@chobantonov/jsonforms-extended-spec 1.0.0 → 1.1.1

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.
@@ -52,6 +52,23 @@ Companion to the [implementation guide](implementation-guide.md). These entries
52
52
 
53
53
  **Check:** A long string is document-valid via Long text while Short text is displayed. Compare enabled/disabled feedback and verify unchanged host validity. Check compilation reuse and nested validation cost. See [mixed control](../examples/mixed-control/README.md).
54
54
 
55
+ ### Bound reactive feedback across nested branches
56
+
57
+ Keeping document and displayed-branch errors separate also requires bounded
58
+ subscriptions. A derived branch error list that reads its parent's error list and
59
+ the same root data can create many dependency paths through nested compositions.
60
+ A host replacement may then spend more time traversing the reactive graph than
61
+ validating the document. Reuse equivalent error snapshots at each branch boundary,
62
+ or use the platform's equivalent subscription boundary. Preserve current local
63
+ feedback and independent document validity when errors appear and disappear.
64
+
65
+ Adapter acceptance case: render five nested object/array composition levels, edit
66
+ the deepest name, import a sixth level rejected by the final array's maxItems,
67
+ and restore the original data. Verify both the descendant error and its removal,
68
+ retained depth limits, and responsive replacement with browser coverage enabled
69
+ where supported. This is proposed cross-platform acceptance; the Svelte
70
+ `tests/demos/tree-max-depth.spec.ts` journey exercises these replacements.
71
+
55
72
  ## P07 — Enclosing fields are not a second scalar editor
56
73
 
57
74
  **Trap:** Generate a whole-value editor after removing a composition keyword, producing an unrestricted duplicate scalar input; omit enclosing object fields entirely.
@@ -290,8 +307,11 @@ that name when locale or effective dynamic header text changes. Resolving a
290
307
  dynamic Label only at child dispatch leaves the parent's name stale. Keep
291
308
  authored interactive content outside the disclosure trigger: nesting a Button
292
309
  inside it makes keyboard and pointer behavior
293
- ambiguous. Data and validation indicators aggregate only through resolved body
294
- children (including slot fallback children), not every child in `elements`. Acceptance:
310
+ ambiguous. Data and validation indicators aggregate bindings across every
311
+ resolved child in `elements`, including header, cover and footer fields. Labels
312
+ and images do not count merely because they display content. Do not reuse the
313
+ body-placement partition to collect indicator bindings. Ordinary rule-hidden
314
+ Controls still participate; conditionally omitted bindings do not. Acceptance:
295
315
  mount the Card regions tab in `examples/group-layout/uischema.json` closed,
296
316
  open it, activate a footer button without changing expansion, close it, then hide
297
317
  the Group. Verify region visibility, action dispatch and unchanged data at each step.
@@ -1154,6 +1174,21 @@ commands must resolve committable edits before reading current data, and retain
1154
1174
  unresolved/staged drafts for explicit Apply/Cancel. Clear, cancellation, rebinding,
1155
1175
  external replacement and disposal invalidate superseded work.
1156
1176
 
1177
+ A no-op commit can finish without any new data prop or change event. Do not
1178
+ clear pending edits exclusively in a model-feedback effect: typing `xy` and
1179
+ reverting to stored `x` before delivery must settle that edit when the timer or
1180
+ an explicit flush runs. Compare with the current model, not the last attempted
1181
+ write. Preserve newer drafts while an earlier write is being acknowledged and
1182
+ keep independent validation or unresolved drafts pending. This does not require
1183
+ all adapters to publish identical intermediate queue states.
1184
+
1185
+ **Acceptance:** Start with valid stored `x`, type `xy` then `x` in one debounce
1186
+ window, and deliver by both timer and explicit flush. If the edit contributes to
1187
+ pending validity, it must stop doing so without a data event. Repeat after a
1188
+ model change and with a newer draft awaiting feedback. The proposed behavior
1189
+ vector requires renderer execution; fixture validation alone does not prove it.
1190
+
1191
+
1157
1192
  Avoid rescanning every mounted editor on each field render. Maintain per-editor
1158
1193
  pending state and update aggregates only when a contributor changes. Verify both
1159
1194
  correctness and notification cost; a form-wide subscription alone does not prove
@@ -1214,3 +1249,74 @@ resolution instead of stripping options at the integration boundary; lowercase
1214
1249
  `readonly` wins when both boolean spellings are present at the same source.
1215
1250
  Keep JSON Schema `readOnly`, canonical UI/config `readonly`, and inherited
