@notectl/core 1.0.3 → 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
@@ -0,0 +1,663 @@
1
+ import { i as t, c as e, b as n, a as o } from "../chunks/Selection-D5ZjXoB7.mjs";
2
+ import { u as r, b as i, c as l, d as s, g as a } from "../chunks/Document-CI3iCwEP.mjs";
3
+ import { n as c } from "../chunks/TypeBrands-C09nE2qO.mjs";
4
+ import { S as d } from "../chunks/Plugin-B9OZ6Y4c.mjs";
5
+ function u() {
6
+ const t2 = l(c("paragraph"), [s("")], i());
7
+ return l(c("table_cell"), [t2], i());
8
+ }
9
+ function b(t2, e2) {
10
+ const n2 = t2.getNodePath(e2);
11
+ if (!n2) return null;
12
+ let o2 = null, i2 = null, l2 = null, s2 = null;
13
+ for (const e3 of n2) {
14
+ const n3 = t2.getBlock(e3);
15
+ n3 && ("table" === n3.type ? (o2 = e3, i2 = n3) : "table_row" === n3.type ? l2 = e3 : "table_cell" === n3.type && (s2 = e3));
16
+ }
17
+ const a2 = t2.getBlock(e2);
18
+ if ("table_cell" === a2?.type && (s2 = e2), !(o2 && i2 && s2 && l2)) return null;
19
+ const c2 = t2.doc.children.findIndex((t3) => t3.id === o2), d2 = r(i2), u2 = d2.findIndex((t3) => t3.id === l2);
20
+ if (-1 === u2) return null;
21
+ const b2 = d2[u2];
22
+ if (!b2) return null;
23
+ const h2 = r(b2), p2 = h2.findIndex((t3) => t3.id === s2);
24
+ if (-1 === p2) return null;
25
+ const f2 = h2.length, m2 = d2.length;
26
+ return { tableId: o2, tableIndex: c2, rowId: l2, rowIndex: u2, cellId: s2, colIndex: p2, totalRows: m2, totalCols: f2 };
27
+ }
28
+ function h(t2, e2, n2, o2) {
29
+ const i2 = t2.getBlock(e2);
30
+ if (!i2) return null;
31
+ const l2 = r(i2)[n2];
32
+ if (!l2) return null;
33
+ const s2 = r(l2)[o2];
34
+ return s2?.id ?? null;
35
+ }
36
+ function p(t2, e2) {
37
+ const n2 = t2.getBlock(e2);
38
+ if (!n2) return e2;
39
+ const o2 = r(n2)[0];
40
+ if (!o2) return e2;
41
+ let i2 = o2;
42
+ for (; ; ) {
43
+ const t3 = r(i2)[0];
44
+ if (!t3) return i2.id;
45
+ i2 = t3;
46
+ }
47
+ }
48
+ function f(t2, e2) {
49
+ const n2 = t2.getBlock(e2);
50
+ if (!n2) return e2;
51
+ const o2 = r(n2), i2 = o2[o2.length - 1];
52
+ if (!i2) return e2;
53
+ let l2 = i2;
54
+ for (; ; ) {
55
+ const t3 = r(l2), e3 = t3[t3.length - 1];
56
+ if (!e3) return l2.id;
57
+ l2 = e3;
58
+ }
59
+ }
60
+ function m(t2, e2) {
61
+ const n2 = t2.getNodePath(e2);
62
+ if (!n2) return false;
63
+ for (const e3 of n2) {
64
+ const n3 = t2.getBlock(e3);
65
+ if ("table" === n3?.type) return true;
66
+ }
67
+ return false;
68
+ }
69
+ function g(t2, n2, o2) {
70
+ const s2 = t2.getBlock(n2);
71
+ if (!s2) return null;
72
+ const a2 = r(s2), d2 = a2[0] ? r(a2[0]).length : 0;
73
+ if (0 === d2) return null;
74
+ const b2 = (function(t3) {
75
+ const e2 = [];
76
+ for (let n3 = 0; n3 < t3; n3++) e2.push(u());
77
+ return l(c("table_row"), e2, i());
78
+ })(d2), h2 = t2.transaction("command").insertNode([n2], o2, b2), p2 = r(b2)[0], f2 = p2 ? r(p2)[0] : void 0;
79
+ return f2 ? h2.setSelection(e(f2.id, 0)) : p2 && h2.setSelection(e(p2.id, 0)), h2.build();
80
+ }
81
+ function v(t2, e2, n2) {
82
+ const o2 = t2.getBlock(e2);
83
+ if (!o2) return null;
84
+ const i2 = r(o2), l2 = t2.transaction("command");
85
+ for (const t3 of i2) {
86
+ const o3 = u();
87
+ l2.insertNode([e2, t3.id], n2, o3);
88
+ }
89
+ return l2.setSelection(t2.selection), l2.build();
90
+ }
91
+ function w(t2, n2, o2, i2 = 0) {
92
+ const l2 = t2.getBlock(n2);
93
+ if (!l2) return null;
94
+ if (r(l2).length <= 1) return I(t2, n2);
95
+ const s2 = t2.transaction("command").removeNode([n2], o2), a2 = h(t2, n2, o2 > 0 ? o2 - 1 : 1, i2);
96
+ if (a2) {
97
+ const n3 = p(t2, a2);
98
+ s2.setSelection(e(n3, 0));
99
+ }
100
+ return s2.build();
101
+ }
102
+ function x(t2, n2, o2, i2 = 0) {
103
+ const l2 = t2.getBlock(n2);
104
+ if (!l2) return null;
105
+ const s2 = r(l2);
106
+ if ((s2[0] ? r(s2[0]).length : 0) <= 1) return I(t2, n2);
107
+ const a2 = t2.transaction("command");
108
+ for (let t3 = s2.length - 1; t3 >= 0; t3--) {
109
+ const e2 = s2[t3];
110
+ e2 && a2.removeNode([n2, e2.id], o2);
111
+ }
112
+ const c2 = h(t2, n2, i2, o2 > 0 ? o2 - 1 : 1);
113
+ if (c2) {
114
+ const n3 = p(t2, c2);
115
+ a2.setSelection(e(n3, 0));
116
+ }
117
+ return a2.build();
118
+ }
119
+ function I(t2, n2) {
120
+ const o2 = t2.doc.children.findIndex((t3) => t3.id === n2);
121
+ if (-1 === o2) return null;
122
+ const r2 = t2.transaction("command").removeNode([], o2), i2 = t2.doc.children[o2 + 1];
123
+ if (i2) return r2.setSelection(e(i2.id, 0)), r2.build();
124
+ const l2 = t2.doc.children[o2 - 1];
125
+ return l2 && r2.setSelection(e(l2.id, 0)), r2.build();
126
+ }
127
+ function y(n2, o2, s2) {
128
+ const a2 = n2.getState(), d2 = a2.selection;
129
+ if (t(d2)) return false;
130
+ const b2 = d2.anchor.blockId;
131
+ let h2 = -1;
132
+ for (let t2 = 0; t2 < a2.doc.children.length; t2++) {
133
+ const e2 = a2.doc.children[t2];
134
+ if (!e2) continue;
135
+ if (e2.id === b2) {
136
+ h2 = t2;
137
+ break;
138
+ }
139
+ const n3 = a2.getNodePath(b2);
140
+ if (n3 && n3[0] === e2.id) {
141
+ h2 = t2;
142
+ break;
143
+ }
144
+ }
145
+ -1 === h2 && (h2 = a2.doc.children.length - 1);
146
+ const p2 = (function(t2, e2) {
147
+ const n3 = i(), o3 = [];
148
+ for (let n4 = 0; n4 < t2; n4++) {
149
+ const t3 = [];
150
+ for (let n5 = 0; n5 < e2; n5++) t3.push(u());
151
+ o3.push(l(c("table_row"), t3, i()));
152
+ }
153
+ return l(c("table"), o3, n3);
154
+ })(o2, s2), f2 = l(c("paragraph")), m2 = h2 + 1, g2 = a2.transaction("command").insertNode([], m2, p2).insertNode([], m2 + 1, f2), v2 = r(p2)[0], w2 = v2 ? r(v2)[0] : void 0, x2 = w2 ? r(w2)[0] : void 0;
155
+ return x2 ? g2.setSelection(e(x2.id, 0)) : w2 && g2.setSelection(e(w2.id, 0)), n2.dispatch(g2.build()), true;
156
+ }
157
+ function k(e2) {
158
+ const n2 = e2.getState();
159
+ if (t(n2.selection)) return false;
160
+ const o2 = b(n2, n2.selection.anchor.blockId);
161
+ if (!o2) return false;
162
+ const r2 = g(n2, o2.tableId, o2.rowIndex + 1);
163
+ return !!r2 && (e2.dispatch(r2), true);
164
+ }
165
+ function S(e2, n2) {
166
+ const o2 = e2.getState();
167
+ if (t(o2.selection)) return false;
168
+ const r2 = b(o2, o2.selection.anchor.blockId);
169
+ if (!r2) return false;
170
+ const i2 = "left" === n2 ? r2.colIndex : r2.colIndex + 1, l2 = v(o2, r2.tableId, i2);
171
+ return !!l2 && (e2.dispatch(l2), true);
172
+ }
173
+ function C(e2) {
174
+ e2.registerCommand("insertTable", () => y(e2, 3, 3)), e2.registerCommand("addRowAbove", () => (function(e3) {
175
+ const n2 = e3.getState();
176
+ if (t(n2.selection)) return false;
177
+ const o2 = b(n2, n2.selection.anchor.blockId);
178
+ if (!o2) return false;
179
+ const r2 = g(n2, o2.tableId, o2.rowIndex);
180
+ return !!r2 && (e3.dispatch(r2), true);
181
+ })(e2)), e2.registerCommand("addRowBelow", () => k(e2)), e2.registerCommand("addColumnLeft", () => (function(t2) {
182
+ return S(t2, "left");
183
+ })(e2)), e2.registerCommand("addColumnRight", () => (function(t2) {
184
+ return S(t2, "right");
185
+ })(e2)), e2.registerCommand("deleteRow", () => (function(e3) {
186
+ const n2 = e3.getState();
187
+ if (t(n2.selection)) return false;
188
+ const o2 = b(n2, n2.selection.anchor.blockId);
189
+ if (!o2) return false;
190
+ const r2 = w(n2, o2.tableId, o2.rowIndex, o2.colIndex);
191
+ return !!r2 && (e3.dispatch(r2), true);
192
+ })(e2)), e2.registerCommand("deleteColumn", () => (function(e3) {
193
+ const n2 = e3.getState();
194
+ if (t(n2.selection)) return false;
195
+ const o2 = b(n2, n2.selection.anchor.blockId);
196
+ if (!o2) return false;
197
+ const r2 = x(n2, o2.tableId, o2.colIndex, o2.rowIndex);
198
+ return !!r2 && (e3.dispatch(r2), true);
199
+ })(e2)), e2.registerCommand("selectTable", () => (function(e3) {
200
+ const o2 = e3.getState(), r2 = o2.selection;
201
+ if (t(r2)) {
202
+ const t2 = o2.getBlock(r2.nodeId);
203
+ return "table" === t2?.type;
204
+ }
205
+ const i2 = b(o2, r2.anchor.blockId);
206
+ if (!i2) return false;
207
+ const l2 = o2.getNodePath(i2.tableId);
208
+ if (!l2) return false;
209
+ const s2 = o2.transaction("command").setSelection(n(i2.tableId, l2)).build();
210
+ return e3.dispatch(s2), true;
211
+ })(e2)), e2.registerCommand("deleteTable", () => (function(e3) {
212
+ const n2 = e3.getState(), o2 = (function(e4) {
213
+ if (t(e4.selection)) {
214
+ const t2 = e4.getBlock(e4.selection.nodeId);
215
+ return "table" !== t2?.type ? null : { tableId: t2.id };
216
+ }
217
+ const n3 = b(e4, e4.selection.anchor.blockId);
218
+ return n3 ? { tableId: n3.tableId } : null;
219
+ })(n2);
220
+ if (!o2) return false;
221
+ const r2 = I(n2, o2.tableId);
222
+ return !!r2 && (e3.dispatch(r2), true);
223
+ })(e2));
224
+ }
225
+ function L(e2, n2) {
226
+ const o2 = e2.getState();
227
+ if (t(o2.selection)) return false;
228
+ const r2 = o2.selection, i2 = b(o2, r2.anchor.blockId);
229
+ return !!i2 && n2(o2, r2, i2);
230
+ }
231
+ function R(t2) {
232
+ return L(t2, (n2, o2, r2) => {
233
+ const i2 = r2.tableIndex + 1;
234
+ if (i2 >= n2.doc.children.length) return false;
235
+ const l2 = n2.doc.children[i2];
236
+ if (!l2) return false;
237
+ const s2 = n2.transaction("command").setSelection(e(l2.id, 0)).build();
238
+ return t2.dispatch(s2), true;
239
+ });
240
+ }
241
+ function E(t2, n2, o2, r2) {
242
+ const i2 = t2.getState(), l2 = h(i2, n2, o2, r2);
243
+ if (!l2) return false;
244
+ const s2 = p(i2, l2), a2 = i2.transaction("command").setSelection(e(s2, 0)).build();
245
+ return t2.dispatch(a2), true;
246
+ }
247
+ function A(t2, n2, o2, r2) {
248
+ const i2 = t2.getState(), l2 = h(i2, n2, o2, r2);
249
+ if (!l2) return false;
250
+ const s2 = f(i2, l2), c2 = i2.getBlock(s2);
251
+ if (!c2) return false;
252
+ const d2 = a(c2), u2 = i2.transaction("command").setSelection(e(s2, d2)).build();
253
+ return t2.dispatch(u2), true;
254
+ }
255
+ function B(t2, e2) {
256
+ const o2 = t2.getState(), r2 = o2.getNodePath(e2);
257
+ if (!r2) return false;
258
+ const i2 = o2.transaction("input").setSelection(n(e2, r2)).build();
259
+ return t2.dispatch(i2), true;
260
+ }
261
+ const T = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M6 1v10M1 6h10" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>';
262
+ function N(t2, e2, n2) {
263
+ const o2 = document.createElement("button");
264
+ return o2.className = t2, o2.innerHTML = e2, o2.title = n2, o2.type = "button", o2.setAttribute("aria-label", n2), o2.setAttribute("contenteditable", "false"), o2.addEventListener("mousedown", (t3) => {
265
+ t3.preventDefault(), t3.stopPropagation();
266
+ }), o2;
267
+ }
268
+ function M(t2) {
269
+ const e2 = document.createElement("div");
270
+ e2.className = `ntbl-insert-line ntbl-insert-line--${t2}`, e2.setAttribute("contenteditable", "false");
271
+ const n2 = N("ntbl-insert-btn", T, "horizontal" === t2 ? "Insert row" : "Insert column");
272
+ return e2.appendChild(n2), e2;
273
+ }
274
+ function H(t2, e2) {
275
+ const n2 = document.createElement("button");
276
+ n2.className = `ntbl-add-zone ${t2}`, n2.type = "button", n2.setAttribute("contenteditable", "false"), n2.setAttribute("aria-label", e2), n2.title = e2;
277
+ const o2 = document.createElement("span");
278
+ return o2.className = "ntbl-add-icon", o2.innerHTML = T, n2.appendChild(o2), n2.addEventListener("mousedown", (t3) => {
279
+ t3.preventDefault(), t3.stopPropagation();
280
+ }), n2;
281
+ }
282
+ function z(t2) {
283
+ const e2 = document.createElement("div");
284
+ return e2.className = t2, e2.setAttribute("contenteditable", "false"), e2;
285
+ }
286
+ function V(t2, e2, n2, o2) {
287
+ const r2 = document.createElement("div");
288
+ r2.className = `ntbl-handle ${t2}`, r2.dataset.index = String(e2);
289
+ const i2 = N("ntbl-handle-delete", '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none"><path d="M2 2l6 6M8 2l-6 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>', n2);
290
+ return i2.addEventListener("click", (t3) => {
291
+ t3.preventDefault(), t3.stopPropagation(), o2(e2);
292
+ }), r2.appendChild(i2), r2;
293
+ }
294
+ function $(t2, e2) {
295
+ let n2 = 0, o2 = 0, r2 = t2;
296
+ for (; r2 && r2 !== e2; ) n2 += r2.offsetTop, o2 += r2.offsetLeft, r2 = r2.offsetParent;
297
+ return { top: n2, left: o2 };
298
+ }
299
+ class _ {
300
+ tableId;
301
+ numRows;
302
+ numCols;
303
+ activeRowIndex = -1;
304
+ activeColIndex = -1;
305
+ colBar;
306
+ rowBar;
307
+ insertLineH;
308
+ insertLineV;
309
+ addRowZone;
310
+ addColZone;
311
+ deleteTableBtn;
312
+ observer;
313
+ container;
314
+ tableEl;
315
+ getState;
316
+ dispatchFn;
317
+ onMouseMove = (t2) => {
318
+ const e2 = this.tableEl.getBoundingClientRect(), n2 = t2.clientX - e2.left, o2 = t2.clientY - e2.top;
319
+ if (!(n2 >= -10 && n2 <= e2.width + 10 && o2 >= -10 && o2 <= e2.height + 10)) return void this.hideInsertLines();
320
+ const r2 = (function(t3, e3, n3, o3) {
321
+ let r3 = Number.POSITIVE_INFINITY, i2 = null;
322
+ for (const t4 of n3) {
323
+ const n4 = Math.abs(e3 - t4.position);
324
+ n4 < r3 && n4 < 10 && (r3 = n4, i2 = t4);
325
+ }
326
+ let l2 = Number.POSITIVE_INFINITY, s2 = null;
327
+ for (const e4 of o3) {
328
+ const n4 = Math.abs(t3 - e4.position);
329
+ n4 < l2 && n4 < 10 && (l2 = n4, s2 = e4);
330
+ }
331
+ return i2 && (!s2 || r3 <= l2) ? { type: "row", border: i2 } : s2 ? { type: "col", border: s2 } : { type: "none", border: null };
332
+ })(n2, o2, (function(t3) {
333
+ const e3 = t3.querySelectorAll(":scope > tbody > tr"), n3 = t3.offsetTop, o3 = [];
334
+ for (let t4 = 1; t4 < e3.length; t4++) {
335
+ const r3 = e3[t4];
336
+ r3 && o3.push({ position: r3.offsetTop - n3, index: t4 });
337
+ }
338
+ return o3;
339
+ })(this.tableEl), (function(t3, e3) {
340
+ if (e3 <= 1) return [];
341
+ const n3 = t3 / e3, o3 = [];
342
+ for (let t4 = 1; t4 < e3; t4++) o3.push({ position: Math.round(n3 * t4), index: t4 });
343
+ return o3;
344
+ })(this.tableEl.offsetWidth, this.numCols));
345
+ "row" === r2.type && r2.border ? (this.showHorizontalLine(r2.border), this.hideVerticalLine()) : "col" === r2.type && r2.border ? (this.showVerticalLine(r2.border), this.hideHorizontalLine()) : this.hideInsertLines();
346
+ };
347
+ onMouseLeave = () => {
348
+ this.hideInsertLines();
349
+ };
350
+ constructor(t2, e2, n2, o2, i2) {
351
+ this.container = t2, this.tableEl = e2, this.getState = o2, this.dispatchFn = i2, this.tableId = n2.id, this.numRows = r(n2).length, this.numCols = this.countCols(n2), this.colBar = z("ntbl-col-bar"), this.rowBar = z("ntbl-row-bar"), this.insertLineH = M("horizontal"), this.insertLineV = M("vertical"), this.addRowZone = H("ntbl-add-row", "Add row"), this.addColZone = H("ntbl-add-col", "Add column"), this.deleteTableBtn = N("ntbl-delete-table-btn", '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none"><path d="M9 3h6m-9 4h12M10 11v6m4-6v6m-9 3h14l-1-13H6L5 20z" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg>', "Delete table"), t2.append(this.colBar, this.rowBar, this.insertLineH, this.insertLineV, this.addRowZone, this.addColZone, this.deleteTableBtn), this.rebuildColHandles(), this.rebuildRowHandles(), this.bindEventListeners(), this.observer = new ResizeObserver(() => {
352
+ this.positionControls();
353
+ }), this.observer.observe(e2), requestAnimationFrame(() => this.positionControls());
354
+ }
355
+ update(t2) {
356
+ this.tableId = t2.id;
357
+ const e2 = r(t2).length, n2 = this.countCols(t2);
358
+ e2 === this.numRows && n2 === this.numCols || (this.numRows = e2, this.numCols = n2, this.rebuildColHandles(), this.rebuildRowHandles()), requestAnimationFrame(() => this.positionControls());
359
+ }
360
+ destroy() {
361
+ this.observer.disconnect(), this.container.removeEventListener("mousemove", this.onMouseMove), this.container.removeEventListener("mouseleave", this.onMouseLeave), this.colBar.remove(), this.rowBar.remove(), this.insertLineH.remove(), this.insertLineV.remove(), this.addRowZone.remove(), this.addColZone.remove(), this.deleteTableBtn.remove();
362
+ }
363
+ bindEventListeners() {
364
+ const t2 = this.insertLineH.querySelector(".ntbl-insert-btn"), e2 = this.insertLineV.querySelector(".ntbl-insert-btn");
365
+ t2.addEventListener("click", () => {
366
+ this.activeRowIndex >= 0 && this.dispatchTransaction(g(this.getState(), this.tableId, this.activeRowIndex));
367
+ }), e2.addEventListener("click", () => {
368
+ this.activeColIndex >= 0 && this.dispatchTransaction(v(this.getState(), this.tableId, this.activeColIndex));
369
+ }), this.addRowZone.addEventListener("click", () => {
370
+ this.dispatchTransaction(g(this.getState(), this.tableId, this.numRows));
371
+ }), this.addColZone.addEventListener("click", () => {
372
+ this.dispatchTransaction(v(this.getState(), this.tableId, this.numCols));
373
+ }), this.deleteTableBtn.addEventListener("click", () => {
374
+ this.dispatchTransaction(I(this.getState(), this.tableId));
375
+ }), this.container.addEventListener("mousemove", this.onMouseMove), this.container.addEventListener("mouseleave", this.onMouseLeave);
376
+ }
377
+ dispatchTransaction(t2) {
378
+ t2 && this.dispatchFn(t2);
379
+ }
380
+ countCols(t2) {
381
+ const e2 = r(t2);
382
+ return e2[0] ? r(e2[0]).length : 0;
383
+ }
384
+ positionControls() {
385
+ !(function(t2, e2, n2) {
386
+ const o2 = t2.children;
387
+ if (0 === o2.length) return;
388
+ const r2 = e2 / n2;
389
+ for (let t3 = 0; t3 < o2.length; t3++) {
390
+ const e3 = o2[t3];
391
+ e3.style.left = `${Math.round(r2 * t3)}px`, e3.style.width = `${Math.round(r2)}px`;
392
+ }
393
+ t2.style.width = `${e2}px`;
394
+ })(this.colBar, this.tableEl.offsetWidth, this.numCols), (function(t2, e2) {
395
+ const n2 = t2.children;
396
+ if (0 === n2.length) return;
397
+ const o2 = e2.querySelectorAll(":scope > tbody > tr"), r2 = e2.offsetTop;
398
+ let i2 = 0;
399
+ for (let t3 = 0; t3 < n2.length; t3++) {
400
+ const e3 = n2[t3], l2 = o2[t3];
401
+ if (l2) {
402
+ const t4 = l2.offsetTop - r2, n3 = l2.offsetHeight;
403
+ e3.style.top = `${t4}px`, e3.style.height = `${n3}px`, i2 = t4 + n3;
404
+ }
405
+ }
406
+ t2.style.height = `${i2}px`;
407
+ })(this.rowBar, this.tableEl), (function(t2, e2, n2, o2) {
408
+ const r2 = $(n2, o2), i2 = n2.offsetHeight, l2 = n2.offsetWidth;
409
+ t2.style.width = `${l2}px`, t2.style.left = `${r2.left}px`, e2.style.height = `${i2}px`, e2.style.top = `${r2.top}px`;
410
+ })(this.addRowZone, this.addColZone, this.tableEl, this.container);
411
+ }
412
+ showHorizontalLine(t2) {
413
+ this.activeRowIndex = t2.index;
414
+ const e2 = $(this.tableEl, this.container);
415
+ this.insertLineH.style.top = e2.top + t2.position - 1 + "px", this.insertLineH.style.left = `${e2.left}px`, this.insertLineH.style.width = `${this.tableEl.offsetWidth}px`, this.insertLineH.classList.add("ntbl-insert-line--visible");
416
+ }
417
+ showVerticalLine(t2) {
418
+ this.activeColIndex = t2.index;
419
+ const e2 = $(this.tableEl, this.container);
420
+ this.insertLineV.style.left = e2.left + t2.position - 1 + "px", this.insertLineV.style.top = `${e2.top}px`, this.insertLineV.style.height = `${this.tableEl.offsetHeight}px`, this.insertLineV.classList.add("ntbl-insert-line--visible");
421
+ }
422
+ hideInsertLines() {
423
+ this.hideHorizontalLine(), this.hideVerticalLine();
424
+ }
425
+ hideHorizontalLine() {
426
+ this.insertLineH.classList.remove("ntbl-insert-line--visible"), this.activeRowIndex = -1;
427
+ }
428
+ hideVerticalLine() {
429
+ this.insertLineV.classList.remove("ntbl-insert-line--visible"), this.activeColIndex = -1;
430
+ }
431
+ rebuildColHandles() {
432
+ this.colBar.innerHTML = "";
433
+ for (let t2 = 0; t2 < this.numCols; t2++) {
434
+ const e2 = V("ntbl-col-handle", t2, "Delete column", (t3) => {
435
+ this.dispatchTransaction(x(this.getState(), this.tableId, t3));
436
+ });
437
+ this.colBar.appendChild(e2);
438
+ }
439
+ }
440
+ rebuildRowHandles() {
441
+ this.rowBar.innerHTML = "";
442
+ for (let t2 = 0; t2 < this.numRows; t2++) {
443
+ const e2 = V("ntbl-row-handle", t2, "Delete row", (t3) => {
444
+ this.dispatchTransaction(w(this.getState(), this.tableId, t3));
445
+ });
446
+ this.rowBar.appendChild(e2);
447
+ }
448
+ }
449
+ }
450
+ const D = new d("tableSelection");
451
+ const P = { maxPickerRows: 8, maxPickerCols: 8 };
452
+ class Z {
453
+ id = "table";
454
+ name = "Table";
455
+ priority = 40;
456
+ config;
457
+ selectionService = null;
458
+ cleanupMouseSelection = null;
459
+ context = null;
460
+ constructor(t2) {
461
+ this.config = { ...P, ...t2 };
462
+ }
463
+ init(e2) {
464
+ e2.registerStyleSheet("\n/* Table */\n.notectl-table-wrapper {\n margin: 8px 0;\n overflow-x: auto;\n position: relative;\n}\n\n.notectl-table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n}\n\n.notectl-table td {\n border: 1px solid var(--notectl-border);\n padding: 8px 12px;\n min-width: 60px;\n vertical-align: top;\n min-height: 1.6em;\n}\n\n.notectl-table td:focus-within {\n outline: 2px solid var(--notectl-primary);\n outline-offset: -2px;\n}\n\n.notectl-table-cell--selected {\n background: var(--notectl-primary-muted);\n}\n\n/* Table Context Menu */\n.notectl-table-context-menu {\n position: fixed;\n background: var(--notectl-surface-overlay);\n border: 1px solid var(--notectl-border);\n border-radius: 6px;\n box-shadow: 0 4px 12px var(--notectl-shadow);\n padding: 4px 0;\n min-width: 180px;\n z-index: 10000;\n}\n\n.notectl-table-context-menu button {\n display: block;\n width: 100%;\n padding: 8px 12px;\n text-align: left;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 14px;\n color: var(--notectl-fg);\n font-family: inherit;\n}\n\n.notectl-table-context-menu button:hover {\n background: var(--notectl-hover-bg);\n}\n\n.notectl-table-context-menu hr {\n border: none;\n border-top: 1px solid var(--notectl-border);\n margin: 4px 0;\n}\n\n/* === Table Controls === */\n\n/* Outer container for table + controls */\n.ntbl-container {\n position: relative;\n margin: 8px 0;\n padding: 24px 0 0 24px;\n}\n\n.ntbl-container .notectl-table-wrapper {\n margin: 0;\n}\n\n.ntbl-container.notectl-table--selected .notectl-table-wrapper {\n outline: 2px solid var(--notectl-primary-fg);\n outline-offset: 2px;\n border-radius: 6px;\n}\n\n/* --- Column Handle Bar --- */\n.ntbl-col-bar {\n position: absolute;\n top: 0;\n left: 24px;\n height: 20px;\n display: flex;\n opacity: 0;\n transition: opacity 0.2s ease;\n z-index: 3;\n pointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-col-bar,\n.ntbl-container:focus-within .ntbl-col-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-col-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* --- Row Handle Bar --- */\n.ntbl-row-bar {\n position: absolute;\n top: 24px;\n left: 0;\n width: 20px;\n display: flex;\n flex-direction: column;\n opacity: 0;\n transition: opacity 0.2s ease;\n z-index: 3;\n pointer-events: none;\n}\n\n.ntbl-container:hover .ntbl-row-bar,\n.ntbl-container:focus-within .ntbl-row-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-row-bar {\n opacity: 1;\n pointer-events: auto;\n}\n\n/* --- Handle (shared base) --- */\n.ntbl-handle {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: background 0.15s ease;\n border-radius: 3px;\n}\n\n.ntbl-col-handle {\n height: 100%;\n background: var(--notectl-hover-bg);\n border-radius: 4px 4px 0 0;\n}\n\n.ntbl-col-handle:hover {\n background: var(--notectl-border);\n}\n\n.ntbl-row-handle {\n width: 100%;\n background: var(--notectl-hover-bg);\n border-radius: 4px 0 0 4px;\n}\n\n.ntbl-row-handle:hover {\n background: var(--notectl-border);\n}\n\n/* --- Handle Delete Button --- */\n.ntbl-handle-delete {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n border: none;\n background: transparent;\n color: var(--notectl-fg-muted);\n cursor: pointer;\n border-radius: 3px;\n padding: 0;\n opacity: 0;\n transform: scale(0.7);\n transition: opacity 0.15s, transform 0.15s,\n background 0.15s, color 0.15s;\n}\n\n.ntbl-handle:hover .ntbl-handle-delete,\n.ntbl-handle:focus-within .ntbl-handle-delete {\n opacity: 1;\n transform: scale(1);\n}\n\n.ntbl-handle-delete:hover,\n.ntbl-handle-delete:focus-visible {\n background: var(--notectl-danger-muted);\n color: var(--notectl-danger);\n}\n\n.ntbl-handle-delete:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n/* --- Insert Lines --- */\n.ntbl-insert-line {\n position: absolute;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.15s ease;\n z-index: 6;\n}\n\n.ntbl-insert-line--visible {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ntbl-insert-line--horizontal {\n height: 2px;\n background: linear-gradient(\n 90deg,\n transparent,\n var(--notectl-primary) 8%,\n var(--notectl-primary) 92%,\n transparent\n );\n box-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--vertical {\n width: 2px;\n background: linear-gradient(\n 180deg,\n transparent,\n var(--notectl-primary) 8%,\n var(--notectl-primary) 92%,\n transparent\n );\n box-shadow: 0 0 6px var(--notectl-focus-ring);\n}\n\n/* --- Insert Button on Line --- */\n.ntbl-insert-btn {\n position: absolute;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n background: var(--notectl-bg);\n border: 2px solid var(--notectl-primary);\n color: var(--notectl-primary);\n cursor: pointer;\n pointer-events: all;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n box-shadow: 0 2px 8px var(--notectl-focus-ring);\n transition: background 0.15s, color 0.15s,\n transform 0.15s, box-shadow 0.15s;\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn {\n left: 50%;\n top: -9px;\n transform: translateX(-50%);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn {\n top: 50%;\n left: -9px;\n transform: translateY(-50%);\n}\n\n.ntbl-insert-btn:hover,\n.ntbl-insert-btn:focus-visible {\n background: var(--notectl-primary);\n color: var(--notectl-bg);\n box-shadow: 0 2px 12px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-insert-line--horizontal .ntbl-insert-btn:hover {\n transform: translateX(-50%) scale(1.2);\n}\n\n.ntbl-insert-line--vertical .ntbl-insert-btn:hover {\n transform: translateY(-50%) scale(1.2);\n}\n\n/* --- Add Row / Add Column Zones --- */\n.ntbl-add-zone {\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n user-select: none;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.2s ease,\n border-color 0.2s ease;\n}\n\n.ntbl-container:hover .ntbl-add-zone,\n.ntbl-container:focus-within .ntbl-add-zone {\n opacity: 1;\n}\n\n.ntbl-container.notectl-table--selected .ntbl-add-zone {\n opacity: 1;\n}\n\n.ntbl-delete-table-btn {\n position: absolute;\n top: 0;\n left: 0;\n width: 20px;\n height: 20px;\n border: 1px solid var(--notectl-danger);\n border-radius: 4px;\n background: var(--notectl-bg);\n color: var(--notectl-danger);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n transition: opacity 0.2s ease, background 0.15s, border-color 0.15s;\n z-index: 7;\n}\n\n.ntbl-container:hover .ntbl-delete-table-btn,\n.ntbl-container:focus-within .ntbl-delete-table-btn,\n.ntbl-container.notectl-table--selected .ntbl-delete-table-btn {\n opacity: 1;\n}\n\n.ntbl-delete-table-btn:hover,\n.ntbl-delete-table-btn:focus-visible {\n background: var(--notectl-danger-muted);\n border-color: var(--notectl-danger);\n}\n\n.ntbl-delete-table-btn:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-row {\n bottom: 0;\n height: 24px;\n border: 1px dashed var(--notectl-border);\n border-radius: 0 0 6px 6px;\n border-top: none;\n color: var(--notectl-fg-muted);\n transform: translateY(100%);\n}\n\n.ntbl-add-row:hover,\n.ntbl-add-row:focus-visible {\n background: var(--notectl-primary-muted);\n border-color: var(--notectl-primary);\n color: var(--notectl-primary);\n}\n\n.ntbl-add-row:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-col {\n right: 0;\n top: 24px;\n width: 24px;\n border: 1px dashed var(--notectl-border);\n border-radius: 0 6px 6px 0;\n border-left: none;\n color: var(--notectl-fg-muted);\n transform: translateX(100%);\n}\n\n.ntbl-add-col:hover,\n.ntbl-add-col:focus-visible {\n background: var(--notectl-primary-muted);\n border-color: var(--notectl-primary);\n color: var(--notectl-primary);\n}\n\n.ntbl-add-col:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px var(--notectl-focus-ring);\n}\n\n.ntbl-add-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n transition: transform 0.2s ease;\n}\n\n.ntbl-add-zone:hover .ntbl-add-icon {\n transform: scale(1.15);\n}\n"), this.context = e2, this.registerNodeSpecs(e2), this.registerNodeViews(e2), C(e2), (function(e3) {
465
+ const n2 = { Tab: () => (function(t2) {
466
+ return L(t2, (e4, n3, o2) => o2.colIndex < o2.totalCols - 1 ? E(t2, o2.tableId, o2.rowIndex, o2.colIndex + 1) : o2.rowIndex < o2.totalRows - 1 ? E(t2, o2.tableId, o2.rowIndex + 1, 0) : (k(t2), true));
467
+ })(e3), "Shift-Tab": () => (function(t2) {
468
+ return L(t2, (e4, n3, o2) => o2.colIndex > 0 ? E(t2, o2.tableId, o2.rowIndex, o2.colIndex - 1) : !(o2.rowIndex > 0) || E(t2, o2.tableId, o2.rowIndex - 1, o2.totalCols - 1));
469
+ })(e3), Enter: () => (function(e4) {
470
+ const n3 = e4.getState();
471
+ if (t(n3.selection)) return false;
472
+ const o2 = n3.getBlock(n3.selection.anchor.blockId);
473
+ if (o2 && "paragraph" !== o2.type) return false;
474
+ const r2 = b(n3, n3.selection.anchor.blockId);
475
+ return !!r2 && (!(r2.rowIndex < r2.totalRows - 1) || E(e4, r2.tableId, r2.rowIndex + 1, r2.colIndex));
476
+ })(e3), Backspace: () => (function(t2) {
477
+ return L(t2, (e4, n3, r2) => {
478
+ if (!o(n3)) return false;
479
+ if (0 !== n3.anchor.offset) return false;
480
+ if (0 !== r2.rowIndex || 0 !== r2.colIndex) return false;
481
+ const i2 = p(e4, r2.cellId);
482
+ return n3.anchor.blockId === i2 && B(t2, r2.tableId);
483
+ });
484
+ })(e3), Delete: () => (function(t2) {
485
+ return L(t2, (e4, n3, r2) => {
486
+ if (!o(n3)) return false;
487
+ const i2 = e4.getBlock(n3.anchor.blockId);
488
+ if (!i2) return false;
489
+ const l2 = a(i2);
490
+ if (n3.anchor.offset !== l2) return false;
491
+ if (r2.rowIndex !== r2.totalRows - 1 || r2.colIndex !== r2.totalCols - 1) return false;
492
+ const s2 = f(e4, r2.cellId);
493
+ return n3.anchor.blockId === s2 && B(t2, r2.tableId);
494
+ });
495
+ })(e3), ArrowDown: () => (function(t2) {
496
+ return L(t2, (e4, n3, o2) => {
497
+ const r2 = f(e4, o2.cellId);
498
+ return n3.anchor.blockId === r2 && (o2.rowIndex >= o2.totalRows - 1 ? R(t2) : E(t2, o2.tableId, o2.rowIndex + 1, o2.colIndex));
499
+ });
500
+ })(e3), ArrowUp: () => (function(t2) {
501
+ return L(t2, (e4, n3, o2) => {
502
+ const r2 = p(e4, o2.cellId);
503
+ return n3.anchor.blockId === r2 && !(o2.rowIndex <= 0) && E(t2, o2.tableId, o2.rowIndex - 1, o2.colIndex);
504
+ });
505
+ })(e3), ArrowRight: () => (function(t2) {
506
+ return L(t2, (e4, n3, r2) => {
507
+ if (!o(n3)) return false;
508
+ const i2 = e4.getBlock(n3.anchor.blockId);
509
+ if (!i2) return false;
510
+ const l2 = a(i2);
511
+ if (n3.anchor.offset !== l2) return false;
512
+ const s2 = f(e4, r2.cellId);
513
+ return n3.anchor.blockId === s2 && (r2.colIndex < r2.totalCols - 1 ? E(t2, r2.tableId, r2.rowIndex, r2.colIndex + 1) : !(r2.rowIndex < r2.totalRows - 1) || E(t2, r2.tableId, r2.rowIndex + 1, 0));
514
+ });
515
+ })(e3), ArrowLeft: () => (function(t2) {
516
+ return L(t2, (e4, n3, r2) => {
517
+ if (!o(n3)) return false;
518
+ if (0 !== n3.anchor.offset) return false;
519
+ const i2 = p(e4, r2.cellId);
520
+ return n3.anchor.blockId === i2 && (r2.colIndex > 0 ? A(t2, r2.tableId, r2.rowIndex, r2.colIndex - 1) : !(r2.rowIndex > 0) || A(t2, r2.tableId, r2.rowIndex - 1, r2.totalCols - 1));
521
+ });
522
+ })(e3), Escape: () => R(e3) };
523
+ e3.registerKeymap(n2);
524
+ })(e2), this.registerToolbarItem(e2), this.selectionService = (function(t2) {
525
+ let e3 = null, n2 = [], o2 = /* @__PURE__ */ new Set();
526
+ const r2 = { getSelectedRange: () => e3, setSelectedRange(r3) {
527
+ e3 = r3, (function() {
528
+ if (!e3) return n2 = [], void (o2 = /* @__PURE__ */ new Set());
529
+ const r4 = t2.getState(), i2 = [], l2 = Math.min(e3.fromRow, e3.toRow), s2 = Math.max(e3.fromRow, e3.toRow), a2 = Math.min(e3.fromCol, e3.toCol), c2 = Math.max(e3.fromCol, e3.toCol);
530
+ for (let t3 = l2; t3 <= s2; t3++) for (let n3 = a2; n3 <= c2; n3++) {
531
+ const o3 = h(r4, e3.tableId, t3, n3);
532
+ o3 && i2.push(o3);
533
+ }
534
+ n2 = i2, o2 = new Set(i2);
535
+ })(), (function(t3, e4) {
536
+ const n3 = t3.getContainer().querySelectorAll("td[data-block-id]");
537
+ for (const t4 of n3) {
538
+ const n4 = t4.getAttribute("data-block-id");
539
+ e4.has(n4) ? t4.classList.add("notectl-table-cell--selected") : t4.classList.remove("notectl-table-cell--selected");
540
+ }
541
+ })(t2, o2);
542
+ }, getSelectedCellIds: () => n2, isSelected: (t3) => o2.has(t3) };
543
+ return t2.registerService(D, r2), r2;
544
+ })(e2);
545
+ }
546
+ onReady() {
547
+ this.context && this.selectionService && (this.cleanupMouseSelection = (function(t2, e2) {
548
+ const n2 = t2.getContainer();
549
+ let o2 = null, r2 = false;
550
+ function i2(n3) {
551
+ const i3 = n3.target.closest("td[data-block-id]");
552
+ if (i3) if (n3.shiftKey) {
553
+ if (o2) {
554
+ const r3 = b(t2.getState(), i3.getAttribute("data-block-id"));
555
+ if (!r3 || r3.tableId !== o2.tableId) return;
556
+ n3.preventDefault(), e2.setSelectedRange({ tableId: o2.tableId, fromRow: o2.row, fromCol: o2.col, toRow: r3.rowIndex, toCol: r3.colIndex });
557
+ }
558
+ } else {
559
+ e2.setSelectedRange(null);
560
+ const n4 = b(t2.getState(), i3.getAttribute("data-block-id"));
561
+ if (!n4) return;
562
+ o2 = { tableId: n4.tableId, row: n4.rowIndex, col: n4.colIndex }, r2 = true;
563
+ }
564
+ else e2.setSelectedRange(null);
565
+ }
566
+ function l2(n3) {
567
+ if (!r2 || !o2) return;
568
+ const i3 = n3.target.closest("td[data-block-id]");
569
+ if (!i3) return;
570
+ const l3 = b(t2.getState(), i3.getAttribute("data-block-id"));
571
+ l3 && l3.tableId === o2.tableId && (l3.rowIndex === o2.row && l3.colIndex === o2.col || (n3.preventDefault(), e2.setSelectedRange({ tableId: o2.tableId, fromRow: o2.row, fromCol: o2.col, toRow: l3.rowIndex, toCol: l3.colIndex })));
572
+ }
573
+ function s2() {
574
+ r2 = false;
575
+ }
576
+ return n2.addEventListener("mousedown", i2), n2.addEventListener("mousemove", l2), document.addEventListener("mouseup", s2), () => {
577
+ n2.removeEventListener("mousedown", i2), n2.removeEventListener("mousemove", l2), document.removeEventListener("mouseup", s2);
578
+ };
579
+ })(this.context, this.selectionService));
580
+ }
581
+ destroy() {
582
+ this.cleanupMouseSelection?.(), this.cleanupMouseSelection = null, this.selectionService = null, this.context = null;
583
+ }
584
+ onStateChange(e2, n2, o2) {
585
+ if (this.selectionService?.getSelectedRange()) {
586
+ const e3 = n2.selection;
587
+ !t(e3) && m(n2, e3.anchor.blockId) || this.selectionService.setSelectedRange(null);
588
+ }
589
+ }
590
+ registerNodeSpecs(t2) {
591
+ t2.registerNodeSpec({ type: "table", group: "block", content: { allow: ["table_row"], min: 1 }, isolating: true, selectable: true, toDOM(t3) {
592
+ const e2 = document.createElement("div");
593
+ return e2.className = "notectl-table-wrapper", e2.setAttribute("data-block-id", t3.id), e2;
594
+ } }), t2.registerNodeSpec({ type: "table_row", group: "table_content", content: { allow: ["table_cell"], min: 1 }, toDOM(t3) {
595
+ const e2 = document.createElement("tr");
596
+ return e2.setAttribute("data-block-id", t3.id), e2.setAttribute("role", "row"), e2;
597
+ } }), t2.registerNodeSpec({ type: "table_cell", group: "table_content", content: { allow: ["paragraph", "list_item", "heading", "blockquote", "image", "horizontal_rule"] }, isolating: true, toDOM(t3) {
598
+ const e2 = document.createElement("td");
599
+ return e2.setAttribute("data-block-id", t3.id), e2.setAttribute("role", "cell"), e2;
600
+ } });
601
+ }
602
+ registerNodeViews(t2) {
603
+ t2.getSchemaRegistry(), t2.registerNodeView("table", (t3, e2, n2) => {
604
+ const o2 = document.createElement("div");
605
+ o2.className = "ntbl-container", o2.setAttribute("data-block-id", t3.id), o2.setAttribute("data-selectable", "true");
606
+ const i2 = document.createElement("div");
607
+ i2.className = "notectl-table-wrapper";
608
+ const l2 = document.createElement("table");
609
+ l2.className = "notectl-table", l2.setAttribute("role", "table");
610
+ const s2 = r(t3), a2 = s2.length, c2 = s2[0] ? r(s2[0]).length : 0;
611
+ l2.setAttribute("aria-label", `Table with ${a2} rows and ${c2} columns`);
612
+ const d2 = document.createElement("tbody");
613
+ l2.appendChild(d2), i2.appendChild(l2), o2.appendChild(i2);
614
+ const u2 = document.createElement("div");
615
+ u2.className = "notectl-sr-only", u2.setAttribute("aria-live", "polite"), u2.setAttribute("aria-atomic", "true"), o2.appendChild(u2);
616
+ const b2 = (function(t4, e3, n3, o3, r2) {
617
+ return new _(t4, e3, n3, o3, r2);
618
+ })(o2, l2, t3, e2, n2);
619
+ return { dom: o2, contentDOM: d2, update(t4) {
620
+ if ("table" !== t4.type) return false;
621
+ o2.setAttribute("data-block-id", t4.id), o2.setAttribute("data-selectable", "true");
622
+ const e3 = r(t4), n3 = e3.length, i3 = e3[0] ? r(e3[0]).length : 0;
623
+ return l2.setAttribute("aria-label", `Table with ${n3} rows and ${i3} columns`), b2.update(t4), false;
624
+ }, destroy() {
625
+ b2.destroy();
626
+ }, selectNode() {
627
+ o2.classList.add("notectl-table--selected");
628
+ }, deselectNode() {
629
+ o2.classList.remove("notectl-table--selected");
630
+ } };
631
+ }), t2.registerNodeView("table_row", (t3, e2, n2) => {
632
+ const o2 = document.createElement("tr");
633
+ return o2.setAttribute("data-block-id", t3.id), o2.setAttribute("role", "row"), { dom: o2, contentDOM: o2, update: (t4) => ("table_row" !== t4.type || o2.setAttribute("data-block-id", t4.id), false), destroy() {
634
+ } };
635
+ }), t2.registerNodeView("table_cell", (t3, e2, n2) => {
636
+ const o2 = document.createElement("td");
637
+ o2.setAttribute("data-block-id", t3.id), o2.setAttribute("role", "cell");
638
+ const r2 = t3.attrs?.colspan ?? 1, i2 = t3.attrs?.rowspan ?? 1;
639
+ r2 > 1 && (o2.colSpan = r2), i2 > 1 && (o2.rowSpan = i2);
640
+ const l2 = t3.attrs?.align;
641
+ return l2 && "left" !== l2 && (o2.style.textAlign = l2), { dom: o2, contentDOM: o2, update(t4) {
642
+ if ("table_cell" !== t4.type) return false;
643
+ o2.setAttribute("data-block-id", t4.id);
644
+ const e3 = t4.attrs?.colspan ?? 1, n3 = t4.attrs?.rowspan ?? 1;
645
+ return e3 > 1 ? o2.colSpan = e3 : o2.removeAttribute("colspan"), n3 > 1 ? o2.rowSpan = n3 : o2.removeAttribute("rowspan"), false;
646
+ }, destroy() {
647
+ } };
648
+ });
649
+ }
650
+ registerToolbarItem(e2) {
651
+ const n2 = this.config.maxPickerRows ?? 8, o2 = this.config.maxPickerCols ?? 8;
652
+ e2.registerToolbarItem({ id: "table", group: "insert", icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3h18v18H3V3zm2 2v4h6V5H5zm8 0v4h6V5h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6zm-8 6v4h6v-4H5zm8 0v4h6v-4h-6z"/></svg>', label: "Insert Table", tooltip: "Insert Table", command: "insertTable", priority: 80, separatorAfter: this.config.separatorAfter, popupType: "gridPicker", popupConfig: { maxRows: n2, maxCols: o2, onSelect: (t2, n3) => {
653
+ y(e2, t2, n3);
654
+ } }, isActive: (e3) => !t(e3.selection) && m(e3, e3.selection.anchor.blockId) });
655
+ }
656
+ }
657
+ export {
658
+ Z as TablePlugin,
659
+ D as TableSelectionServiceKey,
660
+ b as findTableContext,
661
+ m as isInsideTable
662
+ };
663
+ //# sourceMappingURL=table.mjs.map