reactive-md 0.9.2 → 0.10.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 (638) hide show
  1. package/CHANGELOG-ch.md +397 -333
  2. package/CHANGELOG.md +398 -334
  3. package/CONTRIBUTING-ch.md +22 -22
  4. package/CONTRIBUTING.md +22 -22
  5. package/README-ch.md +431 -431
  6. package/README-en.md +431 -431
  7. package/README.md +429 -429
  8. package/SECURITY-ch.md +83 -83
  9. package/SECURITY.md +83 -83
  10. package/THIRD_PARTY_NOTICES.md +0 -57
  11. package/bin/reactive-md.mjs +39 -39
  12. package/cli/args.mjs +263 -263
  13. package/cli/assets.mjs +395 -395
  14. package/cli/build.mjs +445 -445
  15. package/cli/check.mjs +444 -444
  16. package/cli/document.mjs +130 -130
  17. package/cli/errors.mjs +61 -61
  18. package/cli/fs-utils.mjs +133 -133
  19. package/cli/glob.mjs +203 -203
  20. package/cli/help.mjs +325 -323
  21. package/cli/init.mjs +1577 -1577
  22. package/cli/lint.mjs +177 -177
  23. package/cli/main.mjs +65 -65
  24. package/cli/migrate.mjs +368 -368
  25. package/cli/package-loader.mjs +41 -41
  26. package/cli/package.mjs +211 -211
  27. package/dist-library/LocalDocumentView-CP2QG86k.js +114 -0
  28. package/dist-library/{LocalDocumentViewCore-DXE0I0Qc.js → LocalDocumentViewCore-Cd6yMEkg.js} +379 -9445
  29. package/dist-library/LocalReactiveDocumentCore-VuYpZqdn.js +283 -0
  30. package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
  31. package/dist-library/authoring-Bwu_zCWs.js +768 -0
  32. package/dist-library/chart-B1TUtzm-.js +3 -0
  33. package/dist-library/choice-values-BItGjPD2.js +58 -0
  34. package/dist-library/color-values-r8Wf7ALn.js +6 -0
  35. package/dist-library/compile-B35rfzKr.js +1742 -0
  36. package/dist-library/compile-cache-key-D21X2Obx.js +28 -0
  37. package/dist-library/compiler-DBwLawMZ.js +98 -0
  38. package/dist-library/{compiler-core-DDDdvuLy.js → compiler-core-kkDiQ1RK.js} +4202 -3496
  39. package/dist-library/component-kernel-CsJSabHX.js +372 -0
  40. package/dist-library/{component-state-BRwvTV0d.js → component-state-Da0G8Ajc.js} +1 -1
  41. package/dist-library/component-utils-ZM3jUJNy.js +339 -0
  42. package/dist-library/conditional-branches-CIhJXasR.js +17 -0
  43. package/dist-library/config-validation-DbmsWAEV.js +469 -0
  44. package/dist-library/controls-DRy5rzzN.js +5970 -0
  45. package/dist-library/controls-DWlx-AQl.js +3 -0
  46. package/dist-library/{coordinate-B1VFK9fd.js → coordinate-c54pHfgf.js} +89 -89
  47. package/dist-library/data-BtFlkJzp.js +3 -0
  48. package/dist-library/data-table-CSAkm1eU.js +290 -0
  49. package/dist-library/data-table-model-DruztQFt.js +391 -0
  50. package/dist-library/data-visuals-rZQUeQM0.js +384 -0
  51. package/dist-library/{default-components-s21NevON.js → default-components-B-39etG9.js} +518 -355
  52. package/dist-library/{config-DXLvctiZ.js → default-config-CCa8rm2k.js} +265 -230
  53. package/dist-library/default-options-By16CVw1.js +131 -0
  54. package/dist-library/{registry-D6OGkOcX.js → default-registry-DXJy66xj.js} +4 -4
  55. package/dist-library/default-schema-CeYiEW1K.js +33 -0
  56. package/dist-library/diagram-BLepzI8l.js +3 -0
  57. package/dist-library/display-Bb6hAG5T.js +2065 -0
  58. package/dist-library/dist-Cueh1Psp.js +4761 -0
  59. package/dist-library/{document-theme-C8J6UyNO.js → document-theme-CJvN-nC1.js} +246 -4
  60. package/dist-library/{export-CIAIPBov.js → export-BSV4E0jv.js} +135 -135
  61. package/dist-library/font-aliases-CKYjwn4o.js +4 -0
  62. package/dist-library/gallery-BC6FYTqw.js +3 -0
  63. package/dist-library/{gallery-Dv1rOvL0.js → gallery-DM2yTVZJ.js} +1 -1
  64. package/dist-library/{html-Cr4CBwAH.js → html-CY9mC3Sr.js} +49 -48
  65. package/dist-library/{incremental-9nx92u9c.js → incremental-B-wW4H3F.js} +537 -384
  66. package/dist-library/{display-B_uutKkN.js → katex-4ukd4ZxT.js} +1555 -3618
  67. package/dist-library/layout-CPQggKxk.js +592 -0
  68. package/dist-library/layout-CaDWsDof.js +3 -0
  69. package/dist-library/limits-CFERRrlC.js +10 -0
  70. package/dist-library/localization-COdJ6lw2.js +6 -0
  71. package/dist-library/mafs-CnzDC5CR.js +3 -0
  72. package/dist-library/math-view-CyGTS6kv.js +20 -0
  73. package/dist-library/motion-tokens-Czk0RDmS.js +283 -0
  74. package/dist-library/mount-preset-DtrCX4G8.js +24 -0
  75. package/dist-library/numeric-sliders-BmJ1LCLx.js +542 -0
  76. package/dist-library/{observability-4KqXhIEU.js → observability-BVQ16ByQ.js} +125 -43
  77. package/dist-library/package-core-Cu_r_qs7.js +128 -0
  78. package/dist-library/parser-BHl9Lxbw.js +8 -0
  79. package/dist-library/parser-standard-DDAKv_DZ.js +4872 -0
  80. package/dist-library/plugin-packs-CkI0floL.js +19 -0
  81. package/dist-library/preset-core-BKPbH_Nv.js +1371 -0
  82. package/dist-library/props-0iDqxlTk.js +174 -0
  83. package/dist-library/react-74jdGBmu.js +32 -0
  84. package/dist-library/reactive-md-authoring.js +315 -296
  85. package/dist-library/reactive-md-build.js +334 -43
  86. package/dist-library/reactive-md-compiler-session.js +4 -0
  87. package/dist-library/reactive-md-compiler-standard.js +10 -10
  88. package/dist-library/reactive-md-compiler.js +3 -3
  89. package/dist-library/reactive-md-contracts.js +6 -0
  90. package/dist-library/reactive-md-default-packs.js +32 -15
  91. package/dist-library/reactive-md-default-preset.js +7 -7
  92. package/dist-library/reactive-md-export.js +6 -5
  93. package/dist-library/reactive-md-minimal-preset.js +3 -2
  94. package/dist-library/reactive-md-minimal-react-preset.js +26 -23
  95. package/dist-library/reactive-md-minimal.css +1 -1
  96. package/dist-library/reactive-md-observability.js +125 -3
  97. package/dist-library/reactive-md-pack-style-manifest.js +805 -0
  98. package/dist-library/reactive-md-plugin-chart.js +14 -9
  99. package/dist-library/reactive-md-plugin-data.js +8 -8
  100. package/dist-library/reactive-md-plugin-diagram.js +7 -6
  101. package/dist-library/reactive-md-plugin-forms.js +14 -13
  102. package/dist-library/reactive-md-plugin-gallery.js +6 -5
  103. package/dist-library/reactive-md-plugin-navigation.js +8 -8
  104. package/dist-library/reactive-md-plugin-network.js +13 -13
  105. package/dist-library/reactive-md-plugin-plot.js +7 -6
  106. package/dist-library/reactive-md-print.css +304 -304
  107. package/dist-library/reactive-md-react-component-accordion.js +10 -0
  108. package/dist-library/reactive-md-react-component-alert.js +10 -0
  109. package/dist-library/reactive-md-react-component-anchor.js +10 -0
  110. package/dist-library/reactive-md-react-component-badge.js +10 -0
  111. package/dist-library/reactive-md-react-component-card.js +10 -0
  112. package/dist-library/reactive-md-react-component-chart.js +22 -0
  113. package/dist-library/reactive-md-react-component-checkbox.js +10 -0
  114. package/dist-library/reactive-md-react-component-checklist.js +10 -0
  115. package/dist-library/reactive-md-react-component-choices.js +10 -0
  116. package/dist-library/reactive-md-react-component-column.js +6 -0
  117. package/dist-library/reactive-md-react-component-coordinate.js +21 -0
  118. package/dist-library/reactive-md-react-component-counter.js +10 -0
  119. package/dist-library/reactive-md-react-component-data-table.js +14 -0
  120. package/dist-library/reactive-md-react-component-date.js +10 -0
  121. package/dist-library/reactive-md-react-component-diagram.js +22 -0
  122. package/dist-library/reactive-md-react-component-disclosure.js +10 -0
  123. package/dist-library/reactive-md-react-component-edge.js +22 -0
  124. package/dist-library/reactive-md-react-component-else.js +10 -0
  125. package/dist-library/reactive-md-react-component-gallery-item.js +10 -0
  126. package/dist-library/reactive-md-react-component-gallery.js +10 -0
  127. package/dist-library/reactive-md-react-component-grid.js +10 -0
  128. package/dist-library/reactive-md-react-component-if.js +10 -0
  129. package/dist-library/reactive-md-react-component-input.js +10 -0
  130. package/dist-library/reactive-md-react-component-jump.js +10 -0
  131. package/dist-library/reactive-md-react-component-multi-select.js +10 -0
  132. package/dist-library/reactive-md-react-component-node.js +22 -0
  133. package/dist-library/reactive-md-react-component-number.js +10 -0
  134. package/dist-library/reactive-md-react-component-option.js +10 -0
  135. package/dist-library/reactive-md-react-component-panel.js +10 -0
  136. package/dist-library/reactive-md-react-component-plot.js +26 -0
  137. package/dist-library/reactive-md-react-component-progress.js +10 -0
  138. package/dist-library/reactive-md-react-component-quiz.js +10 -0
  139. package/dist-library/reactive-md-react-component-radio-group.js +10 -0
  140. package/dist-library/reactive-md-react-component-range-slider.js +10 -0
  141. package/dist-library/reactive-md-react-component-section.js +10 -0
  142. package/dist-library/reactive-md-react-component-select.js +10 -0
  143. package/dist-library/reactive-md-react-component-slider.js +10 -0
  144. package/dist-library/reactive-md-react-component-step.js +10 -0
  145. package/dist-library/reactive-md-react-component-steps.js +10 -0
  146. package/dist-library/reactive-md-react-component-tab.js +10 -0
  147. package/dist-library/reactive-md-react-component-table.js +14 -0
  148. package/dist-library/reactive-md-react-component-tabs.js +10 -0
  149. package/dist-library/reactive-md-react-component-text.js +10 -0
  150. package/dist-library/reactive-md-react-component-textarea.js +10 -0
  151. package/dist-library/reactive-md-react-component-timeline.js +14 -0
  152. package/dist-library/reactive-md-react-component-timer.js +10 -0
  153. package/dist-library/reactive-md-react-component-toggle.js +10 -0
  154. package/dist-library/reactive-md-react-component-tooltip.js +10 -0
  155. package/dist-library/reactive-md-react-component-validation.js +10 -0
  156. package/dist-library/reactive-md-react-minimal.js +4 -4
  157. package/dist-library/reactive-md-react-pack-controls.js +44 -0
  158. package/dist-library/reactive-md-react-pack-data.js +21 -0
  159. package/dist-library/reactive-md-react-pack-layout.js +37 -0
  160. package/dist-library/reactive-md-react-pack-visuals.js +43 -0
  161. package/dist-library/reactive-md-react-packed.js +50 -0
  162. package/dist-library/reactive-md-react-server.js +29 -27
  163. package/dist-library/reactive-md-react-static-server.js +24 -0
  164. package/dist-library/reactive-md-react-static.js +1 -0
  165. package/dist-library/reactive-md-react-unstyled.js +15 -12
  166. package/dist-library/reactive-md-react.js +15 -12
  167. package/dist-library/reactive-md-scan.js +1 -0
  168. package/dist-library/reactive-md-sdk.js +23 -9
  169. package/dist-library/reactive-md-standalone-configured.js +2 -2
  170. package/dist-library/reactive-md-standalone-host.js +2 -2
  171. package/dist-library/reactive-md-testing-browser.js +2 -2
  172. package/dist-library/reactive-md-testing-react.js +32 -32
  173. package/dist-library/reactive-md-testing.js +12 -12
  174. package/dist-library/reactive-md-vite.js +25 -9
  175. package/dist-library/reactive-md-worker-pool.js +401 -0
  176. package/dist-library/reactive-md.css +1 -1
  177. package/dist-library/reactive-md.js +97 -1554
  178. package/dist-library/registry-core-DxEaxhJ6.js +126 -0
  179. package/dist-library/render-nodes-B6j6Ip5I.js +9404 -0
  180. package/dist-library/requirements-C56sFIEs.js +157 -0
  181. package/dist-library/resources-6VaNgk-h.js +74 -0
  182. package/dist-library/rmd-pack-controls.css +1032 -0
  183. package/dist-library/rmd-pack-data.css +724 -0
  184. package/dist-library/rmd-pack-layout.css +1834 -0
  185. package/dist-library/rmd-pack-resource-chart.css +300 -0
  186. package/dist-library/rmd-pack-resource-controls.css +781 -0
  187. package/dist-library/rmd-pack-resource-data-visuals.css +501 -0
  188. package/dist-library/rmd-pack-resource-diagram.css +106 -0
  189. package/dist-library/rmd-pack-resource-gallery.css +346 -0
  190. package/dist-library/rmd-pack-resource-graphics.css +516 -0
  191. package/dist-library/rmd-pack-resource-layout.css +1489 -0
  192. package/dist-library/rmd-pack-resource-mafs-core.css +124 -0
  193. package/dist-library/rmd-pack-resource-mafs.css +129 -0
  194. package/dist-library/rmd-pack-resource-visual-base.css +224 -0
  195. package/dist-library/rmd-pack-visuals.css +1394 -0
  196. package/dist-library/runtime-BHeuLOv_.js +1369 -0
  197. package/dist-library/runtime-requirement-DzPO8raU.js +772 -0
  198. package/dist-library/schema-core-CDXfxdID.js +155 -0
  199. package/dist-library/sdk-core-CnE-n0Z7.js +1295 -0
  200. package/dist-library/{session-core-dxQCJBNa.js → session-core-C071yQwV.js} +147 -133
  201. package/dist-library/sha256-utf16-Bmandi_H.js +937 -0
  202. package/dist-library/shareable-CHCDnl6j.js +844 -0
  203. package/dist-library/shared-bTzN-F4g.js +3 -0
  204. package/dist-library/structural-views-30-YD_TJ.js +11 -0
  205. package/dist-library/table-surface-CfZn_tk-.js +13 -0
  206. package/dist-library/types/assemblies/compile-cache-key.d.ts +11 -0
  207. package/dist-library/types/assemblies/default-config.d.ts +35 -0
  208. package/dist-library/types/{local/configuration/options.d.ts → assemblies/default-options.d.ts} +4 -4
  209. package/dist-library/types/assemblies/default-registry.d.ts +18 -0
  210. package/dist-library/types/{local/configuration/schema.d.ts → assemblies/default-schema.d.ts} +4 -4
  211. package/dist-library/types/authoring/catalog.d.ts +14 -2
  212. package/dist-library/types/authoring/extensions.d.ts +1 -1
  213. package/dist-library/types/authoring/index.d.ts +4 -4
  214. package/dist-library/types/authoring/templates.d.ts +1 -1
  215. package/dist-library/types/compiler/index.d.ts +1 -0
  216. package/dist-library/types/compiler/session.d.ts +19 -0
  217. package/dist-library/types/compiler/standard.d.ts +1 -0
  218. package/dist-library/types/components/chart/default-chart-types.d.ts +3 -0
  219. package/dist-library/types/components/chart/default-chart.d.ts +7 -0
  220. package/dist-library/types/components/entries/accordion.d.ts +3 -0
  221. package/dist-library/types/components/entries/alert.d.ts +3 -0
  222. package/dist-library/types/components/entries/anchor.d.ts +3 -0
  223. package/dist-library/types/components/entries/badge.d.ts +3 -0
  224. package/dist-library/types/components/entries/card.d.ts +3 -0
  225. package/dist-library/types/components/entries/chart.d.ts +3 -0
  226. package/dist-library/types/components/entries/checkbox.d.ts +3 -0
  227. package/dist-library/types/components/entries/checklist.d.ts +3 -0
  228. package/dist-library/types/components/entries/choices.d.ts +3 -0
  229. package/dist-library/types/components/entries/column.d.ts +3 -0
  230. package/dist-library/types/components/entries/coordinate.d.ts +3 -0
  231. package/dist-library/types/components/entries/counter.d.ts +3 -0
  232. package/dist-library/types/components/entries/data-table.d.ts +3 -0
  233. package/dist-library/types/components/entries/date.d.ts +3 -0
  234. package/dist-library/types/components/entries/diagram.d.ts +3 -0
  235. package/dist-library/types/components/entries/disclosure.d.ts +3 -0
  236. package/dist-library/types/components/entries/edge.d.ts +3 -0
  237. package/dist-library/types/components/entries/else.d.ts +3 -0
  238. package/dist-library/types/components/entries/gallery-item.d.ts +3 -0
  239. package/dist-library/types/components/entries/gallery.d.ts +3 -0
  240. package/dist-library/types/components/entries/grid.d.ts +3 -0
  241. package/dist-library/types/components/entries/if.d.ts +3 -0
  242. package/dist-library/types/components/entries/input.d.ts +3 -0
  243. package/dist-library/types/components/entries/jump.d.ts +3 -0
  244. package/dist-library/types/components/entries/multi-select.d.ts +3 -0
  245. package/dist-library/types/components/entries/node.d.ts +3 -0
  246. package/dist-library/types/components/entries/number.d.ts +3 -0
  247. package/dist-library/types/components/entries/option.d.ts +3 -0
  248. package/dist-library/types/components/entries/panel.d.ts +3 -0
  249. package/dist-library/types/components/entries/plot.d.ts +3 -0
  250. package/dist-library/types/components/entries/progress.d.ts +3 -0
  251. package/dist-library/types/components/entries/quiz.d.ts +3 -0
  252. package/dist-library/types/components/entries/radio-group.d.ts +3 -0
  253. package/dist-library/types/components/entries/range-slider.d.ts +3 -0
  254. package/dist-library/types/components/entries/section.d.ts +3 -0
  255. package/dist-library/types/components/entries/select.d.ts +3 -0
  256. package/dist-library/types/components/entries/slider.d.ts +3 -0
  257. package/dist-library/types/components/entries/step.d.ts +3 -0
  258. package/dist-library/types/components/entries/steps.d.ts +3 -0
  259. package/dist-library/types/components/entries/tab.d.ts +3 -0
  260. package/dist-library/types/components/entries/table.d.ts +3 -0
  261. package/dist-library/types/components/entries/tabs.d.ts +3 -0
  262. package/dist-library/types/components/entries/text.d.ts +3 -0
  263. package/dist-library/types/components/entries/textarea.d.ts +3 -0
  264. package/dist-library/types/components/entries/timeline.d.ts +3 -0
  265. package/dist-library/types/components/entries/timer.d.ts +3 -0
  266. package/dist-library/types/components/entries/toggle.d.ts +3 -0
  267. package/dist-library/types/components/entries/tooltip.d.ts +3 -0
  268. package/dist-library/types/components/entries/validation.d.ts +3 -0
  269. package/dist-library/types/components/layout/layout.d.ts +6 -3
  270. package/dist-library/types/components/layout/structural-views.d.ts +3 -0
  271. package/dist-library/types/components/mount-preset.d.ts +2 -0
  272. package/dist-library/types/components/packs/controls.d.ts +2 -0
  273. package/dist-library/types/components/packs/data.d.ts +2 -0
  274. package/dist-library/types/components/packs/layout.d.ts +2 -0
  275. package/dist-library/types/components/packs/visuals.d.ts +2 -0
  276. package/dist-library/types/components/shared/data-visuals.d.ts +3 -0
  277. package/dist-library/types/components/shared/table-surface.d.ts +10 -0
  278. package/dist-library/types/components/shared/visual-helpers.d.ts +24 -0
  279. package/dist-library/types/components/shared/visuals.d.ts +1 -3
  280. package/dist-library/types/components/table/data-table-model.d.ts +141 -0
  281. package/dist-library/types/components/table/data-table.d.ts +3 -50
  282. package/dist-library/types/{local/configuration → contracts}/component-kernel.d.ts +9 -2
  283. package/dist-library/types/contracts/font-aliases.d.ts +18 -0
  284. package/dist-library/types/contracts/index.d.ts +8 -0
  285. package/dist-library/types/{local/configuration → contracts}/limits.d.ts +9 -1
  286. package/dist-library/types/contracts/localization.d.ts +6 -0
  287. package/dist-library/types/contracts/number-literal.d.ts +2 -0
  288. package/dist-library/types/contracts/runtime-types.d.ts +19 -0
  289. package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
  290. package/dist-library/types/export/index.d.ts +4 -1
  291. package/dist-library/types/local/compilation/cache-version.d.ts +1 -0
  292. package/dist-library/types/local/compilation/compile-status.d.ts +2 -0
  293. package/dist-library/types/local/compilation/compiler-bindings.d.ts +1 -1
  294. package/dist-library/types/local/compilation/compiler-capabilities.d.ts +4 -1
  295. package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
  296. package/dist-library/types/local/compilation/compiler-core.d.ts +1 -1
  297. package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
  298. package/dist-library/types/local/compilation/compiler-embedding.d.ts +20 -0
  299. package/dist-library/types/local/compilation/compiler-expressions.d.ts +17 -5
  300. package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
  301. package/dist-library/types/local/compilation/compiler-structure.d.ts +9 -3
  302. package/dist-library/types/local/compilation/compiler-tables.d.ts +4 -2
  303. package/dist-library/types/local/compilation/compiler-validation.d.ts +14 -7
  304. package/dist-library/types/local/compilation/compiler-values.d.ts +2 -3
  305. package/dist-library/types/local/compilation/compiler.d.ts +1 -1
  306. package/dist-library/types/local/compilation/component-usage.d.ts +2 -0
  307. package/dist-library/types/local/compilation/runtime-requirement.d.ts +3 -0
  308. package/dist-library/types/local/compilation/session/incremental.d.ts +5 -1
  309. package/dist-library/types/local/compilation/streaming.d.ts +1 -1
  310. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +228 -2
  311. package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
  312. package/dist-library/types/local/configuration/embedding.d.ts +4 -0
  313. package/dist-library/types/local/configuration/kernel-value-rules.d.ts +1 -1
  314. package/dist-library/types/local/configuration/options-core.d.ts +8 -2
  315. package/dist-library/types/local/evaluation/choice-values.d.ts +22 -0
  316. package/dist-library/types/local/evaluation/computations.d.ts +13 -5
  317. package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
  318. package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
  319. package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
  320. package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
  321. package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
  322. package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
  323. package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
  324. package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
  325. package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
  326. package/dist-library/types/local/evaluation/validation.d.ts +8 -6
  327. package/dist-library/types/local/index.d.ts +10 -4
  328. package/dist-library/types/local/observability-core.d.ts +20 -1
  329. package/dist-library/types/local/observability.d.ts +2 -0
  330. package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
  331. package/dist-library/types/local/parsing/parse-budget.d.ts +18 -2
  332. package/dist-library/types/local/parsing/parser-region.d.ts +13 -2
  333. package/dist-library/types/local/parsing/parser-tags.d.ts +6 -1
  334. package/dist-library/types/local/parsing/rmd-recovery.d.ts +8 -0
  335. package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
  336. package/dist-library/types/local/performance-report.d.ts +70 -0
  337. package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
  338. package/dist-library/types/local/runtime/runtime-pool.d.ts +14 -0
  339. package/dist-library/types/local/runtime/runtime.d.ts +3 -1
  340. package/dist-library/types/local/runtime/state.d.ts +30 -15
  341. package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
  342. package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
  343. package/dist-library/types/local/source/authoring.d.ts +10 -0
  344. package/dist-library/types/local/source/source-migration.d.ts +1 -0
  345. package/dist-library/types/local/transport/worker-handler.d.ts +3 -0
  346. package/dist-library/types/local/transport/worker-job.d.ts +12 -2
  347. package/dist-library/types/local/transport/worker-pool.d.ts +68 -0
  348. package/dist-library/types/local/transport/worker.d.ts +14 -0
  349. package/dist-library/types/local/types.d.ts +70 -27
  350. package/dist-library/types/observability.d.ts +1 -0
  351. package/dist-library/types/presets/default-semantics.d.ts +1 -1
  352. package/dist-library/types/presets/identity.d.ts +1 -8
  353. package/dist-library/types/presets/pack-style-entry.d.ts +3 -0
  354. package/dist-library/types/presets/pack-style-manifest.d.ts +11 -0
  355. package/dist-library/types/react/component-api.d.ts +24 -4
  356. package/dist-library/types/react/component-loader.d.ts +61 -0
  357. package/dist-library/types/react/component-primitives.d.ts +5 -5
  358. package/dist-library/types/react/component-utils.d.ts +11 -0
  359. package/dist-library/types/react/font-aliases.d.ts +2 -0
  360. package/dist-library/types/react/index.d.ts +9 -5
  361. package/dist-library/types/react/localization.d.ts +5 -6
  362. package/dist-library/types/react/minimal.d.ts +2 -2
  363. package/dist-library/types/react/package-core.d.ts +6 -0
  364. package/dist-library/types/react/packed.d.ts +17 -0
  365. package/dist-library/types/react/render-lifecycle.d.ts +9 -0
  366. package/dist-library/types/{local → react}/rendering/document/ExtendedHtmlFragment.d.ts +1 -1
  367. package/dist-library/types/{local → react}/rendering/document/LocalDocumentViewCore.d.ts +11 -4
  368. package/dist-library/types/react/rendering/document/LocalPooledDocumentView.d.ts +8 -0
  369. package/dist-library/types/react/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
  370. package/dist-library/types/react/rendering/document/LocalStaticDocumentView.d.ts +18 -0
  371. package/dist-library/types/react/rendering/document/StaticExternalSlot.d.ts +25 -0
  372. package/dist-library/types/react/rendering/document/StaticHostData.d.ts +14 -0
  373. package/dist-library/types/{local → react}/rendering/document/render-nodes.d.ts +8 -8
  374. package/dist-library/types/react/rendering/document/static-runtime.d.ts +11 -0
  375. package/dist-library/types/{local → react}/rendering/document/use-author-script.d.ts +2 -2
  376. package/dist-library/types/{local → react}/rendering/document/validation-state.d.ts +3 -3
  377. package/dist-library/types/{local → react}/rendering/document/view-render-context.d.ts +40 -8
  378. package/dist-library/types/{local → react}/rendering/document/view-revision.d.ts +5 -14
  379. package/dist-library/types/{local → react}/rendering/render-types.d.ts +5 -5
  380. package/dist-library/types/react/rendering/table/data-table.d.ts +5 -0
  381. package/dist-library/types/{local → react}/rendering/table/table-numeric-columns.d.ts +3 -3
  382. package/dist-library/types/react/sdk-core.d.ts +15 -4
  383. package/dist-library/types/react/sdk.d.ts +2 -1
  384. package/dist-library/types/react/server.d.ts +3 -10
  385. package/dist-library/types/react/static-server.d.ts +12 -0
  386. package/dist-library/types/scan/index.d.ts +15 -0
  387. package/dist-library/types/sdk/assembly.d.ts +3 -0
  388. package/dist-library/types/sdk/config.d.ts +2 -35
  389. package/dist-library/types/sdk/default-identity.d.ts +3 -0
  390. package/dist-library/types/sdk/font.d.ts +13 -0
  391. package/dist-library/types/sdk/index.d.ts +2 -1
  392. package/dist-library/types/sdk/preset.d.ts +9 -0
  393. package/dist-library/types/sdk/props.d.ts +8 -3
  394. package/dist-library/types/sdk/registry-core.d.ts +2 -2
  395. package/dist-library/types/sdk/registry.d.ts +2 -18
  396. package/dist-library/types/sdk/theme.d.ts +5 -0
  397. package/dist-library/types/sdk/types.d.ts +8 -2
  398. package/dist-library/types/sdk/version.d.ts +2 -0
  399. package/dist-library/types/shareable.d.ts +15 -3
  400. package/dist-library/types/standalone/prepare.d.ts +4 -2
  401. package/dist-library/types/standalone/session-core.d.ts +5 -2
  402. package/dist-library/types/vite/index.d.ts +3 -0
  403. package/dist-library/types/vite/registration.d.ts +1 -0
  404. package/dist-library/{types-Ib5kSScP.js → types-B4qG8J4S.js} +1 -1
  405. package/dist-library/types-FYhRWRn9.js +3 -0
  406. package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
  407. package/dist-library/validation-DRuW0Wl9.js +433 -0
  408. package/dist-library/{version-DAxuGOG2.js → version-4wzhbvDG.js} +24 -33
  409. package/dist-library/visual-frame-y5RFhJ0_.js +19 -0
  410. package/dist-library/visual-helpers-UU6xiL8g.js +75 -0
  411. package/dist-library/visuals-7xzoL9ql.js +49340 -0
  412. package/dist-library/visuals-CdHezgh5.js +3 -0
  413. package/dist-library/worker-3ldRjOEG.js +1632 -0
  414. package/dist-standalone/reactive-md-standalone.css +1 -1
  415. package/dist-standalone/reactive-md-standalone.js +127 -366
  416. package/docs/README-ch.md +104 -101
  417. package/docs/README.md +104 -101
  418. package/docs/compatibility/api-stability-ch.md +1 -1
  419. package/docs/compatibility/api-stability-en.md +1 -1
  420. package/docs/compatibility/compatibility-ch.md +146 -146
  421. package/docs/compatibility/compatibility-en.md +146 -146
  422. package/docs/compatibility/compatibility-manifest.schema.json +3 -2
  423. package/docs/compatibility/deprecation-ch.md +2 -2
  424. package/docs/compatibility/deprecation-en.md +2 -2
  425. package/docs/compatibility/source-versioning-ch.md +170 -162
  426. package/docs/compatibility/source-versioning-en.md +171 -162
  427. package/docs/compatibility/support-matrix-ch.md +4 -3
  428. package/docs/compatibility/support-matrix-en.md +4 -3
  429. package/docs/development/component-development-ch.md +66 -66
  430. package/docs/development/component-development-en.md +66 -66
  431. package/docs/development/component-development-reference-ch.md +269 -253
  432. package/docs/development/component-development-reference-en.md +254 -238
  433. package/docs/development/component-protocol-ch.md +768 -748
  434. package/docs/development/component-protocol-en.md +770 -750
  435. package/docs/development/extension-tutorial-ch.md +308 -308
  436. package/docs/development/extension-tutorial-en.md +308 -308
  437. package/docs/development/performance-overview-ch.md +422 -422
  438. package/docs/development/performance-overview-en.md +422 -422
  439. package/docs/guides/local-guide-ch.md +621 -532
  440. package/docs/guides/local-guide-en.md +621 -532
  441. package/docs/integration/author-tools-ch.md +66 -64
  442. package/docs/integration/author-tools-en.md +66 -64
  443. package/docs/integration/compiler-ch.md +90 -49
  444. package/docs/integration/compiler-en.md +77 -36
  445. package/docs/integration/directory-discovery-en.md +1 -1
  446. package/docs/integration/editor-ch.md +295 -295
  447. package/docs/integration/editor-en.md +303 -303
  448. package/docs/integration/extension-sdk-ch.md +424 -394
  449. package/docs/integration/extension-sdk-en.md +409 -379
  450. package/docs/integration/local-integration-ch.md +648 -646
  451. package/docs/integration/local-integration-en.md +664 -662
  452. package/docs/integration/pdf-export-ch.md +42 -0
  453. package/docs/integration/pdf-export-en.md +42 -0
  454. package/docs/integration/shareable-export-ch.md +299 -307
  455. package/docs/integration/shareable-export-en.md +301 -309
  456. package/docs/reference/diagnostics-counting-ch.md +127 -104
  457. package/docs/reference/diagnostics-counting-en.md +127 -104
  458. package/docs/reference/html-compatibility-ch.md +93 -93
  459. package/docs/reference/html-compatibility-en.md +95 -95
  460. package/docs/reference/local-interaction-syntax-ch.md +913 -724
  461. package/docs/reference/local-interaction-syntax-en.md +911 -722
  462. package/docs/reference/public-api-ch.md +134 -21
  463. package/docs/reference/public-api-en.md +134 -21
  464. package/docs/reference/theme-protocol-ch.md +198 -198
  465. package/docs/reference/theme-protocol-en.md +217 -217
  466. package/docs/releases/release-0.10.0-ch.md +45 -0
  467. package/docs/releases/release-0.10.0-en.md +45 -0
  468. package/docs/releases/release-0.4.0-ch.md +91 -91
  469. package/docs/releases/release-0.4.0-en.md +91 -91
  470. package/docs/releases/release-0.4.1-ch.md +25 -25
  471. package/docs/releases/release-0.4.1-en.md +25 -25
  472. package/docs/releases/release-0.5.0-ch.md +43 -43
  473. package/docs/releases/release-0.5.0-en.md +43 -43
  474. package/docs/releases/release-0.5.1-ch.md +41 -41
  475. package/docs/releases/release-0.5.1-en.md +41 -41
  476. package/docs/releases/release-0.5.2-ch.md +37 -37
  477. package/docs/releases/release-0.5.2-en.md +37 -37
  478. package/docs/releases/release-0.5.3-ch.md +26 -26
  479. package/docs/releases/release-0.5.3-en.md +26 -26
  480. package/docs/releases/release-0.6.0-ch.md +59 -59
  481. package/docs/releases/release-0.6.0-en.md +59 -59
  482. package/docs/releases/release-0.6.1-ch.md +29 -29
  483. package/docs/releases/release-0.6.1-en.md +29 -29
  484. package/docs/releases/release-0.7.0-ch.md +86 -86
  485. package/docs/releases/release-0.7.0-en.md +86 -86
  486. package/docs/releases/release-0.9.3-ch.md +45 -0
  487. package/docs/releases/release-0.9.3-en.md +45 -0
  488. package/examples/component-package/README-ch.md +101 -101
  489. package/examples/component-package/README.md +133 -133
  490. package/examples/conformance/README-ch.md +55 -55
  491. package/examples/conformance/README.md +55 -55
  492. package/examples/conformance/component-protocol-1.json +482 -482
  493. package/examples/conformance/component-protocol-1.schema.json +76 -76
  494. package/examples/conformance/local-draft-1.json +50 -50
  495. package/examples/conformance/local-draft-2.json +212 -212
  496. package/examples/conformance/local-draft-4.json +441 -0
  497. package/examples/game-2048-package/LICENSE +21 -21
  498. package/examples/game-2048-package/NOTICES.md +11 -11
  499. package/examples/game-2048-package/README-ch.md +91 -91
  500. package/examples/game-2048-package/README.md +98 -98
  501. package/examples/game-2048-package/package.json +35 -35
  502. package/examples/game-2048-package/sample/document.reactive.md +17 -17
  503. package/examples/game-2048-package/scripts/build-export.mjs +44 -44
  504. package/examples/game-2048-package/scripts/build.mjs +130 -130
  505. package/examples/game-2048-package/scripts/verify.mjs +180 -180
  506. package/examples/game-2048-package/src/component.css +161 -161
  507. package/examples/game-2048-package/src/components.tsx +326 -326
  508. package/examples/game-2048-package/src/game-engine.ts +228 -228
  509. package/examples/game-2048-package/src/harness.tsx +34 -34
  510. package/examples/game-2048-package/src/manifest.ts +85 -85
  511. package/examples/game-2048-package/src/node-entry.ts +30 -30
  512. package/examples/game-2048-package/src/sample.ts +4 -4
  513. package/examples/game-2048-package/tsconfig.json +15 -15
  514. package/examples/integration/README-ch.md +114 -82
  515. package/examples/integration/README.md +114 -82
  516. package/examples/integration/chat-session/index.mjs +91 -0
  517. package/examples/integration/chat-session/package.json +10 -0
  518. package/examples/integration/core/index.mjs +32 -32
  519. package/examples/integration/extension-sdk/README-ch.md +24 -24
  520. package/examples/integration/extension-sdk/README.md +24 -24
  521. package/examples/integration/static-embed/embed.mjs +44 -0
  522. package/examples/integration/static-embed/index.html +12 -0
  523. package/examples/integration/static-embed/main.mjs +24 -0
  524. package/examples/integration/static-embed/references.mjs +5 -0
  525. package/examples/integration/static-embed/render.mjs +10 -0
  526. package/examples/integration/worker/index.html +19 -19
  527. package/examples/integration/worker/main.js +61 -61
  528. package/examples/integration/worker/package.json +13 -13
  529. package/examples/integration/worker/worker.js +3 -3
  530. package/examples/local/README-ch.md +76 -76
  531. package/examples/local/README.md +76 -76
  532. package/examples/local/charts.reactive.md +73 -73
  533. package/examples/local/recipes/invoice-zh.reactive.md +36 -36
  534. package/examples/local/recipes/invoice.reactive.md +36 -36
  535. package/examples/local/recipes/workshop-zh.reactive.md +33 -33
  536. package/examples/local/recipes/workshop.reactive.md +33 -33
  537. package/examples/local/showcase/README-ch.md +22 -22
  538. package/examples/local/showcase/README.md +31 -31
  539. package/examples/local/showcase/explore.reactive.md +102 -102
  540. package/examples/local/showcase/flow.reactive.md +86 -86
  541. package/examples/local/showcase/forms.reactive.md +126 -126
  542. package/examples/local/showcase/functions.reactive.md +119 -119
  543. package/examples/local/showcase/layout.reactive.md +100 -100
  544. package/examples/local/showcase/statistics.reactive.md +108 -108
  545. package/examples/local/showcase/tasks.reactive.md +89 -89
  546. package/examples/local/showcase/zh/explore.reactive.md +102 -102
  547. package/examples/local/showcase/zh/flow.reactive.md +86 -86
  548. package/examples/local/showcase/zh/forms.reactive.md +126 -126
  549. package/examples/local/showcase/zh/functions.reactive.md +119 -119
  550. package/examples/local/showcase/zh/layout.reactive.md +100 -100
  551. package/examples/local/showcase/zh/statistics.reactive.md +108 -108
  552. package/examples/local/showcase/zh/tasks.reactive.md +89 -89
  553. package/examples/minimal-extension/README-ch.md +78 -78
  554. package/examples/minimal-extension/README.md +78 -78
  555. package/examples/minimal-extension/index.html +15 -15
  556. package/examples/minimal-extension/package.json +26 -26
  557. package/examples/minimal-extension/sample/document.reactive.md +10 -10
  558. package/examples/minimal-extension/scripts/build.mjs +32 -32
  559. package/examples/minimal-extension/scripts/export.mjs +72 -72
  560. package/examples/minimal-extension/scripts/test-node.mjs +75 -75
  561. package/examples/minimal-extension/src/extension.tsx +90 -90
  562. package/examples/minimal-extension/src/preview.tsx +12 -12
  563. package/examples/minimal-extension/src/source.ts +4 -4
  564. package/examples/minimal-extension/tsconfig.json +14 -14
  565. package/examples/sci-fi-theme/README-ch.md +133 -133
  566. package/examples/sci-fi-theme/README.md +148 -148
  567. package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -454
  568. package/examples/sci-fi-theme/demo/demo.css +638 -638
  569. package/examples/sci-fi-theme/demo/document.reactive.md +206 -206
  570. package/examples/sci-fi-theme/demo/index.html +13 -13
  571. package/examples/sci-fi-theme/demo/main.tsx +215 -215
  572. package/examples/sci-fi-theme/docs/design-system-ch.md +245 -245
  573. package/examples/sci-fi-theme/docs/design-system.md +474 -474
  574. package/examples/sci-fi-theme/package.json +28 -28
  575. package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -98
  576. package/examples/sci-fi-theme/src/components.css +2370 -2370
  577. package/examples/sci-fi-theme/src/index.ts +6 -6
  578. package/examples/sci-fi-theme/src/notch.css +142 -142
  579. package/examples/sci-fi-theme/src/sci-fi.css +7 -7
  580. package/examples/sci-fi-theme/src/theme.ts +39 -39
  581. package/examples/sci-fi-theme/tsconfig.json +20 -20
  582. package/examples/sci-fi-theme/vite.config.ts +24 -24
  583. package/examples/tetris-package/LICENSE +21 -21
  584. package/examples/tetris-package/NOTICES.md +11 -11
  585. package/examples/tetris-package/README-ch.md +91 -91
  586. package/examples/tetris-package/README.md +95 -95
  587. package/examples/tetris-package/package.json +35 -35
  588. package/examples/tetris-package/sample/document.reactive.md +16 -16
  589. package/examples/tetris-package/scripts/build-export.mjs +44 -44
  590. package/examples/tetris-package/scripts/build.mjs +130 -130
  591. package/examples/tetris-package/scripts/verify.mjs +173 -173
  592. package/examples/tetris-package/src/component.css +145 -145
  593. package/examples/tetris-package/src/components.tsx +334 -334
  594. package/examples/tetris-package/src/harness.tsx +34 -34
  595. package/examples/tetris-package/src/manifests.ts +93 -93
  596. package/examples/tetris-package/src/node-entry.ts +16 -16
  597. package/examples/tetris-package/src/sample.ts +4 -4
  598. package/examples/tetris-package/src/tetris-engine.ts +325 -325
  599. package/examples/tetris-package/tsconfig.json +15 -15
  600. package/package.json +66 -2
  601. package/dist-library/LocalDocumentView-BuqgJZEY.js +0 -109
  602. package/dist-library/LocalReactiveDocumentCore-CWBe4Mm5.js +0 -275
  603. package/dist-library/authoring-Ci_KzJ0q.js +0 -892
  604. package/dist-library/compile-Dx6Uw3D9.js +0 -1249
  605. package/dist-library/compiler-dxLPB9Ym.js +0 -86
  606. package/dist-library/config-validation-D3D7Dy2J.js +0 -586
  607. package/dist-library/controls-DoZyLCrV.js +0 -6740
  608. package/dist-library/data-table-8-3F15Jf.js +0 -296
  609. package/dist-library/layout-BBB2VF0S.js +0 -562
  610. package/dist-library/mount-preset-DMZ5wd3t.js +0 -13
  611. package/dist-library/options-BBp9IcHm.js +0 -121
  612. package/dist-library/package-core-K5xesGqy.js +0 -117
  613. package/dist-library/parser-standard-CBA1-hdG.js +0 -9630
  614. package/dist-library/plugin-packs-Bh1HhLym.js +0 -19
  615. package/dist-library/preset-core-DeZPA8IE.js +0 -1298
  616. package/dist-library/props-sJ8vk0cr.js +0 -183
  617. package/dist-library/react-0DCh-Mar.js +0 -7
  618. package/dist-library/registry-core-C9xOunaw.js +0 -479
  619. package/dist-library/resources-B0x_w3s9.js +0 -229
  620. package/dist-library/runtime-BpQdZmFI.js +0 -1288
  621. package/dist-library/schema-BryM_VRW.js +0 -40
  622. package/dist-library/sdk-core-ChslheKs.js +0 -1167
  623. package/dist-library/shareable-B8xMoGEa.js +0 -814
  624. package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +0 -6
  625. package/dist-library/types/local/rendering/table/data-table.d.ts +0 -13
  626. package/dist-library/types-daDo2c_w.js +0 -3
  627. package/dist-library/validation-B3RI0xOk.js +0 -1123
  628. package/dist-library/visual-frame-_rcd5HUv.js +0 -48
  629. package/dist-library/visuals-DkDhNdEZ.js +0 -72572
  630. /package/dist-library/types/{local/configuration → contracts}/color-values.d.ts +0 -0
  631. /package/dist-library/types/{local/html → contracts}/html-names.d.ts +0 -0
  632. /package/dist-library/types/{local/configuration → contracts}/schema-core.d.ts +0 -0
  633. /package/dist-library/types/{local → react}/rendering/code/code-block.d.ts +0 -0
  634. /package/dist-library/types/{local → react}/rendering/code/code-languages.d.ts +0 -0
  635. /package/dist-library/types/{local → react}/rendering/document/LocalDocumentView.d.ts +0 -0
  636. /package/dist-library/types/{local → react}/rendering/document/use-color-scheme.d.ts +0 -0
  637. /package/dist-library/types/{local → react}/rendering/image/image-view.d.ts +0 -0
  638. /package/dist-library/types/{local → react}/rendering/math-view.d.ts +0 -0