1216
1251
  compatibility support distinct in documentation and tests.
1252
+
1253
+ ## Manual registration must stay separate from automatic registration
1254
+
1255
+ An exported registration function is insufficient if importing its module still
1256
+ registers the default tag through a component import or a shared chunk. Exercise
1257
+ the actual emitted manual entry in a fresh browser registry. Each alias also
1258
+ needs its own custom element constructor; browsers reject registering the same
1259
+ constructor twice. Registration defaults must not overwrite pre-upgrade instance
1260
+ properties or leak mutable data/configuration between instances. Clone plain
1261
+ records and arrays while retaining callbacks, capability symbols, and service
1262
+ instances. Verify removing an override restores its fallback, and that custom
1263
+ tags still deliver the same events, slots, and styles as the automatic entry.
1264
+
1265
+ ## URL component encoding does not replace markup escaping
1266
+
1267
+ An identifier containing `/`, `?`, `&` or `#` changes a URL's structure when
1268
+ interpolated raw. Encode the identifier as one component, then retain the existing
1269
+ markup escaping and URL-policy stages. `encodeURIComponent` intentionally leaves
1270
+ parentheses and apostrophes unchanged, and re-encodes an existing percent escape.
1271
+ Encoding a whole URL would also encode its structural delimiters. Date-time
1272
+ formatting has a separate environment dependency: the viewer's time zone as well
1273
+ as the form locale must be fixed for reproducible comparisons between hosts.
1274
+
1275
+ ## CEL overloads follow value types, not how numbers look
1276
+
1277
+ A literal `1`, `size(items)`, and JSON data containing `1` can reach different
1278
+ CEL overloads. Implement both integer and double variants of numeric formatters,
1279
+ including fixed-fraction `number` and `percent`. Converting an integer to a
1280
+ JavaScript number first can lose digits. Similarly, a JavaScript `Date` reaches
1281
+ a timestamp overload, not a string overload; an `instanceof Date` branch alone
1282
+ does not make it callable. Preserve cache isolation and evaluation limits when
1283
+ factoring function registration into a reusable environment builder.
1284
+
1285
+
1286
+ ## Template child names must remain literal through engine registries
1287
+
1288
+ **Behavior:** Treat authored child names as literal keys, including `__proto__`,
1289
+ `constructor`, `toString` and `hasOwnProperty`. Preserve own-key enumeration and
1290
+ static, dynamic and iterated child references. An absent name must not resolve
1291
+ through a language runtime's object prototype; apply the profile's missing-slot
1292
+ fallback and diagnostics. Known inactive slots remain known and empty.
1293
+
1294
+ **Trap:** Assign names into ordinary objects, or assume a null-prototype input
1295
+ map protects a third-party engine's internal registry. Ractive 1.4.4 copies
1296
+ partials into a registry inheriting from its constructor's registry, so an
1297
+ ordinary prototype anywhere on that chain can consume `__proto__` assignments.
1298
+ An isolated constructor with a null-prototype partial registry preserves both
1299
+ registration and the engine's later parsed-partial cache writes. Do not mutate
1300
+ the host application's global engine registry. Other engines need equivalent
1301
+ verification at their own lookup and cache boundaries.
1302
+
1303
+ Generated placeholder markup also crosses a second parser boundary. Escape HTML
1304
+ attribute syntax and template delimiters: DOM attribute serialization quotes
1305
+ HTML, but literal `{{`, `[[` and `[[[` delimiters may still become template
1306
+ expressions when the engine parses the serialized placeholder. Ractive uses
1307
+ square-bracket delimiters for one-time interpolation; escape both delimiter
1308
+ families so names cannot evaluate form data into DOM attributes. Keep literal
1309
+ percent sequences and quotes unchanged in the resolved slot name.
1310
+
1311
+ **Check:** Execute `template-literal-child-names` through each supported profile:
1312
+ place prototype-like names statically, by dynamic selection and by iteration;
1313
+ verify missing-slot fallback, retained input nodes/focus/drafts after binding
1314
+ updates, literal markup-like names, and isolation from the host engine registry.
1315
+ The vector is proposed adapter acceptance, not certification of every renderer.
1316
+
1317
+ Component bridges should subscribe to the slot address as a stable scalar and
1318
+ keep reactive reads performed during delegated mounting outside the mounting
1319
+ subscription. A host's coarse props/store update can otherwise rerun that
1320
+ subscription even when the name is unchanged, disposing an editor that should
1321
+ retain its focus and draft. Verify actual DOM/node identity rather than only
1322
+ structural equality of the rendered controls.
package/docs/spec.md CHANGED
@@ -811,7 +811,8 @@ switch. With no slot assignments, the Group is an ordinary body-only Group.
811
811
  Each region uses the **first direct child in authored `elements` order** whose
