@ecomcx/ecomweb-editor 1.24.0 → 1.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1608) hide show
  1. package/README.md +4 -6
  2. package/package.json +5 -36
  3. package/src/index.ts +1 -32
  4. package/src/shared/block-defs.ts +3 -4
  5. package/src/shared/panel-store.ts +3 -3
  6. package/src/shared/types.ts +0 -21
  7. package/src/v2/blocks/layout.tsx +36 -31
  8. package/src/v2/blocks/media.tsx +9 -7
  9. package/src/v2/blocks/text.tsx +21 -7
  10. package/src/v2/canvas/block-list.tsx +1 -0
  11. package/src/v2/canvas/canvas-css.ts +14 -3
  12. package/src/v2/core/registry.ts +1 -1
  13. package/src/v2/index.ts +8 -0
  14. package/src/v2/text/rich-schema.ts +2 -1
  15. package/node_modules/@floating-ui/core/LICENSE +0 -20
  16. package/node_modules/@floating-ui/core/README.md +0 -4
  17. package/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs +0 -1
  18. package/node_modules/@floating-ui/core/dist/floating-ui.core.browser.mjs +0 -1164
  19. package/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +0 -535
  20. package/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +0 -535
  21. package/node_modules/@floating-ui/core/dist/floating-ui.core.esm.js +0 -1038
  22. package/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +0 -1038
  23. package/node_modules/@floating-ui/core/dist/floating-ui.core.umd.js +0 -1183
  24. package/node_modules/@floating-ui/core/dist/floating-ui.core.umd.min.js +0 -1
  25. package/node_modules/@floating-ui/core/package.json +0 -63
  26. package/node_modules/@floating-ui/dom/LICENSE +0 -20
  27. package/node_modules/@floating-ui/dom/README.md +0 -4
  28. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs +0 -1
  29. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.mjs +0 -964
  30. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts +0 -362
  31. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts +0 -362
  32. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js +0 -789
  33. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +0 -789
  34. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.js +0 -983
  35. package/node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.min.js +0 -1
  36. package/node_modules/@floating-ui/dom/package.json +0 -72
  37. package/node_modules/@floating-ui/utils/LICENSE +0 -20
  38. package/node_modules/@floating-ui/utils/README.md +0 -4
  39. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +0 -105
  40. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +0 -105
  41. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +0 -47
  42. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +0 -47
  43. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.esm.js +0 -165
  44. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +0 -165
  45. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.umd.js +0 -192
  46. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.umd.min.js +0 -1
  47. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.esm.js +0 -136
  48. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +0 -136
  49. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.umd.js +0 -167
  50. package/node_modules/@floating-ui/utils/dist/floating-ui.utils.umd.min.js +0 -1
  51. package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +0 -47
  52. package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.esm.js +0 -165
  53. package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.umd.js +0 -192
  54. package/node_modules/@floating-ui/utils/dom/package.json +0 -6
  55. package/node_modules/@floating-ui/utils/package.json +0 -70
  56. package/node_modules/@tiptap/core/LICENSE.md +0 -21
  57. package/node_modules/@tiptap/core/README.md +0 -18
  58. package/node_modules/@tiptap/core/dist/index.cjs +0 -8463
  59. package/node_modules/@tiptap/core/dist/index.cjs.map +0 -1
  60. package/node_modules/@tiptap/core/dist/index.d.cts +0 -5798
  61. package/node_modules/@tiptap/core/dist/index.d.cts.map +0 -1
  62. package/node_modules/@tiptap/core/dist/index.d.ts +0 -5797
  63. package/node_modules/@tiptap/core/dist/index.d.ts.map +0 -1
  64. package/node_modules/@tiptap/core/dist/index.js +0 -8288
  65. package/node_modules/@tiptap/core/dist/index.js.map +0 -1
  66. package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs +0 -70
  67. package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs.map +0 -1
  68. package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.cts +0 -28
  69. package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.cts.map +0 -1
  70. package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.ts +0 -28
  71. package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.ts.map +0 -1
  72. package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +0 -64
  73. package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +0 -1
  74. package/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +0 -13
  75. package/node_modules/@tiptap/core/jsx-dev-runtime/index.cjs +0 -1
  76. package/node_modules/@tiptap/core/jsx-dev-runtime/index.d.cts +0 -1
  77. package/node_modules/@tiptap/core/jsx-dev-runtime/index.d.ts +0 -1
  78. package/node_modules/@tiptap/core/jsx-dev-runtime/index.js +0 -1
  79. package/node_modules/@tiptap/core/jsx-runtime/index.cjs +0 -1
  80. package/node_modules/@tiptap/core/jsx-runtime/index.d.cts +0 -1
  81. package/node_modules/@tiptap/core/jsx-runtime/index.d.ts +0 -1
  82. package/node_modules/@tiptap/core/jsx-runtime/index.js +0 -1
  83. package/node_modules/@tiptap/core/package.json +0 -74
  84. package/node_modules/@tiptap/core/src/CommandManager.test.ts +0 -220
  85. package/node_modules/@tiptap/core/src/CommandManager.ts +0 -208
  86. package/node_modules/@tiptap/core/src/Editor.test.ts +0 -756
  87. package/node_modules/@tiptap/core/src/Editor.ts +0 -908
  88. package/node_modules/@tiptap/core/src/EventEmitter.ts +0 -71
  89. package/node_modules/@tiptap/core/src/Extendable.test.ts +0 -764
  90. package/node_modules/@tiptap/core/src/Extendable.ts +0 -668
  91. package/node_modules/@tiptap/core/src/Extension.ts +0 -59
  92. package/node_modules/@tiptap/core/src/ExtensionManager.test.ts +0 -852
  93. package/node_modules/@tiptap/core/src/ExtensionManager.ts +0 -589
  94. package/node_modules/@tiptap/core/src/InputRule.test.ts +0 -113
  95. package/node_modules/@tiptap/core/src/InputRule.ts +0 -373
  96. package/node_modules/@tiptap/core/src/Mark.ts +0 -231
  97. package/node_modules/@tiptap/core/src/MarkView.test.ts +0 -53
  98. package/node_modules/@tiptap/core/src/MarkView.ts +0 -132
  99. package/node_modules/@tiptap/core/src/Node.ts +0 -390
  100. package/node_modules/@tiptap/core/src/NodePos.test.ts +0 -722
  101. package/node_modules/@tiptap/core/src/NodePos.ts +0 -270
  102. package/node_modules/@tiptap/core/src/NodeView.test.ts +0 -157
  103. package/node_modules/@tiptap/core/src/NodeView.ts +0 -367
  104. package/node_modules/@tiptap/core/src/PasteRule.ts +0 -396
  105. package/node_modules/@tiptap/core/src/Tracker.ts +0 -38
  106. package/node_modules/@tiptap/core/src/commands/blur.ts +0 -29
  107. package/node_modules/@tiptap/core/src/commands/canJoinItemsAt.ts +0 -13
  108. package/node_modules/@tiptap/core/src/commands/clearContent.ts +0 -25
  109. package/node_modules/@tiptap/core/src/commands/clearNodes.ts +0 -57
  110. package/node_modules/@tiptap/core/src/commands/command.ts +0 -22
  111. package/node_modules/@tiptap/core/src/commands/createParagraphNear.ts +0 -21
  112. package/node_modules/@tiptap/core/src/commands/cut.test.ts +0 -38
  113. package/node_modules/@tiptap/core/src/commands/cut.ts +0 -36
  114. package/node_modules/@tiptap/core/src/commands/deleteCurrentNode.ts +0 -44
  115. package/node_modules/@tiptap/core/src/commands/deleteNode.ts +0 -41
  116. package/node_modules/@tiptap/core/src/commands/deleteRange.ts +0 -26
  117. package/node_modules/@tiptap/core/src/commands/deleteSelection.test.ts +0 -125
  118. package/node_modules/@tiptap/core/src/commands/deleteSelection.ts +0 -109
  119. package/node_modules/@tiptap/core/src/commands/enter.ts +0 -19
  120. package/node_modules/@tiptap/core/src/commands/exitCode.ts +0 -21
  121. package/node_modules/@tiptap/core/src/commands/extendMarkRange.test.ts +0 -455
  122. package/node_modules/@tiptap/core/src/commands/extendMarkRange.ts +0 -52
  123. package/node_modules/@tiptap/core/src/commands/first.ts +0 -26
  124. package/node_modules/@tiptap/core/src/commands/focus.ts +0 -108
  125. package/node_modules/@tiptap/core/src/commands/forEach.ts +0 -24
  126. package/node_modules/@tiptap/core/src/commands/index.ts +0 -59
  127. package/node_modules/@tiptap/core/src/commands/insertContent.test.ts +0 -197
  128. package/node_modules/@tiptap/core/src/commands/insertContent.ts +0 -50
  129. package/node_modules/@tiptap/core/src/commands/insertContentAt.test.ts +0 -133
  130. package/node_modules/@tiptap/core/src/commands/insertContentAt.ts +0 -208
  131. package/node_modules/@tiptap/core/src/commands/insertDefaultBlock.test.ts +0 -178
  132. package/node_modules/@tiptap/core/src/commands/insertDefaultBlock.ts +0 -97
  133. package/node_modules/@tiptap/core/src/commands/join.ts +0 -69
  134. package/node_modules/@tiptap/core/src/commands/joinItemBackward.ts +0 -42
  135. package/node_modules/@tiptap/core/src/commands/joinItemForward.test.ts +0 -138
  136. package/node_modules/@tiptap/core/src/commands/joinItemForward.ts +0 -42
  137. package/node_modules/@tiptap/core/src/commands/joinTextblockBackward.ts +0 -20
  138. package/node_modules/@tiptap/core/src/commands/joinTextblockForward.ts +0 -20
  139. package/node_modules/@tiptap/core/src/commands/keyboardShortcut.ts +0 -100
  140. package/node_modules/@tiptap/core/src/commands/lift.ts +0 -34
  141. package/node_modules/@tiptap/core/src/commands/liftEmptyBlock.ts +0 -21
  142. package/node_modules/@tiptap/core/src/commands/liftListItem.ts +0 -26
  143. package/node_modules/@tiptap/core/src/commands/newlineInCode.ts +0 -21
  144. package/node_modules/@tiptap/core/src/commands/resetAttributes.ts +0 -80
  145. package/node_modules/@tiptap/core/src/commands/scrollIntoView.ts +0 -23
  146. package/node_modules/@tiptap/core/src/commands/selectAll.ts +0 -27
  147. package/node_modules/@tiptap/core/src/commands/selectNodeBackward.ts +0 -21
  148. package/node_modules/@tiptap/core/src/commands/selectNodeForward.ts +0 -21
  149. package/node_modules/@tiptap/core/src/commands/selectParentNode.ts +0 -21
  150. package/node_modules/@tiptap/core/src/commands/selectTextblockEnd.ts +0 -23
  151. package/node_modules/@tiptap/core/src/commands/selectTextblockStart.ts +0 -23
  152. package/node_modules/@tiptap/core/src/commands/setContent.test.ts +0 -177
  153. package/node_modules/@tiptap/core/src/commands/setContent.ts +0 -79
  154. package/node_modules/@tiptap/core/src/commands/setMark.ts +0 -122
  155. package/node_modules/@tiptap/core/src/commands/setMeta.ts +0 -25
  156. package/node_modules/@tiptap/core/src/commands/setNode.ts +0 -57
  157. package/node_modules/@tiptap/core/src/commands/setNodeSelection.ts +0 -31
  158. package/node_modules/@tiptap/core/src/commands/setTextDirection.ts +0 -51
  159. package/node_modules/@tiptap/core/src/commands/setTextSelection.ts +0 -36
  160. package/node_modules/@tiptap/core/src/commands/sinkListItem.ts +0 -26
  161. package/node_modules/@tiptap/core/src/commands/splitBlock.test.ts +0 -107
  162. package/node_modules/@tiptap/core/src/commands/splitBlock.ts +0 -136
  163. package/node_modules/@tiptap/core/src/commands/splitListItem.ts +0 -166
  164. package/node_modules/@tiptap/core/src/commands/toggleList.ts +0 -308
  165. package/node_modules/@tiptap/core/src/commands/toggleMark.ts +0 -51
  166. package/node_modules/@tiptap/core/src/commands/toggleNode.ts +0 -47
  167. package/node_modules/@tiptap/core/src/commands/toggleWrap.ts +0 -32
  168. package/node_modules/@tiptap/core/src/commands/undoInputRule.ts +0 -49
  169. package/node_modules/@tiptap/core/src/commands/unsetAllMarks.test.ts +0 -109
  170. package/node_modules/@tiptap/core/src/commands/unsetAllMarks.ts +0 -44
  171. package/node_modules/@tiptap/core/src/commands/unsetMark.ts +0 -65
  172. package/node_modules/@tiptap/core/src/commands/unsetTextDirection.ts +0 -51
  173. package/node_modules/@tiptap/core/src/commands/updateAttributes.ts +0 -150
  174. package/node_modules/@tiptap/core/src/commands/updateDecorations.ts +0 -28
  175. package/node_modules/@tiptap/core/src/commands/utils/appendContentNode.ts +0 -25
  176. package/node_modules/@tiptap/core/src/commands/utils/appendNestedList.test.ts +0 -35
  177. package/node_modules/@tiptap/core/src/commands/utils/appendNestedList.ts +0 -43
  178. package/node_modules/@tiptap/core/src/commands/utils/convertListItem.ts +0 -32
  179. package/node_modules/@tiptap/core/src/commands/utils/convertListItems.ts +0 -24
  180. package/node_modules/@tiptap/core/src/commands/utils/createNode.ts +0 -18
  181. package/node_modules/@tiptap/core/src/commands/utils/findNodePosition.ts +0 -18
  182. package/node_modules/@tiptap/core/src/commands/utils/flushPendingContent.ts +0 -23
  183. package/node_modules/@tiptap/core/src/commands/utils/listConversionTypes.ts +0 -17
  184. package/node_modules/@tiptap/core/src/commands/wrapIn.ts +0 -27
  185. package/node_modules/@tiptap/core/src/commands/wrapInList.ts +0 -27
  186. package/node_modules/@tiptap/core/src/decorations/Decoration.test.ts +0 -40
  187. package/node_modules/@tiptap/core/src/decorations/Decoration.ts +0 -177
  188. package/node_modules/@tiptap/core/src/decorations/DecorationManager.test.ts +0 -821
  189. package/node_modules/@tiptap/core/src/decorations/DecorationManager.ts +0 -440
  190. package/node_modules/@tiptap/core/src/decorations/constants.ts +0 -7
  191. package/node_modules/@tiptap/core/src/decorations/createWidgetDecoration.test.ts +0 -224
  192. package/node_modules/@tiptap/core/src/decorations/createWidgetDecoration.ts +0 -221
  193. package/node_modules/@tiptap/core/src/decorations/decorationApplyScope.test.ts +0 -50
  194. package/node_modules/@tiptap/core/src/decorations/decorationApplyScope.ts +0 -45
  195. package/node_modules/@tiptap/core/src/decorations/helpers/buildDecorationSet.ts +0 -25
  196. package/node_modules/@tiptap/core/src/decorations/helpers/decorationsToPMDecorations.ts +0 -36
  197. package/node_modules/@tiptap/core/src/decorations/helpers/filterOutOfRangeDecorations.ts +0 -52
  198. package/node_modules/@tiptap/core/src/decorations/helpers/findDuplicateWidgetKeys.ts +0 -37
  199. package/node_modules/@tiptap/core/src/decorations/helpers/getRebuildRanges.test.ts +0 -147
  200. package/node_modules/@tiptap/core/src/decorations/helpers/getRebuildRanges.ts +0 -96
  201. package/node_modules/@tiptap/core/src/decorations/helpers/hasResolvableChangedRange.ts +0 -24
  202. package/node_modules/@tiptap/core/src/decorations/helpers/isAttrStep.ts +0 -21
  203. package/node_modules/@tiptap/core/src/decorations/helpers/mapDecorationSet.ts +0 -31
  204. package/node_modules/@tiptap/core/src/decorations/helpers/mapDecorations.ts +0 -26
  205. package/node_modules/@tiptap/core/src/decorations/helpers/mergeDecorationSets.ts +0 -16
  206. package/node_modules/@tiptap/core/src/decorations/helpers/rangeOwnsPosition.ts +0 -38
  207. package/node_modules/@tiptap/core/src/decorations/helpers/shouldRecomputeDecoration.ts +0 -24
  208. package/node_modules/@tiptap/core/src/decorations/helpers/unionWidgetKeys.ts +0 -15
  209. package/node_modules/@tiptap/core/src/decorations/helpers/validateDecorationSpec.ts +0 -49
  210. package/node_modules/@tiptap/core/src/decorations/helpers/widgetKeyOf.ts +0 -11
  211. package/node_modules/@tiptap/core/src/decorations/index.ts +0 -28
  212. package/node_modules/@tiptap/core/src/decorations/types.ts +0 -87
  213. package/node_modules/@tiptap/core/src/extensions/clipboardTextSerializer.test.ts +0 -68
  214. package/node_modules/@tiptap/core/src/extensions/clipboardTextSerializer.ts +0 -53
  215. package/node_modules/@tiptap/core/src/extensions/commands.ts +0 -14
  216. package/node_modules/@tiptap/core/src/extensions/delete.test.ts +0 -49
  217. package/node_modules/@tiptap/core/src/extensions/delete.ts +0 -101
  218. package/node_modules/@tiptap/core/src/extensions/drop.ts +0 -26
  219. package/node_modules/@tiptap/core/src/extensions/editable.ts +0 -18
  220. package/node_modules/@tiptap/core/src/extensions/focusEvents.ts +0 -45
  221. package/node_modules/@tiptap/core/src/extensions/index.ts +0 -10
  222. package/node_modules/@tiptap/core/src/extensions/keymap.ts +0 -165
  223. package/node_modules/@tiptap/core/src/extensions/paste.ts +0 -25
  224. package/node_modules/@tiptap/core/src/extensions/tabindex.test.ts +0 -75
  225. package/node_modules/@tiptap/core/src/extensions/tabindex.ts +0 -58
  226. package/node_modules/@tiptap/core/src/extensions/textDirection.ts +0 -88
  227. package/node_modules/@tiptap/core/src/helpers/MappablePosition.ts +0 -69
  228. package/node_modules/@tiptap/core/src/helpers/combineTransactionSteps.ts +0 -24
  229. package/node_modules/@tiptap/core/src/helpers/createChainableState.ts +0 -42
  230. package/node_modules/@tiptap/core/src/helpers/createDocument.ts +0 -24
  231. package/node_modules/@tiptap/core/src/helpers/createNodeFromContent.test.ts +0 -332
  232. package/node_modules/@tiptap/core/src/helpers/createNodeFromContent.ts +0 -128
  233. package/node_modules/@tiptap/core/src/helpers/defaultBlockAt.ts +0 -18
  234. package/node_modules/@tiptap/core/src/helpers/findChildren.ts +0 -24
  235. package/node_modules/@tiptap/core/src/helpers/findChildrenInRange.ts +0 -40
  236. package/node_modules/@tiptap/core/src/helpers/findParentNode.ts +0 -18
  237. package/node_modules/@tiptap/core/src/helpers/findParentNodeClosestToPos.ts +0 -37
  238. package/node_modules/@tiptap/core/src/helpers/flattenExtensions.ts +0 -34
  239. package/node_modules/@tiptap/core/src/helpers/generateHTML.test.ts +0 -29
  240. package/node_modules/@tiptap/core/src/helpers/generateHTML.ts +0 -18
  241. package/node_modules/@tiptap/core/src/helpers/generateJSON.test.ts +0 -31
  242. package/node_modules/@tiptap/core/src/helpers/generateJSON.ts +0 -18
  243. package/node_modules/@tiptap/core/src/helpers/generateText.test.ts +0 -71
  244. package/node_modules/@tiptap/core/src/helpers/generateText.ts +0 -34
  245. package/node_modules/@tiptap/core/src/helpers/getAttributes.ts +0 -32
  246. package/node_modules/@tiptap/core/src/helpers/getAttributesFromExtensions.test.ts +0 -473
  247. package/node_modules/@tiptap/core/src/helpers/getAttributesFromExtensions.ts +0 -120
  248. package/node_modules/@tiptap/core/src/helpers/getChangedRanges.test.ts +0 -48
  249. package/node_modules/@tiptap/core/src/helpers/getChangedRanges.ts +0 -85
  250. package/node_modules/@tiptap/core/src/helpers/getDebugJSON.ts +0 -54
  251. package/node_modules/@tiptap/core/src/helpers/getExtensionField.ts +0 -32
  252. package/node_modules/@tiptap/core/src/helpers/getHTMLFromFragment.ts +0 -13
  253. package/node_modules/@tiptap/core/src/helpers/getMarkAttributes.ts +0 -33
  254. package/node_modules/@tiptap/core/src/helpers/getMarkRange.test.ts +0 -237
  255. package/node_modules/@tiptap/core/src/helpers/getMarkRange.ts +0 -105
  256. package/node_modules/@tiptap/core/src/helpers/getMarkType.ts +0 -15
  257. package/node_modules/@tiptap/core/src/helpers/getMarksBetween.ts +0 -44
  258. package/node_modules/@tiptap/core/src/helpers/getNodeAtPosition.ts +0 -34
  259. package/node_modules/@tiptap/core/src/helpers/getNodeAttributes.ts +0 -25
  260. package/node_modules/@tiptap/core/src/helpers/getNodeType.ts +0 -15
  261. package/node_modules/@tiptap/core/src/helpers/getPreviousBlockSibling.test.ts +0 -111
  262. package/node_modules/@tiptap/core/src/helpers/getPreviousBlockSibling.ts +0 -36
  263. package/node_modules/@tiptap/core/src/helpers/getRenderedAttributes.ts +0 -23
  264. package/node_modules/@tiptap/core/src/helpers/getSchema.ts +0 -12
  265. package/node_modules/@tiptap/core/src/helpers/getSchemaByResolvedExtensions.test.ts +0 -171
  266. package/node_modules/@tiptap/core/src/helpers/getSchemaByResolvedExtensions.ts +0 -41
  267. package/node_modules/@tiptap/core/src/helpers/getSchemaSpecByResolvedExtensions.test.ts +0 -101
  268. package/node_modules/@tiptap/core/src/helpers/getSchemaSpecByResolvedExtensions.ts +0 -240
  269. package/node_modules/@tiptap/core/src/helpers/getSchemaTypeByName.ts +0 -11
  270. package/node_modules/@tiptap/core/src/helpers/getSchemaTypeNameByName.ts +0 -19
  271. package/node_modules/@tiptap/core/src/helpers/getSplittedAttributes.ts +0 -28
  272. package/node_modules/@tiptap/core/src/helpers/getText.ts +0 -28
  273. package/node_modules/@tiptap/core/src/helpers/getTextBetween.ts +0 -52
  274. package/node_modules/@tiptap/core/src/helpers/getTextContentFromNodes.test.ts +0 -40
  275. package/node_modules/@tiptap/core/src/helpers/getTextContentFromNodes.ts +0 -34
  276. package/node_modules/@tiptap/core/src/helpers/getTextSerializersFromSchema.ts +0 -16
  277. package/node_modules/@tiptap/core/src/helpers/index.ts +0 -71
  278. package/node_modules/@tiptap/core/src/helpers/injectExtensionAttributesToParseRule.ts +0 -47
  279. package/node_modules/@tiptap/core/src/helpers/isActive.test.ts +0 -106
  280. package/node_modules/@tiptap/core/src/helpers/isActive.ts +0 -27
  281. package/node_modules/@tiptap/core/src/helpers/isAtEndOfNode.ts +0 -29
  282. package/node_modules/@tiptap/core/src/helpers/isAtStartOfNode.ts +0 -11
  283. package/node_modules/@tiptap/core/src/helpers/isExtensionRulesEnabled.ts +0 -13
  284. package/node_modules/@tiptap/core/src/helpers/isFragment.ts +0 -14
  285. package/node_modules/@tiptap/core/src/helpers/isList.ts +0 -27
  286. package/node_modules/@tiptap/core/src/helpers/isMarkActive.ts +0 -94
  287. package/node_modules/@tiptap/core/src/helpers/isNodeActive.ts +0 -51
  288. package/node_modules/@tiptap/core/src/helpers/isNodeEmpty.test.ts +0 -250
  289. package/node_modules/@tiptap/core/src/helpers/isNodeEmpty.ts +0 -62
  290. package/node_modules/@tiptap/core/src/helpers/isNodeSelection.ts +0 -5
  291. package/node_modules/@tiptap/core/src/helpers/isNodeViewSelected.test.ts +0 -218
  292. package/node_modules/@tiptap/core/src/helpers/isNodeViewSelected.ts +0 -42
  293. package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddMarkStep.test.ts +0 -19
  294. package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddMarkStep.ts +0 -31
  295. package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddNodeMarkStep.test.ts +0 -19
  296. package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddNodeMarkStep.ts +0 -31
  297. package/node_modules/@tiptap/core/src/helpers/isProseMirrorAttrStep.test.ts +0 -17
  298. package/node_modules/@tiptap/core/src/helpers/isProseMirrorAttrStep.ts +0 -31
  299. package/node_modules/@tiptap/core/src/helpers/isProseMirrorCellSelection.test.ts +0 -17
  300. package/node_modules/@tiptap/core/src/helpers/isProseMirrorCellSelection.ts +0 -18
  301. package/node_modules/@tiptap/core/src/helpers/isProseMirrorContent.ts +0 -14
  302. package/node_modules/@tiptap/core/src/helpers/isProseMirrorDocAttrStep.test.ts +0 -17
  303. package/node_modules/@tiptap/core/src/helpers/isProseMirrorDocAttrStep.ts +0 -31
  304. package/node_modules/@tiptap/core/src/helpers/isProseMirrorFragment.test.ts +0 -27
  305. package/node_modules/@tiptap/core/src/helpers/isProseMirrorFragment.ts +0 -34
  306. package/node_modules/@tiptap/core/src/helpers/isProseMirrorNodeSelection.test.ts +0 -35
  307. package/node_modules/@tiptap/core/src/helpers/isProseMirrorNodeSelection.ts +0 -18
  308. package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveMarkStep.test.ts +0 -19
  309. package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveMarkStep.ts +0 -31
  310. package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveNodeMarkStep.test.ts +0 -19
  311. package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveNodeMarkStep.ts +0 -31
  312. package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceAroundStep.test.ts +0 -19
  313. package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceAroundStep.ts +0 -31
  314. package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceStep.test.ts +0 -17
  315. package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceStep.ts +0 -31
  316. package/node_modules/@tiptap/core/src/helpers/isProseMirrorSlice.test.ts +0 -16
  317. package/node_modules/@tiptap/core/src/helpers/isProseMirrorSlice.ts +0 -43
  318. package/node_modules/@tiptap/core/src/helpers/isProseMirrorStep.test.ts +0 -30
  319. package/node_modules/@tiptap/core/src/helpers/isProseMirrorStep.ts +0 -30
  320. package/node_modules/@tiptap/core/src/helpers/isProseMirrorStepResult.test.ts +0 -17
  321. package/node_modules/@tiptap/core/src/helpers/isProseMirrorStepResult.ts +0 -26
  322. package/node_modules/@tiptap/core/src/helpers/isTextSelection.ts +0 -5
  323. package/node_modules/@tiptap/core/src/helpers/posToDOMRect.ts +0 -35
  324. package/node_modules/@tiptap/core/src/helpers/resolveExtensions.ts +0 -25
  325. package/node_modules/@tiptap/core/src/helpers/resolveFocusPosition.ts +0 -42
  326. package/node_modules/@tiptap/core/src/helpers/rewriteUnknownContent.test.ts +0 -51
  327. package/node_modules/@tiptap/core/src/helpers/rewriteUnknownContent.ts +0 -158
  328. package/node_modules/@tiptap/core/src/helpers/selectionToInsertionEnd.ts +0 -29
  329. package/node_modules/@tiptap/core/src/helpers/sortExtensions.ts +0 -26
  330. package/node_modules/@tiptap/core/src/helpers/splitExtensions.ts +0 -18
  331. package/node_modules/@tiptap/core/src/helpers/warnOnDuplicatedProseMirrorModel.test.ts +0 -23
  332. package/node_modules/@tiptap/core/src/helpers/warnOnDuplicatedProseMirrorModel.ts +0 -47
  333. package/node_modules/@tiptap/core/src/index.ts +0 -23
  334. package/node_modules/@tiptap/core/src/inputRules/index.ts +0 -5
  335. package/node_modules/@tiptap/core/src/inputRules/markInputRule.ts +0 -72
  336. package/node_modules/@tiptap/core/src/inputRules/nodeInputRule.ts +0 -80
  337. package/node_modules/@tiptap/core/src/inputRules/textInputRule.ts +0 -39
  338. package/node_modules/@tiptap/core/src/inputRules/textblockTypeInputRule.ts +0 -41
  339. package/node_modules/@tiptap/core/src/inputRules/wrappingInputRule.ts +0 -88
  340. package/node_modules/@tiptap/core/src/jsx-runtime.test.ts +0 -349
  341. package/node_modules/@tiptap/core/src/jsx-runtime.ts +0 -145
  342. package/node_modules/@tiptap/core/src/lib/ResizableNodeView.test.ts +0 -121
  343. package/node_modules/@tiptap/core/src/lib/ResizableNodeView.ts +0 -1079
  344. package/node_modules/@tiptap/core/src/lib/index.ts +0 -1
  345. package/node_modules/@tiptap/core/src/pasteRules/index.ts +0 -3
  346. package/node_modules/@tiptap/core/src/pasteRules/markPasteRule.test.ts +0 -91
  347. package/node_modules/@tiptap/core/src/pasteRules/markPasteRule.ts +0 -82
  348. package/node_modules/@tiptap/core/src/pasteRules/nodePasteRule.ts +0 -44
  349. package/node_modules/@tiptap/core/src/pasteRules/textPasteRule.ts +0 -34
  350. package/node_modules/@tiptap/core/src/schema/getSchemaAttributes.ts +0 -45
  351. package/node_modules/@tiptap/core/src/schema/mergeSchemaSpec.ts +0 -83
  352. package/node_modules/@tiptap/core/src/schema/schemaSpecFields.ts +0 -24
  353. package/node_modules/@tiptap/core/src/style.ts +0 -71
  354. package/node_modules/@tiptap/core/src/types.ts +0 -1114
  355. package/node_modules/@tiptap/core/src/utilities/attrsEqual.test.ts +0 -54
  356. package/node_modules/@tiptap/core/src/utilities/attrsEqual.ts +0 -27
  357. package/node_modules/@tiptap/core/src/utilities/callOrReturn.ts +0 -25
  358. package/node_modules/@tiptap/core/src/utilities/canInsertNode.ts +0 -30
  359. package/node_modules/@tiptap/core/src/utilities/createStyleTag.ts +0 -21
  360. package/node_modules/@tiptap/core/src/utilities/deleteProps.ts +0 -19
  361. package/node_modules/@tiptap/core/src/utilities/elementFromString.ts +0 -29
  362. package/node_modules/@tiptap/core/src/utilities/escapeForRegEx.ts +0 -4
  363. package/node_modules/@tiptap/core/src/utilities/findDuplicates.ts +0 -8
  364. package/node_modules/@tiptap/core/src/utilities/fromString.test.ts +0 -53
  365. package/node_modules/@tiptap/core/src/utilities/fromString.ts +0 -19
  366. package/node_modules/@tiptap/core/src/utilities/getStyleProperty.test.ts +0 -53
  367. package/node_modules/@tiptap/core/src/utilities/getStyleProperty.ts +0 -52
  368. package/node_modules/@tiptap/core/src/utilities/htmlEntities.test.ts +0 -159
  369. package/node_modules/@tiptap/core/src/utilities/htmlEntities.ts +0 -74
  370. package/node_modules/@tiptap/core/src/utilities/index.ts +0 -31
  371. package/node_modules/@tiptap/core/src/utilities/isAndroid.test.ts +0 -28
  372. package/node_modules/@tiptap/core/src/utilities/isAndroid.ts +0 -3
  373. package/node_modules/@tiptap/core/src/utilities/isDev.ts +0 -12
  374. package/node_modules/@tiptap/core/src/utilities/isEmptyObject.ts +0 -3
  375. package/node_modules/@tiptap/core/src/utilities/isFirefox.ts +0 -11
  376. package/node_modules/@tiptap/core/src/utilities/isFunction.ts +0 -4
  377. package/node_modules/@tiptap/core/src/utilities/isMacOS.ts +0 -3
  378. package/node_modules/@tiptap/core/src/utilities/isNumber.ts +0 -3
  379. package/node_modules/@tiptap/core/src/utilities/isPlainObject.ts +0 -13
  380. package/node_modules/@tiptap/core/src/utilities/isRegExp.ts +0 -3
  381. package/node_modules/@tiptap/core/src/utilities/isSafari.ts +0 -13
  382. package/node_modules/@tiptap/core/src/utilities/isString.ts +0 -3
  383. package/node_modules/@tiptap/core/src/utilities/isValidCSSStyleValue.test.ts +0 -22
  384. package/node_modules/@tiptap/core/src/utilities/isValidCSSStyleValue.ts +0 -8
  385. package/node_modules/@tiptap/core/src/utilities/isiOS.ts +0 -9
  386. package/node_modules/@tiptap/core/src/utilities/markdown/createAtomBlockMarkdownSpec.ts +0 -138
  387. package/node_modules/@tiptap/core/src/utilities/markdown/createBlockMarkdownSpec.ts +0 -229
  388. package/node_modules/@tiptap/core/src/utilities/markdown/createInlineMarkdownSpec.ts +0 -262
  389. package/node_modules/@tiptap/core/src/utilities/markdown/index.ts +0 -14
  390. package/node_modules/@tiptap/core/src/utilities/markdown/parseAttributes.test.ts +0 -70
  391. package/node_modules/@tiptap/core/src/utilities/markdown/parseAttributes.ts +0 -48
  392. package/node_modules/@tiptap/core/src/utilities/markdown/parseIndentedBlocks.ts +0 -194
  393. package/node_modules/@tiptap/core/src/utilities/markdown/parseShortcodeAttributes.ts +0 -13
  394. package/node_modules/@tiptap/core/src/utilities/markdown/renderNestedMarkdownContent.test.ts +0 -51
  395. package/node_modules/@tiptap/core/src/utilities/markdown/renderNestedMarkdownContent.ts +0 -136
  396. package/node_modules/@tiptap/core/src/utilities/markdown/serializeAttributes.ts +0 -42
  397. package/node_modules/@tiptap/core/src/utilities/markdown/tokenizeAttributes.ts +0 -163
  398. package/node_modules/@tiptap/core/src/utilities/marksEqual.test.ts +0 -101
  399. package/node_modules/@tiptap/core/src/utilities/marksEqual.ts +0 -44
  400. package/node_modules/@tiptap/core/src/utilities/mergeAttributes.test.ts +0 -194
  401. package/node_modules/@tiptap/core/src/utilities/mergeAttributes.ts +0 -128
  402. package/node_modules/@tiptap/core/src/utilities/mergeDeep.test.ts +0 -98
  403. package/node_modules/@tiptap/core/src/utilities/mergeDeep.ts +0 -20
  404. package/node_modules/@tiptap/core/src/utilities/minMax.ts +0 -3
  405. package/node_modules/@tiptap/core/src/utilities/objectIncludes.ts +0 -30
  406. package/node_modules/@tiptap/core/src/utilities/removeDuplicates.ts +0 -13
  407. package/node_modules/@tiptap/extension-blockquote/LICENSE.md +0 -21
  408. package/node_modules/@tiptap/extension-blockquote/README.md +0 -18
  409. package/node_modules/@tiptap/extension-blockquote/dist/index.cjs +0 -132
  410. package/node_modules/@tiptap/extension-blockquote/dist/index.cjs.map +0 -1
  411. package/node_modules/@tiptap/extension-blockquote/dist/index.d.cts +0 -40
  412. package/node_modules/@tiptap/extension-blockquote/dist/index.d.cts.map +0 -1
  413. package/node_modules/@tiptap/extension-blockquote/dist/index.d.ts +0 -40
  414. package/node_modules/@tiptap/extension-blockquote/dist/index.d.ts.map +0 -1
  415. package/node_modules/@tiptap/extension-blockquote/dist/index.js +0 -126
  416. package/node_modules/@tiptap/extension-blockquote/dist/index.js.map +0 -1
  417. package/node_modules/@tiptap/extension-blockquote/package.json +0 -52
  418. package/node_modules/@tiptap/extension-blockquote/src/blockquote.tsx +0 -143
  419. package/node_modules/@tiptap/extension-blockquote/src/handleBackspace.test.ts +0 -45
  420. package/node_modules/@tiptap/extension-blockquote/src/handleBackspace.ts +0 -75
  421. package/node_modules/@tiptap/extension-blockquote/src/index.ts +0 -5
  422. package/node_modules/@tiptap/extension-bold/LICENSE.md +0 -21
  423. package/node_modules/@tiptap/extension-bold/README.md +0 -18
  424. package/node_modules/@tiptap/extension-bold/dist/index.cjs +0 -117
  425. package/node_modules/@tiptap/extension-bold/dist/index.cjs.map +0 -1
  426. package/node_modules/@tiptap/extension-bold/dist/index.d.cts +0 -52
  427. package/node_modules/@tiptap/extension-bold/dist/index.d.cts.map +0 -1
  428. package/node_modules/@tiptap/extension-bold/dist/index.d.ts +0 -52
  429. package/node_modules/@tiptap/extension-bold/dist/index.d.ts.map +0 -1
  430. package/node_modules/@tiptap/extension-bold/dist/index.js +0 -108
  431. package/node_modules/@tiptap/extension-bold/dist/index.js.map +0 -1
  432. package/node_modules/@tiptap/extension-bold/package.json +0 -50
  433. package/node_modules/@tiptap/extension-bold/src/bold.test.ts +0 -25
  434. package/node_modules/@tiptap/extension-bold/src/bold.tsx +0 -163
  435. package/node_modules/@tiptap/extension-bold/src/index.ts +0 -5
  436. package/node_modules/@tiptap/extension-bubble-menu/LICENSE.md +0 -21
  437. package/node_modules/@tiptap/extension-bubble-menu/README.md +0 -18
  438. package/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs +0 -333
  439. package/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs.map +0 -1
  440. package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.cts +0 -170
  441. package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.cts.map +0 -1
  442. package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.ts +0 -170
  443. package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.ts.map +0 -1
  444. package/node_modules/@tiptap/extension-bubble-menu/dist/index.js +0 -326
  445. package/node_modules/@tiptap/extension-bubble-menu/dist/index.js.map +0 -1
  446. package/node_modules/@tiptap/extension-bubble-menu/package.json +0 -56
  447. package/node_modules/@tiptap/extension-bubble-menu/src/bubble-menu-plugin.test.ts +0 -289
  448. package/node_modules/@tiptap/extension-bubble-menu/src/bubble-menu-plugin.ts +0 -710
  449. package/node_modules/@tiptap/extension-bubble-menu/src/bubble-menu.ts +0 -50
  450. package/node_modules/@tiptap/extension-bubble-menu/src/index.ts +0 -6
  451. package/node_modules/@tiptap/extension-bullet-list/LICENSE.md +0 -21
  452. package/node_modules/@tiptap/extension-bullet-list/README.md +0 -18
  453. package/node_modules/@tiptap/extension-bullet-list/dist/index.cjs +0 -17
  454. package/node_modules/@tiptap/extension-bullet-list/dist/index.cjs.map +0 -1
  455. package/node_modules/@tiptap/extension-bullet-list/dist/index.d.cts +0 -2
  456. package/node_modules/@tiptap/extension-bullet-list/dist/index.d.ts +0 -2
  457. package/node_modules/@tiptap/extension-bullet-list/dist/index.js +0 -7
  458. package/node_modules/@tiptap/extension-bullet-list/dist/index.js.map +0 -1
  459. package/node_modules/@tiptap/extension-bullet-list/package.json +0 -50
  460. package/node_modules/@tiptap/extension-bullet-list/src/index.ts +0 -6
  461. package/node_modules/@tiptap/extension-code/LICENSE.md +0 -21
  462. package/node_modules/@tiptap/extension-code/README.md +0 -18
  463. package/node_modules/@tiptap/extension-code/dist/index.cjs +0 -136
  464. package/node_modules/@tiptap/extension-code/dist/index.cjs.map +0 -1
  465. package/node_modules/@tiptap/extension-code/dist/index.d.cts +0 -60
  466. package/node_modules/@tiptap/extension-code/dist/index.d.cts.map +0 -1
  467. package/node_modules/@tiptap/extension-code/dist/index.d.ts +0 -60
  468. package/node_modules/@tiptap/extension-code/dist/index.d.ts.map +0 -1
  469. package/node_modules/@tiptap/extension-code/dist/index.js +0 -127
  470. package/node_modules/@tiptap/extension-code/dist/index.js.map +0 -1
  471. package/node_modules/@tiptap/extension-code/package.json +0 -50
  472. package/node_modules/@tiptap/extension-code/src/code.test.ts +0 -122
  473. package/node_modules/@tiptap/extension-code/src/code.ts +0 -200
  474. package/node_modules/@tiptap/extension-code/src/index.ts +0 -5
  475. package/node_modules/@tiptap/extension-code-block/LICENSE.md +0 -21
  476. package/node_modules/@tiptap/extension-code-block/README.md +0 -18
  477. package/node_modules/@tiptap/extension-code-block/dist/index.cjs +0 -255
  478. package/node_modules/@tiptap/extension-code-block/dist/index.cjs.map +0 -1
  479. package/node_modules/@tiptap/extension-code-block/dist/index.d.cts +0 -84
  480. package/node_modules/@tiptap/extension-code-block/dist/index.d.cts.map +0 -1
  481. package/node_modules/@tiptap/extension-code-block/dist/index.d.ts +0 -84
  482. package/node_modules/@tiptap/extension-code-block/dist/index.d.ts.map +0 -1
  483. package/node_modules/@tiptap/extension-code-block/dist/index.js +0 -248
  484. package/node_modules/@tiptap/extension-code-block/dist/index.js.map +0 -1
  485. package/node_modules/@tiptap/extension-code-block/package.json +0 -52
  486. package/node_modules/@tiptap/extension-code-block/src/code-block.test.ts +0 -97
  487. package/node_modules/@tiptap/extension-code-block/src/code-block.ts +0 -514
  488. package/node_modules/@tiptap/extension-code-block/src/index.ts +0 -5
  489. package/node_modules/@tiptap/extension-document/LICENSE.md +0 -21
  490. package/node_modules/@tiptap/extension-document/README.md +0 -18
  491. package/node_modules/@tiptap/extension-document/dist/index.cjs +0 -26
  492. package/node_modules/@tiptap/extension-document/dist/index.cjs.map +0 -1
  493. package/node_modules/@tiptap/extension-document/dist/index.d.cts +0 -10
  494. package/node_modules/@tiptap/extension-document/dist/index.d.cts.map +0 -1
  495. package/node_modules/@tiptap/extension-document/dist/index.d.ts +0 -10
  496. package/node_modules/@tiptap/extension-document/dist/index.d.ts.map +0 -1
  497. package/node_modules/@tiptap/extension-document/dist/index.js +0 -22
  498. package/node_modules/@tiptap/extension-document/dist/index.js.map +0 -1
  499. package/node_modules/@tiptap/extension-document/package.json +0 -50
  500. package/node_modules/@tiptap/extension-document/src/document.ts +0 -19
  501. package/node_modules/@tiptap/extension-document/src/index.ts +0 -5
  502. package/node_modules/@tiptap/extension-dropcursor/LICENSE.md +0 -21
  503. package/node_modules/@tiptap/extension-dropcursor/README.md +0 -18
  504. package/node_modules/@tiptap/extension-dropcursor/dist/index.cjs +0 -17
  505. package/node_modules/@tiptap/extension-dropcursor/dist/index.cjs.map +0 -1
  506. package/node_modules/@tiptap/extension-dropcursor/dist/index.d.cts +0 -2
  507. package/node_modules/@tiptap/extension-dropcursor/dist/index.d.ts +0 -2
  508. package/node_modules/@tiptap/extension-dropcursor/dist/index.js +0 -7
  509. package/node_modules/@tiptap/extension-dropcursor/dist/index.js.map +0 -1
  510. package/node_modules/@tiptap/extension-dropcursor/package.json +0 -50
  511. package/node_modules/@tiptap/extension-dropcursor/src/index.ts +0 -6
  512. package/node_modules/@tiptap/extension-floating-menu/LICENSE.md +0 -21
  513. package/node_modules/@tiptap/extension-floating-menu/README.md +0 -18
  514. package/node_modules/@tiptap/extension-floating-menu/dist/index.cjs +0 -272
  515. package/node_modules/@tiptap/extension-floating-menu/dist/index.cjs.map +0 -1
  516. package/node_modules/@tiptap/extension-floating-menu/dist/index.d.cts +0 -180
  517. package/node_modules/@tiptap/extension-floating-menu/dist/index.d.cts.map +0 -1
  518. package/node_modules/@tiptap/extension-floating-menu/dist/index.d.ts +0 -180
  519. package/node_modules/@tiptap/extension-floating-menu/dist/index.d.ts.map +0 -1
  520. package/node_modules/@tiptap/extension-floating-menu/dist/index.js +0 -265
  521. package/node_modules/@tiptap/extension-floating-menu/dist/index.js.map +0 -1
  522. package/node_modules/@tiptap/extension-floating-menu/package.json +0 -55
  523. package/node_modules/@tiptap/extension-floating-menu/src/floating-menu-plugin.test.ts +0 -250
  524. package/node_modules/@tiptap/extension-floating-menu/src/floating-menu-plugin.ts +0 -580
  525. package/node_modules/@tiptap/extension-floating-menu/src/floating-menu.ts +0 -77
  526. package/node_modules/@tiptap/extension-floating-menu/src/index.ts +0 -6
  527. package/node_modules/@tiptap/extension-gapcursor/LICENSE.md +0 -21
  528. package/node_modules/@tiptap/extension-gapcursor/README.md +0 -18
  529. package/node_modules/@tiptap/extension-gapcursor/dist/index.cjs +0 -17
  530. package/node_modules/@tiptap/extension-gapcursor/dist/index.cjs.map +0 -1
  531. package/node_modules/@tiptap/extension-gapcursor/dist/index.d.cts +0 -2
  532. package/node_modules/@tiptap/extension-gapcursor/dist/index.d.ts +0 -2
  533. package/node_modules/@tiptap/extension-gapcursor/dist/index.js +0 -7
  534. package/node_modules/@tiptap/extension-gapcursor/dist/index.js.map +0 -1
  535. package/node_modules/@tiptap/extension-gapcursor/package.json +0 -50
  536. package/node_modules/@tiptap/extension-gapcursor/src/index.ts +0 -5
  537. package/node_modules/@tiptap/extension-hard-break/LICENSE.md +0 -21
  538. package/node_modules/@tiptap/extension-hard-break/README.md +0 -18
  539. package/node_modules/@tiptap/extension-hard-break/dist/index.cjs +0 -69
  540. package/node_modules/@tiptap/extension-hard-break/dist/index.cjs.map +0 -1
  541. package/node_modules/@tiptap/extension-hard-break/dist/index.d.cts +0 -35
  542. package/node_modules/@tiptap/extension-hard-break/dist/index.d.cts.map +0 -1
  543. package/node_modules/@tiptap/extension-hard-break/dist/index.d.ts +0 -35
  544. package/node_modules/@tiptap/extension-hard-break/dist/index.d.ts.map +0 -1
  545. package/node_modules/@tiptap/extension-hard-break/dist/index.js +0 -64
  546. package/node_modules/@tiptap/extension-hard-break/dist/index.js.map +0 -1
  547. package/node_modules/@tiptap/extension-hard-break/package.json +0 -50
  548. package/node_modules/@tiptap/extension-hard-break/src/hard-break.test.ts +0 -78
  549. package/node_modules/@tiptap/extension-hard-break/src/hard-break.ts +0 -121
  550. package/node_modules/@tiptap/extension-hard-break/src/index.ts +0 -5
  551. package/node_modules/@tiptap/extension-heading/LICENSE.md +0 -21
  552. package/node_modules/@tiptap/extension-heading/README.md +0 -18
  553. package/node_modules/@tiptap/extension-heading/dist/index.cjs +0 -93
  554. package/node_modules/@tiptap/extension-heading/dist/index.cjs.map +0 -1
  555. package/node_modules/@tiptap/extension-heading/dist/index.d.cts +0 -50
  556. package/node_modules/@tiptap/extension-heading/dist/index.d.cts.map +0 -1
  557. package/node_modules/@tiptap/extension-heading/dist/index.d.ts +0 -50
  558. package/node_modules/@tiptap/extension-heading/dist/index.d.ts.map +0 -1
  559. package/node_modules/@tiptap/extension-heading/dist/index.js +0 -88
  560. package/node_modules/@tiptap/extension-heading/dist/index.js.map +0 -1
  561. package/node_modules/@tiptap/extension-heading/package.json +0 -50
  562. package/node_modules/@tiptap/extension-heading/src/heading.ts +0 -152
  563. package/node_modules/@tiptap/extension-heading/src/index.ts +0 -5
  564. package/node_modules/@tiptap/extension-highlight/LICENSE.md +0 -21
  565. package/node_modules/@tiptap/extension-highlight/README.md +0 -18
  566. package/node_modules/@tiptap/extension-highlight/dist/index.cjs +0 -113
  567. package/node_modules/@tiptap/extension-highlight/dist/index.cjs.map +0 -1
  568. package/node_modules/@tiptap/extension-highlight/dist/index.d.cts +0 -59
  569. package/node_modules/@tiptap/extension-highlight/dist/index.d.cts.map +0 -1
  570. package/node_modules/@tiptap/extension-highlight/dist/index.d.ts +0 -59
  571. package/node_modules/@tiptap/extension-highlight/dist/index.d.ts.map +0 -1
  572. package/node_modules/@tiptap/extension-highlight/dist/index.js +0 -106
  573. package/node_modules/@tiptap/extension-highlight/dist/index.js.map +0 -1
  574. package/node_modules/@tiptap/extension-highlight/package.json +0 -50
  575. package/node_modules/@tiptap/extension-highlight/src/highlight.test.ts +0 -44
  576. package/node_modules/@tiptap/extension-highlight/src/highlight.ts +0 -190
  577. package/node_modules/@tiptap/extension-highlight/src/index.ts +0 -5
  578. package/node_modules/@tiptap/extension-horizontal-rule/LICENSE.md +0 -21
  579. package/node_modules/@tiptap/extension-horizontal-rule/README.md +0 -18
  580. package/node_modules/@tiptap/extension-horizontal-rule/dist/index.cjs +0 -78
  581. package/node_modules/@tiptap/extension-horizontal-rule/dist/index.cjs.map +0 -1
  582. package/node_modules/@tiptap/extension-horizontal-rule/dist/index.d.cts +0 -35
  583. package/node_modules/@tiptap/extension-horizontal-rule/dist/index.d.cts.map +0 -1
  584. package/node_modules/@tiptap/extension-horizontal-rule/dist/index.d.ts +0 -35
  585. package/node_modules/@tiptap/extension-horizontal-rule/dist/index.d.ts.map +0 -1
  586. package/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +0 -73
  587. package/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +0 -1
  588. package/node_modules/@tiptap/extension-horizontal-rule/package.json +0 -52
  589. package/node_modules/@tiptap/extension-horizontal-rule/src/horizontal-rule.test.ts +0 -58
  590. package/node_modules/@tiptap/extension-horizontal-rule/src/horizontal-rule.ts +0 -136
  591. package/node_modules/@tiptap/extension-horizontal-rule/src/index.ts +0 -5
  592. package/node_modules/@tiptap/extension-image/LICENSE.md +0 -21
  593. package/node_modules/@tiptap/extension-image/README.md +0 -18
  594. package/node_modules/@tiptap/extension-image/dist/index.cjs +0 -181
  595. package/node_modules/@tiptap/extension-image/dist/index.cjs.map +0 -1
  596. package/node_modules/@tiptap/extension-image/dist/index.d.cts +0 -69
  597. package/node_modules/@tiptap/extension-image/dist/index.d.cts.map +0 -1
  598. package/node_modules/@tiptap/extension-image/dist/index.d.ts +0 -69
  599. package/node_modules/@tiptap/extension-image/dist/index.d.ts.map +0 -1
  600. package/node_modules/@tiptap/extension-image/dist/index.js +0 -175
  601. package/node_modules/@tiptap/extension-image/dist/index.js.map +0 -1
  602. package/node_modules/@tiptap/extension-image/package.json +0 -50
  603. package/node_modules/@tiptap/extension-image/src/image.test.ts +0 -556
  604. package/node_modules/@tiptap/extension-image/src/image.ts +0 -330
  605. package/node_modules/@tiptap/extension-image/src/index.ts +0 -5
  606. package/node_modules/@tiptap/extension-italic/LICENSE.md +0 -21
  607. package/node_modules/@tiptap/extension-italic/README.md +0 -18
  608. package/node_modules/@tiptap/extension-italic/dist/index.cjs +0 -113
  609. package/node_modules/@tiptap/extension-italic/dist/index.cjs.map +0 -1
  610. package/node_modules/@tiptap/extension-italic/dist/index.d.cts +0 -55
  611. package/node_modules/@tiptap/extension-italic/dist/index.d.cts.map +0 -1
  612. package/node_modules/@tiptap/extension-italic/dist/index.d.ts +0 -55
  613. package/node_modules/@tiptap/extension-italic/dist/index.d.ts.map +0 -1
  614. package/node_modules/@tiptap/extension-italic/dist/index.js +0 -104
  615. package/node_modules/@tiptap/extension-italic/dist/index.js.map +0 -1
  616. package/node_modules/@tiptap/extension-italic/package.json +0 -50
  617. package/node_modules/@tiptap/extension-italic/src/index.ts +0 -5
  618. package/node_modules/@tiptap/extension-italic/src/italic.ts +0 -160
  619. package/node_modules/@tiptap/extension-link/LICENSE.md +0 -21
  620. package/node_modules/@tiptap/extension-link/README.md +0 -18
  621. package/node_modules/@tiptap/extension-link/dist/index.cjs +0 -560
  622. package/node_modules/@tiptap/extension-link/dist/index.cjs.map +0 -1
  623. package/node_modules/@tiptap/extension-link/dist/index.d.cts +0 -159
  624. package/node_modules/@tiptap/extension-link/dist/index.d.cts.map +0 -1
  625. package/node_modules/@tiptap/extension-link/dist/index.d.ts +0 -159
  626. package/node_modules/@tiptap/extension-link/dist/index.d.ts.map +0 -1
  627. package/node_modules/@tiptap/extension-link/dist/index.js +0 -553
  628. package/node_modules/@tiptap/extension-link/dist/index.js.map +0 -1
  629. package/node_modules/@tiptap/extension-link/package.json +0 -56
  630. package/node_modules/@tiptap/extension-link/src/helpers/autolink.ts +0 -211
  631. package/node_modules/@tiptap/extension-link/src/helpers/clickHandler.ts +0 -73
  632. package/node_modules/@tiptap/extension-link/src/helpers/markdownLink.ts +0 -205
  633. package/node_modules/@tiptap/extension-link/src/helpers/pasteHandler.ts +0 -53
  634. package/node_modules/@tiptap/extension-link/src/helpers/unlinkTrailingWhitespace.ts +0 -46
  635. package/node_modules/@tiptap/extension-link/src/helpers/whitespace.ts +0 -8
  636. package/node_modules/@tiptap/extension-link/src/index.ts +0 -5
  637. package/node_modules/@tiptap/extension-link/src/link.ts +0 -555
  638. package/node_modules/@tiptap/extension-list/LICENSE.md +0 -21
  639. package/node_modules/@tiptap/extension-list/README.md +0 -18
  640. package/node_modules/@tiptap/extension-list/dist/bullet-list/index.cjs +0 -84
  641. package/node_modules/@tiptap/extension-list/dist/bullet-list/index.cjs.map +0 -1
  642. package/node_modules/@tiptap/extension-list/dist/bullet-list/index.d.cts +0 -52
  643. package/node_modules/@tiptap/extension-list/dist/bullet-list/index.d.cts.map +0 -1
  644. package/node_modules/@tiptap/extension-list/dist/bullet-list/index.d.ts +0 -52
  645. package/node_modules/@tiptap/extension-list/dist/bullet-list/index.d.ts.map +0 -1
  646. package/node_modules/@tiptap/extension-list/dist/bullet-list/index.js +0 -82
  647. package/node_modules/@tiptap/extension-list/dist/bullet-list/index.js.map +0 -1
  648. package/node_modules/@tiptap/extension-list/dist/index.cjs +0 -1570
  649. package/node_modules/@tiptap/extension-list/dist/index.cjs.map +0 -1
  650. package/node_modules/@tiptap/extension-list/dist/index.d.cts +0 -391
  651. package/node_modules/@tiptap/extension-list/dist/index.d.cts.map +0 -1
  652. package/node_modules/@tiptap/extension-list/dist/index.d.ts +0 -390
  653. package/node_modules/@tiptap/extension-list/dist/index.d.ts.map +0 -1
  654. package/node_modules/@tiptap/extension-list/dist/index.js +0 -1533
  655. package/node_modules/@tiptap/extension-list/dist/index.js.map +0 -1
  656. package/node_modules/@tiptap/extension-list/dist/item/index.cjs +0 -308
  657. package/node_modules/@tiptap/extension-list/dist/item/index.cjs.map +0 -1
  658. package/node_modules/@tiptap/extension-list/dist/item/index.d.cts +0 -30
  659. package/node_modules/@tiptap/extension-list/dist/item/index.d.cts.map +0 -1
  660. package/node_modules/@tiptap/extension-list/dist/item/index.d.ts +0 -30
  661. package/node_modules/@tiptap/extension-list/dist/item/index.d.ts.map +0 -1
  662. package/node_modules/@tiptap/extension-list/dist/item/index.js +0 -307
  663. package/node_modules/@tiptap/extension-list/dist/item/index.js.map +0 -1
  664. package/node_modules/@tiptap/extension-list/dist/keymap/index.cjs +0 -263
  665. package/node_modules/@tiptap/extension-list/dist/keymap/index.cjs.map +0 -1
  666. package/node_modules/@tiptap/extension-list/dist/keymap/index.d.cts +0 -66
  667. package/node_modules/@tiptap/extension-list/dist/keymap/index.d.cts.map +0 -1
  668. package/node_modules/@tiptap/extension-list/dist/keymap/index.d.ts +0 -65
  669. package/node_modules/@tiptap/extension-list/dist/keymap/index.d.ts.map +0 -1
  670. package/node_modules/@tiptap/extension-list/dist/keymap/index.js +0 -245
  671. package/node_modules/@tiptap/extension-list/dist/keymap/index.js.map +0 -1
  672. package/node_modules/@tiptap/extension-list/dist/keymap/rolldown-runtime-D7D4PA-g.js +0 -13
  673. package/node_modules/@tiptap/extension-list/dist/kit/index.cjs +0 -1487
  674. package/node_modules/@tiptap/extension-list/dist/kit/index.cjs.map +0 -1
  675. package/node_modules/@tiptap/extension-list/dist/kit/index.d.cts +0 -235
  676. package/node_modules/@tiptap/extension-list/dist/kit/index.d.cts.map +0 -1
  677. package/node_modules/@tiptap/extension-list/dist/kit/index.d.ts +0 -235
  678. package/node_modules/@tiptap/extension-list/dist/kit/index.d.ts.map +0 -1
  679. package/node_modules/@tiptap/extension-list/dist/kit/index.js +0 -1486
  680. package/node_modules/@tiptap/extension-list/dist/kit/index.js.map +0 -1
  681. package/node_modules/@tiptap/extension-list/dist/ordered-list/index.cjs +0 -671
  682. package/node_modules/@tiptap/extension-list/dist/ordered-list/index.cjs.map +0 -1
  683. package/node_modules/@tiptap/extension-list/dist/ordered-list/index.d.cts +0 -120
  684. package/node_modules/@tiptap/extension-list/dist/ordered-list/index.d.cts.map +0 -1
  685. package/node_modules/@tiptap/extension-list/dist/ordered-list/index.d.ts +0 -120
  686. package/node_modules/@tiptap/extension-list/dist/ordered-list/index.d.ts.map +0 -1
  687. package/node_modules/@tiptap/extension-list/dist/ordered-list/index.js +0 -659
  688. package/node_modules/@tiptap/extension-list/dist/ordered-list/index.js.map +0 -1
  689. package/node_modules/@tiptap/extension-list/dist/rolldown-runtime-D7D4PA-g.js +0 -13
  690. package/node_modules/@tiptap/extension-list/dist/task-item/index.cjs +0 -327
  691. package/node_modules/@tiptap/extension-list/dist/task-item/index.cjs.map +0 -1
  692. package/node_modules/@tiptap/extension-list/dist/task-item/index.d.cts +0 -69
  693. package/node_modules/@tiptap/extension-list/dist/task-item/index.d.cts.map +0 -1
  694. package/node_modules/@tiptap/extension-list/dist/task-item/index.d.ts +0 -69
  695. package/node_modules/@tiptap/extension-list/dist/task-item/index.d.ts.map +0 -1
  696. package/node_modules/@tiptap/extension-list/dist/task-item/index.js +0 -325
  697. package/node_modules/@tiptap/extension-list/dist/task-item/index.js.map +0 -1
  698. package/node_modules/@tiptap/extension-list/dist/task-list/index.cjs +0 -121
  699. package/node_modules/@tiptap/extension-list/dist/task-list/index.cjs.map +0 -1
  700. package/node_modules/@tiptap/extension-list/dist/task-list/index.d.cts +0 -35
  701. package/node_modules/@tiptap/extension-list/dist/task-list/index.d.cts.map +0 -1
  702. package/node_modules/@tiptap/extension-list/dist/task-list/index.d.ts +0 -35
  703. package/node_modules/@tiptap/extension-list/dist/task-list/index.d.ts.map +0 -1
  704. package/node_modules/@tiptap/extension-list/dist/task-list/index.js +0 -120
  705. package/node_modules/@tiptap/extension-list/dist/task-list/index.js.map +0 -1
  706. package/node_modules/@tiptap/extension-list/package.json +0 -108
  707. package/node_modules/@tiptap/extension-list/src/bullet-list/bullet-list.ts +0 -151
  708. package/node_modules/@tiptap/extension-list/src/bullet-list/index.ts +0 -1
  709. package/node_modules/@tiptap/extension-list/src/helpers/createBranchingListDeleteKeymap.ts +0 -24
  710. package/node_modules/@tiptap/extension-list/src/helpers/getBranchingNestedListAtCursor.ts +0 -116
  711. package/node_modules/@tiptap/extension-list/src/helpers/handleDeleteBranchingNestedList.ts +0 -25
  712. package/node_modules/@tiptap/extension-list/src/helpers/hasBranchingNestedListAfterCursor.ts +0 -30
  713. package/node_modules/@tiptap/extension-list/src/helpers/hoistBranchingNestedList.ts +0 -56
  714. package/node_modules/@tiptap/extension-list/src/index.ts +0 -7
  715. package/node_modules/@tiptap/extension-list/src/item/index.ts +0 -1
  716. package/node_modules/@tiptap/extension-list/src/item/list-item.test.ts +0 -46
  717. package/node_modules/@tiptap/extension-list/src/item/list-item.ts +0 -206
  718. package/node_modules/@tiptap/extension-list/src/keymap/index.ts +0 -2
  719. package/node_modules/@tiptap/extension-list/src/keymap/list-keymap.ts +0 -120
  720. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/findListItemPos.ts +0 -30
  721. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/getNextListDepth.ts +0 -16
  722. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/handleBackspace.ts +0 -70
  723. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/handleDelete.ts +0 -44
  724. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/handleTab.ts +0 -48
  725. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/hasListBefore.ts +0 -19
  726. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/hasListItemAfter.ts +0 -17
  727. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/hasListItemBefore.ts +0 -17
  728. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/index.ts +0 -11
  729. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/listItemHasSubList.ts +0 -21
  730. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/nextListIsDeeper.ts +0 -19
  731. package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/nextListIsHigher.ts +0 -19
  732. package/node_modules/@tiptap/extension-list/src/kit/index.ts +0 -81
  733. package/node_modules/@tiptap/extension-list/src/ordered-list/collectOrderedListItemsFromSource.ts +0 -58
  734. package/node_modules/@tiptap/extension-list/src/ordered-list/index.ts +0 -13
  735. package/node_modules/@tiptap/extension-list/src/ordered-list/ordered-list.ts +0 -360
  736. package/node_modules/@tiptap/extension-list/src/ordered-list/roman.test.ts +0 -122
  737. package/node_modules/@tiptap/extension-list/src/ordered-list/roman.ts +0 -295
  738. package/node_modules/@tiptap/extension-list/src/ordered-list/utils.test.ts +0 -105
  739. package/node_modules/@tiptap/extension-list/src/ordered-list/utils.ts +0 -399
  740. package/node_modules/@tiptap/extension-list/src/task-item/index.ts +0 -1
  741. package/node_modules/@tiptap/extension-list/src/task-item/task-item.test.ts +0 -1394
  742. package/node_modules/@tiptap/extension-list/src/task-item/task-item.ts +0 -359
  743. package/node_modules/@tiptap/extension-list/src/task-list/index.ts +0 -1
  744. package/node_modules/@tiptap/extension-list/src/task-list/task-list.ts +0 -194
  745. package/node_modules/@tiptap/extension-list-item/LICENSE.md +0 -21
  746. package/node_modules/@tiptap/extension-list-item/README.md +0 -18
  747. package/node_modules/@tiptap/extension-list-item/dist/index.cjs +0 -17
  748. package/node_modules/@tiptap/extension-list-item/dist/index.cjs.map +0 -1
  749. package/node_modules/@tiptap/extension-list-item/dist/index.d.cts +0 -2
  750. package/node_modules/@tiptap/extension-list-item/dist/index.d.ts +0 -2
  751. package/node_modules/@tiptap/extension-list-item/dist/index.js +0 -7
  752. package/node_modules/@tiptap/extension-list-item/dist/index.js.map +0 -1
  753. package/node_modules/@tiptap/extension-list-item/package.json +0 -50
  754. package/node_modules/@tiptap/extension-list-item/src/index.ts +0 -6
  755. package/node_modules/@tiptap/extension-list-keymap/LICENSE.md +0 -21
  756. package/node_modules/@tiptap/extension-list-keymap/README.md +0 -18
  757. package/node_modules/@tiptap/extension-list-keymap/dist/index.cjs +0 -23
  758. package/node_modules/@tiptap/extension-list-keymap/dist/index.cjs.map +0 -1
  759. package/node_modules/@tiptap/extension-list-keymap/dist/index.d.cts +0 -2
  760. package/node_modules/@tiptap/extension-list-keymap/dist/index.d.ts +0 -2
  761. package/node_modules/@tiptap/extension-list-keymap/dist/index.js +0 -7
  762. package/node_modules/@tiptap/extension-list-keymap/dist/index.js.map +0 -1
  763. package/node_modules/@tiptap/extension-list-keymap/package.json +0 -50
  764. package/node_modules/@tiptap/extension-list-keymap/src/index.ts +0 -6
  765. package/node_modules/@tiptap/extension-ordered-list/LICENSE.md +0 -21
  766. package/node_modules/@tiptap/extension-ordered-list/README.md +0 -18
  767. package/node_modules/@tiptap/extension-ordered-list/dist/index.cjs +0 -17
  768. package/node_modules/@tiptap/extension-ordered-list/dist/index.cjs.map +0 -1
  769. package/node_modules/@tiptap/extension-ordered-list/dist/index.d.cts +0 -2
  770. package/node_modules/@tiptap/extension-ordered-list/dist/index.d.ts +0 -2
  771. package/node_modules/@tiptap/extension-ordered-list/dist/index.js +0 -7
  772. package/node_modules/@tiptap/extension-ordered-list/dist/index.js.map +0 -1
  773. package/node_modules/@tiptap/extension-ordered-list/package.json +0 -50
  774. package/node_modules/@tiptap/extension-ordered-list/src/index.ts +0 -6
  775. package/node_modules/@tiptap/extension-paragraph/LICENSE.md +0 -21
  776. package/node_modules/@tiptap/extension-paragraph/README.md +0 -18
  777. package/node_modules/@tiptap/extension-paragraph/dist/index.cjs +0 -73
  778. package/node_modules/@tiptap/extension-paragraph/dist/index.cjs.map +0 -1
  779. package/node_modules/@tiptap/extension-paragraph/dist/index.d.cts +0 -29
  780. package/node_modules/@tiptap/extension-paragraph/dist/index.d.cts.map +0 -1
  781. package/node_modules/@tiptap/extension-paragraph/dist/index.d.ts +0 -29
  782. package/node_modules/@tiptap/extension-paragraph/dist/index.d.ts.map +0 -1
  783. package/node_modules/@tiptap/extension-paragraph/dist/index.js +0 -68
  784. package/node_modules/@tiptap/extension-paragraph/dist/index.js.map +0 -1
  785. package/node_modules/@tiptap/extension-paragraph/package.json +0 -50
  786. package/node_modules/@tiptap/extension-paragraph/src/index.ts +0 -5
  787. package/node_modules/@tiptap/extension-paragraph/src/paragraph.ts +0 -139
  788. package/node_modules/@tiptap/extension-strike/LICENSE.md +0 -21
  789. package/node_modules/@tiptap/extension-strike/README.md +0 -18
  790. package/node_modules/@tiptap/extension-strike/dist/index.cjs +0 -88
  791. package/node_modules/@tiptap/extension-strike/dist/index.cjs.map +0 -1
  792. package/node_modules/@tiptap/extension-strike/dist/index.d.cts +0 -47
  793. package/node_modules/@tiptap/extension-strike/dist/index.d.cts.map +0 -1
  794. package/node_modules/@tiptap/extension-strike/dist/index.d.ts +0 -47
  795. package/node_modules/@tiptap/extension-strike/dist/index.d.ts.map +0 -1
  796. package/node_modules/@tiptap/extension-strike/dist/index.js +0 -81
  797. package/node_modules/@tiptap/extension-strike/dist/index.js.map +0 -1
  798. package/node_modules/@tiptap/extension-strike/package.json +0 -50
  799. package/node_modules/@tiptap/extension-strike/src/index.ts +0 -5
  800. package/node_modules/@tiptap/extension-strike/src/strike.ts +0 -134
  801. package/node_modules/@tiptap/extension-subscript/LICENSE.md +0 -21
  802. package/node_modules/@tiptap/extension-subscript/README.md +0 -18
  803. package/node_modules/@tiptap/extension-subscript/dist/index.cjs +0 -56
  804. package/node_modules/@tiptap/extension-subscript/dist/index.cjs.map +0 -1
  805. package/node_modules/@tiptap/extension-subscript/dist/index.d.cts +0 -39
  806. package/node_modules/@tiptap/extension-subscript/dist/index.d.cts.map +0 -1
  807. package/node_modules/@tiptap/extension-subscript/dist/index.d.ts +0 -39
  808. package/node_modules/@tiptap/extension-subscript/dist/index.d.ts.map +0 -1
  809. package/node_modules/@tiptap/extension-subscript/dist/index.js +0 -51
  810. package/node_modules/@tiptap/extension-subscript/dist/index.js.map +0 -1
  811. package/node_modules/@tiptap/extension-subscript/package.json +0 -52
  812. package/node_modules/@tiptap/extension-subscript/src/index.ts +0 -5
  813. package/node_modules/@tiptap/extension-subscript/src/subscript.test.ts +0 -48
  814. package/node_modules/@tiptap/extension-subscript/src/subscript.ts +0 -97
  815. package/node_modules/@tiptap/extension-superscript/LICENSE.md +0 -21
  816. package/node_modules/@tiptap/extension-superscript/README.md +0 -18
  817. package/node_modules/@tiptap/extension-superscript/dist/index.cjs +0 -56
  818. package/node_modules/@tiptap/extension-superscript/dist/index.cjs.map +0 -1
  819. package/node_modules/@tiptap/extension-superscript/dist/index.d.cts +0 -39
  820. package/node_modules/@tiptap/extension-superscript/dist/index.d.cts.map +0 -1
  821. package/node_modules/@tiptap/extension-superscript/dist/index.d.ts +0 -39
  822. package/node_modules/@tiptap/extension-superscript/dist/index.d.ts.map +0 -1
  823. package/node_modules/@tiptap/extension-superscript/dist/index.js +0 -51
  824. package/node_modules/@tiptap/extension-superscript/dist/index.js.map +0 -1
  825. package/node_modules/@tiptap/extension-superscript/package.json +0 -52
  826. package/node_modules/@tiptap/extension-superscript/src/index.ts +0 -5
  827. package/node_modules/@tiptap/extension-superscript/src/superscript.test.ts +0 -48
  828. package/node_modules/@tiptap/extension-superscript/src/superscript.ts +0 -97
  829. package/node_modules/@tiptap/extension-table/LICENSE.md +0 -21
  830. package/node_modules/@tiptap/extension-table/README.md +0 -18
  831. package/node_modules/@tiptap/extension-table/dist/cell/index.cjs +0 -142
  832. package/node_modules/@tiptap/extension-table/dist/cell/index.cjs.map +0 -1
  833. package/node_modules/@tiptap/extension-table/dist/cell/index.d.cts +0 -35
  834. package/node_modules/@tiptap/extension-table/dist/cell/index.d.cts.map +0 -1
  835. package/node_modules/@tiptap/extension-table/dist/cell/index.d.ts +0 -35
  836. package/node_modules/@tiptap/extension-table/dist/cell/index.d.ts.map +0 -1
  837. package/node_modules/@tiptap/extension-table/dist/cell/index.js +0 -141
  838. package/node_modules/@tiptap/extension-table/dist/cell/index.js.map +0 -1
  839. package/node_modules/@tiptap/extension-table/dist/header/index.cjs +0 -142
  840. package/node_modules/@tiptap/extension-table/dist/header/index.cjs.map +0 -1
  841. package/node_modules/@tiptap/extension-table/dist/header/index.d.cts +0 -35
  842. package/node_modules/@tiptap/extension-table/dist/header/index.d.cts.map +0 -1
  843. package/node_modules/@tiptap/extension-table/dist/header/index.d.ts +0 -35
  844. package/node_modules/@tiptap/extension-table/dist/header/index.d.ts.map +0 -1
  845. package/node_modules/@tiptap/extension-table/dist/header/index.js +0 -141
  846. package/node_modules/@tiptap/extension-table/dist/header/index.js.map +0 -1
  847. package/node_modules/@tiptap/extension-table/dist/index.cjs +0 -832
  848. package/node_modules/@tiptap/extension-table/dist/index.cjs.map +0 -1
  849. package/node_modules/@tiptap/extension-table/dist/index.d.cts +0 -344
  850. package/node_modules/@tiptap/extension-table/dist/index.d.cts.map +0 -1
  851. package/node_modules/@tiptap/extension-table/dist/index.d.ts +0 -344
  852. package/node_modules/@tiptap/extension-table/dist/index.d.ts.map +0 -1
  853. package/node_modules/@tiptap/extension-table/dist/index.js +0 -819
  854. package/node_modules/@tiptap/extension-table/dist/index.js.map +0 -1
  855. package/node_modules/@tiptap/extension-table/dist/kit/index.cjs +0 -817
  856. package/node_modules/@tiptap/extension-table/dist/kit/index.cjs.map +0 -1
  857. package/node_modules/@tiptap/extension-table/dist/kit/index.d.cts +0 -265
  858. package/node_modules/@tiptap/extension-table/dist/kit/index.d.cts.map +0 -1
  859. package/node_modules/@tiptap/extension-table/dist/kit/index.d.ts +0 -265
  860. package/node_modules/@tiptap/extension-table/dist/kit/index.d.ts.map +0 -1
  861. package/node_modules/@tiptap/extension-table/dist/kit/index.js +0 -816
  862. package/node_modules/@tiptap/extension-table/dist/kit/index.js.map +0 -1
  863. package/node_modules/@tiptap/extension-table/dist/row/index.cjs +0 -29
  864. package/node_modules/@tiptap/extension-table/dist/row/index.cjs.map +0 -1
  865. package/node_modules/@tiptap/extension-table/dist/row/index.d.cts +0 -35
  866. package/node_modules/@tiptap/extension-table/dist/row/index.d.cts.map +0 -1
  867. package/node_modules/@tiptap/extension-table/dist/row/index.d.ts +0 -35
  868. package/node_modules/@tiptap/extension-table/dist/row/index.d.ts.map +0 -1
  869. package/node_modules/@tiptap/extension-table/dist/row/index.js +0 -28
  870. package/node_modules/@tiptap/extension-table/dist/row/index.js.map +0 -1
  871. package/node_modules/@tiptap/extension-table/dist/table/index.cjs +0 -616
  872. package/node_modules/@tiptap/extension-table/dist/table/index.cjs.map +0 -1
  873. package/node_modules/@tiptap/extension-table/dist/table/index.d.cts +0 -254
  874. package/node_modules/@tiptap/extension-table/dist/table/index.d.cts.map +0 -1
  875. package/node_modules/@tiptap/extension-table/dist/table/index.d.ts +0 -254
  876. package/node_modules/@tiptap/extension-table/dist/table/index.d.ts.map +0 -1
  877. package/node_modules/@tiptap/extension-table/dist/table/index.js +0 -609
  878. package/node_modules/@tiptap/extension-table/dist/table/index.js.map +0 -1
  879. package/node_modules/@tiptap/extension-table/package.json +0 -92
  880. package/node_modules/@tiptap/extension-table/src/cell/index.ts +0 -1
  881. package/node_modules/@tiptap/extension-table/src/cell/table-cell.test.ts +0 -220
  882. package/node_modules/@tiptap/extension-table/src/cell/table-cell.ts +0 -74
  883. package/node_modules/@tiptap/extension-table/src/header/index.ts +0 -1
  884. package/node_modules/@tiptap/extension-table/src/header/table-header.test.ts +0 -193
  885. package/node_modules/@tiptap/extension-table/src/header/table-header.ts +0 -74
  886. package/node_modules/@tiptap/extension-table/src/index.ts +0 -6
  887. package/node_modules/@tiptap/extension-table/src/kit/index.ts +0 -64
  888. package/node_modules/@tiptap/extension-table/src/row/index.ts +0 -1
  889. package/node_modules/@tiptap/extension-table/src/row/table-row.ts +0 -38
  890. package/node_modules/@tiptap/extension-table/src/table/TableView.ts +0 -154
  891. package/node_modules/@tiptap/extension-table/src/table/index.ts +0 -4
  892. package/node_modules/@tiptap/extension-table/src/table/table.test.ts +0 -76
  893. package/node_modules/@tiptap/extension-table/src/table/table.ts +0 -648
  894. package/node_modules/@tiptap/extension-table/src/table/utilities/colStyle.ts +0 -12
  895. package/node_modules/@tiptap/extension-table/src/table/utilities/createCell.ts +0 -12
  896. package/node_modules/@tiptap/extension-table/src/table/utilities/createColGroup.ts +0 -69
  897. package/node_modules/@tiptap/extension-table/src/table/utilities/createTable.ts +0 -40
  898. package/node_modules/@tiptap/extension-table/src/table/utilities/deleteTableWhenAllCellsSelected.ts +0 -37
  899. package/node_modules/@tiptap/extension-table/src/table/utilities/getTableNodeTypes.ts +0 -21
  900. package/node_modules/@tiptap/extension-table/src/table/utilities/isCellSelection.ts +0 -5
  901. package/node_modules/@tiptap/extension-table/src/table/utilities/keepCursorInTable.ts +0 -29
  902. package/node_modules/@tiptap/extension-table/src/table/utilities/markdown.test.ts +0 -123
  903. package/node_modules/@tiptap/extension-table/src/table/utilities/markdown.ts +0 -233
  904. package/node_modules/@tiptap/extension-table/src/table/utilities/preserveCellSelectionOnContextMenu.test.ts +0 -166
  905. package/node_modules/@tiptap/extension-table/src/table/utilities/preserveCellSelectionOnContextMenu.ts +0 -69
  906. package/node_modules/@tiptap/extension-table/src/types.ts +0 -19
  907. package/node_modules/@tiptap/extension-table/src/utils/fillEmptyCellContent.ts +0 -25
  908. package/node_modules/@tiptap/extension-table/src/utils/omitDefaultSpanAttribute.ts +0 -15
  909. package/node_modules/@tiptap/extension-table/src/utils/parseAlign.ts +0 -80
  910. package/node_modules/@tiptap/extension-table/src/utils/parseColwidth.ts +0 -37
  911. package/node_modules/@tiptap/extension-text/LICENSE.md +0 -21
  912. package/node_modules/@tiptap/extension-text/README.md +0 -18
  913. package/node_modules/@tiptap/extension-text/dist/index.cjs +0 -28
  914. package/node_modules/@tiptap/extension-text/dist/index.cjs.map +0 -1
  915. package/node_modules/@tiptap/extension-text/dist/index.d.cts +0 -10
  916. package/node_modules/@tiptap/extension-text/dist/index.d.cts.map +0 -1
  917. package/node_modules/@tiptap/extension-text/dist/index.d.ts +0 -10
  918. package/node_modules/@tiptap/extension-text/dist/index.d.ts.map +0 -1
  919. package/node_modules/@tiptap/extension-text/dist/index.js +0 -24
  920. package/node_modules/@tiptap/extension-text/dist/index.js.map +0 -1
  921. package/node_modules/@tiptap/extension-text/package.json +0 -50
  922. package/node_modules/@tiptap/extension-text/src/index.ts +0 -5
  923. package/node_modules/@tiptap/extension-text/src/text.ts +0 -20
  924. package/node_modules/@tiptap/extension-text-align/LICENSE.md +0 -21
  925. package/node_modules/@tiptap/extension-text-align/README.md +0 -18
  926. package/node_modules/@tiptap/extension-text-align/dist/index.cjs +0 -73
  927. package/node_modules/@tiptap/extension-text-align/dist/index.cjs.map +0 -1
  928. package/node_modules/@tiptap/extension-text-align/dist/index.d.cts +0 -53
  929. package/node_modules/@tiptap/extension-text-align/dist/index.d.cts.map +0 -1
  930. package/node_modules/@tiptap/extension-text-align/dist/index.d.ts +0 -53
  931. package/node_modules/@tiptap/extension-text-align/dist/index.d.ts.map +0 -1
  932. package/node_modules/@tiptap/extension-text-align/dist/index.js +0 -68
  933. package/node_modules/@tiptap/extension-text-align/dist/index.js.map +0 -1
  934. package/node_modules/@tiptap/extension-text-align/package.json +0 -50
  935. package/node_modules/@tiptap/extension-text-align/src/index.ts +0 -5
  936. package/node_modules/@tiptap/extension-text-align/src/text-align.test.ts +0 -41
  937. package/node_modules/@tiptap/extension-text-align/src/text-align.ts +0 -140
  938. package/node_modules/@tiptap/extension-text-style/LICENSE.md +0 -21
  939. package/node_modules/@tiptap/extension-text-style/README.md +0 -18
  940. package/node_modules/@tiptap/extension-text-style/dist/background-color/index.cjs +0 -121
  941. package/node_modules/@tiptap/extension-text-style/dist/background-color/index.cjs.map +0 -1
  942. package/node_modules/@tiptap/extension-text-style/dist/background-color/index.d.cts +0 -161
  943. package/node_modules/@tiptap/extension-text-style/dist/background-color/index.d.cts.map +0 -1
  944. package/node_modules/@tiptap/extension-text-style/dist/background-color/index.d.ts +0 -161
  945. package/node_modules/@tiptap/extension-text-style/dist/background-color/index.d.ts.map +0 -1
  946. package/node_modules/@tiptap/extension-text-style/dist/background-color/index.js +0 -116
  947. package/node_modules/@tiptap/extension-text-style/dist/background-color/index.js.map +0 -1
  948. package/node_modules/@tiptap/extension-text-style/dist/color/index.cjs +0 -121
  949. package/node_modules/@tiptap/extension-text-style/dist/color/index.cjs.map +0 -1
  950. package/node_modules/@tiptap/extension-text-style/dist/color/index.d.cts +0 -161
  951. package/node_modules/@tiptap/extension-text-style/dist/color/index.d.cts.map +0 -1
  952. package/node_modules/@tiptap/extension-text-style/dist/color/index.d.ts +0 -161
  953. package/node_modules/@tiptap/extension-text-style/dist/color/index.d.ts.map +0 -1
  954. package/node_modules/@tiptap/extension-text-style/dist/color/index.js +0 -116
  955. package/node_modules/@tiptap/extension-text-style/dist/color/index.js.map +0 -1
  956. package/node_modules/@tiptap/extension-text-style/dist/font-family/index.cjs +0 -120
  957. package/node_modules/@tiptap/extension-text-style/dist/font-family/index.cjs.map +0 -1
  958. package/node_modules/@tiptap/extension-text-style/dist/font-family/index.d.cts +0 -161
  959. package/node_modules/@tiptap/extension-text-style/dist/font-family/index.d.cts.map +0 -1
  960. package/node_modules/@tiptap/extension-text-style/dist/font-family/index.d.ts +0 -161
  961. package/node_modules/@tiptap/extension-text-style/dist/font-family/index.d.ts.map +0 -1
  962. package/node_modules/@tiptap/extension-text-style/dist/font-family/index.js +0 -115
  963. package/node_modules/@tiptap/extension-text-style/dist/font-family/index.js.map +0 -1
  964. package/node_modules/@tiptap/extension-text-style/dist/font-size/index.cjs +0 -120
  965. package/node_modules/@tiptap/extension-text-style/dist/font-size/index.cjs.map +0 -1
  966. package/node_modules/@tiptap/extension-text-style/dist/font-size/index.d.cts +0 -161
  967. package/node_modules/@tiptap/extension-text-style/dist/font-size/index.d.cts.map +0 -1
  968. package/node_modules/@tiptap/extension-text-style/dist/font-size/index.d.ts +0 -161
  969. package/node_modules/@tiptap/extension-text-style/dist/font-size/index.d.ts.map +0 -1
  970. package/node_modules/@tiptap/extension-text-style/dist/font-size/index.js +0 -115
  971. package/node_modules/@tiptap/extension-text-style/dist/font-size/index.js.map +0 -1
  972. package/node_modules/@tiptap/extension-text-style/dist/index.cjs +0 -298
  973. package/node_modules/@tiptap/extension-text-style/dist/index.cjs.map +0 -1
  974. package/node_modules/@tiptap/extension-text-style/dist/index.d.cts +0 -275
  975. package/node_modules/@tiptap/extension-text-style/dist/index.d.cts.map +0 -1
  976. package/node_modules/@tiptap/extension-text-style/dist/index.d.ts +0 -275
  977. package/node_modules/@tiptap/extension-text-style/dist/index.d.ts.map +0 -1
  978. package/node_modules/@tiptap/extension-text-style/dist/index.js +0 -291
  979. package/node_modules/@tiptap/extension-text-style/dist/index.js.map +0 -1
  980. package/node_modules/@tiptap/extension-text-style/dist/line-height/index.cjs +0 -120
  981. package/node_modules/@tiptap/extension-text-style/dist/line-height/index.cjs.map +0 -1
  982. package/node_modules/@tiptap/extension-text-style/dist/line-height/index.d.cts +0 -161
  983. package/node_modules/@tiptap/extension-text-style/dist/line-height/index.d.cts.map +0 -1
  984. package/node_modules/@tiptap/extension-text-style/dist/line-height/index.d.ts +0 -161
  985. package/node_modules/@tiptap/extension-text-style/dist/line-height/index.d.ts.map +0 -1
  986. package/node_modules/@tiptap/extension-text-style/dist/line-height/index.js +0 -115
  987. package/node_modules/@tiptap/extension-text-style/dist/line-height/index.js.map +0 -1
  988. package/node_modules/@tiptap/extension-text-style/dist/text-style/index.cjs +0 -80
  989. package/node_modules/@tiptap/extension-text-style/dist/text-style/index.cjs.map +0 -1
  990. package/node_modules/@tiptap/extension-text-style/dist/text-style/index.d.cts +0 -170
  991. package/node_modules/@tiptap/extension-text-style/dist/text-style/index.d.cts.map +0 -1
  992. package/node_modules/@tiptap/extension-text-style/dist/text-style/index.d.ts +0 -170
  993. package/node_modules/@tiptap/extension-text-style/dist/text-style/index.d.ts.map +0 -1
  994. package/node_modules/@tiptap/extension-text-style/dist/text-style/index.js +0 -79
  995. package/node_modules/@tiptap/extension-text-style/dist/text-style/index.js.map +0 -1
  996. package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.cjs +0 -292
  997. package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.cjs.map +0 -1
  998. package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.d.cts +0 -244
  999. package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.d.cts.map +0 -1
  1000. package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.d.ts +0 -244
  1001. package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.d.ts.map +0 -1
  1002. package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.js +0 -291
  1003. package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.js.map +0 -1
  1004. package/node_modules/@tiptap/extension-text-style/package.json +0 -106
  1005. package/node_modules/@tiptap/extension-text-style/src/background-color/background-color.test.ts +0 -35
  1006. package/node_modules/@tiptap/extension-text-style/src/background-color/background-color.ts +0 -100
  1007. package/node_modules/@tiptap/extension-text-style/src/background-color/index.ts +0 -5
  1008. package/node_modules/@tiptap/extension-text-style/src/color/color.test.ts +0 -35
  1009. package/node_modules/@tiptap/extension-text-style/src/color/color.ts +0 -96
  1010. package/node_modules/@tiptap/extension-text-style/src/color/index.ts +0 -5
  1011. package/node_modules/@tiptap/extension-text-style/src/font-family/font-family.test.ts +0 -89
  1012. package/node_modules/@tiptap/extension-text-style/src/font-family/font-family.ts +0 -94
  1013. package/node_modules/@tiptap/extension-text-style/src/font-family/index.ts +0 -5
  1014. package/node_modules/@tiptap/extension-text-style/src/font-size/font-size.test.ts +0 -35
  1015. package/node_modules/@tiptap/extension-text-style/src/font-size/font-size.ts +0 -92
  1016. package/node_modules/@tiptap/extension-text-style/src/font-size/index.ts +0 -5
  1017. package/node_modules/@tiptap/extension-text-style/src/index.ts +0 -14
  1018. package/node_modules/@tiptap/extension-text-style/src/line-height/index.ts +0 -5
  1019. package/node_modules/@tiptap/extension-text-style/src/line-height/line-height.test.ts +0 -35
  1020. package/node_modules/@tiptap/extension-text-style/src/line-height/line-height.ts +0 -93
  1021. package/node_modules/@tiptap/extension-text-style/src/text-style/index.ts +0 -168
  1022. package/node_modules/@tiptap/extension-text-style/src/text-style-kit/index.ts +0 -86
  1023. package/node_modules/@tiptap/extension-underline/LICENSE.md +0 -21
  1024. package/node_modules/@tiptap/extension-underline/README.md +0 -18
  1025. package/node_modules/@tiptap/extension-underline/dist/index.cjs +0 -81
  1026. package/node_modules/@tiptap/extension-underline/dist/index.cjs.map +0 -1
  1027. package/node_modules/@tiptap/extension-underline/dist/index.d.cts +0 -39
  1028. package/node_modules/@tiptap/extension-underline/dist/index.d.cts.map +0 -1
  1029. package/node_modules/@tiptap/extension-underline/dist/index.d.ts +0 -39
  1030. package/node_modules/@tiptap/extension-underline/dist/index.d.ts.map +0 -1
  1031. package/node_modules/@tiptap/extension-underline/dist/index.js +0 -76
  1032. package/node_modules/@tiptap/extension-underline/dist/index.js.map +0 -1
  1033. package/node_modules/@tiptap/extension-underline/package.json +0 -50
  1034. package/node_modules/@tiptap/extension-underline/src/index.ts +0 -5
  1035. package/node_modules/@tiptap/extension-underline/src/underline.ts +0 -123
  1036. package/node_modules/@tiptap/extension-youtube/LICENSE.md +0 -21
  1037. package/node_modules/@tiptap/extension-youtube/README.md +0 -18
  1038. package/node_modules/@tiptap/extension-youtube/dist/index.cjs +0 -254
  1039. package/node_modules/@tiptap/extension-youtube/dist/index.cjs.map +0 -1
  1040. package/node_modules/@tiptap/extension-youtube/dist/index.d.cts +0 -204
  1041. package/node_modules/@tiptap/extension-youtube/dist/index.d.cts.map +0 -1
  1042. package/node_modules/@tiptap/extension-youtube/dist/index.d.ts +0 -204
  1043. package/node_modules/@tiptap/extension-youtube/dist/index.d.ts.map +0 -1
  1044. package/node_modules/@tiptap/extension-youtube/dist/index.js +0 -246
  1045. package/node_modules/@tiptap/extension-youtube/dist/index.js.map +0 -1
  1046. package/node_modules/@tiptap/extension-youtube/package.json +0 -50
  1047. package/node_modules/@tiptap/extension-youtube/src/index.ts +0 -5
  1048. package/node_modules/@tiptap/extension-youtube/src/utils.test.ts +0 -163
  1049. package/node_modules/@tiptap/extension-youtube/src/utils.ts +0 -234
  1050. package/node_modules/@tiptap/extension-youtube/src/youtube.ts +0 -399
  1051. package/node_modules/@tiptap/extensions/LICENSE.md +0 -21
  1052. package/node_modules/@tiptap/extensions/README.md +0 -18
  1053. package/node_modules/@tiptap/extensions/dist/character-count/index.cjs +0 -87
  1054. package/node_modules/@tiptap/extensions/dist/character-count/index.cjs.map +0 -1
  1055. package/node_modules/@tiptap/extensions/dist/character-count/index.d.cts +0 -70
  1056. package/node_modules/@tiptap/extensions/dist/character-count/index.d.cts.map +0 -1
  1057. package/node_modules/@tiptap/extensions/dist/character-count/index.d.ts +0 -70
  1058. package/node_modules/@tiptap/extensions/dist/character-count/index.d.ts.map +0 -1
  1059. package/node_modules/@tiptap/extensions/dist/character-count/index.js +0 -86
  1060. package/node_modules/@tiptap/extensions/dist/character-count/index.js.map +0 -1
  1061. package/node_modules/@tiptap/extensions/dist/drop-cursor/index.cjs +0 -27
  1062. package/node_modules/@tiptap/extensions/dist/drop-cursor/index.cjs.map +0 -1
  1063. package/node_modules/@tiptap/extensions/dist/drop-cursor/index.d.cts +0 -32
  1064. package/node_modules/@tiptap/extensions/dist/drop-cursor/index.d.cts.map +0 -1
  1065. package/node_modules/@tiptap/extensions/dist/drop-cursor/index.d.ts +0 -32
  1066. package/node_modules/@tiptap/extensions/dist/drop-cursor/index.d.ts.map +0 -1
  1067. package/node_modules/@tiptap/extensions/dist/drop-cursor/index.js +0 -26
  1068. package/node_modules/@tiptap/extensions/dist/drop-cursor/index.js.map +0 -1
  1069. package/node_modules/@tiptap/extensions/dist/focus/index.cjs +0 -48
  1070. package/node_modules/@tiptap/extensions/dist/focus/index.cjs.map +0 -1
  1071. package/node_modules/@tiptap/extensions/dist/focus/index.d.cts +0 -29
  1072. package/node_modules/@tiptap/extensions/dist/focus/index.d.cts.map +0 -1
  1073. package/node_modules/@tiptap/extensions/dist/focus/index.d.ts +0 -29
  1074. package/node_modules/@tiptap/extensions/dist/focus/index.d.ts.map +0 -1
  1075. package/node_modules/@tiptap/extensions/dist/focus/index.js +0 -47
  1076. package/node_modules/@tiptap/extensions/dist/focus/index.js.map +0 -1
  1077. package/node_modules/@tiptap/extensions/dist/gap-cursor/index.cjs +0 -29
  1078. package/node_modules/@tiptap/extensions/dist/gap-cursor/index.cjs.map +0 -1
  1079. package/node_modules/@tiptap/extensions/dist/gap-cursor/index.d.cts +0 -26
  1080. package/node_modules/@tiptap/extensions/dist/gap-cursor/index.d.cts.map +0 -1
  1081. package/node_modules/@tiptap/extensions/dist/gap-cursor/index.d.ts +0 -26
  1082. package/node_modules/@tiptap/extensions/dist/gap-cursor/index.d.ts.map +0 -1
  1083. package/node_modules/@tiptap/extensions/dist/gap-cursor/index.js +0 -28
  1084. package/node_modules/@tiptap/extensions/dist/gap-cursor/index.js.map +0 -1
  1085. package/node_modules/@tiptap/extensions/dist/index.cjs +0 -711
  1086. package/node_modules/@tiptap/extensions/dist/index.cjs.map +0 -1
  1087. package/node_modules/@tiptap/extensions/dist/index.d.cts +0 -321
  1088. package/node_modules/@tiptap/extensions/dist/index.d.cts.map +0 -1
  1089. package/node_modules/@tiptap/extensions/dist/index.d.ts +0 -321
  1090. package/node_modules/@tiptap/extensions/dist/index.d.ts.map +0 -1
  1091. package/node_modules/@tiptap/extensions/dist/index.js +0 -699
  1092. package/node_modules/@tiptap/extensions/dist/index.js.map +0 -1
  1093. package/node_modules/@tiptap/extensions/dist/placeholder/index.cjs +0 -372
  1094. package/node_modules/@tiptap/extensions/dist/placeholder/index.cjs.map +0 -1
  1095. package/node_modules/@tiptap/extensions/dist/placeholder/index.d.cts +0 -91
  1096. package/node_modules/@tiptap/extensions/dist/placeholder/index.d.cts.map +0 -1
  1097. package/node_modules/@tiptap/extensions/dist/placeholder/index.d.ts +0 -91
  1098. package/node_modules/@tiptap/extensions/dist/placeholder/index.d.ts.map +0 -1
  1099. package/node_modules/@tiptap/extensions/dist/placeholder/index.js +0 -368
  1100. package/node_modules/@tiptap/extensions/dist/placeholder/index.js.map +0 -1
  1101. package/node_modules/@tiptap/extensions/dist/selection/index.cjs +0 -72
  1102. package/node_modules/@tiptap/extensions/dist/selection/index.cjs.map +0 -1
  1103. package/node_modules/@tiptap/extensions/dist/selection/index.d.cts +0 -20
  1104. package/node_modules/@tiptap/extensions/dist/selection/index.d.cts.map +0 -1
  1105. package/node_modules/@tiptap/extensions/dist/selection/index.d.ts +0 -20
  1106. package/node_modules/@tiptap/extensions/dist/selection/index.d.ts.map +0 -1
  1107. package/node_modules/@tiptap/extensions/dist/selection/index.js +0 -71
  1108. package/node_modules/@tiptap/extensions/dist/selection/index.js.map +0 -1
  1109. package/node_modules/@tiptap/extensions/dist/trailing-node/index.cjs +0 -62
  1110. package/node_modules/@tiptap/extensions/dist/trailing-node/index.cjs.map +0 -1
  1111. package/node_modules/@tiptap/extensions/dist/trailing-node/index.d.cts +0 -30
  1112. package/node_modules/@tiptap/extensions/dist/trailing-node/index.d.cts.map +0 -1
  1113. package/node_modules/@tiptap/extensions/dist/trailing-node/index.d.ts +0 -30
  1114. package/node_modules/@tiptap/extensions/dist/trailing-node/index.d.ts.map +0 -1
  1115. package/node_modules/@tiptap/extensions/dist/trailing-node/index.js +0 -60
  1116. package/node_modules/@tiptap/extensions/dist/trailing-node/index.js.map +0 -1
  1117. package/node_modules/@tiptap/extensions/dist/undo-redo/index.cjs +0 -48
  1118. package/node_modules/@tiptap/extensions/dist/undo-redo/index.cjs.map +0 -1
  1119. package/node_modules/@tiptap/extensions/dist/undo-redo/index.d.cts +0 -45
  1120. package/node_modules/@tiptap/extensions/dist/undo-redo/index.d.cts.map +0 -1
  1121. package/node_modules/@tiptap/extensions/dist/undo-redo/index.d.ts +0 -45
  1122. package/node_modules/@tiptap/extensions/dist/undo-redo/index.d.ts.map +0 -1
  1123. package/node_modules/@tiptap/extensions/dist/undo-redo/index.js +0 -47
  1124. package/node_modules/@tiptap/extensions/dist/undo-redo/index.js.map +0 -1
  1125. package/node_modules/@tiptap/extensions/package.json +0 -116
  1126. package/node_modules/@tiptap/extensions/src/character-count/character-count.ts +0 -203
  1127. package/node_modules/@tiptap/extensions/src/character-count/index.ts +0 -1
  1128. package/node_modules/@tiptap/extensions/src/drop-cursor/drop-cursor.ts +0 -47
  1129. package/node_modules/@tiptap/extensions/src/drop-cursor/index.ts +0 -1
  1130. package/node_modules/@tiptap/extensions/src/focus/focus.ts +0 -110
  1131. package/node_modules/@tiptap/extensions/src/focus/index.ts +0 -1
  1132. package/node_modules/@tiptap/extensions/src/gap-cursor/gap-cursor.ts +0 -47
  1133. package/node_modules/@tiptap/extensions/src/gap-cursor/index.ts +0 -1
  1134. package/node_modules/@tiptap/extensions/src/index.ts +0 -8
  1135. package/node_modules/@tiptap/extensions/src/placeholder/constants.ts +0 -8
  1136. package/node_modules/@tiptap/extensions/src/placeholder/index.ts +0 -4
  1137. package/node_modules/@tiptap/extensions/src/placeholder/placeholder.ts +0 -30
  1138. package/node_modules/@tiptap/extensions/src/placeholder/plugins/PlaceholderPlugin.ts +0 -49
  1139. package/node_modules/@tiptap/extensions/src/placeholder/types.ts +0 -74
  1140. package/node_modules/@tiptap/extensions/src/placeholder/utils/buildPlaceholderDecorations.ts +0 -164
  1141. package/node_modules/@tiptap/extensions/src/placeholder/utils/createPlaceholderDecoration.ts +0 -61
  1142. package/node_modules/@tiptap/extensions/src/placeholder/utils/index.ts +0 -3
  1143. package/node_modules/@tiptap/extensions/src/placeholder/utils/placeholderStateField.ts +0 -204
  1144. package/node_modules/@tiptap/extensions/src/placeholder/utils/preparePlaceholderAttribute.ts +0 -21
  1145. package/node_modules/@tiptap/extensions/src/placeholder/utils/resolveTopLevelRange.test.ts +0 -78
  1146. package/node_modules/@tiptap/extensions/src/placeholder/utils/resolveTopLevelRange.ts +0 -93
  1147. package/node_modules/@tiptap/extensions/src/selection/index.ts +0 -1
  1148. package/node_modules/@tiptap/extensions/src/selection/selection.test.ts +0 -97
  1149. package/node_modules/@tiptap/extensions/src/selection/selection.ts +0 -106
  1150. package/node_modules/@tiptap/extensions/src/trailing-node/index.ts +0 -1
  1151. package/node_modules/@tiptap/extensions/src/trailing-node/trailing-node.test.ts +0 -90
  1152. package/node_modules/@tiptap/extensions/src/trailing-node/trailing-node.ts +0 -107
  1153. package/node_modules/@tiptap/extensions/src/undo-redo/index.ts +0 -1
  1154. package/node_modules/@tiptap/extensions/src/undo-redo/undo-redo.ts +0 -86
  1155. package/node_modules/@tiptap/pm/LICENSE +0 -21
  1156. package/node_modules/@tiptap/pm/README.md +0 -22
  1157. package/node_modules/@tiptap/pm/THIRD_PARTY_LICENSES.md +0 -47
  1158. package/node_modules/@tiptap/pm/changeset/index.ts +0 -1
  1159. package/node_modules/@tiptap/pm/commands/index.ts +0 -1
  1160. package/node_modules/@tiptap/pm/dist/changeset/index.cjs +0 -9
  1161. package/node_modules/@tiptap/pm/dist/changeset/index.d.cts +0 -1
  1162. package/node_modules/@tiptap/pm/dist/changeset/index.d.ts +0 -1
  1163. package/node_modules/@tiptap/pm/dist/changeset/index.js +0 -2
  1164. package/node_modules/@tiptap/pm/dist/commands/index.cjs +0 -9
  1165. package/node_modules/@tiptap/pm/dist/commands/index.d.cts +0 -1
  1166. package/node_modules/@tiptap/pm/dist/commands/index.d.ts +0 -1
  1167. package/node_modules/@tiptap/pm/dist/commands/index.js +0 -2
  1168. package/node_modules/@tiptap/pm/dist/dropcursor/index.cjs +0 -9
  1169. package/node_modules/@tiptap/pm/dist/dropcursor/index.d.cts +0 -1
  1170. package/node_modules/@tiptap/pm/dist/dropcursor/index.d.ts +0 -1
  1171. package/node_modules/@tiptap/pm/dist/dropcursor/index.js +0 -2
  1172. package/node_modules/@tiptap/pm/dist/gapcursor/index.cjs +0 -9
  1173. package/node_modules/@tiptap/pm/dist/gapcursor/index.d.cts +0 -1
  1174. package/node_modules/@tiptap/pm/dist/gapcursor/index.d.ts +0 -1
  1175. package/node_modules/@tiptap/pm/dist/gapcursor/index.js +0 -2
  1176. package/node_modules/@tiptap/pm/dist/history/index.cjs +0 -9
  1177. package/node_modules/@tiptap/pm/dist/history/index.d.cts +0 -1
  1178. package/node_modules/@tiptap/pm/dist/history/index.d.ts +0 -1
  1179. package/node_modules/@tiptap/pm/dist/history/index.js +0 -2
  1180. package/node_modules/@tiptap/pm/dist/inputrules/index.cjs +0 -9
  1181. package/node_modules/@tiptap/pm/dist/inputrules/index.d.cts +0 -1
  1182. package/node_modules/@tiptap/pm/dist/inputrules/index.d.ts +0 -1
  1183. package/node_modules/@tiptap/pm/dist/inputrules/index.js +0 -2
  1184. package/node_modules/@tiptap/pm/dist/keymap/index.cjs +0 -9
  1185. package/node_modules/@tiptap/pm/dist/keymap/index.d.cts +0 -1
  1186. package/node_modules/@tiptap/pm/dist/keymap/index.d.ts +0 -1
  1187. package/node_modules/@tiptap/pm/dist/keymap/index.js +0 -2
  1188. package/node_modules/@tiptap/pm/dist/model/index.cjs +0 -9
  1189. package/node_modules/@tiptap/pm/dist/model/index.d.cts +0 -1
  1190. package/node_modules/@tiptap/pm/dist/model/index.d.ts +0 -1
  1191. package/node_modules/@tiptap/pm/dist/model/index.js +0 -2
  1192. package/node_modules/@tiptap/pm/dist/schema-list/index.cjs +0 -9
  1193. package/node_modules/@tiptap/pm/dist/schema-list/index.d.cts +0 -1
  1194. package/node_modules/@tiptap/pm/dist/schema-list/index.d.ts +0 -1
  1195. package/node_modules/@tiptap/pm/dist/schema-list/index.js +0 -2
  1196. package/node_modules/@tiptap/pm/dist/state/index.cjs +0 -9
  1197. package/node_modules/@tiptap/pm/dist/state/index.d.cts +0 -1
  1198. package/node_modules/@tiptap/pm/dist/state/index.d.ts +0 -1
  1199. package/node_modules/@tiptap/pm/dist/state/index.js +0 -2
  1200. package/node_modules/@tiptap/pm/dist/tables/index.cjs +0 -9
  1201. package/node_modules/@tiptap/pm/dist/tables/index.d.cts +0 -1
  1202. package/node_modules/@tiptap/pm/dist/tables/index.d.ts +0 -1
  1203. package/node_modules/@tiptap/pm/dist/tables/index.js +0 -2
  1204. package/node_modules/@tiptap/pm/dist/transform/index.cjs +0 -9
  1205. package/node_modules/@tiptap/pm/dist/transform/index.d.cts +0 -1
  1206. package/node_modules/@tiptap/pm/dist/transform/index.d.ts +0 -1
  1207. package/node_modules/@tiptap/pm/dist/transform/index.js +0 -2
  1208. package/node_modules/@tiptap/pm/dist/view/index.cjs +0 -9
  1209. package/node_modules/@tiptap/pm/dist/view/index.d.cts +0 -1
  1210. package/node_modules/@tiptap/pm/dist/view/index.d.ts +0 -1
  1211. package/node_modules/@tiptap/pm/dist/view/index.js +0 -2
  1212. package/node_modules/@tiptap/pm/dropcursor/index.ts +0 -1
  1213. package/node_modules/@tiptap/pm/gapcursor/index.ts +0 -1
  1214. package/node_modules/@tiptap/pm/history/index.ts +0 -1
  1215. package/node_modules/@tiptap/pm/inputrules/index.ts +0 -1
  1216. package/node_modules/@tiptap/pm/keymap/index.ts +0 -1
  1217. package/node_modules/@tiptap/pm/model/index.ts +0 -1
  1218. package/node_modules/@tiptap/pm/package.json +0 -166
  1219. package/node_modules/@tiptap/pm/schema-list/index.ts +0 -1
  1220. package/node_modules/@tiptap/pm/state/index.ts +0 -1
  1221. package/node_modules/@tiptap/pm/tables/index.ts +0 -1
  1222. package/node_modules/@tiptap/pm/transform/index.ts +0 -1
  1223. package/node_modules/@tiptap/pm/view/index.ts +0 -1
  1224. package/node_modules/@tiptap/react/LICENSE.md +0 -21
  1225. package/node_modules/@tiptap/react/README.md +0 -18
  1226. package/node_modules/@tiptap/react/dist/index.cjs +0 -1396
  1227. package/node_modules/@tiptap/react/dist/index.cjs.map +0 -1
  1228. package/node_modules/@tiptap/react/dist/index.d.cts +0 -632
  1229. package/node_modules/@tiptap/react/dist/index.d.cts.map +0 -1
  1230. package/node_modules/@tiptap/react/dist/index.d.ts +0 -632
  1231. package/node_modules/@tiptap/react/dist/index.d.ts.map +0 -1
  1232. package/node_modules/@tiptap/react/dist/index.js +0 -1337
  1233. package/node_modules/@tiptap/react/dist/index.js.map +0 -1
  1234. package/node_modules/@tiptap/react/dist/menus/index.cjs +0 -469
  1235. package/node_modules/@tiptap/react/dist/menus/index.cjs.map +0 -1
  1236. package/node_modules/@tiptap/react/dist/menus/index.d.cts +0 -21
  1237. package/node_modules/@tiptap/react/dist/menus/index.d.cts.map +0 -1
  1238. package/node_modules/@tiptap/react/dist/menus/index.d.ts +0 -21
  1239. package/node_modules/@tiptap/react/dist/menus/index.d.ts.map +0 -1
  1240. package/node_modules/@tiptap/react/dist/menus/index.js +0 -444
  1241. package/node_modules/@tiptap/react/dist/menus/index.js.map +0 -1
  1242. package/node_modules/@tiptap/react/package.json +0 -80
  1243. package/node_modules/@tiptap/react/src/Context.tsx +0 -62
  1244. package/node_modules/@tiptap/react/src/Editor.ts +0 -16
  1245. package/node_modules/@tiptap/react/src/EditorContent.test.ts +0 -39
  1246. package/node_modules/@tiptap/react/src/EditorContent.tsx +0 -230
  1247. package/node_modules/@tiptap/react/src/NodeViewContent.tsx +0 -30
  1248. package/node_modules/@tiptap/react/src/NodeViewWrapper.tsx +0 -27
  1249. package/node_modules/@tiptap/react/src/ReactMarkViewRenderer.tsx +0 -114
  1250. package/node_modules/@tiptap/react/src/ReactNodeViewRenderer.test.ts +0 -566
  1251. package/node_modules/@tiptap/react/src/ReactNodeViewRenderer.tsx +0 -465
  1252. package/node_modules/@tiptap/react/src/ReactNodeViewSelectionTracker.ts +0 -113
  1253. package/node_modules/@tiptap/react/src/ReactRenderer.tsx +0 -304
  1254. package/node_modules/@tiptap/react/src/ReactWidgetRenderer.test.ts +0 -448
  1255. package/node_modules/@tiptap/react/src/ReactWidgetRenderer.tsx +0 -97
  1256. package/node_modules/@tiptap/react/src/Tiptap.tsx +0 -232
  1257. package/node_modules/@tiptap/react/src/captureDOMSelection.test.ts +0 -76
  1258. package/node_modules/@tiptap/react/src/captureDOMSelection.ts +0 -35
  1259. package/node_modules/@tiptap/react/src/handleMobileEnter.test.ts +0 -218
  1260. package/node_modules/@tiptap/react/src/handleMobileEnter.ts +0 -60
  1261. package/node_modules/@tiptap/react/src/index.ts +0 -16
  1262. package/node_modules/@tiptap/react/src/lib/utils/getTextSelectionAncestorPositions.ts +0 -27
  1263. package/node_modules/@tiptap/react/src/menus/BubbleMenu.test.ts +0 -178
  1264. package/node_modules/@tiptap/react/src/menus/BubbleMenu.tsx +0 -160
  1265. package/node_modules/@tiptap/react/src/menus/FloatingMenu.test.ts +0 -168
  1266. package/node_modules/@tiptap/react/src/menus/FloatingMenu.tsx +0 -161
  1267. package/node_modules/@tiptap/react/src/menus/getAutoPluginKey.ts +0 -5
  1268. package/node_modules/@tiptap/react/src/menus/index.ts +0 -4
  1269. package/node_modules/@tiptap/react/src/menus/useMenuElementProps.ts +0 -369
  1270. package/node_modules/@tiptap/react/src/types.ts +0 -8
  1271. package/node_modules/@tiptap/react/src/useEditor.ts +0 -379
  1272. package/node_modules/@tiptap/react/src/useEditorState.test.ts +0 -160
  1273. package/node_modules/@tiptap/react/src/useEditorState.ts +0 -187
  1274. package/node_modules/@tiptap/react/src/useReactNodeView.ts +0 -38
  1275. package/node_modules/@tiptap/starter-kit/LICENSE.md +0 -21
  1276. package/node_modules/@tiptap/starter-kit/README.md +0 -18
  1277. package/node_modules/@tiptap/starter-kit/dist/index.cjs +0 -76
  1278. package/node_modules/@tiptap/starter-kit/dist/index.cjs.map +0 -1
  1279. package/node_modules/@tiptap/starter-kit/dist/index.d.cts +0 -137
  1280. package/node_modules/@tiptap/starter-kit/dist/index.d.cts.map +0 -1
  1281. package/node_modules/@tiptap/starter-kit/dist/index.d.ts +0 -137
  1282. package/node_modules/@tiptap/starter-kit/dist/index.d.ts.map +0 -1
  1283. package/node_modules/@tiptap/starter-kit/dist/index.js +0 -71
  1284. package/node_modules/@tiptap/starter-kit/dist/index.js.map +0 -1
  1285. package/node_modules/@tiptap/starter-kit/package.json +0 -70
  1286. package/node_modules/@tiptap/starter-kit/src/index.ts +0 -6
  1287. package/node_modules/@tiptap/starter-kit/src/starter-kit.ts +0 -273
  1288. package/node_modules/@tiptap/suggestion/LICENSE.md +0 -21
  1289. package/node_modules/@tiptap/suggestion/README.md +0 -18
  1290. package/node_modules/@tiptap/suggestion/dist/index.cjs +0 -665
  1291. package/node_modules/@tiptap/suggestion/dist/index.cjs.map +0 -1
  1292. package/node_modules/@tiptap/suggestion/dist/index.d.cts +0 -419
  1293. package/node_modules/@tiptap/suggestion/dist/index.d.cts.map +0 -1
  1294. package/node_modules/@tiptap/suggestion/dist/index.d.ts +0 -419
  1295. package/node_modules/@tiptap/suggestion/dist/index.d.ts.map +0 -1
  1296. package/node_modules/@tiptap/suggestion/dist/index.js +0 -657
  1297. package/node_modules/@tiptap/suggestion/dist/index.js.map +0 -1
  1298. package/node_modules/@tiptap/suggestion/package.json +0 -54
  1299. package/node_modules/@tiptap/suggestion/src/findSuggestionMatch.ts +0 -86
  1300. package/node_modules/@tiptap/suggestion/src/helpers.ts +0 -129
  1301. package/node_modules/@tiptap/suggestion/src/index.ts +0 -8
  1302. package/node_modules/@tiptap/suggestion/src/plugin/async.ts +0 -89
  1303. package/node_modules/@tiptap/suggestion/src/plugin/floating-ui.ts +0 -204
  1304. package/node_modules/@tiptap/suggestion/src/plugin/props.ts +0 -94
  1305. package/node_modules/@tiptap/suggestion/src/plugin/state.ts +0 -182
  1306. package/node_modules/@tiptap/suggestion/src/plugin/view.ts +0 -236
  1307. package/node_modules/@tiptap/suggestion/src/suggestion.ts +0 -151
  1308. package/node_modules/@tiptap/suggestion/src/types.ts +0 -439
  1309. package/node_modules/@types/use-sync-external-store/LICENSE +0 -21
  1310. package/node_modules/@types/use-sync-external-store/README.md +0 -15
  1311. package/node_modules/@types/use-sync-external-store/index.d.ts +0 -5
  1312. package/node_modules/@types/use-sync-external-store/package.json +0 -30
  1313. package/node_modules/@types/use-sync-external-store/shim/index.d.ts +0 -1
  1314. package/node_modules/@types/use-sync-external-store/shim/with-selector.d.ts +0 -1
  1315. package/node_modules/@types/use-sync-external-store/with-selector.d.ts +0 -7
  1316. package/node_modules/fast-equals/LICENSE +0 -21
  1317. package/node_modules/fast-equals/README.md +0 -479
  1318. package/node_modules/fast-equals/dist/cjs/index.cjs +0 -796
  1319. package/node_modules/fast-equals/dist/cjs/index.cjs.map +0 -1
  1320. package/node_modules/fast-equals/dist/cjs/index.d.cts +0 -211
  1321. package/node_modules/fast-equals/dist/es/index.d.mts +0 -211
  1322. package/node_modules/fast-equals/dist/es/index.mjs +0 -785
  1323. package/node_modules/fast-equals/dist/es/index.mjs.map +0 -1
  1324. package/node_modules/fast-equals/dist/umd/index.d.ts +0 -211
  1325. package/node_modules/fast-equals/dist/umd/index.js +0 -802
  1326. package/node_modules/fast-equals/dist/umd/index.js.map +0 -1
  1327. package/node_modules/fast-equals/index.d.ts +0 -211
  1328. package/node_modules/fast-equals/package.json +0 -120
  1329. package/node_modules/linkifyjs/LICENSE +0 -19
  1330. package/node_modules/linkifyjs/README.md +0 -47
  1331. package/node_modules/linkifyjs/dist/linkify.cjs +0 -1854
  1332. package/node_modules/linkifyjs/dist/linkify.d.cts +0 -637
  1333. package/node_modules/linkifyjs/dist/linkify.d.mts +0 -637
  1334. package/node_modules/linkifyjs/dist/linkify.js +0 -1859
  1335. package/node_modules/linkifyjs/dist/linkify.min.js +0 -1
  1336. package/node_modules/linkifyjs/dist/linkify.mjs +0 -1836
  1337. package/node_modules/linkifyjs/package.json +0 -38
  1338. package/node_modules/orderedmap/LICENSE +0 -19
  1339. package/node_modules/orderedmap/README.md +0 -69
  1340. package/node_modules/orderedmap/dist/index.cjs +0 -139
  1341. package/node_modules/orderedmap/dist/index.d.cts +0 -33
  1342. package/node_modules/orderedmap/dist/index.d.ts +0 -33
  1343. package/node_modules/orderedmap/dist/index.js +0 -137
  1344. package/node_modules/orderedmap/package.json +0 -39
  1345. package/node_modules/prosemirror-changeset/CHANGELOG.md +0 -171
  1346. package/node_modules/prosemirror-changeset/LICENSE +0 -19
  1347. package/node_modules/prosemirror-changeset/README.md +0 -175
  1348. package/node_modules/prosemirror-changeset/dist/index.cjs +0 -588
  1349. package/node_modules/prosemirror-changeset/dist/index.d.cts +0 -187
  1350. package/node_modules/prosemirror-changeset/dist/index.d.ts +0 -187
  1351. package/node_modules/prosemirror-changeset/dist/index.js +0 -722
  1352. package/node_modules/prosemirror-changeset/package.json +0 -40
  1353. package/node_modules/prosemirror-changeset/src/README.md +0 -32
  1354. package/node_modules/prosemirror-changeset/src/change.ts +0 -189
  1355. package/node_modules/prosemirror-changeset/src/changeset.ts +0 -212
  1356. package/node_modules/prosemirror-changeset/src/diff.ts +0 -158
  1357. package/node_modules/prosemirror-changeset/src/simplify.ts +0 -132
  1358. package/node_modules/prosemirror-changeset/test/test-changed-range.ts +0 -48
  1359. package/node_modules/prosemirror-changeset/test/test-changes.ts +0 -211
  1360. package/node_modules/prosemirror-changeset/test/test-diff.ts +0 -77
  1361. package/node_modules/prosemirror-changeset/test/test-merge.ts +0 -56
  1362. package/node_modules/prosemirror-changeset/test/test-simplify.ts +0 -74
  1363. package/node_modules/prosemirror-commands/.tern-project +0 -8
  1364. package/node_modules/prosemirror-commands/CHANGELOG.md +0 -328
  1365. package/node_modules/prosemirror-commands/CONTRIBUTING.md +0 -104
  1366. package/node_modules/prosemirror-commands/LICENSE +0 -19
  1367. package/node_modules/prosemirror-commands/README.md +0 -28
  1368. package/node_modules/prosemirror-commands/dist/index.cjs +0 -688
  1369. package/node_modules/prosemirror-commands/dist/index.d.cts +0 -215
  1370. package/node_modules/prosemirror-commands/dist/index.d.ts +0 -215
  1371. package/node_modules/prosemirror-commands/dist/index.js +0 -852
  1372. package/node_modules/prosemirror-commands/package.json +0 -39
  1373. package/node_modules/prosemirror-commands/src/README.md +0 -40
  1374. package/node_modules/prosemirror-commands/src/commands.ts +0 -786
  1375. package/node_modules/prosemirror-dropcursor/CHANGELOG.md +0 -149
  1376. package/node_modules/prosemirror-dropcursor/CONTRIBUTING.md +0 -104
  1377. package/node_modules/prosemirror-dropcursor/LICENSE +0 -19
  1378. package/node_modules/prosemirror-dropcursor/README.md +0 -50
  1379. package/node_modules/prosemirror-dropcursor/dist/index.cjs +0 -200
  1380. package/node_modules/prosemirror-dropcursor/dist/index.d.cts +0 -38
  1381. package/node_modules/prosemirror-dropcursor/dist/index.d.ts +0 -38
  1382. package/node_modules/prosemirror-dropcursor/dist/index.js +0 -163
  1383. package/node_modules/prosemirror-dropcursor/package.json +0 -38
  1384. package/node_modules/prosemirror-dropcursor/src/dropcursor.ts +0 -186
  1385. package/node_modules/prosemirror-gapcursor/CHANGELOG.md +0 -122
  1386. package/node_modules/prosemirror-gapcursor/CONTRIBUTING.md +0 -104
  1387. package/node_modules/prosemirror-gapcursor/LICENSE +0 -19
  1388. package/node_modules/prosemirror-gapcursor/README.md +0 -31
  1389. package/node_modules/prosemirror-gapcursor/dist/index.cjs +0 -239
  1390. package/node_modules/prosemirror-gapcursor/dist/index.d.cts +0 -31
  1391. package/node_modules/prosemirror-gapcursor/dist/index.d.ts +0 -31
  1392. package/node_modules/prosemirror-gapcursor/dist/index.js +0 -239
  1393. package/node_modules/prosemirror-gapcursor/package.json +0 -43
  1394. package/node_modules/prosemirror-gapcursor/src/README.md +0 -21
  1395. package/node_modules/prosemirror-gapcursor/src/gapcursor.ts +0 -141
  1396. package/node_modules/prosemirror-gapcursor/src/index.ts +0 -91
  1397. package/node_modules/prosemirror-gapcursor/style/gapcursor.css +0 -25
  1398. package/node_modules/prosemirror-history/.tern-project +0 -8
  1399. package/node_modules/prosemirror-history/CHANGELOG.md +0 -176
  1400. package/node_modules/prosemirror-history/CONTRIBUTING.md +0 -104
  1401. package/node_modules/prosemirror-history/LICENSE +0 -19
  1402. package/node_modules/prosemirror-history/README.md +0 -27
  1403. package/node_modules/prosemirror-history/dist/index.cjs +0 -383
  1404. package/node_modules/prosemirror-history/dist/index.d.cts +0 -64
  1405. package/node_modules/prosemirror-history/dist/index.d.ts +0 -64
  1406. package/node_modules/prosemirror-history/dist/index.js +0 -454
  1407. package/node_modules/prosemirror-history/package.json +0 -40
  1408. package/node_modules/prosemirror-history/src/README.md +0 -23
  1409. package/node_modules/prosemirror-history/src/history.ts +0 -466
  1410. package/node_modules/prosemirror-inputrules/.tern-project +0 -8
  1411. package/node_modules/prosemirror-inputrules/CHANGELOG.md +0 -127
  1412. package/node_modules/prosemirror-inputrules/CONTRIBUTING.md +0 -104
  1413. package/node_modules/prosemirror-inputrules/LICENSE +0 -19
  1414. package/node_modules/prosemirror-inputrules/README.md +0 -29
  1415. package/node_modules/prosemirror-inputrules/dist/index.cjs +0 -194
  1416. package/node_modules/prosemirror-inputrules/dist/index.d.cts +0 -131
  1417. package/node_modules/prosemirror-inputrules/dist/index.d.ts +0 -131
  1418. package/node_modules/prosemirror-inputrules/dist/index.js +0 -239
  1419. package/node_modules/prosemirror-inputrules/package.json +0 -36
  1420. package/node_modules/prosemirror-inputrules/src/README.md +0 -23
  1421. package/node_modules/prosemirror-inputrules/src/index.ts +0 -4
  1422. package/node_modules/prosemirror-inputrules/src/inputrules.ts +0 -167
  1423. package/node_modules/prosemirror-inputrules/src/rulebuilders.ts +0 -59
  1424. package/node_modules/prosemirror-inputrules/src/rules.ts +0 -17
  1425. package/node_modules/prosemirror-keymap/.tern-project +0 -8
  1426. package/node_modules/prosemirror-keymap/CHANGELOG.md +0 -104
  1427. package/node_modules/prosemirror-keymap/CONTRIBUTING.md +0 -104
  1428. package/node_modules/prosemirror-keymap/LICENSE +0 -19
  1429. package/node_modules/prosemirror-keymap/README.md +0 -27
  1430. package/node_modules/prosemirror-keymap/dist/index.cjs +0 -65
  1431. package/node_modules/prosemirror-keymap/dist/index.d.cts +0 -47
  1432. package/node_modules/prosemirror-keymap/dist/index.d.ts +0 -47
  1433. package/node_modules/prosemirror-keymap/dist/index.js +0 -128
  1434. package/node_modules/prosemirror-keymap/package.json +0 -38
  1435. package/node_modules/prosemirror-keymap/src/README.md +0 -5
  1436. package/node_modules/prosemirror-keymap/src/keymap.ts +0 -105
  1437. package/node_modules/prosemirror-model/.tern-project +0 -8
  1438. package/node_modules/prosemirror-model/CHANGELOG.md +0 -782
  1439. package/node_modules/prosemirror-model/CONTRIBUTING.md +0 -104
  1440. package/node_modules/prosemirror-model/LICENSE +0 -19
  1441. package/node_modules/prosemirror-model/README.md +0 -29
  1442. package/node_modules/prosemirror-model/dist/index.cjs +0 -2911
  1443. package/node_modules/prosemirror-model/dist/index.d.cts +0 -1683
  1444. package/node_modules/prosemirror-model/dist/index.d.ts +0 -1683
  1445. package/node_modules/prosemirror-model/dist/index.js +0 -3463
  1446. package/node_modules/prosemirror-model/package.json +0 -38
  1447. package/node_modules/prosemirror-model/src/README.md +0 -62
  1448. package/node_modules/prosemirror-model/src/comparedeep.ts +0 -15
  1449. package/node_modules/prosemirror-model/src/content.ts +0 -413
  1450. package/node_modules/prosemirror-model/src/diff.ts +0 -57
  1451. package/node_modules/prosemirror-model/src/dom.ts +0 -1
  1452. package/node_modules/prosemirror-model/src/fragment.ts +0 -268
  1453. package/node_modules/prosemirror-model/src/from_dom.ts +0 -851
  1454. package/node_modules/prosemirror-model/src/index.ts +0 -11
  1455. package/node_modules/prosemirror-model/src/mark.ts +0 -110
  1456. package/node_modules/prosemirror-model/src/node.ts +0 -410
  1457. package/node_modules/prosemirror-model/src/replace.ts +0 -217
  1458. package/node_modules/prosemirror-model/src/resolvedpos.ts +0 -289
  1459. package/node_modules/prosemirror-model/src/schema.ts +0 -691
  1460. package/node_modules/prosemirror-model/src/to_dom.ts +0 -242
  1461. package/node_modules/prosemirror-schema-list/.tern-project +0 -8
  1462. package/node_modules/prosemirror-schema-list/CHANGELOG.md +0 -140
  1463. package/node_modules/prosemirror-schema-list/CONTRIBUTING.md +0 -100
  1464. package/node_modules/prosemirror-schema-list/LICENSE +0 -19
  1465. package/node_modules/prosemirror-schema-list/README.md +0 -28
  1466. package/node_modules/prosemirror-schema-list/dist/index.cjs +0 -253
  1467. package/node_modules/prosemirror-schema-list/dist/index.d.cts +0 -71
  1468. package/node_modules/prosemirror-schema-list/dist/index.d.ts +0 -71
  1469. package/node_modules/prosemirror-schema-list/dist/index.js +0 -289
  1470. package/node_modules/prosemirror-schema-list/package.json +0 -40
  1471. package/node_modules/prosemirror-schema-list/src/README.md +0 -29
  1472. package/node_modules/prosemirror-schema-list/src/schema-list.ts +0 -267
  1473. package/node_modules/prosemirror-state/.tern-project +0 -8
  1474. package/node_modules/prosemirror-state/CHANGELOG.md +0 -296
  1475. package/node_modules/prosemirror-state/CONTRIBUTING.md +0 -104
  1476. package/node_modules/prosemirror-state/LICENSE +0 -19
  1477. package/node_modules/prosemirror-state/README.md +0 -28
  1478. package/node_modules/prosemirror-state/dist/index.cjs +0 -884
  1479. package/node_modules/prosemirror-state/dist/index.d.cts +0 -709
  1480. package/node_modules/prosemirror-state/dist/index.d.ts +0 -709
  1481. package/node_modules/prosemirror-state/dist/index.js +0 -1002
  1482. package/node_modules/prosemirror-state/package.json +0 -39
  1483. package/node_modules/prosemirror-state/src/README.md +0 -42
  1484. package/node_modules/prosemirror-state/src/index.ts +0 -7
  1485. package/node_modules/prosemirror-state/src/plugin.ts +0 -142
  1486. package/node_modules/prosemirror-state/src/selection.ts +0 -462
  1487. package/node_modules/prosemirror-state/src/state.ts +0 -266
  1488. package/node_modules/prosemirror-state/src/transaction.ts +0 -215
  1489. package/node_modules/prosemirror-tables/LICENSE +0 -19
  1490. package/node_modules/prosemirror-tables/README.md +0 -254
  1491. package/node_modules/prosemirror-tables/dist/index.cjs +0 -2683
  1492. package/node_modules/prosemirror-tables/dist/index.d.cts +0 -751
  1493. package/node_modules/prosemirror-tables/dist/index.d.cts.map +0 -1
  1494. package/node_modules/prosemirror-tables/dist/index.d.ts +0 -751
  1495. package/node_modules/prosemirror-tables/dist/index.d.ts.map +0 -1
  1496. package/node_modules/prosemirror-tables/dist/index.js +0 -2626
  1497. package/node_modules/prosemirror-tables/dist/index.js.map +0 -1
  1498. package/node_modules/prosemirror-tables/package.json +0 -80
  1499. package/node_modules/prosemirror-tables/style/tables.css +0 -48
  1500. package/node_modules/prosemirror-transform/.tern-project +0 -8
  1501. package/node_modules/prosemirror-transform/CHANGELOG.md +0 -530
  1502. package/node_modules/prosemirror-transform/CONTRIBUTING.md +0 -104
  1503. package/node_modules/prosemirror-transform/LICENSE +0 -19
  1504. package/node_modules/prosemirror-transform/README.md +0 -29
  1505. package/node_modules/prosemirror-transform/dist/index.cjs +0 -2014
  1506. package/node_modules/prosemirror-transform/dist/index.d.cts +0 -857
  1507. package/node_modules/prosemirror-transform/dist/index.d.ts +0 -857
  1508. package/node_modules/prosemirror-transform/dist/index.js +0 -2272
  1509. package/node_modules/prosemirror-transform/package.json +0 -37
  1510. package/node_modules/prosemirror-transform/src/README.md +0 -59
  1511. package/node_modules/prosemirror-transform/src/attr_step.ts +0 -98
  1512. package/node_modules/prosemirror-transform/src/index.ts +0 -11
  1513. package/node_modules/prosemirror-transform/src/map.ts +0 -287
  1514. package/node_modules/prosemirror-transform/src/mark.ts +0 -90
  1515. package/node_modules/prosemirror-transform/src/mark_step.ts +0 -287
  1516. package/node_modules/prosemirror-transform/src/replace.ts +0 -483
  1517. package/node_modules/prosemirror-transform/src/replace_step.ts +0 -187
  1518. package/node_modules/prosemirror-transform/src/step.ts +0 -97
  1519. package/node_modules/prosemirror-transform/src/structure.ts +0 -349
  1520. package/node_modules/prosemirror-transform/src/transform.ts +0 -271
  1521. package/node_modules/prosemirror-view/.tern-project +0 -8
  1522. package/node_modules/prosemirror-view/CHANGELOG.md +0 -2543
  1523. package/node_modules/prosemirror-view/CONTRIBUTING.md +0 -104
  1524. package/node_modules/prosemirror-view/LICENSE +0 -19
  1525. package/node_modules/prosemirror-view/README.md +0 -28
  1526. package/node_modules/prosemirror-view/dist/index.cjs +0 -5549
  1527. package/node_modules/prosemirror-view/dist/index.d.cts +0 -913
  1528. package/node_modules/prosemirror-view/dist/index.d.ts +0 -913
  1529. package/node_modules/prosemirror-view/dist/index.js +0 -6053
  1530. package/node_modules/prosemirror-view/package.json +0 -43
  1531. package/node_modules/prosemirror-view/src/README.md +0 -38
  1532. package/node_modules/prosemirror-view/src/browser.ts +0 -24
  1533. package/node_modules/prosemirror-view/src/capturekeys.ts +0 -344
  1534. package/node_modules/prosemirror-view/src/clipboard.ts +0 -282
  1535. package/node_modules/prosemirror-view/src/decoration.ts +0 -817
  1536. package/node_modules/prosemirror-view/src/dom.ts +0 -166
  1537. package/node_modules/prosemirror-view/src/domchange.ts +0 -383
  1538. package/node_modules/prosemirror-view/src/domcoords.ts +0 -517
  1539. package/node_modules/prosemirror-view/src/domobserver.ts +0 -397
  1540. package/node_modules/prosemirror-view/src/index.ts +0 -826
  1541. package/node_modules/prosemirror-view/src/input.ts +0 -885
  1542. package/node_modules/prosemirror-view/src/selection.ts +0 -229
  1543. package/node_modules/prosemirror-view/src/viewdesc.ts +0 -1624
  1544. package/node_modules/prosemirror-view/style/prosemirror.css +0 -54
  1545. package/node_modules/rope-sequence/LICENSE +0 -19
  1546. package/node_modules/rope-sequence/README.md +0 -63
  1547. package/node_modules/rope-sequence/dist/index.cjs +0 -209
  1548. package/node_modules/rope-sequence/dist/index.d.cts +0 -11
  1549. package/node_modules/rope-sequence/dist/index.d.ts +0 -11
  1550. package/node_modules/rope-sequence/dist/index.js +0 -207
  1551. package/node_modules/rope-sequence/index.js +0 -190
  1552. package/node_modules/rope-sequence/package.json +0 -34
  1553. package/node_modules/rope-sequence/test.js +0 -78
  1554. package/node_modules/use-sync-external-store/LICENSE +0 -21
  1555. package/node_modules/use-sync-external-store/README.md +0 -5
  1556. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +0 -97
  1557. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +0 -85
  1558. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -95
  1559. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +0 -88
  1560. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.js +0 -59
  1561. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -66
  1562. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +0 -96
  1563. package/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +0 -84
  1564. package/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js +0 -27
  1565. package/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js +0 -13
  1566. package/node_modules/use-sync-external-store/index.js +0 -7
  1567. package/node_modules/use-sync-external-store/package.json +0 -43
  1568. package/node_modules/use-sync-external-store/shim/index.js +0 -7
  1569. package/node_modules/use-sync-external-store/shim/index.native.js +0 -7
  1570. package/node_modules/use-sync-external-store/shim/with-selector.js +0 -7
  1571. package/node_modules/use-sync-external-store/with-selector.js +0 -7
  1572. package/node_modules/w3c-keyname/.tern-port +0 -1
  1573. package/node_modules/w3c-keyname/LICENSE +0 -19
  1574. package/node_modules/w3c-keyname/README.md +0 -18
  1575. package/node_modules/w3c-keyname/index.cjs +0 -127
  1576. package/node_modules/w3c-keyname/index.d.cts +0 -5
  1577. package/node_modules/w3c-keyname/index.d.ts +0 -5
  1578. package/node_modules/w3c-keyname/index.js +0 -119
  1579. package/node_modules/w3c-keyname/package.json +0 -37
  1580. package/src/legacy/ask.tsx +0 -154
  1581. package/src/legacy/basic.tsx +0 -127
  1582. package/src/legacy/block-meta.ts +0 -42
  1583. package/src/legacy/block-ops.ts +0 -179
  1584. package/src/legacy/blocks.tsx +0 -165
  1585. package/src/legacy/boundary.tsx +0 -17
  1586. package/src/legacy/content.ts +0 -22
  1587. package/src/legacy/drag-handle.tsx +0 -188
  1588. package/src/legacy/dynamic.tsx +0 -145
  1589. package/src/legacy/editor.css +0 -356
  1590. package/src/legacy/editor.tsx +0 -425
  1591. package/src/legacy/extensions.ts +0 -78
  1592. package/src/legacy/insert-pattern.ts +0 -13
  1593. package/src/legacy/insert.ts +0 -9
  1594. package/src/legacy/inserter.tsx +0 -164
  1595. package/src/legacy/inspector.tsx +0 -237
  1596. package/src/legacy/layout-ui.tsx +0 -227
  1597. package/src/legacy/layout.tsx +0 -174
  1598. package/src/legacy/media.ts +0 -31
  1599. package/src/legacy/nodes.tsx +0 -107
  1600. package/src/legacy/outline.tsx +0 -124
  1601. package/src/legacy/panels.ts +0 -22
  1602. package/src/legacy/rank.ts +0 -22
  1603. package/src/legacy/registry.ts +0 -20
  1604. package/src/legacy/resize-handles.tsx +0 -149
  1605. package/src/legacy/style-attr.ts +0 -69
  1606. package/src/legacy/synced.tsx +0 -128
  1607. package/src/legacy/toolbar.tsx +0 -238
  1608. package/src/legacy/unknown.tsx +0 -74
