@chobantonov/jsonforms-extended-spec 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +126 -2
- package/conformance/authoring.json +2680 -0
- package/conformance/behavior.json +1602 -0
- package/conformance/config-consumption.json +1542 -0
- package/conformance/expected-invalid.json +20 -0
- package/docs/audit.md +150 -0
- package/docs/conditional-fields.md +122 -0
- package/docs/draft-07-visual-support.md +43 -0
- package/docs/external-resources-proposal.md +536 -0
- package/docs/implementation-guide.md +233 -0
- package/docs/implementation-pitfalls.md +968 -0
- package/docs/implementation-web-typescript.md +41 -0
- package/docs/renderer-and-demo.md +1347 -0
- package/docs/renderer-selection.md +99 -0
- package/docs/spec.md +8470 -0
- package/docs/todo.md +166 -0
- package/examples/README.md +127 -0
- package/examples/additional-errors/README.md +176 -0
- package/examples/additional-errors/config.json +3 -0
- package/examples/additional-errors/data.json +11 -0
- package/examples/additional-errors/schema.json +56 -0
- package/examples/additional-errors/translations.json +64 -0
- package/examples/additional-errors/uischema.json +158 -0
- package/examples/additional-items-pagination/README.md +8 -0
- package/examples/additional-items-pagination/config.json +10 -0
- package/examples/additional-items-pagination/data.json +22 -0
- package/examples/additional-items-pagination/schema.json +30 -0
- package/examples/additional-items-pagination/translations.json +16 -0
- package/examples/additional-items-pagination/uischema.json +39 -0
- package/examples/additional-properties/README.md +203 -0
- package/examples/additional-properties/config.json +5 -0
- package/examples/additional-properties/data.json +31 -0
- package/examples/additional-properties/schema.json +78 -0
- package/examples/additional-properties/translations.json +80 -0
- package/examples/additional-properties/uischema.json +104 -0
- package/examples/ag-grid/README.md +62 -0
- package/examples/ag-grid/config.json +14 -0
- package/examples/ag-grid/data.json +124 -0
- package/examples/ag-grid/schema.json +48 -0
- package/examples/ag-grid/translations.json +58 -0
- package/examples/ag-grid/uischema.json +671 -0
- package/examples/array-choices/README.md +150 -0
- package/examples/array-choices/config.json +4 -0
- package/examples/array-choices/data.json +10 -0
- package/examples/array-choices/schema.json +68 -0
- package/examples/array-choices/translations.json +64 -0
- package/examples/array-choices/uischema.json +97 -0
- package/examples/array-controls/README.md +237 -0
- package/examples/array-controls/config.json +4 -0
- package/examples/array-controls/data.json +147 -0
- package/examples/array-controls/schema.json +374 -0
- package/examples/array-controls/translations.json +186 -0
- package/examples/array-controls/uischema.json +685 -0
- package/examples/array-detail-modes/README.md +11 -0
- package/examples/array-detail-modes/data.json +38 -0
- package/examples/array-detail-modes/schema.json +89 -0
- package/examples/array-detail-modes/translations.json +36 -0
- package/examples/array-detail-modes/uischema.json +73 -0
- package/examples/array-detail-modes/uischemas.d.mts +2 -0
- package/examples/array-detail-modes/uischemas.json +15 -0
- package/examples/boolean-controls/README.md +109 -0
- package/examples/boolean-controls/config.json +3 -0
- package/examples/boolean-controls/data.json +27 -0
- package/examples/boolean-controls/schema.json +98 -0
- package/examples/boolean-controls/translations.json +94 -0
- package/examples/boolean-controls/uischema.json +126 -0
- package/examples/button-actions/README.md +259 -0
- package/examples/button-actions/config.json +7 -0
- package/examples/button-actions/data.json +5 -0
- package/examples/button-actions/host.mjs +14 -0
- package/examples/button-actions/schema.json +20 -0
- package/examples/button-actions/translations.json +60 -0
- package/examples/button-actions/uischema.json +179 -0
- package/examples/catalog.json +634 -0
- package/examples/categorization/README.md +132 -0
- package/examples/categorization/config.json +7 -0
- package/examples/categorization/data.json +8 -0
- package/examples/categorization/schema.json +29 -0
- package/examples/categorization/translations.json +72 -0
- package/examples/categorization/uischema.json +288 -0
- package/examples/choice-controls/README.md +136 -0
- package/examples/choice-controls/config.json +10 -0
- package/examples/choice-controls/data.json +61 -0
- package/examples/choice-controls/schema.json +406 -0
- package/examples/choice-controls/translations.json +154 -0
- package/examples/choice-controls/uischema.json +575 -0
- package/examples/choice-controls/uischemas.d.mts +2 -0
- package/examples/choice-controls/uischemas.json +16 -0
- package/examples/code-editor/README.md +74 -0
- package/examples/code-editor/data.json +8 -0
- package/examples/code-editor/schema.json +28 -0
- package/examples/code-editor/translations.json +20 -0
- package/examples/code-editor/uischema.json +77 -0
- package/examples/collection-pagination/README.md +5 -0
- package/examples/collection-pagination/config.json +1 -0
- package/examples/collection-pagination/data.json +64 -0
- package/examples/collection-pagination/schema.json +23 -0
- package/examples/collection-pagination/translations.json +14 -0
- package/examples/collection-pagination/uischema.json +14 -0
- package/examples/color-control/README.md +154 -0
- package/examples/color-control/config.json +7 -0
- package/examples/color-control/data.json +11 -0
- package/examples/color-control/schema.json +61 -0
- package/examples/color-control/translations.json +76 -0
- package/examples/color-control/uischema.json +106 -0
- package/examples/combinators/README.md +223 -0
- package/examples/combinators/config.json +9 -0
- package/examples/combinators/data.json +23 -0
- package/examples/combinators/schema.json +232 -0
- package/examples/combinators/translations.json +178 -0
- package/examples/combinators/uischema.json +158 -0
- package/examples/conditional-fields/README.md +27 -0
- package/examples/conditional-fields/config.json +5 -0
- package/examples/conditional-fields/data.json +7 -0
- package/examples/conditional-fields/schema.json +59 -0
- package/examples/conditional-fields/translations.json +32 -0
- package/examples/conditional-fields/uischema.json +131 -0
- package/examples/container-validation-indicator/README.md +187 -0
- package/examples/container-validation-indicator/config.json +9 -0
- package/examples/container-validation-indicator/data.json +68 -0
- package/examples/container-validation-indicator/schema.json +222 -0
- package/examples/container-validation-indicator/translations.json +120 -0
- package/examples/container-validation-indicator/uischema.json +98 -0
- package/examples/cron-control/README.md +155 -0
- package/examples/cron-control/data.json +15 -0
- package/examples/cron-control/schema.json +72 -0
- package/examples/cron-control/translations.json +80 -0
- package/examples/cron-control/uischema.json +91 -0
- package/examples/destructive-confirmation/README.md +210 -0
- package/examples/destructive-confirmation/config.json +17 -0
- package/examples/destructive-confirmation/data.json +86 -0
- package/examples/destructive-confirmation/schema.json +204 -0
- package/examples/destructive-confirmation/translations.json +112 -0
- package/examples/destructive-confirmation/uischema.json +105 -0
- package/examples/draft-07-metaschema/README.md +11 -0
- package/examples/draft-07-metaschema/config.json +3 -0
- package/examples/draft-07-metaschema/data.json +25 -0
- package/examples/draft-07-metaschema/schema.json +172 -0
- package/examples/draft-07-metaschema/translations.json +10 -0
- package/examples/draft-07-metaschema/uischema.json +14 -0
- package/examples/dynamic-playground/README.md +95 -0
- package/examples/dynamic-playground/config.json +8 -0
- package/examples/dynamic-playground/configuration.json +152 -0
- package/examples/dynamic-playground/data.json +15 -0
- package/examples/dynamic-playground/dynamic-uischema.json +379 -0
- package/examples/dynamic-playground/host.mjs +37 -0
- package/examples/dynamic-playground/schema.json +48 -0
- package/examples/dynamic-playground/translations.json +76 -0
- package/examples/dynamic-playground/uischema.json +36 -0
- package/examples/editor-details/README.md +10 -0
- package/examples/editor-details/data.json +18 -0
- package/examples/editor-details/schema.json +49 -0
- package/examples/editor-details/translations.json +28 -0
- package/examples/editor-details/uischema.json +53 -0
- package/examples/editor-details/uischemas.d.mts +2 -0
- package/examples/editor-details/uischemas.json +14 -0
- package/examples/file-control/README.md +108 -0
- package/examples/file-control/data.json +28 -0
- package/examples/file-control/schema.json +89 -0
- package/examples/file-control/translations.json +46 -0
- package/examples/file-control/uischema.json +152 -0
- package/examples/group-layout/README.md +149 -0
- package/examples/group-layout/config.json +10 -0
- package/examples/group-layout/data.json +9 -0
- package/examples/group-layout/schema.json +51 -0
- package/examples/group-layout/translations.json +62 -0
- package/examples/group-layout/uischema.json +249 -0
- package/examples/index.d.ts +17 -0
- package/examples/index.js +69 -0
- package/examples/input-adornments/README.md +68 -0
- package/examples/input-adornments/data.json +41 -0
- package/examples/input-adornments/schema.json +207 -0
- package/examples/input-adornments/translations.json +106 -0
- package/examples/input-adornments/uischema.json +695 -0
- package/examples/job-application/README.md +23 -0
- package/examples/job-application/config.json +10 -0
- package/examples/job-application/data.json +68 -0
- package/examples/job-application/schema.json +196 -0
- package/examples/job-application/translations.json +388 -0
- package/examples/job-application/uischema.json +218 -0
- package/examples/job-application/uischemas.json +153 -0
- package/examples/json-editor/README.md +28 -0
- package/examples/json-editor/schema.json +1 -0
- package/examples/json-editor/translations.json +10 -0
- package/examples/json-editor/uischema.json +16 -0
- package/examples/json-inference/README.md +33 -0
- package/examples/json-inference/translations.json +10 -0
- package/examples/json-inference/uischema.json +16 -0
- package/examples/kitchen-sink/README.md +86 -0
- package/examples/kitchen-sink/config.json +14 -0
- package/examples/kitchen-sink/data.json +263 -0
- package/examples/kitchen-sink/invalid-data.json +263 -0
- package/examples/kitchen-sink/schema.json +515 -0
- package/examples/kitchen-sink/translations.json +270 -0
- package/examples/kitchen-sink/uischema.json +722 -0
- package/examples/label-interpolation/README.md +241 -0
- package/examples/label-interpolation/config.json +14 -0
- package/examples/label-interpolation/data.json +13 -0
- package/examples/label-interpolation/schema.json +64 -0
- package/examples/label-interpolation/translations.json +94 -0
- package/examples/label-interpolation/uischema.json +379 -0
- package/examples/layout-sizing/README.md +162 -0
- package/examples/layout-sizing/config.json +10 -0
- package/examples/layout-sizing/data.json +14 -0
- package/examples/layout-sizing/schema.json +58 -0
- package/examples/layout-sizing/translations.json +42 -0
- package/examples/layout-sizing/uischema.json +558 -0
- package/examples/markup-label/README.md +109 -0
- package/examples/markup-label/config.json +16 -0
- package/examples/markup-label/data.json +5 -0
- package/examples/markup-label/schema.json +24 -0
- package/examples/markup-label/translations.json +40 -0
- package/examples/markup-label/uischema.json +149 -0
- package/examples/mixed-control/README.md +164 -0
- package/examples/mixed-control/config.json +11 -0
- package/examples/mixed-control/data.json +70 -0
- package/examples/mixed-control/schema.json +221 -0
- package/examples/mixed-control/translations.json +158 -0
- package/examples/mixed-control/uischema.json +211 -0
- package/examples/null-control/README.md +111 -0
- package/examples/null-control/config.json +4 -0
- package/examples/null-control/data.json +6 -0
- package/examples/null-control/schema.json +36 -0
- package/examples/null-control/translations.json +42 -0
- package/examples/null-control/uischema.json +56 -0
- package/examples/numeric-controls/README.md +94 -0
- package/examples/numeric-controls/config.json +4 -0
- package/examples/numeric-controls/data.json +8 -0
- package/examples/numeric-controls/schema.json +52 -0
- package/examples/numeric-controls/translations.json +56 -0
- package/examples/numeric-controls/uischema.json +77 -0
- package/examples/object-control/README.md +220 -0
- package/examples/object-control/config.json +4 -0
- package/examples/object-control/data.json +62 -0
- package/examples/object-control/schema.json +252 -0
- package/examples/object-control/translations.json +160 -0
- package/examples/object-control/uischema.json +275 -0
- package/examples/object-control/uischemas.d.mts +2 -0
- package/examples/object-control/uischemas.json +59 -0
- package/examples/password-control/README.md +119 -0
- package/examples/password-control/config.json +3 -0
- package/examples/password-control/data.json +18 -0
- package/examples/password-control/schema.json +65 -0
- package/examples/password-control/translations.json +64 -0
- package/examples/password-control/uischema.json +94 -0
- package/examples/pre-touch-errors/README.md +176 -0
- package/examples/pre-touch-errors/config.json +4 -0
- package/examples/pre-touch-errors/data.json +5 -0
- package/examples/pre-touch-errors/schema.json +56 -0
- package/examples/pre-touch-errors/translations.json +68 -0
- package/examples/pre-touch-errors/uischema.json +85 -0
- package/examples/presentation/README.md +148 -0
- package/examples/presentation/config.json +9 -0
- package/examples/presentation/data.json +6 -0
- package/examples/presentation/schema.json +21 -0
- package/examples/presentation/translations.json +64 -0
- package/examples/presentation/uischema.json +210 -0
- package/examples/property-pagination/README.md +5 -0
- package/examples/property-pagination/config.json +1 -0
- package/examples/property-pagination/data.json +17 -0
- package/examples/property-pagination/schema.json +14 -0
- package/examples/property-pagination/translations.json +10 -0
- package/examples/property-pagination/uischema.json +24 -0
- package/examples/recursive-tree/README.md +49 -0
- package/examples/recursive-tree/config.json +1 -0
- package/examples/recursive-tree/data.json +40 -0
- package/examples/recursive-tree/schema.json +89 -0
- package/examples/recursive-tree/translations.json +42 -0
- package/examples/recursive-tree/uischema.json +84 -0
- package/examples/recursive-tree/uischemas.d.mts +2 -0
- package/examples/recursive-tree/uischemas.json +51 -0
- package/examples/split-layout/README.md +123 -0
- package/examples/split-layout/config.json +3 -0
- package/examples/split-layout/data.json +13 -0
- package/examples/split-layout/schema.json +50 -0
- package/examples/split-layout/translations.json +50 -0
- package/examples/split-layout/uischema.json +204 -0
- package/examples/string-controls/README.md +159 -0
- package/examples/string-controls/config.json +5 -0
- package/examples/string-controls/data.json +13 -0
- package/examples/string-controls/schema.json +70 -0
- package/examples/string-controls/translations.json +76 -0
- package/examples/string-controls/uischema.json +148 -0
- package/examples/table-row-details/README.md +69 -0
- package/examples/table-row-details/config.json +7 -0
- package/examples/table-row-details/data.json +280 -0
- package/examples/table-row-details/schema.json +61 -0
- package/examples/table-row-details/translations.json +56 -0
- package/examples/table-row-details/uischema.json +1303 -0
- package/examples/template-layout/README.md +250 -0
- package/examples/template-layout/config.json +9 -0
- package/examples/template-layout/data.json +20 -0
- package/examples/template-layout/host.mjs +13 -0
- package/examples/template-layout/schema.json +48 -0
- package/examples/template-layout/translations.json +70 -0
- package/examples/template-layout/uischema.json +177 -0
- package/examples/template-slots/README.md +19 -0
- package/examples/template-slots/data.json +4 -0
- package/examples/template-slots/schema.json +11 -0
- package/examples/template-slots/translations.json +26 -0
- package/examples/template-slots/uischema.json +47 -0
- package/examples/template-slots/uischemas.d.mts +2 -0
- package/examples/template-slots/uischemas.json +56 -0
- package/examples/temporal-controls/README.md +325 -0
- package/examples/temporal-controls/data.json +44 -0
- package/examples/temporal-controls/schema.json +208 -0
- package/examples/temporal-controls/translations.json +156 -0
- package/examples/temporal-controls/uischema.json +297 -0
- package/examples/tree-max-depth/README.md +5 -0
- package/examples/tree-max-depth/config.json +3 -0
- package/examples/tree-max-depth/data.json +31 -0
- package/examples/tree-max-depth/schema.json +258 -0
- package/examples/tree-max-depth/translations.json +42 -0
- package/examples/tree-max-depth/uischema.json +16 -0
- package/examples/tree-max-depth/uischemas.d.mts +2 -0
- package/examples/tree-max-depth/uischemas.json +50 -0
- package/examples/tuple-control/README.md +335 -0
- package/examples/tuple-control/config.json +4 -0
- package/examples/tuple-control/data.json +61 -0
- package/examples/tuple-control/schema.json +218 -0
- package/examples/tuple-control/translations.json +142 -0
- package/examples/tuple-control/uischema.json +128 -0
- package/examples/tuple-control/uischemas.d.mts +2 -0
- package/examples/tuple-control/uischemas.json +125 -0
- package/examples/validator-profile/README.md +197 -0
- package/examples/validator-profile/config.json +9 -0
- package/examples/validator-profile/data.json +16 -0
- package/examples/validator-profile/schema.json +139 -0
- package/examples/validator-profile/translations.json +34 -0
- package/examples/validator-profile/uischema.json +59 -0
- package/package.json +83 -3
- package/provenance.json +140 -0
- package/schemas/README.md +82 -0
- package/schemas/example.schema.json +37 -0
- package/schemas/jsonforms-config.schema.json +427 -0
- package/schemas/jsonforms-dynamic-uischema.schema.json +220 -0
- package/schemas/jsonforms-extended-config.schema.json +332 -0
- package/schemas/jsonforms-extended-uischema.schema.json +1932 -0
- package/schemas/jsonforms-rule.schema.json +104 -0
- package/schemas/jsonforms-uischema.schema.json +1434 -0
- package/typescript/README.md +546 -0
- package/typescript/lib/authoring/cssLength.d.ts +33 -0
- package/typescript/lib/authoring/cssLength.js +25 -0
- package/typescript/lib/authoring/dynamic.d.ts +73 -0
- package/typescript/lib/authoring/dynamic.js +8 -0
- package/typescript/lib/authoring/forSchema.d.ts +385 -0
- package/typescript/lib/authoring/forSchema.js +84 -0
- package/typescript/lib/authoring/schemaTypes.d.ts +111 -0
- package/typescript/lib/authoring/schemaTypes.js +15 -0
- package/typescript/lib/index.d.ts +4 -0
- package/typescript/lib/index.js +20 -0
- package/typescript/package.json +1 -0
- package/typescript/src/authoring/cssLength.ts +79 -0
- package/typescript/src/authoring/dynamic.ts +96 -0
- package/typescript/src/authoring/forSchema.ts +428 -0
- package/typescript/src/authoring/schemaTypes.ts +143 -0
- package/typescript/src/index.ts +4 -0
- package/typescript/test/schemaContract.test.ts +638 -0
- package/typescript/test/tsconfig.json +10 -0
- package/typescript/test/typedAuthoring.test.ts +151 -0
- package/typescript/test/typedAuthoringCoverage.test.ts +178 -0
- package/typescript/test/typedAuthoringCssLength.test.ts +81 -0
- package/typescript/test/typedAuthoringNames.test.ts +90 -0
- package/typescript/test/typedDynamic.test.ts +88 -0
- package/typescript/tsconfig.json +15 -0
package/docs/todo.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Design and implementation backlog
|
|
2
|
+
|
|
3
|
+
The published JSON schemas describe the authoring vocabulary. A
|
|
4
|
+
feature appearing in spec.md does not by itself qualify for a schema definition.
|
|
5
|
+
This backlog separates proposals from implementation work. Renderer projects
|
|
6
|
+
record their own coverage and implementation issues.
|
|
7
|
+
|
|
8
|
+
- **FUTURE:** discuss and refine the design before implementing it.
|
|
9
|
+
- **TODO:** complete or verify implementation and behavior tests before exposing
|
|
10
|
+
the option in the published schemas.
|
|
11
|
+
|
|
12
|
+
Unknown extension keys remain allowed by the schemas. Such acceptance does not
|
|
13
|
+
validate the feature's shape or claim it is supported. We do not publish a second
|
|
14
|
+
schema containing speculative options.
|
|
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
|
+
|
|
33
|
+
## TODO — portable input adornment verification
|
|
34
|
+
|
|
35
|
+
The serialized `startAdornment` / `endAdornment` contract is specified in
|
|
36
|
+
[§18.3a](spec.md#183a-input-adornments), with a tabbed
|
|
37
|
+
[example](../examples/input-adornments/README.md). Complete the fixture's visual
|
|
38
|
+
interaction checklist across families, locales, narrow widths, and writing
|
|
39
|
+
directions. Add explicit
|
|
40
|
+
unsupported-variant diagnostics where a renderer cannot provide a coherent
|
|
41
|
+
input boundary. The authoring and behavior vectors alone are not evidence of
|
|
42
|
+
those remaining adapter checks.
|
|
43
|
+
|
|
44
|
+
<a id="future--dynamic-ui-element-overlays"></a>
|
|
45
|
+
|
|
46
|
+
## EXPERIMENTAL — dynamic UI-element overlays
|
|
47
|
+
|
|
48
|
+
`$dynamic` is an experimental profile, not a static v1 conformance requirement.
|
|
49
|
+
The common/extended static schemas and canonical conformance vectors remain
|
|
50
|
+
separate from the experimental descriptor schema and adapter tests.
|
|
51
|
+
|
|
52
|
+
### Experimental profile
|
|
53
|
+
|
|
54
|
+
- Element-shaped patches and ordered rules, restricted `bind`/`template` paths,
|
|
55
|
+
CEL expressions and explicitly opted-in trusted functions.
|
|
56
|
+
- Authored object patches versus complete descriptor values; fallback, JSON
|
|
57
|
+
safety, own-property access and prototype protection.
|
|
58
|
+
- Config-only `jsonformsExtended.dynamic.enabled` activation and host-owned `external`, also exposed
|
|
59
|
+
to templates as `context.external`; immutable
|
|
60
|
+
environment snapshots and reevaluation when input namespaces change.
|
|
61
|
+
- Resolution before renderer/cell selection, parent-consumed metadata, and
|
|
62
|
+
nested/detail occurrences.
|
|
63
|
+
- Group `cover`, `header`, and `footer` children resolve through dynamic
|
|
64
|
+
dispatch. Verify region updates, the effective header Label's accessible
|
|
65
|
+
name, and preservation of the mounted body editor.
|
|
66
|
+
- Immediate draft discard on editor replacement, scope-change editing sessions,
|
|
67
|
+
and adapter-specific focus handoff and cancellation. Verify coverage for every
|
|
68
|
+
claimed editor boundary.
|
|
69
|
+
- The experimental `jsonforms-dynamic-uischema.schema.json`, TypeScript authoring
|
|
70
|
+
helpers, and the combined [playground](../examples/dynamic-playground/README.md),
|
|
71
|
+
including its External editor and static host-derived alternative.
|
|
72
|
+
|
|
73
|
+
The normative experimental behavior and limitations are in
|
|
74
|
+
[spec §11](spec.md#11-dynamic-values-and-path-grammar). Adapter resolver, lifecycle
|
|
75
|
+
and demo tests are evidence only for the scenarios they execute.
|
|
76
|
+
|
|
77
|
+
### Remaining decisions and verification
|
|
78
|
+
|
|
79
|
+
- Additional namespace-permission policies across adapters. Activation is settled:
|
|
80
|
+
`jsonformsExtended.dynamic.enabled`; the Label interpolation gate is independent.
|
|
81
|
+
- Broader CEL function coverage and consistent evaluation-cost limits across engines.
|
|
82
|
+
- Additional environment exposure beyond current core validation `errors`.
|
|
83
|
+
Host/editor errors and a separate mutable `state` API are not part of this profile.
|
|
84
|
+
- A universal focus/cancellation protocol and a recorded coverage matrix for
|
|
85
|
+
renderer families, internal editor changes, nested/generated/registered details,
|
|
86
|
+
cells, templates, web components and additional adapters.
|
|
87
|
+
- API versioning and the evidence required before promotion into portable
|
|
88
|
+
conformance or the published common/extended static schemas.
|
|
89
|
+
|
|
90
|
+
Remote choice providers remain a separate design; overlays do not introduce
|
|
91
|
+
network acquisition, refresh or cancellation vocabulary for choices.
|
|
92
|
+
|
|
93
|
+
**Existing feature to preserve:** Label interpolation uses
|
|
94
|
+
`jsonformsExtended.dynamicValues.enabled` and its namespace gates. It is separate
|
|
95
|
+
from the overlay resolver and does not grant CEL or trusted-function activation.
|
|
96
|
+
|
|
97
|
+
## FUTURE — other designs
|
|
98
|
+
|
|
99
|
+
| Feature | Work needed | Published schemas |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| Timezone conversion and selectors | Settle source/display/save zone semantics, daylight-saving ambiguity, time-only reference dates and draft lifecycle, then implement. | No `timezone`, `saveTimezone`, `showTimezoneSelector` or `timezoneChangeMode` definitions. |
|
|
102
|
+
| Layout `start` and `responsive` hints | Define placement, breakpoints, precedence and interaction with span/wrap/splitters, then implement. | Removed reserved definitions from child sizing. |
|
|
103
|
+
| Remote choice providers | Define acquisition, cancellation, refresh, typed values and permissions separately from overlays; see the [external resources design](external-resources-proposal.md). | No provider vocabulary. |
|
|
104
|
+
| Markdown images and raw HTML | Decide whether these capabilities are wanted and define separate security profiles before implementation. | No enabling options; both supported Markdown profiles exclude these features. |
|
|
105
|
+
|
|
106
|
+
## Proposed authoring features awaiting design or implementation
|
|
107
|
+
|
|
108
|
+
Composite-dialog removal settings,
|
|
109
|
+
a separate clear-button option, pending-analysis/submit policy, touch-aware
|
|
110
|
+
container summaries, and structured diagnostics require a settled contract and
|
|
111
|
+
behavioral evidence before their authoring shapes are promoted. Their absence
|
|
112
|
+
from the published schemas is intentional; permissive extension keys do not
|
|
113
|
+
promise support.
|
|
114
|
+
|
|
115
|
+
Implementation-specific findings belong in each renderer project.
|
|
116
|
+
|
|
117
|
+
## Promotion checklist
|
|
118
|
+
|
|
119
|
+
1. Settle the design and update the single specification.
|
|
120
|
+
2. Implement the feature in an adapter or shared core.
|
|
121
|
+
3. Add behavioral tests, including unsupported and invalid-input cases.
|
|
122
|
+
4. Add only the implemented authoring shape to the schemas, with positive and
|
|
123
|
+
negative schema vectors and a worked example.
|
|
124
|
+
5. Remove or narrow the corresponding backlog entry in the same change.
|
|
125
|
+
|
|
126
|
+
## Authoring and renderer evidence
|
|
127
|
+
|
|
128
|
+
TypeScript `OptionsFor` is a curated subset, not generated from JSON schemas.
|
|
129
|
+
Applicability involving enum choices, bounds or format still needs runtime checks.
|
|
130
|
+
Add per-capability vectors linking tester selection, option declarations,
|
|
131
|
+
authoring acceptance, and renderer behavior. Open schemas accepting an option
|
|
132
|
+
must never be interpreted as evidence that a renderer implements it.
|
|
133
|
+
|
|
134
|
+
## TODO — remaining Draft-07 visual behavior
|
|
135
|
+
|
|
136
|
+
Broader conditional composition coverage remains open. Each renderer project
|
|
137
|
+
tracks its own executable work.
|
|
138
|
+
|
|
139
|
+
- Extend conditional discovery and authored placement across anyOf/oneOf,
|
|
140
|
+
referenced branches and named templates, with reference-scope regressions.
|
|
141
|
+
- Add contains matching-item feedback and explanations of not failures. Do not
|
|
142
|
+
infer editable fields from a negated schema.
|
|
143
|
+
- Implement boolean false presentation with absence as the quiet default:
|
|
144
|
+
hide absent optional forbidden fields and exclude them from add choices.
|
|
145
|
+
Existing forbidden data must have visible feedback and an allowed removal
|
|
146
|
+
path, without automatic deletion. Root false and required false properties
|
|
147
|
+
need an impossibility explanation, since deleting data cannot make them valid.
|
|
148
|
+
In a graphical schema editor, prohibitions remain visible to the author.
|
|
149
|
+
- Settle explicit default/example actions and writeOnly summary/preview policy.
|
|
150
|
+
- Broaden reference-scope coverage and assess useful format/content editors.
|
|
151
|
+
|
|
152
|
+
## FUTURE — graphical authoring for Draft-07 constraints
|
|
153
|
+
|
|
154
|
+
Provide constraint panels and reference selection, preserve unsupported keywords
|
|
155
|
+
on round trips, and keep inactive-branch preview state separate from runtime data.
|
|
156
|
+
Drag/drop must preserve field bindings and unknown options. These editor features
|
|
157
|
+
are planned work, not implemented capabilities or new published option shapes.
|
|
158
|
+
See [conditional authoring guidance](conditional-fields.md).
|
|
159
|
+
|
|
160
|
+
## Completed authoring work
|
|
161
|
+
|
|
162
|
+
Mixed type-specific details, shared editor detail modes, conditional object field
|
|
163
|
+
discovery and Template/Slot examples now have documented authoring contracts and
|
|
164
|
+
regression coverage. Their implemented slices are in the published schemas.
|
|
165
|
+
Remaining conditional-composition and named-template diagnostic/cycle gaps belong
|
|
166
|
+
in renderer backlogs. The drag-and-drop editor itself remains future work.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Specification examples
|
|
2
|
+
|
|
3
|
+
These 50 example groups share the portable [specification](../docs/spec.md). Each
|
|
4
|
+
folder contains authored JSON, English/Bulgarian translations and a walkthrough.
|
|
5
|
+
The [catalog](catalog.json) lists files and required host capabilities.
|
|
6
|
+
|
|
7
|
+
| Example | Primary spec section |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| [Additional errors: server and editor](additional-errors/README.md) | [15.6](../docs/spec.md#156-renderer-published-additional-errors) |
|
|
10
|
+
| [Additional items pagination: shipping](additional-items-pagination/README.md) | [18.21.1](../docs/spec.md#18211-collection-pagination-and-whole-row-details) |
|
|
11
|
+
| [Additional properties](additional-properties/README.md) | [18.16](../docs/spec.md#1816-object-controls-and-dynamic-properties) |
|
|
12
|
+
| [AG Grid: portable options and native overrides](ag-grid/README.md) | [18.18.1](../docs/spec.md#18181-data-grid-array-control) |
|
|
13
|
+
| [Array choices and tokens](array-choices/README.md) | [18.29](../docs/spec.md#1829-array-choices-and-tokens) |
|
|
14
|
+
| [Array controls](array-controls/README.md) | [18.21](../docs/spec.md#1821-expandable-arrays-and-list-with-detail) |
|
|
15
|
+
| [Array detail modes: generated and registered](array-detail-modes/README.md) | [18.6](../docs/spec.md#186-shared-detail-ui-schema-selection) |
|
|
16
|
+
| [Boolean controls](boolean-controls/README.md) | [18.19](../docs/spec.md#1819-scalar-controls-and-temporal-editing) |
|
|
17
|
+
| [Button actions](button-actions/README.md) | [14](../docs/spec.md#14-button-actions-and-script) |
|
|
18
|
+
| [Categorization: tabs, stepper, accordion](categorization/README.md) | [8.6](../docs/spec.md#86-categorization) |
|
|
19
|
+
| [Choice controls](choice-controls/README.md) | [18.5](../docs/spec.md#185-choice-and-suggested-string-controls) |
|
|
20
|
+
| [Code editor](code-editor/README.md) | [18.26](../docs/spec.md#1826-code-editor-profile) |
|
|
21
|
+
| [Collection pagination: recruitment](collection-pagination/README.md) | [18.21.1](../docs/spec.md#18211-collection-pagination-and-whole-row-details) |
|
|
22
|
+
| [Color control](color-control/README.md) | [18.27](../docs/spec.md#1827-file-and-color-profile-details) |
|
|
23
|
+
| [Combinators and schema conditions](combinators/README.md) | [18.15](../docs/spec.md#1815-combinator-controls) |
|
|
24
|
+
| [Conditional fields: generated and authored layouts](conditional-fields/README.md) | [Appendix A](../docs/spec.md#conditional-fields) |
|
|
25
|
+
| [Container validation indicator](container-validation-indicator/README.md) | [8.3](../docs/spec.md#83-the-container-validation-indicator) |
|
|
26
|
+
| [Cron control](cron-control/README.md) | [18.25](../docs/spec.md#1825-cron-control) |
|
|
27
|
+
| [Destructive-change confirmation](destructive-confirmation/README.md) | [14.3](../docs/spec.md#143-shared-destructive-change-confirmation) |
|
|
28
|
+
| [Draft-07 metaschema](draft-07-metaschema/README.md) | [29](../docs/spec.md#29-json-schema-artifacts-and-validation-boundary) |
|
|
29
|
+
| [Editor details: objects, mixed types, and cells](editor-details/README.md) | [18.6](../docs/spec.md#186-shared-detail-ui-schema-selection) |
|
|
30
|
+
| [Dynamic playground: preview and configuration forms](dynamic-playground/README.md) | [11](../docs/spec.md#11-dynamic-values-and-path-grammar) |
|
|
31
|
+
| [File control](file-control/README.md) | [18.18.4](../docs/spec.md#18184-file-control) |
|
|
32
|
+
| [Group layout](group-layout/README.md) | [8.1](../docs/spec.md#81-group) |
|
|
33
|
+
| [Input adornments](input-adornments/README.md) | [18.3a](../docs/spec.md#183a-input-adornments) |
|
|
34
|
+
| [JSON editor: any JSON type](json-editor/README.md) | [18.20](../docs/spec.md#1820-mixed-value-controls-and-navigation) |
|
|
35
|
+
| [JSON inference: paste data without a schema](json-inference/README.md) | [18.20](../docs/spec.md#1820-mixed-value-controls-and-navigation) |
|
|
36
|
+
| [Kitchen sink: job application](kitchen-sink/README.md) | [24](../docs/spec.md#24-examples-requirement) |
|
|
37
|
+
| [Label interpolation](label-interpolation/README.md) | [9](../docs/spec.md#9-internationalizable-text) |
|
|
38
|
+
| [Layout sizing](layout-sizing/README.md) | [6](../docs/spec.md#6-layout-types-and-sizing) |
|
|
39
|
+
| [Markup labels](markup-label/README.md) | [10](../docs/spec.md#10-markdown-policy) |
|
|
40
|
+
| [Mixed control](mixed-control/README.md) | [18.20](../docs/spec.md#1820-mixed-value-controls-and-navigation) |
|
|
41
|
+
| [Null control](null-control/README.md) | [18](../docs/spec.md#18-renderer-behaviour-specifications) |
|
|
42
|
+
| [Numeric controls: numbers and integers](numeric-controls/README.md) | [18.19](../docs/spec.md#1819-scalar-controls-and-temporal-editing) |
|
|
43
|
+
| [Object control](object-control/README.md) | [18.16](../docs/spec.md#1816-object-controls-and-dynamic-properties) |
|
|
44
|
+
| [Password control](password-control/README.md) | [18.24](../docs/spec.md#1824-one-time-password-presentation) |
|
|
45
|
+
| [Pre-touch error filtering](pre-touch-errors/README.md) | [15.7](../docs/spec.md#157-pre-touch-error-filtering) |
|
|
46
|
+
| [Presentation elements](presentation/README.md) | [13](../docs/spec.md#13-imageview-separator-link-and-templates) |
|
|
47
|
+
| [Property pagination: booking](property-pagination/README.md) | [18.21.1](../docs/spec.md#18211-collection-pagination-and-whole-row-details) |
|
|
48
|
+
| [Recursive tree: files and folders](recursive-tree/README.md) | [Appendix A](../docs/spec.md#recursive-node-tree-presentation) |
|
|
49
|
+
| [Split layout](split-layout/README.md) | [7.3](../docs/spec.md#73-splitter) |
|
|
50
|
+
| [String controls](string-controls/README.md) | [18.18.6](../docs/spec.md#18186-masked-string-control) |
|
|
51
|
+
| [Table row details: recruitment](table-row-details/README.md) | [18.21.1](../docs/spec.md#18211-collection-pagination-and-whole-row-details) |
|
|
52
|
+
| [Template layout: string and native profiles](template-layout/README.md) | [13.5](../docs/spec.md#135-templatelayout) |
|
|
53
|
+
| [Templates and slots: named UI schema reuse](template-slots/README.md) | [13.4](../docs/spec.md#134-template-and-slot) |
|
|
54
|
+
| [Temporal controls](temporal-controls/README.md) | [18.19](../docs/spec.md#1819-scalar-controls-and-temporal-editing) |
|
|
55
|
+
| [Tree: maximum five levels](tree-max-depth/README.md) | [Appendix A](../docs/spec.md#finite-tree-depth) |
|
|
56
|
+
| [Tuple control](tuple-control/README.md) | [18.11](../docs/spec.md#1811-tuple-control-positional-array-fields) |
|
|
57
|
+
| [Validator profile (Ajv)](validator-profile/README.md) | [15.9](../docs/spec.md#159-data-schemas-rules-and-validator-profile) |
|
|
58
|
+
|
|
59
|
+
## Dynamic playground
|
|
60
|
+
|
|
61
|
+
The [two-form dynamic playground](dynamic-playground/README.md) is the single
|
|
62
|
+
catalog example for `$dynamic`. It combines basic presentation settings with
|
|
63
|
+
advanced context, structural and renderer-selection cases. Its External editor
|
|
64
|
+
and configuration form share host state independently of business data.
|
|
65
|
+
The static UI schema and host helper remain a basic fallback for hosts without
|
|
66
|
+
the experimental resolver; they do not implement the advanced cases.
|
|
67
|
+
|
|
68
|
+
## Loading and validation
|
|
69
|
+
|
|
70
|
+
Pass `schema.json`, `uischema.json` and `data.json` to the form host. Apply
|
|
71
|
+
`config.json` and `translations.json` where present. Create a translator for the
|
|
72
|
+
active locale and rebuild it when that locale changes.
|
|
73
|
+
|
|
74
|
+
Registered UI schemas live in portable `uischemas.json`. Each entry has a
|
|
75
|
+
`uischema` and an optional declarative `match`. A named template omits `match`
|
|
76
|
+
and is looked up by `uischema.name`. A ranked detail entry uses these fields:
|
|
77
|
+
|
|
78
|
+
- `rank`: score returned when all conditions match (otherwise -1).
|
|
79
|
+
- `schemaPointer`: JSON Pointer into the candidate data schema.
|
|
80
|
+
- `equals` or `exists: true`: compare the pointer value or require it to exist.
|
|
81
|
+
- `schemaPath` and `notSchemaPath`: optional exact path filters.
|
|
82
|
+
|
|
83
|
+
The generated JavaScript examples export converts these JSON match objects to
|
|
84
|
+
JSON Forms tester functions. Other language hosts can evaluate the same fields
|
|
85
|
+
without JavaScript. Button and template examples offer optional native hooks in
|
|
86
|
+
`host.mjs`; string template engines and script evaluation are separate
|
|
87
|
+
capabilities and permissions.
|
|
88
|
+
|
|
89
|
+
Invalid initial data demonstrates validation and preservation. The portable
|
|
90
|
+
package checks schema/UI/config authoring; the renderer adapter suite checks
|
|
91
|
+
interaction and business-data validation with its chosen validator profile.
|
|
92
|
+
The [negative authoring cases](../conformance/expected-invalid.json) are explicit.
|
|
93
|
+
The static site displays documentation and assets; it never executes the examples.
|
|
94
|
+
|
|
95
|
+
## Consuming the catalog
|
|
96
|
+
|
|
97
|
+
`@chobantonov/jsonforms-extended-spec/examples` exports every catalog entry with
|
|
98
|
+
its JSON assets and optional UI-schema registry. `pnpm generate:examples` rebuilds
|
|
99
|
+
that module, and test/build/pack run generation automatically. Consumers add the
|
|
100
|
+
`spec-` ID prefix at registration; no framework-specific per-example list is needed.
|
|
101
|
+
|
|
102
|
+
English example titles should begin with the feature named by the stable example ID. Add a domain or further explanation after a colon when useful. IDs remain stable when titles are clarified.
|
|
103
|
+
|
|
104
|
+
## Generic JSON and inferred forms
|
|
105
|
+
|
|
106
|
+
- [JSON editor: any JSON type](json-editor/README.md) starts without data and uses an explicit `{}` schema.
|
|
107
|
+
- [JSON inference: paste data without a schema](json-inference/README.md) omits schema and data; apply JSON in the Data editor to generate a form.
|
|
108
|
+
|
|
109
|
+
Catalog assets are optional. Preserve omitted schema/data rather than replacing them with `{}`/`null`; those values have different meanings.
|
|
110
|
+
|
|
111
|
+
- [Array detail modes](array-detail-modes/README.md): default, generated, registered, fallback, and inline layouts.
|
|
112
|
+
|
|
113
|
+
- [Editor details](editor-details/README.md): object generation, per-type mixed layouts, and registered cell editors.
|
|
114
|
+
|
|
115
|
+
- [Templates and slots](template-slots/README.md): named registry lookup, fallback and nested overrides.
|
|
116
|
+
|
|
117
|
+
## Conditional fields
|
|
118
|
+
|
|
119
|
+
See [conditional field presentation and graphical authoring](../docs/conditional-fields.md).
|
|
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.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Example: additional errors, from the server and from an editor
|
|
2
|
+
|
|
3
|
+
**Example ID:** `additional-errors`\
|
|
4
|
+
**Demo entry:** **Spec: Additional errors: server and editor** (`#spec-additional-errors`)\
|
|
5
|
+
**Domain:** deployment notes\
|
|
6
|
+
**Specs covered:**
|
|
7
|
+
|
|
8
|
+
- [Code editor (Monaco), `propagateErrors`](../../docs/spec.md#156-renderer-published-additional-errors)
|
|
9
|
+
- [Additional-error ownership and changing data paths](../../docs/spec.md#156-renderer-published-additional-errors)
|
|
10
|
+
- [Renderer-published additional errors](../../docs/spec.md#156-renderer-published-additional-errors)
|
|
11
|
+
|
|
12
|
+
Two things know something the schema does not: a **server** that rejected a
|
|
13
|
+
submit, and a code editor's **language service**. They look like different
|
|
14
|
+
problems and are the same mechanism — `additionalErrors`, published by an
|
|
15
|
+
owner, shown under the field they name, cleared on that owner's terms.
|
|
16
|
+
|
|
17
|
+
| Tab | Who publishes | Clears when |
|
|
18
|
+
| ------------------- | ------------------------------------------- | ----------------------------------- |
|
|
19
|
+
| **From the server** | the application, after a rejected submit | that field is edited |
|
|
20
|
+
| **Reported** | the Monaco control, `propagateErrors: true` | the language service is happy again |
|
|
21
|
+
| **Not reported** | nobody — the default | — |
|
|
22
|
+
| **Language** | the editor, language chosen from the form | — |
|
|
23
|
+
|
|
24
|
+
Duration validation belongs to the JSON Schema validator. Cron validation can
|
|
25
|
+
be registered as a custom schema format or keyword and follows the same normal
|
|
26
|
+
validation path. Neither control publishes those failures as additional errors.
|
|
27
|
+
The examples here cover application and editor diagnostics that supplement
|
|
28
|
+
schema validation.
|
|
29
|
+
|
|
30
|
+
## From the server
|
|
31
|
+
|
|
32
|
+
Press **Submit (rejected)**. Nothing is sent; the two errors are in the
|
|
33
|
+
button's `params` and stand in for a response. Everything after that is real:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
store.publish('server', response.validationErrors);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
They appear under **Email** and **Phone**, because that is what their
|
|
40
|
+
`instancePath` says. Now edit one field — **only that field's error goes.** The
|
|
41
|
+
other stays until its own field changes.
|
|
42
|
+
|
|
43
|
+
Comparison is **by value**, not by which path the change named, so rewriting a
|
|
44
|
+
field with what it already held clears nothing.
|
|
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
|
+
|
|
53
|
+
## From an editor
|
|
54
|
+
|
|
55
|
+
Open **Reported**. The JSON has a syntax error, and a message appears under the
|
|
56
|
+
editor — in the same place, in the same style, as the message under the
|
|
57
|
+
`Summary` field beside it when you empty it. That is the point: a language
|
|
58
|
+
diagnostic arrives as an ordinary error at that field's path, not as a special
|
|
59
|
+
editor affordance.
|
|
60
|
+
|
|
61
|
+
Break the JSON in a second place and there is still **one** message, with a
|
|
62
|
+
count. Fix it and the message goes.
|
|
63
|
+
|
|
64
|
+
## Off by default
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"type": "Control",
|
|
69
|
+
"scope": "#/properties/policy",
|
|
70
|
+
"options": { "format": "code", "language": "json", "propagateErrors": true }
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`propagateErrors` defaults to `false`, as specified by the portable contract.
|
|
75
|
+
Enable it to bridge Monaco's language-service diagnostics into form validation.
|
|
76
|
+
A host may suppress that bridge for an editor collecting deliberately incomplete
|
|
77
|
+
code by setting `propagateErrors: false`. Diagnostics remain visible inside
|
|
78
|
+
Monaco; schema and server errors continue to participate in form validation.
|
|
79
|
+
|
|
80
|
+
A form that wants publication for all editors sets it once:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{ "jsonformsExtended": { "propagateErrors": true } }
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Resolution is **element, then namespaced config, then flat config** — the order
|
|
87
|
+
every other option in this renderer set uses — so one editor can opt out of a
|
|
88
|
+
form-wide setting.
|
|
89
|
+
|
|
90
|
+
## One error per editor, and it is the editor's to clear
|
|
91
|
+
|
|
92
|
+
Two rules that sound like details and are not:
|
|
93
|
+
|
|
94
|
+
- **At most one summary per editor instance**, however many markers there are.
|
|
95
|
+
Twelve syntax errors are one message with a twelve in it, not twelve
|
|
96
|
+
messages.
|
|
97
|
+
- **The editor clears its own.** Publishing nothing is how it retracts — which
|
|
98
|
+
is also what happens when the option is switched off, and when the editor
|
|
99
|
+
unmounts. A summary left behind by an editor no longer on the form would
|
|
100
|
+
make the form permanently invalid with nothing on screen explaining why.
|
|
101
|
+
|
|
102
|
+
The summary carries an **owner** in its `params`, unique per editor instance.
|
|
103
|
+
Several things can own errors at one path — two editors, or an editor beside a
|
|
104
|
+
server-side error the host published — and the renderer contract requires clearing "only errors
|
|
105
|
+
belonging to the affected owner; preserve unrelated renderer and host errors".
|
|
106
|
+
Without the owner, one editor going quiet would wipe the others.
|
|
107
|
+
|
|
108
|
+
## It needs a host
|
|
109
|
+
|
|
110
|
+
`additionalErrors` is a **prop on `<JsonForms>`**, and core offers no action
|
|
111
|
+
for adding one and no hook for withdrawing one. So publication takes two
|
|
112
|
+
mechanisms, and neither alone is enough:
|
|
113
|
+
|
|
114
|
+
| | Does | Why the other cannot |
|
|
115
|
+
| ------------------ | ------------------------------- | ----------------------------------------------------------------------------------------------------------- |
|
|
116
|
+
| `additionalErrors` | Carries published errors in | Middleware is passive — publishing dispatches nothing, so the form would not re-reduce until somebody typed |
|
|
117
|
+
| `middleware` | Clears on change, merges owners | Only middleware sees the data **before** and after a change |
|
|
118
|
+
|
|
119
|
+
The simplest way to get both is to render the form with the wrapper:
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<ExtendedJsonForms store={store} schema={schema} uischema={uischema} … />
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
or, for a host that assembles `<JsonForms>` itself:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
<AdditionalErrorStoreProvider store={store}>
|
|
129
|
+
<JsonForms {...useAdditionalErrorProps(store)} … />
|
|
130
|
+
</AdditionalErrorStoreProvider>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**A form that installs neither publishes into nothing** — and says so, naming
|
|
134
|
+
the owner and the way out (`additionalErrors.noStore`), because silence there
|
|
135
|
+
is indistinguishable from the option not working.
|
|
136
|
+
|
|
137
|
+
A host that already passes its own `additionalErrors` keeps them. Published
|
|
138
|
+
errors are merged alongside, and neither clears the other.
|
|
139
|
+
|
|
140
|
+
## Warnings are not errors
|
|
141
|
+
|
|
142
|
+
Only error-severity markers count. Warnings, hints and informational messages
|
|
143
|
+
stay inside Monaco: they do not add to the count and do not block the form.
|
|
144
|
+
|
|
145
|
+
## The language decides whether there is anything to report
|
|
146
|
+
|
|
147
|
+
Open **Language**. The summary comes from a language _service_, so it exists
|
|
148
|
+
only for a language that has one — JSON and JavaScript here. Choose
|
|
149
|
+
**Markdown** and the same broken text reports nothing.
|
|
150
|
+
|
|
151
|
+
That is worth stating plainly: **no diagnostics is not the same as no errors.**
|
|
152
|
+
Syntax highlighting alone does not establish that a language is validated.
|
|
153
|
+
|
|
154
|
+
## Expected behaviour
|
|
155
|
+
|
|
156
|
+
| Action | Result |
|
|
157
|
+
| -------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
158
|
+
| Press **Submit (rejected)** | Errors appear under Email and Phone. |
|
|
159
|
+
| Edit **Email** | Only that error goes; Phone's stays. |
|
|
160
|
+
| Press **Clear them** | Both go. |
|
|
161
|
+
| Open **Reported** | One message under the editor, beside an ordinary `minLength` message for comparison. |
|
|
162
|
+
| Add a second syntax error | Still one message; the count goes up. |
|
|
163
|
+
| Fix the JSON | The message disappears. |
|
|
164
|
+
| Open **Not reported** | Monaco marks the same kind of error; the form says nothing. |
|
|
165
|
+
| Switch the language to Markdown | The snippet's summary goes, with no edit to the text. |
|
|
166
|
+
| Empty **Summary** | A schema error, rendered the same way — which is the point. |
|
|
167
|
+
| Publish a server error on a field an editor is on, then fix the code | The server's error stays: one owner retracting never removes another's. |
|
|
168
|
+
|
|
169
|
+
## Conformance scope
|
|
170
|
+
|
|
171
|
+
This walkthrough describes the portable contract. Renderer support must be checked
|
|
172
|
+
by a host adapter; the package validates the authored assets, not live UI behavior.
|
|
173
|
+
|
|
174
|
+
## Standalone host setup
|
|
175
|
+
|
|
176
|
+
- Handle the submit action and publish server errors through an owner-scoped additional-error store; register a code editor error producer.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"policy": "{\n \"allow\": [\"deploy\"],\n \"deny\": [,]\n}",
|
|
3
|
+
"quiet": "{\n \"draft\": true,\n}",
|
|
4
|
+
"language": "json",
|
|
5
|
+
"snippet": "{\n \"retries\": 3\n}",
|
|
6
|
+
"summary": "Ready",
|
|
7
|
+
"contact": {
|
|
8
|
+
"email": "ada@example.com",
|
|
9
|
+
"phone": "555 0100"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"title": "Deployment notes",
|
|
4
|
+
"properties": {
|
|
5
|
+
"policy": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"title": "Access policy (JSON)"
|
|
8
|
+
},
|
|
9
|
+
"quiet": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"title": "Draft policy (JSON, not reported)"
|
|
12
|
+
},
|
|
13
|
+
"language": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"title": "Language",
|
|
16
|
+
"oneOf": [
|
|
17
|
+
{
|
|
18
|
+
"const": "json",
|
|
19
|
+
"title": "JSON"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"const": "javascript",
|
|
23
|
+
"title": "JavaScript"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"const": "markdown",
|
|
27
|
+
"title": "Markdown (no validator)"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"snippet": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"title": "Snippet"
|
|
34
|
+
},
|
|
35
|
+
"summary": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"title": "Summary",
|
|
38
|
+
"minLength": 5
|
|
39
|
+
},
|
|
40
|
+
"contact": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"title": "Contact",
|
|
43
|
+
"properties": {
|
|
44
|
+
"email": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"title": "Email"
|
|
47
|
+
},
|
|
48
|
+
"phone": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"title": "Phone"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"required": ["summary"]
|
|
56
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"en": {
|
|
3
|
+
"intro.text": "Errors that are not the schema's: a server rejecting a submit, and a code editor's language service. Both arrive as additionalErrors, both appear under the field they name, and each clears on its own terms.",
|
|
4
|
+
"reportedTab.label": "Reported",
|
|
5
|
+
"quietTab.label": "Not reported",
|
|
6
|
+
"languageTab.label": "Language",
|
|
7
|
+
"reported.text": "propagateErrors: true. The JSON below has a syntax error, and one summary appears under the editor - in the same place, and looking the same, as the message under a required field that is empty. Fix the JSON and it goes away; break it in two places and there is still one message, with a count.",
|
|
8
|
+
"compare.text": "For comparison, an ordinary field with minLength. The editor's message is the same kind of thing: an error at that field's path.",
|
|
9
|
+
"quiet.text": "The same editor with the option left out, which is the default. The JSON below is also broken - Monaco marks it, the marks stay inside the editor, and the form is unaffected.",
|
|
10
|
+
"language.text": "The summary comes from the language service, so it depends on the language. JSON and JavaScript are validated; Markdown has no validator, and no diagnostics is not the same as no errors.",
|
|
11
|
+
"summary.label": "Summary",
|
|
12
|
+
"error.minLength": "Write at least five characters.",
|
|
13
|
+
"serverTab.label": "From the server",
|
|
14
|
+
"server.text": "Press Submit. Nothing is sent - the two errors below stand in for what a server returned - but everything after that is real: they are published as additionalErrors at the paths they name, and JSON Forms shows them under those fields.",
|
|
15
|
+
"serverClear.text": "Now edit one of the two fields. Only that field's error goes; the other stays until its own field changes, or until Clear them retracts both.",
|
|
16
|
+
"specAdditionalErrors.schema.label": "Deployment notes",
|
|
17
|
+
"specAdditionalErrors.schema.properties.policy.label": "Access policy (JSON)",
|
|
18
|
+
"specAdditionalErrors.schema.properties.quiet.label": "Draft policy (JSON, not reported)",
|
|
19
|
+
"specAdditionalErrors.schema.properties.language.label": "Language",
|
|
20
|
+
"specAdditionalErrors.schema.properties.language.oneOf.0.label": "JSON",
|
|
21
|
+
"specAdditionalErrors.schema.properties.language.oneOf.1.label": "JavaScript",
|
|
22
|
+
"specAdditionalErrors.schema.properties.language.oneOf.2.label": "Markdown (no validator)",
|
|
23
|
+
"specAdditionalErrors.schema.properties.snippet.label": "Snippet",
|
|
24
|
+
"specAdditionalErrors.schema.properties.summary.label": "Summary",
|
|
25
|
+
"specAdditionalErrors.schema.properties.contact.label": "Contact",
|
|
26
|
+
"specAdditionalErrors.schema.properties.contact.properties.email.label": "Email",
|
|
27
|
+
"specAdditionalErrors.schema.properties.contact.properties.phone.label": "Phone",
|
|
28
|
+
"specAdditionalErrors.ui.elements.1.elements.0.elements.1.elements.0.label": "Submit (rejected)",
|
|
29
|
+
"specAdditionalErrors.ui.elements.1.elements.0.elements.1.elements.1.label": "Clear them",
|
|
30
|
+
"specAdditionalErrors.server.email": "That address is already registered.",
|
|
31
|
+
"specAdditionalErrors.server.phone": "We could not reach this number."
|
|
32
|
+
},
|
|
33
|
+
"bg": {
|
|
34
|
+
"intro.text": "Грешки, които не са на схемата: сървър, отхвърлил изпращането, и езиковата услуга на редактора. И двете пристигат като additionalErrors, появяват се под полето, което назовават, и всяка се изчиства по своите правила.",
|
|
35
|
+
"reportedTab.label": "Съобщава се",
|
|
36
|
+
"quietTab.label": "Не се съобщава",
|
|
37
|
+
"languageTab.label": "Език",
|
|
38
|
+
"reported.text": "propagateErrors: true. JSON по-долу има синтактична грешка и под редактора се появява едно обобщение - на същото място и със същия вид като съобщението под задължително празно поле. Поправете JSON и то изчезва; развалете го на две места и съобщението пак е едно, с брояч.",
|
|
39
|
+
"compare.text": "За сравнение - обикновено поле с minLength. Съобщението на редактора е от същия вид: грешка на пътя на това поле.",
|
|
40
|
+
"quiet.text": "Същият редактор без опцията, което е подразбирането. JSON по-долу също е развален - Monaco го маркира, маркерите остават в редактора и формулярът не е засегнат.",
|
|
41
|
+
"language.text": "Обобщението идва от езиковата услуга, затова зависи от езика. JSON и JavaScript се валидират; Markdown няма валидатор, а липсата на диагностика не значи липса на грешки.",
|
|
42
|
+
"summary.label": "Обобщение",
|
|
43
|
+
"error.minLength": "Напишете поне пет знака.",
|
|
44
|
+
"serverTab.label": "От сървъра",
|
|
45
|
+
"server.text": "Натиснете Изпращане. Нищо не се изпраща - двете грешки по-долу заместват отговор на сървър - но всичко след това е истинско: публикуват се като additionalErrors на посочените пътища и JSON Forms ги показва под тези полета.",
|
|
46
|
+
"serverClear.text": "Сега редактирайте едно от двете полета. Изчезва само грешката на това поле; другата остава, докато не се промени нейното поле или докато Изчистване не оттегли и двете.",
|
|
47
|
+
"specAdditionalErrors.schema.label": "Бележки за внедряване",
|
|
48
|
+
"specAdditionalErrors.schema.properties.policy.label": "Политика за достъп (JSON)",
|
|
49
|
+
"specAdditionalErrors.schema.properties.quiet.label": "Чернова на политика (JSON, без съобщаване)",
|
|
50
|
+
"specAdditionalErrors.schema.properties.language.label": "Език",
|
|
51
|
+
"specAdditionalErrors.schema.properties.language.oneOf.0.label": "JSON",
|
|
52
|
+
"specAdditionalErrors.schema.properties.language.oneOf.1.label": "JavaScript",
|
|
53
|
+
"specAdditionalErrors.schema.properties.language.oneOf.2.label": "Markdown (без валидатор)",
|
|
54
|
+
"specAdditionalErrors.schema.properties.snippet.label": "Фрагмент",
|
|
55
|
+
"specAdditionalErrors.schema.properties.summary.label": "Обобщение",
|
|
56
|
+
"specAdditionalErrors.schema.properties.contact.label": "Контакт",
|
|
57
|
+
"specAdditionalErrors.schema.properties.contact.properties.email.label": "Имейл",
|
|
58
|
+
"specAdditionalErrors.schema.properties.contact.properties.phone.label": "Телефон",
|
|
59
|
+
"specAdditionalErrors.ui.elements.1.elements.0.elements.1.elements.0.label": "Изпрати (отхвърлено)",
|
|
60
|
+
"specAdditionalErrors.ui.elements.1.elements.0.elements.1.elements.1.label": "Изчисти грешките",
|
|
61
|
+
"specAdditionalErrors.server.email": "Този адрес вече е регистриран.",
|
|
62
|
+
"specAdditionalErrors.server.phone": "Не успяхме да се свържем с този номер."
|
|
63
|
+
}
|
|
64
|
+
}
|