reactive-md 0.9.3 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/CHANGELOG-ch.md +34 -0
  2. package/CHANGELOG.md +34 -0
  3. package/README-ch.md +7 -7
  4. package/README-en.md +7 -7
  5. package/README.md +7 -7
  6. package/THIRD_PARTY_NOTICES.md +0 -57
  7. package/cli/help.mjs +6 -4
  8. package/cli/init.mjs +1 -1
  9. package/cli/migrate.mjs +1 -1
  10. package/dist-library/{LocalDocumentView-D6zQkTkt.js → LocalDocumentView-CP2QG86k.js} +46 -44
  11. package/dist-library/{LocalDocumentViewCore-CmJhemcA.js → LocalDocumentViewCore-Cd6yMEkg.js} +284 -265
  12. package/dist-library/{LocalReactiveDocumentCore-lAKOGAZ7.js → LocalReactiveDocumentCore-VuYpZqdn.js} +7 -7
  13. package/dist-library/LocalStaticDocumentView-DfX6bemE.js +147 -0
  14. package/dist-library/authoring-Bwu_zCWs.js +768 -0
  15. package/dist-library/choice-values-BItGjPD2.js +58 -0
  16. package/dist-library/compile-B35rfzKr.js +1742 -0
  17. package/dist-library/{compile-cache-key-6GgpETz_.js → compile-cache-key-D21X2Obx.js} +5 -5
  18. package/dist-library/{compiler-DLkKUK4t.js → compiler-DBwLawMZ.js} +4 -4
  19. package/dist-library/{compiler-core-Niqhp9wV.js → compiler-core-kkDiQ1RK.js} +3146 -2055
  20. package/dist-library/{component-kernel-IG4wOO0i.js → component-kernel-CsJSabHX.js} +42 -26
  21. package/dist-library/{component-state-Ht-hOK0W.js → component-state-Da0G8Ajc.js} +1 -1
  22. package/dist-library/{component-utils-eSj5IdG4.js → component-utils-ZM3jUJNy.js} +80 -79
  23. package/dist-library/conditional-branches-CIhJXasR.js +17 -0
  24. package/dist-library/{config-validation-Cpol91_M.js → config-validation-DbmsWAEV.js} +165 -152
  25. package/dist-library/{controls-B-CLSK8Q.js → controls-DRy5rzzN.js} +271 -228
  26. package/dist-library/{coordinate-PyLPMIQK.js → coordinate-c54pHfgf.js} +29 -29
  27. package/dist-library/data-table-CSAkm1eU.js +290 -0
  28. package/dist-library/data-table-model-DruztQFt.js +391 -0
  29. package/dist-library/{data-visuals-_Z7QqYTk.js → data-visuals-rZQUeQM0.js} +14 -14
  30. package/dist-library/{default-components-jugH7Ubr.js → default-components-B-39etG9.js} +233 -71
  31. package/dist-library/{default-config-DIrRpuQz.js → default-config-CCa8rm2k.js} +236 -216
  32. package/dist-library/default-options-By16CVw1.js +131 -0
  33. package/dist-library/{default-registry-BlloaZi7.js → default-registry-DXJy66xj.js} +3 -3
  34. package/dist-library/{default-schema-Ch-Vznpm.js → default-schema-CeYiEW1K.js} +3 -3
  35. package/dist-library/display-Bb6hAG5T.js +2065 -0
  36. package/dist-library/{document-theme-DBAfnk7y.js → document-theme-CJvN-nC1.js} +190 -3
  37. package/dist-library/{export-heVBqgxA.js → export-BSV4E0jv.js} +105 -106
  38. package/dist-library/font-aliases-CKYjwn4o.js +4 -0
  39. package/dist-library/{gallery-Q6VPS2ep.js → gallery-DM2yTVZJ.js} +1 -1
  40. package/dist-library/{html-CCnvzan1.js → html-CY9mC3Sr.js} +5 -5
  41. package/dist-library/{incremental-Bzvh8_lB.js → incremental-B-wW4H3F.js} +251 -245
  42. package/dist-library/{display-y4v9v0Qd.js → katex-4ukd4ZxT.js} +1555 -3618
  43. package/dist-library/layout-CPQggKxk.js +592 -0
  44. package/dist-library/{layout-BnfDeUNy.js → layout-CaDWsDof.js} +1 -1
  45. package/dist-library/{math-view-B0jthpRw.js → math-view-CyGTS6kv.js} +1 -1
  46. package/dist-library/{mount-preset-C_i37FvY.js → mount-preset-DtrCX4G8.js} +4 -4
  47. package/dist-library/{numeric-sliders-CkWS0-ja.js → numeric-sliders-BmJ1LCLx.js} +190 -190
  48. package/dist-library/{observability-CYLuvFfL.js → observability-BVQ16ByQ.js} +5 -4
  49. package/dist-library/{package-core-9UK5ZdqB.js → package-core-Cu_r_qs7.js} +7 -6
  50. package/dist-library/{parser-9yNJxGip.js → parser-BHl9Lxbw.js} +2 -2
  51. package/dist-library/{parser-standard-BPIy4HOu.js → parser-standard-DDAKv_DZ.js} +247 -247
  52. package/dist-library/{plugin-packs-CZb46nuv.js → plugin-packs-CkI0floL.js} +3 -3
  53. package/dist-library/{preset-core-BW3NWZJ9.js → preset-core-BKPbH_Nv.js} +377 -306
  54. package/dist-library/{props-pJRrfDc6.js → props-0iDqxlTk.js} +56 -61
  55. package/dist-library/{react-BSo0o998.js → react-74jdGBmu.js} +2 -2
  56. package/dist-library/reactive-md-authoring.js +277 -269
  57. package/dist-library/reactive-md-build.js +327 -33
  58. package/dist-library/reactive-md-compiler-session.js +3 -3
  59. package/dist-library/reactive-md-compiler-standard.js +10 -10
  60. package/dist-library/reactive-md-compiler.js +3 -3
  61. package/dist-library/reactive-md-contracts.js +4 -4
  62. package/dist-library/reactive-md-default-packs.js +4 -3
  63. package/dist-library/reactive-md-default-preset.js +3 -3
  64. package/dist-library/reactive-md-export.js +6 -6
  65. package/dist-library/reactive-md-minimal-preset.js +3 -2
  66. package/dist-library/reactive-md-minimal-react-preset.js +18 -17
  67. package/dist-library/reactive-md-minimal.css +1 -1
  68. package/dist-library/reactive-md-observability.js +2 -2
  69. package/dist-library/reactive-md-pack-style-manifest.js +8 -0
  70. package/dist-library/reactive-md-plugin-chart.js +13 -9
  71. package/dist-library/reactive-md-plugin-data.js +4 -4
  72. package/dist-library/reactive-md-plugin-diagram.js +3 -3
  73. package/dist-library/reactive-md-plugin-forms.js +5 -5
  74. package/dist-library/reactive-md-plugin-gallery.js +3 -3
  75. package/dist-library/reactive-md-plugin-navigation.js +10 -10
  76. package/dist-library/reactive-md-plugin-network.js +5 -5
  77. package/dist-library/reactive-md-plugin-plot.js +4 -4
  78. package/dist-library/reactive-md-react-component-accordion.js +3 -3
  79. package/dist-library/reactive-md-react-component-alert.js +3 -3
  80. package/dist-library/reactive-md-react-component-anchor.js +3 -3
  81. package/dist-library/reactive-md-react-component-badge.js +3 -3
  82. package/dist-library/reactive-md-react-component-card.js +3 -3
  83. package/dist-library/reactive-md-react-component-chart.js +2 -2
  84. package/dist-library/reactive-md-react-component-checkbox.js +2 -2
  85. package/dist-library/reactive-md-react-component-checklist.js +2 -2
  86. package/dist-library/reactive-md-react-component-choices.js +2 -2
  87. package/dist-library/reactive-md-react-component-column.js +1 -1
  88. package/dist-library/reactive-md-react-component-coordinate.js +2 -2
  89. package/dist-library/reactive-md-react-component-counter.js +2 -2
  90. package/dist-library/reactive-md-react-component-data-table.js +2 -2
  91. package/dist-library/reactive-md-react-component-date.js +2 -2
  92. package/dist-library/reactive-md-react-component-diagram.js +2 -2
  93. package/dist-library/reactive-md-react-component-disclosure.js +3 -3
  94. package/dist-library/reactive-md-react-component-edge.js +1 -1
  95. package/dist-library/reactive-md-react-component-else.js +10 -0
  96. package/dist-library/reactive-md-react-component-gallery-item.js +2 -2
  97. package/dist-library/reactive-md-react-component-gallery.js +2 -2
  98. package/dist-library/reactive-md-react-component-grid.js +3 -3
  99. package/dist-library/reactive-md-react-component-if.js +3 -3
  100. package/dist-library/reactive-md-react-component-input.js +2 -2
  101. package/dist-library/reactive-md-react-component-jump.js +3 -3
  102. package/dist-library/reactive-md-react-component-multi-select.js +2 -2
  103. package/dist-library/reactive-md-react-component-node.js +2 -2
  104. package/dist-library/reactive-md-react-component-number.js +2 -2
  105. package/dist-library/reactive-md-react-component-option.js +1 -1
  106. package/dist-library/reactive-md-react-component-panel.js +3 -3
  107. package/dist-library/reactive-md-react-component-plot.js +2 -2
  108. package/dist-library/reactive-md-react-component-progress.js +2 -2
  109. package/dist-library/reactive-md-react-component-quiz.js +2 -2
  110. package/dist-library/reactive-md-react-component-radio-group.js +2 -2
  111. package/dist-library/reactive-md-react-component-range-slider.js +2 -2
  112. package/dist-library/reactive-md-react-component-section.js +3 -3
  113. package/dist-library/reactive-md-react-component-select.js +2 -2
  114. package/dist-library/reactive-md-react-component-slider.js +2 -2
  115. package/dist-library/reactive-md-react-component-step.js +3 -3
  116. package/dist-library/reactive-md-react-component-steps.js +3 -3
  117. package/dist-library/reactive-md-react-component-tab.js +3 -3
  118. package/dist-library/reactive-md-react-component-table.js +2 -2
  119. package/dist-library/reactive-md-react-component-tabs.js +3 -3
  120. package/dist-library/reactive-md-react-component-text.js +3 -3
  121. package/dist-library/reactive-md-react-component-textarea.js +2 -2
  122. package/dist-library/reactive-md-react-component-timeline.js +2 -2
  123. package/dist-library/reactive-md-react-component-timer.js +2 -2
  124. package/dist-library/reactive-md-react-component-toggle.js +2 -2
  125. package/dist-library/reactive-md-react-component-tooltip.js +3 -3
  126. package/dist-library/reactive-md-react-component-validation.js +3 -3
  127. package/dist-library/reactive-md-react-minimal.js +4 -4
  128. package/dist-library/reactive-md-react-pack-controls.js +4 -4
  129. package/dist-library/reactive-md-react-pack-data.js +3 -3
  130. package/dist-library/reactive-md-react-pack-layout.js +25 -24
  131. package/dist-library/reactive-md-react-pack-visuals.js +2 -2
  132. package/dist-library/reactive-md-react-packed.js +6 -6
  133. package/dist-library/reactive-md-react-server.js +37 -36
  134. package/dist-library/reactive-md-react-static-server.js +2 -2
  135. package/dist-library/reactive-md-react-static.js +1 -1
  136. package/dist-library/reactive-md-react-unstyled.js +12 -12
  137. package/dist-library/reactive-md-react.js +12 -12
  138. package/dist-library/reactive-md-scan.js +1 -1
  139. package/dist-library/reactive-md-sdk.js +23 -9
  140. package/dist-library/reactive-md-standalone-configured.js +2 -2
  141. package/dist-library/reactive-md-standalone-host.js +2 -2
  142. package/dist-library/reactive-md-testing-browser.js +2 -2
  143. package/dist-library/reactive-md-testing-react.js +6 -6
  144. package/dist-library/reactive-md-testing.js +6 -6
  145. package/dist-library/reactive-md-vite.js +25 -9
  146. package/dist-library/reactive-md-worker-pool.js +3 -3
  147. package/dist-library/reactive-md.css +1 -1
  148. package/dist-library/reactive-md.js +52 -43
  149. package/dist-library/{registry-core-CziAIP5P.js → registry-core-DxEaxhJ6.js} +3 -2
  150. package/dist-library/{render-nodes-DKjg_TR1.js → render-nodes-B6j6Ip5I.js} +766 -731
  151. package/dist-library/{requirements-DhIkxAbl.js → requirements-C56sFIEs.js} +2 -2
  152. package/dist-library/{resources-B_nbROgj.js → resources-6VaNgk-h.js} +2 -2
  153. package/dist-library/rmd-pack-layout.css +9 -0
  154. package/dist-library/rmd-pack-resource-layout.css +9 -0
  155. package/dist-library/runtime-BHeuLOv_.js +1369 -0
  156. package/dist-library/{runtime-requirement-C4-vNcf5.js → runtime-requirement-DzPO8raU.js} +166 -163
  157. package/dist-library/{schema-core-4sd1Vu7V.js → schema-core-CDXfxdID.js} +24 -1
  158. package/dist-library/{sdk-core-BLsW9cCy.js → sdk-core-CnE-n0Z7.js} +469 -314
  159. package/dist-library/{session-core-DLBRPV7f.js → session-core-C071yQwV.js} +140 -127
  160. package/dist-library/{validation-XXlb-spV.js → sha256-utf16-Bmandi_H.js} +392 -315
  161. package/dist-library/shareable-CHCDnl6j.js +844 -0
  162. package/dist-library/types/authoring/catalog.d.ts +3 -1
  163. package/dist-library/types/authoring/index.d.ts +1 -1
  164. package/dist-library/types/components/chart/default-chart-types.d.ts +3 -0
  165. package/dist-library/types/components/chart/default-chart.d.ts +7 -0
  166. package/dist-library/types/components/entries/else.d.ts +3 -0
  167. package/dist-library/types/components/layout/layout.d.ts +5 -0
  168. package/dist-library/types/components/shared/visuals.d.ts +1 -1
  169. package/dist-library/types/components/table/data-table-model.d.ts +95 -2
  170. package/dist-library/types/components/table/data-table.d.ts +2 -2
  171. package/dist-library/types/contracts/component-kernel.d.ts +5 -0
  172. package/dist-library/types/contracts/font-aliases.d.ts +18 -0
  173. package/dist-library/types/contracts/number-literal.d.ts +2 -0
  174. package/dist-library/types/contracts/sha256-utf16.d.ts +2 -0
  175. package/dist-library/types/export/index.d.ts +4 -1
  176. package/dist-library/types/local/compilation/compiler-choices.d.ts +4 -0
  177. package/dist-library/types/local/compilation/compiler-declarations.d.ts +2 -1
  178. package/dist-library/types/local/compilation/compiler-expressions.d.ts +12 -1
  179. package/dist-library/types/local/compilation/compiler-macros.d.ts +18 -0
  180. package/dist-library/types/local/compilation/compiler-structure.d.ts +8 -2
  181. package/dist-library/types/local/compilation/compiler-tables.d.ts +1 -0
  182. package/dist-library/types/local/compilation/compiler-validation.d.ts +11 -0
  183. package/dist-library/types/local/compilation/compiler-values.d.ts +1 -2
  184. package/dist-library/types/local/configuration/diagnostic-messages.d.ts +173 -2
  185. package/dist-library/types/local/configuration/diagnostic-runtime-messages.d.ts +40 -0
  186. package/dist-library/types/local/evaluation/choice-values.d.ts +22 -0
  187. package/dist-library/types/local/evaluation/computations.d.ts +13 -5
  188. package/dist-library/types/local/evaluation/dataset.d.ts +4 -0
  189. package/dist-library/types/local/evaluation/expression/collection-functions.d.ts +13 -0
  190. package/dist-library/types/local/evaluation/expression/compile.d.ts +11 -4
  191. package/dist-library/types/local/evaluation/expression/data-functions.d.ts +23 -0
  192. package/dist-library/types/local/evaluation/expression/evaluation.d.ts +3 -1
  193. package/dist-library/types/local/evaluation/expression/internal-names.d.ts +8 -0
  194. package/dist-library/types/local/evaluation/expression/syntax.d.ts +19 -2
  195. package/dist-library/types/local/evaluation/expression/transform-budget.d.ts +13 -0
  196. package/dist-library/types/local/evaluation/expression/values.d.ts +9 -1
  197. package/dist-library/types/local/evaluation/validation.d.ts +8 -6
  198. package/dist-library/types/local/index.d.ts +4 -3
  199. package/dist-library/types/local/parsing/conditional-branches.d.ts +4 -0
  200. package/dist-library/types/local/parsing/source-revision.d.ts +3 -0
  201. package/dist-library/types/local/runtime/runtime-choices.d.ts +11 -0
  202. package/dist-library/types/local/runtime/runtime.d.ts +3 -1
  203. package/dist-library/types/local/runtime/state.d.ts +30 -15
  204. package/dist-library/types/local/source/authoring-requirements.d.ts +3 -0
  205. package/dist-library/types/local/source/authoring-syntax.d.ts +3 -2
  206. package/dist-library/types/local/source/authoring.d.ts +10 -0
  207. package/dist-library/types/local/source/source-migration.d.ts +1 -0
  208. package/dist-library/types/local/types.d.ts +33 -2
  209. package/dist-library/types/react/component-api.d.ts +21 -2
  210. package/dist-library/types/react/component-utils.d.ts +11 -0
  211. package/dist-library/types/react/font-aliases.d.ts +2 -0
  212. package/dist-library/types/react/package-core.d.ts +3 -0
  213. package/dist-library/types/react/rendering/document/validation-state.d.ts +1 -1
  214. package/dist-library/types/react/rendering/document/view-revision.d.ts +3 -12
  215. package/dist-library/types/react/rendering/table/data-table.d.ts +1 -1
  216. package/dist-library/types/react/sdk-core.d.ts +3 -1
  217. package/dist-library/types/sdk/assembly.d.ts +3 -0
  218. package/dist-library/types/sdk/font.d.ts +13 -0
  219. package/dist-library/types/sdk/index.d.ts +1 -0
  220. package/dist-library/types/sdk/theme.d.ts +5 -0
  221. package/dist-library/types/sdk/types.d.ts +6 -0
  222. package/dist-library/types/sdk/version.d.ts +1 -1
  223. package/dist-library/types/shareable.d.ts +15 -3
  224. package/dist-library/types/standalone/prepare.d.ts +4 -2
  225. package/dist-library/types/standalone/session-core.d.ts +4 -1
  226. package/dist-library/types/vite/index.d.ts +3 -0
  227. package/dist-library/types/vite/registration.d.ts +1 -0
  228. package/dist-library/{types-Bza88SGK.js → types-B4qG8J4S.js} +1 -1
  229. package/dist-library/types-FYhRWRn9.js +3 -0
  230. package/dist-library/use-hydrated-D1gFY2Dq.js +2655 -0
  231. package/dist-library/validation-DRuW0Wl9.js +433 -0
  232. package/dist-library/{version-B0G1699c.js → version-4wzhbvDG.js} +1 -1
  233. package/dist-library/{visual-helpers-CRmaqCHX.js → visual-helpers-UU6xiL8g.js} +3 -3
  234. package/dist-library/visuals-7xzoL9ql.js +49340 -0
  235. package/dist-library/{worker-D6WMV8xJ.js → worker-3ldRjOEG.js} +9 -9
  236. package/dist-standalone/reactive-md-standalone.css +1 -1
  237. package/dist-standalone/reactive-md-standalone.js +128 -368
  238. package/docs/README-ch.md +3 -1
  239. package/docs/README.md +3 -1
  240. package/docs/compatibility/api-stability-ch.md +1 -1
  241. package/docs/compatibility/api-stability-en.md +1 -1
  242. package/docs/compatibility/compatibility-ch.md +15 -15
  243. package/docs/compatibility/compatibility-en.md +15 -15
  244. package/docs/compatibility/compatibility-manifest.schema.json +3 -2
  245. package/docs/compatibility/deprecation-ch.md +2 -2
  246. package/docs/compatibility/deprecation-en.md +2 -2
  247. package/docs/compatibility/source-versioning-ch.md +22 -14
  248. package/docs/compatibility/source-versioning-en.md +22 -13
  249. package/docs/compatibility/support-matrix-ch.md +4 -3
  250. package/docs/compatibility/support-matrix-en.md +4 -3
  251. package/docs/development/component-development-ch.md +2 -2
  252. package/docs/development/component-development-en.md +2 -2
  253. package/docs/development/component-protocol-ch.md +18 -18
  254. package/docs/development/component-protocol-en.md +14 -14
  255. package/docs/guides/local-guide-ch.md +109 -20
  256. package/docs/guides/local-guide-en.md +109 -20
  257. package/docs/integration/author-tools-ch.md +1 -1
  258. package/docs/integration/author-tools-en.md +1 -1
  259. package/docs/integration/editor-ch.md +3 -3
  260. package/docs/integration/editor-en.md +3 -3
  261. package/docs/integration/extension-sdk-ch.md +29 -3
  262. package/docs/integration/extension-sdk-en.md +29 -3
  263. package/docs/integration/local-integration-ch.md +3 -3
  264. package/docs/integration/local-integration-en.md +3 -3
  265. package/docs/integration/pdf-export-ch.md +42 -0
  266. package/docs/integration/pdf-export-en.md +42 -0
  267. package/docs/integration/shareable-export-ch.md +11 -19
  268. package/docs/integration/shareable-export-en.md +11 -19
  269. package/docs/reference/diagnostics-counting-ch.md +24 -1
  270. package/docs/reference/diagnostics-counting-en.md +24 -1
  271. package/docs/reference/local-interaction-syntax-ch.md +222 -33
  272. package/docs/reference/local-interaction-syntax-en.md +220 -31
  273. package/docs/reference/public-api-ch.md +24 -18
  274. package/docs/reference/public-api-en.md +24 -18
  275. package/docs/reference/theme-protocol-ch.md +1 -1
  276. package/docs/reference/theme-protocol-en.md +1 -1
  277. package/docs/releases/release-0.10.0-ch.md +45 -0
  278. package/docs/releases/release-0.10.0-en.md +45 -0
  279. package/examples/conformance/README-ch.md +3 -3
  280. package/examples/conformance/README.md +3 -3
  281. package/examples/conformance/local-draft-4.json +441 -0
  282. package/examples/integration/README-ch.md +3 -3
  283. package/examples/integration/README.md +3 -3
  284. package/examples/integration/chat-session/package.json +1 -1
  285. package/examples/local/README-ch.md +1 -1
  286. package/examples/local/README.md +1 -1
  287. package/package.json +6 -1
  288. package/dist-library/LocalStaticDocumentView-2J7w0sKm.js +0 -143
  289. package/dist-library/authoring-B14SsOXZ.js +0 -893
  290. package/dist-library/compile-D50B5_Ww.js +0 -1249
  291. package/dist-library/computations-CffoW7Ff.js +0 -340
  292. package/dist-library/data-table-Kv_ZA2Z2.js +0 -297
  293. package/dist-library/default-options-DU5dxuU6.js +0 -125
  294. package/dist-library/layout-BfUzzO2b.js +0 -553
  295. package/dist-library/runtime-CuJndKqK.js +0 -1289
  296. package/dist-library/shareable-C6mUerpQ.js +0 -817
  297. package/dist-library/types-daDo2c_w.js +0 -3
  298. package/dist-library/use-hydrated-W-laKPhY.js +0 -22975
  299. package/dist-library/visuals-CoVSjVD8.js +0 -49159
