@chobantonov/jsonforms-extended-spec 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/conformance/authoring.json +511 -0
  2. package/conformance/behavior.json +875 -4
  3. package/conformance/config-consumption.json +13 -2
  4. package/docs/conditional-fields.md +44 -2
  5. package/docs/implementation-guide.md +56 -3
  6. package/docs/implementation-pitfalls.md +167 -1
  7. package/docs/spec.md +156 -7
  8. package/docs/todo.md +17 -0
  9. package/examples/README.md +8 -2
  10. package/examples/additional-errors/README.md +7 -0
  11. package/examples/additional-properties/README.md +15 -0
  12. package/examples/color-control/README.md +4 -1
  13. package/examples/conditional-fields/README.md +11 -3
  14. package/examples/conditional-fields/translations.json +4 -2
  15. package/examples/conditional-fields/uischema.json +67 -7
  16. package/examples/index.js +2 -2
  17. package/examples/label-interpolation/README.md +41 -0
  18. package/examples/label-interpolation/config.json +8 -2
  19. package/examples/label-interpolation/uischema.json +6 -2
  20. package/package.json +1 -1
  21. package/schemas/README.md +8 -3
  22. package/schemas/jsonforms-config.schema.json +1 -1
  23. package/schemas/jsonforms-extended-config.schema.json +5 -0
  24. package/schemas/jsonforms-extended-uischema.schema.json +10 -1
  25. package/schemas/jsonforms-uischema.schema.json +14 -1
  26. package/typescript/README.md +8 -2
  27. package/typescript/lib/authoring/forSchema.d.ts +10 -1
  28. package/typescript/src/authoring/forSchema.ts +10 -1
  29. package/typescript/test/schemaContract.test.ts +12 -0
  30. package/typescript/test/typedAuthoring.test.ts +12 -1
  31. package/typescript/test/typedAuthoringCoverage.test.ts +33 -0
@@ -1325,9 +1325,9 @@
1325
1325
  "path": "config.jsonformsExtended.conditionalFields",
1326
1326
  "status": "consumed",
1327
1327
  "evidence": [
1328
- "packages/jsonforms-react-renderer-common/src/conditionalFields.ts"
1328
+ "packages/jsonforms-react-renderer-common/src/objects/conditionalFields.ts"
1329
1329
  ],
1330
- "finding": "Object controls in React Antd and shadcn resolve local conditionalFields before the namespaced default. Defaults off.",
1330
+ "finding": "Object controls and object-context layout entries in React Antd and shadcn resolve local conditionalFields before the namespaced default. Layout descendants inherit their entry decision. Defaults off; other renderer platforms are unverified for direct layout entries.",
1331
1331
  "declaredBefore": false,
1332
1332
  "declaredAfter": true
1333
1333
  },
@@ -1526,6 +1526,17 @@
1526
1526
  "finding": "Config-only overlay activation and exact in-process trusted function capability; external input remains independent.",
1527
1527
  "declaredBefore": false,
1528
1528
  "declaredAfter": true
1529
+ },
1530
+ {
1531
+ "path": "config.jsonformsExtended.markup.textParamSpans",
1532
+ "status": "pending-implementation",
1533
+ "evidence": [
1534
+ "docs/spec.md#94a-styling-named-substitutions",
1535
+ "schemas/jsonforms-extended-config.schema.json#/$defs/markup/properties/textParamSpans"
1536
+ ],
1537
+ "finding": "Accepted host default, overridden by a Label's options.textParamSpans in either direction; renderer consumption and per-platform support have not been verified in this repository. Non-HTML renderers may document a no-op.",
1538
+ "declaredBefore": false,
1539
+ "declaredAfter": true
1529
1540
  }
1530
1541
  ]
1531
1542
  }
@@ -3,8 +3,29 @@
3
3
  ## Runtime contract
4
4
 
5
5
  Conditional presentation is opt-in: options.conditionalFields on an object
6
- Control overrides config.jsonformsExtended.conditionalFields, default false.
7
- Use an object Control at scope # to opt a whole root object into discovery.
6
+ Control or an object-context layout entry overrides
7
+ config.jsonformsExtended.conditionalFields, default false. A root VerticalLayout,
8
+ HorizontalLayout, Group or Categorization can therefore activate presentation
9
+ without a wrapping Control. Categories and all nested layout variants participate
10
+ in that presentation, including tabs, steppers and accordions. A layout does not
11
+ create a data binding: evaluate against the current object schema and data path,
12
+ not the document root when rendering a nested object or an array item.
13
+
14
+ The first layout at an object boundary owns the option for its layout subtree.
15
+ Resolve its local boolean before the global default; a local false disables that
16
+ projection even when nested layouts omit the option. Descendant layouts inherit
17
+ this decision and cannot reverse a projection already applied at that boundary.
18
+ Category is normally structural content of a Categorization and inherits its
19
+ owner's setting. Configure the Categorization, not an individual Category.
20
+ Object Controls continue to own their own projection and detail layouts.
21
+ A same-object Control can reuse the inherited projection and reserved inactive
22
+ property names; an explicit local false restores its original object schema for
23
+ its own detail. Layout filtering must not enter that Control's options.detail.
24
+ New nested object and array-item boundaries resolve their options independently.
25
+ Ownership is also local to the host form instance. An embedded independent form
26
+ must not inherit another form's projection or disabled state merely because
27
+ both use the root data path.
28
+
8
29
  Existing UI rules and validator behavior are unchanged when omitted.
