@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":"normalizeListElement.js","sources":["../../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/transforms/normalizeListElement.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Transforms } from 'slate'\nimport { listItemElementType } from '../ListItemElement'\nimport { ContemberEditor } from '../../../../editor'\n\nexport const normalizeListElement = ({ editor, path, preventDefault }: { editor: Editor; path: SlatePath; preventDefault: () => void }) => {\n\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\tif (SlateElement.isElement(child)) {\n\t\t\tif (child.type !== listItemElementType) {\n\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\tTransforms.setNodes(editor, { type: listItemElementType }, { at: childPath })\n\t\t\t}\n\t\t} else {\n\t\t\t// If a list contains non-element nodes, just remove it.\n\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\tat: path,\n\t\t\t})\n\t\t\treturn preventDefault()\n\t\t}\n\t}\n}\n"],"names":["SlateNode","SlateElement"],"mappings":";;;AAIO,MAAM,uBAAuB,CAAC,EAAE,QAAQ,MAAM,qBAAsF;AAC1I,aAAW,CAAC,OAAO,SAAS,KAAKA,KAAU,SAAS,QAAQ,IAAI,GAAG;AAClE,QAAIC,QAAa,UAAU,KAAK,GAAG;AAClC,UAAI,MAAM,SAAS,qBAAqB;AACvC,wBAAgB,aAAa,QAAQ,SAAS;AAC9C,mBAAW,SAAS,QAAQ,EAAE,MAAM,uBAAuB,EAAE,IAAI,WAAW;AAAA,MAC7E;AAAA,IACD,OAAO;AAEN,iBAAW,YAAY,QAAQ;AAAA,QAC9B,IAAI;AAAA,MAAA,CACJ;AACD,aAAO,eAAA;AAAA,IACR;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"normalizeListElement.js","sources":["../../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/transforms/normalizeListElement.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Transforms } from 'slate'\nimport { listItemElementType } from '../ListItemElement.js'\nimport { ContemberEditor } from '../../../../editor/index.js'\n\nexport const normalizeListElement = ({ editor, path, preventDefault }: { editor: Editor; path: SlatePath; preventDefault: () => void }) => {\n\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\tif (SlateElement.isElement(child)) {\n\t\t\tif (child.type !== listItemElementType) {\n\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\tTransforms.setNodes(editor, { type: listItemElementType }, { at: childPath })\n\t\t\t}\n\t\t} else {\n\t\t\t// If a list contains non-element nodes, just remove it.\n\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\tat: path,\n\t\t\t})\n\t\t\treturn preventDefault()\n\t\t}\n\t}\n}\n"],"names":["SlateNode","SlateElement"],"mappings":";;;AAIO,MAAM,uBAAuB,CAAC,EAAE,QAAQ,MAAM,qBAAsF;AAC1I,aAAW,CAAC,OAAO,SAAS,KAAKA,KAAU,SAAS,QAAQ,IAAI,GAAG;AAClE,QAAIC,QAAa,UAAU,KAAK,GAAG;AAClC,UAAI,MAAM,SAAS,qBAAqB;AACvC,wBAAgB,aAAa,QAAQ,SAAS;AAC9C,mBAAW,SAAS,QAAQ,EAAE,MAAM,uBAAuB,EAAE,IAAI,WAAW;AAAA,MAC7E;AAAA,IACD,OAAO;AAEN,iBAAW,YAAY,QAAQ;AAAA,QAC9B,IAAI;AAAA,MAAA,CACJ;AACD,aAAO,eAAA;AAAA,IACR;AAAA,EACD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"toggleListElement.cjs","sources":["../../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/transforms/toggleListElement.ts"],"sourcesContent":["import { OrderedListElement, orderedListElementType } from '../OrderedListElement'\nimport { UnorderedListElement, unorderedListElementType } from '../UnorderedListElement'\nimport { Editor, Element as SlateElement, NodeEntry, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../../editor'\nimport { listItemElementType } from '../ListItemElement'\nimport { isListElement } from '../ListElement'\n\nexport const toggleListElement = <T extends OrderedListElement | UnorderedListElement>(\n\teditor: Editor,\n\telementType: T['type'],\n\tsuchThat: Partial<T> | undefined,\n\totherKindOfList: typeof orderedListElementType | typeof unorderedListElementType,\n) => {\n\tif (editor.isElementActive(elementType, suchThat)) {\n\t\tconst closestListEntry = ContemberEditor.closest(editor, {\n\t\t\tmatch: node => SlateElement.isElement(node) && node.type === elementType,\n\t\t}) as NodeEntry<UnorderedListElement | OrderedListElement>\n\t\tif (!closestListEntry) {\n\t\t\treturn\n\t\t}\n\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\tconst [closestList, closestListPath] = closestListEntry\n\n\t\t\t// It's important that we iterate backwards because otherwise we'd mangle the paths.\n\t\t\t// We unwrap elements which may have more than one child.\n\t\t\tfor (let i = closestList.children.length - 1; i >= 0; i--) {\n\t\t\t\tconst currentItemPath = [...closestListPath, i]\n\t\t\t\tif (Editor.hasInlines(editor, closestList.children[i] as SlateElement)) {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: currentItemPath,\n\t\t\t\t\t})\n\t\t\t\t\tTransforms.unwrapNodes(editor, {\n\t\t\t\t\t\tat: [...currentItemPath, 0],\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tTransforms.unwrapNodes(editor, { at: currentItemPath })\n\t\t\t\t}\n\t\t\t}\n\t\t\tTransforms.unwrapNodes(editor, { at: closestListPath })\n\t\t})\n\t}\n\tif (editor.isElementActive(elementType) || editor.isElementActive(otherKindOfList)) {\n\t\t// We're in a list but a different one. Note the lack of 'suchThat'\n\t\tconst closestListEntry = ContemberEditor.closest(editor, {\n\t\t\tmatch: node => isListElement(node),\n\t\t}) as NodeEntry<UnorderedListElement | OrderedListElement>\n\t\tif (!closestListEntry) {\n\t\t\treturn\n\t\t}\n\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\tconst [, closestListPath] = closestListEntry\n\t\t\tContemberEditor.ejectElement(editor, closestListPath)\n\t\t\tTransforms.setNodes(editor, { ...suchThat, type: elementType }, { at: closestListPath })\n\t\t})\n\t}\n\n\tconst selection = editor.selection\n\n\tif (!selection) {\n\t\treturn\n\t}\n\n\tconst closestViableParentEntry = ContemberEditor.closestViableBlockContainerEntry(editor)\n\n\tif (!closestViableParentEntry) {\n\t\treturn\n\t}\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tconst [targetParent, targetParentPath] = closestViableParentEntry\n\n\t\tif (SlateElement.isElement(targetParent) && Editor.hasInlines(editor, targetParent)) {\n\t\t\t// We're deliberately widening the selection to include all the inlines.\n\t\t\tconst listItemPath = [...targetParentPath, 0]\n\n\t\t\t// Not using wrapNodes because it appears to exhibit rather unpredictable treatment of text nodes.\n\t\t\tTransforms.insertNodes(editor, { type: listItemElementType, children: [] }, { at: listItemPath })\n\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\tto: [...listItemPath, 0],\n\t\t\t\tmatch: node => Text.isText(node) || SlateElement.isElement(node) && Editor.isInline(editor, node),\n\t\t\t\tat: {\n\t\t\t\t\tanchor: Editor.start(editor, [...targetParentPath, 1]),\n\t\t\t\t\tfocus: Editor.end(editor, [...targetParentPath, targetParent.children.length]),\n\t\t\t\t},\n\t\t\t})\n\t\t\tTransforms.wrapNodes(editor, { type: elementType, children: [] }, { at: listItemPath })\n\t\t} else {\n\t\t\tconst [selectionStart, selectionEnd] = Editor.edges(editor, selection)\n\t\t\tconst relativeStartIndex = selectionStart.path[targetParentPath.length]\n\t\t\tconst relativeEndIndex = selectionEnd.path[targetParentPath.length]\n\n\t\t\tfor (let i = relativeStartIndex; i <= relativeEndIndex; i++) {\n\t\t\t\tTransforms.wrapNodes(editor, { type: listItemElementType, children: [] }, { at: [...targetParentPath, i] })\n\t\t\t}\n\n\t\t\tconst emptyList: UnorderedListElement | OrderedListElement = {\n\t\t\t\t...suchThat,\n\t\t\t\ttype: elementType as (UnorderedListElement | OrderedListElement)['type'],\n\t\t\t\tchildren: [],\n\t\t\t}\n\t\t\tconst listPath = [...targetParentPath, relativeStartIndex]\n\t\t\tTransforms.insertNodes(editor, emptyList, { at: listPath })\n\n\t\t\tfor (let i = relativeStartIndex; i <= relativeEndIndex; i++) {\n\t\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\t\tto: [...listPath, i - relativeStartIndex],\n\t\t\t\t\t// The path doesn't depend on i because we keep moving the siblings away.\n\t\t\t\t\tat: [...targetParentPath, relativeStartInd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EAAE,IAAI,aAAA,CAAc;AAAA,IACvF,OAAO;AACN,YAAM,CAAC,gBAAgB,YAAY,IAAID,MAAAA,OAAO,MAAM,QAAQ,SAAS;AACrE,YAAM,qBAAqB,eAAe,KAAK,iBAAiB,MAAM;AACtE,YAAM,mBAAmB,aAAa,KAAK,iBAAiB,MAAM;AAElE,eAAS,IAAI,oBAAoB,KAAK,kBAAkB,KAAK;AAC5DC,cAAAA,WAAW,UAAU,QAAQ,EAAE,MAAME,gBAAAA,qBAAqB,UAAU,GAAC,GAAK,EAAE,IAAI,CAAC,GAAG,kBAAkB,CAAC,GAAG;AAAA,MAC3G;AAEA,YAAM,YAAuD;AAAA,QAC5D,GAAG;AAAA,QACH,MAAM;AAAA,QACN,UAAU,CAAA;AAAA,MAAC;AAEZ,YAAM,WAAW,CAAC,GAAG,kBAAkB,kBAAkB;AACzDF,YAAAA,WAAW,YAAY,QAAQ,WAAW,EAAE,IAAI,UAAU;AAE1D,eAAS,IAAI,oBAAoB,KAAK,kBAAkB,KAAK;AAC5DA,cAAAA,WAAW,UAAU,QAAQ;AAAA,UAC5B,IAAI,CAAC,GAAG,UAAU,IAAI,kBAAkB;AAAA;AAAA,UAExC,IAAI,CAAC,GAAG,kBAAkB,qBAAqB,CAAC;AAAA,QAAA,CAChD;AAAA,MACF;AAAA,IACD;AAAA,EACD,CAAC;AACF;;"}
1
+ {"version":3,"file":"toggleListElement.cjs","sources":["../../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/transforms/toggleListElement.ts"],"sourcesContent":["import { OrderedListElement, orderedListElementType } from '../OrderedListElement.js'\nimport { UnorderedListElement, unorderedListElementType } from '../UnorderedListElement.js'\nimport { Editor, Element as SlateElement, NodeEntry, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../../editor/index.js'\nimport { listItemElementType } from '../ListItemElement.js'\nimport { isListElement } from '../ListElement.js'\n\nexport const toggleListElement = <T extends OrderedListElement | UnorderedListElement>(\n\teditor: Editor,\n\telementType: T['type'],\n\tsuchThat: Partial<T> | undefined,\n\totherKindOfList: typeof orderedListElementType | typeof unorderedListElementType,\n) => {\n\tif (editor.isElementActive(elementType, suchThat)) {\n\t\tconst closestListEntry = ContemberEditor.closest(editor, {\n\t\t\tmatch: node => SlateElement.isElement(node) && node.type === elementType,\n\t\t}) as NodeEntry<UnorderedListElement | OrderedListElement>\n\t\tif (!closestListEntry) {\n\t\t\treturn\n\t\t}\n\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\tconst [closestList, closestListPath] = closestListEntry\n\n\t\t\t// It's important that we iterate backwards because otherwise we'd mangle the paths.\n\t\t\t// We unwrap elements which may have more than one child.\n\t\t\tfor (let i = closestList.children.length - 1; i >= 0; i--) {\n\t\t\t\tconst currentItemPath = [...closestListPath, i]\n\t\t\t\tif (Editor.hasInlines(editor, closestList.children[i] as SlateElement)) {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: currentItemPath,\n\t\t\t\t\t})\n\t\t\t\t\tTransforms.unwrapNodes(editor, {\n\t\t\t\t\t\tat: [...currentItemPath, 0],\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tTransforms.unwrapNodes(editor, { at: currentItemPath })\n\t\t\t\t}\n\t\t\t}\n\t\t\tTransforms.unwrapNodes(editor, { at: closestListPath })\n\t\t})\n\t}\n\tif (editor.isElementActive(elementType) || editor.isElementActive(otherKindOfList)) {\n\t\t// We're in a list but a different one. Note the lack of 'suchThat'\n\t\tconst closestListEntry = ContemberEditor.closest(editor, {\n\t\t\tmatch: node => isListElement(node),\n\t\t}) as NodeEntry<UnorderedListElement | OrderedListElement>\n\t\tif (!closestListEntry) {\n\t\t\treturn\n\t\t}\n\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\tconst [, closestListPath] = closestListEntry\n\t\t\tContemberEditor.ejectElement(editor, closestListPath)\n\t\t\tTransforms.setNodes(editor, { ...suchThat, type: elementType }, { at: closestListPath })\n\t\t})\n\t}\n\n\tconst selection = editor.selection\n\n\tif (!selection) {\n\t\treturn\n\t}\n\n\tconst closestViableParentEntry = ContemberEditor.closestViableBlockContainerEntry(editor)\n\n\tif (!closestViableParentEntry) {\n\t\treturn\n\t}\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tconst [targetParent, targetParentPath] = closestViableParentEntry\n\n\t\tif (SlateElement.isElement(targetParent) && Editor.hasInlines(editor, targetParent)) {\n\t\t\t// We're deliberately widening the selection to include all the inlines.\n\t\t\tconst listItemPath = [...targetParentPath, 0]\n\n\t\t\t// Not using wrapNodes because it appears to exhibit rather unpredictable treatment of text nodes.\n\t\t\tTransforms.insertNodes(editor, { type: listItemElementType, children: [] }, { at: listItemPath })\n\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\tto: [...listItemPath, 0],\n\t\t\t\tmatch: node => Text.isText(node) || SlateElement.isElement(node) && Editor.isInline(editor, node),\n\t\t\t\tat: {\n\t\t\t\t\tanchor: Editor.start(editor, [...targetParentPath, 1]),\n\t\t\t\t\tfocus: Editor.end(editor, [...targetParentPath, targetParent.children.length]),\n\t\t\t\t},\n\t\t\t})\n\t\t\tTransforms.wrapNodes(editor, { type: elementType, children: [] }, { at: listItemPath })\n\t\t} else {\n\t\t\tconst [selectionStart, selectionEnd] = Editor.edges(editor, selection)\n\t\t\tconst relativeStartIndex = selectionStart.path[targetParentPath.length]\n\t\t\tconst relativeEndIndex = selectionEnd.path[targetParentPath.length]\n\n\t\t\tfor (let i = relativeStartIndex; i <= relativeEndIndex; i++) {\n\t\t\t\tTransforms.wrapNodes(editor, { type: listItemElementType, children: [] }, { at: [...targetParentPath, i] })\n\t\t\t}\n\n\t\t\tconst emptyList: UnorderedListElement | OrderedListElement = {\n\t\t\t\t...suchThat,\n\t\t\t\ttype: elementType as (UnorderedListElement | OrderedListElement)['type'],\n\t\t\t\tchildren: [],\n\t\t\t}\n\t\t\tconst listPath = [...targetParentPath, relativeStartIndex]\n\t\t\tTransforms.insertNodes(editor, emptyList, { at: listPath })\n\n\t\t\tfor (let i = relativeStartIndex; i <= relativeEndIndex; i++) {\n\t\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\t\tto: [...listPath, i - relativeStartIndex],\n\t\t\t\t\t// The path doesn't depend on i because we keep moving the siblings away.\n\t\t\t\t\tat: [...targetParentPath, relativeStartIndex + 1],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["ContemberEditor","SlateElement","Editor","Transforms","isListElement","listItemElementType","Text"],"mappings":";;;;;;AAOO,MAAM,oBAAoB,CAChC,QACA,aACA,UACA,oBACI;AACJ,MAAI,OAAO,gBAAgB,aAAa,QAAQ,GAAG;AAClD,UAAM,mBAAmBA,MAAAA,gBAAgB,QAAQ,QAAQ;AAAA,MACxD,OAAO,CAAA,SAAQC,MAAAA,QAAa,UAAU,IAAI,KAAK,KAAK,SAAS;AAAA,IAAA,CAC7D;AACD,QAAI,CAAC,kBAAkB;AACtB;AAAA,IACD;AACA,WAAOC,MAAAA,OAAO,mBAAmB,QAAQ,MAAM;AAC9C,YAAM,CAAC,aAAa,eAAe,IAAI;AAIvC,eAAS,IAAI,YAAY,SAAS,SAAS,GAAG,KAAK,GAAG,KAAK;AAC1D,cAAM,kBAAkB,CAAC,GAAG,iBAAiB,CAAC;AAC9C,YAAIA,MAAAA,OAAO,WAAW,QAAQ,YAAY,SAAS,CAAC,CAAiB,GAAG;AACvEC,gBAAAA,WAAW,UAAU,QAAQ,OAAO,qBAAqB,CAAA,CAAE,GAAG;AAAA,YAC7D,IAAI;AAAA,UAAA,CACJ;AACDA,gBAAAA,WAAW,YAAY,QAAQ;AAAA,YAC9B,IAAI,CAAC,GAAG,iBAAiB,CAAC;AAAA,UAAA,CAC1B;AAAA,QACF,OAAO;AACNA,gBAAAA,WAAW,YAAY,QAAQ,EAAE,IAAI,iBAAiB;AAAA,QACvD;AAAA,MACD;AACAA,YAAAA,WAAW,YAAY,QAAQ,EAAE,IAAI,iBAAiB;AAAA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AG,kBAAkB,CAAC,CAAC;AAAA,UACrD,OAAOA,MAAAA,OAAO,IAAI,QAAQ,CAAC,GAAG,kBAAkB,aAAa,SAAS,MAAM,CAAC;AAAA,QAAA;AAAA,MAC9E,CACA;AACDC,YAAAA,WAAW,UAAU,QAAQ,EAAE,MAAM,aAAa,UAAU,GAAC,GAAK,EAAE,IAAI,aAAA,CAAc;AAAA,IACvF,OAAO;AACN,YAAM,CAAC,gBAAgB,YAAY,IAAID,MAAAA,OAAO,MAAM,QAAQ,SAAS;AACrE,YAAM,qBAAqB,eAAe,KAAK,iBAAiB,MAAM;AACtE,YAAM,mBAAmB,aAAa,KAAK,iBAAiB,MAAM;AAElE,eAAS,IAAI,oBAAoB,KAAK,kBAAkB,KAAK;AAC5DC,cAAAA,WAAW,UAAU,QAAQ,EAAE,MAAME,gBAAAA,qBAAqB,UAAU,GAAC,GAAK,EAAE,IAAI,CAAC,GAAG,kBAAkB,CAAC,GAAG;AAAA,MAC3G;AAEA,YAAM,YAAuD;AAAA,QAC5D,GAAG;AAAA,QACH,MAAM;AAAA,QACN,UAAU,CAAA;AAAA,MAAC;AAEZ,YAAM,WAAW,CAAC,GAAG,kBAAkB,kBAAkB;AACzDF,YAAAA,WAAW,YAAY,QAAQ,WAAW,EAAE,IAAI,UAAU;AAE1D,eAAS,IAAI,oBAAoB,KAAK,kBAAkB,KAAK;AAC5DA,cAAAA,WAAW,UAAU,QAAQ;AAAA,UAC5B,IAAI,CAAC,GAAG,UAAU,IAAI,kBAAkB;AAAA;AAAA,UAExC,IAAI,CAAC,GAAG,kBAAkB,qBAAqB,CAAC;AAAA,QAAA,CAChD;AAAA,MACF;AAAA,IACD;AAAA,EACD,CAAC;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"toggleListElement.js","sources":["../../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/transforms/toggleListElement.ts"],"sourcesContent":["import { OrderedListElement, orderedListElementType } from '../OrderedListElement'\nimport { UnorderedListElement, unorderedListElementType } from '../UnorderedListElement'\nimport { Editor, Element as SlateElement, NodeEntry, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../../editor'\nimport { listItemElementType } from '../ListItemElement'\nimport { isListElement } from '../ListElement'\n\nexport const toggleListElement = <T extends OrderedListElement | UnorderedListElement>(\n\teditor: Editor,\n\telementType: T['type'],\n\tsuchThat: Partial<T> | undefined,\n\totherKindOfList: typeof orderedListElementType | typeof unorderedListElementType,\n) => {\n\tif (editor.isElementActive(elementType, suchThat)) {\n\t\tconst closestListEntry = ContemberEditor.closest(editor, {\n\t\t\tmatch: node => SlateElement.isElement(node) && node.type === elementType,\n\t\t}) as NodeEntry<UnorderedListElement | OrderedListElement>\n\t\tif (!closestListEntry) {\n\t\t\treturn\n\t\t}\n\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\tconst [closestList, closestListPath] = closestListEntry\n\n\t\t\t// It's important that we iterate backwards because otherwise we'd mangle the paths.\n\t\t\t// We unwrap elements which may have more than one child.\n\t\t\tfor (let i = closestList.children.length - 1; i >= 0; i--) {\n\t\t\t\tconst currentItemPath = [...closestListPath, i]\n\t\t\t\tif (Editor.hasInlines(editor, closestList.children[i] as SlateElement)) {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: currentItemPath,\n\t\t\t\t\t})\n\t\t\t\t\tTransforms.unwrapNodes(editor, {\n\t\t\t\t\t\tat: [...currentItemPath, 0],\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tTransforms.unwrapNodes(editor, { at: currentItemPath })\n\t\t\t\t}\n\t\t\t}\n\t\t\tTransforms.unwrapNodes(editor, { at: closestListPath })\n\t\t})\n\t}\n\tif (editor.isElementActive(elementType) || editor.isElementActive(otherKindOfList)) {\n\t\t// We're in a list but a different one. Note the lack of 'suchThat'\n\t\tconst closestListEntry = ContemberEditor.closest(editor, {\n\t\t\tmatch: node => isListElement(node),\n\t\t}) as NodeEntry<UnorderedListElement | OrderedListElement>\n\t\tif (!closestListEntry) {\n\t\t\treturn\n\t\t}\n\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\tconst [, closestListPath] = closestListEntry\n\t\t\tContemberEditor.ejectElement(editor, closestListPath)\n\t\t\tTransforms.setNodes(editor, { ...suchThat, type: elementType }, { at: closestListPath })\n\t\t})\n\t}\n\n\tconst selection = editor.selection\n\n\tif (!selection) {\n\t\treturn\n\t}\n\n\tconst closestViableParentEntry = ContemberEditor.closestViableBlockContainerEntry(editor)\n\n\tif (!closestViableParentEntry) {\n\t\treturn\n\t}\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tconst [targetParent, targetParentPath] = closestViableParentEntry\n\n\t\tif (SlateElement.isElement(targetParent) && Editor.hasInlines(editor, targetParent)) {\n\t\t\t// We're deliberately widening the selection to include all the inlines.\n\t\t\tconst listItemPath = [...targetParentPath, 0]\n\n\t\t\t// Not using wrapNodes because it appears to exhibit rather unpredictable treatment of text nodes.\n\t\t\tTransforms.insertNodes(editor, { type: listItemElementType, children: [] }, { at: listItemPath })\n\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\tto: [...listItemPath, 0],\n\t\t\t\tmatch: node => Text.isText(node) || SlateElement.isElement(node) && Editor.isInline(editor, node),\n\t\t\t\tat: {\n\t\t\t\t\tanchor: Editor.start(editor, [...targetParentPath, 1]),\n\t\t\t\t\tfocus: Editor.end(editor, [...targetParentPath, targetParent.children.length]),\n\t\t\t\t},\n\t\t\t})\n\t\t\tTransforms.wrapNodes(editor, { type: elementType, children: [] }, { at: listItemPath })\n\t\t} else {\n\t\t\tconst [selectionStart, selectionEnd] = Editor.edges(editor, selection)\n\t\t\tconst relativeStartIndex = selectionStart.path[targetParentPath.length]\n\t\t\tconst relativeEndIndex = selectionEnd.path[targetParentPath.length]\n\n\t\t\tfor (let i = relativeStartIndex; i <= relativeEndIndex; i++) {\n\t\t\t\tTransforms.wrapNodes(editor, { type: listItemElementType, children: [] }, { at: [...targetParentPath, i] })\n\t\t\t}\n\n\t\t\tconst emptyList: UnorderedListElement | OrderedListElement = {\n\t\t\t\t...suchThat,\n\t\t\t\ttype: elementType as (UnorderedListElement | OrderedListElement)['type'],\n\t\t\t\tchildren: [],\n\t\t\t}\n\t\t\tconst listPath = [...targetParentPath, relativeStartIndex]\n\t\t\tTransforms.insertNodes(editor, emptyList, { at: listPath })\n\n\t\t\tfor (let i = relativeStartIndex; i <= relativeEndIndex; i++) {\n\t\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\t\tto: [...listPath, i - relativeStartIndex],\n\t\t\t\t\t// The path doesn't depend on i because we keep moving the siblings away.\n\t\t\t\t\tat: [...targetParentPath, relativeStartIndex + 1],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["SlateElement"],"mappings":";;;;AAOO,MAAM,oBAAoB,CAChC,QACA,aACA,UACA,oBACI;AACJ,MAAI,OAAO,gBAAgB,aAAa,QAAQ,GAAG;AAClD,UAAM,mBAAmB,gBAAgB,QAAQ,QAAQ;AAAA,MACxD,OAAO,CAAA,SAAQA,QAAa,UAAU,IAAI,KAAK,KAAK,SAAS;AAAA,IAAA,CAC7D;AACD,QAAI,CAAC,kBAAkB;AACtB;AAAA,IACD;AACA,WAAO,OAAO,mBAAmB,QAAQ,MAAM;AAC9C,YAAM,CAAC,aAAa,eAAe,IAAI;AAIvC,eAAS,IAAI,YAAY,SAAS,SAAS,GAAG,KAAK,GAAG,KAAK;AAC1D,cAAM,kBAAkB,CAAC,GAAG,iBAAiB,CAAC;AAC9C,YAAI,OAAO,WAAW,QAAQ,YAAY,SAAS,CAAC,CAAiB,GAAG;AACvE,qBAAW,UAAU,QAAQ,OAAO,qBAAqB,CAAA,CAAE,GAAG;AAAA,YAC7D,IAAI;AAAA,UAAA,CACJ;AACD,qBAAW,YAAY,QAAQ;AAAA,YAC9B,IAAI,CAAC,GAAG,iBAAiB,CAAC;AAAA,UAAA,CAC1B;AAAA,QACF,OAAO;AACN,qBAAW,YAA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AAkB,CAAC,CAAC;AAAA,UACrD,OAAO,OAAO,IAAI,QAAQ,CAAC,GAAG,kBAAkB,aAAa,SAAS,MAAM,CAAC;AAAA,QAAA;AAAA,MAC9E,CACA;AACD,iBAAW,UAAU,QAAQ,EAAE,MAAM,aAAa,UAAU,GAAC,GAAK,EAAE,IAAI,aAAA,CAAc;AAAA,IACvF,OAAO;AACN,YAAM,CAAC,gBAAgB,YAAY,IAAI,OAAO,MAAM,QAAQ,SAAS;AACrE,YAAM,qBAAqB,eAAe,KAAK,iBAAiB,MAAM;AACtE,YAAM,mBAAmB,aAAa,KAAK,iBAAiB,MAAM;AAElE,eAAS,IAAI,oBAAoB,KAAK,kBAAkB,KAAK;AAC5D,mBAAW,UAAU,QAAQ,EAAE,MAAM,qBAAqB,UAAU,GAAC,GAAK,EAAE,IAAI,CAAC,GAAG,kBAAkB,CAAC,GAAG;AAAA,MAC3G;AAEA,YAAM,YAAuD;AAAA,QAC5D,GAAG;AAAA,QACH,MAAM;AAAA,QACN,UAAU,CAAA;AAAA,MAAC;AAEZ,YAAM,WAAW,CAAC,GAAG,kBAAkB,kBAAkB;AACzD,iBAAW,YAAY,QAAQ,WAAW,EAAE,IAAI,UAAU;AAE1D,eAAS,IAAI,oBAAoB,KAAK,kBAAkB,KAAK;AAC5D,mBAAW,UAAU,QAAQ;AAAA,UAC5B,IAAI,CAAC,GAAG,UAAU,IAAI,kBAAkB;AAAA;AAAA,UAExC,IAAI,CAAC,GAAG,kBAAkB,qBAAqB,CAAC;AAAA,QAAA,CAChD;AAAA,MACF;AAAA,IACD;AAAA,EACD,CAAC;AACF;"}
1
+ {"version":3,"file":"toggleListElement.js","sources":["../../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/transforms/toggleListElement.ts"],"sourcesContent":["import { OrderedListElement, orderedListElementType } from '../OrderedListElement.js'\nimport { UnorderedListElement, unorderedListElementType } from '../UnorderedListElement.js'\nimport { Editor, Element as SlateElement, NodeEntry, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../../editor/index.js'\nimport { listItemElementType } from '../ListItemElement.js'\nimport { isListElement } from '../ListElement.js'\n\nexport const toggleListElement = <T extends OrderedListElement | UnorderedListElement>(\n\teditor: Editor,\n\telementType: T['type'],\n\tsuchThat: Partial<T> | undefined,\n\totherKindOfList: typeof orderedListElementType | typeof unorderedListElementType,\n) => {\n\tif (editor.isElementActive(elementType, suchThat)) {\n\t\tconst closestListEntry = ContemberEditor.closest(editor, {\n\t\t\tmatch: node => SlateElement.isElement(node) && node.type === elementType,\n\t\t}) as NodeEntry<UnorderedListElement | OrderedListElement>\n\t\tif (!closestListEntry) {\n\t\t\treturn\n\t\t}\n\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\tconst [closestList, closestListPath] = closestListEntry\n\n\t\t\t// It's important that we iterate backwards because otherwise we'd mangle the paths.\n\t\t\t// We unwrap elements which may have more than one child.\n\t\t\tfor (let i = closestList.children.length - 1; i >= 0; i--) {\n\t\t\t\tconst currentItemPath = [...closestListPath, i]\n\t\t\t\tif (Editor.hasInlines(editor, closestList.children[i] as SlateElement)) {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: currentItemPath,\n\t\t\t\t\t})\n\t\t\t\t\tTransforms.unwrapNodes(editor, {\n\t\t\t\t\t\tat: [...currentItemPath, 0],\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tTransforms.unwrapNodes(editor, { at: currentItemPath })\n\t\t\t\t}\n\t\t\t}\n\t\t\tTransforms.unwrapNodes(editor, { at: closestListPath })\n\t\t})\n\t}\n\tif (editor.isElementActive(elementType) || editor.isElementActive(otherKindOfList)) {\n\t\t// We're in a list but a different one. Note the lack of 'suchThat'\n\t\tconst closestListEntry = ContemberEditor.closest(editor, {\n\t\t\tmatch: node => isListElement(node),\n\t\t}) as NodeEntry<UnorderedListElement | OrderedListElement>\n\t\tif (!closestListEntry) {\n\t\t\treturn\n\t\t}\n\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\tconst [, closestListPath] = closestListEntry\n\t\t\tContemberEditor.ejectElement(editor, closestListPath)\n\t\t\tTransforms.setNodes(editor, { ...suchThat, type: elementType }, { at: closestListPath })\n\t\t})\n\t}\n\n\tconst selection = editor.selection\n\n\tif (!selection) {\n\t\treturn\n\t}\n\n\tconst closestViableParentEntry = ContemberEditor.closestViableBlockContainerEntry(editor)\n\n\tif (!closestViableParentEntry) {\n\t\treturn\n\t}\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tconst [targetParent, targetParentPath] = closestViableParentEntry\n\n\t\tif (SlateElement.isElement(targetParent) && Editor.hasInlines(editor, targetParent)) {\n\t\t\t// We're deliberately widening the selection to include all the inlines.\n\t\t\tconst listItemPath = [...targetParentPath, 0]\n\n\t\t\t// Not using wrapNodes because it appears to exhibit rather unpredictable treatment of text nodes.\n\t\t\tTransforms.insertNodes(editor, { type: listItemElementType, children: [] }, { at: listItemPath })\n\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\tto: [...listItemPath, 0],\n\t\t\t\tmatch: node => Text.isText(node) || SlateElement.isElement(node) && Editor.isInline(editor, node),\n\t\t\t\tat: {\n\t\t\t\t\tanchor: Editor.start(editor, [...targetParentPath, 1]),\n\t\t\t\t\tfocus: Editor.end(editor, [...targetParentPath, targetParent.children.length]),\n\t\t\t\t},\n\t\t\t})\n\t\t\tTransforms.wrapNodes(editor, { type: elementType, children: [] }, { at: listItemPath })\n\t\t} else {\n\t\t\tconst [selectionStart, selectionEnd] = Editor.edges(editor, selection)\n\t\t\tconst relativeStartIndex = selectionStart.path[targetParentPath.length]\n\t\t\tconst relativeEndIndex = selectionEnd.path[targetParentPath.length]\n\n\t\t\tfor (let i = relativeStartIndex; i <= relativeEndIndex; i++) {\n\t\t\t\tTransforms.wrapNodes(editor, { type: listItemElementType, children: [] }, { at: [...targetParentPath, i] })\n\t\t\t}\n\n\t\t\tconst emptyList: UnorderedListElement | OrderedListElement = {\n\t\t\t\t...suchThat,\n\t\t\t\ttype: elementType as (UnorderedListElement | OrderedListElement)['type'],\n\t\t\t\tchildren: [],\n\t\t\t}\n\t\t\tconst listPath = [...targetParentPath, relativeStartIndex]\n\t\t\tTransforms.insertNodes(editor, emptyList, { at: listPath })\n\n\t\t\tfor (let i = relativeStartIndex; i <= relativeEndIndex; i++) {\n\t\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\t\tto: [...listPath, i - relativeStartIndex],\n\t\t\t\t\t// The path doesn't depend on i because we keep moving the siblings away.\n\t\t\t\t\tat: [...targetParentPath, relativeStartIndex + 1],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t})\n}\n"],"names":["SlateElement"],"mappings":";;;;AAOO,MAAM,oBAAoB,CAChC,QACA,aACA,UACA,oBACI;AACJ,MAAI,OAAO,gBAAgB,aAAa,QAAQ,GAAG;AAClD,UAAM,mBAAmB,gBAAgB,QAAQ,QAAQ;AAAA,MACxD,OAAO,CAAA,SAAQA,QAAa,UAAU,IAAI,KAAK,KAAK,SAAS;AAAA,IAAA,CAC7D;AACD,QAAI,CAAC,kBAAkB;AACtB;AAAA,IACD;AACA,WAAO,OAAO,mBAAmB,QAAQ,MAAM;AAC9C,YAAM,CAAC,aAAa,eAAe,IAAI;AAIvC,eAAS,IAAI,YAAY,SAAS,SAAS,GAAG,KAAK,GAAG,KAAK;AAC1D,cAAM,kBAAkB,CAAC,GAAG,iBAAiB,CAAC;AAC9C,YAAI,OAAO,WAAW,QAAQ,YAAY,SAAS,CAAC,CAAiB,GAAG;AACvE,qBAAW,UAAU,QAAQ,OAAO,qBAAqB,CAAA,CAAE,GAAG;AAAA,YAC7D,IAAI;AAAA,UAAA,CACJ;AACD,qBAAW,YAAY,QAAQ;AAAA,YAC9B,IAAI,CAAC,GAAG,iBAAiB,CAAC;AAAA,UAAA,CAC1B;AAAA,QACF,OAAO;AACN,qBAAW,YAAY,QAAQ,EAAE,IAAI,iBAAiB;AAAA,QACvD;AAAA,MACD;AACA,i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C,GAAG,kBAAkB,aAAa,SAAS,MAAM,CAAC;AAAA,QAAA;AAAA,MAC9E,CACA;AACD,iBAAW,UAAU,QAAQ,EAAE,MAAM,aAAa,UAAU,GAAC,GAAK,EAAE,IAAI,aAAA,CAAc;AAAA,IACvF,OAAO;AACN,YAAM,CAAC,gBAAgB,YAAY,IAAI,OAAO,MAAM,QAAQ,SAAS;AACrE,YAAM,qBAAqB,eAAe,KAAK,iBAAiB,MAAM;AACtE,YAAM,mBAAmB,aAAa,KAAK,iBAAiB,MAAM;AAElE,eAAS,IAAI,oBAAoB,KAAK,kBAAkB,KAAK;AAC5D,mBAAW,UAAU,QAAQ,EAAE,MAAM,qBAAqB,UAAU,GAAC,GAAK,EAAE,IAAI,CAAC,GAAG,kBAAkB,CAAC,GAAG;AAAA,MAC3G;AAEA,YAAM,YAAuD;AAAA,QAC5D,GAAG;AAAA,QACH,MAAM;AAAA,QACN,UAAU,CAAA;AAAA,MAAC;AAEZ,YAAM,WAAW,CAAC,GAAG,kBAAkB,kBAAkB;AACzD,iBAAW,YAAY,QAAQ,WAAW,EAAE,IAAI,UAAU;AAE1D,eAAS,IAAI,oBAAoB,KAAK,kBAAkB,KAAK;AAC5D,mBAAW,UAAU,QAAQ;AAAA,UAC5B,IAAI,CAAC,GAAG,UAAU,IAAI,kBAAkB;AAAA;AAAA,UAExC,IAAI,CAAC,GAAG,kBAAkB,qBAAqB,CAAC;AAAA,QAAA,CAChD;AAAA,MACF;AAAA,IACD;AAAA,EACD,CAAC;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withLists.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/withLists.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isListItemElement, ListItemElement, listItemElementPlugin } from './ListItemElement'\nimport { OrderedListElement, orderedListElementPlugin } from './OrderedListElement'\nimport { dedentListItem, indentListItem } from './transforms'\nimport { UnorderedListElement, unorderedListElementPlugin } from './UnorderedListElement'\nimport { isListElement } from './ListElement'\nimport { listHtmlDeserializerFactory } from './ListHtmlDeserializer'\nimport { ElementRenderer } from '../../../types'\n\nexport const withLists = ({ renderListItem, renderUnorderedList, renderOrderedList }: {\n\trenderListItem: ElementRenderer<ListItemElement>\n\trenderOrderedList: ElementRenderer<OrderedListElement>\n\trenderUnorderedList: ElementRenderer<UnorderedListElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(listItemElementPlugin({ render: renderListItem }))\n\teditor.registerElement(orderedListElementPlugin({ render: renderOrderedList }))\n\teditor.registerElement(unorderedListElementPlugin({ render: renderUnorderedList }))\n\n\teditor.htmlDeserializer.registerPlugin(listHtmlDeserializerFactory())\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst { selection } = editor\n\n\t\t\tif (!selection || !SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry === undefined) {\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\t\t\tconst [closestBlock, closestBlockPath] = closestBlockEntry\n\n\t\t\tlet containingListItem: ListItemElement\n\t\t\tlet containingListItemPath: SlatePath\n\n\t\t\tif (!isListItemElement(closestBlock)) {\n\t\t\t\tif (closestBlockPath.length < 2) {\n\t\t\t\t\t// This block cannot be inside a list\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\tcontainingListItemPath = SlatePath.parent(closestBlockPath)\n\t\t\t\tconst closestListItem = SlateNode.get(editor, containingListItemPath)\n\n\t\t\t\tif (!isListItemElement(closestListItem)) {\n\t\t\t\t\t// The block is not inside a list\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\t\t\t\tcontainingListItem = closestListItem\n\t\t\t} else {\n\t\t\t\tcontainingListItem = closestBlock\n\t\t\t\tcontainingListItemPath = closestBlockPath\n\t\t\t}\n\n\t\t\tif (SlateNode.string(containingListItem) !== '') {\n\t\t\t\treturn Transforms.splitNodes(editor, {\n\t\t\t\t\talways: true,\n\t\t\t\t\tat: selection.focus,\n\t\t\t\t\tmatch: node => isListItemElement(node),\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// We're in a list and want to leave this list.\n\n\t\t\tconst containingListPath = SlatePath.parent(containingListItemPath)\n\t\t\tconst containingList = SlateNode.get(editor, containingListPath)\n\n\t\t\tif (!isListElement(containingList)) {\n\t\t\t\t// This shouldn't really happen. It's more of a sanity check.\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\n\t\t\tconst followingListItemPath = SlatePath.next(containingListItemPath)\n\t\t\tconst hasFollowingListItem = SlateNode.has(editor, followingListItemPath)\n\n\t\t\tif (hasFollowingListItem) {\n\t\t\t\tconst followingListItemNode = SlateNode.get(editor, followingListItemPath)\n\t\t\t\tif (!isListItemElement(followingListItemNode)) {\n\t\t\t\t\t// This shouldn't really happen. It's more of a sanity check.\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\t\t\t\tif (containingListItemPath[containingListItemPath.length - 1] === 0) {\n\t\t\t\t\t// We're at the beginning of a list\n\t\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t// Remove the trailing empty listItem\n\t\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: containingListPath, select: true })\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\t// We're in the middle of a list.\n\t\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tTransforms.splitNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tconst afterListParent = SlatePath.next(containingListPath)\n\t\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: afterListParent, select: true })\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We're at the end of a list.\n\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\tconst afterListParent = SlatePath.next(containingListPath)\n\t\t\t\t\t// Remove the trailing empty listItem\n\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: afterListParent, select: true })\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\t// TODO this should also work for expanded selections\n\t\t\tif (\n\t\t\t\t(event.key !== 'Tab' && event.key !== 'Enter')\n\t\t\t\t|| !editor.selection\n\t\t\t\t|| !SlateRange.isCollapsed(editor.selection)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst selection = editor.selection\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection.focus })\n\n\t\t\tif (closestBlockEntry === undefined) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet [closestBlockElement, closestBlockPath] = closestBlockEntry\n\t\t\tif (!SlateElement.isElement(closestBlockElement)) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (editor.isDefaultElement(closestBlockElement)) {\n\t\t\t\t\t;[closestBlockElement, closestBlockPath] = Editor.parent(editor, closestBlockPath)\n\t\t\t\t}\n\t\t\t\tif (!isListItemElement(closestBlockElement)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tconst succeeded = event.shiftKey\n\t\t\t\t\t? dedentListItem(editor, closestBlockElement, closestBlockPath)\n\t\t\t\t\t: indentListItem(editor, closestBlockElement, closestBlockPath)\n\n\t\t\t\tif (succeeded) {\n\t\t\t\t\treturn event.preventDefault()\n\t\t\t\t}\n\t\t\t} else if (event.key === 'Enter' && event.shiftKey) {\n\t\t\t\tif (editor.isDefaultElement(closestBlockElement)) {\n\t\t\t\t\tconst [listItem] = Editor.parent(editor, closestBlockPath)\n\t\t\t\t\tif (!isListItemElement(listItem)) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\treturn Transforms.splitNodes(editor, {\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t\tat: selection.focus,\n\t\t\t\t\t\tmatch: node => SlateElement.isElement(node) && Editor.isBlock(editor, node) && editor.isDefaultElement(node),\n\t\t\t\t\t})\n\t\t\t\t} else if (isListItemElement(closestBlockElement)) {\n\t\t\t\t\t// We want to create a newline but the closest block is the list item.\n\t\t\t\t\t// This should mean that it only contains inlines. Hence we wrap them in a default element\n\t\t\t\t\t// and then split it.\n\t\t\t\t\tconst [listItemStart, listItemEnd] = Editor.edges(editor, closestBlockPath)\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\t\tmatch: node => Text.isText(node) || (SlateElement.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\t\tanchor: listItemStart,\n\t\t\t\t\t\t\t\tfocus: listItemEnd,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})\n\t\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\talways: true,\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\treturn onKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["listItemElementPlugin","orderedListElementPlugin","unorderedListElementPlugin","listHtmlDeserializerFactory","SlateRange","ContemberEditor","isListItemElement","SlatePath","SlateNode","Transforms","isListElement","Editor","SlateElement","dedentListItem","indentListItem","Text"],"mappings":";;;;;;;;;;;AAUO,MAAM,YAAY,CAAC,EAAE,gBAAgB,qBAAqB,kBAAA,MAKjE,CAAmB,WAAiB;AACnC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgBA,gBAAAA,sBAAsB,EAAE,QAAQ,eAAA,CAAgB,CAAC;AACxE,SAAO,gBAAgBC,mBAAAA,yBAAyB,EAAE,QAAQ,kBAAA,CAAmB,CAAC;AAC9E,SAAO,gBAAgBC,qBAAAA,2BAA2B,EAAE,QAAQ,oBAAA,CAAqB,CAAC;AAElF,SAAO,iBAAiB,eAAeC,qBAAAA,6BAA6B;AAEpE,SAAO,OAAgC,QAAQ;AAAA,IAC9C,aAAa,MAAM;AAClB,YAAM,EAAE,cAAc;AAEtB,UAAI,CAAC,aAAa,CAACC,MAAAA,MAAW,YAAY,SAAS,GAAG;AACrD,eAAO,YAAA;AAAA,MACR;AACA,YAAM,oBAAoBC,MAAAA,gBAAgB,kBAAkB,MAAM;AAClE,UAAI,sBAAsB,QAAW;AACpC,eAAO,YAAA;AAAA,MACR;AACA,YAAM,CAAC,cAAc,gBAAgB,IAAI;AAEzC,UAAI;AACJ,UAAI;AAEJ,UAAI,CAACC,gBAAAA,kBAAkB,YAAY,GAAG;AACrC,YAAI,iBAAiB,SAAS,GAAG;AAEhC,iBAAO,YAAA;AAAA,QACR;AAEA,iCAAyBC,MAAAA,KAAU,OAAO,gBAAgB;AAC1D,cAAM,kBAAkBC,MAAAA,KAAU,IAAI,QAAQ,sBAAsB;AA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AAA,gBACH,MAAM,CAAC,GAAG,kBAAkB,GAAG,GAAG,QAAQ;AAAA,gBAC1C,QAAQ,UAAU,MAAM;AAAA,cAAA;AAAA,cAEzB,QAAQ;AAAA,YAAA,CACR;AAAA,UACF,CAAC;AAAA,QACF;AAAA,MACD;AACA,aAAO,UAAU,KAAK;AAAA,IACvB;AAAA,EAAA,CACA;AAED,SAAO;AACR;;"}
1
+ {"version":3,"file":"withLists.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/withLists.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { isListItemElement, ListItemElement, listItemElementPlugin } from './ListItemElement.js'\nimport { OrderedListElement, orderedListElementPlugin } from './OrderedListElement.js'\nimport { dedentListItem, indentListItem } from './transforms/index.js'\nimport { UnorderedListElement, unorderedListElementPlugin } from './UnorderedListElement.js'\nimport { isListElement } from './ListElement.js'\nimport { listHtmlDeserializerFactory } from './ListHtmlDeserializer.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withLists = ({ renderListItem, renderUnorderedList, renderOrderedList }: {\n\trenderListItem: ElementRenderer<ListItemElement>\n\trenderOrderedList: ElementRenderer<OrderedListElement>\n\trenderUnorderedList: ElementRenderer<UnorderedListElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(listItemElementPlugin({ render: renderListItem }))\n\teditor.registerElement(orderedListElementPlugin({ render: renderOrderedList }))\n\teditor.registerElement(unorderedListElementPlugin({ render: renderUnorderedList }))\n\n\teditor.htmlDeserializer.registerPlugin(listHtmlDeserializerFactory())\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst { selection } = editor\n\n\t\t\tif (!selection || !SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry === undefined) {\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\t\t\tconst [closestBlock, closestBlockPath] = closestBlockEntry\n\n\t\t\tlet containingListItem: ListItemElement\n\t\t\tlet containingListItemPath: SlatePath\n\n\t\t\tif (!isListItemElement(closestBlock)) {\n\t\t\t\tif (closestBlockPath.length < 2) {\n\t\t\t\t\t// This block cannot be inside a list\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\tcontainingListItemPath = SlatePath.parent(closestBlockPath)\n\t\t\t\tconst closestListItem = SlateNode.get(editor, containingListItemPath)\n\n\t\t\t\tif (!isListItemElement(closestListItem)) {\n\t\t\t\t\t// The block is not inside a list\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\t\t\t\tcontainingListItem = closestListItem\n\t\t\t} else {\n\t\t\t\tcontainingListItem = closestBlock\n\t\t\t\tcontainingListItemPath = closestBlockPath\n\t\t\t}\n\n\t\t\tif (SlateNode.string(containingListItem) !== '') {\n\t\t\t\treturn Transforms.splitNodes(editor, {\n\t\t\t\t\talways: true,\n\t\t\t\t\tat: selection.focus,\n\t\t\t\t\tmatch: node => isListItemElement(node),\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// We're in a list and want to leave this list.\n\n\t\t\tconst containingListPath = SlatePath.parent(containingListItemPath)\n\t\t\tconst containingList = SlateNode.get(editor, containingListPath)\n\n\t\t\tif (!isListElement(containingList)) {\n\t\t\t\t// This shouldn't really happen. It's more of a sanity check.\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\n\t\t\tconst followingListItemPath = SlatePath.next(containingListItemPath)\n\t\t\tconst hasFollowingListItem = SlateNode.has(editor, followingListItemPath)\n\n\t\t\tif (hasFollowingListItem) {\n\t\t\t\tconst followingListItemNode = SlateNode.get(editor, followingListItemPath)\n\t\t\t\tif (!isListItemElement(followingListItemNode)) {\n\t\t\t\t\t// This shouldn't really happen. It's more of a sanity check.\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\t\t\t\tif (containingListItemPath[containingListItemPath.length - 1] === 0) {\n\t\t\t\t\t// We're at the beginning of a list\n\t\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t// Remove the trailing empty listItem\n\t\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: containingListPath, select: true })\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\t// We're in the middle of a list.\n\t\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tTransforms.splitNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tconst afterListParent = SlatePath.next(containingListPath)\n\t\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: afterListParent, select: true })\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We're at the end of a list.\n\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\tconst afterListParent = SlatePath.next(containingListPath)\n\t\t\t\t\t// Remove the trailing empty listItem\n\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: afterListParent, select: true })\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\t// TODO this should also work for expanded selections\n\t\t\tif (\n\t\t\t\t(event.key !== 'Tab' && event.key !== 'Enter')\n\t\t\t\t|| !editor.selection\n\t\t\t\t|| !SlateRange.isCollapsed(editor.selection)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst selection = editor.selection\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection.focus })\n\n\t\t\tif (closestBlockEntry === undefined) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet [closestBlockElement, closestBlockPath] = closestBlockEntry\n\t\t\tif (!SlateElement.isElement(closestBlockElement)) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (editor.isDefaultElement(closestBlockElement)) {\n\t\t\t\t\t;[closestBlockElement, closestBlockPath] = Editor.parent(editor, closestBlockPath)\n\t\t\t\t}\n\t\t\t\tif (!isListItemElement(closestBlockElement)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tconst succeeded = event.shiftKey\n\t\t\t\t\t? dedentListItem(editor, closestBlockElement, closestBlockPath)\n\t\t\t\t\t: indentListItem(editor, closestBlockElement, closestBlockPath)\n\n\t\t\t\tif (succeeded) {\n\t\t\t\t\treturn event.preventDefault()\n\t\t\t\t}\n\t\t\t} else if (event.key === 'Enter' && event.shiftKey) {\n\t\t\t\tif (editor.isDefaultElement(closestBlockElement)) {\n\t\t\t\t\tconst [listItem] = Editor.parent(editor, closestBlockPath)\n\t\t\t\t\tif (!isListItemElement(listItem)) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\treturn Transforms.splitNodes(editor, {\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t\tat: selection.focus,\n\t\t\t\t\t\tmatch: node => SlateElement.isElement(node) && Editor.isBlock(editor, node) && editor.isDefaultElement(node),\n\t\t\t\t\t})\n\t\t\t\t} else if (isListItemElement(closestBlockElement)) {\n\t\t\t\t\t// We want to create a newline but the closest block is the list item.\n\t\t\t\t\t// This should mean that it only contains inlines. Hence we wrap them in a default element\n\t\t\t\t\t// and then split it.\n\t\t\t\t\tconst [listItemStart, listItemEnd] = Editor.edges(editor, closestBlockPath)\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\t\tmatch: node => Text.isText(node) || (SlateElement.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\t\tanchor: listItemStart,\n\t\t\t\t\t\t\t\tfocus: listItemEnd,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})\n\t\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\talways: true,\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\treturn onKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["listItemElementPlugin","orderedListElementPlugin","unorderedListElementPlugin","listHtmlDeserializerFactory","SlateRange","ContemberEditor","isListItemElement","SlatePath","SlateNode","Transforms","isListElement","Editor","SlateElement","dedentListItem","indentListItem","Text"],"mappings":";;;;;;;;;;;AAUO,MAAM,YAAY,CAAC,EAAE,gBAAgB,qBAAqB,kBAAA,MAKjE,CAAmB,WAAiB;AACnC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgBA,gBAAAA,sBAAsB,EAAE,QAAQ,eAAA,CAAgB,CAAC;AACxE,SAAO,gBAAgBC,mBAAAA,yBAAyB,EAAE,QAAQ,kBAAA,CAAmB,CAAC;AAC9E,SAAO,gBAAgBC,qBAAAA,2BAA2B,EAAE,QAAQ,oBAAA,CAAqB,CAAC;AAElF,SAAO,iBAAiB,eAAeC,qBAAAA,6BAA6B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,WAAWL,kCAAkB,mBAAmB,GAAG;AAIlD,gBAAM,CAAC,eAAe,WAAW,IAAIK,MAAAA,OAAO,MAAM,QAAQ,gBAAgB;AAC1E,gBAAM,eAAA;AACN,iBAAOA,MAAAA,OAAO,mBAAmB,QAAQ,MAAM;AAC9CF,kBAAAA,WAAW,UAAU,QAAQ,OAAO,qBAAqB,CAAA,CAAE,GAAG;AAAA,cAC7D,OAAO,CAAA,SAAQM,WAAK,OAAO,IAAI,KAAMH,cAAa,UAAU,IAAI,KAAK,OAAO,SAAS,IAAI;AAAA,cACzF,IAAI;AAAA,gBACH,QAAQ;AAAA,gBACR,OAAO;AAAA,cAAA;AAAA,YACR,CACA;AACD,kBAAM,WAAWL,MAAAA,KAAU,SAAS,UAAU,MAAM,MAAM,gBAAgB;AAC1EE,kBAAAA,WAAW,WAAW,QAAQ;AAAA;AAAA,cAE7B,IAAI;AAAA,gBACH,MAAM,CAAC,GAAG,kBAAkB,GAAG,GAAG,QAAQ;AAAA,gBAC1C,QAAQ,UAAU,MAAM;AAAA,cAAA;AAAA,cAEzB,QAAQ;AAAA,YAAA,CACR;AAAA,UACF,CAAC;AAAA,QACF;AAAA,MACD;AACA,aAAO,UAAU,KAAK;AAAA,IACvB;AAAA,EAAA,CACA;AAED,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withLists.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/withLists.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isListItemElement, ListItemElement, listItemElementPlugin } from './ListItemElement'\nimport { OrderedListElement, orderedListElementPlugin } from './OrderedListElement'\nimport { dedentListItem, indentListItem } from './transforms'\nimport { UnorderedListElement, unorderedListElementPlugin } from './UnorderedListElement'\nimport { isListElement } from './ListElement'\nimport { listHtmlDeserializerFactory } from './ListHtmlDeserializer'\nimport { ElementRenderer } from '../../../types'\n\nexport const withLists = ({ renderListItem, renderUnorderedList, renderOrderedList }: {\n\trenderListItem: ElementRenderer<ListItemElement>\n\trenderOrderedList: ElementRenderer<OrderedListElement>\n\trenderUnorderedList: ElementRenderer<UnorderedListElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(listItemElementPlugin({ render: renderListItem }))\n\teditor.registerElement(orderedListElementPlugin({ render: renderOrderedList }))\n\teditor.registerElement(unorderedListElementPlugin({ render: renderUnorderedList }))\n\n\teditor.htmlDeserializer.registerPlugin(listHtmlDeserializerFactory())\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst { selection } = editor\n\n\t\t\tif (!selection || !SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry === undefined) {\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\t\t\tconst [closestBlock, closestBlockPath] = closestBlockEntry\n\n\t\t\tlet containingListItem: ListItemElement\n\t\t\tlet containingListItemPath: SlatePath\n\n\t\t\tif (!isListItemElement(closestBlock)) {\n\t\t\t\tif (closestBlockPath.length < 2) {\n\t\t\t\t\t// This block cannot be inside a list\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\tcontainingListItemPath = SlatePath.parent(closestBlockPath)\n\t\t\t\tconst closestListItem = SlateNode.get(editor, containingListItemPath)\n\n\t\t\t\tif (!isListItemElement(closestListItem)) {\n\t\t\t\t\t// The block is not inside a list\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\t\t\t\tcontainingListItem = closestListItem\n\t\t\t} else {\n\t\t\t\tcontainingListItem = closestBlock\n\t\t\t\tcontainingListItemPath = closestBlockPath\n\t\t\t}\n\n\t\t\tif (SlateNode.string(containingListItem) !== '') {\n\t\t\t\treturn Transforms.splitNodes(editor, {\n\t\t\t\t\talways: true,\n\t\t\t\t\tat: selection.focus,\n\t\t\t\t\tmatch: node => isListItemElement(node),\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// We're in a list and want to leave this list.\n\n\t\t\tconst containingListPath = SlatePath.parent(containingListItemPath)\n\t\t\tconst containingList = SlateNode.get(editor, containingListPath)\n\n\t\t\tif (!isListElement(containingList)) {\n\t\t\t\t// This shouldn't really happen. It's more of a sanity check.\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\n\t\t\tconst followingListItemPath = SlatePath.next(containingListItemPath)\n\t\t\tconst hasFollowingListItem = SlateNode.has(editor, followingListItemPath)\n\n\t\t\tif (hasFollowingListItem) {\n\t\t\t\tconst followingListItemNode = SlateNode.get(editor, followingListItemPath)\n\t\t\t\tif (!isListItemElement(followingListItemNode)) {\n\t\t\t\t\t// This shouldn't really happen. It's more of a sanity check.\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\t\t\t\tif (containingListItemPath[containingListItemPath.length - 1] === 0) {\n\t\t\t\t\t// We're at the beginning of a list\n\t\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t// Remove the trailing empty listItem\n\t\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: containingListPath, select: true })\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\t// We're in the middle of a list.\n\t\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tTransforms.splitNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tconst afterListParent = SlatePath.next(containingListPath)\n\t\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: afterListParent, select: true })\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We're at the end of a list.\n\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\tconst afterListParent = SlatePath.next(containingListPath)\n\t\t\t\t\t// Remove the trailing empty listItem\n\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: afterListParent, select: true })\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\t// TODO this should also work for expanded selections\n\t\t\tif (\n\t\t\t\t(event.key !== 'Tab' && event.key !== 'Enter')\n\t\t\t\t|| !editor.selection\n\t\t\t\t|| !SlateRange.isCollapsed(editor.selection)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst selection = editor.selection\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection.focus })\n\n\t\t\tif (closestBlockEntry === undefined) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet [closestBlockElement, closestBlockPath] = closestBlockEntry\n\t\t\tif (!SlateElement.isElement(closestBlockElement)) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (editor.isDefaultElement(closestBlockElement)) {\n\t\t\t\t\t;[closestBlockElement, closestBlockPath] = Editor.parent(editor, closestBlockPath)\n\t\t\t\t}\n\t\t\t\tif (!isListItemElement(closestBlockElement)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tconst succeeded = event.shiftKey\n\t\t\t\t\t? dedentListItem(editor, closestBlockElement, closestBlockPath)\n\t\t\t\t\t: indentListItem(editor, closestBlockElement, closestBlockPath)\n\n\t\t\t\tif (succeeded) {\n\t\t\t\t\treturn event.preventDefault()\n\t\t\t\t}\n\t\t\t} else if (event.key === 'Enter' && event.shiftKey) {\n\t\t\t\tif (editor.isDefaultElement(closestBlockElement)) {\n\t\t\t\t\tconst [listItem] = Editor.parent(editor, closestBlockPath)\n\t\t\t\t\tif (!isListItemElement(listItem)) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\treturn Transforms.splitNodes(editor, {\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t\tat: selection.focus,\n\t\t\t\t\t\tmatch: node => SlateElement.isElement(node) && Editor.isBlock(editor, node) && editor.isDefaultElement(node),\n\t\t\t\t\t})\n\t\t\t\t} else if (isListItemElement(closestBlockElement)) {\n\t\t\t\t\t// We want to create a newline but the closest block is the list item.\n\t\t\t\t\t// This should mean that it only contains inlines. Hence we wrap them in a default element\n\t\t\t\t\t// and then split it.\n\t\t\t\t\tconst [listItemStart, listItemEnd] = Editor.edges(editor, closestBlockPath)\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\t\tmatch: node => Text.isText(node) || (SlateElement.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\t\tanchor: listItemStart,\n\t\t\t\t\t\t\t\tfocus: listItemEnd,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})\n\t\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\talways: true,\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\treturn onKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["SlateRange","Sl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AAQA,QAAa,UAAU,IAAI,KAAK,OAAO,QAAQ,QAAQ,IAAI,KAAK,OAAO,iBAAiB,IAAI;AAAA,UAAA,CAC3G;AAAA,QACF,WAAW,kBAAkB,mBAAmB,GAAG;AAIlD,gBAAM,CAAC,eAAe,WAAW,IAAI,OAAO,MAAM,QAAQ,gBAAgB;AAC1E,gBAAM,eAAA;AACN,iBAAO,OAAO,mBAAmB,QAAQ,MAAM;AAC9C,uBAAW,UAAU,QAAQ,OAAO,qBAAqB,CAAA,CAAE,GAAG;AAAA,cAC7D,OAAO,CAAA,SAAQ,KAAK,OAAO,IAAI,KAAMA,QAAa,UAAU,IAAI,KAAK,OAAO,SAAS,IAAI;AAAA,cACzF,IAAI;AAAA,gBACH,QAAQ;AAAA,gBACR,OAAO;AAAA,cAAA;AAAA,YACR,CACA;AACD,kBAAM,WAAWF,KAAU,SAAS,UAAU,MAAM,MAAM,gBAAgB;AAC1E,uBAAW,WAAW,QAAQ;AAAA;AAAA,cAE7B,IAAI;AAAA,gBACH,MAAM,CAAC,GAAG,kBAAkB,GAAG,GAAG,QAAQ;AAAA,gBAC1C,QAAQ,UAAU,MAAM;AAAA,cAAA;AAAA,cAEzB,QAAQ;AAAA,YAAA,CACR;AAAA,UACF,CAAC;AAAA,QACF;AAAA,MACD;AACA,aAAO,UAAU,KAAK;AAAA,IACvB;AAAA,EAAA,CACA;AAED,SAAO;AACR;"}
1
+ {"version":3,"file":"withLists.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/lists/withLists.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { isListItemElement, ListItemElement, listItemElementPlugin } from './ListItemElement.js'\nimport { OrderedListElement, orderedListElementPlugin } from './OrderedListElement.js'\nimport { dedentListItem, indentListItem } from './transforms/index.js'\nimport { UnorderedListElement, unorderedListElementPlugin } from './UnorderedListElement.js'\nimport { isListElement } from './ListElement.js'\nimport { listHtmlDeserializerFactory } from './ListHtmlDeserializer.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withLists = ({ renderListItem, renderUnorderedList, renderOrderedList }: {\n\trenderListItem: ElementRenderer<ListItemElement>\n\trenderOrderedList: ElementRenderer<OrderedListElement>\n\trenderUnorderedList: ElementRenderer<UnorderedListElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(listItemElementPlugin({ render: renderListItem }))\n\teditor.registerElement(orderedListElementPlugin({ render: renderOrderedList }))\n\teditor.registerElement(unorderedListElementPlugin({ render: renderUnorderedList }))\n\n\teditor.htmlDeserializer.registerPlugin(listHtmlDeserializerFactory())\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst { selection } = editor\n\n\t\t\tif (!selection || !SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry === undefined) {\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\t\t\tconst [closestBlock, closestBlockPath] = closestBlockEntry\n\n\t\t\tlet containingListItem: ListItemElement\n\t\t\tlet containingListItemPath: SlatePath\n\n\t\t\tif (!isListItemElement(closestBlock)) {\n\t\t\t\tif (closestBlockPath.length < 2) {\n\t\t\t\t\t// This block cannot be inside a list\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\tcontainingListItemPath = SlatePath.parent(closestBlockPath)\n\t\t\t\tconst closestListItem = SlateNode.get(editor, containingListItemPath)\n\n\t\t\t\tif (!isListItemElement(closestListItem)) {\n\t\t\t\t\t// The block is not inside a list\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\t\t\t\tcontainingListItem = closestListItem\n\t\t\t} else {\n\t\t\t\tcontainingListItem = closestBlock\n\t\t\t\tcontainingListItemPath = closestBlockPath\n\t\t\t}\n\n\t\t\tif (SlateNode.string(containingListItem) !== '') {\n\t\t\t\treturn Transforms.splitNodes(editor, {\n\t\t\t\t\talways: true,\n\t\t\t\t\tat: selection.focus,\n\t\t\t\t\tmatch: node => isListItemElement(node),\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// We're in a list and want to leave this list.\n\n\t\t\tconst containingListPath = SlatePath.parent(containingListItemPath)\n\t\t\tconst containingList = SlateNode.get(editor, containingListPath)\n\n\t\t\tif (!isListElement(containingList)) {\n\t\t\t\t// This shouldn't really happen. It's more of a sanity check.\n\t\t\t\treturn insertBreak()\n\t\t\t}\n\n\t\t\tconst followingListItemPath = SlatePath.next(containingListItemPath)\n\t\t\tconst hasFollowingListItem = SlateNode.has(editor, followingListItemPath)\n\n\t\t\tif (hasFollowingListItem) {\n\t\t\t\tconst followingListItemNode = SlateNode.get(editor, followingListItemPath)\n\t\t\t\tif (!isListItemElement(followingListItemNode)) {\n\t\t\t\t\t// This shouldn't really happen. It's more of a sanity check.\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\t\t\t\tif (containingListItemPath[containingListItemPath.length - 1] === 0) {\n\t\t\t\t\t// We're at the beginning of a list\n\t\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t// Remove the trailing empty listItem\n\t\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: containingListPath, select: true })\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\t// We're in the middle of a list.\n\t\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tTransforms.splitNodes(editor, { at: containingListItemPath })\n\t\t\t\t\t\tconst afterListParent = SlatePath.next(containingListPath)\n\t\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: afterListParent, select: true })\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// We're at the end of a list.\n\t\t\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\t\t\tconst afterListParent = SlatePath.next(containingListPath)\n\t\t\t\t\t// Remove the trailing empty listItem\n\t\t\t\t\tTransforms.removeNodes(editor, { at: containingListItemPath })\n\t\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), { at: afterListParent, select: true })\n\t\t\t\t})\n\t\t\t}\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\t// TODO this should also work for expanded selections\n\t\t\tif (\n\t\t\t\t(event.key !== 'Tab' && event.key !== 'Enter')\n\t\t\t\t|| !editor.selection\n\t\t\t\t|| !SlateRange.isCollapsed(editor.selection)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst selection = editor.selection\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection.focus })\n\n\t\t\tif (closestBlockEntry === undefined) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet [closestBlockElement, closestBlockPath] = closestBlockEntry\n\t\t\tif (!SlateElement.isElement(closestBlockElement)) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (editor.isDefaultElement(closestBlockElement)) {\n\t\t\t\t\t;[closestBlockElement, closestBlockPath] = Editor.parent(editor, closestBlockPath)\n\t\t\t\t}\n\t\t\t\tif (!isListItemElement(closestBlockElement)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tconst succeeded = event.shiftKey\n\t\t\t\t\t? dedentListItem(editor, closestBlockElement, closestBlockPath)\n\t\t\t\t\t: indentListItem(editor, closestBlockElement, closestBlockPath)\n\n\t\t\t\tif (succeeded) {\n\t\t\t\t\treturn event.preventDefault()\n\t\t\t\t}\n\t\t\t} else if (event.key === 'Enter' && event.shiftKey) {\n\t\t\t\tif (editor.isDefaultElement(closestBlockElement)) {\n\t\t\t\t\tconst [listItem] = Editor.parent(editor, closestBlockPath)\n\t\t\t\t\tif (!isListItemElement(listItem)) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\treturn Transforms.splitNodes(editor, {\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t\tat: selection.focus,\n\t\t\t\t\t\tmatch: node => SlateElement.isElement(node) && Editor.isBlock(editor, node) && editor.isDefaultElement(node),\n\t\t\t\t\t})\n\t\t\t\t} else if (isListItemElement(closestBlockElement)) {\n\t\t\t\t\t// We want to create a newline but the closest block is the list item.\n\t\t\t\t\t// This should mean that it only contains inlines. Hence we wrap them in a default element\n\t\t\t\t\t// and then split it.\n\t\t\t\t\tconst [listItemStart, listItemEnd] = Editor.edges(editor, closestBlockPath)\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\t\tmatch: node => Text.isText(node) || (SlateElement.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\t\tanchor: listItemStart,\n\t\t\t\t\t\t\t\tfocus: listItemEnd,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t})\n\t\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\talways: true,\n\t\t\t\t\t\t})\n\t\t\t\t\t})\n\t\t\t\t}\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W,WAAW,QAAQ;AAAA,YACpC,QAAQ;AAAA,YACR,IAAI,UAAU;AAAA,YACd,OAAO,CAAA,SAAQA,QAAa,UAAU,IAAI,KAAK,OAAO,QAAQ,QAAQ,IAAI,KAAK,OAAO,iBAAiB,IAAI;AAAA,UAAA,CAC3G;AAAA,QACF,WAAW,kBAAkB,mBAAmB,GAAG;AAIlD,gBAAM,CAAC,eAAe,WAAW,IAAI,OAAO,MAAM,QAAQ,gBAAgB;AAC1E,gBAAM,eAAA;AACN,iBAAO,OAAO,mBAAmB,QAAQ,MAAM;AAC9C,uBAAW,UAAU,QAAQ,OAAO,qBAAqB,CAAA,CAAE,GAAG;AAAA,cAC7D,OAAO,CAAA,SAAQ,KAAK,OAAO,IAAI,KAAMA,QAAa,UAAU,IAAI,KAAK,OAAO,SAAS,IAAI;AAAA,cACzF,IAAI;AAAA,gBACH,QAAQ;AAAA,gBACR,OAAO;AAAA,cAAA;AAAA,YACR,CACA;AACD,kBAAM,WAAWF,KAAU,SAAS,UAAU,MAAM,MAAM,gBAAgB;AAC1E,uBAAW,WAAW,QAAQ;AAAA;AAAA,cAE7B,IAAI;AAAA,gBACH,MAAM,CAAC,GAAG,kBAAkB,GAAG,GAAG,QAAQ;AAAA,gBAC1C,QAAQ,UAAU,MAAM;AAAA,cAAA;AAAA,cAEzB,QAAQ;AAAA,YAAA,CACR;AAAA,UACF,CAAC;AAAA,QACF;AAAA,MACD;AACA,aAAO,UAAU,KAAK;AAAA,IACvB;AAAA,EAAA,CACA;AAED,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParagraphElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/ParagraphElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { AlignDirection } from '../../attributes'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const paragraphElementType = 'paragraph' as const\n\nexport interface ParagraphElement extends SlateElement {\n\ttype: typeof paragraphElementType\n\tisNumbered?: boolean\n\tchildren: SlateEditor['children']\n\talign?: AlignDirection\n}\n\nexport const isParagraphElement = (\n\telement: SlateNode,\n\tsuchThat?: Partial<ParagraphElement>,\n): element is ParagraphElement => ContemberEditor.isElementType(element, paragraphElementType, suchThat)\n\nexport const paragraphElementPlugin = ({ render }: { render: ElementRenderer<ParagraphElement> }): EditorElementPlugin<ParagraphElement> => ({\n\ttype: paragraphElementType,\n\trender,\n\tcanContainAnyBlocks: false,\n\tacceptsAttributes: ({ editor, suchThat }) => {\n\t\treturn 'align' in suchThat\n\t},\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tconst topLevelNodes = Array.from(ContemberEditor.topLevelNodes(editor))\n\n\t\t\tif (topLevelNodes.every(([node]) => isParagraphElement(node, suchThat))) {\n\t\t\t\tfor (const [, path] of topLevelNodes) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, path)\n\t\t\t\t\tTransforms.setNodes(editor, { type: editor.defaultElementType }, { at: path })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [node, path] of topLevelNodes) {\n\t\t\t\t\tif (isParagraphElement(node, suchThat)) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tContemberEditor.ejectElement(editor, path)\n\t\t\t\t\tconst newProps: Partial<ParagraphElement> = {\n\t\t\t\t\t\t...suchThat,\n\t\t\t\t\t\ttype: paragraphElementType,\n\t\t\t\t\t}\n\t\t\t\t\tTransforms.setNodes(editor, newProps, { at: path })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t},\n\tnormalizeNode: ({ editor, element, path, preventDefault }) => {\n\t\tfor (const [i, child] of element.children.entries()) {\n\t\t\tif (SlateElement.isElement(child) && Editor.isBlock(editor, child)) {\n\t\t\t\tTransforms.unwrapNodes(editor, { at: [...path, i] })\n\t\t\t\treturn preventDef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AAA,OAAO,QAAQ,QAAQ,KAAK,GAAG;AACnEC,yBAAW,YAAY,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG;AACnD,eAAO,eAAA;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;;;;"}
1
+ {"version":3,"file":"ParagraphElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/ParagraphElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { AlignDirection } from '../../attributes/index.js'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const paragraphElementType = 'paragraph' as const\n\nexport interface ParagraphElement extends SlateElement {\n\ttype: typeof paragraphElementType\n\tisNumbered?: boolean\n\tchildren: SlateEditor['children']\n\talign?: AlignDirection\n}\n\nexport const isParagraphElement = (\n\telement: SlateNode,\n\tsuchThat?: Partial<ParagraphElement>,\n): element is ParagraphElement => ContemberEditor.isElementType(element, paragraphElementType, suchThat)\n\nexport const paragraphElementPlugin = ({ render }: { render: ElementRenderer<ParagraphElement> }): EditorElementPlugin<ParagraphElement> => ({\n\ttype: paragraphElementType,\n\trender,\n\tcanContainAnyBlocks: false,\n\tacceptsAttributes: ({ editor, suchThat }) => {\n\t\treturn 'align' in suchThat\n\t},\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tconst topLevelNodes = Array.from(ContemberEditor.topLevelNodes(editor))\n\n\t\t\tif (topLevelNodes.every(([node]) => isParagraphElement(node, suchThat))) {\n\t\t\t\tfor (const [, path] of topLevelNodes) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, path)\n\t\t\t\t\tTransforms.setNodes(editor, { type: editor.defaultElementType }, { at: path })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [node, path] of topLevelNodes) {\n\t\t\t\t\tif (isParagraphElement(node, suchThat)) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tContemberEditor.ejectElement(editor, path)\n\t\t\t\t\tconst newProps: Partial<ParagraphElement> = {\n\t\t\t\t\t\t...suchThat,\n\t\t\t\t\t\ttype: paragraphElementType,\n\t\t\t\t\t}\n\t\t\t\t\tTransforms.setNodes(editor, newProps, { at: path })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t},\n\tnormalizeNode: ({ editor, element, path, preventDefault }) => {\n\t\tfor (const [i, child] of element.children.entries()) {\n\t\t\tif (SlateElement.isElement(child) && Editor.isBlock(editor, child)) {\n\t\t\t\tTransforms.unwrapNodes(editor, { at: [...path, i] })\n\t\t\t\treturn preventDefault()\n\t\t\t}\n\t\t}\n\t},\n})\n"],"names":["ContemberEditor","Editor","Transforms","SlateElement"],"mappings":";;;;AAKO,MAAM,uBAAuB;AAS7B,MAAM,qBAAqB,CACjC,SACA,aACiCA,MAAAA,gBAAgB,cAAc,SAAS,sBAAsB,QAAQ;AAEhG,MAAM,yBAAyB,CAAC,EAAE,cAAoG;AAAA,EAC5I,MAAM;AAAA,EACN;AAAA,EACA,qBAAqB;AAAA,EACrB,mBAAmB,CAAC,EAAE,QAAQ,eAAe;AAC5C,WAAO,WAAW;AAAA,EACnB;AAAA,EACA,eAAe,CAAC,EAAE,QAAQ,eAAe;AACxCC,iBAAO,mBAAmB,QAAQ,MAAM;AACvC,YAAM,gBAAgB,MAAM,KAAKD,MAAAA,gBAAgB,cAAc,MAAM,CAAC;AAEtE,UAAI,cAAc,MAAM,CAAC,CAAC,IAAI,MAAM,mBAAmB,MAAM,QAAQ,CAAC,GAAG;AACxE,mBAAW,CAAA,EAAG,IAAI,KAAK,eAAe;AACrCA,gCAAgB,aAAa,QAAQ,IAAI;AACzCE,2BAAW,SAAS,QAAQ,EAAE,MAAM,OAAO,sBAAsB,EAAE,IAAI,MAAM;AAAA,QAC9E;AAAA,MACD,OAAO;AACN,mBAAW,CAAC,MAAM,IAAI,KAAK,eAAe;AACzC,cAAI,mBAAmB,MAAM,QAAQ,GAAG;AACvC;AAAA,UACD;AACAF,gCAAgB,aAAa,QAAQ,IAAI;AACzC,gBAAM,WAAsC;AAAA,YAC3C,GAAG;AAAA,YACH,MAAM;AAAA,UAAA;AAEPE,gBAAAA,WAAW,SAAS,QAAQ,UAAU,EAAE,IAAI,MAAM;AAAA,QACnD;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAAA,EACA,eAAe,CAAC,EAAE,QAAQ,SAAS,MAAM,qBAAqB;AAC7D,eAAW,CAAC,GAAG,KAAK,KAAK,QAAQ,SAAS,WAAW;AACpD,UAAIC,MAAAA,QAAa,UAAU,KAAK,KAAKF,MAAAA,OAAO,QAAQ,QAAQ,KAAK,GAAG;AACnEC,yBAAW,YAAY,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG;AACnD,eAAO,eAAA;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParagraphElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/ParagraphElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { AlignDirection } from '../../attributes'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const paragraphElementType = 'paragraph' as const\n\nexport interface ParagraphElement extends SlateElement {\n\ttype: typeof paragraphElementType\n\tisNumbered?: boolean\n\tchildren: SlateEditor['children']\n\talign?: AlignDirection\n}\n\nexport const isParagraphElement = (\n\telement: SlateNode,\n\tsuchThat?: Partial<ParagraphElement>,\n): element is ParagraphElement => ContemberEditor.isElementType(element, paragraphElementType, suchThat)\n\nexport const paragraphElementPlugin = ({ render }: { render: ElementRenderer<ParagraphElement> }): EditorElementPlugin<ParagraphElement> => ({\n\ttype: paragraphElementType,\n\trender,\n\tcanContainAnyBlocks: false,\n\tacceptsAttributes: ({ editor, suchThat }) => {\n\t\treturn 'align' in suchThat\n\t},\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tconst topLevelNodes = Array.from(ContemberEditor.topLevelNodes(editor))\n\n\t\t\tif (topLevelNodes.every(([node]) => isParagraphElement(node, suchThat))) {\n\t\t\t\tfor (const [, path] of topLevelNodes) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, path)\n\t\t\t\t\tTransforms.setNodes(editor, { type: editor.defaultElementType }, { at: path })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [node, path] of topLevelNodes) {\n\t\t\t\t\tif (isParagraphElement(node, suchThat)) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tContemberEditor.ejectElement(editor, path)\n\t\t\t\t\tconst newProps: Partial<ParagraphElement> = {\n\t\t\t\t\t\t...suchThat,\n\t\t\t\t\t\ttype: paragraphElementType,\n\t\t\t\t\t}\n\t\t\t\t\tTransforms.setNodes(editor, newProps, { at: path })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t},\n\tnormalizeNode: ({ editor, element, path, preventDefault }) => {\n\t\tfor (const [i, child] of element.children.entries()) {\n\t\t\tif (SlateElement.isElement(child) && Editor.isBlock(editor, child)) {\n\t\t\t\tTransforms.unwrapNodes(editor, { at: [...path, i] })\n\t\t\t\treturn preventDefault()\n\t\t\t}\n\t\t}\n\t},\n})\n"],"names":["SlateElement"],"mappings":";;AAKO,MAAM,uBAAuB;AAS7B,MAAM,qBAAqB,CACjC,SACA,aACiC,gBAAgB,cAAc,SAAS,sBAAsB,QAAQ;AAEhG,MAAM,yBAAyB,CAAC,EAAE,cAAoG;AAAA,EAC5I,MAAM;AAAA,EACN;AAAA,EACA,qBAAqB;AAAA,EACrB,mBAAmB,CAAC,EAAE,QAAQ,eAAe;AAC5C,WAAO,WAAW;AAAA,EACnB;AAAA,EACA,eAAe,CAAC,EAAE,QAAQ,eAAe;AACxC,WAAO,mBAAmB,QAAQ,MAAM;AACvC,YAAM,gBAAgB,MAAM,KAAK,gBAAgB,cAAc,MAAM,CAAC;AAEtE,UAAI,cAAc,MAAM,CAAC,CAAC,IAAI,MAAM,mBAAmB,MAAM,QAAQ,CAAC,GAAG;AACxE,mBAAW,CAAA,EAAG,IAAI,KAAK,eAAe;AACrC,0BAAgB,aAAa,QAAQ,IAAI;AACzC,qBAAW,SAAS,QAAQ,EAAE,MAAM,OAAO,sBAAsB,EAAE,IAAI,MAAM;AAAA,QAC9E;AAAA,MACD,OAAO;AACN,mBAAW,CAAC,MAAM,IAAI,KAAK,eAAe;AACzC,cAAI,mBAAmB,MAAM,QAAQ,GAAG;AACvC;AAAA,UACD;AACA,0BAAgB,aAAa,QAAQ,IAAI;AACzC,gBAAM,WAAsC;AAAA,YAC3C,GAAG;AAAA,YACH,MAAM;AAAA,UAAA;AAEP,qBAAW,SAAS,QAAQ,UAAU,EAAE,IAAI,MAAM;AAAA,QACnD;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AAAA,EACA,eAAe,CAAC,EAAE,QAAQ,SAAS,MAAM,qBAAqB;AAC7D,eAAW,CAAC,GAAG,KAAK,KAAK,QAAQ,SAAS,WAAW;AACpD,UAAIA,QAAa,UAAU,KAAK,KAAK,OAAO,QAAQ,QAAQ,KAAK,GAAG;AACnE,mBAAW,YAAY,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG;AACnD,eAAO,eAAA;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"ParagraphElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/ParagraphElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { AlignDirection } from '../../attributes/index.js'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const paragraphElementType = 'paragraph' as const\n\nexport interface ParagraphElement extends SlateElement {\n\ttype: typeof paragraphElementType\n\tisNumbered?: boolean\n\tchildren: SlateEditor['children']\n\talign?: AlignDirection\n}\n\nexport const isParagraphElement = (\n\telement: SlateNode,\n\tsuchThat?: Partial<ParagraphElement>,\n): element is ParagraphElement => ContemberEditor.isElementType(element, paragraphElementType, suchThat)\n\nexport const paragraphElementPlugin = ({ render }: { render: ElementRenderer<ParagraphElement> }): EditorElementPlugin<ParagraphElement> => ({\n\ttype: paragraphElementType,\n\trender,\n\tcanContainAnyBlocks: false,\n\tacceptsAttributes: ({ editor, suchThat }) => {\n\t\treturn 'align' in suchThat\n\t},\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tconst topLevelNodes = Array.from(ContemberEditor.topLevelNodes(editor))\n\n\t\t\tif (topLevelNodes.every(([node]) => isParagraphElement(node, suchThat))) {\n\t\t\t\tfor (const [, path] of topLevelNodes) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, path)\n\t\t\t\t\tTransforms.setNodes(editor, { type: editor.defaultElementType }, { at: path })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (const [node, path] of topLevelNodes) {\n\t\t\t\t\tif (isParagraphElement(node, suchThat)) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tContemberEditor.ejectElement(editor, path)\n\t\t\t\t\tconst newProps: Partial<ParagraphElement> = {\n\t\t\t\t\t\t...suchThat,\n\t\t\t\t\t\ttype: paragraphElementType,\n\t\t\t\t\t}\n\t\t\t\t\tTransforms.setNodes(editor, newProps, { at: path })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t},\n\tnormalizeNode: ({ editor, element, path, preventDefault }) => {\n\t\tfor (const [i, child] of element.children.entries()) {\n\t\t\tif (SlateElement.isElement(child) && Editor.isBlock(editor, child)) {\n\t\t\t\tTransforms.unwrapNodes(edit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;AACnE,mBAAW,YAAY,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG;AACnD,eAAO,eAAA;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParagraphHtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts"],"sourcesContent":["import { paragraphElementType } from './ParagraphElement'\nimport { HtmlDeserializerPlugin } from '../../../types'\n\nexport const paragraphHtmlDeserializer: HtmlDeserializerPlugin = {\n\tprocessBlockPaste: ({ element, next, cumulativeTextAttrs }) =>\n\t\telement.nodeName === 'P'\n\t\t\t? {\n\t\t\t\ttype: paragraphElementType,\n\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t}\n\t\t\t: null,\n}\n"],"names":["paragraphElementType"],"mappings":";;;AAGO,MAAM,4BAAoD;AAAA,EAChE,mBAAmB,CAAC,EAAE,SAAS,MAAM,oBAAA,MACpC,QAAQ,aAAa,MAClB;AAAA,IACD,MAAMA,iBAAAA;AAAAA,IACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,EAAA,IAErD;AACL;;"}
1
+ {"version":3,"file":"ParagraphHtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts"],"sourcesContent":["import { paragraphElementType } from './ParagraphElement.js'\nimport { HtmlDeserializerPlugin } from '../../../types/index.js'\n\nexport const paragraphHtmlDeserializer: HtmlDeserializerPlugin = {\n\tprocessBlockPaste: ({ element, next, cumulativeTextAttrs }) =>\n\t\telement.nodeName === 'P'\n\t\t\t? {\n\t\t\t\ttype: paragraphElementType,\n\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t}\n\t\t\t: null,\n}\n"],"names":["paragraphElementType"],"mappings":";;;AAGO,MAAM,4BAAoD;AAAA,EAChE,mBAAmB,CAAC,EAAE,SAAS,MAAM,oBAAA,MACpC,QAAQ,aAAa,MAClB;AAAA,IACD,MAAMA,iBAAAA;AAAAA,IACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,EAAA,IAErD;AACL;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ParagraphHtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts"],"sourcesContent":["import { paragraphElementType } from './ParagraphElement'\nimport { HtmlDeserializerPlugin } from '../../../types'\n\nexport const paragraphHtmlDeserializer: HtmlDeserializerPlugin = {\n\tprocessBlockPaste: ({ element, next, cumulativeTextAttrs }) =>\n\t\telement.nodeName === 'P'\n\t\t\t? {\n\t\t\t\ttype: paragraphElementType,\n\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t}\n\t\t\t: null,\n}\n"],"names":[],"mappings":";AAGO,MAAM,4BAAoD;AAAA,EAChE,mBAAmB,CAAC,EAAE,SAAS,MAAM,oBAAA,MACpC,QAAQ,aAAa,MAClB;AAAA,IACD,MAAM;AAAA,IACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,EAAA,IAErD;AACL;"}
1
+ {"version":3,"file":"ParagraphHtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts"],"sourcesContent":["import { paragraphElementType } from './ParagraphElement.js'\nimport { HtmlDeserializerPlugin } from '../../../types/index.js'\n\nexport const paragraphHtmlDeserializer: HtmlDeserializerPlugin = {\n\tprocessBlockPaste: ({ element, next, cumulativeTextAttrs }) =>\n\t\telement.nodeName === 'P'\n\t\t\t? {\n\t\t\t\ttype: paragraphElementType,\n\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t}\n\t\t\t: null,\n}\n"],"names":[],"mappings":";AAGO,MAAM,4BAAoD;AAAA,EAChE,mBAAmB,CAAC,EAAE,SAAS,MAAM,oBAAA,MACpC,QAAQ,aAAa,MAClB;AAAA,IACD,MAAM;AAAA,IACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,EAAA,IAErD;AACL;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withParagraphs.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/withParagraphs.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Point, Range as SlateRange, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isParagraphElement, ParagraphElement, paragraphElementPlugin, paragraphElementType } from './ParagraphElement'\nimport { paragraphHtmlDeserializer } from './ParagraphHtmlDeserializer'\nimport { ElementRenderer } from '../../../types'\n\nexport const withParagraphs = ({ render }: { render: ElementRenderer<ParagraphElement> }) => <E extends Editor>(editor: E): E => {\n\tconst {\n\t\tcanToggleElement,\n\t\tdeleteBackward,\n\t} = editor\n\n\teditor.registerElement(paragraphElementPlugin({ render }))\n\n\teditor.canToggleElement = (elementType, suchThat) => {\n\t\t// This only allows numbered paragraphs at the top level.\n\t\t// TODO this is pretty bad but in order to fix this, we'd also have to fix toggleElement and there's no time now.\n\n\t\tif (elementType !== paragraphElementType || suchThat === undefined) {\n\t\t\treturn canToggleElement(elementType, suchThat)\n\t\t}\n\t\tconst isNumbered = suchThat.isNumbered\n\n\t\tif (isNumbered !== true) {\n\t\t\treturn canToggleElement(elementType, suchThat)\n\t\t}\n\n\t\tif (!editor.selection) {\n\t\t\treturn false\n\t\t}\n\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\tif (closestBlockEntry === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tconst [closestBlockElement, closestBlockPath] = closestBlockEntry\n\n\t\treturn closestBlockPath.length === 1 && SlateElement.isElement(closestBlockElement) && closestBlockElement.type === paragraphElementType\n\t}\n\n\teditor.deleteBackward = unit => {\n\t\tconst selection = editor.selection\n\t\tif (unit !== 'character' || !selection || !SlateRange.isCollapsed(selection) || selection.focus.offset !== 0) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\t// The offset being zero doesn't necessarily imply that selection refers to the start of a paragraph.\n\t\t// It's just a way to early-exit.\n\n\t\tconst closestNumberedEntry = Editor.above<ParagraphElement>(editor, {\n\t\t\tmatch: node => SlateElement.isElement(node) && isParagraphElement(node, { isNumbered: true }),\n\t\t})\n\t\tif (closestNumberedEntry === undefined) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\tconst [, paragraphPath] = closestNumberedEntry\n\t\tconst paragraphStartPoint = Editor.start(editor, paragraphPath)\n\n\t\tif (!Point.equals(paragraphStartPoint, selection.focus)) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ isNumbered: null }, // null removes the key altogether\n\t\t\t{ at: paragraphPath },\n\t\t)\n\t}\n\teditor.htmlDeserializer.registerPlugin(paragraphHtmlDeserializer)\n\n\treturn editor\n}\n"],"names":["paragraphElementPlugin","paragraphElementType","ContemberEditor","SlateElement","SlateRange","Editor","isParagraphElement","Point","Transforms","paragraphHtmlDeserializer"],"mappings":";;;;;;AAMO,MAAM,iBAAiB,CAAC,EAAE,OAAA,MAA4D,CAAmB,WAAiB;AAChI,QAAM;AAAA,IACL;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgBA,iBAAAA,uBAAuB,EAAE,OAAA,CAAQ,CAAC;AAEzD,SAAO,mBAAmB,CAAC,aAAa,aAAa;AAIpD,QAAI,gBAAgBC,iBAAAA,wBAAwB,aAAa,QAAW;AACnE,aAAO,iBAAiB,aAAa,QAAQ;AAAA,IAC9C;AACA,UAAM,aAAa,SAAS;AAE5B,QAAI,eAAe,MAAM;AACxB,aAAO,iBAAiB,aAAa,QAAQ;AAAA,IAC9C;AAEA,QAAI,CAAC,OAAO,WAAW;AACtB,aAAO;AAAA,IACR;AACA,UAAM,oBAAoBC,MAAAA,gBAAgB,kBAAkB,MAAM;AAClE,QAAI,sBAAsB,QAAW;AACpC,aAAO;AAAA,IACR;AACA,UAAM,CAAC,qBAAqB,gBAAgB,IAAI;AAEhD,WAAO,iBAAiB,WAAW,KAAKC,MAAAA,QAAa,UAAU,mBAAmB,KAAK,oBAAoB,SAASF,iBAAAA;AAAAA,EACrH;AAEA,SAAO,iBAAiB,CAAA,SAAQ;AAC/B,UAAM,YAAY,OAAO;AACzB,QAAI,SAAS,eAAe,CAAC,aAAa,CAACG,MAAAA,MAAW,YAAY,SAAS,KAAK,UAAU,MAAM,WAAW,GAAG;AAC7G,aAAO,eAAe,IAAI;AAAA,IAC3B;AAIA,UAAM,uBAAuBC,MAAAA,OAAO,MAAwB,QAAQ;AAAA,MACnE,OAAO,CAAA,SAAQF,MAAAA,QAAa,UAAU,IAAI,KAAKG,iBAAAA,mBAAmB,MAAM,EAAE,YAAY,KAAA,CAAM;AAAA,IAAA,CAC5F;AACD,QAAI,yBAAyB,QAAW;AACvC,aAAO,eAAe,IAAI;AAAA,IAC3B;AACA,UAAM,CAAA,EAAG,aAAa,IAAI;AAC1B,UAAM,sBAAsBD,MAAAA,OAAO,MAAM,QAAQ,aAAa;AAE9D,QAAI,CAACE,MAAAA,MAAM,OAAO,qBAAqB,UAAU,KAAK,GAAG;AACxD,aAAO,eAAe,IAAI;AAAA,IAC3B;AACAC,UAAAA,WAAW;AAAA,MACV;AAAA,MACA,EAAE,YAAY,KAAA;AAAA;AAAA,MACd,EAAE,IAAI,cAAA;AAAA,IAAc;AAAA,EAEtB;AACA,SAAO,iBAAiB,eAAeC,mDAAyB;AAEhE,SAAO;AACR;;"}
1
+ {"version":3,"file":"withParagraphs.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/withParagraphs.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Point, Range as SlateRange, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { isParagraphElement, ParagraphElement, paragraphElementPlugin, paragraphElementType } from './ParagraphElement.js'\nimport { paragraphHtmlDeserializer } from './ParagraphHtmlDeserializer.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withParagraphs = ({ render }: { render: ElementRenderer<ParagraphElement> }) => <E extends Editor>(editor: E): E => {\n\tconst {\n\t\tcanToggleElement,\n\t\tdeleteBackward,\n\t} = editor\n\n\teditor.registerElement(paragraphElementPlugin({ render }))\n\n\teditor.canToggleElement = (elementType, suchThat) => {\n\t\t// This only allows numbered paragraphs at the top level.\n\t\t// TODO this is pretty bad but in order to fix this, we'd also have to fix toggleElement and there's no time now.\n\n\t\tif (elementType !== paragraphElementType || suchThat === undefined) {\n\t\t\treturn canToggleElement(elementType, suchThat)\n\t\t}\n\t\tconst isNumbered = suchThat.isNumbered\n\n\t\tif (isNumbered !== true) {\n\t\t\treturn canToggleElement(elementType, suchThat)\n\t\t}\n\n\t\tif (!editor.selection) {\n\t\t\treturn false\n\t\t}\n\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\tif (closestBlockEntry === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tconst [closestBlockElement, closestBlockPath] = closestBlockEntry\n\n\t\treturn closestBlockPath.length === 1 && SlateElement.isElement(closestBlockElement) && closestBlockElement.type === paragraphElementType\n\t}\n\n\teditor.deleteBackward = unit => {\n\t\tconst selection = editor.selection\n\t\tif (unit !== 'character' || !selection || !SlateRange.isCollapsed(selection) || selection.focus.offset !== 0) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\t// The offset being zero doesn't necessarily imply that selection refers to the start of a paragraph.\n\t\t// It's just a way to early-exit.\n\n\t\tconst closestNumberedEntry = Editor.above<ParagraphElement>(editor, {\n\t\t\tmatch: node => SlateElement.isElement(node) && isParagraphElement(node, { isNumbered: true }),\n\t\t})\n\t\tif (closestNumberedEntry === undefined) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\tconst [, paragraphPath] = closestNumberedEntry\n\t\tconst paragraphStartPoint = Editor.start(editor, paragraphPath)\n\n\t\tif (!Point.equals(paragraphStartPoint, selection.focus)) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ isNumbered: null }, // null removes the key altogether\n\t\t\t{ at: paragraphPath },\n\t\t)\n\t}\n\teditor.htmlDeserializer.registerPlugin(paragraphHtmlDeserializer)\n\n\treturn editor\n}\n"],"names":["paragraphElementPlugin","paragraphElementType","ContemberEditor","SlateElement","SlateRange","Editor","isParagraphElement","Point","Transforms","paragraphHtmlDeserializer"],"mappings":";;;;;;AAMO,MAAM,iBAAiB,CAAC,EAAE,OAAA,MAA4D,CAAmB,WAAiB;AAChI,QAAM;AAAA,IACL;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgBA,iBAAAA,uBAAuB,EAAE,OAAA,CAAQ,CAAC;AAEzD,SAAO,mBAAmB,CAAC,aAAa,aAAa;AAIpD,QAAI,gBAAgBC,iBAAAA,wBAAwB,aAAa,QAAW;AACnE,aAAO,iBAAiB,aAAa,QAAQ;AAAA,IAC9C;AACA,UAAM,aAAa,SAAS;AAE5B,QAAI,eAAe,MAAM;AACxB,aAAO,iBAAiB,aAAa,QAAQ;AAAA,IAC9C;AAEA,QAAI,CAAC,OAAO,WAAW;AACtB,aAAO;AAAA,IACR;AACA,UAAM,oBAAoBC,MAAAA,gBAAgB,kBAAkB,MAAM;AAClE,QAAI,sBAAsB,QAAW;AACpC,aAAO;AAAA,IACR;AACA,UAAM,CAAC,qBAAqB,gBAAgB,IAAI;AAEhD,WAAO,iBAAiB,WAAW,KAAKC,MAAAA,QAAa,UAAU,mBAAmB,KAAK,oBAAoB,SAASF,iBAAAA;AAAAA,EACrH;AAEA,SAAO,iBAAiB,CAAA,SAAQ;AAC/B,UAAM,YAAY,OAAO;AACzB,QAAI,SAAS,eAAe,CAAC,aAAa,CAACG,MAAAA,MAAW,YAAY,SAAS,KAAK,UAAU,MAAM,WAAW,GAAG;AAC7G,aAAO,eAAe,IAAI;AAAA,IAC3B;AAIA,UAAM,uBAAuBC,MAAAA,OAAO,MAAwB,QAAQ;AAAA,MACnE,OAAO,CAAA,SAAQF,MAAAA,QAAa,UAAU,IAAI,KAAKG,iBAAAA,mBAAmB,MAAM,EAAE,YAAY,KAAA,CAAM;AAAA,IAAA,CAC5F;AACD,QAAI,yBAAyB,QAAW;AACvC,aAAO,eAAe,IAAI;AAAA,IAC3B;AACA,UAAM,CAAA,EAAG,aAAa,IAAI;AAC1B,UAAM,sBAAsBD,MAAAA,OAAO,MAAM,QAAQ,aAAa;AAE9D,QAAI,CAACE,MAAAA,MAAM,OAAO,qBAAqB,UAAU,KAAK,GAAG;AACxD,aAAO,eAAe,IAAI;AAAA,IAC3B;AACAC,UAAAA,WAAW;AAAA,MACV;AAAA,MACA,EAAE,YAAY,KAAA;AAAA;AAAA,MACd,EAAE,IAAI,cAAA;AAAA,IAAc;AAAA,EAEtB;AACA,SAAO,iBAAiB,eAAeC,mDAAyB;AAEhE,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withParagraphs.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/withParagraphs.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Point, Range as SlateRange, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isParagraphElement, ParagraphElement, paragraphElementPlugin, paragraphElementType } from './ParagraphElement'\nimport { paragraphHtmlDeserializer } from './ParagraphHtmlDeserializer'\nimport { ElementRenderer } from '../../../types'\n\nexport const withParagraphs = ({ render }: { render: ElementRenderer<ParagraphElement> }) => <E extends Editor>(editor: E): E => {\n\tconst {\n\t\tcanToggleElement,\n\t\tdeleteBackward,\n\t} = editor\n\n\teditor.registerElement(paragraphElementPlugin({ render }))\n\n\teditor.canToggleElement = (elementType, suchThat) => {\n\t\t// This only allows numbered paragraphs at the top level.\n\t\t// TODO this is pretty bad but in order to fix this, we'd also have to fix toggleElement and there's no time now.\n\n\t\tif (elementType !== paragraphElementType || suchThat === undefined) {\n\t\t\treturn canToggleElement(elementType, suchThat)\n\t\t}\n\t\tconst isNumbered = suchThat.isNumbered\n\n\t\tif (isNumbered !== true) {\n\t\t\treturn canToggleElement(elementType, suchThat)\n\t\t}\n\n\t\tif (!editor.selection) {\n\t\t\treturn false\n\t\t}\n\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\tif (closestBlockEntry === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tconst [closestBlockElement, closestBlockPath] = closestBlockEntry\n\n\t\treturn closestBlockPath.length === 1 && SlateElement.isElement(closestBlockElement) && closestBlockElement.type === paragraphElementType\n\t}\n\n\teditor.deleteBackward = unit => {\n\t\tconst selection = editor.selection\n\t\tif (unit !== 'character' || !selection || !SlateRange.isCollapsed(selection) || selection.focus.offset !== 0) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\t// The offset being zero doesn't necessarily imply that selection refers to the start of a paragraph.\n\t\t// It's just a way to early-exit.\n\n\t\tconst closestNumberedEntry = Editor.above<ParagraphElement>(editor, {\n\t\t\tmatch: node => SlateElement.isElement(node) && isParagraphElement(node, { isNumbered: true }),\n\t\t})\n\t\tif (closestNumberedEntry === undefined) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\tconst [, paragraphPath] = closestNumberedEntry\n\t\tconst paragraphStartPoint = Editor.start(editor, paragraphPath)\n\n\t\tif (!Point.equals(paragraphStartPoint, selection.focus)) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ isNumbered: null }, // null removes the key altogether\n\t\t\t{ at: paragraphPath },\n\t\t)\n\t}\n\teditor.htmlDeserializer.registerPlugin(paragraphHtmlDeserializer)\n\n\treturn editor\n}\n"],"names":["SlateElement","SlateRange"],"mappings":";;;;AAMO,MAAM,iBAAiB,CAAC,EAAE,OAAA,MAA4D,CAAmB,WAAiB;AAChI,QAAM;AAAA,IACL;AAAA,IACA;AAAA,EAAA,IACG;AA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,EAEtB;AACA,SAAO,iBAAiB,eAAe,yBAAyB;AAEhE,SAAO;AACR;"}
1
+ {"version":3,"file":"withParagraphs.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/paragraphs/withParagraphs.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Point, Range as SlateRange, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { isParagraphElement, ParagraphElement, paragraphElementPlugin, paragraphElementType } from './ParagraphElement.js'\nimport { paragraphHtmlDeserializer } from './ParagraphHtmlDeserializer.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withParagraphs = ({ render }: { render: ElementRenderer<ParagraphElement> }) => <E extends Editor>(editor: E): E => {\n\tconst {\n\t\tcanToggleElement,\n\t\tdeleteBackward,\n\t} = editor\n\n\teditor.registerElement(paragraphElementPlugin({ render }))\n\n\teditor.canToggleElement = (elementType, suchThat) => {\n\t\t// This only allows numbered paragraphs at the top level.\n\t\t// TODO this is pretty bad but in order to fix this, we'd also have to fix toggleElement and there's no time now.\n\n\t\tif (elementType !== paragraphElementType || suchThat === undefined) {\n\t\t\treturn canToggleElement(elementType, suchThat)\n\t\t}\n\t\tconst isNumbered = suchThat.isNumbered\n\n\t\tif (isNumbered !== true) {\n\t\t\treturn canToggleElement(elementType, suchThat)\n\t\t}\n\n\t\tif (!editor.selection) {\n\t\t\treturn false\n\t\t}\n\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\tif (closestBlockEntry === undefined) {\n\t\t\treturn true\n\t\t}\n\t\tconst [closestBlockElement, closestBlockPath] = closestBlockEntry\n\n\t\treturn closestBlockPath.length === 1 && SlateElement.isElement(closestBlockElement) && closestBlockElement.type === paragraphElementType\n\t}\n\n\teditor.deleteBackward = unit => {\n\t\tconst selection = editor.selection\n\t\tif (unit !== 'character' || !selection || !SlateRange.isCollapsed(selection) || selection.focus.offset !== 0) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\t// The offset being zero doesn't necessarily imply that selection refers to the start of a paragraph.\n\t\t// It's just a way to early-exit.\n\n\t\tconst closestNumberedEntry = Editor.above<ParagraphElement>(editor, {\n\t\t\tmatch: node => SlateElement.isElement(node) && isParagraphElement(node, { isNumbered: true }),\n\t\t})\n\t\tif (closestNumberedEntry === undefined) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\tconst [, paragraphPath] = closestNumberedEntry\n\t\tconst paragraphStartPoint = Editor.start(editor, paragraphPath)\n\n\t\tif (!Point.equals(paragraphStartPoint, selection.focus)) {\n\t\t\treturn deleteBackward(unit)\n\t\t}\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ isNumbered: null }, // null removes the key altogether\n\t\t\t{ at: paragraphPath },\n\t\t)\n\t}\n\teditor.htmlDeserializer.registerPlugin(paragraphHtmlDeserializer)\n\n\treturn editor\n}\n"],"names":["SlateElement","SlateRange"],"mappings":";;;;AAMO,MAAM,iBAAiB,CAAC,EAAE,OAAA,MAA4D,CAAmB,WAAiB;AAChI,QAAM;AAAA,IACL;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgB,uBAAuB,EAAE,OAAA,CAAQ,CAAC;AAEzD,SAAO,mBAAmB,CAAC,aAAa,aAAa;AAIpD,QAAI,gBAAgB,wBAAwB,aAAa,QAAW;AACnE,aAAO,iBAAiB,aAAa,QAAQ;AAAA,IAC9C;AACA,UAAM,aAAa,SAAS;AAE5B,QAAI,eAAe,MAAM;AACxB,aAAO,iBAAiB,aAAa,QAAQ;AAAA,IAC9C;AAEA,QAAI,CAAC,OAAO,WAAW;AACtB,aAAO;AAAA,IACR;AACA,UAAM,oBAAoB,gBAAgB,kBAAkB,MAAM;AAClE,QAAI,sBAAsB,QAAW;AACpC,aAAO;AAAA,IACR;AACA,UAAM,CAAC,qBAAqB,gBAAgB,IAAI;AAEhD,WAAO,iBAAiB,WAAW,KAAKA,QAAa,UAAU,mBAAmB,KAAK,oBAAoB,SAAS;AAAA,EACrH;AAEA,SAAO,iBAAiB,CAAA,SAAQ;AAC/B,UAAM,YAAY,OAAO;AACzB,QAAI,SAAS,eAAe,CAAC,aAAa,CAACC,MAAW,YAAY,SAAS,KAAK,UAAU,MAAM,WAAW,GAAG;AAC7G,aAAO,eAAe,IAAI;AAAA,IAC3B;AAIA,UAAM,uBAAuB,OAAO,MAAwB,QAAQ;AAAA,MACnE,OAAO,CAAA,SAAQD,QAAa,UAAU,IAAI,KAAK,mBAAmB,MAAM,EAAE,YAAY,KAAA,CAAM;AAAA,IAAA,CAC5F;AACD,QAAI,yBAAyB,QAAW;AACvC,aAAO,eAAe,IAAI;AAAA,IAC3B;AACA,UAAM,CAAA,EAAG,aAAa,IAAI;AAC1B,UAAM,sBAAsB,OAAO,MAAM,QAAQ,aAAa;AAE9D,QAAI,CAAC,MAAM,OAAO,qBAAqB,UAAU,KAAK,GAAG;AACxD,aAAO,eAAe,IAAI;AAAA,IAC3B;AACA,eAAW;AAAA,MACV;AAAA,MACA,EAAE,YAAY,KAAA;AAAA;AAAA,MACd,EAAE,IAAI,cAAA;AAAA,IAAc;AAAA,EAEtB;AACA,SAAO,iBAAiB,eAAe,yBAAyB;AAEhE,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollTargetElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/scrollTargets/ScrollTargetElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Range as SlateRange, Transforms } from 'slate'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const scrollTargetElementType = 'scrollTarget' as const\n\nexport interface ScrollTargetElement extends SlateElement {\n\ttype: typeof scrollTargetElementType\n\tidentifier: string\n\tchildren: SlateEditor['children']\n}\n\nexport const isScrollTargetElement = (element: SlateNode): element is ScrollTargetElement =>\n\tSlateElement.isElement(element) && element.type === scrollTargetElementType\n\nexport const isScrollTargetElementActive = (editor: Editor) => {\n\tconst [link] = Editor.nodes(editor, { match: isScrollTargetElement })\n\treturn !!link\n}\n\nexport const scrollTargetElementPlugin = (\n\t{ render }: { render: ElementRenderer<ScrollTargetElement> },\n): EditorElementPlugin<ScrollTargetElement> => ({\n\ttype: scrollTargetElementType,\n\trender,\n\tisActive: ({ editor }) => isScrollTargetElementActive(editor),\n\tisInline: true,\n\tisVoid: true,\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tif (isScrollTargetElementActive(editor)) {\n\t\t\tunwrapScrollTarget(editor)\n\t\t} else {\n\t\t\tlet identifier = suchThat?.identifier\n\t\t\t\t?? prompt('Insert the identifier:')\n\n\t\t\tif (!identifier) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\twrapScrollTarget(editor, identifier)\n\t\t}\n\t},\n})\nconst unwrapScrollTarget = (editor: Editor) => {\n\tTransforms.removeNodes(editor, { match: isScrollTargetElement })\n}\nconst wrapScrollTarget = (editor: Editor, identifier: string) => {\n\tif (isScrollTargetElementActive(editor)) {\n\t\tunwrapScrollTarget(editor)\n\t}\n\n\tconst selection = editor.selection\n\tconst isCollapsed = selection ? SlateRange.isCollapsed(selection!) : false\n\tconst ScrollTarget: ScrollTargetElement = {\n\t\ttype: scrollTargetElementType,\n\t\tidentifier,\n\t\tchildren: [{ text: '' }],\n\t}\n\n\tif (!isCollapsed) {\n\t\tTransforms.collapse(editor, { edge: 'start' })\n\t}\n\tTransforms.insertNodes(editor, ScrollTarget)\n}\n"],"names":["SlateElement","Editor","Transforms","SlateRange"],"mappings":";;;AAGO,MAAM,0BAA0B;AAQhC,MAAM,wBAAwB,CAAC,YACrCA,MAAAA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE9C,MAAM,8BAA8B,CAAC,WAAmB;AAC9D,QAAM,CAAC,IAAI,IAAIC,aAAO,MAAM,QAAQ,EAAE,OAAO,uBAAuB;AACpE,SAAO,CAAC,CAAC;AACV;AAEO,MAAM,4BAA4B,CACxC,EAAE,cAC6C;AAAA,EAC/C,MAAM;AAAA,EACN;AAAA,EACA,UAAU,CAAC,EAAE,aAAa,4BAA4B,MAAM;AAAA,EAC5D,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe,CAAC,EAAE,QAAQ,eAAe;AACxC,QAAI,4BAA4B,MAAM,GAAG;AACxC,yBAAmB,MAAM;AAAA,IAC1B,OAAO;AACN,UAAI,aAAa,UAAU,cACvB,OAAO,wBAAwB;AAEnC,UAAI,CAAC,YAAY;AAChB;AAAA,MACD;AACA,uBAAiB,QAAQ,UAAU;AAAA,IACpC;AAAA,EACD;AACD;AACA,MAAM,qBAAqB,CAAC,WAAmB;AAC9CC,QAAAA,WAAW,YAAY,QAAQ,EAAE,OAAO,uBAAuB;AAChE;AACA,MAAM,mBAAmB,CAAC,QAAgB,eAAuB;AAChE,MAAI,4BAA4B,MAAM,GAAG;AACxC,uBAAmB,MAAM;AAAA,EAC1B;AAEA,QAAM,YAAY,OAAO;AACzB,QAAM,cAAc,YAAYC,MAAAA,MAAW,YAAY,SAAU,IAAI;AACrE,QAAM,eAAoC;AAAA,IACzC,MAAM;AAAA,IACN;AAAA,IACA,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,EAAA;AAGxB,MAAI,CAAC,aAAa;AACjBD,UAAAA,WAAW,SAAS,QAAQ,EAAE,MAAM,SAAS;AAAA,EAC9C;AACAA,mBAAW,YAAY,QAAQ,YAAY;AAC5C;;;;;"}
1
+ {"version":3,"file":"ScrollTargetElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/scrollTargets/ScrollTargetElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Range as SlateRange, Transforms } from 'slate'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const scrollTargetElementType = 'scrollTarget' as const\n\nexport interface ScrollTargetElement extends SlateElement {\n\ttype: typeof scrollTargetElementType\n\tidentifier: string\n\tchildren: SlateEditor['children']\n}\n\nexport const isScrollTargetElement = (element: SlateNode): element is ScrollTargetElement =>\n\tSlateElement.isElement(element) && element.type === scrollTargetElementType\n\nexport const isScrollTargetElementActive = (editor: Editor) => {\n\tconst [link] = Editor.nodes(editor, { match: isScrollTargetElement })\n\treturn !!link\n}\n\nexport const scrollTargetElementPlugin = (\n\t{ render }: { render: ElementRenderer<ScrollTargetElement> },\n): EditorElementPlugin<ScrollTargetElement> => ({\n\ttype: scrollTargetElementType,\n\trender,\n\tisActive: ({ editor }) => isScrollTargetElementActive(editor),\n\tisInline: true,\n\tisVoid: true,\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tif (isScrollTargetElementActive(editor)) {\n\t\t\tunwrapScrollTarget(editor)\n\t\t} else {\n\t\t\tlet identifier = suchThat?.identifier\n\t\t\t\t?? prompt('Insert the identifier:')\n\n\t\t\tif (!identifier) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\twrapScrollTarget(editor, identifier)\n\t\t}\n\t},\n})\nconst unwrapScrollTarget = (editor: Editor) => {\n\tTransforms.removeNodes(editor, { match: isScrollTargetElement })\n}\nconst wrapScrollTarget = (editor: Editor, identifier: string) => {\n\tif (isScrollTargetElementActive(editor)) {\n\t\tunwrapScrollTarget(editor)\n\t}\n\n\tconst selection = editor.selection\n\tconst isCollapsed = selection ? SlateRange.isCollapsed(selection!) : false\n\tconst ScrollTarget: ScrollTargetElement = {\n\t\ttype: scrollTargetElementType,\n\t\tidentifier,\n\t\tchildren: [{ text: '' }],\n\t}\n\n\tif (!isCollapsed) {\n\t\tTransforms.collapse(editor, { edge: 'start' })\n\t}\n\tTransforms.insertNodes(editor, ScrollTarget)\n}\n"],"names":["SlateElement","Editor","Transforms","SlateRange"],"mappings":";;;AAGO,MAAM,0BAA0B;AAQhC,MAAM,wBAAwB,CAAC,YACrCA,MAAAA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE9C,MAAM,8BAA8B,CAAC,WAAmB;AAC9D,QAAM,CAAC,IAAI,IAAIC,aAAO,MAAM,QAAQ,EAAE,OAAO,uBAAuB;AACpE,SAAO,CAAC,CAAC;AACV;AAEO,MAAM,4BAA4B,CACxC,EAAE,cAC6C;AAAA,EAC/C,MAAM;AAAA,EACN;AAAA,EACA,UAAU,CAAC,EAAE,aAAa,4BAA4B,MAAM;AAAA,EAC5D,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe,CAAC,EAAE,QAAQ,eAAe;AACxC,QAAI,4BAA4B,MAAM,GAAG;AACxC,yBAAmB,MAAM;AAAA,IAC1B,OAAO;AACN,UAAI,aAAa,UAAU,cACvB,OAAO,wBAAwB;AAEnC,UAAI,CAAC,YAAY;AAChB;AAAA,MACD;AACA,uBAAiB,QAAQ,UAAU;AAAA,IACpC;AAAA,EACD;AACD;AACA,MAAM,qBAAqB,CAAC,WAAmB;AAC9CC,QAAAA,WAAW,YAAY,QAAQ,EAAE,OAAO,uBAAuB;AAChE;AACA,MAAM,mBAAmB,CAAC,QAAgB,eAAuB;AAChE,MAAI,4BAA4B,MAAM,GAAG;AACxC,uBAAmB,MAAM;AAAA,EAC1B;AAEA,QAAM,YAAY,OAAO;AACzB,QAAM,cAAc,YAAYC,MAAAA,MAAW,YAAY,SAAU,IAAI;AACrE,QAAM,eAAoC;AAAA,IACzC,MAAM;AAAA,IACN;AAAA,IACA,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,EAAA;AAGxB,MAAI,CAAC,aAAa;AACjBD,UAAAA,WAAW,SAAS,QAAQ,EAAE,MAAM,SAAS;AAAA,EAC9C;AACAA,mBAAW,YAAY,QAAQ,YAAY;AAC5C;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollTargetElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/scrollTargets/ScrollTargetElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Range as SlateRange, Transforms } from 'slate'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const scrollTargetElementType = 'scrollTarget' as const\n\nexport interface ScrollTargetElement extends SlateElement {\n\ttype: typeof scrollTargetElementType\n\tidentifier: string\n\tchildren: SlateEditor['children']\n}\n\nexport const isScrollTargetElement = (element: SlateNode): element is ScrollTargetElement =>\n\tSlateElement.isElement(element) && element.type === scrollTargetElementType\n\nexport const isScrollTargetElementActive = (editor: Editor) => {\n\tconst [link] = Editor.nodes(editor, { match: isScrollTargetElement })\n\treturn !!link\n}\n\nexport const scrollTargetElementPlugin = (\n\t{ render }: { render: ElementRenderer<ScrollTargetElement> },\n): EditorElementPlugin<ScrollTargetElement> => ({\n\ttype: scrollTargetElementType,\n\trender,\n\tisActive: ({ editor }) => isScrollTargetElementActive(editor),\n\tisInline: true,\n\tisVoid: true,\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tif (isScrollTargetElementActive(editor)) {\n\t\t\tunwrapScrollTarget(editor)\n\t\t} else {\n\t\t\tlet identifier = suchThat?.identifier\n\t\t\t\t?? prompt('Insert the identifier:')\n\n\t\t\tif (!identifier) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\twrapScrollTarget(editor, identifier)\n\t\t}\n\t},\n})\nconst unwrapScrollTarget = (editor: Editor) => {\n\tTransforms.removeNodes(editor, { match: isScrollTargetElement })\n}\nconst wrapScrollTarget = (editor: Editor, identifier: string) => {\n\tif (isScrollTargetElementActive(editor)) {\n\t\tunwrapScrollTarget(editor)\n\t}\n\n\tconst selection = editor.selection\n\tconst isCollapsed = selection ? SlateRange.isCollapsed(selection!) : false\n\tconst ScrollTarget: ScrollTargetElement = {\n\t\ttype: scrollTargetElementType,\n\t\tidentifier,\n\t\tchildren: [{ text: '' }],\n\t}\n\n\tif (!isCollapsed) {\n\t\tTransforms.collapse(editor, { edge: 'start' })\n\t}\n\tTransforms.insertNodes(editor, ScrollTarget)\n}\n"],"names":["SlateElement","SlateRange"],"mappings":";AAGO,MAAM,0BAA0B;AAQhC,MAAM,wBAAwB,CAAC,YACrCA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE9C,MAAM,8BAA8B,CAAC,WAAmB;AAC9D,QAAM,CAAC,IAAI,IAAI,OAAO,MAAM,QAAQ,EAAE,OAAO,uBAAuB;AACpE,SAAO,CAAC,CAAC;AACV;AAEO,MAAM,4BAA4B,CACxC,EAAE,cAC6C;AAAA,EAC/C,MAAM;AAAA,EACN;AAAA,EACA,UAAU,CAAC,EAAE,aAAa,4BAA4B,MAAM;AAAA,EAC5D,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe,CAAC,EAAE,QAAQ,eAAe;AACxC,QAAI,4BAA4B,MAAM,GAAG;AACxC,yBAAmB,MAAM;AAAA,IAC1B,OAAO;AACN,UAAI,aAAa,UAAU,cACvB,OAAO,wBAAwB;AAEnC,UAAI,CAAC,YAAY;AAChB;AAAA,MACD;AACA,uBAAiB,QAAQ,UAAU;AAAA,IACpC;AAAA,EACD;AACD;AACA,MAAM,qBAAqB,CAAC,WAAmB;AAC9C,aAAW,YAAY,QAAQ,EAAE,OAAO,uBAAuB;AAChE;AACA,MAAM,mBAAmB,CAAC,QAAgB,eAAuB;AAChE,MAAI,4BAA4B,MAAM,GAAG;AACxC,uBAAmB,MAAM;AAAA,EAC1B;AAEA,QAAM,YAAY,OAAO;AACzB,QAAM,cAAc,YAAYC,MAAW,YAAY,SAAU,IAAI;AACrE,QAAM,eAAoC;AAAA,IACzC,MAAM;AAAA,IACN;AAAA,IACA,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,EAAA;AAGxB,MAAI,CAAC,aAAa;AACjB,eAAW,SAAS,QAAQ,EAAE,MAAM,SAAS;AAAA,EAC9C;AACA,aAAW,YAAY,QAAQ,YAAY;AAC5C;"}
1
+ {"version":3,"file":"ScrollTargetElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/scrollTargets/ScrollTargetElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Range as SlateRange, Transforms } from 'slate'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const scrollTargetElementType = 'scrollTarget' as const\n\nexport interface ScrollTargetElement extends SlateElement {\n\ttype: typeof scrollTargetElementType\n\tidentifier: string\n\tchildren: SlateEditor['children']\n}\n\nexport const isScrollTargetElement = (element: SlateNode): element is ScrollTargetElement =>\n\tSlateElement.isElement(element) && element.type === scrollTargetElementType\n\nexport const isScrollTargetElementActive = (editor: Editor) => {\n\tconst [link] = Editor.nodes(editor, { match: isScrollTargetElement })\n\treturn !!link\n}\n\nexport const scrollTargetElementPlugin = (\n\t{ render }: { render: ElementRenderer<ScrollTargetElement> },\n): EditorElementPlugin<ScrollTargetElement> => ({\n\ttype: scrollTargetElementType,\n\trender,\n\tisActive: ({ editor }) => isScrollTargetElementActive(editor),\n\tisInline: true,\n\tisVoid: true,\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tif (isScrollTargetElementActive(editor)) {\n\t\t\tunwrapScrollTarget(editor)\n\t\t} else {\n\t\t\tlet identifier = suchThat?.identifier\n\t\t\t\t?? prompt('Insert the identifier:')\n\n\t\t\tif (!identifier) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\twrapScrollTarget(editor, identifier)\n\t\t}\n\t},\n})\nconst unwrapScrollTarget = (editor: Editor) => {\n\tTransforms.removeNodes(editor, { match: isScrollTargetElement })\n}\nconst wrapScrollTarget = (editor: Editor, identifier: string) => {\n\tif (isScrollTargetElementActive(editor)) {\n\t\tunwrapScrollTarget(editor)\n\t}\n\n\tconst selection = editor.selection\n\tconst isCollapsed = selection ? SlateRange.isCollapsed(selection!) : false\n\tconst ScrollTarget: ScrollTargetElement = {\n\t\ttype: scrollTargetElementType,\n\t\tidentifier,\n\t\tchildren: [{ text: '' }],\n\t}\n\n\tif (!isCollapsed) {\n\t\tTransforms.collapse(editor, { edge: 'start' })\n\t}\n\tTransforms.insertNodes(editor, ScrollTarget)\n}\n"],"names":["SlateElement","SlateRange"],"mappings":";AAGO,MAAM,0BAA0B;AAQhC,MAAM,wBAAwB,CAAC,YACrCA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE9C,MAAM,8BAA8B,CAAC,WAAmB;AAC9D,QAAM,CAAC,IAAI,IAAI,OAAO,MAAM,QAAQ,EAAE,OAAO,uBAAuB;AACpE,SAAO,CAAC,CAAC;AACV;AAEO,MAAM,4BAA4B,CACxC,EAAE,cAC6C;AAAA,EAC/C,MAAM;AAAA,EACN;AAAA,EACA,UAAU,CAAC,EAAE,aAAa,4BAA4B,MAAM;AAAA,EAC5D,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,eAAe,CAAC,EAAE,QAAQ,eAAe;AACxC,QAAI,4BAA4B,MAAM,GAAG;AACxC,yBAAmB,MAAM;AAAA,IAC1B,OAAO;AACN,UAAI,aAAa,UAAU,cACvB,OAAO,wBAAwB;AAEnC,UAAI,CAAC,YAAY;AAChB;AAAA,MACD;AACA,uBAAiB,QAAQ,UAAU;AAAA,IACpC;AAAA,EACD;AACD;AACA,MAAM,qBAAqB,CAAC,WAAmB;AAC9C,aAAW,YAAY,QAAQ,EAAE,OAAO,uBAAuB;AAChE;AACA,MAAM,mBAAmB,CAAC,QAAgB,eAAuB;AAChE,MAAI,4BAA4B,MAAM,GAAG;AACxC,uBAAmB,MAAM;AAAA,EAC1B;AAEA,QAAM,YAAY,OAAO;AACzB,QAAM,cAAc,YAAYC,MAAW,YAAY,SAAU,IAAI;AACrE,QAAM,eAAoC;AAAA,IACzC,MAAM;AAAA,IACN;AAAA,IACA,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,EAAA;AAGxB,MAAI,CAAC,aAAa;AACjB,eAAW,SAAS,QAAQ,EAAE,MAAM,SAAS;AAAA,EAC9C;AACA,aAAW,YAAY,QAAQ,YAAY;AAC5C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withScrollTargets.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/scrollTargets/withScrollTargets.ts"],"sourcesContent":["import { Editor } from 'slate'\nimport { ScrollTargetElement, scrollTargetElementPlugin } from './ScrollTargetElement'\nimport { ElementRenderer } from '../../../types'\n\nexport const withScrollTargets = ({ render }: { render: ElementRenderer<ScrollTargetElement> }) => <E extends Editor>(editor: E): E => {\n\teditor.registerElement(scrollTargetElementPlugin({ render }))\n\treturn editor\n}\n"],"names":["scrollTargetElementPlugin"],"mappings":";;;AAIO,MAAM,oBAAoB,CAAC,EAAE,OAAA,MAA+D,CAAmB,WAAiB;AACtI,SAAO,gBAAgBA,oBAAAA,0BAA0B,EAAE,OAAA,CAAQ,CAAC;AAC5D,SAAO;AACR;;"}
1
+ {"version":3,"file":"withScrollTargets.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/scrollTargets/withScrollTargets.ts"],"sourcesContent":["import { Editor } from 'slate'\nimport { ScrollTargetElement, scrollTargetElementPlugin } from './ScrollTargetElement.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withScrollTargets = ({ render }: { render: ElementRenderer<ScrollTargetElement> }) => <E extends Editor>(editor: E): E => {\n\teditor.registerElement(scrollTargetElementPlugin({ render }))\n\treturn editor\n}\n"],"names":["scrollTargetElementPlugin"],"mappings":";;;AAIO,MAAM,oBAAoB,CAAC,EAAE,OAAA,MAA+D,CAAmB,WAAiB;AACtI,SAAO,gBAAgBA,oBAAAA,0BAA0B,EAAE,OAAA,CAAQ,CAAC;AAC5D,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withScrollTargets.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/scrollTargets/withScrollTargets.ts"],"sourcesContent":["import { Editor } from 'slate'\nimport { ScrollTargetElement, scrollTargetElementPlugin } from './ScrollTargetElement'\nimport { ElementRenderer } from '../../../types'\n\nexport const withScrollTargets = ({ render }: { render: ElementRenderer<ScrollTargetElement> }) => <E extends Editor>(editor: E): E => {\n\teditor.registerElement(scrollTargetElementPlugin({ render }))\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,oBAAoB,CAAC,EAAE,OAAA,MAA+D,CAAmB,WAAiB;AACtI,SAAO,gBAAgB,0BAA0B,EAAE,OAAA,CAAQ,CAAC;AAC5D,SAAO;AACR;"}
1
+ {"version":3,"file":"withScrollTargets.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/scrollTargets/withScrollTargets.ts"],"sourcesContent":["import { Editor } from 'slate'\nimport { ScrollTargetElement, scrollTargetElementPlugin } from './ScrollTargetElement.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withScrollTargets = ({ render }: { render: ElementRenderer<ScrollTargetElement> }) => <E extends Editor>(editor: E): E => {\n\teditor.registerElement(scrollTargetElementPlugin({ render }))\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,oBAAoB,CAAC,EAAE,OAAA,MAA+D,CAAmB,WAAiB;AACtI,SAAO,gBAAgB,0BAA0B,EAAE,OAAA,CAAQ,CAAC;AAC5D,SAAO;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableCellElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableCellElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element, Element as SlateElement, Node, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { tableRowElementType } from './TableRowElement'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const tableCellElementType = 'tableCell' as const\n\nexport interface TableCellElement extends SlateElement {\n\ttype: typeof tableCellElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'row'\n\tjustify?: 'start' | 'center' | 'end'\n}\n\nexport const isTableCellElement = (element: Node): element is TableCellElement => Element.isElement(element) && element.type === tableCellElementType\n\nexport const createEmptyTableCellElement = () => ({\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n\nexport const tableCellElementPlugin = ({ render }: { render: ElementRenderer<TableCellElement> }): EditorElementPlugin<TableCellElement> => ({\n\ttype: tableCellElementType,\n\trender,\n\tnormalizeNode: ({ element, editor, path, preventDefault }) => {\n\t\tif (element.children.length === 1) {\n\t\t\tconst onlyChild = element.children[0]\n\t\t\tif (SlateElement.isElement(onlyChild) && editor.isDefaultElement(onlyChild)) {\n\t\t\t\tTransforms.unwrapNodes(editor, {\n\t\t\t\t\tat: [...path, 0],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableRowElementType)) {\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: true,\n})\n"],"names":["Element","SlateElement","Transforms","ContemberEditor","tableRowElementType"],"mappings":";;;;;AAKO,MAAM,uBAAuB;AAS7B,MAAM,qBAAqB,CAAC,YAA+CA,MAAAA,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE1H,MAAM,8BAA8B,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,UAAU,CAAC,EAAE,MAAM,IAAI;AACxB;AAEO,MAAM,yBAAyB,CAAC,EAAE,cAAoG;AAAA,EAC5I,MAAM;AAAA,EACN;AAAA,EACA,eAAe,CAAC,EAAE,SAAS,QAAQ,MAAM,qBAAqB;AAC7D,QAAI,QAAQ,SAAS,WAAW,GAAG;AAClC,YAAM,YAAY,QAAQ,SAAS,CAAC;AACpC,UAAIC,MAAAA,QAAa,UAAU,SAAS,KAAK,OAAO,iBAAiB,SAAS,GAAG;AAC5EC,cAAAA,WAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI,CAAC,GAAG,MAAM,CAAC;AAAA,QAAA,CACf;AAAA,MACF;AAAA,IACD;AACA,QAAI,CAACC,MAAAA,gBAAgB,gBAAgB,QAAQ,CAAC,SAAS,IAAI,GAAGC,gBAAAA,mBAAmB,GAAG;AACnFF,YAAAA,WAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,aAAO,eAAA;AAAA,IACR;AACA,QAAI,KAAK,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,aAAa;AACrDA,uBAAW,SAAS,QAAQ,EAAE,aAAa,QAAQ,EAAE,IAAI,MAAM;AAC/D,aAAO,eAAA;AAAA,IACR;AAAA,EACD;AAAA,EACA,qBAAqB;AACtB;;;;;"}
1
+ {"version":3,"file":"TableCellElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableCellElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element, Element as SlateElement, Node, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { tableRowElementType } from './TableRowElement.js'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const tableCellElementType = 'tableCell' as const\n\nexport interface TableCellElement extends SlateElement {\n\ttype: typeof tableCellElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'row'\n\tjustify?: 'start' | 'center' | 'end'\n}\n\nexport const isTableCellElement = (element: Node): element is TableCellElement => Element.isElement(element) && element.type === tableCellElementType\n\nexport const createEmptyTableCellElement = () => ({\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n\nexport const tableCellElementPlugin = ({ render }: { render: ElementRenderer<TableCellElement> }): EditorElementPlugin<TableCellElement> => ({\n\ttype: tableCellElementType,\n\trender,\n\tnormalizeNode: ({ element, editor, path, preventDefault }) => {\n\t\tif (element.children.length === 1) {\n\t\t\tconst onlyChild = element.children[0]\n\t\t\tif (SlateElement.isElement(onlyChild) && editor.isDefaultElement(onlyChild)) {\n\t\t\t\tTransforms.unwrapNodes(editor, {\n\t\t\t\t\tat: [...path, 0],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableRowElementType)) {\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: true,\n})\n"],"names":["Element","SlateElement","Transforms","ContemberEditor","tableRowElementType"],"mappings":";;;;;AAKO,MAAM,uBAAuB;AAS7B,MAAM,qBAAqB,CAAC,YAA+CA,MAAAA,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE1H,MAAM,8BAA8B,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,UAAU,CAAC,EAAE,MAAM,IAAI;AACxB;AAEO,MAAM,yBAAyB,CAAC,EAAE,cAAoG;AAAA,EAC5I,MAAM;AAAA,EACN;AAAA,EACA,eAAe,CAAC,EAAE,SAAS,QAAQ,MAAM,qBAAqB;AAC7D,QAAI,QAAQ,SAAS,WAAW,GAAG;AAClC,YAAM,YAAY,QAAQ,SAAS,CAAC;AACpC,UAAIC,MAAAA,QAAa,UAAU,SAAS,KAAK,OAAO,iBAAiB,SAAS,GAAG;AAC5EC,cAAAA,WAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI,CAAC,GAAG,MAAM,CAAC;AAAA,QAAA,CACf;AAAA,MACF;AAAA,IACD;AACA,QAAI,CAACC,MAAAA,gBAAgB,gBAAgB,QAAQ,CAAC,SAAS,IAAI,GAAGC,gBAAAA,mBAAmB,GAAG;AACnFF,YAAAA,WAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,aAAO,eAAA;AAAA,IACR;AACA,QAAI,KAAK,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,aAAa;AACrDA,uBAAW,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":"TableCellElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableCellElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element, Element as SlateElement, Node, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { tableRowElementType } from './TableRowElement'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const tableCellElementType = 'tableCell' as const\n\nexport interface TableCellElement extends SlateElement {\n\ttype: typeof tableCellElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'row'\n\tjustify?: 'start' | 'center' | 'end'\n}\n\nexport const isTableCellElement = (element: Node): element is TableCellElement => Element.isElement(element) && element.type === tableCellElementType\n\nexport const createEmptyTableCellElement = () => ({\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n\nexport const tableCellElementPlugin = ({ render }: { render: ElementRenderer<TableCellElement> }): EditorElementPlugin<TableCellElement> => ({\n\ttype: tableCellElementType,\n\trender,\n\tnormalizeNode: ({ element, editor, path, preventDefault }) => {\n\t\tif (element.children.length === 1) {\n\t\t\tconst onlyChild = element.children[0]\n\t\t\tif (SlateElement.isElement(onlyChild) && editor.isDefaultElement(onlyChild)) {\n\t\t\t\tTransforms.unwrapNodes(editor, {\n\t\t\t\t\tat: [...path, 0],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableRowElementType)) {\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: true,\n})\n"],"names":["SlateElement"],"mappings":";;;AAKO,MAAM,uBAAuB;AAS7B,MAAM,qBAAqB,CAAC,YAA+C,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE1H,MAAM,8BAA8B,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,UAAU,CAAC,EAAE,MAAM,IAAI;AACxB;AAEO,MAAM,yBAAyB,CAAC,EAAE,cAAoG;AAAA,EAC5I,MAAM;AAAA,EACN;AAAA,EACA,eAAe,CAAC,EAAE,SAAS,QAAQ,MAAM,qBAAqB;AAC7D,QAAI,QAAQ,SAAS,WAAW,GAAG;AAClC,YAAM,YAAY,QAAQ,SAAS,CAAC;AACpC,UAAIA,QAAa,UAAU,SAAS,KAAK,OAAO,iBAAiB,SAAS,GAAG;AAC5E,mBAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI,CAAC,GAAG,MAAM,CAAC;AAAA,QAAA,CACf;AAAA,MACF;AAAA,IACD;AACA,QAAI,CAAC,gBAAgB,gBAAgB,QAAQ,CAAC,SAAS,IAAI,GAAG,mBAAmB,GAAG;AACnF,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":"TableCellElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableCellElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element, Element as SlateElement, Node, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { tableRowElementType } from './TableRowElement.js'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const tableCellElementType = 'tableCell' as const\n\nexport interface TableCellElement extends SlateElement {\n\ttype: typeof tableCellElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'row'\n\tjustify?: 'start' | 'center' | 'end'\n}\n\nexport const isTableCellElement = (element: Node): element is TableCellElement => Element.isElement(element) && element.type === tableCellElementType\n\nexport const createEmptyTableCellElement = () => ({\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n\nexport const tableCellElementPlugin = ({ render }: { render: ElementRenderer<TableCellElement> }): EditorElementPlugin<TableCellElement> => ({\n\ttype: tableCellElementType,\n\trender,\n\tnormalizeNode: ({ element, editor, path, preventDefault }) => {\n\t\tif (element.children.length === 1) {\n\t\t\tconst onlyChild = element.children[0]\n\t\t\tif (SlateElement.isElement(onlyChild) && editor.isDefaultElement(onlyChild)) {\n\t\t\t\tTransforms.unwrapNodes(editor, {\n\t\t\t\t\tat: [...path, 0],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableRowElementType)) {\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: true,\n})\n"],"names":["SlateElement"],"mappings":";;;AAKO,MAAM,uBAAuB;AAS7B,MAAM,qBAAqB,CAAC,YAA+C,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE1H,MAAM,8BAA8B,OAAO;AAAA,EACjD,MAAM;AAAA,EACN,UAAU,CAAC,EAAE,MAAM,IAAI;AACxB;AAEO,MAAM,yBAAyB,CAAC,EAAE,cAAoG;AAAA,EAC5I,MAAM;AAAA,EACN;AAAA,EACA,eAAe,CAAC,EAAE,SAAS,QAAQ,MAAM,qBAAqB;AAC7D,QAAI,QAAQ,SAAS,WAAW,GAAG;AAClC,YAAM,YAAY,QAAQ,SAAS,CAAC;AACpC,UAAIA,QAAa,UAAU,SAAS,KAAK,OAAO,iBAAiB,SAAS,GAAG;AAC5E,mBAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI,CAAC,GAAG,MAAM,CAAC;AAAA,QAAA,CACf;AAAA,MACF;AAAA,IACD;AACA,QAAI,CAAC,gBAAgB,gBAAgB,QAAQ,CAAC,SAAS,IAAI,GAAG,mBAAmB,GAAG;AACnF,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":"TableElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableElement.ts"],"sourcesContent":["import {\n\tEditor,\n\tEditor as SlateEditor,\n\tElement,\n\tElement as SlateElement,\n\tNode,\n\tNode as SlateNode,\n\tNodeEntry,\n\tPath as SlatePath,\n\tRange as SlateRange,\n\tTransforms,\n} from 'slate'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement'\nimport { ContemberEditor } from '../../../editor'\nimport { gaugeTableColumnCount } from './gaugeTableColumnCount'\nimport { createEmptyTableCellElement } from './TableCellElement'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const tableElementType = 'table' as const\n\nexport interface TableElement extends SlateElement {\n\ttype: typeof tableElementType\n\tchildren: SlateEditor['children']\n}\n\nexport const isTableElement = (element: Node): element is TableElement => Element.isElement(element) && element.type === tableElementType\n\nexport const createEmptyTableElement = (rowCount = 3, columnCount = 2) => ({\n\ttype: tableElementType,\n\tchildren: Array.from({ length: rowCount }, () => createEmptyTableRowElement(columnCount)),\n})\n\nexport const getTableElementRowCount = (element: TableElement): number => {\n\treturn element.children.length\n}\n\nexport const getTableElementColumnCount = (element: TableElement): number => {\n\tconst firstRow = element.children[0] as TableRowElement | undefined\n\treturn firstRow?.children.length ?? 0\n}\n\nexport const tableElementPlugin = ({ render }: { render: ElementRenderer<TableElement> }): EditorElementPlugin<TableElement> => ({\n\ttype: tableElementType,\n\trender,\n\tnormalizeNode: ({ editor, element, path, preventDefault }) => {\n\t\tif (element.children.length === 0) {\n\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\n\t\tlet didTransform = false\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableRowElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableRowElementType }, { at: childPath })\n\t\t\t\t\tdidTransform = true\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 (didTransform) {\n\t\t\treturn preventDefault()\n\t\t}\n\t\tconst columnCount = gaugeTableColumnCount(element)\n\t\tfor (const [row, childPath] of SlateNode.children(editor, path) as Iterable<NodeEntry<TableRowElement>>) {\n\t\t\tconst currentColumnCount = row.children.length\n\t\t\tif (currentColumnCount === columnCount) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// For the first row, we prepend or insert at the start which in most cases will likely preserve the\n\t\t\t// already existing cells' positions.\n\t\t\tif (currentColumnCount > columnCount) {\n\t\t\t\tconst shouldBiasTowardsStart = childPath[childPath.length - 1] === 0\n\t\t\t\tfor (let i = columnCount; i < currentColumnCount; i++) {\n\t\t\t\t\tTransforms.removeNodes(editor, { at: [...childPath, shouldBiasTowardsStart ? 0 : i] })\n\t\t\t\t}\n\t\t\t} else if (currentColumnCount < columnCount) {\n\t\t\t\tconst shouldBiasTowardsStart = childPath[childPath.length - 1] === 0\n\t\t\t\tfor (let i = currentColumnCount; i < columnCount; i++) {\n\t\t\t\t\tTransforms.insertNodes(editor, createEmptyTableCellElement(), {\n\t\t\t\t\t\tat: [...childPath, shouldBiasTowardsStart ? 0 : i],\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n\ttoggleElement: ({ editor }) => {\n\t\tconst closestTableEntry = Editor.above(editor, {\n\t\t\tmode: 'lowest',\n\t\t\tmatch: matchedNode => SlateElement.isElement(matchedNode) && isTableElement(matchedNode),\n\t\t})\n\t\tif (closestTableEntry) {\n\t\t\treturn\n\t\t}\n\t\tconst { selection } = editor\n\t\tif (!selection || SlateRange.isExpanded(selection)) {\n\t\t\treturn\n\t\t}\n\n\t\tconst closestDefaultEntry: NodeEntry | undefined = Editor.above(editor, {\n\t\t\tat: selection.focus,\n\t\t\tmode: 'lowest',\n\t\t\tmatch: matchedNode => SlateElement.isElement(matchedNode) && editor.isDefaultElement(matchedNode),\n\t\t})\n\t\tif (!closestDefaultEntry) {\n\t\t\treturn\n\t\t}\n\t\tconst [closestDefault, closestDefaultPath] = closestDefaultEntry\n\n\t\tif (closestDefaultPath.length !== 1) {\n\t\t\treturn // We only support tables at the very top level\n\t\t}\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tlet targetPath: SlatePath\n\t\t\tif (SlateNode.string(closestDefault) === '') {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: closestDefaultPath,\n\t\t\t\t})\n\t\t\t\ttargetPath = closestDefaultPath\n\t\t\t} else {\n\t\t\t\ttargetPath = [closestDefaultPath[0] + 1]\n\t\t\t}\n\t\t\tconst table = createEmptyTableElement()\n\n\t\t\tTransforms.insertNodes(editor, table, {\n\t\t\t\tat: targetPath,\n\t\t\t})\n\t\t})\n\t},\n})\n"],"names":["Element","createEmptyTableRowElement","Transforms","SlateNode","SlateElement","isTableRowElement","ContemberEditor","tableRowElementType","gaugeTableColumnCount","createEmptyTableCellElement","Editor","SlateRange"],"mappings":";;;;;;;AAkBO,MAAM,mBAAmB;AAOzB,MAAM,iBAAiB,CAAC,YAA2CA,MAAAA,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAElH,MAAM,0BAA0B,CAAC,WAAW,GAAG,cAAc,OAAO;AAAA,EAC1E,M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AC5CD,cAAAA,WAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI;AAAA,QAAA,CACJ;AACD,qBAAa;AAAA,MACd,OAAO;AACN,qBAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC;AAAA,MACxC;AACA,YAAM,QAAQ,wBAAA;AAEdA,uBAAW,YAAY,QAAQ,OAAO;AAAA,QACrC,IAAI;AAAA,MAAA,CACJ;AAAA,IACF,CAAC;AAAA,EACF;AACD;;;;;;;"}
1
+ {"version":3,"file":"TableElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableElement.ts"],"sourcesContent":["import {\n\tEditor,\n\tEditor as SlateEditor,\n\tElement,\n\tElement as SlateElement,\n\tNode,\n\tNode as SlateNode,\n\tNodeEntry,\n\tPath as SlatePath,\n\tRange as SlateRange,\n\tTransforms,\n} from 'slate'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement.js'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { gaugeTableColumnCount } from './gaugeTableColumnCount.js'\nimport { createEmptyTableCellElement } from './TableCellElement.js'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const tableElementType = 'table' as const\n\nexport interface TableElement extends SlateElement {\n\ttype: typeof tableElementType\n\tchildren: SlateEditor['children']\n}\n\nexport const isTableElement = (element: Node): element is TableElement => Element.isElement(element) && element.type === tableElementType\n\nexport const createEmptyTableElement = (rowCount = 3, columnCount = 2) => ({\n\ttype: tableElementType,\n\tchildren: Array.from({ length: rowCount }, () => createEmptyTableRowElement(columnCount)),\n})\n\nexport const getTableElementRowCount = (element: TableElement): number => {\n\treturn element.children.length\n}\n\nexport const getTableElementColumnCount = (element: TableElement): number => {\n\tconst firstRow = element.children[0] as TableRowElement | undefined\n\treturn firstRow?.children.length ?? 0\n}\n\nexport const tableElementPlugin = ({ render }: { render: ElementRenderer<TableElement> }): EditorElementPlugin<TableElement> => ({\n\ttype: tableElementType,\n\trender,\n\tnormalizeNode: ({ editor, element, path, preventDefault }) => {\n\t\tif (element.children.length === 0) {\n\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\n\t\tlet didTransform = false\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableRowElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableRowElementType }, { at: childPath })\n\t\t\t\t\tdidTransform = true\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 (didTransform) {\n\t\t\treturn preventDefault()\n\t\t}\n\t\tconst columnCount = gaugeTableColumnCount(element)\n\t\tfor (const [row, childPath] of SlateNode.children(editor, path) as Iterable<NodeEntry<TableRowElement>>) {\n\t\t\tconst currentColumnCount = row.children.length\n\t\t\tif (currentColumnCount === columnCount) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// For the first row, we prepend or insert at the start which in most cases will likely preserve the\n\t\t\t// already existing cells' positions.\n\t\t\tif (currentColumnCount > columnCount) {\n\t\t\t\tconst shouldBiasTowardsStart = childPath[childPath.length - 1] === 0\n\t\t\t\tfor (let i = columnCount; i < currentColumnCount; i++) {\n\t\t\t\t\tTransforms.removeNodes(editor, { at: [...childPath, shouldBiasTowardsStart ? 0 : i] })\n\t\t\t\t}\n\t\t\t} else if (currentColumnCount < columnCount) {\n\t\t\t\tconst shouldBiasTowardsStart = childPath[childPath.length - 1] === 0\n\t\t\t\tfor (let i = currentColumnCount; i < columnCount; i++) {\n\t\t\t\t\tTransforms.insertNodes(editor, createEmptyTableCellElement(), {\n\t\t\t\t\t\tat: [...childPath, shouldBiasTowardsStart ? 0 : i],\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n\ttoggleElement: ({ editor }) => {\n\t\tconst closestTableEntry = Editor.above(editor, {\n\t\t\tmode: 'lowest',\n\t\t\tmatch: matchedNode => SlateElement.isElement(matchedNode) && isTableElement(matchedNode),\n\t\t})\n\t\tif (closestTableEntry) {\n\t\t\treturn\n\t\t}\n\t\tconst { selection } = editor\n\t\tif (!selection || SlateRange.isExpanded(selection)) {\n\t\t\treturn\n\t\t}\n\n\t\tconst closestDefaultEntry: NodeEntry | undefined = Editor.above(editor, {\n\t\t\tat: selection.focus,\n\t\t\tmode: 'lowest',\n\t\t\tmatch: matchedNode => SlateElement.isElement(matchedNode) && editor.isDefaultElement(matchedNode),\n\t\t})\n\t\tif (!closestDefaultEntry) {\n\t\t\treturn\n\t\t}\n\t\tconst [closestDefault, closestDefaultPath] = closestDefaultEntry\n\n\t\tif (closestDefaultPath.length !== 1) {\n\t\t\treturn // We only support tables at the very top level\n\t\t}\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tlet targetPath: SlatePath\n\t\t\tif (SlateNode.string(closestDefault) === '') {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: closestDefaultPath,\n\t\t\t\t})\n\t\t\t\ttargetPath = closestDefaultPath\n\t\t\t} else {\n\t\t\t\ttargetPath = [closestDefaultPath[0] + 1]\n\t\t\t}\n\t\t\tconst table = createEmptyTableElement()\n\n\t\t\tTransforms.insertNodes(editor, table, {\n\t\t\t\tat: targetPath,\n\t\t\t})\n\t\t})\n\t},\n})\n"],"names":["Element","createEmptyTableRowElement","Transforms","SlateNode","SlateElement","isTableRowElement","ContemberEditor","tableRowElementType","gaugeTableColumnCount","createEmptyTableCellElement","Editor","SlateRange"],"mappings":";;;;;;;AAkBO,MAAM,mBAAmB;AAOzB,MAAM,iBAAiB,CAAC,YAA2CA,MAAAA,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAElH,MAAM,0BAA0B,CAAC,WAAW,GAAG,cAAc,OAAO;AAA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AM,IAAI;AAC5CD,cAAAA,WAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI;AAAA,QAAA,CACJ;AACD,qBAAa;AAAA,MACd,OAAO;AACN,qBAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC;AAAA,MACxC;AACA,YAAM,QAAQ,wBAAA;AAEdA,uBAAW,YAAY,QAAQ,OAAO;AAAA,QACrC,IAAI;AAAA,MAAA,CACJ;AAAA,IACF,CAAC;AAAA,EACF;AACD;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableElement.ts"],"sourcesContent":["import {\n\tEditor,\n\tEditor as SlateEditor,\n\tElement,\n\tElement as SlateElement,\n\tNode,\n\tNode as SlateNode,\n\tNodeEntry,\n\tPath as SlatePath,\n\tRange as SlateRange,\n\tTransforms,\n} from 'slate'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement'\nimport { ContemberEditor } from '../../../editor'\nimport { gaugeTableColumnCount } from './gaugeTableColumnCount'\nimport { createEmptyTableCellElement } from './TableCellElement'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const tableElementType = 'table' as const\n\nexport interface TableElement extends SlateElement {\n\ttype: typeof tableElementType\n\tchildren: SlateEditor['children']\n}\n\nexport const isTableElement = (element: Node): element is TableElement => Element.isElement(element) && element.type === tableElementType\n\nexport const createEmptyTableElement = (rowCount = 3, columnCount = 2) => ({\n\ttype: tableElementType,\n\tchildren: Array.from({ length: rowCount }, () => createEmptyTableRowElement(columnCount)),\n})\n\nexport const getTableElementRowCount = (element: TableElement): number => {\n\treturn element.children.length\n}\n\nexport const getTableElementColumnCount = (element: TableElement): number => {\n\tconst firstRow = element.children[0] as TableRowElement | undefined\n\treturn firstRow?.children.length ?? 0\n}\n\nexport const tableElementPlugin = ({ render }: { render: ElementRenderer<TableElement> }): EditorElementPlugin<TableElement> => ({\n\ttype: tableElementType,\n\trender,\n\tnormalizeNode: ({ editor, element, path, preventDefault }) => {\n\t\tif (element.children.length === 0) {\n\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\n\t\tlet didTransform = false\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableRowElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableRowElementType }, { at: childPath })\n\t\t\t\t\tdidTransform = true\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 (didTransform) {\n\t\t\treturn preventDefault()\n\t\t}\n\t\tconst columnCount = gaugeTableColumnCount(element)\n\t\tfor (const [row, childPath] of SlateNode.children(editor, path) as Iterable<NodeEntry<TableRowElement>>) {\n\t\t\tconst currentColumnCount = row.children.length\n\t\t\tif (currentColumnCount === columnCount) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// For the first row, we prepend or insert at the start which in most cases will likely preserve the\n\t\t\t// already existing cells' positions.\n\t\t\tif (currentColumnCount > columnCount) {\n\t\t\t\tconst shouldBiasTowardsStart = childPath[childPath.length - 1] === 0\n\t\t\t\tfor (let i = columnCount; i < currentColumnCount; i++) {\n\t\t\t\t\tTransforms.removeNodes(editor, { at: [...childPath, shouldBiasTowardsStart ? 0 : i] })\n\t\t\t\t}\n\t\t\t} else if (currentColumnCount < columnCount) {\n\t\t\t\tconst shouldBiasTowardsStart = childPath[childPath.length - 1] === 0\n\t\t\t\tfor (let i = currentColumnCount; i < columnCount; i++) {\n\t\t\t\t\tTransforms.insertNodes(editor, createEmptyTableCellElement(), {\n\t\t\t\t\t\tat: [...childPath, shouldBiasTowardsStart ? 0 : i],\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n\ttoggleElement: ({ editor }) => {\n\t\tconst closestTableEntry = Editor.above(editor, {\n\t\t\tmode: 'lowest',\n\t\t\tmatch: matchedNode => SlateElement.isElement(matchedNode) && isTableElement(matchedNode),\n\t\t})\n\t\tif (closestTableEntry) {\n\t\t\treturn\n\t\t}\n\t\tconst { selection } = editor\n\t\tif (!selection || SlateRange.isExpanded(selection)) {\n\t\t\treturn\n\t\t}\n\n\t\tconst closestDefaultEntry: NodeEntry | undefined = Editor.above(editor, {\n\t\t\tat: selection.focus,\n\t\t\tmode: 'lowest',\n\t\t\tmatch: matchedNode => SlateElement.isElement(matchedNode) && editor.isDefaultElement(matchedNode),\n\t\t})\n\t\tif (!closestDefaultEntry) {\n\t\t\treturn\n\t\t}\n\t\tconst [closestDefault, closestDefaultPath] = closestDefaultEntry\n\n\t\tif (closestDefaultPath.length !== 1) {\n\t\t\treturn // We only support tables at the very top level\n\t\t}\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tlet targetPath: SlatePath\n\t\t\tif (SlateNode.string(closestDefault) === '') {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: closestDefaultPath,\n\t\t\t\t})\n\t\t\t\ttargetPath = closestDefaultPath\n\t\t\t} else {\n\t\t\t\ttargetPath = [closestDefaultPath[0] + 1]\n\t\t\t}\n\t\t\tconst table = createEmptyTableElement()\n\n\t\t\tTransforms.insertNodes(editor, table, {\n\t\t\t\tat: targetPath,\n\t\t\t})\n\t\t})\n\t},\n})\n"],"names":["SlateNode","SlateElement","SlateRange"],"mappings":";;;;;AAkBO,MAAM,mBAAmB;AAOzB,MAAM,iBAAiB,CAAC,YAA2C,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAElH,MAAM,0BAA0B,CAAC,WAAW,GAAG,cAAc,OAAO;AAAA,EAC1E,MAAM;AAAA,EACN,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAY,MAAM,2BAA2B,WAAW,CAAC;AAC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IAAI;AAAA,MAAA,CACJ;AAAA,IACF,CAAC;AAAA,EACF;AACD;"}
1
+ {"version":3,"file":"TableElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableElement.ts"],"sourcesContent":["import {\n\tEditor,\n\tEditor as SlateEditor,\n\tElement,\n\tElement as SlateElement,\n\tNode,\n\tNode as SlateNode,\n\tNodeEntry,\n\tPath as SlatePath,\n\tRange as SlateRange,\n\tTransforms,\n} from 'slate'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement.js'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { gaugeTableColumnCount } from './gaugeTableColumnCount.js'\nimport { createEmptyTableCellElement } from './TableCellElement.js'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types/index.js'\n\nexport const tableElementType = 'table' as const\n\nexport interface TableElement extends SlateElement {\n\ttype: typeof tableElementType\n\tchildren: SlateEditor['children']\n}\n\nexport const isTableElement = (element: Node): element is TableElement => Element.isElement(element) && element.type === tableElementType\n\nexport const createEmptyTableElement = (rowCount = 3, columnCount = 2) => ({\n\ttype: tableElementType,\n\tchildren: Array.from({ length: rowCount }, () => createEmptyTableRowElement(columnCount)),\n})\n\nexport const getTableElementRowCount = (element: TableElement): number => {\n\treturn element.children.length\n}\n\nexport const getTableElementColumnCount = (element: TableElement): number => {\n\tconst firstRow = element.children[0] as TableRowElement | undefined\n\treturn firstRow?.children.length ?? 0\n}\n\nexport const tableElementPlugin = ({ render }: { render: ElementRenderer<TableElement> }): EditorElementPlugin<TableElement> => ({\n\ttype: tableElementType,\n\trender,\n\tnormalizeNode: ({ editor, element, path, preventDefault }) => {\n\t\tif (element.children.length === 0) {\n\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\n\t\tlet didTransform = false\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableRowElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableRowElementType }, { at: childPath })\n\t\t\t\t\tdidTransform = true\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 (didTransform) {\n\t\t\treturn preventDefault()\n\t\t}\n\t\tconst columnCount = gaugeTableColumnCount(element)\n\t\tfor (const [row, childPath] of SlateNode.children(editor, path) as Iterable<NodeEntry<TableRowElement>>) {\n\t\t\tconst currentColumnCount = row.children.length\n\t\t\tif (currentColumnCount === columnCount) {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// For the first row, we prepend or insert at the start which in most cases will likely preserve the\n\t\t\t// already existing cells' positions.\n\t\t\tif (currentColumnCount > columnCount) {\n\t\t\t\tconst shouldBiasTowardsStart = childPath[childPath.length - 1] === 0\n\t\t\t\tfor (let i = columnCount; i < currentColumnCount; i++) {\n\t\t\t\t\tTransforms.removeNodes(editor, { at: [...childPath, shouldBiasTowardsStart ? 0 : i] })\n\t\t\t\t}\n\t\t\t} else if (currentColumnCount < columnCount) {\n\t\t\t\tconst shouldBiasTowardsStart = childPath[childPath.length - 1] === 0\n\t\t\t\tfor (let i = currentColumnCount; i < columnCount; i++) {\n\t\t\t\t\tTransforms.insertNodes(editor, createEmptyTableCellElement(), {\n\t\t\t\t\t\tat: [...childPath, shouldBiasTowardsStart ? 0 : i],\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n\ttoggleElement: ({ editor }) => {\n\t\tconst closestTableEntry = Editor.above(editor, {\n\t\t\tmode: 'lowest',\n\t\t\tmatch: matchedNode => SlateElement.isElement(matchedNode) && isTableElement(matchedNode),\n\t\t})\n\t\tif (closestTableEntry) {\n\t\t\treturn\n\t\t}\n\t\tconst { selection } = editor\n\t\tif (!selection || SlateRange.isExpanded(selection)) {\n\t\t\treturn\n\t\t}\n\n\t\tconst closestDefaultEntry: NodeEntry | undefined = Editor.above(editor, {\n\t\t\tat: selection.focus,\n\t\t\tmode: 'lowest',\n\t\t\tmatch: matchedNode => SlateElement.isElement(matchedNode) && editor.isDefaultElement(matchedNode),\n\t\t})\n\t\tif (!closestDefaultEntry) {\n\t\t\treturn\n\t\t}\n\t\tconst [closestDefault, closestDefaultPath] = closestDefaultEntry\n\n\t\tif (closestDefaultPath.length !== 1) {\n\t\t\treturn // We only support tables at the very top level\n\t\t}\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tlet targetPath: SlatePath\n\t\t\tif (SlateNode.string(closestDefault) === '') {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: closestDefaultPath,\n\t\t\t\t})\n\t\t\t\ttargetPath = closestDefaultPath\n\t\t\t} else {\n\t\t\t\ttargetPath = [closestDefaultPath[0] + 1]\n\t\t\t}\n\t\t\tconst table = createEmptyTableElement()\n\n\t\t\tTransforms.insertNodes(editor, table, {\n\t\t\t\tat: targetPath,\n\t\t\t})\n\t\t})\n\t},\n})\n"],"names":["SlateNode","SlateElement","SlateRange"],"mappings":";;;;;AAkBO,MAAM,mBAAmB;AAOzB,MAAM,iBAAiB,CAAC,YAA2C,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAElH,MAAM,0BAA0B,CAAC,WAAW,GAAG,cAAc,OAAO;AAAA,EAC1E,MAAM;AAAA,EACN,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAY,MAAM,2BAA2B,WAAW,CAAC;AACzF;AAEO,MAAM,0BAA0B,CAAC,YAAkC;AACzE,SAAO,QAAQ,SAAS;AACzB;AAEO,MAAM,6BAA6B,CAAC,YAAkC;AAC5E,QAAM,WAAW,QAAQ,SAAS,CAAC;AACnC,SAAO,UAAU,SAAS,UAAU;AACrC;AAEO,MAAM,qBAAqB,CAAC,EAAE,cAA4F;AAAA,EAChI,MAAM;AAAA,E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UAAA,CACjD;AAAA,QACF;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EACA,qBAAqB;AAAA,EACrB,eAAe,CAAC,EAAE,aAAa;AAC9B,UAAM,oBAAoB,OAAO,MAAM,QAAQ;AAAA,MAC9C,MAAM;AAAA,MACN,OAAO,CAAA,gBAAeC,QAAa,UAAU,WAAW,KAAK,eAAe,WAAW;AAAA,IAAA,CACvF;AACD,QAAI,mBAAmB;AACtB;AAAA,IACD;AACA,UAAM,EAAE,cAAc;AACtB,QAAI,CAAC,aAAaC,MAAW,WAAW,SAAS,GAAG;AACnD;AAAA,IACD;AAEA,UAAM,sBAA6C,OAAO,MAAM,QAAQ;AAAA,MACvE,IAAI,UAAU;AAAA,MACd,MAAM;AAAA,MACN,OAAO,iBAAeD,QAAa,UAAU,WAAW,KAAK,OAAO,iBAAiB,WAAW;AAAA,IAAA,CAChG;AACD,QAAI,CAAC,qBAAqB;AACzB;AAAA,IACD;AACA,UAAM,CAAC,gBAAgB,kBAAkB,IAAI;AAE7C,QAAI,mBAAmB,WAAW,GAAG;AACpC;AAAA,IACD;AAEA,WAAO,mBAAmB,QAAQ,MAAM;AACvC,UAAI;AACJ,UAAID,KAAU,OAAO,cAAc,MAAM,IAAI;AAC5C,mBAAW,YAAY,QAAQ;AAAA,UAC9B,IAAI;AAAA,QAAA,CACJ;AACD,qBAAa;AAAA,MACd,OAAO;AACN,qBAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC;AAAA,MACxC;AACA,YAAM,QAAQ,wBAAA;AAEd,iBAAW,YAAY,QAAQ,OAAO;AAAA,QACrC,IAAI;AAAA,MAAA,CACJ;AAAA,IACF,CAAC;AAAA,EACF;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableElementSelection.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableElementSelection.ts"],"sourcesContent":["import { ReactEditor } from 'slate-react'\nimport { Editor, Path as SlatePath, Transforms } from 'slate'\nimport { TableCellElement } from './TableCellElement'\nimport { TableElement } from './TableElement'\n\nexport const selectTableCellContents = (editor: Editor, table: TableElement | SlatePath, rowIndex: number, columnIndex: number) => {\n\tif (!Array.isArray(table)) {\n\t\ttable = ReactEditor.findPath(editor, table)\n\t}\n\tTransforms.select(editor, {\n\t\tanchor: Editor.start(editor, [...table, rowIndex, columnIndex]),\n\t\tfocus: Editor.end(editor, [...table, rowIndex, columnIndex]),\n\t})\n}\n\nexport const getTableCellCoordinates = (editor: Editor, element: TableCellElement) => {\n\tconst cellPath = ReactEditor.findPath(editor, element)\n\treturn cellPath.slice(-2) as [number, number]\n}\n"],"names":["ReactEditor","Transforms","Editor"],"mappings":";;;;AAKO,MAAM,0BAA0B,CAAC,QAAgB,OAAiC,UAAkB,gBAAwB;AAClI,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,YAAQA,WAAAA,YAAY,SAAS,QAAQ,KAAK;AAAA,EAC3C;AACAC,QAAAA,WAAW,OAAO,QAAQ;AAAA,IACzB,QAAQC,MAAAA,OAAO,MAAM,QAAQ,CAAC,GAAG,OAAO,UAAU,WAAW,CAAC;AAAA,IAC9D,OAAOA,MAAAA,OAAO,IAAI,QAAQ,CAAC,GAAG,OAAO,UAAU,WAAW,CAAC;AAAA,EAAA,CAC3D;AACF;AAEO,MAAM,0BAA0B,CAAC,QAAgB,YAA8B;AACrF,QAAM,WAAWF,WAAAA,YAAY,SAAS,QAAQ,OAAO;AACrD,SAAO,SAAS,MAAM,EAAE;AACzB;;;"}
1
+ {"version":3,"file":"TableElementSelection.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableElementSelection.ts"],"sourcesContent":["import { ReactEditor } from 'slate-react'\nimport { Editor, Path as SlatePath, Transforms } from 'slate'\nimport { TableCellElement } from './TableCellElement.js'\nimport { TableElement } from './TableElement.js'\n\nexport const selectTableCellContents = (editor: Editor, table: TableElement | SlatePath, rowIndex: number, columnIndex: number) => {\n\tif (!Array.isArray(table)) {\n\t\ttable = ReactEditor.findPath(editor, table)\n\t}\n\tTransforms.select(editor, {\n\t\tanchor: Editor.start(editor, [...table, rowIndex, columnIndex]),\n\t\tfocus: Editor.end(editor, [...table, rowIndex, columnIndex]),\n\t})\n}\n\nexport const getTableCellCoordinates = (editor: Editor, element: TableCellElement) => {\n\tconst cellPath = ReactEditor.findPath(editor, element)\n\treturn cellPath.slice(-2) as [number, number]\n}\n"],"names":["ReactEditor","Transforms","Editor"],"mappings":";;;;AAKO,MAAM,0BAA0B,CAAC,QAAgB,OAAiC,UAAkB,gBAAwB;AAClI,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,YAAQA,WAAAA,YAAY,SAAS,QAAQ,KAAK;AAAA,EAC3C;AACAC,QAAAA,WAAW,OAAO,QAAQ;AAAA,IACzB,QAAQC,MAAAA,OAAO,MAAM,QAAQ,CAAC,GAAG,OAAO,UAAU,WAAW,CAAC;AAAA,IAC9D,OAAOA,MAAAA,OAAO,IAAI,QAAQ,CAAC,GAAG,OAAO,UAAU,WAAW,CAAC;AAAA,EAAA,CAC3D;AACF;AAEO,MAAM,0BAA0B,CAAC,QAAgB,YAA8B;AACrF,QAAM,WAAWF,WAAAA,YAAY,SAAS,QAAQ,OAAO;AACrD,SAAO,SAAS,MAAM,EAAE;AACzB;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableElementSelection.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableElementSelection.ts"],"sourcesContent":["import { ReactEditor } from 'slate-react'\nimport { Editor, Path as SlatePath, Transforms } from 'slate'\nimport { TableCellElement } from './TableCellElement'\nimport { TableElement } from './TableElement'\n\nexport const selectTableCellContents = (editor: Editor, table: TableElement | SlatePath, rowIndex: number, columnIndex: number) => {\n\tif (!Array.isArray(table)) {\n\t\ttable = ReactEditor.findPath(editor, table)\n\t}\n\tTransforms.select(editor, {\n\t\tanchor: Editor.start(editor, [...table, rowIndex, columnIndex]),\n\t\tfocus: Editor.end(editor, [...table, rowIndex, columnIndex]),\n\t})\n}\n\nexport const getTableCellCoordinates = (editor: Editor, element: TableCellElement) => {\n\tconst cellPath = ReactEditor.findPath(editor, element)\n\treturn cellPath.slice(-2) as [number, number]\n}\n"],"names":[],"mappings":";;AAKO,MAAM,0BAA0B,CAAC,QAAgB,OAAiC,UAAkB,gBAAwB;AAClI,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,YAAQ,YAAY,SAAS,QAAQ,KAAK;AAAA,EAC3C;AACA,aAAW,OAAO,QAAQ;AAAA,IACzB,QAAQ,OAAO,MAAM,QAAQ,CAAC,GAAG,OAAO,UAAU,WAAW,CAAC;AAAA,IAC9D,OAAO,OAAO,IAAI,QAAQ,CAAC,GAAG,OAAO,UAAU,WAAW,CAAC;AAAA,EAAA,CAC3D;AACF;AAEO,MAAM,0BAA0B,CAAC,QAAgB,YAA8B;AACrF,QAAM,WAAW,YAAY,SAAS,QAAQ,OAAO;AACrD,SAAO,SAAS,MAAM,EAAE;AACzB;"}
1
+ {"version":3,"file":"TableElementSelection.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableElementSelection.ts"],"sourcesContent":["import { ReactEditor } from 'slate-react'\nimport { Editor, Path as SlatePath, Transforms } from 'slate'\nimport { TableCellElement } from './TableCellElement.js'\nimport { TableElement } from './TableElement.js'\n\nexport const selectTableCellContents = (editor: Editor, table: TableElement | SlatePath, rowIndex: number, columnIndex: number) => {\n\tif (!Array.isArray(table)) {\n\t\ttable = ReactEditor.findPath(editor, table)\n\t}\n\tTransforms.select(editor, {\n\t\tanchor: Editor.start(editor, [...table, rowIndex, columnIndex]),\n\t\tfocus: Editor.end(editor, [...table, rowIndex, columnIndex]),\n\t})\n}\n\nexport const getTableCellCoordinates = (editor: Editor, element: TableCellElement) => {\n\tconst cellPath = ReactEditor.findPath(editor, element)\n\treturn cellPath.slice(-2) as [number, number]\n}\n"],"names":[],"mappings":";;AAKO,MAAM,0BAA0B,CAAC,QAAgB,OAAiC,UAAkB,gBAAwB;AAClI,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AAC1B,YAAQ,YAAY,SAAS,QAAQ,KAAK;AAAA,EAC3C;AACA,aAAW,OAAO,QAAQ;AAAA,IACzB,QAAQ,OAAO,MAAM,QAAQ,CAAC,GAAG,OAAO,UAAU,WAAW,CAAC;AAAA,IAC9D,OAAO,OAAO,IAAI,QAAQ,CAAC,GAAG,OAAO,UAAU,WAAW,CAAC;AAAA,EAAA,CAC3D;AACF;AAEO,MAAM,0BAA0B,CAAC,QAAgB,YAA8B;AACrF,QAAM,WAAW,YAAY,SAAS,QAAQ,OAAO;AACrD,SAAO,SAAS,MAAM,EAAE;AACzB;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableHtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types'\nimport { tableCellElementType } from './TableCellElement'\nimport { tableElementType } from './TableElement'\nimport { tableRowElementType } from './TableRowElement'\n\nexport const tableHTMLDeserializer: HtmlDeserializerPlugin = {\n\tprocessBlockPaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (element.tagName === 'TABLE') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tif (element.tagName === 'TR') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableRowElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tif (element.tagName === 'TD' || element.tagName === 'TH') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableCellElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\treturn null\n\t},\n}\n"],"names":["tableElementType","tableRowElementType","tableCellElementType"],"mappings":";;;;;AAKO,MAAM,wBAAgD;AAAA,EAC5D,mBAAmB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC9D,QAAI,QAAQ,YAAY,SAAS;AAChC,aAAO;AAAA,QACN;AAAA,UACC,MAAMA,aAAAA;AAAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,QAAI,QAAQ,YAAY,MAAM;AAC7B,aAAO;AAAA,QACN;AAAA,UACC,MAAMC,gBAAAA;AAAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,QAAI,QAAQ,YAAY,QAAQ,QAAQ,YAAY,MAAM;AACzD,aAAO;AAAA,QACN;AAAA,UACC,MAAMC,iBAAAA;AAAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,WAAO;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"TableHtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types/index.js'\nimport { tableCellElementType } from './TableCellElement.js'\nimport { tableElementType } from './TableElement.js'\nimport { tableRowElementType } from './TableRowElement.js'\n\nexport const tableHTMLDeserializer: HtmlDeserializerPlugin = {\n\tprocessBlockPaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (element.tagName === 'TABLE') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tif (element.tagName === 'TR') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableRowElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tif (element.tagName === 'TD' || element.tagName === 'TH') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableCellElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\treturn null\n\t},\n}\n"],"names":["tableElementType","tableRowElementType","tableCellElementType"],"mappings":";;;;;AAKO,MAAM,wBAAgD;AAAA,EAC5D,mBAAmB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC9D,QAAI,QAAQ,YAAY,SAAS;AAChC,aAAO;AAAA,QACN;AAAA,UACC,MAAMA,aAAAA;AAAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,QAAI,QAAQ,YAAY,MAAM;AAC7B,aAAO;AAAA,QACN;AAAA,UACC,MAAMC,gBAAAA;AAAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,QAAI,QAAQ,YAAY,QAAQ,QAAQ,YAAY,MAAM;AACzD,aAAO;AAAA,QACN;AAAA,UACC,MAAMC,iBAAAA;AAAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,WAAO;AAAA,EACR;AACD;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableHtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types'\nimport { tableCellElementType } from './TableCellElement'\nimport { tableElementType } from './TableElement'\nimport { tableRowElementType } from './TableRowElement'\n\nexport const tableHTMLDeserializer: HtmlDeserializerPlugin = {\n\tprocessBlockPaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (element.tagName === 'TABLE') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tif (element.tagName === 'TR') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableRowElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tif (element.tagName === 'TD' || element.tagName === 'TH') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableCellElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\treturn null\n\t},\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,wBAAgD;AAAA,EAC5D,mBAAmB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC9D,QAAI,QAAQ,YAAY,SAAS;AAChC,aAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,QAAI,QAAQ,YAAY,MAAM;AAC7B,aAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,QAAI,QAAQ,YAAY,QAAQ,QAAQ,YAAY,MAAM;AACzD,aAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,WAAO;AAAA,EACR;AACD;"}
1
+ {"version":3,"file":"TableHtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types/index.js'\nimport { tableCellElementType } from './TableCellElement.js'\nimport { tableElementType } from './TableElement.js'\nimport { tableRowElementType } from './TableRowElement.js'\n\nexport const tableHTMLDeserializer: HtmlDeserializerPlugin = {\n\tprocessBlockPaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (element.tagName === 'TABLE') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tif (element.tagName === 'TR') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableRowElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\tif (element.tagName === 'TD' || element.tagName === 'TH') {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: tableCellElementType,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\n\t\treturn null\n\t},\n}\n"],"names":[],"mappings":";;;AAKO,MAAM,wBAAgD;AAAA,EAC5D,mBAAmB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC9D,QAAI,QAAQ,YAAY,SAAS;AAChC,aAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,QAAI,QAAQ,YAAY,MAAM;AAC7B,aAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,QAAI,QAAQ,YAAY,QAAQ,QAAQ,YAAY,MAAM;AACzD,aAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AAEA,WAAO;AAAA,EACR;AACD;"}