reactive-md 0.6.1 → 0.8.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 (471) hide show
  1. package/CHANGELOG-ch.md +66 -0
  2. package/CHANGELOG.md +66 -0
  3. package/CONTRIBUTING-ch.md +6 -62
  4. package/CONTRIBUTING.md +5 -63
  5. package/README-ch.md +232 -67
  6. package/README-en.md +209 -71
  7. package/README.md +209 -71
  8. package/SECURITY-ch.md +3 -1
  9. package/SECURITY.md +3 -1
  10. package/THIRD_PARTY_NOTICES.md +1909 -87
  11. package/cli/args.mjs +33 -1
  12. package/cli/build.mjs +62 -1
  13. package/cli/check.mjs +444 -0
  14. package/cli/help.mjs +181 -3
  15. package/cli/init.mjs +1577 -0
  16. package/cli/main.mjs +11 -1
  17. package/cli/package-loader.mjs +41 -0
  18. package/dist-library/LocalDocumentView-6trX7xJc.js +97920 -0
  19. package/dist-library/{authoring-BEVyth5X.js → authoring-BsfSwQRm.js} +237 -209
  20. package/dist-library/compiler--ea2CKQF.js +61 -0
  21. package/dist-library/compiler-core-kPiH-gOV.js +11805 -0
  22. package/dist-library/component-state-Cq2K5gkS.js +490 -0
  23. package/dist-library/component-state-D_cw_EHe.js +54 -0
  24. package/dist-library/config-validation-DXTynAw7.js +3005 -0
  25. package/dist-library/default-components-Z_YMio5P.js +2346 -0
  26. package/dist-library/identity-MYJXKSkB.js +1443 -0
  27. package/dist-library/math-display-BJz4gbFc.js +24000 -0
  28. package/dist-library/math-sample-BGEW49zY.js +1124 -0
  29. package/dist-library/options-CX5m5n-J.js +115 -0
  30. package/dist-library/parser-standard-DlCk7sLo.js +10122 -0
  31. package/dist-library/props-DGlBk0e5.js +183 -0
  32. package/dist-library/react-ByOHunUW.js +122 -0
  33. package/dist-library/reactive-md-authoring.js +712 -1077
  34. package/dist-library/reactive-md-build.js +7966 -0
  35. package/dist-library/reactive-md-compiler-standard.js +33 -0
  36. package/dist-library/reactive-md-compiler.js +22 -0
  37. package/dist-library/reactive-md-default-packs.js +71 -0
  38. package/dist-library/reactive-md-default-preset.js +10 -0
  39. package/dist-library/reactive-md-export.js +111 -0
  40. package/dist-library/reactive-md-print.css +18 -3
  41. package/dist-library/reactive-md-react-runtime.js +251 -0
  42. package/dist-library/reactive-md-react-server.js +55 -0
  43. package/dist-library/reactive-md-react-unstyled.js +9 -1
  44. package/dist-library/reactive-md-react.js +9 -1
  45. package/dist-library/reactive-md-runtime-browser.js +51 -0
  46. package/dist-library/reactive-md-runtime.js +3 -0
  47. package/dist-library/reactive-md-sdk.js +6 -0
  48. package/dist-library/reactive-md-standalone-host.js +442 -0
  49. package/dist-library/reactive-md-testing-browser.js +523 -0
  50. package/dist-library/reactive-md-testing-react.js +221 -0
  51. package/dist-library/reactive-md-testing.js +638 -0
  52. package/dist-library/reactive-md-vite.js +959 -0
  53. package/dist-library/reactive-md.css +1 -1
  54. package/dist-library/reactive-md.js +1080 -795
  55. package/dist-library/registry-B9Jc3FVe.js +1174 -0
  56. package/dist-library/resources-BGt8mpDA.js +204 -0
  57. package/dist-library/runtime-C-sbfpOX.js +1157 -0
  58. package/dist-library/runtime-Dkq7ldyg.js +172 -0
  59. package/dist-library/schema-ZFufO8V0.js +39 -0
  60. package/dist-library/shareable-DDVL4Fi9.js +844 -0
  61. package/dist-library/types/authoring/catalog.d.ts +168 -0
  62. package/dist-library/types/authoring/conformance.d.ts +24 -0
  63. package/dist-library/types/{editor → authoring}/editor-i18n.d.ts +3 -24
  64. package/dist-library/types/authoring/extensions.d.ts +13 -0
  65. package/dist-library/types/authoring/index.d.ts +14 -11
  66. package/dist-library/types/authoring/insert.d.ts +16 -0
  67. package/dist-library/types/{editor → authoring}/native-components.d.ts +19 -2
  68. package/dist-library/types/authoring/templates.d.ts +65 -0
  69. package/dist-library/types/build/diagnostics.d.ts +8 -0
  70. package/dist-library/types/build/digest.d.ts +5 -0
  71. package/dist-library/types/build/entry.d.ts +9 -0
  72. package/dist-library/types/build/host.d.ts +36 -0
  73. package/dist-library/types/build/index.d.ts +99 -0
  74. package/dist-library/types/build/notices.d.ts +29 -0
  75. package/dist-library/types/build/resources.d.ts +60 -0
  76. package/dist-library/types/build/vite.d.ts +15 -0
  77. package/dist-library/types/compiler/index.d.ts +22 -0
  78. package/dist-library/types/compiler/result.d.ts +30 -0
  79. package/dist-library/types/compiler/standard.d.ts +16 -0
  80. package/dist-library/types/compiler/types.d.ts +69 -0
  81. package/dist-library/types/components/chart-motion.d.ts +12 -0
  82. package/dist-library/types/components/controls.d.ts +21 -0
  83. package/dist-library/types/{local → components}/data-table.d.ts +10 -24
  84. package/dist-library/types/components/default-chart-types.d.ts +22 -0
  85. package/dist-library/types/components/default-chart.d.ts +2 -0
  86. package/dist-library/types/components/default-preset.d.ts +10 -0
  87. package/dist-library/types/components/diagram-inspector.d.ts +24 -0
  88. package/dist-library/types/components/gallery.d.ts +6 -0
  89. package/dist-library/types/components/layout.d.ts +23 -0
  90. package/dist-library/types/components/mafs-plot-grid.d.ts +57 -0
  91. package/dist-library/types/components/mafs-visuals.d.ts +40 -0
  92. package/dist-library/types/components/numeric-sliders.d.ts +3 -0
  93. package/dist-library/types/components/uiarc/calendar/calendar.d.ts +26 -0
  94. package/dist-library/types/components/uiarc/date-picker/date-picker.d.ts +29 -0
  95. package/dist-library/types/components/uiarc/lib/motion-tokens.d.ts +2 -0
  96. package/dist-library/types/components/uiarc/lib/use-today.d.ts +2 -0
  97. package/dist-library/types/components/uiarc/motion-tokens.d.ts +60 -0
  98. package/dist-library/types/components/uiarc/rmd-motion.d.ts +12 -0
  99. package/dist-library/types/components/uiarc/select/select.d.ts +21 -0
  100. package/dist-library/types/components/uiarc/slider/slider.d.ts +53 -0
  101. package/dist-library/types/components/use-hydrated.d.ts +6 -0
  102. package/dist-library/types/components/visuals.d.ts +13 -0
  103. package/dist-library/types/export/component-state.d.ts +39 -0
  104. package/dist-library/types/export/index.d.ts +47 -0
  105. package/dist-library/types/export/requirements.d.ts +23 -0
  106. package/dist-library/types/export/resources.d.ts +8 -0
  107. package/dist-library/types/export/restoration.d.ts +52 -0
  108. package/dist-library/types/index.d.ts +1 -0
  109. package/dist-library/types/local/compilation/compiler-core.d.ts +16 -0
  110. package/dist-library/types/local/compilation/compiler-services.d.ts +64 -0
  111. package/dist-library/types/local/compilation/compiler-structure.d.ts +46 -0
  112. package/dist-library/types/local/compilation/compiler-values.d.ts +9 -0
  113. package/dist-library/types/local/compilation/compiler.d.ts +34 -0
  114. package/dist-library/types/local/compilation/component-kernel.d.ts +487 -0
  115. package/dist-library/types/local/{dependencies.d.ts → compilation/dependencies.d.ts} +4 -3
  116. package/dist-library/types/local/{diagnostics.d.ts → configuration/diagnostic-messages.d.ts} +193 -65
  117. package/dist-library/types/local/configuration/diagnostics.d.ts +58 -0
  118. package/dist-library/types/local/{limits.d.ts → configuration/limits.d.ts} +15 -2
  119. package/dist-library/types/local/configuration/options-core.d.ts +120 -0
  120. package/dist-library/types/local/configuration/options.d.ts +17 -0
  121. package/dist-library/types/local/configuration/portable-options.d.ts +3 -0
  122. package/dist-library/types/local/configuration/schema-core.d.ts +32 -0
  123. package/dist-library/types/local/configuration/schema.d.ts +12 -0
  124. package/dist-library/types/local/contracts/types.d.ts +519 -0
  125. package/dist-library/types/local/{version.d.ts → contracts/version.d.ts} +1 -1
  126. package/dist-library/types/local/{computations.d.ts → evaluation/computations.d.ts} +6 -3
  127. package/dist-library/types/local/{expression.d.ts → evaluation/expression.d.ts} +2 -2
  128. package/dist-library/types/local/{math-display.d.ts → evaluation/math-display.d.ts} +2 -16
  129. package/dist-library/types/local/evaluation/math-sample.d.ts +23 -0
  130. package/dist-library/types/local/evaluation/math.d.ts +73 -0
  131. package/dist-library/types/local/{validation.d.ts → evaluation/validation.d.ts} +1 -1
  132. package/dist-library/types/local/html/html-details.d.ts +16 -0
  133. package/dist-library/types/local/html/html-entities.d.ts +7 -0
  134. package/dist-library/types/local/html/html-policy.d.ts +43 -0
  135. package/dist-library/types/local/html/html-recovery.d.ts +16 -0
  136. package/dist-library/types/local/html/html-table-names.d.ts +9 -0
  137. package/dist-library/types/local/{html-table.d.ts → html/html-table.d.ts} +2 -6
  138. package/dist-library/types/local/{html.d.ts → html/html.d.ts} +1 -1
  139. package/dist-library/types/local/index.d.ts +31 -24
  140. package/dist-library/types/local/markdown/fast-markdown.d.ts +137 -0
  141. package/dist-library/types/local/{footnotes.d.ts → markdown/footnotes.d.ts} +1 -1
  142. package/dist-library/types/local/{heading-anchors.d.ts → markdown/heading-anchors.d.ts} +12 -2
  143. package/dist-library/types/local/markdown/markdown-blocks.d.ts +55 -0
  144. package/dist-library/types/local/markdown/markdown-structure.d.ts +3 -0
  145. package/dist-library/types/local/markdown/plain-paragraphs.d.ts +10 -0
  146. package/dist-library/types/local/parsing/lexical.d.ts +21 -0
  147. package/dist-library/types/local/parsing/parse-budget.d.ts +67 -0
  148. package/dist-library/types/local/parsing/parser-capabilities.d.ts +42 -0
  149. package/dist-library/types/local/parsing/parser-core.d.ts +65 -0
  150. package/dist-library/types/local/parsing/parser-standard.d.ts +7 -0
  151. package/dist-library/types/local/parsing/parser.d.ts +16 -0
  152. package/dist-library/types/local/parsing/rmd-recovery.d.ts +48 -0
  153. package/dist-library/types/local/{LocalDocumentView.d.ts → rendering/LocalDocumentView.d.ts} +67 -24
  154. package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +36 -0
  155. package/dist-library/types/local/rendering/render-types.d.ts +57 -0
  156. package/dist-library/types/local/rendering/view-revision.d.ts +75 -0
  157. package/dist-library/types/local/{retention.d.ts → runtime/retention.d.ts} +1 -1
  158. package/dist-library/types/local/runtime/runtime.d.ts +34 -0
  159. package/dist-library/types/local/{state.d.ts → runtime/state.d.ts} +4 -4
  160. package/dist-library/types/local/session/compiler-cache.d.ts +44 -0
  161. package/dist-library/types/local/session/incremental.d.ts +48 -0
  162. package/dist-library/types/local/session/parse-session.d.ts +62 -0
  163. package/dist-library/types/local/session/row-reuse.d.ts +46 -0
  164. package/dist-library/types/local/{authoring.d.ts → source/authoring.d.ts} +11 -3
  165. package/dist-library/types/local/source/node-walk.d.ts +3 -0
  166. package/dist-library/types/local/source/source-context.d.ts +63 -0
  167. package/dist-library/types/local/{source-migration.d.ts → source/source-migration.d.ts} +2 -2
  168. package/dist-library/types/local/{i18n.d.ts → theme/i18n.d.ts} +2 -2
  169. package/dist-library/types/local/theme/theme-name.d.ts +3 -0
  170. package/dist-library/types/local/{theme.d.ts → theme/theme.d.ts} +3 -3
  171. package/dist-library/types/local/transport/compile-patch.d.ts +127 -0
  172. package/dist-library/types/local/{compiled-data.d.ts → transport/compiled-data.d.ts} +1 -1
  173. package/dist-library/types/local/transport/flat-compiled-data.d.ts +17 -0
  174. package/dist-library/types/local/transport/shared-data.d.ts +10 -0
  175. package/dist-library/types/local/transport/worker.d.ts +265 -0
  176. package/dist-library/types/local/widgets/visuals.d.ts +25 -0
  177. package/dist-library/types/presets/default-authoring.d.ts +50 -0
  178. package/dist-library/types/presets/default-components.d.ts +4 -0
  179. package/dist-library/types/presets/default-semantics.d.ts +8 -0
  180. package/dist-library/types/presets/default.d.ts +11 -0
  181. package/dist-library/types/presets/identity.d.ts +7 -0
  182. package/dist-library/types/presets/packs.d.ts +4 -0
  183. package/dist-library/types/react/component-api.d.ts +260 -0
  184. package/dist-library/types/react/component-primitives.d.ts +21 -0
  185. package/dist-library/types/react/component-utils.d.ts +125 -0
  186. package/dist-library/types/react/default-theme.d.ts +6 -0
  187. package/dist-library/types/react/field-validation.d.ts +11 -0
  188. package/dist-library/types/react/index.d.ts +17 -5
  189. package/dist-library/types/react/overflow-text-tooltip.d.ts +6 -0
  190. package/dist-library/types/react/package.d.ts +69 -0
  191. package/dist-library/types/react/runtime/common.d.ts +4 -0
  192. package/dist-library/types/react/runtime/index.d.ts +8 -0
  193. package/dist-library/types/react/runtime/useComponentState.d.ts +30 -0
  194. package/dist-library/types/react/runtime/useKeys.d.ts +16 -0
  195. package/dist-library/types/react/runtime/useSwipe.d.ts +27 -0
  196. package/dist-library/types/react/runtime/useTicker.d.ts +17 -0
  197. package/dist-library/types/react/sdk.d.ts +110 -0
  198. package/dist-library/types/react/server.d.ts +15 -0
  199. package/dist-library/types/react/tooltip-layer.d.ts +10 -0
  200. package/dist-library/types/react/use-draft-field.d.ts +17 -0
  201. package/dist-library/types/runtime-services/browser/index.d.ts +63 -0
  202. package/dist-library/types/runtime-services/component-state.d.ts +152 -0
  203. package/dist-library/types/runtime-services/identity.d.ts +41 -0
  204. package/dist-library/types/runtime-services/index.d.ts +10 -0
  205. package/dist-library/types/runtime-services/random.d.ts +42 -0
  206. package/dist-library/types/runtime-services/runtime.d.ts +51 -0
  207. package/dist-library/types/runtime-services/scheduler.d.ts +44 -0
  208. package/dist-library/types/sdk/assembly.d.ts +73 -0
  209. package/dist-library/types/sdk/compat-profile.d.ts +57 -0
  210. package/dist-library/types/sdk/compiler-config.d.ts +33 -0
  211. package/dist-library/types/sdk/config-validation.d.ts +33 -0
  212. package/dist-library/types/sdk/config.d.ts +35 -0
  213. package/dist-library/types/sdk/hash.d.ts +9 -0
  214. package/dist-library/types/sdk/index.d.ts +10 -0
  215. package/dist-library/types/sdk/manifest.d.ts +49 -0
  216. package/dist-library/types/sdk/pattern.d.ts +11 -0
  217. package/dist-library/types/sdk/preset-core.d.ts +11 -0
  218. package/dist-library/types/sdk/preset.d.ts +9 -0
  219. package/dist-library/types/sdk/props.d.ts +33 -0
  220. package/dist-library/types/sdk/registry-core.d.ts +16 -0
  221. package/dist-library/types/sdk/registry.d.ts +18 -0
  222. package/dist-library/types/sdk/theme.d.ts +73 -0
  223. package/dist-library/types/sdk/types.d.ts +221 -0
  224. package/dist-library/types/sdk/version.d.ts +49 -0
  225. package/dist-library/types/shareable.d.ts +29 -3
  226. package/dist-library/types/standalone/diagnostics.d.ts +16 -0
  227. package/dist-library/types/standalone/events.d.ts +4 -0
  228. package/dist-library/types/standalone/library.d.ts +6 -0
  229. package/dist-library/types/standalone/payload.d.ts +15 -0
  230. package/dist-library/types/standalone/prepare.d.ts +21 -0
  231. package/dist-library/types/standalone/session.d.ts +68 -0
  232. package/dist-library/types/standalone/version.d.ts +7 -0
  233. package/dist-library/types/testing/behavior.d.ts +19 -0
  234. package/dist-library/types/testing/browser.d.ts +126 -0
  235. package/dist-library/types/testing/cases.d.ts +16 -0
  236. package/dist-library/types/testing/index.d.ts +13 -0
  237. package/dist-library/types/testing/manifest.d.ts +10 -0
  238. package/dist-library/types/testing/react.d.ts +45 -0
  239. package/dist-library/types/testing/report.d.ts +20 -0
  240. package/dist-library/types/testing/types.d.ts +125 -0
  241. package/dist-library/types/testing/values.d.ts +22 -0
  242. package/dist-library/types/vite/client.d.ts +36 -0
  243. package/dist-library/types/vite/discovery.d.ts +51 -0
  244. package/dist-library/types/vite/index.d.ts +31 -0
  245. package/dist-library/types/vite/registration.d.ts +109 -0
  246. package/dist-library/types-BFCrMrg0.js +52 -0
  247. package/dist-library/validation-W-bmny-x.js +2253 -0
  248. package/dist-library/values-CIt8AjiU.js +134 -0
  249. package/dist-standalone/reactive-md-standalone.css +1 -1
  250. package/dist-standalone/reactive-md-standalone.js +591 -95
  251. package/docs/README-ch.md +90 -0
  252. package/docs/README.md +87 -81
  253. package/docs/compatibility/compatibility-ch.md +22 -14
  254. package/docs/compatibility/compatibility-en.md +22 -14
  255. package/docs/compatibility/source-versioning-ch.md +15 -12
  256. package/docs/compatibility/source-versioning-en.md +16 -13
  257. package/docs/development/component-development-ch.md +51 -195
  258. package/docs/development/component-development-en.md +51 -195
  259. package/docs/development/component-development-reference-ch.md +253 -0
  260. package/docs/development/component-development-reference-en.md +238 -0
  261. package/docs/development/component-protocol-ch.md +51 -50
  262. package/docs/development/component-protocol-en.md +52 -49
  263. package/docs/development/local-module-layout-ch.md +59 -0
  264. package/docs/development/local-module-layout-en.md +59 -0
  265. package/docs/development/performance-overview-ch.md +402 -0
  266. package/docs/development/performance-overview-en.md +402 -0
  267. package/docs/development/releasing-ch.md +8 -104
  268. package/docs/development/releasing-en.md +8 -104
  269. package/docs/guides/local-guide-ch.md +28 -9
  270. package/docs/guides/local-guide-en.md +31 -12
  271. package/docs/integration/author-tools-ch.md +4 -2
  272. package/docs/integration/author-tools-en.md +4 -2
  273. package/docs/integration/codemirror-ch.md +52 -0
  274. package/docs/integration/codemirror-en.md +29 -0
  275. package/docs/integration/compiler-ch.md +47 -0
  276. package/docs/integration/compiler-en.md +34 -0
  277. package/docs/integration/directory-discovery-ch.md +53 -0
  278. package/docs/integration/directory-discovery-en.md +31 -0
  279. package/docs/integration/editor-ch.md +48 -21
  280. package/docs/integration/editor-en.md +48 -21
  281. package/docs/integration/extension-sdk-ch.md +392 -0
  282. package/docs/integration/extension-sdk-en.md +377 -0
  283. package/docs/integration/local-integration-ch.md +63 -9
  284. package/docs/integration/local-integration-en.md +89 -13
  285. package/docs/integration/repository-split-ch.md +40 -0
  286. package/docs/integration/repository-split-en.md +23 -0
  287. package/docs/integration/shareable-export-ch.md +46 -2
  288. package/docs/integration/shareable-export-en.md +46 -2
  289. package/docs/reference/computations-formatting-ch.md +4 -2
  290. package/docs/reference/computations-formatting-en.md +4 -2
  291. package/docs/reference/constraints-collections-ch.md +21 -1
  292. package/docs/reference/constraints-collections-en.md +21 -1
  293. package/docs/reference/diagnostics-counting-ch.md +1 -1
  294. package/docs/reference/diagnostics-counting-en.md +1 -1
  295. package/docs/reference/html-compatibility-ch.md +4 -0
  296. package/docs/reference/html-compatibility-en.md +4 -0
  297. package/docs/reference/local-components-v2-ch.md +2 -0
  298. package/docs/reference/local-components-v2-en.md +2 -0
  299. package/docs/reference/local-interaction-syntax-ch.md +51 -15
  300. package/docs/reference/local-interaction-syntax-en.md +58 -14
  301. package/docs/reference/theme-protocol-ch.md +79 -7
  302. package/docs/reference/theme-protocol-en.md +79 -7
  303. package/docs/reference/tolerance-ch.md +64 -0
  304. package/docs/reference/tolerance-en.md +57 -0
  305. package/docs/releases/release-0.4.0-ch.md +2 -0
  306. package/docs/releases/release-0.4.0-en.md +2 -0
  307. package/docs/releases/release-0.4.1-ch.md +2 -0
  308. package/docs/releases/release-0.4.1-en.md +2 -0
  309. package/docs/releases/release-0.5.0-ch.md +2 -0
  310. package/docs/releases/release-0.5.0-en.md +2 -0
  311. package/docs/releases/release-0.5.1-ch.md +2 -0
  312. package/docs/releases/release-0.5.1-en.md +2 -0
  313. package/docs/releases/release-0.5.2-ch.md +2 -0
  314. package/docs/releases/release-0.5.2-en.md +2 -0
  315. package/docs/releases/release-0.5.3-ch.md +2 -0
  316. package/docs/releases/release-0.5.3-en.md +2 -0
  317. package/docs/releases/release-0.6.0-ch.md +2 -0
  318. package/docs/releases/release-0.6.0-en.md +2 -0
  319. package/docs/releases/release-0.6.1-ch.md +2 -0
  320. package/docs/releases/release-0.6.1-en.md +2 -0
  321. package/docs/releases/release-0.7.0-ch.md +86 -0
  322. package/docs/releases/release-0.7.0-en.md +86 -0
  323. package/docs/releases/release-0.8.0-ch.md +126 -0
  324. package/docs/releases/release-0.8.0-en.md +126 -0
  325. package/examples/component-package/LICENSE +21 -0
  326. package/examples/component-package/NOTICES.md +12 -0
  327. package/examples/component-package/README-ch.md +101 -0
  328. package/examples/component-package/README.md +133 -0
  329. package/examples/component-package/package.json +35 -0
  330. package/examples/component-package/sample/document.reactive.md +14 -0
  331. package/examples/component-package/scripts/build-export.mjs +44 -0
  332. package/examples/component-package/scripts/build.mjs +130 -0
  333. package/examples/component-package/scripts/verify.mjs +257 -0
  334. package/examples/component-package/src/assets/notice.svg +4 -0
  335. package/examples/component-package/src/component.css +40 -0
  336. package/examples/component-package/src/components.tsx +105 -0
  337. package/examples/component-package/src/harness.tsx +34 -0
  338. package/examples/component-package/src/manifests.ts +71 -0
  339. package/examples/component-package/src/node-entry.ts +18 -0
  340. package/examples/component-package/src/sample.ts +4 -0
  341. package/examples/component-package/src/theme.css +44 -0
  342. package/examples/component-package/src/theme.ts +22 -0
  343. package/examples/component-package/tsconfig.json +15 -0
  344. package/examples/conformance/README-ch.md +55 -0
  345. package/examples/conformance/README.md +2 -0
  346. package/examples/conformance/local-draft-3.json +296 -0
  347. package/examples/game-2048-package/LICENSE +21 -0
  348. package/examples/game-2048-package/NOTICES.md +11 -0
  349. package/examples/game-2048-package/README-ch.md +97 -0
  350. package/examples/game-2048-package/README.md +102 -0
  351. package/examples/game-2048-package/package.json +35 -0
  352. package/examples/game-2048-package/sample/document.reactive.md +17 -0
  353. package/examples/game-2048-package/scripts/build-export.mjs +44 -0
  354. package/examples/game-2048-package/scripts/build.mjs +130 -0
  355. package/examples/game-2048-package/scripts/verify.mjs +180 -0
  356. package/examples/game-2048-package/src/component.css +161 -0
  357. package/examples/game-2048-package/src/components.tsx +326 -0
  358. package/examples/game-2048-package/src/game-engine.ts +228 -0
  359. package/examples/game-2048-package/src/harness.tsx +34 -0
  360. package/examples/game-2048-package/src/manifest.ts +85 -0
  361. package/examples/game-2048-package/src/node-entry.ts +30 -0
  362. package/examples/game-2048-package/src/sample.ts +4 -0
  363. package/examples/game-2048-package/tsconfig.json +15 -0
  364. package/examples/integration/README-ch.md +63 -0
  365. package/examples/integration/README.md +17 -1
  366. package/examples/integration/extension-sdk/README-ch.md +24 -0
  367. package/examples/integration/extension-sdk/README.md +24 -0
  368. package/examples/integration/extension-sdk/advanced-standalone.ts +6 -0
  369. package/examples/integration/extension-sdk/advanced.tsx +101 -0
  370. package/examples/integration/extension-sdk/env.d.ts +2 -0
  371. package/examples/integration/extension-sdk/extensions.tsx +97 -0
  372. package/examples/integration/extension-sdk/index.html +3 -0
  373. package/examples/integration/extension-sdk/main.tsx +10 -0
  374. package/examples/integration/extension-sdk/package.json +6 -0
  375. package/examples/integration/extension-sdk/standalone.ts +7 -0
  376. package/examples/integration/extension-sdk/tsconfig.json +8 -0
  377. package/examples/integration/react-comprehensive/index.html +12 -0
  378. package/examples/integration/react-comprehensive/main.jsx +123 -0
  379. package/examples/integration/react-comprehensive/package.json +18 -0
  380. package/examples/local/README-ch.md +76 -0
  381. package/examples/local/README.md +4 -2
  382. package/examples/local/scenarios/blog-zh.reactive.md +71 -0
  383. package/examples/local/scenarios/blog.reactive.md +71 -0
  384. package/examples/local/scenarios/classroom-zh.reactive.md +97 -0
  385. package/examples/local/scenarios/classroom.reactive.md +97 -0
  386. package/examples/local/scenarios/proposal-zh.reactive.md +79 -0
  387. package/examples/local/scenarios/proposal.reactive.md +79 -0
  388. package/examples/local/scenarios/survey-zh.reactive.md +74 -0
  389. package/examples/local/scenarios/survey.reactive.md +74 -0
  390. package/examples/local/showcase/README-ch.md +22 -0
  391. package/examples/local/showcase/README.md +9 -3
  392. package/examples/local/showcase/features.reactive.md +637 -0
  393. package/examples/local/showcase/zh/features.reactive.md +637 -0
  394. package/examples/sci-fi-theme/README-ch.md +131 -0
  395. package/examples/sci-fi-theme/README.md +146 -0
  396. package/examples/sci-fi-theme/demo/demo.css +532 -0
  397. package/examples/sci-fi-theme/demo/document.reactive.md +185 -0
  398. package/examples/sci-fi-theme/demo/index.html +13 -0
  399. package/examples/sci-fi-theme/demo/main.tsx +180 -0
  400. package/examples/sci-fi-theme/docs/design-system-ch.md +245 -0
  401. package/examples/sci-fi-theme/docs/design-system.md +474 -0
  402. package/examples/sci-fi-theme/package.json +27 -0
  403. package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -0
  404. package/examples/sci-fi-theme/src/components.css +1460 -0
  405. package/examples/sci-fi-theme/src/index.ts +6 -0
  406. package/examples/sci-fi-theme/src/sci-fi.css +5 -0
  407. package/examples/sci-fi-theme/src/theme.ts +37 -0
  408. package/examples/sci-fi-theme/src/tokens.css +408 -0
  409. package/examples/sci-fi-theme/tsconfig.json +20 -0
  410. package/examples/sci-fi-theme/vite.config.ts +24 -0
  411. package/examples/tetris-package/LICENSE +21 -0
  412. package/examples/tetris-package/NOTICES.md +11 -0
  413. package/examples/tetris-package/README-ch.md +91 -0
  414. package/examples/tetris-package/README.md +95 -0
  415. package/examples/tetris-package/package.json +35 -0
  416. package/examples/tetris-package/sample/document.reactive.md +16 -0
  417. package/examples/tetris-package/scripts/build-export.mjs +44 -0
  418. package/examples/tetris-package/scripts/build.mjs +130 -0
  419. package/examples/tetris-package/scripts/verify.mjs +173 -0
  420. package/examples/tetris-package/src/component.css +145 -0
  421. package/examples/tetris-package/src/components.tsx +334 -0
  422. package/examples/tetris-package/src/harness.tsx +34 -0
  423. package/examples/tetris-package/src/manifests.ts +93 -0
  424. package/examples/tetris-package/src/node-entry.ts +16 -0
  425. package/examples/tetris-package/src/sample.ts +4 -0
  426. package/examples/tetris-package/src/tetris-engine.ts +325 -0
  427. package/examples/tetris-package/tsconfig.json +15 -0
  428. package/package.json +98 -44
  429. package/dist-library/compiler-Cm3ppMxG.js +0 -46044
  430. package/dist-library/react-Bh7_oxZp.js +0 -59655
  431. package/dist-library/reactive-md-editor.css +0 -2
  432. package/dist-library/reactive-md-editor.js +0 -3853
  433. package/dist-library/runtime-DlFYQ4s_.js +0 -498
  434. package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +0 -7
  435. package/dist-library/types/editor/editor-toolbar.d.ts +0 -24
  436. package/dist-library/types/editor/editor-view-bar.d.ts +0 -11
  437. package/dist-library/types/editor/extended-native-components.d.ts +0 -58
  438. package/dist-library/types/editor/index.d.ts +0 -9
  439. package/dist-library/types/editor/locale.d.ts +0 -13
  440. package/dist-library/types/editor/source-authoring.d.ts +0 -59
  441. package/dist-library/types/editor/types.d.ts +0 -48
  442. package/dist-library/types/editor/use-gutter-metrics.d.ts +0 -5
  443. package/dist-library/types/editor/use-source-history.d.ts +0 -16
  444. package/dist-library/types/local/compiler.d.ts +0 -4
  445. package/dist-library/types/local/math.d.ts +0 -48
  446. package/dist-library/types/local/options.d.ts +0 -36
  447. package/dist-library/types/local/parser.d.ts +0 -13
  448. package/dist-library/types/local/render-types.d.ts +0 -27
  449. package/dist-library/types/local/runtime.d.ts +0 -2
  450. package/dist-library/types/local/schema.d.ts +0 -77
  451. package/dist-library/types/local/types.d.ts +0 -263
  452. package/dist-library/types/local/visuals.d.ts +0 -12
  453. package/dist-library/types/local/worker.d.ts +0 -98
  454. package/docs/development/performance-ch.md +0 -76
  455. package/docs/development/performance-en.md +0 -76
  456. /package/dist-library/types/{editor → authoring}/command-types.d.ts +0 -0
  457. /package/dist-library/types/{editor → authoring}/editor-commands.d.ts +0 -0
  458. /package/dist-library/types/local/{locale.d.ts → contracts/locale.d.ts} +0 -0
  459. /package/dist-library/types/local/{collection-functions.d.ts → evaluation/collection-functions.d.ts} +0 -0
  460. /package/dist-library/types/local/{data-functions.d.ts → evaluation/data-functions.d.ts} +0 -0
  461. /package/dist-library/types/local/{dates.d.ts → evaluation/dates.d.ts} +0 -0
  462. /package/dist-library/types/local/{formatting.d.ts → evaluation/formatting.d.ts} +0 -0
  463. /package/dist-library/types/local/{html-names.d.ts → html/html-names.d.ts} +0 -0
  464. /package/dist-library/types/local/{text-length.d.ts → source/text-length.d.ts} +0 -0
  465. /package/dist-library/types/local/{colors.d.ts → theme/colors.d.ts} +0 -0
  466. /package/dist-library/types/local/{code-block.d.ts → widgets/code-block.d.ts} +0 -0
  467. /package/dist-library/types/local/{code-languages.d.ts → widgets/code-languages.d.ts} +0 -0
  468. /package/dist-library/types/local/{diagram-layout.d.ts → widgets/diagram-layout.d.ts} +0 -0
  469. /package/dist-library/types/local/{image-view.d.ts → widgets/image-view.d.ts} +0 -0
  470. /package/dist-library/types/local/{math-view.d.ts → widgets/math-view.d.ts} +0 -0
  471. /package/dist-library/types/local/{table-surface.d.ts → widgets/table-surface.d.ts} +0 -0