812
812
  `slot` exactly matches that region. Later children with the same slot name remain
813
813
  in the body, as if their `slot` were omitted. Unrecognized slot names likewise
814
- use ordinary body placement. These are valid fallback cases, not configuration
814
+ use ordinary body placement. There is no dedicated `body` slot; `slot: "body"`
815
+ is an unrecognized name and uses the same fallback. These are valid fallback cases, not configuration
815
816
  errors; no child is discarded or rendered twice. Body fallback children follow
816
817
  ordinary body collapse, data-presence and validation-indicator behavior.
817
818
 
@@ -856,10 +857,11 @@ the heading row. The cover and one heading area remain visible when collapsed;
856
857
  only the body and footer hide. Keep authored interactive header and footer content
857
858
  outside the disclosure trigger. Group visibility hides every region. Enabled,
858
859
  read-only and rule behavior apply to dispatched children as usual. Group data-presence
859
- and validation indicators aggregate only the body children and their
860
- descendants, including duplicate/unknown-slot fallback children and excluding
861
- children selected for regions, even though all children are stored
862
- in `elements`. This presentation boundary does not change document validation.
860
+ and validation indicators aggregate bound Controls across **all** children in
861
+ `elements` and their descendants, including cover, header, footer and body
862
+ fallback children. Placement does not change binding participation. Labels,
863
+ images and other presentation-only elements do not contribute data or errors
864
+ merely by displaying content or carrying a `scope` field. This presentation boundary does not change document validation.
863
865
 
864
866
  For Groups that declare regions, keep the authored content in one card frame.
865
867
  In a collapsible presentation, the cover and one heading area stay inside the
@@ -901,14 +903,16 @@ name control and footer button.
901
903
 
902
904
  `ImageView` retains its URL policy and alternative-text rules (§13.1); `Button`
903
905
  retains the action, disabled and pending rules (§14). Authors can place any
904
- supported UI-schema element in a region, but should keep editable fields in
905
- unslotted body children so collapse and section indicators have predictable meaning.
906
+ supported UI-schema element in any region, including editable fields. A field
907
+ in the footer, header or cover participates in Group indicators just as a body
908
+ field does. Collapse and ordinary visibility rules do not exclude bindings from
909
+ aggregation; conditional omission still removes inactive presentation bindings.
906
910
 
907
911
  | Option | Default | Behaviour |
908
912
  | --- | --- | --- |
909
913
  | `collapsible` | `false` | Enables an accessible disclosure control |
910
914
  | `collapsed` | `false` | Initializes expansion and synchronizes it when the effective boolean changes. Ignored unless `collapsible` is true |
911
- | `showDataIndicator` | `false` | Shows a data-presence indicator when at least one bound body descendant contains data |
915
+ | `showDataIndicator` | `false` | Shows a data-presence indicator when at least one bound descendant in any region contains data |
912
916
  | `showValidationIndicator` | `false` | Shows an aggregated descendant-error indicator. See §8.3 |
913
917
 
