@contember/react-slate-editor-base 2.1.0-beta.2 → 2.2.0-alpha.2

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 (530) hide show
  1. package/dist/development/src/components/RichTextEditor.cjs.map +1 -1
  2. package/dist/development/src/components/RichTextEditor.js.map +1 -1
  3. package/dist/development/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -1
  4. package/dist/development/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -1
  5. package/dist/development/src/editor/createEditor.cjs.map +1 -1
  6. package/dist/development/src/editor/createEditor.js.map +1 -1
  7. package/dist/development/src/editor/createEditorWithEssentials.cjs.map +1 -1
  8. package/dist/development/src/editor/createEditorWithEssentials.js.map +1 -1
  9. package/dist/development/src/editor/index.cjs.map +1 -1
  10. package/dist/development/src/editor/index.js.map +1 -1
  11. package/dist/development/src/editor/methods/addMarks.cjs.map +1 -1
  12. package/dist/development/src/editor/methods/addMarks.js.map +1 -1
  13. package/dist/development/src/editor/methods/closestBlockEntry.cjs.map +1 -1
  14. package/dist/development/src/editor/methods/closestBlockEntry.js.map +1 -1
  15. package/dist/development/src/editor/methods/closestViableBlockContainerEntry.cjs.map +1 -1
  16. package/dist/development/src/editor/methods/closestViableBlockContainerEntry.js.map +1 -1
  17. package/dist/development/src/editor/methods/hasMarks.cjs.map +1 -1
  18. package/dist/development/src/editor/methods/hasMarks.js.map +1 -1
  19. package/dist/development/src/editor/methods/hasParentOfType.cjs.map +1 -1
  20. package/dist/development/src/editor/methods/hasParentOfType.js.map +1 -1
  21. package/dist/development/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -1
  22. package/dist/development/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -1
  23. package/dist/development/src/editor/methods/removeMarks.cjs.map +1 -1
  24. package/dist/development/src/editor/methods/removeMarks.js.map +1 -1
  25. package/dist/development/src/editor/methods/serializeNodes.cjs.map +1 -1
  26. package/dist/development/src/editor/methods/serializeNodes.js.map +1 -1
  27. package/dist/development/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -1
  28. package/dist/development/src/editor/methods/strictlyDeserializeNodes.js.map +1 -1
  29. package/dist/development/src/editor/methods/textToSpecifics.cjs.map +1 -1
  30. package/dist/development/src/editor/methods/textToSpecifics.js.map +1 -1
  31. package/dist/development/src/editor/methods/toLatestFormat.cjs.map +1 -1
  32. package/dist/development/src/editor/methods/toLatestFormat.js.map +1 -1
  33. package/dist/development/src/internal/utils/EditorPasteUtils.cjs.map +1 -1
  34. package/dist/development/src/internal/utils/EditorPasteUtils.js.map +1 -1
  35. package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -1
  36. package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -1
  37. package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -1
  38. package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -1
  39. package/dist/development/src/plugins/behaviour/paste/withPaste.cjs.map +1 -1
  40. package/dist/development/src/plugins/behaviour/paste/withPaste.js.map +1 -1
  41. package/dist/development/src/plugins/element/anchors/AnchorElement.cjs.map +1 -1
  42. package/dist/development/src/plugins/element/anchors/AnchorElement.js.map +1 -1
  43. package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -1
  44. package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -1
  45. package/dist/development/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -1
  46. package/dist/development/src/plugins/element/anchors/AnchorModifications.js.map +1 -1
  47. package/dist/development/src/plugins/element/anchors/withAnchors.cjs.map +1 -1
  48. package/dist/development/src/plugins/element/anchors/withAnchors.js.map +1 -1
  49. package/dist/development/src/plugins/element/headings/HeadingElement.cjs.map +1 -1
  50. package/dist/development/src/plugins/element/headings/HeadingElement.js.map +1 -1
  51. package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -1
  52. package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -1
  53. package/dist/development/src/plugins/element/headings/withHeadings.cjs.map +1 -1
  54. package/dist/development/src/plugins/element/headings/withHeadings.js.map +1 -1
  55. package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -1
  56. package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -1
  57. package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -1
  58. package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -1
  59. package/dist/development/src/plugins/element/lists/ListElement.cjs.map +1 -1
  60. package/dist/development/src/plugins/element/lists/ListElement.js.map +1 -1
  61. package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -1
  62. package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -1
  63. package/dist/development/src/plugins/element/lists/ListItemElement.cjs.map +1 -1
  64. package/dist/development/src/plugins/element/lists/ListItemElement.js.map +1 -1
  65. package/dist/development/src/plugins/element/lists/OrderedListElement.cjs.map +1 -1
  66. package/dist/development/src/plugins/element/lists/OrderedListElement.js.map +1 -1
  67. package/dist/development/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -1
  68. package/dist/development/src/plugins/element/lists/UnorderedListElement.js.map +1 -1
  69. package/dist/development/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -1
  70. package/dist/development/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -1
  71. package/dist/development/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -1
  72. package/dist/development/src/plugins/element/lists/transforms/indentListItem.js.map +1 -1
  73. package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -1
  74. package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -1
  75. package/dist/development/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -1
  76. package/dist/development/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -1
  77. package/dist/development/src/plugins/element/lists/withLists.cjs.map +1 -1
  78. package/dist/development/src/plugins/element/lists/withLists.js.map +1 -1
  79. package/dist/development/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -1
  80. package/dist/development/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -1
  81. package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -1
  82. package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -1
  83. package/dist/development/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -1
  84. package/dist/development/src/plugins/element/paragraphs/withParagraphs.js.map +1 -1
  85. package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -1
  86. package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -1
  87. package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -1
  88. package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -1
  89. package/dist/development/src/plugins/element/tables/TableCellElement.cjs.map +1 -1
  90. package/dist/development/src/plugins/element/tables/TableCellElement.js.map +1 -1
  91. package/dist/development/src/plugins/element/tables/TableElement.cjs.map +1 -1
  92. package/dist/development/src/plugins/element/tables/TableElement.js.map +1 -1
  93. package/dist/development/src/plugins/element/tables/TableElementSelection.cjs.map +1 -1
  94. package/dist/development/src/plugins/element/tables/TableElementSelection.js.map +1 -1
  95. package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +1 -1
  96. package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.js.map +1 -1
  97. package/dist/development/src/plugins/element/tables/TableModifications.cjs.map +1 -1
  98. package/dist/development/src/plugins/element/tables/TableModifications.js.map +1 -1
  99. package/dist/development/src/plugins/element/tables/TableRowElement.cjs.map +1 -1
  100. package/dist/development/src/plugins/element/tables/TableRowElement.js.map +1 -1
  101. package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -1
  102. package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -1
  103. package/dist/development/src/plugins/element/tables/withTables.cjs.map +1 -1
  104. package/dist/development/src/plugins/element/tables/withTables.js.map +1 -1
  105. package/dist/development/src/plugins/text/bold/boldMark.cjs.map +1 -1
  106. package/dist/development/src/plugins/text/bold/boldMark.js.map +1 -1
  107. package/dist/development/src/plugins/text/bold/withBold.cjs.map +1 -1
  108. package/dist/development/src/plugins/text/bold/withBold.js.map +1 -1
  109. package/dist/development/src/plugins/text/code/codeMark.cjs.map +1 -1
  110. package/dist/development/src/plugins/text/code/codeMark.js.map +1 -1
  111. package/dist/development/src/plugins/text/code/withCode.cjs.map +1 -1
  112. package/dist/development/src/plugins/text/code/withCode.js.map +1 -1
  113. package/dist/development/src/plugins/text/highlight/highlightMark.cjs.map +1 -1
  114. package/dist/development/src/plugins/text/highlight/highlightMark.js.map +1 -1
  115. package/dist/development/src/plugins/text/highlight/withHighlight.cjs.map +1 -1
  116. package/dist/development/src/plugins/text/highlight/withHighlight.js.map +1 -1
  117. package/dist/development/src/plugins/text/italic/italicMark.cjs.map +1 -1
  118. package/dist/development/src/plugins/text/italic/italicMark.js.map +1 -1
  119. package/dist/development/src/plugins/text/italic/withItalic.cjs.map +1 -1
  120. package/dist/development/src/plugins/text/italic/withItalic.js.map +1 -1
  121. package/dist/development/src/plugins/text/newline/withNewline.cjs.map +1 -1
  122. package/dist/development/src/plugins/text/newline/withNewline.js.map +1 -1
  123. package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -1
  124. package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -1
  125. package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -1
  126. package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -1
  127. package/dist/development/src/plugins/text/underline/underlineMark.cjs.map +1 -1
  128. package/dist/development/src/plugins/text/underline/underlineMark.js.map +1 -1
  129. package/dist/development/src/plugins/text/underline/withUnderline.cjs.map +1 -1
  130. package/dist/development/src/plugins/text/underline/withUnderline.js.map +1 -1
  131. package/dist/production/src/components/RichTextEditor.cjs.map +1 -1
  132. package/dist/production/src/components/RichTextEditor.js.map +1 -1
  133. package/dist/production/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -1
  134. package/dist/production/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -1
  135. package/dist/production/src/editor/createEditor.cjs.map +1 -1
  136. package/dist/production/src/editor/createEditor.js.map +1 -1
  137. package/dist/production/src/editor/createEditorWithEssentials.cjs.map +1 -1
  138. package/dist/production/src/editor/createEditorWithEssentials.js.map +1 -1
  139. package/dist/production/src/editor/index.cjs.map +1 -1
  140. package/dist/production/src/editor/index.js.map +1 -1
  141. package/dist/production/src/editor/methods/addMarks.cjs.map +1 -1
  142. package/dist/production/src/editor/methods/addMarks.js.map +1 -1
  143. package/dist/production/src/editor/methods/closestBlockEntry.cjs.map +1 -1
  144. package/dist/production/src/editor/methods/closestBlockEntry.js.map +1 -1
  145. package/dist/production/src/editor/methods/closestViableBlockContainerEntry.cjs.map +1 -1
  146. package/dist/production/src/editor/methods/closestViableBlockContainerEntry.js.map +1 -1
  147. package/dist/production/src/editor/methods/hasMarks.cjs.map +1 -1
  148. package/dist/production/src/editor/methods/hasMarks.js.map +1 -1
  149. package/dist/production/src/editor/methods/hasParentOfType.cjs.map +1 -1
  150. package/dist/production/src/editor/methods/hasParentOfType.js.map +1 -1
  151. package/dist/production/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -1
  152. package/dist/production/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -1
  153. package/dist/production/src/editor/methods/removeMarks.cjs.map +1 -1
  154. package/dist/production/src/editor/methods/removeMarks.js.map +1 -1
  155. package/dist/production/src/editor/methods/serializeNodes.cjs.map +1 -1
  156. package/dist/production/src/editor/methods/serializeNodes.js.map +1 -1
  157. package/dist/production/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -1
  158. package/dist/production/src/editor/methods/strictlyDeserializeNodes.js.map +1 -1
  159. package/dist/production/src/editor/methods/textToSpecifics.cjs.map +1 -1
  160. package/dist/production/src/editor/methods/textToSpecifics.js.map +1 -1
  161. package/dist/production/src/editor/methods/toLatestFormat.cjs.map +1 -1
  162. package/dist/production/src/editor/methods/toLatestFormat.js.map +1 -1
  163. package/dist/production/src/internal/utils/EditorPasteUtils.cjs.map +1 -1
  164. package/dist/production/src/internal/utils/EditorPasteUtils.js.map +1 -1
  165. package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -1
  166. package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -1
  167. package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -1
  168. package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -1
  169. package/dist/production/src/plugins/behaviour/paste/withPaste.cjs.map +1 -1
  170. package/dist/production/src/plugins/behaviour/paste/withPaste.js.map +1 -1
  171. package/dist/production/src/plugins/element/anchors/AnchorElement.cjs.map +1 -1
  172. package/dist/production/src/plugins/element/anchors/AnchorElement.js.map +1 -1
  173. package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -1
  174. package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -1
  175. package/dist/production/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -1
  176. package/dist/production/src/plugins/element/anchors/AnchorModifications.js.map +1 -1
  177. package/dist/production/src/plugins/element/anchors/withAnchors.cjs.map +1 -1
  178. package/dist/production/src/plugins/element/anchors/withAnchors.js.map +1 -1
  179. package/dist/production/src/plugins/element/headings/HeadingElement.cjs.map +1 -1
  180. package/dist/production/src/plugins/element/headings/HeadingElement.js.map +1 -1
  181. package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -1
  182. package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -1
  183. package/dist/production/src/plugins/element/headings/withHeadings.cjs.map +1 -1
  184. package/dist/production/src/plugins/element/headings/withHeadings.js.map +1 -1
  185. package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -1
  186. package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -1
  187. package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -1
  188. package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -1
  189. package/dist/production/src/plugins/element/lists/ListElement.cjs.map +1 -1
  190. package/dist/production/src/plugins/element/lists/ListElement.js.map +1 -1
  191. package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -1
  192. package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -1
  193. package/dist/production/src/plugins/element/lists/ListItemElement.cjs.map +1 -1
  194. package/dist/production/src/plugins/element/lists/ListItemElement.js.map +1 -1
  195. package/dist/production/src/plugins/element/lists/OrderedListElement.cjs.map +1 -1
  196. package/dist/production/src/plugins/element/lists/OrderedListElement.js.map +1 -1
  197. package/dist/production/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -1
  198. package/dist/production/src/plugins/element/lists/UnorderedListElement.js.map +1 -1
  199. package/dist/production/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -1
  200. package/dist/production/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -1
  201. package/dist/production/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -1
  202. package/dist/production/src/plugins/element/lists/transforms/indentListItem.js.map +1 -1
  203. package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -1
  204. package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -1
  205. package/dist/production/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -1
  206. package/dist/production/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -1
  207. package/dist/production/src/plugins/element/lists/withLists.cjs.map +1 -1
  208. package/dist/production/src/plugins/element/lists/withLists.js.map +1 -1
  209. package/dist/production/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -1
  210. package/dist/production/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -1
  211. package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -1
  212. package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -1
  213. package/dist/production/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -1
  214. package/dist/production/src/plugins/element/paragraphs/withParagraphs.js.map +1 -1
  215. package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -1
  216. package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -1
  217. package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -1
  218. package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -1
  219. package/dist/production/src/plugins/element/tables/TableCellElement.cjs.map +1 -1
  220. package/dist/production/src/plugins/element/tables/TableCellElement.js.map +1 -1
  221. package/dist/production/src/plugins/element/tables/TableElement.cjs.map +1 -1
  222. package/dist/production/src/plugins/element/tables/TableElement.js.map +1 -1
  223. package/dist/production/src/plugins/element/tables/TableElementSelection.cjs.map +1 -1
  224. package/dist/production/src/plugins/element/tables/TableElementSelection.js.map +1 -1
  225. package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +1 -1
  226. package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.js.map +1 -1
  227. package/dist/production/src/plugins/element/tables/TableModifications.cjs.map +1 -1
  228. package/dist/production/src/plugins/element/tables/TableModifications.js.map +1 -1
  229. package/dist/production/src/plugins/element/tables/TableRowElement.cjs.map +1 -1
  230. package/dist/production/src/plugins/element/tables/TableRowElement.js.map +1 -1
  231. package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -1
  232. package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -1
  233. package/dist/production/src/plugins/element/tables/withTables.cjs.map +1 -1
  234. package/dist/production/src/plugins/element/tables/withTables.js.map +1 -1
  235. package/dist/production/src/plugins/text/bold/boldMark.cjs.map +1 -1
  236. package/dist/production/src/plugins/text/bold/boldMark.js.map +1 -1
  237. package/dist/production/src/plugins/text/bold/withBold.cjs.map +1 -1
  238. package/dist/production/src/plugins/text/bold/withBold.js.map +1 -1
  239. package/dist/production/src/plugins/text/code/codeMark.cjs.map +1 -1
  240. package/dist/production/src/plugins/text/code/codeMark.js.map +1 -1
  241. package/dist/production/src/plugins/text/code/withCode.cjs.map +1 -1
  242. package/dist/production/src/plugins/text/code/withCode.js.map +1 -1
  243. package/dist/production/src/plugins/text/highlight/highlightMark.cjs.map +1 -1
  244. package/dist/production/src/plugins/text/highlight/highlightMark.js.map +1 -1
  245. package/dist/production/src/plugins/text/highlight/withHighlight.cjs.map +1 -1
  246. package/dist/production/src/plugins/text/highlight/withHighlight.js.map +1 -1
  247. package/dist/production/src/plugins/text/italic/italicMark.cjs.map +1 -1
  248. package/dist/production/src/plugins/text/italic/italicMark.js.map +1 -1
  249. package/dist/production/src/plugins/text/italic/withItalic.cjs.map +1 -1
  250. package/dist/production/src/plugins/text/italic/withItalic.js.map +1 -1
  251. package/dist/production/src/plugins/text/newline/withNewline.cjs.map +1 -1
  252. package/dist/production/src/plugins/text/newline/withNewline.js.map +1 -1
  253. package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -1
  254. package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -1
  255. package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -1
  256. package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -1
  257. package/dist/production/src/plugins/text/underline/underlineMark.cjs.map +1 -1
  258. package/dist/production/src/plugins/text/underline/underlineMark.js.map +1 -1
  259. package/dist/production/src/plugins/text/underline/withUnderline.cjs.map +1 -1
  260. package/dist/production/src/plugins/text/underline/withUnderline.js.map +1 -1
  261. package/dist/types/components/RichTextEditor.d.ts +1 -1
  262. package/dist/types/components/RichTextEditor.d.ts.map +1 -1
  263. package/dist/types/components/index.d.ts +2 -2
  264. package/dist/types/components/index.d.ts.map +1 -1
  265. package/dist/types/components/triggers/index.d.ts +4 -4
  266. package/dist/types/components/triggers/index.d.ts.map +1 -1
  267. package/dist/types/editor/createEditor.d.ts +1 -1
  268. package/dist/types/editor/createEditor.d.ts.map +1 -1
  269. package/dist/types/editor/index.d.ts +11 -11
  270. package/dist/types/editor/index.d.ts.map +1 -1
  271. package/dist/types/editor/methods/addMarks.d.ts +1 -1
  272. package/dist/types/editor/methods/addMarks.d.ts.map +1 -1
  273. package/dist/types/editor/methods/closestBlockEntry.d.ts +1 -1
  274. package/dist/types/editor/methods/closestBlockEntry.d.ts.map +1 -1
  275. package/dist/types/editor/methods/hasMarks.d.ts +1 -1
  276. package/dist/types/editor/methods/hasMarks.d.ts.map +1 -1
  277. package/dist/types/editor/methods/index.d.ts +19 -19
  278. package/dist/types/editor/methods/index.d.ts.map +1 -1
  279. package/dist/types/editor/methods/removeMarks.d.ts +1 -1
  280. package/dist/types/editor/methods/removeMarks.d.ts.map +1 -1
  281. package/dist/types/editor/methods/textToSpecifics.d.ts +1 -1
  282. package/dist/types/editor/methods/textToSpecifics.d.ts.map +1 -1
  283. package/dist/types/editor/methods/toLatestFormat.d.ts +1 -1
  284. package/dist/types/editor/methods/toLatestFormat.d.ts.map +1 -1
  285. package/dist/types/index.d.ts +6 -6
  286. package/dist/types/index.d.ts.map +1 -1
  287. package/dist/types/internal/utils/EditorPasteUtils.d.ts +2 -2
  288. package/dist/types/internal/utils/EditorPasteUtils.d.ts.map +1 -1
  289. package/dist/types/internal/utils/index.d.ts +2 -2
  290. package/dist/types/internal/utils/index.d.ts.map +1 -1
  291. package/dist/types/plugins/attributes/alignment/index.d.ts +1 -1
  292. package/dist/types/plugins/attributes/alignment/index.d.ts.map +1 -1
  293. package/dist/types/plugins/attributes/index.d.ts +1 -1
  294. package/dist/types/plugins/attributes/index.d.ts.map +1 -1
  295. package/dist/types/plugins/behaviour/index.d.ts +1 -1
  296. package/dist/types/plugins/behaviour/index.d.ts.map +1 -1
  297. package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts +2 -2
  298. package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts.map +1 -1
  299. package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts +1 -1
  300. package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts.map +1 -1
  301. package/dist/types/plugins/behaviour/paste/index.d.ts +2 -2
  302. package/dist/types/plugins/behaviour/paste/index.d.ts.map +1 -1
  303. package/dist/types/plugins/element/anchors/AnchorElement.d.ts +1 -1
  304. package/dist/types/plugins/element/anchors/AnchorElement.d.ts.map +1 -1
  305. package/dist/types/plugins/element/anchors/AnchorHtmlDeserializer.d.ts +1 -1
  306. package/dist/types/plugins/element/anchors/AnchorHtmlDeserializer.d.ts.map +1 -1
  307. package/dist/types/plugins/element/anchors/index.d.ts +3 -3
  308. package/dist/types/plugins/element/anchors/index.d.ts.map +1 -1
  309. package/dist/types/plugins/element/anchors/withAnchors.d.ts +2 -2
  310. package/dist/types/plugins/element/anchors/withAnchors.d.ts.map +1 -1
  311. package/dist/types/plugins/element/headings/HeadingElement.d.ts +2 -2
  312. package/dist/types/plugins/element/headings/HeadingElement.d.ts.map +1 -1
  313. package/dist/types/plugins/element/headings/HeadingHtmlDeserializer.d.ts +1 -1
  314. package/dist/types/plugins/element/headings/HeadingHtmlDeserializer.d.ts.map +1 -1
  315. package/dist/types/plugins/element/headings/index.d.ts +3 -3
  316. package/dist/types/plugins/element/headings/index.d.ts.map +1 -1
  317. package/dist/types/plugins/element/headings/withHeadings.d.ts +2 -2
  318. package/dist/types/plugins/element/headings/withHeadings.d.ts.map +1 -1
  319. package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts +1 -1
  320. package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts.map +1 -1
  321. package/dist/types/plugins/element/horizonalRules/index.d.ts +2 -2
  322. package/dist/types/plugins/element/horizonalRules/index.d.ts.map +1 -1
  323. package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts +2 -2
  324. package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts.map +1 -1
  325. package/dist/types/plugins/element/index.d.ts +7 -7
  326. package/dist/types/plugins/element/index.d.ts.map +1 -1
  327. package/dist/types/plugins/element/lists/ListElement.d.ts +2 -2
  328. package/dist/types/plugins/element/lists/ListElement.d.ts.map +1 -1
  329. package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts +1 -1
  330. package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts.map +1 -1
  331. package/dist/types/plugins/element/lists/ListItemElement.d.ts +1 -1
  332. package/dist/types/plugins/element/lists/ListItemElement.d.ts.map +1 -1
  333. package/dist/types/plugins/element/lists/OrderedListElement.d.ts +1 -1
  334. package/dist/types/plugins/element/lists/OrderedListElement.d.ts.map +1 -1
  335. package/dist/types/plugins/element/lists/UnorderedListElement.d.ts +1 -1
  336. package/dist/types/plugins/element/lists/UnorderedListElement.d.ts.map +1 -1
  337. package/dist/types/plugins/element/lists/index.d.ts +5 -5
  338. package/dist/types/plugins/element/lists/index.d.ts.map +1 -1
  339. package/dist/types/plugins/element/lists/transforms/dedentListItem.d.ts +1 -1
  340. package/dist/types/plugins/element/lists/transforms/dedentListItem.d.ts.map +1 -1
  341. package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts +1 -1
  342. package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts.map +1 -1
  343. package/dist/types/plugins/element/lists/transforms/index.d.ts +4 -4
  344. package/dist/types/plugins/element/lists/transforms/index.d.ts.map +1 -1
  345. package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts +2 -2
  346. package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts.map +1 -1
  347. package/dist/types/plugins/element/lists/withLists.d.ts +4 -4
  348. package/dist/types/plugins/element/lists/withLists.d.ts.map +1 -1
  349. package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts +2 -2
  350. package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts.map +1 -1
  351. package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts +1 -1
  352. package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts.map +1 -1
  353. package/dist/types/plugins/element/paragraphs/index.d.ts +3 -3
  354. package/dist/types/plugins/element/paragraphs/index.d.ts.map +1 -1
  355. package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts +2 -2
  356. package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts.map +1 -1
  357. package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts +1 -1
  358. package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts.map +1 -1
  359. package/dist/types/plugins/element/scrollTargets/index.d.ts +2 -2
  360. package/dist/types/plugins/element/scrollTargets/index.d.ts.map +1 -1
  361. package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts +2 -2
  362. package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts.map +1 -1
  363. package/dist/types/plugins/element/tables/TableCellElement.d.ts +1 -1
  364. package/dist/types/plugins/element/tables/TableCellElement.d.ts.map +1 -1
  365. package/dist/types/plugins/element/tables/TableElement.d.ts +1 -1
  366. package/dist/types/plugins/element/tables/TableElement.d.ts.map +1 -1
  367. package/dist/types/plugins/element/tables/TableElementSelection.d.ts +2 -2
  368. package/dist/types/plugins/element/tables/TableElementSelection.d.ts.map +1 -1
  369. package/dist/types/plugins/element/tables/TableHtmlDeserializer.d.ts +1 -1
  370. package/dist/types/plugins/element/tables/TableHtmlDeserializer.d.ts.map +1 -1
  371. package/dist/types/plugins/element/tables/TableModifications.d.ts +3 -3
  372. package/dist/types/plugins/element/tables/TableModifications.d.ts.map +1 -1
  373. package/dist/types/plugins/element/tables/TableRowElement.d.ts +1 -1
  374. package/dist/types/plugins/element/tables/TableRowElement.d.ts.map +1 -1
  375. package/dist/types/plugins/element/tables/gaugeTableColumnCount.d.ts +1 -1
  376. package/dist/types/plugins/element/tables/gaugeTableColumnCount.d.ts.map +1 -1
  377. package/dist/types/plugins/element/tables/index.d.ts +5 -5
  378. package/dist/types/plugins/element/tables/index.d.ts.map +1 -1
  379. package/dist/types/plugins/element/tables/withTables.d.ts +4 -4
  380. package/dist/types/plugins/element/tables/withTables.d.ts.map +1 -1
  381. package/dist/types/plugins/index.d.ts +4 -4
  382. package/dist/types/plugins/index.d.ts.map +1 -1
  383. package/dist/types/plugins/text/bold/boldMark.d.ts +1 -1
  384. package/dist/types/plugins/text/bold/boldMark.d.ts.map +1 -1
  385. package/dist/types/plugins/text/bold/index.d.ts +2 -2
  386. package/dist/types/plugins/text/bold/index.d.ts.map +1 -1
  387. package/dist/types/plugins/text/bold/withBold.d.ts +1 -1
  388. package/dist/types/plugins/text/bold/withBold.d.ts.map +1 -1
  389. package/dist/types/plugins/text/code/codeMark.d.ts +1 -1
  390. package/dist/types/plugins/text/code/codeMark.d.ts.map +1 -1
  391. package/dist/types/plugins/text/code/index.d.ts +2 -2
  392. package/dist/types/plugins/text/code/index.d.ts.map +1 -1
  393. package/dist/types/plugins/text/code/withCode.d.ts +1 -1
  394. package/dist/types/plugins/text/code/withCode.d.ts.map +1 -1
  395. package/dist/types/plugins/text/highlight/highlightMark.d.ts +1 -1
  396. package/dist/types/plugins/text/highlight/highlightMark.d.ts.map +1 -1
  397. package/dist/types/plugins/text/highlight/index.d.ts +2 -2
  398. package/dist/types/plugins/text/highlight/index.d.ts.map +1 -1
  399. package/dist/types/plugins/text/highlight/withHighlight.d.ts +1 -1
  400. package/dist/types/plugins/text/highlight/withHighlight.d.ts.map +1 -1
  401. package/dist/types/plugins/text/index.d.ts +7 -7
  402. package/dist/types/plugins/text/index.d.ts.map +1 -1
  403. package/dist/types/plugins/text/italic/index.d.ts +2 -2
  404. package/dist/types/plugins/text/italic/index.d.ts.map +1 -1
  405. package/dist/types/plugins/text/italic/italicMark.d.ts +1 -1
  406. package/dist/types/plugins/text/italic/italicMark.d.ts.map +1 -1
  407. package/dist/types/plugins/text/italic/withItalic.d.ts +1 -1
  408. package/dist/types/plugins/text/italic/withItalic.d.ts.map +1 -1
  409. package/dist/types/plugins/text/newline/index.d.ts +1 -1
  410. package/dist/types/plugins/text/newline/index.d.ts.map +1 -1
  411. package/dist/types/plugins/text/newline/withNewline.d.ts +1 -1
  412. package/dist/types/plugins/text/newline/withNewline.d.ts.map +1 -1
  413. package/dist/types/plugins/text/strikeThrough/index.d.ts +2 -2
  414. package/dist/types/plugins/text/strikeThrough/index.d.ts.map +1 -1
  415. package/dist/types/plugins/text/strikeThrough/strikeThroughMark.d.ts +1 -1
  416. package/dist/types/plugins/text/strikeThrough/strikeThroughMark.d.ts.map +1 -1
  417. package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts +1 -1
  418. package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts.map +1 -1
  419. package/dist/types/plugins/text/underline/index.d.ts +2 -2
  420. package/dist/types/plugins/text/underline/index.d.ts.map +1 -1
  421. package/dist/types/plugins/text/underline/underlineMark.d.ts +1 -1
  422. package/dist/types/plugins/text/underline/underlineMark.d.ts.map +1 -1
  423. package/dist/types/plugins/text/underline/withUnderline.d.ts +1 -1
  424. package/dist/types/plugins/text/underline/withUnderline.d.ts.map +1 -1
  425. package/dist/types/slate-types.d.ts +1 -1
  426. package/dist/types/slate-types.d.ts.map +1 -1
  427. package/dist/types/tsconfig.tsbuildinfo +1 -1
  428. package/dist/types/types/editor.d.ts +2 -2
  429. package/dist/types/types/editor.d.ts.map +1 -1
  430. package/dist/types/types/htmlDeserializer.d.ts +1 -1
  431. package/dist/types/types/htmlDeserializer.d.ts.map +1 -1
  432. package/dist/types/types/index.d.ts +3 -3
  433. package/dist/types/types/index.d.ts.map +1 -1
  434. package/package.json +3 -3
  435. package/src/components/RichTextEditor.tsx +3 -3
  436. package/src/components/index.ts +2 -2
  437. package/src/components/triggers/EditorWrapNodeTrigger.tsx +1 -1
  438. package/src/components/triggers/index.ts +4 -4
  439. package/src/editor/createEditor.ts +2 -2
  440. package/src/editor/createEditorWithEssentials.tsx +5 -5
  441. package/src/editor/index.ts +4 -4
  442. package/src/editor/methods/addMarks.ts +1 -1
  443. package/src/editor/methods/closestBlockEntry.ts +1 -1
  444. package/src/editor/methods/closestViableBlockContainerEntry.ts +1 -1
  445. package/src/editor/methods/hasMarks.ts +1 -1
  446. package/src/editor/methods/hasParentOfType.ts +1 -1
  447. package/src/editor/methods/index.ts +19 -19
  448. package/src/editor/methods/permissivelyDeserializeNodes.ts +2 -2
  449. package/src/editor/methods/removeMarks.ts +1 -1
  450. package/src/editor/methods/serializeNodes.ts +1 -1
  451. package/src/editor/methods/strictlyDeserializeNodes.ts +2 -2
  452. package/src/editor/methods/textToSpecifics.ts +1 -1
  453. package/src/editor/methods/toLatestFormat.ts +1 -1
  454. package/src/index.ts +6 -6
  455. package/src/internal/utils/EditorPasteUtils.ts +2 -2
  456. package/src/internal/utils/index.ts +2 -2
  457. package/src/plugins/attributes/alignment/index.ts +1 -1
  458. package/src/plugins/attributes/index.ts +1 -1
  459. package/src/plugins/behaviour/index.ts +1 -1
  460. package/src/plugins/behaviour/paste/HtmlDeserializer.ts +2 -2
  461. package/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts +1 -1
  462. package/src/plugins/behaviour/paste/index.ts +2 -2
  463. package/src/plugins/behaviour/paste/withPaste.ts +3 -3
  464. package/src/plugins/element/anchors/AnchorElement.ts +2 -2
  465. package/src/plugins/element/anchors/AnchorHtmlDeserializer.ts +1 -1
  466. package/src/plugins/element/anchors/AnchorModifications.ts +1 -1
  467. package/src/plugins/element/anchors/index.ts +3 -3
  468. package/src/plugins/element/anchors/withAnchors.ts +5 -5
  469. package/src/plugins/element/headings/HeadingElement.ts +3 -3
  470. package/src/plugins/element/headings/HeadingHtmlDeserializer.ts +3 -3
  471. package/src/plugins/element/headings/index.ts +3 -3
  472. package/src/plugins/element/headings/withHeadings.ts +4 -4
  473. package/src/plugins/element/horizonalRules/HorizontalRuleElement.ts +1 -1
  474. package/src/plugins/element/horizonalRules/index.ts +2 -2
  475. package/src/plugins/element/horizonalRules/withHorizontalRules.ts +2 -2
  476. package/src/plugins/element/index.ts +7 -7
  477. package/src/plugins/element/lists/ListElement.ts +4 -4
  478. package/src/plugins/element/lists/ListHtmlDeserializer.ts +6 -6
  479. package/src/plugins/element/lists/ListItemElement.ts +3 -3
  480. package/src/plugins/element/lists/OrderedListElement.ts +5 -5
  481. package/src/plugins/element/lists/UnorderedListElement.ts +5 -5
  482. package/src/plugins/element/lists/index.ts +5 -5
  483. package/src/plugins/element/lists/transforms/dedentListItem.ts +5 -5
  484. package/src/plugins/element/lists/transforms/indentListItem.ts +4 -4
  485. package/src/plugins/element/lists/transforms/index.ts +4 -4
  486. package/src/plugins/element/lists/transforms/normalizeListElement.ts +2 -2
  487. package/src/plugins/element/lists/transforms/toggleListElement.ts +5 -5
  488. package/src/plugins/element/lists/withLists.ts +8 -8
  489. package/src/plugins/element/paragraphs/ParagraphElement.ts +3 -3
  490. package/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts +2 -2
  491. package/src/plugins/element/paragraphs/index.ts +3 -3
  492. package/src/plugins/element/paragraphs/withParagraphs.ts +4 -4
  493. package/src/plugins/element/scrollTargets/ScrollTargetElement.ts +1 -1
  494. package/src/plugins/element/scrollTargets/index.ts +2 -2
  495. package/src/plugins/element/scrollTargets/withScrollTargets.ts +2 -2
  496. package/src/plugins/element/tables/TableCellElement.ts +3 -3
  497. package/src/plugins/element/tables/TableElement.ts +5 -5
  498. package/src/plugins/element/tables/TableElementSelection.ts +2 -2
  499. package/src/plugins/element/tables/TableHtmlDeserializer.ts +4 -4
  500. package/src/plugins/element/tables/TableModifications.ts +4 -4
  501. package/src/plugins/element/tables/TableRowElement.ts +4 -4
  502. package/src/plugins/element/tables/gaugeTableColumnCount.ts +2 -2
  503. package/src/plugins/element/tables/index.ts +5 -5
  504. package/src/plugins/element/tables/withTables.ts +8 -8
  505. package/src/plugins/index.ts +4 -4
  506. package/src/plugins/text/bold/boldMark.ts +1 -1
  507. package/src/plugins/text/bold/index.ts +2 -2
  508. package/src/plugins/text/bold/withBold.ts +3 -3
  509. package/src/plugins/text/code/codeMark.ts +1 -1
  510. package/src/plugins/text/code/index.ts +2 -2
  511. package/src/plugins/text/code/withCode.ts +2 -2
  512. package/src/plugins/text/highlight/highlightMark.ts +1 -1
  513. package/src/plugins/text/highlight/index.ts +2 -2
  514. package/src/plugins/text/highlight/withHighlight.ts +2 -2
  515. package/src/plugins/text/index.ts +7 -7
  516. package/src/plugins/text/italic/index.ts +2 -2
  517. package/src/plugins/text/italic/italicMark.ts +1 -1
  518. package/src/plugins/text/italic/withItalic.ts +3 -3
  519. package/src/plugins/text/newline/index.ts +1 -1
  520. package/src/plugins/text/newline/withNewline.ts +1 -1
  521. package/src/plugins/text/strikeThrough/index.ts +2 -2
  522. package/src/plugins/text/strikeThrough/strikeThroughMark.ts +1 -1
  523. package/src/plugins/text/strikeThrough/withStrikeThrough.ts +3 -3
  524. package/src/plugins/text/underline/index.ts +2 -2
  525. package/src/plugins/text/underline/underlineMark.ts +1 -1
  526. package/src/plugins/text/underline/withUnderline.ts +3 -3
  527. package/src/slate-types.ts +1 -1
  528. package/src/types/editor.ts +2 -2
  529. package/src/types/htmlDeserializer.ts +1 -1
  530. package/src/types/index.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"TableModifications.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableModifications.ts"],"sourcesContent":["import { Editor, NodeEntry, Transforms } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { getTableElementColumnCount, getTableElementRowCount, TableElement } from './TableElement'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement'\nimport { ContemberEditor } from '../../../editor'\nimport { createEmptyTableCellElement, isTableCellElement, TableCellElement, tableCellElementType } from './TableCellElement'\n\nexport class TableModifications {\n\tpublic static deleteTableColumn(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst rowCount = element.children.length\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: [...tablePath, rowIndex, index],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static addTableRow(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowIndex = index ?? element.children.length\n\n\t\tlet tableRow: TableRowElement\n\t\tif (element.children.length === 0) {\n\t\t\ttableRow = createEmptyTableRowElement(columnCount)\n\t\t} else {\n\t\t\tconst blueprintRow = element.children[rowIndex === 0 ? 0 : rowIndex - 1] as TableRowElement\n\n\t\t\ttableRow = {\n\t\t\t\t...ContemberEditor.elementToSpecifics(blueprintRow),\n\t\t\t\ttype: tableRowElementType,\n\t\t\t\tchildren: Array.from(\n\t\t\t\t\t{ length: columnCount },\n\t\t\t\t\t(_, columnIndex): TableCellElement => copyTableCell(blueprintRow.children[columnIndex] as TableCellElement),\n\t\t\t\t),\n\t\t\t}\n\n\t\t\tif (rowIndex === 0) {\n\t\t\t\tconst firstRow = element.children[0] as TableRowElement\n\t\t\t\tif (firstRow.headerScope) {\n\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, 0] })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTransforms.insertNodes(editor, tableRow, {\n\t\t\tat: [...tablePath, rowIndex],\n\t\t})\n\t}\n\n\tpublic static addTableColumn(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowCount = getTableElementRowCount(element)\n\t\tconst columnIndex = index ?? columnCount ?? 0\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tconst tableRow = element.children[rowIndex] as TableRowElement\n\n\t\t\t\tlet tableCell: TableCellElement\n\t\t\t\tif (tableRow.children.length === 0) {\n\t\t\t\t\ttableCell = createEmptyTableCellElement()\n\t\t\t\t} else {\n\t\t\t\t\ttableCell = copyTableCell(tableRow.children[columnIndex === 0 ? 0 : columnIndex - 1] as TableCellElement)\n\n\t\t\t\t\tif (columnIndex === 0) {\n\t\t\t\t\t\tconst firstCell = tableRow.children[0] as TableCellElement\n\t\t\t\t\t\tif (firstCell.headerScope) {\n\t\t\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, rowIndex, 0] })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tTransforms.insertNodes(editor, tableCell, {\n\t\t\t\t\tat: [...tablePath, rowIndex, columnIndex],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static justifyTableColumn(editor: Editor, element: TableElement, columnIndex: number, direction: TableCellElement['justify']) {\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ justify: direction ?? undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static toggleTableRowHeaderScope(editor: Editor, element: TableElement, rowIndex: number, scope: TableRowElement['headerScope']) {\n\t\tconst rowCount = element.children.length\n\t\tif (rowIndex !== 0 || rowCount < 1) {\n\t\t\treturn\n\t\t}\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst firstRow = element.children[0] as TableRowElement\n\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ headerScope: firstRow.headerScope === scope ? undefined : scope },\n\t\t\t{ match: node => isTableRowElement(node), at: [...tablePath, 0] },\n\t\t)\n\t}\n\n\tpublic static toggleTableColumnHeaderScope(editor: Editor, element: TableElement, columnIndex: number, scope: TableCellElement['headerScope']) {\n\t\tlet currentStatusScore = 0\n\t\tconst rowCount = element.children.length\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([cell]) => {\n\t\t\tcurrentStatusScore += cell.headerScope === scope ? 1 : -1\n\t\t})\n\n\t\t// If none have it or the majority does but not all.\n\t\tconst shouldSetScope = -currentStatusScore === rowCount || (currentStatusScore > 0 && currentStatusScore !== rowCount)\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ headerScope: shouldSetScope ? scope : undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static deleteTableRow(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tTransforms.removeNodes(editor, {\n\t\t\tat: [...tablePath, index],\n\t\t})\n\t}\n}\n\nconst forEachCellInColumn = (\n\teditor: Editor,\n\telement: TableElement,\n\tcolumnIndex: number,\n\tcallback: (cellEntry: NodeEntry<TableCellElement>) => void,\n) => {\n\tconst tablePath = ReactEditor.findPath(editor, element)\n\tconst rowCount = getTableElementRowCount(element)\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\tcallback(Editor.node(editor, [...tablePath, rowIndex, columnIndex]) as NodeEntry<TableCellElement>)\n\t\t}\n\t})\n}\nconst copyTableCell = (tableCellElement: TableCellElement): TableCellElement => ({\n\t...ContemberEditor.elementToSpecifics(tableCellElement),\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n"],"names":["index","ReactEditor","Editor","Transforms","getTableElementColumnCount","createEmptyTableRowElement","ContemberEditor","tableRowElementType","getTableElementRowCount","createEmptyTableCellElement","isTableCellElement","isTableRowElement","tableCellElementType"],"mappings":";;;;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,OAAc,kBAAkB,QAAgB,SAAuBA,QAAe;AACrF,UAAM,YAAYC,WAAAA,YAAY,SAAS,QAAQ,OAAO;AACtD,UAAM,WAAW,QAAQ,SAAS;AAElCC,iBAAO,mBAAmB,QAAQ,MAAM;AACvC,eAAS,WAAW,GAAG,WAAW,UAAU,YAAY;AACvDC,cAAAA,WAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI,CAAC,GAAG,WAAW,UAAUH,MAAK;AAAA,QAAA,CAClC;AAAA,MACF;AAAA,IACD,CAAC;AAAA,EACF;AAAA,EAEA,OAAc,YAAY,QAAgB,SAAuBA,SAAgB;AAChF,UAAM,YAAYC,WAAAA,YAAY,SAAS,QAAQ,OAAO;AACtD,UAAM,cAAcG,aAAAA,2BAA2B,OAAO;AACtD,UAAM,WAAWJ,WAAS,QAAQ,SAAS;AAE3C,QAAI;AACJ,QAAI,QAAQ,SAAS,WAAW,GAAG;AAClC,iBAAWK,gBAAAA,2BAA2B,WAAW;AAAA,IAClD,OAAO;AACN,YAAM,eAAe,QAAQ,SAAS,aAAa,IAAI,IAAI,WAAW,CAAC;AAEvE,iBAAW;AAAA,QACV,GAAGC,MAAAA,gBAAgB,mBAAmB,YAAY;AAAA,QAClD,MAAMC,gBAAAA;AAAAA,QACN,UAAU,MAAM;AAAA,UACf,EAAE,QAAQ,YAAA;AAAA,UACV,CAAC,GAAG,gBAAkC,cAAc,aAAa,SAAS,WAAW,CAAqB;AAAA,QAAA;AAAA,MAC3G;AAGD,UAAI,aAAa,GAAG;AACnB,cAAM,WAAW,QAAQ,SAAS,CAAC;AACnC,YAAI,SAAS,aAAa;AACzBJ,gBAAAA,WAAW,SAAS,QAAQ,EAAE,aAAa,KAAA,GAAQ,EAAE,IAAI,CAAC,GAAG,WAA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AAC,GAAG,WAAWH,MAAK;AAAA,IAAA,CACxB;AAAA,EACF;AACD;AAEA,MAAM,sBAAsB,CAC3B,QACA,SACA,aACA,aACI;AACJ,QAAM,YAAYC,WAAAA,YAAY,SAAS,QAAQ,OAAO;AACtD,QAAM,WAAWO,aAAAA,wBAAwB,OAAO;AAEhDN,eAAO,mBAAmB,QAAQ,MAAM;AACvC,aAAS,WAAW,GAAG,WAAW,UAAU,YAAY;AACvD,eAASA,MAAAA,OAAO,KAAK,QAAQ,CAAC,GAAG,WAAW,UAAU,WAAW,CAAC,CAAgC;AAAA,IACnG;AAAA,EACD,CAAC;AACF;AACA,MAAM,gBAAgB,CAAC,sBAA0D;AAAA,EAChF,GAAGI,MAAAA,gBAAgB,mBAAmB,gBAAgB;AAAA,EACtD,MAAMM,iBAAAA;AAAAA,EACN,UAAU,CAAC,EAAE,MAAM,IAAI;AACxB;;"}