@@ -1,6 +1,8 @@
1
1
  # Reactive MD component protocol
2
2
 
3
- Protocol revision `component-protocol-2` · applicable syntax `local-draft-2` · current package version `0.5.2` (preview)
3
+ **English** · [中文](component-protocol-ch.md)
4
+
5
+ Protocol revision `component-protocol-3` · applicable syntax `local-draft-3` · current package version `0.7.0`
4
6
 
5
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.
6
8
 
@@ -21,8 +23,8 @@ Reactive MD maintains the following independent version axes:
21
23
  | Version axis | Current value | Determines |
22
24
  | --- | --- | --- |
23
25
  | Package version | `0.5.2` | npm release, core and React entries, upgrade compatibility rules |
24
- | Syntax revision | `local-draft-2` | Tags, attributes and expressions authors can write |
25
- | Protocol revision | `component-protocol-2` | Component contribution requirements, acceptance gates and machine data semantics |
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 |
26
28
  | Theme protocol | `reactive-md-theme-1` | Theme registration, style variables, color schemes and theme acceptance |
27
29
 
28
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.
@@ -37,7 +39,7 @@ When this protocol restates existing behavior, the following files are authorita
37
39
  - Versions, diagnostics contract and platform scope: [Versions and compatibility](../compatibility/compatibility-en.md).
