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
@@ -0,0 +1,32 @@
1
+ import type { KernelBindingSchema, KernelChildRule, KernelComponentSchema, KernelInitialRule, KernelLegacySlot, KernelPropSchema } from '../compilation/component-kernel.js';
2
+ /**
3
+ * Theme-free component schema vocabulary.
4
+ *
5
+ * These declarations are the part of `schema.ts` that depends only on the
6
+ * language kernel. The default preset projection, suggestions over installed
7
+ * names and every manifest import stay in `schema.ts`; the single-compilation
8
+ * entry point may import this module without loading the preset or the theme
9
+ * registry.
10
+ */
11
+ export type LocalComponentForm = 'leaf' | 'inline' | 'container';
12
+ export type LocalChildRule = KernelChildRule;
13
+ export type LocalPropKind = 'string' | 'number' | 'boolean' | 'enum';
14
+ export type LocalPropSchema = KernelPropSchema;
15
+ export type LocalBindingFamily = 'text' | 'number' | 'boolean' | 'choice' | 'date' | 'timer' | 'checklist' | 'tabs' | 'diagram' | 'multi-select' | 'selection' | 'steps' | 'collection';
16
+ export type LocalBindingSchema = KernelBindingSchema;
17
+ /**
18
+ * One independently bound value of a multi-slot component. Each slot has its
19
+ * own public binding name (or an internal `@node:slot` key) and is exclusive in
20
+ * the first revision of the slot API.
21
+ */
22
+ export type LocalBindingSlotSchema = KernelLegacySlot;
23
+ /**
24
+ * `default` is the schema default for an ordinary property. `initialRule`
25
+ * describes how a component produces the value of a binding when the author
26
+ * omits `initial`.
27
+ */
28
+ export type LocalInitialRule = KernelInitialRule;
29
+ export type LocalComponentSchema = KernelComponentSchema;
30
+ export declare const LOCAL_KERNEL_DECLARATIONS: readonly LocalComponentSchema[];
31
+ /** Closest candidate within an edit distance of two, or `undefined`. */
32
+ export declare function closestName(name: string, candidates: readonly string[]): string | undefined;
@@ -0,0 +1,12 @@
1
+ import type { LocalComponentForm, LocalComponentSchema } from './schema-core.js';
2
+ import type { LocalValue } from '../contracts/types.js';
3
+ export type { LocalComponentForm, LocalChildRule, LocalPropKind, LocalPropSchema, LocalBindingFamily, LocalBindingSchema, LocalBindingSlotSchema, LocalInitialRule, LocalComponentSchema, } from './schema-core.js';
4
+ export { LOCAL_KERNEL_DECLARATIONS, closestName } from './schema-core.js';
5
+ export declare const LOCAL_COMPONENTS: Readonly<Record<string, LocalComponentSchema>>;
6
+ export declare const LOCAL_COMPONENT_NAMES: readonly string[];
7
+ /** Component names with the given tag shape, in declaration order. */
8
+ export declare function localComponentNames(form: LocalComponentForm): readonly string[];
9
+ export declare function getLocalComponent(name: string): LocalComponentSchema | undefined;
10
+ export declare function getPropDefault(component: LocalComponentSchema, prop: string): LocalValue | undefined;
11
+ export declare function suggestComponent(name: string): string | undefined;
12
+ export declare function suggestAttribute(component: LocalComponentSchema, name: string): string | undefined;
@@ -0,0 +1,519 @@
1
+ import type { LocalConfig, LocalExtensionRequirements } from '../../sdk/types.js';
2
+ import type { LocalRuntimeServices } from '../../runtime-services/runtime.js';
3
+ import type { LocalComponentStateStorage } from '../../runtime-services/component-state.js';
4
+ export interface SourceRange {
5
+ start: number;
6
+ end: number;
7
+ }
8
+ /** A source-level syntax declaration; offsets use original UTF-16 units. */
9
+ export interface LocalVersionDeclaration {
10
+ version: string;
11
+ range: SourceRange;
12
+ }
13
+ /** A scalar, JSON/structured-clone-safe diagnostic template parameter. */
14
+ export type LocalDiagnosticParam = string | number | boolean | null;
15
+ export type LocalDiagnosticParams = Readonly<Record<string, LocalDiagnosticParam>>;
16
+ /** A display issue relative to the formula body, independent of the renderer. */
17
+ export interface LocalMathDisplayIssue {
18
+ start: number;
19
+ end: number;
20
+ reason: 'unsupported-command' | 'unsupported-environment' | 'budget' | 'syntax';
21
+ message: string;
22
+ code: string;
23
+ messageKey: string;
24
+ params?: LocalDiagnosticParams;
25
+ }
26
+ export interface Diagnostic {
27
+ code: string;
28
+ message: string;
29
+ severity: 'error' | 'warning';
30
+ range: SourceRange;
31
+ line: number;
32
+ column: number;
33
+ /**
34
+ * Stable template key for a built-in message. Omitted for host-owned
35
+ * diagnostics, whose `message` is preserved verbatim by display code.
36
+ */
37
+ messageKey?: string;
38
+ /** Bounded scalar parameters for `messageKey`. */
39
+ params?: LocalDiagnosticParams;
40
+ }
41
+ export type LocalValue = string | number | boolean | null | string[] | number[];
42
+ /** `array` retains its existing meaning: a homogeneous string array. */
43
+ export type LocalValueKind = 'string' | 'number' | 'boolean' | 'null' | 'array' | 'number-array';
44
+ /** Markdown nodes retain their original source ranges; component attributes remain raw decoded strings. */
45
+ export interface LocalNode {
46
+ type: string;
47
+ id: string;
48
+ range: SourceRange;
49
+ children?: LocalNode[];
50
+ name?: string;
51
+ attrs?: Record<string, string>;
52
+ value?: string;
53
+ depth?: number;
54
+ ordered?: boolean;
55
+ start?: number;
56
+ checked?: boolean | null;
57
+ url?: string;
58
+ title?: string | null;
59
+ alt?: string;
60
+ /** Rendered width of an HTML `<img>`, in CSS pixels. */
61
+ width?: number;
62
+ /** Rendered height of an HTML `<img>`, in CSS pixels. */
63
+ height?: number;
64
+ /** Host component shape recorded by the parser from the host schema. */
65
+ hostForm?: 'leaf' | 'inline' | 'container';
66
+ lang?: string;
67
+ align?: ('left' | 'center' | 'right' | null)[];
68
+ /**
69
+ * Normalized footnote identifier shared by `footnoteReference` and
70
+ * `footnoteDefinition` nodes (whitespace collapsed, lowercased).
71
+ */
72
+ identifier?: string;
73
+ /** Original footnote label as written, preserved for display. */
74
+ label?: string;
75
+ /**
76
+ * True for a node created by HTML recovery rather than written in source.
77
+ * Synthetic nodes own no original tag offsets.
78
+ */
79
+ synthetic?: boolean;
80
+ /**
81
+ * Source boundary that justified a synthetic node. Only meaningful together
82
+ * with `synthetic`; it never replaces `range`.
83
+ */
84
+ syntheticBoundary?: SourceRange;
85
+ }
86
+ /**
87
+ * One structural repair the tolerant parser applied in loose mode. Ranges are
88
+ * original-source UTF-16 half-open intervals: `causeRange` marks the problem
89
+ * and `affectedRange` marks what was actually recovered. Strict compilation
90
+ * never produces records; older results simply omit the field.
91
+ */
92
+ export interface LocalRecovery {
93
+ code: string;
94
+ causeRange: SourceRange;
95
+ affectedRange: SourceRange;
96
+ action: 'html-repair' | 'literal-fallback';
97
+ boundary: 'token' | 'fragment' | 'container-end' | 'heading' | 'eof';
98
+ }
99
+ /**
100
+ * One read-only document value declared by a top-level `<computed>` or
101
+ * `<const>` tag. The record is plain, serializable metadata: the declaring
102
+ * node is not part of the rendered tree and owns no writable binding.
103
+ */
104
+ export interface LocalComputation {
105
+ name: string;
106
+ kind: 'computed' | 'const';
107
+ /** Expression source between `{{` and `}}`, trimmed. */
108
+ source: string;
109
+ /** Names read by the expression, in first-use order. */
110
+ dependencies: string[];
111
+ type: LocalValueKind;
112
+ /** Canonical id of the declaration node, retained for host diagnostics. */
113
+ nodeId: string;
114
+ /** Source range of the declaration tag. */
115
+ range: SourceRange;
116
+ /**
117
+ * Statically evaluated value. Present only for `const`, whose expression
118
+ * cannot depend on controls or computed values.
119
+ */
120
+ value?: LocalValue;
121
+ }
122
+ export interface LocalBinding {
123
+ /** Kernel value semantics, including ordered generic collections. */
124
+ family?: import('../../sdk/types.js').LocalBindingFamily;
125
+ name: string;
126
+ nodeIds: string[];
127
+ type: LocalValueKind;
128
+ initial: LocalValue;
129
+ min?: number;
130
+ max?: number;
131
+ step?: number;
132
+ options?: string[];
133
+ /** Upper bound for array selections such as `multi-select`. */
134
+ maxItems?: number;
135
+ owner?: string;
136
+ }
137
+ /**
138
+ * One host-provided read-only value declared by a top-level `<external>` tag.
139
+ * The record is plain data: the declaration owns no writable binding and is
140
+ * never persisted in a state file.
141
+ */
142
+ export interface LocalExternal {
143
+ name: string;
144
+ /** `array` is a string array; `number-array` a finite-number array. */
145
+ type: LocalValueKind;
146
+ /** Canonical id of the declaration node, retained for diagnostics. */
147
+ nodeId: string;
148
+ /** Source range of the declaration tag. */
149
+ range: SourceRange;
150
+ }
151
+ /** One dynamic constraint expression attached to a control attribute. */
152
+ export interface LocalDynamicConstraint {
153
+ /** Expression source between `{{` and `}}`, trimmed. */
154
+ source: string;
155
+ /** Absolute offset of the expression in the document source. */
156
+ offset: number;
157
+ /** Optional schema of the numeric prop supplying this binding bound. */
158
+ numeric?: {
159
+ min?: number;
160
+ max?: number;
161
+ integer?: boolean;
162
+ };
163
+ }
164
+ /** Dynamic constraints declared by one control, keyed by attribute name. */
165
+ export interface LocalDynamicConstraints {
166
+ min?: LocalDynamicConstraint;
167
+ max?: LocalDynamicConstraint;
168
+ required?: LocalDynamicConstraint;
169
+ }
170
+ /** Advisory cross-field rule; an invalid rule keeps its fields editable. */
171
+ export interface LocalValidation {
172
+ nodeId: string;
173
+ expression: string;
174
+ dependencies: string[];
175
+ message: string;
176
+ fields: string[];
177
+ range: SourceRange;
178
+ }
179
+ /** One serialized runtime value rule lowered from a component manifest. */
180
+ export type LocalCompiledValueRule = {
181
+ kind: 'date';
182
+ min?: string;
183
+ max?: string;
184
+ required?: string;
185
+ } | {
186
+ kind: 'length';
187
+ min?: string;
188
+ max?: string;
189
+ email?: string;
190
+ emailType?: string;
191
+ } | {
192
+ kind: 'required';
193
+ required: string;
194
+ } | {
195
+ kind: 'email';
196
+ type: string;
197
+ value: string;
198
+ };
199
+ /** One serialized slot order relation, e.g. range start <= end. */
200
+ export interface LocalKernelSlotRelation {
201
+ nodeId: string;
202
+ lower: string;
203
+ upper: string;
204
+ }
205
+ /**
206
+ * Serializable kernel metadata lowered at compile time. Runtime consumers
207
+ * never read manifests; this record carries only bounded plain data.
208
+ */
209
+ export interface LocalDocumentKernel {
210
+ valueRules: Readonly<Record<string, readonly LocalCompiledValueRule[]>>;
211
+ slotRelations: readonly LocalKernelSlotRelation[];
212
+ retentionExclusions: readonly string[];
213
+ bindingAttributes?: Readonly<Record<string, {
214
+ bind: string;
215
+ initial: string;
216
+ }>>;
217
+ dependencyRules?: Readonly<Record<string, {
218
+ selfBinding?: {
219
+ mode: 'always' | 'attribute';
220
+ attribute?: string;
221
+ };
222
+ inlineMathReads?: boolean;
223
+ }>>;
224
+ }
225
+ /** Compiler-produced documents contain only plain records, arrays and primitives. */
226
+ export interface LocalDocument {
227
+ syntax: 'local';
228
+ source: string;
229
+ /** Registry fingerprint carried through compilation, Worker cloning and patches. */
230
+ componentConfigKey?: string;
231
+ /** Effective syntax revision; absent on older hand-built runtime documents. */
232
+ syntaxVersion?: 'local-draft-3';
233
+ /**
234
+ * Present only when at least one HTML capability flag was enabled. Its
235
+ * presence routes rendering to the isolated native-HTML branch; the
236
+ * original source is preserved and `nodes` carries one `htmlDocument` node
237
+ * whose `value` is the sanitized, complete iframe document.
238
+ */
239
+ html?: LocalHtmlPolicy;
240
+ versionDeclaration?: LocalVersionDeclaration;
241
+ nodes: LocalNode[];
242
+ initialState: Record<string, LocalValue>;
243
+ bindings: Record<string, LocalBinding>;
244
+ /**
245
+ * Selected theme name. Themes are document metadata, not components: the
246
+ * compiler always supplies the built-in `default` when no declaration is
247
+ * present, and the renderer resolves the name against host-supplied CSS.
248
+ */
249
+ theme?: string;
250
+ /** Original source range of the leading `<theme ...>` declaration. */
251
+ themeRange?: SourceRange;
252
+ /**
253
+ * Canonical node id -> slot -> binding key for multi-slot components such as
254
+ * `range-slider` (`start`/`end`) and `coordinate` (`x`/`y`). Renderers use
255
+ * runtime `get`/`set`/`setMany` with slot names instead of reading this map.
256
+ */
257
+ bindingSlots?: Record<string, Record<string, string>>;
258
+ /**
259
+ * Read-only values declared with top-level `<computed>` / `<const>` tags,
260
+ * keyed by name. These are document metadata, not components: declaration
261
+ * nodes are removed from `nodes` before publication and never own bindings.
262
+ */
263
+ computations?: Record<string, LocalComputation>;
264
+ /** Cross-field constraints in source order; evaluated against each revision. */
265
+ validations?: LocalValidation[];
266
+ /**
267
+ * Host-provided read-only declarations, keyed by name. They participate in
268
+ * expressions and computations but never appear in `bindings`, public
269
+ * parameters or exported state files.
270
+ */
271
+ externals?: Record<string, LocalExternal>;
272
+ /**
273
+ * Node id -> dynamic constraint expressions. Controls such as `number`,
274
+ * `slider`, `date`, `input` and `textarea` use these to evaluate `min`,
275
+ * `max` or `required` against the current state instead of the compile-time
276
+ * value.
277
+ */
278
+ dynamicConstraints?: Record<string, LocalDynamicConstraints>;
279
+ /**
280
+ * Node id -> subtree binding dependencies, produced by the compiler. `null`
281
+ * marks subtrees whose reads cannot be decided statically. Internal shape:
282
+ * consumers should read it through the package runtime rather than depend on
283
+ * the serialized form.
284
+ */
285
+ dependencies?: Readonly<Record<string, readonly string[] | null>>;
286
+ /**
287
+ * Node id -> table structure for `<table>`, `<chart>` and `<timeline>`
288
+ * contents, produced by the compiler. Header cells are plain text and data
289
+ * rows list the ids of their cell nodes. Frozen and serializable: it holds no
290
+ * node references. Internal shape; readers should tolerate its absence.
291
+ */
292
+ tableShapes?: Readonly<Record<string, {
293
+ readonly header: readonly string[];
294
+ readonly rowIds: readonly (readonly string[])[];
295
+ }>>;
296
+ /**
297
+ * External SDK components actually used by this document. Present only when
298
+ * an instance configuration contributed at least one used component; the
299
+ * list describes requirements and never carries executable code.
300
+ */
301
+ extensions?: LocalExtensionRequirements;
302
+ /**
303
+ * Component contracts actually used by this document, including default
304
+ * preset manifests. Plain, serializable data; runtime semantics resolve from
305
+ * it with default-preset fallback for older hand-built documents.
306
+ */
307
+ componentDefinitions?: readonly import('../../sdk/types.js').LocalComponentDefinition[];
308
+ /**
309
+ * Serializable component-semantics metadata lowered at compile time. Present
310
+ * only when at least one component contributes a runtime rule, slot relation
311
+ * or retention exclusion. Internal shape; consumers use the runtime API.
312
+ */
313
+ kernel?: LocalDocumentKernel;
314
+ }
315
+ /** Host-owned budgets for a single compilation. */
316
+ export interface LocalCompileLimits {
317
+ /** Positive safe integer; defaults to 10,000 cumulative LocalNode creations. */
318
+ readonly maxSyntaxNodes?: number;
319
+ /**
320
+ * Positive safe integer; defaults to 20,000,000 deterministic parser work
321
+ * units (source scanning plus general Markdown parse submission). Raising it
322
+ * only affects pathological inputs; normal documents stay far below it.
323
+ */
324
+ readonly maxParseWork?: number;
325
+ /**
326
+ * Positive safe integer; defaults to 1,000 nested Markdown container levels
327
+ * (blockquotes and open list levels). Fenced and indented code is ignored.
328
+ */
329
+ readonly maxMarkdownDepth?: number;
330
+ }
331
+ /**
332
+ * Host-owned capability flags for the temporary whole-document HTML mode.
333
+ *
334
+ * All flags default to `false`. When every flag is false the existing
335
+ * Markdown/ReactiveMD pipeline runs unchanged. When any flag is true the whole
336
+ * source is interpreted as native HTML and rendered inside a sandboxed iframe;
337
+ * Markdown, interpolation, bindings, formulas and ReactiveMD components are not
338
+ * interpreted in that mode.
339
+ */
340
+ export interface LocalHtmlOptions {
341
+ /** Allow authored CSS; external resources remain subject to the native CSP. */
342
+ readonly enableCss?: boolean;
343
+ /** Allow authored scripts and inline event handlers. */
344
+ readonly enableJavaScript?: boolean;
345
+ /** Allow HTML beyond the safe P0 subset (tables, forms, SVG/MathML, ...). */
346
+ readonly enableExtendedHtml?: boolean;
347
+ }
348
+ /** Effective, non-optional policy recorded on a compiled HTML-branch document. */
349
+ export interface LocalHtmlPolicy {
350
+ readonly enableCss: boolean;
351
+ readonly enableJavaScript: boolean;
352
+ readonly enableExtendedHtml: boolean;
353
+ }
354
+ export type LocalHostPropKind = 'string' | 'number' | 'boolean' | 'enum';
355
+ export interface LocalHostPropSchema {
356
+ readonly kind: LocalHostPropKind;
357
+ readonly required?: boolean;
358
+ /** Reject `{{ ... }}` in this property. */
359
+ readonly static?: boolean;
360
+ /** Allowed literals for kind 'enum'; required and non-empty for enums. */
361
+ readonly enum?: readonly string[];
362
+ /** RegExp source applied to literal string values; restricted to a linear-time-safe subset. */
363
+ readonly pattern?: string;
364
+ }
365
+ export type LocalHostComponentForm = 'leaf' | 'inline' | 'container';
366
+ /**
367
+ * Optional public binding of a host component. The component accepts `bind`,
368
+ * `initial` and `disabled` attributes implicitly and shares the built-in
369
+ * binding families, so it can pair with `number`, `input` and `toggle`.
370
+ */
371
+ export interface LocalHostBindingSchema {
372
+ readonly kind: 'string' | 'number' | 'boolean';
373
+ /** Default value rule when `initial` is omitted. */
374
+ readonly initialRule?: 'empty' | 'false' | 'nearest-zero' | 'min' | 'first-option';
375
+ /** `number` only: static lower bound. */
376
+ readonly min?: number;
377
+ /** `number` only: static upper bound. */
378
+ readonly max?: number;
379
+ /** `number` only: static step; defaults to 1. */
380
+ readonly step?: number;
381
+ /** `string` only: when present, the binding family is `choice`. */
382
+ readonly options?: readonly string[];
383
+ /** Only one component may own this binding. */
384
+ readonly exclusive?: boolean;
385
+ }
386
+ export interface LocalHostComponentSchema {
387
+ readonly name: string;
388
+ readonly form: LocalHostComponentForm;
389
+ readonly props: Readonly<Record<string, LocalHostPropSchema>>;
390
+ readonly binding?: LocalHostBindingSchema;
391
+ }
392
+ export interface LocalCompileOptions extends LocalHtmlOptions {
393
+ readonly limits?: LocalCompileLimits;
394
+ /**
395
+ * Render ordinary Markdown soft line breaks as `<br>`.
396
+ *
397
+ * Defaults to `false`, which keeps the historical behavior where a soft
398
+ * break is ordinary collapsible whitespace. When `true`, each source soft
399
+ * break becomes a `break` node; explicit hard breaks, code, formulas and
400
+ * native HTML are left untouched. The source text is never rewritten, so
401
+ * every node keeps its original offsets.
402
+ */
403
+ readonly markdownBreaks?: boolean;
404
+ /** Host-defined leaf components recognized alongside the built-in schema. */
405
+ readonly hostComponents?: readonly LocalHostComponentSchema[];
406
+ /**
407
+ * Instance-level SDK configuration. Cannot be combined with
408
+ * `hostComponents`; external manifests are lowered to the same internal
409
+ * registry shape, while their typed defaults and constraints stay enforced.
410
+ */
411
+ readonly config?: LocalConfig;
412
+ /**
413
+ * Strict structural checking. Defaults to `true`, which keeps the historical
414
+ * behavior. `false` lets the parser recover isolated structural damage and
415
+ * report successful repairs through `recoveries` and bounded warning
416
+ * diagnostics. Unrecoverable semantic, configuration, version and budget
417
+ * errors remain errors. Only booleans are accepted.
418
+ */
419
+ readonly strict?: boolean;
420
+ }
421
+ /** Public compiler output is plain data, including nested attributes and dependencies. */
422
+ export type LocalCompileResult = {
423
+ ok: true;
424
+ document: LocalDocument;
425
+ diagnostics: Diagnostic[];
426
+ recoveries?: LocalRecovery[];
427
+ } | {
428
+ ok: false;
429
+ diagnostics: Diagnostic[];
430
+ recoveries?: LocalRecovery[];
431
+ };
432
+ /**
433
+ * Frozen state of the current revision. It contains controls, successful
434
+ * computed values and currently available external values. Use
435
+ * `getParameters()` when only writable public parameters are wanted.
436
+ */
437
+ export interface LocalSnapshot {
438
+ revision: number;
439
+ state: Readonly<Record<string, LocalValue>>;
440
+ }
441
+ /** Host-provided initial external values; invalid entries are treated as unavailable. */
442
+ export interface LocalRuntimeOptions {
443
+ /**
444
+ * Initial read-only host values for `<external>` declarations. Declared names
445
+ * without a valid value stay unavailable until a later `setExternalValues`.
446
+ */
447
+ readonly externalValues?: Readonly<Record<string, LocalValue>>;
448
+ /** Stable host identity for component-scoped state. Defaults to the source digest. */
449
+ readonly documentId?: string;
450
+ /** Document-level seed for component randomness. */
451
+ readonly randomSeed?: number;
452
+ /** Component-state sidecar to restore before the first render. */
453
+ readonly componentState?: unknown;
454
+ /**
455
+ * Persistence port for component state. Applied only when the runtime owns
456
+ * its services; omitted keeps state in memory.
457
+ */
458
+ readonly componentStateStorage?: LocalComponentStateStorage;
459
+ /**
460
+ * Coalesce component-state writes. Memory updates immediately; a positive
461
+ * delay writes the stored sidecar at most once per window. Call
462
+ * `runtime.services.state.flush()` when the page is hidden. Defaults to 0
463
+ * (write after every save or clear).
464
+ */
465
+ readonly componentStateWriteDelayMs?: number;
466
+ /**
467
+ * Current semantic configuration key. It is written into component-state
468
+ * snapshots and a restored sidecar must match it or one of
469
+ * `legacyConfigKeys`. Omitted keeps the sidecar identity unverified.
470
+ */
471
+ readonly configKey?: string;
472
+ /** Legacy configuration identities accepted when restoring a sidecar. */
473
+ readonly legacyConfigKeys?: readonly string[];
474
+ /** Inject scheduler/clock/state services; the runtime owns them only when omitted. */
475
+ readonly services?: LocalRuntimeServices;
476
+ }
477
+ export interface LocalRuntime {
478
+ document: LocalDocument;
479
+ /**
480
+ * Runtime-scoped services (clock, scheduler, component state). Hand-built
481
+ * runtimes in tests may omit them; contexts fall back to detached services.
482
+ */
483
+ readonly services?: LocalRuntimeServices;
484
+ snapshot(): LocalSnapshot;
485
+ /** Read a control value; `slot` is required for multi-slot components. */
486
+ get(node: LocalNode, slot?: string): LocalValue;
487
+ /** Write one control value; `slot` selects `start`/`end` or `x`/`y`. */
488
+ set(node: LocalNode, value: LocalValue, slot?: string): Diagnostic[];
489
+ /** Atomically write multiple slots of one multi-slot component. */
490
+ setMany(node: LocalNode, values: Readonly<Record<string, LocalValue>>): Diagnostic[];
491
+ /** Sorted public binding names; internal @... bindings are excluded. */
492
+ parameterNames(): readonly string[];
493
+ /** Read a public parameter by binding name. Returns undefined for unknown/internal names. */
494
+ getParameter(name: string): LocalValue | undefined;
495
+ /** Snapshot of all public parameters; `@...` and external values are excluded. */
496
+ getParameters(): Readonly<Record<string, LocalValue>>;
497
+ /** Validate and atomically write one public parameter. */
498
+ setParameter(name: string, value: LocalValue): Diagnostic[];
499
+ /** Validate and atomically write one or more public parameters. */
500
+ setParameters(values: Readonly<Record<string, LocalValue>>): Diagnostic[];
501
+ /** Read a declared external value; `undefined` when unavailable or undeclared. */
502
+ getExternal(name: string): LocalValue | undefined;
503
+ /** Frozen record of the currently available external values. */
504
+ getExternalValues(): Readonly<Record<string, LocalValue>>;
505
+ /**
506
+ * Atomically write declared external values. Unknown names, wrong types and
507
+ * budget failures return diagnostics without changing state or revision.
508
+ */
509
+ setExternalValues(values: Readonly<Record<string, LocalValue>>): Diagnostic[];
510
+ evaluate(expression: string): LocalValue;
511
+ /** Current advisory constraint failures; never changes or rejects field state. */
512
+ validate(): Diagnostic[];
513
+ text(template: string): string;
514
+ reset(node: LocalNode): void;
515
+ resetToken(node: LocalNode): number;
516
+ subscribe(listener: () => void): () => void;
517
+ dispose(): void;
518
+ }
519
+ export declare const localKey: (node: LocalNode) => string;
@@ -1,2 +1,2 @@
1
1
  /** The local syntax revision accepted and rendered by this build. */
