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
@@ -1,13 +1,14 @@
1
- import { w as e, y as t } from "./config-validation-DXTynAw7.js";
2
- import { $ as n } from "./validation-W-bmny-x.js";
3
- import { a as r, c as i, i as a, l as o, o as s, r as c, s as l, u } from "./default-components-Z_YMio5P.js";
4
- import { u as d } from "./registry-B9Jc3FVe.js";
5
- import { n as f, t as p } from "./options-CX5m5n-J.js";
6
- import { t as m } from "./compiler--ea2CKQF.js";
7
- import { a as h, c as ee, i as g, n as _, o as v, r as y, s as b, t as te } from "./schema-ZFufO8V0.js";
8
- import { i as x, n as ne, r as re, t as ie } from "./authoring-BsfSwQRm.js";
1
+ import { b as e } from "./config-validation-F47AcE6o.js";
2
+ import { o as t } from "./compile-wUv8KEge.js";
3
+ import { t as n } from "./registry-core-Bbad9Bm2.js";
4
+ import { a as r, c as i, d as a, i as o, l as s, o as c, s as l, u } from "./default-components-BwQf0oP-.js";
5
+ import { s as d } from "./config-BadfhjdP.js";
6
+ import { r as f, t as p } from "./options-1aDLK7JY.js";
7
+ import { t as m } from "./compiler-eOfcinZs.js";
8
+ import { i as h, n as ee, r as g, t as _ } from "./authoring-Dsune4Hy.js";
9
+ import { a as v, c as te, i as y, n as ne, o as re, r as ie, s as ae, t as oe } from "./schema-BufhKUSM.js";
9
10
  // src/authoring/editor-i18n.ts