38
40
  - Implementation code: the parser, declaration table, compiler, runtime and renderer under `src/local/`.
39
41
 
40
- This protocol does not copy the full attribute tables. Attribute defaults, allowed values and static/dynamic markers follow `src/local/schema.ts` and the syntax specification.
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.
41
43
 
42
44
  ### CP-SCOPE-03 Normative terms (required)
43
45
 
@@ -60,7 +62,7 @@ When a clause restating existing behavior conflicts with the syntax specificatio
60
62
 
61
63
  ### CP-SCOPE-05 Scope (boundary)
62
64
 
63
- This protocol applies to the 48 tag names of `local-draft-2`, their compilation, runtime and reference rendering behavior, and the process for submitting new components or changing existing ones to the repository.
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.
64
66
 
65
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.
66
68
 
@@ -68,7 +70,7 @@ This document defines contribution and acceptance contracts. The author tutorial
68
70
 
69
71
  ### CP-MODEL-01 Component classification (existing)
70
72
 
71
- `local-draft-2` fixes 48 tag names in the following groups:
73
+ `local-draft-3` fixes 49 tag names in the following groups:
72
74
 
73
75
  | Category | Components | Notes |
74
76
  | --- | --- | --- |
@@ -78,7 +80,7 @@ This document defines contribution and acceptance contracts. The author tutorial
78
80
  | Navigation and prose | `jump`, `anchor`, `text`, `section` | Jumps, explicit anchors and bounded foreground colors |