@@ -1,2626 +0,0 @@
1
- import { NodeSelection, Plugin, PluginKey, Selection, SelectionRange, TextSelection } from "prosemirror-state";
2
- import { Fragment, Slice } from "prosemirror-model";
3
- import { Decoration, DecorationSet } from "prosemirror-view";
4
- import { keydownHandler } from "prosemirror-keymap";
5
- import { Transform } from "prosemirror-transform";
6
-
7
- //#region src/tablemap.ts
8
- let readFromCache;
9
- let addToCache;
10
- if (typeof WeakMap != "undefined") {
11
- let cache = /* @__PURE__ */ new WeakMap();
12
- readFromCache = (key) => cache.get(key);
13
- addToCache = (key, value) => {
14
- cache.set(key, value);
15
- return value;
16
- };
17
- } else {
18
- const cache = [];
19
- const cacheSize = 10;
20
- let cachePos = 0;
21
- readFromCache = (key) => {
22
- for (let i = 0; i < cache.length; i += 2) if (cache[i] == key) return cache[i + 1];
23
- };
24
- addToCache = (key, value) => {
25
- if (cachePos == cacheSize) cachePos = 0;
26
- cache[cachePos++] = key;
27
- return cache[cachePos++] = value;
28
- };
29
- }
30
- /**
31
- * A table map describes the structure of a given table. To avoid
32
- * recomputing them all the time, they are cached per table node. To
33
- * be able to do that, positions saved in the map are relative to the
34
- * start of the table, rather than the start of the document.
35
- *
36
- * @public
37
- */
38
- var TableMap = class {
39
- constructor(width, height, map, problems) {
40
- this.width = width;
41
- this.height = height;
42
- this.map = map;
43
- this.problems = problems;
44
- }
45
- findCell(pos) {
46
- for (let i = 0; i < this.map.length; i++) {
47
- const curPos = this.map[i];
48
- if (curPos != pos) continue;
49
- const left = i % this.width;
50
- const top = i / this.width | 0;
51
- let right = left + 1;
52
- let bottom = top + 1;
53
- for (let j = 1; right < this.width && this.map[i + j] == curPos; j++) right++;
54
- for (let j = 1; bottom < this.height && this.map[i + this.width * j] == curPos; j++) bottom++;
55
- return {
56
- left,
57
- top,
58
- right,
59
- bottom
60
- };
61
- }
62
- throw new RangeError(`No cell with offset ${pos} found`);
63
- }
64
- colCount(pos) {
65
- for (let i = 0; i < this.map.length; i++) if (this.map[i] == pos) return i % this.width;
66
- throw new RangeError(`No cell with offset ${pos} found`);
67
- }
68
- nextCell(pos, axis, dir) {
69
- const { left, right, top, bottom } = this.findCell(pos);
70
- if (axis == "horiz") {
71
- if (dir < 0 ? left == 0 : right == this.width) return null;
72
- return this.map[top * this.width + (dir < 0 ? left - 1 : right)];
73
- } else {
74
- if (dir < 0 ? top == 0 : bottom == this.height) return null;
75
- return this.map[left + this.width * (dir < 0 ? top - 1 : bottom)];
76
- }
77
- }
78
- rectBetween(a, b) {
79
- const { left: leftA, right: rightA, top: topA, bottom: bottomA } = this.findCell(a);
80
- const { left: leftB, right: rightB, top: topB, bottom: bottomB } = this.findCell(b);
81
- return {
82
- left: Math.min(leftA, leftB),
83
- top: Math.min(topA, topB),
84
- right: Math.max(rightA, rightB),
85
- bottom: Math.max(bottomA, bottomB)
86
- };
87
- }
88
- cellsInRect(rect) {
89
- const result = [];
90
- const seen = {};
91
- for (let row = rect.top; row < rect.bottom; row++) for (let col = rect.left; col < rect.right; col++) {
92
- const index = row * this.width + col;
93
- const pos = this.map[index];
94
- if (seen[pos]) continue;
95
- seen[pos] = true;
96
- if (col == rect.left && col && this.map[index - 1] == pos || row == rect.top && row && this.map[index - this.width] == pos) continue;
97
- result.push(pos);
98
- }
99
- return result;
100
- }
101
- positionAt(row, col, table) {
102
- for (let i = 0, rowStart = 0;; i++) {
103
- const rowEnd = rowStart + table.child(i).nodeSize;
104
- if (i == row) {
105
- let index = col + row * this.width;
106
- const rowEndIndex = (row + 1) * this.width;
107
- while (index < rowEndIndex && this.map[index] < rowStart) index++;
108
- return index == rowEndIndex ? rowEnd - 1 : this.map[index];
109
- }
110
- rowStart = rowEnd;
111
- }
112
- }
113
- static get(table) {
114
- return readFromCache(table) || addToCache(table, computeMap(table));
115
- }
116
- };
117
- function computeMap(table) {
118
- if (table.type.spec.tableRole != "table") throw new RangeError("Not a table node: " + table.type.name);
119
- const width = findWidth(table), height = table.childCount;
120
- const map = [];
121
- let mapPos = 0;
122
- let problems = null;
123
- const colWidths = [];
124
- for (let i = 0, e = width * height; i < e; i++) map[i] = 0;
125
- for (let row = 0, pos = 0; row < height; row++) {
126
- const rowNode = table.child(row);
127
- pos++;
128
- for (let i = 0;; i++) {
129
- while (mapPos < map.length && map[mapPos] != 0) mapPos++;
130
- if (i == rowNode.childCount) break;
131
- const cellNode = rowNode.child(i);
132
- const { colspan, rowspan, colwidth } = cellNode.attrs;
133
- for (let h = 0; h < rowspan; h++) {
134
- if (h + row >= height) {
135
- (problems || (problems = [])).push({
136
- type: "overlong_rowspan",
137
- pos,
138
- n: rowspan - h
139
- });
140
- break;
141
- }
142
- const start = mapPos + h * width;
143
- for (let w = 0; w < colspan; w++) {
144
- if (map[start + w] == 0) map[start + w] = pos;
145
- else (problems || (problems = [])).push({
146
- type: "collision",
147
- row,
148
- pos,
149
- n: colspan - w
150
- });
151
- const colW = colwidth && colwidth[w];
152
- if (colW) {
153
- const widthIndex = (start + w) % width * 2, prev = colWidths[widthIndex];
154
- if (prev == null || prev != colW && colWidths[widthIndex + 1] == 1) {
155
- colWidths[widthIndex] = colW;
156
- colWidths[widthIndex + 1] = 1;
157
- } else if (prev == colW) colWidths[widthIndex + 1]++;
158
- }
159
- }
160
- }
161
- mapPos += colspan;
162
- pos += cellNode.nodeSize;
163
- }
164
- const expectedPos = (row + 1) * width;
165
- let missing = 0;
166
- while (mapPos < expectedPos) if (map[mapPos++] == 0) missing++;
167
- if (missing) (problems || (problems = [])).push({
168
- type: "missing",
169
- row,
170
- n: missing
171
- });
172
- pos++;
173
- }
174
- if (width === 0 || height === 0) (problems || (problems = [])).push({ type: "zero_sized" });
175
- const tableMap = new TableMap(width, height, map, problems);
176
- let badWidths = false;
177
- for (let i = 0; !badWidths && i < colWidths.length; i += 2) if (colWidths[i] != null && colWidths[i + 1] < height) badWidths = true;
178
- if (badWidths) findBadColWidths(tableMap, colWidths, table);
179
- return tableMap;
180
- }
181
- function findWidth(table) {
182
- let width = -1;
183
- let hasRowSpan = false;
184
- for (let row = 0; row < table.childCount; row++) {
185
- const rowNode = table.child(row);
186
- let rowWidth = 0;
187
- if (hasRowSpan) for (let j = 0; j < row; j++) {
188
- const prevRow = table.child(j);
189
- for (let i = 0; i < prevRow.childCount; i++) {
190
- const cell = prevRow.child(i);
191
- if (j + cell.attrs.rowspan > row) rowWidth += cell.attrs.colspan;
192
- }
193
- }
194
- for (let i = 0; i < rowNode.childCount; i++) {
195
- const cell = rowNode.child(i);
196
- rowWidth += cell.attrs.colspan;
197
- if (cell.attrs.rowspan > 1) hasRowSpan = true;
198
- }
199
- if (width == -1) width = rowWidth;
200
- else if (width != rowWidth) width = Math.max(width, rowWidth);
201
- }
202
- return width;
203
- }
204
- function findBadColWidths(map, colWidths, table) {
205
- if (!map.problems) map.problems = [];
206
- const seen = {};
207
- for (let i = 0; i < map.map.length; i++) {
208
- const pos = map.map[i];
209
- if (seen[pos]) continue;
210
- seen[pos] = true;
211
- const node = table.nodeAt(pos);
212
- if (!node) throw new RangeError(`No cell with offset ${pos} found`);
213
- let updated = null;
214
- const attrs = node.attrs;
215
- for (let j = 0; j < attrs.colspan; j++) {
216
- const colWidth = colWidths[(i + j) % map.width * 2];
217
- if (colWidth != null && (!attrs.colwidth || attrs.colwidth[j] != colWidth)) (updated || (updated = freshColWidth(attrs)))[j] = colWidth;
218
- }
219
- if (updated) map.problems.unshift({
220
- type: "colwidth mismatch",
221
- pos,
222
- colwidth: updated
223
- });
224
- }
225
- }
226
- function freshColWidth(attrs) {
227
- if (attrs.colwidth) return attrs.colwidth.slice();
228
- const result = [];
229
- for (let i = 0; i < attrs.colspan; i++) result.push(0);
230
- return result;
231
- }
232
-
233
- //#endregion
234
- //#region src/schema.ts
235
- function getCellAttrs(dom, extraAttrs) {
236
- if (typeof dom === "string") return {};
237
- const widthAttr = dom.getAttribute("data-colwidth");
238
- const widths = widthAttr && /^\d+(,\d+)*$/.test(widthAttr) ? widthAttr.split(",").map((s) => Number(s)) : null;
239
- const colspan = Number(dom.getAttribute("colspan") || 1);
240
- const result = {
241
- colspan,
242
- rowspan: Number(dom.getAttribute("rowspan") || 1),
243
- colwidth: widths && widths.length == colspan ? widths : null
244
- };
245
- for (const prop in extraAttrs) {
246
- const getter = extraAttrs[prop].getFromDOM;
247
- const value = getter && getter(dom);
248
- if (value != null) result[prop] = value;
249
- }
250
- return result;
251
- }
252
- function setCellAttrs(node, extraAttrs) {
253
- const attrs = {};
254
- if (node.attrs.colspan != 1) attrs.colspan = node.attrs.colspan;
255
- if (node.attrs.rowspan != 1) attrs.rowspan = node.attrs.rowspan;
256
- if (node.attrs.colwidth) attrs["data-colwidth"] = node.attrs.colwidth.join(",");
257
- for (const prop in extraAttrs) {
258
- const setter = extraAttrs[prop].setDOMAttr;
259
- if (setter) setter(node.attrs[prop], attrs);
260
- }
261
- return attrs;
262
- }
263
- function validateColwidth(value) {
264
- if (value === null) return;
265
- if (!Array.isArray(value)) throw new TypeError("colwidth must be null or an array");
266
- for (const item of value) if (typeof item !== "number") throw new TypeError("colwidth must be null or an array of numbers");
267
- }
268
- /**
269
- * This function creates a set of [node
270
- * specs](http://prosemirror.net/docs/ref/#model.SchemaSpec.nodes) for
271
- * `table`, `table_row`, and `table_cell` nodes types as used by this
272
- * module. The result can then be added to the set of nodes when
273
- * creating a schema.
274
- *
275
- * @public
276
- */
277
- function tableNodes(options) {
278
- const extraAttrs = options.cellAttributes || {};
279
- const cellAttrs = {
280
- colspan: {
281
- default: 1,
282
- validate: "number"
283
- },
284
- rowspan: {
285
- default: 1,
286
- validate: "number"
287
- },
288
- colwidth: {
289
- default: null,
290
- validate: validateColwidth
291
- }
292
- };
293
- for (const prop in extraAttrs) cellAttrs[prop] = {
294
- default: extraAttrs[prop].default,
295
- validate: extraAttrs[prop].validate
296
- };
297
- return {
298
- table: {
299
- content: "table_row+",
300
- tableRole: "table",
301
- isolating: true,
302
- group: options.tableGroup,
303
- parseDOM: [{ tag: "table" }],
304
- toDOM() {
305
- return ["table", ["tbody", 0]];
306
- }
307
- },
308
- table_row: {
309
- content: "(table_cell | table_header)*",
310
- tableRole: "row",
311
- parseDOM: [{ tag: "tr" }],
312
- toDOM() {
313
- return ["tr", 0];
314
- }
315
- },
316
- table_cell: {
317
- content: options.cellContent,
318
- attrs: cellAttrs,
319
- tableRole: "cell",
320
- isolating: true,
321
- parseDOM: [{
322
- tag: "td",
323
- getAttrs: (dom) => getCellAttrs(dom, extraAttrs)
324
- }],
325
- toDOM(node) {
326
- return [
327
- "td",
328
- setCellAttrs(node, extraAttrs),
329
- 0
330
- ];
331
- }
332
- },
333
- table_header: {
334
- content: options.cellContent,
335
- attrs: cellAttrs,
336
- tableRole: "header_cell",
337
- isolating: true,
338
- parseDOM: [{
339
- tag: "th",
340
- getAttrs: (dom) => getCellAttrs(dom, extraAttrs)
341
- }],
342
- toDOM(node) {
343
- return [
344
- "th",
345
- setCellAttrs(node, extraAttrs),
346
- 0
347
- ];
348
- }
349
- }
350
- };
351
- }
352
- /**
353
- * @public
354
- */
355
- function tableNodeTypes(schema) {
356
- let result = schema.cached.tableNodeTypes;
357
- if (!result) {
358
- result = schema.cached.tableNodeTypes = {};
359
- for (const name in schema.nodes) {
360
- const type = schema.nodes[name], role = type.spec.tableRole;
361
- if (role) result[role] = type;
362
- }
363
- }
364
- return result;
365
- }
366
-
367
- //#endregion
368
- //#region src/util.ts
369
- /**
370
- * @public
371
- */
372
- const tableEditingKey = new PluginKey("selectingCells");
373
- /**
374
- * @public
375
- */
376
- function cellAround($pos) {
377
- for (let d = $pos.depth - 1; d > 0; d--) if ($pos.node(d).type.spec.tableRole == "row") return $pos.node(0).resolve($pos.before(d + 1));
378
- return null;
379
- }
380
- function cellWrapping($pos) {
381
- for (let d = $pos.depth; d > 0; d--) {
382
- const role = $pos.node(d).type.spec.tableRole;
383
- if (role === "cell" || role === "header_cell") return $pos.node(d);
384
- }
385
- return null;
386
- }
387
- /**
388
- * @public
389
- */
390
- function isInTable(state) {
391
- const $head = state.selection.$head;
392
- for (let d = $head.depth; d > 0; d--) if ($head.node(d).type.spec.tableRole == "row") return true;
393
- return false;
394
- }
395
- /**
396
- * @internal
397
- */
398
- function selectionCell(state) {
399
- const sel = state.selection;
400
- if ("$anchorCell" in sel && sel.$anchorCell) return sel.$anchorCell.pos > sel.$headCell.pos ? sel.$anchorCell : sel.$headCell;
401
- else if ("node" in sel && sel.node && sel.node.type.spec.tableRole == "cell") return sel.$anchor;
402
- const $cell = cellAround(sel.$head) || cellNear(sel.$head);
403
- if ($cell) return $cell;
404
- throw new RangeError(`No cell found around position ${sel.head}`);
405
- }
406
- /**
407
- * @public
408
- */
409
- function cellNear($pos) {
410
- for (let after = $pos.nodeAfter, pos = $pos.pos; after; after = after.firstChild, pos++) {
411
- const role = after.type.spec.tableRole;
412
- if (role == "cell" || role == "header_cell") return $pos.doc.resolve(pos);
413
- }
414
- for (let before = $pos.nodeBefore, pos = $pos.pos; before; before = before.lastChild, pos--) {
415
- const role = before.type.spec.tableRole;
416
- if (role == "cell" || role == "header_cell") return $pos.doc.resolve(pos - before.nodeSize);
417
- }
418
- }
419
- /**
420
- * @public
421
- */
422
- function pointsAtCell($pos) {
423
- return $pos.parent.type.spec.tableRole == "row" && !!$pos.nodeAfter;
424
- }
425
- /**
426
- * @public
427
- */
428
- function moveCellForward($pos) {
429
- return $pos.node(0).resolve($pos.pos + $pos.nodeAfter.nodeSize);
430
- }
431
- /**
432
- * @internal
433
- */
434
- function inSameTable($cellA, $cellB) {
435
- return $cellA.depth == $cellB.depth && $cellA.pos >= $cellB.start(-1) && $cellA.pos <= $cellB.end(-1);
436
- }
437
- /**
438
- * @public
439
- */
440
- function findCell($pos) {
441
- return TableMap.get($pos.node(-1)).findCell($pos.pos - $pos.start(-1));
442
- }
443
- /**
444
- * @public
445
- */
446
- function colCount($pos) {
447
- return TableMap.get($pos.node(-1)).colCount($pos.pos - $pos.start(-1));
448
- }
449
- /**
450
- * @public
451
- */
452
- function nextCell($pos, axis, dir) {
453
- const table = $pos.node(-1);
454
- const map = TableMap.get(table);
455
- const tableStart = $pos.start(-1);
456
- const moved = map.nextCell($pos.pos - tableStart, axis, dir);
457
- return moved == null ? null : $pos.node(0).resolve(tableStart + moved);
458
- }
459
- /**
460
- * @public
461
- */
462
- function removeColSpan(attrs, pos, n = 1) {
463
- const result = {
464
- ...attrs,
465
- colspan: attrs.colspan - n
466
- };
467
- if (result.colwidth) {
468
- result.colwidth = result.colwidth.slice();
469
- result.colwidth.splice(pos, n);
470
- if (!result.colwidth.some((w) => w > 0)) result.colwidth = null;
471
- }
472
- return result;
473
- }
474
- /**
475
- * @public
476
- */
477
- function addColSpan(attrs, pos, n = 1) {
478
- const result = {
479
- ...attrs,
480
- colspan: attrs.colspan + n
481
- };
482
- if (result.colwidth) {
483
- result.colwidth = result.colwidth.slice();
484
- for (let i = 0; i < n; i++) result.colwidth.splice(pos, 0, 0);
485
- }
486
- return result;
487
- }
488
- /**
489
- * @public
490
- */
491
- function columnIsHeader(map, table, col) {
492
- const headerCell = tableNodeTypes(table.type.schema).header_cell;
493
- for (let row = 0; row < map.height; row++) if (table.nodeAt(map.map[col + row * map.width]).type != headerCell) return false;
494
- return true;
495
- }
496
-
497
- //#endregion
498
- //#region src/cellselection.ts
499
- /**
500
- * A [`Selection`](http://prosemirror.net/docs/ref/#state.Selection)
501
- * subclass that represents a cell selection spanning part of a table.
502
- * With the plugin enabled, these will be created when the user
503
- * selects across cells, and will be drawn by giving selected cells a
504
- * `selectedCell` CSS class.
505
- *
506
- * @public
507
- */
508
- var CellSelection = class CellSelection extends Selection {
509
- constructor($anchorCell, $headCell = $anchorCell) {
510
- const table = $anchorCell.node(-1);
511
- const map = TableMap.get(table);
512
- const tableStart = $anchorCell.start(-1);
513
- const rect = map.rectBetween($anchorCell.pos - tableStart, $headCell.pos - tableStart);
514
- const doc = $anchorCell.node(0);
515
- const cells = map.cellsInRect(rect).filter((p) => p != $headCell.pos - tableStart);
516
- cells.unshift($headCell.pos - tableStart);
517
- const ranges = cells.map((pos) => {
518
- const cell = table.nodeAt(pos);
519
- if (!cell) throw new RangeError(`No cell with offset ${pos} found`);
520
- const from = tableStart + pos + 1;
521
- return new SelectionRange(doc.resolve(from), doc.resolve(from + cell.content.size));
522
- });
523
- super(ranges[0].$from, ranges[0].$to, ranges);
524
- this.$anchorCell = $anchorCell;
525
- this.$headCell = $headCell;
526
- }
527
- map(doc, mapping) {
528
- const $anchorCell = doc.resolve(mapping.map(this.$anchorCell.pos));
529
- const $headCell = doc.resolve(mapping.map(this.$headCell.pos));
530
- if (pointsAtCell($anchorCell) && pointsAtCell($headCell) && inSameTable($anchorCell, $headCell)) {
531
- const tableChanged = this.$anchorCell.node(-1) != $anchorCell.node(-1);
532
- if (tableChanged && this.isRowSelection()) return CellSelection.rowSelection($anchorCell, $headCell);
533
- else if (tableChanged && this.isColSelection()) return CellSelection.colSelection($anchorCell, $headCell);
534
- else return new CellSelection($anchorCell, $headCell);
535
- }
536
- return TextSelection.between($anchorCell, $headCell);
537
- }
538
- content() {
539
- const table = this.$anchorCell.node(-1);
540
- const map = TableMap.get(table);
541
- const tableStart = this.$anchorCell.start(-1);
542
- const rect = map.rectBetween(this.$anchorCell.pos - tableStart, this.$headCell.pos - tableStart);
543
- const seen = {};
544
- const rows = [];
545
- for (let row = rect.top; row < rect.bottom; row++) {
546
- const rowContent = [];
547
- for (let index = row * map.width + rect.left, col = rect.left; col < rect.right; col++, index++) {
548
- const pos = map.map[index];
549
- if (seen[pos]) continue;
550
- seen[pos] = true;
551
- const cellRect = map.findCell(pos);
552
- let cell = table.nodeAt(pos);
553
- if (!cell) throw new RangeError(`No cell with offset ${pos} found`);
554
- const extraLeft = rect.left - cellRect.left;
555
- const extraRight = cellRect.right - rect.right;
556
- if (extraLeft > 0 || extraRight > 0) {
557
- let attrs = cell.attrs;
558
- if (extraLeft > 0) attrs = removeColSpan(attrs, 0, extraLeft);
559
- if (extraRight > 0) attrs = removeColSpan(attrs, attrs.colspan - extraRight, extraRight);
560
- if (cellRect.left < rect.left) {
561
- cell = cell.type.createAndFill(attrs);
562
- if (!cell) throw new RangeError(`Could not create cell with attrs ${JSON.stringify(attrs)}`);
563
- } else cell = cell.type.create(attrs, cell.content);
564
- }
565
- if (cellRect.top < rect.top || cellRect.bottom > rect.bottom) {
566
- const attrs = {
567
- ...cell.attrs,
568
- rowspan: Math.min(cellRect.bottom, rect.bottom) - Math.max(cellRect.top, rect.top)
569
- };
570
- if (cellRect.top < rect.top) cell = cell.type.createAndFill(attrs);
571
- else cell = cell.type.create(attrs, cell.content);
572
- }
573
- rowContent.push(cell);
574
- }
575
- rows.push(table.child(row).copy(Fragment.from(rowContent)));
576
- }
577
- const fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
578
- return new Slice(Fragment.from(fragment), 1, 1);
579
- }
580
- replace(tr, content = Slice.empty) {
581
- const mapFrom = tr.steps.length, ranges = this.ranges;
582
- for (let i = 0; i < ranges.length; i++) {
583
- const { $from, $to } = ranges[i], mapping = tr.mapping.slice(mapFrom);
584
- tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ? Slice.empty : content);
585
- }
586
- const sel = Selection.findFrom(tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)), -1);
587
- if (sel) tr.setSelection(sel);
588
- }
589
- replaceWith(tr, node) {
590
- this.replace(tr, new Slice(Fragment.from(node), 0, 0));
591
- }
592
- forEachCell(f) {
593
- const table = this.$anchorCell.node(-1);
594
- const map = TableMap.get(table);
595
- const tableStart = this.$anchorCell.start(-1);
596
- const cells = map.cellsInRect(map.rectBetween(this.$anchorCell.pos - tableStart, this.$headCell.pos - tableStart));
597
- for (let i = 0; i < cells.length; i++) f(table.nodeAt(cells[i]), tableStart + cells[i]);
598
- }
599
- isColSelection() {
600
- const anchorTop = this.$anchorCell.index(-1);
601
- const headTop = this.$headCell.index(-1);
602
- if (Math.min(anchorTop, headTop) > 0) return false;
603
- const anchorBottom = anchorTop + this.$anchorCell.nodeAfter.attrs.rowspan;
604
- const headBottom = headTop + this.$headCell.nodeAfter.attrs.rowspan;
605
- return Math.max(anchorBottom, headBottom) == this.$headCell.node(-1).childCount;
606
- }
607
- static colSelection($anchorCell, $headCell = $anchorCell) {
608
- const table = $anchorCell.node(-1);
609
- const map = TableMap.get(table);
610
- const tableStart = $anchorCell.start(-1);
611
- const anchorRect = map.findCell($anchorCell.pos - tableStart);
612
- const headRect = map.findCell($headCell.pos - tableStart);
613
- const doc = $anchorCell.node(0);
614
- if (anchorRect.top <= headRect.top) {
615
- if (anchorRect.top > 0) $anchorCell = doc.resolve(tableStart + map.map[anchorRect.left]);
616
- if (headRect.bottom < map.height) $headCell = doc.resolve(tableStart + map.map[map.width * (map.height - 1) + headRect.right - 1]);
617
- } else {
618
- if (headRect.top > 0) $headCell = doc.resolve(tableStart + map.map[headRect.left]);
619
- if (anchorRect.bottom < map.height) $anchorCell = doc.resolve(tableStart + map.map[map.width * (map.height - 1) + anchorRect.right - 1]);
620
- }
621
- return new CellSelection($anchorCell, $headCell);
622
- }
623
- isRowSelection() {
624
- const table = this.$anchorCell.node(-1);
625
- const map = TableMap.get(table);
626
- const tableStart = this.$anchorCell.start(-1);
627
- const anchorLeft = map.colCount(this.$anchorCell.pos - tableStart);
628
- const headLeft = map.colCount(this.$headCell.pos - tableStart);
629
- if (Math.min(anchorLeft, headLeft) > 0) return false;
630
- const anchorRight = anchorLeft + this.$anchorCell.nodeAfter.attrs.colspan;
631
- const headRight = headLeft + this.$headCell.nodeAfter.attrs.colspan;
632
- return Math.max(anchorRight, headRight) == map.width;
633
- }
634
- eq(other) {
635
- return other instanceof CellSelection && other.$anchorCell.pos == this.$anchorCell.pos && other.$headCell.pos == this.$headCell.pos;
636
- }
637
- static rowSelection($anchorCell, $headCell = $anchorCell) {
638
- const table = $anchorCell.node(-1);
639
- const map = TableMap.get(table);
640
- const tableStart = $anchorCell.start(-1);
641
- const anchorRect = map.findCell($anchorCell.pos - tableStart);
642
- const headRect = map.findCell($headCell.pos - tableStart);
643
- const doc = $anchorCell.node(0);
644
- if (anchorRect.left <= headRect.left) {
645
- if (anchorRect.left > 0) $anchorCell = doc.resolve(tableStart + map.map[anchorRect.top * map.width]);
646
- if (headRect.right < map.width) $headCell = doc.resolve(tableStart + map.map[map.width * (headRect.top + 1) - 1]);
647
- } else {
648
- if (headRect.left > 0) $headCell = doc.resolve(tableStart + map.map[headRect.top * map.width]);
649
- if (anchorRect.right < map.width) $anchorCell = doc.resolve(tableStart + map.map[map.width * (anchorRect.top + 1) - 1]);
650
- }
651
- return new CellSelection($anchorCell, $headCell);
652
- }
653
- toJSON() {
654
- return {
655
- type: "cell",
656
- anchor: this.$anchorCell.pos,
657
- head: this.$headCell.pos
658
- };
659
- }
660
- static fromJSON(doc, json) {
661
- return new CellSelection(doc.resolve(json.anchor), doc.resolve(json.head));
662
- }
663
- static create(doc, anchorCell, headCell = anchorCell) {
664
- return new CellSelection(doc.resolve(anchorCell), doc.resolve(headCell));
665
- }
666
- getBookmark() {
667
- return new CellBookmark(this.$anchorCell.pos, this.$headCell.pos);
668
- }
669
- };
670
- CellSelection.prototype.visible = false;
671
- Selection.jsonID("cell", CellSelection);
672
- /**
673
- * @public
674
- */
675
- var CellBookmark = class CellBookmark {
676
- constructor(anchor, head) {
677
- this.anchor = anchor;
678
- this.head = head;
679
- }
680
- map(mapping) {
681
- return new CellBookmark(mapping.map(this.anchor), mapping.map(this.head));
682
- }
683
- resolve(doc) {
684
- const $anchorCell = doc.resolve(this.anchor), $headCell = doc.resolve(this.head);
685
- if ($anchorCell.parent.type.spec.tableRole == "row" && $headCell.parent.type.spec.tableRole == "row" && $anchorCell.index() < $anchorCell.parent.childCount && $headCell.index() < $headCell.parent.childCount && inSameTable($anchorCell, $headCell)) return new CellSelection($anchorCell, $headCell);
686
- else return Selection.near($headCell, 1);
687
- }
688
- };
689
- function drawCellSelection(state) {
690
- if (!(state.selection instanceof CellSelection)) return null;
691
- const cells = [];
692
- state.selection.forEachCell((node, pos) => {
693
- cells.push(Decoration.node(pos, pos + node.nodeSize, { class: "selectedCell" }));
694
- });
695
- return DecorationSet.create(state.doc, cells);
696
- }
697
- function isCellBoundarySelection({ $from, $to }) {
698
- if ($from.pos == $to.pos || $from.pos < $to.pos - 6) return false;
699
- let afterFrom = $from.pos;
700
- let beforeTo = $to.pos;
701
- let depth = $from.depth;
702
- for (; depth >= 0; depth--, afterFrom++) if ($from.after(depth + 1) < $from.end(depth)) break;
703
- for (let d = $to.depth; d >= 0; d--, beforeTo--) if ($to.before(d + 1) > $to.start(d)) break;
704
- return afterFrom == beforeTo && /row|table/.test($from.node(depth).type.spec.tableRole);
705
- }
706
- function isTextSelectionAcrossCells({ $from, $to }) {
707
- let fromCellBoundaryNode;
708
- let toCellBoundaryNode;
709
- for (let i = $from.depth; i > 0; i--) {
710
- const node = $from.node(i);
711
- if (node.type.spec.tableRole === "cell" || node.type.spec.tableRole === "header_cell") {
712
- fromCellBoundaryNode = node;
713
- break;
714
- }
715
- }
716
- for (let i = $to.depth; i > 0; i--) {
717
- const node = $to.node(i);
718
- if (node.type.spec.tableRole === "cell" || node.type.spec.tableRole === "header_cell") {
719
- toCellBoundaryNode = node;
720
- break;
721
- }
722
- }
723
- return fromCellBoundaryNode !== toCellBoundaryNode && $to.parentOffset === 0;
724
- }
725
- function normalizeSelection(state, tr, allowTableNodeSelection) {
726
- const sel = (tr || state).selection;
727
- const doc = (tr || state).doc;
728
- let normalize;
729
- let role;
730
- if (sel instanceof NodeSelection && (role = sel.node.type.spec.tableRole)) {
731
- if (role == "cell" || role == "header_cell") normalize = CellSelection.create(doc, sel.from);
732
- else if (role == "row") {
733
- const $cell = doc.resolve(sel.from + 1);
734
- normalize = CellSelection.rowSelection($cell, $cell);
735
- } else if (!allowTableNodeSelection) {
736
- const map = TableMap.get(sel.node);
737
- const start = sel.from + 1;
738
- const lastCell = start + map.map[map.width * map.height - 1];
739
- normalize = CellSelection.create(doc, start + 1, lastCell);
740
- }
741
- } else if (sel instanceof TextSelection && isCellBoundarySelection(sel)) normalize = TextSelection.create(doc, sel.from);
742
- else if (sel instanceof TextSelection && isTextSelectionAcrossCells(sel)) normalize = TextSelection.create(doc, sel.$from.start(), sel.$from.end());
743
- if (normalize) (tr || (tr = state.tr)).setSelection(normalize);
744
- return tr;
745
- }
746
-
747
- //#endregion
748
- //#region src/fixtables.ts
749
- /**
750
- * @public
751
- */
752
- const fixTablesKey = new PluginKey("fix-tables");
753
- /**
754
- * Helper for iterating through the nodes in a document that changed
755
- * compared to the given previous document. Useful for avoiding
756
- * duplicate work on each transaction.
757
- *
758
- * @public
759
- */
760
- function changedDescendants(old, cur, offset, f) {
761
- const oldSize = old.childCount, curSize = cur.childCount;
762
- outer: for (let i = 0, j = 0; i < curSize; i++) {
763
- const child = cur.child(i);
764
- for (let scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) if (old.child(scan) == child) {
765
- j = scan + 1;
766
- offset += child.nodeSize;
767
- continue outer;
768
- }
769
- f(child, offset);
770
- if (j < oldSize && old.child(j).sameMarkup(child)) changedDescendants(old.child(j), child, offset + 1, f);
771
- else child.nodesBetween(0, child.content.size, f, offset + 1);
772
- offset += child.nodeSize;
773
- }
774
- }
775
- /**
776
- * Inspect all tables in the given state's document and return a
777
- * transaction that fixes them, if necessary. If `oldState` was
778
- * provided, that is assumed to hold a previous, known-good state,
779
- * which will be used to avoid re-scanning unchanged parts of the
780
- * document.
781
- *
782
- * @public
783
- */
784
- function fixTables(state, oldState) {
785
- let tr;
786
- const check = (node, pos) => {
787
- if (node.type.spec.tableRole == "table") tr = fixTable(state, node, pos, tr);
788
- };
789
- if (!oldState) state.doc.descendants(check);
790
- else if (oldState.doc != state.doc) changedDescendants(oldState.doc, state.doc, 0, check);
791
- return tr;
792
- }
793
- function fixTable(state, table, tablePos, tr) {
794
- const map = TableMap.get(table);
795
- if (!map.problems) return tr;
796
- if (!tr) tr = state.tr;
797
- const mustAdd = [];
798
- for (let i = 0; i < map.height; i++) mustAdd.push(0);
799
- for (let i = 0; i < map.problems.length; i++) {
800
- const prob = map.problems[i];
801
- if (prob.type == "collision") {
802
- const cell = table.nodeAt(prob.pos);
803
- if (!cell) continue;
804
- const attrs = cell.attrs;
805
- for (let j = 0; j < attrs.rowspan; j++) mustAdd[prob.row + j] += prob.n;
806
- tr.setNodeMarkup(tr.mapping.map(tablePos + 1 + prob.pos), null, removeColSpan(attrs, attrs.colspan - prob.n, prob.n));
807
- } else if (prob.type == "missing") mustAdd[prob.row] += prob.n;
808
- else if (prob.type == "overlong_rowspan") {
809
- const cell = table.nodeAt(prob.pos);
810
- if (!cell) continue;
811
- tr.setNodeMarkup(tr.mapping.map(tablePos + 1 + prob.pos), null, {
812
- ...cell.attrs,
813
- rowspan: cell.attrs.rowspan - prob.n
814
- });
815
- } else if (prob.type == "colwidth mismatch") {
816
- const cell = table.nodeAt(prob.pos);
817
- if (!cell) continue;
818
- tr.setNodeMarkup(tr.mapping.map(tablePos + 1 + prob.pos), null, {
819
- ...cell.attrs,
820
- colwidth: prob.colwidth
821
- });
822
- } else if (prob.type == "zero_sized") {
823
- const pos = tr.mapping.map(tablePos);
824
- tr.delete(pos, pos + table.nodeSize);
825
- }
826
- }
827
- let first, last;
828
- for (let i = 0; i < mustAdd.length; i++) if (mustAdd[i]) {
829
- if (first == null) first = i;
830
- last = i;
831
- }
832
- for (let i = 0, pos = tablePos + 1; i < map.height; i++) {
833
- const row = table.child(i);
834
- const end = pos + row.nodeSize;
835
- const add = mustAdd[i];
836
- if (add > 0) {
837
- let role = "cell";
838
- if (row.firstChild) role = row.firstChild.type.spec.tableRole;
839
- const nodes = [];
840
- for (let j = 0; j < add; j++) {
841
- const node = tableNodeTypes(state.schema)[role].createAndFill();
842
- if (node) nodes.push(node);
843
- }
844
- const side = (i == 0 || first == i - 1) && last == i ? pos + 1 : end - 1;
845
- tr.insert(tr.mapping.map(side), nodes);
846
- }
847
- pos = end;
848
- }
849
- return tr.setMeta(fixTablesKey, { fixTables: true });
850
- }
851
-
852
- //#endregion
853
- //#region src/utils/convert.ts
854
- /**
855
- * This function will transform the table node into a matrix of rows and columns
856
- * respecting merged cells, for example this table:
857
- *
858
- * ```
859
- * ┌──────┬──────┬─────────────┐
860
- * │ A1 │ B1 │ C1 │
861
- * ├──────┼──────┴──────┬──────┤
862
- * │ A2 │ B2 │ │
863
- * ├──────┼─────────────┤ D1 │
864
- * │ A3 │ B3 │ C3 │ │
865
- * └──────┴──────┴──────┴──────┘
866
- * ```
867
- *
868
- * will be converted to the below:
869
- *
870
- * ```javascript
871
- * [
872
- * [A1, B1, C1, null],
873
- * [A2, B2, null, D1],
874
- * [A3, B3, C3, null],
875
- * ]
876
- * ```
877
- * @internal
878
- */
879
- function convertTableNodeToArrayOfRows(tableNode) {
880
- const map = TableMap.get(tableNode);
881
- const rows = [];
882
- const rowCount = map.height;
883
- const colCount$1 = map.width;
884
- for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
885
- const row = [];
886
- for (let colIndex = 0; colIndex < colCount$1; colIndex++) {
887
- const cellIndex = rowIndex * colCount$1 + colIndex;
888
- const cellPos = map.map[cellIndex];
889
- if (rowIndex > 0) {
890
- const topCellIndex = cellIndex - colCount$1;
891
- if (cellPos === map.map[topCellIndex]) {
892
- row.push(null);
893
- continue;
894
- }
895
- }
896
- if (colIndex > 0) {
897
- const leftCellIndex = cellIndex - 1;
898
- if (cellPos === map.map[leftCellIndex]) {
899
- row.push(null);
900
- continue;
901
- }
902
- }
903
- row.push(tableNode.nodeAt(cellPos));
904
- }
905
- rows.push(row);
906
- }
907
- return rows;
908
- }
909
- /**
910
- * Convert an array of rows to a table node.
911
- *
912
- * @internal
913
- */
914
- function convertArrayOfRowsToTableNode(tableNode, arrayOfNodes) {
915
- const newRows = [];
916
- const map = TableMap.get(tableNode);
917
- const rowCount = map.height;
918
- const colCount$1 = map.width;
919
- for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
920
- const oldRow = tableNode.child(rowIndex);
921
- const newCells = [];
922
- for (let colIndex = 0; colIndex < colCount$1; colIndex++) {
923
- const cell = arrayOfNodes[rowIndex][colIndex];
924
- if (!cell) continue;
925
- const cellPos = map.map[rowIndex * map.width + colIndex];
926
- const oldCell = tableNode.nodeAt(cellPos);
927
- if (!oldCell) continue;
928
- const newCell = oldCell.type.createChecked(cell.attrs, cell.content, cell.marks);
929
- newCells.push(newCell);
930
- }
931
- const newRow = oldRow.type.createChecked(oldRow.attrs, newCells, oldRow.marks);
932
- newRows.push(newRow);
933
- }
934
- return tableNode.type.createChecked(tableNode.attrs, newRows, tableNode.marks);
935
- }
936
-
937
- //#endregion
938
- //#region src/utils/move-row-in-array-of-rows.ts
939
- /**
940
- * Move a row in an array of rows.
941
- *
942
- * @internal
943
- */
944
- function moveRowInArrayOfRows(rows, indexesOrigin, indexesTarget, directionOverride) {
945
- const direction = indexesOrigin[0] > indexesTarget[0] ? -1 : 1;
946
- const rowsExtracted = rows.splice(indexesOrigin[0], indexesOrigin.length);
947
- const positionOffset = rowsExtracted.length % 2 === 0 ? 1 : 0;
948
- let target;
949
- if (directionOverride === -1 && direction === 1) target = indexesTarget[0] - 1;
950
- else if (directionOverride === 1 && direction === -1) target = indexesTarget[indexesTarget.length - 1] - positionOffset + 1;
951
- else target = direction === -1 ? indexesTarget[0] : indexesTarget[indexesTarget.length - 1] - positionOffset;
952
- rows.splice(target, 0, ...rowsExtracted);
953
- return rows;
954
- }
955
-
956
- //#endregion
957
- //#region src/utils/query.ts
958
- /**
959
- * Checks if the given object is a `CellSelection` instance.
960
- *
961
- * @internal
962
- */
963
- function isCellSelection(value) {
964
- return value instanceof CellSelection;
965
- }
966
- /**
967
- * Find the closest table node for a given position.
968
- *
969
- * @public
970
- */
971
- function findTable($pos) {
972
- return findParentNode((node) => node.type.spec.tableRole === "table", $pos);
973
- }
974
- /**
975
- * Try to find the anchor and head cell in the same table by using the given
976
- * anchor and head as hit points, or fallback to the selection's anchor and
977
- * head.
978
- *
979
- * @public
980
- */
981
- function findCellRange(selection, anchorHit, headHit) {
982
- var _ref, _ref2;
983
- if (anchorHit == null && headHit == null && isCellSelection(selection)) return [selection.$anchorCell, selection.$headCell];
984
- const anchor = (_ref = anchorHit !== null && anchorHit !== void 0 ? anchorHit : headHit) !== null && _ref !== void 0 ? _ref : selection.anchor;
985
- const head = (_ref2 = headHit !== null && headHit !== void 0 ? headHit : anchorHit) !== null && _ref2 !== void 0 ? _ref2 : selection.head;
986
- const doc = selection.$head.doc;
987
- const $anchorCell = findCellPos(doc, anchor);
988
- const $headCell = findCellPos(doc, head);
989
- if ($anchorCell && $headCell && inSameTable($anchorCell, $headCell)) return [$anchorCell, $headCell];
990
- return null;
991
- }
992
- /**
993
- * Try to find a resolved pos of a cell by using the given pos as a hit point.
994
- *
995
- * @public
996
- */
997
- function findCellPos(doc, pos) {
998
- const $pos = doc.resolve(pos);
999
- return cellAround($pos) || cellNear($pos);
1000
- }
1001
- /**
1002
- * Find the closest parent node that satisfies the predicate.
1003
- *
1004
- * @internal
1005
- */
1006
- function findParentNode(predicate, $pos) {
1007
- for (let depth = $pos.depth; depth >= 0; depth -= 1) {
1008
- const node = $pos.node(depth);
1009
- if (predicate(node)) return {
1010
- node,
1011
- pos: depth === 0 ? 0 : $pos.before(depth),
1012
- start: $pos.start(depth),
1013
- depth
1014
- };
1015
- }
1016
- return null;
1017
- }
1018
-
1019
- //#endregion
1020
- //#region src/utils/get-cells.ts
1021
- /**
1022
- * Returns an array of cells in a column at the specified column index.
1023
- *
1024
- * @internal
1025
- */
1026
- function getCellsInColumn(columnIndex, selection) {
1027
- const table = findTable(selection.$from);
1028
- if (!table) return;
1029
- const map = TableMap.get(table.node);
1030
- if (columnIndex < 0 || columnIndex > map.width - 1) return;
1031
- return map.cellsInRect({
1032
- left: columnIndex,
1033
- right: columnIndex + 1,
1034
- top: 0,
1035
- bottom: map.height
1036
- }).map((nodePos) => {
1037
- const node = table.node.nodeAt(nodePos);
1038
- const pos = nodePos + table.start;
1039
- return {
1040
- pos,
1041
- start: pos + 1,
1042
- node,
1043
- depth: table.depth + 2
1044
- };
1045
- });
1046
- }
1047
- /**
1048
- * Returns an array of cells in a row at the specified row index.
1049
- *
1050
- * @internal
1051
- */
1052
- function getCellsInRow(rowIndex, selection) {
1053
- const table = findTable(selection.$from);
1054
- if (!table) return;
1055
- const map = TableMap.get(table.node);
1056
- if (rowIndex < 0 || rowIndex > map.height - 1) return;
1057
- return map.cellsInRect({
1058
- left: 0,
1059
- right: map.width,
1060
- top: rowIndex,
1061
- bottom: rowIndex + 1
1062
- }).map((nodePos) => {
1063
- const node = table.node.nodeAt(nodePos);
1064
- const pos = nodePos + table.start;
1065
- return {
1066
- pos,
1067
- start: pos + 1,
1068
- node,
1069
- depth: table.depth + 2
1070
- };
1071
- });
1072
- }
1073
-
1074
- //#endregion
1075
- //#region src/utils/selection-range.ts
1076
- /**
1077
- * Returns a range of rectangular selection spanning all merged cells around a
1078
- * column at index `columnIndex`.
1079
- *
1080
- * Original implementation from Atlassian (Apache License 2.0)
1081
- *
1082
- * https://bitbucket.org/atlassian/atlassian-frontend-mirror/src/5f91cb871e8248bc3bae5ddc30bb9fd9200fadbb/editor/editor-tables/src/utils/get-selection-range-in-column.ts#editor/editor-tables/src/utils/get-selection-range-in-column.ts
1083
- *
1084
- * @internal
1085
- */
1086
- function getSelectionRangeInColumn(tr, startColIndex, endColIndex = startColIndex) {
1087
- let startIndex = startColIndex;
1088
- let endIndex = endColIndex;
1089
- for (let i = startColIndex; i >= 0; i--) {
1090
- const cells = getCellsInColumn(i, tr.selection);
1091
- if (cells) cells.forEach((cell) => {
1092
- const maybeEndIndex = cell.node.attrs.colspan + i - 1;
1093
- if (maybeEndIndex >= startIndex) startIndex = i;
1094
- if (maybeEndIndex > endIndex) endIndex = maybeEndIndex;
1095
- });
1096
- }
1097
- for (let i = startColIndex; i <= endIndex; i++) {
1098
- const cells = getCellsInColumn(i, tr.selection);
1099
- if (cells) cells.forEach((cell) => {
1100
- const maybeEndIndex = cell.node.attrs.colspan + i - 1;
1101
- if (cell.node.attrs.colspan > 1 && maybeEndIndex > endIndex) endIndex = maybeEndIndex;
1102
- });
1103
- }
1104
- const indexes = [];
1105
- for (let i = startIndex; i <= endIndex; i++) {
1106
- const maybeCells = getCellsInColumn(i, tr.selection);
1107
- if (maybeCells && maybeCells.length > 0) indexes.push(i);
1108
- }
1109
- startIndex = indexes[0];
1110
- endIndex = indexes[indexes.length - 1];
1111
- const firstSelectedColumnCells = getCellsInColumn(startIndex, tr.selection);
1112
- const firstRowCells = getCellsInRow(0, tr.selection);
1113
- if (!firstSelectedColumnCells || !firstRowCells) return;
1114
- const $anchor = tr.doc.resolve(firstSelectedColumnCells[firstSelectedColumnCells.length - 1].pos);
1115
- let headCell;
1116
- for (let i = endIndex; i >= startIndex; i--) {
1117
- const columnCells = getCellsInColumn(i, tr.selection);
1118
- if (columnCells && columnCells.length > 0) {
1119
- for (let j = firstRowCells.length - 1; j >= 0; j--) if (firstRowCells[j].pos === columnCells[0].pos) {
1120
- headCell = columnCells[0];
1121
- break;
1122
- }
1123
- if (headCell) break;
1124
- }
1125
- }
1126
- if (!headCell) return;
1127
- return {
1128
- $anchor,
1129
- $head: tr.doc.resolve(headCell.pos),
1130
- indexes
1131
- };
1132
- }
1133
- /**
1134
- * Returns a range of rectangular selection spanning all merged cells around a
1135
- * row at index `rowIndex`.
1136
- *
1137
- * Original implementation from Atlassian (Apache License 2.0)
1138
- *
1139
- * https://bitbucket.org/atlassian/atlassian-frontend-mirror/src/5f91cb871e8248bc3bae5ddc30bb9fd9200fadbb/editor/editor-tables/src/utils/get-selection-range-in-row.ts#editor/editor-tables/src/utils/get-selection-range-in-row.ts
1140
- *
1141
- * @internal
1142
- */
1143
- function getSelectionRangeInRow(tr, startRowIndex, endRowIndex = startRowIndex) {
1144
- let startIndex = startRowIndex;
1145
- let endIndex = endRowIndex;
1146
- for (let i = startRowIndex; i >= 0; i--) {
1147
- const cells = getCellsInRow(i, tr.selection);
1148
- if (cells) cells.forEach((cell) => {
1149
- const maybeEndIndex = cell.node.attrs.rowspan + i - 1;
1150
- if (maybeEndIndex >= startIndex) startIndex = i;
1151
- if (maybeEndIndex > endIndex) endIndex = maybeEndIndex;
1152
- });
1153
- }
1154
- for (let i = startRowIndex; i <= endIndex; i++) {
1155
- const cells = getCellsInRow(i, tr.selection);
1156
- if (cells) cells.forEach((cell) => {
1157
- const maybeEndIndex = cell.node.attrs.rowspan + i - 1;
1158
- if (cell.node.attrs.rowspan > 1 && maybeEndIndex > endIndex) endIndex = maybeEndIndex;
1159
- });
1160
- }
1161
- const indexes = [];
1162
- for (let i = startIndex; i <= endIndex; i++) {
1163
- const maybeCells = getCellsInRow(i, tr.selection);
1164
- if (maybeCells && maybeCells.length > 0) indexes.push(i);
1165
- }
1166
- startIndex = indexes[0];
1167
- endIndex = indexes[indexes.length - 1];
1168
- const firstSelectedRowCells = getCellsInRow(startIndex, tr.selection);
1169
- const firstColumnCells = getCellsInColumn(0, tr.selection);
1170
- if (!firstSelectedRowCells || !firstColumnCells) return;
1171
- const $anchor = tr.doc.resolve(firstSelectedRowCells[firstSelectedRowCells.length - 1].pos);
1172
- let headCell;
1173
- for (let i = endIndex; i >= startIndex; i--) {
1174
- const rowCells = getCellsInRow(i, tr.selection);
1175
- if (rowCells && rowCells.length > 0) {
1176
- for (let j = firstColumnCells.length - 1; j >= 0; j--) if (firstColumnCells[j].pos === rowCells[0].pos) {
1177
- headCell = rowCells[0];
1178
- break;
1179
- }
1180
- if (headCell) break;
1181
- }
1182
- }
1183
- if (!headCell) return;
1184
- return {
1185
- $anchor,
1186
- $head: tr.doc.resolve(headCell.pos),
1187
- indexes
1188
- };
1189
- }
1190
-
1191
- //#endregion
1192
- //#region src/utils/transpose.ts
1193
- /**
1194
- * Transposes a 2D array by flipping columns to rows.
1195
- *
1196
- * Transposition is a familiar algebra concept where the matrix is flipped
1197
- * along its diagonal. For more details, see:
1198
- * https://en.wikipedia.org/wiki/Transpose
1199
- *
1200
- * @example
1201
- * ```javascript
1202
- * const arr = [
1203
- * ['a1', 'a2', 'a3'],
1204
- * ['b1', 'b2', 'b3'],
1205
- * ['c1', 'c2', 'c3'],
1206
- * ['d1', 'd2', 'd3'],
1207
- * ];
1208
- *
1209
- * const result = transpose(arr);
1210
- * result === [
1211
- * ['a1', 'b1', 'c1', 'd1'],
1212
- * ['a2', 'b2', 'c2', 'd2'],
1213
- * ['a3', 'b3', 'c3', 'd3'],
1214
- * ]
1215
- * ```
1216
- */
1217
- function transpose(array) {
1218
- return array[0].map((_, i) => {
1219
- return array.map((column) => column[i]);
1220
- });
1221
- }
1222
-
1223
- //#endregion
1224
- //#region src/utils/move-column.ts
1225
- /**
1226
- * Move a column from index `origin` to index `target`.
1227
- *
1228
- * @internal
1229
- */
1230
- function moveColumn(moveColParams) {
1231
- var _getSelectionRangeInC, _getSelectionRangeInC2;
1232
- const { tr, originIndex, targetIndex, select, pos } = moveColParams;
1233
- const table = findTable(tr.doc.resolve(pos));
1234
- if (!table) return false;
1235
- const indexesOriginColumn = (_getSelectionRangeInC = getSelectionRangeInColumn(tr, originIndex)) === null || _getSelectionRangeInC === void 0 ? void 0 : _getSelectionRangeInC.indexes;
1236
- const indexesTargetColumn = (_getSelectionRangeInC2 = getSelectionRangeInColumn(tr, targetIndex)) === null || _getSelectionRangeInC2 === void 0 ? void 0 : _getSelectionRangeInC2.indexes;
1237
- if (!indexesOriginColumn || !indexesTargetColumn) return false;
1238
- if (indexesOriginColumn.includes(targetIndex)) return false;
1239
- const newTable = moveTableColumn$1(table.node, indexesOriginColumn, indexesTargetColumn, 0);
1240
- tr.replaceWith(table.pos, table.pos + table.node.nodeSize, newTable);
1241
- if (!select) return true;
1242
- const map = TableMap.get(newTable);
1243
- const start = table.start;
1244
- const index = targetIndex;
1245
- const lastCell = map.positionAt(map.height - 1, index, newTable);
1246
- const $lastCell = tr.doc.resolve(start + lastCell);
1247
- const firstCell = map.positionAt(0, index, newTable);
1248
- const $firstCell = tr.doc.resolve(start + firstCell);
1249
- tr.setSelection(CellSelection.colSelection($lastCell, $firstCell));
1250
- return true;
1251
- }
1252
- function moveTableColumn$1(table, indexesOrigin, indexesTarget, direction) {
1253
- let rows = transpose(convertTableNodeToArrayOfRows(table));
1254
- rows = moveRowInArrayOfRows(rows, indexesOrigin, indexesTarget, direction);
1255
- rows = transpose(rows);
1256
- return convertArrayOfRowsToTableNode(table, rows);
1257
- }
1258
-
1259
- //#endregion
1260
- //#region src/utils/move-row.ts
1261
- /**
1262
- * Move a row from index `origin` to index `target`.
1263
- *
1264
- * @internal
1265
- */
1266
- function moveRow(moveRowParams) {
1267
- var _getSelectionRangeInR, _getSelectionRangeInR2;
1268
- const { tr, originIndex, targetIndex, select, pos } = moveRowParams;
1269
- const table = findTable(tr.doc.resolve(pos));
1270
- if (!table) return false;
1271
- const indexesOriginRow = (_getSelectionRangeInR = getSelectionRangeInRow(tr, originIndex)) === null || _getSelectionRangeInR === void 0 ? void 0 : _getSelectionRangeInR.indexes;
1272
- const indexesTargetRow = (_getSelectionRangeInR2 = getSelectionRangeInRow(tr, targetIndex)) === null || _getSelectionRangeInR2 === void 0 ? void 0 : _getSelectionRangeInR2.indexes;
1273
- if (!indexesOriginRow || !indexesTargetRow) return false;
1274
- if (indexesOriginRow.includes(targetIndex)) return false;
1275
- const newTable = moveTableRow$1(table.node, indexesOriginRow, indexesTargetRow, 0);
1276
- tr.replaceWith(table.pos, table.pos + table.node.nodeSize, newTable);
1277
- if (!select) return true;
1278
- const map = TableMap.get(newTable);
1279
- const start = table.start;
1280
- const index = targetIndex;
1281
- const lastCell = map.positionAt(index, map.width - 1, newTable);
1282
- const $lastCell = tr.doc.resolve(start + lastCell);
1283
- const firstCell = map.positionAt(index, 0, newTable);
1284
- const $firstCell = tr.doc.resolve(start + firstCell);
1285
- tr.setSelection(CellSelection.rowSelection($lastCell, $firstCell));
1286
- return true;
1287
- }
1288
- function moveTableRow$1(table, indexesOrigin, indexesTarget, direction) {
1289
- let rows = convertTableNodeToArrayOfRows(table);
1290
- rows = moveRowInArrayOfRows(rows, indexesOrigin, indexesTarget, direction);
1291
- return convertArrayOfRowsToTableNode(table, rows);
1292
- }
1293
-
1294
- //#endregion
1295
- //#region src/commands.ts
1296
- /**
1297
- * Helper to get the selected rectangle in a table, if any. Adds table
1298
- * map, table node, and table start offset to the object for
1299
- * convenience.
1300
- *
1301
- * @public
1302
- */
1303
- function selectedRect(state) {
1304
- const sel = state.selection;
1305
- const $pos = selectionCell(state);
1306
- const table = $pos.node(-1);
1307
- const tableStart = $pos.start(-1);
1308
- const map = TableMap.get(table);
1309
- return {
1310
- ...sel instanceof CellSelection ? map.rectBetween(sel.$anchorCell.pos - tableStart, sel.$headCell.pos - tableStart) : map.findCell($pos.pos - tableStart),
1311
- tableStart,
1312
- map,
1313
- table
1314
- };
1315
- }
1316
- /**
1317
- * Add a column at the given position in a table.
1318
- *
1319
- * @public
1320
- */
1321
- function addColumn(tr, { map, tableStart, table }, col) {
1322
- let refColumn = col > 0 ? -1 : 0;
1323
- if (columnIsHeader(map, table, col + refColumn)) refColumn = col == 0 || col == map.width ? null : 0;
1324
- for (let row = 0; row < map.height; row++) {
1325
- const index = row * map.width + col;
1326
- if (col > 0 && col < map.width && map.map[index - 1] == map.map[index]) {
1327
- const pos = map.map[index];
1328
- const cell = table.nodeAt(pos);
1329
- tr.setNodeMarkup(tr.mapping.map(tableStart + pos), null, addColSpan(cell.attrs, col - map.colCount(pos)));
1330
- row += cell.attrs.rowspan - 1;
1331
- } else {
1332
- const type = refColumn == null ? tableNodeTypes(table.type.schema).cell : table.nodeAt(map.map[index + refColumn]).type;
1333
- const pos = map.positionAt(row, col, table);
1334
- tr.insert(tr.mapping.map(tableStart + pos), type.createAndFill());
1335
- }
1336
- }
1337
- return tr;
1338
- }
1339
- /**
1340
- * Command to add a column before the column with the selection.
1341
- *
1342
- * @public
1343
- */
1344
- function addColumnBefore(state, dispatch) {
1345
- if (!isInTable(state)) return false;
1346
- if (dispatch) {
1347
- const rect = selectedRect(state);
1348
- dispatch(addColumn(state.tr, rect, rect.left));
1349
- }
1350
- return true;
1351
- }
1352
- /**
1353
- * Command to add a column after the column with the selection.
1354
- *
1355
- * @public
1356
- */
1357
- function addColumnAfter(state, dispatch) {
1358
- if (!isInTable(state)) return false;
1359
- if (dispatch) {
1360
- const rect = selectedRect(state);
1361
- dispatch(addColumn(state.tr, rect, rect.right));
1362
- }
1363
- return true;
1364
- }
1365
- /**
1366
- * @public
1367
- */
1368
- function removeColumn(tr, { map, table, tableStart }, col) {
1369
- const mapStart = tr.mapping.maps.length;
1370
- for (let row = 0; row < map.height;) {
1371
- const index = row * map.width + col;
1372
- const pos = map.map[index];
1373
- const cell = table.nodeAt(pos);
1374
- const attrs = cell.attrs;
1375
- if (col > 0 && map.map[index - 1] == pos || col < map.width - 1 && map.map[index + 1] == pos) tr.setNodeMarkup(tr.mapping.slice(mapStart).map(tableStart + pos), null, removeColSpan(attrs, col - map.colCount(pos)));
1376
- else {
1377
- const start = tr.mapping.slice(mapStart).map(tableStart + pos);
1378
- tr.delete(start, start + cell.nodeSize);
1379
- }
1380
- row += attrs.rowspan;
1381
- }
1382
- }
1383
- /**
1384
- * Command function that removes the selected columns from a table.
1385
- *
1386
- * @public
1387
- */
1388
- function deleteColumn(state, dispatch) {
1389
- if (!isInTable(state)) return false;
1390
- if (dispatch) {
1391
- const rect = selectedRect(state);
1392
- const tr = state.tr;
1393
- if (rect.left == 0 && rect.right == rect.map.width) return false;
1394
- for (let i = rect.right - 1;; i--) {
1395
- removeColumn(tr, rect, i);
1396
- if (i == rect.left) break;
1397
- const table = rect.tableStart ? tr.doc.nodeAt(rect.tableStart - 1) : tr.doc;
1398
- if (!table) throw new RangeError("No table found");
1399
- rect.table = table;
1400
- rect.map = TableMap.get(table);
1401
- }
1402
- dispatch(tr);
1403
- }
1404
- return true;
1405
- }
1406
- /**
1407
- * @public
1408
- */
1409
- function rowIsHeader(map, table, row) {
1410
- var _table$nodeAt;
1411
- const headerCell = tableNodeTypes(table.type.schema).header_cell;
1412
- for (let col = 0; col < map.width; col++) if (((_table$nodeAt = table.nodeAt(map.map[col + row * map.width])) === null || _table$nodeAt === void 0 ? void 0 : _table$nodeAt.type) != headerCell) return false;
1413
- return true;
1414
- }
1415
- /**
1416
- * @public
1417
- */
1418
- function addRow(tr, { map, tableStart, table }, row) {
1419
- let rowPos = tableStart;
1420
- for (let i = 0; i < row; i++) rowPos += table.child(i).nodeSize;
1421
- const cells = [];
1422
- let refRow = row > 0 ? -1 : 0;
1423
- if (rowIsHeader(map, table, row + refRow)) refRow = row == 0 || row == map.height ? null : 0;
1424
- for (let col = 0, index = map.width * row; col < map.width; col++, index++) if (row > 0 && row < map.height && map.map[index] == map.map[index - map.width]) {
1425
- const pos = map.map[index];
1426
- const attrs = table.nodeAt(pos).attrs;
1427
- tr.setNodeMarkup(tableStart + pos, null, {
1428
- ...attrs,
1429
- rowspan: attrs.rowspan + 1
1430
- });
1431
- col += attrs.colspan - 1;
1432
- } else {
1433
- var _table$nodeAt2;
1434
- const type = refRow == null ? tableNodeTypes(table.type.schema).cell : (_table$nodeAt2 = table.nodeAt(map.map[index + refRow * map.width])) === null || _table$nodeAt2 === void 0 ? void 0 : _table$nodeAt2.type;
1435
- const node = type === null || type === void 0 ? void 0 : type.createAndFill();
1436
- if (node) cells.push(node);
1437
- }
1438
- tr.insert(rowPos, tableNodeTypes(table.type.schema).row.create(null, cells));
1439
- return tr;
1440
- }
1441
- /**
1442
- * Add a table row before the selection.
1443
- *
1444
- * @public
1445
- */
1446
- function addRowBefore(state, dispatch) {
1447
- if (!isInTable(state)) return false;
1448
- if (dispatch) {
1449
- const rect = selectedRect(state);
1450
- dispatch(addRow(state.tr, rect, rect.top));
1451
- }
1452
- return true;
1453
- }
1454
- /**
1455
- * Add a table row after the selection.
1456
- *
1457
- * @public
1458
- */
1459
- function addRowAfter(state, dispatch) {
1460
- if (!isInTable(state)) return false;
1461
- if (dispatch) {
1462
- const rect = selectedRect(state);
1463
- dispatch(addRow(state.tr, rect, rect.bottom));
1464
- }
1465
- return true;
1466
- }
1467
- /**
1468
- * @public
1469
- */
1470
- function removeRow(tr, { map, table, tableStart }, row) {
1471
- let rowPos = 0;
1472
- for (let i = 0; i < row; i++) rowPos += table.child(i).nodeSize;
1473
- const nextRow = rowPos + table.child(row).nodeSize;
1474
- const mapFrom = tr.mapping.maps.length;
1475
- tr.delete(rowPos + tableStart, nextRow + tableStart);
1476
- const seen = /* @__PURE__ */ new Set();
1477
- for (let col = 0, index = row * map.width; col < map.width; col++, index++) {
1478
- const pos = map.map[index];
1479
- if (seen.has(pos)) continue;
1480
- seen.add(pos);
1481
- if (row > 0 && pos == map.map[index - map.width]) {
1482
- const attrs = table.nodeAt(pos).attrs;
1483
- tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + tableStart), null, {
1484
- ...attrs,
1485
- rowspan: attrs.rowspan - 1
1486
- });
1487
- col += attrs.colspan - 1;
1488
- } else if (row < map.height && pos == map.map[index + map.width]) {
1489
- const cell = table.nodeAt(pos);
1490
- const attrs = cell.attrs;
1491
- const copy = cell.type.create({
1492
- ...attrs,
1493
- rowspan: cell.attrs.rowspan - 1
1494
- }, cell.content);
1495
- const newPos = map.positionAt(row + 1, col, table);
1496
- tr.insert(tr.mapping.slice(mapFrom).map(tableStart + newPos), copy);
1497
- col += attrs.colspan - 1;
1498
- }
1499
- }
1500
- }
1501
- /**
1502
- * Remove the selected rows from a table.
1503
- *
1504
- * @public
1505
- */
1506
- function deleteRow(state, dispatch) {
1507
- if (!isInTable(state)) return false;
1508
- if (dispatch) {
1509
- const rect = selectedRect(state), tr = state.tr;
1510
- if (rect.top == 0 && rect.bottom == rect.map.height) return false;
1511
- for (let i = rect.bottom - 1;; i--) {
1512
- removeRow(tr, rect, i);
1513
- if (i == rect.top) break;
1514
- const table = rect.tableStart ? tr.doc.nodeAt(rect.tableStart - 1) : tr.doc;
1515
- if (!table) throw new RangeError("No table found");
1516
- rect.table = table;
1517
- rect.map = TableMap.get(rect.table);
1518
- }
1519
- dispatch(tr);
1520
- }
1521
- return true;
1522
- }
1523
- function isEmpty(cell) {
1524
- const c = cell.content;
1525
- return c.childCount == 1 && c.child(0).isTextblock && c.child(0).childCount == 0;
1526
- }
1527
- function cellsOverlapRectangle({ width, height, map }, rect) {
1528
- let indexTop = rect.top * width + rect.left, indexLeft = indexTop;
1529
- let indexBottom = (rect.bottom - 1) * width + rect.left, indexRight = indexTop + (rect.right - rect.left - 1);
1530
- for (let i = rect.top; i < rect.bottom; i++) {
1531
- if (rect.left > 0 && map[indexLeft] == map[indexLeft - 1] || rect.right < width && map[indexRight] == map[indexRight + 1]) return true;
1532
- indexLeft += width;
1533
- indexRight += width;
1534
- }
1535
- for (let i = rect.left; i < rect.right; i++) {
1536
- if (rect.top > 0 && map[indexTop] == map[indexTop - width] || rect.bottom < height && map[indexBottom] == map[indexBottom + width]) return true;
1537
- indexTop++;
1538
- indexBottom++;
1539
- }
1540
- return false;
1541
- }
1542
- /**
1543
- * Merge the selected cells into a single cell. Only available when
1544
- * the selected cells' outline forms a rectangle.
1545
- *
1546
- * @public
1547
- */
1548
- function mergeCells(state, dispatch) {
1549
- const sel = state.selection;
1550
- if (!(sel instanceof CellSelection) || sel.$anchorCell.pos == sel.$headCell.pos) return false;
1551
- const rect = selectedRect(state), { map } = rect;
1552
- if (cellsOverlapRectangle(map, rect)) return false;
1553
- if (dispatch) {
1554
- const tr = state.tr;
1555
- const seen = {};
1556
- let content = Fragment.empty;
1557
- let mergedPos;
1558
- let mergedCell;
1559
- for (let row = rect.top; row < rect.bottom; row++) for (let col = rect.left; col < rect.right; col++) {
1560
- const cellPos = map.map[row * map.width + col];
1561
- const cell = rect.table.nodeAt(cellPos);
1562
- if (seen[cellPos] || !cell) continue;
1563
- seen[cellPos] = true;
1564
- if (mergedPos == null) {
1565
- mergedPos = cellPos;
1566
- mergedCell = cell;
1567
- } else {
1568
- if (!isEmpty(cell)) content = content.append(cell.content);
1569
- const mapped = tr.mapping.map(cellPos + rect.tableStart);
1570
- tr.delete(mapped, mapped + cell.nodeSize);
1571
- }
1572
- }
1573
- if (mergedPos == null || mergedCell == null) return true;
1574
- tr.setNodeMarkup(mergedPos + rect.tableStart, null, {
1575
- ...addColSpan(mergedCell.attrs, mergedCell.attrs.colspan, rect.right - rect.left - mergedCell.attrs.colspan),
1576
- rowspan: rect.bottom - rect.top
1577
- });
1578
- if (content.size > 0) {
1579
- const end = mergedPos + 1 + mergedCell.content.size;
1580
- const start = isEmpty(mergedCell) ? mergedPos + 1 : end;
1581
- tr.replaceWith(start + rect.tableStart, end + rect.tableStart, content);
1582
- }
1583
- tr.setSelection(new CellSelection(tr.doc.resolve(mergedPos + rect.tableStart)));
1584
- dispatch(tr);
1585
- }
1586
- return true;
1587
- }
1588
- /**
1589
- * Split a selected cell, whose rowpan or colspan is greater than one,
1590
- * into smaller cells. Use the first cell type for the new cells.
1591
- *
1592
- * @public
1593
- */
1594
- function splitCell(state, dispatch) {
1595
- const nodeTypes = tableNodeTypes(state.schema);
1596
- return splitCellWithType(({ node }) => {
1597
- return nodeTypes[node.type.spec.tableRole];
1598
- })(state, dispatch);
1599
- }
1600
- /**
1601
- * Split a selected cell, whose rowpan or colspan is greater than one,
1602
- * into smaller cells with the cell type (th, td) returned by getType function.
1603
- *
1604
- * @public
1605
- */
1606
- function splitCellWithType(getCellType) {
1607
- return (state, dispatch) => {
1608
- const sel = state.selection;
1609
- let cellNode;
1610
- let cellPos;
1611
- if (!(sel instanceof CellSelection)) {
1612
- var _cellAround;
1613
- cellNode = cellWrapping(sel.$from);
1614
- if (!cellNode) return false;
1615
- cellPos = (_cellAround = cellAround(sel.$from)) === null || _cellAround === void 0 ? void 0 : _cellAround.pos;
1616
- } else {
1617
- if (sel.$anchorCell.pos != sel.$headCell.pos) return false;
1618
- cellNode = sel.$anchorCell.nodeAfter;
1619
- cellPos = sel.$anchorCell.pos;
1620
- }
1621
- if (cellNode == null || cellPos == null) return false;
1622
- if (cellNode.attrs.colspan == 1 && cellNode.attrs.rowspan == 1) return false;
1623
- if (dispatch) {
1624
- let baseAttrs = cellNode.attrs;
1625
- const attrs = [];
1626
- const colwidth = baseAttrs.colwidth;
1627
- if (baseAttrs.rowspan > 1) baseAttrs = {
1628
- ...baseAttrs,
1629
- rowspan: 1
1630
- };
1631
- if (baseAttrs.colspan > 1) baseAttrs = {
1632
- ...baseAttrs,
1633
- colspan: 1
1634
- };
1635
- const rect = selectedRect(state), tr = state.tr;
1636
- for (let i = 0; i < rect.right - rect.left; i++) attrs.push(colwidth ? {
1637
- ...baseAttrs,
1638
- colwidth: colwidth && colwidth[i] ? [colwidth[i]] : null
1639
- } : baseAttrs);
1640
- let lastCell;
1641
- for (let row = rect.top; row < rect.bottom; row++) {
1642
- let pos = rect.map.positionAt(row, rect.left, rect.table);
1643
- if (row == rect.top) pos += cellNode.nodeSize;
1644
- for (let col = rect.left, i = 0; col < rect.right; col++, i++) {
1645
- if (col == rect.left && row == rect.top) continue;
1646
- tr.insert(lastCell = tr.mapping.map(pos + rect.tableStart, 1), getCellType({
1647
- node: cellNode,
1648
- row,
1649
- col
1650
- }).createAndFill(attrs[i]));
1651
- }
1652
- }
1653
- tr.setNodeMarkup(cellPos, getCellType({
1654
- node: cellNode,
1655
- row: rect.top,
1656
- col: rect.left
1657
- }), attrs[0]);
1658
- if (sel instanceof CellSelection) tr.setSelection(new CellSelection(tr.doc.resolve(sel.$anchorCell.pos), lastCell ? tr.doc.resolve(lastCell) : void 0));
1659
- dispatch(tr);
1660
- }
1661
- return true;
1662
- };
1663
- }
1664
- /**
1665
- * Returns a command that sets the given attribute to the given value,
1666
- * and is only available when the currently selected cell doesn't
1667
- * already have that attribute set to that value.
1668
- *
1669
- * @public
1670
- */
1671
- function setCellAttr(name, value) {
1672
- return function(state, dispatch) {
1673
- if (!isInTable(state)) return false;
1674
- const $cell = selectionCell(state);
1675
- if ($cell.nodeAfter.attrs[name] === value) return false;
1676
- if (dispatch) {
1677
- const tr = state.tr;
1678
- if (state.selection instanceof CellSelection) state.selection.forEachCell((node, pos) => {
1679
- if (node.attrs[name] !== value) tr.setNodeMarkup(pos, null, {
1680
- ...node.attrs,
1681
- [name]: value
1682
- });
1683
- });
1684
- else tr.setNodeMarkup($cell.pos, null, {
1685
- ...$cell.nodeAfter.attrs,
1686
- [name]: value
1687
- });
1688
- dispatch(tr);
1689
- }
1690
- return true;
1691
- };
1692
- }
1693
- function deprecated_toggleHeader(type) {
1694
- return function(state, dispatch) {
1695
- if (!isInTable(state)) return false;
1696
- if (dispatch) {
1697
- const types = tableNodeTypes(state.schema);
1698
- const rect = selectedRect(state), tr = state.tr;
1699
- const cells = rect.map.cellsInRect(type == "column" ? {
1700
- left: rect.left,
1701
- top: 0,
1702
- right: rect.right,
1703
- bottom: rect.map.height
1704
- } : type == "row" ? {
1705
- left: 0,
1706
- top: rect.top,
1707
- right: rect.map.width,
1708
- bottom: rect.bottom
1709
- } : rect);
1710
- const nodes = cells.map((pos) => rect.table.nodeAt(pos));
1711
- for (let i = 0; i < cells.length; i++) if (nodes[i].type == types.header_cell) tr.setNodeMarkup(rect.tableStart + cells[i], types.cell, nodes[i].attrs);
1712
- if (tr.steps.length === 0) for (let i = 0; i < cells.length; i++) tr.setNodeMarkup(rect.tableStart + cells[i], types.header_cell, nodes[i].attrs);
1713
- dispatch(tr);
1714
- }
1715
- return true;
1716
- };
1717
- }
1718
- function isHeaderEnabledByType(type, rect, types) {
1719
- const cellPositions = rect.map.cellsInRect({
1720
- left: 0,
1721
- top: 0,
1722
- right: type == "row" ? rect.map.width : 1,
1723
- bottom: type == "column" ? rect.map.height : 1
1724
- });
1725
- for (let i = 0; i < cellPositions.length; i++) {
1726
- const cell = rect.table.nodeAt(cellPositions[i]);
1727
- if (cell && cell.type !== types.header_cell) return false;
1728
- }
1729
- return true;
1730
- }
1731
- /**
1732
- * Toggles between row/column header and normal cells (Only applies to first row/column).
1733
- * For deprecated behavior pass `useDeprecatedLogic` in options with true.
1734
- *
1735
- * @public
1736
- */
1737
- function toggleHeader(type, options) {
1738
- options = options || { useDeprecatedLogic: false };
1739
- if (options.useDeprecatedLogic) return deprecated_toggleHeader(type);
1740
- return function(state, dispatch) {
1741
- if (!isInTable(state)) return false;
1742
- if (dispatch) {
1743
- const types = tableNodeTypes(state.schema);
1744
- const rect = selectedRect(state), tr = state.tr;
1745
- const isHeaderRowEnabled = isHeaderEnabledByType("row", rect, types);
1746
- const isHeaderColumnEnabled = isHeaderEnabledByType("column", rect, types);
1747
- const selectionStartsAt = (type === "column" ? isHeaderRowEnabled : type === "row" ? isHeaderColumnEnabled : false) ? 1 : 0;
1748
- const cellsRect = type == "column" ? {
1749
- left: 0,
1750
- top: selectionStartsAt,
1751
- right: 1,
1752
- bottom: rect.map.height
1753
- } : type == "row" ? {
1754
- left: selectionStartsAt,
1755
- top: 0,
1756
- right: rect.map.width,
1757
- bottom: 1
1758
- } : rect;
1759
- const newType = type == "column" ? isHeaderColumnEnabled ? types.cell : types.header_cell : type == "row" ? isHeaderRowEnabled ? types.cell : types.header_cell : types.cell;
1760
- rect.map.cellsInRect(cellsRect).forEach((relativeCellPos) => {
1761
- const cellPos = relativeCellPos + rect.tableStart;
1762
- const cell = tr.doc.nodeAt(cellPos);
1763
- if (cell) tr.setNodeMarkup(cellPos, newType, cell.attrs);
1764
- });
1765
- dispatch(tr);
1766
- }
1767
- return true;
1768
- };
1769
- }
1770
- /**
1771
- * Toggles whether the selected row contains header cells.
1772
- *
1773
- * @public
1774
- */
1775
- const toggleHeaderRow = toggleHeader("row", { useDeprecatedLogic: true });
1776
- /**
1777
- * Toggles whether the selected column contains header cells.
1778
- *
1779
- * @public
1780
- */
1781
- const toggleHeaderColumn = toggleHeader("column", { useDeprecatedLogic: true });
1782
- /**
1783
- * Toggles whether the selected cells are header cells.
1784
- *
1785
- * @public
1786
- */
1787
- const toggleHeaderCell = toggleHeader("cell", { useDeprecatedLogic: true });
1788
- function findNextCell($cell, dir) {
1789
- if (dir < 0) {
1790
- const before = $cell.nodeBefore;
1791
- if (before) return $cell.pos - before.nodeSize;
1792
- for (let row = $cell.index(-1) - 1, rowEnd = $cell.before(); row >= 0; row--) {
1793
- const rowNode = $cell.node(-1).child(row);
1794
- const lastChild = rowNode.lastChild;
1795
- if (lastChild) return rowEnd - 1 - lastChild.nodeSize;
1796
- rowEnd -= rowNode.nodeSize;
1797
- }
1798
- } else {
1799
- if ($cell.index() < $cell.parent.childCount - 1) return $cell.pos + $cell.nodeAfter.nodeSize;
1800
- const table = $cell.node(-1);
1801
- for (let row = $cell.indexAfter(-1), rowStart = $cell.after(); row < table.childCount; row++) {
1802
- const rowNode = table.child(row);
1803
- if (rowNode.childCount) return rowStart + 1;
1804
- rowStart += rowNode.nodeSize;
1805
- }
1806
- }
1807
- return null;
1808
- }
1809
- /**
1810
- * Returns a command for selecting the next (direction=1) or previous
1811
- * (direction=-1) cell in a table.
1812
- *
1813
- * @public
1814
- */
1815
- function goToNextCell(direction) {
1816
- return function(state, dispatch) {
1817
- if (!isInTable(state)) return false;
1818
- const cell = findNextCell(selectionCell(state), direction);
1819
- if (cell == null) return false;
1820
- if (dispatch) {
1821
- const $cell = state.doc.resolve(cell);
1822
- dispatch(state.tr.setSelection(TextSelection.between($cell, moveCellForward($cell))).scrollIntoView());
1823
- }
1824
- return true;
1825
- };
1826
- }
1827
- /**
1828
- * Deletes the table around the selection, if any.
1829
- *
1830
- * @public
1831
- */
1832
- function deleteTable(state, dispatch) {
1833
- const $pos = state.selection.$anchor;
1834
- for (let d = $pos.depth; d > 0; d--) if ($pos.node(d).type.spec.tableRole == "table") {
1835
- if (dispatch) dispatch(state.tr.delete($pos.before(d), $pos.after(d)).scrollIntoView());
1836
- return true;
1837
- }
1838
- return false;
1839
- }
1840
- /**
1841
- * Deletes the content of the selected cells, if they are not empty.
1842
- *
1843
- * @public
1844
- */
1845
- function deleteCellSelection(state, dispatch) {
1846
- const sel = state.selection;
1847
- if (!(sel instanceof CellSelection)) return false;
1848
- if (dispatch) {
1849
- const tr = state.tr;
1850
- const baseContent = tableNodeTypes(state.schema).cell.createAndFill().content;
1851
- sel.forEachCell((cell, pos) => {
1852
- if (!cell.content.eq(baseContent)) tr.replace(tr.mapping.map(pos + 1), tr.mapping.map(pos + cell.nodeSize - 1), new Slice(baseContent, 0, 0));
1853
- });
1854
- if (tr.docChanged) dispatch(tr);
1855
- }
1856
- return true;
1857
- }
1858
- /**
1859
- * Move a table row from index `from` to index `to`.
1860
- *
1861
- * @public
1862
- */
1863
- function moveTableRow(options) {
1864
- return (state, dispatch) => {
1865
- const { from: originIndex, to: targetIndex, select = true, pos = state.selection.from } = options;
1866
- const tr = state.tr;
1867
- if (moveRow({
1868
- tr,
1869
- originIndex,
1870
- targetIndex,
1871
- select,
1872
- pos
1873
- })) {
1874
- dispatch === null || dispatch === void 0 || dispatch(tr);
1875
- return true;
1876
- }
1877
- return false;
1878
- };
1879
- }
1880
- /**
1881
- * Move a table column from index `from` to index `to`.
1882
- *
1883
- * @public
1884
- */
1885
- function moveTableColumn(options) {
1886
- return (state, dispatch) => {
1887
- const { from: originIndex, to: targetIndex, select = true, pos = state.selection.from } = options;
1888
- const tr = state.tr;
1889
- if (moveColumn({
1890
- tr,
1891
- originIndex,
1892
- targetIndex,
1893
- select,
1894
- pos
1895
- })) {
1896
- dispatch === null || dispatch === void 0 || dispatch(tr);
1897
- return true;
1898
- }
1899
- return false;
1900
- };
1901
- }
1902
-
1903
- //#endregion
1904
- //#region src/copypaste.ts
1905
- /**
1906
- * Get a rectangular area of cells from a slice, or null if the outer
1907
- * nodes of the slice aren't table cells or rows.
1908
- *
1909
- * @internal
1910
- */
1911
- function pastedCells(slice) {
1912
- if (slice.size === 0) return null;
1913
- let { content, openStart, openEnd } = slice;
1914
- while (content.childCount == 1 && (openStart > 0 && openEnd > 0 || content.child(0).type.spec.tableRole == "table")) {
1915
- openStart--;
1916
- openEnd--;
1917
- content = content.child(0).content;
1918
- }
1919
- const first = content.child(0);
1920
- const role = first.type.spec.tableRole;
1921
- const schema = first.type.schema, rows = [];
1922
- if (role == "row") for (let i = 0; i < content.childCount; i++) {
1923
- let cells = content.child(i).content;
1924
- const left = i ? 0 : Math.max(0, openStart - 1);
1925
- const right = i < content.childCount - 1 ? 0 : Math.max(0, openEnd - 1);
1926
- if (left || right) cells = fitSlice(tableNodeTypes(schema).row, new Slice(cells, left, right)).content;
1927
- rows.push(cells);
1928
- }
1929
- else if (role == "cell" || role == "header_cell") rows.push(openStart || openEnd ? fitSlice(tableNodeTypes(schema).row, new Slice(content, openStart, openEnd)).content : content);
1930
- else return null;
1931
- return ensureRectangular(schema, rows);
1932
- }
1933
- function ensureRectangular(schema, rows) {
1934
- const widths = [];
1935
- for (let i = 0; i < rows.length; i++) {
1936
- const row = rows[i];
1937
- for (let j = row.childCount - 1; j >= 0; j--) {
1938
- const { rowspan, colspan } = row.child(j).attrs;
1939
- for (let r = i; r < i + rowspan; r++) widths[r] = (widths[r] || 0) + colspan;
1940
- }
1941
- }
1942
- let width = 0;
1943
- for (let r = 0; r < widths.length; r++) width = Math.max(width, widths[r]);
1944
- for (let r = 0; r < widths.length; r++) {
1945
- if (r >= rows.length) rows.push(Fragment.empty);
1946
- if (widths[r] < width) {
1947
- const empty = tableNodeTypes(schema).cell.createAndFill();
1948
- const cells = [];
1949
- for (let i = widths[r]; i < width; i++) cells.push(empty);
1950
- rows[r] = rows[r].append(Fragment.from(cells));
1951
- }
1952
- }
1953
- return {
1954
- height: rows.length,
1955
- width,
1956
- rows
1957
- };
1958
- }
1959
- function fitSlice(nodeType, slice) {
1960
- const node = nodeType.createAndFill();
1961
- return new Transform(node).replace(0, node.content.size, slice).doc;
1962
- }
1963
- /**
1964
- * Clip or extend (repeat) the given set of cells to cover the given
1965
- * width and height. Will clip rowspan/colspan cells at the edges when
1966
- * they stick out.
1967
- *
1968
- * @internal
1969
- */
1970
- function clipCells({ width, height, rows }, newWidth, newHeight) {
1971
- if (width != newWidth) {
1972
- const added = [];
1973
- const newRows = [];
1974
- for (let row = 0; row < rows.length; row++) {
1975
- const frag = rows[row], cells = [];
1976
- for (let col = added[row] || 0, i = 0; col < newWidth; i++) {
1977
- let cell = frag.child(i % frag.childCount);
1978
- if (col + cell.attrs.colspan > newWidth) cell = cell.type.createChecked(removeColSpan(cell.attrs, cell.attrs.colspan, col + cell.attrs.colspan - newWidth), cell.content);
1979
- cells.push(cell);
1980
- col += cell.attrs.colspan;
1981
- for (let j = 1; j < cell.attrs.rowspan; j++) added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
1982
- }
1983
- newRows.push(Fragment.from(cells));
1984
- }
1985
- rows = newRows;
1986
- width = newWidth;
1987
- }
1988
- if (height != newHeight) {
1989
- const newRows = [];
1990
- for (let row = 0, i = 0; row < newHeight; row++, i++) {
1991
- const cells = [], source = rows[i % height];
1992
- for (let j = 0; j < source.childCount; j++) {
1993
- let cell = source.child(j);
1994
- if (row + cell.attrs.rowspan > newHeight) cell = cell.type.create({
1995
- ...cell.attrs,
1996
- rowspan: Math.max(1, newHeight - cell.attrs.rowspan)
1997
- }, cell.content);
1998
- cells.push(cell);
1999
- }
2000
- newRows.push(Fragment.from(cells));
2001
- }
2002
- rows = newRows;
2003
- height = newHeight;
2004
- }
2005
- return {
2006
- width,
2007
- height,
2008
- rows
2009
- };
2010
- }
2011
- function growTable(tr, map, table, start, width, height, mapFrom) {
2012
- const schema = tr.doc.type.schema;
2013
- const types = tableNodeTypes(schema);
2014
- let empty;
2015
- let emptyHead;
2016
- if (width > map.width) for (let row = 0, rowEnd = 0; row < map.height; row++) {
2017
- const rowNode = table.child(row);
2018
- rowEnd += rowNode.nodeSize;
2019
- const cells = [];
2020
- let add;
2021
- if (rowNode.lastChild == null || rowNode.lastChild.type == types.cell) add = empty || (empty = types.cell.createAndFill());
2022
- else add = emptyHead || (emptyHead = types.header_cell.createAndFill());
2023
- for (let i = map.width; i < width; i++) cells.push(add);
2024
- tr.insert(tr.mapping.slice(mapFrom).map(rowEnd - 1 + start), cells);
2025
- }
2026
- if (height > map.height) {
2027
- const cells = [];
2028
- for (let i = 0, start$1 = (map.height - 1) * map.width; i < Math.max(map.width, width); i++) {
2029
- const header = i >= map.width ? false : table.nodeAt(map.map[start$1 + i]).type == types.header_cell;
2030
- cells.push(header ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty || (empty = types.cell.createAndFill()));
2031
- }
2032
- const emptyRow = types.row.create(null, Fragment.from(cells)), rows = [];
2033
- for (let i = map.height; i < height; i++) rows.push(emptyRow);
2034
- tr.insert(tr.mapping.slice(mapFrom).map(start + table.nodeSize - 2), rows);
2035
- }
2036
- return !!(empty || emptyHead);
2037
- }
2038
- function isolateHorizontal(tr, map, table, start, left, right, top, mapFrom) {
2039
- if (top == 0 || top == map.height) return false;
2040
- let found = false;
2041
- for (let col = left; col < right; col++) {
2042
- const index = top * map.width + col, pos = map.map[index];
2043
- if (map.map[index - map.width] == pos) {
2044
- found = true;
2045
- const cell = table.nodeAt(pos);
2046
- const { top: cellTop, left: cellLeft } = map.findCell(pos);
2047
- tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(pos + start), null, {
2048
- ...cell.attrs,
2049
- rowspan: top - cellTop
2050
- });
2051
- tr.insert(tr.mapping.slice(mapFrom).map(map.positionAt(top, cellLeft, table)), cell.type.createAndFill({
2052
- ...cell.attrs,
2053
- rowspan: cellTop + cell.attrs.rowspan - top
2054
- }));
2055
- col += cell.attrs.colspan - 1;
2056
- }
2057
- }
2058
- return found;
2059
- }
2060
- function isolateVertical(tr, map, table, start, top, bottom, left, mapFrom) {
2061
- if (left == 0 || left == map.width) return false;
2062
- let found = false;
2063
- for (let row = top; row < bottom; row++) {
2064
- const index = row * map.width + left, pos = map.map[index];
2065
- if (map.map[index - 1] == pos) {
2066
- found = true;
2067
- const cell = table.nodeAt(pos);
2068
- const cellLeft = map.colCount(pos);
2069
- const updatePos = tr.mapping.slice(mapFrom).map(pos + start);
2070
- tr.setNodeMarkup(updatePos, null, removeColSpan(cell.attrs, left - cellLeft, cell.attrs.colspan - (left - cellLeft)));
2071
- tr.insert(updatePos + cell.nodeSize, cell.type.createAndFill(removeColSpan(cell.attrs, 0, left - cellLeft)));
2072
- row += cell.attrs.rowspan - 1;
2073
- }
2074
- }
2075
- return found;
2076
- }
2077
- /**
2078
- * Insert the given set of cells (as returned by `pastedCells`) into a
2079
- * table, at the position pointed at by rect.
2080
- *
2081
- * @internal
2082
- */
2083
- function insertCells(state, dispatch, tableStart, rect, cells) {
2084
- let table = tableStart ? state.doc.nodeAt(tableStart - 1) : state.doc;
2085
- if (!table) throw new Error("No table found");
2086
- let map = TableMap.get(table);
2087
- const { top, left } = rect;
2088
- const right = left + cells.width, bottom = top + cells.height;
2089
- const tr = state.tr;
2090
- let mapFrom = 0;
2091
- function recomp() {
2092
- table = tableStart ? tr.doc.nodeAt(tableStart - 1) : tr.doc;
2093
- if (!table) throw new Error("No table found");
2094
- map = TableMap.get(table);
2095
- mapFrom = tr.mapping.maps.length;
2096
- }
2097
- if (growTable(tr, map, table, tableStart, right, bottom, mapFrom)) recomp();
2098
- if (isolateHorizontal(tr, map, table, tableStart, left, right, top, mapFrom)) recomp();
2099
- if (isolateHorizontal(tr, map, table, tableStart, left, right, bottom, mapFrom)) recomp();
2100
- if (isolateVertical(tr, map, table, tableStart, top, bottom, left, mapFrom)) recomp();
2101
- if (isolateVertical(tr, map, table, tableStart, top, bottom, right, mapFrom)) recomp();
2102
- for (let row = top; row < bottom; row++) {
2103
- const from = map.positionAt(row, left, table), to = map.positionAt(row, right, table);
2104
- tr.replace(tr.mapping.slice(mapFrom).map(from + tableStart), tr.mapping.slice(mapFrom).map(to + tableStart), new Slice(cells.rows[row - top], 0, 0));
2105
- }
2106
- recomp();
2107
- tr.setSelection(new CellSelection(tr.doc.resolve(tableStart + map.positionAt(top, left, table)), tr.doc.resolve(tableStart + map.positionAt(bottom - 1, right - 1, table))));
2108
- dispatch(tr);
2109
- }
2110
-
2111
- //#endregion
2112
- //#region src/input.ts
2113
- const handleKeyDown = keydownHandler({
2114
- ArrowLeft: arrow("horiz", -1),
2115
- ArrowRight: arrow("horiz", 1),
2116
- ArrowUp: arrow("vert", -1),
2117
- ArrowDown: arrow("vert", 1),
2118
- "Shift-ArrowLeft": shiftArrow("horiz", -1),
2119
- "Shift-ArrowRight": shiftArrow("horiz", 1),
2120
- "Shift-ArrowUp": shiftArrow("vert", -1),
2121
- "Shift-ArrowDown": shiftArrow("vert", 1),
2122
- Backspace: deleteCellSelection,
2123
- "Mod-Backspace": deleteCellSelection,
2124
- Delete: deleteCellSelection,
2125
- "Mod-Delete": deleteCellSelection
2126
- });
2127
- function maybeSetSelection(state, dispatch, selection) {
2128
- if (selection.eq(state.selection)) return false;
2129
- if (dispatch) dispatch(state.tr.setSelection(selection).scrollIntoView());
2130
- return true;
2131
- }
2132
- /**
2133
- * @internal
2134
- */
2135
- function arrow(axis, dir) {
2136
- return (state, dispatch, view) => {
2137
- if (!view) return false;
2138
- const sel = state.selection;
2139
- if (sel instanceof CellSelection) return maybeSetSelection(state, dispatch, Selection.near(sel.$headCell, dir));
2140
- if (axis != "horiz" && !sel.empty) return false;
2141
- const end = atEndOfCell(view, axis, dir);
2142
- if (end == null) return false;
2143
- if (axis == "horiz") return maybeSetSelection(state, dispatch, Selection.near(state.doc.resolve(sel.head + dir), dir));
2144
- else {
2145
- const $cell = state.doc.resolve(end);
2146
- const $next = nextCell($cell, axis, dir);
2147
- let newSel;
2148
- if ($next) newSel = Selection.near($next, 1);
2149
- else if (dir < 0) newSel = Selection.near(state.doc.resolve($cell.before(-1)), -1);
2150
- else newSel = Selection.near(state.doc.resolve($cell.after(-1)), 1);
2151
- return maybeSetSelection(state, dispatch, newSel);
2152
- }
2153
- };
2154
- }
2155
- function shiftArrow(axis, dir) {
2156
- return (state, dispatch, view) => {
2157
- if (!view) return false;
2158
- const sel = state.selection;
2159
- let cellSel;
2160
- if (sel instanceof CellSelection) cellSel = sel;
2161
- else {
2162
- const end = atEndOfCell(view, axis, dir);
2163
- if (end == null) return false;
2164
- cellSel = new CellSelection(state.doc.resolve(end));
2165
- }
2166
- const $head = nextCell(cellSel.$headCell, axis, dir);
2167
- if (!$head) return false;
2168
- return maybeSetSelection(state, dispatch, new CellSelection(cellSel.$anchorCell, $head));
2169
- };
2170
- }
2171
- function handleTripleClick(view, pos) {
2172
- const doc = view.state.doc, $cell = cellAround(doc.resolve(pos));
2173
- if (!$cell) return false;
2174
- view.dispatch(view.state.tr.setSelection(new CellSelection($cell)));
2175
- return true;
2176
- }
2177
- /**
2178
- * @public
2179
- */
2180
- function handlePaste(view, _, slice) {
2181
- if (!isInTable(view.state)) return false;
2182
- let cells = pastedCells(slice);
2183
- const sel = view.state.selection;
2184
- if (sel instanceof CellSelection) {
2185
- if (!cells) cells = {
2186
- width: 1,
2187
- height: 1,
2188
- rows: [Fragment.from(fitSlice(tableNodeTypes(view.state.schema).cell, slice))]
2189
- };
2190
- const table = sel.$anchorCell.node(-1);
2191
- const start = sel.$anchorCell.start(-1);
2192
- const rect = TableMap.get(table).rectBetween(sel.$anchorCell.pos - start, sel.$headCell.pos - start);
2193
- cells = clipCells(cells, rect.right - rect.left, rect.bottom - rect.top);
2194
- insertCells(view.state, view.dispatch, start, rect, cells);
2195
- return true;
2196
- } else if (cells) {
2197
- const $cell = selectionCell(view.state);
2198
- const start = $cell.start(-1);
2199
- insertCells(view.state, view.dispatch, start, TableMap.get($cell.node(-1)).findCell($cell.pos - start), cells);
2200
- return true;
2201
- } else return false;
2202
- }
2203
- function handleMouseDown$1(view, startEvent) {
2204
- var _cellUnderMouse;
2205
- if (startEvent.button != 0) return;
2206
- if (startEvent.ctrlKey || startEvent.metaKey) return;
2207
- const startDOMCell = domInCell(view, startEvent.target);
2208
- let $anchor;
2209
- if (startEvent.shiftKey && view.state.selection instanceof CellSelection) {
2210
- setCellSelection(view.state.selection.$anchorCell, startEvent);
2211
- startEvent.preventDefault();
2212
- } else if (startEvent.shiftKey && startDOMCell && ($anchor = cellAround(view.state.selection.$anchor)) != null && ((_cellUnderMouse = cellUnderMouse(view, startEvent)) === null || _cellUnderMouse === void 0 ? void 0 : _cellUnderMouse.pos) != $anchor.pos) {
2213
- setCellSelection($anchor, startEvent);
2214
- startEvent.preventDefault();
2215
- } else if (!startDOMCell) return;
2216
- function setCellSelection($anchor$1, event) {
2217
- let $head = cellUnderMouse(view, event);
2218
- const starting = tableEditingKey.getState(view.state) == null;
2219
- if (!$head || !inSameTable($anchor$1, $head)) if (starting) $head = $anchor$1;
2220
- else return;
2221
- const selection = new CellSelection($anchor$1, $head);
2222
- if (starting || !view.state.selection.eq(selection)) {
2223
- const tr = view.state.tr.setSelection(selection);
2224
- if (starting) tr.setMeta(tableEditingKey, $anchor$1.pos);
2225
- view.dispatch(tr);
2226
- }
2227
- }
2228
- function stop() {
2229
- view.root.removeEventListener("mouseup", stop);
2230
- view.root.removeEventListener("dragstart", stop);
2231
- view.root.removeEventListener("mousemove", move);
2232
- if (tableEditingKey.getState(view.state) != null) view.dispatch(view.state.tr.setMeta(tableEditingKey, -1));
2233
- }
2234
- function move(_event) {
2235
- const event = _event;
2236
- const anchor = tableEditingKey.getState(view.state);
2237
- let $anchor$1;
2238
- if (anchor != null) $anchor$1 = view.state.doc.resolve(anchor);
2239
- else if (domInCell(view, event.target) != startDOMCell) {
2240
- $anchor$1 = cellUnderMouse(view, startEvent);
2241
- if (!$anchor$1) return stop();
2242
- }
2243
- if ($anchor$1) setCellSelection($anchor$1, event);
2244
- }
2245
- view.root.addEventListener("mouseup", stop);
2246
- view.root.addEventListener("dragstart", stop);
2247
- view.root.addEventListener("mousemove", move);
2248
- }
2249
- function atEndOfCell(view, axis, dir) {
2250
- if (!(view.state.selection instanceof TextSelection)) return null;
2251
- const { $head } = view.state.selection;
2252
- for (let d = $head.depth - 1; d >= 0; d--) {
2253
- const parent = $head.node(d);
2254
- if ((dir < 0 ? $head.index(d) : $head.indexAfter(d)) != (dir < 0 ? 0 : parent.childCount)) return null;
2255
- if (parent.type.spec.tableRole == "cell" || parent.type.spec.tableRole == "header_cell") {
2256
- const cellPos = $head.before(d);
2257
- const dirStr = axis == "vert" ? dir > 0 ? "down" : "up" : dir > 0 ? "right" : "left";
2258
- return view.endOfTextblock(dirStr) ? cellPos : null;
2259
- }
2260
- }
2261
- return null;
2262
- }
2263
- function domInCell(view, dom) {
2264
- for (; dom && dom != view.dom; dom = dom.parentNode) if (dom.nodeName == "TD" || dom.nodeName == "TH") return dom;
2265
- return null;
2266
- }
2267
- function cellUnderMouse(view, event) {
2268
- const mousePos = view.posAtCoords({
2269
- left: event.clientX,
2270
- top: event.clientY
2271
- });
2272
- if (!mousePos) return null;
2273
- let { inside, pos } = mousePos;
2274
- return inside >= 0 && cellAround(view.state.doc.resolve(inside)) || cellAround(view.state.doc.resolve(pos));
2275
- }
2276
-
2277
- //#endregion
2278
- //#region src/tableview.ts
2279
- /**
2280
- * @public
2281
- */
2282
- var TableView = class {
2283
- constructor(node, defaultCellMinWidth) {
2284
- this.node = node;
2285
- this.defaultCellMinWidth = defaultCellMinWidth;
2286
- this.dom = document.createElement("div");
2287
- this.dom.className = "tableWrapper";
2288
- this.table = this.dom.appendChild(document.createElement("table"));
2289
- this.table.style.setProperty("--default-cell-min-width", `${defaultCellMinWidth}px`);
2290
- this.colgroup = this.table.appendChild(document.createElement("colgroup"));
2291
- updateColumnsOnResize(node, this.colgroup, this.table, defaultCellMinWidth);
2292
- this.contentDOM = this.table.appendChild(document.createElement("tbody"));
2293
- }
2294
- update(node) {
2295
- if (node.type != this.node.type) return false;
2296
- this.node = node;
2297
- updateColumnsOnResize(node, this.colgroup, this.table, this.defaultCellMinWidth);
2298
- return true;
2299
- }
2300
- ignoreMutation(record) {
2301
- return record.type == "attributes" && (record.target == this.table || this.colgroup.contains(record.target));
2302
- }
2303
- };
2304
- /**
2305
- * @public
2306
- */
2307
- function updateColumnsOnResize(node, colgroup, table, defaultCellMinWidth, overrideCol, overrideValue) {
2308
- let totalWidth = 0;
2309
- let fixedWidth = true;
2310
- let nextDOM = colgroup.firstChild;
2311
- const row = node.firstChild;
2312
- if (!row) return;
2313
- for (let i = 0, col = 0; i < row.childCount; i++) {
2314
- const { colspan, colwidth } = row.child(i).attrs;
2315
- for (let j = 0; j < colspan; j++, col++) {
2316
- const hasWidth = overrideCol == col ? overrideValue : colwidth && colwidth[j];
2317
- const cssWidth = hasWidth ? hasWidth + "px" : "";
2318
- totalWidth += hasWidth || defaultCellMinWidth;
2319
- if (!hasWidth) fixedWidth = false;
2320
- if (!nextDOM) {
2321
- const col$1 = document.createElement("col");
2322
- col$1.style.width = cssWidth;
2323
- colgroup.appendChild(col$1);
2324
- } else {
2325
- if (nextDOM.style.width != cssWidth) nextDOM.style.width = cssWidth;
2326
- nextDOM = nextDOM.nextSibling;
2327
- }
2328
- }
2329
- }
2330
- while (nextDOM) {
2331
- var _nextDOM$parentNode;
2332
- const after = nextDOM.nextSibling;
2333
- (_nextDOM$parentNode = nextDOM.parentNode) === null || _nextDOM$parentNode === void 0 || _nextDOM$parentNode.removeChild(nextDOM);
2334
- nextDOM = after;
2335
- }
2336
- if (fixedWidth) {
2337
- table.style.width = totalWidth + "px";
2338
- table.style.minWidth = "";
2339
- } else {
2340
- table.style.width = "";
2341
- table.style.minWidth = totalWidth + "px";
2342
- }
2343
- }
2344
-
2345
- //#endregion
2346
- //#region src/columnresizing.ts
2347
- /**
2348
- * @public
2349
- */
2350
- const columnResizingPluginKey = new PluginKey("tableColumnResizing");
2351
- /**
2352
- * @public
2353
- */
2354
- function columnResizing({ handleWidth = 5, cellMinWidth = 25, defaultCellMinWidth = 100, View = TableView, lastColumnResizable = true } = {}) {
2355
- const plugin = new Plugin({
2356
- key: columnResizingPluginKey,
2357
- state: {
2358
- init(_, state) {
2359
- var _plugin$spec;
2360
- const nodeViews = (_plugin$spec = plugin.spec) === null || _plugin$spec === void 0 || (_plugin$spec = _plugin$spec.props) === null || _plugin$spec === void 0 ? void 0 : _plugin$spec.nodeViews;
2361
- const tableName = tableNodeTypes(state.schema).table.name;
2362
- if (View && nodeViews) nodeViews[tableName] = (node, view) => {
2363
- return new View(node, defaultCellMinWidth, view);
2364
- };
2365
- return new ResizeState(-1, false);
2366
- },
2367
- apply(tr, prev) {
2368
- return prev.apply(tr);
2369
- }
2370
- },
2371
- props: {
2372
- attributes: (state) => {
2373
- const pluginState = columnResizingPluginKey.getState(state);
2374
- return pluginState && pluginState.activeHandle > -1 ? { class: "resize-cursor" } : {};
2375
- },
2376
- handleDOMEvents: {
2377
- mousemove: (view, event) => {
2378
- handleMouseMove(view, event, handleWidth, lastColumnResizable);
2379
- },
2380
- mouseleave: (view) => {
2381
- handleMouseLeave(view);
2382
- },
2383
- mousedown: (view, event) => {
2384
- handleMouseDown(view, event, cellMinWidth, defaultCellMinWidth);
2385
- }
2386
- },
2387
- decorations: (state) => {
2388
- const pluginState = columnResizingPluginKey.getState(state);
2389
- if (pluginState && pluginState.activeHandle > -1) return handleDecorations(state, pluginState.activeHandle);
2390
- },
2391
- nodeViews: {}
2392
- }
2393
- });
2394
- return plugin;
2395
- }
2396
- /**
2397
- * @public
2398
- */
2399
- var ResizeState = class ResizeState {
2400
- constructor(activeHandle, dragging) {
2401
- this.activeHandle = activeHandle;
2402
- this.dragging = dragging;
2403
- }
2404
- apply(tr) {
2405
- const state = this;
2406
- const action = tr.getMeta(columnResizingPluginKey);
2407
- if (action && action.setHandle != null) return new ResizeState(action.setHandle, false);
2408
- if (action && action.setDragging !== void 0) return new ResizeState(state.activeHandle, action.setDragging);
2409
- if (state.activeHandle > -1 && tr.docChanged) {
2410
- let handle = tr.mapping.map(state.activeHandle, -1);
2411
- if (!pointsAtCell(tr.doc.resolve(handle))) handle = -1;
2412
- return new ResizeState(handle, state.dragging);
2413
- }
2414
- return state;
2415
- }
2416
- };
2417
- function handleMouseMove(view, event, handleWidth, lastColumnResizable) {
2418
- if (!view.editable) return;
2419
- const pluginState = columnResizingPluginKey.getState(view.state);
2420
- if (!pluginState) return;
2421
- if (!pluginState.dragging) {
2422
- const target = domCellAround(event.target);
2423
- let cell = -1;
2424
- if (target) {
2425
- const { left, right } = target.getBoundingClientRect();
2426
- if (event.clientX - left <= handleWidth) cell = edgeCell(view, event, "left", handleWidth);
2427
- else if (right - event.clientX <= handleWidth) cell = edgeCell(view, event, "right", handleWidth);
2428
- }
2429
- if (cell != pluginState.activeHandle) {
2430
- if (!lastColumnResizable && cell !== -1) {
2431
- const $cell = view.state.doc.resolve(cell);
2432
- const table = $cell.node(-1);
2433
- const map = TableMap.get(table);
2434
- const tableStart = $cell.start(-1);
2435
- if (map.colCount($cell.pos - tableStart) + $cell.nodeAfter.attrs.colspan - 1 == map.width - 1) return;
2436
- }
2437
- updateHandle(view, cell);
2438
- }
2439
- }
2440
- }
2441
- function handleMouseLeave(view) {
2442
- if (!view.editable) return;
2443
- const pluginState = columnResizingPluginKey.getState(view.state);
2444
- if (pluginState && pluginState.activeHandle > -1 && !pluginState.dragging) updateHandle(view, -1);
2445
- }
2446
- function handleMouseDown(view, event, cellMinWidth, defaultCellMinWidth) {
2447
- var _view$dom$ownerDocume;
2448
- if (!view.editable) return false;
2449
- const win = (_view$dom$ownerDocume = view.dom.ownerDocument.defaultView) !== null && _view$dom$ownerDocume !== void 0 ? _view$dom$ownerDocume : window;
2450
- const pluginState = columnResizingPluginKey.getState(view.state);
2451
- if (!pluginState || pluginState.activeHandle == -1 || pluginState.dragging) return false;
2452
- const cell = view.state.doc.nodeAt(pluginState.activeHandle);
2453
- const width = currentColWidth(view, pluginState.activeHandle, cell.attrs);
2454
- view.dispatch(view.state.tr.setMeta(columnResizingPluginKey, { setDragging: {
2455
- startX: event.clientX,
2456
- startWidth: width
2457
- } }));
2458
- function finish(event$1) {
2459
- win.removeEventListener("mouseup", finish);
2460
- win.removeEventListener("mousemove", move);
2461
- const pluginState$1 = columnResizingPluginKey.getState(view.state);
2462
- if (pluginState$1 === null || pluginState$1 === void 0 ? void 0 : pluginState$1.dragging) {
2463
- updateColumnWidth(view, pluginState$1.activeHandle, draggedWidth(pluginState$1.dragging, event$1, cellMinWidth));
2464
- view.dispatch(view.state.tr.setMeta(columnResizingPluginKey, { setDragging: null }));
2465
- }
2466
- }
2467
- function move(event$1) {
2468
- if (!event$1.which) return finish(event$1);
2469
- const pluginState$1 = columnResizingPluginKey.getState(view.state);
2470
- if (!pluginState$1) return;
2471
- if (pluginState$1.dragging) {
2472
- const dragged = draggedWidth(pluginState$1.dragging, event$1, cellMinWidth);
2473
- displayColumnWidth(view, pluginState$1.activeHandle, dragged, defaultCellMinWidth);
2474
- }
2475
- }
2476
- displayColumnWidth(view, pluginState.activeHandle, width, defaultCellMinWidth);
2477
- win.addEventListener("mouseup", finish);
2478
- win.addEventListener("mousemove", move);
2479
- event.preventDefault();
2480
- return true;
2481
- }
2482
- function currentColWidth(view, cellPos, { colspan, colwidth }) {
2483
- const width = colwidth && colwidth[colwidth.length - 1];
2484
- if (width) return width;
2485
- const dom = view.domAtPos(cellPos);
2486
- let domWidth = dom.node.childNodes[dom.offset].offsetWidth, parts = colspan;
2487
- if (colwidth) {
2488
- for (let i = 0; i < colspan; i++) if (colwidth[i]) {
2489
- domWidth -= colwidth[i];
2490
- parts--;
2491
- }
2492
- }
2493
- return domWidth / parts;
2494
- }
2495
- function domCellAround(target) {
2496
- while (target && target.nodeName != "TD" && target.nodeName != "TH") target = target.classList && target.classList.contains("ProseMirror") ? null : target.parentNode;
2497
- return target;
2498
- }
2499
- function edgeCell(view, event, side, handleWidth) {
2500
- const offset = side == "right" ? -handleWidth : handleWidth;
2501
- const found = view.posAtCoords({
2502
- left: event.clientX + offset,
2503
- top: event.clientY
2504
- });
2505
- if (!found) return -1;
2506
- const { pos } = found;
2507
- const $cell = cellAround(view.state.doc.resolve(pos));
2508
- if (!$cell) return -1;
2509
- if (side == "right") return $cell.pos;
2510
- const map = TableMap.get($cell.node(-1)), start = $cell.start(-1);
2511
- const index = map.map.indexOf($cell.pos - start);
2512
- return index % map.width == 0 ? -1 : start + map.map[index - 1];
2513
- }
2514
- function draggedWidth(dragging, event, resizeMinWidth) {
2515
- const offset = event.clientX - dragging.startX;
2516
- return Math.max(resizeMinWidth, dragging.startWidth + offset);
2517
- }
2518
- function updateHandle(view, value) {
2519
- view.dispatch(view.state.tr.setMeta(columnResizingPluginKey, { setHandle: value }));
2520
- }
2521
- function updateColumnWidth(view, cell, width) {
2522
- const $cell = view.state.doc.resolve(cell);
2523
- const table = $cell.node(-1), map = TableMap.get(table), start = $cell.start(-1);
2524
- const col = map.colCount($cell.pos - start) + $cell.nodeAfter.attrs.colspan - 1;
2525
- const tr = view.state.tr;
2526
- for (let row = 0; row < map.height; row++) {
2527
- const mapIndex = row * map.width + col;
2528
- if (row && map.map[mapIndex] == map.map[mapIndex - map.width]) continue;
2529
- const pos = map.map[mapIndex];
2530
- const attrs = table.nodeAt(pos).attrs;
2531
- const index = attrs.colspan == 1 ? 0 : col - map.colCount(pos);
2532
- if (attrs.colwidth && attrs.colwidth[index] == width) continue;
2533
- const colwidth = attrs.colwidth ? attrs.colwidth.slice() : zeroes(attrs.colspan);
2534
- colwidth[index] = width;
2535
- tr.setNodeMarkup(start + pos, null, {
2536
- ...attrs,
2537
- colwidth
2538
- });
2539
- }
2540
- if (tr.docChanged) view.dispatch(tr);
2541
- }
2542
- function displayColumnWidth(view, cell, width, defaultCellMinWidth) {
2543
- const $cell = view.state.doc.resolve(cell);
2544
- const table = $cell.node(-1), start = $cell.start(-1);
2545
- const col = TableMap.get(table).colCount($cell.pos - start) + $cell.nodeAfter.attrs.colspan - 1;
2546
- let dom = view.domAtPos($cell.start(-1)).node;
2547
- while (dom && dom.nodeName != "TABLE") dom = dom.parentNode;
2548
- if (!dom) return;
2549
- updateColumnsOnResize(table, dom.firstChild, dom, defaultCellMinWidth, col, width);
2550
- }
2551
- function zeroes(n) {
2552
- return Array(n).fill(0);
2553
- }
2554
- function handleDecorations(state, cell) {
2555
- const decorations = [];
2556
- const $cell = state.doc.resolve(cell);
2557
- const table = $cell.node(-1);
2558
- if (!table) return DecorationSet.empty;
2559
- const map = TableMap.get(table);
2560
- const start = $cell.start(-1);
2561
- const col = map.colCount($cell.pos - start) + $cell.nodeAfter.attrs.colspan - 1;
2562
- for (let row = 0; row < map.height; row++) {
2563
- const index = col + row * map.width;
2564
- if ((col == map.width - 1 || map.map[index] != map.map[index + 1]) && (row == 0 || map.map[index] != map.map[index - map.width])) {
2565
- var _columnResizingPlugin;
2566
- const cellPos = map.map[index];
2567
- const pos = start + cellPos + table.nodeAt(cellPos).nodeSize - 1;
2568
- const dom = document.createElement("div");
2569
- dom.className = "column-resize-handle";
2570
- if ((_columnResizingPlugin = columnResizingPluginKey.getState(state)) === null || _columnResizingPlugin === void 0 ? void 0 : _columnResizingPlugin.dragging) decorations.push(Decoration.node(start + cellPos, start + cellPos + table.nodeAt(cellPos).nodeSize, { class: "column-resize-dragging" }));
2571
- decorations.push(Decoration.widget(pos, dom));
2572
- }
2573
- }
2574
- return DecorationSet.create(state.doc, decorations);
2575
- }
2576
-
2577
- //#endregion
2578
- //#region src/index.ts
2579
- /**
2580
- * Creates a [plugin](http://prosemirror.net/docs/ref/#state.Plugin)
2581
- * that, when added to an editor, enables cell-selection, handles
2582
- * cell-based copy/paste, and makes sure tables stay well-formed (each
2583
- * row has the same width, and cells don't overlap).
2584
- *
2585
- * You should probably put this plugin near the end of your array of
2586
- * plugins, since it handles mouse and arrow key events in tables
2587
- * rather broadly, and other plugins, like the gap cursor or the
2588
- * column-width dragging plugin, might want to get a turn first to
2589
- * perform more specific behavior.
2590
- *
2591
- * @public
2592
- */
2593
- function tableEditing({ allowTableNodeSelection = false } = {}) {
2594
- return new Plugin({
2595
- key: tableEditingKey,
2596
- state: {
2597
- init() {
2598
- return null;
2599
- },
2600
- apply(tr, cur) {
2601
- const set = tr.getMeta(tableEditingKey);
2602
- if (set != null) return set == -1 ? null : set;
2603
- if (cur == null || !tr.docChanged) return cur;
2604
- const { deleted, pos } = tr.mapping.mapResult(cur);
2605
- return deleted ? null : pos;
2606
- }
2607
- },
2608
- props: {
2609
- decorations: drawCellSelection,
2610
- handleDOMEvents: { mousedown: handleMouseDown$1 },
2611
- createSelectionBetween(view) {
2612
- return tableEditingKey.getState(view.state) != null ? view.state.selection : null;
2613
- },
2614
- handleTripleClick,
2615
- handleKeyDown,
2616
- handlePaste
2617
- },
2618
- appendTransaction(_, oldState, state) {
2619
- return normalizeSelection(state, fixTables(state, oldState), allowTableNodeSelection);
2620
- }
2621
- });
2622
- }
2623
-
2624
- //#endregion
2625
- export { CellBookmark, CellSelection, ResizeState, TableMap, TableView, clipCells as __clipCells, insertCells as __insertCells, pastedCells as __pastedCells, addColSpan, addColumn, addColumnAfter, addColumnBefore, addRow, addRowAfter, addRowBefore, cellAround, cellNear, colCount, columnIsHeader, columnResizing, columnResizingPluginKey, deleteCellSelection, deleteColumn, deleteRow, deleteTable, findCell, findCellPos, findCellRange, findTable, fixTables, fixTablesKey, goToNextCell, handlePaste, inSameTable, isInTable, mergeCells, moveCellForward, moveTableColumn, moveTableRow, nextCell, pointsAtCell, removeColSpan, removeColumn, removeRow, rowIsHeader, selectedRect, selectionCell, setCellAttr, splitCell, splitCellWithType, tableEditing, tableEditingKey, tableNodeTypes, tableNodes, toggleHeader, toggleHeaderCell, toggleHeaderColumn, toggleHeaderRow, updateColumnsOnResize };
2626
- //# sourceMappingURL=index.js.map