reactive-md 0.8.0 → 0.9.1

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 (441) hide show
  1. package/CHANGELOG-ch.md +54 -4
  2. package/CHANGELOG.md +55 -4
  3. package/CONTRIBUTING-ch.md +13 -2
  4. package/CONTRIBUTING.md +13 -2
  5. package/README-ch.md +132 -23
  6. package/README-en.md +130 -21
  7. package/README.md +128 -21
  8. package/SECURITY-ch.md +3 -3
  9. package/SECURITY.md +3 -3
  10. package/THIRD_PARTY_NOTICES.md +111 -1
  11. package/cli/args.mjs +51 -1
  12. package/cli/assets.mjs +6 -1
  13. package/cli/build.mjs +125 -9
  14. package/cli/fs-utils.mjs +3 -3
  15. package/cli/help.mjs +12 -5
  16. package/cli/init.mjs +1 -1
  17. package/cli/package.mjs +1 -0
  18. package/dist-library/LocalDocumentView-sthUP0ct.js +109 -0
  19. package/dist-library/LocalDocumentViewCore-GiWV3bey.js +9829 -0
  20. package/dist-library/LocalReactiveDocumentCore-ZjQSGyHE.js +275 -0
  21. package/dist-library/{authoring-BsfSwQRm.js → authoring-Dsune4Hy.js} +240 -218
  22. package/dist-library/compile-wUv8KEge.js +1249 -0
  23. package/dist-library/{compiler-core-kPiH-gOV.js → compiler-core-As_m-MNm.js} +5372 -5559
  24. package/dist-library/compiler-eOfcinZs.js +62 -0
  25. package/dist-library/component-state-BoLCGee4.js +801 -0
  26. package/dist-library/{component-state-D_cw_EHe.js → component-state-C52ZFJGl.js} +2 -2
  27. package/dist-library/{registry-B9Jc3FVe.js → config-BadfhjdP.js} +374 -457
  28. package/dist-library/{config-validation-DXTynAw7.js → config-validation-F47AcE6o.js} +549 -751
  29. package/dist-library/controls-CcT6n7k_.js +6740 -0
  30. package/dist-library/coordinate-CWS9p5q_.js +293 -0
  31. package/dist-library/data-table-Bgccxd7h.js +296 -0
  32. package/dist-library/{default-components-Z_YMio5P.js → default-components-BwQf0oP-.js} +344 -334
  33. package/dist-library/{math-display-BJz4gbFc.js → display-B-VhqVND.js} +1299 -1299
  34. package/dist-library/export-BqVmTXm8.js +369 -0
  35. package/dist-library/gallery-CY6mTx8i.js +360 -0
  36. package/dist-library/html-CNT4KD-2.js +757 -0
  37. package/dist-library/{math-sample-BGEW49zY.js → incremental-Dv0FSp_U.js} +476 -394
  38. package/dist-library/latex-1w7aQgD5.js +928 -0
  39. package/dist-library/layout-C0YlEPGr.js +562 -0
  40. package/dist-library/mount-preset-KxvtKgJb.js +13 -0
  41. package/dist-library/options-1aDLK7JY.js +121 -0
  42. package/dist-library/{react-ByOHunUW.js → package-core-WFK1RhAZ.js} +49 -55
  43. package/dist-library/{parser-standard-DlCk7sLo.js → parser-standard-Yuf3A_VI.js} +6605 -7097
  44. package/dist-library/plugin-packs-B1XPWcFs.js +18 -0
  45. package/dist-library/{identity-MYJXKSkB.js → preset-core-CKc5YXSM.js} +31 -31
  46. package/dist-library/{props-DGlBk0e5.js → props-sJ8vk0cr.js} +1 -1
  47. package/dist-library/react-BbyAgeXc.js +6070 -0
  48. package/dist-library/react-D5iGiUdL.js +7 -0
  49. package/dist-library/reactive-md-authoring.js +222 -223
  50. package/dist-library/reactive-md-build.js +126 -72
  51. package/dist-library/reactive-md-compiler-standard.js +12 -10
  52. package/dist-library/reactive-md-compiler.js +3 -3
  53. package/dist-library/reactive-md-default-packs.js +2 -2
  54. package/dist-library/reactive-md-default-preset.js +4 -4
  55. package/dist-library/reactive-md-export-assets.js +57 -0
  56. package/dist-library/reactive-md-export.js +5 -111
  57. package/dist-library/reactive-md-minimal-preset.js +24 -0
  58. package/dist-library/reactive-md-minimal-react-preset.js +26 -0
  59. package/dist-library/reactive-md-minimal-styles.js +80 -0
  60. package/dist-library/reactive-md-minimal.css +2 -0
  61. package/dist-library/reactive-md-pdf.js +7582 -0
  62. package/dist-library/reactive-md-plugin-chart.js +13 -0
  63. package/dist-library/reactive-md-plugin-data.js +17 -0
  64. package/dist-library/reactive-md-plugin-diagram.js +18 -0
  65. package/dist-library/reactive-md-plugin-forms.js +18 -0
  66. package/dist-library/reactive-md-plugin-gallery.js +12 -0
  67. package/dist-library/reactive-md-plugin-navigation.js +15 -0
  68. package/dist-library/reactive-md-plugin-network.js +222 -0
  69. package/dist-library/reactive-md-plugin-plot.js +24 -0
  70. package/dist-library/reactive-md-print.css +5 -0
  71. package/dist-library/reactive-md-react-minimal.js +28 -0
  72. package/dist-library/reactive-md-react-server.js +34 -32
  73. package/dist-library/reactive-md-react-unstyled.js +14 -9
  74. package/dist-library/reactive-md-react.js +14 -9
  75. package/dist-library/reactive-md-runtime-browser.js +847 -15
  76. package/dist-library/reactive-md-runtime.js +3 -3
  77. package/dist-library/reactive-md-sdk.js +8 -6
  78. package/dist-library/reactive-md-standalone-configured.js +16 -0
  79. package/dist-library/reactive-md-standalone-host.js +9 -438
  80. package/dist-library/reactive-md-testing-browser.js +5 -4
  81. package/dist-library/reactive-md-testing-react.js +46 -44
  82. package/dist-library/reactive-md-testing.js +45 -44
  83. package/dist-library/reactive-md-vite.js +135 -37
  84. package/dist-library/reactive-md.css +1 -1
  85. package/dist-library/reactive-md.js +590 -498
  86. package/dist-library/registry-B9NGct4d.js +20 -0
  87. package/dist-library/registry-core-Bbad9Bm2.js +479 -0
  88. package/dist-library/{resources-BGt8mpDA.js → resources-D2GDQS0p.js} +45 -45
  89. package/dist-library/{runtime-Dkq7ldyg.js → runtime-B2fxeveq.js} +1 -1
  90. package/dist-library/runtime-kcA7bG7G.js +1282 -0
  91. package/dist-library/sample-bP4zHB3L.js +289 -0
  92. package/dist-library/{schema-ZFufO8V0.js → schema-BufhKUSM.js} +12 -11
  93. package/dist-library/sdk-core-BoJT1SIt.js +1166 -0
  94. package/dist-library/session-core-nmJHuR9c.js +452 -0
  95. package/dist-library/{shareable-DDVL4Fi9.js → shareable-DpbE-59H.js} +250 -283
  96. package/dist-library/tooltip-layer-HDLrSWs0.js +28 -0
  97. package/dist-library/types/authoring/catalog.d.ts +2 -3
  98. package/dist-library/types/authoring/editor-i18n.d.ts +1 -1
  99. package/dist-library/types/authoring/index.d.ts +1 -1
  100. package/dist-library/types/authoring/insert.d.ts +1 -1
  101. package/dist-library/types/authoring/templates.d.ts +2 -2
  102. package/dist-library/types/build/diagnostics.d.ts +1 -1
  103. package/dist-library/types/build/host.d.ts +1 -1
  104. package/dist-library/types/build/index.d.ts +1 -1
  105. package/dist-library/types/build/notices.d.ts +1 -1
  106. package/dist-library/types/build/resources.d.ts +1 -1
  107. package/dist-library/types/build/vite.d.ts +1 -1
  108. package/dist-library/types/compiler/index.d.ts +2 -2
  109. package/dist-library/types/compiler/result.d.ts +1 -1
  110. package/dist-library/types/compiler/standard.d.ts +2 -2
  111. package/dist-library/types/compiler/types.d.ts +1 -1
  112. package/dist-library/types/components/{controls.d.ts → controls/controls.d.ts} +2 -3
  113. package/dist-library/types/components/{numeric-sliders.d.ts → controls/numeric-sliders.d.ts} +1 -1
  114. package/dist-library/types/components/{gallery.d.ts → gallery/gallery.d.ts} +1 -1
  115. package/dist-library/types/components/{layout.d.ts → layout/layout.d.ts} +1 -1
  116. package/dist-library/types/components/minimal-preset.d.ts +2 -0
  117. package/dist-library/types/components/mount-preset.d.ts +4 -0
  118. package/dist-library/types/components/network/submit-button.d.ts +10 -0
  119. package/dist-library/types/components/plot/coordinate.d.ts +2 -0
  120. package/dist-library/types/components/plugins/chart.d.ts +2 -0
  121. package/dist-library/types/components/plugins/data.d.ts +2 -0
  122. package/dist-library/types/components/plugins/diagram.d.ts +2 -0
  123. package/dist-library/types/components/plugins/forms.d.ts +2 -0
  124. package/dist-library/types/components/plugins/gallery.d.ts +2 -0
  125. package/dist-library/types/components/plugins/navigation.d.ts +2 -0
  126. package/dist-library/types/components/plugins/network.d.ts +2 -0
  127. package/dist-library/types/components/plugins/plot.d.ts +2 -0
  128. package/dist-library/types/components/shared/visual-frame.d.ts +12 -0
  129. package/dist-library/types/components/{visuals.d.ts → shared/visuals.d.ts} +1 -7
  130. package/dist-library/types/components/{data-table.d.ts → table/data-table.d.ts} +2 -2
  131. package/dist-library/types/export/component-state.d.ts +1 -1
  132. package/dist-library/types/export/index.d.ts +2 -1
  133. package/dist-library/types/export/print-document.d.ts +18 -0
  134. package/dist-library/types/export/render-markup.d.ts +23 -0
  135. package/dist-library/types/export/requirements.d.ts +1 -1
  136. package/dist-library/types/export/resources.d.ts +1 -1
  137. package/dist-library/types/export/restoration.d.ts +1 -1
  138. package/dist-library/types/export-assets/index.d.ts +25 -0
  139. package/dist-library/types/local/compilation/compiler-attributes.d.ts +8 -0
  140. package/dist-library/types/local/compilation/compiler-bindings.d.ts +19 -0
  141. package/dist-library/types/local/compilation/compiler-capabilities.d.ts +3 -0
  142. package/dist-library/types/local/compilation/compiler-core.d.ts +11 -3
  143. package/dist-library/types/local/compilation/compiler-declarations.d.ts +32 -0
  144. package/dist-library/types/local/compilation/compiler-expressions.d.ts +32 -0
  145. package/dist-library/types/local/compilation/compiler-services.d.ts +62 -16
  146. package/dist-library/types/local/compilation/compiler-structure.d.ts +38 -3
  147. package/dist-library/types/local/compilation/compiler-tables.d.ts +30 -0
  148. package/dist-library/types/local/compilation/compiler-validation.d.ts +15 -0
  149. package/dist-library/types/local/compilation/compiler-values.d.ts +39 -1
  150. package/dist-library/types/local/compilation/compiler.d.ts +7 -14
  151. package/dist-library/types/local/compilation/dependencies.d.ts +1 -1
  152. package/dist-library/types/local/compilation/session/incremental.d.ts +75 -0
  153. package/dist-library/types/local/{session → compilation/session}/row-reuse.d.ts +1 -1
  154. package/dist-library/types/local/{session/compiler-cache.d.ts → compilation/session/semantic-cache.d.ts} +5 -19
  155. package/dist-library/types/local/compilation/streaming.d.ts +27 -0
  156. package/dist-library/types/local/configuration/capability-policy.d.ts +3 -0
  157. package/dist-library/types/local/{compilation → configuration}/component-kernel.d.ts +3 -79
  158. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +1104 -1056
  159. package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +731 -0
  160. package/dist-library/types/local/configuration/diagnostics.d.ts +1 -1
  161. package/dist-library/types/local/configuration/kernel-value-rules.d.ts +66 -0
  162. package/dist-library/types/local/configuration/official-leaf-syntax.d.ts +24 -0
  163. package/dist-library/types/local/configuration/options-core.d.ts +5 -4
  164. package/dist-library/types/local/configuration/options.d.ts +2 -1
  165. package/dist-library/types/local/configuration/portable-options.d.ts +1 -1
  166. package/dist-library/types/local/configuration/schema-core.d.ts +1 -1
  167. package/dist-library/types/local/configuration/schema.d.ts +1 -1
  168. package/dist-library/types/local/css/author-css.d.ts +66 -0
  169. package/dist-library/types/local/evaluation/computations.d.ts +2 -2
  170. package/dist-library/types/local/evaluation/expression/compile.d.ts +30 -0
  171. package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -0
  172. package/dist-library/types/local/evaluation/expression/inference.d.ts +4 -0
  173. package/dist-library/types/local/evaluation/expression/syntax.d.ts +72 -0
  174. package/dist-library/types/local/evaluation/expression/values.d.ts +56 -0
  175. package/dist-library/types/local/evaluation/{math-display.d.ts → math/display.d.ts} +2 -2
  176. package/dist-library/types/local/evaluation/math/evaluation.d.ts +10 -0
  177. package/dist-library/types/local/evaluation/{math.d.ts → math/latex.d.ts} +58 -17
  178. package/dist-library/types/local/evaluation/{math-sample.d.ts → math/sample.d.ts} +4 -2
  179. package/dist-library/types/local/evaluation/math/syntax.d.ts +72 -0
  180. package/dist-library/types/local/evaluation/validation.d.ts +1 -1
  181. package/dist-library/types/local/html/extended-fragment.d.ts +41 -0
  182. package/dist-library/types/local/html/html-details.d.ts +1 -1
  183. package/dist-library/types/local/html/html-entities.d.ts +11 -2
  184. package/dist-library/types/local/html/html-recovery.d.ts +1 -1
  185. package/dist-library/types/local/html/html-table.d.ts +1 -1
  186. package/dist-library/types/local/html/html.d.ts +40 -4
  187. package/dist-library/types/local/index.d.ts +14 -13
  188. package/dist-library/types/local/parsing/author-markdown.d.ts +11 -0
  189. package/dist-library/types/local/{markdown → parsing}/fast-markdown.d.ts +1 -1
  190. package/dist-library/types/local/{markdown → parsing}/footnotes.d.ts +1 -1
  191. package/dist-library/types/local/{markdown → parsing}/heading-anchors.d.ts +1 -1
  192. package/dist-library/types/local/parsing/html-attributes.d.ts +14 -0
  193. package/dist-library/types/local/parsing/parse-budget.d.ts +1 -1
  194. package/dist-library/types/local/{session → parsing}/parse-session.d.ts +5 -5
  195. package/dist-library/types/local/parsing/parser-capabilities.d.ts +7 -2
  196. package/dist-library/types/local/parsing/parser-convert.d.ts +26 -0
  197. package/dist-library/types/local/parsing/parser-core.d.ts +10 -4
  198. package/dist-library/types/local/parsing/parser-internals.d.ts +54 -0
  199. package/dist-library/types/local/parsing/parser-region.d.ts +46 -0
  200. package/dist-library/types/local/parsing/parser-standard.d.ts +3 -0
  201. package/dist-library/types/local/parsing/parser-tags.d.ts +108 -0
  202. package/dist-library/types/local/parsing/parser.d.ts +3 -3
  203. package/dist-library/types/local/{markdown → parsing}/plain-paragraphs.d.ts +1 -1
  204. package/dist-library/types/local/parsing/rmd-recovery.d.ts +1 -1
  205. package/dist-library/types/local/parsing/theme-declaration.d.ts +22 -0
  206. package/dist-library/types/local/rendering/document/ExtendedHtmlFragment.d.ts +14 -0
  207. package/dist-library/types/local/rendering/document/LocalDocumentView.d.ts +5 -0
  208. package/dist-library/types/local/rendering/{LocalDocumentView.d.ts → document/LocalDocumentViewCore.d.ts} +48 -9
  209. package/dist-library/types/local/rendering/document/LocalReactiveDocumentCore.d.ts +6 -0
  210. package/dist-library/types/local/rendering/document/render-nodes.d.ts +24 -0
  211. package/dist-library/types/local/rendering/document/use-author-script.d.ts +3 -0
  212. package/dist-library/types/local/rendering/document/use-color-scheme.d.ts +10 -0
  213. package/dist-library/types/local/rendering/document/validation-state.d.ts +31 -0
  214. package/dist-library/types/local/rendering/document/view-render-context.d.ts +146 -0
  215. package/dist-library/types/local/rendering/{view-revision.d.ts → document/view-revision.d.ts} +31 -4
  216. package/dist-library/types/local/rendering/render-types.d.ts +1 -1
  217. package/dist-library/types/local/{widgets/table-surface.d.ts → rendering/table/data-table.d.ts} +3 -0
  218. package/dist-library/types/local/rendering/table/table-numeric-columns.d.ts +7 -0
  219. package/dist-library/types/local/runtime/author-script-protocol.d.ts +59 -0
  220. package/dist-library/types/local/runtime/retention.d.ts +1 -1
  221. package/dist-library/types/local/runtime/runtime-document.d.ts +71 -0
  222. package/dist-library/types/local/runtime/runtime-migration.d.ts +19 -0
  223. package/dist-library/types/local/runtime/runtime-values.d.ts +39 -0
  224. package/dist-library/types/local/runtime/runtime.d.ts +4 -2
  225. package/dist-library/types/local/runtime/state.d.ts +1 -1
  226. package/dist-library/types/local/source/authoring-syntax.d.ts +48 -0
  227. package/dist-library/types/local/source/authoring.d.ts +1 -1
  228. package/dist-library/types/local/source/source-context.d.ts +23 -0
  229. package/dist-library/types/local/source/source-migration.d.ts +2 -2
  230. package/dist-library/types/local/transport/compile-patch.d.ts +1 -1
  231. package/dist-library/types/local/transport/flat-compiled-data.d.ts +1 -1
  232. package/dist-library/types/local/transport/shared-data.d.ts +1 -1
  233. package/dist-library/types/local/transport/worker-handler.d.ts +30 -0
  234. package/dist-library/types/local/transport/worker-job.d.ts +28 -0
  235. package/dist-library/types/local/transport/worker.d.ts +32 -46
  236. package/dist-library/types/local/{contracts/types.d.ts → types.d.ts} +78 -21
  237. package/dist-library/types/pdf.d.ts +22 -0
  238. package/dist-library/types/presets/identity.d.ts +1 -0
  239. package/dist-library/types/presets/minimal.d.ts +2 -0
  240. package/dist-library/types/presets/plugin-packs.d.ts +1 -0
  241. package/dist-library/types/react/component-api.d.ts +20 -4
  242. package/dist-library/types/react/component-primitives.d.ts +10 -10
  243. package/dist-library/types/react/component-utils.d.ts +9 -1
  244. package/dist-library/types/react/index.d.ts +6 -5
  245. package/dist-library/types/{local/theme/i18n.d.ts → react/localization.d.ts} +2 -2
  246. package/dist-library/types/react/minimal.d.ts +13 -0
  247. package/dist-library/types/react/package-core.d.ts +67 -0
  248. package/dist-library/types/react/package.d.ts +3 -67
  249. package/dist-library/types/react/runtime/common.d.ts +1 -1
  250. package/dist-library/types/react/sdk-core.d.ts +115 -0
  251. package/dist-library/types/react/sdk.d.ts +4 -110
  252. package/dist-library/types/react/server.d.ts +2 -2
  253. package/dist-library/types/react/use-draft-field.d.ts +5 -1
  254. package/dist-library/types/runtime-services/browser/duplex.d.ts +163 -0
  255. package/dist-library/types/runtime-services/browser/http-sse.d.ts +117 -0
  256. package/dist-library/types/runtime-services/browser/index.d.ts +2 -1
  257. package/dist-library/types/runtime-services/component-state.d.ts +1 -1
  258. package/dist-library/types/runtime-services/index.d.ts +2 -0
  259. package/dist-library/types/runtime-services/network.d.ts +86 -0
  260. package/dist-library/types/runtime-services/runtime.d.ts +1 -1
  261. package/dist-library/types/sdk/config.d.ts +1 -1
  262. package/dist-library/types/sdk/index.d.ts +1 -0
  263. package/dist-library/types/sdk/props.d.ts +1 -1
  264. package/dist-library/types/sdk/registry-core.d.ts +1 -1
  265. package/dist-library/types/sdk/theme.d.ts +5 -4
  266. package/dist-library/types/sdk/types.d.ts +2 -2
  267. package/dist-library/types/shareable.d.ts +6 -5
  268. package/dist-library/types/standalone/diagnostics.d.ts +1 -1
  269. package/dist-library/types/standalone/host.d.ts +5 -0
  270. package/dist-library/types/standalone/payload.d.ts +1 -1
  271. package/dist-library/types/standalone/prepare.d.ts +2 -2
  272. package/dist-library/types/standalone/session-core.d.ts +68 -0
  273. package/dist-library/types/standalone/session.d.ts +6 -68
  274. package/dist-library/types/themes/contract.d.ts +7 -0
  275. package/dist-library/types/{local/theme/theme.d.ts → themes/document-theme.d.ts} +4 -3
  276. package/dist-library/types/vite/client.d.ts +19 -0
  277. package/dist-library/types/vite/index.d.ts +18 -3
  278. package/dist-library/types/vite/registration.d.ts +2 -2
  279. package/dist-library/{types-BFCrMrg0.js → types-BeNtPqdY.js} +1 -1
  280. package/dist-library/validation-BEBA_HvS.js +1121 -0
  281. package/dist-library/visual-frame-CyV1FXzs.js +48 -0
  282. package/dist-library/visuals-B5KSafVk.js +3 -0
  283. package/dist-library/visuals-BZbZYA7w.js +72572 -0
  284. package/dist-standalone/reactive-md-standalone.css +1 -1
  285. package/dist-standalone/reactive-md-standalone.js +146 -137
  286. package/docs/README-ch.md +16 -11
  287. package/docs/README.md +16 -11
  288. package/docs/compatibility/compatibility-ch.md +8 -8
  289. package/docs/compatibility/compatibility-en.md +8 -8
  290. package/docs/compatibility/source-versioning-ch.md +1 -1
  291. package/docs/compatibility/source-versioning-en.md +1 -1
  292. package/docs/development/component-development-ch.md +2 -2
  293. package/docs/development/component-development-en.md +2 -2
  294. package/docs/development/component-development-reference-ch.md +4 -4
  295. package/docs/development/component-development-reference-en.md +4 -4
  296. package/docs/development/component-protocol-ch.md +14 -14
  297. package/docs/development/component-protocol-en.md +14 -14
  298. package/docs/development/extension-tutorial-ch.md +308 -0
  299. package/docs/development/extension-tutorial-en.md +308 -0
  300. package/docs/development/local-module-layout-ch.md +10 -50
  301. package/docs/development/local-module-layout-en.md +9 -49
  302. package/docs/development/performance-overview-ch.md +174 -154
  303. package/docs/development/performance-overview-en.md +174 -154
  304. package/docs/guides/local-guide-ch.md +2 -2
  305. package/docs/guides/local-guide-en.md +2 -2
  306. package/docs/integration/author-tools-ch.md +2 -2
  307. package/docs/integration/author-tools-en.md +2 -2
  308. package/docs/integration/compiler-ch.md +4 -2
  309. package/docs/integration/compiler-en.md +4 -2
  310. package/docs/integration/directory-discovery-ch.md +5 -1
  311. package/docs/integration/directory-discovery-en.md +5 -1
  312. package/docs/integration/editor-ch.md +35 -5
  313. package/docs/integration/editor-en.md +42 -4
  314. package/docs/integration/extension-sdk-ch.md +6 -4
  315. package/docs/integration/extension-sdk-en.md +6 -4
  316. package/docs/integration/local-integration-ch.md +201 -19
  317. package/docs/integration/local-integration-en.md +194 -18
  318. package/docs/integration/network-host-ch.md +75 -0
  319. package/docs/integration/network-host-en.md +75 -0
  320. package/docs/integration/shareable-export-ch.md +58 -16
  321. package/docs/integration/shareable-export-en.md +57 -15
  322. package/docs/reference/html-compatibility-ch.md +20 -67
  323. package/docs/reference/html-compatibility-en.md +19 -64
  324. package/docs/reference/local-interaction-syntax-ch.md +199 -26
  325. package/docs/reference/local-interaction-syntax-en.md +194 -27
  326. package/docs/reference/public-api-ch.md +416 -0
  327. package/docs/reference/public-api-en.md +416 -0
  328. package/docs/reference/theme-protocol-ch.md +27 -8
  329. package/docs/reference/theme-protocol-en.md +46 -8
  330. package/docs/releases/release-0.4.0-ch.md +2 -2
  331. package/docs/releases/release-0.4.0-en.md +2 -2
  332. package/docs/releases/release-0.8.0-ch.md +19 -3
  333. package/docs/releases/release-0.8.0-en.md +19 -3
  334. package/docs/releases/release-0.9.0-ch.md +44 -0
  335. package/docs/releases/release-0.9.0-en.md +44 -0
  336. package/docs/releases/release-0.9.1-ch.md +29 -0
  337. package/docs/releases/release-0.9.1-en.md +29 -0
  338. package/examples/component-package/README-ch.md +1 -1
  339. package/examples/component-package/README.md +1 -1
  340. package/examples/conformance/README-ch.md +3 -3
  341. package/examples/conformance/README.md +3 -3
  342. package/examples/game-2048-package/README-ch.md +3 -9
  343. package/examples/game-2048-package/README.md +8 -12
  344. package/examples/integration/README-ch.md +21 -2
  345. package/examples/integration/README.md +21 -2
  346. package/examples/integration/extension-sdk/README-ch.md +1 -1
  347. package/examples/integration/extension-sdk/README.md +1 -1
  348. package/examples/integration/streaming/index.html +48 -0
  349. package/examples/integration/streaming/main.js +175 -0
  350. package/examples/integration/streaming/package.json +13 -0
  351. package/examples/integration/streaming/worker.js +3 -0
  352. package/examples/local/README-ch.md +3 -3
  353. package/examples/local/README.md +2 -2
  354. package/examples/local/minimal-budget.reactive.md +48 -0
  355. package/examples/minimal-extension/README-ch.md +78 -0
  356. package/examples/minimal-extension/README.md +78 -0
  357. package/examples/minimal-extension/index.html +15 -0
  358. package/examples/minimal-extension/package.json +26 -0
  359. package/examples/minimal-extension/sample/document.reactive.md +10 -0
  360. package/examples/minimal-extension/scripts/build.mjs +32 -0
  361. package/examples/minimal-extension/scripts/export.mjs +72 -0
  362. package/examples/minimal-extension/scripts/test-node.mjs +75 -0
  363. package/examples/minimal-extension/src/extension.tsx +90 -0
  364. package/examples/minimal-extension/src/preview.tsx +12 -0
  365. package/examples/minimal-extension/src/source.ts +4 -0
  366. package/examples/minimal-extension/tsconfig.json +14 -0
  367. package/examples/network-survey/README.md +200 -0
  368. package/examples/network-survey/index.html +49 -0
  369. package/examples/network-survey/package.json +26 -0
  370. package/examples/network-survey/sample/document.reactive.md +51 -0
  371. package/examples/network-survey/src/components.tsx +325 -0
  372. package/examples/network-survey/src/host.ts +316 -0
  373. package/examples/network-survey/src/main.tsx +91 -0
  374. package/examples/network-survey/src/source.ts +1 -0
  375. package/examples/network-survey/tsconfig.json +26 -0
  376. package/examples/network-survey/vite.config.ts +227 -0
  377. package/examples/sci-fi-theme/README-ch.md +4 -2
  378. package/examples/sci-fi-theme/README.md +4 -2
  379. package/examples/sci-fi-theme/demo/acceptance.reactive.md +454 -0
  380. package/examples/sci-fi-theme/demo/demo.css +129 -23
  381. package/examples/sci-fi-theme/demo/document.reactive.md +27 -6
  382. package/examples/sci-fi-theme/demo/main.tsx +45 -10
  383. package/examples/sci-fi-theme/docs/design-system-ch.md +6 -6
  384. package/examples/sci-fi-theme/package.json +2 -1
  385. package/examples/sci-fi-theme/src/components.css +1064 -154
  386. package/examples/sci-fi-theme/src/notch.css +142 -0
  387. package/examples/sci-fi-theme/src/sci-fi.css +3 -1
  388. package/examples/sci-fi-theme/src/theme.ts +2 -0
  389. package/examples/sci-fi-theme/src/tokens.css +512 -408
  390. package/examples/tetris-package/README-ch.md +4 -4
  391. package/examples/tetris-package/README.md +4 -4
  392. package/package.json +70 -3
  393. package/dist-library/LocalDocumentView-6trX7xJc.js +0 -97920
  394. package/dist-library/compiler--ea2CKQF.js +0 -61
  395. package/dist-library/component-state-Cq2K5gkS.js +0 -490
  396. package/dist-library/options-CX5m5n-J.js +0 -115
  397. package/dist-library/runtime-C-sbfpOX.js +0 -1157
  398. package/dist-library/types/local/contracts/locale.d.ts +0 -1
  399. package/dist-library/types/local/contracts/version.d.ts +0 -2
  400. package/dist-library/types/local/evaluation/dates.d.ts +0 -2
  401. package/dist-library/types/local/evaluation/expression.d.ts +0 -47
  402. package/dist-library/types/local/markdown/markdown-structure.d.ts +0 -3
  403. package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +0 -36
  404. package/dist-library/types/local/session/incremental.d.ts +0 -48
  405. package/dist-library/types/local/source/node-walk.d.ts +0 -3
  406. package/dist-library/types/local/source/text-length.d.ts +0 -13
  407. package/dist-library/types/local/theme/theme-name.d.ts +0 -3
  408. package/dist-library/types/local/widgets/visuals.d.ts +0 -25
  409. package/dist-library/types/react/default-theme.d.ts +0 -6
  410. package/dist-library/validation-W-bmny-x.js +0 -2253
  411. package/docs/development/releasing-ch.md +0 -12
  412. package/docs/development/releasing-en.md +0 -12
  413. package/docs/integration/codemirror-ch.md +0 -52
  414. package/docs/integration/codemirror-en.md +0 -29
  415. package/docs/integration/repository-split-ch.md +0 -40
  416. package/docs/integration/repository-split-en.md +0 -23
  417. package/docs/reference/computations-formatting-ch.md +0 -89
  418. package/docs/reference/computations-formatting-en.md +0 -89
  419. package/docs/reference/constraints-collections-ch.md +0 -104
  420. package/docs/reference/constraints-collections-en.md +0 -104
  421. package/docs/reference/local-components-v2-ch.md +0 -140
  422. package/docs/reference/local-components-v2-en.md +0 -106
  423. package/docs/reference/tolerance-ch.md +0 -64
  424. package/docs/reference/tolerance-en.md +0 -57
  425. /package/dist-library/types/components/{chart-motion.d.ts → chart/chart-motion.d.ts} +0 -0
  426. /package/dist-library/types/components/{default-chart-types.d.ts → chart/default-chart-types.d.ts} +0 -0
  427. /package/dist-library/types/components/{default-chart.d.ts → chart/default-chart.d.ts} +0 -0
  428. /package/dist-library/types/components/{diagram-inspector.d.ts → diagram/diagram-inspector.d.ts} +0 -0
  429. /package/dist-library/types/{local/widgets/diagram-layout.d.ts → components/diagram/layout.d.ts} +0 -0
  430. /package/dist-library/types/components/{mafs-plot-grid.d.ts → plot/mafs-plot-grid.d.ts} +0 -0
  431. /package/dist-library/types/components/{mafs-visuals.d.ts → plot/mafs-visuals.d.ts} +0 -0
  432. /package/dist-library/types/components/{use-hydrated.d.ts → shared/use-hydrated.d.ts} +0 -0
  433. /package/dist-library/types/local/{theme/colors.d.ts → configuration/color-values.d.ts} +0 -0
  434. /package/dist-library/types/local/evaluation/{collection-functions.d.ts → expression/collection-functions.d.ts} +0 -0
  435. /package/dist-library/types/local/evaluation/{data-functions.d.ts → expression/data-functions.d.ts} +0 -0
  436. /package/dist-library/types/local/evaluation/{formatting.d.ts → expression/formatting.d.ts} +0 -0
  437. /package/dist-library/types/local/{markdown → parsing}/markdown-blocks.d.ts +0 -0
  438. /package/dist-library/types/local/{widgets → rendering/code}/code-block.d.ts +0 -0
  439. /package/dist-library/types/local/{widgets → rendering/code}/code-languages.d.ts +0 -0
  440. /package/dist-library/types/local/{widgets → rendering/image}/image-view.d.ts +0 -0
  441. /package/dist-library/types/local/{widgets → rendering}/math-view.d.ts +0 -0