9
30
 
10
31
  Evaluate if against the current object using the host validator and original
@@ -17,9 +38,22 @@ Schema-valued Draft-07 dependencies activate on property presence, including
17
38
  false, null and empty strings. Array-valued dependencies contribute required
18
39
  markers, not new fields. Active allOf branches contribute conjunctively.
19
40
  Base fields remain visible; active branches may change their required markers.
41
+ For a base field, the required asterisk appears exactly when the base schema or
42
+ an active branch requires it; it disappears when no active constraint requires
43
+ it, subject to the existing hideRequiredAsterisk presentation option. Visibility
44
+ and requiredness are independent. Explicit layouts never acquire extra controls
45
+ from discovery: only authored bindings participate. Generated object details
46
+ continue to discover active fields.
20
47
  Inactive branch-only fields disappear without data deletion or default insertion.
21
48
  Retained inactive properties are reserved from the additional-property editor.
22
49
 
50
+ Moving controls among groups, columns and categories must not change conditional
51
+ semantics or introduce frames. Preserve layout options, regions, rules, order and
52
+ empty authored containers. Apply ordinary UI rules after determining active
53
+ conditional bindings. Project once per owning object boundary, rather than
54
+ reevaluating the same conditions for every nested layout. Never traverse a child
55
+ Control's options.detail as if it belonged to the parent object.
56
+
23
57
  Only the presentation schema is projected. Original document validation remains
24
58
  authoritative, including additionalProperties and branch constraints. Projection
25
59
  must retain overlapping property constraints rather than replace earlier ones.
@@ -68,6 +102,14 @@ by this feature. Keep JSON Schema validation and UI-schema placement separate.
68
102
  categories belong to categorizations, detail layouts use the edited value's
69
103
  scope, and a Slot fallback uses one layout to hold multiple controls.
70
104
 
105
+ ## Acceptance and implementation status
106
+
107
+ The conditional-fields example demonstrates both object-Control and direct-layout
108
+ entry points. The conditional-layout behavior vectors are portable acceptance
109
+ inputs, not executed renderer tests. Direct-layout support is being implemented
110
+ for React only; other renderer platforms are unverified for this extension.
111
+ Record real registry test results in each renderer repository.
112
+
71
113
  ## Follow-up priorities
72
114
 
73
115
  1. More conditional compositions and named-template placement coverage.
@@ -18,7 +18,7 @@ The specification and renderer acceptance guide govern requirements. This guide
18
18
  - Typed JSON values, literal keys, schema constraints and data paths.
19
19
  - Renderer selection, option precedence and supported authoring capabilities.
20
20
  - Field labels, descriptions, local errors, container errors and action placement.
21
- - Confirmation, selection, editing, focus and keyboard behavior.
21
+ - Confirmation, selection, editing, focus and keyboard behavior. Independent informational overlays must not acquire dismissal ownership over edit dialogs merely through native stack order.
22
22
  - Translated built-in and authored text, including error overrides.
23
23
  - Search and sorting based on displayed summaries where specified.
24
24
  - Responsive containment, collection boundaries and pagination placement.
@@ -161,8 +161,14 @@ duplicate-name diagnostics and cycle protection against the normative requiremen
161
161
  ## Conditional fields
162
162
 
163
163
  See [conditional field presentation and graphical authoring](conditional-fields.md).
164
- Use `options.conditionalFields: true` on an object Control or the default
165
- `config.jsonformsExtended.conditionalFields`. Local false opts out.
164
+ Use `options.conditionalFields: true` on an object Control or an object-context
165
+ layout entry (VerticalLayout, HorizontalLayout, Group or Categorization), or use
166
+ `config.jsonformsExtended.conditionalFields` as the default. Local false opts out.
167
+ The entry owns the projection for descendant layouts and Categories at that
168
+ object boundary. Nested object and array-item boundaries resolve independently.
169
+ Explicit layouts preserve placement and update conditional required indicators
170
+ without generating extra controls. See the conditional-fields contract for
171
+ ownership, validation, examples and platform support limits.
166
172
 
167
173
 
168
174
  ## Choice-card branch details
@@ -178,3 +184,50 @@ The choice-controls Card detail modes example covers generation with a matching
178
184
  registry, registry selection and fallback, inline layouts, and editing a nested
179
185
  value. Check the example in English and Bulgarian, including registry fallback
180
186
  for Postal mail.
