@notectl/core 1.0.4 → 1.0.5

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 (312) hide show
  1. package/README.md +51 -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-D5VqeBPT.mjs +398 -0
  21. package/dist/chunks/ToolbarPlugin-D5VqeBPT.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-CPPb-Jah.mjs +569 -0
  27. package/dist/chunks/index-CPPb-Jah.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 +131 -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 +81 -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 +2576 -11104
  133. package/dist/notectl-core.mjs.map +1 -1
  134. package/dist/notectl-core.umd.js +6810 -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 +66 -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/CodeBlockNodeView.d.ts +5 -0
  155. package/dist/plugins/code-block/CodeBlockNodeView.d.ts.map +1 -0
  156. package/dist/plugins/code-block/CodeBlockPlugin.d.ts +135 -0
  157. package/dist/plugins/code-block/CodeBlockPlugin.d.ts.map +1 -0
  158. package/dist/plugins/code-block/index.d.ts +2 -0
  159. package/dist/plugins/code-block/index.d.ts.map +1 -0
  160. package/dist/plugins/code-block.mjs +6 -0
  161. package/dist/plugins/code-block.mjs.map +1 -0
  162. package/dist/plugins/font/FontPlugin.d.ts +85 -0
  163. package/dist/plugins/font/FontPlugin.d.ts.map +1 -0
  164. package/dist/plugins/font/StarterFonts.d.ts +10 -0
  165. package/dist/plugins/font/StarterFonts.d.ts.map +1 -0
  166. package/dist/plugins/font/index.d.ts +2 -0
  167. package/dist/plugins/font/index.d.ts.map +1 -0
  168. package/dist/plugins/font-size/FontSizePlugin.d.ts +65 -0
  169. package/dist/plugins/font-size/FontSizePlugin.d.ts.map +1 -0
  170. package/dist/plugins/font-size/index.d.ts +2 -0
  171. package/dist/plugins/font-size/index.d.ts.map +1 -0
  172. package/dist/plugins/font-size.mjs +220 -0
  173. package/dist/plugins/font-size.mjs.map +1 -0
  174. package/dist/plugins/font.mjs +186 -0
  175. package/dist/plugins/font.mjs.map +1 -0
  176. package/dist/plugins/hard-break/HardBreakPlugin.d.ts +16 -0
  177. package/dist/plugins/hard-break/HardBreakPlugin.d.ts.map +1 -0
  178. package/dist/plugins/hard-break/index.d.ts +2 -0
  179. package/dist/plugins/hard-break/index.d.ts.map +1 -0
  180. package/dist/plugins/hard-break.mjs +28 -0
  181. package/dist/plugins/hard-break.mjs.map +1 -0
  182. package/dist/plugins/heading/BlockTypePickerEntry.d.ts +20 -0
  183. package/dist/plugins/heading/BlockTypePickerEntry.d.ts.map +1 -0
  184. package/dist/plugins/heading/HeadingPlugin.d.ts +78 -0
  185. package/dist/plugins/heading/HeadingPlugin.d.ts.map +1 -0
  186. package/dist/plugins/heading/index.d.ts +3 -0
  187. package/dist/plugins/heading/index.d.ts.map +1 -0
  188. package/dist/plugins/heading.mjs +188 -0
  189. package/dist/plugins/heading.mjs.map +1 -0
  190. package/dist/plugins/highlight/HighlightPlugin.d.ts +37 -0
  191. package/dist/plugins/highlight/HighlightPlugin.d.ts.map +1 -0
  192. package/dist/plugins/highlight/index.d.ts +2 -0
  193. package/dist/plugins/highlight/index.d.ts.map +1 -0
  194. package/dist/plugins/highlight.mjs +126 -0
  195. package/dist/plugins/highlight.mjs.map +1 -0
  196. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts +29 -0
  197. package/dist/plugins/horizontal-rule/HorizontalRulePlugin.d.ts.map +1 -0
  198. package/dist/plugins/horizontal-rule/index.d.ts +2 -0
  199. package/dist/plugins/horizontal-rule/index.d.ts.map +1 -0
  200. package/dist/plugins/horizontal-rule.mjs +59 -0
  201. package/dist/plugins/horizontal-rule.mjs.map +1 -0
  202. package/dist/plugins/image/ImageCommands.d.ts +26 -0
  203. package/dist/plugins/image/ImageCommands.d.ts.map +1 -0
  204. package/dist/plugins/image/ImageNodeView.d.ts +6 -0
  205. package/dist/plugins/image/ImageNodeView.d.ts.map +1 -0
  206. package/dist/plugins/image/ImagePlugin.d.ts +43 -0
  207. package/dist/plugins/image/ImagePlugin.d.ts.map +1 -0
  208. package/dist/plugins/image/ImageUpload.d.ts +48 -0
  209. package/dist/plugins/image/ImageUpload.d.ts.map +1 -0
  210. package/dist/plugins/image/index.d.ts +3 -0
  211. package/dist/plugins/image/index.d.ts.map +1 -0
  212. package/dist/plugins/image.mjs +381 -0
  213. package/dist/plugins/image.mjs.map +1 -0
  214. package/dist/plugins/link/LinkPlugin.d.ts +32 -0
  215. package/dist/plugins/link/LinkPlugin.d.ts.map +1 -0
  216. package/dist/plugins/link/index.d.ts +2 -0
  217. package/dist/plugins/link/index.d.ts.map +1 -0
  218. package/dist/plugins/link.mjs +127 -0
  219. package/dist/plugins/link.mjs.map +1 -0
  220. package/dist/plugins/list/ListPlugin.d.ts +51 -0
  221. package/dist/plugins/list/ListPlugin.d.ts.map +1 -0
  222. package/dist/plugins/list/index.d.ts +2 -0
  223. package/dist/plugins/list/index.d.ts.map +1 -0
  224. package/dist/plugins/list.mjs +193 -0
  225. package/dist/plugins/list.mjs.map +1 -0
  226. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts +23 -0
  227. package/dist/plugins/strikethrough/StrikethroughPlugin.d.ts.map +1 -0
  228. package/dist/plugins/strikethrough/index.d.ts +2 -0
  229. package/dist/plugins/strikethrough/index.d.ts.map +1 -0
  230. package/dist/plugins/strikethrough.mjs +35 -0
  231. package/dist/plugins/strikethrough.mjs.map +1 -0
  232. package/dist/plugins/super-sub/SuperSubPlugin.d.ts +44 -0
  233. package/dist/plugins/super-sub/SuperSubPlugin.d.ts.map +1 -0
  234. package/dist/plugins/super-sub/index.d.ts +2 -0
  235. package/dist/plugins/super-sub/index.d.ts.map +1 -0
  236. package/dist/plugins/super-sub.mjs +81 -0
  237. package/dist/plugins/super-sub.mjs.map +1 -0
  238. package/dist/plugins/table/TableCommands.d.ts +50 -0
  239. package/dist/plugins/table/TableCommands.d.ts.map +1 -0
  240. package/dist/plugins/table/TableControls.d.ts +10 -0
  241. package/dist/plugins/table/TableControls.d.ts.map +1 -0
  242. package/dist/plugins/table/TableControlsDOM.d.ts +18 -0
  243. package/dist/plugins/table/TableControlsDOM.d.ts.map +1 -0
  244. package/dist/plugins/table/TableControlsLayout.d.ts +34 -0
  245. package/dist/plugins/table/TableControlsLayout.d.ts.map +1 -0
  246. package/dist/plugins/table/TableHelpers.d.ts +39 -0
  247. package/dist/plugins/table/TableHelpers.d.ts.map +1 -0
  248. package/dist/plugins/table/TableNavigation.d.ts +4 -0
  249. package/dist/plugins/table/TableNavigation.d.ts.map +1 -0
  250. package/dist/plugins/table/TableNodeViews.d.ts +18 -0
  251. package/dist/plugins/table/TableNodeViews.d.ts.map +1 -0
  252. package/dist/plugins/table/TablePlugin.d.ts +39 -0
  253. package/dist/plugins/table/TablePlugin.d.ts.map +1 -0
  254. package/dist/plugins/table/TableSelection.d.ts +26 -0
  255. package/dist/plugins/table/TableSelection.d.ts.map +1 -0
  256. package/dist/plugins/table/TableTestUtils.d.ts +45 -0
  257. package/dist/plugins/table/TableTestUtils.d.ts.map +1 -0
  258. package/dist/plugins/table/index.d.ts +4 -0
  259. package/dist/plugins/table/index.d.ts.map +1 -0
  260. package/dist/plugins/table.mjs +663 -0
  261. package/dist/plugins/table.mjs.map +1 -0
  262. package/dist/plugins/text-color/TextColorPlugin.d.ts +37 -0
  263. package/dist/plugins/text-color/TextColorPlugin.d.ts.map +1 -0
  264. package/dist/plugins/text-color/index.d.ts +2 -0
  265. package/dist/plugins/text-color/index.d.ts.map +1 -0
  266. package/dist/plugins/text-color.mjs +126 -0
  267. package/dist/plugins/text-color.mjs.map +1 -0
  268. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts +34 -0
  269. package/dist/plugins/text-formatting/TextFormattingPlugin.d.ts.map +1 -0
  270. package/dist/plugins/text-formatting/index.d.ts +2 -0
  271. package/dist/plugins/text-formatting/index.d.ts.map +1 -0
  272. package/dist/plugins/text-formatting.mjs +52 -0
  273. package/dist/plugins/text-formatting.mjs.map +1 -0
  274. package/dist/plugins/toolbar/ToolbarItem.d.ts +66 -0
  275. package/dist/plugins/toolbar/ToolbarItem.d.ts.map +1 -0
  276. package/dist/plugins/toolbar/ToolbarKeyboardNav.d.ts +25 -0
  277. package/dist/plugins/toolbar/ToolbarKeyboardNav.d.ts.map +1 -0
  278. package/dist/plugins/toolbar/ToolbarPlugin.d.ts +47 -0
  279. package/dist/plugins/toolbar/ToolbarPlugin.d.ts.map +1 -0
  280. package/dist/plugins/toolbar/ToolbarPopupController.d.ts +25 -0
  281. package/dist/plugins/toolbar/ToolbarPopupController.d.ts.map +1 -0
  282. package/dist/plugins/toolbar/ToolbarRenderers.d.ts +19 -0
  283. package/dist/plugins/toolbar/ToolbarRenderers.d.ts.map +1 -0
  284. package/dist/plugins/toolbar/ToolbarTooltip.d.ts +17 -0
  285. package/dist/plugins/toolbar/ToolbarTooltip.d.ts.map +1 -0
  286. package/dist/plugins/toolbar/index.d.ts +4 -0
  287. package/dist/plugins/toolbar/index.d.ts.map +1 -0
  288. package/dist/plugins/toolbar.mjs +8 -0
  289. package/dist/plugins/toolbar.mjs.map +1 -0
  290. package/dist/state/EditorState.d.ts +40 -0
  291. package/dist/state/EditorState.d.ts.map +1 -0
  292. package/dist/state/History.d.ts +38 -0
  293. package/dist/state/History.d.ts.map +1 -0
  294. package/dist/state/StepApplication.d.ts +5 -0
  295. package/dist/state/StepApplication.d.ts.map +1 -0
  296. package/dist/state/Transaction.d.ts +185 -0
  297. package/dist/state/Transaction.d.ts.map +1 -0
  298. package/dist/test/PluginTestUtils.d.ts +127 -0
  299. package/dist/test/PluginTestUtils.d.ts.map +1 -0
  300. package/dist/test/TestUtils.d.ts +153 -0
  301. package/dist/test/TestUtils.d.ts.map +1 -0
  302. package/dist/view/EditorView.d.ts +74 -0
  303. package/dist/view/EditorView.d.ts.map +1 -0
  304. package/dist/view/NodeView.d.ts +18 -0
  305. package/dist/view/NodeView.d.ts.map +1 -0
  306. package/dist/view/Reconciler.d.ts +23 -0
  307. package/dist/view/Reconciler.d.ts.map +1 -0
  308. package/dist/view/SelectionSync.d.ts +8 -0
  309. package/dist/view/SelectionSync.d.ts.map +1 -0
  310. package/package.json +112 -11
  311. package/dist/notectl-core.js +0 -1463
  312. package/dist/notectl-core.js.map +0 -1