914
918
  ```json
@@ -1426,6 +1430,64 @@ zone renders the previous day for readers west of the meridian, which is a
1426
1430
  one-day error that appears for some readers only; such a value MUST be
1427
1431
  formatted as UTC.
1428
1432
 
1433
+ Numeric formatting MUST accept both CEL `int` and `double` values. In
1434
+ particular, JSON data numbers and integer-valued literals or computations MUST
1435
+ not require different authoring expressions. The portable signatures are
1436
+ `number(int|double): string`, `number(int|double, int): string`,
1437
+ `currency(int|double, string): string`, and `percent(int|double): string`;
1438
+ `int|double` denotes two separate overloads. The second `number` argument fixes
1439
+ both minimum and maximum fraction digits. CEL integer precision MUST be retained
1440
+ until formatting, including values outside JavaScript's safe integer range.
1441
+
1442
+ The temporal functions `date`, `time`, and `dateTime` MUST also accept CEL
1443
+ `google.protobuf.Timestamp` values, including a value produced by
1444
+ `timestamp("2026-10-01T12:30:00Z")`. A JavaScript host may supply its `Date`
1445
+ representation of that type. Format timestamps as instants in the viewer's time
1446
+ zone, using medium date, short time, or both respectively. The string overloads
1447
+ keep their existing calendar-date, clock-only, and timestamp semantics. This does
1448
+ not introduce numeric epoch overloads: a number's units cannot be inferred from
1449
+ its CEL type. Unparseable temporal values follow the expression-failure policy.
1450
+
1451
+ ### 9.3a Portable URL-component and date-time helpers
1452
+
1453
+ Hosts evaluating the canonical CEL text-expression profile MUST expose these
1454
+ case-sensitive signatures, including hosts consumed through HTML or JavaScript.
1455
+ They are registered CEL functions, independent of JavaScript globals.
1456
+
1457
+ | Signature | Behavior |
1458
+ | --- | --- |
1459
+ | `encodeUriComponent(string): string` | Encode a single URL path segment or query value using the UTF-8 percent-encoding semantics of JavaScript `encodeURIComponent`. Encoding is locale-independent. |
1460
+ | `dateTime(string): string` and `dateTime(google.protobuf.Timestamp): string` | For an RFC 3339 date-time with `Z` or an explicit offset, format its instant using the active form locale, a medium date and a short time in the viewer's time zone, equivalent to `Intl.DateTimeFormat(locale, { dateStyle: 'medium', timeStyle: 'short' })`. |
1461
+
1462
+ `encodeUriComponent` MUST encode reserved delimiters such as `/`, `?`, `&`, `#`,
1463
+ and `=`, spaces as `%20`, and a literal `%` as `%25`. It MUST retain the same
1464
+ unescaped characters as `encodeURIComponent`, including `!`, `~`, `*`, apostrophes,
1465
+ and parentheses. It does not detect previously encoded text: `a%2Fb` becomes
1466
+ `a%252Fb`. An unpaired UTF-16 surrogate fails the expression. The CEL argument is
1467
+ string-only; use `encodeUriComponent(string(id))` for a numeric identifier.
1468
+
1469
+ For example, with declared `name` and `id` text parameters:
1470
+
1471
+ ```md
1472
+ [{name}](#/users/{encodeUriComponent(id)})
1473
+ ```
1474
+
1475
+ Component encoding MUST NOT replace the substitution escaping in §9.4 or the
1476
+ resolved-destination URL policy in §12. Parentheses and apostrophes left by
1477
+ component encoding still pass through the renderer's normal markup escaping.
1478
+
1479
+ `dateTime` preserves the instant represented by an offset; equivalent timestamps
1480
+ MUST render identically for the same locale and viewer time zone. Switching the
1481
+ form locale re-formats the value. The viewer's zone is a host environment input,
1482
+ so adapters MUST control it when comparing acceptance output across platforms;
1483
+ localized strings may also vary with locale-data versions. Use `date` for calendar
1484
+ dates and `time` for clock-only values. Values the formatter cannot parse, wrong
1485
+ CEL argument types, and encoding errors follow the existing expression-failure
1486
+ policy in §9.2; they MUST NOT take down the surrounding form.
1487
+
1488
+ The JSON cases in `conformance/cel-helpers.json` are portable adapter inputs,
1489
+ not evidence of execution by a renderer.
1490
+
1429
1491
  ### 9.4 Substitution, escaping and order
1430
1492
 
1431
1493
  **Pipeline:** effective `textParams` → translation and message lookup →
@@ -4009,6 +4071,13 @@ latest draft is valid.
4009
4071
  - **Clear supersedes queued edits**, so an old callback cannot restore the
4010
4072
  cleared value.
4011
4073
 
4074
+ A completed commit may equal the value already stored in the current model. In
4075
+ that case, any pending contribution for that edit MUST settle without requiring
4076
+ a data-change event or a new data snapshot: there may be no such acknowledgement.
4077
+ Notify participating validity consumers when this state changes. Preserve newer
4078
+ queued drafts, unresolved edits and independent pending validation; completing a
4079
+ no-op write does not make those contributions valid.
4080
+
4012
4081
  **Disposal must leave no stale write callback active**, and there are three
4013
4082
  ways a queued write outlives its target — only one of which is disposal:
4014
4083
 
@@ -167,8 +167,22 @@ required by this package.
167
167
 
168
168
  ## Feature navigation
169
169
 
170
- Explore one feature at a time using the tabs: **Identity group**, **Contact group**, **Insurance group**, **Audit group**, **False and zero**, and **Card regions**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
170
+ Explore one feature at a time using the tabs: **Identity group**, **Contact group**, **Insurance group**, **Audit group**, **False and zero**, **Card regions**, and **Region bindings**. Tab titles are localized in English and Bulgarian. The tabs share the existing form data.
171
171
 