@@ -1,750 +1,770 @@
1
- # Reactive MD component protocol
2
-
3
- **English** · [中文](component-protocol-ch.md)
4
-
5
- Protocol revision `component-protocol-3` · applicable syntax `local-draft-3` · current package version `0.9.2`
6
-
7
- Components are the building blocks of the Reactive MD language. This protocol defines the shared contract for contribution, implementation and acceptance, connecting author syntax, the compiler, the runtime, the React reference adapter and machine conformance data. Authors writing documents follow the [local interaction syntax specification](../reference/local-interaction-syntax-en.md); hosts integrating follow [local mode integration](../integration/local-integration-en.md); this document is for contributors, reviewers and tests.
8
-
9
- | To learn about | Read |
10
- | --- | --- |
11
- | How to write documents | [Beginner guide](../guides/local-guide-en.md), [syntax specification](../reference/local-interaction-syntax-en.md) |
12
- | How to add or change components | [Component development guide](component-development-en.md), sections 12 and 13 of this document |
13
- | How to run acceptance | [Language conformance data](../../examples/conformance/README.md), section 11 of this document |
14
- | Version and migration rules | [Versions and compatibility](../compatibility/compatibility-en.md) |
15
- | Security boundary | [Security policy](../../SECURITY.md) |
16
-
17
- ## 1. Status, terminology and normative force
18
-
19
- ### CP-SCOPE-01 Version axes (existing)
20
-
21
- Reactive MD maintains the following independent version axes:
22
-
23
- | Version axis | Current value | Determines |
24
- | --- | --- | --- |
25
- | Package version | `0.5.2` | npm release, core and React entries, upgrade compatibility rules |
26
- | Syntax revision | `local-draft-3` | Tags, attributes and expressions authors can write |
27
- | Protocol revision | `component-protocol-3` | Component contribution requirements, acceptance gates and machine data semantics |
28
- | Theme protocol | `reactive-md-theme-1` | Theme registration, style variables, color schemes and theme acceptance |
29
-
30
- The protocol revision is independent of the package version and syntax version. One package version accepts only one syntax revision. A protocol revision may raise contribution and acceptance requirements without changing author syntax; a syntax revision change does not automatically require a protocol revision.
31
-
32
- ### CP-SCOPE-02 Normative sources (existing)
33
-
34
- When this protocol restates existing behavior, the following files are authoritative:
35
-
36
- - Author syntax: [local interaction syntax specification](../reference/local-interaction-syntax-en.md).
37
- - Core and React API: [local mode integration](../integration/local-integration-en.md).
38
- - Security boundary and host responsibilities: [security policy](../../SECURITY.md).
39
- - Versions, diagnostics contract and platform scope: [Versions and compatibility](../compatibility/compatibility-en.md).
40
- - Implementation code: the parser, declaration table, compiler, runtime and renderer under `src/local/`.
41
-
42
- This protocol does not copy the full attribute tables. Attribute defaults, allowed values and static/dynamic markers follow `src/local/configuration/schema.ts` and the syntax specification.
43
-
44
- ### CP-SCOPE-03 Normative terms (required)
45
-
46
- | Term | Meaning |
47
- | --- | --- |
48
- | MUST | Failing it means not conforming to this protocol; review must not pass |
49
- | MUST NOT | Explicitly prohibited |
50
- | SHOULD | Follow by default; deviations must record rationale and alternative evidence in the proposal |
51
- | MAY | Optional and does not affect conformance |
52
-
53
- ### CP-SCOPE-04 Clause markers (required)
54
-
55
- Each clause carries a marker:
56
-
57
- - **(existing)**: restates behavior in current code and published documentation, used for regressions and review.
58
- - **(required)**: a requirement this protocol places on new or changed components; the current implementation may not check it automatically, and review must provide evidence.
59
- - **(boundary)**: a capability this revision explicitly does not promise, which cannot be used as acceptance evidence.
60
-
61
- When a clause restating existing behavior conflicts with the syntax specification, integration documentation or code, contributors must record the difference and provide a minimal reproduction. After maintainers confirm the expected behavior, synchronize the specification, implementation and conformance data according to fix or migration rules. New contribution requirements in this protocol are identified by the "required" marker.
62
-
63
- ### CP-SCOPE-05 Scope (boundary)
64
-
65
- This protocol applies to the 49 tag names of `local-draft-3`, their compilation, runtime and reference rendering behavior, and the process for submitting new components or changing existing ones to the repository.
66
-
67
- This document defines contribution and acceptance contracts. The author tutorial and host API have separate documents; see CP-CORE-03 for the portable HTML scope and CP-CORE-05 for extension interface boundaries.
68
-
69
- ## 2. Component model
70
-
71
- ### CP-MODEL-01 Component classification (existing)
72
-
73
- `local-draft-3` fixes 49 tag names in the following groups:
74
-
75
- | Category | Components | Notes |
76
- | --- | --- | --- |
77
- | Input controls | `input`, `textarea`, `number`, `slider`, `range-slider`, `coordinate`, `toggle`, `checkbox`, `date`, `select`, `choices`, `radio-group`, `multi-select`, `option` | Read reader input and optionally expose parameters |
78
- | Self-operating controls | `counter`, `timer`, `checklist`, `progress` | Provide increment/decrement, timing, checking or progress display |
79
- | Organization and structure | `panel`, `card`, `grid`, `tabs`, `tab`, `steps`, `step`, `accordion`, `disclosure`, `if` | Layout, switching, collapsing, guided reading and conditional display |
80
- | Navigation and prose | `jump`, `anchor`, `text`, `section` | Jumps, explicit anchors and bounded foreground colors |
81
- | Assessment | `quiz` | Choice or numeric self-study questions; no public binding |
82
- | Feedback | `alert`, `badge`, `tooltip` | Alerts and inline explanations |
83
- | Declarations | `external`, `computed`, `const`, `validation` | Parsed tags that are not rendered controls; `external` is a read-only host-data declaration |
84
- | Generated data and visualization | `data-table`, `column`, `table`, `chart`, `plot`, `timeline`, `diagram`, `node`, `edge` | Generated rows, tables, charts, function curves, timelines and diagrams |
85
-
86
- `option`, `tab`, `disclosure`, `node`, `edge`, `step` and `column` are structural children that appear only inside their specified parent components. `computed` and `const` are invisible declarations; `validation` produces accessible hints when its rule fails. The leading `<theme>` declaration is document metadata, not a component. See [section 12 of the syntax specification](../reference/local-interaction-syntax-en.md#12-component-reference-and-syntax-scope) for the complete names and purposes.
87
-
88
- ### CP-MODEL-02 Three shapes (existing)
89
-
90
- | Shape | Author form | Current components |
91
- | --- | --- | --- |
92
- | No body (leaf) | `<slider ...>`, no end tag; `<slider ... />` is also accepted | `input`, `textarea`, `number`, `slider`, `range-slider`, `coordinate`, `toggle`, `checkbox`, `date`, `counter`, `timer`, `progress`, `edge`, `anchor`, `external`, `computed`, `const`, `validation`, `column` |
93
- | Inline | Paired tags with content embedded in a sentence | `badge`, `tooltip`, `jump`, `text` |
94
- | Container | Paired tags whose content continues to parse as Markdown or child components | The remaining components |
95
-
96
- Void components must not carry a body; containers must be explicitly closed, and automatic closing or correction of mismatched tags is not allowed. `textarea` text is set through `initial`, so it is a void component.
97
-
98
- ### CP-MODEL-03 Declaration contents (required)
99
-
100
- A component proposal declaration contains at least the following information; items that do not apply, such as no binding or no computation, must be stated explicitly:
101
-
102
- | Information | Content |
103
- | --- | --- |
104
- | Name | Lowercase kebab-case tag name |
105
- | Shape | Void, inline or container |
106
- | Child rules | Allowed direct children; allowed parents for structural children |
107
- | Label requirements | `label` required, optional or not applicable |
108
- | Attribute table | Name, type, static or dynamic, required, default, constraints |
109
- | Binding | Public value type, family, whether exclusive, default initial-value rule |
110
- | Initial-value rules | How the public value is produced when `initial` is omitted |
111
- | Rendering | Reference adapter element, accessible name, keyboard operations and style hooks |
112
- | Diagnostics | Diagnostic categories for structure, attributes, bindings, initial values and budget failures |
113
- | Budgets | Resource limits defined when adding unbounded input, loops, recursion or computation |
114
- | Compatibility classification | Capability addition, breaking change or implementation/editorial change |
115
- | Acceptance evidence | Automated tests, machine conformance data and manual browser checks |
116
-
117
- The current declaration table is `src/local/configuration/schema.ts`; the tag lexical sets are in `src/local/parsing/parser.ts`, semantic validation in `src/local/compilation/compiler.ts`, write constraints in `src/local/runtime/runtime.ts`, and rendering in `src/local/rendering/document/LocalDocumentView.tsx` and `src/local/rendering/visuals.tsx`. Changing only the declaration table does not automatically provide parsing, validation or rendering.
118
-
119
- ### CP-MODEL-04 Name set (existing)
120
-
121
- The 49 names of `local-draft-3` are the complete set for the current syntax. Adding, removing or changing the meaning of a name is an author-visible change and is handled under section 10. Implementations may use undocumented node types internally, but authors can only use the names listed here and in the syntax specification.
122
-
123
- ## 3. Names, syntax and attributes
124
-
125
- ### CP-SYNTAX-01 Name spelling (existing)
126
-
127
- Tag names and attribute names must use lowercase kebab-case matching `^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$`. Duplicate attribute names, end tags with attributes, and non-conforming tag or attribute names all produce compile diagnostics. Authors cannot define new tags, nor extend components with `class`, `style` or `on-*`.
128
-
129
- ### CP-SYNTAX-02 Shape and nesting (existing)
130
-
131
- - Void components have no end tag; a trailing `/` may be used as self-closing syntax.
132
- - Containers must use a paired end tag; the end tag must match the most recently unclosed container.
133
- - Automatic closing, auto-completion or correction of mismatched tags is not supported.
134
- - `badge`, `tooltip`, `jump` and `text` are inline components and can be embedded in sentences; other components are treated as block content.
135
- - Tags, interpolations and formulas inside code fences and inline code are displayed verbatim and are not activated; Markdown comments produce no display content, components or bindings.
136
-
137
- ### CP-SYNTAX-03 Attribute values (existing)
138
-
139
- Regular attribute values must be enclosed in single or double quotes; boolean attributes may omit their value, which means `true`. Attribute order has no semantics, and duplicate attributes are errors. `&quot;`, `&apos;`, `&amp;`, `&lt;` and `&gt;` in attribute values decode to the corresponding characters; backslashes are not used to escape attribute quotes.
140
-
141
- Omitted boolean attributes use the default declared by the component instead of assuming `false` uniformly. For example, `panel.reset` defaults to `true`.
142
-
143
- ### CP-SYNTAX-04 Static and dynamic values (existing)
144
-
145
- Attributes declared static must not contain interpolation. Dynamic attributes may use valid literals; when interpolation is used, a numeric, boolean or enum attribute must be one complete `{{ expression }}` and the result keeps the corresponding type. Text attributes may contain multiple interpolations, and their output is treated as text.
146
-
147
- ```markdown
148
- <slider bind="people" label="People" initial="2" min="1" max="20">
149
- <number bind="lowerBound" label="Lower bound" initial="-2">
150
- <number bind="upperBound" label="Upper bound" initial="2">
151
- <if when="{{ people >= 5 }}">
152
- <plot min="{{ lowerBound }}" max="{{ upperBound }}">
153
- $$ y = x^2 $$
154
- </plot>
155
- </if>
156
- ```
157
-
158
- `bind`, `initial`, `id`, `value`, `from`, `to`, `kind`, `type`, `step`, text-length limits and layout enums are static attributes. `disabled`, `if.when`, `plot.min`, `plot.max`, `node.tone`, `number`/`slider` `min`/`max`, `date` `min`/`max`/`required`, and `input`/`textarea` `required` are dynamic. The complete list follows the `static` and `dynamic` markers in `schema.ts`.
159
-
160
- ### CP-SYNTAX-05 Labels and accessible names (existing)
161
-
162
- Whether `label` is required, optional or not applicable is determined by the component declaration. A required label cannot be missing or whitespace-only; labels may be dynamic text. An input control's `label` is also its accessible name. When an optional label is omitted, the reference adapter must provide a stable accessible-name fallback and must not leave an unnamed control.
163
-
164
- ### CP-SYNTAX-06 Child rules (existing)
165
-
166
- | Child rule | Allowed content | Current components |
167
- | --- | --- | --- |
168
- | No children | No body or child components | Void controls, `progress`, `edge`, `anchor`, `computed`, `const`, `validation`, `column` |
169
- | Inline content | Inline Markdown, no nested component tags | `option`, `badge`, `tooltip`, `jump`, `text` |
170
- | Options | One or more `option` | `select`, `choices`, `radio-group`, `multi-select`, `quiz` (choice) |
171
- | Tabs | One or more `tab` | `tabs` |
172
- | Steps | One or more `step` | `steps` |
173
- | Disclosures | One or more `disclosure` | `accordion` |
174
- | Cards | One or more `card` | `grid` |
175
- | Diagram | One or more `node`, optional `edge` | `diagram` |
176
- | Table | Exactly one Markdown table | `table`, `chart`, `timeline` |
177
- | Columns | One to 20 `column` declarations | `data-table` |
178
- | Formulas | One or more `$$...$$` formula blocks | `plot` |
179
- | Content | A task list or static notes | `checklist`, `node` |
180
- | General content | Markdown and components, with component-specific rules | `panel`, `card`, `tab`, `step`, `if`, `alert`, `section` |
181
-
182
- The `checklist` body must be exactly one level of Markdown task list; `node` notes may contain text interpolation but must not contain interactive components. A `choice` quiz accepts `option` children and a `number` quiz has an empty body. Compilation fails when a structural child appears under the wrong parent, a container lacks a required child, or a child type does not match.
183
-
184
- ### CP-SYNTAX-07 Markdown context (existing)
185
-
186
- Components may sit in a paragraph or a standalone block. Container content is dedented by the common indentation and then parsed as Markdown; indentation inside code fences is preserved. The parser identifies code, math regions and tag boundaries first, then interprets interpolations; the syntax cannot be implemented by string replacement over the whole document.
187
-
188
- ### CP-SYNTAX-08 Author capability boundary (existing)
189
-
190
- Authors cannot execute scripts, write executable HTML, provide author CSS, register event handlers or declare network service calls. Images and links are constrained by the host URL policy in CP-SEC-02. `<script>`, `<style>`, `on-*`, `class`, `style` and legacy directives are not part of `local-draft-2`. Complete unknown tags fall back to source; incomplete or unrecoverable tags produce errors. Document content is never executed as arbitrary HTML.
191
-
192
- ## 4. Bindings and state
193
-
194
- ### CP-STATE-01 Binding names (existing)
195
-
196
- `bind` must match `[A-Za-z_][A-Za-z0-9_]*`, is case-sensitive, and is at most 128 characters. Expression built-in function names, `x`, `y`, `pi`, `e`, `true`, `false`, `null`, and `__proto__`, `prototype`, `constructor` are reserved names and cannot be used as binding names.
197
-
198
- Components without `bind` still have internal state under the internal key `@<node.id>`, but that key does not enter the public parameter set and cannot be referenced by expressions. Public parameters contain only explicitly bound names.
199
-
200
- ### CP-STATE-02 Binding families (existing)
201
-
202
- | family | Public value | Components |
203
- | --- | --- | --- |
204
- | `text` | String | `input`, `textarea` |
205
- | `number` | Finite number | `number`, `slider`, `counter` |
206
- | `boolean` | Boolean | `toggle`, `checkbox` |
207
- | `date` | `YYYY-MM-DD` or empty string | `date` |
208
- | `choice` | Option string | `select`, `choices`, `radio-group` |
209
- | `timer` | Remaining seconds, non-negative number | `timer` |
210
- | `checklist` | String array of selected item IDs | `checklist` |
211
- | `tabs` | Current tab value | `tabs` |
212
- | `diagram` | Current node ID | `diagram` |
213
- | `multi-select` | Option value array in source order, exclusive | `multi-select` |
214
- | `steps` | Current step value, exclusive | `steps` |
215
- | `selection` | Stable row key, empty string when unselected | `table` and `chart` with key |
216
-
217
- Each numeric slot of range-slider and coordinate is also exclusive. Bounds, steps, defaults and atomic batch writes are defined in the [syntax specification](../reference/local-interaction-syntax-en.md). Selection can be shared by tables and charts only with identical ordered keys. The initialization, rejection, visibility, reset and disposal clauses below continue to apply.
218
-
219
- `timer`, `checklist`, `tabs` and `diagram` are also exclusive families: a public parameter can be owned by only one component, and other controls cannot declare a same-name binding. Hosts can still call the public `runtime.set` through the owning node, and writes follow the same validation.
220
-
221
- ### CP-STATE-03 Shared constraints (existing)
222
-
223
- A same-name binding is valid only when all of the following conditions hold:
224
-
225
- - All components belong to the same family.
226
- - Numeric bindings have exactly identical `min`, `max` and `step`; when a bound is dynamic, all owners must declare the same expression.
227
- - Date bindings have identical `min` and `max` after resolving literals and dynamic expressions.
228
- - Selector option value sets and order are exactly identical.
229
- - An exclusive family has only one component.
230
- - The same binding has at most one explicit `initial`.
231
-
232
- Shared controls may have different label text and appearance. Violating shared conditions produces a compile error, and the error message points to the conflicting location.
233
-
234
- ### CP-STATE-04 Initialization (existing)
235
-
236
- Public values are initialized once when the document instance is created. Components in conditional regions, inactive tabs and closed disclosure panels also participate in initialization; hiding and showing again does not initialize again.
237
-
238
- Without an explicit `initial`, the default is generated according to the component declaration:
239
-
240
- | Initial rule | Components | Result |
241
- | --- | --- | --- |
242
- | `empty` | `input`, `textarea`, `date` | Empty string |
243
- | `false` | `toggle`, `checkbox` | `false` |
244
- | `min` | `slider`; `range-slider.start` | `min`, default range 0 to 100 |
245
- | `max-step` | `range-slider.end` | The largest valid step not exceeding `max` |
246
- | `nearest-zero` | `number`, `counter`; `coordinate.x` and `coordinate.y` | The valid step value within range closest to 0; the smaller value when equidistant |
247
- | `first-option` | Selectors | value of the first option |
248
- | `empty-array` | `multi-select` | Empty string array |
249
- | `first-tab` | `tabs` | value of the first tab |
250
- | `first-step` | `steps` | value of the first step |
251
- | `first-node` | `diagram` | id of the first node |
252
- | `checked` | `checklist` | IDs of checked items in the task list |
253
- | `duration` | `timer` | `duration`, default 60 |
254
- | `none` | `table`, `chart` selection | Empty string when unselected |
255
-
256
- When a shared binding has no explicit initial value, the default of the first component in the source is used, and all members' constraints are validated.
257
-
258
- ### CP-STATE-05 Initial-value validation (existing)
259
-
260
- An explicit initial value must be static. Compile-time validation covers numeric ranges, steps, date format, option membership, text length, email format and shared constraints. Out-of-range, off-step, unknown-option or type-mismatched values produce errors and are not silently corrected. A valid empty string may represent "not selected yet"; that value remains public until the reader enters something.
261
-
262
- `initial` is only document initialization data, not a persistence format. After the source changes, a new instance is created and initialized from the new source.
263
-
264
- ### CP-STATE-06 Writes and atomicity (existing)
265
-
266
- Runtime `set(node, value)` relies on the controls registered in the compiled document and ignores forged node metadata from the caller. A write checks in order:
267
-
268
- 1. Whether the component has a writable binding.
269
- 2. The value type and resource budget.
270
- 3. The binding's own range, step and option constraints.
271
- 4. Additional constraints on all shared controls, such as required, length, email and date ranges.
272
-
273
- When all checks pass, the runtime commits once and all dependent content sees the same new state; when any control rejects, state does not change, revision does not increase, and a runtime diagnostic is returned. Checklist array values are normalized to the source order of items. A write equal to the current value does not commit and does not notify subscribers.
274
-
275
- ### CP-STATE-07 Input drafts (existing)
276
-
277
- Intermediate input in number and text fields that is not yet valid is kept in a renderer-local draft and does not enter public state. Examples include an empty string or a minus sign in a number field, and content that has not passed email or length checks in a text field. Valid input commits immediately; if it is still invalid on blur, a hint is shown while other content keeps reading the last valid value. Panel reset clears drafts.
278
-
279
- ### CP-STATE-08 Reset (existing)
280
-
281
- `runtime.reset(node)` restores all bindings and internal component state within that node's subtree at once, commits once and notifies once. Scope rules:
282
-
283
- - Bindings of controls in the subtree return to compile-time initial values; displays of shared variables outside the subtree update in sync.
284
- - Components in the subtree detect reset through `resetToken` and restore local selection, table query, sorting, paging, chart legend, plot readout, tab, disclosure state and timer state.
285
- - Child controls not yet shown in a condition are also within reset scope.
286
- - A panel's restore-defaults uses the same mechanism; an inner reset of a nested panel affects only the inner panel, while an outer reset covers the whole subtree.
287
- - Internal state of components without bindings is also reset; their internal keys still do not enter the public parameter set.
288
-
289
- ### CP-STATE-09 Display state is not permission (existing)
290
-
291
- `disabled` and `if` control only interface display and input. They are not authorization, data validation or server-side permission boundaries. The host must revalidate permissions and business constraints when submitting to the server.
292
-
293
- ### CP-STATE-10 Representative normative points for slider (existing)
294
-
295
- `slider` represents a simple numeric control:
296
-
297
- - The family is `number`; `min`, `max` and `step` are static numeric attributes with defaults `0`, `100` and `1`.
298
- - Omitting `initial` takes `min`; an explicit initial value must be within range and on a step based at `min`.
299
- - The runtime rejects out-of-range, non-finite and off-step writes, and keeps the last valid state when rejecting.
300
- - When sharing a binding with other numeric controls, all members' `min`, `max` and `step` must be exactly identical.
301
- - Without `bind`, the control still works, with state stored under the internal key and not exposed to expressions.
302
-
303
- ### CP-STATE-11 Representative normative points for tabs (existing)
304
-
305
- `tabs` represents a container component with public state:
306
-
307
- - The public value type is string, the family is `tabs`, and ownership is exclusive; a second component cannot declare a same-name binding.
308
- - `tab.value` is a static unique value; when omitted, `tab-1`, `tab-2` and so on are generated in source order.
309
- - Without `initial`, the first tab is selected; an explicit initial value must point to an existing tab.
310
- - Without `bind`, selection stays inside the component; with `bind`, switching writes the public value.
311
- - Hidden tab content still participates in compilation and initialization, and child content state is preserved; timers inside pause, and the reader must start them again after the tab is shown.
312
- - Panel reset restores the tab initials and child content state together.
313
-
314
- ### CP-STATE-12 Representative normative points for plot (existing)
315
-
316
- `plot` represents a computational visualization:
317
-
318
- - The body may contain only whitespace and one or more `$$...$$` formula blocks. Each block defines one explicit `y = expression` curve, one parametric `\begin{cases} x = f(t) \\ y = g(t) \end{cases}` curve, one polar `r = f(\theta)` curve, or one implicit equation in `x` and `y`.
319
- - `min` and `max` may be dynamic and require `min < max`; static ranges are validated at compile time and dynamic ranges at render time. Invalid ranges show a local error instead of being silently clamped. They set the horizontal range for explicit curves, the `t` range for parametric curves, the angle interval in radians for polar curves, and the square tracing region for implicit curves.
320
- - `points` is a static integer from 2 to 2000. The existing `samples` attribute remains supported; `points` takes precedence when both are supplied, and the default is 200 when both are omitted. Each `plot` has at most 16 curves.
321
- - An explicit, parametric or polar curve requests the specified number of points, including both endpoints. An implicit curve uses the specified number of grid points per axis (capped at 100, raised to at least 32) and requests the grid area.
322
- - The whole document has at most 20,000 curve sample points, including hidden regions; plotting computation shares a budget of 2,000,000 steps.
323
- - Formulas may reference only declared numeric parameters; undeclared or non-numeric parameters are diagnosed at compile time. `t` is local to a parametric block, and `\theta` is local to a polar equation; neither reads the same-named document parameter in its curve. Polar samples use `x = r cos(θ)`, `y = r sin(θ)` and preserve the direction of negative radii.
324
- - Non-finite samples form breaks, and the two sides of a break are not connected directly; when there are no valid values, an empty state is shown.
325
- - The reference adapter provides legends and pointer/keyboard readouts; real pointer, keyboard and narrow-screen behavior is checked manually as described in section 11.
326
-
327
- ## 5. Diagnostics and fallback
328
-
329
- ### CP-DIAG-01 Diagnostics contract (existing)
330
-
331
- `Diagnostic` contains `code`, `message`, `severity`, `range`, `line` and `column`. `line` and `column` start at 1; `range` is an index into the current source string. `code` is a string identifier; `message` is display text, and callers must not parse message or make business decisions based on its full text.
332
-
333
- ### CP-DIAG-02 Compile results and severity (existing)
334
-
335
- Compilation has exactly two outcomes:
336
-
337
- - Success: `ok: true`, with the document and diagnostics; diagnostics may contain warnings.
338
- - Failure: `ok: false`, with diagnostics only; the interactive preview is disabled.
339
-
340
- Structurally complete but unknown tags produce warnings; incomplete component structures, mismatched tags, unknown attributes or type errors on known components, binding errors, expression errors and budget overruns produce errors. Errors block successful compilation; warnings do not. Normal footnotes produce no unsupported-syntax warning.
341
-
342
- ### CP-DIAG-03 Fallback isolation (existing)
343
-
344
- Structurally complete unknown tags are displayed as original source with a `local.component.unknown` warning. Controls, interpolations and formulas inside the fallback region are not executed, do not initialize bindings and cause no network actions. Footnotes support Markdown layout, numbering and return links; controls and interpolations inside definitions remain text and create no bindings. Other prose and interactions keep working.
345
-
346
- Unknown tags that cannot be reliably recovered and tag structure errors still block compilation; fallback cannot be used to bypass validation.
347
-
348
- ### CP-DIAG-04 Runtime error isolation (existing)
349
-
350
- When a control write is rejected, a `local.runtime.value` or `local.runtime.binding` diagnostic is returned and public state keeps the last valid value. Local computation errors in expressions, tables, charts or plots are shown near the corresponding content, with "Unable to compute" or a matching empty state, while other independent content keeps updating. A rendering exception in a single component is isolated by an error boundary and retried after the revision changes.
351
-
352
- ### CP-DIAG-05 Hidden branches are still compiled (existing)
353
-
354
- A false condition, inactive tab or closed disclosure affects display only, not compilation. Undeclared variables, type errors, structure errors and budget overruns in hidden branches are still compile errors. At runtime, hiding preserves state and pauses timers; it does not skip validation.
355
-
356
- ### CP-DIAG-06 Diagnostic code stability (contract)
357
-
358
- Existing diagnostic codes keep their meaning within one 0.x minor series; new codes may be added. Removal, renaming or a change of meaning requires a new minor version and migration notes. Messages are localized display text. Tests and machine conformance use codes and structured fields. See [Diagnostics and counting rules](../reference/diagnostics-counting-en.md) for units and budget scopes.
359
-
360
- ## 6. Accessibility, themes and styling
361
-
362
- ### CP-A11Y-01 Accessible names and states (existing)
363
-
364
- Every interactive component must provide an accessible name and expose its current state. Input controls use `label` as their name; containers and visualizations that require independent operation use a stable fallback name when an optional label is omitted. Selectors, tabs, disclosures, checklists, progress, timers, tables, charts, plots and diagrams must expose states such as selection, expansion, progress, remaining time, sorting or readout to assistive technologies. Distinguishing state by color alone does not meet the requirement.
365
-
366
- ### CP-A11Y-02 Keyboard and focus (existing)
367
-
368
- Interactive components must be reachable and operable by keyboard. Tabs support arrow keys, Home and End; diagram nodes support Tab focus and Enter selection; plots support arrow keys, Home and End readouts; table sorting and paging use focusable controls. When a conditional region is hidden and focus is inside it, the reference adapter moves focus out of the hidden content. New components must not leave focus on invisible elements.
369
-
370
- ### CP-A11Y-03 Manual checks (existing / boundary)
371
-
372
- The machine conformance data of this protocol does not cover browser behavior such as real keyboard input, IME composition, 375px narrow screens, screen readers and timer pause. These items require corresponding automated browser checks or the manual checks in section 11. Incomplete checks must be recorded and must not be reported as passed.
373
-
374
- ### CP-STYLE-01 Global styles and themes (existing)
375
-
376
- `reactive-md/styles.css` is a global stylesheet, not isolated through Shadow DOM or CSS Modules. The host imports it explicitly once. Theme variables are declared on `.md-document` and `.reactive-md-theme`. Document selection, registration and color schemes follow the [theme protocol](../reference/theme-protocol-en.md). `colorScheme="auto"` reads the nearest explicit ancestor preference or the system, retaining support for `data-theme="dark|light"`.
377
-
378
- ### CP-STYLE-02 Style hooks are not an API (existing)
379
-
380
- Prefer public CSS variables for themes. Component outer `.md-*` and `.local-*` classes and semantic state attributes are styling interfaces under the theme protocol; internal node ordering is not an extension API. Neither React component accepts `className` or `style`; authors cannot write class or style either. New components use existing prefixes and shared variables and work with the built-in default theme in both modes.
381
-
382
- ### CP-STYLE-03 Styling requirements for new components (required)
383
-
384
- New components must:
385
-
386
- - Be usable at 375px width without horizontal overflow or unreachable actions.
387
- - Use existing theme variables and `.md-*`, `.local-*` prefixes, without overriding global selectors outside the document.
388
- - Provide visible styles for keyboard focus and non-color cues for selected, disabled, error and empty states.
389
- - Not automatically inject new global styles when JavaScript is imported; styles ship with `styles.css`.
390
- - List added or changed style files and manual check screenshots or records in the proposal.
391
-
392
- ## 7. Visibility, instances and disposal
393
-
394
- ### CP-VIS-01 Hidden state is preserved (existing)
395
-
396
- When `if` is false, a tab is inactive or a disclosure is closed, content is not displayed, but parameters, tab selection and checklist checks are preserved. Hiding does not reinitialize bindings or skip diagnostics. Toggling display updates only the view and does not create new document state.
397
-
398
- ### CP-VIS-02 Timing and focus (existing)
399
-
400
- Timers in hidden regions pause, and public seconds stop at the pause point; when shown again they stay paused until the reader starts them. When a conditional region is hidden, keyboard focus must not remain in hidden content. Hidden regions still count toward the whole-document plot sample budget.
401
-
402
- ### CP-LIFE-01 Instance isolation (existing)
403
-
404
- Each `LocalReactiveDocument` instance creates an independent runtime and state. The same page can embed multiple copies of the same source, and parameters, timers, tabs, table queries and diagram selections do not affect each other. `LocalDocumentView` uses the runtime passed by the host; when instance isolation is needed, the host must create a separate runtime for each document. Heading anchors are isolated per rendering instance, and table-of-contents links target the current instance.
405
-
406
- ### CP-LIFE-02 Source changes (existing)
407
-
408
- `LocalReactiveDocument` recompiles when `source` changes and tries to adopt the new document in its existing runtime, retaining bindings that still satisfy their contracts. Changed compilation semantics or an incompatible document create a new runtime; use a new React `key` when switching to an independent document. Hosts that manage the lifecycle pass the compiled document and runtime to `LocalDocumentView` and dispose the runtime on unmount. Deferred disposal under React StrictMode preserves runtimes still in use.
409
-
410
- ### CP-LIFE-03 Disposal (existing)
411
-
412
- `runtime.dispose()` is idempotent and clears subscriptions, expression caches and reset markers; React components clean up their timers and event listeners on unmount. After disposal the host should stop using the instance; lifecycle-checked methods such as `snapshot`, `get` and `set` throw. Host-managed runtimes must call `dispose()` on unmount and handle callbacks still in flight.
413
-
414
- ### CP-LIFE-04 SSR and persistence scope (boundary)
415
-
416
- Static SSR rendering is covered by the pre-release packed check. Single-file export static-first hydration is covered in Playwright Chromium and local Edge; general SSR hydration outside that path is unverified. Document state exists only in the current instance's memory; there is no localStorage, cookie, server write or cross-instance sharing. Persist the original `.reactive.md` source; public parameters may also be exported as a validated `reactive-md-state/v1` file. Do not persist `LocalDocument`, `LocalNode`, `node.id`, `LocalSnapshot` or internal runtime keys, whose structure is not guaranteed across versions.
417
-
418
- ## 8. Security and resource budgets
419
-
420
- ### CP-SEC-01 Untrusted documents (existing)
421
-
422
- The renderer and evaluators treat document content as untrusted input:
423
-
424
- - They do not execute author scripts. Formula HTML comes only from the configured KaTeX renderer; author source and error messages are never injected as HTML.
425
- - Expressions use their own parser and AST evaluator, not `eval` or `new Function`, and do not support assignment, method calls, property access, prototype paths or imports.
426
- - LaTeX is typeset by KaTeX as HTML with accessible MathML and bundled fonts. Input, expansion and output dimensions are bounded; author-defined macros, files, network and HTML entry points are disabled. Plot evaluation keeps its separate budget-limited parser.
427
- - Expressions, templates, tables and charts do not make network requests.
428
-
429
- ### CP-SEC-02 URLs and networking (existing)
430
-
431
- All images are rejected by default, including relative paths; they load only when the host `urlPolicy` returns `true`. Images with a protocol allow only `http:` and `https:`; dangerous protocols are rejected even if the policy allows them. Links allow relative addresses and `http:`, `https:`, `mailto:` and `tel:` by default; external HTTP links open in a new tab with `noopener noreferrer`. If the policy throws, the address is rejected.
432
-
433
- `urlPolicy` is a URL allowlist, not server-side authorization or a sandbox. Hosts still need to configure CSP, network egress, an image proxy or a sandboxed iframe.
434
-
435
- ### CP-SEC-03 Resource budgets (existing)
436
-
437
- | Limit | Value |
438
- | --- | --- |
439
- | Source per document | 1,000,000 characters |
440
- | Syntax nodes created cumulatively during parsing | 10,000 by default, configurable per call by the host |
441
- | A single string value, attribute or template | 100,000 characters |
442
- | A single array | 10,000 items |
443
- | Total string length within an array | 100,000 characters |
444
- | Email address | 254 characters, validated in linear time |
445
- | Number of diagnostics | 100 |
446
- | Text of a single diagnostic | 2,000 characters |
447
- | Curves per plot component | 16 |
448
- | Curve sample points requested by the whole document | 20,000 |
449
- | Shared computation steps for plotting | 2,000,000 |
450
- | Validation rules per document | 100, including hidden regions |
451
- | Declared generated rows per `<data-table>` | 1,000 maximum; 100 default |
452
- | Columns per `<data-table>` | 20 |
453
- | Document generated row budget | 2,000 |
454
- | Document generated cell budget | 10,000 |
455
- | Generated table text | 100,000 UTF-16 code units per table |
456
-
457
- Here, characters means UTF-16 code units. Text-control `min-length` / `max-length` and string `len()` count Unicode code points. Writes over a limit are rejected and the runtime keeps the last valid state; compile-time overruns return diagnostics. Expressions and math evaluation have additional length, node, depth and token budgets. See [Diagnostics and counting rules](../reference/diagnostics-counting-en.md) for all units and scopes. Hidden regions count toward plotting budgets. Hosts still control request size, concurrency and timeouts.
458
-
459
- ### CP-SEC-04 Host responsibilities (existing)
460
-
461
- The host decides who may write, submit and share documents; limits request size, concurrency and execution time for untrusted authors; configures `urlPolicy`, CSP and network egress; revalidates form values, permissions and business constraints on the server; and assesses the rendering process's resource limits before statically rendering untrusted documents.
462
-
463
- ### CP-SEC-05 Extension trust boundary (boundary)
464
-
465
- This language does not provide a sandbox for trusted host extension code. Hosts control the security boundary of components they register or wrap; `disabled`, conditional visibility and client state are not permission controls. The legacy `hostComponents` option registers plain schema data for one compilation and carries no executable code. The SDK likewise separates data manifests from explicitly imported implementations. Hosts control the code permissions of render callbacks and SDK implementations.
466
-
467
- ## 9. Core and renderer separation
468
-
469
- ### CP-CORE-01 Entry separation (existing)
470
-
471
- The `reactive-md` core entry provides `compileLocal`, `createLocalRuntime`, expressions, LaTeX and version constants, does not depend on React, and can run in Node. `reactive-md/react` provides `LocalReactiveDocument` and `LocalDocumentView` and requires React 19. Styles are imported through the separate `reactive-md/styles.css`.
472
-
473
- ### CP-CORE-02 Authority layering (existing)
474
-
475
- - The declaration table and compiler determine which tags, attributes, structures and initial values are legal.
476
- - The runtime determines whether writes are accepted and whether shared values commit atomically.
477
- - The renderer presents content and collects user input; it does not reinterpret source rejected by the compiler or create public bindings not registered by the compiler.
478
- - The core and reference renderer produce the same binding semantics and state results for the same document.
479
-
480
- ### CP-CORE-03 HTML is not a cross-implementation protocol (boundary)
481
-
482
- SSR HTML, class names and DOM structure in machine acceptance are evidence for the React reference adapter, not a cross-implementation HTML byte protocol. Cross-implementation compatibility is measured by bindings, state, diagnostic codes and text results; visual presentation is the responsibility of each implementation, but must meet accessibility and narrow-screen requirements.
483
-
484
- ### CP-CORE-04 Implementation surfaces for new components (required)
485
-
486
- New components must check the following integration points and change the corresponding implementation according to their behavior; when reusing existing generic validation, explain it in the proposal:
487
-
488
- 1. The public manifest's `form`; the parser reads shapes from instance configuration.
489
- 2. Component definitions and registration. Default manifests live in `src/presets/default-components.ts`; `src/local/configuration/schema.ts` provides a compatibility projection.
490
- 3. Manifest props, structures, bindings, initial values and rules, executed by the shared compiler.
491
- 4. Generic kernel write constraints when existing public rules cannot express a new value or state.
492
- 5. Implementations registered through the public React SDK. Default views live in `src/components/`.
493
- 6. Budgets in `src/local/configuration/limits.ts` (if new computation or collections are introduced).
494
- 7. Styles, tests, examples, syntax documentation, integration documentation and conformance data.
495
-
496
- Components that reuse public rules need a definition, implementation and registration. New kernel primitives also require a public contract and acceptance cases.
497
-
498
- ### CP-CORE-05 Extension interface boundary (boundary)
499
-
500
- This revision describes contribution requirements and the legacy host interface in section 14. `LOCAL_COMPONENTS` is an internal compatibility projection of the default preset. `hostComponents` accepts plain schema data for one compilation and adapts it to the shared kernel, with implementations supplied by the host.
501
-
502
- The source tree's [extension SDK](../integration/extension-sdk-en.md) has shipped since `reactive-md@0.8.0` and uses a separate `reactive-md-component/v1` data contract and instance configuration for registration validation, React implementations, editor catalogs, offline builds, versioned restoration and public compliance tools. All 48 default rendered and structural components use this contract. Hosts explicitly install component code; document declarations never load it.
503
-
504
- ## 10. Compatibility, name governance, revisions and migration
505
-
506
- ### CP-COMPAT-01 Change classification (required)
507
-
508
- | Category | Example | Handling |
509
- | --- | --- | --- |
510
- | Capability addition | New component; new optional attribute on an existing component whose default preserves existing valid forms | Author-visible syntax additions still establish a new syntax revision, raise the package minor version and add acceptance and migration notes |
511
- | Breaking change | Removing or renaming a component; changing shape, required attributes, defaults, structure rules or binding family; changing initial-value rules; lowering an existing budget; changing compile results or public values of existing documents | Requires a new syntax revision, migration notes and old/new examples |
512
- | Implementation or editorial change | Adjusting diagnostic message, internal class names, DOM structure, `node.id` or performance implementation while keeping existing semantics, accessibility and resource boundaries | Usually does not raise the syntax or protocol revision; public API changes follow compatibility rules separately |
513
-
514
- Adding a tag makes previously inert regions with that name start executing in old implementations, so it cannot promise that all old sources keep their old behavior. Migration notes must cover this change. Adding or adjusting diagnostic codes also changes the `codes` in machine data, requiring synchronized acceptance and changelog updates; cross-version promises for diagnostic codes continue to follow the compatibility notes.
515
-
516
- ### CP-COMPAT-02 Syntax revisions (existing)
517
-
518
- Author-visible syntax changes establish a new syntax revision, such as `local-draft-2`, raising the package minor version and updating `LOCAL_SYNTAX_VERSION` at the same time. The project does not rewrite sources automatically; after upgrading, authors or hosts migrate according to the changelog. One package version accepts only one syntax revision.
519
-
520
- ### CP-COMPAT-03 Protocol revisions (required)
521
-
522
- The following changes raise the protocol revision, for example from `component-protocol-1` to `component-protocol-2`:
523
-
524
- - Changing MUST or MUST NOT clauses.
525
- - Adding required component declaration information or acceptance gates.
526
- - Changing root fields, required fields or comparison semantics of machine conformance data.
527
- - Changing compatibility classification rules or name governance rules.
528
-
529
- Editorial changes do not raise the protocol revision. Protocol revisions can ship independently of syntax revisions but must state the applicable syntax and package version in the documentation.
530
-
531
- ### CP-COMPAT-04 Name governance (required)
532
-
533
- - New names must be lowercase kebab-case, semantically clear, and avoid conflicts with the existing 49 names.
534
- - Do not use HTML names such as `script`, `style`, `div`, `span` or `a`, and do not use `on-*`, `class` or `style` as author attributes.
535
- - Within `component-protocol-1`, the existing 48 names are reserved for existing semantics; reusing a name is a breaking change.
536
- - No implicit aliases. An alias needs its own name, documentation and acceptance evidence.
537
- - Structural child names and parent constraints are governed together; do not change only the parent component.
538
-
539
- ### CP-COMPAT-05 Migration (required)
540
-
541
- - Components that already conform to this protocol keep their existing semantics after a protocol revision; new MUST clauses apply to new or changed components by default.
542
- - If a new requirement applies retroactively to existing components, it must be handled as a breaking change with migration notes, old/new behavior comparisons and acceptance updates.
543
- - Breaking changes must not quietly change author syntax without a new syntax revision.
544
- - Migration notes are for users and contributors and include at least the old form, new form, affected scope and verification method.
545
-
546
- ### CP-COMPAT-06 Persistable content (existing)
547
-
548
- Persist only the original `.reactive.md` source and the syntax revision used. `LocalDocument`, `LocalNode`, `node.id`, `initialState`, `LocalSnapshot` and runtime parameter state are current runtime objects, and their structure or field meanings are not guaranteed across versions. Diagnostic line numbers, columns and offsets locate the current source and are not persistence identifiers.
549
-
550
- ## 11. Acceptance matrix
551
-
552
- ### CP-ACCEPT-01 Acceptance surfaces (required)
553
-
554
- | Acceptance surface | Evidence | Pass condition | Related clauses |
555
- | --- | --- | --- | --- |
556
- | Tag shape and structure | Parser/compiler tests, machine cases | Valid documents pass; mismatches, missing children and wrong parents fail | CP-SYNTAX-01 to 08 |
557
- | Attributes and expressions | Compiler tests, machine cases | Static/dynamic, types, empty interpolation and unknown attributes diagnosed per clause | CP-SYNTAX-03, 04 |
558
- | Bindings and initial values | Runtime tests, machine cases | Shared constraints, defaults and explicit initial validation agree | CP-STATE-01 to 05 |
559
- | Writes and atomicity | Runtime tests, machine cases | State unchanged on rejection; one commit on acceptance; shared controls agree | CP-STATE-06 |
560
- | Drafts and reset | Renderer/runtime tests, machine cases | Drafts never enter public values; reset commits once and restores the subtree | CP-STATE-07, 08 |
561
- | Visibility and lifecycle | Runtime/renderer tests, machine cases | Hiding preserves state; timing pauses; instances isolated; disposal cleans up | CP-VIS-01, 02, CP-LIFE-01 to 03 |
562
- | Fallback and error isolation | Compiler/renderer tests, machine cases | Complete unknown tags fall back inertly; local errors do not affect other content | CP-DIAG-02 to 05 |
563
- | Visualization | Renderer tests, machine cases, manual checks | plot/chart/table/diagram/timeline semantics and budgets correct | CP-STATE-12, CP-SEC-03 |
564
- | Accessibility | Manual browser checks, some automated checks | Names, roles, states, keyboard, focus and 375px usability | CP-A11Y-01 to 03 |
565
- | Security and budgets | Security tests, budget tests, machine cases | No script/network entry points; over-limit rejected while keeping valid state | CP-SEC-01 to 04 |
566
- | Core and renderer separation | Build, package checks, Node consumption tests | Core independent of React; React entry installable separately | CP-CORE-01, 02 |
567
- | Documentation and links | `npm run test:docs` | Relative links and heading anchors valid | CP-SCOPE-02 |
568
- | Machine data format | Conformance runner | Root fields, unique ids, required fields and exact codes pass | CP-ACCEPT-02 |
569
-
570
- ### CP-ACCEPT-02 Machine conformance data (required)
571
-
572
- The root object of a machine conformance set contains only `protocolVersion`, `syntaxVersion` and a non-empty `cases` array. The frozen author-component set `examples/conformance/component-protocol-1.json` remains `component-protocol-1` / `local-draft-2`. The current portable syntax set is `examples/conformance/local-draft-3.json`; both are checked for their declared revisions. The package version is identified by `package.json` and is not inferred from these fields.
573
-
574
- Each case contains at least a unique string `id`, component name `component`, source `source`, boolean `ok` and a deduplicated diagnostic code set `codes`. Optional fields `initial`, `bindingNames`, `actions`, `reset`, `text`, `expectedText`, `htmlIncludes` and `htmlExcludes` follow the [language conformance data notes](../../examples/conformance/README.md) and the JSON Schema shipped with the repository. The full format follows that document and the Schema; this protocol defines only the semantic gates.
575
-
576
- The runner must:
577
-
578
- - Check `protocolVersion` and `syntaxVersion` exactly.
579
- - Validate unique ids, required fields and `codes` as a duplicate-free set of strings; invalid data fails directly instead of being skipped silently.
580
- - Run `actions` in order and check whether each write is accepted; `reset` runs after actions, looks up the compiled node by component name and 0-based `index`, and calls `runtime.reset`.
581
- - Evaluate `text` and `expectedText` after `actions`/`reset`, and check SSR HTML includes/excludes in the final state.
582
- - Call `dispose()` for every runtime in a `finally` block.
583
- - For cases with failed compilation, check only `ok` and `codes`, with no success state, actions or rendering expectations.
584
-
585
- `initial` and `reset.expectedState` use partial matching; `bindingNames` checks the complete public binding name set; `text` and `expectedText` must appear in pairs.
586
-
587
- The frozen author-component set covers representative `slider`, `tabs` and `plot` cases and at least one complete unknown-tag fallback case. It remains a representative gate, not full certification of the 49 tag names; host components have no portable machine cases.
588
-
589
- ### CP-ACCEPT-03 Component-level evidence (required)
590
-
591
- New or changed components must provide evidence commensurate with the size of their declaration:
592
-
593
- - At least one successful compilation case and one failure case covering new attributes, structure or binding constraints.
594
- - If a public value is introduced, at least one initialization case and one rejected-write case.
595
- - If internal state is introduced, at least one reset or hiding-preserves-state case.
596
- - If computation or collections are introduced, at least one budget boundary case.
597
- - If a visualization is introduced, at least one rendering or SSR evidence item, plus a list of manual browser checks.
598
- - If existing semantics change, old/new behavior comparisons and migration evidence.
599
-
600
- ### CP-ACCEPT-04 Manual browser checks (required)
601
-
602
- Component contributions involving the following behavior must provide real browser evidence. Existing automated browser checks may cover corresponding actions; items not yet covered, such as screen reader experience, require manual checks. The machine data in section 11.2 cannot replace this evidence:
603
-
604
- - Real keyboard operations, focus order and moving focus out of hidden content.
605
- - Chinese IME composition and blur validation.
606
- - 375px narrow-screen layout, horizontal overflow and touch targets.
607
- - Timer start, pause, resume and behavior after switching to the background.
608
- - Screen reader names and dynamic state announcements.
609
- - Dark theme, theme variable overrides and style isolation.
610
-
611
- Local browser verification has used Microsoft Edge (Chromium-based); Linux CI uses Playwright Chromium. Firefox, Safari/WebKit and general SSR hydration outside the single-file export are unverified.
612
-
613
- ### CP-ACCEPT-05 Command gate and exemptions (required)
614
-
615
- The protocol sample gate uses `npm run test:components`, which runs `examples/conformance/component-protocol-1.json` and language conformance; it does not replace full tests, builds, documentation checks or manual browser checks. See the [contributing guide](../../CONTRIBUTING.md) and the [component development guide](component-development-en.md) for the full check commands.
616
-
617
- Only SHOULD clauses can be exempted; exemptions must record the rationale, alternative evidence and impact in the proposal. MUST clauses cannot be exempted and can only be changed through a protocol revision.
618
-
619
- ## 12. Current implementation map
620
-
621
- ### CP-IMPL-01 Code locations (existing)
622
-
623
- | Contract surface | Main location | Notes |
624
- | --- | --- | --- |
625
- | Tag lexing and shapes | `src/local/parsing/parser.ts` | `VOID`, `PAIRED`, `INLINE`, unknown-tag fallback, footnote shielding |
626
- | Component declarations | `src/local/configuration/schema.ts` | Names, shapes, child rules, attributes, bindings, initial-value rules |
627
- | Compile validation | `src/local/compilation/compiler.ts` | Structure, attributes, initial values, shared constraints, expressions, table and plot budgets |
628
- | Runtime | `src/local/runtime/runtime.ts` | `get`, `set`, `evaluate`, `text`, `reset`, `resetToken`, `dispose` |
629
- | React reference adapter | `src/local/rendering/document/LocalDocumentView.tsx` | Document container, controls, layout, accessible names, reset and lifecycle |
630
- | Visualization adapter | `src/local/rendering/visuals.tsx`, `src/local/evaluation/math/latex.ts`, `src/local/rendering/math-view.tsx` | Tables, charts, plots, timelines, diagrams and math rendering |
631
- | Styles | `src/styles/index.css`, `src/themes/default/`, component CSS under `src/components/`, `src/local/rendering/document/local.css` | Public entry, complete defaults and component styles |
632
- | Budgets | `src/local/configuration/limits.ts` | Shared resource limits |
633
- | Versions | `src/local/types.ts`, `package.json` | Syntax revision and package version |
634
- | Acceptance | `tests/`, `examples/conformance/` | Language tests and machine conformance data |
635
- | Documentation | `docs/`, `README.md`, `CONTRIBUTING.md`, `SECURITY.md` | Syntax, integration, compatibility, security and contribution rules |
636
-
637
- ### CP-IMPL-02 Current coverage (existing / boundary)
638
-
639
- The current implementation covers parsing, declarations, compilation, runtime, React rendering, resource budgets and release checks. Real keyboard input, IME, 375px layout and timer pause require corresponding automated browser checks or manual checks; general SSR hydration outside the single-file export is unverified. The machine data of `component-protocol-1` is a representative gate, not certification of all 49 tag names.
640
-
641
- ### CP-IMPL-03 Extension interfaces (boundary)
642
-
643
- Section 14 retains the legacy schema and renderer interfaces. New components use the [extension SDK](../integration/extension-sdk-en.md) manifest, instance configuration and adapters. The SDK protocol, component versions, theme protocol, restoration payload and `local-draft-3` syntax revision are managed separately.
644
-
645
- Use `reactive-md/testing` for manifest and binding checks, and `testing/react` and `testing/browser` for rendering and lifecycle evidence. Components must meet this protocol's budget, accessibility and behavior requirements. Hosts install implementations explicitly and control their code permissions; SDK contract and resource validation does not sandbox third-party code.
646
-
647
- ## 13. New component proposal template
648
-
649
- The tables below are for review. See the [component development guide](component-development-en.md) for the complete process, copyable proposal template and check commands.
650
-
651
- ### 13.1 Basic information
652
-
653
- | Item | Content |
654
- | --- | --- |
655
- | Component name | `<name>` (lowercase kebab-case) |
656
- | Protocol revision | `component-protocol-3` |
657
- | Purpose | What problem it solves and how readers use it |
658
- | Non-goals | Capabilities this component does not take on |
659
- | Version impact | Package version, syntax revision, protocol revision |
660
- | Name and shape | Name, leaf/inline/container, parent, child rules |
661
- | Syntax example | Minimal runnable source |
662
- | Binding | Public value type, family, exclusivity, initial-value rule, sharing conditions |
663
- | Children and structure | Allowed direct children and structural constraints |
664
- | State and reset | Public state, internal state, panel reset behavior |
665
- | Visibility and disposal | Conditional hiding, tab switching, timers and unmount behavior |
666
- | Diagnostics and fallback | Structure, attribute, initial-value and runtime errors, unknown-tag fallback |
667
- | Security and budgets | Budgets for new input, loops, recursion, computation or collections |
668
- | Accessibility | Accessible name, role, state, keyboard and focus |
669
- | Narrow screens and styles | 375px behavior, theme variables, style files and screenshots |
670
- | Compatibility classification | Capability addition, breaking change or implementation/editorial change |
671
- | Migration | Old form, new form, affected scope and verification method |
672
- | Acceptance evidence | Automated tests, machine data, SSR/manual checks |
673
- | Changed files | Parser, declaration table, compiler, runtime, renderer, styles, tests, documentation |
674
- | Clause checklist | Applicable CP-* clauses and evidence listed one by one |
675
-
676
- ### 13.2 Attribute table
677
-
678
- | Attribute | Type | Static/dynamic | Required | Default | Constraints | Failure diagnostics |
679
- | --- | --- | --- | --- | --- | --- | --- |
680
- | `name` | string/number/boolean/enum | static/dynamic | yes/no | value | range, enum, length | expected code |
681
- | ... | | | | | | |
682
-
683
- ### 13.3 Binding table
684
-
685
- | Public value | family | Exclusive | Initial-value rule | Sharing conditions | Reset behavior |
686
- | --- | --- | --- | --- | --- | --- |
687
- | `bindName` | text/number/boolean/date/choice/timer/checklist/tabs/diagram | yes/no | rule | same family, matching range/step/options | restore initial value and trigger reset token |
688
-
689
- ### 13.4 Clause checklist
690
-
691
- | Clause | Evidence | Conclusion |
692
- | --- | --- | --- |
693
- | CP-SYNTAX-01 to 08 | Parser/compiler tests, syntax documentation | Pass/outstanding |
694
- | CP-STATE-01 to 09 | Runtime tests, machine data | Pass/outstanding |
695
- | CP-DIAG-01 to 05 | Failure cases, fallback cases | Pass/outstanding |
696
- | CP-A11Y-01 to 03 | Manual browser records | Pass/outstanding |
697
- | CP-STYLE-01 to 03 | Style files, narrow-screen screenshots | Pass/outstanding |
698
- | CP-VIS-01, 02, CP-LIFE-01 to 03 | Hiding/reset/disposal cases | Pass/outstanding |
699
- | CP-SEC-01 to 04 | Security tests, budget cases | Pass/outstanding |
700
- | CP-CORE-01, 02, 04 | Build, Node consumption, rendering tests | Pass/outstanding |
701
- | CP-COMPAT-01 to 05 | Compatibility notes, migration examples | Pass/outstanding |
702
- | CP-ACCEPT-01 to 05 | Acceptance matrix and command results | Pass/outstanding |
703
-
704
- ## 14. Host component extension axis
705
-
706
- ### CP-HOST-01 Host components are opt-in (existing)
707
-
708
- `compileLocal(source, { hostComponents })` adds a host-owned extension axis to the compiler. Without the `hostComponents` option, author behavior is unchanged: the 48 author tag names parse as before, and a tag outside that set remains unknown and falls back to source under CP-DIAG-03. The option changes only which tag names the compiler recognizes for that call; it does not add author syntax. The syntax revision remains `local-draft-2`; the protocol revision becomes `component-protocol-2`.
709
-
710
- ### CP-HOST-02 Host schemas are plain data (required)
711
-
712
- `LocalHostComponentSchema` is plain, structured-clone-safe data supplied by the host. It contains no functions, class instances or runtime handles.
713
-
714
- | Field | Content |
715
- | --- | --- |
716
- | `name` | Lowercase kebab-case, unique within the set, not one of the 48 author tag names, a P0 HTML tag name or the theme declaration name |
717
- | `form` | `'leaf'`, `'inline'` or `'container'`; inline and container bodies are compiled as normal Markdown and may contain components |
718
- | `props` | A table of host properties; property names use lowercase kebab-case |
719
- | `binding` | Optional scalar binding (`string`, `number`, `boolean`) with static `min`, `max`, `step`, `options`, `initialRule` and `exclusive`; the component then accepts `bind`, `initial` and dynamic `disabled` implicitly |
720
-
721
- One compilation accepts at most 32 host component schemas. Each property declares `kind` (`string`, `number`, `boolean` or `enum`), `required`, `static`, `enum` and `pattern`. A host binding shares the built-in families; when its name matches a built-in control, family and static constraints must agree. `enum` applies to `enum` properties, and `pattern` applies to `string` properties. P0 HTML tag names are reserved because the parser handles them before component tags. `pattern` is restricted to a linear-time-safe subset: backreferences, lookarounds, named groups, nested quantifiers and quantified alternation are rejected. Invalid schemas are rejected with a `local.options.invalid` diagnostic; compilation fails and no host component from that set is partially registered.
722
-
723
- ### CP-HOST-03 Host components are not author syntax (boundary)
724
-
725
- Host components are not part of `local-draft-2` and cannot be used as portable author syntax. A document that uses them is portable only with a host that registers the same names and compatible schemas; a plain reader treats each name as an unknown component and applies the existing fallback in CP-DIAG-03. Authors cannot rely on host components being present, so documents intended to be portable must not use them.
726
-
727
- ### CP-HOST-04 Attribute validation and budget (required)
728
-
729
- The compiler validates every host attribute against the registered schema: required properties must be present, `enum` values must belong to the declared set, `pattern` must match literal string values, literal values must match the declared `kind`, and a property declared `static` rejects `{{ ... }}`. For a property with a `pattern`, a non-static value may be exactly one full interpolation in place of the literal; mixed literal text with interpolation is rejected. Other string properties may mix literals and interpolations. Failures produce a `local.host.attribute` diagnostic at the attribute location.
730
-
731
- A valid host node counts as exactly one syntax node in the existing syntax-node budget; its attributes, props and leaf form add no further nodes and do not change other budget accounting.
732
-
733
- ### CP-HOST-05 React dispatch and host-owned data (required)
734
-
735
- The React view dispatches a `hostComponent` node to `hostRenderer(node, data, ctx)`. `data` is read from `hostData`, JSON-safe host data indexed by `${kind}:${ref}` from the node attributes; components without those attributes (binding-only, inline or container shapes) do not require host data. `ctx` provides `value`, a validating `setValue`, `disabled`, `resetToken`, resolved `props`, `report` and `render`; `ctx.render()` with no arguments renders a container's parsed children. Both props stay on the host/React side: the renderer function never enters a worker, and `hostData` never enters the worker either, because compilation needs only the schemas.
736
-
737
- A missing renderer, a missing `${kind}:${ref}` key or a renderer that throws renders a visible diagnostic placeholder. It must not throw out of the document or blank the rest of the content. `mode === 'static'` goes through the same dispatch, so static rendering shows the same placeholder when the host has not supplied a renderer or data.
738
-
739
- Portable machine cases remain `examples/conformance/component-protocol-1.json`, frozen as the baseline for the 48 author components. Host components get no portable conformance cases, because rendering is host-owned and a plain reader only sees the unknown-component fallback.
740
-
741
- ## 15. Revision history
742
-
743
- | Revision | Date | Notes |
744
- | --- | --- | --- |
745
- | `component-protocol-3` | 2026-10-29 | Host components gain inline/container forms and scalar bindings; `local-draft-3` adds `<external>` and dynamic constraints. |
746
- | `component-protocol-2` | 2026-10-25 | Added the host component extension axis; author syntax remains `local-draft-2`. |
747
- | `component-protocol-1` | 2026-10-23 | Initial version; originally applied to `local-draft-1` and package version `0.3.0`, defining component contribution, acceptance and extension boundaries. It now applies to `local-draft-2` and the `0.4.0` preview release without changing its MUST clauses or machine format. |
748
-
749
-
750
- See the [syntax specification](../reference/local-interaction-syntax-en.md) for tags, colors, slot state and selection rules, and [Versions and compatibility](../compatibility/compatibility-en.md) for version mapping and migration guidance.
1
+ # Reactive MD component protocol
2
+
3
+ **English** · [中文](component-protocol-ch.md)
4
+
5
+ Protocol revision `component-protocol-3` · applicable syntax `local-draft-4` · current package version `0.10.0`
6
+
7
+ Components are the building blocks of the Reactive MD language. This protocol defines the shared contract for contribution, implementation and acceptance, connecting author syntax, the compiler, the runtime, the React reference adapter and machine conformance data. Authors writing documents follow the [local interaction syntax specification](../reference/local-interaction-syntax-en.md); hosts integrating follow [local mode integration](../integration/local-integration-en.md); this document is for contributors, reviewers and tests.
8
+
9
+ | To learn about | Read |
10
+ | --- | --- |
11
+ | How to write documents | [Beginner guide](../guides/local-guide-en.md), [syntax specification](../reference/local-interaction-syntax-en.md) |
12
+ | How to add or change components | [Component development guide](component-development-en.md), sections 12 and 13 of this document |
13
+ | How to run acceptance | [Language conformance data](../../examples/conformance/README.md), section 11 of this document |
14
+ | Version and migration rules | [Versions and compatibility](../compatibility/compatibility-en.md) |
15
+ | Security boundary | [Security policy](../../SECURITY.md) |
16
+
17
+ ## 1. Status, terminology and normative force
18
+
19
+ ### CP-SCOPE-01 Version axes (existing)
20
+
21
+ Reactive MD maintains the following independent version axes:
22
+
23
+ | Version axis | Current value | Determines |
24
+ | --- | --- | --- |
25
+ | Package version | `0.5.2` | npm release, core and React entries, upgrade compatibility rules |
26
+ | Syntax revision | `local-draft-4` | Tags, attributes and expressions authors can write |
27
+ | Protocol revision | `component-protocol-3` | Component contribution requirements, acceptance gates and machine data semantics |
28
+ | Theme protocol | `reactive-md-theme-1` | Theme registration, style variables, color schemes and theme acceptance |
29
+
30
+ The protocol revision is independent of the package version and syntax version. One package version accepts only one syntax revision. A protocol revision may raise contribution and acceptance requirements without changing author syntax; a syntax revision change does not automatically require a protocol revision.
31
+
32
+ ### CP-SCOPE-02 Normative sources (existing)
33
+
34
+ When this protocol restates existing behavior, the following files are authoritative:
35
+
36
+ - Author syntax: [local interaction syntax specification](../reference/local-interaction-syntax-en.md).
37
+ - Core and React API: [local mode integration](../integration/local-integration-en.md).
38
+ - Security boundary and host responsibilities: [security policy](../../SECURITY.md).
39
+ - Versions, diagnostics contract and platform scope: [Versions and compatibility](../compatibility/compatibility-en.md).
40
+ - Implementation code: the parser, declaration table, compiler, runtime and renderer under `src/local/`.
41
+
42
+ This protocol does not copy the full attribute tables. Default manifests in `src/presets/default-semantics.ts` define the component data, while `src/assemblies/default-schema.ts` builds the compatibility schema used by local parsing and authoring.
43
+
44
+ ### CP-SCOPE-03 Normative terms (required)
45
+
46
+ | Term | Meaning |
47
+ | --- | --- |
48
+ | MUST | Failing it means not conforming to this protocol; review must not pass |
49
+ | MUST NOT | Explicitly prohibited |
50
+ | SHOULD | Follow by default; deviations must record rationale and alternative evidence in the proposal |
51
+ | MAY | Optional and does not affect conformance |
52
+
53
+ ### CP-SCOPE-04 Clause markers (required)
54
+
55
+ Each clause carries a marker:
56
+
57
+ - **(existing)**: restates behavior in current code and published documentation, used for regressions and review.
58
+ - **(required)**: a requirement this protocol places on new or changed components; the current implementation may not check it automatically, and review must provide evidence.
59
+ - **(boundary)**: a capability this revision explicitly does not promise, which cannot be used as acceptance evidence.
60
+
61
+ When a clause restating existing behavior conflicts with the syntax specification, integration documentation or code, contributors must record the difference and provide a minimal reproduction. After maintainers confirm the expected behavior, synchronize the specification, implementation and conformance data according to fix or migration rules. New contribution requirements in this protocol are identified by the "required" marker.
62
+
63
+ ### CP-SCOPE-05 Scope (boundary)
64
+
65
+ This protocol applies to the 52 tag names of `local-draft-4`, their compilation, runtime and reference rendering behavior, and the process for submitting new components or changing existing ones to the repository.
66
+
67
+ This document defines contribution and acceptance contracts. The author tutorial and host API have separate documents; see CP-CORE-03 for the portable HTML scope and CP-CORE-05 for extension interface boundaries.
68
+
69
+ ## 2. Component model
70
+
71
+ ### CP-MODEL-01 Component classification (existing)
72
+
73
+ `local-draft-4` fixes 52 tag names in the following groups:
74
+
75
+ | Category | Components | Notes |
76
+ | --- | --- | --- |
77
+ | Input controls | `input`, `textarea`, `number`, `slider`, `range-slider`, `coordinate`, `toggle`, `checkbox`, `date`, `select`, `choices`, `radio-group`, `multi-select`, `option` | Read reader input and optionally expose parameters |
78
+ | Self-operating controls | `counter`, `timer`, `checklist`, `progress` | Provide increment/decrement, timing, checking or progress display |
79
+ | Organization and structure | `panel`, `card`, `grid`, `gallery`, `gallery-item`, `tabs`, `tab`, `steps`, `step`, `accordion`, `disclosure`, `if`, `else` | Layout, switching, collapsing, guided reading and conditional display |
80
+ | Navigation and prose | `jump`, `anchor`, `text`, `section` | Jumps, explicit anchors and bounded foreground colors |
81
+ | Assessment | `quiz` | Choice or numeric self-study questions; no public binding |
82
+ | Feedback | `alert`, `badge`, `tooltip` | Alerts and inline explanations |
83
+ | Declarations | `external`, `computed`, `const`, `validation` | Parsed tags that are not rendered controls; `external` is a read-only host-data declaration |
84
+ | Generated data and visualization | `data-table`, `column`, `table`, `chart`, `plot`, `timeline`, `diagram`, `node`, `edge` | Generated rows, tables, charts, function curves, timelines and diagrams |
85
+
86
+ `option`, `tab`, `gallery-item`, `disclosure`, `node`, `edge`, `step` and `column` are structural children that appear only inside their specified parent components. `computed` and `const` are invisible declarations; `validation` produces accessible hints when its rule fails. The leading `<theme>` declaration is document metadata, not a component. See [section 12 of the syntax specification](../reference/local-interaction-syntax-en.md#12-component-reference-and-syntax-scope) for the complete names and purposes.
87
+
88
+ ### CP-MODEL-02 Three shapes (existing)
89
+
90
+ | Shape | Author form | Current components |
91
+ | --- | --- | --- |
92
+ | No body (leaf) | `<slider ...>`, no end tag; `<slider ... />` is also accepted | `input`, `textarea`, `number`, `slider`, `range-slider`, `coordinate`, `toggle`, `checkbox`, `date`, `counter`, `timer`, `progress`, `edge`, `anchor`, `external`, `computed`, `const`, `validation`, `column` |
93
+ | Inline | Paired tags with content embedded in a sentence | `badge`, `tooltip`, `jump`, `text` |
94
+ | Container | Paired tags whose content continues to parse as Markdown or child components | The remaining components |
95
+
96
+ Void components must not carry a body; containers must be explicitly closed, and automatic closing or correction of mismatched tags is not allowed. `textarea` text is set through `initial`, so it is a void component.
97
+
98
+ ### CP-MODEL-03 Declaration contents (required)
99
+
100
+ A component proposal declaration contains at least the following information; items that do not apply, such as no binding or no computation, must be stated explicitly:
101
+
102
+ | Information | Content |
103
+ | --- | --- |
104
+ | Name | Lowercase kebab-case tag name |
105
+ | Shape | Void, inline or container |
106
+ | Child rules | Allowed direct children; allowed parents for structural children |
107
+ | Label requirements | `label` required, optional or not applicable |
108
+ | Attribute table | Name, type, static or dynamic, required, default, constraints |
109
+ | Binding | Public value type, family, whether exclusive, default initial-value rule |
110
+ | Initial-value rules | How the public value is produced when `initial` is omitted |
111
+ | Rendering | Reference adapter element, accessible name, keyboard operations and style hooks |
112
+ | Diagnostics | Diagnostic categories for structure, attributes, bindings, initial values and budget failures |
113
+ | Budgets | Resource limits defined when adding unbounded input, loops, recursion or computation |
114
+ | Compatibility classification | Capability addition, breaking change or implementation/editorial change |
115
+ | Acceptance evidence | Automated tests, machine conformance data and manual browser checks |
116
+
117
+ Default component data lives in `src/presets/default-semantics.ts`, with its local schema projection in `src/assemblies/default-schema.ts`. Kernel declarations and normalization live in `src/contracts/component-kernel.ts`. Tag lexical sets are in `src/local/parsing/parser.ts`, semantic validation in `src/local/compilation/compiler.ts`, write constraints in `src/local/runtime/runtime.ts`, and React rendering in `src/react/rendering/document/LocalDocumentView.tsx` and `src/react/rendering/visuals.tsx`.
118
+
119
+ ### CP-MODEL-04 Name set (existing)
120
+
121
+ The 52 names of `local-draft-4` are the complete set for the current syntax. Adding, removing or changing the meaning of a name is an author-visible change and is handled under section 10. Implementations may use undocumented node types internally, but authors can only use the names listed here and in the syntax specification.
122
+
123
+ ### CP-MODEL-05 Raw-body containers (required)
124
+
125
+ A container component may declare `structure: { rule: 'raw-body', label: ..., min?: ... }` in an SDK manifest, or `body: 'raw'` in a legacy `hostComponents` schema. Its body is delivered as one lazy `rawBody` child and is never parsed:
126
+
127
+ - Only `form: 'container'` accepts the declaration. A leaf or inline manifest or host schema is rejected when it is read.
128
+ - Inside the body, Markdown, component tags, `{{ }}` interpolation, HTML entities, backslash escapes and formulas stay literal. A `<name>` line is text; same-name nesting creates no structure.
129
+ - The body ends only on a line whose first non-whitespace content is exactly `</name>` and whose remaining characters are spaces, tabs or the line ending. Leading indentation is allowed, matching is case-sensitive, and tag-shaped text before that line stays body text. A blockquote `>` or other prefix marker before the closing tag is not whitespace, so a raw container whose close line sits under such a prefix does not close; keep raw containers on unprefixed lines.
130
+ - The delivered `value` is the body source with the container's common indentation removed; line endings and remaining whitespace are kept. `rawBody.range` points at the original body source without the opener or close tag, and the component range still spans the whole element.
131
+ - Compilation emits exactly one `rawBody` child, including for an empty body (`value: ''`). `structure.min > 0` requires a non-blank body and reports `local.structure.children` with `local.structure.children.minimum`; Markdown child rules do not run against the body.
132
+ - Body source counts toward `limits.maxRawBodyChars` (default 100,000 UTF-16 code units, at most 1,000,000, counted before dedenting and excluding both tags), and scanning counts toward `maxParseWork`. An over-limit compile fails with `local.budget` / `local.budget.raw` and `{ name, limit }`, without a partial node.
133
+ - Final compilation reports `local.tag.unclosed` for an unclosed body in strict mode and uses unclosed-container recovery with `strict: false`. Streaming shows the unfinished body as raw text through the end of the snapshot in either mode. The length limit also applies when loose final compilation recovers the unfinished body as source text.
134
+ - The React renderer emits the value as plain text, identically in interactive, SSR and offline/static output. It never enters `dangerouslySetInnerHTML`, a Markdown renderer or an HTML renderer. A host that inserts the string into its own HTML owns that escaping.
135
+ - `analyzeLocalSource` treats the body as opaque: no tag, attribute, interpolation, binding, comment or completion token comes from it. The catalog reports `bodyKind: 'raw'` and synthesizes `<name>\n\n</name>` (a required body uses a literal `…` line) unless the manifest supplies `authoring.insertText`.
136
+ - Identity is unchanged: the manifest protocol stays `reactive-md-component/v1` and the protocol revision stays `component-protocol-3`. Older readers reject an unknown structure rule, and no default component declares `raw-body`.
137
+
138
+ ## 3. Names, syntax and attributes
139
+
140
+ ### CP-SYNTAX-01 Name spelling (existing)
141
+
142
+ Tag names and attribute names must use lowercase kebab-case matching `^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$`. Duplicate attribute names, end tags with attributes, and non-conforming tag or attribute names all produce compile diagnostics. Authors cannot define new tags, nor extend components with `class`, `style` or `on-*`.
143
+
144
+ ### CP-SYNTAX-02 Shape and nesting (existing)
145
+
146
+ - Void components have no end tag; a trailing `/` may be used as self-closing syntax.
147
+ - Containers must use a paired end tag; the end tag must match the most recently unclosed container.
148
+ - Automatic closing, auto-completion or correction of mismatched tags is not supported.
149
+ - `badge`, `tooltip`, `jump` and `text` are inline components and can be embedded in sentences; other components are treated as block content.
150
+ - Tags, interpolations and formulas inside code fences and inline code are displayed verbatim and are not activated; Markdown comments produce no display content, components or bindings.
151
+
152
+ ### CP-SYNTAX-03 Attribute values (existing)
153
+
154
+ Regular attribute values must be enclosed in single or double quotes; boolean attributes may omit their value, which means `true`. Attribute order has no semantics, and duplicate attributes are errors. `&quot;`, `&apos;`, `&amp;`, `&lt;` and `&gt;` in attribute values decode to the corresponding characters; backslashes are not used to escape attribute quotes.
155
+
156
+ Omitted boolean attributes use the default declared by the component instead of assuming `false` uniformly. For example, `panel.reset` defaults to `true`.
157
+
158
+ ### CP-SYNTAX-04 Static and dynamic values (existing)
159
+
160
+ Attributes declared static must not contain interpolation. Dynamic attributes may use valid literals; when interpolation is used, a numeric, boolean or enum attribute must be one complete `{{ expression }}` and the result keeps the corresponding type. Text attributes may contain multiple interpolations, and their output is treated as text.
161
+
162
+ ```markdown
163
+ <slider bind="people" label="People" initial="2" min="1" max="20">
164
+ <number bind="lowerBound" label="Lower bound" initial="-2">
165
+ <number bind="upperBound" label="Upper bound" initial="2">
166
+ <if when="{{ people >= 5 }}">
167
+ <plot min="{{ lowerBound }}" max="{{ upperBound }}">
168
+ $$ y = x^2 $$
169
+ </plot>
170
+ </if>
171
+ ```
172
+
173
+ `bind`, `initial`, `id`, `value`, `from`, `to`, `kind`, `type`, `step`, text-length limits and layout enums are static attributes. `disabled`, `if.when`, `plot.min`, `plot.max`, `node.tone`, `number`/`slider` `min`/`max`, `date` `min`/`max`/`required`, and `input`/`textarea` `required` are dynamic. The complete list follows the `static` and `dynamic` markers in `schema.ts`.
174
+
175
+ ### CP-SYNTAX-05 Labels and accessible names (existing)
176
+
177
+ Whether `label` is required, optional or not applicable is determined by the component declaration. A required label cannot be missing or whitespace-only; labels may be dynamic text. An input control's `label` is also its accessible name. When an optional label is omitted, the reference adapter must provide a stable accessible-name fallback and must not leave an unnamed control.
178
+
179
+ ### CP-SYNTAX-06 Child rules (existing)
180
+
181
+ | Child rule | Allowed content | Current components |
182
+ | --- | --- | --- |
183
+ | No children | No body or child components | Void controls, `progress`, `edge`, `anchor`, `computed`, `const`, `validation`, `column` |
184
+ | Inline content | Inline Markdown, no nested component tags | `option`, `badge`, `tooltip`, `jump`, `text` |
185
+ | Options | One or more `option` | `select`, `choices`, `radio-group`, `multi-select`, `quiz` (choice) |
186
+ | Tabs | One or more `tab` | `tabs` |
187
+ | Steps | One or more `step` | `steps` |
188
+ | Disclosures | One or more `disclosure` | `accordion` |
189
+ | Cards | One or more `card` | `grid` |
190
+ | Diagram | One or more `node`, optional `edge` | `diagram` |
191
+ | Table | Exactly one Markdown table | `table`, `chart`, `timeline` |
192
+ | Columns | One to 20 `column` declarations | `data-table` |
193
+ | Formulas | One or more `$$...$$` formula blocks | `plot` |
194
+ | Content | A task list or static notes | `checklist`, `node` |
195
+ | General content | Markdown and components, with component-specific rules | `panel`, `card`, `tab`, `step`, `if`, `alert`, `section` |
196
+ | Raw body | One lazy raw text body; no Markdown, interpolation or child components | SDK or host containers declaring `raw-body`; none of the 49 author tags |
197
+
198
+ The `checklist` body must be exactly one level of Markdown task list; `node` notes may contain text interpolation but must not contain interactive components. A `choice` quiz accepts `option` children and a `number` quiz has an empty body. Compilation fails when a structural child appears under the wrong parent, a container lacks a required child, or a child type does not match.
199
+
200
+ ### CP-SYNTAX-07 Markdown context (existing)
201
+
202
+ Components may sit in a paragraph or a standalone block. Container content is dedented by the common indentation and then parsed as Markdown; indentation inside code fences is preserved. The parser identifies code, math regions and tag boundaries first, then interprets interpolations; the syntax cannot be implemented by string replacement over the whole document.
203
+
204
+ ### CP-SYNTAX-08 Author capability boundary (existing)
205
+
206
+ Authors cannot execute scripts, write executable HTML, provide author CSS, register event handlers or declare network service calls. Images and links are constrained by the host URL policy in CP-SEC-02. `<script>`, `<style>`, `on-*`, `class`, `style` and legacy directives are not part of `local-draft-2`. Complete unknown tags fall back to source; incomplete or unrecoverable tags produce errors. Document content is never executed as arbitrary HTML.
207
+
208
+ ## 4. Bindings and state
209
+
210
+ ### CP-STATE-01 Binding names (existing)
211
+
212
+ `bind` must match `[A-Za-z_][A-Za-z0-9_]*`, is case-sensitive, and is at most 128 characters. Expression built-in function names, `x`, `y`, `pi`, `e`, `true`, `false`, `null`, and `__proto__`, `prototype`, `constructor` are reserved names and cannot be used as binding names.
213
+
214
+ Components without `bind` still have internal state under the internal key `@<node.id>`, but that key does not enter the public parameter set and cannot be referenced by expressions. Public parameters contain only explicitly bound names.
215
+
216
+ ### CP-STATE-02 Binding families (existing)
217
+
218
+ | family | Public value | Components |
219
+ | --- | --- | --- |
220
+ | `text` | String | `input`, `textarea` |
221
+ | `number` | Finite number | `number`, `slider`, `counter` |
222
+ | `boolean` | Boolean | `toggle`, `checkbox` |
223
+ | `date` | `YYYY-MM-DD` or empty string | `date` |
224
+ | `choice` | Option string | `select`, `choices`, `radio-group` |
225
+ | `timer` | Remaining seconds, non-negative number | `timer` |
226
+ | `checklist` | String array of selected item IDs | `checklist` |
227
+ | `tabs` | Current tab value | `tabs` |
228
+ | `diagram` | Current node ID | `diagram` |
229
+ | `multi-select` | Option value array in source order, exclusive | `multi-select` |
230
+ | `steps` | Current step value, exclusive | `steps` |
231
+ | `selection` | Stable row key, empty string when unselected | `table` and `chart` with key |
232
+
233
+ Each numeric slot of range-slider and coordinate is also exclusive. Bounds, steps, defaults and atomic batch writes are defined in the [syntax specification](../reference/local-interaction-syntax-en.md). Selection can be shared by tables and charts only with identical ordered keys. The initialization, rejection, visibility, reset and disposal clauses below continue to apply.
234
+
235
+ `timer`, `checklist`, `tabs` and `diagram` are also exclusive families: a public parameter can be owned by only one component, and other controls cannot declare a same-name binding. Hosts can still call the public `runtime.set` through the owning node, and writes follow the same validation.
236
+
237
+ ### CP-STATE-03 Shared constraints (existing)
238
+
239
+ A same-name binding is valid only when all of the following conditions hold:
240
+
241
+ - All components belong to the same family.
242
+ - Numeric bindings have exactly identical `min`, `max` and `step`; when a bound is dynamic, all owners must declare the same expression.
243
+ - Date bindings have identical `min` and `max` after resolving literals and dynamic expressions.
244
+ - Selector option value sets and order are exactly identical.
245
+ - An exclusive family has only one component.
246
+ - The same binding has at most one explicit `initial`.
247
+
248
+ Shared controls may have different label text and appearance. Violating shared conditions produces a compile error, and the error message points to the conflicting location.
249
+
250
+ ### CP-STATE-04 Initialization (existing)
251
+
252
+ Public values are initialized once when the document instance is created. Components in conditional regions, inactive tabs and closed disclosure panels also participate in initialization; hiding and showing again does not initialize again.
253
+
254
+ Without an explicit `initial`, the default is generated according to the component declaration:
255
+
256
+ | Initial rule | Components | Result |
257
+ | --- | --- | --- |
258
+ | `empty` | `input`, `textarea`, `date` | Empty string |
259
+ | `false` | `toggle`, `checkbox` | `false` |
260
+ | `min` | `slider`; `range-slider.start` | `min`, default range 0 to 100 |
261
+ | `max-step` | `range-slider.end` | The largest valid step not exceeding `max` |
262
+ | `nearest-zero` | `number`, `counter`; `coordinate.x` and `coordinate.y` | The valid step value within range closest to 0; the smaller value when equidistant |
263
+ | `first-option` | Selectors | value of the first option |
264
+ | `empty-array` | `multi-select` | Empty string array |
265
+ | `first-tab` | `tabs` | value of the first tab |
266
+ | `first-step` | `steps` | value of the first step |
267
+ | `first-node` | `diagram` | id of the first node |
268
+ | `checked` | `checklist` | IDs of checked items in the task list |
269
+ | `duration` | `timer` | `duration`, default 60 |
270
+ | `none` | `table`, `chart` selection | Empty string when unselected |
271
+
272
+ When a shared binding has no explicit initial value, the default of the first component in the source is used, and all members' constraints are validated.
273
+
274
+ ### CP-STATE-05 Initial-value validation (existing)
275
+
276
+ An explicit initial value must be static. Compile-time validation covers numeric ranges, steps, date format, option membership, text length, email format and shared constraints. Out-of-range, off-step, unknown-option or type-mismatched values produce errors and are not silently corrected. A valid empty string may represent "not selected yet"; that value remains public until the reader enters something.
277
+
278
+ `initial` is only document initialization data, not a persistence format. After the source changes, a new instance is created and initialized from the new source.
279
+
280
+ ### CP-STATE-06 Writes and atomicity (existing)
281
+
282
+ Runtime `set(node, value)` relies on the controls registered in the compiled document and ignores forged node metadata from the caller. A write checks in order:
283
+
284
+ 1. Whether the component has a writable binding.
285
+ 2. The value type and resource budget.
286
+ 3. The binding's own range, step and option constraints.
287
+ 4. Additional constraints on all shared controls, such as required, length, email and date ranges.
288
+
289
+ When all checks pass, the runtime commits once and all dependent content sees the same new state; when any control rejects, state does not change, revision does not increase, and a runtime diagnostic is returned. Checklist array values are normalized to the source order of items. A write equal to the current value does not commit and does not notify subscribers.
290
+
291
+ ### CP-STATE-07 Input drafts (existing)
292
+
293
+ Intermediate input in number and text fields that is not yet valid is kept in a renderer-local draft and does not enter public state. Examples include an empty string or a minus sign in a number field, and content that has not passed email or length checks in a text field. Valid input commits immediately; if it is still invalid on blur, a hint is shown while other content keeps reading the last valid value. Panel reset clears drafts.
294
+
295
+ ### CP-STATE-08 Reset (existing)
296
+
297
+ `runtime.reset(node)` restores all bindings and internal component state within that node's subtree at once, commits once and notifies once. Scope rules:
298
+
299
+ - Bindings of controls in the subtree return to compile-time initial values; displays of shared variables outside the subtree update in sync.
300
+ - Components in the subtree detect reset through `resetToken` and restore local selection, table query, sorting, paging, chart legend, plot readout, tab, disclosure state and timer state.
301
+ - Child controls not yet shown in a condition are also within reset scope.
302
+ - A panel's restore-defaults uses the same mechanism; an inner reset of a nested panel affects only the inner panel, while an outer reset covers the whole subtree.
303
+ - Internal state of components without bindings is also reset; their internal keys still do not enter the public parameter set.
304
+
305
+ ### CP-STATE-09 Display state is not permission (existing)
306
+
307
+ `disabled` and `if` control only interface display and input. They are not authorization, data validation or server-side permission boundaries. The host must revalidate permissions and business constraints when submitting to the server.
308
+
309
+ ### CP-STATE-10 Representative normative points for slider (existing)
310
+
311
+ `slider` represents a simple numeric control:
312
+
313
+ - The family is `number`; `min`, `max` and `step` are static numeric attributes with defaults `0`, `100` and `1`.
314
+ - Omitting `initial` takes `min`; an explicit initial value must be within range and on a step based at `min`.
315
+ - The runtime rejects out-of-range, non-finite and off-step writes, and keeps the last valid state when rejecting.
316
+ - When sharing a binding with other numeric controls, all members' `min`, `max` and `step` must be exactly identical.
317
+ - Without `bind`, the control still works, with state stored under the internal key and not exposed to expressions.
318
+
319
+ ### CP-STATE-11 Representative normative points for tabs (existing)
320
+
321
+ `tabs` represents a container component with public state:
322
+
323
+ - The public value type is string, the family is `tabs`, and ownership is exclusive; a second component cannot declare a same-name binding.
324
+ - `tab.value` is a static unique value; when omitted, `tab-1`, `tab-2` and so on are generated in source order.
325
+ - Without `initial`, the first tab is selected; an explicit initial value must point to an existing tab.
326
+ - Without `bind`, selection stays inside the component; with `bind`, switching writes the public value.
327
+ - Hidden tab content still participates in compilation and initialization, and child content state is preserved; timers inside pause, and the reader must start them again after the tab is shown.
328
+ - Panel reset restores the tab initials and child content state together.
329
+
330
+ ### CP-STATE-12 Representative normative points for plot (existing)
331
+
332
+ `plot` represents a computational visualization:
333
+
334
+ - The body may contain only whitespace and one or more `$$...$$` formula blocks. Each block defines one explicit `y = expression` curve, one parametric `\begin{cases} x = f(t) \\ y = g(t) \end{cases}` curve, one polar `r = f(\theta)` curve, or one implicit equation in `x` and `y`.
335
+ - `min` and `max` may be dynamic and require `min < max`; static ranges are validated at compile time and dynamic ranges at render time. Invalid ranges show a local error instead of being silently clamped. They set the horizontal range for explicit curves, the `t` range for parametric curves, the angle interval in radians for polar curves, and the square tracing region for implicit curves.
336
+ - `points` is a static integer from 2 to 2000. The existing `samples` attribute remains supported; `points` takes precedence when both are supplied, and the default is 200 when both are omitted. Each `plot` has at most 16 curves.
337
+ - An explicit, parametric or polar curve requests the specified number of points, including both endpoints. An implicit curve uses the specified number of grid points per axis (capped at 100, raised to at least 32) and requests the grid area.
338
+ - The whole document has at most 20,000 curve sample points, including hidden regions; plotting computation shares a budget of 2,000,000 steps.
339
+ - Formulas may reference only declared numeric parameters; undeclared or non-numeric parameters are diagnosed at compile time. `t` is local to a parametric block, and `\theta` is local to a polar equation; neither reads the same-named document parameter in its curve. Polar samples use `x = r cos(θ)`, `y = r sin(θ)` and preserve the direction of negative radii.
340
+ - Non-finite samples form breaks, and the two sides of a break are not connected directly; when there are no valid values, an empty state is shown.
341
+ - The reference adapter provides legends and pointer/keyboard readouts; real pointer, keyboard and narrow-screen behavior is checked manually as described in section 11.
342
+
343
+ ## 5. Diagnostics and fallback
344
+
345
+ ### CP-DIAG-01 Diagnostics contract (existing)
346
+
347
+ `Diagnostic` contains `code`, `message`, `severity`, `range`, `line` and `column`. `line` and `column` start at 1; `range` is an index into the current source string. `code` is a string identifier; `message` is display text, and callers must not parse message or make business decisions based on its full text.
348
+
349
+ ### CP-DIAG-02 Compile results and severity (existing)
350
+
351
+ Compilation has exactly two outcomes:
352
+
353
+ - Success: `ok: true`, with the document and diagnostics; diagnostics may contain warnings.
354
+ - Failure: `ok: false`, with diagnostics only; the interactive preview is disabled.
355
+
356
+ Structurally complete but unknown tags produce warnings; incomplete component structures, mismatched tags, unknown attributes or type errors on known components, binding errors, expression errors and budget overruns produce errors. Errors block successful compilation; warnings do not. Normal footnotes produce no unsupported-syntax warning.
357
+
358
+ ### CP-DIAG-03 Fallback isolation (existing)
359
+
360
+ Structurally complete unknown tags are displayed as original source with a `local.component.unknown` warning. Controls, interpolations and formulas inside the fallback region are not executed, do not initialize bindings and cause no network actions. Footnotes support Markdown layout, numbering and return links; controls and interpolations inside definitions remain text and create no bindings. Other prose and interactions keep working.
361
+
362
+ Unknown tags that cannot be reliably recovered and tag structure errors still block compilation; fallback cannot be used to bypass validation.
363
+
364
+ ### CP-DIAG-04 Runtime error isolation (existing)
365
+
366
+ When a control write is rejected, a `local.runtime.value` or `local.runtime.binding` diagnostic is returned and public state keeps the last valid value. Local computation errors in expressions, tables, charts or plots are shown near the corresponding content, with "Unable to compute" or a matching empty state, while other independent content keeps updating. A rendering exception in a single component is isolated by an error boundary and retried after the revision changes.
367
+
368
+ ### CP-DIAG-05 Hidden branches are still compiled (existing)
369
+
370
+ A false condition, inactive tab or closed disclosure affects display only, not compilation. Undeclared variables, type errors, structure errors and budget overruns in hidden branches are still compile errors. At runtime, hiding preserves state and pauses timers; it does not skip validation.
371
+
372
+ ### CP-DIAG-06 Diagnostic code stability (contract)
373
+
374
+ Existing diagnostic codes keep their meaning within one 0.x minor series; new codes may be added. Removal, renaming or a change of meaning requires a new minor version and migration notes. Messages are localized display text. Tests and machine conformance use codes and structured fields. See [Diagnostics and counting rules](../reference/diagnostics-counting-en.md) for units and budget scopes.
375
+
376
+ ## 6. Accessibility, themes and styling
377
+
378
+ ### CP-A11Y-01 Accessible names and states (existing)
379
+
380
+ Every interactive component must provide an accessible name and expose its current state. Input controls use `label` as their name; containers and visualizations that require independent operation use a stable fallback name when an optional label is omitted. Selectors, tabs, disclosures, checklists, progress, timers, tables, charts, plots and diagrams must expose states such as selection, expansion, progress, remaining time, sorting or readout to assistive technologies. Distinguishing state by color alone does not meet the requirement.
381
+
382
+ ### CP-A11Y-02 Keyboard and focus (existing)
383
+
384
+ Interactive components must be reachable and operable by keyboard. Tabs support arrow keys, Home and End; diagram nodes support Tab focus and Enter selection; plots support arrow keys, Home and End readouts; table sorting and paging use focusable controls. When a conditional region is hidden and focus is inside it, the reference adapter moves focus out of the hidden content. New components must not leave focus on invisible elements.
385
+
386
+ ### CP-A11Y-03 Manual checks (existing / boundary)
387
+
388
+ The machine conformance data of this protocol does not cover browser behavior such as real keyboard input, IME composition, 375px narrow screens, screen readers and timer pause. These items require corresponding automated browser checks or the manual checks in section 11. Incomplete checks must be recorded and must not be reported as passed.
389
+
390
+ ### CP-STYLE-01 Global styles and themes (existing)
391
+
392
+ `reactive-md/styles.css` is a global stylesheet, not isolated through Shadow DOM or CSS Modules. The host imports it explicitly once. Theme variables are declared on `.md-document` and `.reactive-md-theme`. Document selection, registration and color schemes follow the [theme protocol](../reference/theme-protocol-en.md). `colorScheme="auto"` reads the nearest explicit ancestor preference or the system, retaining support for `data-theme="dark|light"`.
393
+
394
+ ### CP-STYLE-02 Style hooks are not an API (existing)
395
+
396
+ Prefer public CSS variables for themes. Component outer `.md-*` and `.local-*` classes and semantic state attributes are styling interfaces under the theme protocol; internal node ordering is not an extension API. Neither React component accepts `className` or `style`; authors cannot write class or style either. New components use existing prefixes and shared variables and work with the built-in default theme in both modes.
397
+
398
+ ### CP-STYLE-03 Styling requirements for new components (required)
399
+
400
+ New components must:
401
+
402
+ - Be usable at 375px width without horizontal overflow or unreachable actions.
403
+ - Use existing theme variables and `.md-*`, `.local-*` prefixes, without overriding global selectors outside the document.
404
+ - Provide visible styles for keyboard focus and non-color cues for selected, disabled, error and empty states.
405
+ - Not automatically inject new global styles when JavaScript is imported; styles ship with `styles.css`.
406
+ - List added or changed style files and manual check screenshots or records in the proposal.
407
+
408
+ ## 7. Visibility, instances and disposal
409
+
410
+ ### CP-VIS-01 Hidden state is preserved (existing)
411
+
412
+ When `if` is false, a tab is inactive or a disclosure is closed, content is not displayed, but parameters, tab selection and checklist checks are preserved. Hiding does not reinitialize bindings or skip diagnostics. Toggling display updates only the view and does not create new document state.
413
+
414
+ ### CP-VIS-02 Timing and focus (existing)
415
+
416
+ Timers in hidden regions pause, and public seconds stop at the pause point; when shown again they stay paused until the reader starts them. When a conditional region is hidden, keyboard focus must not remain in hidden content. Hidden regions still count toward the whole-document plot sample budget.
417
+
418
+ ### CP-LIFE-01 Instance isolation (existing)
419
+
420
+ Each `LocalReactiveDocument` instance creates an independent runtime and state. The same page can embed multiple copies of the same source, and parameters, timers, tabs, table queries and diagram selections do not affect each other. `LocalDocumentView` uses the runtime passed by the host; when instance isolation is needed, the host must create a separate runtime for each document. Heading anchors are isolated per rendering instance, and table-of-contents links target the current instance.
421
+
422
+ ### CP-LIFE-02 Source changes (existing)
423
+
424
+ `LocalReactiveDocument` recompiles when `source` changes and tries to adopt the new document in its existing runtime, retaining bindings that still satisfy their contracts. Changed compilation semantics or an incompatible document create a new runtime; use a new React `key` when switching to an independent document. Hosts that manage the lifecycle pass the compiled document and runtime to `LocalDocumentView` and dispose the runtime on unmount. Deferred disposal under React StrictMode preserves runtimes still in use.
425
+
426
+ ### CP-LIFE-03 Disposal (existing)
427
+
428
+ `runtime.dispose()` is idempotent and clears subscriptions, expression caches and reset markers; React components clean up their timers and event listeners on unmount. After disposal the host should stop using the instance; lifecycle-checked methods such as `snapshot`, `get` and `set` throw. Host-managed runtimes must call `dispose()` on unmount and handle callbacks still in flight.
429
+
430
+ ### CP-LIFE-04 SSR and persistence scope (boundary)
431
+
432
+ Static SSR rendering is covered by the pre-release packed check. Single-file export static-first hydration is covered in Playwright Chromium and local Edge; general SSR hydration outside that path is unverified. Document state exists only in the current instance's memory; there is no localStorage, cookie, server write or cross-instance sharing. Persist the original `.reactive.md` source; public parameters may also be exported as a validated `reactive-md-state/v1` file. Do not persist `LocalDocument`, `LocalNode`, `node.id`, `LocalSnapshot` or internal runtime keys, whose structure is not guaranteed across versions.
433
+
434
+ ## 8. Security and resource budgets
435
+
436
+ ### CP-SEC-01 Untrusted documents (existing)
437
+
438
+ The renderer and evaluators treat document content as untrusted input:
439
+
440
+ - They do not execute author scripts. Formula HTML comes only from the configured KaTeX renderer; author source and error messages are never injected as HTML.
441
+ - Expressions use their own parser and AST evaluator, not `eval` or `new Function`, and do not support assignment, method calls, property access, prototype paths or imports.
442
+ - LaTeX is typeset by KaTeX as HTML with accessible MathML and bundled fonts. Input, expansion and output dimensions are bounded; author-defined macros, files, network and HTML entry points are disabled. Plot evaluation keeps its separate budget-limited parser.
443
+ - Expressions, templates, tables and charts do not make network requests.
444
+
445
+ ### CP-SEC-02 URLs and networking (existing)
446
+
447
+ All images are rejected by default, including relative paths; they load only when the host `urlPolicy` returns `true`. Images with a protocol allow only `http:` and `https:`; dangerous protocols are rejected even if the policy allows them. Links allow relative addresses and `http:`, `https:`, `mailto:` and `tel:` by default; external HTTP links open in a new tab with `noopener noreferrer`. If the policy throws, the address is rejected.
448
+
449
+ `urlPolicy` is a URL allowlist, not server-side authorization or a sandbox. Hosts still need to configure CSP, network egress, an image proxy or a sandboxed iframe.
450
+
451
+ ### CP-SEC-03 Resource budgets (existing)
452
+
453
+ | Limit | Value |
454
+ | --- | --- |
455
+ | Source per document | 1,000,000 characters |
456
+ | Raw body source per `raw-body` component | 100,000 UTF-16 code units by default; host may raise `limits.maxRawBodyChars` to 1,000,000 |
457
+ | Syntax nodes created cumulatively during parsing | 10,000 by default, configurable per call by the host |
458
+ | A single string value, attribute or template | 100,000 characters |
459
+ | A single array | 10,000 items |
460
+ | Total string length within an array | 100,000 characters |
461
+ | Email address | 254 characters, validated in linear time |
462
+ | Number of diagnostics | 100 |
463
+ | Text of a single diagnostic | 2,000 characters |
464
+ | Curves per plot component | 16 |
465
+ | Curve sample points requested by the whole document | 20,000 |
466
+ | Shared computation steps for plotting | 2,000,000 |
467
+ | Validation rules per document | 100, including hidden regions |
468
+ | Declared generated rows per `<data-table>` | 1,000 maximum; 100 default |
469
+ | Columns per `<data-table>` | 20 |
470
+ | Document generated row budget | 2,000 |
471
+ | Document generated cell budget | 10,000 |
472
+ | Generated table text | 100,000 UTF-16 code units per table |
473
+
474
+ Here, characters means UTF-16 code units. Text-control `min-length` / `max-length` and string `len()` count Unicode code points. Writes over a limit are rejected and the runtime keeps the last valid state; compile-time overruns return diagnostics. Expressions and math evaluation have additional length, node, depth and token budgets. See [Diagnostics and counting rules](../reference/diagnostics-counting-en.md) for all units and scopes. Hidden regions count toward plotting budgets. Hosts still control request size, concurrency and timeouts.
475
+
476
+ ### CP-SEC-04 Host responsibilities (existing)
477
+
478
+ The host decides who may write, submit and share documents; limits request size, concurrency and execution time for untrusted authors; configures `urlPolicy`, CSP and network egress; revalidates form values, permissions and business constraints on the server; and assesses the rendering process's resource limits before statically rendering untrusted documents.
479
+
480
+ ### CP-SEC-05 Extension trust boundary (boundary)
481
+
482
+ This language does not provide a sandbox for trusted host extension code. Hosts control the security boundary of components they register or wrap; `disabled`, conditional visibility and client state are not permission controls. The legacy `hostComponents` option registers plain schema data for one compilation and carries no executable code. The SDK likewise separates data manifests from explicitly imported implementations. Hosts control the code permissions of render callbacks and SDK implementations.
483
+
484
+ ## 9. Core and renderer separation
485
+
486
+ ### CP-CORE-01 Entry separation (existing)
487
+
488
+ The `reactive-md` core entry provides `compileLocal`, `createLocalRuntime`, expressions, LaTeX and version constants, does not depend on React, and can run in Node. `reactive-md/react` provides `LocalReactiveDocument` and `LocalDocumentView` and requires React 19. Styles are imported through the separate `reactive-md/styles.css`.
489
+
490
+ ### CP-CORE-02 Authority layering (existing)
491
+
492
+ - The declaration table and compiler determine which tags, attributes, structures and initial values are legal.
493
+ - The runtime determines whether writes are accepted and whether shared values commit atomically.
494
+ - The renderer presents content and collects user input; it does not reinterpret source rejected by the compiler or create public bindings not registered by the compiler.
495
+ - The core and reference renderer produce the same binding semantics and state results for the same document.
496
+
497
+ ### CP-CORE-03 HTML is not a cross-implementation protocol (boundary)
498
+
499
+ SSR HTML, class names and DOM structure in machine acceptance are evidence for the React reference adapter, not a cross-implementation HTML byte protocol. Cross-implementation compatibility is measured by bindings, state, diagnostic codes and text results; visual presentation is the responsibility of each implementation, but must meet accessibility and narrow-screen requirements.
500
+
501
+ ### CP-CORE-04 Implementation surfaces for new components (required)
502
+
503
+ New components must check the following integration points and change the corresponding implementation according to their behavior; when reusing existing generic validation, explain it in the proposal:
504
+
505
+ 1. The public manifest's `form`; the parser reads shapes from instance configuration.
506
+ 2. Component definitions and registration. Default manifests live in `src/presets/default-semantics.ts`; `src/assemblies/default-schema.ts` provides the local compatibility projection.
507
+ 3. Manifest props, structures, bindings, initial values and rules, executed by the shared compiler.
508
+ 4. Generic kernel write constraints when existing public rules cannot express a new value or state.
509
+ 5. Implementations registered through the public React SDK. Default views live in `src/components/`.
510
+ 6. Budgets in `src/contracts/limits.ts` (if new computation or collections are introduced).
511
+ 7. Styles, tests, examples, syntax documentation, integration documentation and conformance data.
512
+
513
+ Components that reuse public rules need a definition, implementation and registration. New kernel primitives also require a public contract and acceptance cases.
514
+
515
+ ### CP-CORE-05 Extension interface boundary (boundary)
516
+
517
+ This revision describes contribution requirements and the legacy host interface in section 14. `LOCAL_COMPONENTS` is an internal compatibility projection of the default preset. `hostComponents` accepts plain schema data for one compilation and adapts it to the shared kernel, with implementations supplied by the host.
518
+
519
+ The source tree's [extension SDK](../integration/extension-sdk-en.md) has shipped since `reactive-md@0.8.0` and uses a separate `reactive-md-component/v1` data contract and instance configuration for registration validation, React implementations, editor catalogs, offline builds, versioned restoration and public compliance tools. All 49 default rendered and structural components use this contract. Hosts explicitly install component code; document declarations never load it.
520
+
521
+ ## 10. Compatibility, name governance, revisions and migration
522
+
523
+ ### CP-COMPAT-01 Change classification (required)
524
+
525
+ | Category | Example | Handling |
526
+ | --- | --- | --- |
527
+ | Capability addition | New component; new optional attribute on an existing component whose default preserves existing valid forms | Author-visible syntax additions still establish a new syntax revision, raise the package minor version and add acceptance and migration notes |
528
+ | Breaking change | Removing or renaming a component; changing shape, required attributes, defaults, structure rules or binding family; changing initial-value rules; lowering an existing budget; changing compile results or public values of existing documents | Requires a new syntax revision, migration notes and old/new examples |
529
+ | Implementation or editorial change | Adjusting diagnostic message, internal class names, DOM structure, `node.id` or performance implementation while keeping existing semantics, accessibility and resource boundaries | Usually does not raise the syntax or protocol revision; public API changes follow compatibility rules separately |
530
+
531
+ Adding a tag makes previously inert regions with that name start executing in old implementations, so it cannot promise that all old sources keep their old behavior. Migration notes must cover this change. Adding or adjusting diagnostic codes also changes the `codes` in machine data, requiring synchronized acceptance and changelog updates; cross-version promises for diagnostic codes continue to follow the compatibility notes.
532
+
533
+ ### CP-COMPAT-02 Syntax revisions (existing)
534
+
535
+ Author-visible syntax changes establish a new syntax revision, such as `local-draft-2`, raising the package minor version and updating `LOCAL_SYNTAX_VERSION` at the same time. The project does not rewrite sources automatically; after upgrading, authors or hosts migrate according to the changelog. One package version accepts only one syntax revision.
536
+
537
+ ### CP-COMPAT-03 Protocol revisions (required)
538
+
539
+ The following changes raise the protocol revision, for example from `component-protocol-1` to `component-protocol-2`:
540
+
541
+ - Changing MUST or MUST NOT clauses.
542
+ - Adding required component declaration information or acceptance gates.
543
+ - Changing root fields, required fields or comparison semantics of machine conformance data.
544
+ - Changing compatibility classification rules or name governance rules.
545
+
546
+ Editorial changes do not raise the protocol revision. Protocol revisions can ship independently of syntax revisions but must state the applicable syntax and package version in the documentation.
547
+
548
+ ### CP-COMPAT-04 Name governance (required)
549
+
550
+ - New names must be lowercase kebab-case, semantically clear, and avoid conflicts with the existing 52 names.
551
+ - Do not use HTML names such as `script`, `style`, `div`, `span` or `a`, and do not use `on-*`, `class` or `style` as author attributes.
552
+ - Within `component-protocol-1`, the existing 48 names are reserved for existing semantics; reusing a name is a breaking change.
553
+ - No implicit aliases. An alias needs its own name, documentation and acceptance evidence.
554
+ - Structural child names and parent constraints are governed together; do not change only the parent component.
555
+
556
+ ### CP-COMPAT-05 Migration (required)
557
+
558
+ - Components that already conform to this protocol keep their existing semantics after a protocol revision; new MUST clauses apply to new or changed components by default.
559
+ - If a new requirement applies retroactively to existing components, it must be handled as a breaking change with migration notes, old/new behavior comparisons and acceptance updates.
560
+ - Breaking changes must not quietly change author syntax without a new syntax revision.
561
+ - Migration notes are for users and contributors and include at least the old form, new form, affected scope and verification method.
562
+
563
+ ### CP-COMPAT-06 Persistable content (existing)
564
+
565
+ Persist only the original `.reactive.md` source and the syntax revision used. `LocalDocument`, `LocalNode`, `node.id`, `initialState`, `LocalSnapshot` and runtime parameter state are current runtime objects, and their structure or field meanings are not guaranteed across versions. Diagnostic line numbers, columns and offsets locate the current source and are not persistence identifiers.
566
+
567
+ ## 11. Acceptance matrix
568
+
569
+ ### CP-ACCEPT-01 Acceptance surfaces (required)
570
+
571
+ | Acceptance surface | Evidence | Pass condition | Related clauses |
572
+ | --- | --- | --- | --- |
573
+ | Tag shape and structure | Parser/compiler tests, machine cases | Valid documents pass; mismatches, missing children and wrong parents fail | CP-SYNTAX-01 to 08 |
574
+ | Attributes and expressions | Compiler tests, machine cases | Static/dynamic, types, empty interpolation and unknown attributes diagnosed per clause | CP-SYNTAX-03, 04 |
575
+ | Bindings and initial values | Runtime tests, machine cases | Shared constraints, defaults and explicit initial validation agree | CP-STATE-01 to 05 |
576
+ | Writes and atomicity | Runtime tests, machine cases | State unchanged on rejection; one commit on acceptance; shared controls agree | CP-STATE-06 |
577
+ | Drafts and reset | Renderer/runtime tests, machine cases | Drafts never enter public values; reset commits once and restores the subtree | CP-STATE-07, 08 |
578
+ | Visibility and lifecycle | Runtime/renderer tests, machine cases | Hiding preserves state; timing pauses; instances isolated; disposal cleans up | CP-VIS-01, 02, CP-LIFE-01 to 03 |
579
+ | Fallback and error isolation | Compiler/renderer tests, machine cases | Complete unknown tags fall back inertly; local errors do not affect other content | CP-DIAG-02 to 05 |
580
+ | Visualization | Renderer tests, machine cases, manual checks | plot/chart/table/diagram/timeline semantics and budgets correct | CP-STATE-12, CP-SEC-03 |
581
+ | Accessibility | Manual browser checks, some automated checks | Names, roles, states, keyboard, focus and 375px usability | CP-A11Y-01 to 03 |
582
+ | Security and budgets | Security tests, budget tests, machine cases | No script/network entry points; over-limit rejected while keeping valid state | CP-SEC-01 to 04 |
583
+ | Core and renderer separation | Build, package checks, Node consumption tests | Core independent of React; React entry installable separately | CP-CORE-01, 02 |
584
+ | Documentation and links | `npm run test:docs` | Relative links and heading anchors valid | CP-SCOPE-02 |
585
+ | Machine data format | Conformance runner | Root fields, unique ids, required fields and exact codes pass | CP-ACCEPT-02 |
586
+
587
+ ### CP-ACCEPT-02 Machine conformance data (required)
588
+
589
+ The root object of a machine conformance set contains only `protocolVersion`, `syntaxVersion` and a non-empty `cases` array. The frozen author-component set `examples/conformance/component-protocol-1.json` remains `component-protocol-1` / `local-draft-2`. The current portable syntax set is `examples/conformance/local-draft-4.json`; both are checked for their declared revisions. The package version is identified by `package.json` and is not inferred from these fields.
590
+
591
+ Each case contains at least a unique string `id`, component name `component`, source `source`, boolean `ok` and a deduplicated diagnostic code set `codes`. Optional fields `initial`, `bindingNames`, `actions`, `reset`, `text`, `expectedText`, `htmlIncludes` and `htmlExcludes` follow the [language conformance data notes](../../examples/conformance/README.md) and the JSON Schema shipped with the repository. The full format follows that document and the Schema; this protocol defines only the semantic gates.
592
+
593
+ The runner must:
594
+
595
+ - Check `protocolVersion` and `syntaxVersion` exactly.
596
+ - Validate unique ids, required fields and `codes` as a duplicate-free set of strings; invalid data fails directly instead of being skipped silently.
597
+ - Run `actions` in order and check whether each write is accepted; `reset` runs after actions, looks up the compiled node by component name and 0-based `index`, and calls `runtime.reset`.
598
+ - Evaluate `text` and `expectedText` after `actions`/`reset`, and check SSR HTML includes/excludes in the final state.
599
+ - Call `dispose()` for every runtime in a `finally` block.
600
+ - For cases with failed compilation, check only `ok` and `codes`, with no success state, actions or rendering expectations.
601
+
602
+ `initial` and `reset.expectedState` use partial matching; `bindingNames` checks the complete public binding name set; `text` and `expectedText` must appear in pairs.
603
+
604
+ The frozen author-component set covers representative `slider`, `tabs` and `plot` cases and at least one complete unknown-tag fallback case. It remains a representative gate, not full certification of the 52 tag names; host components have no portable machine cases.
605
+
606
+ ### CP-ACCEPT-03 Component-level evidence (required)
607
+
608
+ New or changed components must provide evidence commensurate with the size of their declaration:
609
+
610
+ - At least one successful compilation case and one failure case covering new attributes, structure or binding constraints.
611
+ - If a public value is introduced, at least one initialization case and one rejected-write case.
612
+ - If internal state is introduced, at least one reset or hiding-preserves-state case.
613
+ - If computation or collections are introduced, at least one budget boundary case.
614
+ - If a visualization is introduced, at least one rendering or SSR evidence item, plus a list of manual browser checks.
615
+ - If existing semantics change, old/new behavior comparisons and migration evidence.
616
+
617
+ ### CP-ACCEPT-04 Manual browser checks (required)
618
+
619
+ Component contributions involving the following behavior must provide real browser evidence. Existing automated browser checks may cover corresponding actions; items not yet covered, such as screen reader experience, require manual checks. The machine data in section 11.2 cannot replace this evidence:
620
+
621
+ - Real keyboard operations, focus order and moving focus out of hidden content.
622
+ - Chinese IME composition and blur validation.
623
+ - 375px narrow-screen layout, horizontal overflow and touch targets.
624
+ - Timer start, pause, resume and behavior after switching to the background.
625
+ - Screen reader names and dynamic state announcements.
626
+ - Dark theme, theme variable overrides and style isolation.
627
+
628
+ Local browser verification has used Microsoft Edge (Chromium-based); Linux CI uses Playwright Chromium. Firefox, Safari/WebKit and general SSR hydration outside the single-file export are unverified.
629
+
630
+ ### CP-ACCEPT-05 Command gate and exemptions (required)
631
+
632
+ The protocol sample gate uses `npm run test:components`, which runs `examples/conformance/component-protocol-1.json` and language conformance; it does not replace full tests, builds, documentation checks or manual browser checks. See the [contributing guide](../../CONTRIBUTING.md) and the [component development guide](component-development-en.md) for the full check commands.
633
+
634
+ Only SHOULD clauses can be exempted; exemptions must record the rationale, alternative evidence and impact in the proposal. MUST clauses cannot be exempted and can only be changed through a protocol revision.
635
+
636
+ ## 12. Current implementation map
637
+
638
+ ### CP-IMPL-01 Code locations (existing)
639
+
640
+ | Contract surface | Main location | Notes |
641
+ | --- | --- | --- |
642
+ | Tag lexing and shapes | `src/local/parsing/parser.ts` | `VOID`, `PAIRED`, `INLINE`, unknown-tag fallback, footnote shielding |
643
+ | Component declarations | `src/presets/default-semantics.ts`, `src/assemblies/default-schema.ts` | Default manifests and their local compatibility projection |
644
+ | Compile validation | `src/local/compilation/compiler.ts` | Structure, attributes, initial values, shared constraints, expressions, table and plot budgets |
645
+ | Runtime | `src/local/runtime/runtime.ts` | `get`, `set`, `evaluate`, `text`, `reset`, `resetToken`, `dispose` |
646
+ | React reference adapter | `src/react/rendering/document/LocalDocumentView.tsx` | Document container, controls, layout, accessible names, reset and lifecycle |
647
+ | Visualization adapter | `src/react/rendering/visuals.tsx`, `src/local/evaluation/math/latex.ts`, `src/react/rendering/math-view.tsx` | Tables, charts, plots, timelines, diagrams and math rendering |
648
+ | Styles | `src/styles/index.css`, `src/themes/default/`, component CSS under `src/components/`, `src/react/rendering/document/local.css` | Public entry, complete defaults and component styles |
649
+ | Budgets | `src/contracts/limits.ts` | Shared resource limits |
650
+ | Versions | `src/local/types.ts`, `package.json` | Syntax revision and package version |
651
+ | Acceptance | `tests/`, `examples/conformance/` | Language tests and machine conformance data |
652
+ | Documentation | `docs/`, `README.md`, `CONTRIBUTING.md`, `SECURITY.md` | Syntax, integration, compatibility, security and contribution rules |
653
+
654
+ ### CP-IMPL-02 Current coverage (existing / boundary)
655
+
656
+ The current implementation covers parsing, declarations, compilation, runtime, React rendering, resource budgets and release checks. Real keyboard input, IME, 375px layout and timer pause require corresponding automated browser checks or manual checks; general SSR hydration outside the single-file export is unverified. The machine data of `component-protocol-1` is a representative gate, not certification of all 52 tag names.
657
+
658
+ ### CP-IMPL-03 Extension interfaces (boundary)
659
+
660
+ Section 14 retains the legacy schema and renderer interfaces. New components use the [extension SDK](../integration/extension-sdk-en.md) manifest, instance configuration and adapters. The SDK protocol, component versions, theme protocol, restoration payload and `local-draft-4` syntax revision are managed separately.
661
+
662
+ Use `reactive-md/testing` for manifest and binding checks, and `testing/react` and `testing/browser` for rendering and lifecycle evidence. Components must meet this protocol's budget, accessibility and behavior requirements. Hosts install implementations explicitly and control their code permissions; SDK contract and resource validation does not sandbox third-party code.
663
+
664
+ ## 13. New component proposal template
665
+
666
+ The tables below are for review. See the [component development guide](component-development-en.md) for the complete process, copyable proposal template and check commands.
667
+
668
+ ### 13.1 Basic information
669
+
670
+ | Item | Content |
671
+ | --- | --- |
672
+ | Component name | `<name>` (lowercase kebab-case) |
673
+ | Protocol revision | `component-protocol-3` |
674
+ | Purpose | What problem it solves and how readers use it |
675
+ | Non-goals | Capabilities this component does not take on |
676
+ | Version impact | Package version, syntax revision, protocol revision |
677
+ | Name and shape | Name, leaf/inline/container, parent, child rules |
678
+ | Syntax example | Minimal runnable source |
679
+ | Binding | Public value type, family, exclusivity, initial-value rule, sharing conditions |
680
+ | Children and structure | Allowed direct children and structural constraints |
681
+ | State and reset | Public state, internal state, panel reset behavior |
682
+ | Visibility and disposal | Conditional hiding, tab switching, timers and unmount behavior |
683
+ | Diagnostics and fallback | Structure, attribute, initial-value and runtime errors, unknown-tag fallback |
684
+ | Security and budgets | Budgets for new input, loops, recursion, computation or collections |
685
+ | Accessibility | Accessible name, role, state, keyboard and focus |
686
+ | Narrow screens and styles | 375px behavior, theme variables, style files and screenshots |
687
+ | Compatibility classification | Capability addition, breaking change or implementation/editorial change |
688
+ | Migration | Old form, new form, affected scope and verification method |
689
+ | Acceptance evidence | Automated tests, machine data, SSR/manual checks |
690
+ | Changed files | Parser, declaration table, compiler, runtime, renderer, styles, tests, documentation |
691
+ | Clause checklist | Applicable CP-* clauses and evidence listed one by one |
692
+
693
+ ### 13.2 Attribute table
694
+
695
+ | Attribute | Type | Static/dynamic | Required | Default | Constraints | Failure diagnostics |
696
+ | --- | --- | --- | --- | --- | --- | --- |
697
+ | `name` | string/number/boolean/enum | static/dynamic | yes/no | value | range, enum, length | expected code |
698
+ | ... | | | | | | |
699
+
700
+ ### 13.3 Binding table
701
+
702
+ | Public value | family | Exclusive | Initial-value rule | Sharing conditions | Reset behavior |
703
+ | --- | --- | --- | --- | --- | --- |
704
+ | `bindName` | text/number/boolean/date/choice/timer/checklist/tabs/diagram | yes/no | rule | same family, matching range/step/options | restore initial value and trigger reset token |
705
+
706
+ ### 13.4 Clause checklist
707
+
708
+ | Clause | Evidence | Conclusion |
709
+ | --- | --- | --- |
710
+ | CP-SYNTAX-01 to 08 | Parser/compiler tests, syntax documentation | Pass/outstanding |
711
+ | CP-STATE-01 to 09 | Runtime tests, machine data | Pass/outstanding |
712
+ | CP-DIAG-01 to 05 | Failure cases, fallback cases | Pass/outstanding |
713
+ | CP-A11Y-01 to 03 | Manual browser records | Pass/outstanding |
714
+ | CP-STYLE-01 to 03 | Style files, narrow-screen screenshots | Pass/outstanding |
715
+ | CP-VIS-01, 02, CP-LIFE-01 to 03 | Hiding/reset/disposal cases | Pass/outstanding |
716
+ | CP-SEC-01 to 04 | Security tests, budget cases | Pass/outstanding |
717
+ | CP-CORE-01, 02, 04 | Build, Node consumption, rendering tests | Pass/outstanding |
718
+ | CP-COMPAT-01 to 05 | Compatibility notes, migration examples | Pass/outstanding |
719
+ | CP-ACCEPT-01 to 05 | Acceptance matrix and command results | Pass/outstanding |
720
+
721
+ ## 14. Host component extension axis
722
+
723
+ ### CP-HOST-01 Host components are opt-in (existing)
724
+
725
+ `compileLocal(source, { hostComponents })` adds a host-owned extension axis to the compiler. Without the `hostComponents` option, author behavior is unchanged: the 48 author tag names parse as before, and a tag outside that set remains unknown and falls back to source under CP-DIAG-03. The option changes only which tag names the compiler recognizes for that call; it does not add author syntax. The syntax revision remains `local-draft-2`; the protocol revision becomes `component-protocol-2`.
726
+
727
+ ### CP-HOST-02 Host schemas are plain data (required)
728
+
729
+ `LocalHostComponentSchema` is plain, structured-clone-safe data supplied by the host. It contains no functions, class instances or runtime handles.
730
+
731
+ | Field | Content |
732
+ | --- | --- |
733
+ | `name` | Lowercase kebab-case, unique within the set, not one of the 48 author tag names, a P0 HTML tag name or the theme declaration name |
734
+ | `form` | `'leaf'`, `'inline'` or `'container'`; inline and container bodies are compiled as normal Markdown and may contain components, unless `body` selects raw delivery |
735
+ | `props` | A table of host properties; property names use lowercase kebab-case |
736
+ | `body` | Optional container body delivery: `'markdown'` (the default) or `'raw'`. `'raw'` lowers to the internal `raw-body` structure rule under CP-MODEL-05; other forms are rejected |
737
+ | `binding` | Optional scalar binding (`string`, `number`, `boolean`) with static `min`, `max`, `step`, `options`, `initialRule` and `exclusive`; the component then accepts `bind`, `initial` and dynamic `disabled` implicitly |
738
+
739
+ One compilation accepts at most 32 host component schemas. Each property declares `kind` (`string`, `number`, `boolean` or `enum`), `required`, `static`, `enum` and `pattern`. A host binding shares the built-in families; when its name matches a built-in control, family and static constraints must agree. `enum` applies to `enum` properties, and `pattern` applies to `string` properties. P0 HTML tag names are reserved because the parser handles them before component tags. `pattern` is restricted to a linear-time-safe subset: backreferences, lookarounds, named groups, nested quantifiers and quantified alternation are rejected. Invalid schemas are rejected with a `local.options.invalid` diagnostic; compilation fails and no host component from that set is partially registered.
740
+
741
+ ### CP-HOST-03 Host components are not author syntax (boundary)
742
+
743
+ Host components are not part of `local-draft-2` and cannot be used as portable author syntax. A document that uses them is portable only with a host that registers the same names and compatible schemas; a plain reader treats each name as an unknown component and applies the existing fallback in CP-DIAG-03. Authors cannot rely on host components being present, so documents intended to be portable must not use them.
744
+
745
+ ### CP-HOST-04 Attribute validation and budget (required)
746
+
747
+ The compiler validates every host attribute against the registered schema: required properties must be present, `enum` values must belong to the declared set, `pattern` must match literal string values, literal values must match the declared `kind`, and a property declared `static` rejects `{{ ... }}`. For a property with a `pattern`, a non-static value may be exactly one full interpolation in place of the literal; mixed literal text with interpolation is rejected. Other string properties may mix literals and interpolations. Failures produce a `local.host.attribute` diagnostic at the attribute location.
748
+
749
+ A valid host node counts as exactly one syntax node in the existing syntax-node budget; its attributes, props and leaf form add no further nodes and do not change other budget accounting.
750
+
751
+ ### CP-HOST-05 React dispatch and host-owned data (required)
752
+
753
+ The React view dispatches a `hostComponent` node to `hostRenderer(node, data, ctx)`. `data` is read from `hostData`, JSON-safe host data indexed by `${kind}:${ref}` from the node attributes; components without those attributes (binding-only, inline or container shapes) do not require host data. `ctx` provides `value`, a validating `setValue`, `disabled`, `resetToken`, resolved `props`, `report` and `render`; `ctx.render()` with no arguments renders a container's parsed children. Both props stay on the host/React side: the renderer function never enters a worker, and `hostData` never enters the worker either, because compilation needs only the schemas.
754
+
755
+ A missing renderer, a missing `${kind}:${ref}` key or a renderer that throws renders a visible diagnostic placeholder. It must not throw out of the document or blank the rest of the content. `mode === 'static'` goes through the same dispatch, so static rendering shows the same placeholder when the host has not supplied a renderer or data.
756
+
757
+ Portable machine cases remain `examples/conformance/component-protocol-1.json`, frozen as the baseline for the 48 author components. Host components get no portable conformance cases, because rendering is host-owned and a plain reader only sees the unknown-component fallback.
758
+
759
+ ## 15. Revision history
760
+
761
+ | Revision | Date | Notes |
762
+ | --- | --- | --- |
763
+ | `component-protocol-3` | 2026-10-29 | Host components gain inline/container forms and scalar bindings; `local-draft-3` adds `<external>` and dynamic constraints. |
764
+ | `component-protocol-2` | 2026-10-25 | Added the host component extension axis; author syntax remains `local-draft-2`. |
765
+ | `component-protocol-1` | 2026-10-23 | Initial version; originally applied to `local-draft-1` and package version `0.3.0`, defining component contribution, acceptance and extension boundaries. It now applies to `local-draft-2` and the `0.4.0` preview release without changing its MUST clauses or machine format. |
766
+
767
+ `raw-body` containers (CP-MODEL-05) were added after `component-protocol-3` without raising the revision. The declaration is additive SDK and host data, an unknown structure rule is rejected rather than misread, no default component uses it, and the manifest protocol remains `reactive-md-component/v1` (`src/sdk/version.ts`).
768
+
769
+
770
+ See the [syntax specification](../reference/local-interaction-syntax-en.md) for tags, colors, slot state and selection rules, and [Versions and compatibility](../compatibility/compatibility-en.md) for version mapping and migration guidance.