From 6ebd2de14ee3d17c0257f4121516d61e0ae77152 Mon Sep 17 00:00:00 2001 From: Rishi Mehta Date: Thu, 19 Mar 2026 12:24:29 +0530 Subject: [PATCH 01/48] chore: ignore .worktrees directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ca2137dc16..923742b631 100644 --- a/.gitignore +++ b/.gitignore @@ -74,3 +74,4 @@ ui.tests/test-module/**/*.cy.json # Agent working artifacts docs/superpowers/ +.worktrees/ From 4e83d24719cb29232aeeff8fb2f68dfe92ca76d4 Mon Sep 17 00:00:00 2001 From: Rishi Mehta Date: Thu, 19 Mar 2026 12:30:09 +0530 Subject: [PATCH 02/48] docs: add base, field and container JCR authoring schema YAML files Co-Authored-By: Claude Sonnet 4.6 --- docs/authoring-schema/README.md | 55 ++++ .../base.authoring.schema.yaml | 298 ++++++++++++++++++ .../container.authoring.schema.yaml | 21 ++ .../field.authoring.schema.yaml | 157 +++++++++ 4 files changed, 531 insertions(+) create mode 100644 docs/authoring-schema/README.md create mode 100644 docs/authoring-schema/base.authoring.schema.yaml create mode 100644 docs/authoring-schema/container.authoring.schema.yaml create mode 100644 docs/authoring-schema/field.authoring.schema.yaml diff --git a/docs/authoring-schema/README.md b/docs/authoring-schema/README.md new file mode 100644 index 0000000000..48a3393111 --- /dev/null +++ b/docs/authoring-schema/README.md @@ -0,0 +1,55 @@ +# Authoring Schema + +This directory contains YAML-based JSON Schema Draft 7 files documenting +the JCR properties that the Edit Dialog writes for each Adaptive Form +component and that the corresponding Sling Model consumes. + +## Why separate from af2-docs schema? + +`af2-docs/schema/` describes the **runtime JSON model** that the AF2 runtime +receives. This directory describes the **JCR authoring layer** — what an AEM +author actually stores in the content repository. + +## Structure + +``` +docs/authoring-schema/ +├── base.authoring.schema.yaml # All components (AbstractFormComponentImpl + AbstractBaseImpl) +├── field.authoring.schema.yaml # All field/leaf components (AbstractFieldImpl) +├── container.authoring.schema.yaml # Panel/container components +└── components/ + ├── textinput.authoring.schema.yaml + ├── dropdown.authoring.schema.yaml + └── ... # One file per component +``` + +## Reading the schemas + +Each property entry includes: +- **type** — JSON Schema / JCR type +- **title** — human-readable property name as shown in the dialog +- **description** — behavior notes including JCR property name (e.g. `fd:emptyValue`) +- **default** — value used when the property is absent from the JCR node +- **enum** (where applicable) — allowed values + +## Child nodes + +`fd:rules` and `fd:events` are JCR child nodes, not flat properties. They appear +in the base schema under those keys with documentation of their internal structure. + +- **`fd:rules`**: contains runtime rule expressions (String), visual rule editor AST (String[]), and rule editor metadata (`validationStatus`). The web runtime only reads the plain property-name keys (visible, required, etc.). +- **`fd:events`**: contains event handler expressions. Keys are event names (click, change, etc.); values are String or String[]. Custom events use `custom_eventName` in JCR (renamed to `custom:eventName` at read time). + +## Type mapping + +| JCR Type | JSON Schema type | +|------------|---------------------| +| Boolean | boolean | +| String | string | +| String[] | array of string | +| Long | integer | +| Double | number | +| Date | string (date-time) | + +> **Note**: Legacy JCR content may store Boolean properties (e.g. `required`, `hideTitle`, +> `dorExclusion`) as String `"true"`/`"false"`. Sling auto-coerces these transparently. diff --git a/docs/authoring-schema/base.authoring.schema.yaml b/docs/authoring-schema/base.authoring.schema.yaml new file mode 100644 index 0000000000..4742f81d28 --- /dev/null +++ b/docs/authoring-schema/base.authoring.schema.yaml @@ -0,0 +1,298 @@ +$id: base.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: Base JCR Authoring Properties +description: >- + Properties common to ALL adaptive form components, derived from + AbstractFormComponentImpl and AbstractBaseImpl. These are written to + the component's JCR node by the Edit Dialog and consumed by Sling Models. +type: object +properties: + # --- Identity & binding --- + name: + type: string + title: Field name / data key + description: Submitted as data key unless overridden by dataRef. + dataRef: + type: ["string", "null"] + title: Data binding JSON-path + description: >- + JSON-path of the data value this field binds to, relative to the parent's + dataRef. Use null to opt out of data binding. + id: + type: string + title: HTML id override + description: Overrides the auto-generated component id. + fieldType: + type: string + title: Widget field type + description: >- + Maps to the runtime fieldType. Usually hard-coded per component via + getFieldType() in the Sling model. + enum: + - text-input + - number-input + - date-input + - datetime-input + - file-input + - multiline-input + - drop-down + - radio-group + - checkbox-group + - checkbox + - switch + - plain-text + - button + - panel + - image + - email + - captcha + - tel + + # --- Visibility / Interaction --- + visible: + type: boolean + title: Visible + description: >- + Whether the field is visible on initial render. When absent from JCR the + Sling model returns null and the AF2 runtime applies its own default (true). + Do NOT set this to document the runtime default — only present when authored. + enabled: + type: boolean + title: Enabled + description: >- + Whether the field is enabled. When absent from JCR the Sling model returns + null (JsonInclude.NON_NULL) and the runtime applies its own default (true). + Disabled fields do not participate in rules but can still have custom events. + + # --- Labels & Description --- + "jcr:title": + type: string + title: Field label + description: The visible label rendered next to the field. + hideTitle: + type: boolean + title: Hide label + default: false + description: When true the label is hidden but still available to screen readers. + isTitleRichText: + type: boolean + title: Label is rich text + default: false + description: + type: string + title: Long description / help text + description: >- + Rendered as short/long description. Supports rich text. Used as help + text for individual fields or top-level description for panels. + tooltip: + type: string + title: Tooltip text + description: Shown in a popover when the user clicks the question-mark icon. + tooltipVisible: + type: boolean + title: Show tooltip icon + default: false + + # --- Data type --- + type: + type: string + title: Data type + description: >- + The data type this field captures. Coerced to this type on submit. + enum: + - string + - number + - integer + - boolean + - "string[]" + - "number[]" + - "boolean[]" + - file + - "file[]" + - object + - array + + # --- Validation --- + required: + type: boolean + title: Required + default: false + description: >- + Whether a value is required. Note: legacy JCR content may store this as + String "true"/"false" — Sling auto-coerces to Boolean transparently. + mandatoryMessage: + type: string + title: Required constraint message + validationExpression: + type: string + title: Custom validation expression (json-formula) + description: A json-formula expression that returns true when the value is valid. + validateExpMessage: + type: string + title: Custom validation expression error message + + # --- Accessibility --- + assistPriority: + type: string + title: Assistive technology priority + description: Determines which text the screen reader announces for this field. + enum: [description, title, name, custom] + custom: + type: string + title: Custom assistive text + description: Used when assistPriority is set to "custom". + + # --- Repeatability --- + repeatable: + type: boolean + title: Repeatable + default: false + minOccur: + type: integer + title: Minimum occurrences (deprecated; prefer minItems) + maxOccur: + type: integer + title: Maximum occurrences (deprecated; prefer maxItems) + minItems: + type: integer + title: Minimum instances of a repeatable field/panel + maxItems: + type: integer + title: Maximum instances of a repeatable field/panel + minItemsMessage: + type: string + title: Min items constraint message + maxItemsMessage: + type: string + title: Max items constraint message + uniqueItemsMessage: + type: string + title: Unique items constraint message + + # --- DOR (Document of Record) --- + dorExclusion: + type: boolean + title: Exclude from DOR + default: false + description: >- + Note: legacy JCR content may store this as String "true"/"false" — + Sling auto-coerces to Boolean transparently. + dorColspan: + type: string + title: DOR column span + description: >- + Stored as JCR String in AbstractFormComponentImpl (PN_DOR_COLSPAN). + dorBindRef: + type: string + title: DOR data binding ref + dorExcludeTitle: + type: boolean + title: Exclude title from DOR + default: false + dorExcludeDescription: + type: boolean + title: Exclude description from DOR + default: false + dorNumCols: + type: integer + title: DOR number of columns + dorLayoutType: + type: string + title: DOR layout type + dorTemplateRef: + type: string + title: DOR template path + dorType: + type: string + title: DOR type + "fd:formType": + type: string + title: DOR template type + + # --- Localization --- + lang: + type: string + title: Language for field formatting + description: >- + BCP 47 language tag (e.g. "en-US", "de-DE") used for date/number formatting. + langDisplayValue: + type: string + title: Language display value + + # --- Internal rendering --- + "fd:channel": + type: string + title: Rendering channel + description: >- + Internal property injected by AbstractComponentImpl (@JsonIgnore — not in JSON model output). + Propagated to children by AbstractContainerImpl for print vs. web rendering selection. + Authors do not typically set this directly. + + # ----------------------------------------------------------------------- + # CHILD NODES (not flat properties — stored as separate JCR nodes) + # These are read via resource.getChild(...) in AbstractFormComponentImpl + # ----------------------------------------------------------------------- + "fd:rules": + type: object + title: Rules child node + description: >- + A JCR child node named "fd:rules" directly under the component node. + Contains three categories of data: + (A) Runtime rule expressions (String, plain property-name keys) — returned by getRules() + and appear in the JSON model "rules" key. Valid keys: visible, required, enabled, + readOnly, value, label, enum, enumNames, minimum, maximum, exclusiveMinimum, + exclusiveMaximum, description. + (B) Visual rule editor AST (String[], fd:-prefixed keys) — written by the rule editor + UI, ignored by the web runtime model. Keys: fd:click, fd:validate, fd:valueCommit, + fd:format, fd:formReady, fd:layoutReady, fd:docReady, fd:calc, fd:init, fd:indexChange. + Values are arrays of JSON-encoded AST blobs. + (C) Rule editor metadata: validationStatus (String "none"|"valid"|"invalid"). + Do NOT document as a flat property — document as a child node. + properties: + validationStatus: + type: string + enum: ["none", "valid", "invalid"] + description: Internal rule editor validity marker. Written by the rule editor UI. + additionalProperties: + oneOf: + - type: string + description: A json-formula rule expression (category A — runtime rules). + - type: array + items: + type: string + description: JSON-encoded AST blob array (category B — visual rule editor, ignored by runtime). + + "fd:events": + type: object + title: Events child node + description: >- + A JCR child node named "fd:events" directly under the component node. + Each property inside is an event name to handler expression (String or String[]). + Valid event names: click, submit, initialize, load, change, submitSuccess, submitError. + Custom events are stored with underscores instead of colons (JCR restriction): + "custom:foo" is stored as "custom_foo" in JCR, renamed at read time. + Do NOT document as a flat property — document as a child node. + additionalProperties: + oneOf: + - type: string + description: A single json-formula handler expression. + - type: array + items: + type: string + description: Multiple json-formula handler expressions executed in order. + + # --- View type --- + "fd:viewType": + type: string + title: Custom rendering hint + description: >- + Optional. When set, the AF2 runtime uses this value to select an alternate + component renderer. Present in AbstractFormComponentImpl as PN_VIEWTYPE. + + # --- Data binding behavior --- + unboundFormElement: + type: boolean + title: Unbound form element + description: >- + When true forces dataRef = null regardless of the dataRef property value. + Present in AbstractFormComponentImpl as PN_UNBOUND_FORM_ELEMENT. diff --git a/docs/authoring-schema/container.authoring.schema.yaml b/docs/authoring-schema/container.authoring.schema.yaml new file mode 100644 index 0000000000..193ca20b08 --- /dev/null +++ b/docs/authoring-schema/container.authoring.schema.yaml @@ -0,0 +1,21 @@ +$id: container.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: Container JCR Authoring Properties +description: >- + Properties for container (panel) components derived from AbstractContainerImpl. + Extends base.authoring.schema. +allOf: + - $ref: ./base.authoring.schema.yaml + - type: object + properties: + lazy: + type: boolean + title: Lazy load children + description: >- + When true the container defers loading its children until the user + navigates to it. Requires fragmentPath to be set. + fragmentPath: + type: string + title: Fragment path (for lazy containers) + description: >- + Path to a fragment definition when lazy=true. diff --git a/docs/authoring-schema/field.authoring.schema.yaml b/docs/authoring-schema/field.authoring.schema.yaml new file mode 100644 index 0000000000..22763ee645 --- /dev/null +++ b/docs/authoring-schema/field.authoring.schema.yaml @@ -0,0 +1,157 @@ +$id: field.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: Field JCR Authoring Properties +description: >- + Properties for all leaf field components (text-input, number-input, etc.), + derived from AbstractFieldImpl. Extends base.authoring.schema. +allOf: + - $ref: ./base.authoring.schema.yaml + - type: object + properties: + # --- Interaction --- + readOnly: + type: boolean + title: Read-only + default: false + + # --- Default & empty value --- + default: + title: Default value + description: >- + Initial value when the form loads without pre-fill data. Type must + match the field's `type` property. Stored as JCR multi-value property. + oneOf: + - type: ["string", "number", "boolean"] + - type: array + items: + type: ["string", "number", "boolean"] + "fd:multiDefaultValues": + title: Multi-value default (options fields) + description: >- + Used by AbstractOptionsFieldImpl for options fields (dropdown, checkboxgroup, etc.) + where the default is a multi-value selection. Stored as JCR multi-value property. + Distinct from `default` which is used on non-options fields. + type: array + items: + type: ["string", "number", "boolean"] + + "fd:emptyValue": + type: string + title: Empty value + description: >- + Value submitted when the user leaves the field empty. + Stored as JCR String. Sling model maps to EmptyValue enum. + enum: ["null", "undefined", ""] + + # --- Placeholder --- + placeholder: + type: string + title: Placeholder text + description: Ghosted hint text shown inside the empty widget. + + # --- Formats --- + displayFormat: + type: string + title: Display format + description: >- + Format pattern for displaying the value to the user (e.g. date/number + locale format). + "fd:customDisplayFormat": + type: string + title: Custom display format (overrides displayFormat) + description: >- + Freeform display format clause. When present it overrides displayFormat. + editFormat: + type: string + title: Edit format + description: Format pattern for value entry (e.g. German number separators). + displayValueExpression: + type: string + title: Display value expression (json-formula) + description: >- + A json-formula expression whose result is shown in the field instead of + the raw value. Useful for masking, formatting computed display. + dataFormat: + type: string + title: Data / submission format + description: Format in which the value is exported or submitted. + + # --- String constraints --- + minLength: + type: integer + title: Minimum length + maxLength: + type: integer + title: Maximum length + minLengthMessage: + type: string + title: Min length constraint message + maxLengthMessage: + type: string + title: Max length constraint message + pattern: + type: string + title: Regex validation pattern + validatePictureClauseMessage: + type: string + title: Pattern constraint message + + # --- Number / Date constraints --- + minimum: + title: Minimum value (inclusive) + description: Stored as String or Long. Accepts number or ISO date string. + oneOf: + - type: number + - type: string + maximum: + title: Maximum value (inclusive) + description: Stored as String or Long. + oneOf: + - type: number + - type: string + exclusiveMinimum: + type: boolean + title: Exclusive minimum flag + default: false + description: >- + JCR authoring layer stores this as a Boolean flag (true = exclusive). + Note: the af2-docs runtime schema types exclusiveMinimum/exclusiveMaximum as + number|date values (Draft 7 style). The JCR layer uses boolean flags and the + Sling model (AbstractFieldImpl) has @Default(booleanValues=false). These are + reconciled by the model's getMaximum()/getMinimum() methods. + exclusiveMaximum: + type: boolean + title: Exclusive maximum flag + default: false + description: See exclusiveMinimum note above. + minimumDate: + type: string + title: Minimum date (JCR Date property) + format: date-time + maximumDate: + type: string + title: Maximum date (JCR Date property) + format: date-time + minimumDateTime: + type: string + title: Minimum date-time (string) + maximumDateTime: + type: string + title: Maximum date-time (string) + minimumMessage: + type: string + title: Minimum constraint message + maximumMessage: + type: string + title: Maximum constraint message + + # --- Format / type constraint messages --- + typeMessage: + type: string + title: Type constraint message + formatMessage: + type: string + title: Format constraint message + stepMessage: + type: string + title: Step constraint message From 45471529d725b9d06bb70d8abfd82fffa9744684 Mon Sep 17 00:00:00 2001 From: Rishi Mehta Date: Thu, 19 Mar 2026 12:36:50 +0530 Subject: [PATCH 03/48] docs: add authoring schemas and update READMEs for date-type field components Co-Authored-By: Claude Sonnet 4.6 --- .../components/checkbox.authoring.schema.yaml | 30 +++++++ .../checkboxgroup.authoring.schema.yaml | 43 ++++++++++ .../datepicker.authoring.schema.yaml | 27 ++++++ .../components/datetime.authoring.schema.yaml | 22 +++++ .../components/dropdown.authoring.schema.yaml | 48 +++++++++++ .../emailinput.authoring.schema.yaml | 7 ++ .../numberinput.authoring.schema.yaml | 28 ++++++ .../radiobutton.authoring.schema.yaml | 41 +++++++++ .../components/switch.authoring.schema.yaml | 31 +++++++ .../telephoneinput.authoring.schema.yaml | 7 ++ .../textinput.authoring.schema.yaml | 23 +++++ .../form/datepicker/v1/datepicker/README.md | 85 +++++++++++++++---- .../form/datepicker/v2/datepicker/README.md | 85 +++++++++++++++---- .../form/datetime/v1/datetime/README.md | 78 ++++++++++++++--- 14 files changed, 511 insertions(+), 44 deletions(-) create mode 100644 docs/authoring-schema/components/checkbox.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/checkboxgroup.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/datepicker.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/datetime.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/dropdown.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/emailinput.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/numberinput.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/radiobutton.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/switch.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/telephoneinput.authoring.schema.yaml create mode 100644 docs/authoring-schema/components/textinput.authoring.schema.yaml diff --git a/docs/authoring-schema/components/checkbox.authoring.schema.yaml b/docs/authoring-schema/components/checkbox.authoring.schema.yaml new file mode 100644 index 0000000000..7737217628 --- /dev/null +++ b/docs/authoring-schema/components/checkbox.authoring.schema.yaml @@ -0,0 +1,30 @@ +$id: checkbox.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: Checkbox JCR Authoring Properties +description: >- + Properties for the Adaptive Form Checkbox component (checkbox field type). +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + checkedValue: + title: Checked value + description: >- + The value submitted when the checkbox is checked. Type matches the field's + `type` property (string, boolean, or number). + oneOf: + - type: string + - type: boolean + - type: number + uncheckedValue: + title: Unchecked value + description: Value submitted when checkbox is unchecked (only when enableUncheckedValue=true). + oneOf: + - type: string + - type: boolean + - type: number + enableUncheckedValue: + type: boolean + title: Submit value when unchecked + default: false + description: When true, uncheckedValue is submitted when the checkbox is unchecked. diff --git a/docs/authoring-schema/components/checkboxgroup.authoring.schema.yaml b/docs/authoring-schema/components/checkboxgroup.authoring.schema.yaml new file mode 100644 index 0000000000..5589912089 --- /dev/null +++ b/docs/authoring-schema/components/checkboxgroup.authoring.schema.yaml @@ -0,0 +1,43 @@ +$id: checkboxgroup.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: CheckboxGroup JCR Authoring Properties +description: >- + Properties for the Adaptive Form Checkbox Group component (checkbox-group field type). +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + enum: + type: array + title: Option values + items: + type: ["string", "number", "boolean"] + description: Available checkbox values. + enumNames: + type: array + title: Option display labels + items: + type: string + description: Display text for each enum value. + orientation: + type: string + title: Options orientation + description: >- + Layout direction for checkboxes. Injected by CheckBoxGroupImpl (@ValueMapValue). + enum: [horizontal, vertical] + enforceEnum: + type: boolean + title: Enforce enum + default: true + enforceEnumMessage: + type: string + title: Enforce enum constraint message + uniqueItemsMessage: + type: string + title: Unique items constraint message + areOptionsRichText: + type: boolean + title: Options are rich text + description: >- + When true, enumNames are rendered as rich text HTML. + Reserved in ReservedProperties but not currently injected via @ValueMapValue. diff --git a/docs/authoring-schema/components/datepicker.authoring.schema.yaml b/docs/authoring-schema/components/datepicker.authoring.schema.yaml new file mode 100644 index 0000000000..f7dcfa98c5 --- /dev/null +++ b/docs/authoring-schema/components/datepicker.authoring.schema.yaml @@ -0,0 +1,27 @@ +$id: datepicker.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: DatePicker JCR Authoring Properties +description: >- + DatePicker-specific authoring properties. Constraint properties (minimumDate, + maximumDate, exclusiveMinimum, exclusiveMaximum, minimumMessage, maximumMessage) + are inherited from field.authoring.schema. + IMPORTANT: minimumDate/maximumDate are stored as JCR Date properties (not String) + and Sling auto-coerces them to java.util.Date via @ValueMapValue. +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + excludeMinimum: + type: boolean + title: Exclude minimum (backward compat) + default: false + description: >- + Actively injected by DatePickerImpl (@ValueMapValue, @Default false). + Legacy XFA-era property; use exclusiveMinimum for new content. + excludeMaximum: + type: boolean + title: Exclude maximum (backward compat) + default: false + description: >- + Actively injected by DatePickerImpl (@ValueMapValue, @Default false). + Legacy XFA-era property; use exclusiveMaximum for new content. diff --git a/docs/authoring-schema/components/datetime.authoring.schema.yaml b/docs/authoring-schema/components/datetime.authoring.schema.yaml new file mode 100644 index 0000000000..078edb3f88 --- /dev/null +++ b/docs/authoring-schema/components/datetime.authoring.schema.yaml @@ -0,0 +1,22 @@ +$id: datetime.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: DateTime JCR Authoring Properties +description: >- + DateTime-specific authoring properties. DateTimeImpl extends AbstractFieldImpl + directly (not DatePickerImpl), so it does NOT have excludeMinimum/excludeMaximum. + Constraint properties (minimumDateTime, maximumDateTime, minimumMessage, + maximumMessage) are inherited from field.authoring.schema. + IMPORTANT: minimumDateTime/maximumDateTime are stored as JCR String properties + (ISO-8601 offset format), unlike DatePicker's minimumDate/maximumDate which are + JCR Date properties. The model formats them to "yyyy-MM-dd'T'HH:mm" on export. +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + pattern: + type: string + title: DateTime pattern + description: >- + Injected via @ValueMapValue (optional). Internal pattern used for + datetime formatting. Not exposed as a dialog field in v1 but + available as a JCR property. diff --git a/docs/authoring-schema/components/dropdown.authoring.schema.yaml b/docs/authoring-schema/components/dropdown.authoring.schema.yaml new file mode 100644 index 0000000000..f69cac18fd --- /dev/null +++ b/docs/authoring-schema/components/dropdown.authoring.schema.yaml @@ -0,0 +1,48 @@ +$id: dropdown.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: Dropdown JCR Authoring Properties +description: >- + Properties for the Adaptive Form Dropdown component (drop-down field type). + Enum/options properties come from AbstractOptionsFieldImpl. +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + enum: + type: array + title: Option values + items: + type: ["string", "number", "boolean"] + description: Available values. Type must match the field's `type` property. + enumNames: + type: array + title: Option display labels + items: + type: string + description: Display text for each enum value. Length must match enum array. + multiSelect: + type: boolean + title: Multi-select + default: false + description: >- + When true the type becomes an array type (e.g. string[]) automatically. + Stored as JCR Boolean; @Default(booleanValues=false) in DropDownImpl. + enforceEnum: + type: boolean + title: Enforce enum + default: true + description: >- + When false, users can type values not in the enum list (enum acts as suggestions only). + enforceEnumMessage: + type: string + title: Enforce enum constraint message + uniqueItemsMessage: + type: string + title: Unique items constraint message + areOptionsRichText: + type: boolean + title: Options are rich text + description: >- + When true, enumNames are rendered as rich text HTML. + Reserved in ReservedProperties but not currently injected via @ValueMapValue — + consumed by client-side rendering. diff --git a/docs/authoring-schema/components/emailinput.authoring.schema.yaml b/docs/authoring-schema/components/emailinput.authoring.schema.yaml new file mode 100644 index 0000000000..36f318ab89 --- /dev/null +++ b/docs/authoring-schema/components/emailinput.authoring.schema.yaml @@ -0,0 +1,7 @@ +$id: emailinput.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: EmailInput JCR Authoring Properties +description: >- + Email Input has no component-specific JCR properties beyond field.authoring.schema. + The fieldType is hard-coded to "email" in EmailInputImpl.getFieldType(). +$ref: ../field.authoring.schema.yaml diff --git a/docs/authoring-schema/components/numberinput.authoring.schema.yaml b/docs/authoring-schema/components/numberinput.authoring.schema.yaml new file mode 100644 index 0000000000..7925d7dc18 --- /dev/null +++ b/docs/authoring-schema/components/numberinput.authoring.schema.yaml @@ -0,0 +1,28 @@ +$id: numberinput.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: NumberInput JCR Authoring Properties +description: >- + NumberInput-specific JCR properties. All field constraints (minimum, maximum, + exclusiveMinimum, exclusiveMaximum, etc.) are inherited from field.authoring.schema. +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + step: + title: Step + description: Value must be a multiple of step. Stored as String or Long in JCR. + oneOf: + - type: number + - type: string + excludeMaximumCheck: + type: boolean + title: Exclude maximum check (backward compat) + description: >- + Actively injected by NumberInputImpl (@ValueMapValue). Legacy XFA-era property; + use exclusiveMaximum for new content. + excludeMinimumCheck: + type: boolean + title: Exclude minimum check (backward compat) + description: >- + Actively injected by NumberInputImpl (@ValueMapValue). Legacy XFA-era property; + use exclusiveMinimum for new content. diff --git a/docs/authoring-schema/components/radiobutton.authoring.schema.yaml b/docs/authoring-schema/components/radiobutton.authoring.schema.yaml new file mode 100644 index 0000000000..eff164a93e --- /dev/null +++ b/docs/authoring-schema/components/radiobutton.authoring.schema.yaml @@ -0,0 +1,41 @@ +$id: radiobutton.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: RadioButton JCR Authoring Properties +description: >- + Properties for the Adaptive Form Radio Button component (radio-group field type). +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + enum: + type: array + title: Option values + items: + type: ["string", "number", "boolean"] + description: Available radio button values. + enumNames: + type: array + title: Option display labels + items: + type: string + description: Display text for each enum value. + orientation: + type: string + title: Options orientation + description: >- + Layout direction for radio buttons. Injected by RadioButtonImpl (@ValueMapValue). + Stored as JCR String. + enum: [horizontal, vertical] + enforceEnum: + type: boolean + title: Enforce enum + default: true + enforceEnumMessage: + type: string + title: Enforce enum constraint message + areOptionsRichText: + type: boolean + title: Options are rich text + description: >- + When true, enumNames are rendered as rich text HTML. + Reserved in ReservedProperties but not currently injected via @ValueMapValue. diff --git a/docs/authoring-schema/components/switch.authoring.schema.yaml b/docs/authoring-schema/components/switch.authoring.schema.yaml new file mode 100644 index 0000000000..5ba6864a2c --- /dev/null +++ b/docs/authoring-schema/components/switch.authoring.schema.yaml @@ -0,0 +1,31 @@ +$id: switch.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: Switch JCR Authoring Properties +description: >- + Properties for the Adaptive Form Switch component (switch field type). + Switch uses the same checked/unchecked value pattern as Checkbox. + SwitchImpl extends AbstractCheckboxImpl; the only behavioral difference is + that enumNames are trimmed to one entry when enableUncheckedValue is false. +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + checkedValue: + title: On value + description: Value submitted when switch is in the "on" state. + oneOf: + - type: string + - type: boolean + - type: number + uncheckedValue: + title: Off value + description: Value submitted when switch is in the "off" state (only when enableUncheckedValue=true). + oneOf: + - type: string + - type: boolean + - type: number + enableUncheckedValue: + type: boolean + title: Submit value when off + default: false + description: When true, uncheckedValue is submitted when the switch is in the off state. diff --git a/docs/authoring-schema/components/telephoneinput.authoring.schema.yaml b/docs/authoring-schema/components/telephoneinput.authoring.schema.yaml new file mode 100644 index 0000000000..f76960c411 --- /dev/null +++ b/docs/authoring-schema/components/telephoneinput.authoring.schema.yaml @@ -0,0 +1,7 @@ +$id: telephoneinput.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: TelephoneInput JCR Authoring Properties +description: >- + Telephone Input has no component-specific JCR properties beyond field.authoring.schema. + The fieldType is hard-coded to "tel" in TelephoneInputImpl.getFieldType(). +$ref: ../field.authoring.schema.yaml diff --git a/docs/authoring-schema/components/textinput.authoring.schema.yaml b/docs/authoring-schema/components/textinput.authoring.schema.yaml new file mode 100644 index 0000000000..8d476cac70 --- /dev/null +++ b/docs/authoring-schema/components/textinput.authoring.schema.yaml @@ -0,0 +1,23 @@ +$id: textinput.authoring.schema +$schema: "http://json-schema.org/draft-07/schema#" +title: TextInput JCR Authoring Properties +description: >- + Properties specific to Adaptive Form Text Input (v1) beyond those in + field.authoring.schema. JCR resource type: core/fd/components/form/textinput/v1/textinput +allOf: + - $ref: ../field.authoring.schema.yaml + - type: object + properties: + multiLine: + type: boolean + title: Allow multiple lines (textarea) + default: false + description: >- + When true the widget renders as a