79
81
  | Assessment | `quiz` | Choice or numeric self-study questions; no public binding |
80
82
  | Feedback | `alert`, `badge`, `tooltip` | Alerts and inline explanations |
81
- | Declarations | `computed`, `const`, `validation` | Parsed tags that are not rendered controls |
83
+ | Declarations | `external`, `computed`, `const`, `validation` | Parsed tags that are not rendered controls; `external` is a read-only host-data declaration |
82
84
  | Generated data and visualization | `data-table`, `column`, `table`, `chart`, `plot`, `timeline`, `diagram`, `node`, `edge` | Generated rows, tables, charts, function curves, timelines and diagrams |
83
85
 
84
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,7 +89,7 @@ This document defines contribution and acceptance contracts. The author tutorial
87
89
 
88
90
  | Shape | Author form | Current components |
89
91
  | --- | --- | --- |
90
- | 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`, `computed`, `const`, `validation`, `column` |
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` |
91
93
  | Inline | Paired tags with content embedded in a sentence | `badge`, `tooltip`, `jump`, `text` |
92
94
  | Container | Paired tags whose content continues to parse as Markdown or child components | The remaining components |
93
95
 
@@ -112,11 +114,11 @@ A component proposal declaration contains at least the following information; it
112
114
  | Compatibility classification | Capability addition, breaking change or implementation/editorial change |