@@ -1,5 +1,5 @@
1
1
  export { analyzeLocalSource, completeLocalSource, renameLocalBinding, formatLocalSource } from './source/authoring.js';
2
- export type { AuthorToken, AuthorBinding, AuthorAnalysis, AuthorCompletion, AuthorCompletionKind, AuthorRename } from './source/authoring.js';
2
+ export type { AuthorToken, AuthorBinding, AuthorAnalysis, AuthorCompletion, AuthorCompletionKind, AuthorMacroDefinition, AuthorRename } from './source/authoring.js';
3
3
  export { compileLocal } from './compilation/compiler.js';
4
4
  export { createLocalCompileSession, LocalCompileSession } from './compilation/session/incremental.js';
5
5
  export type { LocalIncrementalStats } from './compilation/session/incremental.js';
@@ -22,13 +22,14 @@ export { LOCAL_SYNTAX_VERSION } from './types.js';
22
22
  export { inspectLocalSourceVersion, checkLocalUpgrade, migrateLocalSource } from './source/source-migration.js';
23
23
  export type { LocalSourceVersion, LocalUpgradeOptions, LocalUpgradeReport, LocalMigrationResult } from './source/source-migration.js';
24
24
  export type { LocalVersionDeclaration } from './types.js';
25
+ export type { LocalDiagnosticRelatedRange } from './types.js';
25
26
  export type { LocalSubmissionFieldCheck, LocalSubmissionFieldProblem, LocalSubmissionFieldsResult } from './types.js';