@@ -0,0 +1,48 @@
1
+ import type { LocalNode, SourceRange } from '../types.js';
2
+ export interface RawAttribute {
3
+ name: string;
4
+ nameRange: SourceRange;
5
+ /** Content between the quotes, without the quotes themselves. */
6
+ valueRange?: SourceRange;
7
+ quoteStart?: number;
8
+ quoteEnd?: number;
9
+ unquoted?: boolean;
10
+ }
11
+ export interface RawTag {
12
+ start: number;
13
+ /** Offset just past `>`. */
14
+ end: number;
15
+ /** Offset of `>`. */
16
+ contentEnd: number;
17
+ name: string;
18
+ nameRange: SourceRange;
19
+ closing: boolean;
20
+ selfClosing: boolean;
21
+ attrs: RawAttribute[];
22
+ }
23
+ export declare function readTagAt(source: string, start: number): RawTag | null;
24
+ export declare function closingTagOf(source: string, node: LocalNode, openingEnd: number): RawTag | null;
25
+ export interface RawInterpolation {
26
+ /** Start of `{{`. */
27
+ start: number;
28
+ /** Offset just past `}}`. */
29
+ end: number;
30
+ innerStart: number;
31
+ innerEnd: number;
32
+ }
33
+ /** Mirrors the compiler's attribute-template scanner, including `\{{` escapes. */
34
+ export declare function rawInterpolations(source: string, start: number, end: number): RawInterpolation[];
35
+ /** Attribute decoding matches the parser while retaining original boundaries. */
36
+ export declare function decodedAttribute(source: string, range: SourceRange): {
37
+ text: string;
38
+ offsets: number[];
39
+ };
40
+ export interface IdentifierRange {
41
+ name: string;
42
+ range: SourceRange;
43
+ }
44
+ /** Identifiers that are real references: strings, literals, functions are skipped. */
45
+ export declare function expressionIdentifiers(source: string, start: number, end: number): IdentifierRange[];
46
+ export declare function isIdentifierStart(character: string | undefined): boolean;
47
+ export declare function isIdentifierPart(character: string | undefined): boolean;
48
+ export declare function isWhitespace(character: string | undefined): boolean;
@@ -1,4 +1,4 @@
1
- import type { Diagnostic, LocalCompileOptions, LocalDocument, SourceRange } from '../contracts/types.js';
1
+ import type { Diagnostic, LocalCompileOptions, LocalDocument, SourceRange } from '../types.js';
2
2
  /**
3
3
  * DOM-free authoring services for the local interaction syntax.
4
4
  *
@@ -1,3 +1,4 @@
1
+ import type { LocalNode } from '../types.js';
1
2
  /** One physical source line (LF, CRLF or CR terminated). */
