reactive-md 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (471) hide show
  1. package/CHANGELOG-ch.md +66 -0
  2. package/CHANGELOG.md +66 -0
  3. package/CONTRIBUTING-ch.md +6 -62
  4. package/CONTRIBUTING.md +5 -63
  5. package/README-ch.md +232 -67
  6. package/README-en.md +209 -71
  7. package/README.md +209 -71
  8. package/SECURITY-ch.md +3 -1
  9. package/SECURITY.md +3 -1
  10. package/THIRD_PARTY_NOTICES.md +1909 -87
  11. package/cli/args.mjs +33 -1
  12. package/cli/build.mjs +62 -1
  13. package/cli/check.mjs +444 -0
  14. package/cli/help.mjs +181 -3
  15. package/cli/init.mjs +1577 -0
  16. package/cli/main.mjs +11 -1
  17. package/cli/package-loader.mjs +41 -0
  18. package/dist-library/LocalDocumentView-6trX7xJc.js +97920 -0
  19. package/dist-library/{authoring-BEVyth5X.js → authoring-BsfSwQRm.js} +237 -209
  20. package/dist-library/compiler--ea2CKQF.js +61 -0
  21. package/dist-library/compiler-core-kPiH-gOV.js +11805 -0
  22. package/dist-library/component-state-Cq2K5gkS.js +490 -0
  23. package/dist-library/component-state-D_cw_EHe.js +54 -0
  24. package/dist-library/config-validation-DXTynAw7.js +3005 -0
  25. package/dist-library/default-components-Z_YMio5P.js +2346 -0
  26. package/dist-library/identity-MYJXKSkB.js +1443 -0
  27. package/dist-library/math-display-BJz4gbFc.js +24000 -0
  28. package/dist-library/math-sample-BGEW49zY.js +1124 -0
  29. package/dist-library/options-CX5m5n-J.js +115 -0
  30. package/dist-library/parser-standard-DlCk7sLo.js +10122 -0
  31. package/dist-library/props-DGlBk0e5.js +183 -0
  32. package/dist-library/react-ByOHunUW.js +122 -0
  33. package/dist-library/reactive-md-authoring.js +712 -1077
  34. package/dist-library/reactive-md-build.js +7966 -0
  35. package/dist-library/reactive-md-compiler-standard.js +33 -0
  36. package/dist-library/reactive-md-compiler.js +22 -0
  37. package/dist-library/reactive-md-default-packs.js +71 -0
  38. package/dist-library/reactive-md-default-preset.js +10 -0
  39. package/dist-library/reactive-md-export.js +111 -0
  40. package/dist-library/reactive-md-print.css +18 -3
  41. package/dist-library/reactive-md-react-runtime.js +251 -0
  42. package/dist-library/reactive-md-react-server.js +55 -0
  43. package/dist-library/reactive-md-react-unstyled.js +9 -1
  44. package/dist-library/reactive-md-react.js +9 -1
  45. package/dist-library/reactive-md-runtime-browser.js +51 -0
  46. package/dist-library/reactive-md-runtime.js +3 -0
  47. package/dist-library/reactive-md-sdk.js +6 -0
  48. package/dist-library/reactive-md-standalone-host.js +442 -0
  49. package/dist-library/reactive-md-testing-browser.js +523 -0
  50. package/dist-library/reactive-md-testing-react.js +221 -0
  51. package/dist-library/reactive-md-testing.js +638 -0
  52. package/dist-library/reactive-md-vite.js +959 -0
  53. package/dist-library/reactive-md.css +1 -1
  54. package/dist-library/reactive-md.js +1080 -795
  55. package/dist-library/registry-B9Jc3FVe.js +1174 -0
  56. package/dist-library/resources-BGt8mpDA.js +204 -0
  57. package/dist-library/runtime-C-sbfpOX.js +1157 -0
  58. package/dist-library/runtime-Dkq7ldyg.js +172 -0
  59. package/dist-library/schema-ZFufO8V0.js +39 -0
  60. package/dist-library/shareable-DDVL4Fi9.js +844 -0
  61. package/dist-library/types/authoring/catalog.d.ts +168 -0
  62. package/dist-library/types/authoring/conformance.d.ts +24 -0
  63. package/dist-library/types/{editor → authoring}/editor-i18n.d.ts +3 -24
  64. package/dist-library/types/authoring/extensions.d.ts +13 -0
  65. package/dist-library/types/authoring/index.d.ts +14 -11
  66. package/dist-library/types/authoring/insert.d.ts +16 -0
  67. package/dist-library/types/{editor → authoring}/native-components.d.ts +19 -2
  68. package/dist-library/types/authoring/templates.d.ts +65 -0
  69. package/dist-library/types/build/diagnostics.d.ts +8 -0
  70. package/dist-library/types/build/digest.d.ts +5 -0
  71. package/dist-library/types/build/entry.d.ts +9 -0
  72. package/dist-library/types/build/host.d.ts +36 -0
  73. package/dist-library/types/build/index.d.ts +99 -0
  74. package/dist-library/types/build/notices.d.ts +29 -0
  75. package/dist-library/types/build/resources.d.ts +60 -0
  76. package/dist-library/types/build/vite.d.ts +15 -0
  77. package/dist-library/types/compiler/index.d.ts +22 -0
  78. package/dist-library/types/compiler/result.d.ts +30 -0
  79. package/dist-library/types/compiler/standard.d.ts +16 -0
  80. package/dist-library/types/compiler/types.d.ts +69 -0
  81. package/dist-library/types/components/chart-motion.d.ts +12 -0
  82. package/dist-library/types/components/controls.d.ts +21 -0
  83. package/dist-library/types/{local → components}/data-table.d.ts +10 -24
  84. package/dist-library/types/components/default-chart-types.d.ts +22 -0
  85. package/dist-library/types/components/default-chart.d.ts +2 -0
  86. package/dist-library/types/components/default-preset.d.ts +10 -0
  87. package/dist-library/types/components/diagram-inspector.d.ts +24 -0
  88. package/dist-library/types/components/gallery.d.ts +6 -0
  89. package/dist-library/types/components/layout.d.ts +23 -0
  90. package/dist-library/types/components/mafs-plot-grid.d.ts +57 -0
  91. package/dist-library/types/components/mafs-visuals.d.ts +40 -0
  92. package/dist-library/types/components/numeric-sliders.d.ts +3 -0
  93. package/dist-library/types/components/uiarc/calendar/calendar.d.ts +26 -0
  94. package/dist-library/types/components/uiarc/date-picker/date-picker.d.ts +29 -0
  95. package/dist-library/types/components/uiarc/lib/motion-tokens.d.ts +2 -0
  96. package/dist-library/types/components/uiarc/lib/use-today.d.ts +2 -0
  97. package/dist-library/types/components/uiarc/motion-tokens.d.ts +60 -0
  98. package/dist-library/types/components/uiarc/rmd-motion.d.ts +12 -0
  99. package/dist-library/types/components/uiarc/select/select.d.ts +21 -0
  100. package/dist-library/types/components/uiarc/slider/slider.d.ts +53 -0
  101. package/dist-library/types/components/use-hydrated.d.ts +6 -0
  102. package/dist-library/types/components/visuals.d.ts +13 -0
  103. package/dist-library/types/export/component-state.d.ts +39 -0
  104. package/dist-library/types/export/index.d.ts +47 -0
  105. package/dist-library/types/export/requirements.d.ts +23 -0
  106. package/dist-library/types/export/resources.d.ts +8 -0
  107. package/dist-library/types/export/restoration.d.ts +52 -0
  108. package/dist-library/types/index.d.ts +1 -0
  109. package/dist-library/types/local/compilation/compiler-core.d.ts +16 -0
  110. package/dist-library/types/local/compilation/compiler-services.d.ts +64 -0
  111. package/dist-library/types/local/compilation/compiler-structure.d.ts +46 -0
  112. package/dist-library/types/local/compilation/compiler-values.d.ts +9 -0
  113. package/dist-library/types/local/compilation/compiler.d.ts +34 -0
  114. package/dist-library/types/local/compilation/component-kernel.d.ts +487 -0
  115. package/dist-library/types/local/{dependencies.d.ts → compilation/dependencies.d.ts} +4 -3
  116. package/dist-library/types/local/{diagnostics.d.ts → configuration/diagnostic-messages.d.ts} +193 -65
  117. package/dist-library/types/local/configuration/diagnostics.d.ts +58 -0
  118. package/dist-library/types/local/{limits.d.ts → configuration/limits.d.ts} +15 -2
  119. package/dist-library/types/local/configuration/options-core.d.ts +120 -0
  120. package/dist-library/types/local/configuration/options.d.ts +17 -0
  121. package/dist-library/types/local/configuration/portable-options.d.ts +3 -0
  122. package/dist-library/types/local/configuration/schema-core.d.ts +32 -0
  123. package/dist-library/types/local/configuration/schema.d.ts +12 -0
  124. package/dist-library/types/local/contracts/types.d.ts +519 -0
  125. package/dist-library/types/local/{version.d.ts → contracts/version.d.ts} +1 -1
  126. package/dist-library/types/local/{computations.d.ts → evaluation/computations.d.ts} +6 -3
  127. package/dist-library/types/local/{expression.d.ts → evaluation/expression.d.ts} +2 -2
  128. package/dist-library/types/local/{math-display.d.ts → evaluation/math-display.d.ts} +2 -16
  129. package/dist-library/types/local/evaluation/math-sample.d.ts +23 -0
  130. package/dist-library/types/local/evaluation/math.d.ts +73 -0
  131. package/dist-library/types/local/{validation.d.ts → evaluation/validation.d.ts} +1 -1
  132. package/dist-library/types/local/html/html-details.d.ts +16 -0
  133. package/dist-library/types/local/html/html-entities.d.ts +7 -0
  134. package/dist-library/types/local/html/html-policy.d.ts +43 -0
  135. package/dist-library/types/local/html/html-recovery.d.ts +16 -0
  136. package/dist-library/types/local/html/html-table-names.d.ts +9 -0
  137. package/dist-library/types/local/{html-table.d.ts → html/html-table.d.ts} +2 -6
  138. package/dist-library/types/local/{html.d.ts → html/html.d.ts} +1 -1
  139. package/dist-library/types/local/index.d.ts +31 -24
  140. package/dist-library/types/local/markdown/fast-markdown.d.ts +137 -0
  141. package/dist-library/types/local/{footnotes.d.ts → markdown/footnotes.d.ts} +1 -1
  142. package/dist-library/types/local/{heading-anchors.d.ts → markdown/heading-anchors.d.ts} +12 -2
  143. package/dist-library/types/local/markdown/markdown-blocks.d.ts +55 -0
  144. package/dist-library/types/local/markdown/markdown-structure.d.ts +3 -0
  145. package/dist-library/types/local/markdown/plain-paragraphs.d.ts +10 -0
  146. package/dist-library/types/local/parsing/lexical.d.ts +21 -0
  147. package/dist-library/types/local/parsing/parse-budget.d.ts +67 -0
  148. package/dist-library/types/local/parsing/parser-capabilities.d.ts +42 -0
  149. package/dist-library/types/local/parsing/parser-core.d.ts +65 -0
  150. package/dist-library/types/local/parsing/parser-standard.d.ts +7 -0
  151. package/dist-library/types/local/parsing/parser.d.ts +16 -0
  152. package/dist-library/types/local/parsing/rmd-recovery.d.ts +48 -0
  153. package/dist-library/types/local/{LocalDocumentView.d.ts → rendering/LocalDocumentView.d.ts} +67 -24
  154. package/dist-library/types/local/rendering/legacy-component-adapter.d.ts +36 -0
  155. package/dist-library/types/local/rendering/render-types.d.ts +57 -0
  156. package/dist-library/types/local/rendering/view-revision.d.ts +75 -0
  157. package/dist-library/types/local/{retention.d.ts → runtime/retention.d.ts} +1 -1
  158. package/dist-library/types/local/runtime/runtime.d.ts +34 -0
  159. package/dist-library/types/local/{state.d.ts → runtime/state.d.ts} +4 -4
  160. package/dist-library/types/local/session/compiler-cache.d.ts +44 -0
  161. package/dist-library/types/local/session/incremental.d.ts +48 -0
  162. package/dist-library/types/local/session/parse-session.d.ts +62 -0
  163. package/dist-library/types/local/session/row-reuse.d.ts +46 -0
  164. package/dist-library/types/local/{authoring.d.ts → source/authoring.d.ts} +11 -3
  165. package/dist-library/types/local/source/node-walk.d.ts +3 -0
  166. package/dist-library/types/local/source/source-context.d.ts +63 -0
  167. package/dist-library/types/local/{source-migration.d.ts → source/source-migration.d.ts} +2 -2
  168. package/dist-library/types/local/{i18n.d.ts → theme/i18n.d.ts} +2 -2
  169. package/dist-library/types/local/theme/theme-name.d.ts +3 -0
  170. package/dist-library/types/local/{theme.d.ts → theme/theme.d.ts} +3 -3
  171. package/dist-library/types/local/transport/compile-patch.d.ts +127 -0
  172. package/dist-library/types/local/{compiled-data.d.ts → transport/compiled-data.d.ts} +1 -1
  173. package/dist-library/types/local/transport/flat-compiled-data.d.ts +17 -0
  174. package/dist-library/types/local/transport/shared-data.d.ts +10 -0
  175. package/dist-library/types/local/transport/worker.d.ts +265 -0
  176. package/dist-library/types/local/widgets/visuals.d.ts +25 -0
  177. package/dist-library/types/presets/default-authoring.d.ts +50 -0
  178. package/dist-library/types/presets/default-components.d.ts +4 -0
  179. package/dist-library/types/presets/default-semantics.d.ts +8 -0
  180. package/dist-library/types/presets/default.d.ts +11 -0
  181. package/dist-library/types/presets/identity.d.ts +7 -0
  182. package/dist-library/types/presets/packs.d.ts +4 -0
  183. package/dist-library/types/react/component-api.d.ts +260 -0
  184. package/dist-library/types/react/component-primitives.d.ts +21 -0
  185. package/dist-library/types/react/component-utils.d.ts +125 -0
  186. package/dist-library/types/react/default-theme.d.ts +6 -0
  187. package/dist-library/types/react/field-validation.d.ts +11 -0
  188. package/dist-library/types/react/index.d.ts +17 -5
  189. package/dist-library/types/react/overflow-text-tooltip.d.ts +6 -0
  190. package/dist-library/types/react/package.d.ts +69 -0
  191. package/dist-library/types/react/runtime/common.d.ts +4 -0
  192. package/dist-library/types/react/runtime/index.d.ts +8 -0
  193. package/dist-library/types/react/runtime/useComponentState.d.ts +30 -0
  194. package/dist-library/types/react/runtime/useKeys.d.ts +16 -0
  195. package/dist-library/types/react/runtime/useSwipe.d.ts +27 -0
  196. package/dist-library/types/react/runtime/useTicker.d.ts +17 -0
  197. package/dist-library/types/react/sdk.d.ts +110 -0
  198. package/dist-library/types/react/server.d.ts +15 -0
  199. package/dist-library/types/react/tooltip-layer.d.ts +10 -0
  200. package/dist-library/types/react/use-draft-field.d.ts +17 -0
  201. package/dist-library/types/runtime-services/browser/index.d.ts +63 -0
  202. package/dist-library/types/runtime-services/component-state.d.ts +152 -0
  203. package/dist-library/types/runtime-services/identity.d.ts +41 -0
  204. package/dist-library/types/runtime-services/index.d.ts +10 -0
  205. package/dist-library/types/runtime-services/random.d.ts +42 -0
  206. package/dist-library/types/runtime-services/runtime.d.ts +51 -0
  207. package/dist-library/types/runtime-services/scheduler.d.ts +44 -0
  208. package/dist-library/types/sdk/assembly.d.ts +73 -0
  209. package/dist-library/types/sdk/compat-profile.d.ts +57 -0
  210. package/dist-library/types/sdk/compiler-config.d.ts +33 -0
  211. package/dist-library/types/sdk/config-validation.d.ts +33 -0
  212. package/dist-library/types/sdk/config.d.ts +35 -0
  213. package/dist-library/types/sdk/hash.d.ts +9 -0
  214. package/dist-library/types/sdk/index.d.ts +10 -0
  215. package/dist-library/types/sdk/manifest.d.ts +49 -0
  216. package/dist-library/types/sdk/pattern.d.ts +11 -0
  217. package/dist-library/types/sdk/preset-core.d.ts +11 -0
  218. package/dist-library/types/sdk/preset.d.ts +9 -0
  219. package/dist-library/types/sdk/props.d.ts +33 -0
  220. package/dist-library/types/sdk/registry-core.d.ts +16 -0
  221. package/dist-library/types/sdk/registry.d.ts +18 -0
  222. package/dist-library/types/sdk/theme.d.ts +73 -0
  223. package/dist-library/types/sdk/types.d.ts +221 -0
  224. package/dist-library/types/sdk/version.d.ts +49 -0
  225. package/dist-library/types/shareable.d.ts +29 -3
  226. package/dist-library/types/standalone/diagnostics.d.ts +16 -0
  227. package/dist-library/types/standalone/events.d.ts +4 -0
  228. package/dist-library/types/standalone/library.d.ts +6 -0
  229. package/dist-library/types/standalone/payload.d.ts +15 -0
  230. package/dist-library/types/standalone/prepare.d.ts +21 -0
  231. package/dist-library/types/standalone/session.d.ts +68 -0
  232. package/dist-library/types/standalone/version.d.ts +7 -0
  233. package/dist-library/types/testing/behavior.d.ts +19 -0
  234. package/dist-library/types/testing/browser.d.ts +126 -0
  235. package/dist-library/types/testing/cases.d.ts +16 -0
  236. package/dist-library/types/testing/index.d.ts +13 -0
  237. package/dist-library/types/testing/manifest.d.ts +10 -0
  238. package/dist-library/types/testing/react.d.ts +45 -0
  239. package/dist-library/types/testing/report.d.ts +20 -0
  240. package/dist-library/types/testing/types.d.ts +125 -0
  241. package/dist-library/types/testing/values.d.ts +22 -0
  242. package/dist-library/types/vite/client.d.ts +36 -0
  243. package/dist-library/types/vite/discovery.d.ts +51 -0
  244. package/dist-library/types/vite/index.d.ts +31 -0
  245. package/dist-library/types/vite/registration.d.ts +109 -0
  246. package/dist-library/types-BFCrMrg0.js +52 -0
  247. package/dist-library/validation-W-bmny-x.js +2253 -0
  248. package/dist-library/values-CIt8AjiU.js +134 -0
  249. package/dist-standalone/reactive-md-standalone.css +1 -1
  250. package/dist-standalone/reactive-md-standalone.js +591 -95
  251. package/docs/README-ch.md +90 -0
  252. package/docs/README.md +87 -81
  253. package/docs/compatibility/compatibility-ch.md +22 -14
  254. package/docs/compatibility/compatibility-en.md +22 -14
  255. package/docs/compatibility/source-versioning-ch.md +15 -12
  256. package/docs/compatibility/source-versioning-en.md +16 -13
  257. package/docs/development/component-development-ch.md +51 -195
  258. package/docs/development/component-development-en.md +51 -195
  259. package/docs/development/component-development-reference-ch.md +253 -0
  260. package/docs/development/component-development-reference-en.md +238 -0
  261. package/docs/development/component-protocol-ch.md +51 -50
  262. package/docs/development/component-protocol-en.md +52 -49
  263. package/docs/development/local-module-layout-ch.md +59 -0
  264. package/docs/development/local-module-layout-en.md +59 -0
  265. package/docs/development/performance-overview-ch.md +402 -0
  266. package/docs/development/performance-overview-en.md +402 -0
  267. package/docs/development/releasing-ch.md +8 -104
  268. package/docs/development/releasing-en.md +8 -104
  269. package/docs/guides/local-guide-ch.md +28 -9
  270. package/docs/guides/local-guide-en.md +31 -12
  271. package/docs/integration/author-tools-ch.md +4 -2
  272. package/docs/integration/author-tools-en.md +4 -2
  273. package/docs/integration/codemirror-ch.md +52 -0
  274. package/docs/integration/codemirror-en.md +29 -0
  275. package/docs/integration/compiler-ch.md +47 -0
  276. package/docs/integration/compiler-en.md +34 -0
  277. package/docs/integration/directory-discovery-ch.md +53 -0
  278. package/docs/integration/directory-discovery-en.md +31 -0
  279. package/docs/integration/editor-ch.md +48 -21
  280. package/docs/integration/editor-en.md +48 -21
  281. package/docs/integration/extension-sdk-ch.md +392 -0
  282. package/docs/integration/extension-sdk-en.md +377 -0
  283. package/docs/integration/local-integration-ch.md +63 -9
  284. package/docs/integration/local-integration-en.md +89 -13
  285. package/docs/integration/repository-split-ch.md +40 -0
  286. package/docs/integration/repository-split-en.md +23 -0
  287. package/docs/integration/shareable-export-ch.md +46 -2
  288. package/docs/integration/shareable-export-en.md +46 -2
  289. package/docs/reference/computations-formatting-ch.md +4 -2
  290. package/docs/reference/computations-formatting-en.md +4 -2
  291. package/docs/reference/constraints-collections-ch.md +21 -1
  292. package/docs/reference/constraints-collections-en.md +21 -1
  293. package/docs/reference/diagnostics-counting-ch.md +1 -1
  294. package/docs/reference/diagnostics-counting-en.md +1 -1
  295. package/docs/reference/html-compatibility-ch.md +4 -0
  296. package/docs/reference/html-compatibility-en.md +4 -0
  297. package/docs/reference/local-components-v2-ch.md +2 -0
  298. package/docs/reference/local-components-v2-en.md +2 -0
  299. package/docs/reference/local-interaction-syntax-ch.md +51 -15
  300. package/docs/reference/local-interaction-syntax-en.md +58 -14
  301. package/docs/reference/theme-protocol-ch.md +79 -7
  302. package/docs/reference/theme-protocol-en.md +79 -7
  303. package/docs/reference/tolerance-ch.md +64 -0
  304. package/docs/reference/tolerance-en.md +57 -0
  305. package/docs/releases/release-0.4.0-ch.md +2 -0
  306. package/docs/releases/release-0.4.0-en.md +2 -0
  307. package/docs/releases/release-0.4.1-ch.md +2 -0
  308. package/docs/releases/release-0.4.1-en.md +2 -0
  309. package/docs/releases/release-0.5.0-ch.md +2 -0
  310. package/docs/releases/release-0.5.0-en.md +2 -0
  311. package/docs/releases/release-0.5.1-ch.md +2 -0
  312. package/docs/releases/release-0.5.1-en.md +2 -0
  313. package/docs/releases/release-0.5.2-ch.md +2 -0
  314. package/docs/releases/release-0.5.2-en.md +2 -0
  315. package/docs/releases/release-0.5.3-ch.md +2 -0
  316. package/docs/releases/release-0.5.3-en.md +2 -0
  317. package/docs/releases/release-0.6.0-ch.md +2 -0
  318. package/docs/releases/release-0.6.0-en.md +2 -0
  319. package/docs/releases/release-0.6.1-ch.md +2 -0
  320. package/docs/releases/release-0.6.1-en.md +2 -0
  321. package/docs/releases/release-0.7.0-ch.md +86 -0
  322. package/docs/releases/release-0.7.0-en.md +86 -0
  323. package/docs/releases/release-0.8.0-ch.md +126 -0
  324. package/docs/releases/release-0.8.0-en.md +126 -0
  325. package/examples/component-package/LICENSE +21 -0
  326. package/examples/component-package/NOTICES.md +12 -0
  327. package/examples/component-package/README-ch.md +101 -0
  328. package/examples/component-package/README.md +133 -0
  329. package/examples/component-package/package.json +35 -0
  330. package/examples/component-package/sample/document.reactive.md +14 -0
  331. package/examples/component-package/scripts/build-export.mjs +44 -0
  332. package/examples/component-package/scripts/build.mjs +130 -0
  333. package/examples/component-package/scripts/verify.mjs +257 -0
  334. package/examples/component-package/src/assets/notice.svg +4 -0
  335. package/examples/component-package/src/component.css +40 -0
  336. package/examples/component-package/src/components.tsx +105 -0
  337. package/examples/component-package/src/harness.tsx +34 -0
  338. package/examples/component-package/src/manifests.ts +71 -0
  339. package/examples/component-package/src/node-entry.ts +18 -0
  340. package/examples/component-package/src/sample.ts +4 -0
  341. package/examples/component-package/src/theme.css +44 -0
  342. package/examples/component-package/src/theme.ts +22 -0
  343. package/examples/component-package/tsconfig.json +15 -0
  344. package/examples/conformance/README-ch.md +55 -0
  345. package/examples/conformance/README.md +2 -0
  346. package/examples/conformance/local-draft-3.json +296 -0
  347. package/examples/game-2048-package/LICENSE +21 -0
  348. package/examples/game-2048-package/NOTICES.md +11 -0
  349. package/examples/game-2048-package/README-ch.md +97 -0
  350. package/examples/game-2048-package/README.md +102 -0
  351. package/examples/game-2048-package/package.json +35 -0
  352. package/examples/game-2048-package/sample/document.reactive.md +17 -0
  353. package/examples/game-2048-package/scripts/build-export.mjs +44 -0
  354. package/examples/game-2048-package/scripts/build.mjs +130 -0
  355. package/examples/game-2048-package/scripts/verify.mjs +180 -0
  356. package/examples/game-2048-package/src/component.css +161 -0
  357. package/examples/game-2048-package/src/components.tsx +326 -0
  358. package/examples/game-2048-package/src/game-engine.ts +228 -0
  359. package/examples/game-2048-package/src/harness.tsx +34 -0
  360. package/examples/game-2048-package/src/manifest.ts +85 -0
  361. package/examples/game-2048-package/src/node-entry.ts +30 -0
  362. package/examples/game-2048-package/src/sample.ts +4 -0
  363. package/examples/game-2048-package/tsconfig.json +15 -0
  364. package/examples/integration/README-ch.md +63 -0
  365. package/examples/integration/README.md +17 -1
  366. package/examples/integration/extension-sdk/README-ch.md +24 -0
  367. package/examples/integration/extension-sdk/README.md +24 -0
  368. package/examples/integration/extension-sdk/advanced-standalone.ts +6 -0
  369. package/examples/integration/extension-sdk/advanced.tsx +101 -0
  370. package/examples/integration/extension-sdk/env.d.ts +2 -0
  371. package/examples/integration/extension-sdk/extensions.tsx +97 -0
  372. package/examples/integration/extension-sdk/index.html +3 -0
  373. package/examples/integration/extension-sdk/main.tsx +10 -0
  374. package/examples/integration/extension-sdk/package.json +6 -0
  375. package/examples/integration/extension-sdk/standalone.ts +7 -0
  376. package/examples/integration/extension-sdk/tsconfig.json +8 -0
  377. package/examples/integration/react-comprehensive/index.html +12 -0
  378. package/examples/integration/react-comprehensive/main.jsx +123 -0
  379. package/examples/integration/react-comprehensive/package.json +18 -0
  380. package/examples/local/README-ch.md +76 -0
  381. package/examples/local/README.md +4 -2
  382. package/examples/local/scenarios/blog-zh.reactive.md +71 -0
  383. package/examples/local/scenarios/blog.reactive.md +71 -0
  384. package/examples/local/scenarios/classroom-zh.reactive.md +97 -0
  385. package/examples/local/scenarios/classroom.reactive.md +97 -0
  386. package/examples/local/scenarios/proposal-zh.reactive.md +79 -0
  387. package/examples/local/scenarios/proposal.reactive.md +79 -0
  388. package/examples/local/scenarios/survey-zh.reactive.md +74 -0
  389. package/examples/local/scenarios/survey.reactive.md +74 -0
  390. package/examples/local/showcase/README-ch.md +22 -0
  391. package/examples/local/showcase/README.md +9 -3
  392. package/examples/local/showcase/features.reactive.md +637 -0
  393. package/examples/local/showcase/zh/features.reactive.md +637 -0
  394. package/examples/sci-fi-theme/README-ch.md +131 -0
  395. package/examples/sci-fi-theme/README.md +146 -0
  396. package/examples/sci-fi-theme/demo/demo.css +532 -0
  397. package/examples/sci-fi-theme/demo/document.reactive.md +185 -0
  398. package/examples/sci-fi-theme/demo/index.html +13 -0
  399. package/examples/sci-fi-theme/demo/main.tsx +180 -0
  400. package/examples/sci-fi-theme/docs/design-system-ch.md +245 -0
  401. package/examples/sci-fi-theme/docs/design-system.md +474 -0
  402. package/examples/sci-fi-theme/package.json +27 -0
  403. package/examples/sci-fi-theme/scripts/screenshot.mjs +98 -0
  404. package/examples/sci-fi-theme/src/components.css +1460 -0
  405. package/examples/sci-fi-theme/src/index.ts +6 -0
  406. package/examples/sci-fi-theme/src/sci-fi.css +5 -0
  407. package/examples/sci-fi-theme/src/theme.ts +37 -0
  408. package/examples/sci-fi-theme/src/tokens.css +408 -0
  409. package/examples/sci-fi-theme/tsconfig.json +20 -0
  410. package/examples/sci-fi-theme/vite.config.ts +24 -0
  411. package/examples/tetris-package/LICENSE +21 -0
  412. package/examples/tetris-package/NOTICES.md +11 -0
  413. package/examples/tetris-package/README-ch.md +91 -0
  414. package/examples/tetris-package/README.md +95 -0
  415. package/examples/tetris-package/package.json +35 -0
  416. package/examples/tetris-package/sample/document.reactive.md +16 -0
  417. package/examples/tetris-package/scripts/build-export.mjs +44 -0
  418. package/examples/tetris-package/scripts/build.mjs +130 -0
  419. package/examples/tetris-package/scripts/verify.mjs +173 -0
  420. package/examples/tetris-package/src/component.css +145 -0
  421. package/examples/tetris-package/src/components.tsx +334 -0
  422. package/examples/tetris-package/src/harness.tsx +34 -0
  423. package/examples/tetris-package/src/manifests.ts +93 -0
  424. package/examples/tetris-package/src/node-entry.ts +16 -0
  425. package/examples/tetris-package/src/sample.ts +4 -0
  426. package/examples/tetris-package/src/tetris-engine.ts +325 -0
  427. package/examples/tetris-package/tsconfig.json +15 -0
  428. package/package.json +98 -44
  429. package/dist-library/compiler-Cm3ppMxG.js +0 -46044
  430. package/dist-library/react-Bh7_oxZp.js +0 -59655
  431. package/dist-library/reactive-md-editor.css +0 -2
  432. package/dist-library/reactive-md-editor.js +0 -3853
  433. package/dist-library/runtime-DlFYQ4s_.js +0 -498
  434. package/dist-library/types/editor/ReactiveMarkdownEditor.d.ts +0 -7
  435. package/dist-library/types/editor/editor-toolbar.d.ts +0 -24
  436. package/dist-library/types/editor/editor-view-bar.d.ts +0 -11
  437. package/dist-library/types/editor/extended-native-components.d.ts +0 -58
  438. package/dist-library/types/editor/index.d.ts +0 -9
  439. package/dist-library/types/editor/locale.d.ts +0 -13
  440. package/dist-library/types/editor/source-authoring.d.ts +0 -59
  441. package/dist-library/types/editor/types.d.ts +0 -48
  442. package/dist-library/types/editor/use-gutter-metrics.d.ts +0 -5
  443. package/dist-library/types/editor/use-source-history.d.ts +0 -16
  444. package/dist-library/types/local/compiler.d.ts +0 -4
  445. package/dist-library/types/local/math.d.ts +0 -48
  446. package/dist-library/types/local/options.d.ts +0 -36
  447. package/dist-library/types/local/parser.d.ts +0 -13
  448. package/dist-library/types/local/render-types.d.ts +0 -27
  449. package/dist-library/types/local/runtime.d.ts +0 -2
  450. package/dist-library/types/local/schema.d.ts +0 -77
  451. package/dist-library/types/local/types.d.ts +0 -263
  452. package/dist-library/types/local/visuals.d.ts +0 -12
  453. package/dist-library/types/local/worker.d.ts +0 -98
  454. package/docs/development/performance-ch.md +0 -76
  455. package/docs/development/performance-en.md +0 -76
  456. /package/dist-library/types/{editor → authoring}/command-types.d.ts +0 -0
  457. /package/dist-library/types/{editor → authoring}/editor-commands.d.ts +0 -0
  458. /package/dist-library/types/local/{locale.d.ts → contracts/locale.d.ts} +0 -0
  459. /package/dist-library/types/local/{collection-functions.d.ts → evaluation/collection-functions.d.ts} +0 -0
  460. /package/dist-library/types/local/{data-functions.d.ts → evaluation/data-functions.d.ts} +0 -0
  461. /package/dist-library/types/local/{dates.d.ts → evaluation/dates.d.ts} +0 -0
  462. /package/dist-library/types/local/{formatting.d.ts → evaluation/formatting.d.ts} +0 -0
  463. /package/dist-library/types/local/{html-names.d.ts → html/html-names.d.ts} +0 -0
  464. /package/dist-library/types/local/{text-length.d.ts → source/text-length.d.ts} +0 -0
  465. /package/dist-library/types/local/{colors.d.ts → theme/colors.d.ts} +0 -0
  466. /package/dist-library/types/local/{code-block.d.ts → widgets/code-block.d.ts} +0 -0
  467. /package/dist-library/types/local/{code-languages.d.ts → widgets/code-languages.d.ts} +0 -0
  468. /package/dist-library/types/local/{diagram-layout.d.ts → widgets/diagram-layout.d.ts} +0 -0
  469. /package/dist-library/types/local/{image-view.d.ts → widgets/image-view.d.ts} +0 -0
  470. /package/dist-library/types/local/{math-view.d.ts → widgets/math-view.d.ts} +0 -0
  471. /package/dist-library/types/local/{table-surface.d.ts → widgets/table-surface.d.ts} +0 -0