26
27
  export type { LocalLocale } from './types.js';
27
28
  export { LOCAL_THEME_PROTOCOL, DEFAULT_LOCAL_THEME, resolveLocalTheme, isLocalThemeName } from '../themes/document-theme.js';
28
29
  export type { LocalColorScheme, LocalThemeDefinition, LocalThemeResolution } from '../themes/document-theme.js';
29
30
  export type { Diagnostic, LocalDiagnosticParam, LocalDiagnosticParams, SourceRange, LocalRecovery, LocalValue, LocalValueKind, LocalNode, LocalBinding, LocalComputation, LocalExternal, LocalDynamicConstraint, LocalDynamicConstraints, LocalValidation, LocalDocument, LocalHtmlOptions, LocalHtmlPolicy, LocalCompileLimits, LocalCompileOptions, LocalCompileResult, LocalSourcePhase, LocalCompileStatus, LocalRuntime, LocalRuntimeOptions, LocalSnapshot, LocalHostPropKind, LocalHostPropSchema, LocalHostComponentForm, LocalHostBindingSchema, LocalHostComponentSchema } from './types.js';
30
- export { LOCAL_STATE_FORMAT, localSourceDigest, createLocalStateFile, parseLocalState, resolveLocalState, applyLocalState, exportLocalState, importLocalState, serializeLocalState, } from './runtime/state.js';
31
- export type { LocalStateGenerator, LocalStateFile, LocalStateParseResult, LocalStateResolution, } from './runtime/state.js';
31
+ export { LOCAL_STATE_FORMAT, LOCAL_MACRO_STATE_FORMAT, captureLocalMacroState, createLocalMacroStateFile, parseLocalMacroState, localSourceDigest, createLocalStateFile, parseLocalState, resolveLocalState, applyLocalState, exportLocalState, importLocalState, serializeLocalState, } from './runtime/state.js';
32
+ export type { LocalStateGenerator, LocalStateFile, LocalStateParseResult, LocalStateResolution, LocalStateResolutionOptions, LocalMacroStateFile, LocalMacroStateParseResult, } from './runtime/state.js';
32
33
  export { planLocalStateRetention, applyLocalStateRetention } from './runtime/retention.js';
