@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.
Files changed (366) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +126 -2
  3. package/conformance/authoring.json +2680 -0
  4. package/conformance/behavior.json +1602 -0
  5. package/conformance/config-consumption.json +1542 -0
  6. package/conformance/expected-invalid.json +20 -0
  7. package/docs/audit.md +150 -0
  8. package/docs/conditional-fields.md +122 -0
  9. package/docs/draft-07-visual-support.md +43 -0
  10. package/docs/external-resources-proposal.md +536 -0
  11. package/docs/implementation-guide.md +233 -0
  12. package/docs/implementation-pitfalls.md +968 -0
  13. package/docs/implementation-web-typescript.md +41 -0
  14. package/docs/renderer-and-demo.md +1347 -0
  15. package/docs/renderer-selection.md +99 -0
  16. package/docs/spec.md +8470 -0
  17. package/docs/todo.md +166 -0
  18. package/examples/README.md +127 -0
  19. package/examples/additional-errors/README.md +176 -0
  20. package/examples/additional-errors/config.json +3 -0
  21. package/examples/additional-errors/data.json +11 -0
  22. package/examples/additional-errors/schema.json +56 -0
  23. package/examples/additional-errors/translations.json +64 -0
  24. package/examples/additional-errors/uischema.json +158 -0
  25. package/examples/additional-items-pagination/README.md +8 -0
  26. package/examples/additional-items-pagination/config.json +10 -0
  27. package/examples/additional-items-pagination/data.json +22 -0
  28. package/examples/additional-items-pagination/schema.json +30 -0
  29. package/examples/additional-items-pagination/translations.json +16 -0
  30. package/examples/additional-items-pagination/uischema.json +39 -0
  31. package/examples/additional-properties/README.md +203 -0
  32. package/examples/additional-properties/config.json +5 -0
  33. package/examples/additional-properties/data.json +31 -0
  34. package/examples/additional-properties/schema.json +78 -0
  35. package/examples/additional-properties/translations.json +80 -0
  36. package/examples/additional-properties/uischema.json +104 -0
  37. package/examples/ag-grid/README.md +62 -0
  38. package/examples/ag-grid/config.json +14 -0
  39. package/examples/ag-grid/data.json +124 -0
  40. package/examples/ag-grid/schema.json +48 -0
  41. package/examples/ag-grid/translations.json +58 -0
  42. package/examples/ag-grid/uischema.json +671 -0
  43. package/examples/array-choices/README.md +150 -0
  44. package/examples/array-choices/config.json +4 -0
  45. package/examples/array-choices/data.json +10 -0
  46. package/examples/array-choices/schema.json +68 -0
  47. package/examples/array-choices/translations.json +64 -0
  48. package/examples/array-choices/uischema.json +97 -0
  49. package/examples/array-controls/README.md +237 -0
  50. package/examples/array-controls/config.json +4 -0
  51. package/examples/array-controls/data.json +147 -0
  52. package/examples/array-controls/schema.json +374 -0
  53. package/examples/array-controls/translations.json +186 -0
  54. package/examples/array-controls/uischema.json +685 -0
  55. package/examples/array-detail-modes/README.md +11 -0
  56. package/examples/array-detail-modes/data.json +38 -0
  57. package/examples/array-detail-modes/schema.json +89 -0
  58. package/examples/array-detail-modes/translations.json +36 -0
  59. package/examples/array-detail-modes/uischema.json +73 -0
  60. package/examples/array-detail-modes/uischemas.d.mts +2 -0
  61. package/examples/array-detail-modes/uischemas.json +15 -0
  62. package/examples/boolean-controls/README.md +109 -0
  63. package/examples/boolean-controls/config.json +3 -0
  64. package/examples/boolean-controls/data.json +27 -0
  65. package/examples/boolean-controls/schema.json +98 -0
  66. package/examples/boolean-controls/translations.json +94 -0
  67. package/examples/boolean-controls/uischema.json +126 -0
  68. package/examples/button-actions/README.md +259 -0
  69. package/examples/button-actions/config.json +7 -0
  70. package/examples/button-actions/data.json +5 -0
  71. package/examples/button-actions/host.mjs +14 -0
  72. package/examples/button-actions/schema.json +20 -0
  73. package/examples/button-actions/translations.json +60 -0
  74. package/examples/button-actions/uischema.json +179 -0
  75. package/examples/catalog.json +634 -0
  76. package/examples/categorization/README.md +132 -0
  77. package/examples/categorization/config.json +7 -0
  78. package/examples/categorization/data.json +8 -0
  79. package/examples/categorization/schema.json +29 -0
  80. package/examples/categorization/translations.json +72 -0
  81. package/examples/categorization/uischema.json +288 -0
  82. package/examples/choice-controls/README.md +136 -0
  83. package/examples/choice-controls/config.json +10 -0
  84. package/examples/choice-controls/data.json +61 -0
  85. package/examples/choice-controls/schema.json +406 -0
  86. package/examples/choice-controls/translations.json +154 -0
  87. package/examples/choice-controls/uischema.json +575 -0
  88. package/examples/choice-controls/uischemas.d.mts +2 -0
  89. package/examples/choice-controls/uischemas.json +16 -0
  90. package/examples/code-editor/README.md +74 -0
  91. package/examples/code-editor/data.json +8 -0
  92. package/examples/code-editor/schema.json +28 -0
  93. package/examples/code-editor/translations.json +20 -0
  94. package/examples/code-editor/uischema.json +77 -0
  95. package/examples/collection-pagination/README.md +5 -0
  96. package/examples/collection-pagination/config.json +1 -0
  97. package/examples/collection-pagination/data.json +64 -0
  98. package/examples/collection-pagination/schema.json +23 -0
  99. package/examples/collection-pagination/translations.json +14 -0
  100. package/examples/collection-pagination/uischema.json +14 -0
  101. package/examples/color-control/README.md +154 -0
  102. package/examples/color-control/config.json +7 -0
  103. package/examples/color-control/data.json +11 -0
  104. package/examples/color-control/schema.json +61 -0
  105. package/examples/color-control/translations.json +76 -0
  106. package/examples/color-control/uischema.json +106 -0
  107. package/examples/combinators/README.md +223 -0
  108. package/examples/combinators/config.json +9 -0
  109. package/examples/combinators/data.json +23 -0
  110. package/examples/combinators/schema.json +232 -0
  111. package/examples/combinators/translations.json +178 -0
  112. package/examples/combinators/uischema.json +158 -0
  113. package/examples/conditional-fields/README.md +27 -0
  114. package/examples/conditional-fields/config.json +5 -0
  115. package/examples/conditional-fields/data.json +7 -0
  116. package/examples/conditional-fields/schema.json +59 -0
  117. package/examples/conditional-fields/translations.json +32 -0
  118. package/examples/conditional-fields/uischema.json +131 -0
  119. package/examples/container-validation-indicator/README.md +187 -0
  120. package/examples/container-validation-indicator/config.json +9 -0
  121. package/examples/container-validation-indicator/data.json +68 -0
  122. package/examples/container-validation-indicator/schema.json +222 -0
  123. package/examples/container-validation-indicator/translations.json +120 -0
  124. package/examples/container-validation-indicator/uischema.json +98 -0
  125. package/examples/cron-control/README.md +155 -0
  126. package/examples/cron-control/data.json +15 -0
  127. package/examples/cron-control/schema.json +72 -0
  128. package/examples/cron-control/translations.json +80 -0
  129. package/examples/cron-control/uischema.json +91 -0
  130. package/examples/destructive-confirmation/README.md +210 -0
  131. package/examples/destructive-confirmation/config.json +17 -0
  132. package/examples/destructive-confirmation/data.json +86 -0
  133. package/examples/destructive-confirmation/schema.json +204 -0
  134. package/examples/destructive-confirmation/translations.json +112 -0
  135. package/examples/destructive-confirmation/uischema.json +105 -0
  136. package/examples/draft-07-metaschema/README.md +11 -0
  137. package/examples/draft-07-metaschema/config.json +3 -0
  138. package/examples/draft-07-metaschema/data.json +25 -0
  139. package/examples/draft-07-metaschema/schema.json +172 -0
  140. package/examples/draft-07-metaschema/translations.json +10 -0
  141. package/examples/draft-07-metaschema/uischema.json +14 -0
  142. package/examples/dynamic-playground/README.md +95 -0
  143. package/examples/dynamic-playground/config.json +8 -0
  144. package/examples/dynamic-playground/configuration.json +152 -0
  145. package/examples/dynamic-playground/data.json +15 -0
  146. package/examples/dynamic-playground/dynamic-uischema.json +379 -0
  147. package/examples/dynamic-playground/host.mjs +37 -0
  148. package/examples/dynamic-playground/schema.json +48 -0
  149. package/examples/dynamic-playground/translations.json +76 -0
  150. package/examples/dynamic-playground/uischema.json +36 -0
  151. package/examples/editor-details/README.md +10 -0
  152. package/examples/editor-details/data.json +18 -0
  153. package/examples/editor-details/schema.json +49 -0
  154. package/examples/editor-details/translations.json +28 -0
  155. package/examples/editor-details/uischema.json +53 -0
  156. package/examples/editor-details/uischemas.d.mts +2 -0
  157. package/examples/editor-details/uischemas.json +14 -0
  158. package/examples/file-control/README.md +108 -0
  159. package/examples/file-control/data.json +28 -0
  160. package/examples/file-control/schema.json +89 -0
  161. package/examples/file-control/translations.json +46 -0
  162. package/examples/file-control/uischema.json +152 -0
  163. package/examples/group-layout/README.md +149 -0
  164. package/examples/group-layout/config.json +10 -0
  165. package/examples/group-layout/data.json +9 -0
  166. package/examples/group-layout/schema.json +51 -0
  167. package/examples/group-layout/translations.json +62 -0
  168. package/examples/group-layout/uischema.json +249 -0
  169. package/examples/index.d.ts +17 -0
  170. package/examples/index.js +69 -0
  171. package/examples/input-adornments/README.md +68 -0
  172. package/examples/input-adornments/data.json +41 -0
  173. package/examples/input-adornments/schema.json +207 -0
  174. package/examples/input-adornments/translations.json +106 -0
  175. package/examples/input-adornments/uischema.json +695 -0
  176. package/examples/job-application/README.md +23 -0
  177. package/examples/job-application/config.json +10 -0
  178. package/examples/job-application/data.json +68 -0
  179. package/examples/job-application/schema.json +196 -0
  180. package/examples/job-application/translations.json +388 -0
  181. package/examples/job-application/uischema.json +218 -0
  182. package/examples/job-application/uischemas.json +153 -0
  183. package/examples/json-editor/README.md +28 -0
  184. package/examples/json-editor/schema.json +1 -0
  185. package/examples/json-editor/translations.json +10 -0
  186. package/examples/json-editor/uischema.json +16 -0
  187. package/examples/json-inference/README.md +33 -0
  188. package/examples/json-inference/translations.json +10 -0
  189. package/examples/json-inference/uischema.json +16 -0
  190. package/examples/kitchen-sink/README.md +86 -0
  191. package/examples/kitchen-sink/config.json +14 -0
  192. package/examples/kitchen-sink/data.json +263 -0
  193. package/examples/kitchen-sink/invalid-data.json +263 -0
  194. package/examples/kitchen-sink/schema.json +515 -0
  195. package/examples/kitchen-sink/translations.json +270 -0
  196. package/examples/kitchen-sink/uischema.json +722 -0
  197. package/examples/label-interpolation/README.md +241 -0
  198. package/examples/label-interpolation/config.json +14 -0
  199. package/examples/label-interpolation/data.json +13 -0
  200. package/examples/label-interpolation/schema.json +64 -0
  201. package/examples/label-interpolation/translations.json +94 -0
  202. package/examples/label-interpolation/uischema.json +379 -0
  203. package/examples/layout-sizing/README.md +162 -0
  204. package/examples/layout-sizing/config.json +10 -0
  205. package/examples/layout-sizing/data.json +14 -0
  206. package/examples/layout-sizing/schema.json +58 -0
  207. package/examples/layout-sizing/translations.json +42 -0
  208. package/examples/layout-sizing/uischema.json +558 -0
  209. package/examples/markup-label/README.md +109 -0
  210. package/examples/markup-label/config.json +16 -0
  211. package/examples/markup-label/data.json +5 -0
  212. package/examples/markup-label/schema.json +24 -0
  213. package/examples/markup-label/translations.json +40 -0
  214. package/examples/markup-label/uischema.json +149 -0
  215. package/examples/mixed-control/README.md +164 -0
  216. package/examples/mixed-control/config.json +11 -0
  217. package/examples/mixed-control/data.json +70 -0
  218. package/examples/mixed-control/schema.json +221 -0
  219. package/examples/mixed-control/translations.json +158 -0
  220. package/examples/mixed-control/uischema.json +211 -0
  221. package/examples/null-control/README.md +111 -0
  222. package/examples/null-control/config.json +4 -0
  223. package/examples/null-control/data.json +6 -0
  224. package/examples/null-control/schema.json +36 -0
  225. package/examples/null-control/translations.json +42 -0
  226. package/examples/null-control/uischema.json +56 -0
  227. package/examples/numeric-controls/README.md +94 -0
  228. package/examples/numeric-controls/config.json +4 -0
  229. package/examples/numeric-controls/data.json +8 -0
  230. package/examples/numeric-controls/schema.json +52 -0
  231. package/examples/numeric-controls/translations.json +56 -0
  232. package/examples/numeric-controls/uischema.json +77 -0
  233. package/examples/object-control/README.md +220 -0
  234. package/examples/object-control/config.json +4 -0
  235. package/examples/object-control/data.json +62 -0
  236. package/examples/object-control/schema.json +252 -0
  237. package/examples/object-control/translations.json +160 -0
  238. package/examples/object-control/uischema.json +275 -0
  239. package/examples/object-control/uischemas.d.mts +2 -0
  240. package/examples/object-control/uischemas.json +59 -0
  241. package/examples/password-control/README.md +119 -0
  242. package/examples/password-control/config.json +3 -0
  243. package/examples/password-control/data.json +18 -0
  244. package/examples/password-control/schema.json +65 -0
  245. package/examples/password-control/translations.json +64 -0
  246. package/examples/password-control/uischema.json +94 -0
  247. package/examples/pre-touch-errors/README.md +176 -0
  248. package/examples/pre-touch-errors/config.json +4 -0
  249. package/examples/pre-touch-errors/data.json +5 -0
  250. package/examples/pre-touch-errors/schema.json +56 -0
  251. package/examples/pre-touch-errors/translations.json +68 -0
  252. package/examples/pre-touch-errors/uischema.json +85 -0
  253. package/examples/presentation/README.md +148 -0
  254. package/examples/presentation/config.json +9 -0
  255. package/examples/presentation/data.json +6 -0
  256. package/examples/presentation/schema.json +21 -0
  257. package/examples/presentation/translations.json +64 -0
  258. package/examples/presentation/uischema.json +210 -0
  259. package/examples/property-pagination/README.md +5 -0
  260. package/examples/property-pagination/config.json +1 -0
  261. package/examples/property-pagination/data.json +17 -0
  262. package/examples/property-pagination/schema.json +14 -0
  263. package/examples/property-pagination/translations.json +10 -0
  264. package/examples/property-pagination/uischema.json +24 -0
  265. package/examples/recursive-tree/README.md +49 -0
  266. package/examples/recursive-tree/config.json +1 -0
  267. package/examples/recursive-tree/data.json +40 -0
  268. package/examples/recursive-tree/schema.json +89 -0
  269. package/examples/recursive-tree/translations.json +42 -0
  270. package/examples/recursive-tree/uischema.json +84 -0
  271. package/examples/recursive-tree/uischemas.d.mts +2 -0
  272. package/examples/recursive-tree/uischemas.json +51 -0
  273. package/examples/split-layout/README.md +123 -0
  274. package/examples/split-layout/config.json +3 -0
  275. package/examples/split-layout/data.json +13 -0
  276. package/examples/split-layout/schema.json +50 -0
  277. package/examples/split-layout/translations.json +50 -0
  278. package/examples/split-layout/uischema.json +204 -0
  279. package/examples/string-controls/README.md +159 -0
  280. package/examples/string-controls/config.json +5 -0
  281. package/examples/string-controls/data.json +13 -0
  282. package/examples/string-controls/schema.json +70 -0
  283. package/examples/string-controls/translations.json +76 -0
  284. package/examples/string-controls/uischema.json +148 -0
  285. package/examples/table-row-details/README.md +69 -0
  286. package/examples/table-row-details/config.json +7 -0
  287. package/examples/table-row-details/data.json +280 -0
  288. package/examples/table-row-details/schema.json +61 -0
  289. package/examples/table-row-details/translations.json +56 -0
  290. package/examples/table-row-details/uischema.json +1303 -0
  291. package/examples/template-layout/README.md +250 -0
  292. package/examples/template-layout/config.json +9 -0
  293. package/examples/template-layout/data.json +20 -0
  294. package/examples/template-layout/host.mjs +13 -0
  295. package/examples/template-layout/schema.json +48 -0
  296. package/examples/template-layout/translations.json +70 -0
  297. package/examples/template-layout/uischema.json +177 -0
  298. package/examples/template-slots/README.md +19 -0
  299. package/examples/template-slots/data.json +4 -0
  300. package/examples/template-slots/schema.json +11 -0
  301. package/examples/template-slots/translations.json +26 -0
  302. package/examples/template-slots/uischema.json +47 -0
  303. package/examples/template-slots/uischemas.d.mts +2 -0
  304. package/examples/template-slots/uischemas.json +56 -0
  305. package/examples/temporal-controls/README.md +325 -0
  306. package/examples/temporal-controls/data.json +44 -0
  307. package/examples/temporal-controls/schema.json +208 -0
  308. package/examples/temporal-controls/translations.json +156 -0
  309. package/examples/temporal-controls/uischema.json +297 -0
  310. package/examples/tree-max-depth/README.md +5 -0
  311. package/examples/tree-max-depth/config.json +3 -0
  312. package/examples/tree-max-depth/data.json +31 -0
  313. package/examples/tree-max-depth/schema.json +258 -0
  314. package/examples/tree-max-depth/translations.json +42 -0
  315. package/examples/tree-max-depth/uischema.json +16 -0
  316. package/examples/tree-max-depth/uischemas.d.mts +2 -0
  317. package/examples/tree-max-depth/uischemas.json +50 -0
  318. package/examples/tuple-control/README.md +335 -0
  319. package/examples/tuple-control/config.json +4 -0
  320. package/examples/tuple-control/data.json +61 -0
  321. package/examples/tuple-control/schema.json +218 -0
  322. package/examples/tuple-control/translations.json +142 -0
  323. package/examples/tuple-control/uischema.json +128 -0
  324. package/examples/tuple-control/uischemas.d.mts +2 -0
  325. package/examples/tuple-control/uischemas.json +125 -0
  326. package/examples/validator-profile/README.md +197 -0
  327. package/examples/validator-profile/config.json +9 -0
  328. package/examples/validator-profile/data.json +16 -0
  329. package/examples/validator-profile/schema.json +139 -0
  330. package/examples/validator-profile/translations.json +34 -0
  331. package/examples/validator-profile/uischema.json +59 -0
  332. package/package.json +83 -3
  333. package/provenance.json +140 -0
  334. package/schemas/README.md +82 -0
  335. package/schemas/example.schema.json +37 -0
  336. package/schemas/jsonforms-config.schema.json +427 -0
  337. package/schemas/jsonforms-dynamic-uischema.schema.json +220 -0
  338. package/schemas/jsonforms-extended-config.schema.json +332 -0
  339. package/schemas/jsonforms-extended-uischema.schema.json +1932 -0
  340. package/schemas/jsonforms-rule.schema.json +104 -0
  341. package/schemas/jsonforms-uischema.schema.json +1434 -0
  342. package/typescript/README.md +546 -0
  343. package/typescript/lib/authoring/cssLength.d.ts +33 -0
  344. package/typescript/lib/authoring/cssLength.js +25 -0
  345. package/typescript/lib/authoring/dynamic.d.ts +73 -0
  346. package/typescript/lib/authoring/dynamic.js +8 -0
  347. package/typescript/lib/authoring/forSchema.d.ts +385 -0
  348. package/typescript/lib/authoring/forSchema.js +84 -0
  349. package/typescript/lib/authoring/schemaTypes.d.ts +111 -0
  350. package/typescript/lib/authoring/schemaTypes.js +15 -0
  351. package/typescript/lib/index.d.ts +4 -0
  352. package/typescript/lib/index.js +20 -0
  353. package/typescript/package.json +1 -0
  354. package/typescript/src/authoring/cssLength.ts +79 -0
  355. package/typescript/src/authoring/dynamic.ts +96 -0
  356. package/typescript/src/authoring/forSchema.ts +428 -0
  357. package/typescript/src/authoring/schemaTypes.ts +143 -0
  358. package/typescript/src/index.ts +4 -0
  359. package/typescript/test/schemaContract.test.ts +638 -0
  360. package/typescript/test/tsconfig.json +10 -0
  361. package/typescript/test/typedAuthoring.test.ts +151 -0
  362. package/typescript/test/typedAuthoringCoverage.test.ts +178 -0
  363. package/typescript/test/typedAuthoringCssLength.test.ts +81 -0
  364. package/typescript/test/typedAuthoringNames.test.ts +90 -0
  365. package/typescript/test/typedDynamic.test.ts +88 -0
  366. package/typescript/tsconfig.json +15 -0