@@ -1,213 +1,13 @@
1
- import { C as e, D as t, E as n, O as r, S as i, T as a, w as o, x as s } from "./compiler-Cm3ppMxG.js";
2
- import { i as c, n as l, r as u, t as d } from "./authoring-BEVyth5X.js";
3
- // src/editor/extended-native-components.ts
4
- var f = [
5
- {
6
- id: "jump",
7
- label: "Jump and anchor",
8
- description: "Link to a named position in this document.",
9
- group: "action",
10
- keywords: [
11
- "jump",
12
- "anchor",
13
- "navigation"
14
- ],
15
- template: "<jump to=\"{{bind:destination}}\" appearance=\"button\" color=\"#2563eb\">View results</jump>\n\n<anchor id=\"{{bind:destination}}\">\n\n{{selection:Results appear here.}}"
16
- },
17
- {
18
- id: "anchor",
19
- label: "Anchor",
20
- description: "Name a destination for document links.",
21
- group: "layout",
22
- keywords: [
23
- "anchor",
24
- "target",
25
- "destination"
26
- ],
27
- template: "<anchor id=\"{{bind:destination}}\">"
28
- },
29
- {
30
- id: "text",
31
- label: "Colored text",
32
- description: "Give selected words a foreground color.",
33
- group: "hint",
34
- keywords: [
35
- "text",
36
- "color",
37
- "foreground"
38
- ],
39
- inline: !0,
40
- template: "<text color=\"#a2273a\">{{selection:Important reminder}}</text>"
41
- },
42
- {
43
- id: "section",
44
- label: "Colored section",
45
- description: "Apply a shared text color to several paragraphs.",
46
- group: "layout",
47
- keywords: [
48
- "section",
49
- "color",
50
- "paragraph"
51
- ],
52
- template: "<section color=\"#45536f\">\n\n{{selection:Your paragraphs go here.}}\n\n</section>"
53
- },
54
- {
55
- id: "multi-select",
56
- label: "Multiple selection",
57
- description: "Choose up to two items and read their values.",
58
- group: "input",
59
- keywords: [
60
- "multiple",
61
- "select",
62
- "subjects",
63
- "checkbox"
64
- ],
65
- template: "<multi-select bind=\"{{bind:subjects}}\" label=\"Subjects\" max-selected=\"2\">\n<option value=\"math\">Math</option>\n<option value=\"physics\">Physics</option>\n<option value=\"chemistry\">Chemistry</option>\n</multi-select>"
66
- },
67
- {
68
- id: "range-slider",
69
- label: "Interval slider",
70
- description: "Choose the lower and upper bounds of an interval.",
71
- group: "input",
72
- keywords: [
73
- "range",
74
- "interval",
75
- "slider",
76
- "bounds"
77
- ],
78
- template: "<range-slider label=\"Interval\" bind-start=\"{{bind:low}}\" bind-end=\"{{bind:high}}\" initial-start=\"20\" initial-end=\"80\" min=\"0\" max=\"100\" step=\"1\">"
79
- },
80
- {
81
- id: "coordinate",
82
- label: "Coordinate point",
83
- description: "Drag a point or change its two coordinates.",
84
- group: "input",
85
- keywords: [
86
- "coordinate",
87
- "point",
88
- "drag",
89
- "geometry"
90
- ],
91
- template: "<coordinate label=\"Point\" bind-x=\"{{bind:px}}\" bind-y=\"{{bind:py}}\" initial-x=\"1\" initial-y=\"2\" x-min=\"-5\" x-max=\"5\" y-min=\"-5\" y-max=\"5\">"
92
- },
93
- {
94
- id: "quiz",
95
- label: "Practice question",
96
- description: "Check an answer and read a short explanation.",
97
- group: "action",
98
- keywords: [
99
- "quiz",
100
- "practice",
101
- "answer",
102
- "learn"
103
- ],
104
- template: "<quiz type=\"choice\" label=\"What is 2 + 3?\" answer=\"b\" explanation=\"The sum is 5.\">\n<option value=\"a\">4</option>\n<option value=\"b\">5</option>\n</quiz>"
105
- },
106
- {
107
- id: "steps",
108
- label: "Guided steps",
109
- description: "Read instructions one step at a time.",
110
- group: "layout",
111
- keywords: [
112
- "steps",
113
- "guide",
114
- "previous",
115
- "next"
116
- ],
117
- template: "<steps label=\"Learning path\" bind=\"{{bind:lesson}}\">\n<step label=\"Observe\">\nChange a parameter.\n</step>\n<step label=\"Practice\">\nCheck an answer.\n</step>\n</steps>"
118
- }
119
- ], p = {
120
- jump: {
121
- label: "跳转与锚点",
122
- description: "跳到当前文档中的指定位置。",
123
- keywords: [
124
- "跳转",
125
- "锚点",
126
- "导航"
127
- ],
128
- template: "<jump to=\"{{bind:destination}}\" appearance=\"button\" color=\"#2563eb\">查看结果</jump>\n\n<anchor id=\"{{bind:destination}}\">\n\n{{selection:结果显示在这里。}}"
129
- },
130
- anchor: {
131
- label: "锚点",
132
- description: "为文档内的跳转指定目标位置。",
133
- keywords: [
134
- "锚点",
135
- "目标",
136
- "位置"
137
- ],
138
- template: "<anchor id=\"{{bind:destination}}\">"
139
- },
140
- text: {
141
- label: "文字颜色",
142
- description: "为选中的局部文字指定颜色。",
143
- keywords: [
144
- "文字",
145
- "颜色",
146
- "前景"
147
- ],
148
- template: "<text color=\"#a2273a\">{{selection:重要提醒}}</text>"
149
- },
150
- section: {
151
- label: "正文颜色",
152
- description: "为一段或多段正文指定统一颜色。",
153
- keywords: [
154
- "正文",
155
- "段落",
156
- "颜色"
157
- ],
158
- template: "<section color=\"#45536f\">\n\n{{selection:在这里填写正文。}}\n\n</section>"
159
- },
160
- "multi-select": {
161
- label: "多选",
162
- description: "最多选择两个选项,公开选项值数组。",
163
- keywords: [
164
- "多选",
165
- "选项",
166
- "主题"
167
- ],
168
- template: "<multi-select bind=\"{{bind:subjects}}\" label=\"主题\" max-selected=\"2\">\n<option value=\"math\">数学</option>\n<option value=\"physics\">物理</option>\n<option value=\"chemistry\">化学</option>\n</multi-select>"
169
- },
170
- "range-slider": {
171
- label: "区间滑块",
172
- description: "同时选择区间的起点和终点。",
173
- keywords: [
174
- "区间",
175
- "滑块",
176
- "上下限"
177
- ],
178
- template: "<range-slider label=\"观察区间\" bind-start=\"{{bind:low}}\" bind-end=\"{{bind:high}}\" initial-start=\"20\" initial-end=\"80\" min=\"0\" max=\"100\" step=\"1\">"
179
- },
180
- coordinate: {
181
- label: "二维坐标",
182
- description: "拖动坐标点,或直接修改两个坐标。",
183
- keywords: [
184
- "坐标",
185
- "拖动",
186
- "几何"
187
- ],
188
- template: "<coordinate label=\"坐标点\" bind-x=\"{{bind:px}}\" bind-y=\"{{bind:py}}\" initial-x=\"1\" initial-y=\"2\" x-min=\"-5\" x-max=\"5\" y-min=\"-5\" y-max=\"5\">"
189
- },
190
- quiz: {
191
- label: "练习题",
192
- description: "检查答案并阅读简短解析。",
193
- keywords: [
194
- "练习",
195
- "题目",
196
- "答案"
197
- ],
198
- template: "<quiz type=\"choice\" label=\"2 + 3 等于多少?\" answer=\"b\" explanation=\"相加得到 5。\">\n<option value=\"a\">4</option>\n<option value=\"b\">5</option>\n</quiz>"
199
- },
200
- steps: {
201
- label: "分步阅读",
202
- description: "按顺序阅读说明,内置上一步和下一步。",
203
- keywords: [
204
- "步骤",
205
- "引导",
206
- "下一步"
207
- ],
208
- template: "<steps label=\"学习路线\" bind=\"{{bind:lesson}}\">\n<step label=\"观察\">\n调整参数。\n</step>\n<step label=\"练习\">\n检查答案。\n</step>\n</steps>"
209
- }
210
- }, m = {
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";
9
+ // src/authoring/editor-i18n.ts
10
+ var ae = {
211
11
  en: {
212
12
  boldPlaceholder: "bold text",
213
13
  italicPlaceholder: "italic text",
@@ -254,758 +54,13 @@ var f = [
254
54
  "示例 6"
255
55
  ]]
256
56
  }
257
- }, h = {
258
- en: {
259
- groups: {
260
- input: "Input controls",
261
- action: "Interactive tools",
262
- layout: "Content layout",
263
- data: "Data visualization",
264
- hint: "Feedback"
265
- },
266
- components: {}
267
- },
268
- zh: {
269
- groups: {
270
- input: "输入控件",
271
- action: "交互工具",
272
- layout: "内容组织",
273
- data: "数据可视化",
274
- hint: "提示反馈"
275
- },
276
- components: {
277
- ...p,
278
- slider: {
279
- label: "滑块",
280
- description: "拖动滑块在指定范围内选择一个数值。",
281
- keywords: [
282
- "滑块",
283
- "范围",
284
- "数值",
285
- "拖动",
286
- "滑动"
287
- ],
288
- template: "<slider bind=\"{{bind:amount}}\" label=\"数量\" initial=\"10\" min=\"0\" max=\"100\" step=\"1\">"
289
- },
290
- number: {
291
- label: "数字输入",
292
- description: "输入精确数字,可限制范围和步长。",
293
- keywords: [
294
- "数字",
295
- "数值",
296
- "输入",
297
- "步长",
298
- "数量"
299
- ],
300
- template: "<number bind=\"{{bind:quantity}}\" label=\"数量\" initial=\"1\" min=\"0\" max=\"100\" step=\"1\">"
301
- },
302
- input: {
303
- label: "单行文本",
304
- description: "输入姓名、标题等单行文本。",
305
- keywords: [
306
- "文本",
307
- "单行",
308
- "输入框",
309
- "名称",
310
- "输入"
311
- ],
312
- template: "<input bind=\"{{bind:name}}\" label=\"名称\" placeholder=\"请输入名称\">"
313
- },
314
- textarea: {
315
- label: "多行文本",
316
- description: "输入说明、备注等多行文字。",
317
- keywords: [
318
- "文本域",
319
- "多行",
320
- "说明",
321
- "备注",
322
- "详细"
323
- ],
324
- template: "<textarea bind=\"{{bind:message}}\" label=\"详细说明\" placeholder=\"请输入详细说明\" rows=\"4\">"
325
- },
326
- toggle: {
327
- label: "开关",
328
- description: "在开启与关闭之间切换一个布尔选项。",
329
- keywords: [
330
- "开关",
331
- "布尔",
332
- "启用",
333
- "切换",
334
- "选项"
335
- ],
336
- template: "<toggle bind=\"{{bind:enabled}}\" label=\"启用选项\">"
337
- },
338
- checkbox: {
339
- label: "复选框",
340
- description: "勾选或取消一个布尔选项。",
341
- keywords: [
342
- "复选",
343
- "勾选",
344
- "布尔",
345
- "确认",
346
- "选项"
347
- ],
348
- template: "<checkbox bind=\"{{bind:confirmed}}\" label=\"确认选项\">"
349
- },
350
- date: {
351
- label: "日期选择",
352
- description: "选择一个日期,未选择时为空字符串。",
353
- keywords: [
354
- "日期",
355
- "日历",
356
- "时间",
357
- "选择"
358
- ],
359
- template: "<date bind=\"{{bind:date}}\" label=\"选择日期\">"
360
- },
361
- choices: {
362
- label: "选项卡片",
363
- description: "从多个选项卡中选择一项。",
364
- keywords: [
365
- "选项",
366
- "选择",
367
- "卡片",
368
- "单选",
369
- "方案"
370
- ],
371
- template: "<choices bind=\"{{bind:plan}}\" label=\"选择方案\">\n<option value=\"basic\">基础版</option>\n<option value=\"pro\">专业版</option>\n</choices>"
372
- },
373
- counter: {
374
- label: "计数器",
375
- description: "通过加减按钮调整整数,并可一键重置。",
376
- keywords: [
377
- "计数",
378
- "加减",
379
- "整数",
380
- "调整",
381
- "重置"
382
- ],
383
- template: "<counter bind=\"{{bind:count}}\" label=\"计数\" initial=\"0\" min=\"0\" max=\"99\">"
384
- },
385
- timer: {
386
- label: "倒计时",
387
- description: "启动、暂停和重置一段专注计时。",
388
- keywords: [
389
- "计时",
390
- "倒计时",
391
- "专注",
392
- "秒",
393
- "暂停"
394
- ],
395
- template: "<timer bind=\"{{bind:remaining}}\" label=\"专注计时\" duration=\"60\">"
396
- },
397
- checklist: {
398
- label: "任务清单",
399
- description: "用可勾选的任务列表记录完成情况。",
400
- keywords: [
401
- "清单",
402
- "任务",
403
- "勾选",
404
- "待办",
405
- "完成"
406
- ],
407
- template: "<checklist bind=\"{{bind:done}}\" label=\"完成清单\">\n- [ ] 第一项任务\n- [ ] 第二项任务\n- [ ] 第三项任务\n</checklist>"
408
- },
409
- progress: {
410
- label: "进度条",
411
- description: "展示 0 到 100 之间的完成进度。",
412
- keywords: [
413
- "进度",
414
- "完成度",
415
- "进度条",
416
- "百分比"
417
- ],
418
- template: "<progress label=\"完成进度\" value=\"{{ 40 }}\">"
419
- },
420
- panel: {
421
- label: "参数面板",
422
- description: "把一组控件包进面板,并附带恢复默认按钮。",
423
- keywords: [
424
- "面板",
425
- "参数",
426
- "重置",
427
- "表单",
428
- "控件"
429
- ],
430
- template: "<panel title=\"参数面板\">\n{{selection:示例内容}}\n</panel>"
431
- },
432
- card: {
433
- label: "内容卡片",
434
- description: "用卡片组织一段独立内容。",
435
- keywords: [
436
- "卡片",
437
- "容器",
438
- "内容",
439
- "区块"
440
- ],
441
- template: "<card title=\"内容卡片\">\n{{selection:示例内容}}\n</card>"
442
- },
443
- if: {
444
- label: "条件区域",
445
- description: "只有条件为真时才显示其中内容。",
446
- keywords: [
447
- "条件",
448
- "判断",
449
- "显示",
450
- "当"
451
- ],
452
- template: "<if when=\"{{ {{select:true}} }}\">\n{{selection:示例内容}}\n</if>"
453
- },
454
- tabs: {
455
- label: "标签页",
456
- description: "把内容分到多个可切换的标签页中。",
457
- keywords: [
458
- "标签页",
459
- "切换",
460
- "分组",
461
- "选项卡"
462
- ],
463
- template: "<tabs label=\"内容标签页\">\n<tab label=\"标签一\">\n{{selection:示例内容}}\n</tab>\n\n<tab label=\"标签二\">\n第二个标签页的内容。\n</tab>\n</tabs>"
464
- },
465
- accordion: {
466
- label: "折叠面板",
467
- description: "把说明放进可展开和收起的条目。",
468
- keywords: [
469
- "折叠",
470
- "展开",
471
- "问答",
472
- "手风琴",
473
- "条目"
474
- ],
475
- template: "<accordion label=\"常见问题\">\n<disclosure label=\"问题一\">\n{{selection:示例内容}}\n</disclosure>\n\n<disclosure label=\"问题二\">\n第二个条目的说明。\n</disclosure>\n</accordion>"
476
- },
477
- chart: {
478
- label: "柱状图",
479
- description: "把 Markdown 表格转换成柱状图。",
480
- keywords: [
481
- "图表",
482
- "柱状图",
483
- "表格",
484
- "数据",
485
- "对比"
486
- ],
487
- template: "<chart kind=\"bar\" title=\"分类对比\" y-label=\"数值\">\n| 项目 | 数值 |\n| --- | ---: |\n| 项目甲 | 20 |\n| 项目乙 | 35 |\n</chart>"
488
- },
489
- table: {
490
- label: "增强表格",
491
- description: "带搜索、排序和分页的 Markdown 表格。",
492
- keywords: [
493
- "表格",
494
- "搜索",
495
- "排序",
496
- "分页",
497
- "数据"
498
- ],
499
- template: "<table label=\"数据表格\" page-size=\"5\">\n| 名称 | 分类 | 数值 |\n| --- | --- | ---: |\n| 项目甲 | 分类一 | 20 |\n| 项目乙 | 分类二 | 35 |\n</table>"
500
- },
501
- timeline: {
502
- label: "时间轴",
503
- description: "用表格展示任务的开始时间与时长。",
504
- keywords: [
505
- "时间轴",
506
- "计划",
507
- "时长",
508
- "日程",
509
- "任务"
510
- ],
511
- template: "<timeline title=\"任务时间轴\">\n| 事项 | 开始 | 时长 | 说明 |\n| --- | ---: | ---: | --- |\n| 准备 | 0 | 10 | 列出所需材料 |\n| 执行 | 10 | 20 | 完成主要内容 |\n| 检查 | 30 | 5 | 复核结果 |\n</timeline>"
512
- },
513
- diagram: {
514
- label: "交互图解",
515
- description: "用节点和连线展示流程,可点击查看说明。",
516
- keywords: [
517
- "图解",
518
- "流程",
519
- "节点",
520
- "连线",
521
- "关系图"
522
- ],
523
- template: "<diagram label=\"流程示意\">\n<node id=\"start\" label=\"开始\">\n流程起点。\n</node>\n\n<node id=\"process\" label=\"处理\">\n执行主要步骤。\n</node>\n\n<node id=\"end\" label=\"结束\">\n查看结果。\n</node>\n\n<edge from=\"start\" to=\"process\" label=\"进入\">\n<edge from=\"process\" to=\"end\" label=\"完成\">\n</diagram>"
524
- },
525
- plot: {
526
- label: "函数曲线",
527
- description: "用 LaTeX 公式绘制一条函数曲线。",
528
- keywords: [
529
- "曲线",
530
- "函数",
531
- "公式",
532
- "数学",
533
- "绘图"
534
- ],
535
- template: "<plot min=\"-5\" max=\"5\" label=\"函数曲线\">\n$$ y = x^2 $$\n</plot>"
536
- },
537
- alert: {
538
- label: "提示框",
539
- description: "用不同语气突出普通、成功或警告信息。",
540
- keywords: [
541
- "提示",
542
- "警告",
543
- "通知",
544
- "信息",
545
- "消息"
546
- ],
547
- template: "<alert tone=\"info\" title=\"提示\">\n{{selection:示例内容}}\n</alert>"
548
- },
549
- badge: {
550
- label: "徽标",
551
- description: "在句子里显示一个简短状态标记。",
552
- keywords: [
553
- "徽标",
554
- "标签",
555
- "状态",
556
- "行内",
557
- "标记"
558
- ],
559
- template: "<badge tone=\"success\">标签</badge>"
560
- },
561
- tooltip: {
562
- label: "行内提示",
563
- description: "为句中的词语附加悬停或聚焦说明。",
564
- keywords: [
565
- "提示",
566
- "悬停",
567
- "说明",
568
- "行内",
569
- "气泡"
570
- ],
571
- template: "<tooltip text=\"这里显示补充说明。\">悬停查看</tooltip>"
572
- }
573
- }
574
- }
575
- }, g = [
576
- {
577
- id: "input",
578
- label: "Input controls"
579
- },
580
- {
581
- id: "action",
582
- label: "Interactive tools"
583
- },
584
- {
585
- id: "layout",
586
- label: "Content layout"
587
- },
588
- {
589
- id: "data",
590
- label: "Data visualization"
591
- },
592
- {
593
- id: "hint",
594
- label: "Feedback"
595
- }
596
- ], _ = [
597
- ...f,
598
- {
599
- id: "slider",
600
- label: "Slider",
601
- description: "Drag the slider to choose a number within a range.",
602
- group: "input",
603
- keywords: [
604
- "slider",
605
- "range",
606
- "number",
607
- "drag",
608
- "value"
609
- ],
610
- template: "<slider bind=\"{{bind:amount}}\" label=\"Amount\" initial=\"10\" min=\"0\" max=\"100\" step=\"1\">"
611
- },
612
- {
613
- id: "number",
614
- label: "Number input",
615
- description: "Enter an exact number with an optional range and step.",
616
- group: "input",
617
- keywords: [
618
- "number",
619
- "numeric",
620
- "input",
621
- "step",
622
- "quantity"
623
- ],
624
- template: "<number bind=\"{{bind:quantity}}\" label=\"Quantity\" initial=\"1\" min=\"0\" max=\"100\" step=\"1\">"
625
- },
626
- {
627
- id: "input",
628
- label: "Single-line text",
629
- description: "Enter a name, title or other single-line text.",
630
- group: "input",
631
- keywords: [
632
- "input",
633
- "text",
634
- "single-line",
635
- "field",
636
- "name"
637
- ],
638
- template: "<input bind=\"{{bind:name}}\" label=\"Name\" placeholder=\"Enter a name\">"
639
- },
640
- {
641
- id: "textarea",
642
- label: "Multi-line text",
643
- description: "Enter notes, descriptions or other multi-line text.",
644
- group: "input",
645
- keywords: [
646
- "textarea",
647
- "text area",
648
- "multi-line",
649
- "notes",
650
- "description"
651
- ],
652
- template: "<textarea bind=\"{{bind:message}}\" label=\"Details\" placeholder=\"Enter details\" rows=\"4\">"
653
- },
654
- {
655
- id: "toggle",
656
- label: "Toggle",
657
- description: "Switch a boolean option on or off.",
658
- group: "input",
659
- keywords: [
660
- "toggle",
661
- "switch",
662
- "boolean",
663
- "enable",
664
- "on"
665
- ],
666
- template: "<toggle bind=\"{{bind:enabled}}\" label=\"Enable option\">"
667
- },
668
- {
669
- id: "checkbox",
670
- label: "Checkbox",
671
- description: "Check or uncheck a boolean option.",
672
- group: "input",
673
- keywords: [
674
- "checkbox",
675
- "check",
676
- "boolean",
677
- "confirm",
678
- "option"
679
- ],
680
- template: "<checkbox bind=\"{{bind:confirmed}}\" label=\"Confirm option\">"
681
- },
682
- {
683
- id: "date",
684
- label: "Date picker",
685
- description: "Pick a date; the value stays empty until one is chosen.",
686
- group: "input",
687
- keywords: [
688
- "date",
689
- "calendar",
690
- "picker",
691
- "day"
692
- ],
693
- template: "<date bind=\"{{bind:date}}\" label=\"Pick a date\">"
694
- },
695
- {
696
- id: "choices",
697
- label: "Choice cards",
698
- description: "Pick one option from a set of cards.",
699
- group: "input",
700
- keywords: [
701
- "choices",
702
- "options",
703
- "cards",
704
- "select",
705
- "radio"
706
- ],
707
- template: "<choices bind=\"{{bind:plan}}\" label=\"Choose a plan\">\n<option value=\"basic\">Basic</option>\n<option value=\"pro\">Pro</option>\n</choices>"
708
- },
709
- {
710
- id: "counter",
711
- label: "Counter",
712
- description: "Adjust an integer with plus and minus buttons, then reset it in one click.",
713
- group: "action",
714
- keywords: [
715
- "counter",
716
- "count",
717
- "plus",
718
- "minus",
719
- "integer"
720
- ],
721
- template: "<counter bind=\"{{bind:count}}\" label=\"Count\" initial=\"0\" min=\"0\" max=\"99\">"
722
- },
723
- {
724
- id: "timer",
725
- label: "Countdown timer",
726
- description: "Start, pause and reset a focus timer.",
727
- group: "action",
728
- keywords: [
729
- "timer",
730
- "countdown",
731
- "focus",
732
- "seconds",
733
- "pause"
734
- ],
735
- template: "<timer bind=\"{{bind:remaining}}\" label=\"Focus timer\" duration=\"60\">"
736
- },
737
- {
738
- id: "checklist",
739
- label: "Checklist",
740
- description: "Track completion with a checkable task list.",
741
- group: "action",
742
- keywords: [
743
- "checklist",
744
- "tasks",
745
- "todo",
746
- "check",
747
- "done"
748
- ],
749
- template: "<checklist bind=\"{{bind:done}}\" label=\"Task checklist\">\n- [ ] First task\n- [ ] Second task\n- [ ] Third task\n</checklist>"
750
- },
751
- {
752
- id: "progress",
753
- label: "Progress bar",
754
- description: "Show completion from 0 to 100.",
755
- group: "action",
756
- keywords: [
757
- "progress",
758
- "completion",
759
- "bar",
760
- "percent"
761
- ],
762
- template: "<progress label=\"Progress\" value=\"{{ 40 }}\">"
763
- },
764
- {
765
- id: "panel",
766
- label: "Parameter panel",
767
- description: "Group controls in a panel with a restore-defaults button.",
768
- group: "layout",
769
- keywords: [
770
- "panel",
771
- "parameters",
772
- "reset",
773
- "form",
774
- "group"
775
- ],
776
- template: "<panel title=\"Parameters\">\n{{selection:Sample content}}\n</panel>"
777
- },
778
- {
779
- id: "card",
780
- label: "Content card",
781
- description: "Organize a self-contained piece of content in a card.",
782
- group: "layout",
783
- keywords: [
784
- "card",
785
- "container",
786
- "content",
787
- "section"
788
- ],
789
- template: "<card title=\"Content card\">\n{{selection:Sample content}}\n</card>"
790
- },
791
- {
792
- id: "if",
793
- label: "Conditional section",
794
- description: "Show the contents only when a condition is true.",
795
- group: "layout",
796
- keywords: [
797
- "if",
798
- "condition",
799
- "when",
800
- "show",
801
- "visible"
802
- ],
803
- template: "<if when=\"{{ {{select:true}} }}\">\n{{selection:Sample content}}\n</if>"
804
- },
805
- {
806
- id: "tabs",
807
- label: "Tabs",
808
- description: "Split content across switchable tabs.",
809
- group: "layout",
810
- keywords: [
811
- "tabs",
812
- "switch",
813
- "sections",
814
- "groups"
815
- ],
816
- template: "<tabs label=\"Content tabs\">\n<tab label=\"Tab one\">\n{{selection:Sample content}}\n</tab>\n\n<tab label=\"Tab two\">\nContent for the second tab.\n</tab>\n</tabs>"
817
- },
818
- {
819
- id: "accordion",
820
- label: "Accordion",
821
- description: "Put notes into items that expand and collapse.",
822
- group: "layout",
823
- keywords: [
824
- "accordion",
825
- "collapse",
826
- "expand",
827
- "faq",
828
- "disclosure"
829
- ],
830
- template: "<accordion label=\"FAQ\">\n<disclosure label=\"Question one\">\n{{selection:Sample content}}\n</disclosure>\n\n<disclosure label=\"Question two\">\nDetails for the second item.\n</disclosure>\n</accordion>"
831
- },
832
- {
833
- id: "chart",
834
- label: "Bar chart",
835
- description: "Turn a Markdown table into a bar chart.",
836
- group: "data",
837
- keywords: [
838
- "chart",
839
- "bar",
840
- "graph",
841
- "table",
842
- "data"
843
- ],
844
- template: "<chart kind=\"bar\" title=\"Category comparison\" y-label=\"Value\">\n| Item | Value |\n| --- | ---: |\n| Item A | 20 |\n| Item B | 35 |\n</chart>"
845
- },
846
- {
847
- id: "table",
848
- label: "Enhanced table",
849
- description: "A Markdown table with search, sorting and paging.",
850
- group: "data",
851
- keywords: [
852
- "table",
853
- "search",
854
- "sort",
855
- "paging",
856
- "data"
857
- ],
858
- template: "<table label=\"Data table\" page-size=\"5\">\n| Name | Category | Value |\n| --- | --- | ---: |\n| Item A | Category one | 20 |\n| Item B | Category two | 35 |\n</table>"
859
- },
860
- {
861
- id: "timeline",
862
- label: "Timeline",
863
- description: "Show task start times and durations in a table.",
864
- group: "data",
865
- keywords: [
866
- "timeline",
867
- "schedule",
868
- "plan",
869
- "duration",
870
- "gantt"
871
- ],
872
- template: "<timeline title=\"Task timeline\">\n| Task | Start | Duration | Notes |\n| --- | ---: | ---: | --- |\n| Prepare | 0 | 10 | List the materials |\n| Execute | 10 | 20 | Complete the main work |\n| Review | 30 | 5 | Check the results |\n</timeline>"
873
- },
874
- {
875
- id: "diagram",
876
- label: "Interactive diagram",
877
- description: "Show a flow with nodes and edges; click a node to read its notes.",
878
- group: "data",
879
- keywords: [
880
- "diagram",
881
- "flow",
882
- "node",
883
- "edge",
884
- "graph"
885
- ],
886
- template: "<diagram label=\"Flow overview\">\n<node id=\"start\" label=\"Start\">\nWhere the flow begins.\n</node>\n\n<node id=\"process\" label=\"Process\">\nPerform the main step.\n</node>\n\n<node id=\"end\" label=\"End\">\nReview the result.\n</node>\n\n<edge from=\"start\" to=\"process\" label=\"Proceed\">\n<edge from=\"process\" to=\"end\" label=\"Complete\">\n</diagram>"
887
- },
888
- {
889
- id: "plot",
890
- label: "Function plot",
891
- description: "Plot a function curve from a LaTeX formula.",
892
- group: "data",
893
- keywords: [
894
- "plot",
895
- "curve",
896
- "function",
897
- "formula",
898
- "latex",
899
- "math"
900
- ],
901
- template: "<plot min=\"-5\" max=\"5\" label=\"Function plot\">\n$$ y = x^2 $$\n</plot>"
902
- },
903
- {
904
- id: "alert",
905
- label: "Alert",
906
- description: "Highlight info, success or warning messages with different tones.",
907
- group: "hint",
908
- keywords: [
909
- "alert",
910
- "notice",
911
- "warning",
912
- "info",
913
- "message"
914
- ],
915
- template: "<alert tone=\"info\" title=\"Notice\">\n{{selection:Sample content}}\n</alert>"
916
- },
917
- {
918
- id: "badge",
919
- label: "Badge",
920
- description: "Show a short status marker inside a sentence.",
921
- group: "hint",
922
- keywords: [
923
- "badge",
924
- "label",
925
- "status",
926
- "inline",
927
- "tag"
928
- ],
929
- inline: !0,
930
- template: "<badge tone=\"success\">Badge</badge>"
931
- },
932
- {
933
- id: "tooltip",
934
- label: "Tooltip",
935
- description: "Attach a hover or focus note to a word in a sentence.",
936
- group: "hint",
937
- keywords: [
938
- "tooltip",
939
- "hint",
940
- "hover",
941
- "focus",
942
- "inline"
943
- ],
944
- inline: !0,
945
- template: "<tooltip text=\"Extra details appear here.\">Hover to view</tooltip>"
946
- }
947
- ], v = /\{\{bind:([^{}]+)\}\}/g, ee = /[A-Za-z_][A-Za-z0-9_]*/g;
948
- function y(e, t) {
949
- let n = [...e];
950
- for (let e of t) {
951
- let t = e.toLowerCase();
952
- n.some((e) => e.toLowerCase() === t) || n.push(e);
953
- }
954
- return n;
955
- }
956
- var b = g.map((e) => ({
957
- ...e,
958
- label: h.zh.groups[e.id]
959
- })), te = _.map((e) => ({
960
- ...e,
961
- keywords: y(e.keywords, h.zh.components[e.id]?.keywords ?? [])
962
- })), x = _.map((e) => {
963
- let t = h.zh.components[e.id];
964
- return t ? {
965
- ...e,
966
- label: t.label,
967
- description: t.description,
968
- keywords: y(e.keywords, t.keywords),
969
- template: t.template
970
- } : e;
971
- });
972
- function ne(e = "en") {
973
- return e === "zh" ? {
974
- groups: b,
975
- components: x
976
- } : {
977
- groups: g,
978
- components: te
979
- };
980
- }
981
- function S(e) {
982
- return new Set(e.match(ee) ?? []);
983
- }
984
- function C(e) {
985
- let t = e.trim().replace(/[^A-Za-z0-9_]/g, "_");
986
- return t ? /^[0-9]/.test(t) ? `_${t}` : t : "value";
987
- }
988
- function w(e, t) {
989
- if (!t.has(e)) return e;
990
- let n = 2;
991
- for (; t.has(`${e}${n}`);) n += 1;
992
- return `${e}${n}`;
993
- }
994
- function T(e, t, n) {
995
- let r = S(t), i = /* @__PURE__ */ new Map();
996
- return e.template.replace(v, (e, t) => {
997
- let n = t.trim(), a = i.get(n);
998
- if (a) return a;
999
- let o = w(C(n), r);
1000
- return r.add(o), i.set(n, o), o;
1001
- });
1002
- }
1003
- // src/editor/editor-commands.ts
1004
- function E(e, t) {
57
+ };
58
+ // src/authoring/editor-commands.ts
59
+ function S(e, t) {
1005
60
  return typeof e != "number" || Number.isNaN(e) ? 0 : Math.min(Math.max(Math.trunc(e), 0), t);
1006
61
  }