113
115
  | Acceptance evidence | Automated tests, machine conformance data and manual browser checks |
114
116
 
115
- The current declaration table is `src/local/schema.ts`; the tag lexical sets are in `src/local/parser.ts`, semantic validation in `src/local/compiler.ts`, write constraints in `src/local/runtime.ts`, and rendering in `src/local/LocalDocumentView.tsx` and `src/local/visuals.tsx`. Changing only the declaration table does not automatically provide parsing, validation or rendering.
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/LocalDocumentView.tsx` and `src/local/widgets/visuals.tsx`. Changing only the declaration table does not automatically provide parsing, validation or rendering.
116
118
 
117
119
  ### CP-MODEL-04 Name set (existing)
118
120
 
119
- The 48 names of `local-draft-2` 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.
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.
120
122
 
121
123
  ## 3. Names, syntax and attributes
122
124
 
@@ -153,7 +155,7 @@ $$ y = x^2 $$
153
155
  </if>
154
156
  ```
155
157
 
156
- `bind`, `initial`, `id`, `value`, `from`, `to`, `kind`, `type` and layout enums are static attributes; `disabled`, `if.when`, `plot.min`, `plot.max` and `node.tone` are dynamic attributes. The complete list follows the `static` and `dynamic` markers in `schema.ts`.
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`.
157
159
 
158
160
  ### CP-SYNTAX-05 Labels and accessible names (existing)
159
161
 
@@ -221,7 +223,8 @@ Each numeric slot of range-slider and coordinate is also exclusive. Bounds, step
221
223
  A same-name binding is valid only when all of the following conditions hold:
222
224
 
223
225
  - All components belong to the same family.
224
- - Numeric bindings have exactly identical `min`, `max` and `step`.
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.
225
228
  - Selector option value sets and order are exactly identical.
226
229
  - An exclusive family has only one component.
227
230
  - The same binding has at most one explicit `initial`.
@@ -312,11 +315,12 @@ Intermediate input in number and text fields that is not yet valid is kept in a
312
315
 
313
316
  `plot` represents a computational visualization:
314
317
 
315
- - The body may contain only whitespace and one or more `$$...$$` formula blocks; each block explicitly writes `y = expression`.
316
- - `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.
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, 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, and the square tracing region for implicit curves.
317
320
  - `samples` is a static integer from 2 to 2000; each `plot` has at most 16 curves.