172
172
  ## Consolidated demo coverage
173
173
 
174
174
  The False and zero tab starts collapsed with `false` and `0`: both count as present data.
175
+
176
+ ## Indicators include fields in every region
177
+
178
+ The **Region bindings** tab has its only bound Control in the footer. That note
179
+ is required, so clearing or removing its value remains invalid. It starts
180
+ collapsed with a populated valid value, so the data indicator appears even though
181
+ the body has no bound fields. Open it and enter `x`: data and error indicators
182
+ appear. Clear the value: only the error indicator remains. Collapsing the Group
183
+ does not remove those signals. The header/body Labels are presentation only.
184
+ The same binding participation applies to header and cover Controls, unslotted
185
+ children and unknown-slot fallback children (including `slot: "body"`).
186
+
187
+ This is a portable acceptance example; the spec validates its assets, while
188
+ renderer adapters must execute the interactions above.
@@ -5,5 +5,6 @@
5
5
  "contactEmail": "support@example.test",
6
6
  "alternatePhone": "+1 503 555 0113",
7
7
  "active": false,
8
- "count": 0
8
+ "count": 0,
9
+ "regionNote": "Ready"
9
10
  }
@@ -46,6 +46,15 @@
46
46
  "count": {
47
47
  "type": "integer",
48
48
  "i18n": "presence.count"
49
+ },
50
+ "regionNote": {
51
+ "type": "string",
52
+ "minLength": 3,
53
+ "title": "Footer note",
54
+ "i18n": "regionNote"
49
55
  }
50
- }
56
+ },
57
+ "required": [
58
+ "regionNote"
59
+ ]
51
60
  }
@@ -27,7 +27,11 @@
27
27
  "regions.tab.label": "Card regions",
28
28
  "regions.footer.text": "Preview language",
29
29
  "regions.header.title.text": "Hospitality partner",
30
- "regions.header.description.text": "Verified service partner · Member since 2018"
30
+ "regions.header.description.text": "Verified service partner · Member since 2018",
31
+ "featureNavigation.regionBindings.label": "Region bindings",
32
+ "regionBindings.heading.text": "Field in the footer",
33
+ "regionBindings.body.text": "The body contains no bound fields.",
34
+ "regionNote.label": "Footer note"
31
35
  },
32
36
  "bg": {
33
37
  "group.dataIndicator": "Съдържа данни",
@@ -57,6 +61,10 @@
57
61
  "regions.tab.label": "Секции на картата",
58
62
  "regions.footer.text": "Език на прегледа",
59
63
  "regions.header.title.text": "Партньор в хотелиерството",
60
- "regions.header.description.text": "Проверен партньор · Член от 2018 г."
64
+ "regions.header.description.text": "Проверен партньор · Член от 2018 г.",
65
+ "featureNavigation.regionBindings.label": "Полета в областите",
66
+ "regionBindings.heading.text": "Поле в долната част",
67
+ "regionBindings.body.text": "Основната част не съдържа свързани полета.",
68
+ "regionNote.label": "Бележка в долната част"
61
69
  }
62
70
  }
@@ -251,6 +251,47 @@
251
251
  ]
252
252
  }
253
253
  ]
254
+ },
255
+ {
256
+ "type": "Category",
257
+ "label": "Region bindings",
258
+ "i18n": "featureNavigation.regionBindings",
259
+ "elements": [
260
+ {
261
+ "type": "Group",
262
+ "label": "All region bindings",
263
+ "options": {
264
+ "collapsible": true,
265
+ "collapsed": true,
266
+ "showDataIndicator": true,
267
+ "showValidationIndicator": true,
268
+ "showValidationIndicatorCount": true
269
+ },
270
+ "elements": [
271
+ {
272
+ "type": "Label",
273
+ "text": "Field in the footer",
274
+ "i18n": "regionBindings.heading",
275
+ "slot": "header"
276
+ },
277
+ {
278
+ "type": "Label",
279
+ "text": "The body contains no bound fields.",
280
+ "i18n": "regionBindings.body"
281
+ },
282
+ {
283
+ "type": "HorizontalLayout",
284
+ "slot": "footer",
285
+ "elements": [
286
+ {
287
+ "type": "Control",
288
+ "scope": "#/properties/regionNote"
289
+ }
290
+ ]
291
+ }
292
+ ]
293
+ }
294
+ ]
254
295
  }
255
296
  ]
256
297
  }