33
34
  export type { LocalStateRetentionReason, LocalStateRetentionDrop, LocalStateRetentionInput, LocalRetainedState, LocalStateRetentionResult, } from './runtime/retention.js';
34
35
  export { LOCAL_COMPILE_DELAY_MS, LOCAL_COMPILE_PREPARATION_DELAY_MS, localWorkerOptionsKey, LocalCompileScheduler, compileFailureDiagnostic, startLocalCompileWorker, } from './transport/worker.js';
@@ -0,0 +1,4 @@
1
+ import type { LocalNode } from '../types.js';
2
+ export declare function previousConditionalSiblingIndex(nodes: readonly LocalNode[], index: number): number;
3
+ export declare function nextConditionalSiblingIndex(nodes: readonly LocalNode[], index: number): number;
4
+ export declare function conditionalBranchIssue(nodes: readonly LocalNode[], index: number): 'without-if' | 'duplicate' | undefined;
@@ -0,0 +1,3 @@
1
+ export declare const SOURCE_REVISION: RegExp;
2
+ /** Only the source prologue can change which tags the structural scanner knows. */
3
+ export declare function hasMacroSourceDirective(source: string): boolean;
@@ -0,0 +1,11 @@
1
+ import type { LocalBinding, LocalChoiceConstraint, LocalValue } from '../types.js';
2
+ import type { LocalExpression } from '../evaluation/expression/compile.js';
3
+ import type { TransformStage } from '../evaluation/expression/transform-budget.js';
4
+ /** Null means the source is unavailable. An empty list is a resolved domain. */
5
+ export declare function readChoiceDomain(constraint: LocalChoiceConstraint, environment: Record<string, LocalValue>, compile: (source: string) => LocalExpression | null, stage?: TransformStage): string[] | null;
6
+ export declare function reconcileChoice(binding: LocalBinding, constraint: LocalChoiceConstraint, value: LocalValue, domain: readonly string[] | null, explicit: boolean): {
7
+ ok: true;
8
+ value: LocalValue;
9
+ } | {
10
+ ok: false;
11
+ };
@@ -1,4 +1,4 @@
1
- import { type Diagnostic, type LocalDocument, type LocalRuntime, type LocalRuntimeOptions } from '../types.js';
1
+ import { type Diagnostic, type LocalDocument, type LocalRuntime, type LocalRuntimeOptions, type LocalValue } from '../types.js';
2
2
  import type { LocalStateRetentionDrop } from './retention.js';
3
3
  import { type NetworkSession } from '../../runtime-services/network.js';