321
+ - An explicit or parametric curve requests `samples` points. An implicit curve traces a `samples`×`samples` grid per axis (capped at 100, raised to at least 32) and requests the grid area.
318
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.
319
- - Formulas may reference only declared numeric parameters; undeclared or non-numeric parameters are diagnosed at compile time.
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 cannot be read as a document parameter there.
320
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.
321
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.
322
326
 
@@ -401,7 +405,7 @@ Each `LocalReactiveDocument` instance creates an independent runtime and state.
401
405
 
402
406
  ### CP-LIFE-02 Source changes (existing)
403
407
 
404
- `LocalReactiveDocument` recompiles and creates a new runtime when `source` changes; old instance state is not kept. When the host manages the lifecycle itself, pass the compiled document and runtime to `LocalDocumentView` and dispose the runtime on unmount. Repeated mounts under React StrictMode are handled by deferred disposal logic, which does not release a runtime still in use.
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.
405
409
 
406
410
  ### CP-LIFE-03 Disposal (existing)
407
411
 
@@ -458,7 +462,7 @@ The host decides who may write, submit and share documents; limits request size,
458
462
 
459
463
  ### CP-SEC-05 Extension trust boundary (boundary)
460
464
 
461
- This language does not provide a sandbox for trusted host extension code. If the host registers or wraps components itself, the host is responsible for the security boundary; `disabled`, conditional visibility or client state in author documents must not be treated as permission control. The `hostComponents` option registers plain schema data for one compilation only and carries no executable code. A host renderer is trusted host code outside the document sandbox, so the host remains responsible for its security boundary; a fuller SDK would need a separately defined trust model.
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.
462
466
 
463
467
  ## 9. Core and renderer separation
464
468
 
@@ -481,19 +485,21 @@ SSR HTML, class names and DOM structure in machine acceptance are evidence for t
481
485
 
482
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:
483
487
 
484
- 1. The `VOID`, `PAIRED` and `INLINE` shape sets in `src/local/parser.ts` (by shape).
485
- 2. The declaration table in `src/local/schema.ts`.
486
- 3. Structure, attribute, binding and initial-value validation in `src/local/compiler.ts`.
487
- 4. Write constraints in `src/local/runtime.ts` (if a new public value or state is introduced).
488
- 5. Reference rendering in `src/local/LocalDocumentView.tsx` and `src/local/visuals.tsx`.
489
- 6. Budgets in `src/local/limits.ts` (if new computation or collections are introduced).
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).
490
494
  7. Styles, tests, examples, syntax documentation, integration documentation and conformance data.
491
495
 
492
- Adding only a `schema.ts` entry does not automatically provide parsing, validation or rendering.
496
+ Components that reuse public rules need a definition, implementation and registration. New kernel primitives also require a public contract and acceptance cases.
493
497
 
494
498
  ### CP-CORE-05 Extension interface boundary (boundary)
495
499
 
496
- This revision has no runtime-loadable component implementation, `registerComponent` API, global registrar or author plugin entry point. `LOCAL_COMPONENTS` is an internal frozen table. The `hostComponents` option (section 14) accepts plain schema data for a single compile; component implementations stay in host code and are never loaded from document content. A future SDK that provides a general registration interface needs a new protocol revision that defines the trust model, version negotiation, budgets and acceptance methods.
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) ships in `reactive-md@0.7.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 46 default rendered and structural components use this contract. Hosts explicitly install component code; document declarations never load it.
497
503
 
498
504
  ## 10. Compatibility, name governance, revisions and migration
499
505
 
@@ -524,7 +530,7 @@ Editorial changes do not raise the protocol revision. Protocol revisions can shi
524
530
 
525
531
  ### CP-COMPAT-04 Name governance (required)
526
532
 
527
- - New names must be lowercase kebab-case, semantically clear, and avoid conflicts with the existing 48 names.
533
+ - New names must be lowercase kebab-case, semantically clear, and avoid conflicts with the existing 49 names.
528
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.
529
535
  - Within `component-protocol-1`, the existing 48 names are reserved for existing semantics; reusing a name is a breaking change.
530
536
  - No implicit aliases. An alias needs its own name, documentation and acceptance evidence.
@@ -563,7 +569,7 @@ Persist only the original `.reactive.md` source and the syntax revision used. `L
563
569
 