1
+ {"version":3,"file":"TableModifications.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableModifications.ts"],"sourcesContent":["import { Editor, NodeEntry, Transforms } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { getTableElementColumnCount, getTableElementRowCount, TableElement } from './TableElement.js'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement.js'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { createEmptyTableCellElement, isTableCellElement, TableCellElement, tableCellElementType } from './TableCellElement.js'\n\nexport class TableModifications {\n\tpublic static deleteTableColumn(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst rowCount = element.children.length\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: [...tablePath, rowIndex, index],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static addTableRow(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowIndex = index ?? element.children.length\n\n\t\tlet tableRow: TableRowElement\n\t\tif (element.children.length === 0) {\n\t\t\ttableRow = createEmptyTableRowElement(columnCount)\n\t\t} else {\n\t\t\tconst blueprintRow = element.children[rowIndex === 0 ? 0 : rowIndex - 1] as TableRowElement\n\n\t\t\ttableRow = {\n\t\t\t\t...ContemberEditor.elementToSpecifics(blueprintRow),\n\t\t\t\ttype: tableRowElementType,\n\t\t\t\tchildren: Array.from(\n\t\t\t\t\t{ length: columnCount },\n\t\t\t\t\t(_, columnIndex): TableCellElement => copyTableCell(blueprintRow.children[columnIndex] as TableCellElement),\n\t\t\t\t),\n\t\t\t}\n\n\t\t\tif (rowIndex === 0) {\n\t\t\t\tconst firstRow = element.children[0] as TableRowElement\n\t\t\t\tif (firstRow.headerScope) {\n\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, 0] })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTransforms.insertNodes(editor, tableRow, {\n\t\t\tat: [...tablePath, rowIndex],\n\t\t})\n\t}\n\n\tpublic static addTableColumn(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowCount = getTableElementRowCount(element)\n\t\tconst columnIndex = index ?? columnCount ?? 0\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tconst tableRow = element.children[rowIndex] as TableRowElement\n\n\t\t\t\tlet tableCell: TableCellElement\n\t\t\t\tif (tableRow.children.length === 0) {\n\t\t\t\t\ttableCell = createEmptyTableCellElement()\n\t\t\t\t} else {\n\t\t\t\t\ttableCell = copyTableCell(tableRow.children[columnIndex === 0 ? 0 : columnIndex - 1] as TableCellElement)\n\n\t\t\t\t\tif (columnIndex === 0) {\n\t\t\t\t\t\tconst firstCell = tableRow.children[0] as TableCellElement\n\t\t\t\t\t\tif (firstCell.headerScope) {\n\t\t\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, rowIndex, 0] })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tTransforms.insertNodes(editor, tableCell, {\n\t\t\t\t\tat: [...tablePath, rowIndex, columnIndex],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static justifyTableColumn(editor: Editor, element: TableElement, columnIndex: number, direction: TableCellElement['justify']) {\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ justify: direction ?? undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static toggleTableRowHeaderScope(editor: Editor, element: TableElement, rowIndex: number, scope: TableRowElement['headerScope']) {\n\t\tconst rowCount = element.children.length\n\t\tif (rowIndex !== 0 || rowCount < 1) {\n\t\t\treturn\n\t\t}\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst firstRow = element.children[0] as TableRowElement\n\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ headerScope: firstRow.headerScope === scope ? undefined : scope },\n\t\t\t{ match: node => isTableRowElement(node), at: [...tablePath, 0] },\n\t\t)\n\t}\n\n\tpublic static toggleTableColumnHeaderScope(editor: Editor, element: TableElement, columnIndex: number, scope: TableCellElement['headerScope']) {\n\t\tlet currentStatusScore = 0\n\t\tconst rowCount = element.children.length\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([cell]) => {\n\t\t\tcurrentStatusScore += cell.headerScope === scope ? 1 : -1\n\t\t})\n\n\t\t// If none have it or the majority does but not all.\n\t\tconst shouldSetScope = -currentStatusScore === rowCount || (currentStatusScore > 0 && currentStatusScore !== rowCount)\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ headerScope: shouldSetScope ? scope : undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static deleteTableRow(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tTransforms.removeNodes(editor, {\n\t\t\tat: [...tablePath, index],\n\t\t})\n\t}\n}\n\nconst forEachCellInColumn = (\n\teditor: Editor,\n\telement: TableElement,\n\tcolumnIndex: number,\n\tcallback: (cellEntry: NodeEntry<TableCellElement>) => void,\n) => {\n\tconst tablePath = ReactEditor.findPath(editor, element)\n\tconst rowCount = getTableElementRowCount(element)\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\tcallback(Editor.node(editor, [...tablePath, rowIndex, columnIndex]) as NodeEntry<TableCellElement>)\n\t\t}\n\t})\n}\nconst copyTableCell = (tableCellElement: TableCellElement): TableCellElement => ({\n\t...ContemberEditor.elementToSpecifics(tableCellElement),\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n"],"names":["index","ReactEditor","Editor","Transforms","getTableElementColumnCount","createEmptyTableRowElement","ContemberEditor","tableRowElementType","getTableElementRowCount","createEmptyTableCellElement","isTableCellElement","isTableRowElement","tableCellElementType"],"mappings":";;;;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,OAAc,kBAAkB,QAAgB,SAAuBA,QAAe;AACrF,UAAM,YAAYC,WAAAA,YAAY,SAAS,QAAQ,OAAO;AACtD,UAAM,WAAW,QAAQ,SAAS;AAElCC,iBAAO,mBAAmB,QAAQ,MAAM;AACvC,eAAS,WAAW,GAAG,WAAW,UAAU,YAAY;AACvDC,cAAAA,WAAW,YAAY,QAAQ;AAAA,UAC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AC;AACF;AACA,MAAM,gBAAgB,CAAC,sBAA0D;AAAA,EAChF,GAAGI,MAAAA,gBAAgB,mBAAmB,gBAAgB;AAAA,EACtD,MAAMM,iBAAAA;AAAAA,EACN,UAAU,CAAC,EAAE,MAAM,IAAI;AACxB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableModifications.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableModifications.ts"],"sourcesContent":["import { Editor, NodeEntry, Transforms } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { getTableElementColumnCount, getTableElementRowCount, TableElement } from './TableElement'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement'\nimport { ContemberEditor } from '../../../editor'\nimport { createEmptyTableCellElement, isTableCellElement, TableCellElement, tableCellElementType } from './TableCellElement'\n\nexport class TableModifications {\n\tpublic static deleteTableColumn(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst rowCount = element.children.length\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: [...tablePath, rowIndex, index],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static addTableRow(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowIndex = index ?? element.children.length\n\n\t\tlet tableRow: TableRowElement\n\t\tif (element.children.length === 0) {\n\t\t\ttableRow = createEmptyTableRowElement(columnCount)\n\t\t} else {\n\t\t\tconst blueprintRow = element.children[rowIndex === 0 ? 0 : rowIndex - 1] as TableRowElement\n\n\t\t\ttableRow = {\n\t\t\t\t...ContemberEditor.elementToSpecifics(blueprintRow),\n\t\t\t\ttype: tableRowElementType,\n\t\t\t\tchildren: Array.from(\n\t\t\t\t\t{ length: columnCount },\n\t\t\t\t\t(_, columnIndex): TableCellElement => copyTableCell(blueprintRow.children[columnIndex] as TableCellElement),\n\t\t\t\t),\n\t\t\t}\n\n\t\t\tif (rowIndex === 0) {\n\t\t\t\tconst firstRow = element.children[0] as TableRowElement\n\t\t\t\tif (firstRow.headerScope) {\n\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, 0] })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTransforms.insertNodes(editor, tableRow, {\n\t\t\tat: [...tablePath, rowIndex],\n\t\t})\n\t}\n\n\tpublic static addTableColumn(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowCount = getTableElementRowCount(element)\n\t\tconst columnIndex = index ?? columnCount ?? 0\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tconst tableRow = element.children[rowIndex] as TableRowElement\n\n\t\t\t\tlet tableCell: TableCellElement\n\t\t\t\tif (tableRow.children.length === 0) {\n\t\t\t\t\ttableCell = createEmptyTableCellElement()\n\t\t\t\t} else {\n\t\t\t\t\ttableCell = copyTableCell(tableRow.children[columnIndex === 0 ? 0 : columnIndex - 1] as TableCellElement)\n\n\t\t\t\t\tif (columnIndex === 0) {\n\t\t\t\t\t\tconst firstCell = tableRow.children[0] as TableCellElement\n\t\t\t\t\t\tif (firstCell.headerScope) {\n\t\t\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, rowIndex, 0] })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tTransforms.insertNodes(editor, tableCell, {\n\t\t\t\t\tat: [...tablePath, rowIndex, columnIndex],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static justifyTableColumn(editor: Editor, element: TableElement, columnIndex: number, direction: TableCellElement['justify']) {\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ justify: direction ?? undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static toggleTableRowHeaderScope(editor: Editor, element: TableElement, rowIndex: number, scope: TableRowElement['headerScope']) {\n\t\tconst rowCount = element.children.length\n\t\tif (rowIndex !== 0 || rowCount < 1) {\n\t\t\treturn\n\t\t}\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst firstRow = element.children[0] as TableRowElement\n\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ headerScope: firstRow.headerScope === scope ? undefined : scope },\n\t\t\t{ match: node => isTableRowElement(node), at: [...tablePath, 0] },\n\t\t)\n\t}\n\n\tpublic static toggleTableColumnHeaderScope(editor: Editor, element: TableElement, columnIndex: number, scope: TableCellElement['headerScope']) {\n\t\tlet currentStatusScore = 0\n\t\tconst rowCount = element.children.length\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([cell]) => {\n\t\t\tcurrentStatusScore += cell.headerScope === scope ? 1 : -1\n\t\t})\n\n\t\t// If none have it or the majority does but not all.\n\t\tconst shouldSetScope = -currentStatusScore === rowCount || (currentStatusScore > 0 && currentStatusScore !== rowCount)\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ headerScope: shouldSetScope ? scope : undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static deleteTableRow(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tTransforms.removeNodes(editor, {\n\t\t\tat: [...tablePath, index],\n\t\t})\n\t}\n}\n\nconst forEachCellInColumn = (\n\teditor: Editor,\n\telement: TableElement,\n\tcolumnIndex: number,\n\tcallback: (cellEntry: NodeEntry<TableCellElement>) => void,\n) => {\n\tconst tablePath = ReactEditor.findPath(editor, element)\n\tconst rowCount = getTableElementRowCount(element)\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\tcallback(Editor.node(editor, [...tablePath, rowIndex, columnIndex]) as NodeEntry<TableCellElement>)\n\t\t}\n\t})\n}\nconst copyTableCell = (tableCellElement: TableCellElement): TableCellElement => ({\n\t...ContemberEditor.elementToSpecifics(tableCellElement),\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,OAAc,kBAAkB,QAAgB,SAAuB,OAAe;AACrF,UAAM,YAAY,YAAY,SAAS,QAAQ,OAAO;AACtD,UAAM,WAAW,QAAQ,SAAS;AAElC,WAAO,mBAAmB,QAAQ,MAAM;AACvC,eAAS,WAAW,GAAG,WAAW,UAAU,YAAY;AACvD,mBAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI,CAAC,GAAG,WAAW,UAAU,KAAK;AAAA,QAAA,CAClC;AAAA,MACF;AAAA,IACD,CAAC;AAAA,EACF;AAAA,EAEA,OAAc,YAAY,QAAgB,SAAuB,OAAgB;AAChF,UAAM,YAAY,YAAY,SAAS,QAAQ,OAAO;AACtD,UAAM,cAAc,2BAA2B,OAAO;AACtD,UAAM,WAAW,SAAS,QAAQ,SAAS;AAE3C,QAAI;AACJ,QAAI,QAAQ,SAAS,WAAW,GAAG;AAClC,iBAAW,2BAA2B,WAAW;AAAA,IAClD,OAAO;AACN,YAAM,eAAe,QAAQ,SAAS,aAAa,IAAI,IAAI,WAAW,CAAC;AAEvE,iBAAW;AAAA,QACV,GAAG,gBAAgB,mBAAmB,YAAY;AAAA,QAClD,MAAM;AAAA,QACN,UAAU,MAAM;AAAA,UACf,EAAE,QAAQ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AA,EACF;AAAA,EAEA,OAAc,eAAe,QAAgB,SAAuB,OAAe;AAClF,UAAM,YAAY,YAAY,SAAS,QAAQ,OAAO;AACtD,eAAW,YAAY,QAAQ;AAAA,MAC9B,IAAI,CAAC,GAAG,WAAW,KAAK;AAAA,IAAA,CACxB;AAAA,EACF;AACD;AAEA,MAAM,sBAAsB,CAC3B,QACA,SACA,aACA,aACI;AACJ,QAAM,YAAY,YAAY,SAAS,QAAQ,OAAO;AACtD,QAAM,WAAW,wBAAwB,OAAO;AAEhD,SAAO,mBAAmB,QAAQ,MAAM;AACvC,aAAS,WAAW,GAAG,WAAW,UAAU,YAAY;AACvD,eAAS,OAAO,KAAK,QAAQ,CAAC,GAAG,WAAW,UAAU,WAAW,CAAC,CAAgC;AAAA,IACnG;AAAA,EACD,CAAC;AACF;AACA,MAAM,gBAAgB,CAAC,sBAA0D;AAAA,EAChF,GAAG,gBAAgB,mBAAmB,gBAAgB;AAAA,EACtD,MAAM;AAAA,EACN,UAAU,CAAC,EAAE,MAAM,IAAI;AACxB;"}
1
+ {"version":3,"file":"TableModifications.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableModifications.ts"],"sourcesContent":["import { Editor, NodeEntry, Transforms } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { getTableElementColumnCount, getTableElementRowCount, TableElement } from './TableElement.js'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement.js'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { createEmptyTableCellElement, isTableCellElement, TableCellElement, tableCellElementType } from './TableCellElement.js'\n\nexport class TableModifications {\n\tpublic static deleteTableColumn(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst rowCount = element.children.length\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: [...tablePath, rowIndex, index],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static addTableRow(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowIndex = index ?? element.children.length\n\n\t\tlet tableRow: TableRowElement\n\t\tif (element.children.length === 0) {\n\t\t\ttableRow = createEmptyTableRowElement(columnCount)\n\t\t} else {\n\t\t\tconst blueprintRow = element.children[rowIndex === 0 ? 0 : rowIndex - 1] as TableRowElement\n\n\t\t\ttableRow = {\n\t\t\t\t...ContemberEditor.elementToSpecifics(blueprintRow),\n\t\t\t\ttype: tableRowElementType,\n\t\t\t\tchildren: Array.from(\n\t\t\t\t\t{ length: columnCount },\n\t\t\t\t\t(_, columnIndex): TableCellElement => copyTableCell(blueprintRow.children[columnIndex] as TableCellElement),\n\t\t\t\t),\n\t\t\t}\n\n\t\t\tif (rowIndex === 0) {\n\t\t\t\tconst firstRow = element.children[0] as TableRowElement\n\t\t\t\tif (firstRow.headerScope) {\n\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, 0] })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTransforms.insertNodes(editor, tableRow, {\n\t\t\tat: [...tablePath, rowIndex],\n\t\t})\n\t}\n\n\tpublic static addTableColumn(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowCount = getTableElementRowCount(element)\n\t\tconst columnIndex = index ?? columnCount ?? 0\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tconst tableRow = element.children[rowIndex] as TableRowElement\n\n\t\t\t\tlet tableCell: TableCellElement\n\t\t\t\tif (tableRow.children.length === 0) {\n\t\t\t\t\ttableCell = createEmptyTableCellElement()\n\t\t\t\t} else {\n\t\t\t\t\ttableCell = copyTableCell(tableRow.children[columnIndex === 0 ? 0 : columnIndex - 1] as TableCellElement)\n\n\t\t\t\t\tif (columnIndex === 0) {\n\t\t\t\t\t\tconst firstCell = tableRow.children[0] as TableCellElement\n\t\t\t\t\t\tif (firstCell.headerScope) {\n\t\t\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, rowIndex, 0] })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tTransforms.insertNodes(editor, tableCell, {\n\t\t\t\t\tat: [...tablePath, rowIndex, columnIndex],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static justifyTableColumn(editor: Editor, element: TableElement, columnIndex: number, direction: TableCellElement['justify']) {\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ justify: direction ?? undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static toggleTableRowHeaderScope(editor: Editor, element: TableElement, rowIndex: number, scope: TableRowElement['headerScope']) {\n\t\tconst rowCount = element.children.length\n\t\tif (rowIndex !== 0 || rowCount < 1) {\n\t\t\treturn\n\t\t}\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst firstRow = element.children[0] as TableRowElement\n\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ headerScope: firstRow.headerScope === scope ? undefined : scope },\n\t\t\t{ match: node => isTableRowElement(node), at: [...tablePath, 0] },\n\t\t)\n\t}\n\n\tpublic static toggleTableColumnHeaderScope(editor: Editor, element: TableElement, columnIndex: number, scope: TableCellElement['headerScope']) {\n\t\tlet currentStatusScore = 0\n\t\tconst rowCount = element.children.length\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([cell]) => {\n\t\t\tcurrentStatusScore += cell.headerScope === scope ? 1 : -1\n\t\t})\n\n\t\t// If none have it or the majority does but not all.\n\t\tconst shouldSetScope = -currentStatusScore === rowCount || (currentStatusScore > 0 && currentStatusScore !== rowCount)\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ headerScope: shouldSetScope ? scope : undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static deleteTableRow(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tTransforms.removeNodes(editor, {\n\t\t\tat: [...tablePath, index],\n\t\t})\n\t}\n}\n\nconst forEachCellInColumn = (\n\teditor: Editor,\n\telement: TableElement,\n\tcolumnIndex: number,\n\tcallback: (cellEntry: NodeEntry<TableCellElement>) => void,\n) => {\n\tconst tablePath = ReactEditor.findPath(editor, element)\n\tconst rowCount = getTableElementRowCount(element)\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\tcallback(Editor.node(editor, [...tablePath, rowIndex, columnIndex]) as NodeEntry<TableCellElement>)\n\t\t}\n\t})\n}\nconst copyTableCell = (tableCellElement: TableCellElement): TableCellElement => ({\n\t...ContemberEditor.elementToSpecifics(tableCellElement),\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,mBAAmB;AAAA,EAC/B,OAAc,kBAAkB,QAAgB,SAAuB,OAAe;AACrF,UAAM,YAAY,YAAY,SAAS,QAAQ,OAAO;AACtD,UAAM,WAAW,QAAQ,SAAS;AAElC,WAAO,mBAAmB,QAAQ,MAAM;AACvC,eAAS,WAAW,GAAG,WAAW,UAAU,YAAY;AACvD,mBAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI,CAAC,GAAG,WAAW,UAAU,KAAK;AAAA,QAAA,C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C;AAC9I,QAAI,qBAAqB;AACzB,UAAM,WAAW,QAAQ,SAAS;AAElC,wBAAoB,QAAQ,SAAS,aAAa,CAAC,CAAC,IAAI,MAAM;AAC7D,4BAAsB,KAAK,gBAAgB,QAAQ,IAAI;AAAA,IACxD,CAAC;AAGD,UAAM,iBAAiB,CAAC,uBAAuB,YAAa,qBAAqB,KAAK,uBAAuB;AAE7G,wBAAoB,QAAQ,SAAS,aAAa,CAAC,CAAA,EAAG,QAAQ,MAAM;AACnE,iBAAW;AAAA,QACV;AAAA,QACA,EAAE,aAAa,iBAAiB,QAAQ,OAAA;AAAA,QACxC,EAAE,OAAO,CAAA,SAAQ,mBAAmB,IAAI,GAAG,IAAI,SAAA;AAAA,MAAS;AAAA,IAE1D,CAAC;AAAA,EACF;AAAA,EAEA,OAAc,eAAe,QAAgB,SAAuB,OAAe;AAClF,UAAM,YAAY,YAAY,SAAS,QAAQ,OAAO;AACtD,eAAW,YAAY,QAAQ;AAAA,MAC9B,IAAI,CAAC,GAAG,WAAW,KAAK;AAAA,IAAA,CACxB;AAAA,EACF;AACD;AAEA,MAAM,sBAAsB,CAC3B,QACA,SACA,aACA,aACI;AACJ,QAAM,YAAY,YAAY,SAAS,QAAQ,OAAO;AACtD,QAAM,WAAW,wBAAwB,OAAO;AAEhD,SAAO,mBAAmB,QAAQ,MAAM;AACvC,aAAS,WAAW,GAAG,WAAW,UAAU,YAAY;AACvD,eAAS,OAAO,KAAK,QAAQ,CAAC,GAAG,WAAW,UAAU,WAAW,CAAC,CAAgC;AAAA,IACnG;AAAA,EACD,CAAC;AACF;AACA,MAAM,gBAAgB,CAAC,sBAA0D;AAAA,EAChF,GAAG,gBAAgB,mBAAmB,gBAAgB;AAAA,EACtD,MAAM;AAAA,EACN,UAAU,CAAC,EAAE,MAAM,IAAI;AACxB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableRowElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableRowElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element, Element as SlateElement, Node, Node as SlateNode, Transforms } from 'slate'\nimport { createEmptyTableCellElement, isTableCellElement, tableCellElementType } from './TableCellElement'\nimport { ContemberEditor } from '../../../editor'\nimport { tableElementType } from './TableElement'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const tableRowElementType = 'tableRow' as const\n\nexport interface TableRowElement extends SlateElement {\n\ttype: typeof tableRowElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'table'\n}\n\nexport const isTableRowElement = (element: Node): element is TableRowElement => Element.isElement(element) && element.type === tableRowElementType\n\nexport const createEmptyTableRowElement = (columnCount = 2) => ({\n\ttype: tableRowElementType,\n\tchildren: Array.from({ length: columnCount }, () => createEmptyTableCellElement()),\n})\n\nexport const tableRowElementPlugin = ({ render }: { render: ElementRenderer<TableRowElement> }): EditorElementPlugin<TableRowElement> => ({\n\ttype: tableRowElementType,\n\trender,\n\tnormalizeNode: ({ editor, path, element, preventDefault }) => {\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableCellElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableCellElementType }, { at: childPath })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\t\treturn preventDefault()\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableElementType)) {\n\t\t\tTransforms.unwrapNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t\tif (path[path.length - 1] > 0 && element.headerScope) {\n\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n})\n"],"names":["Element","createEmptyTableCellElement","SlateNode","SlateElement","isTableCellElement","ContemberEditor","Transforms","tableCell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src/plugins/element/tables/TableRowElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element, Element as SlateElement, Node, Node as SlateNode, Transforms } from 'slate'\nimport { createEmptyTableCellElement, isTableCellElement, tableCellElementType } from './TableCellElement.js'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { tableElementType } from './TableElement.js'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const tableRowElementType = 'tableRow' as const\n\nexport interface TableRowElement extends SlateElement {\n\ttype: typeof tableRowElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'table'\n}\n\nexport const isTableRowElement = (element: Node): element is TableRowElement => Element.isElement(element) && element.type === tableRowElementType\n\nexport const createEmptyTableRowElement = (columnCount = 2) => ({\n\ttype: tableRowElementType,\n\tchildren: Array.from({ length: columnCount }, () => createEmptyTableCellElement()),\n})\n\nexport const tableRowElementPlugin = ({ render }: { render: ElementRenderer<TableRowElement> }): EditorElementPlugin<TableRowElement> => ({\n\ttype: tableRowElementType,\n\trender,\n\tnormalizeNode: ({ editor, path, element, preventDefault }) => {\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableCellElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableCellElementType }, { at: childPath })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\t\treturn preventDefault()\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableElementType)) {\n\t\t\tTransforms.unwrapNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t\tif (path[path.length - 1] > 0 && element.headerScope) {\n\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n})\n"],"names":["Element","createEmptyTableCellElement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
1
- {"version":3,"file":"TableRowElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableRowElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element, Element as SlateElement, Node, Node as SlateNode, Transforms } from 'slate'\nimport { createEmptyTableCellElement, isTableCellElement, tableCellElementType } from './TableCellElement'\nimport { ContemberEditor } from '../../../editor'\nimport { tableElementType } from './TableElement'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const tableRowElementType = 'tableRow' as const\n\nexport interface TableRowElement extends SlateElement {\n\ttype: typeof tableRowElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'table'\n}\n\nexport const isTableRowElement = (element: Node): element is TableRowElement => Element.isElement(element) && element.type === tableRowElementType\n\nexport const createEmptyTableRowElement = (columnCount = 2) => ({\n\ttype: tableRowElementType,\n\tchildren: Array.from({ length: columnCount }, () => createEmptyTableCellElement()),\n})\n\nexport const tableRowElementPlugin = ({ render }: { render: ElementRenderer<TableRowElement> }): EditorElementPlugin<TableRowElement> => ({\n\ttype: tableRowElementType,\n\trender,\n\tnormalizeNode: ({ editor, path, element, preventDefault }) => {\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableCellElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableCellElementType }, { at: childPath })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\t\treturn preventDefault()\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableElementType)) {\n\t\t\tTransforms.unwrapNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t\tif (path[path.length - 1] > 0 && element.headerScope) {\n\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n})\n"],"names":["SlateNode","SlateElement"],"mappings":";;;;AAMO,MAAM,sBAAsB;AAQ5B,MAAM,oBAAoB,CAAC,YAA8C,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAExH,MAAM,6BAA6B,CAAC,cAAc,OAAO;AAAA,EAC/D,MAAM;AAAA,EACN,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAA,GAAe,MAAM,4BAAA,CAA6B;AAClF;AAEO,MAAM,wBAAwB,CAAC,EAAE,cAAkG;AAAA,EACzI,MAAM;AAAA,EACN;AAAA,EACA,eAAe,CAAC,EAAE,QAAQ,MAAM,SAAS,qBAAqB;AAC7D,eAAW,CAAC,OAAO,SAAS,KAAKA,KAAU,SAAS,QAAQ,IAAI,GAAG;AAClE,UAAIC,QAAa,UAAU,KAAK,GAAG;AAClC,YAAI,CAAC,mBAAmB,KAAK,GAAG;AAC/B,0BAAgB,aAAa,QAAQ,SAAS;AAC9C,qBAAW,SAAS,QAAQ,EAAE,MAAM,wBAAwB,EAAE,IAAI,WAAW;AAAA,QAC9E;AAAA,MACD,OAAO;AACN,mBAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,eAAO,eAAA;AAAA,MACR;AAAA,IACD;AACA,QAAI,CAAC,gBAAgB,gBAAgB,QAAQ,CAAC,SAAS,IAAI,GAAG,gBAAgB,GAAG;AAChF,iBAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,aAAO,eAAA;AAAA,IACR;AACA,QAAI,KAAK,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,aAAa;AACrD,iBAAW,SAAS,QAAQ,EAAE,aAAa,QAAQ,EAAE,IAAI,MAAM;AAC/D,aAAO,eAAA;AAAA,IACR;AAAA,EACD;AAAA,EACA,qBAAqB;AACtB;"}
1
+ {"version":3,"file":"TableRowElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableRowElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element, Element as SlateElement, Node, Node as SlateNode, Transforms } from 'slate'\nimport { createEmptyTableCellElement, isTableCellElement, tableCellElementType } from './TableCellElement.js'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { tableElementType } from './TableElement.js'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const tableRowElementType = 'tableRow' as const\n\nexport interface TableRowElement extends SlateElement {\n\ttype: typeof tableRowElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'table'\n}\n\nexport const isTableRowElement = (element: Node): element is TableRowElement => Element.isElement(element) && element.type === tableRowElementType\n\nexport const createEmptyTableRowElement = (columnCount = 2) => ({\n\ttype: tableRowElementType,\n\tchildren: Array.from({ length: columnCount }, () => createEmptyTableCellElement()),\n})\n\nexport const tableRowElementPlugin = ({ render }: { render: ElementRenderer<TableRowElement> }): EditorElementPlugin<TableRowElement> => ({\n\ttype: tableRowElementType,\n\trender,\n\tnormalizeNode: ({ editor, path, element, preventDefault }) => {\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableCellElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableCellElementType }, { at: childPath })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\t\treturn preventDefault()\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableElementType)) {\n\t\t\tTransforms.unwrapNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t\tif (path[path.length - 1] > 0 && element.headerScope) {\n\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n})\n"],"names":["SlateNode","SlateElement"],"mappings":";;;;AAMO,MAAM,sBAAsB;AAQ5B,MAAM,oBAAoB,CAAC,YAA8C,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAExH,MAAM,6BAA6B,CAAC,cAAc,OAAO;AAAA,EAC/D,MAAM;AAAA,EACN,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAA,GAAe,MAAM,4BAAA,CAA6B;AAClF;AAEO,MAAM,wBAAwB,CAAC,EAAE,cAAkG;AAAA,EACzI,MAAM;AAAA,EACN;AAAA,EACA,eAAe,CAAC,EAAE,QAAQ,MAAM,SAAS,qBAAqB;AAC7D,eAAW,CAAC,OAAO,SAAS,KAAKA,KAAU,SAAS,QAAQ,IAAI,GAAG;AAClE,UAAIC,QAAa,UAAU,KAAK,GAAG;AAClC,YAAI,CAAC,mBAAmB,KAAK,GAAG;AAC/B,0BAAgB,aAAa,QAAQ,SAAS;AAC9C,qBAAW,SAAS,QAAQ,EAAE,MAAM,wBAAwB,EAAE,IAAI,WAAW;AAAA,QAC9E;AAAA,MACD,OAAO;AACN,mBAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,eAAO,eAAA;AAAA,MACR;AAAA,IACD;AACA,QAAI,CAAC,gBAAgB,gBAAgB,QAAQ,CAAC,SAAS,IAAI,GAAG,gBAAgB,GAAG;AAChF,iBAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,aAAO,eAAA;AAAA,IACR;AACA,QAAI,KAAK,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,aAAa;AACrD,iBAAW,SAAS,QAAQ,EAAE,aAAa,QAAQ,EAAE,IAAI,MAAM;AAC/D,aAAO,eAAA;AAAA,IACR;AAAA,EACD;AAAA,EACA,qBAAqB;AACtB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"gaugeTableColumnCount.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/gaugeTableColumnCount.ts"],"sourcesContent":["import type { TableElement } from './TableElement'\nimport type { TableRowElement } from './TableRowElement'\n\nexport const gaugeTableColumnCount = (table: TableElement): number => {\n\t// This whole function is obviously very heuristic. It's intended to be called during normalizations (i.e. often),\n\t// and so it aims to be reasonably fast. We want to use this return value to repair corrupted tables.\n\n\tif (table.children.length === 0) {\n\t\treturn 0\n\t}\n\n\tconst rowSampleStart = table.children[0] as TableRowElement\n\tconst rowSampleMiddle = table.children[Math.floor(table.children.length / 2)] as TableRowElement\n\tconst rowSampleEnd = table.children[table.children.length - 1] as TableRowElement\n\n\tconst columnSampleStart = rowSampleStart.children.length\n\tconst columnSampleMiddle = rowSampleMiddle.children.length\n\tconst columnSampleEnd = rowSampleEnd.children.length\n\n\t// Tables most often get corrupted either at the beginning or at the end. Thus we assume that out of these three\n\t// values, two will likely be the same.\n\tif (columnSampleStart === columnSampleEnd) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleStart === columnSampleMiddle) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleMiddle === columnSampleEnd) {\n\t\treturn columnSampleMiddle\n\t}\n\n\t// If we make it here, then all three are different and the table is completely broken. We could consult more rows\n\t// but really, odds are that it wouldn't really help.\n\treturn columnSampleStart\n}\n"],"names":[],"mappings":";;AAGO,MAAM,wBAAwB,CAAC,UAAgC;AAIrE,MAAI,MAAM,SAAS,WAAW,GAAG;AAChC,WAAO;AAAA,EACR;AAEA,QAAM,iBAAiB,MAAM,SAAS,CAAC;AACvC,QAAM,kBAAkB,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,SAAS,CAAC,CAAC;AAC5E,QAAM,eAAe,MAAM,SAAS,MAAM,SAAS,SAAS,CAAC;AAE7D,QAAM,oBAAoB,eAAe,SAAS;AAClD,QAAM,qBAAqB,gBAAgB,SAAS;AACpD,QAAM,kBAAkB,aAAa,SAAS;AAI9C,MAAI,sBAAsB,iBAAiB;AAC1C,WAAO;AAAA,EACR;AACA,MAAI,sBAAsB,oBAAoB;AAC7C,WAAO;AAAA,EACR;AACA,MAAI,uBAAuB,iBAAiB;AAC3C,WAAO;AAAA,EACR;AAIA,SAAO;AACR;;"}
1
+ {"version":3,"file":"gaugeTableColumnCount.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/gaugeTableColumnCount.ts"],"sourcesContent":["import type { TableElement } from './TableElement.js'\nimport type { TableRowElement } from './TableRowElement.js'\n\nexport const gaugeTableColumnCount = (table: TableElement): number => {\n\t// This whole function is obviously very heuristic. It's intended to be called during normalizations (i.e. often),\n\t// and so it aims to be reasonably fast. We want to use this return value to repair corrupted tables.\n\n\tif (table.children.length === 0) {\n\t\treturn 0\n\t}\n\n\tconst rowSampleStart = table.children[0] as TableRowElement\n\tconst rowSampleMiddle = table.children[Math.floor(table.children.length / 2)] as TableRowElement\n\tconst rowSampleEnd = table.children[table.children.length - 1] as TableRowElement\n\n\tconst columnSampleStart = rowSampleStart.children.length\n\tconst columnSampleMiddle = rowSampleMiddle.children.length\n\tconst columnSampleEnd = rowSampleEnd.children.length\n\n\t// Tables most often get corrupted either at the beginning or at the end. Thus we assume that out of these three\n\t// values, two will likely be the same.\n\tif (columnSampleStart === columnSampleEnd) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleStart === columnSampleMiddle) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleMiddle === columnSampleEnd) {\n\t\treturn columnSampleMiddle\n\t}\n\n\t// If we make it here, then all three are different and the table is completely broken. We could consult more rows\n\t// but really, odds are that it wouldn't really help.\n\treturn columnSampleStart\n}\n"],"names":[],"mappings":";;AAGO,MAAM,wBAAwB,CAAC,UAAgC;AAIrE,MAAI,MAAM,SAAS,WAAW,GAAG;AAChC,WAAO;AAAA,EACR;AAEA,QAAM,iBAAiB,MAAM,SAAS,CAAC;AACvC,QAAM,kBAAkB,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,SAAS,CAAC,CAAC;AAC5E,QAAM,eAAe,MAAM,SAAS,MAAM,SAAS,SAAS,CAAC;AAE7D,QAAM,oBAAoB,eAAe,SAAS;AAClD,QAAM,qBAAqB,gBAAgB,SAAS;AACpD,QAAM,kBAAkB,aAAa,SAAS;AAI9C,MAAI,sBAAsB,iBAAiB;AAC1C,WAAO;AAAA,EACR;AACA,MAAI,sBAAsB,oBAAoB;AAC7C,WAAO;AAAA,EACR;AACA,MAAI,uBAAuB,iBAAiB;AAC3C,WAAO;AAAA,EACR;AAIA,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"gaugeTableColumnCount.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/gaugeTableColumnCount.ts"],"sourcesContent":["import type { TableElement } from './TableElement'\nimport type { TableRowElement } from './TableRowElement'\n\nexport const gaugeTableColumnCount = (table: TableElement): number => {\n\t// This whole function is obviously very heuristic. It's intended to be called during normalizations (i.e. often),\n\t// and so it aims to be reasonably fast. We want to use this return value to repair corrupted tables.\n\n\tif (table.children.length === 0) {\n\t\treturn 0\n\t}\n\n\tconst rowSampleStart = table.children[0] as TableRowElement\n\tconst rowSampleMiddle = table.children[Math.floor(table.children.length / 2)] as TableRowElement\n\tconst rowSampleEnd = table.children[table.children.length - 1] as TableRowElement\n\n\tconst columnSampleStart = rowSampleStart.children.length\n\tconst columnSampleMiddle = rowSampleMiddle.children.length\n\tconst columnSampleEnd = rowSampleEnd.children.length\n\n\t// Tables most often get corrupted either at the beginning or at the end. Thus we assume that out of these three\n\t// values, two will likely be the same.\n\tif (columnSampleStart === columnSampleEnd) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleStart === columnSampleMiddle) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleMiddle === columnSampleEnd) {\n\t\treturn columnSampleMiddle\n\t}\n\n\t// If we make it here, then all three are different and the table is completely broken. We could consult more rows\n\t// but really, odds are that it wouldn't really help.\n\treturn columnSampleStart\n}\n"],"names":[],"mappings":"AAGO,MAAM,wBAAwB,CAAC,UAAgC;AAIrE,MAAI,MAAM,SAAS,WAAW,GAAG;AAChC,WAAO;AAAA,EACR;AAEA,QAAM,iBAAiB,MAAM,SAAS,CAAC;AACvC,QAAM,kBAAkB,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,SAAS,CAAC,CAAC;AAC5E,QAAM,eAAe,MAAM,SAAS,MAAM,SAAS,SAAS,CAAC;AAE7D,QAAM,oBAAoB,eAAe,SAAS;AAClD,QAAM,qBAAqB,gBAAgB,SAAS;AACpD,QAAM,kBAAkB,aAAa,SAAS;AAI9C,MAAI,sBAAsB,iBAAiB;AAC1C,WAAO;AAAA,EACR;AACA,MAAI,sBAAsB,oBAAoB;AAC7C,WAAO;AAAA,EACR;AACA,MAAI,uBAAuB,iBAAiB;AAC3C,WAAO;AAAA,EACR;AAIA,SAAO;AACR;"}
1
+ {"version":3,"file":"gaugeTableColumnCount.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/gaugeTableColumnCount.ts"],"sourcesContent":["import type { TableElement } from './TableElement.js'\nimport type { TableRowElement } from './TableRowElement.js'\n\nexport const gaugeTableColumnCount = (table: TableElement): number => {\n\t// This whole function is obviously very heuristic. It's intended to be called during normalizations (i.e. often),\n\t// and so it aims to be reasonably fast. We want to use this return value to repair corrupted tables.\n\n\tif (table.children.length === 0) {\n\t\treturn 0\n\t}\n\n\tconst rowSampleStart = table.children[0] as TableRowElement\n\tconst rowSampleMiddle = table.children[Math.floor(table.children.length / 2)] as TableRowElement\n\tconst rowSampleEnd = table.children[table.children.length - 1] as TableRowElement\n\n\tconst columnSampleStart = rowSampleStart.children.length\n\tconst columnSampleMiddle = rowSampleMiddle.children.length\n\tconst columnSampleEnd = rowSampleEnd.children.length\n\n\t// Tables most often get corrupted either at the beginning or at the end. Thus we assume that out of these three\n\t// values, two will likely be the same.\n\tif (columnSampleStart === columnSampleEnd) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleStart === columnSampleMiddle) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleMiddle === columnSampleEnd) {\n\t\treturn columnSampleMiddle\n\t}\n\n\t// If we make it here, then all three are different and the table is completely broken. We could consult more rows\n\t// but really, odds are that it wouldn't really help.\n\treturn columnSampleStart\n}\n"],"names":[],"mappings":"AAGO,MAAM,wBAAwB,CAAC,UAAgC;AAIrE,MAAI,MAAM,SAAS,WAAW,GAAG;AAChC,WAAO;AAAA,EACR;AAEA,QAAM,iBAAiB,MAAM,SAAS,CAAC;AACvC,QAAM,kBAAkB,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,SAAS,CAAC,CAAC;AAC5E,QAAM,eAAe,MAAM,SAAS,MAAM,SAAS,SAAS,CAAC;AAE7D,QAAM,oBAAoB,eAAe,SAAS;AAClD,QAAM,qBAAqB,gBAAgB,SAAS;AACpD,QAAM,kBAAkB,aAAa,SAAS;AAI9C,MAAI,sBAAsB,iBAAiB;AAC1C,WAAO;AAAA,EACR;AACA,MAAI,sBAAsB,oBAAoB;AAC7C,WAAO;AAAA,EACR;AACA,MAAI,uBAAuB,iBAAiB;AAC3C,WAAO;AAAA,EACR;AAIA,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withTables.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/withTables.ts"],"sourcesContent":["import { Editor, Element, Node as SlateNode, NodeEntry, Path as SlatePath, Point, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isTableCellElement, TableCellElement, tableCellElementPlugin } from './TableCellElement'\nimport { getTableElementColumnCount, getTableElementRowCount, isTableElement, TableElement, tableElementPlugin } from './TableElement'\nimport { getTableCellCoordinates, selectTableCellContents } from './TableElementSelection'\nimport { tableHTMLDeserializer } from './TableHtmlDeserializer'\nimport { TableModifications } from './TableModifications'\nimport { isTableRowElement, TableRowElement, tableRowElementPlugin } from './TableRowElement'\nimport { ElementRenderer } from '../../../types'\n\nexport const withTables = ({ renderTable, renderTableCell, renderTableRow }: {\n\trenderTable: ElementRenderer<TableElement>\n\trenderTableCell: ElementRenderer<TableCellElement>\n\trenderTableRow: ElementRenderer<TableRowElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tdeleteForward,\n\t\tdeleteBackward,\n\t\tdeleteFragment,\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(tableElementPlugin({ render: renderTable }))\n\teditor.registerElement(tableCellElementPlugin({ render: renderTableCell }))\n\teditor.registerElement(tableRowElementPlugin({ render: renderTableRow }))\n\n\teditor.htmlDeserializer.registerPlugin(tableHTMLDeserializer)\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst selection = editor.selection\n\t\t\t\tconst [, closestBlockPath] = closestBlockEntry\n\t\t\t\tconst [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath)\n\n\t\t\t\tif (!selection) {\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tanchor: cellStart,\n\t\t\t\t\t\t\tfocus: cellEnd,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmatch: node => Text.isText(node) || (Element.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t\tinsertBreak()\n\t\t},\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteBackward(unit)\n\t\t},\n\t\tdeleteForward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteForward(unit)\n\t\t},\n\t\tdeleteFragment: () => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (!selection || SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn deleteFragment()\n\t\t\t}\n\t\t\tconst lowestCommonAncestorPath = SlatePath.common(selection.anchor.path, selection.focus.path)\n\t\t\tconst [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath)\n\n\t\t\tif (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {\n\t\t\t\treturn // TODO nope for now\n\t\t\t}\n\t\t\tdeleteFragment()\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (\n\t\t\t\t!selection\n\t\t\t\t|| !(\n\t\t\t\t\tevent.key === 'Tab'\n\t\t\t\t\t|| event.key === 'ArrowUp'\n\t\t\t\t\t|| event.key === 'ArrowRight'\n\t\t\t\t\t|| event.key === 'ArrowDown'\n\t\t\t\t\t|| event.key === 'ArrowLeft'\n\t\t\t\t\t|| event.key === 'Enter'\n\t\t\t\t\t|| event.key === 'Backspace'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection })\n\n\t\t\tif (!closestBlockEntry) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet cellElement: TableCellElement\n\t\t\tlet cellPath: SlatePath\n\n\t\t\tif (!isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst parent = SlateNode.parent(editor, closestBlockEntry[1])\n\t\t\t\tif (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {\n\t\t\t\t\tcellElement = parent\n\t\t\t\t\tcellPath = SlatePath.parent(closestBlockEntry[1])\n\t\t\t\t} else {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;[cellElement, cellPath] = closestBlockEntry\n\t\t\t}\n\t\t\tif (cellPath.length < 3) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement)\n\t\t\tconst tablePath = cellPath.slice(0, -2)\n\t\t\tconst tableElement = SlateNode.get(editor, tablePath) as TableElement\n\t\t\tconst rowCount = getTableElementRowCount(tableElement)\n\t\t\tconst columnCount = getTableElementColumnCount(tableElement)\n\n\t\t\tif (rowCount === 0 || columnCount === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst moveSelectionBeforeTable = () => {\n\t\t\t\tconst pointBeforeTable = Editor.before(editor, tablePath)\n\t\t\t\tif (!pointBeforeTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointBeforeTable)\n\t\t\t}\n\t\t\tconst moveSelectionAfterTable = () => {\n\t\t\t\tconst pointAfterTable = Editor.after(editor, tablePath)\n\t\t\t\tif (!pointAfterTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointAfterTable)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t// Moving backwards\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1)\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Moving forwards\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1)\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\t// We're at the right edge of the table\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex + 1, 0)\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === 'ArrowLeft') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.start(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]))\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowRight') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.end(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]))\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]))\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\tconst withinDefault = editor.isDefaultElement(closestBlockEntry[0])\n\t\t\t\tif (withinDefault) {\n\t\t\t\t\tconst relative = SlatePath.relative(closestBlockEntry[1], cellPath)\n\t\t\t\t\tconst defaultIndex = relative[0]\n\t\t\t\t\tif (\n\t\t\t\t\t\t(event.key === 'ArrowUp' && defaultIndex !== 0)\n\t\t\t\t\t\t|| (event.key === 'ArrowDown' && defaultIndex !== cellElement.children.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAboveEndPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset)\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowAboveEndPoint.path,\n\t\t\t\t\t\t\toffset: minOffset,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStatPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint) as NodeEntry<Text>\n\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowBelowStatPoint.path,\n\t\t\t\t\t\t\toffset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t}\n\t\t\t} else if (event.ctrlKey || event.metaKey) {\n\t\t\t\tif (event.key === 'Backspace') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tTableModifications.deleteTableColumn(editor, tableElement, columnIndex)\n\n\t\t\t\t\t\tif (columnCount > 1) {\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTableModifications.deleteTableRow(editor, tableElement, rowIndex)\n\n\t\t\t\t\t\tif (rowCount > 1) {\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex)\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex + 1)\n\t\t\t\t\t\t\tconst columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnAfter)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex)\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex + 1)\n\t\t\t\t\t\t\tconst rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStat)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["tableElementPlugin","tableCellElementPlugin","tableRowElementPlugin","tableHTMLDeserializer","ContemberEditor","isTableCellElement","Editor","Transforms","Text","Element","SlatePath","SlateRange","Point","isTableElement","isTableRowElement","SlateNode","getTableCellCoordinates","getTableElementRowCount","getTableElementColumnCount","selectTableCellContents","TableModifications"],"mappings":";;;;;;;;;;AAUO,MAAM,aAAa,CAAC,EAAE,aAAa,iBAAiB,eAAA,MAK3D,CAAmB,WAAiB;AACnC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgBA,aAAAA,mBAAmB,EAAE,QAAQ,YAAA,CAAa,CAAC;AAClE,SAAO,gBAAgBC,iBAAAA,uBAAuB,EAAE,QAAQ,gBAAA,CAAiB,CAAC;AAC1E,SAAO,gBAAgBC,gBAAAA,sBAAsB,EAAE,QAAQ,eAAA,CAAgB,CAAC;AAExE,SAAO,iBAAiB,eAAeC,2CAAqB;AAE5D,SAAO,OAAgC,QAAQ;AAAA,IAC9C,aAAa,MAAM;AAClB,YAAM,oBAAoBC,MAAAA,gBAAgB,kBAAkB,MAAM;AAClE,UAAI,qBAAqBC,iBAAAA,mBAAmB,kBAAkB,CAAC,CAAC,GAAG;AAClE,cAAM,YAAY,OAAO;AACzB,cAAM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D;AAAA,QACD;AAAA,MACD;AACA,gBAAU,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAED,SAAO;AACR;;"}
1
+ {"version":3,"file":"withTables.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/withTables.ts"],"sourcesContent":["import { Editor, Element, Node as SlateNode, NodeEntry, Path as SlatePath, Point, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { isTableCellElement, TableCellElement, tableCellElementPlugin } from './TableCellElement.js'\nimport { getTableElementColumnCount, getTableElementRowCount, isTableElement, TableElement, tableElementPlugin } from './TableElement.js'\nimport { getTableCellCoordinates, selectTableCellContents } from './TableElementSelection.js'\nimport { tableHTMLDeserializer } from './TableHtmlDeserializer.js'\nimport { TableModifications } from './TableModifications.js'\nimport { isTableRowElement, TableRowElement, tableRowElementPlugin } from './TableRowElement.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withTables = ({ renderTable, renderTableCell, renderTableRow }: {\n\trenderTable: ElementRenderer<TableElement>\n\trenderTableCell: ElementRenderer<TableCellElement>\n\trenderTableRow: ElementRenderer<TableRowElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tdeleteForward,\n\t\tdeleteBackward,\n\t\tdeleteFragment,\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(tableElementPlugin({ render: renderTable }))\n\teditor.registerElement(tableCellElementPlugin({ render: renderTableCell }))\n\teditor.registerElement(tableRowElementPlugin({ render: renderTableRow }))\n\n\teditor.htmlDeserializer.registerPlugin(tableHTMLDeserializer)\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst selection = editor.selection\n\t\t\t\tconst [, closestBlockPath] = closestBlockEntry\n\t\t\t\tconst [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath)\n\n\t\t\t\tif (!selection) {\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tanchor: cellStart,\n\t\t\t\t\t\t\tfocus: cellEnd,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmatch: node => Text.isText(node) || (Element.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t\tinsertBreak()\n\t\t},\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteBackward(unit)\n\t\t},\n\t\tdeleteForward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteForward(unit)\n\t\t},\n\t\tdeleteFragment: () => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (!selection || SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn deleteFragment()\n\t\t\t}\n\t\t\tconst lowestCommonAncestorPath = SlatePath.common(selection.anchor.path, selection.focus.path)\n\t\t\tconst [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath)\n\n\t\t\tif (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {\n\t\t\t\treturn // TODO nope for now\n\t\t\t}\n\t\t\tdeleteFragment()\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (\n\t\t\t\t!selection\n\t\t\t\t|| !(\n\t\t\t\t\tevent.key === 'Tab'\n\t\t\t\t\t|| event.key === 'ArrowUp'\n\t\t\t\t\t|| event.key === 'ArrowRight'\n\t\t\t\t\t|| event.key === 'ArrowDown'\n\t\t\t\t\t|| event.key === 'ArrowLeft'\n\t\t\t\t\t|| event.key === 'Enter'\n\t\t\t\t\t|| event.key === 'Backspace'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection })\n\n\t\t\tif (!closestBlockEntry) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet cellElement: TableCellElement\n\t\t\tlet cellPath: SlatePath\n\n\t\t\tif (!isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst parent = SlateNode.parent(editor, closestBlockEntry[1])\n\t\t\t\tif (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {\n\t\t\t\t\tcellElement = parent\n\t\t\t\t\tcellPath = SlatePath.parent(closestBlockEntry[1])\n\t\t\t\t} else {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;[cellElement, cellPath] = closestBlockEntry\n\t\t\t}\n\t\t\tif (cellPath.length < 3) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement)\n\t\t\tconst tablePath = cellPath.slice(0, -2)\n\t\t\tconst tableElement = SlateNode.get(editor, tablePath) as TableElement\n\t\t\tconst rowCount = getTableElementRowCount(tableElement)\n\t\t\tconst columnCount = getTableElementColumnCount(tableElement)\n\n\t\t\tif (rowCount === 0 || columnCount === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst moveSelectionBeforeTable = () => {\n\t\t\t\tconst pointBeforeTable = Editor.before(editor, tablePath)\n\t\t\t\tif (!pointBeforeTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointBeforeTable)\n\t\t\t}\n\t\t\tconst moveSelectionAfterTable = () => {\n\t\t\t\tconst pointAfterTable = Editor.after(editor, tablePath)\n\t\t\t\tif (!pointAfterTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointAfterTable)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t// Moving backwards\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1)\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Moving forwards\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1)\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\t// We're at the right edge of the table\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex + 1, 0)\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === 'ArrowLeft') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.start(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]))\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowRight') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.end(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]))\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]))\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\tconst withinDefault = editor.isDefaultElement(closestBlockEntry[0])\n\t\t\t\tif (withinDefault) {\n\t\t\t\t\tconst relative = SlatePath.relative(closestBlockEntry[1], cellPath)\n\t\t\t\t\tconst defaultIndex = relative[0]\n\t\t\t\t\tif (\n\t\t\t\t\t\t(event.key === 'ArrowUp' && defaultIndex !== 0)\n\t\t\t\t\t\t|| (event.key === 'ArrowDown' && defaultIndex !== cellElement.children.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAboveEndPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset)\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowAboveEndPoint.path,\n\t\t\t\t\t\t\toffset: minOffset,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStatPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint) as NodeEntry<Text>\n\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowBelowStatPoint.path,\n\t\t\t\t\t\t\toffset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t}\n\t\t\t} else if (event.ctrlKey || event.metaKey) {\n\t\t\t\tif (event.key === 'Backspace') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tTableModifications.deleteTableColumn(editor, tableElement, columnIndex)\n\n\t\t\t\t\t\tif (columnCount > 1) {\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTableModifications.deleteTableRow(editor, tableElement, rowIndex)\n\n\t\t\t\t\t\tif (rowCount > 1) {\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex)\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex + 1)\n\t\t\t\t\t\t\tconst columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnAfter)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex)\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex + 1)\n\t\t\t\t\t\t\tconst rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStat)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["tableElementPlugin","tableCellElementPlugin","tableRowElementPlugin","tableHTMLDeserializer","ContemberEditor","isTableCellElement","Editor","Transforms","Text","Element","SlatePath","SlateRange","Point","isTableElement","isTableRowElement","SlateNode","getTableCellCoordinates","getTableElementRowCount","getTableElementColumnCount","selectTableCellContents","TableModifications"],"mappings":";;;;;;;;;;AAUO,MAAM,aAAa,CAAC,EAAE,aAAa,iBAAiB,eAAA,MAK3D,CAAmB,WAAiB;AACnC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgBA,aAAAA,mBAAmB,EAAE,QAAQ,YAAA,CAAa,CAAC;AAClE,SAAO,gBAAgBC,iBAAAA,uBAAuB,EAAE,QAAQ,gBAAA,CAAiB,CAAC;AAC1E,SAAO,gBAAgBC,gBAAAA,sBAAsB,EAAE,QAAQ,eAAA,CAAgB,CAAC;AAExE,SAAO,iBAAiB,eAAeC,2CAAqB;AAE5D,SAAO,OAAgC,QAAQ;AAAA,IAC9C,aAAa,MAAM;AAClB,YAAM,oBAAoBC,MAAAA,gBAAgB,kBAAkB,MAAM;AAClE,UAAI,qBAAqBC,iBAAAA,mBAAmB,kBAAkB,CAAC,CAAC,GAAG;AAClE,cAAM,YAAY,OAAO;AACzB,cAAM,CAAA,EAAG,gBAAgB,IAAI;AAC7B,cAAM,CAAC,WAAW,OAAO,IAAIC,MAAAA,OAAO,MAAM,QAAQ,gBAAgB;AAElE,YAAI,CAAC,WAAW;AACf,iBAAO,YAAA;AAAA,QACR;AAEA,eAAOA,MAAAA,OAAO,mBAAmB,QAAQ,MAAM;AAC9CC,gBAAAA,WAAW,UAAU,QAAQ,OAAO,qBAAqB,CAAA,CAAE,GAAG;AAAA,YAC7D,IAAI;AAAA,cACH,QAAQ;AAAA,cACR,OAAO;AAAA,YAAA;AAAA,YAER,OAAO,CAAA,SAAQC,MAAAA,KAAK,OAAO,IAAI,KAAMC,MAAAA,QAAQ,UAAU,IAAI,KAAK,OAAO,SAAS,IAAI;AAAA,UAAA,CACpF;AAED,gBAA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UAAU,KAAK,IAAI,GAAG,WAAW,CAAC,CAAC;AAE5F,qBAAOC,iBAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C,OAAO;AACNa,iCAAAA,mBAAmB,eAAe,QAAQ,cAAc,cAAc,CAAC;AACvE,oBAAM,cAAcd,aAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,UAAU,cAAc,CAAC,CAAC;AAElF,qBAAOC,iBAAW,OAAO,QAAQ,WAAW;AAAA,YAC7C;AAAA,UACD,OAAO;AACN,gBAAI,MAAM,UAAU;AACnBa,iCAAAA,mBAAmB,YAAY,QAAQ,cAAc,QAAQ;AAC7D,oBAAM,WAAWd,MAAAA,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,KAAK,IAAI,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExF,qBAAOC,iBAAW,OAAO,QAAQ,QAAQ;AAAA,YAC1C,OAAO;AACNa,iCAAAA,mBAAmB,YAAY,QAAQ,cAAc,WAAW,CAAC;AACjE,oBAAM,eAAed,aAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,WAAW,GAAG,WAAW,CAAC;AAEnF,qBAAOC,iBAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C;AAAA,UACD;AAAA,QACD;AAAA,MACD;AACA,gBAAU,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAED,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withTables.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/withTables.ts"],"sourcesContent":["import { Editor, Element, Node as SlateNode, NodeEntry, Path as SlatePath, Point, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isTableCellElement, TableCellElement, tableCellElementPlugin } from './TableCellElement'\nimport { getTableElementColumnCount, getTableElementRowCount, isTableElement, TableElement, tableElementPlugin } from './TableElement'\nimport { getTableCellCoordinates, selectTableCellContents } from './TableElementSelection'\nimport { tableHTMLDeserializer } from './TableHtmlDeserializer'\nimport { TableModifications } from './TableModifications'\nimport { isTableRowElement, TableRowElement, tableRowElementPlugin } from './TableRowElement'\nimport { ElementRenderer } from '../../../types'\n\nexport const withTables = ({ renderTable, renderTableCell, renderTableRow }: {\n\trenderTable: ElementRenderer<TableElement>\n\trenderTableCell: ElementRenderer<TableCellElement>\n\trenderTableRow: ElementRenderer<TableRowElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tdeleteForward,\n\t\tdeleteBackward,\n\t\tdeleteFragment,\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(tableElementPlugin({ render: renderTable }))\n\teditor.registerElement(tableCellElementPlugin({ render: renderTableCell }))\n\teditor.registerElement(tableRowElementPlugin({ render: renderTableRow }))\n\n\teditor.htmlDeserializer.registerPlugin(tableHTMLDeserializer)\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst selection = editor.selection\n\t\t\t\tconst [, closestBlockPath] = closestBlockEntry\n\t\t\t\tconst [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath)\n\n\t\t\t\tif (!selection) {\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tanchor: cellStart,\n\t\t\t\t\t\t\tfocus: cellEnd,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmatch: node => Text.isText(node) || (Element.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t\tinsertBreak()\n\t\t},\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteBackward(unit)\n\t\t},\n\t\tdeleteForward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteForward(unit)\n\t\t},\n\t\tdeleteFragment: () => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (!selection || SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn deleteFragment()\n\t\t\t}\n\t\t\tconst lowestCommonAncestorPath = SlatePath.common(selection.anchor.path, selection.focus.path)\n\t\t\tconst [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath)\n\n\t\t\tif (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {\n\t\t\t\treturn // TODO nope for now\n\t\t\t}\n\t\t\tdeleteFragment()\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (\n\t\t\t\t!selection\n\t\t\t\t|| !(\n\t\t\t\t\tevent.key === 'Tab'\n\t\t\t\t\t|| event.key === 'ArrowUp'\n\t\t\t\t\t|| event.key === 'ArrowRight'\n\t\t\t\t\t|| event.key === 'ArrowDown'\n\t\t\t\t\t|| event.key === 'ArrowLeft'\n\t\t\t\t\t|| event.key === 'Enter'\n\t\t\t\t\t|| event.key === 'Backspace'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection })\n\n\t\t\tif (!closestBlockEntry) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet cellElement: TableCellElement\n\t\t\tlet cellPath: SlatePath\n\n\t\t\tif (!isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst parent = SlateNode.parent(editor, closestBlockEntry[1])\n\t\t\t\tif (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {\n\t\t\t\t\tcellElement = parent\n\t\t\t\t\tcellPath = SlatePath.parent(closestBlockEntry[1])\n\t\t\t\t} else {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;[cellElement, cellPath] = closestBlockEntry\n\t\t\t}\n\t\t\tif (cellPath.length < 3) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement)\n\t\t\tconst tablePath = cellPath.slice(0, -2)\n\t\t\tconst tableElement = SlateNode.get(editor, tablePath) as TableElement\n\t\t\tconst rowCount = getTableElementRowCount(tableElement)\n\t\t\tconst columnCount = getTableElementColumnCount(tableElement)\n\n\t\t\tif (rowCount === 0 || columnCount === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst moveSelectionBeforeTable = () => {\n\t\t\t\tconst pointBeforeTable = Editor.before(editor, tablePath)\n\t\t\t\tif (!pointBeforeTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointBeforeTable)\n\t\t\t}\n\t\t\tconst moveSelectionAfterTable = () => {\n\t\t\t\tconst pointAfterTable = Editor.after(editor, tablePath)\n\t\t\t\tif (!pointAfterTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointAfterTable)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t// Moving backwards\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1)\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Moving forwards\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1)\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\t// We're at the right edge of the table\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex + 1, 0)\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === 'ArrowLeft') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.start(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]))\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowRight') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.end(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]))\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]))\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\tconst withinDefault = editor.isDefaultElement(closestBlockEntry[0])\n\t\t\t\tif (withinDefault) {\n\t\t\t\t\tconst relative = SlatePath.relative(closestBlockEntry[1], cellPath)\n\t\t\t\t\tconst defaultIndex = relative[0]\n\t\t\t\t\tif (\n\t\t\t\t\t\t(event.key === 'ArrowUp' && defaultIndex !== 0)\n\t\t\t\t\t\t|| (event.key === 'ArrowDown' && defaultIndex !== cellElement.children.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAboveEndPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset)\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowAboveEndPoint.path,\n\t\t\t\t\t\t\toffset: minOffset,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStatPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint) as NodeEntry<Text>\n\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowBelowStatPoint.path,\n\t\t\t\t\t\t\toffset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t}\n\t\t\t} else if (event.ctrlKey || event.metaKey) {\n\t\t\t\tif (event.key === 'Backspace') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tTableModifications.deleteTableColumn(editor, tableElement, columnIndex)\n\n\t\t\t\t\t\tif (columnCount > 1) {\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTableModifications.deleteTableRow(editor, tableElement, rowIndex)\n\n\t\t\t\t\t\tif (rowCount > 1) {\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex)\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex + 1)\n\t\t\t\t\t\t\tconst columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnAfter)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex)\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex + 1)\n\t\t\t\t\t\t\tconst rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStat)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["SlatePath","SlateRange","SlateNode"],"mappings":";;;;;;;;AAUO,MAAM,aAAa,CAAC,EAAE,aAAa,iBAAiB,eAAA,MAK3D,CAAmB,WAAiB;AACnC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgB,mBAAmB,EAAE,QAAQ,YAAA,CAAa,CAAC;AAClE,SAAO,gBAAgB,uBAAuB,EAAE,QAAQ,gBAAA,CAAiB,CAAC;AAC1E,SAAO,gBAAgB,sBAAsB,EAAE,QAAQ,eAAA,CAAgB,CAAC;AAExE,SAAO,iBAAiB,eAAe,qBAAqB;AAE5D,SAAO,OAAgC,QAAQ;AAAA,IAC9C,aAAa,MAAM;AAClB,YAAM,oBAAoB,gBAAgB,kBAAkB,MAAM;AAClE,UAAI,qBAAqB,mBAAmB,kBAAkB,CAAC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AI,GAAG,WAAW,CAAC,CAAC;AAE5F,qBAAO,WAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C,OAAO;AACN,iCAAmB,eAAe,QAAQ,cAAc,cAAc,CAAC;AACvE,oBAAM,cAAc,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,UAAU,cAAc,CAAC,CAAC;AAElF,qBAAO,WAAW,OAAO,QAAQ,WAAW;AAAA,YAC7C;AAAA,UACD,OAAO;AACN,gBAAI,MAAM,UAAU;AACnB,iCAAmB,YAAY,QAAQ,cAAc,QAAQ;AAC7D,oBAAM,WAAW,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,KAAK,IAAI,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExF,qBAAO,WAAW,OAAO,QAAQ,QAAQ;AAAA,YAC1C,OAAO;AACN,iCAAmB,YAAY,QAAQ,cAAc,WAAW,CAAC;AACjE,oBAAM,eAAe,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,WAAW,GAAG,WAAW,CAAC;AAEnF,qBAAO,WAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C;AAAA,UACD;AAAA,QACD;AAAA,MACD;AACA,gBAAU,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAED,SAAO;AACR;"}
1
+ {"version":3,"file":"withTables.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/withTables.ts"],"sourcesContent":["import { Editor, Element, Node as SlateNode, NodeEntry, Path as SlatePath, Point, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { isTableCellElement, TableCellElement, tableCellElementPlugin } from './TableCellElement.js'\nimport { getTableElementColumnCount, getTableElementRowCount, isTableElement, TableElement, tableElementPlugin } from './TableElement.js'\nimport { getTableCellCoordinates, selectTableCellContents } from './TableElementSelection.js'\nimport { tableHTMLDeserializer } from './TableHtmlDeserializer.js'\nimport { TableModifications } from './TableModifications.js'\nimport { isTableRowElement, TableRowElement, tableRowElementPlugin } from './TableRowElement.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withTables = ({ renderTable, renderTableCell, renderTableRow }: {\n\trenderTable: ElementRenderer<TableElement>\n\trenderTableCell: ElementRenderer<TableCellElement>\n\trenderTableRow: ElementRenderer<TableRowElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tdeleteForward,\n\t\tdeleteBackward,\n\t\tdeleteFragment,\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(tableElementPlugin({ render: renderTable }))\n\teditor.registerElement(tableCellElementPlugin({ render: renderTableCell }))\n\teditor.registerElement(tableRowElementPlugin({ render: renderTableRow }))\n\n\teditor.htmlDeserializer.registerPlugin(tableHTMLDeserializer)\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst selection = editor.selection\n\t\t\t\tconst [, closestBlockPath] = closestBlockEntry\n\t\t\t\tconst [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath)\n\n\t\t\t\tif (!selection) {\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tanchor: cellStart,\n\t\t\t\t\t\t\tfocus: cellEnd,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmatch: node => Text.isText(node) || (Element.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t\tinsertBreak()\n\t\t},\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteBackward(unit)\n\t\t},\n\t\tdeleteForward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteForward(unit)\n\t\t},\n\t\tdeleteFragment: () => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (!selection || SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn deleteFragment()\n\t\t\t}\n\t\t\tconst lowestCommonAncestorPath = SlatePath.common(selection.anchor.path, selection.focus.path)\n\t\t\tconst [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath)\n\n\t\t\tif (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {\n\t\t\t\treturn // TODO nope for now\n\t\t\t}\n\t\t\tdeleteFragment()\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (\n\t\t\t\t!selection\n\t\t\t\t|| !(\n\t\t\t\t\tevent.key === 'Tab'\n\t\t\t\t\t|| event.key === 'ArrowUp'\n\t\t\t\t\t|| event.key === 'ArrowRight'\n\t\t\t\t\t|| event.key === 'ArrowDown'\n\t\t\t\t\t|| event.key === 'ArrowLeft'\n\t\t\t\t\t|| event.key === 'Enter'\n\t\t\t\t\t|| event.key === 'Backspace'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection })\n\n\t\t\tif (!closestBlockEntry) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet cellElement: TableCellElement\n\t\t\tlet cellPath: SlatePath\n\n\t\t\tif (!isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst parent = SlateNode.parent(editor, closestBlockEntry[1])\n\t\t\t\tif (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {\n\t\t\t\t\tcellElement = parent\n\t\t\t\t\tcellPath = SlatePath.parent(closestBlockEntry[1])\n\t\t\t\t} else {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;[cellElement, cellPath] = closestBlockEntry\n\t\t\t}\n\t\t\tif (cellPath.length < 3) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement)\n\t\t\tconst tablePath = cellPath.slice(0, -2)\n\t\t\tconst tableElement = SlateNode.get(editor, tablePath) as TableElement\n\t\t\tconst rowCount = getTableElementRowCount(tableElement)\n\t\t\tconst columnCount = getTableElementColumnCount(tableElement)\n\n\t\t\tif (rowCount === 0 || columnCount === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst moveSelectionBeforeTable = () => {\n\t\t\t\tconst pointBeforeTable = Editor.before(editor, tablePath)\n\t\t\t\tif (!pointBeforeTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointBeforeTable)\n\t\t\t}\n\t\t\tconst moveSelectionAfterTable = () => {\n\t\t\t\tconst pointAfterTable = Editor.after(editor, tablePath)\n\t\t\t\tif (!pointAfterTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointAfterTable)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t// Moving backwards\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1)\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Moving forwards\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1)\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\t// We're at the right edge of the table\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex + 1, 0)\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === 'ArrowLeft') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.start(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]))\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowRight') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.end(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]))\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]))\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\tconst withinDefault = editor.isDefaultElement(closestBlockEntry[0])\n\t\t\t\tif (withinDefault) {\n\t\t\t\t\tconst relative = SlatePath.relative(closestBlockEntry[1], cellPath)\n\t\t\t\t\tconst defaultIndex = relative[0]\n\t\t\t\t\tif (\n\t\t\t\t\t\t(event.key === 'ArrowUp' && defaultIndex !== 0)\n\t\t\t\t\t\t|| (event.key === 'ArrowDown' && defaultIndex !== cellElement.children.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAboveEndPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset)\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowAboveEndPoint.path,\n\t\t\t\t\t\t\toffset: minOffset,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStatPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint) as NodeEntry<Text>\n\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowBelowStatPoint.path,\n\t\t\t\t\t\t\toffset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t}\n\t\t\t} else if (event.ctrlKey || event.metaKey) {\n\t\t\t\tif (event.key === 'Backspace') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tTableModifications.deleteTableColumn(editor, tableElement, columnIndex)\n\n\t\t\t\t\t\tif (columnCount > 1) {\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTableModifications.deleteTableRow(editor, tableElement, rowIndex)\n\n\t\t\t\t\t\tif (rowCount > 1) {\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex)\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex + 1)\n\t\t\t\t\t\t\tconst columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnAfter)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex)\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex + 1)\n\t\t\t\t\t\t\tconst rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStat)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["SlatePath","SlateRange","SlateNode"],"mappings":";;;;;;;;AAUO,MAAM,aAAa,CAAC,EAAE,aAAa,iBAAiB,eAAA,MAK3D,CAAmB,WAAiB;AACnC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgB,mBAAmB,EAAE,QAAQ,YAAA,CAAa,CAAC;AAClE,SAAO,gBAAgB,uBAAuB,EAAE,QAAQ,gBAAA,CAAiB,CAAC;AAC1E,SAAO,gBAAgB,sBAAsB,EAAE,QAAQ,eAAA,CAAgB,CAAC;AAExE,SAAO,iBAAiB,eAAe,qBAAqB;AAE5D,SAAO,OAAgC,QAAQ;AAAA,IAC9C,aAAa,MAAM;AAClB,YAAM,oBAAoB,gBAAgB,kBAAkB,MAAM;AAClE,UAAI,qBAAqB,mBAAmB,kBAAkB,CAAC,CAAC,GAAG;AAClE,cAAM,YAAY,OAAO;AACzB,cAAM,CAA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,QAAQ,YAAY;AAAA,YAC9C,OAAO;AACN,iCAAmB,eAAe,QAAQ,cAAc,cAAc,CAAC;AACvE,oBAAM,cAAc,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,UAAU,cAAc,CAAC,CAAC;AAElF,qBAAO,WAAW,OAAO,QAAQ,WAAW;AAAA,YAC7C;AAAA,UACD,OAAO;AACN,gBAAI,MAAM,UAAU;AACnB,iCAAmB,YAAY,QAAQ,cAAc,QAAQ;AAC7D,oBAAM,WAAW,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,KAAK,IAAI,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExF,qBAAO,WAAW,OAAO,QAAQ,QAAQ;AAAA,YAC1C,OAAO;AACN,iCAAmB,YAAY,QAAQ,cAAc,WAAW,CAAC;AACjE,oBAAM,eAAe,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,WAAW,GAAG,WAAW,CAAC;AAEnF,qBAAO,WAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C;AAAA,UACD;AAAA,QACD;AAAA,MACD;AACA,gBAAU,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAED,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"boldMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/boldMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const boldMark = 'isBold'\n\nexport const boldMarkPlugin: EditorMarkPlugin = {\n\ttype: boldMark,\n\tisHotKey: isHotkey('mod+b'),\n\trender: ({ children }) => createElement('b', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
1
+ {"version":3,"file":"boldMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/boldMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const boldMark = 'isBold'\n\nexport const boldMarkPlugin: EditorMarkPlugin = {\n\ttype: boldMark,\n\tisHotKey: isHotkey('mod+b'),\n\trender: ({ children }) => createElement('b', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"boldMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/boldMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const boldMark = 'isBold'\n\nexport const boldMarkPlugin: EditorMarkPlugin = {\n\ttype: boldMark,\n\tisHotKey: isHotkey('mod+b'),\n\trender: ({ children }) => createElement('b', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
1
+ {"version":3,"file":"boldMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/boldMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const boldMark = 'isBold'\n\nexport const boldMarkPlugin: EditorMarkPlugin = {\n\ttype: boldMark,\n\tisHotKey: isHotkey('mod+b'),\n\trender: ({ children }) => createElement('b', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withBold.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/withBold.ts"],"sourcesContent":["import { boldMark, boldMarkPlugin } from './boldMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withBold = (): EditorPlugin => editor => {\n\teditor.registerMark(boldMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tboldMark,\n\t\t\tel => el.nodeName === 'STRONG' || (el.nodeName === 'B' && !el.id.startsWith('docs-internal-guid')),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":["boldMarkPlugin","createMarkHtmlDeserializer","boldMark"],"mappings":";;;;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAaA,uBAAc;AAClC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,SAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa,YAAa,GAAG,aAAa,OAAO,CAAC,GAAG,GAAG,WAAW,oBAAoB;AAAA,MAChG,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;;"}
1
+ {"version":3,"file":"withBold.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/withBold.ts"],"sourcesContent":["import { boldMark, boldMarkPlugin } from './boldMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withBold = (): EditorPlugin => editor => {\n\teditor.registerMark(boldMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tboldMark,\n\t\t\tel => el.nodeName === 'STRONG' || (el.nodeName === 'B' && !el.id.startsWith('docs-internal-guid')),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":["boldMarkPlugin","createMarkHtmlDeserializer","boldMark"],"mappings":";;;;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAaA,uBAAc;AAClC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,SAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa,YAAa,GAAG,aAAa,OAAO,CAAC,GAAG,GAAG,WAAW,oBAAoB;AAAA,MAChG,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withBold.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/withBold.ts"],"sourcesContent":["import { boldMark, boldMarkPlugin } from './boldMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withBold = (): EditorPlugin => editor => {\n\teditor.registerMark(boldMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tboldMark,\n\t\t\tel => el.nodeName === 'STRONG' || (el.nodeName === 'B' && !el.id.startsWith('docs-internal-guid')),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAa,cAAc;AAClC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa,YAAa,GAAG,aAAa,OAAO,CAAC,GAAG,GAAG,WAAW,oBAAoB;AAAA,MAChG,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;"}
1
+ {"version":3,"file":"withBold.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/withBold.ts"],"sourcesContent":["import { boldMark, boldMarkPlugin } from './boldMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withBold = (): EditorPlugin => editor => {\n\teditor.registerMark(boldMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tboldMark,\n\t\t\tel => el.nodeName === 'STRONG' || (el.nodeName === 'B' && !el.id.startsWith('docs-internal-guid')),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAa,cAAc;AAClC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa,YAAa,GAAG,aAAa,OAAO,CAAC,GAAG,GAAG,WAAW,oBAAoB;AAAA,MAChG,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"codeMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/codeMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const codeMark = 'isCode'\n\nexport const codeMarkPlugin: EditorMarkPlugin = {\n\ttype: codeMark,\n\tisHotKey: isHotkey('mod+`'),\n\trender: ({ children }) => createElement('code', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,QAAQ,QAAW,QAAQ;AACpE;;;"}
1
+ {"version":3,"file":"codeMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/codeMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const codeMark = 'isCode'\n\nexport const codeMarkPlugin: EditorMarkPlugin = {\n\ttype: codeMark,\n\tisHotKey: isHotkey('mod+`'),\n\trender: ({ children }) => createElement('code', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,QAAQ,QAAW,QAAQ;AACpE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"codeMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/codeMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const codeMark = 'isCode'\n\nexport const codeMarkPlugin: EditorMarkPlugin = {\n\ttype: codeMark,\n\tisHotKey: isHotkey('mod+`'),\n\trender: ({ children }) => createElement('code', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,QAAQ,QAAW,QAAQ;AACpE;"}
1
+ {"version":3,"file":"codeMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/codeMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const codeMark = 'isCode'\n\nexport const codeMarkPlugin: EditorMarkPlugin = {\n\ttype: codeMark,\n\tisHotKey: isHotkey('mod+`'),\n\trender: ({ children }) => createElement('code', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,QAAQ,QAAW,QAAQ;AACpE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withCode.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/withCode.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { codeMarkPlugin } from './codeMark'\nimport { EditorPlugin } from '../../../types'\n\nexport const withCode = (): EditorPlugin => editor => {\n\teditor.registerMark(codeMarkPlugin)\n\n\treturn editor\n}\n"],"names":["codeMarkPlugin"],"mappings":";;;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAaA,uBAAc;AAElC,SAAO;AACR;;"}
1
+ {"version":3,"file":"withCode.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/withCode.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { codeMarkPlugin } from './codeMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withCode = (): EditorPlugin => editor => {\n\teditor.registerMark(codeMarkPlugin)\n\n\treturn editor\n}\n"],"names":["codeMarkPlugin"],"mappings":";;;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAaA,uBAAc;AAElC,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withCode.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/withCode.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { codeMarkPlugin } from './codeMark'\nimport { EditorPlugin } from '../../../types'\n\nexport const withCode = (): EditorPlugin => editor => {\n\teditor.registerMark(codeMarkPlugin)\n\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAa,cAAc;AAElC,SAAO;AACR;"}
1
+ {"version":3,"file":"withCode.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/withCode.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { codeMarkPlugin } from './codeMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withCode = (): EditorPlugin => editor => {\n\teditor.registerMark(codeMarkPlugin)\n\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAa,cAAc;AAElC,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"highlightMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/highlightMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const highlightMark = 'isHighlighted'\n\nexport const highlightMarkPlugin: EditorMarkPlugin = {\n\ttype: highlightMark,\n\tisHotKey: isHotkey('mod+e'),\n\trender: ({ children }) => createElement('em', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,MAAM,QAAW,QAAQ;AAClE;;;"}
1
+ {"version":3,"file":"highlightMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/highlightMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const highlightMark = 'isHighlighted'\n\nexport const highlightMarkPlugin: EditorMarkPlugin = {\n\ttype: highlightMark,\n\tisHotKey: isHotkey('mod+e'),\n\trender: ({ children }) => createElement('em', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,MAAM,QAAW,QAAQ;AAClE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"highlightMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/highlightMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const highlightMark = 'isHighlighted'\n\nexport const highlightMarkPlugin: EditorMarkPlugin = {\n\ttype: highlightMark,\n\tisHotKey: isHotkey('mod+e'),\n\trender: ({ children }) => createElement('em', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,MAAM,QAAW,QAAQ;AAClE;"}
1
+ {"version":3,"file":"highlightMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/highlightMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const highlightMark = 'isHighlighted'\n\nexport const highlightMarkPlugin: EditorMarkPlugin = {\n\ttype: highlightMark,\n\tisHotKey: isHotkey('mod+e'),\n\trender: ({ children }) => createElement('em', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,MAAM,QAAW,QAAQ;AAClE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withHighlight.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/withHighlight.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { highlightMarkPlugin } from './highlightMark'\nimport { EditorPlugin } from '../../../types'\n\nexport const withHighlight = (): EditorPlugin => editor => {\n\teditor.registerMark(highlightMarkPlugin)\n\n\treturn editor\n}\n"],"names":["highlightMarkPlugin"],"mappings":";;;AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAaA,iCAAmB;AAEvC,SAAO;AACR;;"}
1
+ {"version":3,"file":"withHighlight.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/withHighlight.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { highlightMarkPlugin } from './highlightMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withHighlight = (): EditorPlugin => editor => {\n\teditor.registerMark(highlightMarkPlugin)\n\n\treturn editor\n}\n"],"names":["highlightMarkPlugin"],"mappings":";;;AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAaA,iCAAmB;AAEvC,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withHighlight.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/withHighlight.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { highlightMarkPlugin } from './highlightMark'\nimport { EditorPlugin } from '../../../types'\n\nexport const withHighlight = (): EditorPlugin => editor => {\n\teditor.registerMark(highlightMarkPlugin)\n\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAa,mBAAmB;AAEvC,SAAO;AACR;"}
1
+ {"version":3,"file":"withHighlight.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/withHighlight.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { highlightMarkPlugin } from './highlightMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withHighlight = (): EditorPlugin => editor => {\n\teditor.registerMark(highlightMarkPlugin)\n\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAa,mBAAmB;AAEvC,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"italicMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/italicMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const italicMark = 'isItalic'\n\nexport const italicMarkPlugin: EditorMarkPlugin = {\n\ttype: italicMark,\n\tisHotKey: isHotkey('mod+i'),\n\trender: ({ children }) => createElement('i', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,aAAa;AAEnB,MAAM,mBAAqC;AAAA,EACjD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
1
+ {"version":3,"file":"italicMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/italicMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const italicMark = 'isItalic'\n\nexport const italicMarkPlugin: EditorMarkPlugin = {\n\ttype: italicMark,\n\tisHotKey: isHotkey('mod+i'),\n\trender: ({ children }) => createElement('i', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,aAAa;AAEnB,MAAM,mBAAqC;AAAA,EACjD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"italicMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/italicMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const italicMark = 'isItalic'\n\nexport const italicMarkPlugin: EditorMarkPlugin = {\n\ttype: italicMark,\n\tisHotKey: isHotkey('mod+i'),\n\trender: ({ children }) => createElement('i', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,aAAa;AAEnB,MAAM,mBAAqC;AAAA,EACjD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
1
+ {"version":3,"file":"italicMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/italicMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const italicMark = 'isItalic'\n\nexport const italicMarkPlugin: EditorMarkPlugin = {\n\ttype: italicMark,\n\tisHotKey: isHotkey('mod+i'),\n\trender: ({ children }) => createElement('i', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,aAAa;AAEnB,MAAM,mBAAqC;AAAA,EACjD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withItalic.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/withItalic.ts"],"sourcesContent":["import { italicMark, italicMarkPlugin } from './italicMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withItalic = (): EditorPlugin => editor => {\n\teditor.registerMark(italicMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\titalicMark,\n\t\t\tel => ['I', 'EM'].includes(el.nodeName),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":["italicMarkPlugin","createMarkHtmlDeserializer","italicMark"],"mappings":";;;;AAIO,MAAM,aAAa,MAAoB,CAAA,WAAU;AACvD,SAAO,aAAaA,2BAAgB;AACpC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,WAAAA;AAAAA,MACA,QAAM,CAAC,KAAK,IAAI,EAAE,SAAS,GAAG,QAAQ;AAAA,MACtC,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;;"}
1
+ {"version":3,"file":"withItalic.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/withItalic.ts"],"sourcesContent":["import { italicMark, italicMarkPlugin } from './italicMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withItalic = (): EditorPlugin => editor => {\n\teditor.registerMark(italicMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\titalicMark,\n\t\t\tel => ['I', 'EM'].includes(el.nodeName),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":["italicMarkPlugin","createMarkHtmlDeserializer","italicMark"],"mappings":";;;;AAIO,MAAM,aAAa,MAAoB,CAAA,WAAU;AACvD,SAAO,aAAaA,2BAAgB;AACpC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,WAAAA;AAAAA,MACA,QAAM,CAAC,KAAK,IAAI,EAAE,SAAS,GAAG,QAAQ;AAAA,MACtC,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withItalic.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/withItalic.ts"],"sourcesContent":["import { italicMark, italicMarkPlugin } from './italicMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withItalic = (): EditorPlugin => editor => {\n\teditor.registerMark(italicMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\titalicMark,\n\t\t\tel => ['I', 'EM'].includes(el.nodeName),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,aAAa,MAAoB,CAAA,WAAU;AACvD,SAAO,aAAa,gBAAgB;AACpC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,QAAM,CAAC,KAAK,IAAI,EAAE,SAAS,GAAG,QAAQ;AAAA,MACtC,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;"}
1
+ {"version":3,"file":"withItalic.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/withItalic.ts"],"sourcesContent":["import { italicMark, italicMarkPlugin } from './italicMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withItalic = (): EditorPlugin => editor => {\n\teditor.registerMark(italicMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\titalicMark,\n\t\t\tel => ['I', 'EM'].includes(el.nodeName),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,aAAa,MAAoB,CAAA,WAAU;AACvD,SAAO,aAAa,gBAAgB;AACpC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,QAAM,CAAC,KAAK,IAAI,EAAE,SAAS,GAAG,QAAQ;AAAA,MACtC,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withNewline.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/newline/withNewline.ts"],"sourcesContent":["import { Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types'\n\nexport const withNewline = (): EditorPlugin => editor => {\n\tconst { onKeyDown } = editor\n\teditor.onKeyDown = e => {\n\t\tif (e.key !== 'Enter' || !e.shiftKey) {\n\t\t\treturn onKeyDown(e)\n\t\t}\n\t\te.preventDefault()\n\t\tTransforms.insertText(editor, '\\n')\n\t}\n}\n"],"names":["Transforms"],"mappings":";;;AAGO,MAAM,cAAc,MAAoB,CAAA,WAAU;AACxD,QAAM,EAAE,cAAc;AACtB,SAAO,YAAY,CAAA,MAAK;AACvB,QAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACrC,aAAO,UAAU,CAAC;AAAA,IACnB;AACA,MAAE,eAAA;AACFA,qBAAW,WAAW,QAAQ,IAAI;AAAA,EACnC;AACD;;"}
1
+ {"version":3,"file":"withNewline.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/newline/withNewline.ts"],"sourcesContent":["import { Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withNewline = (): EditorPlugin => editor => {\n\tconst { onKeyDown } = editor\n\teditor.onKeyDown = e => {\n\t\tif (e.key !== 'Enter' || !e.shiftKey) {\n\t\t\treturn onKeyDown(e)\n\t\t}\n\t\te.preventDefault()\n\t\tTransforms.insertText(editor, '\\n')\n\t}\n}\n"],"names":["Transforms"],"mappings":";;;AAGO,MAAM,cAAc,MAAoB,CAAA,WAAU;AACxD,QAAM,EAAE,cAAc;AACtB,SAAO,YAAY,CAAA,MAAK;AACvB,QAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACrC,aAAO,UAAU,CAAC;AAAA,IACnB;AACA,MAAE,eAAA;AACFA,qBAAW,WAAW,QAAQ,IAAI;AAAA,EACnC;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withNewline.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/newline/withNewline.ts"],"sourcesContent":["import { Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types'\n\nexport const withNewline = (): EditorPlugin => editor => {\n\tconst { onKeyDown } = editor\n\teditor.onKeyDown = e => {\n\t\tif (e.key !== 'Enter' || !e.shiftKey) {\n\t\t\treturn onKeyDown(e)\n\t\t}\n\t\te.preventDefault()\n\t\tTransforms.insertText(editor, '\\n')\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,cAAc,MAAoB,CAAA,WAAU;AACxD,QAAM,EAAE,cAAc;AACtB,SAAO,YAAY,CAAA,MAAK;AACvB,QAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACrC,aAAO,UAAU,CAAC;AAAA,IACnB;AACA,MAAE,eAAA;AACF,eAAW,WAAW,QAAQ,IAAI;AAAA,EACnC;AACD;"}
1
+ {"version":3,"file":"withNewline.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/newline/withNewline.ts"],"sourcesContent":["import { Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withNewline = (): EditorPlugin => editor => {\n\tconst { onKeyDown } = editor\n\teditor.onKeyDown = e => {\n\t\tif (e.key !== 'Enter' || !e.shiftKey) {\n\t\t\treturn onKeyDown(e)\n\t\t}\n\t\te.preventDefault()\n\t\tTransforms.insertText(editor, '\\n')\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,cAAc,MAAoB,CAAA,WAAU;AACxD,QAAM,EAAE,cAAc;AACtB,SAAO,YAAY,CAAA,MAAK;AACvB,QAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACrC,aAAO,UAAU,CAAC;AAAA,IACnB;AACA,MAAE,eAAA;AACF,eAAW,WAAW,QAAQ,IAAI;AAAA,EACnC;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"strikeThroughMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/strikeThroughMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const strikeThroughMark = 'isStruckThrough'\nexport const strikeThroughPlugin: EditorMarkPlugin = {\n\ttype: strikeThroughMark,\n\trender: ({ children }) => createElement('s', undefined, children),\n\tisHotKey: isHotkey('mod+opt+s'),\n}\n"],"names":["createElement","isHotkey"],"mappings":";;;;AAIO,MAAM,oBAAoB;AAC1B,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ,CAAC,EAAE,SAAA,MAAeA,MAAAA,cAAc,KAAK,QAAW,QAAQ;AAAA,EAChE,UAAUC,SAAAA,SAAS,WAAW;AAC/B;;;"}
1
+ {"version":3,"file":"strikeThroughMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/strikeThroughMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const strikeThroughMark = 'isStruckThrough'\nexport const strikeThroughPlugin: EditorMarkPlugin = {\n\ttype: strikeThroughMark,\n\trender: ({ children }) => createElement('s', undefined, children),\n\tisHotKey: isHotkey('mod+opt+s'),\n}\n"],"names":["createElement","isHotkey"],"mappings":";;;;AAIO,MAAM,oBAAoB;AAC1B,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ,CAAC,EAAE,SAAA,MAAeA,MAAAA,cAAc,KAAK,QAAW,QAAQ;AAAA,EAChE,UAAUC,SAAAA,SAAS,WAAW;AAC/B;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"strikeThroughMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/strikeThroughMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const strikeThroughMark = 'isStruckThrough'\nexport const strikeThroughPlugin: EditorMarkPlugin = {\n\ttype: strikeThroughMark,\n\trender: ({ children }) => createElement('s', undefined, children),\n\tisHotKey: isHotkey('mod+opt+s'),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,oBAAoB;AAC1B,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AAAA,EAChE,UAAU,SAAS,WAAW;AAC/B;"}
1
+ {"version":3,"file":"strikeThroughMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/strikeThroughMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const strikeThroughMark = 'isStruckThrough'\nexport const strikeThroughPlugin: EditorMarkPlugin = {\n\ttype: strikeThroughMark,\n\trender: ({ children }) => createElement('s', undefined, children),\n\tisHotKey: isHotkey('mod+opt+s'),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,oBAAoB;AAC1B,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AAAA,EAChE,UAAU,SAAS,WAAW;AAC/B;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withStrikeThrough.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/withStrikeThrough.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { strikeThroughMark, strikeThroughPlugin } from './strikeThroughMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withStrikeThrough = (): EditorPlugin => editor => {\n\teditor.registerMark(strikeThroughPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tstrikeThroughMark,\n\t\t\tel => el.nodeName === 'S',\n\t\t\tel => el.style.textDecoration === 'line-through',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":["strikeThroughPlugin","createMarkHtmlDeserializer","strikeThroughMark"],"mappings":";;;;AAKO,MAAM,oBAAoB,MAAoB,CAAA,WAAU;AAC9D,SAAO,aAAaA,qCAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,kBAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;;"}
1
+ {"version":3,"file":"withStrikeThrough.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/withStrikeThrough.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { strikeThroughMark, strikeThroughPlugin } from './strikeThroughMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withStrikeThrough = (): EditorPlugin => editor => {\n\teditor.registerMark(strikeThroughPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tstrikeThroughMark,\n\t\t\tel => el.nodeName === 'S',\n\t\t\tel => el.style.textDecoration === 'line-through',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":["strikeThroughPlugin","createMarkHtmlDeserializer","strikeThroughMark"],"mappings":";;;;AAKO,MAAM,oBAAoB,MAAoB,CAAA,WAAU;AAC9D,SAAO,aAAaA,qCAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,kBAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withStrikeThrough.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/withStrikeThrough.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { strikeThroughMark, strikeThroughPlugin } from './strikeThroughMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withStrikeThrough = (): EditorPlugin => editor => {\n\teditor.registerMark(strikeThroughPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tstrikeThroughMark,\n\t\t\tel => el.nodeName === 'S',\n\t\t\tel => el.style.textDecoration === 'line-through',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":[],"mappings":";;AAKO,MAAM,oBAAoB,MAAoB,CAAA,WAAU;AAC9D,SAAO,aAAa,mBAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;"}
1
+ {"version":3,"file":"withStrikeThrough.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/withStrikeThrough.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { strikeThroughMark, strikeThroughPlugin } from './strikeThroughMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withStrikeThrough = (): EditorPlugin => editor => {\n\teditor.registerMark(strikeThroughPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tstrikeThroughMark,\n\t\t\tel => el.nodeName === 'S',\n\t\t\tel => el.style.textDecoration === 'line-through',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":[],"mappings":";;AAKO,MAAM,oBAAoB,MAAoB,CAAA,WAAU;AAC9D,SAAO,aAAa,mBAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;"}