2
- export declare const LOCAL_SYNTAX_VERSION: 'local-draft-2';
2
+ export declare const LOCAL_SYNTAX_VERSION: 'local-draft-3';
@@ -1,5 +1,5 @@
1
1
  import { LocalExpressionError, type LocalExpression } from './expression.js';
2
- import type { LocalComputation, LocalValue, LocalValueKind } from './types.js';
2
+ import type { LocalComputation, LocalValue, LocalValueKind } from '../contracts/types.js';
3
3
  /**
4
4
  * Declarations are resolved in one bounded pass: every expression is compiled
5
5
  * once, the dependency graph is topologically ordered with an iterative Kahn
@@ -38,7 +38,10 @@ export declare function orderComputations(computations: Record<string, LocalComp
38
38
  order: string[];
39
39
  cyclic: string[];
40
40
  };
41
- export declare function resolveComputationGraph(inputs: ComputationInput[], controls: Record<string, LocalValueKind>, report: ComputationReport): ResolvedComputations;
41
+ export declare function resolveComputationGraph(inputs: ComputationInput[], controls: Record<string, LocalValueKind>, report: ComputationReport, externalNames?: ReadonlySet<string>, cache?: {
42
+ expression(source: string): LocalExpression;
43
+ infer(expression: LocalExpression, env: Record<string, LocalValueKind>): LocalValueKind;
44
+ }): ResolvedComputations;
42
45
  export interface ComputationEvaluation {
43
46
  values: Record<string, LocalValue>;
44
47
  errors: Map<string, LocalExpressionError>;
@@ -50,4 +53,4 @@ export interface ComputationEvaluation {
50
53
  * the original error only when the failing name is actually read, which keeps
51
54
  * short-circuited branches and independent consumers working.
52
55
  */
