@chobantonov/jsonforms-extended-spec 0.2.0 → 0.4.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.
- package/conformance/authoring.json +511 -0
- package/conformance/behavior.json +2373 -4
- package/conformance/config-consumption.json +13 -2
- package/docs/audit.md +17 -2
- package/docs/conditional-fields.md +133 -6
- package/docs/external-resources-proposal.md +8 -2
- package/docs/implementation-guide.md +129 -90
- package/docs/implementation-pitfalls.md +393 -1
- package/docs/implementation-web-typescript.md +2 -5
- package/docs/renderer-and-demo.md +47 -34
- package/docs/spec.md +235 -14
- package/docs/todo.md +72 -18
- package/examples/README.md +8 -2
- package/examples/additional-errors/README.md +7 -0
- package/examples/additional-properties/README.md +15 -0
- package/examples/catalog.json +16 -1
- package/examples/color-control/README.md +4 -1
- package/examples/conditional-fields/README.md +21 -3
- package/examples/conditional-fields/translations.json +4 -2
- package/examples/conditional-fields/uischema.json +67 -7
- package/examples/conditional-template-slots/README.md +14 -0
- package/examples/conditional-template-slots/config.json +7 -0
- package/examples/conditional-template-slots/data.json +5 -0
- package/examples/conditional-template-slots/schema.json +37 -0
- package/examples/conditional-template-slots/translations.json +16 -0
- package/examples/conditional-template-slots/uischema.json +22 -0
- package/examples/index.js +4 -3
- package/examples/kitchen-sink/README.md +93 -4
- package/examples/kitchen-sink/config.json +7 -0
- package/examples/kitchen-sink/data.json +14 -2
- package/examples/kitchen-sink/invalid-data.json +13 -1
- package/examples/kitchen-sink/schema.json +100 -1
- package/examples/kitchen-sink/translations.json +80 -2
- package/examples/kitchen-sink/uischema.json +239 -4
- package/examples/label-interpolation/README.md +58 -1
- package/examples/label-interpolation/config.json +8 -2
- package/examples/label-interpolation/translations.json +8 -4
- package/examples/label-interpolation/uischema.json +31 -8
- package/package.json +1 -1
- package/schemas/README.md +8 -3
- package/schemas/jsonforms-config.schema.json +1 -1
- package/schemas/jsonforms-extended-config.schema.json +5 -0
- package/schemas/jsonforms-extended-uischema.schema.json +11 -2
- package/schemas/jsonforms-uischema.schema.json +14 -1
- package/typescript/README.md +8 -2
- package/typescript/lib/authoring/forSchema.d.ts +10 -1
- package/typescript/src/authoring/forSchema.ts +10 -1
- package/typescript/test/schemaContract.test.ts +12 -0
- package/typescript/test/typedAuthoring.test.ts +12 -1
- package/typescript/test/typedAuthoringCoverage.test.ts +33 -0
package/docs/spec.md
CHANGED
|
@@ -30,7 +30,9 @@ fallback that preserves data.
|
|
|
30
30
|
Sections 1–28 define the model and renderer behavior. Section 29 defines the
|
|
31
31
|
schema artifacts and validation boundary. Section 30 covers host integration,
|
|
32
32
|
demo behavior and accessibility. Appendix A records proposals that are **not
|
|
33
|
-
part of v1 conformance**.
|
|
33
|
+
part of v1 conformance**. Appendix B contains accepted supplemental contracts;
|
|
34
|
+
its placement does not make them proposals or certify adapter support. The
|
|
35
|
+
examples are portable assets, with explicit host
|
|
34
36
|
requirements in [the catalog](../examples/catalog.json).
|
|
35
37
|
|
|
36
38
|
## Contents
|
|
@@ -67,6 +69,7 @@ requirements in [the catalog](../examples/catalog.json).
|
|
|
67
69
|
- [29. JSON schema artifacts and validation boundary](#29-json-schema-artifacts-and-validation-boundary)
|
|
68
70
|
- [30. Host, demo and accessibility contracts](#30-host-demo-and-accessibility-contracts)
|
|
69
71
|
- [Appendix A. Proposals outside v1 conformance](#appendix-a-proposals-outside-v1-conformance)
|
|
72
|
+
- [Appendix B. Accepted supplemental contracts](#appendix-b-accepted-supplemental-contracts)
|
|
70
73
|
|
|
71
74
|
## 1. Purpose and portability
|
|
72
75
|
|
|
@@ -164,7 +167,8 @@ A worked shape:
|
|
|
164
167
|
"security": { "allowScriptEvaluation": false },
|
|
165
168
|
"markup": {
|
|
166
169
|
"markdown": { "enabled": true, "profile": "basic" },
|
|
167
|
-
"typography": true
|
|
170
|
+
"typography": true,
|
|
171
|
+
"textParamSpans": false
|
|
168
172
|
},
|
|
169
173
|
"confirmation": { "default": "always" },
|
|
170
174
|
"showValidationIndicator": true
|
|
@@ -498,6 +502,68 @@ indeterminate. A group that renders individual controls rather than a grouping
|
|
|
498
502
|
component MUST still declare a grouping role, or there is nothing for the
|
|
499
503
|
orientation to describe.
|
|
500
504
|
|
|
505
|
+
### 5.7 Host styling markers
|
|
506
|
+
|
|
507
|
+
`options.part` supplies stable, authored names that a host can select when
|
|
508
|
+
styling an element. It applies to any element type, including registered custom
|
|
509
|
+
types. It adds no default appearance, behavior, role or accessibility state.
|
|
510
|
+
Renderers MUST NOT assign built-in styles or actions based on these names.
|
|
511
|
+
The host supplies any styling separately.
|
|
512
|
+
|
|
513
|
+
```json
|
|
514
|
+
{
|
|
515
|
+
"type": "VerticalLayout",
|
|
516
|
+
"elements": [
|
|
517
|
+
{ "type": "Label", "text": "Membership summary", "options": { "part": "summary prominent" } },
|
|
518
|
+
{ "type": "Label", "text": "Membership can be changed at any time.", "options": { "part": "supporting-note" } }
|
|
519
|
+
]
|
|
520
|
+
}
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
The authoring value is a string of whitespace-separated tokens. Each token
|
|
524
|
+
matches `[A-Za-z][A-Za-z0-9_-]*`; names are case-sensitive. Empty and
|
|
525
|
+
whitespace-only strings are allowed and supply no marker. Authoring validation
|
|
526
|
+
rejects other tokens and non-string values. As defensive handling of unchecked
|
|
527
|
+
input, a renderer MUST ignore a non-string value, discard invalid tokens,
|
|
528
|
+
remove duplicates while preserving first-occurrence order, and join remaining
|
|
529
|
+
tokens with a single space. No remaining tokens means no marker.
|
|
530
|
+
Whitespace here means the `\s` character class used by the published schemas.
|
|
531
|
+
|
|
532
|
+
For an HTML renderer implementing this capability, the normalized value MUST
|
|
533
|
+
be emitted as `data-part` on the child's layout slot: the existing wrapper
|
|
534
|
+
through which its parent layout assigns space. A nested layout's own marker
|
|
535
|
+
belongs on its slot in its parent, not on its children. Use token selectors:
|
|
536
|
+
|
|
537
|
+
```css
|
|
538
|
+
[data-part~="prominent"] { font-weight: 600; }
|
|
539
|
+
[data-part~="supporting-note"] { font-size: 0.875em; }
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
The marker's location is a wrapper contract, not a promise about internal
|
|
543
|
+
widget structure. Hosts may need to target descendants to reach a widget.
|
|
544
|
+
No extra wrapper is required solely to supply a marker. A root element, or an
|
|
545
|
+
element dispatched without a layout slot, has no marker under this contract.
|
|
546
|
+
This includes Group regions and Category dispatch where no such slot exists;
|
|
547
|
+
renderer-specific extensions MUST document any additional placement.
|
|
548
|
+
A hidden element MUST NOT gain layout space because it has a marker.
|
|
549
|
+
|
|
550
|
+
Only an explicit `options.part` supplies names. They MUST NOT be inferred from
|
|
551
|
+
`i18n`, `name`, `scope`, type, translated text or data, and are not interpolated.
|
|
552
|
+
There is no global default or enable switch for `part`. This option does not
|
|
553
|
+
author arbitrary HTML attributes, CSS classes, inline styles or a web
|
|
554
|
+
component's `part` attribute; `::part()` does not select `data-part`.
|
|
555
|
+
|
|
556
|
+
These hooks and the parameter markers in §9.4a are **platform integrations**
|
|
557
|
+
(§1.1). HTML output can expose them to page CSS within the applicable DOM or
|
|
558
|
+
Shadow Root styling boundary. A non-HTML renderer, including a Kotlin renderer
|
|
559
|
+
that paints to a canvas, MAY expose names through native styling callbacks or
|
|
560
|
+
annotated text ranges, or treat both hooks as a no-op. The language alone does
|
|
561
|
+
not decide applicability: a Kotlin renderer producing HTML can implement the
|
|
562
|
+
HTML contract. A no-op MUST preserve content, accessibility, interaction and
|
|
563
|
+
data, and MUST be documented as a platform fallback rather than claimed as
|
|
564
|
+
implemented marker support. Capability declarations distinguish partial,
|
|
565
|
+
unsupported and unverified support; acceptance vectors alone certify no port.
|
|
566
|
+
|
|
501
567
|
## 6. Layout types and sizing
|
|
502
568
|
|
|
503
569
|
```ts
|
|
@@ -1201,7 +1267,22 @@ or silently enable overlay expressions through the interpolation gate.
|
|
|
1201
1267
|
| | may reference |
|
|
1202
1268
|
| --- | --- |
|
|
1203
1269
|
| a `textParams` **value** | `data`, `item`, `config`, `context`, subject to the interpolation gate; `locale` |
|
|
1204
|
-
| the **text** | the declared `textParams
|
|
1270
|
+
| the **text** | only the declared `textParams` |
|
|
1271
|
+
|
|
1272
|
+
The text scope MUST NOT inject `locale` or any other ambient variable. To
|
|
1273
|
+
show the host locale, declare it explicitly, for example
|
|
1274
|
+
`"textParams": { "language": "{locale}" }`, then use `{language}` in the text.
|
|
1275
|
+
`locale` remains available to parameter expressions even when the interpolation
|
|
1276
|
+
data-access gate is closed; this does not enable data namespaces. A parameter
|
|
1277
|
+
may itself be named `locale`: `"textParams": { "locale": "{locale}" }` reads
|
|
1278
|
+
the host locale on the right and exposes a declared parameter on the left.
|
|
1279
|
+
Parameter evaluation does not read the text scope, so there is no self-reference.
|
|
1280
|
+
Undeclared `{locale}` in text follows the unknown-variable diagnostic rule (§9.5).
|
|
1281
|
+
Locale-aware formatting functions still use the active host locale (§9.3).
|
|
1282
|
+
|
|
1283
|
+
This replaces the earlier implicit text variable. Migrate existing messages by
|
|
1284
|
+
adding an explicit parameter; renderers MUST NOT retain an undeclared-locale
|
|
1285
|
+
exception in the canonical text scope.
|
|
1205
1286
|
|
|
1206
1287
|
A translated string MUST NOT be able to name a data path. `{data.customerName}`
|
|
1207
1288
|
written in the text resolves to nothing and is reported, however open the gate
|
|
@@ -1317,6 +1398,84 @@ URL-bearing positions get no protection from value escaping, because the
|
|
|
1317
1398
|
destination is the author's own markup. The URL policy (§12) is what covers
|
|
1318
1399
|
them, and it applies to a resolved destination exactly as to a static one.
|
|
1319
1400
|
|
|
1401
|
+
### 9.4a Styling named substitutions
|
|
1402
|
+
|
|
1403
|
+
`options.textParamSpans` is an optional boolean on a Label. Resolve its effective
|
|
1404
|
+
value from the Label's own option, then
|
|
1405
|
+
`config.jsonformsExtended.markup.textParamSpans`, then `false`. Explicit local
|
|
1406
|
+
`false` overrides a host default of `true`; local `true` enables markers even
|
|
1407
|
+
when the host default is absent or `false`. The host setting is a default,
|
|
1408
|
+
not a permission gate. Omit the local option to inherit that default; a schema
|
|
1409
|
+
validator MUST NOT insert a local `false` for an omitted option. This option
|
|
1410
|
+
does not cascade from a parent layout to its descendants. As defensive handling
|
|
1411
|
+
of unchecked input, a renderer MUST ignore a non-boolean local
|
|
1412
|
+
`options.textParamSpans` and resolve the effective value as if it were omitted.
|
|
1413
|
+
|
|
1414
|
+
When the effective value is true, an HTML renderer implementing the capability
|
|
1415
|
+
wraps each nonempty substitution of a bare declared parameter name in a
|
|
1416
|
+
`span` with `data-text-param` equal to that name. This applies to interpolated
|
|
1417
|
+
**Label** text only; it adds no requirement for Control captions, Button labels
|
|
1418
|
+
or Link text. Neither this setting nor `options.part` enables interpolation,
|
|
1419
|
+
Markdown or data access.
|
|
1420
|
+
|
|
1421
|
+
```json
|
|
1422
|
+
{
|
|
1423
|
+
"type": "Label",
|
|
1424
|
+
"text": "{member} selected the {plan} membership.",
|
|
1425
|
+
"options": {
|
|
1426
|
+
"interpolate": true,
|
|
1427
|
+
"part": "membership-summary",
|
|
1428
|
+
"textParamSpans": true,
|
|
1429
|
+
"textParams": { "member": "Morgan", "plan": "Studio" }
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
```
|
|
1433
|
+
|
|
1434
|
+
With the setting enabled, the text content can be represented as:
|
|
1435
|
+
|
|
1436
|
+
```html
|
|
1437
|
+
<span data-text-param="member">Morgan</span> selected the <span data-text-param="plan">Studio</span> membership.
|
|
1438
|
+
```
|
|
1439
|
+
|
|
1440
|
+
A host can use `[data-text-param="plan"]` to style the substituted plan name.
|
|
1441
|
+
The attribute uses the declared parameter name, never its expression, data
|
|
1442
|
+
path or resolved value. Set attributes through a safe attribute API or escape
|
|
1443
|
+
them correctly when serializing HTML. Repeated occurrences receive the same
|
|
1444
|
+
name; translated messages may reorder them without changing their names.
|
|
1445
|
+
Expressions such as `{seats + 1}`, undeclared identifiers and escaped literal
|
|
1446
|
+
braces receive no marker. Eligibility is determined from declared `textParams`
|
|
1447
|
+
keys, not from whether an expression is a bare identifier. A declared parameter
|
|
1448
|
+
named `locale` is eligible just like any other parameter; an undeclared
|
|
1449
|
+
`{locale}` is an authoring error (§9.1), not an implicit substitution. Missing
|
|
1450
|
+
or empty substitutions produce no span; rendered `0` and `false` are nonempty values. Existing failure
|
|
1451
|
+
handling and diagnostics (§9.5) remain unchanged.
|
|
1452
|
+
|
|
1453
|
+
Markers MUST preserve text content, accessible reading order, link targets,
|
|
1454
|
+
and all existing formatting and security decisions. They add no default style,
|
|
1455
|
+
role, ARIA state or focus target. When the effective value is false, the renderer
|
|
1456
|
+
MUST skip marker-specific processing, including any additional Markdown parse.
|
|
1457
|
+
Changing either setting recomputes the effective value without changing content
|
|
1458
|
+
or data; removing the local override restores the current host default.
|
|
1459
|
+
|
|
1460
|
+
For Markdown, retain §9.4's escape-before-parse order. Insert spans only around
|
|
1461
|
+
substitution text in the parsed output, inside the author's formatting nodes;
|
|
1462
|
+
`**{member}**` can produce a strong node containing the member span. Never
|
|
1463
|
+
insert spans into attributes, including link destinations. A substitution split
|
|
1464
|
+
across parsed text nodes may receive several spans with the same name.
|
|
1465
|
+
Removing only these generated spans from the result MUST yield the same
|
|
1466
|
+
rendered structure and text as rendering with the setting off. This includes
|
|
1467
|
+
code, whitespace, punctuation, links and both Markdown profiles.
|
|
1468
|
+
|
|
1469
|
+
If the implementation cannot preserve that equivalence for a Label, it MUST
|
|
1470
|
+
render that Label without parameter spans. This safe fallback is permitted even
|
|
1471
|
+
with the switch on. Boundary-tracking techniques MUST NOT change Markdown
|
|
1472
|
+
parsing, leak internal markers into displayed or fallback text, alter URLs
|
|
1473
|
+
before §12 checks them, or remove characters belonging to the original content.
|
|
1474
|
+
For example, `word**{member}**word` with a punctuation-leading value can change
|
|
1475
|
+
emphasis parsing if a sentinel is inserted near a delimiter; emitting unmarked
|
|
1476
|
+
content is preferable to changing the message. Native equivalents and no-op
|
|
1477
|
+
fallbacks follow §5.7.
|
|
1478
|
+
|
|
1320
1479
|
### 9.5 Absent data is not an authoring error
|
|
1321
1480
|
|
|
1322
1481
|
Two failures look alike and are not:
|
|
@@ -1471,7 +1630,9 @@ for. An implementation whose parser exposes a token stream MAY build its
|
|
|
1471
1630
|
output from that stream directly rather than rendering to markup and
|
|
1472
1631
|
sanitizing; doing so satisfies the requirement, because nothing unsanitized is
|
|
1473
1632
|
produced. The set of elements that can be drawn is then an explicit allowlist,
|
|
1474
|
-
and attributes other than link targets are dropped.
|
|
1633
|
+
and authored attributes other than link targets are dropped. Renderer-generated
|
|
1634
|
+
`data-text-param` spans (§9.4a) are permitted without accepting raw HTML or
|
|
1635
|
+
arbitrary attributes from authored text.
|
|
1475
1636
|
|
|
1476
1637
|
**Excluding a construct means excluding its grammar, not filtering its
|
|
1477
1638
|
output.** In a profile without headings, `# Title` renders as those
|
|
@@ -1528,12 +1689,17 @@ content, since `<p>` accepts phrasing content only.
|
|
|
1528
1689
|
"jsonformsExtended": {
|
|
1529
1690
|
"markup": {
|
|
1530
1691
|
"markdown": { "enabled": true, "profile": "basic" },
|
|
1531
|
-
"typography": true
|
|
1692
|
+
"typography": true,
|
|
1693
|
+
"textParamSpans": false
|
|
1532
1694
|
}
|
|
1533
1695
|
}
|
|
1534
1696
|
}
|
|
1535
1697
|
```
|
|
1536
1698
|
|
|
1699
|
+
`textParamSpans` supplies the default for optional Label substitution hooks
|
|
1700
|
+
(§9.4a). A Label's `options.textParamSpans` overrides it in either direction.
|
|
1701
|
+
`part` remains local to each element (§5.7).
|
|
1702
|
+
|
|
1537
1703
|
`profile` is `basic` or `extended`. An unrecognized value falls back to
|
|
1538
1704
|
`basic` without a diagnostic: a profile name is a host setting rather than an
|
|
1539
1705
|
authored one, so there is no author on the page to tell, and the safe
|
|
@@ -2343,7 +2509,16 @@ stale slot editors.
|
|
|
2343
2509
|
|
|
2344
2510
|
**Children are addressed by name.** Each named child is available to the
|
|
2345
2511
|
template as a placeholder that mounts its delegated renderer. Unnamed children
|
|
2346
|
-
receive their decimal index as a fallback name; explicit names are recommended.
|
|
2512
|
+
receive their authored decimal index as a fallback name; explicit names are recommended.
|
|
2513
|
+
Conditional projection MUST preserve the authored address set and collision
|
|
2514
|
+
resolution. Known inactive slots render nothing, without unknown-slot diagnostics
|
|
2515
|
+
or fallback activation. Ordered child views MUST NOT alias a later child into an
|
|
2516
|
+
inactive numeric address, even when the numeric name was explicit. Iteration
|
|
2517
|
+
renders only active content while retaining slot identity. A profile that supports
|
|
2518
|
+
component-style child references applies the same rule to those references;
|
|
2519
|
+
unknown names and unsupported syntax retain their diagnostics. See
|
|
2520
|
+
[conditional fields](conditional-fields.md) for object-boundary ownership.
|
|
2521
|
+
|
|
2347
2522
|
|
|
2348
2523
|
Two requirements that are easy to satisfy incorrectly:
|
|
2349
2524
|
|
|
@@ -2582,6 +2757,14 @@ libraries MUST NOT give these values different meanings.
|
|
|
2582
2757
|
| UI-schema options | `options.readonly` requests read-only behaviour independently of schema annotation |
|
|
2583
2758
|
| JSON Schema | `readOnly` is the standard spelling. Lowercase is **not** the schema keyword |
|
|
2584
2759
|
|
|
2760
|
+
JSON Forms core integrations also preserve core's compatibility spelling
|
|
2761
|
+
`options.readOnly` and `config.readOnly`. Within either source, a boolean
|
|
2762
|
+
`readonly` takes precedence over a boolean `readOnly`; the normal source
|
|
2763
|
+
precedence below still applies. Adapters MUST NOT silently strip these options
|
|
2764
|
+
before core resolves them. Use lowercase `readonly` in portable UI/config
|
|
2765
|
+
examples; other integrations MAY support the compatibility alias. This does not
|
|
2766
|
+
change the JSON Schema keyword's spelling.
|
|
2767
|
+
|
|
2585
2768
|
JSON Schema `readOnly` is an **annotation**. Standard validation does not
|
|
2586
2769
|
compare previous and new values, nor enforce immutability because the
|
|
2587
2770
|
annotation is present. The rendering integration enforces editing
|
|
@@ -7699,8 +7882,8 @@ variant layout span weight width height
|
|
|
7699
7882
|
gridColumns gap wrap minItemWidth
|
|
7700
7883
|
resizable rows align justify collapsible
|
|
7701
7884
|
collapsed showDataIndicator interpolate
|
|
7702
|
-
markup textParams initial responsive
|
|
7703
|
-
name size fullWidth $dynamic
|
|
7885
|
+
markup textParams textParamSpans initial responsive
|
|
7886
|
+
name size fullWidth $dynamic part
|
|
7704
7887
|
```
|
|
7705
7888
|
|
|
7706
7889
|
Renderer-specific namespaces MUST NOT redefine these with incompatible
|
|
@@ -7830,6 +8013,7 @@ for offline validation; no network resolver is required.
|
|
|
7830
8013
|
| `jsonforms-config.schema.json` | Common defaults and shared extension configuration |
|
|
7831
8014
|
| `jsonforms-extended-config.schema.json` | Extended configuration and security blocks |
|
|
7832
8015
|
| `example.schema.json` | Example catalog entry and host requirements |
|
|
8016
|
+
| `jsonforms-dynamic-uischema.schema.json` | Separate experimental `$dynamic` descriptor profile (§11); not static v1 conformance |
|
|
7833
8017
|
| `jsonforms-rule.schema.json` | Standalone serialized rules, shared by both UI profiles |
|
|
7834
8018
|
|
|
7835
8019
|
Unknown options and extension namespaces remain open. Known fields retain their
|
|
@@ -7843,7 +8027,9 @@ schema or config. This is separate from a form validator deliberately applying
|
|
|
7843
8027
|
defaults to business data under §15.9.
|
|
7844
8028
|
|
|
7845
8029
|
Structural checks cover option shapes, nested UI elements, mutually exclusive
|
|
7846
|
-
Button action/script fields.
|
|
8030
|
+
Button action/script fields. The common and extended static UI profiles do not
|
|
8031
|
+
define `$dynamic` descriptors; the separate experimental schema validates their
|
|
8032
|
+
syntax. Structural checks cannot prove
|
|
7847
8033
|
that a Control scope resolves, a named category exists, a CSS length is useful,
|
|
7848
8034
|
an expression is safe to execute, a bound is comparable, or a renderer behaves
|
|
7849
8035
|
correctly. Those require semantic and behavioral conformance tests. Neither a
|
|
@@ -7868,7 +8054,7 @@ claim renderer conformance or execute scripts embedded in example documents.
|
|
|
7868
8054
|
|
|
7869
8055
|
The detailed host and demo acceptance requirements are maintained in
|
|
7870
8056
|
[Renderer and demo guide](renderer-and-demo.md). See the
|
|
7871
|
-
[
|
|
8057
|
+
[authoring-schema audit and source reconciliation](audit.md) for historical sources.
|
|
7872
8058
|
|
|
7873
8059
|
### 30.1 Host parity and reusable behavior
|
|
7874
8060
|
|
|
@@ -7950,6 +8136,13 @@ publish limitations rather than treating a schema definition or a worked example
|
|
|
7950
8136
|
as proof of runtime support. External choice providers have no canonical option
|
|
7951
8137
|
in this version; any relationship to the experimental overlay resolver still needs design.
|
|
7952
8138
|
|
|
8139
|
+
## Appendix B. Accepted supplemental contracts
|
|
8140
|
+
|
|
8141
|
+
These sections supplement the model and renderer requirements above. They are
|
|
8142
|
+
accepted contracts, subject to capability declarations and documented platform
|
|
8143
|
+
limits; they are not the proposals in Appendix A. Existing section anchors remain
|
|
8144
|
+
stable for links from examples and implementation guides.
|
|
8145
|
+
|
|
7953
8146
|
### Array panel collapsing
|
|
7954
8147
|
|
|
7955
8148
|
All array presentations (table, expandable items, list with detail, and AG Grid)
|
|
@@ -7970,7 +8163,12 @@ shared controls, normal tables, AG Grid and detail editors with English/Bulgaria
|
|
|
7970
8163
|
authoring catalogs. It includes valid and deliberately invalid data fixtures.
|
|
7971
8164
|
Phone validation is an explicit international syntax pattern; it does not prove
|
|
7972
8165
|
reachability. Standard email/date/time format validation must be enabled by the
|
|
7973
|
-
host.
|
|
8166
|
+
host. Its root layout opts into conditional work-location and relocation fields;
|
|
8167
|
+
employment cards, skills chips, language selection, adornments and live translated
|
|
8168
|
+
summaries demonstrate additional portable contracts. A separate Demo guide tab
|
|
8169
|
+
identifies what to try while applicant-facing captions stay business-oriented.
|
|
8170
|
+
Named substitution and slot markers require host styling for a visible effect.
|
|
8171
|
+
See the example for component coverage, adapter limits and library-locale requirements.
|
|
7974
8172
|
|
|
7975
8173
|
|
|
7976
8174
|
### Direct errors on arrays and objects
|
|
@@ -8258,13 +8456,20 @@ which navigates arbitrary JSON structure.
|
|
|
8258
8456
|
|
|
8259
8457
|
The selected node's child collection retains native add/delete behavior and
|
|
8260
8458
|
uses links to child editors rather than recursively expanding their fields.
|
|
8459
|
+
Tree rows also expose rename and delete actions. Rename edits the configured
|
|
8460
|
+
label property's value, not an object key, and validates the new value against
|
|
8461
|
+
its schema. Delete removes the node from its parent's child array and respects
|
|
8462
|
+
minItems, read-only ancestors, and deletion confirmation (the mixed catalog).
|
|
8463
|
+
The displayed root cannot be deleted. Confirmation rechecks the current target
|
|
8464
|
+
and permissions to avoid deleting a replacement node at a reused array index.
|
|
8261
8465
|
Editing a node preserves sibling data. Node error indicators include descendants
|
|
8262
8466
|
and follow the container-indicator and validation-visibility settings. After a
|
|
8263
8467
|
selected node is removed, select its closest remaining parent. Navigation remains
|
|
8264
8468
|
available in read-only forms; mutations remain disabled.
|
|
8265
8469
|
|
|
8266
8470
|
The recursive-tree example includes a Tree editor tab for comparison. See the
|
|
8267
|
-
implementation guide
|
|
8471
|
+
[implementation guide](implementation-guide.md#recursive-node-tree-presentation)
|
|
8472
|
+
for acceptance guidance; renderer projects record their own executed coverage.
|
|
8268
8473
|
|
|
8269
8474
|
### Array detail resolution
|
|
8270
8475
|
|
|
@@ -8317,5 +8522,21 @@ See the editor-details example.
|
|
|
8317
8522
|
### Conditional fields
|
|
8318
8523
|
|
|
8319
8524
|
See [conditional field presentation and graphical authoring](conditional-fields.md).
|
|
8320
|
-
Use `options.conditionalFields: true` on an object Control or
|
|
8321
|
-
|
|
8525
|
+
Use `options.conditionalFields: true` on an object Control or an object-context
|
|
8526
|
+
layout entry (VerticalLayout, HorizontalLayout, Group, Categorization, TemplateLayout, Template or Slot), or use
|
|
8527
|
+
`config.jsonformsExtended.conditionalFields` as the default. Local false opts out.
|
|
8528
|
+
The entry owns the projection for descendant layouts and Categories at that
|
|
8529
|
+
object boundary; their local options are ignored in both directions. Group
|
|
8530
|
+
regions participate in the same filtering. Whole-value editors retain the
|
|
8531
|
+
original schema. Nested object, array-item and independent host form boundaries
|
|
8532
|
+
resolve independently.
|
|
8533
|
+
Filtering the last child from a Group region MUST preserve compatible body
|
|
8534
|
+
editor instances, focus and local drafts. Choose a stable enclosing frame from
|
|
8535
|
+
the authored layout, or use an equivalent reconciliation strategy. Render only
|
|
8536
|
+
active region contents; retaining identity must not expose inactive controls.
|
|
8537
|
+
Projection diagnostics belong to the boundary that evaluated the projection.
|
|
8538
|
+
Descendants reusing it MUST NOT emit or display its failures again. Independent
|
|
8539
|
+
object paths and forms retain their own diagnostics even when messages match.
|
|
8540
|
+
Explicit layouts preserve placement and update conditional required indicators
|
|
8541
|
+
without generating extra controls. See the conditional-fields contract for
|
|
8542
|
+
ownership, validation, examples and platform support limits.
|
package/docs/todo.md
CHANGED
|
@@ -6,12 +6,43 @@ This backlog separates proposals from implementation work. Renderer projects
|
|
|
6
6
|
record their own coverage and implementation issues.
|
|
7
7
|
|
|
8
8
|
- **FUTURE:** discuss and refine the design before implementing it.
|
|
9
|
-
- **TODO:**
|
|
10
|
-
|
|
9
|
+
- **TODO:** remaining implementation or adapter verification. For a proposed
|
|
10
|
+
authoring option, complete the promotion checklist before publishing its shape.
|
|
11
|
+
Verification of an accepted contract does not remove it from the schemas.
|
|
12
|
+
- **EXPERIMENTAL:** a separate opt-in profile whose portable conformance remains
|
|
13
|
+
unsettled, even when schema/type/example assets already exist.
|
|
11
14
|
|
|
12
15
|
Unknown extension keys remain allowed by the schemas. Such acceptance does not
|
|
13
|
-
validate the feature's shape or claim it is supported.
|
|
14
|
-
|
|
16
|
+
validate the feature's shape or claim it is supported. Speculative options stay
|
|
17
|
+
out of the static schemas; the explicitly experimental `$dynamic` profile has
|
|
18
|
+
its own schema and does not promote those options into static conformance.
|
|
19
|
+
|
|
20
|
+
## Review boundary
|
|
21
|
+
|
|
22
|
+
Reviewed against this package on 2026-12-04: schemas, TypeScript authoring,
|
|
23
|
+
examples, behavior vectors and validation tests. This repository ships no
|
|
24
|
+
renderer adapter; the list below does not certify current React, Svelte, Vue or
|
|
25
|
+
native support. Dated source audits retain their stated revision and scope.
|
|
26
|
+
Renderer projects own execution results and remaining implementation issues.
|
|
27
|
+
|
|
28
|
+
## Accepted optional host styling hooks — adapter verification
|
|
29
|
+
|
|
30
|
+
The contracts in [§5.7](spec.md#57-host-styling-markers) and
|
|
31
|
+
[§9.4a](spec.md#94a-styling-named-substitutions) are accepted authoring vocabulary,
|
|
32
|
+
with published schema validation. They are optional platform integrations;
|
|
33
|
+
their inclusion does not certify an HTML implementation or require CSS support
|
|
34
|
+
on native or canvas platforms. This differs from speculative options awaiting
|
|
35
|
+
promotion under the TODO policy above.
|
|
36
|
+
|
|
37
|
+
Run the `styling-*` behavior vectors and the
|
|
38
|
+
[membership walkthrough](../examples/label-interpolation/README.md#optional-host-css-hooks)
|
|
39
|
+
through each adapter before claiming support. Verify slot placement, translated
|
|
40
|
+
substitution names, local/host boolean precedence in both directions, Markdown
|
|
41
|
+
equivalence, URL decisions, accessibility and disabled-path processing. Record
|
|
42
|
+
native mappings or documented no-op fallbacks and Shadow Root styling limits.
|
|
43
|
+
Renderer execution remains unverified here; the
|
|
44
|
+
[config-consumption inventory](../conformance/config-consumption.json) records
|
|
45
|
+
source-level evidence and its limits.
|
|
15
46
|
|
|
16
47
|
## TODO — portable input adornment verification
|
|
17
48
|
|
|
@@ -88,12 +119,16 @@ from the overlay resolver and does not grant CEL or trusted-function activation.
|
|
|
88
119
|
|
|
89
120
|
## Proposed authoring features awaiting design or implementation
|
|
90
121
|
|
|
91
|
-
Composite-dialog removal settings
|
|
92
|
-
|
|
93
|
-
container summaries, and structured diagnostics
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
122
|
+
Composite-dialog removal settings (`showRemoveButton` / `removeLabel`) and
|
|
123
|
+
additional authoring shapes for pending-analysis/submit policy, touch-aware
|
|
124
|
+
container summaries, and structured diagnostics still need design and behavioral
|
|
125
|
+
evidence before promotion. Their absence from the published schemas is
|
|
126
|
+
intentional; permissive extension keys do not promise support.
|
|
127
|
+
|
|
128
|
+
The existing `clearable` option is already published. Pending-edit validity
|
|
129
|
+
(§18.4), pre-touch filtering (§15.7), and diagnostic guidance (§21) also have
|
|
130
|
+
accepted contracts; completing their adapter integration is separate from
|
|
131
|
+
designing new serialized settings.
|
|
97
132
|
|
|
98
133
|
Implementation-specific findings belong in each renderer project.
|
|
99
134
|
|
|
@@ -119,11 +154,13 @@ must never be interpreted as evidence that a renderer implements it.
|
|
|
119
154
|
Broader conditional composition coverage remains open. Each renderer project
|
|
120
155
|
tracks its own executable work.
|
|
121
156
|
|
|
122
|
-
- Extend conditional discovery
|
|
123
|
-
|
|
157
|
+
- Extend conditional discovery into anyOf/oneOf alternatives. Local-reference,
|
|
158
|
+
allOf and named-template placement contracts already have examples and
|
|
159
|
+
acceptance vectors; execute and broaden their adapter coverage rather than
|
|
160
|
+
treating those contracts as undesigned.
|
|
124
161
|
- Add contains matching-item feedback and explanations of not failures. Do not
|
|
125
162
|
infer editable fields from a negated schema.
|
|
126
|
-
-
|
|
163
|
+
- Verify boolean false presentation with absence as the quiet default:
|
|
127
164
|
hide absent optional forbidden fields and exclude them from add choices.
|
|
128
165
|
Existing forbidden data must have visible feedback and an allowed removal
|
|
129
166
|
path, without automatic deletion. Root false and required false properties
|
|
@@ -140,10 +177,27 @@ Drag/drop must preserve field bindings and unknown options. These editor feature
|
|
|
140
177
|
are planned work, not implemented capabilities or new published option shapes.
|
|
141
178
|
See [conditional authoring guidance](conditional-fields.md).
|
|
142
179
|
|
|
180
|
+
## TODO — accepted conditional and template adapter verification
|
|
181
|
+
|
|
182
|
+
The [conditional contract](conditional-fields.md) includes direct-layout entry,
|
|
183
|
+
Group regions, whole-value schema preservation, local override ownership,
|
|
184
|
+
reference-aware discovery and Template/Slot address reservation. It is no longer
|
|
185
|
+
limited to direct fields in an object detail. Execute the `conditional-layout-*`,
|
|
186
|
+
`conditional-discovery-*` and `conditional-template-*` cases through each claimed
|
|
187
|
+
adapter. Include retained focus/drafts, stable Group frames, bounded static work,
|
|
188
|
+
independent forms and projection-diagnostic ownership. Keep the dated Svelte
|
|
189
|
+
source findings separate from renderer interaction evidence.
|
|
190
|
+
|
|
191
|
+
Named-template lookup, caller slot overrides and recursion boundaries also have
|
|
192
|
+
accepted contracts and vectors. Verify diagnostics and cycle termination in
|
|
193
|
+
renderer repositories; missing execution is not a missing authoring design.
|
|
194
|
+
|
|
143
195
|
## Completed authoring work
|
|
144
196
|
|
|
145
|
-
Mixed type-specific details, shared editor detail modes, conditional object
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
197
|
+
Mixed type-specific details, shared editor detail modes, conditional object and
|
|
198
|
+
layout presentation, Template/Slot placement, `clearable`, and the experimental
|
|
199
|
+
dynamic schema/playground have documented contracts and package validation
|
|
200
|
+
coverage. Static authoring shapes are published; `$dynamic` descriptors use their
|
|
201
|
+
separate experimental schema. These checks validate assets and authoring, not
|
|
202
|
+
renderer interaction. Remaining adapter verification stays above and in renderer
|
|
203
|
+
backlogs. The drag-and-drop editor itself remains future work.
|
package/examples/README.md
CHANGED
|
@@ -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
|
|
121
|
-
|
|
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
|
|
@@ -186,3 +186,18 @@ The **Static and dynamic properties** tab shows **Inventory details** with schem
|
|
|
186
186
|
Reference and Quantity fields, followed by editable Warehouse and Handling keys
|
|
187
187
|
in Additional Properties. Both sections belong inside the same object boundary.
|
|
188
188
|
Static fields must not appear again in the dynamic list.
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
## Proposed acceptance cases for clearing values
|
|
192
|
+
|
|
193
|
+
In a host using the real renderer registry, load an object with an additional
|
|
194
|
+
string property whose schema defines a nonempty default. Activate the field
|
|
195
|
+
clear button, then repeat by deleting all text. Verify that the exact key has
|
|
196
|
+
the empty string value, its editor stays mounted, and the user can enter a new
|
|
197
|
+
value. Verify that explicit Delete removes the key and row. Repeat with an empty
|
|
198
|
+
key and a dotted key through the host's literal-key editor.
|
|
199
|
+
|
|
200
|
+
For an additional property containing an object with a declared string field,
|
|
201
|
+
clear that nested field and verify its normal absence semantics while its
|
|
202
|
+
additional-property parent and row remain present. These are proposed host
|
|
203
|
+
acceptance cases, not executable tests in this specification package.
|
package/examples/catalog.json
CHANGED
|
@@ -201,6 +201,20 @@
|
|
|
201
201
|
],
|
|
202
202
|
"hostRequirements": []
|
|
203
203
|
},
|
|
204
|
+
{
|
|
205
|
+
"id": "conditional-template-slots",
|
|
206
|
+
"title": "Conditional template slots",
|
|
207
|
+
"files": [
|
|
208
|
+
"config.json",
|
|
209
|
+
"data.json",
|
|
210
|
+
"schema.json",
|
|
211
|
+
"translations.json",
|
|
212
|
+
"uischema.json"
|
|
213
|
+
],
|
|
214
|
+
"hostRequirements": [
|
|
215
|
+
"Register the Ractive TemplateLayout profile and allow script evaluation for this trusted template."
|
|
216
|
+
]
|
|
217
|
+
},
|
|
204
218
|
{
|
|
205
219
|
"id": "container-validation-indicator",
|
|
206
220
|
"title": "Container validation indicator",
|
|
@@ -363,7 +377,8 @@
|
|
|
363
377
|
"config.json"
|
|
364
378
|
],
|
|
365
379
|
"hostRequirements": [
|
|
366
|
-
"Register base and extended renderers/cells, including AG Grid and Monaco. Enable standard format validation and load English or Bulgarian renderer messages. Phone validation checks international syntax, not assignment or reachability."
|
|
380
|
+
"Register base and extended renderers/cells, including AG Grid and Monaco. Enable standard format validation and load English or Bulgarian renderer messages. Phone validation checks international syntax, not assignment or reachability.",
|
|
381
|
+
"Support conditional object-context layouts, choice cards, chips, multi-select and portable input adornments (semantic lock/information icons). Label interpolation uses dynamicValues; optional part/textParamSpans styling requires host CSS in the form styling scope. Report unsupported capabilities; no experimental $dynamic or template engine is required."
|
|
367
382
|
]
|
|
368
383
|
},
|
|
369
384
|
{
|
|
@@ -116,7 +116,10 @@ the stored text is shown beside the swatch exactly as stored.
|
|
|
116
116
|
|
|
117
117
|
**Clearing works from inside the picker.** Open any field's picker and use the
|
|
118
118
|
clear affordance in the panel. For Print spot color it is the only one there
|
|
119
|
-
is, which is why it is not optional.
|
|
119
|
+
is, which is why it is not optional. As a proposed acceptance case, clear a
|
|
120
|
+
populated picker while its panel remains open: the stored value and the panel's
|
|
121
|
+
channel and alpha text should become empty. Switching HEX/RGB/HSB views should
|
|
122
|
+
leave the value empty; selecting a new color should populate it again.
|
|
120
123
|
|
|
121
124
|
**Switch the demo to Bulgarian.** The entry hints, the clear-value tooltip, the
|
|
122
125
|
picker's accessible name and the hex3 guidance all translate. The stored colors
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
# Conditional object fields
|
|
2
2
|
|
|
3
|
-
Config opts in; local options.conditionalFields:false overrides it.
|
|
3
|
+
Config opts in; local options.conditionalFields:false overrides it. All tabs
|
|
4
4
|
edit the same data. Switch customerType to personal: nickname replaces VAT, and
|
|
5
5
|
Name remains visible but is no longer required. Switch back: VAT is preserved.
|
|
6
6
|
Remove purchaseOrder in the Data editor to deactivate its schema dependency;
|
|
7
7
|
an empty string still counts as present. Billing address is retained in data.
|
|
8
8
|
The second tab demonstrates freely placed branch-only fields in ordinary groups.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
The third tab uses ordinary VerticalLayout, HorizontalLayout and Group elements
|
|
11
|
+
without an object Control. The root Categorization enables conditional projection
|
|
12
|
+
for its layout subtree. Name stays visible and its required star follows the
|
|
13
|
+
business condition, while inactive branch-only controls disappear. All tabs edit
|
|
14
|
+
the same data. Object Controls remain available for generated/registered details.
|
|
15
|
+
|
|
16
|
+
Enable options.conditionalFields on the first layout at the current object
|
|
17
|
+
boundary, or use the global config default. Descendant layout settings do not
|
|
18
|
+
reverse that owner's projection. A local false on the entry overrides global true.
|
|
19
|
+
Nested objects and array items use their own schema/data context.
|
|
12
20
|
Validation always uses the original schema. Hiding a field does not erase it or
|
|
13
21
|
relax additionalProperties. In Draft-07, additionalProperties:false in the base
|
|
14
22
|
schema does not recognize properties declared only in then/else: declare allowed
|
|
@@ -17,3 +25,13 @@ visibility of those base fields.
|
|
|
17
25
|
|
|
18
26
|
This example supports graphical authoring through serializable control scopes,
|
|
19
27
|
detail layouts and config. It does not include a drag-and-drop editor.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Additional acceptance cases in conformance/behavior.json cover conditions reached
|
|
31
|
+
through allOf/$ref, ordinary allOf properties and required names without an if,
|
|
32
|
+
and direct layouts whose schema type is ["object", "null"]. They reuse explicit
|
|
33
|
+
name/vat/nickname placement. Business data requires name and vat; personal data
|
|
34
|
+
replaces vat with nickname except in the unconditional allOf case. Nullable layouts
|
|
35
|
+
must preserve null through null/object/null transitions. Separate reference-context
|
|
36
|
+
cases check cache isolation, missing references and cycles. These are additional
|
|
37
|
+
acceptance vectors rather than new tabs in the interactive example.
|