4
4
  export interface LocalRuntimeUpdateOptions {
@@ -20,6 +20,8 @@ export interface LocalRuntimeDocumentUpdate {
20
20
  readonly dropped: readonly LocalStateRetentionDrop[];
21
21
  readonly diagnostics: readonly Diagnostic[];
22
22
  }
23
+ /** State-file paths validate and match the payload before entering this transaction. */
24
+ export declare function restoreLocalRuntimeValues(runtime: LocalRuntime, values: Readonly<Record<string, LocalValue>>): Diagnostic[];
23
25
  /**
24
26
  * Adopt a freshly compiled document without discarding the runtime object.
25
27
  * Values migrate with the same rules as `planLocalStateRetention` /
@@ -3,13 +3,14 @@ import type { Diagnostic, LocalDocument, LocalRuntime, LocalValue } from '../typ
3
3
  export { localSourceDigest };
4
4
  /** Version tag for the portable, shareable parameter state format. */
5
5
  export declare const LOCAL_STATE_FORMAT: 'reactive-md-state/v1';
6
+ export declare const LOCAL_MACRO_STATE_FORMAT: 'reactive-md-macro-state/v1';
6
7
  export interface LocalStateGenerator {
7
8
  name: string;
8
9
  version: string;
9
10
  }
10
11
  export interface LocalStateFile {
11
12
  format: typeof LOCAL_STATE_FORMAT;
12
- /** Syntax revision the state was produced for (currently `local-draft-3`). */
13
+ /** Syntax revision the state was produced for (currently `local-draft-4`). */
13
14
  syntax: string;
14
15
  /** Deterministic digest of the document source. */
15
16
  sourceDigest: string;
@@ -17,6 +18,19 @@ export interface LocalStateFile {
17
18
  parameters: Record<string, LocalValue>;
18
19
  generator?: LocalStateGenerator;
19
20
  }
21
+ export interface LocalMacroStateFile {
22
+ readonly format: typeof LOCAL_MACRO_STATE_FORMAT;
23
+ readonly sourceDigest: string;
24
+ readonly configKey: string;
25
+ readonly state: Readonly<Record<string, LocalValue>>;
26
+ }
27
+ export type LocalMacroStateParseResult = {
28
+ ok: true;
29
+ file: LocalMacroStateFile;
30
+ } | {
31
+ ok: false;
32
+ diagnostics: Diagnostic[];
33
+ };
20
34
  export type LocalStateParseResult = {
21
35
  ok: true;
22
36
  file: LocalStateFile;
@@ -32,6 +46,12 @@ export type LocalStateResolution = {
32
46
  ok: false;
33
47
  diagnostics: Diagnostic[];
34
48
  };
49
+ /** Parse bounded plain data before comparing the sidecar to a compiled document. */
50
+ export declare function parseLocalMacroState(input: unknown, options?: {
51
+ maxLength?: number;
52
+ }): LocalMacroStateParseResult;
53
+ export declare function createLocalMacroStateFile(document: LocalDocument, snapshot: Readonly<Record<string, LocalValue>>): LocalMacroStateFile;
54
+ export declare function captureLocalMacroState(runtime: LocalRuntime): LocalMacroStateFile;
35
55
  /**
36
56
  * Capture every public binding from a runtime state. Internal `@...` binding
37
57
  * keys and declared read-only values are ignored so a full snapshot can be passed in;
@@ -45,21 +65,18 @@ export declare function createLocalStateFile(document: LocalDocument, state: Rea
45
65
  export declare function parseLocalState(input: string | unknown, options?: {
46
66
  maxLength?: number;
47
67
  }): LocalStateParseResult;
68
+ export interface LocalStateResolutionOptions {
69
+ maxLength?: number;
70
+ externalValues?: Readonly<Record<string, LocalValue>>;
71
+ macroState?: unknown;
72
+ }
48
73
  /**
49
74
  * Verify a state file against a compiled document and normalize its values
50
75
  * through a throwaway runtime. No live runtime is created or mutated.
51
76
  */
52
- export declare function resolveLocalState(document: LocalDocument, input: string | unknown, options?: {
53
- maxLength?: number;
54
- }): LocalStateResolution;
55
- /**
56
- * Validate the file against the document (using the runtime's current state as
57
- * the baseline) and then write the normalized public values. Multi-slot
58
- * components are written atomically with `setMany`.
59
- */
60
- export declare function applyLocalState(runtime: LocalRuntime, file: LocalStateFile, options?: {
61
- maxLength?: number;
62
- }): Diagnostic[];
77
+ export declare function resolveLocalState(document: LocalDocument, input: string | unknown, options?: LocalStateResolutionOptions): LocalStateResolution;
78
+ /** Validate and apply public parameters and optional macro values as one runtime transaction. */
79
+ export declare function applyLocalState(runtime: LocalRuntime, file: LocalStateFile, options?: Pick<LocalStateResolutionOptions, 'maxLength' | 'macroState'>): Diagnostic[];
63
80
  /**
64
81
  * Capture the live runtime's public parameters in the portable state format.
65
82
  * The runtime snapshot may contain internal bindings; the state file never does.
@@ -70,9 +87,7 @@ export declare function exportLocalState(runtime: LocalRuntime, generator?: Loca
70
87
  * runtime. Returns diagnostics and never throws for malformed input; a failed
71
88
  * import leaves the runtime state untouched.
72
89
  */
73
- export declare function importLocalState(runtime: LocalRuntime, input: string | unknown, options?: {
74
- maxLength?: number;
75
- }): Diagnostic[];
90
+ export declare function importLocalState(runtime: LocalRuntime, input: string | unknown, options?: Pick<LocalStateResolutionOptions, 'maxLength' | 'macroState'>): Diagnostic[];
76
91
  /**
77
92
  * Produce stable JSON in a canonical key order. The CLI is responsible for
78
93
  * wrapping the result in an HTML/script context; no HTML escaping happens here.
@@ -0,0 +1,3 @@
1
+ import type { LocalComponentSchema, LocalPropSchema } from '../../contracts/schema-core.js';
2
+ /** Whether the component requires this attribute to be written in the source. */
3
+ export declare function requiresSourceAttribute(component: LocalComponentSchema, name: string, prop: LocalPropSchema, present?: ReadonlySet<string>): boolean;
@@ -40,9 +40,10 @@ export declare function decodedAttribute(source: string, range: SourceRange): {
40
40
  export interface IdentifierRange {
41
41
  name: string;
42
42
  range: SourceRange;
43
+ scope?: 'iteration' | 'unknown';
43
44
  }
44
- /** Identifiers that are real references: strings, literals, functions are skipped. */
45
- export declare function expressionIdentifiers(source: string, start: number, end: number): IdentifierRange[];
45
+ /** Free references, with offsets in the original source even in Markdown table cells. */
46
+ export declare function expressionIdentifiers(source: string, start: number, end: number, tablePipes?: boolean): IdentifierRange[];
46
47
  export declare function isIdentifierStart(character: string | undefined): boolean;
47
48
  export declare function isIdentifierPart(character: string | undefined): boolean;
48
49
  export declare function isWhitespace(character: string | undefined): boolean;
@@ -21,10 +21,20 @@ export interface AuthorBinding {
21
21
  declarations: SourceRange[];
22
22
  references: SourceRange[];
23
23
  }
24
+ export interface AuthorMacroDefinition {
25
+ name: string;
26
+ params: readonly string[];
27
+ outputs: readonly string[];
28
+ range: SourceRange;
29
+ bodyRange: SourceRange;
30
+ }
24
31
  export interface AuthorAnalysis {
25
32
  tokens: AuthorToken[];
26
33
  bindings: AuthorBinding[];
27
34
  diagnostics: Diagnostic[];
35
+ macros?: readonly AuthorMacroDefinition[];
36
+ /** Explicit source theme, when present. */
37
+ theme?: string;
28
38
  }
29
39
  export type AuthorCompletionKind = 'tag' | 'attribute' | 'binding' | 'value';
30
40
  export interface AuthorCompletion {
@@ -6,6 +6,7 @@ export interface LocalSourceVersion {
6
6
  supported: boolean;
7
7
  range: SourceRange | null;
8
8
  diagnostics: Diagnostic[];
9
+ features?: readonly 'macros'[];
9
10
  }
10
11
  export interface LocalUpgradeOptions {
11
12
  fromVersion?: string;
@@ -8,10 +8,15 @@ import type { ComponentNetwork, JsonPayload, NetworkConfig } from '../runtime-se
8
8
  export interface LocalVersionDeclaration {
9
9
  version: string;
10
10
  range: SourceRange;
11
+ features?: readonly 'macros'[];
11
12
  }
12
13
  /** A scalar, JSON/structured-clone-safe diagnostic template parameter. */
13
14
  export type LocalDiagnosticParam = string | number | boolean | null;
14
15
  export type LocalDiagnosticParams = Readonly<Record<string, LocalDiagnosticParam>>;
16
+ export interface LocalDiagnosticRelatedRange {
17
+ role: 'definition' | 'use';
18
+ range: SourceRange;
19
+ }
15
20
  /** A display issue relative to the formula body, independent of the renderer. */
16
21
  export interface LocalMathDisplayIssue {
17
22
  start: number;
@@ -27,6 +32,7 @@ export interface Diagnostic {
27
32
  message: string;
28
33
  severity: 'error' | 'warning';
29
34
  range: SourceRange;
35
+ relatedRanges?: readonly LocalDiagnosticRelatedRange[];
30
36
  line: number;
31
37
  column: number;
32
38
  /**
@@ -48,6 +54,12 @@ export interface LocalNode {
48
54
  type: string;
49
55
  id: string;
50
56
  range: SourceRange;
57
+ /** Call site of a heading expanded from a macro, for source navigation. */
58
+ macroUseRange?: SourceRange;
59
+ /** Lexical bindings for a math block expanded from a macro. */
60
+ macroMathScope?: Readonly<Record<string, string>>;
61
+ /** Static macro argument substitutions that contain interpolation delimiters. */
62
+ macroLiteralAttrs?: readonly string[];
51
63
  fallback?: LocalFallbackInfo;
52
64
  children?: LocalNode[];
53
65
  name?: string;
@@ -139,6 +151,21 @@ export interface LocalBinding {
139
151
  maxItems?: number;
140
152
  owner?: string;
141
153
  }
154
+ /** Runtime membership for an array-backed choice or selection binding. */
155
+ export type LocalChoiceConstraint = {
156
+ binding: string;
157
+ } & ({
158
+ kind: 'options';
159
+ source: string;
160
+ } | {
161
+ kind: 'rows';
162
+ sources: {
163
+ rows: string;
164
+ key: string;
165
+ maxRows: number;
166
+ }[];
167
+ staticKeys: string[][];
168
+ });
142
169
  /**
143
170
  * One host-provided read-only value declared by a top-level `<external>` tag.
144
171
  * The record is plain data: the declaration owns no writable binding and is
@@ -249,8 +276,10 @@ export interface LocalDocument {
249
276
  usedComponents?: readonly string[];
250
277
  /** Registry fingerprint carried through compilation, Worker cloning and patches. */
251
278
  componentConfigKey?: string;
279
+ /** Identity of the macro expansion configuration, carried through transport and exports. */
280
+ macroConfigKey?: string;
252
281
  /** Effective syntax revision; absent on older hand-built runtime documents. */
253
- syntaxVersion?: 'local-draft-3';
282
+ syntaxVersion?: 'local-draft-4';
254
283
  /**
255
284
  * Policy on legacy whole-document HTML results. Mixed-source compilers
256
285
  * record author content in `capabilities`.
@@ -297,6 +326,8 @@ export interface LocalDocument {
297
326
  * value.
298
327
  */
299
328
  dynamicConstraints?: Record<string, LocalDynamicConstraints>;
329
+ /** Checked in dependency order before publishing runtime state. */
330
+ choiceConstraints?: LocalChoiceConstraint[];
300
331
  /**
301
332
  * Node id -> subtree binding dependencies, produced by the compiler. `null`
302
333
  * marks subtrees whose reads cannot be decided statically. Internal shape:
@@ -593,4 +624,4 @@ export type LocalSubmissionFieldsResult = {
593
624
  };
594
625
  export declare const localKey: (node: LocalNode) => string;
595
626
  /** The local syntax revision accepted and rendered by this build. */
596
- export declare const LOCAL_SYNTAX_VERSION: 'local-draft-3';
627
+ export declare const LOCAL_SYNTAX_VERSION: 'local-draft-4';
@@ -45,6 +45,8 @@ export interface LocalComponentContent {
45
45
  readonly text: string;
46
46
  /** Markdown/content format marker (`math`, `inlineMath`, code language, ...). */
47
47
  readonly format?: string;
48
+ /** Compiled symbol mapping for a macro's math content. */
49
+ readonly macroMathScope?: Readonly<Record<string, string>>;
48
50
  readonly visible: boolean;
49
51
  readonly children: readonly LocalComponentContent[];
50
52
  readonly range: Readonly<SourceRange>;
@@ -245,6 +247,20 @@ export interface LocalComponentAdapterEnvironment {
245
247
  export declare function formatComponentNumber(value: number): string;
246
248
  /** Public values are immutable; kernel arrays are copied on the way out. */
247
249
  export declare function publicComponentValue(value: LocalValue | undefined): LocalComponentValue;
250
+ export type LenientPropRead = {
251
+ ok: true;
252
+ value: LocalComponentValue;
253
+ } | {
254
+ ok: false;
255
+ error: unknown;
256
+ };
257
+ export interface LocalConditionalBranchRead {
258
+ readonly condition: LenientPropRead;
259
+ readonly selection: boolean | null;
260
+ }
261
+ export declare function isConditionalBranch(node: LocalNode | undefined, name: 'if' | 'else', definitionFor: LocalComponentAdapterEnvironment['definitionFor']): node is LocalNode;
262
+ /** A sibling chain evaluates at most once, when its first decision is requested. */
263
+ export declare function conditionalBranchReads(nodes: readonly LocalNode[], definitionFor: LocalComponentAdapterEnvironment['definitionFor'], runtime: LocalRuntime): ReadonlyMap<LocalNode, () => LocalConditionalBranchRead>;
248
264
  export interface PropFailureSink {
249
265
  readonly environment: LocalComponentAdapterEnvironment;
250
266
  /** Minimal adapter-side identity; not an AST handle. */
@@ -253,6 +269,7 @@ export interface PropFailureSink {
253
269
  readonly name?: string;
254
270
  readonly range: SourceRange;
255
271
  readonly literalAttributes?: true;
272
+ readonly macroLiteralAttrs?: readonly string[];
256
273
  };
257
274
  }
258
275
  /**
@@ -261,12 +278,14 @@ export interface PropFailureSink {
261
278
  * nested contexts in the same pass do not duplicate the same failure.
262
279
  */
263
280
  export declare function beginLocalComponentRender(runtime: LocalRuntime): void;
264
- export declare function resolveComponentProps(definition: LocalComponentDefinition | undefined, attrs: Readonly<Record<string, string>> | undefined, runtime: LocalRuntime, failure?: PropFailureSink): Record<string, LocalComponentValue>;
281
+ export declare function resolveComponentProps(definition: LocalComponentDefinition | undefined, attrs: Readonly<Record<string, string>> | undefined, runtime: LocalRuntime, failure?: PropFailureSink, when?: LenientPropRead | (() => LenientPropRead)): Record<string, LocalComponentValue>;
282
+ /** Resolve a free reference for an expression evaluated in a generated row scope. */
283
+ export declare function readComponentExpressionDependency(runtime: LocalComponentRuntime, name: string): LocalValue;
265
284
  /**
266
285
  * Build the public context for one component node. Called by the renderer;
267
286
  * external implementations receive exactly this object.
268
287
  */
269
- export declare function createLocalComponentContext(node: LocalNode, environment: LocalComponentAdapterEnvironment): LocalComponentContext;
288
+ export declare function createLocalComponentContext(node: LocalNode, environment: LocalComponentAdapterEnvironment, condition?: LenientPropRead): LocalComponentContext;
270
289
  /**
271
290
  * Bind a React implementation to a validated manifest. The digest is captured
272
291
  * here and rechecked when the config is assembled.
@@ -8,6 +8,17 @@ import type { LocalComponentContext, LocalComponentContent, LocalComponentHint,
8
8
  * canonical kernel code; nothing is copied here.
9
9
  */
10
10
  export * from './component-primitives.js';
11
+ /**
12
+ * Branch selection for one alternative. The decision is identified
13
+ * by the `<else>` node id, so a detached `<else>` cannot consume an ancestor
14
+ * chain's selection. A reached branch with a failed condition carries an error.
15
+ */
16
+ export interface LocalBranchSelection {
17
+ readonly elseId: string;
18
+ readonly shown: boolean;
19
+ readonly error: boolean;
20
+ }
21
+ export declare const LocalBranchContext: import("react").Context<LocalBranchSelection | null | undefined>;
11
22
  /** Convenience view over one public component context. */
12
23
  export interface LocalComponentView {
13
24
  readonly context: LocalComponentContext;
@@ -0,0 +1,2 @@
1
+ /** The selected font families of one document instance. */
2
+ export declare const LocalFontAliasesContext: import("react").Context<Readonly<Record<string, string>> | undefined>;
@@ -1,3 +1,4 @@
1
+ import type { LocalFontAliases } from '../contracts/font-aliases.js';
1
2
  import { type LocalPresetSelection } from '../sdk/preset.js';
2
3
  import { LOCAL_REACT_PRESET_PROTOCOL, type LocalComponentDefinition, type LocalPresetPackage } from '../sdk/types.js';
3
4
  import type { LocalStyleResource, LocalThemePackage } from '../sdk/theme.js';
@@ -53,6 +54,8 @@ export interface LocalReactHostInput {
53
54
  readonly packages?: readonly LocalReactPackage[];
54
55
  readonly components?: readonly LocalReactComponent[];
55
56
  readonly themes?: readonly LocalThemePackage[];
57
+ /** Host-wide source aliases whose font files are supplied via style resources. */
58
+ readonly fonts?: LocalFontAliases;
56
59
  readonly resources?: readonly LocalStyleResource[];
57
60
  readonly notices?: readonly LocalPackageNotice[];
58
61
  }
@@ -12,7 +12,7 @@ export interface LocalValidationField {
12
12
  invalid: boolean;
13
13
  }
14
14
  export interface LocalValidationState {
15
- /** The hint for a rendered `<validation>` tag, matched by tag range. */
15
+ /** The hint for a rendered `<validation>` tag, matched by compiled node ID. */
16
16
  hintFor(node: LocalNode): LocalValidationHint | null;
17
17
  /** Current failing hints attached to a bound control/slot group. */
18
18
  fieldFor(node: LocalNode): LocalValidationField;
@@ -42,19 +42,10 @@ export declare function dependencyIndexEqual(previous: DependencyIndex, next: De
42
42
  */
43
43
  export declare function validationProjectionKey(document: LocalDocument): string;
44
44
  /**
45
- * Semantic signature of validation results. Each diagnostic is identified by
46
- * its rule index (matched through the freshly compiled rule ranges, so source
47
- * offsets may move), then by code and message. This keeps prose shifts stable
48
- * while still distinguishing "the same message now belongs to another rule".
45
+ * Semantic signature of validation results. The rule's node ID distinguishes
46
+ * macro instances even when the code, message and authored range coincide.
49
47
  */
50
- export declare function validationDiagnosticKey(document: LocalDocument, diagnostics: readonly {
51
- code: string;
52
- message: string;
53
- range: {
54
- start: number;
55
- end: number;
56
- };
57
- }[]): string;
48
+ export declare function validationDiagnosticKey(document: LocalDocument, diagnostics: readonly Pick<Diagnostic, 'code' | 'message' | 'range' | 'details'>[]): string;
58
49
  /**
59
50
  * The scalar inputs of one memoized block. Everything else a block needs
60
51
  * travels through `env` (kept stable by the projections above) and through
@@ -1,5 +1,5 @@
1
1
  import { TableSurface } from '../../../components/shared/table-surface.js';
2
2
  /** Compatibility exports for the canonical data-table model. */
3
- export { buildDataTableModel, dataTableFailureMessage, encodeDataTableKey, evaluateDataTableRows, } from '../../../components/table/data-table.js';
3
+ export { buildDataTableModel, buildDataTablePage, dataTableEmptyMessage, dataTableFailureMessage, encodeDataTableKey, evaluateDataTableRows, } from '../../../components/table/data-table.js';
4
4
  export type { DataTableBuildOptions, DataTableBuildResult, DataTableCell, DataTableColumnSpec, DataTableFailure, DataTableModel, DataTableRow, } from '../../../components/table/data-table.js';
5
5
  export { TableSurface };
@@ -9,12 +9,14 @@ import type { LocalThemePackage } from '../sdk/theme.js';
9
9
  import type { LocalRuntimeServices } from '../runtime-services/runtime.js';
10
10
  import type { ComponentNetwork } from '../runtime-services/network.js';
11
11
  import type { LocalComponentDefinition, LocalConfig } from '../sdk/types.js';
12
- import { type LocalComponentAdapterEnvironment, type LocalComponentContext, type LocalReactComponent, type LocalReactPreset } from './component-api.js';
12
+ import { type LenientPropRead, type LocalComponentAdapterEnvironment, type LocalComponentContext, type LocalReactComponent, type LocalReactPreset } from './component-api.js';
13
13
  export type { LocalComponentRender } from './component-api.js';
14
14
  export { defineReactComponent, type LocalComponentBindingHandle, type LocalComponentContext, type LocalComponentInstance, type LocalComponentPropValue, type LocalComponentSetResult, type LocalComponentValue, type LocalReactComponent, type LocalReactComponentImplementation, type LocalReactPreset, } from './component-api.js';
15
15
  /** Everything a renderer needs from the document view. */
16
16
  export interface LocalReactRenderEnvironment {
17
17
  runtime: LocalRuntime;
18
+ /** Precomputed condition for an official conditional branch. */
19
+ branchCondition?: LenientPropRead;
18
20
  trace?: LocalReactTraceContext;
19
21
  authorStyle?: LocalComponentAdapterEnvironment['authorStyle'];
20
22
  authorStyleText?: LocalComponentAdapterEnvironment['authorStyleText'];
@@ -1,3 +1,4 @@
1
+ import { type LocalFontAliases } from '../contracts/font-aliases.js';
1
2
  import type { LocalCompatProfile } from './compat-profile.js';
2
3
  import type { LocalStyleResource, LocalThemePackage } from './theme.js';
3
4
  import type { LocalAssemblySnapshot, LocalComponentDefinition, LocalComponentRequirement, LocalConfig, LocalLegacyConfigKey, LocalReplacementRecord, LocalResolvedPreset } from './types.js';
@@ -57,6 +58,7 @@ export interface LocalAssemblyIdentity {
57
58
  readonly components: readonly LocalComponentRequirement[];
58
59
  readonly replacements: readonly LocalReplacementRecord[];
59
60
  readonly legacyKeys: readonly LocalLegacyConfigKey[];
61
+ readonly fontDigest?: string;
60
62
  }
61
63
  type AssemblyIdentityInput = {
62
64
  readonly key: string;
@@ -64,6 +66,7 @@ type AssemblyIdentityInput = {
64
66
  readonly registry: readonly LocalComponentDefinition[];
65
67
  readonly replacements: readonly LocalReplacementRecord[];
66
68
  readonly legacyKeys: readonly LocalLegacyConfigKey[];
69
+ readonly fonts?: LocalFontAliases;
67
70
  };
68
71
  export declare function localAssemblyIdentity(input: AssemblyIdentityInput): LocalAssemblyIdentity;
69
72
  /** Deterministic digest over the assembly identity. */
@@ -0,0 +1,13 @@
1
+ import { type LocalFontAliases } from '../contracts/font-aliases.js';
2
+ import type { LocalStyleResource } from './theme.js';
3
+ export interface LocalFontInput {
4
+ readonly alias: string;
5
+ /** Inline WOFF or WOFF2 data from the host's asset loader. */
6
+ readonly source: string;
7
+ }
8
+ export interface LocalFontRegistration {
9
+ readonly fonts: LocalFontAliases;
10
+ readonly resource: LocalStyleResource;
11
+ }
12
+ /** Produce a host alias and a portable @font-face resource for one font. */
13
+ export declare function defineLocalFont(input: LocalFontInput): LocalFontRegistration;
@@ -8,4 +8,5 @@ export { localAssemblyIdentity, localAssemblySeal, localConfigKeyMatches } from
8
8
  export type { LocalAssemblyIdentity } from './assembly.js';
9
9
  export * from './props.js';
10
10
  export * from './theme.js';
11
+ export * from './font.js';
11
12
  export { LOCAL_STYLE_CONTRACT, LOCAL_STYLE_LAYERS, LOCAL_THEME_STYLE_LAYER, LOCAL_STYLE_LAYER_ORDER } from '../themes/contract.js';
@@ -1,4 +1,5 @@
1
1
  import { LOCAL_THEME_PROTOCOL, type LocalThemeDefinition } from '../themes/document-theme.js';
2
+ import { type LocalFontAliases } from '../contracts/font-aliases.js';
2
3
  /**
3
4
  * Preview theme-package contract.
4
5
  *
@@ -32,6 +33,7 @@ export interface LocalThemePackage extends LocalThemeDefinition {
32
33
  readonly version: string;
33
34
  /** Inline CSS resources in stylesheet order. */
34
35
  readonly css: readonly LocalStyleResource[];
36
+ readonly fonts?: LocalFontAliases;
35
37
  }
36
38
  export interface LocalThemeInput {
37
39
  readonly id: string;
@@ -42,6 +44,8 @@ export interface LocalThemeInput {
42
44
  /** Defaults to both light and dark; both are required. */
43
45
  readonly colorSchemes?: readonly ('light' | 'dark')[];
44
46
  readonly css: readonly LocalStyleResource[];
47
+ /** Source aliases available to documents selecting this theme. */
48
+ readonly fonts?: LocalFontAliases;
45
49
  }
46
50
  export interface LocalThemeCompositionInput {
47
51
  readonly id: string;
@@ -50,6 +54,7 @@ export interface LocalThemeCompositionInput {
50
54
  readonly base: LocalThemePackage;
51
55
  /** Ordered resources appended after the base theme. */
52
56
  readonly overrides: readonly LocalStyleResource[];
57
+ readonly fonts?: LocalFontAliases;
53
58
  }
54
59
  /** Network-free literal CSS for component resources as well as theme packages. */
55
60
  export declare function isLocalInlineCss(value: unknown): value is string;
@@ -1,8 +1,10 @@
1
1
  import type { LocalValueKind } from '../contracts/runtime-types.js';
2
+ import type { LocalFontAliases } from '../contracts/font-aliases.js';
2
3
  import type { KernelBindingConstraint, KernelBindingSchema, KernelChildRule, KernelInitialRule, KernelPropSchema, KernelRule, KernelSlotRelation, KernelStructure } from '../contracts/component-kernel.js';
3
4
  import { LOCAL_ASSEMBLY_PROTOCOL, LOCAL_COMPONENT_PROTOCOL, LOCAL_CONFIG_PROTOCOL_V2, LOCAL_EXTENSIONS_PROTOCOL, LOCAL_PRESET_PROTOCOL } from './version.js';
4
5
  import type { LocalThemePackage } from './theme.js';
5
6
  export * from './version.js';
7
+ export type { LocalFontAliases } from '../contracts/font-aliases.js';
6
8
  export type LocalComponentForm = 'leaf' | 'inline' | 'container';
7
9
  export type LocalComponentPropKind = 'string' | 'number' | 'boolean' | 'enum';
8
10
  /** Shared value kinds; bindings use the same vocabulary as runtime values. */
@@ -168,6 +170,7 @@ export interface LocalAssemblySnapshot {
168
170
  readonly replacementPolicy: 'allow' | 'forbid';
169
171
  /** Host-supplied themes; preset themes remain inside `presets`. */
170
172
  readonly themes: readonly LocalThemePackage[];
173
+ readonly fonts?: LocalFontAliases;
171
174
  }
172
175
  export interface LocalResolvedPreset {
173
176
  readonly id: string;
@@ -206,6 +209,7 @@ export interface LocalConfig {
206
209
  /** Full active registry in stable position order. */
207
210
  readonly registry: readonly LocalComponentDefinition[];
208
211
  readonly themes: readonly LocalThemePackage[];
212
+ readonly fonts?: LocalFontAliases;
209
213
  /** Supported legacy identity aliases, e.g. the v1 config key. */
210
214
  readonly legacyKeys: readonly LocalLegacyConfigKey[];
211
215
  }
@@ -218,4 +222,6 @@ export interface LocalConfigInput {
218
222
  /** Defaults to `'allow'`; only explicit `replaces` declarations apply. */
219
223
  readonly replacements?: 'allow' | 'forbid';
220
224
  readonly themes?: readonly LocalThemePackage[];
225
+ /** Available in every theme, unless the selected theme overrides an alias. */
226
+ readonly fonts?: LocalFontAliases;
221
227
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
  export declare const LOCAL_SDK_VERSION: '0.7.0';
8
8
  /** Engine package release identity. Must match package.json. */
9
- export declare const LOCAL_ENGINE_VERSION: '0.9.3';
9
+ export declare const LOCAL_ENGINE_VERSION: '0.10.0';
10
10
  export declare const LOCAL_COMPONENT_PROTOCOL: 'reactive-md-component/v1';
11
11
  /** Legacy configuration protocol. Readable through the v1 compatibility profile. */
12
12
  export declare const LOCAL_CONFIG_PROTOCOL: 'reactive-md-config/v1';
@@ -1,7 +1,7 @@
1
1
  import type { LocalExtensionRequirements } from './sdk/types.js';
2
2
  import { type LocalRestorationRequirements } from './export/restoration.js';
3
3
  import type { LocalStyleResource } from './sdk/theme.js';
4
- import { type LocalStateFile, type LocalStateGenerator } from './local/runtime/state.js';
4
+ import { type LocalMacroStateFile, type LocalStateFile, type LocalStateGenerator } from './local/runtime/state.js';
5
5
  import type { Diagnostic, LocalCompileOptions, LocalDocument, LocalValue } from './local/types.js';
6
6
  import { type LocalComponentStateDocument } from './runtime-services/component-state.js';
7
7
  /** Version of the single-file HTML envelope, not of the document syntax. */
@@ -16,6 +16,7 @@ export interface ShareableMountPayload {
16
16
  target: string;
17
17
  source: string;
18
18
  state: LocalStateFile;
19
+ macroState?: LocalMacroStateFile;
19
20
  locale: 'en' | 'zh';
20
21
  colorScheme: 'light' | 'dark' | 'auto';
21
22
  hydrate: boolean;
@@ -39,11 +40,14 @@ export interface ShareableHtmlOptions {
39
40
  title: string;
40
41
  source: string;
41
42
  state: LocalStateFile;
43
+ /** Private macro values for interactive output, rendered in staticMarkup for hydration. */
44
+ macroState?: LocalMacroStateFile;
42
45
  /** Trusted static markup. Render it with the same CSS and Extended HTML grants as the export. */
43
46
  staticMarkup: string;
44
47
  /** Trusted host stylesheet, normally the built reactive-md.css. */
45
48
  css: string;
46
- mode: ShareableHtmlMode;
49
+ /** Defaults to interactive output. */
50
+ mode?: ShareableHtmlMode;
47
51
  /** Required for interactive output; the standalone IIFE source. */
48
52
  runtimeScript?: string;
49
53
  locale?: 'en' | 'zh';
@@ -84,6 +88,14 @@ export type LocalStateBaselineOutcome = {
84
88
  ok: false;
85
89
  diagnostics: Diagnostic[];
86
90
  };
91
+ /**
92
+ * Escape JavaScript source for an inline `<script>` element. The result keeps
93
+ * the original values in strings, template literals and regular expression
94
+ * literals, including `u`/`v` patterns. It prevents `</script` from closing
95
+ * the element and blocks the `<!--` + `<script` sequence that puts the HTML
96
+ * tokenizer into the double-escaped state where `</script>` is plain text.
97
+ */
98
+ export declare function escapeInlineScript(script: string): string;
87
99
  /** Escape JSON so it cannot terminate its script element or form HTML text. */
88
100
  export declare function serializeForScript(value: unknown): string;
89
101
  /**
@@ -91,7 +103,7 @@ export declare function serializeForScript(value: unknown): string;
91
103
  * document then has one baseline for first render, refresh and Reset instead of
92
104
  * silently resetting a shared export to values the author did not select.
93
105
  */
94
- export declare function resolveLocalStateBaseline(document: LocalDocument, state: LocalStateFile): LocalStateBaselineOutcome;
106
+ export declare function resolveLocalStateBaseline(document: LocalDocument, state: LocalStateFile, macroState?: unknown): LocalStateBaselineOutcome;
95
107
  /**
96
108
  * Build the deterministic single-file HTML envelope. Caller-provided markup and
97
109
  * runtime code are trusted build artifacts; all metadata and JSON are escaped.
@@ -1,7 +1,9 @@
1
1
  import { type LocalStateFile } from '../local/runtime/state.js';
2
- import type { Diagnostic, LocalCompileOptions, LocalDocument } from '../local/types.js';
2
+ import type { Diagnostic, LocalCompileOptions, LocalDocument, LocalValue } from '../local/types.js';
3
3
  export interface PreparedStandaloneDocument {
4
4
  document: LocalDocument;
5
+ /** Joint state to apply before first render, with private Reset defaults intact. */
6
+ restoredValues?: Readonly<Record<string, LocalValue>>;
5
7
  /** Compiler diagnostics, including errors retained for native source fallback. */
6
8
  diagnostics: Diagnostic[];
7
9
  }
@@ -18,4 +20,4 @@ export interface PreparedStandaloneDocument {
18
20
  * `compileOptions` replays the capability flags and limits an export was
19
21
  * created with; omitting them keeps the default ReactiveMD route.
20
22
  */
21
- export declare function prepareStandaloneDocument(source: string, state?: LocalStateFile | string, theme?: string, compileOptions?: LocalCompileOptions, beforeState?: (document: LocalDocument) => void, legacyPayload?: boolean): PreparedStandaloneDocument;
23
+ export declare function prepareStandaloneDocument(source: string, state?: LocalStateFile | string, theme?: string, compileOptions?: LocalCompileOptions, beforeState?: (document: LocalDocument) => void, legacyPayload?: boolean, macroState?: unknown): PreparedStandaloneDocument;