187
+
188
+
189
+ ## Comparable renderer contract tests
190
+
191
+ Maintain matching behavioral cases for each supported renderer family. Shared
192
+ helper tests establish the helper policy, while renderer integration tests must
193
+ also verify that the real registry supplies the context, options, validator and
194
+ callbacks required to apply it. Use the same input data, option-precedence cases,
195
+ expected committed values and cancellation outcomes across families. Adapt widget
196
+ selectors and host wrappers to each UI library.
197
+
198
+ Exercise non-default states as well as initial rendering. Include clearing by
199
+ button and by deleting text, literal dynamic keys, referenced isolated schemas,
200
+ confirmation accept/cancel and policy overrides, locale changes, external data
201
+ replacement, focus retention, array reorder/deletion, and temporal serialization
202
+ and bounds. Rendering an example establishes only the assertions executed by that
203
+ test. Record missing renderer or browser interaction coverage explicitly.
204
+
205
+
206
+ ## Verify native adapter policy boundaries
207
+
208
+ After testing shared logic, execute the same operation through each native registry.
209
+ Check script permission and pending action behavior, batch deletion confirmation,
210
+ and accessible unset/invalid primitive status. A rendering slot does not imply its
211
+ operation policy is connected. See [adapter boundaries](implementation-pitfalls.md#adapter-boundaries-must-retain-operation-semantics)
212
+ and the proposed `adapter-operation-policy` and `primitive-presence-presentation`
213
+ vectors. Record actual host test results separately from proposed vectors.
214
+
215
+
216
+ ## Host styling hooks depend on the rendering platform
217
+
218
+ Implement the contracts in [§5.7](spec.md#57-host-styling-markers) and
219
+ [§9.4a](spec.md#94a-styling-named-substitutions) at the layout-slot and Label
220
+ text boundaries. Keep host CSS separate from the form definition. A DOM host
221
+ needs access to the relevant styling boundary; document Shadow Root limits.
222
+ A native or canvas renderer may expose equivalent names or document a no-op.
223
+ Do not infer support from the implementation language or report a no-op as
224
+ implemented CSS hooks.
225
+
226
+ Compare marker-enabled and marker-disabled Markdown output after unwrapping
227
+ only generated spans. Preserve parsing and URL decisions, and use unmarked
228
+ output if equivalence is uncertain. Resolve the Label's own `options.textParamSpans`
229
+ before the host default and then false; explicit false must survive option
230
+ merging. The host default is not a permission gate, and layout options do not
231
+ cascade. Skip tracking and additional parsing when the effective value is false. See the [pitfall](implementation-pitfalls.md#host-styling-markers-must-not-change-content)
232
+ and the acceptance cases in the [Label example](../examples/label-interpolation/README.md).
233
+ Renderer support remains unverified until an adapter executes the cases.
@@ -98,6 +98,25 @@ Companion to the [implementation guide](implementation-guide.md). These entries
98
98
 
99
99
  **Behavior:** Keep the edited control mounted where practical; preserve caret, focus and selection while values and errors update. Stable identity must not freeze stale summaries or callbacks.
100
100
 
101
+ **Unavailable focus targets:** A web platform can keep its active element on a
102
+ connected control after that control becomes hidden, native-disabled, or inert.
103
+ Focus recovery must recognize that unavailable owned target, rather than relying
104
+ only on focus falling back to the document body. Read focus from the owning
105
+ Shadow Root where applicable. If the user has moved focus to another available
106
+ control, preserve that newer ownership instead of reclaiming it.
107
+
108
+ Native controls can synchronously update framework state from blur handlers.
109
+ Release a retiring header's focus at a safe lifecycle boundary before hiding or
110
+ removing it. A queued transition must not blur a newer focus owner. Keep native
111
+ items, displayed labels, and selection consistent during the transition.
112
+
113
+ **Additional manual acceptance:** Focus a category header, then hide that category
114
+ while retaining its disabled header in the DOM. Move focus to the selected
115
+ available category. Repeat after moving focus outside the form before hiding the
116
+ category; outside focus must remain untouched. For web renderers, check both
117
+ document and Shadow Root hosts. This is a portable acceptance case, not a claim
118
+ that every renderer adapter has executed it.
119
+
101
120
  **Check:** Type several characters while validation changes and filtering is enabled. No dropped characters, focus jumps or stale values. Keyboard focus remains visible; pointer selection does not require an extra persistent focus ring.
102
121
 
103
122
  ## P13 — Array positions and missing values need care
@@ -132,6 +151,25 @@ Companion to the [implementation guide](implementation-guide.md). These entries
132
151
 
133
152
  **Check:** Light/dark themes, narrow form pane, many tabs, keyboard-only navigation and long translated labels. Avoid unnecessary vertical scrolling in horizontal tab bars.
134
153
 
154
+ A dark theme may inherit a destructive token intended for a filled button
155
+ background. When that token also colors validation text and borders, it must
156
+ have readable contrast against the form surface. Check the actual error
157
+ message, invalid border and indicator in both direct and Web Component hosts;
158
+ do not infer text contrast from the button appearance.
159
+
160
+ **Native writing direction:** A widget can force LTR through its own default
161
+ context even inside an RTL container. Text language and writing direction are
162
+ independent: an English form can still be presented RTL. Forward the effective
163
+ container direction into native widget state, including live host changes,
164
+ so arrow-key navigation agrees with the displayed order rather than changing
165
+ CSS alone.
166
+
167
+ **Additional manual acceptance:** Render radio choices and rich cards in an
168
+ English RTL container. Verify the RTL arrow-key order, then switch the same
169
+ container to LTR and verify both the layout and native direction update. Repeat
170
+ in a Shadow Root. These are portable acceptance cases; executable coverage is
171
+ owned by each renderer adapter.
172
+
135
173
  ## P17 — Rich choices and summaries retain security boundaries
136
174
 
137
175
  **Trap:** Treat custom markup/images as trusted because they occur inside a choice card, or enable broader expression/data access during filtering.
@@ -148,6 +186,24 @@ Companion to the [implementation guide](implementation-guide.md). These entries
148
186
 
149
187
  **Check:** Mount, update schema/data/locale, disconnect and reconnect. Use the packaged implementation as well as source tests. Test nullable and recursive data without automatically materializing infinite children.
150
188
 
189
+ ### Independent overlays do not inherit dismissal ownership
190
+
191
+ **Trap:** Treat every later-opened overlay as a child of an earlier overlay
192
+ because a native layer manager orders them that way. Closing a validation
193
+ popover can then dismiss an independent property editor while the user types.
194
+
195
+ **Behavior:** Preserve logical ownership when adapting native overlay stacks.
196
+ An informational popup closing must not cancel an independent edit dialog or
197
+ discard its draft. Retain explicit Cancel, accept, Escape and actual owner
198
+ teardown behavior, including focus restoration in document and shadow hosts.
199
+
200
+ **Proposed acceptance case:** Pin a property-name validation popup, open Rename
201
+ for that property, and change the draft until its validation message changes.
202
+ Let the informational popup close; Rename remains open with the draft intact.
203
+ Cancel, verify focus returns to the opener, reopen, and accept a valid name.
204
+ Repeat with translated messages and an isolated component host. This is a
205
+ proposed interaction case, not evidence that any renderer has executed it.
206
+
151
207
  ## Dynamic overlays preserve typed values and committed data
152
208
 
153
209
  **Trap:** Treat a CEL integer as a JavaScript number without checking its range,
@@ -767,7 +823,10 @@ summary, clear meaning, and draft behavior should agree across renderers.
767
823
 
768
824
  A color picker should expose a labeled Clear value action at the bottom of
769
825
  its app-owned panel when a value is present and clearing is allowed. It must
770
- use the same empty-value contract as the field-level clear action. Opening the
826
+ use the same empty-value contract as the field-level clear action. After
827
+ clearing, its channel and alpha inputs should show no stale value. Changing the
828
+ channel view alone must not commit a fallback color; the next deliberate picker
829
+ edit can establish a new one. Opening the
771
830
  field's picker should reveal the color-selection controls immediately; a large
772
831
  native color-input swatch inside an app popover creates a second dialog when
773
832
  activated. A browser-native color dialog cannot host application buttons, so a
@@ -775,6 +834,19 @@ renderer that needs Clear value in the picker should use an app-owned spectrum
775
834
  and controls in that single panel. A renderer that uses a native dialog instead
776
835
  must expose clear separately and record that platform limitation.
777
836
 
837
+ A composable picker may normalize an unset or invalid value to a default color
838
+ when it mounts. Keep that preview inside the picker until the user edits it;
839
+ opening the panel must not overwrite the form value or clear an invalid imported
840
+ string. Bind channel-view changes separately from the configured save format,
841
+ and use the shared parser and serializer when a selection is committed. If a
842
+ separate alpha field makes the picker hide alpha in its hex field, keep the
843
+ alpha field visible and preserve its value through view changes.
844
+
845
+ **Check:** Open empty and invalid imported colors, then switch HEX/RGB/HSB
846
+ views without editing; stored data must remain unchanged. Change a channel and
847
+ verify the configured save format and alpha survive. Reopen the picker and
848
+ confirm that its initial view matches the configured format.
849
+
778
850
  **Check:** Open a duration with at least two units. Compare the numeric input
779
851
  and Remove unit button centers; compare the input right edges and label start
780
852
  edges across rows. Activate Remove Hours and verify that the draft loses the
@@ -800,3 +872,97 @@ Activate the field's picker and verify that saturation, hue and channel editing
800
872
  are usable immediately, without activating another swatch or opening a second
801
873
  dialog. Use pointer and keyboard editing, then clear from the same panel.
802
874
  Test the footer action and the color-selection surface through each renderer.
875
+
876
+
877
+ ## Clearing a dynamic property keeps its editor
878
+
879
+ Dynamic rows are discovered from keys present in form data. Delegated controls
880
+ that map an empty input or clear action to undefined can therefore remove the
881
+ row through the form core update handling. Communicate dynamic-property context
882
+ to the delegated editor and preserve the property at its exact path. A cleared
883
+ string stores an empty string even when its schema has a nonempty default.
884
+ Apply the same rule when literal keys require isolated editors. Nested declared
885
+ fields keep their ordinary clear semantics. Delete remains an explicit action
886
+ on the containing object.
887
+
888
+ Proposed acceptance cases are described in the
889
+ [additional-properties walkthrough](../examples/additional-properties/README.md).
890
+ Host execution is required to establish renderer support.
891
+
892
+
893
+ ## Adapter boundaries must retain operation semantics
894
+
895
+ A native component adapter can render a shared feature successfully while omitting
896
+ its operation policy. Reimplementing Button activation can lose script permission,
897
+ ActionEvent normalization and pending-promise semantics. Supplying a grid frame and
898
+ icons without the deletion-policy adapter can silently skip confirmation for a
899
+ batch. Compare real registry interactions across renderer sets, including the host
900
+ callback and stored data, rather than treating shared factory unit tests or example
901
+ mounts as evidence that the adapter wired those behaviors.
902
+
903
+ Primitive status is another adaptation boundary. A switch has no indeterminate
904
+ state, so expose a localized, associated description for unset and invalid values.
905
+ A null control distinguishes explicit null, absence and an invalid imported value;
906
+ it must not normalize any of them merely by mounting. Preserve these distinctions
907
+ in cells as well as ordinary controls.
908
+
909
+ Proposed acceptance vectors are `adapter-operation-policy` and
910
+ `primitive-presence-presentation` in `conformance/behavior.json`. They require host
911
+ execution; adding the vectors does not certify a renderer. Exercise a pending Button
912
+ action, a disallowed string script, cancellation and acceptance of batch deletion,
913
+ and external primitive data replacement through each real renderer registry.
914
+
915
+
916
+ ## Host styling markers must not change content
917
+
918
+ **Trap:** Insert tracking characters before Markdown parsing and assume they
919
+ cannot affect delimiters. Compare only plain text, losing a changed emphasis
920
+ node or link target. Require HTML spans from a canvas renderer, or derive
921
+ styling names from translated strings or data paths. Treat the host's false
922
+ as a permission gate, or use boolean OR merging and lose a Label's explicit false.
923
+
924
+ **Behavior:** Treat parts and named substitution hooks as optional platform
925
+ integrations. On HTML, normalize authored part tokens onto existing layout
926
+ slots; root and direct dispatch without slots do not acquire wrappers.
927
+ For Label substitutions, preserve the parsed structure as well as text and URL
928
+ policy. Internal boundary markers must never leak, corrupt user characters,
929
+ or reach URL validation. Fall back to unmarked Label output when equivalence
930
+ cannot be guaranteed. Resolve the Label's own boolean before the host default,
931
+ then false. Omission inherits; local false disables a host true and local true
932
+ overrides a host false. Disabled hooks skip tracking and extra parsing. Native
933
+ callbacks and annotated ranges are optional; a documented no-op preserves the
934
+ form's meaning and is not evidence of marker support.
935
+
936
+ **Check:** Run the `styling-*` vectors in `conformance/behavior.json` through a
937
+ real adapter. Compare on/off output after removing only generated spans, with
938
+ punctuation near emphasis, adjacent/repeated values, code, line breaks, literal
939
+ private-use characters, safe and refused URLs, and translated parameter order.
940
+ Check all local/host true, false and omitted combinations, then change the
941
+ host default and remove a local override while mounted. Check nested slots,
942
+ root and region dispatch, invalid tokens, and unchanged accessibility and interaction. Exercise a documented canvas no-op separately.
943
+ These are acceptance inputs; this repository does not execute renderer tests.
944
+
945
+
946
+ ## Conditional requiredness belongs to the object, not the layout widget
947
+
948
+ **Trap:** Update required indicators only for generated object Controls, or
949
+ re-evaluate against document-root data when a layout is reused inside an object
950
+ or array item. Treating requiredness as visibility hides base fields. Flattening
951
+ all conditions into the validation schema changes document validity.
952
+
953
+ **Behavior:** Project the current object's presentation once at its owning
954
+ Control or layout entry. All descendant layout containers use that projection;
955
+ base fields stay visible while their conditional required indicators change.
956
+ Entry-local false overrides the global default for that layout subtree. Nested
957
+ object Controls and array items have independent boundaries. Host form instances
958
+ also remain independent even when their data paths are identical; an isolated
959
+ editor must not inherit the enclosing form's disabled projection. Preserve authored
960
+ placement, UI rules, regions and inactive data; validate the original document.
961
+ Do not cross Control detail boundaries while filtering a parent layout.
962
+
963
+ **Check:** Run the conditional-layout vectors through each actual renderer
964
+ registry, across vertical/horizontal/group and categorization variants. Toggle
965
+ the discriminator by editing and external data replacement, with validation on
966
+ and off. Check base-required fields, branch-only fields, retained values, local
967
+ opt-out, nested objects and distinct array items. Keep authoring validation tests
968
+ and proposed behavior vectors separate from executed renderer certification.
package/docs/spec.md CHANGED
@@ -164,7 +164,8 @@ A worked shape:
164
164
  "security": { "allowScriptEvaluation": false },
165
165
  "markup": {
166
166
  "markdown": { "enabled": true, "profile": "basic" },
167
- "typography": true
167
+ "typography": true,
168
+ "textParamSpans": false
168
169
  },
169
170
  "confirmation": { "default": "always" },
170
171
  "showValidationIndicator": true
@@ -498,6 +499,68 @@ indeterminate. A group that renders individual controls rather than a grouping
498
499
  component MUST still declare a grouping role, or there is nothing for the
499
500
  orientation to describe.
500
501
 
502
+ ### 5.7 Host styling markers
503
+
504
+ `options.part` supplies stable, authored names that a host can select when
505
+ styling an element. It applies to any element type, including registered custom
506
+ types. It adds no default appearance, behavior, role or accessibility state.
507
+ Renderers MUST NOT assign built-in styles or actions based on these names.
508
+ The host supplies any styling separately.
509
+
510
+ ```json
511
+ {
512
+ "type": "VerticalLayout",
513
+ "elements": [
514
+ { "type": "Label", "text": "Membership summary", "options": { "part": "summary prominent" } },
515
+ { "type": "Label", "text": "Membership can be changed at any time.", "options": { "part": "supporting-note" } }
516
+ ]
517
+ }
518
+ ```
519
+
520
+ The authoring value is a string of whitespace-separated tokens. Each token
521
+ matches `[A-Za-z][A-Za-z0-9_-]*`; names are case-sensitive. Empty and
522
+ whitespace-only strings are allowed and supply no marker. Authoring validation
523
+ rejects other tokens and non-string values. As defensive handling of unchecked
524
+ input, a renderer MUST ignore a non-string value, discard invalid tokens,
525
+ remove duplicates while preserving first-occurrence order, and join remaining
526
+ tokens with a single space. No remaining tokens means no marker.
527
+ Whitespace here means the `\s` character class used by the published schemas.
528
+
529
+ For an HTML renderer implementing this capability, the normalized value MUST
530
+ be emitted as `data-part` on the child's layout slot: the existing wrapper
531
+ through which its parent layout assigns space. A nested layout's own marker
532
+ belongs on its slot in its parent, not on its children. Use token selectors:
533
+
534
+ ```css
535
+ [data-part~="prominent"] { font-weight: 600; }
536
+ [data-part~="supporting-note"] { font-size: 0.875em; }
537
+ ```
538
+
539
+ The marker's location is a wrapper contract, not a promise about internal
540
+ widget structure. Hosts may need to target descendants to reach a widget.
541
+ No extra wrapper is required solely to supply a marker. A root element, or an
542
+ element dispatched without a layout slot, has no marker under this contract.
543
+ This includes Group regions and Category dispatch where no such slot exists;
544
+ renderer-specific extensions MUST document any additional placement.
545
+ A hidden element MUST NOT gain layout space because it has a marker.
546
+
547
+ Only an explicit `options.part` supplies names. They MUST NOT be inferred from
548
+ `i18n`, `name`, `scope`, type, translated text or data, and are not interpolated.
549
+ There is no global default or enable switch for `part`. This option does not
550
+ author arbitrary HTML attributes, CSS classes, inline styles or a web
551
+ component's `part` attribute; `::part()` does not select `data-part`.
552
+
553
+ These hooks and the parameter markers in §9.4a are **platform integrations**
554
+ (§1.1). HTML output can expose them to page CSS within the applicable DOM or
555
+ Shadow Root styling boundary. A non-HTML renderer, including a Kotlin renderer
556
+ that paints to a canvas, MAY expose names through native styling callbacks or
557
+ annotated text ranges, or treat both hooks as a no-op. The language alone does
558
+ not decide applicability: a Kotlin renderer producing HTML can implement the
559
+ HTML contract. A no-op MUST preserve content, accessibility, interaction and
560
+ data, and MUST be documented as a platform fallback rather than claimed as
561
+ implemented marker support. Capability declarations distinguish partial,
562
+ unsupported and unverified support; acceptance vectors alone certify no port.
563
+
501
564
  ## 6. Layout types and sizing
502
565
 
503
566
  ```ts
@@ -1317,6 +1380,79 @@ URL-bearing positions get no protection from value escaping, because the
1317
1380
  destination is the author's own markup. The URL policy (§12) is what covers
1318
1381
  them, and it applies to a resolved destination exactly as to a static one.
1319
1382
 
1383
+ ### 9.4a Styling named substitutions
1384
+
1385
+ `options.textParamSpans` is an optional boolean on a Label. Resolve its effective
1386
+ value from the Label's own option, then
1387
+ `config.jsonformsExtended.markup.textParamSpans`, then `false`. Explicit local
1388
+ `false` overrides a host default of `true`; local `true` enables markers even
1389
+ when the host default is absent or `false`. The host setting is a default,
1390
+ not a permission gate. Omit the local option to inherit that default; a schema
1391
+ validator MUST NOT insert a local `false` for an omitted option. This option
1392
+ does not cascade from a parent layout to its descendants.
1393
+
1394
+ When the effective value is true, an HTML renderer implementing the capability
1395
+ wraps each nonempty substitution of a bare declared parameter name in a
1396
+ `span` with `data-text-param` equal to that name. This applies to interpolated
1397
+ **Label** text only; it adds no requirement for Control captions, Button labels
1398
+ or Link text. Neither this setting nor `options.part` enables interpolation,
1399
+ Markdown or data access.
1400
+
1401
+ ```json
1402
+ {
1403
+ "type": "Label",
1404
+ "text": "{member} selected the {plan} membership.",
1405
+ "options": {
1406
+ "interpolate": true,
1407
+ "part": "membership-summary",
1408
+ "textParamSpans": true,
1409
+ "textParams": { "member": "Morgan", "plan": "Studio" }
1410
+ }
1411
+ }
1412
+ ```
1413
+
1414
+ With the setting enabled, the text content can be represented as:
1415
+
1416
+ ```html
1417
+ <span data-text-param="member">Morgan</span> selected the <span data-text-param="plan">Studio</span> membership.
1418
+ ```
1419
+
1420
+ A host can use `[data-text-param="plan"]` to style the substituted plan name.
1421
+ The attribute uses the declared parameter name, never its expression, data
1422
+ path or resolved value. Set attributes through a safe attribute API or escape
1423
+ them correctly when serializing HTML. Repeated occurrences receive the same
1424
+ name; translated messages may reorder them without changing their names.
1425
+ Expressions such as `{seats + 1}`, reserved variables such as `{locale}`, and
1426
+ escaped literal braces receive no marker. Missing or empty substitutions
1427
+ produce no span; rendered `0` and `false` are nonempty values. Existing failure
1428
+ handling and diagnostics (§9.5) remain unchanged.
1429
+
1430
+ Markers MUST preserve text content, accessible reading order, link targets,
1431
+ and all existing formatting and security decisions. They add no default style,
1432
+ role, ARIA state or focus target. When the effective value is false, the renderer
1433
+ MUST skip marker-specific processing, including any additional Markdown parse.
1434
+ Changing either setting recomputes the effective value without changing content
1435
+ or data; removing the local override restores the current host default.
1436
+
1437
+ For Markdown, retain §9.4's escape-before-parse order. Insert spans only around
1438
+ substitution text in the parsed output, inside the author's formatting nodes;
1439
+ `**{member}**` can produce a strong node containing the member span. Never
1440
+ insert spans into attributes, including link destinations. A substitution split
1441
+ across parsed text nodes may receive several spans with the same name.
1442
+ Removing only these generated spans from the result MUST yield the same
1443
+ rendered structure and text as rendering with the setting off. This includes
1444
+ code, whitespace, punctuation, links and both Markdown profiles.
1445
+
1446
+ If the implementation cannot preserve that equivalence for a Label, it MUST
1447
+ render that Label without parameter spans. This safe fallback is permitted even
1448
+ with the switch on. Boundary-tracking techniques MUST NOT change Markdown
1449
+ parsing, leak internal markers into displayed or fallback text, alter URLs
1450
+ before §12 checks them, or remove characters belonging to the original content.
1451
+ For example, `word**{member}**word` with a punctuation-leading value can change
1452
+ emphasis parsing if a sentinel is inserted near a delimiter; emitting unmarked
1453
+ content is preferable to changing the message. Native equivalents and no-op
1454
+ fallbacks follow §5.7.
1455
+
1320
1456
  ### 9.5 Absent data is not an authoring error
1321
1457
 
1322
1458
  Two failures look alike and are not:
@@ -1471,7 +1607,9 @@ for. An implementation whose parser exposes a token stream MAY build its
1471
1607
  output from that stream directly rather than rendering to markup and
1472
1608
  sanitizing; doing so satisfies the requirement, because nothing unsanitized is
1473
1609
  produced. The set of elements that can be drawn is then an explicit allowlist,
1474
- and attributes other than link targets are dropped.
1610
+ and authored attributes other than link targets are dropped. Renderer-generated
1611
+ `data-text-param` spans (§9.4a) are permitted without accepting raw HTML or
1612
+ arbitrary attributes from authored text.
1475
1613
 
1476
1614
  **Excluding a construct means excluding its grammar, not filtering its
1477
1615
  output.** In a profile without headings, `# Title` renders as those
@@ -1528,12 +1666,17 @@ content, since `<p>` accepts phrasing content only.
1528
1666
  "jsonformsExtended": {
1529
1667
  "markup": {
1530
1668
  "markdown": { "enabled": true, "profile": "basic" },
1531
- "typography": true
1669
+ "typography": true,
1670
+ "textParamSpans": false
1532
1671
  }
1533
1672
  }
1534
1673
  }
1535
1674
  ```
1536
1675
 
1676
+ `textParamSpans` supplies the default for optional Label substitution hooks
1677
+ (§9.4a). A Label's `options.textParamSpans` overrides it in either direction.
1678
+ `part` remains local to each element (§5.7).
1679
+
1537
1680
  `profile` is `basic` or `extended`. An unrecognized value falls back to
1538
1681
  `basic` without a diagnostic: a profile name is a host setting rather than an
1539
1682
  authored one, so there is no author on the page to tell, and the safe
@@ -7699,8 +7842,8 @@ variant layout span weight width height
7699
7842
  gridColumns gap wrap minItemWidth
7700
7843
  resizable rows align justify collapsible
7701
7844
  collapsed showDataIndicator interpolate
7702
- markup textParams initial responsive
7703
- name size fullWidth $dynamic
7845
+ markup textParams textParamSpans initial responsive
7846
+ name size fullWidth $dynamic part
7704
7847
  ```
7705
7848
 
7706
7849
  Renderer-specific namespaces MUST NOT redefine these with incompatible
@@ -8317,5 +8460,11 @@ See the editor-details example.
8317
8460
  ### Conditional fields
8318
8461
 
8319
8462
  See [conditional field presentation and graphical authoring](conditional-fields.md).
8320
- Use `options.conditionalFields: true` on an object Control or the default
8321
- `config.jsonformsExtended.conditionalFields`. Local false opts out.
8463
+ Use `options.conditionalFields: true` on an object Control or an object-context
8464
+ layout entry (VerticalLayout, HorizontalLayout, Group or Categorization), or use
8465
+ `config.jsonformsExtended.conditionalFields` as the default. Local false opts out.
8466
+ The entry owns the projection for descendant layouts and Categories at that
8467
+ object boundary. Nested object and array-item boundaries resolve independently.
8468
+ Explicit layouts preserve placement and update conditional required indicators
8469
+ without generating extra controls. See the conditional-fields contract for
8470
+ ownership, validation, examples and platform support limits.
package/docs/todo.md CHANGED
@@ -13,6 +13,23 @@ Unknown extension keys remain allowed by the schemas. Such acceptance does not
13
13
  validate the feature's shape or claim it is supported. We do not publish a second
14
14
  schema containing speculative options.
15
15
 
16
+ ## Accepted optional host styling hooks — adapter verification
17
+
18
+ The contracts in [§5.7](spec.md#57-host-styling-markers) and
19
+ [§9.4a](spec.md#94a-styling-named-substitutions) are accepted authoring vocabulary,
20
+ with published schema validation. They are optional platform integrations;
21
+ their inclusion does not certify an HTML implementation or require CSS support
22
+ on native or canvas platforms. This differs from speculative options awaiting
23
+ promotion under the TODO policy above.
24
+
25
+ Run the `styling-*` behavior vectors and the
26
+ [membership walkthrough](../examples/label-interpolation/README.md#optional-host-css-hooks)
27
+ through each adapter before claiming support. Verify slot placement, translated
28
+ substitution names, local/host boolean precedence in both directions, Markdown
29
+ equivalence, URL decisions, accessibility and disabled-path processing. Record native mappings or documented no-op fallbacks
30
+ and Shadow Root styling limits. Renderer execution remains unverified here;
31
+ the config-consumption inventory explicitly records that boundary.
32
+
16
33
  ## TODO — portable input adornment verification
17
34
 
18
35
  The serialized `startAdornment` / `endAdornment` contract is specified in
@@ -117,5 +117,11 @@ Catalog assets are optional. Preserve omitted schema/data rather than replacing
117
117
  ## Conditional fields
118
118
 
119
119
  See [conditional field presentation and graphical authoring](../docs/conditional-fields.md).
120
- Use `options.conditionalFields: true` on an object Control or the default
121
- `config.jsonformsExtended.conditionalFields`. Local false opts out.
120
+ Use `options.conditionalFields: true` on an object Control or an object-context
121
+ layout entry (VerticalLayout, HorizontalLayout, Group or Categorization), or use
122
+ `config.jsonformsExtended.conditionalFields` as the default. Local false opts out.
123
+ The entry owns the projection for descendant layouts and Categories at that
124
+ object boundary. Nested object and array-item boundaries resolve independently.
125
+ Explicit layouts preserve placement and update conditional required indicators
126
+ without generating extra controls. See the conditional-fields contract for
127
+ ownership, validation, examples and platform support limits.
@@ -43,6 +43,13 @@ other stays until its own field changes.
43
43
  Comparison is **by value**, not by which path the change named, so rewriting a
44
44
  field with what it already held clears nothing.
45
45
 
46
+ **Proposed visual acceptance:** In light and dark themes, inspect the Email
47
+ and Phone messages, invalid borders and error indicators on the rendered form
48
+ surface. Repeat in the native demo and Web Component host. Each error must be
49
+ readable without hover or selection; changing one field still removes only its
50
+ own message. This is an acceptance case, not a claim that every renderer has
51
+ passed it.
52
+
46
53
  ## From an editor
47
54
 
48
55
  Open **Reported**. The JSON has a syntax error, and a message appears under the