564
570
  ### CP-ACCEPT-02 Machine conformance data (required)
565
571
 
566
- The root object of a machine conformance set contains only `protocolVersion`, `syntaxVersion` and a non-empty `cases` array. The current author-component set fixes them to `component-protocol-1` and `local-draft-2`; it remains the frozen v1 baseline described in section 14. The package version is identified by `package.json` and is not inferred from these fields.
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.
567
573
 
568
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.
569
575
 
@@ -578,7 +584,7 @@ The runner must:
578
584
 
579
585
  `initial` and `reset.expectedState` use partial matching; `bindingNames` checks the complete public binding name set; `text` and `expectedText` must appear in pairs.
580
586
 
581
- 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 48 tag names; host components have no portable machine cases.
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.
582
588
 
583
589
  ### CP-ACCEPT-03 Component-level evidence (required)
584
590
 
@@ -616,32 +622,27 @@ Only SHOULD clauses can be exempted; exemptions must record the rationale, alter
616
622
 
617
623
  | Contract surface | Main location | Notes |
618
624
  | --- | --- | --- |
619
- | Tag lexing and shapes | `src/local/parser.ts` | `VOID`, `PAIRED`, `INLINE`, unknown-tag fallback, footnote shielding |
620
- | Component declarations | `src/local/schema.ts` | Names, shapes, child rules, attributes, bindings, initial-value rules |
621
- | Compile validation | `src/local/compiler.ts` | Structure, attributes, initial values, shared constraints, expressions, table and plot budgets |
622
- | Runtime | `src/local/runtime.ts` | `get`, `set`, `evaluate`, `text`, `reset`, `resetToken`, `dispose` |
623
- | React reference adapter | `src/local/LocalDocumentView.tsx` | Document container, controls, layout, accessible names, reset and lifecycle |
624
- | Visualization adapter | `src/local/visuals.tsx`, `src/local/math.ts`, `src/local/math-view.tsx` | Tables, charts, plots, timelines, diagrams and math rendering |
625
- | Styles | `src/styles.css`, `src/theme.css`, `src/base.css`, `src/local/local.css`, `src/local/visuals.css` | Global stylesheet, theme variables and component styles |
626
- | Budgets | `src/local/limits.ts` | Shared resource limits |
627
- | Versions | `src/local/version.ts`, `package.json` | Syntax revision and package version |
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/LocalDocumentView.tsx` | Document container, controls, layout, accessible names, reset and lifecycle |
630
+ | Visualization adapter | `src/local/widgets/visuals.tsx`, `src/local/evaluation/math.ts`, `src/local/widgets/math-view.tsx` | Tables, charts, plots, timelines, diagrams and math rendering |
631
+ | Styles | `src/styles.css`, `src/theme.css`, `src/base.css`, `src/local/rendering/local.css`, `src/local/widgets/visuals.css` | Global stylesheet, theme variables and component styles |
632
+ | Budgets | `src/local/configuration/limits.ts` | Shared resource limits |
633
+ | Versions | `src/local/contracts/version.ts`, `package.json` | Syntax revision and package version |
628
634
  | Acceptance | `tests/`, `examples/conformance/` | Language tests and machine conformance data |
629
635
  | Documentation | `docs/`, `README.md`, `CONTRIBUTING.md`, `SECURITY.md` | Syntax, integration, compatibility, security and contribution rules |
630
636
 
631
637
  ### CP-IMPL-02 Current coverage (existing / boundary)
632
638
 
633
- 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 48 tag names.
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.
634
640
 
635
641
  ### CP-IMPL-03 Extension interfaces (boundary)
636
642
 
637
- Beyond the compile-time schema and React renderer axis in section 14, a fuller SDK would need separately defined:
638
-
639
- - Machine format and version negotiation for component declarations.
640
- - Trust model and sandbox boundary for the host registration API.
641
- - Budgets, accessibility and acceptance gates for new components.
642
- - Relationship to the `local-draft-2` syntax revision.
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.
643
644
 
644
- These capabilities are future work; they cannot be used as current acceptance evidence and must not be documented as already provided.
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.
645
646
 
646
647
  ## 13. New component proposal template
647
648
 
@@ -652,7 +653,7 @@ The tables below are for review. See the [component development guide](component
652
653
  | Item | Content |
653
654
  | --- | --- |
654
655
  | Component name | `<name>` (lowercase kebab-case) |
655
- | Protocol revision | `component-protocol-2` |
656
+ | Protocol revision | `component-protocol-3` |
656
657
  | Purpose | What problem it solves and how readers use it |
657
658
  | Non-goals | Capabilities this component does not take on |
658
659
  | Version impact | Package version, syntax revision, protocol revision |
@@ -713,10 +714,11 @@ The tables below are for review. See the [component development guide](component
713
714
  | Field | Content |
714
715
  | --- | --- |
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 |
716
- | `form` | `'leaf'`; host components have no body |
717
+ | `form` | `'leaf'`, `'inline'` or `'container'`; inline and container bodies are compiled as normal Markdown and may contain components |
717
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 |
718
720
 
719
- One compilation accepts at most 32 host component schemas. Each property declares `kind` (`string`, `number`, `boolean` or `enum`), `required`, `static`, `enum` and `pattern`. `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.
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.
720
722
 
721
723
  ### CP-HOST-03 Host components are not author syntax (boundary)
722
724
 
@@ -730,7 +732,7 @@ A valid host node counts as exactly one syntax node in the existing syntax-node
730
732
 
731
733
  ### CP-HOST-05 React dispatch and host-owned data (required)
732
734
 
733
- 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. 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.
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.
734
736
 
735
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.
736
738
 
@@ -740,6 +742,7 @@ Portable machine cases remain `examples/conformance/component-protocol-1.json`,
740
742
 
741
743
  | Revision | Date | Notes |
742
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. |
743
746
  | `component-protocol-2` | 2026-10-25 | Added the host component extension axis; author syntax remains `local-draft-2`. |
744
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. |
745
748
 