2
3
  export interface SourceLineFacts {
3
4
  readonly from: number;
@@ -61,3 +62,25 @@ export declare class MappedSource {
61
62
  text(): string;
62
63
  at(offset: number, fallback: number): number;
63
64
  }
65
+ /**
66
+ * Author-visible character counting.
67
+ *
68
+ * Unicode code points are the unit authors see: `len()` in expressions,
69
+ * `min-length`/`max-length` on text controls and initial-value checks all use
70
+ * this function. Combining marks are not merged into grapheme clusters, and an
71
+ * unpaired surrogate counts as one code point.
72
+ *
73
+ * Source offsets, line/column positions and defensive resource budgets remain
74
+ * UTF-16 code units (see `limits.ts`); those are machine limits, not counts
75
+ * authors compare against visible text.
76
+ */
77
+ export declare function countLocalCodePoints(value: string): number;
78
+ /**
79
+ * Prefix of at most `end` UTF-16 code units that never ends in the middle of a
80
+ * surrogate pair. Budgets for diagnostics and display text are counted in
81
+ * code units, but the truncated text must remain well-formed Unicode, so a
82
+ * trailing high surrogate is dropped instead of being left unpaired.
83
+ */
84
+ export declare function localCodeUnitPrefix(value: string, end: number): string;
85
+ /** Ordered traversal with memory proportional to depth, independent of JS stack. */
86
+ export declare function walkLocalNodes(nodes: readonly LocalNode[], postorder?: boolean): Generator<LocalNode>;
@@ -1,5 +1,5 @@
1
- import { LOCAL_SYNTAX_VERSION } from '../contracts/version.js';
2
- import type { Diagnostic, SourceRange } from '../contracts/types.js';
1
+ import { LOCAL_SYNTAX_VERSION } from '../types.js';
2
+ import type { Diagnostic, SourceRange } from '../types.js';
3
3
  export interface LocalSourceVersion {
4
4
  declaredVersion: string | null;
5
5
  effectiveVersion: string;
@@ -1,4 +1,4 @@
1
- import type { Diagnostic, LocalCompileResult, LocalNode, LocalRecovery } from '../contracts/types.js';
1
+ import type { Diagnostic, LocalCompileResult, LocalNode, LocalRecovery } from '../types.js';
2
2
  /**
3
3
  * Wire protocol for incremental compile results.
4
4
  *
@@ -1,4 +1,4 @@
1
- import type { LocalCompileResult } from '../contracts/types.js';
1
+ import type { LocalCompileResult } from '../types.js';
2
2
  /** Plain compiler data only: no executable values, class instances or cycles. */
3
3
  type Primitive = string | number | boolean | null | undefined;
4
4
  type Entry = [key: string, reference: number];
@@ -1,4 +1,4 @@
1
- import type { LocalCompileResult } from '../contracts/types.js';
1
+ import type { LocalCompileResult } from '../types.js';
2
2
  export interface SharedDataResult<T> {
3
3
  value: T;
4
4
  reused: number;
@@ -0,0 +1,30 @@
1
+ import type { LocalCompileResponse } from './worker.js';
2
+ import { LocalCompileSession } from '../compilation/session/incremental.js';
3
+ import { type LocalSourceEdit } from './compile-patch.js';
4
+ export interface LocalCompileWorkerScope {
5
+ onmessage: ((event: any) => void) | null;
6
+ /** Classic full/failure shape; patch frames are delivered to patch-v1 clients. */
7
+ postMessage(message: LocalCompileResponse): void;
8
+ }
9
+ export interface LocalCompileWorkerControlMessage {
10
+ readonly control: 'dispose' | 'cancel-preparation';
11
+ }
12
+ export interface LocalCompileWorkerControl {
13
+ dispose(): void;
14
+ cancelPreparation(): void;
15
+ readonly disposed: boolean;
16
+ }
17
+ export interface LocalCompileWorkerOptions {
18
+ /** Test seam; production uses `createLocalCompileSession`. */
19
+ createSession?(): LocalCompileSession;
20
+ /** Idle delay before session preparation; defaults to `LOCAL_COMPILE_PREPARATION_DELAY_MS`. */
21
+ preparationDelay?: number;
22
+ }
23
+ export declare function isPatchEdit(value: unknown): value is LocalSourceEdit;
24
+ /**
25
+ * Install the worker-side compile handler on a DedicatedWorkerGlobalScope-like
26
+ * object. Returns a cleanup handle (ignored by existing callers) and accepts
27
+ * `{control: 'dispose' | 'cancel-preparation'}` messages for transports that
28
+ * prefer lifecycle messages over the handle.
29
+ */
30
+ export declare function startLocalCompileWorker(scope?: LocalCompileWorkerScope, options?: LocalCompileWorkerOptions): LocalCompileWorkerControl;
@@ -0,0 +1,28 @@
1
+ import type { LocalCompileOptions, LocalCompileResult } from '../types.js';
2
+ import { type AuthorAnalysis } from '../source/authoring.js';
3
+ /** Editors are coalesced for this long before a compile is dispatched. */
4
+ export declare const LOCAL_COMPILE_DELAY_MS = 150;
5
+ /**
6
+ * Idle delay after a successful result before the worker asks the session to
7
+ * prepare the next revision. A new request cancels the pending preparation.
8
+ */
9
+ export declare const LOCAL_COMPILE_PREPARATION_DELAY_MS = 200;
10
+ export declare function messageOf(error: unknown): string;
11
+ export declare function now(): number;
12
+ export declare function safeDuration(value: number): number;
13
+ export declare function analyzeResult(source: string, options: LocalCompileOptions | undefined, result: LocalCompileResult): AuthorAnalysis;
14
+ /**
15
+ * Copy the option values that affect routing, budgets and host components.
16
+ * Invalid values are preserved so the compiler can report them; known keys are
17
+ * snapshotted so a caller mutating its object after `schedule` cannot widen an
18
+ * in-flight compile. `maxParseWork` and `maxMarkdownDepth` are copied even
19
+ * before their declarations land, so a queued job keeps its own budget.
20
+ */
21
+ export declare function snapshotCompileOptions(options: LocalCompileOptions | undefined): LocalCompileOptions | undefined;
22
+ /**
23
+ * Canonical job/transport signature. Extends the compiler's public key with
24
+ * the newer per-compile budgets once they exist, without modifying options.ts.
25
+ * Strict identity, including the recovery-strategy version for `strict:false`,
26
+ * comes from `localCompileOptionsKey`; both sides key the same snapshot.
27
+ */
28
+ export declare function localWorkerOptionsKey(options: LocalCompileOptions | undefined): string;
@@ -1,15 +1,8 @@
1
- import { type LocalCompileSession, type LocalIncrementalStats } from '../session/incremental.js';
2
1
  import { LOCAL_RESULT_PATCH_PROTOCOL, type LocalResultPatch, type LocalSourceEdit } from './compile-patch.js';
3
- import type { Diagnostic, LocalCompileOptions, LocalCompileResult } from '../contracts/types.js';
4
- import { type AuthorAnalysis } from '../source/authoring.js';
5
2
  import { FLAT_COMPILED_DATA_PROTOCOL, type FlatCompiledData } from './flat-compiled-data.js';
6
- /** Editors are coalesced for this long before a compile is dispatched. */
7
- export declare const LOCAL_COMPILE_DELAY_MS = 150;
8
- /**
9
- * Idle delay after a successful result before the worker asks the session to
10
- * prepare the next revision. A new request cancels the pending preparation.
11
- */
12
- export declare const LOCAL_COMPILE_PREPARATION_DELAY_MS = 200;
3
+ import type { Diagnostic, LocalCompileOptions, LocalCompileResult, LocalSourcePhase } from '../types.js';
4
+ import type { AuthorAnalysis } from '../source/authoring.js';
5
+ import { type LocalIncrementalStats } from '../compilation/session/incremental.js';
13
6
  export type LocalCompileProtocol = typeof LOCAL_RESULT_PATCH_PROTOCOL;
14
7
  export interface LocalCompileRequest {
15
8
  /** Opt into depth-independent full results. Absent on legacy clients. */
@@ -26,6 +19,13 @@ export interface LocalCompileRequest {
26
19
  * reference path.
27
20
  */
28
21
  options?: LocalCompileOptions;
22
+ /**
23
+ * Source generation phase. Omitted keeps the legacy final compile: the
24
+ * response then has the historical shape without `status`. `streaming`
25
+ * returns the provisional snapshot in the result itself; the transport does
26
+ * not alter or patch it.
27
+ */
28
+ sourcePhase?: LocalSourcePhase;
29
29
  /**
30
30
  * Advertised by a client that understands `patch-v1`. A worker echoes its
31
31
  * support on the full response, after which both sides may exchange edits
@@ -93,6 +93,8 @@ export interface LocalCompilePatchResponse {
93
93
  revision: number;
94
94
  patch: LocalResultPatch;
95
95
  duration: number;
96
+ /** Phase of the result this patch extends; present when the client asked for one. */
97
+ sourcePhase?: LocalSourcePhase;
96
98
  incremental?: Readonly<LocalIncrementalStats>;
97
99
  metrics?: LocalCompileWorkerMetrics;
98
100
  }
@@ -101,6 +103,8 @@ export type LocalCompileResponse = {
101
103
  ok: true;
102
104
  result: LocalCompileResult;
103
105
  duration: number;
106
+ /** Echo of the request phase; omitted for legacy clients. */
107
+ sourcePhase?: LocalSourcePhase;
104
108
  incremental?: Readonly<LocalIncrementalStats>;
105
109
  protocol?: LocalCompileProtocol;
106
110
  revision?: number;
@@ -152,15 +156,21 @@ export interface LocalCompileOutcome {
152
156
  metrics?: LocalCompileMetrics;
153
157
  /** Source revision when the worker negotiated `patch-v1`. */
154
158
  revision?: number;
159
+ /**
160
+ * Set for streaming snapshots and for callers that supplied a phase
161
+ * themselves. Legacy final jobs omit it and keep the historical shape.
162
+ */
163
+ sourcePhase?: LocalSourcePhase;
155
164
  }
156
165
  export interface LocalCompileSchedulerOptions {
157
166
  includeAuthorAnalysis?: boolean;
158
167
  createWorker(): LocalCompileWorker;
159
168
  /**
160
169
  * Defaults to compileLocal. Runs on the main thread only when the worker is
161
- * unavailable or failed. One-argument callbacks remain supported.
170
+ * unavailable or failed. One- and two-argument callbacks remain supported;
171
+ * an explicit source phase is passed as the third argument.
162
172
  */
163
- fallbackCompile?(source: string, options?: LocalCompileOptions): LocalCompileResult;
173
+ fallbackCompile?(source: string, options?: LocalCompileOptions, sourcePhase?: LocalSourcePhase): LocalCompileResult;
164
174
  onResult(outcome: LocalCompileOutcome): void;
165
175
  onPendingChange?(pending: boolean): void;
166
176
  onModeChange?(mode: LocalCompileMode, detail?: string): void;
@@ -176,13 +186,6 @@ export interface LocalCompileEditHint {
176
186
  baseSource: string;
177
187
  edit: LocalSourceEdit;
178
188
  }
179
- /**
180
- * Canonical job/transport signature. Extends the compiler's public key with
181
- * the newer per-compile budgets once they exist, without modifying options.ts.
182
- * Strict identity, including the recovery-strategy version for `strict:false`,
183
- * comes from `localCompileOptionsKey`; both sides key the same snapshot.
184
- */
185
- export declare function localWorkerOptionsKey(options: LocalCompileOptions | undefined): string;
186
189
  export declare function compileFailureDiagnostic(error: unknown): Diagnostic;
187
190
  /**
188
191
  * Debounces edits, keeps at most one compile in flight plus the latest source
@@ -213,8 +216,14 @@ export declare class LocalCompileScheduler {
213
216
  * any, is replaced. Options are copied so a later mutation cannot change the
214
217
  * permissions of an in-flight compile. An options-only edit still supersedes
215
218
  * an older result for the same source.
219
+ *
220
+ * `sourcePhase` is optional. Streaming snapshots keep the debounce; a
221
+ * snapshot that explicitly declares `final` is dispatched immediately so it
222
+ * can replace a queued intermediate one and settle as soon as any in-flight
223
+ * compile returns. Calls that declare no phase keep the historical debounce
224
+ * and wire shape.
216
225
  */
217
- schedule(source: string, options?: LocalCompileOptions, hint?: LocalCompileEditHint): void;
226
+ schedule(source: string, options?: LocalCompileOptions, hint?: LocalCompileEditHint, sourcePhase?: LocalSourcePhase): void;
218
227
  /** Stop the timer and terminate the worker. No callbacks fire afterwards. */
219
228
  dispose(): void;
220
229
  private drain;
@@ -237,29 +246,6 @@ export declare class LocalCompileScheduler {
237
246
  private setPending;
238
247
  private clearTimer;
239
248
  }
240
- export interface LocalCompileWorkerScope {
241
- onmessage: ((event: any) => void) | null;
242
- /** Classic full/failure shape; patch frames are delivered to patch-v1 clients. */
243
- postMessage(message: LocalCompileResponse): void;
244
- }
245
- export interface LocalCompileWorkerControlMessage {
246
- readonly control: 'dispose' | 'cancel-preparation';
247
- }
248
- export interface LocalCompileWorkerControl {
249
- dispose(): void;
250
- cancelPreparation(): void;
251
- readonly disposed: boolean;
252
- }
253
- export interface LocalCompileWorkerOptions {
254
- /** Test seam; production uses `createLocalCompileSession`. */
255
- createSession?(): LocalCompileSession;
256
- /** Idle delay before session preparation; defaults to `LOCAL_COMPILE_PREPARATION_DELAY_MS`. */
257
- preparationDelay?: number;
258
- }
259
- /**
260
- * Install the worker-side compile handler on a DedicatedWorkerGlobalScope-like
261
- * object. Returns a cleanup handle (ignored by existing callers) and accepts
262
- * `{control: 'dispose' | 'cancel-preparation'}` messages for transports that
263
- * prefer lifecycle messages over the handle.
264
- */
265
- export declare function startLocalCompileWorker(scope?: LocalCompileWorkerScope, options?: LocalCompileWorkerOptions): LocalCompileWorkerControl;
249
+ export { startLocalCompileWorker } from "./worker-handler.js";
250
+ export type { LocalCompileWorkerScope, LocalCompileWorkerControlMessage, LocalCompileWorkerControl, LocalCompileWorkerOptions } from "./worker-handler.js";
251
+ export { LOCAL_COMPILE_DELAY_MS, LOCAL_COMPILE_PREPARATION_DELAY_MS, messageOf, now, safeDuration, analyzeResult, snapshotCompileOptions, localWorkerOptionsKey } from "./worker-job.js";
@@ -1,6 +1,7 @@
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';
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
+ import type { ComponentNetwork, JsonPayload, NetworkConfig } from '../runtime-services/network.js';
4
5
  export interface SourceRange {
5
6
  start: number;
6
7
  end: number;
@@ -121,7 +122,7 @@ export interface LocalComputation {
121
122
  }
122
123
  export interface LocalBinding {
123
124
  /** Kernel value semantics, including ordered generic collections. */
124
- family?: import('../../sdk/types.js').LocalBindingFamily;
125
+ family?: import('../sdk/types.js').LocalBindingFamily;
125
126
  name: string;
126
127
  nodeIds: string[];
127
128
  type: LocalValueKind;
@@ -222,6 +223,18 @@ export interface LocalDocumentKernel {
222
223
  inlineMathReads?: boolean;
223
224
  }>>;
224
225
  }
226
+ /**
227
+ * Source generation phase supplied by a streaming host. Omitted keeps the
228
+ * historical final-compilation semantics; `strict` remains an independent
229
+ * structural-recovery switch.
230
+ */
231
+ export type LocalSourcePhase = 'streaming' | 'final';
232
+ /**
233
+ * Compilation status. `partial` is only produced for an explicit streaming
234
+ * snapshot; final callers that do not opt into phases keep the historical
235
+ * result shape without a `status` field.
236
+ */
237
+ export type LocalCompileStatus = 'partial' | 'valid' | 'recovered' | 'failed';
225
238
  /** Compiler-produced documents contain only plain records, arrays and primitives. */
226
239
  export interface LocalDocument {
227
240
  syntax: 'local';
@@ -231,12 +244,12 @@ export interface LocalDocument {
231
244
  /** Effective syntax revision; absent on older hand-built runtime documents. */
232
245
  syntaxVersion?: 'local-draft-3';
233
246
  /**
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.
247
+ * Policy on legacy whole-document HTML results. Mixed-source compilers
248
+ * record author content in `capabilities`.
238
249
  */
239
250
  html?: LocalHtmlPolicy;
251
+ /** Serializable author content and its compile-time permission ceiling. */
252
+ capabilities?: LocalDocumentCapabilities;
240
253
  versionDeclaration?: LocalVersionDeclaration;
241
254
  nodes: LocalNode[];
242
255
  initialState: Record<string, LocalValue>;
@@ -304,7 +317,7 @@ export interface LocalDocument {
304
317
  * preset manifests. Plain, serializable data; runtime semantics resolve from
305
318
  * it with default-preset fallback for older hand-built documents.
306
319
  */
307
- componentDefinitions?: readonly import('../../sdk/types.js').LocalComponentDefinition[];
320
+ componentDefinitions?: readonly import('../sdk/types.js').LocalComponentDefinition[];
308
321
  /**
309
322
  * Serializable component-semantics metadata lowered at compile time. Present
310
323
  * only when at least one component contributes a runtime rule, slot relation
@@ -329,28 +342,33 @@ export interface LocalCompileLimits {
329
342
  readonly maxMarkdownDepth?: number;
330
343
  }
331
344
  /**
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.
345
+ * Host-owned capability flags for the mixed Markdown and ReactiveMD pipeline.
339
346
  */
340
347
  export interface LocalHtmlOptions {
341
- /** Allow authored CSS; external resources remain subject to the native CSP. */
348
+ /** Allow document styles and component declarations. Defaults to true. */
342
349
  readonly enableCss?: boolean;
343
- /** Allow authored scripts and inline event handlers. */
350
+ /** Allow author JavaScript in interactive mounts. Defaults to false. */
344
351
  readonly enableJavaScript?: boolean;
345
- /** Allow HTML beyond the safe P0 subset (tables, forms, SVG/MathML, ...). */
352
+ /** Allow additional native HTML fragments. Defaults to false. */
346
353
  readonly enableExtendedHtml?: boolean;
347
354
  }
348
- /** Effective, non-optional policy recorded on a compiled HTML-branch document. */
355
+ /** Resolved document capability flags. */
349
356
  export interface LocalHtmlPolicy {
350
357
  readonly enableCss: boolean;
351
358
  readonly enableJavaScript: boolean;
352
359
  readonly enableExtendedHtml: boolean;
353
360
  }
361
+ export interface LocalAuthorBlock {
362
+ readonly text: string;
363
+ readonly range: SourceRange;
364
+ }
365
+ export interface LocalDocumentCapabilities {
366
+ readonly policy: LocalHtmlPolicy;
367
+ readonly styles: readonly LocalAuthorBlock[];
368
+ readonly scripts: readonly LocalAuthorBlock[];
369
+ readonly componentStyles: Readonly<Record<string, string>>;
370
+ readonly actionTargets: Readonly<Record<string, string>>;
371
+ }
354
372
  export type LocalHostPropKind = 'string' | 'number' | 'boolean' | 'enum';
355
373
  export interface LocalHostPropSchema {
356
374
  readonly kind: LocalHostPropKind;
@@ -417,17 +435,36 @@ export interface LocalCompileOptions extends LocalHtmlOptions {
417
435
  * errors remain errors. Only booleans are accepted.
418
436
  */
419
437
  readonly strict?: boolean;
438
+ /**
439
+ * Marks the snapshot as still being generated. Omitted or `final` keeps the
440
+ * historical final-compilation semantics, including `strict` recovery.
441
+ * `streaming` selects provisional rendering and diagnostics; it is not part
442
+ * of the compile identity and must not be used as a structural-recovery
443
+ * switch. Only accepted values are `streaming` and `final`.
444
+ */
445
+ readonly sourcePhase?: LocalSourcePhase;
420
446
  }
421
- /** Public compiler output is plain data, including nested attributes and dependencies. */
447
+ /**
448
+ * Public compiler output is plain data, including nested attributes and
449
+ * dependencies. `status` and `transientDiagnostics` are present only for
450
+ * callers that explicitly supplied a source phase; legacy callers keep the
451
+ * historical shape.
452
+ */
422
453
  export type LocalCompileResult = {
423
454
  ok: true;
424
455
  document: LocalDocument;
425
456
  diagnostics: Diagnostic[];
426
457
  recoveries?: LocalRecovery[];
458
+ status?: Exclude<LocalCompileStatus, 'failed'>;
459
+ /** Fixable issues from a streaming snapshot; never merged into `diagnostics`. */
460
+ transientDiagnostics?: Diagnostic[];
427
461
  } | {
428
462
  ok: false;
429
463
  diagnostics: Diagnostic[];
430
464
  recoveries?: LocalRecovery[];
465
+ status?: 'failed';
466
+ /** Fixable issues observed before a deterministic failure. */
467
+ transientDiagnostics?: Diagnostic[];
431
468
  };
432
469
  /**
433
470
  * Frozen state of the current revision. It contains controls, successful
@@ -440,6 +477,8 @@ export interface LocalSnapshot {
440
477
  }
441
478
  /** Host-provided initial external values; invalid entries are treated as unavailable. */
442
479
  export interface LocalRuntimeOptions {
480
+ /** Named channels granted to this document runtime. */
481
+ readonly network?: NetworkConfig;
443
482
  /**
444
483
  * Initial read-only host values for `<external>` declarations. Declared names
445
484
  * without a valid value stay unavailable until a later `setExternalValues`.
@@ -476,6 +515,7 @@ export interface LocalRuntimeOptions {
476
515
  }
477
516
  export interface LocalRuntime {
478
517
  document: LocalDocument;
518
+ readonly network?: ComponentNetwork;
479
519
  /**
480
520
  * Runtime-scoped services (clock, scheduler, component state). Hand-built
481
521
  * runtimes in tests may omit them; contexts fall back to detached services.
@@ -494,6 +534,10 @@ export interface LocalRuntime {
494
534
  getParameter(name: string): LocalValue | undefined;
495
535
  /** Snapshot of all public parameters; `@...` and external values are excluded. */
496
536
  getParameters(): Readonly<Record<string, LocalValue>>;
537
+ /** Project selected public parameters from one revision for a submission. */
538
+ readSubmissionFields?(fields: readonly string[]): LocalSubmissionFieldsResult;
539
+ /** Register a mounted field's validity check until the returned cleanup runs. */
540
+ registerSubmissionField?(node: LocalNode, check: LocalSubmissionFieldCheck): () => void;
497
541
  /** Validate and atomically write one public parameter. */
498
542
  setParameter(name: string, value: LocalValue): Diagnostic[];
499
543
  /** Validate and atomically write one or more public parameters. */
@@ -516,4 +560,17 @@ export interface LocalRuntime {
516
560
  subscribe(listener: () => void): () => void;
517
561
  dispose(): void;
518
562
  }
563
+ export type LocalSubmissionFieldProblem = 'invalid' | 'required';
564
+ export type LocalSubmissionFieldCheck = (value: LocalValue) => LocalSubmissionFieldProblem | undefined;
565
+ export type LocalSubmissionFieldsResult = {
566
+ ok: true;
567
+ payload: JsonPayload;
568
+ } | {
569
+ ok: false;
570
+ field: string;
571
+ reason: 'unavailable' | LocalSubmissionFieldProblem;
572
+ };
519
573
  export declare const localKey: (node: LocalNode) => string;
574
+ export type LocalLocale = 'en' | 'zh';
575
+ /** The local syntax revision accepted and rendered by this build. */
576
+ export declare const LOCAL_SYNTAX_VERSION: 'local-draft-3';
@@ -0,0 +1,22 @@
1
+ /** A problem that only the print engine can observe, with no document position. */
2
+ export interface LocalPdfDiagnostic {
3
+ readonly code: 'local.pdf.image-decode';
4
+ readonly message: string;
5
+ }
6
+ export interface LocalPdfOptions {
7
+ readonly format?: string;
8
+ readonly landscape?: boolean;
9
+ readonly margin?: {
10
+ readonly top?: string;
11
+ readonly right?: string;
12
+ readonly bottom?: string;
13
+ readonly left?: string;
14
+ };
15
+ readonly printBackground?: boolean;
16
+ /** Treat reported problems as fatal, like the CLI's --strict. */
17
+ readonly strict?: boolean;
18
+ /** Called once per problem; a relaxed export still writes its PDF. */
19
+ readonly onDiagnostic?: (diagnostic: LocalPdfDiagnostic) => void;
20
+ }
21
+ /** Print self-contained static HTML using a caller-installed Chromium. */
22
+ export declare function renderLocalPdf(html: string, options?: LocalPdfOptions): Promise<Uint8Array>;
@@ -4,4 +4,5 @@
4
4
  * without importing the preset implementation or its component table.
5
5
  */
6
6
  export declare const DEFAULT_PRESET_ID = "reactive-md/default";
7
+ export declare const MINIMAL_PRESET_ID = "reactive-md/minimal";
7
8
  export declare const DEFAULT_PRESET_VERSION: "0.7.0";
@@ -0,0 +1,2 @@
1
+ export declare const minimalPreset: import("../sdk/index.js").LocalPresetPackage;
2
+ export default minimalPreset;
@@ -0,0 +1 @@
1
+ export declare function selectOfficialPreset(id: string, names: readonly string[], dependencies?: readonly string[]): import("../sdk/index.js").LocalPresetPackage;
@@ -1,13 +1,14 @@
1
- import { type ComponentType, type ReactNode } from 'react';
2
- import type { Diagnostic, LocalNode, LocalRuntime, LocalSnapshot, LocalValue, SourceRange } from '../local/contracts/types.js';
1
+ import { type ComponentType, type CSSProperties, type ReactNode } from 'react';
2
+ import type { Diagnostic, LocalNode, LocalRuntime, LocalSnapshot, LocalSubmissionFieldCheck, LocalSubmissionFieldsResult, LocalValue, SourceRange } from '../local/types.js';
3
3
  import type { LocalRenderMode, LocalSourceTarget } from '../local/rendering/render-types.js';
4
- import type { LocalUrlPolicy } from '../local/rendering/LocalDocumentView.js';
5
- import type { LocalLocale } from '../local/theme/i18n.js';
4
+ import type { LocalUrlPolicy } from '../local/rendering/document/LocalDocumentView.js';
5
+ import type { LocalLocale } from './localization.js';
6
6
  import type { LocalComponentDefinition, LocalComponentRequirement } from '../sdk/types.js';
7
7
  import type { LocalExtensionRequirements } from '../sdk/types.js';
8
8
  import type { LocalRuntimeServices } from '../runtime-services/runtime.js';
9
9
  import type { LocalComponentStateHandle } from '../runtime-services/component-state.js';
10
10
  import type { LocalClock, LocalScheduler } from '../runtime-services/scheduler.js';
11
+ import { type ComponentNetwork } from '../runtime-services/network.js';
11
12
  /** A public component value. Arrays are the immutable collection form. */
12
13
  export type LocalComponentValue = string | number | boolean | null | readonly string[] | readonly number[];
13
14
  /** @deprecated phase-one alias; scalar-only views can keep using it. */
@@ -92,6 +93,9 @@ export interface LocalComponentRuntime {
92
93
  resetToken(item: LocalComponentContent): number;
93
94
  evaluate(expression: string): LocalComponentValue;
94
95
  snapshot(): LocalSnapshot;
96
+ /** Select public writable fields and check mounted controls for invalid drafts. */
97
+ readSubmissionFields?(fields: readonly string[]): LocalSubmissionFieldsResult;
98
+ registerSubmissionField?(item: LocalComponentContent, check: LocalSubmissionFieldCheck): () => void;
95
99
  validate(): Diagnostic[];
96
100
  text(template: string): string;
97
101
  }
@@ -139,10 +143,18 @@ export interface LocalComponentServices {
139
143
  readonly clock: LocalClock;
140
144
  readonly scheduler: LocalScheduler;
141
145
  readonly state: LocalComponentStateHandle;
146
+ /** Present in SDK-created contexts, optional for older hand-built contexts. */
147
+ readonly network?: ComponentNetwork;
142
148
  }
143
149
  /** Context passed to every SDK component. It contains no AST. */
144
150
  export interface LocalComponentContext {
145
151
  readonly props: Readonly<Record<string, LocalComponentValue>>;
152
+ /** Author declarations for the component's visible root. */
153
+ readonly authorStyle?: CSSProperties;
154
+ /** Sanitized ordered declarations when repeated properties need browser fallbacks. */
155
+ readonly authorStyleText?: string;
156
+ /** Return true when the current mount delegates this action to author JavaScript. */
157
+ readonly dispatchAuthorAction?: (action: import('../local/runtime/author-script-protocol.js').AuthorAction) => boolean;
146
158
  readonly content: LocalComponentContent;
147
159
  readonly services: LocalComponentServices;
148
160
  readonly bindings: {
@@ -197,7 +209,11 @@ export interface LocalReactPreset {
197
209
  * internal nodes only to `component-api`, never to component implementations.
198
210
  */
199
211
  export interface LocalComponentAdapterEnvironment {
212
+ readonly authorStyle?: LocalComponentContext['authorStyle'];
213
+ readonly authorStyleText?: LocalComponentContext['authorStyleText'];
214
+ readonly dispatchAuthorAction?: LocalComponentContext['dispatchAuthorAction'];
200
215
  readonly runtime: LocalRuntime;
216
+ readonly network?: ComponentNetwork;
201
217
  /** Optional runtime-scoped services. Falls back to detached services. */
202
218
  readonly services?: LocalRuntimeServices;
203
219
  readonly mode: LocalRenderMode;
@@ -7,15 +7,15 @@
7
7
  * implementations are not copied: they remain the kernel modules.
8
8
  */
9
9
  export { DEFAULT_LOCAL_DATA_TABLE_ROWS, MAX_LOCAL_ARRAY_LENGTH, MAX_LOCAL_DATA_TABLE_COLUMNS, MAX_LOCAL_DATA_TABLE_ROWS, MAX_LOCAL_PLOT_CURVES, MAX_LOCAL_PLOT_POINTS, MAX_LOCAL_PLOT_STEPS, MAX_LOCAL_STRING_LENGTH, MAX_LOCAL_VALUE_CHARACTERS, isLocalEmail, } from '../local/configuration/limits.js';
10
- export { countLocalCodePoints } from '../local/source/text-length.js';
10
+ export { countLocalCodePoints } from '../local/source/source-context.js';
11
11
  export { formatLocalDiagnostic } from '../local/configuration/diagnostics.js';
12
- export { compileExpression, type LocalExpression } from '../local/evaluation/expression.js';
13
- export { compileLatex, compilePlotFormula, implicitGridSize, LatexError, MAX_IMPLICIT_GRID, MIN_IMPLICIT_GRID, plotFormulaKind, type CompiledPlotFormula, type LatexEvaluationBudget, type PlotFormulaKind, type PlotPoint, type PlotSample, } from '../local/evaluation/math.js';
14
- export { sampleImplicit, sampleParametric, samplePlot } from '../local/evaluation/math-sample.js';
15
- export { LatexView } from '../local/widgets/math-view.js';
16
- export { TableSurface } from '../local/widgets/table-surface.js';
17
- export { createDiagramLayoutFallback, diagramEdgePath, diagramLayoutKey, layoutDiagram, type DiagramLayoutInput, type DiagramLayoutResult, } from '../local/widgets/diagram-layout.js';
18
- export { isLocalColor } from '../local/theme/colors.js';
19
- export type { Diagnostic, LocalValue } from '../local/contracts/types.js';
12
+ export { compileExpression, type LocalExpression } from '../local/evaluation/expression/compile.js';
13
+ export { compileLatex, compilePlotFormula, implicitGridSize, LatexError, MAX_IMPLICIT_GRID, MIN_IMPLICIT_GRID, plotFormulaKind, type CompiledPlotFormula, type LatexEvaluationBudget, type PlotFormulaKind, type PlotPoint, type PlotSample, } from '../local/evaluation/math/latex.js';
14
+ export { sampleImplicit, sampleParametric, samplePlot, samplePolar } from '../local/evaluation/math/sample.js';
15
+ export { LatexView } from '../local/rendering/math-view.js';
16
+ export { TableSurface } from '../local/rendering/table/data-table.js';
17
+ export { createDiagramLayoutFallback, diagramEdgePath, diagramLayoutKey, layoutDiagram, type DiagramLayoutInput, type DiagramLayoutResult, } from '../components/diagram/layout.js';
18
+ export { isLocalColor } from '../local/configuration/color-values.js';
19
+ export type { Diagnostic, LocalValue } from '../local/types.js';
20
20
  export type { LocalRenderMode } from '../local/rendering/render-types.js';
21
- export type { LocalLocale, Localize } from '../local/theme/i18n.js';
21
+ export type { LocalLocale, Localize } from './localization.js';