1007
- function D(e, t) {
1008
- let n = E(t.start, e.length), r = E(t.end, e.length);
62
+ function C(e, t) {
63
+ let n = S(t.start, e.length), r = S(t.end, e.length);
1009
64
  return n <= r ? {
1010
65
  start: n,
1011
66
  end: r
@@ -1014,14 +69,14 @@ function D(e, t) {
1014
69
  end: n
1015
70
  };
1016
71
  }
1017
- function O(e) {
1018
- return m[e] ?? m.en;
72
+ function w(e) {
73
+ return ae[e] ?? ae.en;
1019
74
  }
1020
- function k(e, t) {
75
+ function T(e, t) {
1021
76
  return t <= 0 ? 0 : e.lastIndexOf("\n", t - 1) + 1;
1022
77
  }
1023
- function A(e, t) {
1024
- let n = k(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;
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;
1025
80
  for (;;) {
1026
81
  let t = e.indexOf("\n", s), n = t === -1 || t > a ? a : t;
1027
82
  if (o.push({
@@ -1033,7 +88,7 @@ function A(e, t) {
1033
88
  }
1034
89
  return o;
1035
90
  }
1036
- function j(e, t, n) {
91
+ function D(e, t, n) {
1037
92
  if (n.length === 0) return {
1038
93
  value: e,
1039
94
  selection: t
@@ -1067,7 +122,7 @@ function j(e, t, n) {
1067
122
  }
1068
123
  };
1069
124
  }
1070
- function M(e, t, n, r) {
125
+ function O(e, t, n, r) {
1071
126
  return t === e.text ? null : {
1072
127
  start: e.start,
1073
128
  end: e.end,
@@ -1076,13 +131,13 @@ function M(e, t, n, r) {
1076
131
  newPrefixLength: r
1077
132
  };
1078
133
  }
1079
- function N(e, t, n, r) {
134
+ function oe(e, t, n, r) {
1080
135
  return n === "*" ? r ? e[t.start - 1] !== "*" && e[t.end] !== "*" : e[t.start - n.length - 1] !== "*" && e[t.end + n.length] !== "*" : !0;
1081
136
  }
1082
- function P(e, t, n, r) {
1083
- let i = D(e, t), a = n.length, { start: o, end: s } = i, c = e.slice(o, s);
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);
1084
139
  if (o !== s) {
1085
- if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) && N(e, i, n, !0)) {
140
+ if (c.length >= a * 2 && c.startsWith(n) && c.endsWith(n) && (n !== "*" || !c.startsWith("**") && !c.endsWith("**")) && oe(e, i, n, !0)) {
1086
141
  let t = c.slice(a, c.length - a);
1087
142
  return {
1088
143
  value: e.slice(0, o) + t + e.slice(s),
@@ -1093,7 +148,7 @@ function P(e, t, n, r) {
1093
148
  };
1094
149
  }
1095
150
  let t = o - a, r = s + a;
1096
- return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n && N(e, i, n, !1) ? {
151
+ return t >= 0 && r <= e.length && e.slice(t, o) === n && e.slice(s, r) === n && oe(e, i, n, !1) ? {
1097
152
  value: e.slice(0, t) + c + e.slice(r),
1098
153
  selection: {
1099
154
  start: t,
@@ -1116,39 +171,39 @@ function P(e, t, n, r) {
1116
171
  }
1117
172
  };
1118
173
  }
1119
- function re(e, t, n = "en") {
1120
- return P(e, t, "**", O(n).boldPlaceholder);
174
+ function se(e, t, n = "en") {
175
+ return k(e, t, "**", w(n).boldPlaceholder);
1121
176
  }
1122
- function F(e, t, n = "en") {
1123
- return P(e, t, "*", O(n).italicPlaceholder);
177
+ function ce(e, t, n = "en") {
178
+ return k(e, t, "*", w(n).italicPlaceholder);
1124
179
  }
1125
- function I(e, t, n = "en") {
1126
- return P(e, t, "~~", O(n).strikePlaceholder);
180
+ function le(e, t, n = "en") {
181
+ return k(e, t, "~~", w(n).strikePlaceholder);
1127
182
  }
1128
- function L(e) {
183
+ function A(e) {
1129
184
  let t = 0;
1130
185
  for (let n of e.match(/`+/g) ?? []) t = Math.max(t, n.length);
1131
186
  return t;
1132
187
  }
1133
- function R(e, t, n) {
188
+ function j(e, t, n) {
1134
189
  let r = 0;
1135
190
  for (; e[t] === "`";) r += 1, t += n;
1136
191
  return r;
1137
192
  }
1138
- function ie(e, t) {
1139
- let { start: n, end: r } = t, i = e.slice(n, r), a = R(e, n - 1, -1), o = R(e, r, 1), s = a > 0 && a === o ? {
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 ? {
1140
195
  run: a,
1141
196
  padding: 0
1142
- } : null, c = R(e, n - 2, -1), l = R(e, r + 1, 1), u = e[n - 1] === " " && e[r] === " " && c > 0 && c === l ? {
197
+ } : null, c = j(e, n - 2, -1), l = j(e, r + 1, 1), u = e[n - 1] === " " && e[r] === " " && c > 0 && c === l ? {
1143
198
  run: c,
1144
199
  padding: 1
1145
200
  } : null, d = s ?? u;
1146
- return !d || L(i) >= d.run ? null : d;
201
+ return !d || A(i) >= d.run ? null : d;
1147
202
  }
1148
- function ae(e, t, n = "en") {
1149
- let r = D(e, t), { start: i, end: a } = r, o = e.slice(i, a);
203
+ function de(e, t, n = "en") {
204
+ let r = C(e, t), { start: i, end: a } = r, o = e.slice(i, a);
1150
205
  if (i === a) {
1151
- let t = O(n).inlineCodePlaceholder, r = `\`${t}\``;
206
+ let t = w(n).inlineCodePlaceholder, r = `\`${t}\``;
1152
207
  return {
1153
208
  value: e.slice(0, i) + r + e.slice(a),
1154
209
  selection: {
@@ -1157,8 +212,8 @@ function ae(e, t, n = "en") {
1157
212
  }
1158
213
  };
1159
214
  }
1160
- let s = R(o, 0, 1), c = R(o, o.length - 1, -1);
1161
- if (s > 0 && s === c && o.length >= s * 2 && L(o.slice(s, o.length - s)) < s) {
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) {
1162
217
  let t = o.slice(s, o.length - s);
1163
218
  return t.startsWith(" ") && t.endsWith(" ") && t.trim().length > 0 && (t = t.slice(1, -1)), {
1164
219
  value: e.slice(0, i) + t + e.slice(a),
@@ -1168,7 +223,7 @@ function ae(e, t, n = "en") {
1168
223
  }
1169
224
  };
1170
225
  }
1171
- let l = ie(e, r);
226
+ let l = ue(e, r);
1172
227
  if (l) {
1173
228
  let t = l.run + l.padding;
1174
229
  return {
@@ -1179,7 +234,7 @@ function ae(e, t, n = "en") {
1179
234
  }
1180
235
  };
1181
236
  }
1182
- let u = "`".repeat(L(o) + 1), d = /^[` ]|[` ]$/.test(o) ? " " : "", f = u + d;
237
+ let u = "`".repeat(A(o) + 1), d = /^[` ]|[` ]$/.test(o) ? " " : "", f = u + d;
1183
238
  return {
1184
239
  value: e.slice(0, i) + f + o + d + u + e.slice(a),
1185
240
  selection: {
@@ -1188,19 +243,19 @@ function ae(e, t, n = "en") {
1188
243
  }
1189
244
  };
1190
245
  }
1191
- var z = /^(#{1,6})[ \t]+/;
1192
- function oe(e, t, n) {
1193
- let r = D(e, t), i = [];
1194
- for (let t of A(e, r)) {
1195
- let e = z.exec(t.text), r = e ? e[0].length : 0;
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;
1196
251
  if (n === 0 && !e) continue;
1197
- let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s = M(t, o + a, r, o.length);
252
+ let a = t.text.slice(r), o = n === 0 ? "" : `${"#".repeat(n)} `, s = O(t, o + a, r, o.length);
1198
253
  s && i.push(s);
1199
254
  }
1200
- return j(e, r, i);
255
+ return D(e, r, i);
1201
256
  }
1202
- var B = /^([ \t]*)([-*+] )/, V = /^([ \t]*)(\d+[.)] )/, H = /^([ \t]*)([-*+] \[[ xX]\] )/, U = /^([ \t]*)(> ?)/;
1203
- function W(e, t) {
257
+ var M = /^([ \t]*)([-*+] )/, N = /^([ \t]*)(\d+[.)] )/, P = /^([ \t]*)([-*+] \[[ xX]\] )/, F = /^([ \t]*)(> ?)/;
258
+ function I(e, t) {
1204
259
  let n = t.exec(e);
1205
260
  if (!n) return null;
1206
261
  let r = n[1] ?? "", i = n[2] ?? "";
@@ -1210,12 +265,12 @@ function W(e, t) {
1210
265
  prefixLength: r.length + i.length
1211
266
  };
1212
267
  }
1213
- function G(e) {
268
+ function me(e) {
1214
269
  let t = /^[ \t]*/.exec(e);
1215
270
  return t ? t[0] : "";
1216
271
  }
1217
- function K(e, t, n, r) {
1218
- let i = D(e, t), a = A(e, i), o = a.map((e) => n(e.text)), s = 0, c = !0;
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;
1219
274
  for (let e = 0; e < a.length; e += 1) {
1220
275
  let t = a[e];
1221
276
  (o[e] || t.text.trim().length > 0) && (s += 1, o[e] || (c = !1));
@@ -1225,30 +280,30 @@ function K(e, t, n, r) {
1225
280
  let t = a[e], n = o[e] ?? null;
1226
281
  if (l) {
1227
282
  if (!n) continue;
1228
- let e = M(t, n.indent + t.text.slice(n.prefixLength), n.prefixLength, n.indent.length);
283
+ let e = O(t, n.indent + t.text.slice(n.prefixLength), n.prefixLength, n.indent.length);
1229
284
  e && u.push(e);
1230
285
  continue;
1231
286
  }
1232
- let i = n ? n.indent : G(t.text), s = t.text.slice(n ? n.prefixLength : i.length), c = r(i, e + 1), d = M(t, i + c + s, n ? n.prefixLength : i.length, i.length + c.length);
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);
1233
288
  d && u.push(d);
1234
289
  }
1235
- return j(e, i, u);
290
+ return D(e, i, u);
1236
291
  }
1237
- function q(e, t) {
1238
- return K(e, t, (e) => W(e, B), () => "- ");
292
+ function he(e, t) {
293
+ return L(e, t, (e) => I(e, M), () => "- ");
1239
294
  }
1240
- function se(e, t) {
1241
- return K(e, t, (e) => W(e, V), (e, t) => `${t}. `);
295
+ function ge(e, t) {
296
+ return L(e, t, (e) => I(e, N), (e, t) => `${t}. `);
1242
297
  }
1243
- function ce(e, t) {
1244
- return K(e, t, (e) => W(e, H), () => "- [ ] ");
298
+ function _e(e, t) {
299
+ return L(e, t, (e) => I(e, P), () => "- [ ] ");
1245
300
  }
1246
- function le(e, t) {
1247
- return K(e, t, (e) => W(e, U), () => "> ");
301
+ function ve(e, t) {
302
+ return L(e, t, (e) => I(e, F), () => "> ");
1248
303
  }
1249
- function ue(e, t) {
1250
- let n = D(e, t);
1251
- return j(e, n, A(e, n).map((e) => ({
304
+ function ye(e, t) {
305
+ let n = C(e, t);
306
+ return D(e, n, E(e, n).map((e) => ({
1252
307
  start: e.start,
1253
308
  end: e.end,
1254
309
  text: ` ${e.text}`,
@@ -1256,7 +311,7 @@ function ue(e, t) {
1256
311
  newPrefixLength: 2
1257
312
  })));
1258
313
  }
1259
- function de(e) {
314
+ function be(e) {
1260
315
  if (e.startsWith(" ")) return {
1261
316
  text: e.slice(1),
1262
317
  removed: 1
@@ -1268,18 +323,18 @@ function de(e) {
1268
323
  removed: t
1269
324
  };
1270
325
  }
1271
- function fe(e, t) {
1272
- let n = D(e, t), r = [];
1273
- for (let t of A(e, n)) {
1274
- let e = de(t.text);
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);
1275
330
  if (e.removed === 0) continue;
1276
- let n = M(t, e.text, e.removed, 0);
331
+ let n = O(t, e.text, e.removed, 0);
1277
332
  n && r.push(n);
1278
333
  }
1279
- return j(e, n, r);
334
+ return D(e, n, r);
1280
335
  }
1281
- function pe(e, t, n = "en") {
1282
- let { start: r, end: i } = D(e, t), a = e.slice(r, i), o = "https://example.com";
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";
1283
338
  if (a.length > 0) {
1284
339
  let t = `[${a}](${o})`, n = r + 1 + a.length + 2;
1285
340
  return {
@@ -1290,7 +345,7 @@ function pe(e, t, n = "en") {
1290
345
  }
1291
346
  };
1292
347
  }
1293
- let s = O(n).linkText, c = `[${s}](${o})`;
348
+ let s = w(n).linkText, c = `[${s}](${o})`;
1294
349
  return {
1295
350
  value: e.slice(0, r) + c + e.slice(i),
1296
351
  selection: {
@@ -1299,8 +354,8 @@ function pe(e, t, n = "en") {
1299
354
  }
1300
355
  };
1301
356
  }
1302
- function me(e, t, n = "en") {
1303
- let { start: r, end: i } = D(e, t), a = e.slice(r, i), o = "images/example.png";
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";
1304
359
  if (a.length > 0) {
1305
360
  let t = `![${a}](${o})`, n = r + 2 + a.length + 2;
1306
361
  return {
@@ -1311,7 +366,7 @@ function me(e, t, n = "en") {
1311
366
  }
1312
367
  };
1313
368
  }
1314
- let s = O(n).imageAlt, c = `![${s}](${o})`;
369
+ let s = w(n).imageAlt, c = `![${s}](${o})`;
1315
370
  return {
1316
371
  value: e.slice(0, r) + c + e.slice(i),
1317
372
  selection: {
@@ -1320,25 +375,25 @@ function me(e, t, n = "en") {
1320
375
  }
1321
376
  };
1322
377
  }
1323
- function he(e, t, n = "en") {
1324
- let r = D(e, t), i = e.slice(r.start, r.end), a = i.length > 0 ? i : O(n).codeBlockPlaceholder, o = "`".repeat(Math.max(3, L(a) + 1)), s = `${o}text\n`;
1325
- return Y(e, r, `${s}${a}\n${o}`, {
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`;
380
+ return R(e, r, `${s}${a}\n${o}`, {
1326
381
  start: s.length,
1327
382
  end: s.length + a.length
1328
383
  });
1329
384
  }
1330
- function ge(e) {
385
+ function Te(e) {
1331
386
  return [
1332
387
  `| ${e.tableHeaders.join(" | ")} |`,
1333
388
  `| ${e.tableHeaders.map(() => "---").join(" | ")} |`,
1334
389
  ...e.tableRows.map((e) => `| ${e.join(" | ")} |`)
1335
390
  ].join("\n");
1336
391
  }
1337
- function J(e, t) {
1338
- let n = k(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 = "";
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 = "";
1339
394
  if (/\S/.test(r)) s = "\n\n";
1340
395
  else if (n > 0) {
1341
- let t = k(e, n - 1);
396
+ let t = T(e, n - 1);
1342
397
  /\S/.test(e.slice(t, n - 1)) && (s = "\n");
1343
398
  }
1344
399
  return {
@@ -1346,8 +401,8 @@ function J(e, t) {
1346
401
  suffix: /\S/.test(o) ? "\n\n" : ""
1347
402
  };
1348
403
  }
1349
- function Y(e, t, n, r) {
1350
- let { prefix: i, suffix: a } = J(e, t), o = t.start + i.length;
404
+ function R(e, t, n, r) {
405
+ let { prefix: i, suffix: a } = Ee(e, t), o = t.start + i.length;
1351
406
  return {
1352
407
  value: e.slice(0, t.start) + i + n + a + e.slice(t.end),
1353
408
  selection: {
@@ -1356,21 +411,21 @@ function Y(e, t, n, r) {
1356
411
  }
1357
412
  };
1358
413
  }
1359
- function _e(e, t, n = "en") {
1360
- let r = D(e, t), i = O(n), a = ge(i), o = i.tableRows[0][0], s = a.indexOf(o);
1361
- return Y(e, r, a, {
414
+ 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
+ return R(e, r, a, {
1362
417
  start: s,
1363
418
  end: s + o.length
1364
419
  });
1365
420
  }
1366
- function ve(e, t) {
1367
- return Y(e, D(e, t), "---", {
421
+ function Oe(e, t) {
422
+ return R(e, C(e, t), "---", {
1368
423
  start: 3,
1369
424
  end: 3
1370
425
  });
1371
426
  }
1372
- function ye(e, t, n) {
1373
- let r = D(e, t), i = r.start + n.length;
427
+ function ke(e, t, n) {
428
+ let r = C(e, t), i = r.start + n.length;
1374
429
  return {
1375
430
  value: e.slice(0, r.start) + n + e.slice(r.end),
1376
431
  selection: {
@@ -1379,11 +434,11 @@ function ye(e, t, n) {
1379
434
  }
1380
435
  };
1381
436
  }
1382
- var X = /\{\{(selection(?::[^{}]*)?|caret|select:[^{}]*)\}\}/g;
1383
- function be(e, t) {
437
+ var z = /\{\{(selection(?::[^{}]*)?|caret|select:[^{}]*)\}\}/g;
438
+ function Ae(e, t) {
1384
439
  let n = "", r = 0, i = null, a = null, o = null;
1385
- X.lastIndex = 0;
1386
- for (let s = X.exec(e); s; s = X.exec(e)) {
440
+ z.lastIndex = 0;
441
+ for (let s = z.exec(e); s; s = z.exec(e)) {
1387
442
  let c = s.index;
1388
443
  n += e.slice(r, c), r = c + s[0].length;
1389
444
  let l = s[1] ?? "";
@@ -1414,8 +469,8 @@ function be(e, t) {
1414
469
  caret: o
1415
470
  };
1416
471
  }
1417
- function xe(e, t, n, r = {}) {
1418
- let i = D(e, t), a = be(n, e.slice(i.start, i.end)), o = r.block === !0 && a.text.length > 0 ? J(e, i) : {
472
+ 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) : {
1419
474
  prefix: "",
1420
475
  suffix: ""
1421
476
  }, s = i.start + o.prefix.length, c;
@@ -1436,7 +491,7 @@ function xe(e, t, n, r = {}) {
1436
491
  selection: c
1437
492
  };
1438
493
  }
1439
- function Z(e, t) {
494
+ function je(e, t) {
1440
495
  let n = [], r = 0;
1441
496
  for (; r < e.length;) {
1442
497
  if (e[r] !== t) {
@@ -1453,18 +508,18 @@ function Z(e, t) {
1453
508
  }
1454
509
  return n;
1455
510
  }
1456
- function Q(e, t) {
1457
- if (t === "inlineCode") return Z(e, "`");
1458
- let n = Z(e, t === "strike" ? "~" : "*");
511
+ function Me(e, t) {
512
+ if (t === "inlineCode") return je(e, "`");
513
+ let n = je(e, t === "strike" ? "~" : "*");
1459
514
  return t === "italic" ? n.filter((e) => e.length % 2 == 1) : n.filter((e) => e.length >= 2);
1460
515
  }
1461
- function Se(e, t, n) {
516
+ function Ne(e, t, n) {
1462
517
  return e >= t ? !1 : n.some((r) => r.start === e && n.some((e) => e.end === t && e.length === r.length && e.start >= r.end));
1463
518
  }
1464
- function Ce(e, t, n) {
519
+ function Pe(e, t, n) {
1465
520
  return e >= t ? !1 : n.some((r) => r.end === e && n.some((e) => e.start === t && e.length === r.length && e.start >= r.end));
1466
521
  }
1467
- function we(e, t) {
522
+ function Fe(e, t) {
1468
523
  let n = 0;
1469
524
  for (; n < t.length;) {
1470
525
  let r = t[n], i = n + 1;
@@ -1478,37 +533,617 @@ function we(e, t) {
1478
533
  }
1479
534
  return !1;
1480
535
  }
1481
- function $(e, t, n, r) {
536
+ function V(e, t, n, r) {
1482
537
  if (t.start !== t.end) {
1483
- let n = Q(e, r);
1484
- return Se(t.start, t.end, n) || Ce(t.start, t.end, n);
538
+ let n = Me(e, r);
539
+ return Ne(t.start, t.end, n) || Pe(t.start, t.end, n);
1485
540
  }
1486
- return we(Math.min(Math.max(t.start - n.start, 0), n.text.length), Q(n.text, r).filter((e) => e.start >= Te(n.text)));
541
+ return Fe(Math.min(Math.max(t.start - n.start, 0), n.text.length), Me(n.text, r).filter((e) => e.start >= Ie(n.text)));
1487
542
  }
1488
- function Te(e) {
543
+ function Ie(e) {
1489
544
  let t = 0;
1490
545
  for (;;) {
1491
- let n = e.slice(t), r = W(n, H) ?? W(n, B) ?? W(n, V) ?? W(n, U);
546
+ let n = e.slice(t), r = I(n, P) ?? I(n, M) ?? I(n, N) ?? I(n, F);
1492
547
  if (!r) return t;
1493
548
  t += r.prefixLength;
1494
549
  }
1495
550
  }
1496
- function Ee(e) {
1497
- return W(e, H) ? "task" : W(e, B) ? "bullet" : W(e, V) ? "ordered" : null;
551
+ function Le(e) {
552
+ return I(e, P) ? "task" : I(e, M) ? "bullet" : I(e, N) ? "ordered" : null;
1498
553
  }
1499
- function De(e, t) {
1500
- let n = D(e, t), r = A(e, {
554
+ function Re(e, t) {
555
+ let n = C(e, t), r = E(e, {
1501
556
  start: n.start,
1502
557
  end: n.start
1503
- })[0], i = r.text, a = z.exec(i);
558
+ })[0], i = r.text, a = fe.exec(i);
1504
559
  return {
1505
560
  headingLevel: a ? a[1].length : 0,
1506
- bold: $(e, n, r, "bold"),
1507
- italic: $(e, n, r, "italic"),
1508
- strike: $(e, n, r, "strike"),
1509
- inlineCode: $(e, n, r, "inlineCode"),
1510
- list: Ee(i),
1511
- quote: W(i, U) !== null
561
+ bold: V(e, n, r, "bold"),
562
+ italic: V(e, n, r, "italic"),
563
+ strike: V(e, n, r, "strike"),
564
+ inlineCode: V(e, n, r, "inlineCode"),
565
+ list: Le(i),
566
+ quote: I(i, F) !== null
567
+ };
568
+ }
569
+ // src/authoring/native-components.ts
570
+ var H = Object.freeze(c.map((e) => ({
571
+ id: e.id,
572
+ label: u(e.title, "en", e.id)
573
+ })));
574
+ function U(e, t) {
575
+ let n = r[e];
576
+ return {
577
+ id: e,
578
+ label: u(n.title, t, e),
579
+ description: u(n.description, t, e),
580
+ group: n.category,
581
+ keywords: [...l(e) ?? []],
582
+ ...n.inline === !0 ? { inline: !0 } : {},
583
+ template: u(n.insertText, t, n.insertText.en ?? "")
584
+ };
585
+ }
586
+ var W = a.map((e) => U(e, "en")), G = Object.freeze(c.map((e) => ({
587
+ 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({
590
+ label: e.label,
591
+ description: e.description,
592
+ keywords: Object.freeze([...e.keywords]),
593
+ template: e.template
594
+ })])));
595
+ function Ve(e = "en") {
596
+ return e === "zh" ? {
597
+ groups: G,
598
+ components: K
599
+ } : {
600
+ groups: H,
601
+ components: W
602
+ };
603
+ }
604
+ function He(e) {
605
+ return new Set(e.match(/[A-Za-z_][A-Za-z0-9_]*/g) ?? []);
606
+ }
607
+ function Ue(e) {
608
+ let t = e.trim().replace(/[^A-Za-z0-9_]/g, "_");
609
+ return t ? /^[0-9]/.test(t) ? `_${t}` : t : "value";
610
+ }
611
+ function We(e, t) {
612
+ if (!t.has(e)) return e;
613
+ let n = 2;
614
+ for (; t.has(`${e}${n}`);) n += 1;
615
+ return `${e}${n}`;
616
+ }
617
+ function q(e, t, n) {
618
+ let r = He(t), i = /* @__PURE__ */ new Map();
619
+ return e.template.replace(/\{\{bind:([^{}]+)\}\}/g, (e, t) => {
620
+ let n = t.trim(), a = i.get(n);
621
+ if (a) return a;
622
+ let o = We(Ue(n), r);
623
+ return r.add(o), i.set(n, o), o;
624
+ });
625
+ }
626
+ // src/authoring/templates.ts
627
+ function Ge(e) {
628
+ let t = {};
629
+ for (let [n, r] of Object.entries(e.props)) t[n] = {
630
+ kind: r.kind,
631
+ required: r.required === !0,
632
+ ...r.enum ? { values: r.enum } : {},
633
+ ...r.default === void 0 ? {} : { defaultValue: r.default },
634
+ ...r.pattern === void 0 ? {} : { pattern: r.pattern },
635
+ ...r.min === void 0 ? {} : { min: r.min },
636
+ ...r.max === void 0 ? {} : { max: r.max },
637
+ integer: r.integer === !0,
638
+ color: r.color === !0
639
+ };
640
+ return t;
641
+ }
642
+ function Ke(e) {
643
+ return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
644
+ }
645
+ function qe(e) {
646
+ return e === null ? "" : Ke(String(e));
647
+ }
648
+ 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;
651
+ }
652
+ function Ye(e, t) {
653
+ if (e.defaultValue !== void 0 && e.defaultValue !== null) return qe(e.defaultValue);
654
+ switch (e.kind) {
655
+ case "boolean": return "false";
656
+ case "enum":
657
+ if (e.values?.length) return qe(e.values[0]);
658
+ throw Error(`${t} is a required enum without values; provide an authoring.insertText.`);
659
+ case "number": {
660
+ 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;
661
+ if (n !== void 0 && r !== void 0 && n > r) throw Error(`${t} has no integer inside its declared range; provide an authoring.insertText.`);
662
+ let i = n !== void 0 && n > 0 ? n : r !== void 0 && r < 0 ? r : 0;
663
+ if (n !== void 0 && i < n && (i = n), r !== void 0 && i > r && (i = r), !Number.isFinite(i)) throw Error(`${t} is a required number without a legal finite value; provide an authoring.insertText.`);
664
+ return String(i);
665
+ }
666
+ case "string":
667
+ if (e.color) return "#000000";
668
+ if (e.pattern) throw Error(`${t} is a required pattern-constrained string; provide an authoring.insertText.`);
669
+ return "";
670
+ default: throw Error(`${t} has an unsupported property kind; provide an authoring.insertText.`);
671
+ }
672
+ }
673
+ function Xe(e) {
674
+ if (e.structure && e.structure.rule !== "none" && e.structure.rule !== "any" && e.structure.rule !== "inline") return !0;
675
+ let t = e.children;
676
+ 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
+ function Ze(e, t) {
679
+ let n = e.name, r = e.form;
680
+ 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
+ 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}"`)}"`));
685
+ let s = `<${n}${o.length > 0 ? ` ${o.join(" ")}` : ""}`;
686
+ return r === "leaf" ? `${s}>` : r === "inline" ? `${s}></${n}>` : `${s}>\n\n</${n}>`;
687
+ }
688
+ var Qe = {
689
+ id: "authoring-template",
690
+ label: "",
691
+ description: "",
692
+ group: "input",
693
+ keywords: [],
694
+ template: ""
695
+ };
696
+ function J(e, t = "") {
697
+ let n = q({
698
+ ...Qe,
699
+ template: e
700
+ }, t);
701
+ return B(t, {
702
+ start: t.length,
703
+ end: t.length
704
+ }, n).value.slice(t.length);
705
+ }
706
+ function $e(e) {
707
+ return e.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
708
+ }
709
+ function et(e, t) {
710
+ let n = J(t), r = `</${e}>`, i = n.lastIndexOf(r);
711
+ if (!(i < 0)) return {
712
+ before: `${n.slice(0, i)}\n`,
713
+ after: `\n${n.slice(i)}`
714
+ };
715
+ }
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;
718
+ try {
719
+ o = m(a, t ?? {});
720
+ } catch (e) {
721
+ throw Error(`${n} authoring.insertText could not be compiled: ${e instanceof Error ? e.message : String(e)}.`);
722
+ }
723
+ if (o.ok) return;
724
+ let s = $e(o);
725
+ throw Error(`${n} authoring.insertText does not compile with this configuration${s ? ` (${s})` : ""}.`);
726
+ }
727
+ function nt(e, t, n, r) {
728
+ let i = r === void 0 ? e : `${r.before}${e}${r.after}`, a;
729
+ try {
730
+ a = m(i, t ?? {});
731
+ } catch (e) {
732
+ throw Error(`${n} has no authoring.insertText and its synthesized template could not be compiled: ${e instanceof Error ? e.message : String(e)}. Provide authoring.insertText.`);
733
+ }
734
+ if (a.ok) return;
735
+ let o = a.diagnostics.map((e) => `${e.code}: ${e.message}`).join("; ");
736
+ throw Error(`${n} has no authoring.insertText and its synthesized template does not compile with this configuration${o ? ` (${o})` : ""}. Provide authoring.insertText.`);
737
+ }
738
+ // src/authoring/catalog.ts
739
+ function Y(e) {
740
+ return /* @__PURE__ */ Error(`Invalid local component catalog: ${e}`);
741
+ }
742
+ function X(e, t, n) {
743
+ return u(e, t, n);
744
+ }
745
+ function rt(e, t) {
746
+ let n = X(e, t, "");
747
+ return n === "" ? void 0 : n;
748
+ }
749
+ function it(e) {
750
+ if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") return e;
751
+ if (e === null) return null;
752
+ }
753
+ function at(e, t) {
754
+ return Object.freeze({
755
+ name: e,
756
+ kind: t.kind,
757
+ required: t.required === !0,
758
+ static: t.static === !0,
759
+ dynamic: t.dynamic === !0,
760
+ ...t.values ? { values: Object.freeze([...t.values]) } : {},
761
+ ...it(t.default) === void 0 ? {} : { defaultValue: it(t.default) }
762
+ });
763
+ }
764
+ function ot(e, t) {
765
+ let n = {};
766
+ for (let [t, r] of Object.entries(e)) n[t] = at(t, r);
767
+ return n;
768
+ }
769
+ function st(e, t, n) {
770
+ for (let [r, i] of Object.entries(e.props)) {
771
+ let e = rt(i.description, n);
772
+ if (e === void 0) continue;
773
+ let a = t[r];
774
+ t[r] = Object.freeze({
775
+ ...a ?? {
776
+ name: r,
777
+ kind: i.kind,
778
+ required: i.required === !0,
779
+ static: i.static === !0,
780
+ dynamic: i.dynamic === !0
781
+ },
782
+ description: e
783
+ });
784
+ }
785
+ return t;
786
+ }
787
+ function ct(e) {
788
+ return Object.freeze({
789
+ id: e.id,
790
+ name: e.name,
791
+ title: e.title,
792
+ description: e.description,
793
+ category: e.category,
794
+ categoryLabel: e.categoryLabel,
795
+ insertText: e.insertText,
796
+ form: e.form,
797
+ paired: e.form !== "leaf",
798
+ inline: e.inline ?? e.form === "inline",
799
+ ...e.parents === void 0 ? {} : { parents: Object.freeze([...e.parents]) },
800
+ ...e.allowedChildren === void 0 ? {} : { allowedChildren: Object.freeze([...e.allowedChildren]) },
801
+ ...e.keywords === void 0 ? {} : { keywords: Object.freeze([...e.keywords]) },
802
+ props: Object.freeze({ ...e.props }),
803
+ ...e.styles === void 0 ? {} : { styles: Object.freeze([...e.styles]) },
804
+ ...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
805
+ });
806
+ }
807
+ function lt(e) {
808
+ let t = e.structure;
809
+ return {
810
+ ...t?.parents?.length ? { parents: t.parents } : {},
811
+ ...t?.children?.length ? { allowedChildren: t.children } : {}
812
+ };
813
+ }
814
+ function ut(e, t) {
815
+ if (e === t) return !0;
816
+ if (e === void 0 || t === void 0) return !1;
817
+ let n = Object.keys(e).sort(), r = Object.keys(t).sort();
818
+ return n.length === r.length && n.every((n, i) => n === r[i] && e[n] === t[n]);
819
+ }
820
+ function Z(e) {
821
+ let t = e.authoring;
822
+ 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);
826
+ }
827
+ function Q(e, t) {
828
+ let n = i(e.name), r = Z(e);
829
+ if (n) {
830
+ let e = r?.insertText;
831
+ if (e !== void 0) return e.trim() === "" ? void 0 : e;
832
+ let i = X(n.insertText, t, n.insertText.en ?? "");
833
+ return i === "" ? void 0 : i;
834
+ }
835
+ let a = r?.insertText;
836
+ return a !== void 0 && a.trim() !== "" ? a : void 0;
837
+ }
838
+ function dt(e, t) {
839
+ let n = Q(e, t);
840
+ return n === void 0 ? Ze(e, Ge(e)) : n;
841
+ }
842
+ function ft(e, n, r) {
843
+ let i = t(e).structure?.parents;
844
+ 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;
847
+ let i;
848
+ try {
849
+ i = dt(t, r);
850
+ } catch {
851
+ continue;
852
+ }
853
+ let a = et(e, i);
854
+ if (a !== void 0) return a;
855
+ }
856
+ }
857
+ function pt(e, t) {
858
+ if (e.parents !== void 0 && e.parents.length !== 0) for (let n of e.parents) {
859
+ let e = t.find((e) => e.name === n);
860
+ if (e === void 0 || e.form !== "container") continue;
861
+ let r = et(n, e.insertText);
862
+ if (r !== void 0) return r;
863
+ }
864
+ }
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;
867
+ if (g !== void 0) {
868
+ if (v = g, o) {
869
+ let t = ft(e, a, n);
870
+ try {
871
+ tt(v, r, `component "${e.name}"`, t);
872
+ } catch (e) {
873
+ throw Y(e instanceof Error ? e.message : String(e));
874
+ }
875
+ }
876
+ } else {
877
+ try {
878
+ v = Ze(e, Ge(e));
879
+ } catch (e) {
880
+ throw Y(e instanceof Error ? e.message : String(e));
881
+ }
882
+ if (o) try {
883
+ nt(v, r, `component "${e.name}"`, ft(e, a, n));
884
+ } catch (e) {
885
+ throw Y(e instanceof Error ? e.message : String(e));
886
+ }
887
+ }
888
+ let y = st(e, ot(c.props, n), n), b = l(e.name);
889
+ return ct({
890
+ id: u ? e.name : e.id,
891
+ name: e.name,
892
+ title: p,
893
+ description: m,
894
+ category: h,
895
+ categoryLabel: ee,
896
+ insertText: v,
897
+ form: e.form,
898
+ inline: u ? u.inline === !0 : e.form === "inline",
899
+ ..._,
900
+ ...b === void 0 ? {} : { keywords: b },
901
+ props: y,
902
+ ...e.styles === void 0 ? {} : { styles: e.styles },
903
+ ...e.requires === void 0 ? {} : { requires: e.requires }
904
+ });
905
+ }
906
+ function ht(e, t, n, r, i) {
907
+ let o = new Map(e.map((e) => [e.name, e])), s = [], c = /* @__PURE__ */ new Set();
908
+ for (let e of a) {
909
+ let t = o.get(e);
910
+ t && t.authoring !== void 0 && (s.push(mt(t, n, r, o, !1)), c.add(e));
911
+ }
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
+ return s;
914
+ }
915
+ function gt(e, n) {
916
+ let r = i(e.name), a = e.authoring, o = Z(e), c = {};
917
+ for (let [t, n] of Object.entries(e.props)) c[t] = n.description;
918
+ return JSON.stringify({
919
+ name: e.name,
920
+ id: e.id,
921
+ 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, ""),
924
+ 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,
927
+ inline: r ? r.inline === !0 : e.form === "inline",
928
+ keywords: l(e.name) ?? null,
929
+ manifest: a ?? null,
930
+ preset: r ?? null,
931
+ propDescriptions: c,
932
+ structure: t(e).structure ?? null,
933
+ styles: e.styles ?? null,
934
+ requires: e.requires ?? null
935
+ });
936
+ }
937
+ function _t(e, t = "en") {
938
+ let n = f(e);
939
+ if (!n.ok) return `invalid|${t}`;
940
+ let r = n.registry.map((e) => gt(e, t));
941
+ return `${p(e)}|${t}|${r.join("\0")}`;
942
+ }
943
+ function $(e, t, n, r) {
944
+ return Object.freeze(ht(e.registry, e.externalComponentNames, t, n, r));
945
+ }
946
+ function vt(e, t = "en") {
947
+ let n = d(e), r = f({ config: n });
948
+ if (!r.ok) throw Y(r.message);
949
+ return $(r, t, { config: n }, !0);
950
+ }
951
+ function yt(e, t = "en") {
952
+ let n = d(e), r = f({ config: n });
953
+ if (!r.ok) throw Y(r.message);
954
+ return $(r, t, { config: n }, !1);
955
+ }
956
+ function bt(e, t = "en") {
957
+ let n = f(e);
958
+ return n.ok ? $(n, t, e, !0) : Object.freeze([]);
959
+ }
960
+ function xt(e) {
961
+ let t = new Map(c.map((e, t) => [e.id, t])), n = /* @__PURE__ */ new Map();
962
+ for (let t of e) {
963
+ let e = n.get(t.category);
964
+ e ? e.entries.push(t) : n.set(t.category, {
965
+ id: t.category,
966
+ label: t.categoryLabel,
967
+ entries: [t]
968
+ });
969
+ }
970
+ return Object.freeze([...n.values()].map((e, n) => ({
971
+ ...e,
972
+ index: n,
973
+ rank: t.get(e.id) ?? 2 ** 53 - 1
974
+ })).sort((e, t) => e.rank - t.rank || e.index - t.index).map((e) => Object.freeze({
975
+ id: e.id,
976
+ label: e.label,
977
+ entries: Object.freeze([...e.entries])
978
+ })));
979
+ }
980
+ function St(e, t = {}) {
981
+ let n = t.ancestors ?? [], r = n[n.length - 1], i = (r === void 0 ? void 0 : e.find((e) => e.name === r))?.allowedChildren, a = (t.query ?? "").trim().toLowerCase(), o = e.filter((e) => e.parents !== void 0 && e.parents.length > 0 && !e.parents.some((e) => n.includes(e)) || i !== void 0 && i.length > 0 && !i.includes(e.name) ? !1 : a === "" || [
982
+ e.name,
983
+ e.title,
984
+ e.description,
985
+ e.categoryLabel,
986
+ ...e.keywords ?? []
987
+ ].some((e) => e.toLowerCase().includes(a)));
988
+ return Object.freeze(o);
989
+ }
990
+ function Ct(e) {
991
+ let t = [];
992
+ e.description !== "" && t.push(e.description);
993
+ for (let n of Object.values(e.props)) n.description !== void 0 && t.push(`${n.name}: ${n.description}`);
994
+ return t.join("\n");
995
+ }
996
+ 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;
1001
+ try {
1002
+ o = ee(e, n);
1003
+ } catch {
1004
+ return a;
1005
+ }
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) {
1008
+ 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);
1011
+ };
1012
+ return s(o.nodes, Object.freeze([])), a;
1013
+ }
1014
+ function Tt(e) {
1015
+ let t = {};
1016
+ if (!e) return t;
1017
+ for (let [n, r] of Object.entries(e.props)) t[n] = Object.freeze({
1018
+ name: n,
1019
+ kind: r.kind,
1020
+ required: r.required === !0,
1021
+ static: r.static === !0,
1022
+ dynamic: r.dynamic === !0,
1023
+ ...r.values ? { values: Object.freeze([...r.values]) } : {},
1024
+ ...r.default === void 0 ? {} : { defaultValue: r.default }
1025
+ });
1026
+ return t;
1027
+ }
1028
+ function Et(e) {
1029
+ return Object.freeze({
1030
+ name: e.name,
1031
+ form: e.form,
1032
+ paired: e.form !== "leaf",
1033
+ title: e.title,
1034
+ description: e.description,
1035
+ category: e.category,
1036
+ categoryLabel: e.categoryLabel,
1037
+ insertText: e.insertText,
1038
+ props: Object.freeze({ ...e.props }),
1039
+ ...e.parents === void 0 ? {} : { parents: Object.freeze([...e.parents]) },
1040
+ ...e.allowedChildren === void 0 ? {} : { allowedChildren: Object.freeze([...e.allowedChildren]) },
1041
+ ...e.keywords === void 0 ? {} : { keywords: Object.freeze([...e.keywords]) },
1042
+ ...e.styles === void 0 ? {} : { styles: Object.freeze([...e.styles]) },
1043
+ ...e.requires === void 0 ? {} : { requires: Object.freeze({ ...e.requires }) }
1044
+ });
1045
+ }
1046
+ function Dt(e) {
1047
+ let t = new Map(e.map((e) => [e.name, e])), n = Object.freeze([...e]);
1048
+ return Object.freeze({
1049
+ tags: n,
1050
+ tag(e) {
1051
+ return t.get(e);
1052
+ },
1053
+ attribute(e, n) {
1054
+ return t.get(e)?.props[n];
1055
+ }
1056
+ });
1057
+ }
1058
+ function Ot(e, t = "en") {
1059
+ let n = f(e);
1060
+ if (!n.ok) return Dt([]);
1061
+ let r = [];
1062
+ try {
1063
+ r = $(n, t, e, !1);
1064
+ } catch {
1065
+ r = Object.freeze([]);
1066
+ }
1067
+ let i = new Map(r.map((e) => [e.name, e])), a = [];
1068
+ for (let [e, t] of n.schemaByName) {
1069
+ let n = i.get(e), r = Tt(t);
1070
+ for (let [e, t] of Object.entries(n?.props ?? {})) r[e] = Object.freeze({
1071
+ ...r[e],
1072
+ ...t
1073
+ });
1074
+ a.push(Et({
1075
+ name: e,
1076
+ form: t.form,
1077
+ title: n?.title ?? e,
1078
+ description: n?.description ?? "",
1079
+ category: n?.category ?? "component",
1080
+ categoryLabel: n?.categoryLabel ?? "component",
1081
+ insertText: n?.insertText ?? "",
1082
+ props: r,
1083
+ ...n?.parents === void 0 ? {} : { parents: n.parents },
1084
+ ...n?.allowedChildren === void 0 ? {} : { allowedChildren: n.allowedChildren },
1085
+ ...n?.keywords === void 0 ? {} : { keywords: n.keywords },
1086
+ ...n?.styles === void 0 ? {} : { styles: n.styles },
1087
+ ...n?.requires === void 0 ? {} : { requires: n.requires }
1088
+ }));
1089
+ }
1090
+ return Dt(a);
1091
+ }
1092
+ // src/authoring/insert.ts
1093
+ 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;
1096
+ for (let e of a) {
1097
+ 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);
1100
+ }
1101
+ return s;
1102
+ }
1103
+ function jt(e) {
1104
+ return {
1105
+ id: e.id,
1106
+ label: e.title,
1107
+ description: e.description,
1108
+ group: "input",
1109
+ keywords: [],
1110
+ template: e.insertText
1512
1111
  };
1513
1112
  }
1514
- export { f as EXTENDED_NATIVE_COMPONENTS, p as EXTENDED_NATIVE_COMPONENT_COPY_ZH, s as LOCAL_COMPONENTS, i as LOCAL_COMPONENT_NAMES, _ as NATIVE_COMPONENTS, x as NATIVE_COMPONENTS_ZH, g as NATIVE_COMPONENT_GROUPS, b as NATIVE_COMPONENT_GROUPS_ZH, d as analyzeLocalSource, e as closestName, l as completeLocalSource, re as formatBold, q as formatBulletList, oe as formatHeading, ae as formatInlineCode, F as formatItalic, u as formatLocalSource, se as formatOrderedList, le as formatQuote, I as formatStrike, ce as formatTaskList, o as getLocalComponent, ne as getNativeComponentCatalog, a as getPropDefault, ue as indentSelection, he as insertCodeBlock, ve as insertDivider, me as insertImage, pe as insertLink, _e as insertTable, xe as insertTemplate, ye as insertText, n as localComponentNames, fe as outdentSelection, De as readFormatState, c as renameLocalBinding, T as renderNativeSnippet, t as suggestAttribute, r as suggestComponent };
1113
+ function Mt(e, t, n, r) {
1114
+ return B(n, r, At(q(jt(e), n), t, n), { block: !e.inline });
1115
+ }
1116
+ function Nt(e, t, n, r, i = "en") {
1117
+ if (typeof n != "string") throw TypeError("insertLocalComponent requires source text.");
1118
+ if (typeof t != "string" || t.length === 0) throw TypeError("insertLocalComponent requires a component id.");
1119
+ let a = f(e);
1120
+ if (!a.ok) throw Error(`Invalid compile options: ${a.message}`);
1121
+ let o = bt(e, i).find((e) => e.id === t || e.name === t);
1122
+ if (!o) throw Error(`Unknown local component "${t}".`);
1123
+ return Mt(o, e, n, r);
1124
+ }
1125
+ function Pt(e, t, n, r, i = "en") {
1126
+ return Nt({ config: d(e) }, t, n, r, i);
1127
+ }
1128
+ // src/authoring/conformance.ts
1129
+ function Ft(e, t = "en") {
1130
+ let n = d(e), r = new Set(n.components.map((e) => e.name)), i = [], a = { config: n }, o = yt(n, t);
1131
+ for (let e of o) {
1132
+ if (!r.has(e.name)) continue;
1133
+ let t = Mt(e, a, "", {
1134
+ start: 0,
1135
+ end: 0
1136
+ }).value, n = pt(e, o), s = n === void 0 ? t : `${n.before}${t}${n.after}`, c = m(s, a);
1137
+ c.ok || i.push(Object.freeze({
1138
+ id: e.id,
1139
+ name: e.name,
1140
+ message: `Insert template for <${e.name}> does not compile with this configuration.`,
1141
+ diagnostics: Object.freeze(c.diagnostics.map((e) => Object.freeze({
1142
+ code: e.code,
1143
+ message: e.message
1144
+ })))
1145
+ }));
1146
+ }
1147
+ return Object.freeze(i);
1148
+ }
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 };