10
- var ae = {
11
+ var b = {
11
12
  en: {
12
13
  boldPlaceholder: "bold text",
13
14
  italicPlaceholder: "italic text",
@@ -56,11 +57,11 @@ var ae = {
56
57
  }
57
58
  };
58
59
  // src/authoring/editor-commands.ts
59
- function S(e, t) {
60
+ function x(e, t) {
60
61
  return typeof e != "number" || Number.isNaN(e) ? 0 : Math.min(Math.max(Math.trunc(e), 0), t);
61
62
  }
62
- function C(e, t) {
63
- let n = S(t.start, e.length), r = S(t.end, e.length);
63
+ function S(e, t) {
64
+ let n = x(t.start, e.length), r = x(t.end, e.length);
64
65
  return n <= r ? {
65
66
  start: n,
66
67
  end: r
@@ -69,14 +70,14 @@ function C(e, t) {
69
70
  end: n
70
71
  };
71
72
  }
72
- function w(e) {
73
- return ae[e] ?? ae.en;
73
+ function C(e) {
74
+ return b[e] ?? b.en;
74
75
  }
75
- function T(e, t) {
76
+ function w(e, t) {
76
77
  return t <= 0 ? 0 : e.lastIndexOf("\n", t - 1) + 1;
77
78
  }
78
- function E(e, t) {
79
- let n = T(e, t.start), r = t.end > t.start && e[t.end - 1] === "\n" ? t.end - 1 : t.end, i = e.indexOf("\n", r), a = i === -1 ? e.length : i, o = [], s = n;
79
+ function T(e, t) {
80
+ let n = w(e, t.start), r = t.end > t.start && e[t.end - 1] === "\n" ? t.end - 1 : t.end, i = e.indexOf("\n", r), a = i === -1 ? e.length : i, o = [], s = n;
80
81
  for (;;) {
81
82
  let t = e.indexOf("\n", s), n = t === -1 || t > a ? a : t;
82
83
  if (o.push({
@@ -88,7 +89,7 @@ function E(e, t) {
88
89
  }
89
90
  return o;
90
91
  }
91
- function D(e, t, n) {
92
+ function E(e, t, n) {
92
93
  if (n.length === 0) return {
93
94
  value: e,
94
95
  selection: t
@@ -122,7 +123,7 @@ function D(e, t, n) {
122
123
  }
123
124
  };
124
125
  }
125
- function O(e, t, n, r) {
126
+ function D(e, t, n, r) {
126
127
  return t === e.text ? null : {
127
128
  start: e.start,
128
129
  end: e.end,
@@ -131,13 +132,13 @@ function O(e, t, n, r) {
131
132
  newPrefixLength: r
132
133
  };
133
134
  }
134
- function oe(e, t, n, r) {
135
+ function se(e, t, n, r) {
135
136
  return n === "*" ? r ? e[t.start - 1] !== "*" && e[t.end] !== "*" : e[t.start - n.length - 1] !== "*" && e[t.end + n.length] !== "*" : !0;
136
137
  }
137
- function k(e, t, n, r) {
138
- let i = C(e, t), a = n.length, { start: o, end: s } = i, c = e.slice(o, s);
138
+ function O(e, t, n, r) {
139
+ let i = S(e, t), a = n.length, { start: o, end: s } = i, c = e.slice(o, s);
139
140
  if (o !== s) {
140
- if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) && oe(e, i, n, !0)) {
141
+ if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) && se(e, i, n, !0)) {
141
142
  let t = c.slice(a, c.length - a);
142
143
  return {
143
144
  value: e.slice(0, o) + t + e.slice(s),
@@ -148,7 +149,7 @@ function k(e, t, n, r) {
148
149
  };
149
150
  }
150
151
  let t = o - a, r = s + a;
151
- return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n && oe(e, i, n, !1) ? {
152
+ return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n && se(e, i, n, !1) ? {
152
153
  value: e.slice(0, t) + c + e.slice(r),
153
154
  selection: {
154
155
  start: t,
@@ -171,39 +172,39 @@ function k(e, t, n, r) {
171
172
  }
172
173
  };
173
174
  }
174
- function se(e, t, n = "en") {
175
- return k(e, t, "**", w(n).boldPlaceholder);
176
- }
177
175
  function ce(e, t, n = "en") {
178
- return k(e, t, "*", w(n).italicPlaceholder);
176
+ return O(e, t, "**", C(n).boldPlaceholder);
179
177
  }
180
178
  function le(e, t, n = "en") {
181
- return k(e, t, "~~", w(n).strikePlaceholder);
179
+ return O(e, t, "*", C(n).italicPlaceholder);
180
+ }
181
+ function ue(e, t, n = "en") {
182
+ return O(e, t, "~~", C(n).strikePlaceholder);
182
183
  }
183
- function A(e) {
184
+ function k(e) {
184
185
  let t = 0;
185
186
  for (let n of e.match(/`+/g) ?? []) t = Math.max(t, n.length);
186
187
  return t;
187
188
  }
188
- function j(e, t, n) {
189
+ function A(e, t, n) {
189
190
  let r = 0;
190
191
  for (; e[t] === "`";) r += 1, t += n;
191
192
  return r;
192
193
  }
193
- function ue(e, t) {
194
- let { start: n, end: r } = t, i = e.slice(n, r), a = j(e, n - 1, -1), o = j(e, r, 1), s = a > 0 && a === o ? {
194
+ function de(e, t) {
195
+ let { start: n, end: r } = t, i = e.slice(n, r), a = A(e, n - 1, -1), o = A(e, r, 1), s = a > 0 && a === o ? {
195
196
  run: a,
196
197
  padding: 0
197
- } : null, c = j(e, n - 2, -1), l = j(e, r + 1, 1), u = e[n - 1] === " " && e[r] === " " && c > 0 && c === l ? {
198
+ } : null, c = A(e, n - 2, -1), l = A(e, r + 1, 1), u = e[n - 1] === " " && e[r] === " " && c > 0 && c === l ? {
198
199
  run: c,
199
200
  padding: 1
200
201
  } : null, d = s ?? u;
201
- return !d || A(i) >= d.run ? null : d;
202
+ return !d || k(i) >= d.run ? null : d;
202
203
  }
203
- function de(e, t, n = "en") {
204
- let r = C(e, t), { start: i, end: a } = r, o = e.slice(i, a);
204
+ function fe(e, t, n = "en") {
205
+ let r = S(e, t), { start: i, end: a } = r, o = e.slice(i, a);
205
206
  if (i === a) {
206
- let t = w(n).inlineCodePlaceholder, r = `\`${t}\``;
207
+ let t = C(n).inlineCodePlaceholder, r = `\`${t}\``;
207
208
  return {
208
209
  value: e.slice(0, i) + r + e.slice(a),
209
210
  selection: {
@@ -212,8 +213,8 @@ function de(e, t, n = "en") {
212
213
  }
213
214
  };
214
215
  }
215
- let s = j(o, 0, 1), c = j(o, o.length - 1, -1);
216
- if (s > 0 && s === c && o.length >= s * 2 && A(o.slice(s, o.length - s)) < s) {
216
+ let s = A(o, 0, 1), c = A(o, o.length - 1, -1);
217
+ if (s > 0 && s === c && o.length >= s * 2 && k(o.slice(s, o.length - s)) < s) {
217
218
  let t = o.slice(s, o.length - s);
218
219
  return t.startsWith(" ") && t.endsWith(" ") && t.trim().length > 0 && (t = t.slice(1, -1)), {
219
220
  value: e.slice(0, i) + t + e.slice(a),
@@ -223,7 +224,7 @@ function de(e, t, n = "en") {
223
224
  }
224
225
  };
225
226
  }
226
- let l = ue(e, r);
227
+ let l = de(e, r);
227
228
  if (l) {
228
229
  let t = l.run + l.padding;
229
230
  return {
@@ -234,7 +235,7 @@ function de(e, t, n = "en") {
234
235
  }
235
236
  };
236
237
  }
237
- let u = "`".repeat(A(o) + 1), d = /^[` ]|[` ]$/.test(o) ? " " : "", f = u + d;
238
+ let u = "`".repeat(k(o) + 1), d = /^[` ]|[` ]$/.test(o) ? " " : "", f = u + d;
238
239
  return {
239
240
  value: e.slice(0, i) + f + o + d + u + e.slice(a),
240
241
  selection: {
@@ -243,19 +244,19 @@ function de(e, t, n = "en") {
243
244
  }
244
245
  };
245
246
  }
246
- var fe = /^(#{1,6})[ \t]+/;
247
- function pe(e, t, n) {
248
- let r = C(e, t), i = [];
249
- for (let t of E(e, r)) {
250
- let e = fe.exec(t.text), r = e ? e[0].length : 0;
247
+ var pe = /^(#{1,6})[ \t]+/;
248
+ function me(e, t, n) {
249
+ let r = S(e, t), i = [];
250
+ for (let t of T(e, r)) {
251
+ let e = pe.exec(t.text), r = e ? e[0].length : 0;
251
252
  if (n === 0 && !e) continue;
252
- let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s = O(t, o + a, r, o.length);
253
+ let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s = D(t, o + a, r, o.length);
253
254
  s && i.push(s);
254
255
  }
255
- return D(e, r, i);
256
+ return E(e, r, i);
256
257
  }
257
- var M = /^([ \t]*)([-*+] )/, N = /^([ \t]*)(\d+[.)] )/, P = /^([ \t]*)([-*+] \[[ xX]\] )/, F = /^([ \t]*)(> ?)/;
258
- function I(e, t) {
258
+ var j = /^([ \t]*)([-*+] )/, M = /^([ \t]*)(\d+[.)] )/, N = /^([ \t]*)([-*+] \[[ xX]\] )/, P = /^([ \t]*)(> ?)/;
259
+ function F(e, t) {
259
260
  let n = t.exec(e);
260
261
  if (!n) return null;
261
262
  let r = n[1] ?? "", i = n[2] ?? "";
@@ -265,12 +266,12 @@ function I(e, t) {
265
266
  prefixLength: r.length + i.length
266
267
  };
267
268
  }
268
- function me(e) {
269
+ function he(e) {
269
270
  let t = /^[ \t]*/.exec(e);
270
271
  return t ? t[0] : "";
271
272
  }
272
- function L(e, t, n, r) {
273
- let i = C(e, t), a = E(e, i), o = a.map((e) => n(e.text)), s = 0, c = !0;
273
+ function I(e, t, n, r) {
274
+ let i = S(e, t), a = T(e, i), o = a.map((e) => n(e.text)), s = 0, c = !0;
274
275
  for (let e = 0; e < a.length; e += 1) {
275
276
  let t = a[e];
276
277
  (o[e] || t.text.trim().length > 0) && (s += 1, o[e] || (c = !1));
@@ -280,30 +281,30 @@ function L(e, t, n, r) {
280
281
  let t = a[e], n = o[e] ?? null;
281
282
  if (l) {
282
283
  if (!n) continue;
283
- let e = O(t, n.indent + t.text.slice(n.prefixLength), n.prefixLength, n.indent.length);
284
+ let e = D(t, n.indent + t.text.slice(n.prefixLength), n.prefixLength, n.indent.length);
284
285
  e && u.push(e);
285
286
  continue;
286
287
  }
287
- let i = n ? n.indent : me(t.text), s = t.text.slice(n ? n.prefixLength : i.length), c = r(i, e + 1), d = O(t, i + c + s, n ? n.prefixLength : i.length, i.length + c.length);
288
+ let i = n ? n.indent : he(t.text), s = t.text.slice(n ? n.prefixLength : i.length), c = r(i, e + 1), d = D(t, i + c + s, n ? n.prefixLength : i.length, i.length + c.length);
288
289
  d && u.push(d);
289
290
  }
290
- return D(e, i, u);
291
- }
292
- function he(e, t) {
293
- return L(e, t, (e) => I(e, M), () => "- ");
291
+ return E(e, i, u);
294
292
  }
295
293
  function ge(e, t) {
296
- return L(e, t, (e) => I(e, N), (e, t) => `${t}. `);
294
+ return I(e, t, (e) => F(e, j), () => "- ");
297
295
  }
298
296
  function _e(e, t) {
299
- return L(e, t, (e) => I(e, P), () => "- [ ] ");
297
+ return I(e, t, (e) => F(e, M), (e, t) => `${t}. `);
300
298
  }
301
299
  function ve(e, t) {
302
- return L(e, t, (e) => I(e, F), () => "> ");
300
+ return I(e, t, (e) => F(e, N), () => "- [ ] ");
303
301
  }
304
302
  function ye(e, t) {
305
- let n = C(e, t);
306
- return D(e, n, E(e, n).map((e) => ({
303
+ return I(e, t, (e) => F(e, P), () => "> ");
304
+ }
305
+ function be(e, t) {
306
+ let n = S(e, t);
307
+ return E(e, n, T(e, n).map((e) => ({
307
308
  start: e.start,
308
309
  end: e.end,
309
310
  text: ` ${e.text}`,
@@ -311,7 +312,7 @@ function ye(e, t) {
311
312
  newPrefixLength: 2
312
313
  })));
313
314
  }
314
- function be(e) {
315
+ function xe(e) {
315
316
  if (e.startsWith(" ")) return {
316
317
  text: e.slice(1),
317
318
  removed: 1
@@ -323,18 +324,18 @@ function be(e) {
323
324
  removed: t
324
325
  };
325
326
  }
326
- function xe(e, t) {
327
- let n = C(e, t), r = [];
328
- for (let t of E(e, n)) {
329
- let e = be(t.text);
327
+ function Se(e, t) {
328
+ let n = S(e, t), r = [];
329
+ for (let t of T(e, n)) {
330
+ let e = xe(t.text);
330
331
  if (e.removed === 0) continue;
331
- let n = O(t, e.text, e.removed, 0);
332
+ let n = D(t, e.text, e.removed, 0);
332
333
  n && r.push(n);
333
334
  }
334
- return D(e, n, r);
335
+ return E(e, n, r);
335
336
  }
336
- function Se(e, t, n = "en") {
337
- let { start: r, end: i } = C(e, t), a = e.slice(r, i), o = "https://example.com";
337
+ function Ce(e, t, n = "en") {
338
+ let { start: r, end: i } = S(e, t), a = e.slice(r, i), o = "https://example.com";
338
339
  if (a.length > 0) {
339
340
  let t = `[${a}](${o})`, n = r + 1 + a.length + 2;
340
341
  return {
@@ -345,7 +346,7 @@ function Se(e, t, n = "en") {
345
346
  }
346
347
  };
347
348
  }
348
- let s = w(n).linkText, c = `[${s}](${o})`;
349
+ let s = C(n).linkText, c = `[${s}](${o})`;
349
350
  return {
350
351
  value: e.slice(0, r) + c + e.slice(i),
351
352
  selection: {
@@ -354,8 +355,8 @@ function Se(e, t, n = "en") {
354
355
  }
355
356
  };
356
357
  }
357
- function Ce(e, t, n = "en") {
358
- let { start: r, end: i } = C(e, t), a = e.slice(r, i), o = "images/example.png";
358
+ function we(e, t, n = "en") {
359
+ let { start: r, end: i } = S(e, t), a = e.slice(r, i), o = "images/example.png";
359
360
  if (a.length > 0) {
360
361
  let t = `![${a}](${o})`, n = r + 2 + a.length + 2;
361
362
  return {
@@ -366,7 +367,7 @@ function Ce(e, t, n = "en") {
366
367
  }
367
368
  };
368
369
  }
369
- let s = w(n).imageAlt, c = `![${s}](${o})`;
370
+ let s = C(n).imageAlt, c = `![${s}](${o})`;
370
371
  return {
371
372
  value: e.slice(0, r) + c + e.slice(i),
372
373
  selection: {
@@ -375,25 +376,25 @@ function Ce(e, t, n = "en") {
375
376
  }
376
377
  };
377
378
  }
378
- function we(e, t, n = "en") {
379
- let r = C(e, t), i = e.slice(r.start, r.end), a = i.length > 0 ? i : w(n).codeBlockPlaceholder, o = "`".repeat(Math.max(3, A(a) + 1)), s = `${o}text\n`;
379
+ function Te(e, t, n = "en") {
380
+ let r = S(e, t), i = e.slice(r.start, r.end), a = i.length > 0 ? i : C(n).codeBlockPlaceholder, o = "`".repeat(Math.max(3, k(a) + 1)), s = `${o}text\n`;
380
381
  return R(e, r, `${s}${a}\n${o}`, {
381
382
  start: s.length,
382
383
  end: s.length + a.length
383
384
  });
384
385
  }
385
- function Te(e) {
386
+ function Ee(e) {
386
387
  return [
387
388
  `| ${e.tableHeaders.join(" | ")} |`,
388
389
  `| ${e.tableHeaders.map(() => "---").join(" | ")} |`,
389
390
  ...e.tableRows.map((e) => `| ${e.join(" | ")} |`)
390
391
  ].join("\n");
391
392
  }
392
- function Ee(e, t) {
393
- let n = T(e, t.start), r = e.slice(n, t.start), i = e.indexOf("\n", t.end), a = i === -1 ? e.length : i, o = e.slice(t.end, a), s = "";
393
+ function L(e, t) {
394
+ let n = w(e, t.start), r = e.slice(n, t.start), i = e.indexOf("\n", t.end), a = i === -1 ? e.length : i, o = e.slice(t.end, a), s = "";
394
395
  if (/\S/.test(r)) s = "\n\n";
395
396
  else if (n > 0) {
396
- let t = T(e, n - 1);
397
+ let t = w(e, n - 1);
397
398
  /\S/.test(e.slice(t, n - 1)) && (s = "\n");
398
399
  }
399
400
  return {
@@ -402,7 +403,7 @@ function Ee(e, t) {
402
403
  };
403
404
  }
404
405
  function R(e, t, n, r) {
405
- let { prefix: i, suffix: a } = Ee(e, t), o = t.start + i.length;
406
+ let { prefix: i, suffix: a } = L(e, t), o = t.start + i.length;
406
407
  return {
407
408
  value: e.slice(0, t.start) + i + n + a + e.slice(t.end),
408
409
  selection: {
@@ -412,20 +413,20 @@ function R(e, t, n, r) {
412
413
  };
413
414
  }
414
415
  function De(e, t, n = "en") {
415
- let r = C(e, t), i = w(n), a = Te(i), o = i.tableRows[0][0], s = a.indexOf(o);
416
+ let r = S(e, t), i = C(n), a = Ee(i), o = i.tableRows[0][0], s = a.indexOf(o);
416
417
  return R(e, r, a, {
417
418
  start: s,
418
419
  end: s + o.length
419
420
  });
420
421
  }
421
422
  function Oe(e, t) {
422
- return R(e, C(e, t), "---", {
423
+ return R(e, S(e, t), "---", {
423
424
  start: 3,
424
425
  end: 3
425
426
  });
426
427
  }
427
428
  function ke(e, t, n) {
428
- let r = C(e, t), i = r.start + n.length;
429
+ let r = S(e, t), i = r.start + n.length;
429
430
  return {
430
431
  value: e.slice(0, r.start) + n + e.slice(r.end),
431
432
  selection: {
@@ -470,7 +471,7 @@ function Ae(e, t) {
470
471
  };
471
472
  }
472
473
  function B(e, t, n, r = {}) {
473
- let i = C(e, t), a = Ae(n, e.slice(i.start, i.end)), o = r.block === !0 && a.text.length > 0 ? Ee(e, i) : {
474
+ let i = S(e, t), a = Ae(n, e.slice(i.start, i.end)), o = r.block === !0 && a.text.length > 0 ? L(e, i) : {
474
475
  prefix: "",
475
476
  suffix: ""
476
477
  }, s = i.start + o.prefix.length, c;
@@ -543,19 +544,19 @@ function V(e, t, n, r) {
543
544
  function Ie(e) {
544
545
  let t = 0;
545
546
  for (;;) {
546
- let n = e.slice(t), r = I(n, P) ?? I(n, M) ?? I(n, N) ?? I(n, F);
547
+ let n = e.slice(t), r = F(n, N) ?? F(n, j) ?? F(n, M) ?? F(n, P);
547
548
  if (!r) return t;
548
549
  t += r.prefixLength;
549
550
  }
550
551
  }
551
552
  function Le(e) {
552
- return I(e, P) ? "task" : I(e, M) ? "bullet" : I(e, N) ? "ordered" : null;
553
+ return F(e, N) ? "task" : F(e, j) ? "bullet" : F(e, M) ? "ordered" : null;
553
554
  }
554
555
  function Re(e, t) {
555
- let n = C(e, t), r = E(e, {
556
+ let n = S(e, t), r = T(e, {
556
557
  start: n.start,
557
558
  end: n.start
558
- })[0], i = r.text, a = fe.exec(i);
559
+ })[0], i = r.text, a = pe.exec(i);
559
560
  return {
560
561
  headingLevel: a ? a[1].length : 0,
561
562
  bold: V(e, n, r, "bold"),
@@ -563,68 +564,68 @@ function Re(e, t) {
563
564
  strike: V(e, n, r, "strike"),
564
565
  inlineCode: V(e, n, r, "inlineCode"),
565
566
  list: Le(i),
566
- quote: I(i, F) !== null
567
+ quote: F(i, P) !== null
567
568
  };
568
569
  }
569
570
  // src/authoring/native-components.ts
570
- var H = Object.freeze(c.map((e) => ({
571
+ var ze = Object.freeze(o.map((e) => ({
571
572
  id: e.id,
572
- label: u(e.title, "en", e.id)
573
+ label: a(e.title, "en", e.id)
573
574
  })));
574
- function U(e, t) {
575
- let n = r[e];
575
+ function Be(e, t) {
576
+ let n = c[e];
576
577
  return {
577
578
  id: e,
578
- label: u(n.title, t, e),
579
- description: u(n.description, t, e),
579
+ label: a(n.title, t, e),
580
+ description: a(n.description, t, e),
580
581
  group: n.category,
581
- keywords: [...l(e) ?? []],
582
+ keywords: [...i(e) ?? []],
582
583
  ...n.inline === !0 ? { inline: !0 } : {},
583
- template: u(n.insertText, t, n.insertText.en ?? "")
584
+ template: a(n.insertText, t, n.insertText.en ?? "")
584
585
  };
585
586
  }
586
- var W = a.map((e) => U(e, "en")), G = Object.freeze(c.map((e) => ({
587
+ var H = r.map((e) => Be(e, "en")), U = Object.freeze(o.map((e) => ({
587
588
  id: e.id,
588
- label: u(e.title, "zh", e.id)
589
- }))), K = a.map((e) => U(e, "zh")), ze = W.filter((e) => r[e.id]?.extended === !0), Be = Object.freeze(Object.fromEntries(K.filter((e) => r[e.id]?.extended === !0).map((e) => [e.id, Object.freeze({
589
+ label: a(e.title, "zh", e.id)
590
+ }))), W = r.map((e) => Be(e, "zh")), Ve = H.filter((e) => c[e.id]?.extended === !0), He = Object.freeze(Object.fromEntries(W.filter((e) => c[e.id]?.extended === !0).map((e) => [e.id, Object.freeze({
590
591
  label: e.label,
591
592
  description: e.description,
592
593
  keywords: Object.freeze([...e.keywords]),
593
594
  template: e.template
594
595
  })])));
595
- function Ve(e = "en") {
596
+ function Ue(e = "en") {
596
597
  return e === "zh" ? {
597
- groups: G,
598
- components: K
599
- } : {
600
- groups: H,
598
+ groups: U,
601
599
  components: W
600
+ } : {
601
+ groups: ze,
602
+ components: H
602
603
  };
603
604
  }
604
- function He(e) {
605
+ function We(e) {
605
606
  return new Set(e.match(/[A-Za-z_][A-Za-z0-9_]*/g) ?? []);
606
607
  }
607
- function Ue(e) {
608
+ function Ge(e) {
608
609
  let t = e.trim().replace(/[^A-Za-z0-9_]/g, "_");
609
610
  return t ? /^[0-9]/.test(t) ? `_${t}` : t : "value";
610
611
  }
611
- function We(e, t) {
612
+ function Ke(e, t) {
612
613
  if (!t.has(e)) return e;
613
614
  let n = 2;
614
615
  for (; t.has(`${e}${n}`);) n += 1;
615
616
  return `${e}${n}`;
616
617
  }
617
- function q(e, t, n) {
618
- let r = He(t), i = /* @__PURE__ */ new Map();
618
+ function G(e, t, n) {
619
+ let r = We(t), i = /* @__PURE__ */ new Map();
619
620
  return e.template.replace(/\{\{bind:([^{}]+)\}\}/g, (e, t) => {
620
621
  let n = t.trim(), a = i.get(n);
621
622
  if (a) return a;
622
- let o = We(Ue(n), r);
623
+ let o = Ke(Ge(n), r);
623
624
  return r.add(o), i.set(n, o), o;
624
625
  });
625
626
  }
626
627
  // src/authoring/templates.ts
627
- function Ge(e) {
628
+ function K(e) {
628
629
  let t = {};
629
630
  for (let [n, r] of Object.entries(e.props)) t[n] = {
630
631
  kind: r.kind,
@@ -639,22 +640,22 @@ function Ge(e) {
639
640
  };
640
641
  return t;
641
642
  }
642
- function Ke(e) {
643
- return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
644
- }
645
643
  function qe(e) {
646
- return e === null ? "" : Ke(String(e));
644
+ return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
647
645
  }
648
646
  function Je(e) {
649
- let t = e.replace(/[^A-Za-z0-9_]/g, "_"), r = /^[0-9]/.test(t) ? `_${t}` : t;
650
- return n.has(r) ? `${r}_value` : r;
647
+ return e === null ? "" : qe(String(e));
648
+ }
649
+ function Ye(e) {
650
+ let n = e.replace(/[^A-Za-z0-9_]/g, "_"), r = /^[0-9]/.test(n) ? `_${n}` : n;
651
+ return t.has(r) ? `${r}_value` : r;
651
652
  }
652
- function Ye(e, t) {
653
- if (e.defaultValue !== void 0 && e.defaultValue !== null) return qe(e.defaultValue);
653
+ function Xe(e, t) {
654
+ if (e.defaultValue !== void 0 && e.defaultValue !== null) return Je(e.defaultValue);
654
655
  switch (e.kind) {
655
656
  case "boolean": return "false";
656
657
  case "enum":
657
- if (e.values?.length) return qe(e.values[0]);
658
+ if (e.values?.length) return Je(e.values[0]);
658
659
  throw Error(`${t} is a required enum without values; provide an authoring.insertText.`);
659
660
  case "number": {
660
661
  let n = e.min === void 0 ? void 0 : e.integer ? Math.ceil(e.min) : e.min, r = e.max === void 0 ? void 0 : e.integer ? Math.floor(e.max) : e.max;
@@ -670,22 +671,22 @@ function Ye(e, t) {
670
671
  default: throw Error(`${t} has an unsupported property kind; provide an authoring.insertText.`);
671
672
  }
672
673
  }
673
- function Xe(e) {
674
+ function Ze(e) {
674
675
  if (e.structure && e.structure.rule !== "none" && e.structure.rule !== "any" && e.structure.rule !== "inline") return !0;
675
676
  let t = e.children;
676
677
  return Array.isArray(t) ? t.some((e) => typeof e == "object" && !!e && (e.required === !0 || typeof e.min == "number" && e.min > 0)) : typeof t == "object" && t ? t.required === !0 || typeof t.min == "number" && t.min > 0 : !1;
677
678
  }
678
- function Ze(e, t) {
679
+ function Qe(e, t) {
679
680
  let n = e.name, r = e.form;
680
681
  if (r !== "leaf" && r !== "inline" && r !== "container") throw Error(`component "${n}" has an unsupported form; provide an authoring.insertText.`);
681
- if (Xe(e)) throw Error(`component "${n}" requires children; provide an authoring.insertText.`);
682
+ if (Ze(e)) throw Error(`component "${n}" requires children; provide an authoring.insertText.`);
682
683
  let i = Object.entries(e.bindings ?? {}), a = new Set(i.flatMap(([, e]) => [e.bind, e.initial])), o = [];
683
- for (let [e, t] of i) o.push(`${t.bind}="${Je(e === "value" ? n : `${n}_${e}`)}"`);
684
- for (let [e, r] of Object.entries(t)) r.required && (a.has(e) || o.push(`${e}="${Ye(r, `component "${n}" property "${e}"`)}"`));
684
+ for (let [e, t] of i) o.push(`${t.bind}="${Ye(e === "value" ? n : `${n}_${e}`)}"`);
685
+ for (let [e, r] of Object.entries(t)) r.required && (a.has(e) || o.push(`${e}="${Xe(r, `component "${n}" property "${e}"`)}"`));
685
686
  let s = `<${n}${o.length > 0 ? ` ${o.join(" ")}` : ""}`;
686
687
  return r === "leaf" ? `${s}>` : r === "inline" ? `${s}></${n}>` : `${s}>\n\n</${n}>`;
687
688
  }
688
- var Qe = {
689
+ var $e = {
689
690
  id: "authoring-template",
690
691
  label: "",
691
692
  description: "",
@@ -693,9 +694,9 @@ var Qe = {
693
694
  keywords: [],
694
695
  template: ""
695
696
  };
696
- function J(e, t = "") {
697
- let n = q({
698
- ...Qe,
697
+ function q(e, t = "") {
698
+ let n = G({
699
+ ...$e,
699
700
  template: e
700
701
  }, t);
701
702
  return B(t, {
@@ -703,28 +704,28 @@ function J(e, t = "") {
703
704
  end: t.length
704
705
  }, n).value.slice(t.length);
705
706
  }
706
- function $e(e) {
707
+ function et(e) {
707
708
  return e.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
708
709
  }
709
- function et(e, t) {
710
- let n = J(t), r = `</${e}>`, i = n.lastIndexOf(r);
710
+ function tt(e, t) {
711
+ let n = q(t), r = `</${e}>`, i = n.lastIndexOf(r);
711
712
  if (!(i < 0)) return {
712
713
  before: `${n.slice(0, i)}\n`,
713
714
  after: `\n${n.slice(i)}`
714
715
  };
715
716
  }
716
- function tt(e, t, n, r) {
717
- let i = r === void 0 ? J(e) : J(e, r.before), a = r === void 0 ? i : `${r.before}${i}${r.after}`, o;
717
+ function nt(e, t, n, r) {
718
+ let i = r === void 0 ? q(e) : q(e, r.before), a = r === void 0 ? i : `${r.before}${i}${r.after}`, o;
718
719
  try {
719
720
  o = m(a, t ?? {});
720
721
  } catch (e) {
721
722
  throw Error(`${n} authoring.insertText could not be compiled: ${e instanceof Error ? e.message : String(e)}.`);
722
723
  }
723
724
  if (o.ok) return;
724
- let s = $e(o);
725
+ let s = et(o);
725
726
  throw Error(`${n} authoring.insertText does not compile with this configuration${s ? ` (${s})` : ""}.`);
726
727
  }
727
- function nt(e, t, n, r) {
728
+ function rt(e, t, n, r) {
728
729
  let i = r === void 0 ? e : `${r.before}${e}${r.after}`, a;
729
730
  try {
730
731
  a = m(i, t ?? {});
@@ -736,21 +737,21 @@ function nt(e, t, n, r) {
736
737
  throw Error(`${n} has no authoring.insertText and its synthesized template does not compile with this configuration${o ? ` (${o})` : ""}. Provide authoring.insertText.`);
737
738
  }
738
739
  // src/authoring/catalog.ts
739
- function Y(e) {
740
+ function J(e) {
740
741
  return /* @__PURE__ */ Error(`Invalid local component catalog: ${e}`);
741
742
  }
742
- function X(e, t, n) {
743
- return u(e, t, n);
743
+ function Y(e, t, n) {
744
+ return a(e, t, n);
744
745
  }
745
- function rt(e, t) {
746
- let n = X(e, t, "");
746
+ function it(e, t) {
747
+ let n = Y(e, t, "");
747
748
  return n === "" ? void 0 : n;
748
749
  }
749
- function it(e) {
750
+ function at(e) {
750
751
  if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
751
752
  if (e === null) return null;
752
753
  }
753
- function at(e, t) {
754
+ function ot(e, t) {
754
755
  return Object.freeze({
755
756
  name: e,
756
757
  kind: t.kind,
@@ -758,17 +759,17 @@ function at(e, t) {
758
759
  static: t.static === !0,
759
760
  dynamic: t.dynamic === !0,
760
761
  ...t.values ? { values: Object.freeze([...t.values]) } : {},
761
- ...it(t.default) === void 0 ? {} : { defaultValue: it(t.default) }
762
+ ...at(t.default) === void 0 ? {} : { defaultValue: at(t.default) }
762
763
  });
763
764
  }
764
- function ot(e, t) {
765
+ function st(e, t) {
765
766
  let n = {};
766
- for (let [t, r] of Object.entries(e)) n[t] = at(t, r);
767
+ for (let [t, r] of Object.entries(e)) n[t] = ot(t, r);
767
768
  return n;
768
769
  }
769
- function st(e, t, n) {
770
+ function ct(e, t, n) {
770
771
  for (let [r, i] of Object.entries(e.props)) {
771
- let e = rt(i.description, n);
772
+ let e = it(i.description, n);
772
773
  if (e === void 0) continue;
773
774
  let a = t[r];
774
775
  t[r] = Object.freeze({
@@ -784,7 +785,7 @@ function st(e, t, n) {
784
785
  }
785
786
  return t;
786
787
  }
787
- function ct(e) {
788
+ function lt(e) {
788
789
  return Object.freeze({
789
790
  id: e.id,
790
791
  name: e.name,
@@ -804,89 +805,89 @@ function ct(e) {
804
805
  ...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
805
806
  });
806
807
  }
807
- function lt(e) {
808
+ function ut(e) {
808
809
  let t = e.structure;
809
810
  return {
810
811
  ...t?.parents?.length ? { parents: t.parents } : {},
811
812
  ...t?.children?.length ? { allowedChildren: t.children } : {}
812
813
  };
813
814
  }
814
- function ut(e, t) {
815
+ function dt(e, t) {
815
816
  if (e === t) return !0;
816
817
  if (e === void 0 || t === void 0) return !1;
817
818
  let n = Object.keys(e).sort(), r = Object.keys(t).sort();
818
819
  return n.length === r.length && n.every((n, i) => n === r[i] && e[n] === t[n]);
819
820
  }
820
- function Z(e) {
821
+ function X(e) {
821
822
  let t = e.authoring;
822
823
  if (t === void 0) return;
823
- if (i(e.name) === void 0) return t;
824
- let n = o(e.name), r = {};
825
- return t.title !== void 0 && !ut(t.title, n?.title) && (r.title = t.title), t.description !== void 0 && !ut(t.description, n?.description) && (r.description = t.description), t.category !== void 0 && t.category !== n?.category && (r.category = t.category), t.insertText !== void 0 && t.insertText !== n?.insertText && (r.insertText = t.insertText), Object.keys(r).length === 0 ? void 0 : Object.freeze(r);
824
+ if (s(e.name) === void 0) return t;
825
+ let n = u(e.name), r = {};
826
+ return t.title !== void 0 && !dt(t.title, n?.title) && (r.title = t.title), t.description !== void 0 && !dt(t.description, n?.description) && (r.description = t.description), t.category !== void 0 && t.category !== n?.category && (r.category = t.category), t.insertText !== void 0 && t.insertText !== n?.insertText && (r.insertText = t.insertText), Object.keys(r).length === 0 ? void 0 : Object.freeze(r);
826
827
  }
827
- function Q(e, t) {
828
- let n = i(e.name), r = Z(e);
828
+ function Z(e, t) {
829
+ let n = s(e.name), r = X(e);
829
830
  if (n) {
830
831
  let e = r?.insertText;
831
832
  if (e !== void 0) return e.trim() === "" ? void 0 : e;
832
- let i = X(n.insertText, t, n.insertText.en ?? "");
833
+ let i = Y(n.insertText, t, n.insertText.en ?? "");
833
834
  return i === "" ? void 0 : i;
834
835
  }
835
- let a = r?.insertText;
836
- return a !== void 0 && a.trim() !== "" ? a : void 0;
836
+ let i = r?.insertText;
837
+ return i !== void 0 && i.trim() !== "" ? i : void 0;
837
838
  }
838
- function dt(e, t) {
839
- let n = Q(e, t);
840
- return n === void 0 ? Ze(e, Ge(e)) : n;
839
+ function ft(e, t) {
840
+ let n = Z(e, t);
841
+ return n === void 0 ? Qe(e, K(e)) : n;
841
842
  }
842
- function ft(e, n, r) {
843
- let i = t(e).structure?.parents;
843
+ function pt(e, t, r) {
844
+ let i = n(e).structure?.parents;
844
845
  if (i !== void 0 && i.length !== 0) for (let e of i) {
845
- let t = n.get(e);
846
- if (t === void 0 || t.form !== "container") continue;
846
+ let n = t.get(e);
847
+ if (n === void 0 || n.form !== "container") continue;
847
848
  let i;
848
849
  try {
849
- i = dt(t, r);
850
+ i = ft(n, r);
850
851
  } catch {
851
852
  continue;
852
853
  }
853
- let a = et(e, i);
854
+ let a = tt(e, i);
854
855
  if (a !== void 0) return a;
855
856
  }
856
857
  }
857
- function pt(e, t) {
858
+ function mt(e, t) {
858
859
  if (e.parents !== void 0 && e.parents.length !== 0) for (let n of e.parents) {
859
860
  let e = t.find((e) => e.name === n);
860
861
  if (e === void 0 || e.form !== "container") continue;
861
- let r = et(n, e.insertText);
862
+ let r = tt(n, e.insertText);
862
863
  if (r !== void 0) return r;
863
864
  }
864
865
  }
865
- function mt(e, n, r, a, o) {
866
- let c = t(e), u = i(e.name), d = e.authoring, f = Z(e), p = X(u ? f?.title ?? u.title : d?.title, n, e.name), m = X(u ? f?.description ?? u.description : d?.description, n, p), h = u ? f?.category ?? u.category : d?.category !== void 0 && d.category.trim() !== "" ? d.category : "extension", ee = s(h, n), g = Q(e, n), _ = lt(c), v;
866
+ function Q(e, t, r, a, o) {
867
+ let c = n(e), u = s(e.name), d = e.authoring, f = X(e), p = Y(u ? f?.title ?? u.title : d?.title, t, e.name), m = Y(u ? f?.description ?? u.description : d?.description, t, p), h = u ? f?.category ?? u.category : d?.category !== void 0 && d.category.trim() !== "" ? d.category : "extension", ee = l(h, t), g = Z(e, t), _ = ut(c), v;
867
868
  if (g !== void 0) {
868
869
  if (v = g, o) {
869
- let t = ft(e, a, n);
870
+ let n = pt(e, a, t);
870
871
  try {
871
- tt(v, r, `component "${e.name}"`, t);
872
+ nt(v, r, `component "${e.name}"`, n);
872
873
  } catch (e) {
873
- throw Y(e instanceof Error ? e.message : String(e));
874
+ throw J(e instanceof Error ? e.message : String(e));
874
875
  }
875
876
  }
876
877
  } else {
877
878
  try {
878
- v = Ze(e, Ge(e));
879
+ v = Qe(e, K(e));
879
880
  } catch (e) {
880
- throw Y(e instanceof Error ? e.message : String(e));
881
+ throw J(e instanceof Error ? e.message : String(e));
881
882
  }
882
883
  if (o) try {
883
- nt(v, r, `component "${e.name}"`, ft(e, a, n));
884
+ rt(v, r, `component "${e.name}"`, pt(e, a, t));
884
885
  } catch (e) {
885
- throw Y(e instanceof Error ? e.message : String(e));
886
+ throw J(e instanceof Error ? e.message : String(e));
886
887
  }
887
888
  }
888
- let y = st(e, ot(c.props, n), n), b = l(e.name);
889
- return ct({
889
+ let te = ct(e, st(c.props, t), t), y = i(e.name);
890
+ return lt({
890
891
  id: u ? e.name : e.id,
891
892
  name: e.name,
892
893
  title: p,
@@ -897,39 +898,39 @@ function mt(e, n, r, a, o) {
897
898
  form: e.form,
898
899
  inline: u ? u.inline === !0 : e.form === "inline",
899
900
  ..._,
900
- ...b === void 0 ? {} : { keywords: b },
901
- props: y,
901
+ ...y === void 0 ? {} : { keywords: y },
902
+ props: te,
902
903
  ...e.styles === void 0 ? {} : { styles: e.styles },
903
904
  ...e.requires === void 0 ? {} : { requires: e.requires }
904
905
  });
905
906
  }
906
- function ht(e, t, n, r, i) {
907
+ function ht(e, t, n, i, a) {
907
908
  let o = new Map(e.map((e) => [e.name, e])), s = [], c = /* @__PURE__ */ new Set();
908
- for (let e of a) {
909
+ for (let e of r) {
909
910
  let t = o.get(e);
910
- t && t.authoring !== void 0 && (s.push(mt(t, n, r, o, !1)), c.add(e));
911
+ t && t.authoring !== void 0 && (s.push(Q(t, n, i, o, !1)), c.add(e));
911
912
  }
912
- for (let a of e) c.has(a.name) || (a.authoring !== void 0 || t.has(a.name)) && (s.push(mt(a, n, r, o, i && t.has(a.name))), c.add(a.name));
913
+ for (let r of e) c.has(r.name) || (r.authoring !== void 0 || t.has(r.name)) && (s.push(Q(r, n, i, o, a && t.has(r.name))), c.add(r.name));
913
914
  return s;
914
915
  }
915
- function gt(e, n) {
916
- let r = i(e.name), a = e.authoring, o = Z(e), c = {};
916
+ function gt(e, t) {
917
+ let r = s(e.name), a = e.authoring, o = X(e), c = {};
917
918
  for (let [t, n] of Object.entries(e.props)) c[t] = n.description;
918
919
  return JSON.stringify({
919
920
  name: e.name,
920
921
  id: e.id,
921
922
  form: e.form,
922
- title: X(r ? o?.title ?? r.title : a?.title, n, e.name),
923
- description: X(r ? o?.description ?? r.description : a?.description, n, ""),
923
+ title: Y(r ? o?.title ?? r.title : a?.title, t, e.name),
924
+ description: Y(r ? o?.description ?? r.description : a?.description, t, ""),
924
925
  category: r ? o?.category ?? r.category : a?.category ?? "",
925
- categoryLabel: s(r ? o?.category ?? r.category : a?.category ?? "extension", n),
926
- insertText: Q(e, n) ?? null,
926
+ categoryLabel: l(r ? o?.category ?? r.category : a?.category ?? "extension", t),
927
+ insertText: Z(e, t) ?? null,
927
928
  inline: r ? r.inline === !0 : e.form === "inline",
928
- keywords: l(e.name) ?? null,
929
+ keywords: i(e.name) ?? null,
929
930
  manifest: a ?? null,
930
931
  preset: r ?? null,
931
932
  propDescriptions: c,
932
- structure: t(e).structure ?? null,
933
+ structure: n(e).structure ?? null,
933
934
  styles: e.styles ?? null,
934
935
  requires: e.requires ?? null
935
936
  });
@@ -945,12 +946,12 @@ function $(e, t, n, r) {
945
946
  }
946
947
  function vt(e, t = "en") {
947
948
  let n = d(e), r = f({ config: n });
948
- if (!r.ok) throw Y(r.message);
949
+ if (!r.ok) throw J(r.message);
949
950
  return $(r, t, { config: n }, !0);
950
951
  }
951
952
  function yt(e, t = "en") {
952
953
  let n = d(e), r = f({ config: n });
953
- if (!r.ok) throw Y(r.message);
954
+ if (!r.ok) throw J(r.message);
954
955
  return $(r, t, { config: n }, !1);
955
956
  }
956
957
  function bt(e, t = "en") {
@@ -958,7 +959,7 @@ function bt(e, t = "en") {
958
959
  return n.ok ? $(n, t, e, !0) : Object.freeze([]);
959
960
  }
960
961
  function xt(e) {
961
- let t = new Map(c.map((e, t) => [e.id, t])), n = /* @__PURE__ */ new Map();
962
+ let t = new Map(o.map((e, t) => [e.id, t])), n = /* @__PURE__ */ new Map();
962
963
  for (let t of e) {
963
964
  let e = n.get(t.category);
964
965
  e ? e.entries.push(t) : n.set(t.category, {
@@ -994,22 +995,20 @@ function Ct(e) {
994
995
  return t.join("\n");
995
996
  }
996
997
  function wt(e, t, n) {
997
- if (typeof e != "string" || !Number.isFinite(t)) return Object.freeze([]);
998
- let r = f(n);
999
- if (!r.ok || r.htmlActive) return Object.freeze([]);
1000
- let i = Math.max(0, Math.min(e.length, Math.floor(t))), a = Object.freeze([]), o;
998
+ if (typeof e != "string" || !Number.isFinite(t) || !f(n).ok) return Object.freeze([]);
999
+ let r = Math.max(0, Math.min(e.length, Math.floor(t))), i = Object.freeze([]), a;
1001
1000
  try {
1002
- o = ee(e, n);
1001
+ a = te(e, n);
1003
1002
  } catch {
1004
- return a;
1003
+ return i;
1005
1004
  }
1006
- let s = (e, t) => {
1007
- for (let n of e) if ((n.type === "component" || n.type === "hostComponent") && n.name !== void 0 && n.range.start <= i && i < n.range.end) {
1005
+ let o = (e, t) => {
1006
+ for (let n of e) if ((n.type === "component" || n.type === "hostComponent") && n.name !== void 0 && n.range.start <= r && r < n.range.end) {
1008
1007
  let e = Object.freeze([...t, n.name]);
1009
- a = e, n.children && s(n.children, e);
1010
- } else n.type !== "fallback" && n.children && s(n.children, t);
1008
+ i = e, n.children && o(n.children, e);
1009
+ } else n.type !== "fallback" && n.children && o(n.children, t);
1011
1010
  };
1012
- return s(o.nodes, Object.freeze([])), a;
1011
+ return o(a.nodes, Object.freeze([])), i;
1013
1012
  }
1014
1013
  function Tt(e) {
1015
1014
  let t = {};
@@ -1091,12 +1090,12 @@ function Ot(e, t = "en") {
1091
1090
  }
1092
1091
  // src/authoring/insert.ts
1093
1092
  var kt = /[A-Za-z_][A-Za-z0-9_]*/g;
1094
- function At(e, t, r) {
1095
- let i = new Set(r.match(kt) ?? []), a = ie(e, t, { diagnostics: !1 }).bindings.filter((e) => e.declarations.length > 0).map((e) => e.name), o = new Set(a), s = e;
1093
+ function At(e, n, r) {
1094
+ let i = new Set(r.match(kt) ?? []), a = _(e, n, { diagnostics: !1 }).bindings.filter((e) => e.declarations.length > 0).map((e) => e.name), o = new Set(a), s = e;
1096
1095
  for (let e of a) {
1097
1096
  let r = e, a = 2;
1098
- for (; i.has(r) || n.has(r) || r !== e && o.has(r);) r = `${e}${a}`, a += 1;
1099
- i.add(r), r !== e && (s = x(s, e, r, t).source);
1097
+ for (; i.has(r) || t.has(r) || r !== e && o.has(r);) r = `${e}${a}`, a += 1;
1098
+ i.add(r), r !== e && (s = h(s, e, r, n).source);
1100
1099
  }
1101
1100
  return s;
1102
1101
  }
@@ -1111,7 +1110,7 @@ function jt(e) {
1111
1110
  };
1112
1111
  }
1113
1112
  function Mt(e, t, n, r) {
1114
- return B(n, r, At(q(jt(e), n), t, n), { block: !e.inline });
1113
+ return B(n, r, At(G(jt(e), n), t, n), { block: !e.inline });
1115
1114
  }
1116
1115
  function Nt(e, t, n, r, i = "en") {
1117
1116
  if (typeof n != "string") throw TypeError("insertLocalComponent requires source text.");
@@ -1133,7 +1132,7 @@ function Ft(e, t = "en") {
1133
1132
  let t = Mt(e, a, "", {
1134
1133
  start: 0,
1135
1134
  end: 0
1136
- }).value, n = pt(e, o), s = n === void 0 ? t : `${n.before}${t}${n.after}`, c = m(s, a);
1135
+ }).value, n = mt(e, o), s = n === void 0 ? t : `${n.before}${t}${n.after}`, c = m(s, a);
1137
1136
  c.ok || i.push(Object.freeze({
1138
1137
  id: e.id,
1139
1138
  name: e.name,
@@ -1146,4 +1145,4 @@ function Ft(e, t = "en") {
1146
1145
  }
1147
1146
  return Object.freeze(i);
1148
1147
  }
1149
- export { ze as EXTENDED_NATIVE_COMPONENTS, Be as EXTENDED_NATIVE_COMPONENT_COPY_ZH, te as LOCAL_COMPONENTS, _ as LOCAL_COMPONENT_NAMES, W as NATIVE_COMPONENTS, K as NATIVE_COMPONENTS_ZH, H as NATIVE_COMPONENT_GROUPS, G as NATIVE_COMPONENT_GROUPS_ZH, ie as analyzeLocalSource, e as closestName, ne as completeLocalSource, Ot as createLocalAuthoringLookup, vt as createLocalComponentCatalog, bt as createLocalComponentCatalogForOptions, St as filterLocalComponentCatalog, se as formatBold, he as formatBulletList, pe as formatHeading, de as formatInlineCode, ce as formatItalic, re as formatLocalSource, ge as formatOrderedList, ve as formatQuote, le as formatStrike, _e as formatTaskList, y as getLocalComponent, Ve as getNativeComponentCatalog, g as getPropDefault, ye as indentSelection, we as insertCodeBlock, Oe as insertDivider, Ce as insertImage, Se as insertLink, Pt as insertLocalComponent, Nt as insertLocalComponentFromOptions, De as insertTable, B as insertTemplate, ke as insertText, wt as localCatalogAncestors, xt as localComponentCatalogGroups, _t as localComponentCatalogKey, Ct as localComponentHelp, h as localComponentNames, xe as outdentSelection, Re as readFormatState, x as renameLocalBinding, q as renderNativeSnippet, v as suggestAttribute, b as suggestComponent, Ft as validateLocalComponentInsertTemplates };
1148
+ export { Ve as EXTENDED_NATIVE_COMPONENTS, He as EXTENDED_NATIVE_COMPONENT_COPY_ZH, oe as LOCAL_COMPONENTS, ne as LOCAL_COMPONENT_NAMES, H as NATIVE_COMPONENTS, W as NATIVE_COMPONENTS_ZH, ze as NATIVE_COMPONENT_GROUPS, U as NATIVE_COMPONENT_GROUPS_ZH, _ as analyzeLocalSource, e as closestName, ee as completeLocalSource, Ot as createLocalAuthoringLookup, vt as createLocalComponentCatalog, bt as createLocalComponentCatalogForOptions, St as filterLocalComponentCatalog, ce as formatBold, ge as formatBulletList, me as formatHeading, fe as formatInlineCode, le as formatItalic, g as formatLocalSource, _e as formatOrderedList, ye as formatQuote, ue as formatStrike, ve as formatTaskList, ie as getLocalComponent, Ue as getNativeComponentCatalog, y as getPropDefault, be as indentSelection, Te as insertCodeBlock, Oe as insertDivider, we as insertImage, Ce as insertLink, Pt as insertLocalComponent, Nt as insertLocalComponentFromOptions, De as insertTable, B as insertTemplate, ke as insertText, wt as localCatalogAncestors, xt as localComponentCatalogGroups, _t as localComponentCatalogKey, Ct as localComponentHelp, v as localComponentNames, Se as outdentSelection, Re as readFormatState, h as renameLocalBinding, G as renderNativeSnippet, re as suggestAttribute, ae as suggestComponent, Ft as validateLocalComponentInsertTemplates };