@notectl/core 1.0.4 → 1.0.6

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 (334) hide show
  1. package/README.md +52 -148
  2. package/dist/chunks/AttrRegistry-DTsHyDVA.mjs +16 -0
  3. package/dist/chunks/AttrRegistry-DTsHyDVA.mjs.map +1 -0
  4. package/dist/chunks/Commands-DLP85Mp5.mjs +461 -0
  5. package/dist/chunks/Commands-DLP85Mp5.mjs.map +1 -0
  6. package/dist/chunks/Document-CI3iCwEP.mjs +177 -0
  7. package/dist/chunks/Document-CI3iCwEP.mjs.map +1 -0
  8. package/dist/chunks/HTMLUtils-0wvCRvJc.mjs +7 -0
  9. package/dist/chunks/HTMLUtils-0wvCRvJc.mjs.map +1 -0
  10. package/dist/chunks/NodeResolver-D68ZLXti.mjs +81 -0
  11. package/dist/chunks/NodeResolver-D68ZLXti.mjs.map +1 -0
  12. package/dist/chunks/NodeSpec-NZVvcCuH.mjs +8 -0
  13. package/dist/chunks/NodeSpec-NZVvcCuH.mjs.map +1 -0
  14. package/dist/chunks/Plugin-B9OZ6Y4c.mjs +15 -0
  15. package/dist/chunks/Plugin-B9OZ6Y4c.mjs.map +1 -0
  16. package/dist/chunks/Selection-D5ZjXoB7.mjs +44 -0
  17. package/dist/chunks/Selection-D5ZjXoB7.mjs.map +1 -0
  18. package/dist/chunks/ToolbarItem-ugDymuXi.mjs +7 -0
  19. package/dist/chunks/ToolbarItem-ugDymuXi.mjs.map +1 -0
  20. package/dist/chunks/ToolbarPlugin-sJTiZr-S.mjs +398 -0
  21. package/dist/chunks/ToolbarPlugin-sJTiZr-S.mjs.map +1 -0
  22. package/dist/chunks/TypeBrands-C09nE2qO.mjs +27 -0
  23. package/dist/chunks/TypeBrands-C09nE2qO.mjs.map +1 -0
  24. package/dist/chunks/color-picker-Csf0wx5a.mjs +5 -0
  25. package/dist/chunks/color-picker-Csf0wx5a.mjs.map +1 -0
  26. package/dist/chunks/index-QvKiO9_4.mjs +538 -0
  27. package/dist/chunks/index-QvKiO9_4.mjs.map +1 -0
  28. package/dist/commands/Commands.d.ts +71 -0
  29. package/dist/commands/Commands.d.ts.map +1 -0
  30. package/dist/commands/PasteCommand.d.ts +9 -0
  31. package/dist/commands/PasteCommand.d.ts.map +1 -0
  32. package/dist/decorations/Decoration.d.ts +76 -0
  33. package/dist/decorations/Decoration.d.ts.map +1 -0
  34. package/dist/decorations/PositionMapping.d.ts +9 -0
  35. package/dist/decorations/PositionMapping.d.ts.map +1 -0
  36. package/dist/editor/Announcer.d.ts +12 -0
  37. package/dist/editor/Announcer.d.ts.map +1 -0
  38. package/dist/editor/DocumentParser.d.ts +5 -0
  39. package/dist/editor/DocumentParser.d.ts.map +1 -0
  40. package/dist/editor/DocumentSerializer.d.ts +5 -0
  41. package/dist/editor/DocumentSerializer.d.ts.map +1 -0
  42. package/dist/editor/EditorDOM.d.ts +18 -0
  43. package/dist/editor/EditorDOM.d.ts.map +1 -0
  44. package/dist/editor/EditorThemeController.d.ts +21 -0
  45. package/dist/editor/EditorThemeController.d.ts.map +1 -0
  46. package/dist/editor/NotectlEditor.d.ts +135 -0
  47. package/dist/editor/NotectlEditor.d.ts.map +1 -0
  48. package/dist/editor/styles/base.d.ts +3 -0
  49. package/dist/editor/styles/base.d.ts.map +1 -0
  50. package/dist/editor/styles/code-block.d.ts +3 -0
  51. package/dist/editor/styles/code-block.d.ts.map +1 -0
  52. package/dist/editor/styles/color-picker.d.ts +3 -0
  53. package/dist/editor/styles/color-picker.d.ts.map +1 -0
  54. package/dist/editor/styles/font-select.d.ts +3 -0
  55. package/dist/editor/styles/font-select.d.ts.map +1 -0
  56. package/dist/editor/styles/font-size-select.d.ts +3 -0
  57. package/dist/editor/styles/font-size-select.d.ts.map +1 -0
  58. package/dist/editor/styles/heading-select.d.ts +3 -0
  59. package/dist/editor/styles/heading-select.d.ts.map +1 -0
  60. package/dist/editor/styles/image.d.ts +3 -0
  61. package/dist/editor/styles/image.d.ts.map +1 -0
  62. package/dist/editor/styles/list.d.ts +3 -0
  63. package/dist/editor/styles/list.d.ts.map +1 -0
  64. package/dist/editor/styles/reduced-motion.d.ts +3 -0
  65. package/dist/editor/styles/reduced-motion.d.ts.map +1 -0
  66. package/dist/editor/styles/table.d.ts +3 -0
  67. package/dist/editor/styles/table.d.ts.map +1 -0
  68. package/dist/editor/styles/toolbar.d.ts +3 -0
  69. package/dist/editor/styles/toolbar.d.ts.map +1 -0
  70. package/dist/editor/styles.d.ts +12 -0
  71. package/dist/editor/styles.d.ts.map +1 -0
  72. package/dist/editor/theme/ThemeEngine.d.ts +6 -0
  73. package/dist/editor/theme/ThemeEngine.d.ts.map +1 -0
  74. package/dist/editor/theme/ThemeTokens.d.ts +73 -0
  75. package/dist/editor/theme/ThemeTokens.d.ts.map +1 -0
  76. package/dist/fonts.d.ts +17 -0
  77. package/dist/fonts.d.ts.map +1 -0
  78. package/dist/fonts.mjs +7 -0
  79. package/dist/fonts.mjs.map +1 -0
  80. package/dist/index.d.ts +83 -2360
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/input/ClipboardHandler.d.ts +29 -0
  83. package/dist/input/ClipboardHandler.d.ts.map +1 -0
  84. package/dist/input/InputHandler.d.ts +32 -0
  85. package/dist/input/InputHandler.d.ts.map +1 -0
  86. package/dist/input/InputRule.d.ts +9 -0
  87. package/dist/input/InputRule.d.ts.map +1 -0
  88. package/dist/input/InternalClipboard.d.ts +23 -0
  89. package/dist/input/InternalClipboard.d.ts.map +1 -0
  90. package/dist/input/KeyboardHandler.d.ts +42 -0
  91. package/dist/input/KeyboardHandler.d.ts.map +1 -0
  92. package/dist/input/Keymap.d.ts +11 -0
  93. package/dist/input/Keymap.d.ts.map +1 -0
  94. package/dist/input/PasteHandler.d.ts +38 -0
  95. package/dist/input/PasteHandler.d.ts.map +1 -0
  96. package/dist/input/SourceNormalizer.d.ts +7 -0
  97. package/dist/input/SourceNormalizer.d.ts.map +1 -0
  98. package/dist/model/AttrRegistry.d.ts +39 -0
  99. package/dist/model/AttrRegistry.d.ts.map +1 -0
  100. package/dist/model/BuiltinSpecs.d.ts +4 -0
  101. package/dist/model/BuiltinSpecs.d.ts.map +1 -0
  102. package/dist/model/ContentModel.d.ts +12 -0
  103. package/dist/model/ContentModel.d.ts.map +1 -0
  104. package/dist/model/ContentSlice.d.ts +17 -0
  105. package/dist/model/ContentSlice.d.ts.map +1 -0
  106. package/dist/model/Document.d.ts +127 -0
  107. package/dist/model/Document.d.ts.map +1 -0
  108. package/dist/model/HTMLParser.d.ts +36 -0
  109. package/dist/model/HTMLParser.d.ts.map +1 -0
  110. package/dist/model/HTMLUtils.d.ts +6 -0
  111. package/dist/model/HTMLUtils.d.ts.map +1 -0
  112. package/dist/model/InlineNodeSpec.d.ts +20 -0
  113. package/dist/model/InlineNodeSpec.d.ts.map +1 -0
  114. package/dist/model/MarkSpec.d.ts +22 -0
  115. package/dist/model/MarkSpec.d.ts.map +1 -0
  116. package/dist/model/NodeResolver.d.ts +36 -0
  117. package/dist/model/NodeResolver.d.ts.map +1 -0
  118. package/dist/model/NodeSpec.d.ts +67 -0
  119. package/dist/model/NodeSpec.d.ts.map +1 -0
  120. package/dist/model/ParseRule.d.ts +11 -0
  121. package/dist/model/ParseRule.d.ts.map +1 -0
  122. package/dist/model/SanitizeConfig.d.ts +9 -0
  123. package/dist/model/SanitizeConfig.d.ts.map +1 -0
  124. package/dist/model/Schema.d.ts +17 -0
  125. package/dist/model/Schema.d.ts.map +1 -0
  126. package/dist/model/SchemaRegistry.d.ts +81 -0
  127. package/dist/model/SchemaRegistry.d.ts.map +1 -0
  128. package/dist/model/Selection.d.ts +52 -0
  129. package/dist/model/Selection.d.ts.map +1 -0
  130. package/dist/model/TypeBrands.d.ts +28 -0
  131. package/dist/model/TypeBrands.d.ts.map +1 -0
  132. package/dist/notectl-core.mjs +2715 -11109
  133. package/dist/notectl-core.mjs.map +1 -1
  134. package/dist/notectl-core.umd.js +6894 -0
  135. package/dist/notectl-core.umd.js.map +1 -0
  136. package/dist/plugins/EventBus.d.ts +13 -0
  137. package/dist/plugins/EventBus.d.ts.map +1 -0
  138. package/dist/plugins/Plugin.d.ts +85 -0
  139. package/dist/plugins/Plugin.d.ts.map +1 -0
  140. package/dist/plugins/PluginManager.d.ts +68 -0
  141. package/dist/plugins/PluginManager.d.ts.map +1 -0
  142. package/dist/plugins/alignment/AlignmentPlugin.d.ts +48 -0
  143. package/dist/plugins/alignment/AlignmentPlugin.d.ts.map +1 -0
  144. package/dist/plugins/alignment/index.d.ts +2 -0
  145. package/dist/plugins/alignment/index.d.ts.map +1 -0
  146. package/dist/plugins/alignment.mjs +92 -0
  147. package/dist/plugins/alignment.mjs.map +1 -0
  148. package/dist/plugins/blockquote/BlockquotePlugin.d.ts +30 -0
  149. package/dist/plugins/blockquote/BlockquotePlugin.d.ts.map +1 -0
  150. package/dist/plugins/blockquote/index.d.ts +2 -0
  151. package/dist/plugins/blockquote/index.d.ts.map +1 -0
  152. package/dist/plugins/blockquote.mjs +58 -0
  153. package/dist/plugins/blockquote.mjs.map +1 -0
  154. package/dist/plugins/code-block/CodeBlockCommands.d.ts +5 -0
  155. package/dist/plugins/code-block/CodeBlockCommands.d.ts.map +1 -0
  156. package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts +10 -0
  157. package/dist/plugins/code-block/CodeBlockKeyboardHandlers.d.ts.map +1 -0
  158. package/dist/plugins/code-block/CodeBlockNodeView.d.ts +5 -0
  159. package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -0
  160. package/dist/plugins/code-block/CodeBlockPlugin.d.ts +27 -0
  161. package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -0
  162. package/dist/plugins/code-block/CodeBlockService.d.ts +5 -0
  163. package/dist/plugins/code-block/CodeBlockService.d.ts.map +1 -0
  164. package/dist/plugins/code-block/CodeBlockTypes.d.ts +69 -0
  165. package/dist/plugins/code-block/CodeBlockTypes.d.ts.map +1 -0
  166. package/dist/plugins/code-block/index.d.ts +2 -0
  167. package/dist/plugins/code-block/index.d.ts.map +1 -0
  168. package/dist/plugins/code-block.mjs +6 -0
  169. package/dist/plugins/code-block.mjs.map +1 -0
  170. package/dist/plugins/font/FontPlugin.d.ts +85 -0
  171. package/dist/plugins/font/FontPlugin.d.ts.map +1 -0
  172. package/dist/plugins/font/StarterFonts.d.ts +10 -0
  173. package/dist/plugins/font/StarterFonts.d.ts.map +1 -0
  174. package/dist/plugins/font/index.d.ts +2 -0
  175. package/dist/plugins/font/index.d.ts.map +1 -0
  176. package/dist/plugins/font-size/FontSizeOperations.d.ts +22 -0
  177. package/dist/plugins/font-size/FontSizeOperations.d.ts.map +1 -0
  178. package/dist/plugins/font-size/FontSizePlugin.d.ts +56 -0
  179. package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -0
  180. package/dist/plugins/font-size/FontSizePopup.d.ts +9 -0
  181. package/dist/plugins/font-size/FontSizePopup.d.ts.map +1 -0
  182. package/dist/plugins/font-size/index.d.ts +2 -0
  183. package/dist/plugins/font-size/index.d.ts.map +1 -0
  184. package/dist/plugins/font-size.mjs +204 -0
  185. package/dist/plugins/font-size.mjs.map +1 -0
  186. package/dist/plugins/font.mjs +186 -0
  187. package/dist/plugins/font.mjs.map +1 -0
  188. package/dist/plugins/hard-break/HardBreakPlugin.d.ts +16 -0
  189. package/dist/plugins/hard-break/HardBreakPlugin.d.ts.map +1 -0
  190. package/dist/plugins/hard-break/index.d.ts +2 -0
  191. package/dist/plugins/hard-break/index.d.ts.map +1 -0
  192. package/dist/plugins/hard-break.mjs +28 -0
  193. package/dist/plugins/hard-break.mjs.map +1 -0
  194. package/dist/plugins/heading/BlockTypePickerEntry.d.ts +20 -0
  195. package/dist/plugins/heading/BlockTypePickerEntry.d.ts.map +1 -0
  196. package/dist/plugins/heading/HeadingPlugin.d.ts +78 -0
  197. package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -0
  198. package/dist/plugins/heading/index.d.ts +3 -0
  199. package/dist/plugins/heading/index.d.ts.map +1 -0
  200. package/dist/plugins/heading.mjs +188 -0
  201. package/dist/plugins/heading.mjs.map +1 -0
  202. package/dist/plugins/highlight/HighlightPlugin.d.ts +37 -0
  203. package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -0
  204. package/dist/plugins/highlight/index.d.ts +2 -0
  205. package/dist/plugins/highlight/index.d.ts.map +1 -0
  206. package/dist/plugins/highlight.mjs +126 -0
  207. package/dist/plugins/highlight.mjs.map +1 -0
  208. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts +29 -0
  209. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -0
  210. package/dist/plugins/horizontal-rule/index.d.ts +2 -0
  211. package/dist/plugins/horizontal-rule/index.d.ts.map +1 -0
  212. package/dist/plugins/horizontal-rule.mjs +59 -0
  213. package/dist/plugins/horizontal-rule.mjs.map +1 -0
  214. package/dist/plugins/image/ImageCommands.d.ts +26 -0
  215. package/dist/plugins/image/ImageCommands.d.ts.map +1 -0
  216. package/dist/plugins/image/ImageNodeView.d.ts +6 -0
  217. package/dist/plugins/image/ImageNodeView.d.ts.map +1 -0
  218. package/dist/plugins/image/ImagePlugin.d.ts +43 -0
  219. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -0
  220. package/dist/plugins/image/ImageUpload.d.ts +48 -0
  221. package/dist/plugins/image/ImageUpload.d.ts.map +1 -0
  222. package/dist/plugins/image/index.d.ts +3 -0
  223. package/dist/plugins/image/index.d.ts.map +1 -0
  224. package/dist/plugins/image.mjs +381 -0
  225. package/dist/plugins/image.mjs.map +1 -0
  226. package/dist/plugins/link/LinkPlugin.d.ts +32 -0
  227. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -0
  228. package/dist/plugins/link/index.d.ts +2 -0
  229. package/dist/plugins/link/index.d.ts.map +1 -0
  230. package/dist/plugins/link.mjs +127 -0
  231. package/dist/plugins/link.mjs.map +1 -0
  232. package/dist/plugins/list/ListPlugin.d.ts +51 -0
  233. package/dist/plugins/list/ListPlugin.d.ts.map +1 -0
  234. package/dist/plugins/list/index.d.ts +2 -0
  235. package/dist/plugins/list/index.d.ts.map +1 -0
  236. package/dist/plugins/list.mjs +193 -0
  237. package/dist/plugins/list.mjs.map +1 -0
  238. package/dist/plugins/print/PrintContentPreparer.d.ts +12 -0
  239. package/dist/plugins/print/PrintContentPreparer.d.ts.map +1 -0
  240. package/dist/plugins/print/PrintPlugin.d.ts +12 -0
  241. package/dist/plugins/print/PrintPlugin.d.ts.map +1 -0
  242. package/dist/plugins/print/PrintServiceImpl.d.ts +7 -0
  243. package/dist/plugins/print/PrintServiceImpl.d.ts.map +1 -0
  244. package/dist/plugins/print/PrintStyleCollector.d.ts +10 -0
  245. package/dist/plugins/print/PrintStyleCollector.d.ts.map +1 -0
  246. package/dist/plugins/print/PrintTypes.d.ts +56 -0
  247. package/dist/plugins/print/PrintTypes.d.ts.map +1 -0
  248. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts +23 -0
  249. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -0
  250. package/dist/plugins/strikethrough/index.d.ts +2 -0
  251. package/dist/plugins/strikethrough/index.d.ts.map +1 -0
  252. package/dist/plugins/strikethrough.mjs +35 -0
  253. package/dist/plugins/strikethrough.mjs.map +1 -0
  254. package/dist/plugins/super-sub/SuperSubPlugin.d.ts +44 -0
  255. package/dist/plugins/super-sub/SuperSubPlugin.d.ts.map +1 -0
  256. package/dist/plugins/super-sub/index.d.ts +2 -0
  257. package/dist/plugins/super-sub/index.d.ts.map +1 -0
  258. package/dist/plugins/super-sub.mjs +81 -0
  259. package/dist/plugins/super-sub.mjs.map +1 -0
  260. package/dist/plugins/table/TableCommands.d.ts +50 -0
  261. package/dist/plugins/table/TableCommands.d.ts.map +1 -0
  262. package/dist/plugins/table/TableControls.d.ts +10 -0
  263. package/dist/plugins/table/TableControls.d.ts.map +1 -0
  264. package/dist/plugins/table/TableControlsDOM.d.ts +18 -0
  265. package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -0
  266. package/dist/plugins/table/TableControlsLayout.d.ts +34 -0
  267. package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -0
  268. package/dist/plugins/table/TableHelpers.d.ts +39 -0
  269. package/dist/plugins/table/TableHelpers.d.ts.map +1 -0
  270. package/dist/plugins/table/TableNavigation.d.ts +4 -0
  271. package/dist/plugins/table/TableNavigation.d.ts.map +1 -0
  272. package/dist/plugins/table/TableNodeViews.d.ts +18 -0
  273. package/dist/plugins/table/TableNodeViews.d.ts.map +1 -0
  274. package/dist/plugins/table/TablePlugin.d.ts +39 -0
  275. package/dist/plugins/table/TablePlugin.d.ts.map +1 -0
  276. package/dist/plugins/table/TableSelection.d.ts +26 -0
  277. package/dist/plugins/table/TableSelection.d.ts.map +1 -0
  278. package/dist/plugins/table/TableTestUtils.d.ts +45 -0
  279. package/dist/plugins/table/TableTestUtils.d.ts.map +1 -0
  280. package/dist/plugins/table/index.d.ts +4 -0
  281. package/dist/plugins/table/index.d.ts.map +1 -0
  282. package/dist/plugins/table.mjs +663 -0
  283. package/dist/plugins/table.mjs.map +1 -0
  284. package/dist/plugins/text-color/TextColorPlugin.d.ts +37 -0
  285. package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -0
  286. package/dist/plugins/text-color/index.d.ts +2 -0
  287. package/dist/plugins/text-color/index.d.ts.map +1 -0
  288. package/dist/plugins/text-color.mjs +126 -0
  289. package/dist/plugins/text-color.mjs.map +1 -0
  290. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts +34 -0
  291. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -0
  292. package/dist/plugins/text-formatting/index.d.ts +2 -0
  293. package/dist/plugins/text-formatting/index.d.ts.map +1 -0
  294. package/dist/plugins/text-formatting.mjs +52 -0
  295. package/dist/plugins/text-formatting.mjs.map +1 -0
  296. package/dist/plugins/toolbar/ToolbarItem.d.ts +66 -0
  297. package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -0
  298. package/dist/plugins/toolbar/ToolbarKeyboardNav.d.ts +25 -0
  299. package/dist/plugins/toolbar/ToolbarKeyboardNav.d.ts.map +1 -0
  300. package/dist/plugins/toolbar/ToolbarPlugin.d.ts +47 -0
  301. package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -0
  302. package/dist/plugins/toolbar/ToolbarPopupController.d.ts +25 -0
  303. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -0
  304. package/dist/plugins/toolbar/ToolbarRenderers.d.ts +19 -0
  305. package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -0
  306. package/dist/plugins/toolbar/ToolbarTooltip.d.ts +17 -0
  307. package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -0
  308. package/dist/plugins/toolbar/index.d.ts +4 -0
  309. package/dist/plugins/toolbar/index.d.ts.map +1 -0
  310. package/dist/plugins/toolbar.mjs +8 -0
  311. package/dist/plugins/toolbar.mjs.map +1 -0
  312. package/dist/state/EditorState.d.ts +40 -0
  313. package/dist/state/EditorState.d.ts.map +1 -0
  314. package/dist/state/History.d.ts +38 -0
  315. package/dist/state/History.d.ts.map +1 -0
  316. package/dist/state/StepApplication.d.ts +5 -0
  317. package/dist/state/StepApplication.d.ts.map +1 -0
  318. package/dist/state/Transaction.d.ts +185 -0
  319. package/dist/state/Transaction.d.ts.map +1 -0
  320. package/dist/test/PluginTestUtils.d.ts +127 -0
  321. package/dist/test/PluginTestUtils.d.ts.map +1 -0
  322. package/dist/test/TestUtils.d.ts +153 -0
  323. package/dist/test/TestUtils.d.ts.map +1 -0
  324. package/dist/view/EditorView.d.ts +74 -0
  325. package/dist/view/EditorView.d.ts.map +1 -0
  326. package/dist/view/NodeView.d.ts +18 -0
  327. package/dist/view/NodeView.d.ts.map +1 -0
  328. package/dist/view/Reconciler.d.ts +23 -0
  329. package/dist/view/Reconciler.d.ts.map +1 -0
  330. package/dist/view/SelectionSync.d.ts +8 -0
  331. package/dist/view/SelectionSync.d.ts.map +1 -0
  332. package/package.json +112 -11
  333. package/dist/notectl-core.js +0 -1463
  334. package/dist/notectl-core.js.map +0 -1