package/README.md CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  # notectl
4
4
 
5
- ## **A framework-agnostic rich text editor as a Web Component ship only what you use.**
5
+ ### The rich text editor that gets out of your way.
6
6
 
7
- Built on immutable state, a transaction-based architecture, and a plugin system that powers every feature from bold text to full table editing.
7
+ A modular, accessible rich text editorshipped as a Web Component.
8
+ Use what you need, nothing more.
8
9
 
9
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
10
11
  [![Web Component](https://img.shields.io/badge/Web_Component-%3Cnotectl--editor%3E-purple)](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
@@ -15,42 +16,34 @@ Built on immutable state, a transaction-based architecture, and a plugin system
15
16
 
16
17
  <img src="docs-site/src/assets/screenshots/hero-editor-rich.png" alt="notectl editor with rich content" width="720" />
17
18
 
19
+ [Documentation](https://samyssmile.github.io/notectl/) &bull; [Playground](https://samyssmile.github.io/notectl/playground/) &bull; [npm](https://www.npmjs.com/package/@notectl/core)
20
+
18
21
  </div>
19
22
 
20
23
  <br />
21
24
 
22
- ## Why notectl?
25
+ **Try it live** — [Open the playground](https://samyssmile.github.io/notectl/playground/) (no install required)
23
26
 
24
- Most editors bolt formatting on top of `contenteditable` and hope for the best. notectl takes a different approach: every keystroke produces an immutable transaction, every feature is a plugin, and the DOM is a projection of state — never the source of truth.
27
+ <br />
28
+
29
+ ## Why notectl?
25
30
 
26
- - **Web Component** — drop `<notectl-editor>` into any framework or vanilla HTML
27
- - **Plugin architecture** — every feature (bold, tables, lists, ...) is a plugin; add only what you need
31
+ - **Web Component** — drop `<notectl-editor>` into React, Vue, Svelte, Angular, or plain HTML
32
+ - **Plugin architecture** — every feature is a plugin; add only what you need
33
+ - **Accessible by default** — full keyboard navigation, ARIA roles and labels, screen reader support
28
34
  - **Immutable state** — predictable updates, time-travel undo/redo, zero mutation bugs
29
- - **Transaction system** — atomic, invertible steps with middleware support
30
- - **Zero framework lock-in** — works with React, Vue, Svelte, Angular, or plain JS
31
- - **Native Angular integration** — available as [`@notectl/angular`](https://www.npmjs.com/package/@notectl/angular) for idiomatic Angular usage
32
- - **Tiny dependency footprint** — single runtime dependency (DOMPurify)
35
+ - **Native Angular integration** — available as [`@notectl/angular`](https://www.npmjs.com/package/@notectl/angular)
36
+ - **Lightweight** — bundle size of notectl core is 29kb
37
+ - **Single dependency** — only DOMPurify at runtime
33
38
 
34
39
  <br />
35
40
 
36
- ## Wanna try?
37
- Check out the [live playground](https://samyssmile.github.io/notectl/playground/) — no install required.
38
-
39
- ## Wanna see full working example?
40
- `examples/vanillajs/` is a great place to see everything in action.
41
- `examples/angular/` shows how to use notectl in Angular with the `@notectl/angular` package.
42
-
43
41
  ## Quick Start
44
42
 
45
-
46
- ### Install
47
-
48
43
  ```bash
49
44
  npm install @notectl/core
50
45
  ```
51
46
 
52
- ### Use
53
-
54
47
  ```ts
55
48
  import {
56
49
  createEditor,
@@ -77,17 +70,30 @@ const editor = await createEditor({
77
70
  document.body.appendChild(editor);
78
71
  ```
79
72
 
80
- That's it. A full-featured editor in 16 lines. `ThemePreset.Light` and `ThemePreset.Dark` are available out of the box.
73
+ A full-featured editor in 16 lines.
74
+
75
+ <br />
76
+
77
+ ## Accessibility
78
+
79
+ notectl is built with accessibility as a first-class concern, not an afterthought.
80
+
81
+ - Full **keyboard navigation** — every feature reachable without a mouse
82
+ - Semantic **ARIA roles and labels** on all interactive elements
83
+ - Proper **focus management** across toolbar, dialogs, and editor content
84
+ - **Screen reader** friendly — announces formatting changes and editor state
85
+ - **High-contrast** compatible with `ThemePreset.Light` and `ThemePreset.Dark`
81
86
 
82
87
  <br />
83
88
 
84
89
  ## Plugins
85
90
 
86
91
  Every capability is a plugin. Compose exactly the editor you need.
92
+ See the [plugin documentation](https://samyssmile.github.io/notectl/) for configuration details and examples.
87
93
 
88
94
  | Plugin | What it does |
89
95
  |---|---|
90
- | **TextFormattingPlugin** | Bold, italic, underline — individually toggleable |
96
+ | **TextFormattingPlugin** | Bold, italic, underline |
91
97
  | **StrikethroughPlugin** | ~~Strikethrough~~ text |
92
98
  | **HeadingPlugin** | H1 – H6 headings |
93
99
  | **BlockquotePlugin** | Block quotes |
@@ -95,158 +101,55 @@ Every capability is a plugin. Compose exactly the editor you need.
95
101
  | **LinkPlugin** | Hyperlink insertion and editing |
96
102
  | **TablePlugin** | Full table support with row/column controls |
97
103
  | **TextColorPlugin** | Text color picker |
104
+ | **HighlightPlugin** | Text highlighting / background color |
98
105
  | **AlignmentPlugin** | Left, center, right, justify |
99
- | **FontPlugin** | Font family selection with custom font support |
106
+ | **FontPlugin** | Font family selection with custom fonts |
100
107
  | **FontSizePlugin** | Configurable font sizes |
101
108
  | **HorizontalRulePlugin** | Horizontal dividers |
102
109
  | **SuperSubPlugin** | Superscript and subscript |
103
- | **HighlightPlugin** | Text highlighting / background color |
104
- | **ToolbarPlugin** | Visual toolbar with grouped items |
105
-
106
- ### Tables
107
-
108
- Full table editing — add/remove rows and columns, navigate with Tab, resize, and select.
109
-
110
- <div align="center">
111
- <img src="docs-site/src/assets/screenshots/editor-table-showcase.png" alt="Table editing in notectl" width="720" />
112
- </div>
113
110
 
114
111
  <br />
115
112
 
116
- ## Content API
117
-
118
- Read and write content in multiple formats:
119
-
120
- ```ts
121
- // JSON (immutable Document)
122
- const doc = editor.getJSON();
123
- editor.setJSON(doc);
124
-
125
- // HTML (sanitized via DOMPurify)
126
- const html = editor.getHTML();
127
- editor.setHTML('<p>Hello <strong>world</strong></p>');
128
-
129
- // Plain text
130
- const text = editor.getText();
131
-
132
- // State
133
- editor.isEmpty(); // true | false
134
- ```
135
-
136
- ## Command API
113
+ ## Full Working Examples
137
114
 
138
- ```ts
139
- editor.commands.toggleBold();
140
- editor.commands.toggleItalic();
141
- editor.commands.toggleUnderline();
142
- editor.commands.undo();
143
- editor.commands.redo();
144
- editor.commands.selectAll();
145
- ```
115
+ See notectl in action with every plugin, custom fonts, and the complete API:
146
116
 
147
- ## Events
117
+ - [`examples/vanillajs`](examples/vanillajs) — Vanilla JavaScript
118
+ - [`examples/angular`](examples/angular) — Angular with `@notectl/angular`
148
119
 
149
- ```ts
150
- editor.on('stateChange', ({ oldState, newState, transaction }) => { /* ... */ });
151
- editor.on('selectionChange', ({ selection }) => { /* ... */ });
152
- editor.on('ready', () => { /* ... */ });
153
- editor.on('focus', () => { /* ... */ });
154
- editor.on('blur', () => { /* ... */ });
155
- ```
156
-
157
- <br />
158
-
159
- ## Custom Fonts
160
-
161
- Bring your own fonts — notectl handles `@font-face` injection automatically.
162
-
163
- ```ts
164
- import { FontPlugin, STARTER_FONTS } from '@notectl/core';
165
-
166
- const Inter = {
167
- name: 'Inter',
168
- family: "'Inter', sans-serif",
169
- category: 'sans-serif',
170
- fontFaces: [
171
- {
172
- src: "url('/fonts/Inter-Variable.ttf') format('truetype')",
173
- weight: '100 900',
174
- style: 'normal',
175
- },
176
- ],
177
- };
178
-
179
- new FontPlugin({ fonts: [...STARTER_FONTS, Inter] });
120
+ ```bash
121
+ git clone https://github.com/Samyssmile/notectl.git
122
+ cd notectl && pnpm install && pnpm dev
180
123
  ```
181
124
 
182
125
  <br />
183
126
 
184
- ## Toolbar Configuration
185
-
186
- Group plugins into toolbar sections for a clean UI:
127
+ ## Content API
187
128
 
188
129
  ```ts
189
- const editor = await createEditor({
190
- toolbar: [
191
- [new FontPlugin(), new FontSizePlugin()],
192
- [new TextFormattingPlugin(), new StrikethroughPlugin(), new TextColorPlugin()],
193
- [new HeadingPlugin(), new BlockquotePlugin()],
194
- [new AlignmentPlugin()],
195
- [new ListPlugin()],
196
- [new LinkPlugin(), new TablePlugin(), new HorizontalRulePlugin()],
197
- ],
198
- });
199
- ```
200
-
201
- Each inner array becomes a visually separated group in the toolbar.
202
-
203
- <br />
204
-
205
- ## Examples
206
-
207
- Check out the full working example in [`examples/vanillajs`](examples/vanillajs) — it demonstrates every plugin, custom font loading, toolbar grouping, and the complete content API.
208
-
209
- ```bash
210
- git clone https://github.com/Samyssmile/notectl.git
211
- cd notectl
212
- pnpm install
213
- pnpm dev
130
+ editor.getHTML(); // read HTML
131
+ editor.setHTML('<p>Hello <strong>world</strong></p>'); // write HTML
132
+ editor.getJSON(); // read JSON
133
+ editor.getText(); // read plain text
134
+ editor.isEmpty(); // check if empty
214
135
  ```
215
136
 
216
137
  <br />
217
138
 
218
- ## Architecture
139
+ ## Documentation
219
140
 
220
- ```
221
- Input Event → InputHandler / KeyboardHandler
222
- → Transaction with atomic Steps
223
- → Middleware chain (priority-ordered)
224
- → EditorState.apply(tr) → new immutable EditorState
225
- → Reconciler patches DOM (block-level diffing)
226
- → Plugins notified via onStateChange()
227
- ```
228
-
229
- | Layer | Responsibility |
230
- |---|---|
231
- | `model/` | Immutable data — Document, BlockNode, TextNode, Mark, Selection |
232
- | `state/` | EditorState, Transaction, StepApplication, History |
233
- | `view/` | DOM rendering, Reconciler, SelectionSync |
234
- | `input/` | Keyboard/input handling, paste, input rules |
235
- | `commands/` | High-level operations (toggleMark, splitBlock, ...) |
236
- | `plugins/` | All features — every capability is a plugin |
237
- | `editor/` | `<notectl-editor>` Web Component public API |
141
+ Full guides, API reference, and plugin docs are available at **[samyssmile.github.io/notectl](https://samyssmile.github.io/notectl/)**.
238
142
 
239
143
  <br />
240
144
 
241
- ## Development
145
+ ## Contributing
242
146
 
243
147
  ```bash
244
148
  pnpm install # install dependencies
245
149
  pnpm build # build all packages
246
- pnpm test # run unit tests (vitest + happy-dom)
247
- pnpm test:e2e # run e2e tests (playwright)
248
- pnpm lint # lint (biome)
249
- pnpm typecheck # type check
150
+ pnpm test # run unit tests
151
+ pnpm test:e2e # run e2e tests
152
+ pnpm lint # lint
250
153
  ```
251
154
 
252
155
  <br />
@@ -0,0 +1,16 @@
1
+ import { i as n } from "./Document-CI3iCwEP.mjs";
2
+ function t(n2, t2) {
3
+ return n2.type === t2;
4
+ }
5
+ function e(n2, t2) {
6
+ return n2.type === t2;
7
+ }
8
+ function r(t2, e2) {
9
+ return n(t2) && t2.inlineType === e2;
10
+ }
11
+ export {
12
+ r as a,
13
+ e as b,
14
+ t as i
15
+ };
16
+ //# sourceMappingURL=AttrRegistry-DTsHyDVA.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AttrRegistry-DTsHyDVA.mjs","sources":["../../src/model/AttrRegistry.ts"],"sourcesContent":["/**\n * Module-augmentable attribute registries for type-safe node/mark attributes.\n *\n * Plugins extend these interfaces via `declare module`:\n * @example\n * declare module '../../model/AttrRegistry.js' {\n * interface NodeAttrRegistry {\n * heading: { level: HeadingLevel; align?: BlockAlignment };\n * }\n * }\n */\n\nimport type { BlockAlignment } from '../plugins/alignment/AlignmentPlugin.js';\nimport type { BlockNode, InlineNode, Mark } from './Document.js';\nimport { isInlineNode } from './Document.js';\n\n/** Plugins augment this interface to register typed node attributes. */\nexport interface NodeAttrRegistry {\n\tparagraph: { align?: BlockAlignment };\n}\n\n/** Plugins augment this interface to register typed mark attributes. */\nexport interface MarkAttrRegistry {\n\tbold: Record<string, never>;\n\titalic: Record<string, never>;\n\tunderline: Record<string, never>;\n}\n\n/** Resolves typed attributes for known node types, falls back for unknown. */\nexport type NodeAttrsFor<T extends string> = T extends keyof NodeAttrRegistry\n\t? NodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Resolves typed attributes for known mark types, falls back for unknown. */\nexport type MarkAttrsFor<T extends string> = T extends keyof MarkAttrRegistry\n\t? MarkAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows a BlockNode to a typed variant with known attributes. */\nexport function isNodeOfType<T extends keyof NodeAttrRegistry>(\n\tnode: BlockNode,\n\ttype: T,\n): node is BlockNode & { readonly type: T; readonly attrs: NodeAttrRegistry[T] } {\n\treturn (node.type as string) === type;\n}\n\n/** Narrows a Mark to a typed variant with known attributes. */\nexport function isMarkOfType<T extends keyof MarkAttrRegistry>(\n\tmark: Mark,\n\ttype: T,\n): mark is Mark & { readonly type: T; readonly attrs: MarkAttrRegistry[T] } {\n\treturn (mark.type as string) === type;\n}\n\n// --- InlineNode Attribute Registry ---\n\n/** Plugins augment this interface to register typed inline node attributes. */\n// biome-ignore lint/suspicious/noEmptyInterface: module augmentation requires interface\nexport interface InlineNodeAttrRegistry {}\n\n/** Resolves typed attributes for known inline node types, falls back for unknown. */\nexport type InlineNodeAttrsFor<T extends string> = T extends keyof InlineNodeAttrRegistry\n\t? InlineNodeAttrRegistry[T]\n\t: Record<string, string | number | boolean>;\n\n/** Narrows an InlineNode to a typed variant with known attributes. */\nexport function isInlineNodeOfType<T extends keyof InlineNodeAttrRegistry>(\n\tnode: InlineNode,\n\tinlineNodeType: T,\n): node is InlineNode & {\n\treadonly inlineType: T;\n\treadonly attrs: InlineNodeAttrRegistry[T];\n} {\n\treturn isInlineNode(node) && (node.inlineType as string) === inlineNodeType;\n}\n"],"names":["isNodeOfType","node","type","isMarkOfType","mark","isInlineNodeOfType","inlineNodeType","isInlineNode","inlineType"],"mappings":";AAuCO,SAASA,EACfC,IACAC,IAAAA;AAEA,SAAQD,GAAKC,SAAoBA;AAClC;AAGO,SAASC,EACfC,IACAF,IAAAA;AAEA,SAAQE,GAAKF,SAAoBA;AAClC;AAcO,SAASG,EACfJ,IACAK,IAAAA;AAKA,SAAOC,EAAaN,EAAAA,KAAUA,GAAKO,eAA0BF;AAC9D;"}