@@ -0,0 +1,250 @@
1
+ # Example: template layout, three engines
2
+
3
+ **Example ID:** `template-layout`\
4
+ **Demo entry:** **Spec: Template layout: three engines** (`#spec-template-layout`)\
5
+ **Domain:** event registration\
6
+ **Specs covered:**
7
+
8
+ - [TemplateLayout fields and profiles](../../docs/spec.md#135-templatelayout)
9
+ - [script evaluation permission, and function-valued extension points](../../docs/spec.md#135-templatelayout)
10
+ - [Two template engines](../../docs/spec.md#135-templatelayout)
11
+ - [TemplateLayout, authored in TypeScript](../../docs/spec.md#135-templatelayout)
12
+
13
+ The same five things, written three times: in `lang: "jsx"`, in
14
+ `lang: "ractive"`, and as a **TypeScript function**. Put next to each other
15
+ they answer the question the profiles actually raise — what changes when you
16
+ switch, and what does not.
17
+
18
+ ## Layout of the page
19
+
20
+ A `Categorization` gives each engine a tab, so one is on screen at a time:
21
+
22
+ | Tab | Holds | Portable |
23
+ | --- | --- | --- |
24
+ | **lang: jsx** | The JSX template, the note it slots, and `{elements}` over the whole child list. | yes |
25
+ | **lang: ractive** | The Ractive template and the note it slots. | yes |
26
+ | **native (TypeScript)** | The same template as a function, plus what only a function can do. | **no** |
27
+ | **Language resolution** | The template with no `lang`, and the one asking for an engine nobody implements. | yes |
28
+
29
+ **Customer** and **Priority booking** sit *above* the tabs, on purpose: they
30
+ are what all three templates read, so they have to stay reachable whichever
31
+ tab is open. Editing one of them is how the reactivity below is seen.
32
+
33
+ The third tab is not in `uischema.json` and cannot be. Its `template` is a
34
+ function, which has no JSON spelling, so the tab is appended in the host registration —
35
+ the same boundary the Button example draws, drawn the same way. **Open the UI
36
+ schema panel on that tab:** the `TemplateLayout` is there and its `template`
37
+ is not, because `JSON.stringify` drops a function silently.
38
+
39
+ The split is also the clearest demonstration that an engine is a separate
40
+ registered renderer: open the network panel, switch tabs, and the second
41
+ compiler is fetched at that moment — not when the form loaded.
42
+
43
+ ## Files
44
+
45
+ | File | Role |
46
+ | --- | --- |
47
+ | `schema.json` | One property edited above the templates, one boolean for the branch, a list to iterate, one note per engine to slot, and two more for the array form. |
48
+ | `uischema.json` | Two shared controls, then a `Categorization` holding five `TemplateLayout`s: jsx, jsx over the whole child array, ractive, one with no `lang`, and one with a language nobody implements. |
49
+ | `data.json` | Enough to make every branch and the list visible on load. |
50
+ | `config.json` | `jsonformsExtended.defaultTemplateLang: "ractive"` and `jsonformsExtended.security.allowScriptEvaluation: true`. |
51
+ | `translations.json` | English and Bulgarian. |
52
+
53
+ ## The same template, twice
54
+
55
+ | | `lang: "jsx"` | `lang: "ractive"` |
56
+ | --- | --- | --- |
57
+ | interpolate | `{data.customerName}` | `{{data.customerName}}` |
58
+ | branch | `{data.priority ? 'A' : 'B'}` | `{{#if data.priority}}A{{else}}B{{/if}}` |
59
+ | iterate | `{data.contacts.map(c => c.name).join(', ')}` | `{{#each data.contacts}}{{ @index ? ', ' : '' }}{{ .name }}{{/each}}` |
60
+ | slot a child | `{elements['jsxNote']}` | `{{>ractiveNote}}` |
61
+
62
+ And the third column, which is not a language at all:
63
+
64
+ | | native (TypeScript) |
65
+ | --- | --- |
66
+ | interpolate | `{formData?.customerName}` |
67
+ | branch | `{formData?.priority ? 'A' : 'B'}` |
68
+ | iterate | `{(formData?.contacts ?? []).map(c => c.name).join(', ')}` |
69
+ | slot a child | `<Slot name='nativeNote' />` |
70
+
71
+ It reads like the JSX column because it is JSX — the difference is that
72
+ **nothing is compiled at runtime**. The build compiled it, so there is no
73
+ parser in the bundle for it, no `new Function`, and no
74
+ `allowScriptEvaluation`: that permission exists for CSP `unsafe-eval`, and a
75
+ function has no use for it. Switch the permission off and this tab keeps
76
+ working while the other two explain themselves.
77
+
78
+ ### What only the native tab can do
79
+
80
+ ```tsx
81
+ const Pill = ({ children }) => <span data-pill>{children}</span>;
82
+
83
+ const nativeTemplate: TemplateRender<RegistrationData> = ({ data, Slot, errors, readonly }) => (
84
+ <p><Pill>{errors.length} problems</Pill>{readonly ? ' · read-only' : ' · editable'}</p>
85
+ );
86
+ ```
87
+
88
+ - **A component registered nowhere.** `Pill` is defined beside the template and
89
+ used directly. A string template can only reach what the engine chose to put
90
+ in its scope; a function reaches whatever is in lexical scope.
91
+ - **Types.** `data` is typed through the type argument, and `Slot`, `errors`
92
+ and `readonly` come from `TemplateRenderProps`. Misspell `data.custmerName`
93
+ and it is a compile error, not an empty span.
94
+ - **`readonly` separately from `enabled`.** A read-only form disables its
95
+ controls too, but the two mean different things to a widget, and the
96
+ template is told both.
97
+ - **A fallback for an undeclared slot.** `<Slot name='notDeclared'>…</Slot>`
98
+ renders its children and warns `template.unknownSlot`, rather than going
99
+ quiet.
100
+
101
+ Both print `Contacts: Ann, Bo, Cy`.
102
+
103
+ ### `elements` is a list as well as a map
104
+
105
+ The jsx tab carries a second template that does not name anything:
106
+
107
+ ```jsx
108
+ <div data-children>{elements}</div>
109
+ ```
110
+
111
+ Rendering the binding itself **mounts every child, in order** — the two
112
+ controls below it, one named and one not. It is the ordinary way to write a
113
+ custom layout: the template decides the surroundings and lets the children fall
114
+ where they are declared, instead of listing each one by name.
115
+
116
+ **Only the jsx profile has this.** Ractive places children as named partials,
117
+ and there is no partial meaning "all of them", so the row above has no Ractive
118
+ column. That asymmetry is the reason the two engines sit in one example: they
119
+ are the same feature, not the same language.
120
+
121
+ The example names its *first* child deliberately. An unnamed child falls back
122
+ to its decimal index as its name, so a list where nothing is named resolves by
123
+ position either way and hides a whole class of mistake — which is exactly what
124
+ happened: `{elements}` once returned internal wrappers instead of the elements,
125
+ and every test passed because none of them had named a child in a list rendered
126
+ as an array. See [the specification](../../docs/spec.md#135-templatelayout).
127
+
128
+ ## Expected behaviour
129
+
130
+ ### Reactivity
131
+
132
+ **Type in Customer.** The greeting on the open tab updates on every keystroke,
133
+ and **the slotted note loses neither its cursor nor its text**. Switch tabs and
134
+ the other engine shows the same new value — both read the same form data. That is the whole point of the
135
+ feature: the templates are patched around the controls rather than rebuilt with
136
+ them.
137
+
138
+ The two get there differently. The JSX profile re-runs its template function
139
+ and lets the host reconcile; Ractive never re-runs the template at all — `set` patches
140
+ the bound text node. Both leave the slotted control's DOM node identical, which
141
+ is what the test asserts.
142
+
143
+ ### Iteration is where the languages differ most
144
+
145
+ JSX has the whole of JavaScript, so `.map().join(', ')` works. **Ractive has no
146
+ function literals** — `{{ customers.map(c => c.name) }}` is a parse error, not a
147
+ silent failure. Iteration is `{{#each}}`, or a helper injected through the
148
+ bindings.
149
+
150
+ That restriction is not an accident: it is why Ractive's `new Function` only
151
+ ever compiles `return (expr)`.
152
+
153
+ ### A whitespace trap worth knowing
154
+
155
+ The obvious Ractive separator is wrong:
156
+
157
+ ```hbs
158
+ {{#each data.contacts}}{{.name}}{{#if @index < data.contacts.length - 1}}, {{/if}}{{/each}}
159
+ ```
160
+
161
+ That renders `Ann,Bo,Cy` — Ractive collapses template whitespace, so the space
162
+ after the comma disappears. It looks like a typo in the data.
163
+
164
+ Three forms survive it; the fixture uses the third:
165
+
166
+ | Form | Output |
167
+ | --- | --- |
168
+ | literal `, ` between mustaches | `Ann,Bo,Cy` |
169
+ | `{{', '}}` as an expression | `Ann, Bo, Cy` |
170
+ | `{{ @index ? ', ' : '' }}` before each item | `Ann, Bo, Cy` |
171
+
172
+ `preserveWhitespace: true` also fixes it, but it changes whitespace handling
173
+ for the whole template, so it is not what this renderer does.
174
+
175
+ Note also that Ractive has **no `@last`** — `{{#unless @last}}` silently emits
176
+ nothing, which is the same symptom by a different route.
177
+
178
+ ### Choosing the engine
179
+
180
+ Both live under the **Language resolution** tab.
181
+
182
+ **A template with no `lang`** takes `config.jsonformsExtended.defaultTemplateLang`, which this
183
+ example sets to `ractive`. Remove that key and it would still be `ractive`, the
184
+ default of last resort. An explicit `lang` always wins over both.
185
+
186
+ The choice is made in the **tester**, so each engine is a separate registered
187
+ renderer and only the one an element asks for is ever loaded.
188
+
189
+ **An unknown language is diagnosed.** The last template asks for
190
+ `lang: "handlebars"` and renders a message naming it, not a guess at another
191
+ engine — "unknown or unsupported languages must be diagnosed rather than
192
+ interpreted as another engine". A form that quietly fell back would render the
193
+ wrong thing and say nothing.
194
+
195
+ ### Both engines need permission
196
+
197
+ `config.json` sets
198
+ `jsonformsExtended.security.allowScriptEvaluation: true`. **Remove it and both
199
+ templates stop**, each replaced by a message naming the key.
200
+
201
+ That is not over-caution about the JSX profile only. Ractive compiles every
202
+ `{{ }}` expression through `new Function` as well — narrower than compiling a
203
+ component body, and still string evaluation, still needing CSP `unsafe-eval`.
204
+ The renderer reports the refusal rather than weakening anything, which is what
205
+ the specification asks for.
206
+
207
+ ### Neither compiler is in the initial bundle
208
+
209
+ Both engines load on demand. A form with no `TemplateLayout`
210
+ downloads neither; a form of only `ractive` templates never downloads Sucrase.
211
+ Measured on the demo build: the app entry contains no `sucrase` and no
212
+ `Ractive.parse`, which live in a 224 KB and a 360 KB chunk respectively.
213
+
214
+ ## Fallback behaviour
215
+
216
+ | Situation | Result |
217
+ | --- | --- |
218
+ | Explicit `lang` | Wins over everything. |
219
+ | No `lang`, `defaultTemplateLang` set | That engine. |
220
+ | Neither | `ractive`. |
221
+ | A language no engine implements, from either source | Diagnosed, naming what was asked for. |
222
+ | `allowScriptEvaluation` absent or false | Both **string** engines refuse, and say why. The native tab is unaffected — there is no string to evaluate. |
223
+ | A named child | A partial (`{{>name}}`) or an `elements[...]` entry. |
224
+ | An unnamed child | Its decimal index becomes the name. |
225
+ | A child that can be given no name | Unaddressable, not unrenderable: it still has a position, so `{elements}` mounts it. |
226
+ | `{elements}` in a Ractive template | Not a thing; Ractive places children as named partials only. |
227
+ | `<Slot name='…'>` naming no child | Renders the slot's children as a fallback, and warns `template.unknownSlot`. |
228
+ | The model is serialized | The native tab's element survives; its `template` does not. |
229
+
230
+ ## Conformance scope
231
+
232
+ This walkthrough describes the portable contract. Renderer support must be checked
233
+ by a host adapter; the package validates the authored assets, not live UI behavior.
234
+
235
+ ## Rendering the error collection
236
+
237
+ The JSX tab includes a plain list of `errors`. Set **Copies** to zero to trigger its `minimum: 1` schema error. The template uses HTML list semantics, so it
238
+ does not depend on components injected by a particular UI library. An empty
239
+ error collection produces an empty list.
240
+
241
+ ## Standalone host setup
242
+
243
+ - Register the requested template-language engines. Native function templates require a host adapter and are not part of the serialized fixture.
244
+
245
+ The optional [host.mjs](host.mjs) demonstrates native in-memory values.
246
+ Those functions have no JSON representation; keep them in trusted host code.
247
+
248
+ ## Consolidated demo coverage
249
+
250
+ Nested slots exercises a named child inside two levels of positional `{elements}` insertion, with controls and an action button.
@@ -0,0 +1,9 @@
1
+ {
2
+ "showUnfocusedDescription": true,
3
+ "jsonformsExtended": {
4
+ "security": {
5
+ "allowScriptEvaluation": true
6
+ },
7
+ "defaultTemplateLang": "ractive"
8
+ }
9
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "customerName": "Northwind Books",
3
+ "priority": true,
4
+ "contacts": [
5
+ {
6
+ "name": "Ann"
7
+ },
8
+ {
9
+ "name": "Bo"
10
+ },
11
+ {
12
+ "name": "Cy"
13
+ }
14
+ ],
15
+ "jsxNote": "Seat near the front, please.",
16
+ "ractiveNote": "Vegetarian meal.",
17
+ "reference": "REG-4417",
18
+ "copies": 2,
19
+ "nativeNote": "Wheelchair access needed."
20
+ }
@@ -0,0 +1,13 @@
1
+ /** Supply a precompiled template from the host's native rendering system.
2
+ * The portable package does not import a framework or create a native view.
3
+ * The host owns URL-policy enforcement and guarded writes from its template.
4
+ */
5
+ export function nativeTemplateCategory(template) {
6
+ if (typeof template !== 'function') throw new TypeError('This JavaScript example expects a trusted template function.');
7
+ return {
8
+ type: 'Category', name: 'native', label: 'Native template',
9
+ elements: [{ type: 'TemplateLayout', template,
10
+ elements: [{ type: 'Control', scope: '#/properties/nativeNote', name: 'nativeNote' }]
11
+ }]
12
+ };
13
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "type": "object",
3
+ "title": "Event registration",
4
+ "properties": {
5
+ "customerName": {
6
+ "type": "string",
7
+ "title": "Customer"
8
+ },
9
+ "priority": {
10
+ "type": "boolean",
11
+ "title": "Priority booking"
12
+ },
13
+ "contacts": {
14
+ "type": "array",
15
+ "title": "Contacts",
16
+ "items": {
17
+ "type": "object",
18
+ "properties": {
19
+ "name": {
20
+ "type": "string",
21
+ "title": "Name"
22
+ }
23
+ }
24
+ }
25
+ },
26
+ "jsxNote": {
27
+ "type": "string",
28
+ "title": "Note (slotted into the jsx template)"
29
+ },
30
+ "ractiveNote": {
31
+ "type": "string",
32
+ "title": "Note (slotted into the ractive template)"
33
+ },
34
+ "reference": {
35
+ "type": "string",
36
+ "title": "Reference"
37
+ },
38
+ "copies": {
39
+ "type": "integer",
40
+ "title": "Copies",
41
+ "minimum": 1
42
+ },
43
+ "nativeNote": {
44
+ "type": "string",
45
+ "title": "Note (slotted into the native template)"
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "en": {
3
+ "control.clearValue": "Clear value",
4
+ "nestedSlots.tab.label": "Nested slots",
5
+ "nestedSlots.action.label": "Handle action",
6
+ "specTemplateLayout.schema.label": "Event registration",
7
+ "specTemplateLayout.schema.properties.customerName.label": "Customer",
8
+ "specTemplateLayout.schema.properties.priority.label": "Priority booking",
9
+ "specTemplateLayout.schema.properties.contacts.label": "Contacts",
10
+ "specTemplateLayout.schema.properties.contacts.items.properties.name.label": "Name",
11
+ "specTemplateLayout.schema.properties.jsxNote.label": "Note (slotted into the jsx template)",
12
+ "specTemplateLayout.schema.properties.ractiveNote.label": "Note (slotted into the ractive template)",
13
+ "specTemplateLayout.schema.properties.reference.label": "Reference",
14
+ "specTemplateLayout.schema.properties.copies.label": "Copies",
15
+ "specTemplateLayout.schema.properties.nativeNote.label": "Note (slotted into the native template)",
16
+ "specTemplateLayout.ui.elements.0.text": "Edit these; whichever engine is on screen reacts to every keystroke.",
17
+ "specTemplateLayout.ui.elements.3.elements.0.label": "lang: jsx",
18
+ "specTemplateLayout.ui.elements.3.elements.0.elements.0.text": "JavaScript expressions, compiled with Sucrase.",
19
+ "specTemplateLayout.ui.elements.3.elements.0.elements.2.text": "elements is also an ordered list: {elements} mounts every child, in order.",
20
+ "specTemplateLayout.ui.elements.3.elements.1.label": "lang: ractive",
21
+ "specTemplateLayout.ui.elements.3.elements.1.elements.0.text": "The portable default profile: no function literals, surgical updates.",
22
+ "specTemplateLayout.ui.elements.3.elements.2.label": "Language resolution",
23
+ "specTemplateLayout.ui.elements.3.elements.2.elements.0.text": "No lang: config.jsonformsExtended.defaultTemplateLang decides (here, ractive).",
24
+ "specTemplateLayout.ui.elements.3.elements.2.elements.2.text": "An unknown language is diagnosed, never guessed.",
25
+ "specTemplateLayout.greeting": "Hello",
26
+ "specTemplateLayout.priority": "Priority booking",
27
+ "specTemplateLayout.standard": "Standard booking",
28
+ "specTemplateLayout.contacts": "Contacts",
29
+ "specTemplateLayout.resolved": "Resolved by config",
30
+ "specTemplateLayout.native.label": "Native Svelte component",
31
+ "specTemplateLayout.native.errors": "Schema errors",
32
+ "specTemplateLayout.native.readonly": "Read-only",
33
+ "specTemplateLayout.native.editable": "Editable",
34
+ "specTemplateLayout.native.fallback": "Fallback for an undeclared slot"
35
+ },
36
+ "bg": {
37
+ "control.clearValue": "Изчистване на стойността",
38
+ "nestedSlots.tab.label": "Вложени слотове",
39
+ "nestedSlots.action.label": "Изпълнение на действие",
40
+ "specTemplateLayout.schema.label": "Регистрация за събитие",
41
+ "specTemplateLayout.schema.properties.customerName.label": "Клиент",
42
+ "specTemplateLayout.schema.properties.priority.label": "Приоритетна резервация",
43
+ "specTemplateLayout.schema.properties.contacts.label": "Контакти",
44
+ "specTemplateLayout.schema.properties.contacts.items.properties.name.label": "Име",
45
+ "specTemplateLayout.schema.properties.jsxNote.label": "Бележка (в слот на JSX шаблона)",
46
+ "specTemplateLayout.schema.properties.ractiveNote.label": "Бележка (в слот на Ractive шаблона)",
47
+ "specTemplateLayout.schema.properties.reference.label": "Референция",
48
+ "specTemplateLayout.schema.properties.copies.label": "Копия",
49
+ "specTemplateLayout.schema.properties.nativeNote.label": "Бележка (в слот на нативния шаблон)",
50
+ "specTemplateLayout.ui.elements.0.text": "Редактирайте тези полета; показаният шаблон реагира на всяко натискане на клавиш.",
51
+ "specTemplateLayout.ui.elements.3.elements.0.label": "lang: jsx",
52
+ "specTemplateLayout.ui.elements.3.elements.0.elements.0.text": "JavaScript изрази, компилирани със Sucrase.",
53
+ "specTemplateLayout.ui.elements.3.elements.0.elements.2.text": "elements е и подреден списък: {elements} показва всички дъщерни елементи по ред.",
54
+ "specTemplateLayout.ui.elements.3.elements.1.label": "lang: ractive",
55
+ "specTemplateLayout.ui.elements.3.elements.1.elements.0.text": "Преносимият профил по подразбиране: без функционални литерали, с точни обновявания.",
56
+ "specTemplateLayout.ui.elements.3.elements.2.label": "Избор на език",
57
+ "specTemplateLayout.ui.elements.3.elements.2.elements.0.text": "Без lang: config.jsonformsExtended.defaultTemplateLang определя езика (тук ractive).",
58
+ "specTemplateLayout.ui.elements.3.elements.2.elements.2.text": "Непознатият език се отчита с диагностика, без да се заменя с друг.",
59
+ "specTemplateLayout.greeting": "Здравейте",
60
+ "specTemplateLayout.priority": "Приоритетна резервация",
61
+ "specTemplateLayout.standard": "Стандартна резервация",
62
+ "specTemplateLayout.contacts": "Контакти",
63
+ "specTemplateLayout.resolved": "Избрано чрез конфигурацията",
64
+ "specTemplateLayout.native.label": "Нативен Svelte компонент",
65
+ "specTemplateLayout.native.errors": "Грешки в схемата",
66
+ "specTemplateLayout.native.readonly": "Само за четене",
67
+ "specTemplateLayout.native.editable": "Може да се редактира",
68
+ "specTemplateLayout.native.fallback": "Резервно съдържание за недеклариран слот"
69
+ }
70
+ }
@@ -0,0 +1,177 @@
1
+ {
2
+ "type": "VerticalLayout",
3
+ "options": {
4
+ "gap": "1.5rem"
5
+ },
6
+ "elements": [
7
+ {
8
+ "type": "Label",
9
+ "text": "Edit these; whichever engine is on screen reacts to every keystroke."
10
+ },
11
+ {
12
+ "type": "Control",
13
+ "scope": "#/properties/customerName"
14
+ },
15
+ {
16
+ "type": "Control",
17
+ "scope": "#/properties/priority"
18
+ },
19
+ {
20
+ "type": "Categorization",
21
+ "elements": [
22
+ {
23
+ "type": "Category",
24
+ "name": "jsx",
25
+ "label": "lang: jsx",
26
+ "elements": [
27
+ {
28
+ "type": "Label",
29
+ "text": "JavaScript expressions, compiled with Sucrase."
30
+ },
31
+ {
32
+ "type": "TemplateLayout",
33
+ "lang": "jsx",
34
+ "template": "<div><p data-greeting>Hello {data.customerName}</p><p data-branch>{data.priority ? 'Priority booking' : 'Standard booking'}</p><p data-list>Contacts: {data.contacts.map(c => c.name).join(', ')}</p><div data-slot>{elements['jsxNote']}</div></div>",
35
+ "elements": [
36
+ {
37
+ "type": "Control",
38
+ "scope": "#/properties/jsxNote",
39
+ "name": "jsxNote"
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "type": "Label",
45
+ "text": "elements is also an ordered list: {elements} mounts every child, in order."
46
+ },
47
+ {
48
+ "type": "TemplateLayout",
49
+ "lang": "jsx",
50
+ "template": "<div data-children>{elements}</div>",
51
+ "elements": [
52
+ {
53
+ "type": "Control",
54
+ "scope": "#/properties/reference",
55
+ "name": "reference"
56
+ },
57
+ {
58
+ "type": "Control",
59
+ "scope": "#/properties/copies"
60
+ }
61
+ ]
62
+ },
63
+ {
64
+ "type": "TemplateLayout",
65
+ "lang": "jsx",
66
+ "template": "<ul aria-label=\"Validation errors\">{errors.map((error, index) => <li key={index}>{error.message}</li>)}</ul>"
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "type": "Category",
72
+ "name": "ractive",
73
+ "label": "lang: ractive",
74
+ "elements": [
75
+ {
76
+ "type": "Label",
77
+ "text": "The portable default profile: no function literals, surgical updates."
78
+ },
79
+ {
80
+ "type": "TemplateLayout",
81
+ "lang": "ractive",
82
+ "template": "<div><p data-greeting>Hello {{data.customerName}}</p><p data-branch>{{#if data.priority}}Priority booking{{else}}Standard booking{{/if}}</p><p data-list>Contacts: {{#each data.contacts}}{{ @index ? ', ' : '' }}{{ .name }}{{/each}}</p><div data-slot>{{>ractiveNote}}</div></div>",
83
+ "elements": [
84
+ {
85
+ "type": "Control",
86
+ "scope": "#/properties/ractiveNote",
87
+ "name": "ractiveNote"
88
+ }
89
+ ]
90
+ }
91
+ ]
92
+ },
93
+ {
94
+ "type": "Category",
95
+ "name": "resolution",
96
+ "label": "Language resolution",
97
+ "elements": [
98
+ {
99
+ "type": "Label",
100
+ "text": "No lang: config.jsonformsExtended.defaultTemplateLang decides (here, ractive)."
101
+ },
102
+ {
103
+ "type": "TemplateLayout",
104
+ "template": "<p data-default>Resolved by config: {{data.customerName}}</p>"
105
+ },
106
+ {
107
+ "type": "Label",
108
+ "text": "An unknown language is diagnosed, never guessed."
109
+ },
110
+ {
111
+ "type": "TemplateLayout",
112
+ "lang": "handlebars",
113
+ "template": "<p>never rendered</p>"
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "type": "Category",
119
+ "name": "nested",
120
+ "label": "Nested slots",
121
+ "i18n": "nestedSlots.tab",
122
+ "elements": [
123
+ {
124
+ "type": "TemplateLayout",
125
+ "lang": "jsx",
126
+ "template": "<div data-nested-root>{elements}</div>",
127
+ "elements": [
128
+ {
129
+ "type": "TemplateLayout",
130
+ "name": "header",
131
+ "lang": "jsx",
132
+ "template": "<header>{elements['greeting']}</header>",
133
+ "elements": [
134
+ {
135
+ "type": "TemplateLayout",
136
+ "name": "greeting",
137
+ "lang": "jsx",
138
+ "template": "<div>Hello {data.customerName}</div>"
139
+ }
140
+ ]
141
+ },
142
+ {
143
+ "type": "TemplateLayout",
144
+ "lang": "jsx",
145
+ "template": "<section>{elements}</section>",
146
+ "elements": [
147
+ {
148
+ "type": "VerticalLayout",
149
+ "elements": [
150
+ {
151
+ "type": "Control",
152
+ "scope": "#/properties/customerName"
153
+ },
154
+ {
155
+ "type": "Control",
156
+ "scope": "#/properties/priority"
157
+ }
158
+ ]
159
+ },
160
+ {
161
+ "type": "Button",
162
+ "label": "Handle action",
163
+ "i18n": "nestedSlots.action",
164
+ "options": {
165
+ "action": "template-action"
166
+ }
167
+ }
168
+ ]
169
+ }
170
+ ]
171
+ }
172
+ ]
173
+ }
174
+ ]
175
+ }
176
+ ]
177
+ }
@@ -0,0 +1,19 @@
1
+ # Named templates and slots
2
+
3
+ Load `uischemas.json` into the host's `uischemas` registry. This file is trusted
4
+ host code; the UI models themselves contain no executable templates.
5
+
6
+ - `Template.name` matches **entry.uischema.name**, exactly and case-sensitively.
7
+ The first matching entry wins. `tester` is ignored for this lookup. Returning
8
+ -1 keeps these layouts out of ordinary ranked detail selection.
9
+ - The first card supplies named heading and body elements. The second uses
10
+ each Slot's first child as fallback. The empty optional Slot renders nothing.
11
+ - The nested card inherits the email body and replaces only its heading locally.
12
+ - All cards share the caller's schema and data path. Editing Contact name also
13
+ updates Default name; names identify UI models, not data properties or scopes.
14
+
15
+ Use unique template names and acyclic references. Hosts should diagnose missing
16
+ templates and duplicates and guard cyclic references.
17
+
18
+ This exercises TemplateRenderer and SlotRenderer, not TemplateLayoutRenderer:
19
+ TemplateLayout renders a source template, whereas these elements compose UI models.
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "Ada",
3
+ "email": "ada@example.org"
4
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "type": "object",
3
+ "properties": {
4
+ "name": {
5
+ "type": "string"
6
+ },
7
+ "email": {
8
+ "type": "string"
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "en": {
3
+ "specTemplateSlots.ui.elements.0.text": "Named UI schemas reuse the current data. Edit either name field to update both.",
4
+ "specTemplateSlots.ui.elements.1.elements.0.text": "Custom heading",
5
+ "specTemplateSlots.ui.elements.1.elements.1.label": "Contact name",
6
+ "specTemplateSlots.ui.elements.3.elements.0.text": "Inherited heading",
7
+ "specTemplateSlots.ui.elements.3.elements.1.label": "Inherited email",
8
+ "specTemplateSlots.registry.0.label": "Reusable contact",
9
+ "specTemplateSlots.registry.0.elements.0.elements.0.text": "Default heading",
10
+ "specTemplateSlots.registry.0.elements.1.elements.0.label": "Default name",
11
+ "specTemplateSlots.registry.1.label": "Nested composition",
12
+ "specTemplateSlots.registry.1.elements.0.elements.0.text": "Local heading overrides inherited heading"
13
+ },
14
+ "bg": {
15
+ "specTemplateSlots.ui.elements.0.text": "Именуваните UI схеми използват текущите данни. Редактирайте което и да е поле за име, за да обновите и двете.",
16
+ "specTemplateSlots.ui.elements.1.elements.0.text": "Персонализирано заглавие",
17
+ "specTemplateSlots.ui.elements.1.elements.1.label": "Име за контакт",
18
+ "specTemplateSlots.ui.elements.3.elements.0.text": "Наследено заглавие",
19
+ "specTemplateSlots.ui.elements.3.elements.1.label": "Наследен имейл",
20
+ "specTemplateSlots.registry.0.label": "Контакт за многократна употреба",
21
+ "specTemplateSlots.registry.0.elements.0.elements.0.text": "Заглавие по подразбиране",
22
+ "specTemplateSlots.registry.0.elements.1.elements.0.label": "Име по подразбиране",
23
+ "specTemplateSlots.registry.1.label": "Вложена композиция",
24
+ "specTemplateSlots.registry.1.elements.0.elements.0.text": "Локалното заглавие заменя наследеното заглавие"
25
+ }
26
+ }