53
- export declare function evaluateComputations(computations: Record<string, LocalComputation>, order: string[], expressions: Map<string, LocalExpression>, controls: Record<string, LocalValue>, constValues: Record<string, LocalValue>): ComputationEvaluation;
56
+ export declare function evaluateComputations(computations: Record<string, LocalComputation>, order: string[], expressions: Map<string, LocalExpression>, controls: Record<string, LocalValue>, constValues: Record<string, LocalValue>, unavailable?: ReadonlyMap<string, LocalExpressionError>): ComputationEvaluation;
@@ -1,5 +1,5 @@
1
- import { type LocalDiagnosticDetails } from './diagnostics.js';
2
- import type { LocalValue, LocalValueKind } from './types.js';
1
+ import { type LocalDiagnosticDetails } from '../configuration/diagnostics.js';
2
+ import type { LocalValue, LocalValueKind } from '../contracts/types.js';
3
3
  /**
4
4
  * The local-draft expression language.
5
5
  *
@@ -11,24 +11,10 @@
11
11
  * to bounded literal text and produces a source-ranged issue, so "shown as
12
12
  * literal text" and "reported as a warning" stay in sync.
13
13
  */
14
- import type { LocalDiagnosticParams } from './types.js';
14
+ import type { LocalMathDisplayIssue } from '../contracts/types.js';
15
+ export type { LocalMathDisplayIssue } from '../contracts/types.js';
15
16
  import 'katex/contrib/mhchem';