@@ -0,0 +1,36 @@
1
+ import { BlockNode, Document } from './Document.js';
2
+ /**
3
+ * Resolves a node in the document tree by its path (array of block IDs).
4
+ * The path traces the lineage from the root block down to the target.
5
+ */
6
+ export declare function resolveNodeByPath(doc: Document, path: readonly string[]): BlockNode | undefined;
7
+ /**
8
+ * Resolves the parent of a node at the given path.
9
+ * Returns the parent container (Document or BlockNode) and the child's index within it.
10
+ */
11
+ export declare function resolveParentByPath(doc: Document, path: readonly string[]): {
12
+ parent: Document | BlockNode;
13
+ index: number;
14
+ } | undefined;
15
+ /**
16
+ * Finds the path (array of block IDs) to a node by its ID.
17
+ * Performs recursive DFS through the document tree.
18
+ */
19
+ export declare function findNodePath(doc: Document, nodeId: string): string[] | undefined;
20
+ /**
21
+ * Walks all block nodes in the document tree in depth-first order.
22
+ * Visits every BlockNode, including nested ones, with their full path.
23
+ */
24
+ export declare function walkNodes(doc: Document, callback: (node: BlockNode, path: string[]) => void): void;
25
+ /**
26
+ * Finds a block node by ID anywhere in the document tree (recursive DFS).
27
+ */
28
+ export declare function findNode(doc: Document, nodeId: string): BlockNode | undefined;
29
+ /**
30
+ * Finds a block node and returns it together with its path.
31
+ */
32
+ export declare function findNodeWithPath(doc: Document, nodeId: string): {
33
+ node: BlockNode;
34
+ path: string[];
35
+ } | undefined;
36
+ //# sourceMappingURL=NodeResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NodeResolver.d.ts","sourceRoot":"","sources":["../../src/model/NodeResolver.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,SAAS,CAiB/F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,SAAS,MAAM,EAAE,GACrB;IAAE,MAAM,EAAE,QAAQ,GAAG,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAqB7D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAQhF;AAaD;;;GAGG;AACH,wBAAgB,SAAS,CACxB,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,GACjD,IAAI,CAIN;AAeD;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAO7E;AAYD;;GAEG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,GACZ;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,SAAS,CAMjD"}
@@ -0,0 +1,67 @@
1
+ import { NodeAttrsFor } from './AttrRegistry.js';
2
+ import { BlockNode } from './Document.js';
3
+ import { ParseRule } from './ParseRule.js';
4
+ import { SanitizeConfig } from './SanitizeConfig.js';
5
+ import { BlockId } from './TypeBrands.js';
6
+ export interface AttrSpec {
7
+ readonly default?: string | number | boolean;
8
+ }
9
+ /** Describes a wrapper element that groups consecutive blocks of the same kind. */
10
+ export interface WrapperSpec {
11
+ /** The HTML tag for the wrapper element (e.g., 'ul', 'ol'). */
12
+ readonly tag: string;
13
+ /** A key to group consecutive blocks. Blocks with the same key share a wrapper. */
14
+ readonly key: string;
15
+ /** Optional CSS class for the wrapper element. */
16
+ readonly className?: string;
17
+ /** Optional attributes for the wrapper element. */
18
+ readonly attrs?: Readonly<Record<string, string>>;
19
+ }
20
+ /** Describes which children a node type is allowed to contain. */
21
+ export interface ContentRule {
22
+ /** Allowed child types or group names. */
23
+ readonly allow: readonly string[];
24
+ readonly min?: number;
25
+ readonly max?: number;
26
+ }
27
+ /** Creates an HTMLElement with the required `data-block-id` attribute. */
28
+ export declare function createBlockElement(tag: string, blockId: BlockId): HTMLElement;
29
+ export interface NodeSpec<T extends string = string> {
30
+ readonly type: T;
31
+ /** Renders the block to a DOM element. Must set `data-block-id` on the root. */
32
+ toDOM(node: Omit<BlockNode, 'attrs'> & {
33
+ readonly attrs: NodeAttrsFor<T>;
34
+ }): HTMLElement;
35
+ readonly attrs?: Readonly<Record<string, AttrSpec>>;
36
+ /** If true, the node contains no editable text (e.g. Image, HR). */
37
+ readonly isVoid?: boolean;
38
+ /** Content model: which children this node can contain. */
39
+ readonly content?: ContentRule;
40
+ /** Group membership: 'block' | 'inline' | custom. */
41
+ readonly group?: string;
42
+ /** If true, selection cannot cross this node's boundary (e.g. table_cell). */
43
+ readonly isolating?: boolean;
44
+ /** If true, node can be selected as an object via mouse interaction. */
45
+ readonly selectable?: boolean;
46
+ /**
47
+ * Mark types that are incompatible with this block type.
48
+ * When a block is converted to this type, marks listed here
49
+ * are stripped from the block's inline content.
50
+ */
51
+ readonly excludeMarks?: readonly string[];
52
+ /** Serializes the block to an HTML string. `content` is the pre-serialized inline children. */
53
+ readonly toHTML?: (node: BlockNode, content: string) => string;
54
+ /** Rules for matching HTML elements to this block type during parsing. */
55
+ readonly parseHTML?: readonly ParseRule[];
56
+ /** Tags and attributes this spec needs through DOMPurify sanitization. */
57
+ readonly sanitize?: SanitizeConfig;
58
+ /**
59
+ * If provided, the Reconciler groups consecutive blocks with the same
60
+ * wrapper key into a shared wrapper element. Useful for semantic list
61
+ * wrappers (`<ul>`, `<ol>`) around `<li>` block elements.
62
+ */
63
+ wrapper?(node: Omit<BlockNode, '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AG,WAAW,CAAC;CAC5F"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * ParseRule: describes how an HTML element maps to a document node or mark.
3
+ * Used by plugins to declare their HTML parsing behavior.
4
+ */
5
+ export interface ParseRule {
6
+ readonly tag: string;
7
+ readonly getAttrs?: (el: HTMLElement) => Record<string, unknown> | false;
8
+ /** Higher priority rules are matched first. Default: 50. */
9
+ readonly priority?: number;
10
+ }
11
+ //# sourceMappingURL=ParseRule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParseRule.d.ts","sourceRoot":"","sources":["../../src/model/ParseRule.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;IACzE,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * SanitizeConfig: declares which HTML tags and attributes a spec needs
3
+ * to survive DOMPurify sanitization.
4
+ */
5
+ export interface SanitizeConfig {
6
+ readonly tags?: readonly string[];
7
+ readonly attrs?: readonly string[];
8
+ }
9
+ //# sourceMappingURL=SanitizeConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SanitizeConfig.d.ts","sourceRoot":"","sources":["../../src/model/SanitizeConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC"}
@@ -0,0 +1,17 @@
1
+ import { NodeSpec } from './NodeSpec.js';
2
+ import { SchemaRegistry } from './SchemaRegistry.js';
3
+ export interface Schema {
4
+ readonly nodeTypes: readonly string[];
5
+ readonly markTypes: readonly string[];
6
+ /** Looks up the full NodeSpec for a given type. Available when created via schemaFromRegistry. */
7
+ readonly getNodeSpec?: (type: string) => NodeSpec | undefined;
8
+ }
9
+ /** Creates the default schema with paragraph nodes and bold/italic/underline marks. */
10
+ export declare function defaultSchema(): Schema;
11
+ /** Derives a Schema from a SchemaRegistry's registered specs. */
12
+ export declare function schemaFromRegistry(registry: SchemaRegistry): Schema;
13
+ /** Checks whether the given mark type is allowed by the schema. */
14
+ export declare function isMarkAllowed(schema: Schema, markType: string): boolean;
15
+ /** Checks whether the given node type is allowed by the schema. */
16
+ export declare function isNodeTypeAllowed(schema: Schema, nodeType: string): boolean;
17
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/model/Schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,MAAM,WAAW,MAAM;IACtB,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,kGAAkG;IAClG,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;CAC9D;AAED,uFAAuF;AACvF,wBAAgB,aAAa,IAAI,MAAM,CAMtC;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAMnE;AAED,mEAAmE;AACnE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED,mEAAmE;AACnE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAE3E"}
@@ -0,0 +1,81 @@
1
+ import { InputRule } from '../input/InputRule.js';
2
+ import { Keymap } from '../input/Keymap.js';
3
+ import { BlockTypePickerEntry } from '../plugins/heading/BlockTypePickerEntry.js';
4
+ import { ToolbarItem } from '../plugins/toolbar/ToolbarItem.js';
5
+ import { NodeViewFactory } from '../view/NodeView.js';
6
+ import { InlineNodeSpec } from './InlineNodeSpec.js';
7
+ import { MarkSpec } from './MarkSpec.js';
8
+ import { NodeSpec } from './NodeSpec.js';
9
+ import { ParseRule } from './ParseRule.js';
10
+ /** Handler for files pasted or dropped into the editor. */
11
+ export type FileHandler = (files: readonly File[], position: import('./Selection.js').Position | null) => boolean | Promise<boolean>;
12
+ export interface FileHandlerEntry {
13
+ readonly pattern: string;
14
+ readonly handler: FileHandler;
15
+ }
16
+ export declare class SchemaRegistry {
17
+ private readonly _nodeSpecs;
18
+ private readonly _markSpecs;
19
+ private readonly _inlineNodeSpecs;
20
+ private readonly _nodeViews;
21
+ private readonly _keymaps;
22
+ private readonly _inputRules;
23
+ private readonly _toolbarItems;
24
+ private readonly _toolbarItemPluginMap;
25
+ private readonly _fileHandlers;
26
+ private readonly _blockTypePickerEntries;
27
+ registerNodeSpec<T extends string>(spec: NodeSpec<T>): void;
28
+ getNodeSpec(type: string): NodeSpec | undefined;
29
+ removeNodeSpec(type: string): void;
30
+ getNodeTypes(): string[];
31
+ registerMarkSpec<T extends string>(spec: MarkSpec<T>): void;
32
+ getMarkSpec(type: string): MarkSpec | undefined;
33
+ removeMarkSpec(type: string): void;
34
+ getMarkTypes(): string[];
35
+ registerInlineNodeSpec<T extends string>(spec: InlineNodeSpec<T>): void;
36
+ getInlineNodeSpec(type: string): InlineNodeSpec | undefined;
37
+ removeInlineNodeSpec(type: string): void;
38
+ getInlineNodeTypes(): string[];
39
+ registerNodeView(type: string, factory: NodeViewFactory): void;
40
+ getNodeViewFactory(type: string): NodeViewFactory | undefined;
41
+ removeNodeView(type: string): void;
42
+ registerKeymap(keymap: Keymap): void;
43
+ getKeymaps(): readonly Keymap[];
44
+ removeKeymap(keymap: Keymap): void;
45
+ registerInputRule(rule: InputRule): void;
46
+ getInputRules(): readonly InputRule[];
47
+ removeInputRule(rule: InputRule): void;
48
+ registerToolbarItem(item: ToolbarItem, pluginId?: string): void;
49
+ getToolbarItemsByPlugin(pluginId: string): ToolbarItem[];
50
+ getToolbarItem(id: string): ToolbarItem | undefined;
51
+ getToolbarItems(): ToolbarItem[];
52
+ removeToolbarItem(id: string): void;
53
+ registerFileHandler(pattern: string, handler: FileHandler): void;
54
+ getFileHandlers(): readonly FileHandlerEntry[];
55
+ matchFileHandlers(mimeType: string): FileHandler[];
56
+ removeFileHandler(handler: FileHandler): void;
57
+ registerBlockTypePickerEntry(entry: BlockTypePickerEntry): void;
58
+ getBlockTypePickerEntries(): readonly BlockTypePickerEntry[];
59
+ removeBlockTypePickerEntry(id: string): void;
60
+ /** Returns all NodeSpec parseHTML rules, sorted by priority descending. */
61
+ getBlockParseRules(): readonly {
62
+ readonly rule: ParseRule;
63
+ readonly type: string;
64
+ }[];
65
+ /** Returns all InlineNodeSpec parseHTML rules, sorted by priority descending. */
66
+ getInlineParseRules(): readonly {
67
+ readonly rule: ParseRule;
68
+ readonly type: string;
69
+ }[];
70
+ /** Returns all MarkSpec parseHTML rules, sorted by priority descending. */
71
+ getMarkParseRules(): readonly {
72
+ readonly rule: ParseRule;
73
+ readonly type: string;
74
+ }[];
75
+ /** Returns all allowed HTML tags from base defaults + all spec sanitize configs. */
76
+ getAllowedTags(): string[];
77
+ /** Returns all allowed HTML attributes from base defaults + all spec sanitize configs. */
78
+ getAllowedAttrs(): string[];
79
+ clear(): void;
80
+ }
81
+ //# sourceMappingURL=SchemaRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaRegistry.d.ts","sourceRoot":"","sources":["../../src/model/SchemaRegistry.ts"],"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,KAAK,IAAI,IAAI;CAYb"}
@@ -0,0 +1,52 @@
1
+ import { BlockId } from './TypeBrands.js';
2
+ export interface Position {
3
+ readonly blockId: BlockId;
4
+ readonly offset: number;
5
+ /** Path from root block to leaf block (optional, for nested structures). */
6
+ readonly path?: readonly BlockId[];
7
+ }
8
+ export interface Selection {
9
+ readonly anchor: Position;
10
+ readonly head: Position;
11
+ }
12
+ export interface SelectionRange {
13
+ readonly from: Position;
14
+ readonly to: Position;
15
+ }
16
+ /** A selection that selects an entire node (e.g. void blocks, table selection). */
17
+ export interface NodeSelection {
18
+ readonly type: 'node';
19
+ readonly nodeId: BlockId;
20
+ readonly path: readonly BlockId[];
21
+ }
22
+ /** Union type representing either a text selection or a node selection. */
23
+ export type EditorSelection = Selection | NodeSelection;
24
+ /** Creates a NodeSelection for the given block. */
25
+ export declare function createNodeSelection(nodeId: BlockId, path: readonly BlockId[]): NodeSelection;
26
+ /** Type guard: returns true if the selection is a NodeSelection. */
27
+ export declare function isNodeSelection(sel: EditorSelection): sel is NodeSelection;
28
+ /** Type guard: returns true if the selection is a text Selection. */
29
+ export declare function isTextSelection(sel: EditorSelection): sel is Selection;
30
+ /** Compares two EditorSelections for equality. */
31
+ export declare function selectionsEqual(a: EditorSelection, b: EditorSelection): boolean;
32
+ /** Creates a Position, optionally with a path. */
33
+ export declare function createPosition(blockId: BlockId, offset: number, path?: readonly BlockId[]): Position;
34
+ /** Creates a selection with distinct anchor and head. */
35
+ export declare function createSelection(anchor: Position, head: Position): Selection;
36
+ /** Creates a collapsed selection (cursor) at the given position. */
37
+ export declare function createCollapsedSelection(blockId: BlockId, offset: number): Selection;
38
+ /** Returns true if the selection is collapsed (cursor with no range). NodeSelection is never collapsed. */
39
+ export declare function isCollapsed(sel: EditorSelection): boolean;
40
+ /**
41
+ * Returns true if the selection direction is forward (anchor before head).
42
+ * When anchor and head are in the same block, compares offsets.
43
+ * Cross-block ordering uses document order (not determinable here — caller provides block order).
44
+ * For NodeSelection, always returns true.
45
+ */
46
+ export declare function isForward(sel: EditorSelection, blockOrder?: readonly BlockId[]): boolean;
47
+ /**
48
+ * Returns a normalized range where `from` is always before `to`.
49
+ * Throws for NodeSelection — use isNodeSelection() guard first.
50
+ */
51
+ export declare function selectionRange(sel: Selection, blockOrder?: readonly BlockId[]): SelectionRange;
52
+ //# sourceMappingURL=Selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Selection.d.ts","sourceRoot":"","sources":["../../src/model/Selection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,WAAW,QAAQ;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC;CACtB;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;CAClC;AAED,2EAA2E;AAC3E,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,aAAa,CAAC;AAExD,mDAAmD;AACnD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,aAAa,CAE5F;AAED,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,aAAa,CAE1E;AAED,qEAAqE;AACrE,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,GAAG,IAAI,SAAS,CAEtE;AAED,kDAAkD;AAClD,wBAAgB,eAAe,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,GAAG,OAAO,CAa/E;AAED,kDAAkD;AAClD,wBAAgB,cAAc,CAC7B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,GACvB,QAAQ,CAEV;AAED,yDAAyD;AACzD,wBAAgB,eAAe,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CAE3E;AAED,oEAAoE;AACpE,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAGpF;AAED,2GAA2G;AAC3G,wBAAgB,WAAW,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAGzD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAWxF;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,SAAS,OAAO,EAAE,GAAG,cAAc,CAK9F"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Branded (nominal) types for semantic string distinctions.
3
+ * Prevents accidental interchange of structurally identical IDs.
4
+ */
5
+ declare const __brand: unique symbol;
6
+ type Brand<T, B extends string> = T & {
7
+ readonly [__brand]: B;
8
+ };
9
+ /** Unique identifier for a block node in the document tree. */
10
+ export type BlockId = Brand<string, 'BlockId'>;
11
+ /** Semantic name for a node type (e.g. 'paragraph', 'heading'). */
12
+ export type NodeTypeName = Brand<string, 'NodeTypeName'>;
13
+ /** Semantic name for a mark type (e.g. 'bold', 'link'). */
14
+ export type MarkTypeName = Brand<string, 'MarkTypeName'>;
15
+ /** Unique identifier for a plugin. */
16
+ export type PluginId = Brand<string, 'PluginId'>;
17
+ /** Registered command name. */
18
+ export type CommandName = Brand<string, 'CommandName'>;
19
+ /** Semantic name for an inline node type (e.g. 'image', 'mention'). */
20
+ export type InlineTypeName = Brand<string, 'InlineTypeName'>;
21
+ export declare function blockId(id: string): BlockId;
22
+ export declare function nodeType(name: string): NodeTypeName;
23
+ export declare function markType(name: string): MarkTypeName;
24
+ export declare function pluginId(id: string): PluginId;
25
+ export declare function commandName(name: string): CommandName;
26
+ export declare function inlineType(name: string): InlineTypeName;
27
+ export {};
28
+ //# sourceMappingURL=TypeBrands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeBrands.d.ts","sourceRoot":"","sources":["../../src/model/TypeBrands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,MAAM,CAAC;AACrC,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;IAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAEhE,+DAA+D;AAC/D,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAE/C,mEAAmE;AACnE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAEzD,2DAA2D;AAC3D,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAEzD,sCAAsC;AACtC,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEjD,+BAA+B;AAC/B,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEvD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