@@ -0,0 +1,59 @@
1
+ # 本地模块目录结构
2
+
3
+ **中文** · [English](local-module-layout-en.md)
4
+
5
+ `src/local` 承载 local-draft 的解析、编译、求值、运行时、Worker 传输和 React 渲染实现。文件按职责分组。`src/local/index.ts` 保留在根目录,是唯一的汇总入口,定义由包根入口再导出的本地 API。
6
+
7
+ ## 职责目录
8
+
9
+ 本次调整把 75 个实现与资源文件归入 14 个目录。
10
+
11
+ | 目录 | 职责 |
12
+ | --- | --- |
13
+ | `contracts/` | 共享数据类型:文档、节点、诊断、编译与运行时类型,语法版本和语言区域。 |
14
+ | `source/` | 源文本事实与作者工具:行、围栏和缩进扫描,节点遍历,码点长度,源码版本检查与迁移,编辑器分析。 |
15
+ | `configuration/` | 编译选项校验与标识、默认预设装配、限制、诊断模板和组件 schema。 |
16
+ | `parsing/` | 解析器内核与门面、解析工作量预算、宽松 RMD 恢复。 |
17
+ | `markdown/` | Markdown 快速路径与转换:块规划、普通段落、标题锚点和脚注。 |
18
+ | `html/` | HTML 解析、允许列表、表格、details 和恢复。 |
19
+ | `compilation/` | 单次语义编译、编译入口、服务接口、组件内核和依赖索引。 |
20
+ | `evaluation/` | 表达式语言、可计算 LaTeX 与绘图采样、KaTeX 显示检查、计算、日期、格式化、集合与数据函数、校验。 |
21
+ | `session/` | 跨修订复用:语义缓存、解析缓存、增量块会话和行复用。 |
22
+ | `transport/` | Worker 协议与消息结构、完整/共享/扁平结果、源码编辑和结果补丁。 |
23
+ | `runtime/` | 响应式运行时、状态导入导出、保留策略。 |
24
+ | `rendering/` | React 文档视图、渲染契约、旧版适配器、视图修订投影和视图样式。 |
25
+ | `widgets/` | 叶子 React 视图:代码高亮、数据表格、图片、数学、表格表面、图表和可视化。 |
26
+ | `theme/` | 主题协议与名称校验、颜色、本地化。 |
27
+
28
+ ## 新文件放在哪里
29
+
30
+ 先看模块产出什么:
31
+
32
+ 1. 源文本事实和解析结构,按读取的输入放入 `source/`、`parsing/`、`markdown/` 或 `html/`。
33
+ 2. 共享数据结构放 `contracts/`。选项校验、限制、诊断文本和组件 schema 放 `configuration/`。
34
+ 3. 跨修订复用放 `session/`。Worker 消息、序列化和补丁放 `transport/`。文档运行状态放 `runtime/`。
35
+ 4. React 文档视图和叶子视图放 `rendering/` 或 `widgets/`。语言区域和主题代码放 `theme/`,其中 `theme/i18n.tsx` 使用 React。
36
+ 5. 先归入已有目录。只有职责与现有目录都不同时才新建目录。
37
+
38
+ ## 跨目录导入
39
+
40
+ 使用精确的模块路径:
41
+
42
+ ```ts
43
+ import { parseLocal } from '../parsing/parser';
44
+ import type { LocalNode } from '../contracts/types';
45
+ ```
46
+
47
+ 不要在目录内新增 `index.ts` 汇总文件。`evaluation/index.ts` 会把 KaTeX 带入每次表达式导入,渲染目录的宽泛汇总会把 React 带入只做编译的路径。可选能力在用到的地方直接导入:
48
+
49
+ - React 视图:`rendering/` 和 `widgets/`
50
+ - Worker 调度与协议:`transport/worker`
51
+ - KaTeX 显示:`evaluation/math-display`
52
+
53
+ 根 `index.ts` 是唯一的汇总入口。只有符号属于包级本地 API 时才在这里添加导出。
54
+
55
+ ## 公开导出
56
+
57
+ 外部导入方式不变。包提供 `package.json` 中声明的路径,例如 `reactive-md`、`reactive-md/react`、`reactive-md/compiler` 和 `reactive-md/sdk`。本地汇总入口服务包根入口,新目录不产生深层导入子路径。
58
+
59
+ 本次只调整文件路径。公开导出和运行时行为保持不变,不发布新版本、不提升版本号,也不新增分层或消除循环依赖的保证。
@@ -0,0 +1,59 @@
1
+ # Local module layout
2
+
3
+ **English** · [中文](local-module-layout-ch.md)
4
+
5
+ `src/local` holds the local-draft implementation: parsing, compilation, evaluation, runtime, worker transport and React rendering. The files are grouped by responsibility. `src/local/index.ts` stays at the root as the only barrel and defines the local API re-exported by the package root.
6
+
7
+ ## Responsibility folders
8
+
9
+ The reorganization moves 75 implementation and asset files into 14 folders.
10
+
11
+ | Folder | Responsibility |
12
+ | --- | --- |
13
+ | `contracts/` | Shared data shapes: document, node, diagnostic, compilation and runtime types, syntax version and locale. |
14
+ | `source/` | Source text facts and author tooling: line, fence and indent scans, node traversal, code-point length, source version inspection and migration, editor analysis. |
15
+ | `configuration/` | Compile option validation and identity, default preset assembly, limits, diagnostic templates and component schema. |
16
+ | `parsing/` | Parser kernel and facade, parse work budgets and tolerant RMD recovery. |
17
+ | `markdown/` | Markdown fast paths and transforms: block planning, plain paragraphs, heading anchors and footnotes. |
18
+ | `html/` | HTML parsing, allowlists, tables, details and recovery. |
19
+ | `compilation/` | Single semantic pass, compile entry points, service interfaces, component kernel and dependency index. |
20
+ | `evaluation/` | Expression language, computable LaTeX and plot sampling, KaTeX display checks, computations, dates, formatting, collection and data functions, validation. |
21
+ | `session/` | Cross-revision reuse: semantic and parse caches, incremental block session and row reuse. |
22
+ | `transport/` | Worker protocol and message shapes, full, shared and flat result forms, source edits and result patches. |
23
+ | `runtime/` | Reactive runtime, state import and export, retention. |
24
+ | `rendering/` | React document view, render contracts, legacy adapter, view revision projections and view styles. |
25
+ | `widgets/` | Leaf React views: code highlighting, data tables, images, math, table surface, diagrams and visuals. |
26
+ | `theme/` | Theme protocol and name validation, colors and localization. |
27
+
28
+ ## Choosing a location
29
+
30
+ Start from the output a module produces:
31
+
32
+ 1. Source facts and parse structure go in `source/`, `parsing/`, `markdown/` or `html/`, depending on the input that module reads.
33
+ 2. Shared data contracts go in `contracts/`. Option validation, limits, diagnostic text and component schema go in `configuration/`.
34
+ 3. A module that repeats work across revisions goes in `session/`. Worker messages, serialization and patches go in `transport/`. Live document state goes in `runtime/`.
35
+ 4. React document and leaf views go in `rendering/` or `widgets/`. Locale and theme code go in `theme/`; `theme/i18n.tsx` is the React-aware file there.
36
+ 5. Fit an existing folder first. A new folder needs a responsibility that no current folder owns.
37
+
38
+ ## Cross-folder imports
39
+
40
+ Use the exact module path:
41
+
42
+ ```ts
43
+ import { parseLocal } from '../parsing/parser';
44
+ import type { LocalNode } from '../contracts/types';
45
+ ```
46
+
47
+ Do not add folder-level `index.ts` barrels. A barrel such as `evaluation/index.ts` would add KaTeX to every expression import, and a broad rendering barrel would add React to compile-only paths. Import an optional capability at the point of use:
48
+
49
+ - React views: `rendering/` and `widgets/`
50
+ - Worker scheduling and protocol: `transport/worker`
51
+ - KaTeX display: `evaluation/math-display`
52
+
53
+ The root `index.ts` is the deliberate exception. Add an export there only when a symbol belongs to the package-level local API.
54
+
55
+ ## Public exports
56
+
57
+ Consumer imports stay the same. The package exposes the paths declared in `package.json`, such as `reactive-md`, `reactive-md/react`, `reactive-md/compiler` and `reactive-md/sdk`. The local barrel feeds the root entry and does not create deep-import subpaths for the new folders.
58
+
59
+ This is a path-only reorganization. Public exports and runtime behavior are unchanged, with no release or version bump and no new layering or cycle guarantee.