16
17
  export type LocalMathDisplayIssueReason = 'unsupported-command' | 'unsupported-environment' | 'budget' | 'syntax';
17
- /** One display-compatibility issue; offsets are relative to the formula body. */
18
- export interface LocalMathDisplayIssue {
19
- /** Inclusive UTF-16 offset into the formula body. */
20
- start: number;
21
- /** Exclusive UTF-16 offset into the formula body. */
22
- end: number;
23
- reason: LocalMathDisplayIssueReason;
24
- /** English message for the issue (localize with `messageKey`/`params`). */
25
- message: string;
26
- /** Coarse machine code reported on `Diagnostic.code`. */
27
- code: string;
28
- /** Template key registered in `diagnostics.ts`. */
29
- messageKey: string;
30
- params?: LocalDiagnosticParams;
31
- }
32
18
  /** Result of typesetting one formula; `html === null` means literal fallback. */
33
19
  export interface LocalMathDisplayRender {
34
20
  /** KaTeX `htmlAndMathml` markup, or `null` when the formula must fall back. */
@@ -0,0 +1,23 @@
1
+ import type { LatexEvaluationBudget, LatexExpression, PlotSample, PlotSegmentPoint } from './math.js';
2
+ import type { LocalValue } from '../contracts/types.js';
3
+ /**
4
+ * Samples y(x) across [min, max]. Undefined points and the sample after a
5
+ * detected break become null so a renderer cannot join the two sides of an
6
+ * asymptote. The array always has exactly `samples` points.
7
+ *
8
+ * The optional final budget is shared by every curve/plot in a document. Each
9
+ * evaluation is limited by whatever remains of both that shared budget and the
10
+ * per-curve budget, and a `latex-budget` error aborts the whole sampling pass.
11
+ */
12
+ export declare function samplePlot(expression: LatexExpression, env: Record<string, LocalValue>, min: number, max: number, samples?: number, sharedBudget?: LatexEvaluationBudget): PlotSample;
13
+ /**
14
+ * Samples a parametric curve `(x(t), y(t))` over [min, max]. Points whose x or
15
+ * y value is undefined keep a NaN x and a null y so the renderer breaks the
16
+ * stroke instead of joining across a domain gap.
17
+ */
18
+ export declare function sampleParametric(xExpression: LatexExpression, yExpression: LatexExpression, env: Record<string, LocalValue>, min: number, max: number, samples?: number, sharedBudget?: LatexEvaluationBudget): PlotSample;
19
+ /**
20
+ * Traces `expression(x, y) = 0` with marching squares. The caller supplies the
21
+ * viewport; the environment receives the current y for every evaluation.
22
+ */
23
+ export declare function sampleImplicit(expression: LatexExpression, env: Record<string, LocalValue>, xMin: number, xMax: number, yMin: number, yMax: number, grid?: number, sharedBudget?: LatexEvaluationBudget): PlotSegmentPoint[][];