@contember/react-slate-editor-base 2.0.0-alpha.9 → 2.0.0-beta.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 (293) hide show
  1. package/dist/development/src/components/RichTextEditor.cjs +3 -3
  2. package/dist/development/src/components/RichTextEditor.cjs.map +1 -1
  3. package/dist/development/src/components/RichTextEditor.js +3 -3
  4. package/dist/development/src/components/RichTextEditor.js.map +1 -1
  5. package/dist/development/src/components/triggers/EditorElementTrigger.cjs.map +1 -1
  6. package/dist/development/src/components/triggers/EditorElementTrigger.js.map +1 -1
  7. package/dist/development/src/components/triggers/EditorGenericTrigger.cjs.map +1 -1
  8. package/dist/development/src/components/triggers/EditorGenericTrigger.js.map +1 -1
  9. package/dist/development/src/components/triggers/EditorMarkTrigger.cjs.map +1 -1
  10. package/dist/development/src/components/triggers/EditorMarkTrigger.js.map +1 -1
  11. package/dist/development/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -1
  12. package/dist/development/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -1
  13. package/dist/development/src/editor/createEditor.cjs.map +1 -1
  14. package/dist/development/src/editor/createEditor.js.map +1 -1
  15. package/dist/development/src/editor/createEditorWithEssentials.cjs.map +1 -1
  16. package/dist/development/src/editor/createEditorWithEssentials.js.map +1 -1
  17. package/dist/development/src/editor/index.cjs.map +1 -1
  18. package/dist/development/src/editor/methods/addMarks.cjs.map +1 -1
  19. package/dist/development/src/editor/methods/addMarks.js.map +1 -1
  20. package/dist/development/src/editor/methods/canToggleMark.cjs.map +1 -1
  21. package/dist/development/src/editor/methods/canToggleMark.js.map +1 -1
  22. package/dist/development/src/editor/methods/closest.cjs.map +1 -1
  23. package/dist/development/src/editor/methods/closest.js.map +1 -1
  24. package/dist/development/src/editor/methods/closestBlockEntry.cjs.map +1 -1
  25. package/dist/development/src/editor/methods/ejectElement.cjs.map +1 -1
  26. package/dist/development/src/editor/methods/ejectElement.js.map +1 -1
  27. package/dist/development/src/editor/methods/getElementDataAttributes.cjs.map +1 -1
  28. package/dist/development/src/editor/methods/getElementDataAttributes.js.map +1 -1
  29. package/dist/development/src/editor/methods/getPreviousSibling.cjs.map +1 -1
  30. package/dist/development/src/editor/methods/getPreviousSibling.js.map +1 -1
  31. package/dist/development/src/editor/methods/hasMarks.cjs.map +1 -1
  32. package/dist/development/src/editor/methods/hasMarks.js.map +1 -1
  33. package/dist/development/src/editor/methods/hasParentOfType.cjs.map +1 -1
  34. package/dist/development/src/editor/methods/hasParentOfType.js.map +1 -1
  35. package/dist/development/src/editor/methods/isElementType.cjs.map +1 -1
  36. package/dist/development/src/editor/methods/isElementType.js.map +1 -1
  37. package/dist/development/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -1
  38. package/dist/development/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -1
  39. package/dist/development/src/editor/methods/removeMarks.cjs.map +1 -1
  40. package/dist/development/src/editor/methods/removeMarks.js.map +1 -1
  41. package/dist/development/src/editor/methods/serializeNodes.cjs.map +1 -1
  42. package/dist/development/src/editor/methods/serializeNodes.js.map +1 -1
  43. package/dist/development/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -1
  44. package/dist/development/src/editor/methods/strictlyDeserializeNodes.js.map +1 -1
  45. package/dist/development/src/editor/methods/toLatestFormat.cjs.map +1 -1
  46. package/dist/development/src/editor/methods/toLatestFormat.js.map +1 -1
  47. package/dist/development/src/internal/components/DefaultElement.cjs.map +1 -1
  48. package/dist/development/src/internal/components/DefaultElement.js.map +1 -1
  49. package/dist/development/src/internal/hooks/useRichTextFieldNodes.cjs.map +1 -1
  50. package/dist/development/src/internal/hooks/useRichTextFieldNodes.js.map +1 -1
  51. package/dist/development/src/internal/utils/EditorPasteUtils.cjs.map +1 -1
  52. package/dist/development/src/internal/utils/EditorPasteUtils.js.map +1 -1
  53. package/dist/development/src/internal/utils/parseUrl.cjs.map +1 -1
  54. package/dist/development/src/internal/utils/parseUrl.js.map +1 -1
  55. package/dist/development/src/plugins/attributes/alignment/alignButton.cjs.map +1 -1
  56. package/dist/development/src/plugins/attributes/alignment/alignButton.js.map +1 -1
  57. package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -1
  58. package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -1
  59. package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -1
  60. package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -1
  61. package/dist/development/src/plugins/behaviour/paste/withPaste.cjs.map +1 -1
  62. package/dist/development/src/plugins/behaviour/paste/withPaste.js.map +1 -1
  63. package/dist/development/src/plugins/element/anchors/AnchorElement.cjs.map +1 -1
  64. package/dist/development/src/plugins/element/anchors/AnchorElement.js.map +1 -1
  65. package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -1
  66. package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -1
  67. package/dist/development/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -1
  68. package/dist/development/src/plugins/element/anchors/AnchorModifications.js.map +1 -1
  69. package/dist/development/src/plugins/element/anchors/withAnchors.cjs.map +1 -1
  70. package/dist/development/src/plugins/element/anchors/withAnchors.js.map +1 -1
  71. package/dist/development/src/plugins/element/headings/HeadingElement.cjs.map +1 -1
  72. package/dist/development/src/plugins/element/headings/HeadingElement.js.map +1 -1
  73. package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -1
  74. package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -1
  75. package/dist/development/src/plugins/element/headings/withHeadings.cjs.map +1 -1
  76. package/dist/development/src/plugins/element/headings/withHeadings.js.map +1 -1
  77. package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -1
  78. package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -1
  79. package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -1
  80. package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -1
  81. package/dist/development/src/plugins/element/lists/ListElement.cjs.map +1 -1
  82. package/dist/development/src/plugins/element/lists/ListElement.js.map +1 -1
  83. package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -1
  84. package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -1
  85. package/dist/development/src/plugins/element/lists/ListItemElement.cjs.map +1 -1
  86. package/dist/development/src/plugins/element/lists/ListItemElement.js.map +1 -1
  87. package/dist/development/src/plugins/element/lists/OrderedListElement.cjs.map +1 -1
  88. package/dist/development/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -1
  89. package/dist/development/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -1
  90. package/dist/development/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -1
  91. package/dist/development/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -1
  92. package/dist/development/src/plugins/element/lists/transforms/indentListItem.js.map +1 -1
  93. package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -1
  94. package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -1
  95. package/dist/development/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -1
  96. package/dist/development/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -1
  97. package/dist/development/src/plugins/element/lists/withLists.cjs.map +1 -1
  98. package/dist/development/src/plugins/element/lists/withLists.js.map +1 -1
  99. package/dist/development/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -1
  100. package/dist/development/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -1
  101. package/dist/development/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -1
  102. package/dist/development/src/plugins/element/paragraphs/withParagraphs.js.map +1 -1
  103. package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -1
  104. package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -1
  105. package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -1
  106. package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -1
  107. package/dist/development/src/plugins/element/tables/TableCellElement.cjs.map +1 -1
  108. package/dist/development/src/plugins/element/tables/TableCellElement.js.map +1 -1
  109. package/dist/development/src/plugins/element/tables/TableElement.cjs.map +1 -1
  110. package/dist/development/src/plugins/element/tables/TableElement.js.map +1 -1
  111. package/dist/development/src/plugins/element/tables/TableElementSelection.cjs.map +1 -1
  112. package/dist/development/src/plugins/element/tables/TableElementSelection.js.map +1 -1
  113. package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.cjs +36 -0
  114. package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +1 -0
  115. package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.js +36 -0
  116. package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.js.map +1 -0
  117. package/dist/development/src/plugins/element/tables/TableModifications.cjs.map +1 -1
  118. package/dist/development/src/plugins/element/tables/TableModifications.js +1 -1
  119. package/dist/development/src/plugins/element/tables/TableModifications.js.map +1 -1
  120. package/dist/development/src/plugins/element/tables/TableRowElement.cjs.map +1 -1
  121. package/dist/development/src/plugins/element/tables/TableRowElement.js.map +1 -1
  122. package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -1
  123. package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -1
  124. package/dist/development/src/plugins/element/tables/withTables.cjs +2 -0
  125. package/dist/development/src/plugins/element/tables/withTables.cjs.map +1 -1
  126. package/dist/development/src/plugins/element/tables/withTables.js +2 -0
  127. package/dist/development/src/plugins/element/tables/withTables.js.map +1 -1
  128. package/dist/development/src/plugins/text/bold/withBold.cjs.map +1 -1
  129. package/dist/development/src/plugins/text/bold/withBold.js.map +1 -1
  130. package/dist/development/src/plugins/text/code/withCode.cjs.map +1 -1
  131. package/dist/development/src/plugins/text/highlight/withHighlight.cjs.map +1 -1
  132. package/dist/development/src/plugins/text/italic/withItalic.cjs.map +1 -1
  133. package/dist/development/src/plugins/text/italic/withItalic.js.map +1 -1
  134. package/dist/development/src/plugins/text/newline/withNewline.cjs.map +1 -1
  135. package/dist/development/src/plugins/text/newline/withNewline.js.map +1 -1
  136. package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -1
  137. package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -1
  138. package/dist/development/src/plugins/text/underline/withUnderline.cjs.map +1 -1
  139. package/dist/development/src/plugins/text/underline/withUnderline.js.map +1 -1
  140. package/dist/production/src/components/RichTextEditor.cjs +3 -3
  141. package/dist/production/src/components/RichTextEditor.cjs.map +1 -1
  142. package/dist/production/src/components/RichTextEditor.js +3 -3
  143. package/dist/production/src/components/RichTextEditor.js.map +1 -1
  144. package/dist/production/src/components/triggers/EditorElementTrigger.cjs.map +1 -1
  145. package/dist/production/src/components/triggers/EditorElementTrigger.js.map +1 -1
  146. package/dist/production/src/components/triggers/EditorGenericTrigger.cjs.map +1 -1
  147. package/dist/production/src/components/triggers/EditorGenericTrigger.js.map +1 -1
  148. package/dist/production/src/components/triggers/EditorMarkTrigger.cjs.map +1 -1
  149. package/dist/production/src/components/triggers/EditorMarkTrigger.js.map +1 -1
  150. package/dist/production/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -1
  151. package/dist/production/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -1
  152. package/dist/production/src/editor/createEditor.cjs.map +1 -1
  153. package/dist/production/src/editor/createEditor.js.map +1 -1
  154. package/dist/production/src/editor/createEditorWithEssentials.cjs.map +1 -1
  155. package/dist/production/src/editor/createEditorWithEssentials.js.map +1 -1
  156. package/dist/production/src/editor/index.cjs.map +1 -1
  157. package/dist/production/src/editor/methods/addMarks.cjs.map +1 -1
  158. package/dist/production/src/editor/methods/addMarks.js.map +1 -1
  159. package/dist/production/src/editor/methods/canToggleMark.cjs.map +1 -1
  160. package/dist/production/src/editor/methods/canToggleMark.js.map +1 -1
  161. package/dist/production/src/editor/methods/closest.cjs.map +1 -1
  162. package/dist/production/src/editor/methods/closest.js.map +1 -1
  163. package/dist/production/src/editor/methods/closestBlockEntry.cjs.map +1 -1
  164. package/dist/production/src/editor/methods/ejectElement.cjs.map +1 -1
  165. package/dist/production/src/editor/methods/ejectElement.js.map +1 -1
  166. package/dist/production/src/editor/methods/getElementDataAttributes.cjs.map +1 -1
  167. package/dist/production/src/editor/methods/getElementDataAttributes.js.map +1 -1
  168. package/dist/production/src/editor/methods/getPreviousSibling.cjs.map +1 -1
  169. package/dist/production/src/editor/methods/getPreviousSibling.js.map +1 -1
  170. package/dist/production/src/editor/methods/hasMarks.cjs.map +1 -1
  171. package/dist/production/src/editor/methods/hasMarks.js.map +1 -1
  172. package/dist/production/src/editor/methods/hasParentOfType.cjs.map +1 -1
  173. package/dist/production/src/editor/methods/hasParentOfType.js.map +1 -1
  174. package/dist/production/src/editor/methods/isElementType.cjs.map +1 -1
  175. package/dist/production/src/editor/methods/isElementType.js.map +1 -1
  176. package/dist/production/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -1
  177. package/dist/production/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -1
  178. package/dist/production/src/editor/methods/removeMarks.cjs.map +1 -1
  179. package/dist/production/src/editor/methods/removeMarks.js.map +1 -1
  180. package/dist/production/src/editor/methods/serializeNodes.cjs.map +1 -1
  181. package/dist/production/src/editor/methods/serializeNodes.js.map +1 -1
  182. package/dist/production/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -1
  183. package/dist/production/src/editor/methods/strictlyDeserializeNodes.js.map +1 -1
  184. package/dist/production/src/editor/methods/toLatestFormat.cjs.map +1 -1
  185. package/dist/production/src/editor/methods/toLatestFormat.js.map +1 -1
  186. package/dist/production/src/internal/components/DefaultElement.cjs.map +1 -1
  187. package/dist/production/src/internal/components/DefaultElement.js.map +1 -1
  188. package/dist/production/src/internal/hooks/useRichTextFieldNodes.cjs.map +1 -1
  189. package/dist/production/src/internal/hooks/useRichTextFieldNodes.js.map +1 -1
  190. package/dist/production/src/internal/utils/EditorPasteUtils.cjs.map +1 -1
  191. package/dist/production/src/internal/utils/EditorPasteUtils.js.map +1 -1
  192. package/dist/production/src/internal/utils/parseUrl.cjs.map +1 -1
  193. package/dist/production/src/internal/utils/parseUrl.js.map +1 -1
  194. package/dist/production/src/plugins/attributes/alignment/alignButton.cjs.map +1 -1
  195. package/dist/production/src/plugins/attributes/alignment/alignButton.js.map +1 -1
  196. package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -1
  197. package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -1
  198. package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -1
  199. package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -1
  200. package/dist/production/src/plugins/behaviour/paste/withPaste.cjs.map +1 -1
  201. package/dist/production/src/plugins/behaviour/paste/withPaste.js.map +1 -1
  202. package/dist/production/src/plugins/element/anchors/AnchorElement.cjs.map +1 -1
  203. package/dist/production/src/plugins/element/anchors/AnchorElement.js.map +1 -1
  204. package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -1
  205. package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -1
  206. package/dist/production/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -1
  207. package/dist/production/src/plugins/element/anchors/AnchorModifications.js.map +1 -1
  208. package/dist/production/src/plugins/element/anchors/withAnchors.cjs.map +1 -1
  209. package/dist/production/src/plugins/element/anchors/withAnchors.js.map +1 -1
  210. package/dist/production/src/plugins/element/headings/HeadingElement.cjs.map +1 -1
  211. package/dist/production/src/plugins/element/headings/HeadingElement.js.map +1 -1
  212. package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -1
  213. package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -1
  214. package/dist/production/src/plugins/element/headings/withHeadings.cjs.map +1 -1
  215. package/dist/production/src/plugins/element/headings/withHeadings.js.map +1 -1
  216. package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -1
  217. package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -1
  218. package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -1
  219. package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -1
  220. package/dist/production/src/plugins/element/lists/ListElement.cjs.map +1 -1
  221. package/dist/production/src/plugins/element/lists/ListElement.js.map +1 -1
  222. package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -1
  223. package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -1
  224. package/dist/production/src/plugins/element/lists/ListItemElement.cjs.map +1 -1
  225. package/dist/production/src/plugins/element/lists/ListItemElement.js.map +1 -1
  226. package/dist/production/src/plugins/element/lists/OrderedListElement.cjs.map +1 -1
  227. package/dist/production/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -1
  228. package/dist/production/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -1
  229. package/dist/production/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -1
  230. package/dist/production/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -1
  231. package/dist/production/src/plugins/element/lists/transforms/indentListItem.js.map +1 -1
  232. package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -1
  233. package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -1
  234. package/dist/production/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -1
  235. package/dist/production/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -1
  236. package/dist/production/src/plugins/element/lists/withLists.cjs.map +1 -1
  237. package/dist/production/src/plugins/element/lists/withLists.js.map +1 -1
  238. package/dist/production/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -1
  239. package/dist/production/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -1
  240. package/dist/production/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -1
  241. package/dist/production/src/plugins/element/paragraphs/withParagraphs.js.map +1 -1
  242. package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -1
  243. package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -1
  244. package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -1
  245. package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -1
  246. package/dist/production/src/plugins/element/tables/TableCellElement.cjs.map +1 -1
  247. package/dist/production/src/plugins/element/tables/TableCellElement.js.map +1 -1
  248. package/dist/production/src/plugins/element/tables/TableElement.cjs.map +1 -1
  249. package/dist/production/src/plugins/element/tables/TableElement.js.map +1 -1
  250. package/dist/production/src/plugins/element/tables/TableElementSelection.cjs.map +1 -1
  251. package/dist/production/src/plugins/element/tables/TableElementSelection.js.map +1 -1
  252. package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.cjs +36 -0
  253. package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +1 -0
  254. package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.js +36 -0
  255. package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.js.map +1 -0
  256. package/dist/production/src/plugins/element/tables/TableModifications.cjs.map +1 -1
  257. package/dist/production/src/plugins/element/tables/TableModifications.js +1 -1
  258. package/dist/production/src/plugins/element/tables/TableModifications.js.map +1 -1
  259. package/dist/production/src/plugins/element/tables/TableRowElement.cjs.map +1 -1
  260. package/dist/production/src/plugins/element/tables/TableRowElement.js.map +1 -1
  261. package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -1
  262. package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -1
  263. package/dist/production/src/plugins/element/tables/withTables.cjs +2 -0
  264. package/dist/production/src/plugins/element/tables/withTables.cjs.map +1 -1
  265. package/dist/production/src/plugins/element/tables/withTables.js +2 -0
  266. package/dist/production/src/plugins/element/tables/withTables.js.map +1 -1
  267. package/dist/production/src/plugins/text/bold/withBold.cjs.map +1 -1
  268. package/dist/production/src/plugins/text/bold/withBold.js.map +1 -1
  269. package/dist/production/src/plugins/text/code/withCode.cjs.map +1 -1
  270. package/dist/production/src/plugins/text/highlight/withHighlight.cjs.map +1 -1
  271. package/dist/production/src/plugins/text/italic/withItalic.cjs.map +1 -1
  272. package/dist/production/src/plugins/text/italic/withItalic.js.map +1 -1
  273. package/dist/production/src/plugins/text/newline/withNewline.cjs.map +1 -1
  274. package/dist/production/src/plugins/text/newline/withNewline.js.map +1 -1
  275. package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -1
  276. package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -1
  277. package/dist/production/src/plugins/text/underline/withUnderline.cjs.map +1 -1
  278. package/dist/production/src/plugins/text/underline/withUnderline.js.map +1 -1
  279. package/dist/types/editor/createEditor.d.ts +1 -1
  280. package/dist/types/editor/createEditor.d.ts.map +1 -1
  281. package/dist/types/plugins/element/tables/TableHtmlDeserializer.d.ts +3 -0
  282. package/dist/types/plugins/element/tables/TableHtmlDeserializer.d.ts.map +1 -0
  283. package/dist/types/plugins/element/tables/withTables.d.ts.map +1 -1
  284. package/dist/types/tsconfig.tsbuildinfo +1 -1
  285. package/dist/types/types/plugins.d.ts +1 -2
  286. package/dist/types/types/plugins.d.ts.map +1 -1
  287. package/package.json +10 -9
  288. package/src/components/RichTextEditor.tsx +3 -3
  289. package/src/editor/createEditor.ts +1 -1
  290. package/src/plugins/element/tables/TableHtmlDeserializer.ts +37 -0
  291. package/src/plugins/element/tables/withTables.ts +3 -0
  292. package/src/tsconfig.json +0 -1
  293. package/src/types/plugins.ts +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"hasParentOfType.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/hasParentOfType.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, NodeEntry, Path as SlatePath } from 'slate'\nimport { ContemberEditor } from '../index'\n\nexport const hasParentOfType = <Editor extends SlateEditor, Element extends SlateElement>(\n\teditor: Editor,\n\tnodeEntry: NodeEntry<SlateNode | SlateElement>,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tconst [, path] = nodeEntry\n\tif (path.length === 1) {\n\t\treturn false // Doesn't have a parent\n\t}\n\tconst parentPath = SlatePath.parent(path)\n\tconst parent = SlateNode.get(editor, parentPath)\n\n\treturn ContemberEditor.isElementType(parent, type, suchThat)\n}\n"],"names":["SlatePath","SlateNode"],"mappings":";;AAGO,MAAM,kBAAkB,CAC9B,QACA,WACA,MACA,aACa;AACP,QAAA,CAAG,EAAA,IAAI,IAAI;AACb,MAAA,KAAK,WAAW,GAAG;AACf,WAAA;AAAA,EACR;AACM,QAAA,aAAaA,KAAU,OAAO,IAAI;AACxC,QAAM,SAASC,KAAU,IAAI,QAAQ,UAAU;AAE/C,SAAO,gBAAgB,cAAc,QAAQ,MAAM,QAAQ;AAC5D;"}
1
+ {"version":3,"file":"hasParentOfType.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/hasParentOfType.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, NodeEntry, Path as SlatePath } from 'slate'\nimport { ContemberEditor } from '../index'\n\nexport const hasParentOfType = <Editor extends SlateEditor, Element extends SlateElement>(\n\teditor: Editor,\n\tnodeEntry: NodeEntry<SlateNode | SlateElement>,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tconst [, path] = nodeEntry\n\tif (path.length === 1) {\n\t\treturn false // Doesn't have a parent\n\t}\n\tconst parentPath = SlatePath.parent(path)\n\tconst parent = SlateNode.get(editor, parentPath)\n\n\treturn ContemberEditor.isElementType(parent, type, suchThat)\n}\n"],"names":["SlatePath","SlateNode"],"mappings":";;AAGO,MAAM,kBAAkB,CAC9B,QACA,WACA,MACA,aACa;AACP,QAAA,CAAA,EAAG,IAAI,IAAI;AACb,MAAA,KAAK,WAAW,GAAG;AACf,WAAA;AAAA,EAAA;AAEF,QAAA,aAAaA,KAAU,OAAO,IAAI;AACxC,QAAM,SAASC,KAAU,IAAI,QAAQ,UAAU;AAE/C,SAAO,gBAAgB,cAAc,QAAQ,MAAM,QAAQ;AAC5D;"}
@@ -1 +1 @@
1
- {"version":3,"file":"isElementType.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/isElementType.ts"],"sourcesContent":["import { Element as SlateElement, Node as SlateNode } from 'slate'\n\nexport const isElementType = <Element extends SlateElement>(\n\telement: SlateNode,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tif (!SlateElement.isElement(element) || element.type !== type) {\n\t\treturn false\n\t}\n\tif (suchThat === undefined) {\n\t\treturn true\n\t}\n\n\tfor (const prop in suchThat) {\n\t\tconst propValue = suchThat[prop]\n\t\tconst propPresent = prop in element\n\n\t\tif (!propValue && !propPresent) {\n\t\t\t// Falsy values get special treatment.\n\t\t\tcontinue\n\t\t}\n\n\t\tif (!propPresent || (element as Element)[prop as keyof Element] !== propValue) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"],"names":["SlateElement"],"mappings":";;;AAEO,MAAM,gBAAgB,CAC5B,SACA,MACA,aACa;AACb,MAAI,CAACA,MAAa,QAAA,UAAU,OAAO,KAAK,QAAQ,SAAS,MAAM;AACvD,WAAA;AAAA,EACR;AACA,MAAI,aAAa,QAAW;AACpB,WAAA;AAAA,EACR;AAEA,aAAW,QAAQ,UAAU;AACtB,UAAA,YAAY,SAAS,IAAI;AAC/B,UAAM,cAAc,QAAQ;AAExB,QAAA,CAAC,aAAa,CAAC,aAAa;AAE/B;AAAA,IACD;AAEA,QAAI,CAAC,eAAgB,QAAoB,IAAqB,MAAM,WAAW;AACvE,aAAA;AAAA,IACR;AAAA,EACD;AACO,SAAA;AACR;;"}
1
+ {"version":3,"file":"isElementType.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/isElementType.ts"],"sourcesContent":["import { Element as SlateElement, Node as SlateNode } from 'slate'\n\nexport const isElementType = <Element extends SlateElement>(\n\telement: SlateNode,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tif (!SlateElement.isElement(element) || element.type !== type) {\n\t\treturn false\n\t}\n\tif (suchThat === undefined) {\n\t\treturn true\n\t}\n\n\tfor (const prop in suchThat) {\n\t\tconst propValue = suchThat[prop]\n\t\tconst propPresent = prop in element\n\n\t\tif (!propValue && !propPresent) {\n\t\t\t// Falsy values get special treatment.\n\t\t\tcontinue\n\t\t}\n\n\t\tif (!propPresent || (element as Element)[prop as keyof Element] !== propValue) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"],"names":["SlateElement"],"mappings":";;;AAEO,MAAM,gBAAgB,CAC5B,SACA,MACA,aACa;AACb,MAAI,CAACA,MAAa,QAAA,UAAU,OAAO,KAAK,QAAQ,SAAS,MAAM;AACvD,WAAA;AAAA,EAAA;AAER,MAAI,aAAa,QAAW;AACpB,WAAA;AAAA,EAAA;AAGR,aAAW,QAAQ,UAAU;AACtB,UAAA,YAAY,SAAS,IAAI;AAC/B,UAAM,cAAc,QAAQ;AAExB,QAAA,CAAC,aAAa,CAAC,aAAa;AAE/B;AAAA,IAAA;AAGD,QAAI,CAAC,eAAgB,QAAoB,IAAqB,MAAM,WAAW;AACvE,aAAA;AAAA,IAAA;AAAA,EACR;AAEM,SAAA;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"isElementType.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/isElementType.ts"],"sourcesContent":["import { Element as SlateElement, Node as SlateNode } from 'slate'\n\nexport const isElementType = <Element extends SlateElement>(\n\telement: SlateNode,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tif (!SlateElement.isElement(element) || element.type !== type) {\n\t\treturn false\n\t}\n\tif (suchThat === undefined) {\n\t\treturn true\n\t}\n\n\tfor (const prop in suchThat) {\n\t\tconst propValue = suchThat[prop]\n\t\tconst propPresent = prop in element\n\n\t\tif (!propValue && !propPresent) {\n\t\t\t// Falsy values get special treatment.\n\t\t\tcontinue\n\t\t}\n\n\t\tif (!propPresent || (element as Element)[prop as keyof Element] !== propValue) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"],"names":["SlateElement"],"mappings":";AAEO,MAAM,gBAAgB,CAC5B,SACA,MACA,aACa;AACb,MAAI,CAACA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS,MAAM;AACvD,WAAA;AAAA,EACR;AACA,MAAI,aAAa,QAAW;AACpB,WAAA;AAAA,EACR;AAEA,aAAW,QAAQ,UAAU;AACtB,UAAA,YAAY,SAAS,IAAI;AAC/B,UAAM,cAAc,QAAQ;AAExB,QAAA,CAAC,aAAa,CAAC,aAAa;AAE/B;AAAA,IACD;AAEA,QAAI,CAAC,eAAgB,QAAoB,IAAqB,MAAM,WAAW;AACvE,aAAA;AAAA,IACR;AAAA,EACD;AACO,SAAA;AACR;"}
1
+ {"version":3,"file":"isElementType.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/isElementType.ts"],"sourcesContent":["import { Element as SlateElement, Node as SlateNode } from 'slate'\n\nexport const isElementType = <Element extends SlateElement>(\n\telement: SlateNode,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tif (!SlateElement.isElement(element) || element.type !== type) {\n\t\treturn false\n\t}\n\tif (suchThat === undefined) {\n\t\treturn true\n\t}\n\n\tfor (const prop in suchThat) {\n\t\tconst propValue = suchThat[prop]\n\t\tconst propPresent = prop in element\n\n\t\tif (!propValue && !propPresent) {\n\t\t\t// Falsy values get special treatment.\n\t\t\tcontinue\n\t\t}\n\n\t\tif (!propPresent || (element as Element)[prop as keyof Element] !== propValue) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"],"names":["SlateElement"],"mappings":";AAEO,MAAM,gBAAgB,CAC5B,SACA,MACA,aACa;AACb,MAAI,CAACA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS,MAAM;AACvD,WAAA;AAAA,EAAA;AAER,MAAI,aAAa,QAAW;AACpB,WAAA;AAAA,EAAA;AAGR,aAAW,QAAQ,UAAU;AACtB,UAAA,YAAY,SAAS,IAAI;AAC/B,UAAM,cAAc,QAAQ;AAExB,QAAA,CAAC,aAAa,CAAC,aAAa;AAE/B;AAAA,IAAA;AAGD,QAAI,CAAC,eAAgB,QAAoB,IAAqB,MAAM,WAAW;AACvE,aAAA;AAAA,IAAA;AAAA,EACR;AAEM,SAAA;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"permissivelyDeserializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/permissivelyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const permissivelyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode | SlateElement | null = null\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {}\n\n\tif (typeof deserialized !== 'object' || deserialized === null) {\n\t\treturn [editor.createDefaultElement([{ text: serializedElement }])]\n\t}\n\n\tif ('formatVersion' in deserialized) {\n\t\treturn toLatestFormat(editor, deserialized as SerializableEditorNode).children\n\t}\n\n\t// If no format version is specified, assume zero.\n\treturn toLatestFormat(editor, {\n\t\tformatVersion: 0,\n\t\tchildren: [deserialized],\n\t}).children\n}\n"],"names":["toLatestFormat"],"mappings":";;;AAIO,MAAM,+BAA+B,CAC3C,QACA,mBACA,iBACqC;AACrC,MAAI,eAA6D;AAC7D,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AAAA,EAAC;AAEb,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,MAAM;AACvD,WAAA,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,kBAAA,CAAmB,CAAC,CAAC;AAAA,EACnE;AAEA,MAAI,mBAAmB,cAAc;AAC7B,WAAAA,8BAAe,QAAQ,YAAsC,EAAE;AAAA,EACvE;AAGA,SAAOA,eAAAA,eAAe,QAAQ;AAAA,IAC7B,eAAe;AAAA,IACf,UAAU,CAAC,YAAY;AAAA,EACvB,CAAA,EAAE;AACJ;;"}
1
+ {"version":3,"file":"permissivelyDeserializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/permissivelyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const permissivelyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode | SlateElement | null = null\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {}\n\n\tif (typeof deserialized !== 'object' || deserialized === null) {\n\t\treturn [editor.createDefaultElement([{ text: serializedElement }])]\n\t}\n\n\tif ('formatVersion' in deserialized) {\n\t\treturn toLatestFormat(editor, deserialized as SerializableEditorNode).children\n\t}\n\n\t// If no format version is specified, assume zero.\n\treturn toLatestFormat(editor, {\n\t\tformatVersion: 0,\n\t\tchildren: [deserialized],\n\t}).children\n}\n"],"names":["toLatestFormat"],"mappings":";;;AAIO,MAAM,+BAA+B,CAC3C,QACA,mBACA,iBACqC;AACrC,MAAI,eAA6D;AAC7D,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AAAA,EAAA;AAEZ,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,MAAM;AACvD,WAAA,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,kBAAmB,CAAA,CAAC,CAAC;AAAA,EAAA;AAGnE,MAAI,mBAAmB,cAAc;AAC7B,WAAAA,8BAAe,QAAQ,YAAsC,EAAE;AAAA,EAAA;AAIvE,SAAOA,eAAAA,eAAe,QAAQ;AAAA,IAC7B,eAAe;AAAA,IACf,UAAU,CAAC,YAAY;AAAA,EACvB,CAAA,EAAE;AACJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"permissivelyDeserializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/permissivelyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const permissivelyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode | SlateElement | null = null\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {}\n\n\tif (typeof deserialized !== 'object' || deserialized === null) {\n\t\treturn [editor.createDefaultElement([{ text: serializedElement }])]\n\t}\n\n\tif ('formatVersion' in deserialized) {\n\t\treturn toLatestFormat(editor, deserialized as SerializableEditorNode).children\n\t}\n\n\t// If no format version is specified, assume zero.\n\treturn toLatestFormat(editor, {\n\t\tformatVersion: 0,\n\t\tchildren: [deserialized],\n\t}).children\n}\n"],"names":[],"mappings":";AAIO,MAAM,+BAA+B,CAC3C,QACA,mBACA,iBACqC;AACrC,MAAI,eAA6D;AAC7D,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AAAA,EAAC;AAEb,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,MAAM;AACvD,WAAA,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,kBAAA,CAAmB,CAAC,CAAC;AAAA,EACnE;AAEA,MAAI,mBAAmB,cAAc;AAC7B,WAAA,eAAe,QAAQ,YAAsC,EAAE;AAAA,EACvE;AAGA,SAAO,eAAe,QAAQ;AAAA,IAC7B,eAAe;AAAA,IACf,UAAU,CAAC,YAAY;AAAA,EACvB,CAAA,EAAE;AACJ;"}
1
+ {"version":3,"file":"permissivelyDeserializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/permissivelyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const permissivelyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode | SlateElement | null = null\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {}\n\n\tif (typeof deserialized !== 'object' || deserialized === null) {\n\t\treturn [editor.createDefaultElement([{ text: serializedElement }])]\n\t}\n\n\tif ('formatVersion' in deserialized) {\n\t\treturn toLatestFormat(editor, deserialized as SerializableEditorNode).children\n\t}\n\n\t// If no format version is specified, assume zero.\n\treturn toLatestFormat(editor, {\n\t\tformatVersion: 0,\n\t\tchildren: [deserialized],\n\t}).children\n}\n"],"names":[],"mappings":";AAIO,MAAM,+BAA+B,CAC3C,QACA,mBACA,iBACqC;AACrC,MAAI,eAA6D;AAC7D,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AAAA,EAAA;AAEZ,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,MAAM;AACvD,WAAA,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,kBAAmB,CAAA,CAAC,CAAC;AAAA,EAAA;AAGnE,MAAI,mBAAmB,cAAc;AAC7B,WAAA,eAAe,QAAQ,YAAsC,EAAE;AAAA,EAAA;AAIvE,SAAO,eAAe,QAAQ;AAAA,IAC7B,eAAe;AAAA,IACf,UAAU,CAAC,YAAY;AAAA,EACvB,CAAA,EAAE;AACJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"removeMarks.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/removeMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const removeMarks = <T extends SlateText, E extends SlateEditor>(editor: E, marks: TextSpecifics<T>) => {\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (const mark in marks) {\n\t\t\tEditor.removeMark(editor, mark)\n\t\t}\n\t})\n}\n"],"names":["Editor"],"mappings":";;;AAGa,MAAA,cAAc,CAA6C,QAAW,UAA4B;AACvGA,eAAA,mBAAmB,QAAQ,MAAM;AACvC,eAAW,QAAQ,OAAO;AAClBA,YAAAA,OAAA,WAAW,QAAQ,IAAI;AAAA,IAC/B;AAAA,EAAA,CACA;AACF;;"}
1
+ {"version":3,"file":"removeMarks.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/removeMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const removeMarks = <T extends SlateText, E extends SlateEditor>(editor: E, marks: TextSpecifics<T>) => {\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (const mark in marks) {\n\t\t\tEditor.removeMark(editor, mark)\n\t\t}\n\t})\n}\n"],"names":["Editor"],"mappings":";;;AAGa,MAAA,cAAc,CAA6C,QAAW,UAA4B;AACvGA,eAAA,mBAAmB,QAAQ,MAAM;AACvC,eAAW,QAAQ,OAAO;AAClBA,mBAAA,WAAW,QAAQ,IAAI;AAAA,IAAA;AAAA,EAC/B,CACA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"removeMarks.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/removeMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const removeMarks = <T extends SlateText, E extends SlateEditor>(editor: E, marks: TextSpecifics<T>) => {\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (const mark in marks) {\n\t\t\tEditor.removeMark(editor, mark)\n\t\t}\n\t})\n}\n"],"names":[],"mappings":";AAGa,MAAA,cAAc,CAA6C,QAAW,UAA4B;AACvG,SAAA,mBAAmB,QAAQ,MAAM;AACvC,eAAW,QAAQ,OAAO;AAClB,aAAA,WAAW,QAAQ,IAAI;AAAA,IAC/B;AAAA,EAAA,CACA;AACF;"}
1
+ {"version":3,"file":"removeMarks.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/removeMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const removeMarks = <T extends SlateText, E extends SlateEditor>(editor: E, marks: TextSpecifics<T>) => {\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (const mark in marks) {\n\t\t\tEditor.removeMark(editor, mark)\n\t\t}\n\t})\n}\n"],"names":[],"mappings":";AAGa,MAAA,cAAc,CAA6C,QAAW,UAA4B;AACvG,SAAA,mBAAmB,QAAQ,MAAM;AACvC,eAAW,QAAQ,OAAO;AAClB,aAAA,WAAW,QAAQ,IAAI;AAAA,IAAA;AAAA,EAC/B,CACA;AACF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"serializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/serializeNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const serializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\telements: Array<SlateElement | SlateText>,\n\terrorMessage?: string,\n) => {\n\ttry {\n\t\tconst serialized: SerializableEditorNode = {\n\t\t\tformatVersion: editor.formatVersion,\n\t\t\tchildren: elements,\n\t\t}\n\t\treturn JSON.stringify(serialized)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: serialization error`)\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,iBAAiB,CAC7B,QACA,UACA,iBACI;AACA,MAAA;AACH,UAAM,aAAqC;AAAA,MAC1C,eAAe,OAAO;AAAA,MACtB,UAAU;AAAA,IAAA;AAEJ,WAAA,KAAK,UAAU,UAAU;AAAA,WACxB,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,6BAA6B;AAAA,EAC9D;AACD;;"}
1
+ {"version":3,"file":"serializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/serializeNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const serializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\telements: Array<SlateElement | SlateText>,\n\terrorMessage?: string,\n) => {\n\ttry {\n\t\tconst serialized: SerializableEditorNode = {\n\t\t\tformatVersion: editor.formatVersion,\n\t\t\tchildren: elements,\n\t\t}\n\t\treturn JSON.stringify(serialized)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: serialization error`)\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,iBAAiB,CAC7B,QACA,UACA,iBACI;AACA,MAAA;AACH,UAAM,aAAqC;AAAA,MAC1C,eAAe,OAAO;AAAA,MACtB,UAAU;AAAA,IACX;AACO,WAAA,KAAK,UAAU,UAAU;AAAA,WACxB,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,6BAA6B;AAAA,EAAA;AAE/D;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"serializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/serializeNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const serializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\telements: Array<SlateElement | SlateText>,\n\terrorMessage?: string,\n) => {\n\ttry {\n\t\tconst serialized: SerializableEditorNode = {\n\t\t\tformatVersion: editor.formatVersion,\n\t\t\tchildren: elements,\n\t\t}\n\t\treturn JSON.stringify(serialized)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: serialization error`)\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,iBAAiB,CAC7B,QACA,UACA,iBACI;AACA,MAAA;AACH,UAAM,aAAqC;AAAA,MAC1C,eAAe,OAAO;AAAA,MACtB,UAAU;AAAA,IAAA;AAEJ,WAAA,KAAK,UAAU,UAAU;AAAA,WACxB,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,6BAA6B;AAAA,EAC9D;AACD;"}
1
+ {"version":3,"file":"serializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/serializeNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const serializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\telements: Array<SlateElement | SlateText>,\n\terrorMessage?: string,\n) => {\n\ttry {\n\t\tconst serialized: SerializableEditorNode = {\n\t\t\tformatVersion: editor.formatVersion,\n\t\t\tchildren: elements,\n\t\t}\n\t\treturn JSON.stringify(serialized)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: serialization error`)\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,iBAAiB,CAC7B,QACA,UACA,iBACI;AACA,MAAA;AACH,UAAM,aAAqC;AAAA,MAC1C,eAAe,OAAO;AAAA,MACtB,UAAU;AAAA,IACX;AACO,WAAA,KAAK,UAAU,UAAU;AAAA,WACxB,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,6BAA6B;AAAA,EAAA;AAE/D;"}
@@ -1 +1 @@
1
- {"version":3,"file":"strictlyDeserializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/strictlyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const strictlyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: deserialization error`)\n\t}\n\treturn toLatestFormat(editor, deserialized).children\n}\n"],"names":["toLatestFormat"],"mappings":";;;AAIO,MAAM,2BAA2B,CACvC,QACA,mBACA,iBACqC;AACjC,MAAA;AACA,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,+BAA+B;AAAA,EAChE;AACO,SAAAA,8BAAe,QAAQ,YAAY,EAAE;AAC7C;;"}
1
+ {"version":3,"file":"strictlyDeserializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/strictlyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const strictlyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: deserialization error`)\n\t}\n\treturn toLatestFormat(editor, deserialized).children\n}\n"],"names":["toLatestFormat"],"mappings":";;;AAIO,MAAM,2BAA2B,CACvC,QACA,mBACA,iBACqC;AACjC,MAAA;AACA,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,+BAA+B;AAAA,EAAA;AAEzD,SAAAA,8BAAe,QAAQ,YAAY,EAAE;AAC7C;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"strictlyDeserializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/strictlyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const strictlyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: deserialization error`)\n\t}\n\treturn toLatestFormat(editor, deserialized).children\n}\n"],"names":[],"mappings":";AAIO,MAAM,2BAA2B,CACvC,QACA,mBACA,iBACqC;AACjC,MAAA;AACA,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,+BAA+B;AAAA,EAChE;AACO,SAAA,eAAe,QAAQ,YAAY,EAAE;AAC7C;"}
1
+ {"version":3,"file":"strictlyDeserializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/strictlyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const strictlyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: deserialization error`)\n\t}\n\treturn toLatestFormat(editor, deserialized).children\n}\n"],"names":[],"mappings":";AAIO,MAAM,2BAA2B,CACvC,QACA,mBACA,iBACqC;AACjC,MAAA;AACA,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,+BAA+B;AAAA,EAAA;AAEzD,SAAA,eAAe,QAAQ,YAAY,EAAE;AAC7C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"toLatestFormat.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/toLatestFormat.ts"],"sourcesContent":["import { BindingError } from '@contember/react-binding'\nimport { Editor as SlateEditor, Element as SlateElement } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const toLatestFormat = <E extends SlateEditor>(\n\teditor: E,\n\tpotentiallyOldNode: SerializableEditorNode,\n): SerializableEditorNode => {\n\tif (potentiallyOldNode.formatVersion === editor.formatVersion) {\n\t\treturn potentiallyOldNode\n\t}\n\tif (potentiallyOldNode.formatVersion > editor.formatVersion) {\n\t\t// Boy oh boy, do we have a situation…\n\t\treturn potentiallyOldNode // Just hope it's at least somewhat backwards compatible.\n\t}\n\tlet formatNumber = potentiallyOldNode.formatVersion\n\ttry {\n\t\tfor (; formatNumber < editor.formatVersion; formatNumber++) {\n\t\t\tpotentiallyOldNode = {\n\t\t\t\tformatVersion: formatNumber + 1,\n\t\t\t\tchildren: potentiallyOldNode.children.map(oldChild =>\n\t\t\t\t\teditor.upgradeFormatBySingleVersion(oldChild, formatNumber),\n\t\t\t\t) as SlateElement[],\n\t\t\t}\n\t\t}\n\t\treturn potentiallyOldNode\n\t} catch (e) {\n\t\tconst genericMessage = `Failed to upgrade editor format from version ${formatNumber}.`\n\t\tif (e instanceof RangeError) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`${genericMessage}\\nDetected a stack overflow. ` +\n\t\t\t\t\t`Perhaps you incorrectly implemented 'upgradeFormatBySingleVersion'?`,\n\t\t\t)\n\t\t}\n\t\tthrow new BindingError(genericMessage)\n\t}\n}\n"],"names":["BindingError"],"mappings":";;;AAIa,MAAA,iBAAiB,CAC7B,QACA,uBAC4B;AACxB,MAAA,mBAAmB,kBAAkB,OAAO,eAAe;AACvD,WAAA;AAAA,EACR;AACI,MAAA,mBAAmB,gBAAgB,OAAO,eAAe;AAErD,WAAA;AAAA,EACR;AACA,MAAI,eAAe,mBAAmB;AAClC,MAAA;AACI,WAAA,eAAe,OAAO,eAAe,gBAAgB;AACtC,2BAAA;AAAA,QACpB,eAAe,eAAe;AAAA,QAC9B,UAAU,mBAAmB,SAAS;AAAA,UAAI,CACzC,aAAA,OAAO,6BAA6B,UAAU,YAAY;AAAA,QAC3D;AAAA,MAAA;AAAA,IAEF;AACO,WAAA;AAAA,WACC,GAAG;AACL,UAAA,iBAAiB,gDAAgD,YAAY;AACnF,QAAI,aAAa,YAAY;AAC5B,YAAM,IAAIA,aAAA;AAAA,QACT,GAAG,cAAc;AAAA;AAAA,MAAA;AAAA,IAGnB;AACM,UAAA,IAAIA,aAAAA,aAAa,cAAc;AAAA,EACtC;AACD;;"}
1
+ {"version":3,"file":"toLatestFormat.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/toLatestFormat.ts"],"sourcesContent":["import { BindingError } from '@contember/react-binding'\nimport { Editor as SlateEditor, Element as SlateElement } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const toLatestFormat = <E extends SlateEditor>(\n\teditor: E,\n\tpotentiallyOldNode: SerializableEditorNode,\n): SerializableEditorNode => {\n\tif (potentiallyOldNode.formatVersion === editor.formatVersion) {\n\t\treturn potentiallyOldNode\n\t}\n\tif (potentiallyOldNode.formatVersion > editor.formatVersion) {\n\t\t// Boy oh boy, do we have a situation…\n\t\treturn potentiallyOldNode // Just hope it's at least somewhat backwards compatible.\n\t}\n\tlet formatNumber = potentiallyOldNode.formatVersion\n\ttry {\n\t\tfor (; formatNumber < editor.formatVersion; formatNumber++) {\n\t\t\tpotentiallyOldNode = {\n\t\t\t\tformatVersion: formatNumber + 1,\n\t\t\t\tchildren: potentiallyOldNode.children.map(oldChild =>\n\t\t\t\t\teditor.upgradeFormatBySingleVersion(oldChild, formatNumber),\n\t\t\t\t) as SlateElement[],\n\t\t\t}\n\t\t}\n\t\treturn potentiallyOldNode\n\t} catch (e) {\n\t\tconst genericMessage = `Failed to upgrade editor format from version ${formatNumber}.`\n\t\tif (e instanceof RangeError) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`${genericMessage}\\nDetected a stack overflow. ` +\n\t\t\t\t\t`Perhaps you incorrectly implemented 'upgradeFormatBySingleVersion'?`,\n\t\t\t)\n\t\t}\n\t\tthrow new BindingError(genericMessage)\n\t}\n}\n"],"names":["BindingError"],"mappings":";;;AAIa,MAAA,iBAAiB,CAC7B,QACA,uBAC4B;AACxB,MAAA,mBAAmB,kBAAkB,OAAO,eAAe;AACvD,WAAA;AAAA,EAAA;AAEJ,MAAA,mBAAmB,gBAAgB,OAAO,eAAe;AAErD,WAAA;AAAA,EAAA;AAER,MAAI,eAAe,mBAAmB;AAClC,MAAA;AACI,WAAA,eAAe,OAAO,eAAe,gBAAgB;AACtC,2BAAA;AAAA,QACpB,eAAe,eAAe;AAAA,QAC9B,UAAU,mBAAmB,SAAS;AAAA,UAAI,CACzC,aAAA,OAAO,6BAA6B,UAAU,YAAY;AAAA,QAAA;AAAA,MAE5D;AAAA,IAAA;AAEM,WAAA;AAAA,WACC,GAAG;AACL,UAAA,iBAAiB,gDAAgD,YAAY;AACnF,QAAI,aAAa,YAAY;AAC5B,YAAM,IAAIA,aAAA;AAAA,QACT,GAAG,cAAc;AAAA;AAAA,MAElB;AAAA,IAAA;AAEK,UAAA,IAAIA,0BAAa,cAAc;AAAA,EAAA;AAEvC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"toLatestFormat.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/toLatestFormat.ts"],"sourcesContent":["import { BindingError } from '@contember/react-binding'\nimport { Editor as SlateEditor, Element as SlateElement } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const toLatestFormat = <E extends SlateEditor>(\n\teditor: E,\n\tpotentiallyOldNode: SerializableEditorNode,\n): SerializableEditorNode => {\n\tif (potentiallyOldNode.formatVersion === editor.formatVersion) {\n\t\treturn potentiallyOldNode\n\t}\n\tif (potentiallyOldNode.formatVersion > editor.formatVersion) {\n\t\t// Boy oh boy, do we have a situation…\n\t\treturn potentiallyOldNode // Just hope it's at least somewhat backwards compatible.\n\t}\n\tlet formatNumber = potentiallyOldNode.formatVersion\n\ttry {\n\t\tfor (; formatNumber < editor.formatVersion; formatNumber++) {\n\t\t\tpotentiallyOldNode = {\n\t\t\t\tformatVersion: formatNumber + 1,\n\t\t\t\tchildren: potentiallyOldNode.children.map(oldChild =>\n\t\t\t\t\teditor.upgradeFormatBySingleVersion(oldChild, formatNumber),\n\t\t\t\t) as SlateElement[],\n\t\t\t}\n\t\t}\n\t\treturn potentiallyOldNode\n\t} catch (e) {\n\t\tconst genericMessage = `Failed to upgrade editor format from version ${formatNumber}.`\n\t\tif (e instanceof RangeError) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`${genericMessage}\\nDetected a stack overflow. ` +\n\t\t\t\t\t`Perhaps you incorrectly implemented 'upgradeFormatBySingleVersion'?`,\n\t\t\t)\n\t\t}\n\t\tthrow new BindingError(genericMessage)\n\t}\n}\n"],"names":[],"mappings":";AAIa,MAAA,iBAAiB,CAC7B,QACA,uBAC4B;AACxB,MAAA,mBAAmB,kBAAkB,OAAO,eAAe;AACvD,WAAA;AAAA,EACR;AACI,MAAA,mBAAmB,gBAAgB,OAAO,eAAe;AAErD,WAAA;AAAA,EACR;AACA,MAAI,eAAe,mBAAmB;AAClC,MAAA;AACI,WAAA,eAAe,OAAO,eAAe,gBAAgB;AACtC,2BAAA;AAAA,QACpB,eAAe,eAAe;AAAA,QAC9B,UAAU,mBAAmB,SAAS;AAAA,UAAI,CACzC,aAAA,OAAO,6BAA6B,UAAU,YAAY;AAAA,QAC3D;AAAA,MAAA;AAAA,IAEF;AACO,WAAA;AAAA,WACC,GAAG;AACL,UAAA,iBAAiB,gDAAgD,YAAY;AACnF,QAAI,aAAa,YAAY;AAC5B,YAAM,IAAI;AAAA,QACT,GAAG,cAAc;AAAA;AAAA,MAAA;AAAA,IAGnB;AACM,UAAA,IAAI,aAAa,cAAc;AAAA,EACtC;AACD;"}
1
+ {"version":3,"file":"toLatestFormat.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/toLatestFormat.ts"],"sourcesContent":["import { BindingError } from '@contember/react-binding'\nimport { Editor as SlateEditor, Element as SlateElement } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const toLatestFormat = <E extends SlateEditor>(\n\teditor: E,\n\tpotentiallyOldNode: SerializableEditorNode,\n): SerializableEditorNode => {\n\tif (potentiallyOldNode.formatVersion === editor.formatVersion) {\n\t\treturn potentiallyOldNode\n\t}\n\tif (potentiallyOldNode.formatVersion > editor.formatVersion) {\n\t\t// Boy oh boy, do we have a situation…\n\t\treturn potentiallyOldNode // Just hope it's at least somewhat backwards compatible.\n\t}\n\tlet formatNumber = potentiallyOldNode.formatVersion\n\ttry {\n\t\tfor (; formatNumber < editor.formatVersion; formatNumber++) {\n\t\t\tpotentiallyOldNode = {\n\t\t\t\tformatVersion: formatNumber + 1,\n\t\t\t\tchildren: potentiallyOldNode.children.map(oldChild =>\n\t\t\t\t\teditor.upgradeFormatBySingleVersion(oldChild, formatNumber),\n\t\t\t\t) as SlateElement[],\n\t\t\t}\n\t\t}\n\t\treturn potentiallyOldNode\n\t} catch (e) {\n\t\tconst genericMessage = `Failed to upgrade editor format from version ${formatNumber}.`\n\t\tif (e instanceof RangeError) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`${genericMessage}\\nDetected a stack overflow. ` +\n\t\t\t\t\t`Perhaps you incorrectly implemented 'upgradeFormatBySingleVersion'?`,\n\t\t\t)\n\t\t}\n\t\tthrow new BindingError(genericMessage)\n\t}\n}\n"],"names":[],"mappings":";AAIa,MAAA,iBAAiB,CAC7B,QACA,uBAC4B;AACxB,MAAA,mBAAmB,kBAAkB,OAAO,eAAe;AACvD,WAAA;AAAA,EAAA;AAEJ,MAAA,mBAAmB,gBAAgB,OAAO,eAAe;AAErD,WAAA;AAAA,EAAA;AAER,MAAI,eAAe,mBAAmB;AAClC,MAAA;AACI,WAAA,eAAe,OAAO,eAAe,gBAAgB;AACtC,2BAAA;AAAA,QACpB,eAAe,eAAe;AAAA,QAC9B,UAAU,mBAAmB,SAAS;AAAA,UAAI,CACzC,aAAA,OAAO,6BAA6B,UAAU,YAAY;AAAA,QAAA;AAAA,MAE5D;AAAA,IAAA;AAEM,WAAA;AAAA,WACC,GAAG;AACL,UAAA,iBAAiB,gDAAgD,YAAY;AACnF,QAAI,aAAa,YAAY;AAC5B,YAAM,IAAI;AAAA,QACT,GAAG,cAAc;AAAA;AAAA,MAElB;AAAA,IAAA;AAEK,UAAA,IAAI,aAAa,cAAc;AAAA,EAAA;AAEvC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultElement.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/components/DefaultElement.tsx"],"sourcesContent":["import { createElement, FunctionComponent } from 'react'\nimport { RenderElementProps, useSlateStatic } from 'slate-react'\n\nexport interface DefaultElementProps extends RenderElementProps {}\n\nexport const DefaultElement: FunctionComponent<DefaultElementProps> = ({ attributes, children, element }) => {\n\tconst editor = useSlateStatic()\n\n\treturn createElement(editor.isInline(element) ? 'span' : 'div', attributes, children)\n}\nDefaultElement.displayName = 'DefaultElement'\n"],"names":["useSlateStatic","createElement"],"mappings":";;;;AAKO,MAAM,iBAAyD,CAAC,EAAE,YAAY,UAAU,cAAc;AAC5G,QAAM,SAASA,WAAAA;AAER,SAAAC,MAAA,cAAc,OAAO,SAAS,OAAO,IAAI,SAAS,OAAO,YAAY,QAAQ;AACrF;AACA,eAAe,cAAc;;"}
1
+ {"version":3,"file":"DefaultElement.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/components/DefaultElement.tsx"],"sourcesContent":["import { createElement, FunctionComponent } from 'react'\nimport { RenderElementProps, useSlateStatic } from 'slate-react'\n\nexport interface DefaultElementProps extends RenderElementProps {}\n\nexport const DefaultElement: FunctionComponent<DefaultElementProps> = ({ attributes, children, element }) => {\n\tconst editor = useSlateStatic()\n\n\treturn createElement(editor.isInline(element) ? 'span' : 'div', attributes, children)\n}\nDefaultElement.displayName = 'DefaultElement'\n"],"names":["useSlateStatic","createElement"],"mappings":";;;;AAKO,MAAM,iBAAyD,CAAC,EAAE,YAAY,UAAU,cAAc;AAC5G,QAAM,SAASA,WAAAA,eAAe;AAEvB,SAAAC,MAAA,cAAc,OAAO,SAAS,OAAO,IAAI,SAAS,OAAO,YAAY,QAAQ;AACrF;AACA,eAAe,cAAc;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultElement.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/components/DefaultElement.tsx"],"sourcesContent":["import { createElement, FunctionComponent } from 'react'\nimport { RenderElementProps, useSlateStatic } from 'slate-react'\n\nexport interface DefaultElementProps extends RenderElementProps {}\n\nexport const DefaultElement: FunctionComponent<DefaultElementProps> = ({ attributes, children, element }) => {\n\tconst editor = useSlateStatic()\n\n\treturn createElement(editor.isInline(element) ? 'span' : 'div', attributes, children)\n}\nDefaultElement.displayName = 'DefaultElement'\n"],"names":[],"mappings":";;AAKO,MAAM,iBAAyD,CAAC,EAAE,YAAY,UAAU,cAAc;AAC5G,QAAM,SAAS;AAER,SAAA,cAAc,OAAO,SAAS,OAAO,IAAI,SAAS,OAAO,YAAY,QAAQ;AACrF;AACA,eAAe,cAAc;"}
1
+ {"version":3,"file":"DefaultElement.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/components/DefaultElement.tsx"],"sourcesContent":["import { createElement, FunctionComponent } from 'react'\nimport { RenderElementProps, useSlateStatic } from 'slate-react'\n\nexport interface DefaultElementProps extends RenderElementProps {}\n\nexport const DefaultElement: FunctionComponent<DefaultElementProps> = ({ attributes, children, element }) => {\n\tconst editor = useSlateStatic()\n\n\treturn createElement(editor.isInline(element) ? 'span' : 'div', attributes, children)\n}\nDefaultElement.displayName = 'DefaultElement'\n"],"names":[],"mappings":";;AAKO,MAAM,iBAAyD,CAAC,EAAE,YAAY,UAAU,cAAc;AAC5G,QAAM,SAAS,eAAe;AAEvB,SAAA,cAAc,OAAO,SAAS,OAAO,IAAI,SAAS,OAAO,YAAY,QAAQ;AACrF;AACA,eAAe,cAAc;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRichTextFieldNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/hooks/useRichTextFieldNodes.ts"],"sourcesContent":["import { BindingError, FieldAccessor } from '@contember/react-binding'\nimport { Descendant, Editor } from 'slate'\n\nexport interface UseRichTextFieldEditorNodeOptions {\n\teditor: Editor\n\tfieldAccessor: FieldAccessor<string>\n\tcontemberFieldElementCache: WeakMap<FieldAccessor<string>, Descendant[]>\n}\n\nexport const useRichTextFieldNodes = ({\n\teditor,\n\tfieldAccessor,\n\tcontemberFieldElementCache,\n}: UseRichTextFieldEditorNodeOptions): Descendant[] => {\n\tif (contemberFieldElementCache.has(fieldAccessor)) {\n\t\treturn contemberFieldElementCache.get(fieldAccessor)!\n\t}\n\n\tconst fieldValue = fieldAccessor.value\n\tif (typeof fieldValue !== 'string' && fieldValue !== null) {\n\t\tthrow new BindingError(`RichTextField: the underlying field does not contain a string value.`)\n\t}\n\n\tconst elements: Descendant[] =\n\t\tfieldValue === null || fieldValue === ''\n\t\t\t? [editor.createDefaultElement([{ text: '' }])]\n\t\t\t: [\n\t\t\t\teditor.createDefaultElement(\n\t\t\t\t\teditor.deserializeNodes(\n\t\t\t\t\t\tfieldValue,\n\t\t\t\t\t\t`RichTextField: the underlying field contains invalid JSON.`,\n\t\t\t\t\t) as Descendant[],\n\t\t\t\t),\n\t\t\t ]\n\tcontemberFieldElementCache.set(fieldAccessor, elements)\n\n\treturn elements\n}\n"],"names":["BindingError"],"mappings":";;;AASO,MAAM,wBAAwB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACD,MAAuD;AAClD,MAAA,2BAA2B,IAAI,aAAa,GAAG;AAC3C,WAAA,2BAA2B,IAAI,aAAa;AAAA,EACpD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AACpD,UAAA,IAAIA,0BAAa,sEAAsE;AAAA,EAC9F;AAEA,QAAM,WACL,eAAe,QAAQ,eAAe,KACnC,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAI,CAAA,CAAC,CAAC,IAC5C;AAAA,IACD,OAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EAAA;AAEwB,6BAAA,IAAI,eAAe,QAAQ;AAE/C,SAAA;AACR;;"}
1
+ {"version":3,"file":"useRichTextFieldNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/hooks/useRichTextFieldNodes.ts"],"sourcesContent":["import { BindingError, FieldAccessor } from '@contember/react-binding'\nimport { Descendant, Editor } from 'slate'\n\nexport interface UseRichTextFieldEditorNodeOptions {\n\teditor: Editor\n\tfieldAccessor: FieldAccessor<string>\n\tcontemberFieldElementCache: WeakMap<FieldAccessor<string>, Descendant[]>\n}\n\nexport const useRichTextFieldNodes = ({\n\teditor,\n\tfieldAccessor,\n\tcontemberFieldElementCache,\n}: UseRichTextFieldEditorNodeOptions): Descendant[] => {\n\tif (contemberFieldElementCache.has(fieldAccessor)) {\n\t\treturn contemberFieldElementCache.get(fieldAccessor)!\n\t}\n\n\tconst fieldValue = fieldAccessor.value\n\tif (typeof fieldValue !== 'string' && fieldValue !== null) {\n\t\tthrow new BindingError(`RichTextField: the underlying field does not contain a string value.`)\n\t}\n\n\tconst elements: Descendant[] =\n\t\tfieldValue === null || fieldValue === ''\n\t\t\t? [editor.createDefaultElement([{ text: '' }])]\n\t\t\t: [\n\t\t\t\teditor.createDefaultElement(\n\t\t\t\t\teditor.deserializeNodes(\n\t\t\t\t\t\tfieldValue,\n\t\t\t\t\t\t`RichTextField: the underlying field contains invalid JSON.`,\n\t\t\t\t\t) as Descendant[],\n\t\t\t\t),\n\t\t\t ]\n\tcontemberFieldElementCache.set(fieldAccessor, elements)\n\n\treturn elements\n}\n"],"names":["BindingError"],"mappings":";;;AASO,MAAM,wBAAwB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACD,MAAuD;AAClD,MAAA,2BAA2B,IAAI,aAAa,GAAG;AAC3C,WAAA,2BAA2B,IAAI,aAAa;AAAA,EAAA;AAGpD,QAAM,aAAa,cAAc;AACjC,MAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AACpD,UAAA,IAAIA,aAAAA,aAAa,sEAAsE;AAAA,EAAA;AAG9F,QAAM,WACL,eAAe,QAAQ,eAAe,KACnC,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAI,CAAA,CAAC,CAAC,IAC5C;AAAA,IACD,OAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA;AAAA,MAAA;AAAA,IACD;AAAA,EAEA;AACuB,6BAAA,IAAI,eAAe,QAAQ;AAE/C,SAAA;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useRichTextFieldNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/hooks/useRichTextFieldNodes.ts"],"sourcesContent":["import { BindingError, FieldAccessor } from '@contember/react-binding'\nimport { Descendant, Editor } from 'slate'\n\nexport interface UseRichTextFieldEditorNodeOptions {\n\teditor: Editor\n\tfieldAccessor: FieldAccessor<string>\n\tcontemberFieldElementCache: WeakMap<FieldAccessor<string>, Descendant[]>\n}\n\nexport const useRichTextFieldNodes = ({\n\teditor,\n\tfieldAccessor,\n\tcontemberFieldElementCache,\n}: UseRichTextFieldEditorNodeOptions): Descendant[] => {\n\tif (contemberFieldElementCache.has(fieldAccessor)) {\n\t\treturn contemberFieldElementCache.get(fieldAccessor)!\n\t}\n\n\tconst fieldValue = fieldAccessor.value\n\tif (typeof fieldValue !== 'string' && fieldValue !== null) {\n\t\tthrow new BindingError(`RichTextField: the underlying field does not contain a string value.`)\n\t}\n\n\tconst elements: Descendant[] =\n\t\tfieldValue === null || fieldValue === ''\n\t\t\t? [editor.createDefaultElement([{ text: '' }])]\n\t\t\t: [\n\t\t\t\teditor.createDefaultElement(\n\t\t\t\t\teditor.deserializeNodes(\n\t\t\t\t\t\tfieldValue,\n\t\t\t\t\t\t`RichTextField: the underlying field contains invalid JSON.`,\n\t\t\t\t\t) as Descendant[],\n\t\t\t\t),\n\t\t\t ]\n\tcontemberFieldElementCache.set(fieldAccessor, elements)\n\n\treturn elements\n}\n"],"names":[],"mappings":";AASO,MAAM,wBAAwB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACD,MAAuD;AAClD,MAAA,2BAA2B,IAAI,aAAa,GAAG;AAC3C,WAAA,2BAA2B,IAAI,aAAa;AAAA,EACpD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AACpD,UAAA,IAAI,aAAa,sEAAsE;AAAA,EAC9F;AAEA,QAAM,WACL,eAAe,QAAQ,eAAe,KACnC,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAI,CAAA,CAAC,CAAC,IAC5C;AAAA,IACD,OAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EAAA;AAEwB,6BAAA,IAAI,eAAe,QAAQ;AAE/C,SAAA;AACR;"}
1
+ {"version":3,"file":"useRichTextFieldNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/hooks/useRichTextFieldNodes.ts"],"sourcesContent":["import { BindingError, FieldAccessor } from '@contember/react-binding'\nimport { Descendant, Editor } from 'slate'\n\nexport interface UseRichTextFieldEditorNodeOptions {\n\teditor: Editor\n\tfieldAccessor: FieldAccessor<string>\n\tcontemberFieldElementCache: WeakMap<FieldAccessor<string>, Descendant[]>\n}\n\nexport const useRichTextFieldNodes = ({\n\teditor,\n\tfieldAccessor,\n\tcontemberFieldElementCache,\n}: UseRichTextFieldEditorNodeOptions): Descendant[] => {\n\tif (contemberFieldElementCache.has(fieldAccessor)) {\n\t\treturn contemberFieldElementCache.get(fieldAccessor)!\n\t}\n\n\tconst fieldValue = fieldAccessor.value\n\tif (typeof fieldValue !== 'string' && fieldValue !== null) {\n\t\tthrow new BindingError(`RichTextField: the underlying field does not contain a string value.`)\n\t}\n\n\tconst elements: Descendant[] =\n\t\tfieldValue === null || fieldValue === ''\n\t\t\t? [editor.createDefaultElement([{ text: '' }])]\n\t\t\t: [\n\t\t\t\teditor.createDefaultElement(\n\t\t\t\t\teditor.deserializeNodes(\n\t\t\t\t\t\tfieldValue,\n\t\t\t\t\t\t`RichTextField: the underlying field contains invalid JSON.`,\n\t\t\t\t\t) as Descendant[],\n\t\t\t\t),\n\t\t\t ]\n\tcontemberFieldElementCache.set(fieldAccessor, elements)\n\n\treturn elements\n}\n"],"names":[],"mappings":";AASO,MAAM,wBAAwB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACD,MAAuD;AAClD,MAAA,2BAA2B,IAAI,aAAa,GAAG;AAC3C,WAAA,2BAA2B,IAAI,aAAa;AAAA,EAAA;AAGpD,QAAM,aAAa,cAAc;AACjC,MAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AACpD,UAAA,IAAI,aAAa,sEAAsE;AAAA,EAAA;AAG9F,QAAM,WACL,eAAe,QAAQ,eAAe,KACnC,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAI,CAAA,CAAC,CAAC,IAC5C;AAAA,IACD,OAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA;AAAA,MAAA;AAAA,IACD;AAAA,EAEA;AACuB,6BAAA,IAAI,eAAe,QAAQ;AAE/C,SAAA;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorPasteUtils.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/EditorPasteUtils.ts"],"sourcesContent":["import { Element } from 'slate'\nimport { NodesWithType } from '../../plugins/behaviour/paste/HtmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../types/editor'\n\nexport class EditorPasteUtils {\n\tpublic static wordPasteListItemContent(allNodes: Iterable<Node> | ArrayLike<Node>): Node[] {\n\t\tconst nodes: Node[] = []\n\t\tlet ignoring = false\n\t\tlet forProcessing = Array.from(allNodes)\n\t\tif (\n\t\t\t(forProcessing.length === 1 && forProcessing[0].nodeName === 'SPAN') ||\n\t\t\t\t(forProcessing.length === 2 && forProcessing[0].nodeName === 'SPAN' && forProcessing[1].nodeName === 'O:P')\n\t\t) {\n\t\t\tforProcessing = Array.from(forProcessing[0].childNodes)\n\t\t}\n\n\t\tfor (const node of forProcessing) {\n\t\t\tconst isStartIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[if !supportLists]'\n\t\t\tif (isStartIgnore) {\n\t\t\t\tignoring = true\n\t\t\t} else {\n\t\t\t\tconst isEndIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[endif]'\n\t\t\t\tif (isEndIgnore) {\n\t\t\t\t\tignoring = false\n\t\t\t\t} else {\n\t\t\t\t\tif (!ignoring) {\n\t\t\t\t\t\tnodes.push(node)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nodes\n\t}\n\n\tpublic static flattenNodesWithType(withType: NodesWithType[], defaultElementFactory: EditorDefaultElementFactory): NodesWithType {\n\t\tconst withTypeFiltered = withType.filter((item): item is Exclude<NodesWithType, null> => item !== null)\n\t\tconst containsBlock = withTypeFiltered.find(({ elements }) => elements !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: withTypeFiltered.flatMap<Element>(item => {\n\t\t\t\t\tif (item.elements === undefined) {\n\t\t\t\t\t\treturn [defaultElementFactory(item.texts)]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn item.elements\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: withTypeFiltered.flatMap(item => item.texts!) }\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,yBAAyB,UAAoD;AAC1F,UAAM,QAAgB,CAAA;AACtB,QAAI,WAAW;AACX,QAAA,gBAAgB,MAAM,KAAK,QAAQ;AAErC,QAAA,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAC3D,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAAU,cAAc,CAAC,EAAE,aAAa,OACrG;AACD,sBAAgB,MAAM,KAAK,cAAc,CAAC,EAAE,UAAU;AAAA,IACvD;AAEA,eAAW,QAAQ,eAAe;AACjC,YAAM,gBAAgB,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAChF,UAAI,eAAe;AACP,mBAAA;AAAA,MAAA,OACL;AACN,cAAM,cAAc,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAC9E,YAAI,aAAa;AACL,qBAAA;AAAA,QAAA,OACL;AACN,cAAI,CAAC,UAAU;AACd,kBAAM,KAAK,IAAI;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAc,qBAAqB,UAA2B,uBAAoE;AACjI,UAAM,mBAAmB,SAAS,OAAO,CAAC,SAA+C,SAAS,IAAI;AAChG,UAAA,gBAAgB,iBAAiB,KAAK,CAAC,EAAE,eAAe,aAAa,MAAS,MAAM;AAE1F,QAAI,eAAe;AACX,aAAA;AAAA,QACN,UAAU,iBAAiB,QAAiB,CAAQ,SAAA;AAC/C,cAAA,KAAK,aAAa,QAAW;AAChC,mBAAO,CAAC,sBAAsB,KAAK,KAAK,CAAC;AAAA,UAAA,OACnC;AACN,mBAAO,KAAK;AAAA,UACb;AAAA,QAAA,CACA;AAAA,MAAA;AAAA,IACF,OACM;AACN,aAAO,EAAE,OAAO,iBAAiB,QAAQ,CAAQ,SAAA,KAAK,KAAM;IAC7D;AAAA,EACD;AACD;;"}
1
+ {"version":3,"file":"EditorPasteUtils.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/EditorPasteUtils.ts"],"sourcesContent":["import { Element } from 'slate'\nimport { NodesWithType } from '../../plugins/behaviour/paste/HtmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../types/editor'\n\nexport class EditorPasteUtils {\n\tpublic static wordPasteListItemContent(allNodes: Iterable<Node> | ArrayLike<Node>): Node[] {\n\t\tconst nodes: Node[] = []\n\t\tlet ignoring = false\n\t\tlet forProcessing = Array.from(allNodes)\n\t\tif (\n\t\t\t(forProcessing.length === 1 && forProcessing[0].nodeName === 'SPAN') ||\n\t\t\t\t(forProcessing.length === 2 && forProcessing[0].nodeName === 'SPAN' && forProcessing[1].nodeName === 'O:P')\n\t\t) {\n\t\t\tforProcessing = Array.from(forProcessing[0].childNodes)\n\t\t}\n\n\t\tfor (const node of forProcessing) {\n\t\t\tconst isStartIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[if !supportLists]'\n\t\t\tif (isStartIgnore) {\n\t\t\t\tignoring = true\n\t\t\t} else {\n\t\t\t\tconst isEndIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[endif]'\n\t\t\t\tif (isEndIgnore) {\n\t\t\t\t\tignoring = false\n\t\t\t\t} else {\n\t\t\t\t\tif (!ignoring) {\n\t\t\t\t\t\tnodes.push(node)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nodes\n\t}\n\n\tpublic static flattenNodesWithType(withType: NodesWithType[], defaultElementFactory: EditorDefaultElementFactory): NodesWithType {\n\t\tconst withTypeFiltered = withType.filter((item): item is Exclude<NodesWithType, null> => item !== null)\n\t\tconst containsBlock = withTypeFiltered.find(({ elements }) => elements !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: withTypeFiltered.flatMap<Element>(item => {\n\t\t\t\t\tif (item.elements === undefined) {\n\t\t\t\t\t\treturn [defaultElementFactory(item.texts)]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn item.elements\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: withTypeFiltered.flatMap(item => item.texts!) }\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,yBAAyB,UAAoD;AAC1F,UAAM,QAAgB,CAAC;AACvB,QAAI,WAAW;AACX,QAAA,gBAAgB,MAAM,KAAK,QAAQ;AAErC,QAAA,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAC3D,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAAU,cAAc,CAAC,EAAE,aAAa,OACrG;AACD,sBAAgB,MAAM,KAAK,cAAc,CAAC,EAAE,UAAU;AAAA,IAAA;AAGvD,eAAW,QAAQ,eAAe;AACjC,YAAM,gBAAgB,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAChF,UAAI,eAAe;AACP,mBAAA;AAAA,MAAA,OACL;AACN,cAAM,cAAc,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAC9E,YAAI,aAAa;AACL,qBAAA;AAAA,QAAA,OACL;AACN,cAAI,CAAC,UAAU;AACd,kBAAM,KAAK,IAAI;AAAA,UAAA;AAAA,QAChB;AAAA,MACD;AAAA,IACD;AAEM,WAAA;AAAA,EAAA;AAAA,EAGR,OAAc,qBAAqB,UAA2B,uBAAoE;AACjI,UAAM,mBAAmB,SAAS,OAAO,CAAC,SAA+C,SAAS,IAAI;AAChG,UAAA,gBAAgB,iBAAiB,KAAK,CAAC,EAAE,SAAS,MAAM,aAAa,MAAS,MAAM;AAE1F,QAAI,eAAe;AACX,aAAA;AAAA,QACN,UAAU,iBAAiB,QAAiB,CAAQ,SAAA;AAC/C,cAAA,KAAK,aAAa,QAAW;AAChC,mBAAO,CAAC,sBAAsB,KAAK,KAAK,CAAC;AAAA,UAAA,OACnC;AACN,mBAAO,KAAK;AAAA,UAAA;AAAA,QAEb,CAAA;AAAA,MACF;AAAA,IAAA,OACM;AACN,aAAO,EAAE,OAAO,iBAAiB,QAAQ,CAAQ,SAAA,KAAK,KAAM,EAAE;AAAA,IAAA;AAAA,EAC/D;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorPasteUtils.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/EditorPasteUtils.ts"],"sourcesContent":["import { Element } from 'slate'\nimport { NodesWithType } from '../../plugins/behaviour/paste/HtmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../types/editor'\n\nexport class EditorPasteUtils {\n\tpublic static wordPasteListItemContent(allNodes: Iterable<Node> | ArrayLike<Node>): Node[] {\n\t\tconst nodes: Node[] = []\n\t\tlet ignoring = false\n\t\tlet forProcessing = Array.from(allNodes)\n\t\tif (\n\t\t\t(forProcessing.length === 1 && forProcessing[0].nodeName === 'SPAN') ||\n\t\t\t\t(forProcessing.length === 2 && forProcessing[0].nodeName === 'SPAN' && forProcessing[1].nodeName === 'O:P')\n\t\t) {\n\t\t\tforProcessing = Array.from(forProcessing[0].childNodes)\n\t\t}\n\n\t\tfor (const node of forProcessing) {\n\t\t\tconst isStartIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[if !supportLists]'\n\t\t\tif (isStartIgnore) {\n\t\t\t\tignoring = true\n\t\t\t} else {\n\t\t\t\tconst isEndIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[endif]'\n\t\t\t\tif (isEndIgnore) {\n\t\t\t\t\tignoring = false\n\t\t\t\t} else {\n\t\t\t\t\tif (!ignoring) {\n\t\t\t\t\t\tnodes.push(node)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nodes\n\t}\n\n\tpublic static flattenNodesWithType(withType: NodesWithType[], defaultElementFactory: EditorDefaultElementFactory): NodesWithType {\n\t\tconst withTypeFiltered = withType.filter((item): item is Exclude<NodesWithType, null> => item !== null)\n\t\tconst containsBlock = withTypeFiltered.find(({ elements }) => elements !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: withTypeFiltered.flatMap<Element>(item => {\n\t\t\t\t\tif (item.elements === undefined) {\n\t\t\t\t\t\treturn [defaultElementFactory(item.texts)]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn item.elements\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: withTypeFiltered.flatMap(item => item.texts!) }\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAIO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,yBAAyB,UAAoD;AAC1F,UAAM,QAAgB,CAAA;AACtB,QAAI,WAAW;AACX,QAAA,gBAAgB,MAAM,KAAK,QAAQ;AAErC,QAAA,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAC3D,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAAU,cAAc,CAAC,EAAE,aAAa,OACrG;AACD,sBAAgB,MAAM,KAAK,cAAc,CAAC,EAAE,UAAU;AAAA,IACvD;AAEA,eAAW,QAAQ,eAAe;AACjC,YAAM,gBAAgB,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAChF,UAAI,eAAe;AACP,mBAAA;AAAA,MAAA,OACL;AACN,cAAM,cAAc,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAC9E,YAAI,aAAa;AACL,qBAAA;AAAA,QAAA,OACL;AACN,cAAI,CAAC,UAAU;AACd,kBAAM,KAAK,IAAI;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAc,qBAAqB,UAA2B,uBAAoE;AACjI,UAAM,mBAAmB,SAAS,OAAO,CAAC,SAA+C,SAAS,IAAI;AAChG,UAAA,gBAAgB,iBAAiB,KAAK,CAAC,EAAE,eAAe,aAAa,MAAS,MAAM;AAE1F,QAAI,eAAe;AACX,aAAA;AAAA,QACN,UAAU,iBAAiB,QAAiB,CAAQ,SAAA;AAC/C,cAAA,KAAK,aAAa,QAAW;AAChC,mBAAO,CAAC,sBAAsB,KAAK,KAAK,CAAC;AAAA,UAAA,OACnC;AACN,mBAAO,KAAK;AAAA,UACb;AAAA,QAAA,CACA;AAAA,MAAA;AAAA,IACF,OACM;AACN,aAAO,EAAE,OAAO,iBAAiB,QAAQ,CAAQ,SAAA,KAAK,KAAM;IAC7D;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"EditorPasteUtils.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/EditorPasteUtils.ts"],"sourcesContent":["import { Element } from 'slate'\nimport { NodesWithType } from '../../plugins/behaviour/paste/HtmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../types/editor'\n\nexport class EditorPasteUtils {\n\tpublic static wordPasteListItemContent(allNodes: Iterable<Node> | ArrayLike<Node>): Node[] {\n\t\tconst nodes: Node[] = []\n\t\tlet ignoring = false\n\t\tlet forProcessing = Array.from(allNodes)\n\t\tif (\n\t\t\t(forProcessing.length === 1 && forProcessing[0].nodeName === 'SPAN') ||\n\t\t\t\t(forProcessing.length === 2 && forProcessing[0].nodeName === 'SPAN' && forProcessing[1].nodeName === 'O:P')\n\t\t) {\n\t\t\tforProcessing = Array.from(forProcessing[0].childNodes)\n\t\t}\n\n\t\tfor (const node of forProcessing) {\n\t\t\tconst isStartIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[if !supportLists]'\n\t\t\tif (isStartIgnore) {\n\t\t\t\tignoring = true\n\t\t\t} else {\n\t\t\t\tconst isEndIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[endif]'\n\t\t\t\tif (isEndIgnore) {\n\t\t\t\t\tignoring = false\n\t\t\t\t} else {\n\t\t\t\t\tif (!ignoring) {\n\t\t\t\t\t\tnodes.push(node)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nodes\n\t}\n\n\tpublic static flattenNodesWithType(withType: NodesWithType[], defaultElementFactory: EditorDefaultElementFactory): NodesWithType {\n\t\tconst withTypeFiltered = withType.filter((item): item is Exclude<NodesWithType, null> => item !== null)\n\t\tconst containsBlock = withTypeFiltered.find(({ elements }) => elements !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: withTypeFiltered.flatMap<Element>(item => {\n\t\t\t\t\tif (item.elements === undefined) {\n\t\t\t\t\t\treturn [defaultElementFactory(item.texts)]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn item.elements\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t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,QAAQ,CAAQ,SAAA,KAAK,KAAM,EAAE;AAAA,IAAA;AAAA,EAC/D;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"parseUrl.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/parseUrl.ts"],"sourcesContent":["export const parseUrl = (url: string): URL | undefined => {\n\tif (url.length < 4 || url.includes(' ')) {\n\t\t// This is almost definitely not an url anyway.\n\t\t// By returning early, we avoid the relatively costly URL constructor and can speed up the most common case of\n\t\t// just inserting a single character which better be as fast as possible.\n\t\treturn undefined\n\t}\n\ttry {\n\t\treturn new URL(url)\n\t} catch {\n\t\treturn undefined\n\t}\n}\n"],"names":[],"mappings":";;AAAa,MAAA,WAAW,CAAC,QAAiC;AACzD,MAAI,IAAI,SAAS,KAAK,IAAI,SAAS,GAAG,GAAG;AAIjC,WAAA;AAAA,EACR;AACI,MAAA;AACI,WAAA,IAAI,IAAI,GAAG;AAAA,EAAA,QACX;AACA,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"parseUrl.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/parseUrl.ts"],"sourcesContent":["export const parseUrl = (url: string): URL | undefined => {\n\tif (url.length < 4 || url.includes(' ')) {\n\t\t// This is almost definitely not an url anyway.\n\t\t// By returning early, we avoid the relatively costly URL constructor and can speed up the most common case of\n\t\t// just inserting a single character which better be as fast as possible.\n\t\treturn undefined\n\t}\n\ttry {\n\t\treturn new URL(url)\n\t} catch {\n\t\treturn undefined\n\t}\n}\n"],"names":[],"mappings":";;AAAa,MAAA,WAAW,CAAC,QAAiC;AACzD,MAAI,IAAI,SAAS,KAAK,IAAI,SAAS,GAAG,GAAG;AAIjC,WAAA;AAAA,EAAA;AAEJ,MAAA;AACI,WAAA,IAAI,IAAI,GAAG;AAAA,EAAA,QACX;AACA,WAAA;AAAA,EAAA;AAET;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"parseUrl.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/parseUrl.ts"],"sourcesContent":["export const parseUrl = (url: string): URL | undefined => {\n\tif (url.length < 4 || url.includes(' ')) {\n\t\t// This is almost definitely not an url anyway.\n\t\t// By returning early, we avoid the relatively costly URL constructor and can speed up the most common case of\n\t\t// just inserting a single character which better be as fast as possible.\n\t\treturn undefined\n\t}\n\ttry {\n\t\treturn new URL(url)\n\t} catch {\n\t\treturn undefined\n\t}\n}\n"],"names":[],"mappings":"AAAa,MAAA,WAAW,CAAC,QAAiC;AACzD,MAAI,IAAI,SAAS,KAAK,IAAI,SAAS,GAAG,GAAG;AAIjC,WAAA;AAAA,EACR;AACI,MAAA;AACI,WAAA,IAAI,IAAI,GAAG;AAAA,EAAA,QACX;AACA,WAAA;AAAA,EACR;AACD;"}
1
+ {"version":3,"file":"parseUrl.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/parseUrl.ts"],"sourcesContent":["export const parseUrl = (url: string): URL | undefined => {\n\tif (url.length < 4 || url.includes(' ')) {\n\t\t// This is almost definitely not an url anyway.\n\t\t// By returning early, we avoid the relatively costly URL constructor and can speed up the most common case of\n\t\t// just inserting a single character which better be as fast as possible.\n\t\treturn undefined\n\t}\n\ttry {\n\t\treturn new URL(url)\n\t} catch {\n\t\treturn undefined\n\t}\n}\n"],"names":[],"mappings":"AAAa,MAAA,WAAW,CAAC,QAAiC;AACzD,MAAI,IAAI,SAAS,KAAK,IAAI,SAAS,GAAG,GAAG;AAIjC,WAAA;AAAA,EAAA;AAEJ,MAAA;AACI,WAAA,IAAI,IAAI,GAAG;AAAA,EAAA,QACX;AACA,WAAA;AAAA,EAAA;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"alignButton.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/attributes/alignment/alignButton.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node, Transforms } from 'slate'\n\nexport type AlignDirection = 'start' | 'center' | 'end' | 'justify' | undefined\n\nconst isAlignTarget = (editor: Editor, it: Node, direction: AlignDirection) =>\n\tSlateElement.isElement(it)\n\t&& editor.acceptsAttributes(it.type, { align: direction })\n\nexport const createAlignHandler = (direction: AlignDirection): {\n\tisActive?: (args: { editor: Editor }) => boolean\n\tshouldDisplay?: (args: { editor: Editor }) => boolean\n\ttoggle: (args: { editor: Editor }) => void\n}\t=> ({\n\tshouldDisplay: ({ editor }) => {\n\t\treturn Array.from(Editor.nodes(editor, { match: it => isAlignTarget(editor, it, direction) })).length > 0\n\t},\n\tisActive: ({ editor }) => {\n\t\treturn Array.from(Editor.nodes(editor, { match: it => isAlignTarget(editor, it, direction) && (it as any).align === direction })).length > 0\n\t},\n\ttoggle: ({ editor }) => {\n\t\tTransforms.setNodes(editor, {\n\t\t\talign: direction,\n\t\t}, {\n\t\t\tmatch: it => isAlignTarget(editor, it, direction),\n\t\t})\n\t},\n})\n\n\n\n"],"names":["SlateElement","Editor","Transforms"],"mappings":";;;AAIA,MAAM,gBAAgB,CAAC,QAAgB,IAAU,cAChDA,MAAAA,QAAa,UAAU,EAAE,KACtB,OAAO,kBAAkB,GAAG,MAAM,EAAE,OAAO,WAAW;AAE7C,MAAA,qBAAqB,CAAC,eAI7B;AAAA,EACL,eAAe,CAAC,EAAE,aAAa;AAC9B,WAAO,MAAM,KAAKC,MAAA,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS,EAAG,CAAA,CAAC,EAAE,SAAS;AAAA,EACzG;AAAA,EACA,UAAU,CAAC,EAAE,aAAa;AACzB,WAAO,MAAM,KAAKA,aAAO,MAAM,QAAQ,EAAE,OAAO,CAAM,OAAA,cAAc,QAAQ,IAAI,SAAS,KAAM,GAAW,UAAU,WAAW,CAAC,EAAE,SAAS;AAAA,EAC5I;AAAA,EACA,QAAQ,CAAC,EAAE,aAAa;AACvBC,UAAA,WAAW,SAAS,QAAQ;AAAA,MAC3B,OAAO;AAAA,IAAA,GACL;AAAA,MACF,OAAO,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS;AAAA,IAAA,CAChD;AAAA,EACF;AACD;;"}
1
+ {"version":3,"file":"alignButton.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/attributes/alignment/alignButton.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node, Transforms } from 'slate'\n\nexport type AlignDirection = 'start' | 'center' | 'end' | 'justify' | undefined\n\nconst isAlignTarget = (editor: Editor, it: Node, direction: AlignDirection) =>\n\tSlateElement.isElement(it)\n\t&& editor.acceptsAttributes(it.type, { align: direction })\n\nexport const createAlignHandler = (direction: AlignDirection): {\n\tisActive?: (args: { editor: Editor }) => boolean\n\tshouldDisplay?: (args: { editor: Editor }) => boolean\n\ttoggle: (args: { editor: Editor }) => void\n}\t=> ({\n\tshouldDisplay: ({ editor }) => {\n\t\treturn Array.from(Editor.nodes(editor, { match: it => isAlignTarget(editor, it, direction) })).length > 0\n\t},\n\tisActive: ({ editor }) => {\n\t\treturn Array.from(Editor.nodes(editor, { match: it => isAlignTarget(editor, it, direction) && (it as any).align === direction })).length > 0\n\t},\n\ttoggle: ({ editor }) => {\n\t\tTransforms.setNodes(editor, {\n\t\t\talign: direction,\n\t\t}, {\n\t\t\tmatch: it => isAlignTarget(editor, it, direction),\n\t\t})\n\t},\n})\n\n\n\n"],"names":["SlateElement","Editor","Transforms"],"mappings":";;;AAIA,MAAM,gBAAgB,CAAC,QAAgB,IAAU,cAChDA,MAAAA,QAAa,UAAU,EAAE,KACtB,OAAO,kBAAkB,GAAG,MAAM,EAAE,OAAO,WAAW;AAE7C,MAAA,qBAAqB,CAAC,eAI7B;AAAA,EACL,eAAe,CAAC,EAAE,aAAa;AAC9B,WAAO,MAAM,KAAKC,MAAAA,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS,EAAA,CAAG,CAAC,EAAE,SAAS;AAAA,EACzG;AAAA,EACA,UAAU,CAAC,EAAE,aAAa;AACzB,WAAO,MAAM,KAAKA,aAAO,MAAM,QAAQ,EAAE,OAAO,CAAM,OAAA,cAAc,QAAQ,IAAI,SAAS,KAAM,GAAW,UAAU,UAAW,CAAA,CAAC,EAAE,SAAS;AAAA,EAC5I;AAAA,EACA,QAAQ,CAAC,EAAE,aAAa;AACvBC,UAAA,WAAW,SAAS,QAAQ;AAAA,MAC3B,OAAO;AAAA,IAAA,GACL;AAAA,MACF,OAAO,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS;AAAA,IAAA,CAChD;AAAA,EAAA;AAEH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"alignButton.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/attributes/alignment/alignButton.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node, Transforms } from 'slate'\n\nexport type AlignDirection = 'start' | 'center' | 'end' | 'justify' | undefined\n\nconst isAlignTarget = (editor: Editor, it: Node, direction: AlignDirection) =>\n\tSlateElement.isElement(it)\n\t&& editor.acceptsAttributes(it.type, { align: direction })\n\nexport const createAlignHandler = (direction: AlignDirection): {\n\tisActive?: (args: { editor: Editor }) => boolean\n\tshouldDisplay?: (args: { editor: Editor }) => boolean\n\ttoggle: (args: { editor: Editor }) => void\n}\t=> ({\n\tshouldDisplay: ({ editor }) => {\n\t\treturn Array.from(Editor.nodes(editor, { match: it => isAlignTarget(editor, it, direction) })).length > 0\n\t},\n\tisActive: ({ editor }) => {\n\t\treturn Array.from(Editor.nodes(editor, { match: it => isAlignTarget(editor, it, direction) && (it as any).align === direction })).length > 0\n\t},\n\ttoggle: ({ editor }) => {\n\t\tTransforms.setNodes(editor, {\n\t\t\talign: direction,\n\t\t}, {\n\t\t\tmatch: it => isAlignTarget(editor, it, direction),\n\t\t})\n\t},\n})\n\n\n\n"],"names":["SlateElement"],"mappings":";AAIA,MAAM,gBAAgB,CAAC,QAAgB,IAAU,cAChDA,QAAa,UAAU,EAAE,KACtB,OAAO,kBAAkB,GAAG,MAAM,EAAE,OAAO,WAAW;AAE7C,MAAA,qBAAqB,CAAC,eAI7B;AAAA,EACL,eAAe,CAAC,EAAE,aAAa;AAC9B,WAAO,MAAM,KAAK,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS,EAAG,CAAA,CAAC,EAAE,SAAS;AAAA,EACzG;AAAA,EACA,UAAU,CAAC,EAAE,aAAa;AACzB,WAAO,MAAM,KAAK,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAM,OAAA,cAAc,QAAQ,IAAI,SAAS,KAAM,GAAW,UAAU,WAAW,CAAC,EAAE,SAAS;AAAA,EAC5I;AAAA,EACA,QAAQ,CAAC,EAAE,aAAa;AACvB,eAAW,SAAS,QAAQ;AAAA,MAC3B,OAAO;AAAA,IAAA,GACL;AAAA,MACF,OAAO,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS;AAAA,IAAA,CAChD;AAAA,EACF;AACD;"}
1
+ {"version":3,"file":"alignButton.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/attributes/alignment/alignButton.ts"],"sourcesContent":["import { Editor, Element as SlateElement, Node, Transforms } from 'slate'\n\nexport type AlignDirection = 'start' | 'center' | 'end' | 'justify' | undefined\n\nconst isAlignTarget = (editor: Editor, it: Node, direction: AlignDirection) =>\n\tSlateElement.isElement(it)\n\t&& editor.acceptsAttributes(it.type, { align: direction })\n\nexport const createAlignHandler = (direction: AlignDirection): {\n\tisActive?: (args: { editor: Editor }) => boolean\n\tshouldDisplay?: (args: { editor: Editor }) => boolean\n\ttoggle: (args: { editor: Editor }) => void\n}\t=> ({\n\tshouldDisplay: ({ editor }) => {\n\t\treturn Array.from(Editor.nodes(editor, { match: it => isAlignTarget(editor, it, direction) })).length > 0\n\t},\n\tisActive: ({ editor }) => {\n\t\treturn Array.from(Editor.nodes(editor, { match: it => isAlignTarget(editor, it, direction) && (it as any).align === direction })).length > 0\n\t},\n\ttoggle: ({ editor }) => {\n\t\tTransforms.setNodes(editor, {\n\t\t\talign: direction,\n\t\t}, {\n\t\t\tmatch: it => isAlignTarget(editor, it, direction),\n\t\t})\n\t},\n})\n\n\n\n"],"names":["SlateElement"],"mappings":";AAIA,MAAM,gBAAgB,CAAC,QAAgB,IAAU,cAChDA,QAAa,UAAU,EAAE,KACtB,OAAO,kBAAkB,GAAG,MAAM,EAAE,OAAO,WAAW;AAE7C,MAAA,qBAAqB,CAAC,eAI7B;AAAA,EACL,eAAe,CAAC,EAAE,aAAa;AAC9B,WAAO,MAAM,KAAK,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS,EAAA,CAAG,CAAC,EAAE,SAAS;AAAA,EACzG;AAAA,EACA,UAAU,CAAC,EAAE,aAAa;AACzB,WAAO,MAAM,KAAK,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAM,OAAA,cAAc,QAAQ,IAAI,SAAS,KAAM,GAAW,UAAU,UAAW,CAAA,CAAC,EAAE,SAAS;AAAA,EAC5I;AAAA,EACA,QAAQ,CAAC,EAAE,aAAa;AACvB,eAAW,SAAS,QAAQ;AAAA,MAC3B,OAAO;AAAA,IAAA,GACL;AAAA,MACF,OAAO,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS;AAAA,IAAA,CAChD;AAAA,EAAA;AAEH;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/HtmlDeserializer.ts"],"sourcesContent":["import { Descendant, Element as SlateElement, Text as SlateText } from 'slate'\nimport { HtmlDeserializerNextCallback, HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../../types/editor'\n\nconst ignoredElements = ['SCRIPT', 'STYLE', 'TEMPLATE']\n\nexport interface TextAttrs {\n\t[key: string]: any\n}\n\nexport type NodesWithTypeFiltered =\n\t| { texts: Descendant[]; elements?: undefined }\n\t| { elements: SlateElement[]; texts?: undefined }\n\nexport type NodesWithType = NodesWithTypeFiltered | null\n\nexport class HtmlDeserializer {\n\tconstructor(\n\t\tpublic createDefaultElement: EditorDefaultElementFactory,\n\t\tprivate plugins: HtmlDeserializerPlugin[],\n\t) {\n\t}\n\n\tregisterPlugin(plugin: HtmlDeserializerPlugin, prepend: boolean = true) {\n\t\tprepend ? this.plugins.unshift(plugin) : this.plugins.push(plugin)\n\t}\n\n\tpublic processNodeListPaste(nodeList: Node[], cumulativeTextAttrs: TextAttrs) {\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processNodeListPaste?.({ nodeList, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\tconst processed: (\n\t\t\t| { text: SlateText | SlateElement; element?: undefined; isWhiteSpace: boolean }\n\t\t\t| { element: SlateElement; text?: undefined }\n\t\t)[] = []\n\n\t\tfor (const childNode of nodeList) {\n\t\t\tconst isWhiteSpace = childNode.nodeType === Node.TEXT_NODE && childNode.textContent?.match(/^\\s*$/) !== null\n\n\t\t\t// Block\n\t\t\tconst attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs)\n\t\t\tconst result =\n\t\t\t\tchildNode instanceof HTMLElement\n\t\t\t\t\t? this.processBlockPaste(\n\t\t\t\t\t\tchildNode,\n\t\t\t\t\t\tcumulativeTextAttrs,\n\t\t\t\t\t)\n\t\t\t\t\t: null\n\t\t\tif (result !== null) {\n\t\t\t\tprocessed.push(...(Array.isArray(result) ? result : [result]).map(element => ({ element })))\n\t\t\t} else {\n\t\t\t\t// Inline\n\t\t\t\tconst result = this.deserializeTextNode(childNode, cumulativeTextAttrs)\n\t\t\t\tif (result !== null) {\n\t\t\t\t\tprocessed.push(...result.map(text => ({ text, isWhiteSpace })))\n\t\t\t\t} else {\n\t\t\t\t\t// Unknown element\n\t\t\t\t\tconst deserializedChildren = this.processNodeListPaste(\n\t\t\t\t\t\tArray.from(childNode.childNodes),\n\t\t\t\t\t\tattrs,\n\t\t\t\t\t)\n\t\t\t\t\tprocessed.push(\n\t\t\t\t\t\t...(deserializedChildren === null\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: deserializedChildren.texts !== undefined\n\t\t\t\t\t\t\t\t? deserializedChildren.texts.map(text => ({ text, isWhiteSpace }))\n\t\t\t\t\t\t\t\t: deserializedChildren.elements.map(element => ({ element }))),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (processed.length === 0) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst containsBlock = processed.find(({ element }) => element !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: processed.flatMap(item => {\n\t\t\t\t\tif (item.text !== undefined) {\n\t\t\t\t\t\treturn item.isWhiteSpace ? [] : [this.createDefaultElement([item.text])]\n\t\t\t\t\t} else if (item.element !== undefined) {\n\t\t\t\t\t\treturn [item.element]\n\t\t\t\t\t}\n\t\t\t\t\t{\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: processed.map(item => item.text as SlateText) }\n\t\t}\n\t}\n\n\tdeserializeInline(list: NodeList | Node[], cumulativeTextAttrs: TextAttrs): Descendant[] {\n\t\treturn Array.from(list).flatMap(childNode => {\n\t\t\tconst result = this.deserializeTextNode(childNode, cumulativeTextAttrs)\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t} else {\n\t\t\t\tconst attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs)\n\t\t\t\treturn this.deserializeInline(childNode.childNodes, attrs)\n\t\t\t}\n\t\t})\n\t}\n\n\tdeserializeBlocks(list: Node[], cumulativeTextAttrs: TextAttrs): Descendant[] {\n\t\tconst result = this.processNodeListPaste(list, cumulativeTextAttrs)\n\t\treturn result?.texts ?? result?.elements ?? []\n\t}\n\n\n\tprivate deserializeTextNode(node: Node, cumulativeTextAttrs: TextAttrs): Descendant[] | null {\n\t\tif (node.nodeType === Node.TEXT_NODE) {\n\t\t\tconst text = node.textContent ?? ''\n\t\t\treturn [{ ...cumulativeTextAttrs, text: text.replace(/[ \\t]*(?:\\r?\\n[ \\t]*)+/g, ' ') }]\n\t\t} else if (node instanceof HTMLElement) {\n\t\t\tconst result = this.processInlinePaste(\n\t\t\t\tnode,\n\t\t\t\tcumulativeTextAttrs,\n\t\t\t)\n\t\t\tif (result !== null) {\n\t\t\t\treturn Array.isArray(result) ? result : [result]\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n\n\tprivate processInlinePaste(element: HTMLElement, cumulativeTextAttrs: TextAttrs): (SlateElement | SlateText)[] | SlateElement | SlateText | null {\n\t\tif (ignoredElements.includes(element.tagName)) {\n\t\t\treturn []\n\t\t}\n\t\tif (element.tagName === 'BR') {\n\t\t\treturn { ...cumulativeTextAttrs, text: ' ' }\n\t\t}\n\t\tconst next: HtmlDeserializerNextCallback = (list, cta) => {\n\t\t\tconst attrs = this.processWithAttributeProcessor(element, cta)\n\t\t\treturn this.deserializeInline(list, attrs)\n\t\t}\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processInlinePaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate processWithAttributeProcessor(element: Node, cumulativeTextAttrs: TextAttrs): TextAttrs {\n\t\tif (!(element instanceof HTMLElement)) {\n\t\t\treturn {}\n\t\t}\n\t\treturn this.plugins.reduce(\n\t\t\t(cta, plugin) => plugin.processAttributesPaste?.({ element, cumulativeTextAttrs, deserializer: this }) ?? cta,\n\t\t\tcumulativeTextAttrs,\n\t\t)\n\t}\n\n\tprivate processBlockPaste(element: HTMLElement, cumulativeTextAttrs: TextAttrs): SlateElement[] | SlateElement | null {\n\t\tif (ignoredElements.includes(element.tagName)) {\n\t\t\treturn []\n\t\t}\n\t\tconst next: HtmlDeserializerNextCallback = (list, cta) =>\n\t\t\tthis.deserializeBlocks(Array.from(list), { ...cumulativeTextAttrs, ...cta })\n\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processBlockPaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n"],"names":["result"],"mappings":";;AAIA,MAAM,kBAAkB,CAAC,UAAU,SAAS,UAAU;AAY/C,MAAM,iBAAiB;AAAA,EAC7B,YACQ,sBACC,SACP;AAFM,SAAA,uBAAA;AACC,SAAA,UAAA;AAAA,EAET;AAAA,EAEA,eAAe,QAAgC,UAAmB,MAAM;AAC7D,cAAA,KAAK,QAAQ,QAAQ,MAAM,IAAI,KAAK,QAAQ,KAAK,MAAM;AAAA,EAClE;AAAA,EAEO,qBAAqB,UAAkB,qBAAgC;AAClE,eAAA,UAAU,KAAK,SAAS;AAC5B,YAAA,SAAS,OAAO,uBAAuB,EAAE,UAAU,qBAAqB,cAAc,MAAM,KAAK;AACvG,UAAI,WAAW,MAAM;AACb,eAAA;AAAA,MACR;AAAA,IACD;AACA,UAAM,YAGA,CAAA;AAEN,eAAW,aAAa,UAAU;AAC3B,YAAA,eAAe,UAAU,aAAa,KAAK,aAAa,UAAU,aAAa,MAAM,OAAO,MAAM;AAGxG,YAAM,QAAQ,KAAK,8BAA8B,WAAW,mBAAmB;AACzE,YAAA,SACL,qBAAqB,cAClB,KAAK;AAAA,QACN;AAAA,QACA;AAAA,MAEC,IAAA;AACJ,UAAI,WAAW,MAAM;AACpB,kBAAU,KAAK,IAAI,MAAM,QAAQ,MAAM,IAAI,SAAS,CAAC,MAAM,GAAG,IAAI,CAAA,aAAY,EAAE,QAAA,EAAU,CAAC;AAAA,MAAA,OACrF;AAEN,cAAMA,UAAS,KAAK,oBAAoB,WAAW,mBAAmB;AACtE,YAAIA,YAAW,MAAM;AACV,oBAAA,KAAK,GAAGA,QAA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SAAS,qBAAqB,cAAc,KAAO,CAAA,KAAK;AAAA,MAC3G;AAAA,IAAA;AAAA,EAEF;AAAA,EAEQ,kBAAkB,SAAsB,qBAAsE;AACrH,QAAI,gBAAgB,SAAS,QAAQ,OAAO,GAAG;AAC9C,aAAO;IACR;AACA,UAAM,OAAqC,CAAC,MAAM,QACjD,KAAK,kBAAkB,MAAM,KAAK,IAAI,GAAG,EAAE,GAAG,qBAAqB,GAAG,IAAK,CAAA;AAEjE,eAAA,UAAU,KAAK,SAAS;AAC5B,YAAA,SAAS,OAAO,oBAAoB,EAAE,SAAS,MAAM,qBAAqB,cAAc,KAAM,CAAA,KAAK;AACzG,UAAI,WAAW,MAAM;AACb,eAAA;AAAA,MACR;AAAA,IACD;AACO,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"HtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/HtmlDeserializer.ts"],"sourcesContent":["import { Descendant, Element as SlateElement, Text as SlateText } from 'slate'\nimport { HtmlDeserializerNextCallback, HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../../types/editor'\n\nconst ignoredElements = ['SCRIPT', 'STYLE', 'TEMPLATE']\n\nexport interface TextAttrs {\n\t[key: string]: any\n}\n\nexport type NodesWithTypeFiltered =\n\t| { texts: Descendant[]; elements?: undefined }\n\t| { elements: SlateElement[]; texts?: undefined }\n\nexport type NodesWithType = NodesWithTypeFiltered | null\n\nexport class HtmlDeserializer {\n\tconstructor(\n\t\tpublic createDefaultElement: EditorDefaultElementFactory,\n\t\tprivate plugins: HtmlDeserializerPlugin[],\n\t) {\n\t}\n\n\tregisterPlugin(plugin: HtmlDeserializerPlugin, prepend: boolean = true) {\n\t\tprepend ? this.plugins.unshift(plugin) : this.plugins.push(plugin)\n\t}\n\n\tpublic processNodeListPaste(nodeList: Node[], cumulativeTextAttrs: TextAttrs) {\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processNodeListPaste?.({ nodeList, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\tconst processed: (\n\t\t\t| { text: SlateText | SlateElement; element?: undefined; isWhiteSpace: boolean }\n\t\t\t| { element: SlateElement; text?: undefined }\n\t\t)[] = []\n\n\t\tfor (const childNode of nodeList) {\n\t\t\tconst isWhiteSpace = childNode.nodeType === Node.TEXT_NODE && childNode.textContent?.match(/^\\s*$/) !== null\n\n\t\t\t// Block\n\t\t\tconst attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs)\n\t\t\tconst result =\n\t\t\t\tchildNode instanceof HTMLElement\n\t\t\t\t\t? this.processBlockPaste(\n\t\t\t\t\t\tchildNode,\n\t\t\t\t\t\tcumulativeTextAttrs,\n\t\t\t\t\t)\n\t\t\t\t\t: null\n\t\t\tif (result !== null) {\n\t\t\t\tprocessed.push(...(Array.isArray(result) ? result : [result]).map(element => ({ element })))\n\t\t\t} else {\n\t\t\t\t// Inline\n\t\t\t\tconst result = this.deserializeTextNode(childNode, cumulativeTextAttrs)\n\t\t\t\tif (result !== null) {\n\t\t\t\t\tprocessed.push(...result.map(text => ({ text, isWhiteSpace })))\n\t\t\t\t} else {\n\t\t\t\t\t// Unknown element\n\t\t\t\t\tconst deserializedChildren = this.processNodeListPaste(\n\t\t\t\t\t\tArray.from(childNode.childNodes),\n\t\t\t\t\t\tattrs,\n\t\t\t\t\t)\n\t\t\t\t\tprocessed.push(\n\t\t\t\t\t\t...(deserializedChildren === null\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: deserializedChildren.texts !== undefined\n\t\t\t\t\t\t\t\t? deserializedChildren.texts.map(text => ({ text, isWhiteSpace }))\n\t\t\t\t\t\t\t\t: deserializedChildren.elements.map(element => ({ element }))),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (processed.length === 0) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst containsBlock = processed.find(({ element }) => element !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: processed.flatMap(item => {\n\t\t\t\t\tif (item.text !== undefined) {\n\t\t\t\t\t\treturn item.isWhiteSpace ? [] : [this.createDefaultElement([item.text])]\n\t\t\t\t\t} else if (item.element !== undefined) {\n\t\t\t\t\t\treturn [item.element]\n\t\t\t\t\t}\n\t\t\t\t\t{\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: processed.map(item => item.text as SlateText) }\n\t\t}\n\t}\n\n\tdeserializeInline(list: NodeList | Node[], cumulativeTextAttrs: TextAttrs): Descendant[] {\n\t\treturn Array.from(list).flatMap(childNode => {\n\t\t\tconst result = this.deserializeTextNode(childNode, cumulativeTextAttrs)\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t} else {\n\t\t\t\tconst attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs)\n\t\t\t\treturn this.deserializeInline(childNode.childNodes, attrs)\n\t\t\t}\n\t\t})\n\t}\n\n\tdeserializeBlocks(list: Node[], cumulativeTextAttrs: TextAttrs): Descendant[] {\n\t\tconst result = this.processNodeListPaste(list, cumulativeTextAttrs)\n\t\treturn result?.texts ?? result?.elements ?? []\n\t}\n\n\n\tprivate deserializeTextNode(node: Node, cumulativeTextAttrs: TextAttrs): Descendant[] | null {\n\t\tif (node.nodeType === Node.TEXT_NODE) {\n\t\t\tconst text = node.textContent ?? ''\n\t\t\treturn [{ ...cumulativeTextAttrs, text: text.replace(/[ \\t]*(?:\\r?\\n[ \\t]*)+/g, ' ') }]\n\t\t} else if (node instanceof HTMLElement) {\n\t\t\tconst result = this.processInlinePaste(\n\t\t\t\tnode,\n\t\t\t\tcumulativeTextAttrs,\n\t\t\t)\n\t\t\tif (result !== null) {\n\t\t\t\treturn Array.isArray(result) ? result : [result]\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n\n\tprivate processInlinePaste(element: HTMLElement, cumulativeTextAttrs: TextAttrs): (SlateElement | SlateText)[] | SlateElement | SlateText | null {\n\t\tif (ignoredElements.includes(element.tagName)) {\n\t\t\treturn []\n\t\t}\n\t\tif (element.tagName === 'BR') {\n\t\t\treturn { ...cumulativeTextAttrs, text: ' ' }\n\t\t}\n\t\tconst next: HtmlDeserializerNextCallback = (list, cta) => {\n\t\t\tconst attrs = this.processWithAttributeProcessor(element, cta)\n\t\t\treturn this.deserializeInline(list, attrs)\n\t\t}\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processInlinePaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate processWithAttributeProcessor(element: Node, cumulativeTextAttrs: TextAttrs): TextAttrs {\n\t\tif (!(element instanceof HTMLElement)) {\n\t\t\treturn {}\n\t\t}\n\t\treturn this.plugins.reduce(\n\t\t\t(cta, plugin) => plugin.processAttributesPaste?.({ element, cumulativeTextAttrs, deserializer: this }) ?? cta,\n\t\t\tcumulativeTextAttrs,\n\t\t)\n\t}\n\n\tprivate processBlockPaste(element: HTMLElement, cumulativeTextAttrs: TextAttrs): SlateElement[] | SlateElement | null {\n\t\tif (ignoredElements.includes(element.tagName)) {\n\t\t\treturn []\n\t\t}\n\t\tconst next: HtmlDeserializerNextCallback = (list, cta) =>\n\t\t\tthis.deserializeBlocks(Array.from(list), { ...cumulativeTextAttrs, ...cta })\n\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processBlockPaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n"],"names":["result"],"mappings":";;AAIA,MAAM,kBAAkB,CAAC,UAAU,SAAS,UAAU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AK,IAAI,GAAG,EAAE,GAAG,qBAAqB,GAAG,KAAK;AAEjE,eAAA,UAAU,KAAK,SAAS;AAC5B,YAAA,SAAS,OAAO,oBAAoB,EAAE,SAAS,MAAM,qBAAqB,cAAc,KAAM,CAAA,KAAK;AACzG,UAAI,WAAW,MAAM;AACb,eAAA;AAAA,MAAA;AAAA,IACR;AAEM,WAAA;AAAA,EAAA;AAET;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/HtmlDeserializer.ts"],"sourcesContent":["import { Descendant, Element as SlateElement, Text as SlateText } from 'slate'\nimport { HtmlDeserializerNextCallback, HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../../types/editor'\n\nconst ignoredElements = ['SCRIPT', 'STYLE', 'TEMPLATE']\n\nexport interface TextAttrs {\n\t[key: string]: any\n}\n\nexport type NodesWithTypeFiltered =\n\t| { texts: Descendant[]; elements?: undefined }\n\t| { elements: SlateElement[]; texts?: undefined }\n\nexport type NodesWithType = NodesWithTypeFiltered | null\n\nexport class HtmlDeserializer {\n\tconstructor(\n\t\tpublic createDefaultElement: EditorDefaultElementFactory,\n\t\tprivate plugins: HtmlDeserializerPlugin[],\n\t) {\n\t}\n\n\tregisterPlugin(plugin: HtmlDeserializerPlugin, prepend: boolean = true) {\n\t\tprepend ? this.plugins.unshift(plugin) : this.plugins.push(plugin)\n\t}\n\n\tpublic processNodeListPaste(nodeList: Node[], cumulativeTextAttrs: TextAttrs) {\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processNodeListPaste?.({ nodeList, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\tconst processed: (\n\t\t\t| { text: SlateText | SlateElement; element?: undefined; isWhiteSpace: boolean }\n\t\t\t| { element: SlateElement; text?: undefined }\n\t\t)[] = []\n\n\t\tfor (const childNode of nodeList) {\n\t\t\tconst isWhiteSpace = childNode.nodeType === Node.TEXT_NODE && childNode.textContent?.match(/^\\s*$/) !== null\n\n\t\t\t// Block\n\t\t\tconst attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs)\n\t\t\tconst result =\n\t\t\t\tchildNode instanceof HTMLElement\n\t\t\t\t\t? this.processBlockPaste(\n\t\t\t\t\t\tchildNode,\n\t\t\t\t\t\tcumulativeTextAttrs,\n\t\t\t\t\t)\n\t\t\t\t\t: null\n\t\t\tif (result !== null) {\n\t\t\t\tprocessed.push(...(Array.isArray(result) ? result : [result]).map(element => ({ element })))\n\t\t\t} else {\n\t\t\t\t// Inline\n\t\t\t\tconst result = this.deserializeTextNode(childNode, cumulativeTextAttrs)\n\t\t\t\tif (result !== null) {\n\t\t\t\t\tprocessed.push(...result.map(text => ({ text, isWhiteSpace })))\n\t\t\t\t} else {\n\t\t\t\t\t// Unknown element\n\t\t\t\t\tconst deserializedChildren = this.processNodeListPaste(\n\t\t\t\t\t\tArray.from(childNode.childNodes),\n\t\t\t\t\t\tattrs,\n\t\t\t\t\t)\n\t\t\t\t\tprocessed.push(\n\t\t\t\t\t\t...(deserializedChildren === null\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: deserializedChildren.texts !== undefined\n\t\t\t\t\t\t\t\t? deserializedChildren.texts.map(text => ({ text, isWhiteSpace }))\n\t\t\t\t\t\t\t\t: deserializedChildren.elements.map(element => ({ element }))),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (processed.length === 0) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst containsBlock = processed.find(({ element }) => element !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: processed.flatMap(item => {\n\t\t\t\t\tif (item.text !== undefined) {\n\t\t\t\t\t\treturn item.isWhiteSpace ? [] : [this.createDefaultElement([item.text])]\n\t\t\t\t\t} else if (item.element !== undefined) {\n\t\t\t\t\t\treturn [item.element]\n\t\t\t\t\t}\n\t\t\t\t\t{\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: processed.map(item => item.text as SlateText) }\n\t\t}\n\t}\n\n\tdeserializeInline(list: NodeList | Node[], cumulativeTextAttrs: TextAttrs): Descendant[] {\n\t\treturn Array.from(list).flatMap(childNode => {\n\t\t\tconst result = this.deserializeTextNode(childNode, cumulativeTextAttrs)\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t} else {\n\t\t\t\tconst attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs)\n\t\t\t\treturn this.deserializeInline(childNode.childNodes, attrs)\n\t\t\t}\n\t\t})\n\t}\n\n\tdeserializeBlocks(list: Node[], cumulativeTextAttrs: TextAttrs): Descendant[] {\n\t\tconst result = this.processNodeListPaste(list, cumulativeTextAttrs)\n\t\treturn result?.texts ?? result?.elements ?? []\n\t}\n\n\n\tprivate deserializeTextNode(node: Node, cumulativeTextAttrs: TextAttrs): Descendant[] | null {\n\t\tif (node.nodeType === Node.TEXT_NODE) {\n\t\t\tconst text = node.textContent ?? ''\n\t\t\treturn [{ ...cumulativeTextAttrs, text: text.replace(/[ \\t]*(?:\\r?\\n[ \\t]*)+/g, ' ') }]\n\t\t} else if (node instanceof HTMLElement) {\n\t\t\tconst result = this.processInlinePaste(\n\t\t\t\tnode,\n\t\t\t\tcumulativeTextAttrs,\n\t\t\t)\n\t\t\tif (result !== null) {\n\t\t\t\treturn Array.isArray(result) ? result : [result]\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n\n\tprivate processInlinePaste(element: HTMLElement, cumulativeTextAttrs: TextAttrs): (SlateElement | SlateText)[] | SlateElement | SlateText | null {\n\t\tif (ignoredElements.includes(element.tagName)) {\n\t\t\treturn []\n\t\t}\n\t\tif (element.tagName === 'BR') {\n\t\t\treturn { ...cumulativeTextAttrs, text: ' ' }\n\t\t}\n\t\tconst next: HtmlDeserializerNextCallback = (list, cta) => {\n\t\t\tconst attrs = this.processWithAttributeProcessor(element, cta)\n\t\t\treturn this.deserializeInline(list, attrs)\n\t\t}\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processInlinePaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate processWithAttributeProcessor(element: Node, cumulativeTextAttrs: TextAttrs): TextAttrs {\n\t\tif (!(element instanceof HTMLElement)) {\n\t\t\treturn {}\n\t\t}\n\t\treturn this.plugins.reduce(\n\t\t\t(cta, plugin) => plugin.processAttributesPaste?.({ element, cumulativeTextAttrs, deserializer: this }) ?? cta,\n\t\t\tcumulativeTextAttrs,\n\t\t)\n\t}\n\n\tprivate processBlockPaste(element: HTMLElement, cumulativeTextAttrs: TextAttrs): SlateElement[] | SlateElement | null {\n\t\tif (ignoredElements.includes(element.tagName)) {\n\t\t\treturn []\n\t\t}\n\t\tconst next: HtmlDeserializerNextCallback = (list, cta) =>\n\t\t\tthis.deserializeBlocks(Array.from(list), { ...cumulativeTextAttrs, ...cta })\n\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processBlockPaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n"],"names":["result"],"mappings":"AAIA,MAAM,kBAAkB,CAAC,UAAU,SAAS,UAAU;AAY/C,MAAM,iBAAiB;AAAA,EAC7B,YACQ,sBACC,SACP;AAFM,SAAA,uBAAA;AACC,SAAA,UAAA;AAAA,EAET;AAAA,EAEA,eAAe,QAAgC,UAAmB,MAAM;AAC7D,cAAA,KAAK,QAAQ,QAAQ,MAAM,IAAI,KAAK,QAAQ,KAAK,MAAM;AAAA,EAClE;AAAA,E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packages/react-slate-editor-base/src/plugins/behaviour/paste/HtmlDeserializer.ts"],"sourcesContent":["import { Descendant, Element as SlateElement, Text as SlateText } from 'slate'\nimport { HtmlDeserializerNextCallback, HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../../types/editor'\n\nconst ignoredElements = ['SCRIPT', 'STYLE', 'TEMPLATE']\n\nexport interface TextAttrs {\n\t[key: string]: any\n}\n\nexport type NodesWithTypeFiltered =\n\t| { texts: Descendant[]; elements?: undefined }\n\t| { elements: SlateElement[]; texts?: undefined }\n\nexport type NodesWithType = NodesWithTypeFiltered | null\n\nexport class HtmlDeserializer {\n\tconstructor(\n\t\tpublic createDefaultElement: EditorDefaultElementFactory,\n\t\tprivate plugins: HtmlDeserializerPlugin[],\n\t) {\n\t}\n\n\tregisterPlugin(plugin: HtmlDeserializerPlugin, prepend: boolean = true) {\n\t\tprepend ? this.plugins.unshift(plugin) : this.plugins.push(plugin)\n\t}\n\n\tpublic processNodeListPaste(nodeList: Node[], cumulativeTextAttrs: TextAttrs) {\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processNodeListPaste?.({ nodeList, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\tconst processed: (\n\t\t\t| { text: SlateText | SlateElement; element?: undefined; isWhiteSpace: boolean }\n\t\t\t| { element: SlateElement; text?: undefined }\n\t\t)[] = []\n\n\t\tfor (const childNode of nodeList) {\n\t\t\tconst isWhiteSpace = childNode.nodeType === Node.TEXT_NODE && childNode.textContent?.match(/^\\s*$/) !== null\n\n\t\t\t// Block\n\t\t\tconst attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs)\n\t\t\tconst result =\n\t\t\t\tchildNode instanceof HTMLElement\n\t\t\t\t\t? this.processBlockPaste(\n\t\t\t\t\t\tchildNode,\n\t\t\t\t\t\tcumulativeTextAttrs,\n\t\t\t\t\t)\n\t\t\t\t\t: null\n\t\t\tif (result !== null) {\n\t\t\t\tprocessed.push(...(Array.isArray(result) ? result : [result]).map(element => ({ element })))\n\t\t\t} else {\n\t\t\t\t// Inline\n\t\t\t\tconst result = this.deserializeTextNode(childNode, cumulativeTextAttrs)\n\t\t\t\tif (result !== null) {\n\t\t\t\t\tprocessed.push(...result.map(text => ({ text, isWhiteSpace })))\n\t\t\t\t} else {\n\t\t\t\t\t// Unknown element\n\t\t\t\t\tconst deserializedChildren = this.processNodeListPaste(\n\t\t\t\t\t\tArray.from(childNode.childNodes),\n\t\t\t\t\t\tattrs,\n\t\t\t\t\t)\n\t\t\t\t\tprocessed.push(\n\t\t\t\t\t\t...(deserializedChildren === null\n\t\t\t\t\t\t\t? []\n\t\t\t\t\t\t\t: deserializedChildren.texts !== undefined\n\t\t\t\t\t\t\t\t? deserializedChildren.texts.map(text => ({ text, isWhiteSpace }))\n\t\t\t\t\t\t\t\t: deserializedChildren.elements.map(element => ({ element }))),\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (processed.length === 0) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst containsBlock = processed.find(({ element }) => element !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: processed.flatMap(item => {\n\t\t\t\t\tif (item.text !== undefined) {\n\t\t\t\t\t\treturn item.isWhiteSpace ? [] : [this.createDefaultElement([item.text])]\n\t\t\t\t\t} else if (item.element !== undefined) {\n\t\t\t\t\t\treturn [item.element]\n\t\t\t\t\t}\n\t\t\t\t\t{\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: processed.map(item => item.text as SlateText) }\n\t\t}\n\t}\n\n\tdeserializeInline(list: NodeList | Node[], cumulativeTextAttrs: TextAttrs): Descendant[] {\n\t\treturn Array.from(list).flatMap(childNode => {\n\t\t\tconst result = this.deserializeTextNode(childNode, cumulativeTextAttrs)\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t} else {\n\t\t\t\tconst attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs)\n\t\t\t\treturn this.deserializeInline(childNode.childNodes, attrs)\n\t\t\t}\n\t\t})\n\t}\n\n\tdeserializeBlocks(list: Node[], cumulativeTextAttrs: TextAttrs): Descendant[] {\n\t\tconst result = this.processNodeListPaste(list, cumulativeTextAttrs)\n\t\treturn result?.texts ?? result?.elements ?? []\n\t}\n\n\n\tprivate deserializeTextNode(node: Node, cumulativeTextAttrs: TextAttrs): Descendant[] | null {\n\t\tif (node.nodeType === Node.TEXT_NODE) {\n\t\t\tconst text = node.textContent ?? ''\n\t\t\treturn [{ ...cumulativeTextAttrs, text: text.replace(/[ \\t]*(?:\\r?\\n[ \\t]*)+/g, ' ') }]\n\t\t} else if (node instanceof HTMLElement) {\n\t\t\tconst result = this.processInlinePaste(\n\t\t\t\tnode,\n\t\t\t\tcumulativeTextAttrs,\n\t\t\t)\n\t\t\tif (result !== null) {\n\t\t\t\treturn Array.isArray(result) ? result : [result]\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n\n\tprivate processInlinePaste(element: HTMLElement, cumulativeTextAttrs: TextAttrs): (SlateElement | SlateText)[] | SlateElement | SlateText | null {\n\t\tif (ignoredElements.includes(element.tagName)) {\n\t\t\treturn []\n\t\t}\n\t\tif (element.tagName === 'BR') {\n\t\t\treturn { ...cumulativeTextAttrs, text: ' ' }\n\t\t}\n\t\tconst next: HtmlDeserializerNextCallback = (list, cta) => {\n\t\t\tconst attrs = this.processWithAttributeProcessor(element, cta)\n\t\t\treturn this.deserializeInline(list, attrs)\n\t\t}\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processInlinePaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n\n\tprivate processWithAttributeProcessor(element: Node, cumulativeTextAttrs: TextAttrs): TextAttrs {\n\t\tif (!(element instanceof HTMLElement)) {\n\t\t\treturn {}\n\t\t}\n\t\treturn this.plugins.reduce(\n\t\t\t(cta, plugin) => plugin.processAttributesPaste?.({ element, cumulativeTextAttrs, deserializer: this }) ?? cta,\n\t\t\tcumulativeTextAttrs,\n\t\t)\n\t}\n\n\tprivate processBlockPaste(element: HTMLElement, cumulativeTextAttrs: TextAttrs): SlateElement[] | SlateElement | null {\n\t\tif (ignoredElements.includes(element.tagName)) {\n\t\t\treturn []\n\t\t}\n\t\tconst next: HtmlDeserializerNextCallback = (list, cta) =>\n\t\t\tthis.deserializeBlocks(Array.from(list), { ...cumulativeTextAttrs, ...cta })\n\n\t\tfor (const plugin of this.plugins) {\n\t\t\tconst result = plugin.processBlockPaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null\n\t\t\tif (result !== null) {\n\t\t\t\treturn result\n\t\t\t}\n\t\t}\n\t\treturn null\n\t}\n}\n"],"names":["result"],"mappings":"AAIA,MAAM,kBAAkB,CAAC,UAAU,SAAS,UAAU;AAY/C,MAAM,iBAAiB;AAAA,EAC7B,YACQ,sBACC,SACP;AAFM,SAAA,uBAAA;AACC,SAAA,UAAA;AAAA,EAAA;AAAA,EAIT,eAAe,QAAgC,UAAmB,MAAM;AAC7D,cAAA,KAAK,QAAQ,QAAQ,MAAM,IAAI,KAAK,QAAQ,KAAK,MAAM;AAAA,EAAA;AAAA,EAG3D,qBAAqB,UAAkB,qBAAgC;AAClE,eAAA,UAAU,KAAK,SAAS;AAC5B,YAAA,SAAS,OAAO,uBAAuB,EAAE,UAAU,qBAAqB,cAAc,KAAM,CAAA,KAAK;AACvG,UAAI,WAAW,MAAM;AACb,eAAA;AAAA,MAAA;AAAA,IACR;AAED,UAAM,YAGA,CAAC;AAEP,eAAW,aAAa,UAAU;AAC3B,YAAA,eAAe,UAAU,aAAa,KAAK,aAAa,UAAU,aAAa,MAAM,OAAO,M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K,8BAA8B,SAAS,GAAG;AACtD,aAAA,KAAK,kBAAkB,MAAM,KAAK;AAAA,IAC1C;AACW,eAAA,UAAU,KAAK,SAAS;AAC5B,YAAA,SAAS,OAAO,qBAAqB,EAAE,SAAS,MAAM,qBAAqB,cAAc,KAAM,CAAA,KAAK;AAC1G,UAAI,WAAW,MAAM;AACb,eAAA;AAAA,MAAA;AAAA,IACR;AAEM,WAAA;AAAA,EAAA;AAAA,EAGA,8BAA8B,SAAe,qBAA2C;AAC3F,QAAA,EAAE,mBAAmB,cAAc;AACtC,aAAO,CAAC;AAAA,IAAA;AAET,WAAO,KAAK,QAAQ;AAAA,MACnB,CAAC,KAAK,WAAW,OAAO,yBAAyB,EAAE,SAAS,qBAAqB,cAAc,KAAO,CAAA,KAAK;AAAA,MAC3G;AAAA,IACD;AAAA,EAAA;AAAA,EAGO,kBAAkB,SAAsB,qBAAsE;AACrH,QAAI,gBAAgB,SAAS,QAAQ,OAAO,GAAG;AAC9C,aAAO,CAAC;AAAA,IAAA;AAET,UAAM,OAAqC,CAAC,MAAM,QACjD,KAAK,kBAAkB,MAAM,KAAK,IAAI,GAAG,EAAE,GAAG,qBAAqB,GAAG,KAAK;AAEjE,eAAA,UAAU,KAAK,SAAS;AAC5B,YAAA,SAAS,OAAO,oBAAoB,EAAE,SAAS,MAAM,qBAAqB,cAAc,KAAM,CAAA,KAAK;AACzG,UAAI,WAAW,MAAM;AACb,eAAA;AAAA,MAAA;AAAA,IACR;AAEM,WAAA;AAAA,EAAA;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createMarkHtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\n\nexport const createMarkHtmlDeserializer = (markType: string, tagMatcher: (el: HTMLElement) => boolean, attributeMatcher: (el: HTMLElement) => boolean): HtmlDeserializerPlugin => ({\n\tprocessAttributesPaste: ({ element, cumulativeTextAttrs: cta }) => {\n\t\treturn attributeMatcher(element) ? { ...cta, [markType]: true } : cta\n\t},\n\tprocessInlinePaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (tagMatcher(element)) {\n\t\t\treturn next(element.childNodes, { ...cumulativeTextAttrs, [markType]: true })\n\t\t}\n\t\treturn null\n\t},\n})\n"],"names":[],"mappings":";;AAEO,MAAM,6BAA6B,CAAC,UAAkB,YAA0C,sBAA4E;AAAA,EAClL,wBAAwB,CAAC,EAAE,SAAS,qBAAqB,UAAU;AAC3D,WAAA,iBAAiB,OAAO,IAAI,EAAE,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAS,IAAA;AAAA,EACnE;AAAA,EACA,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC3D,QAAA,WAAW,OAAO,GAAG;AACjB,aAAA,KAAK,QAAQ,YAAY,EAAE,GAAG,qBAAqB,CAAC,QAAQ,GAAG,KAAA,CAAM;AAAA,IAC7E;AACO,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"createMarkHtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\n\nexport const createMarkHtmlDeserializer = (markType: string, tagMatcher: (el: HTMLElement) => boolean, attributeMatcher: (el: HTMLElement) => boolean): HtmlDeserializerPlugin => ({\n\tprocessAttributesPaste: ({ element, cumulativeTextAttrs: cta }) => {\n\t\treturn attributeMatcher(element) ? { ...cta, [markType]: true } : cta\n\t},\n\tprocessInlinePaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (tagMatcher(element)) {\n\t\t\treturn next(element.childNodes, { ...cumulativeTextAttrs, [markType]: true })\n\t\t}\n\t\treturn null\n\t},\n})\n"],"names":[],"mappings":";;AAEO,MAAM,6BAA6B,CAAC,UAAkB,YAA0C,sBAA4E;AAAA,EAClL,wBAAwB,CAAC,EAAE,SAAS,qBAAqB,UAAU;AAC3D,WAAA,iBAAiB,OAAO,IAAI,EAAE,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAA,IAAS;AAAA,EACnE;AAAA,EACA,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC3D,QAAA,WAAW,OAAO,GAAG;AACjB,aAAA,KAAK,QAAQ,YAAY,EAAE,GAAG,qBAAqB,CAAC,QAAQ,GAAG,MAAM;AAAA,IAAA;AAEtE,WAAA;AAAA,EAAA;AAET;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createMarkHtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\n\nexport const createMarkHtmlDeserializer = (markType: string, tagMatcher: (el: HTMLElement) => boolean, attributeMatcher: (el: HTMLElement) => boolean): HtmlDeserializerPlugin => ({\n\tprocessAttributesPaste: ({ element, cumulativeTextAttrs: cta }) => {\n\t\treturn attributeMatcher(element) ? { ...cta, [markType]: true } : cta\n\t},\n\tprocessInlinePaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (tagMatcher(element)) {\n\t\t\treturn next(element.childNodes, { ...cumulativeTextAttrs, [markType]: true })\n\t\t}\n\t\treturn null\n\t},\n})\n"],"names":[],"mappings":"AAEO,MAAM,6BAA6B,CAAC,UAAkB,YAA0C,sBAA4E;AAAA,EAClL,wBAAwB,CAAC,EAAE,SAAS,qBAAqB,UAAU;AAC3D,WAAA,iBAAiB,OAAO,IAAI,EAAE,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAS,IAAA;AAAA,EACnE;AAAA,EACA,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC3D,QAAA,WAAW,OAAO,GAAG;AACjB,aAAA,KAAK,QAAQ,YAAY,EAAE,GAAG,qBAAqB,CAAC,QAAQ,GAAG,KAAA,CAAM;AAAA,IAC7E;AACO,WAAA;AAAA,EACR;AACD;"}
1
+ {"version":3,"file":"createMarkHtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\n\nexport const createMarkHtmlDeserializer = (markType: string, tagMatcher: (el: HTMLElement) => boolean, attributeMatcher: (el: HTMLElement) => boolean): HtmlDeserializerPlugin => ({\n\tprocessAttributesPaste: ({ element, cumulativeTextAttrs: cta }) => {\n\t\treturn attributeMatcher(element) ? { ...cta, [markType]: true } : cta\n\t},\n\tprocessInlinePaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (tagMatcher(element)) {\n\t\t\treturn next(element.childNodes, { ...cumulativeTextAttrs, [markType]: true })\n\t\t}\n\t\treturn null\n\t},\n})\n"],"names":[],"mappings":"AAEO,MAAM,6BAA6B,CAAC,UAAkB,YAA0C,sBAA4E;AAAA,EAClL,wBAAwB,CAAC,EAAE,SAAS,qBAAqB,UAAU;AAC3D,WAAA,iBAAiB,OAAO,IAAI,EAAE,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAA,IAAS;AAAA,EACnE;AAAA,EACA,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC3D,QAAA,WAAW,OAAO,GAAG;AACjB,aAAA,KAAK,QAAQ,YAAY,EAAE,GAAG,qBAAqB,CAAC,QAAQ,GAAG,MAAM;AAAA,IAAA;AAEtE,WAAA;AAAA,EAAA;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withPaste.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/withPaste.ts"],"sourcesContent":["import { Editor, Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types/plugins'\nimport { HtmlDeserializer } from './HtmlDeserializer'\nimport { HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\n\n\nexport const withPaste = (editor: Editor) => {\n\tconst { insertData } = editor\n\tconst htmlDeserializer = new HtmlDeserializer(editor.createDefaultElement, [])\n\teditor.insertData = data => {\n\t\tif (data.getData('application/x-slate-fragment')) {\n\t\t\treturn insertData(data)\n\t\t}\n\t\tconst html = data.getData('text/html')\n\t\tif (!html) {\n\t\t\treturn insertData(data)\n\t\t}\n\t\tconst document = new DOMParser().parseFromString(html, 'text/html')\n\t\tconst nodes = Array.from(document.body.childNodes)\n\t\tconst result = htmlDeserializer.deserializeBlocks(nodes, {})\n\t\tTransforms.insertFragment(editor, result)\n\t}\n\teditor.htmlDeserializer = htmlDeserializer\n}\n"],"names":["HtmlDeserializer","Transforms"],"mappings":";;;;AAMa,MAAA,YAAY,CAAC,WAAmB;AACtC,QAAA,EAAE,WAAe,IAAA;AACvB,QAAM,mBAAmB,IAAIA,iBAAA,iBAAiB,OAAO,sBAAsB,CAAE,CAAA;AAC7E,SAAO,aAAa,CAAQ,SAAA;AACvB,QAAA,KAAK,QAAQ,8BAA8B,GAAG;AACjD,aAAO,WAAW,IAAI;AAAA,IACvB;AACM,UAAA,OAAO,KAAK,QAAQ,WAAW;AACrC,QAAI,CAAC,MAAM;AACV,aAAO,WAAW,IAAI;AAAA,IACvB;AACA,UAAM,WAAW,IAAI,UAAA,EAAY,gBAAgB,MAAM,WAAW;AAClE,UAAM,QAAQ,MAAM,KAAK,SAAS,KAAK,UAAU;AACjD,UAAM,SAAS,iBAAiB,kBAAkB,OAAO,CAAE,CAAA;AAChDC,UAAAA,WAAA,eAAe,QAAQ,MAAM;AAAA,EAAA;AAEzC,SAAO,mBAAmB;AAC3B;;"}
1
+ {"version":3,"file":"withPaste.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/withPaste.ts"],"sourcesContent":["import { Editor, Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types/plugins'\nimport { HtmlDeserializer } from './HtmlDeserializer'\nimport { HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\n\n\nexport const withPaste = (editor: Editor) => {\n\tconst { insertData } = editor\n\tconst htmlDeserializer = new HtmlDeserializer(editor.createDefaultElement, [])\n\teditor.insertData = data => {\n\t\tif (data.getData('application/x-slate-fragment')) {\n\t\t\treturn insertData(data)\n\t\t}\n\t\tconst html = data.getData('text/html')\n\t\tif (!html) {\n\t\t\treturn insertData(data)\n\t\t}\n\t\tconst document = new DOMParser().parseFromString(html, 'text/html')\n\t\tconst nodes = Array.from(document.body.childNodes)\n\t\tconst result = htmlDeserializer.deserializeBlocks(nodes, {})\n\t\tTransforms.insertFragment(editor, result)\n\t}\n\teditor.htmlDeserializer = htmlDeserializer\n}\n"],"names":["HtmlDeserializer","Transforms"],"mappings":";;;;AAMa,MAAA,YAAY,CAAC,WAAmB;AACtC,QAAA,EAAE,eAAe;AACvB,QAAM,mBAAmB,IAAIA,iBAAAA,iBAAiB,OAAO,sBAAsB,CAAA,CAAE;AAC7E,SAAO,aAAa,CAAQ,SAAA;AACvB,QAAA,KAAK,QAAQ,8BAA8B,GAAG;AACjD,aAAO,WAAW,IAAI;AAAA,IAAA;AAEjB,UAAA,OAAO,KAAK,QAAQ,WAAW;AACrC,QAAI,CAAC,MAAM;AACV,aAAO,WAAW,IAAI;AAAA,IAAA;AAEvB,UAAM,WAAW,IAAI,UAAA,EAAY,gBAAgB,MAAM,WAAW;AAClE,UAAM,QAAQ,MAAM,KAAK,SAAS,KAAK,UAAU;AACjD,UAAM,SAAS,iBAAiB,kBAAkB,OAAO,CAAA,CAAE;AAChDC,qBAAA,eAAe,QAAQ,MAAM;AAAA,EACzC;AACA,SAAO,mBAAmB;AAC3B;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withPaste.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/withPaste.ts"],"sourcesContent":["import { Editor, Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types/plugins'\nimport { HtmlDeserializer } from './HtmlDeserializer'\nimport { HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\n\n\nexport const withPaste = (editor: Editor) => {\n\tconst { insertData } = editor\n\tconst htmlDeserializer = new HtmlDeserializer(editor.createDefaultElement, [])\n\teditor.insertData = data => {\n\t\tif (data.getData('application/x-slate-fragment')) {\n\t\t\treturn insertData(data)\n\t\t}\n\t\tconst html = data.getData('text/html')\n\t\tif (!html) {\n\t\t\treturn insertData(data)\n\t\t}\n\t\tconst document = new DOMParser().parseFromString(html, 'text/html')\n\t\tconst nodes = Array.from(document.body.childNodes)\n\t\tconst result = htmlDeserializer.deserializeBlocks(nodes, {})\n\t\tTransforms.insertFragment(editor, result)\n\t}\n\teditor.htmlDeserializer = htmlDeserializer\n}\n"],"names":[],"mappings":";;AAMa,MAAA,YAAY,CAAC,WAAmB;AACtC,QAAA,EAAE,WAAe,IAAA;AACvB,QAAM,mBAAmB,IAAI,iBAAiB,OAAO,sBAAsB,CAAE,CAAA;AAC7E,SAAO,aAAa,CAAQ,SAAA;AACvB,QAAA,KAAK,QAAQ,8BAA8B,GAAG;AACjD,aAAO,WAAW,IAAI;AAAA,IACvB;AACM,UAAA,OAAO,KAAK,QAAQ,WAAW;AACrC,QAAI,CAAC,MAAM;AACV,aAAO,WAAW,IAAI;AAAA,IACvB;AACA,UAAM,WAAW,IAAI,UAAA,EAAY,gBAAgB,MAAM,WAAW;AAClE,UAAM,QAAQ,MAAM,KAAK,SAAS,KAAK,UAAU;AACjD,UAAM,SAAS,iBAAiB,kBAAkB,OAAO,CAAE,CAAA;AAChD,eAAA,eAAe,QAAQ,MAAM;AAAA,EAAA;AAEzC,SAAO,mBAAmB;AAC3B;"}
1
+ {"version":3,"file":"withPaste.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/behaviour/paste/withPaste.ts"],"sourcesContent":["import { Editor, Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types/plugins'\nimport { HtmlDeserializer } from './HtmlDeserializer'\nimport { HtmlDeserializerPlugin } from '../../../types/htmlDeserializer'\n\n\nexport const withPaste = (editor: Editor) => {\n\tconst { insertData } = editor\n\tconst htmlDeserializer = new HtmlDeserializer(editor.createDefaultElement, [])\n\teditor.insertData = data => {\n\t\tif (data.getData('application/x-slate-fragment')) {\n\t\t\treturn insertData(data)\n\t\t}\n\t\tconst html = data.getData('text/html')\n\t\tif (!html) {\n\t\t\treturn insertData(data)\n\t\t}\n\t\tconst document = new DOMParser().parseFromString(html, 'text/html')\n\t\tconst nodes = Array.from(document.body.childNodes)\n\t\tconst result = htmlDeserializer.deserializeBlocks(nodes, {})\n\t\tTransforms.insertFragment(editor, result)\n\t}\n\teditor.htmlDeserializer = htmlDeserializer\n}\n"],"names":[],"mappings":";;AAMa,MAAA,YAAY,CAAC,WAAmB;AACtC,QAAA,EAAE,eAAe;AACvB,QAAM,mBAAmB,IAAI,iBAAiB,OAAO,sBAAsB,CAAA,CAAE;AAC7E,SAAO,aAAa,CAAQ,SAAA;AACvB,QAAA,KAAK,QAAQ,8BAA8B,GAAG;AACjD,aAAO,WAAW,IAAI;AAAA,IAAA;AAEjB,UAAA,OAAO,KAAK,QAAQ,WAAW;AACrC,QAAI,CAAC,MAAM;AACV,aAAO,WAAW,IAAI;AAAA,IAAA;AAEvB,UAAM,WAAW,IAAI,UAAA,EAAY,gBAAgB,MAAM,WAAW;AAClE,UAAM,QAAQ,MAAM,KAAK,SAAS,KAAK,UAAU;AACjD,UAAM,SAAS,iBAAiB,kBAAkB,OAAO,CAAA,CAAE;AAChD,eAAA,eAAe,QAAQ,MAAM;AAAA,EACzC;AACA,SAAO,mBAAmB;AAC3B;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnchorElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Element as SlateElement, Node as SlateNode, Path, Range as SlateRange, Transforms } from 'slate'\nimport { AnchorModifications } from './AnchorModifications'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const anchorElementType = 'anchor' as const\n\nexport interface AnchorElement extends SlateElement {\n\ttype: typeof anchorElementType\n\thref: string\n\tchildren: SlateEditor['children']\n}\n\nexport const isAnchorElement = (element: SlateNode): element is AnchorElement => SlateElement.isElement(element) && element.type === anchorElementType\n\nexport const isAnchorElementActive = (editor: Editor) => {\n\tconst [link] = Editor.nodes(editor, { match: isAnchorElement })\n\treturn !!link\n}\n\n\nexport const anchorElementPlugin = ({ render }: { render: ElementRenderer<AnchorElement> }): EditorElementPlugin<AnchorElement> => ({\n\ttype: anchorElementType,\n\tisInline: true,\n\trender,\n\tisActive: ({ editor }) => isAnchorElementActive(editor),\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tif (isAnchorElementActive(editor)) {\n\t\t\tAnchorModifications.unwrapAnchor(editor)\n\t\t} else {\n\t\t\tconst href = suchThat?.href ?? prompt('Insert the URL:')\n\t\t\tif (!href) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tAnchorModifications.wrapAnchor(editor, href)\n\t\t}\n\t},\n\tnormalizeNode: ({ element, path, editor, preventDefault }) => {\n\t\tif (SlateNode.string(element) === '') {\n\t\t\tconst selection = editor.selection\n\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\tat: path,\n\t\t\t})\n\t\t\tif (selection && SlateRange.isCollapsed(selection) && Path.isCommon(path, selection.focus.path)) {\n\t\t\t\tTransforms.select(editor, Path.parent(path))\n\t\t\t}\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n})\n"],"names":["SlateElement","Editor","AnchorModifications","SlateNode","Transforms","SlateRange","Path"],"mappings":";;;;AAIO,MAAM,oBAAoB;AAQpB,MAAA,kBAAkB,CAAC,YAAiDA,cAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAExH,MAAA,wBAAwB,CAAC,WAAmB;AAClD,QAAA,CAAC,IAAI,IAAIC,aAAO,MAAM,QAAQ,EAAE,OAAO,gBAAA,CAAiB;AAC9D,SAAO,CAAC,CAAC;AACV;AAGO,MAAM,sBAAsB,CAAC,EAAE,cAA8F;AAAA,EACnI,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,UAAU,CAAC,EAAE,aAAa,sBAAsB,MAAM;AAAA,EACtD,eAAe,CAAC,EAAE,QAAQ,eAAe;AACpC,QAAA,sBAAsB,MAAM,GAAG;AAClCC,8CAAoB,aAAa,MAAM;AAAA,IAAA,OACjC;AACN,YAAM,OAAO,UAAU,QAAQ,OAAO,iBAAiB;AACvD,UAAI,CAAC,MAAM;AACV;AAAA,MACD;AACoBA,0BAAAA,oBAAA,WAAW,QAAQ,IAAI;AAAA,IAC5C;AAAA,EACD;AAAA,EACA,eAAe,CAAC,EAAE,SAAS,MAAM,QAAQ,qBAAqB;AAC7D,QAAIC,WAAU,OAAO,OAAO,MAAM,IAAI;AACrC,YAAM,YAAY,OAAO;AACzBC,YAAA,WAAW,YAAY,QAAQ;AAAA,QAC9B,IAAI;AAAA,MAAA,CACJ;AACG,UAAA,aAAaC,MAAAA,MAAW,YAAY,SAAS,KAAKC,MAAAA,KAAK,SAAS,MAAM,UAAU,MAAM,IAAI,GAAG;AAChGF,cAAA,WAAW,OAAO,QAAQE,MAAK,KAAA,OAAO,IAAI,CAAC;AAAA,MAC5C;AACA,aAAO,eAAe;AAAA,IACvB;AAAA,EACD;AACD;;;;;"}
1
+ {"version":3,"file":"AnchorElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Element as SlateElement, Node as SlateNode, Path, Range as SlateRange, Transforms } from 'slate'\nimport { AnchorModifications } from './AnchorModifications'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const anchorElementType = 'anchor' as const\n\nexport interface AnchorElement extends SlateElement {\n\ttype: typeof anchorElementType\n\thref: string\n\tchildren: SlateEditor['children']\n}\n\nexport const isAnchorElement = (element: SlateNode): element is AnchorElement => SlateElement.isElement(element) && element.type === anchorElementType\n\nexport const isAnchorElementActive = (editor: Editor) => {\n\tconst [link] = Editor.nodes(editor, { match: isAnchorElement })\n\treturn !!link\n}\n\n\nexport const anchorElementPlugin = ({ render }: { render: ElementRenderer<AnchorElement> }): EditorElementPlugin<AnchorElement> => ({\n\ttype: anchorElementType,\n\tisInline: true,\n\trender,\n\tisActive: ({ editor }) => isAnchorElementActive(editor),\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tif (isAnchorElementActive(editor)) {\n\t\t\tAnchorModifications.unwrapAnchor(editor)\n\t\t} else {\n\t\t\tconst href = suchThat?.href ?? prompt('Insert the URL:')\n\t\t\tif (!href) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tAnchorModifications.wrapAnchor(editor, href)\n\t\t}\n\t},\n\tnormalizeNode: ({ element, path, editor, preventDefault }) => {\n\t\tif (SlateNode.string(element) === '') {\n\t\t\tconst selection = editor.selection\n\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\tat: path,\n\t\t\t})\n\t\t\tif (selection && SlateRange.isCollapsed(selection) && Path.isCommon(path, selection.focus.path)) {\n\t\t\t\tTransforms.select(editor, Path.parent(path))\n\t\t\t}\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n})\n"],"names":["SlateElement","Editor","AnchorModifications","SlateNode","Transforms","SlateRange","Path"],"mappings":";;;;AAIO,MAAM,oBAAoB;AAQpB,MAAA,kBAAkB,CAAC,YAAiDA,MAAA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAExH,MAAA,wBAAwB,CAAC,WAAmB;AAClD,QAAA,CAAC,IAAI,IAAIC,aAAO,MAAM,QAAQ,EAAE,OAAO,iBAAiB;AAC9D,SAAO,CAAC,CAAC;AACV;AAGO,MAAM,sBAAsB,CAAC,EAAE,cAA8F;AAAA,EACnI,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,UAAU,CAAC,EAAE,aAAa,sBAAsB,MAAM;AAAA,EACtD,eAAe,CAAC,EAAE,QAAQ,eAAe;AACpC,QAAA,sBAAsB,MAAM,GAAG;AAClCC,0BAAA,oBAAoB,aAAa,MAAM;AAAA,IAAA,OACjC;AACN,YAAM,OAAO,UAAU,QAAQ,OAAO,iBAAiB;AACvD,UAAI,CAAC,MAAM;AACV;AAAA,MAAA;AAEmBA,8CAAA,WAAW,QAAQ,IAAI;AAAA,IAAA;AAAA,EAE7C;AAAA,EACA,eAAe,CAAC,EAAE,SAAS,MAAM,QAAQ,qBAAqB;AAC7D,QAAIC,WAAU,OAAO,OAAO,MAAM,IAAI;AACrC,YAAM,YAAY,OAAO;AACzBC,YAAA,WAAW,YAAY,QAAQ;AAAA,QAC9B,IAAI;AAAA,MAAA,CACJ;AACG,UAAA,aAAaC,MAAAA,MAAW,YAAY,SAAS,KAAKC,MAAAA,KAAK,SAAS,MAAM,UAAU,MAAM,IAAI,GAAG;AAChGF,cAAA,WAAW,OAAO,QAAQE,MAAK,KAAA,OAAO,IAAI,CAAC;AAAA,MAAA;AAE5C,aAAO,eAAe;AAAA,IAAA;AAAA,EACvB;AAEF;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnchorElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Element as SlateElement, Node as SlateNode, Path, Range as SlateRange, Transforms } from 'slate'\nimport { AnchorModifications } from './AnchorModifications'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const anchorElementType = 'anchor' as const\n\nexport interface AnchorElement extends SlateElement {\n\ttype: typeof anchorElementType\n\thref: string\n\tchildren: SlateEditor['children']\n}\n\nexport const isAnchorElement = (element: SlateNode): element is AnchorElement => SlateElement.isElement(element) && element.type === anchorElementType\n\nexport const isAnchorElementActive = (editor: Editor) => {\n\tconst [link] = Editor.nodes(editor, { match: isAnchorElement })\n\treturn !!link\n}\n\n\nexport const anchorElementPlugin = ({ render }: { render: ElementRenderer<AnchorElement> }): EditorElementPlugin<AnchorElement> => ({\n\ttype: anchorElementType,\n\tisInline: true,\n\trender,\n\tisActive: ({ editor }) => isAnchorElementActive(editor),\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tif (isAnchorElementActive(editor)) {\n\t\t\tAnchorModifications.unwrapAnchor(editor)\n\t\t} else {\n\t\t\tconst href = suchThat?.href ?? prompt('Insert the URL:')\n\t\t\tif (!href) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tAnchorModifications.wrapAnchor(editor, href)\n\t\t}\n\t},\n\tnormalizeNode: ({ element, path, editor, preventDefault }) => {\n\t\tif (SlateNode.string(element) === '') {\n\t\t\tconst selection = editor.selection\n\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\tat: path,\n\t\t\t})\n\t\t\tif (selection && SlateRange.isCollapsed(selection) && Path.isCommon(path, selection.focus.path)) {\n\t\t\t\tTransforms.select(editor, Path.parent(path))\n\t\t\t}\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n})\n"],"names":["SlateElement","SlateNode","SlateRange"],"mappings":";;AAIO,MAAM,oBAAoB;AAQpB,MAAA,kBAAkB,CAAC,YAAiDA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAExH,MAAA,wBAAwB,CAAC,WAAmB;AAClD,QAAA,CAAC,IAAI,IAAI,OAAO,MAAM,QAAQ,EAAE,OAAO,gBAAA,CAAiB;AAC9D,SAAO,CAAC,CAAC;AACV;AAGO,MAAM,sBAAsB,CAAC,EAAE,cAA8F;AAAA,EACnI,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,UAAU,CAAC,EAAE,aAAa,sBAAsB,MAAM;AAAA,EACtD,eAAe,CAAC,EAAE,QAAQ,eAAe;AACpC,QAAA,sBAAsB,MAAM,GAAG;AAClC,0BAAoB,aAAa,MAAM;AAAA,IAAA,OACjC;AACN,YAAM,OAAO,UAAU,QAAQ,OAAO,iBAAiB;AACvD,UAAI,CAAC,MAAM;AACV;AAAA,MACD;AACoB,0BAAA,WAAW,QAAQ,IAAI;AAAA,IAC5C;AAAA,EACD;AAAA,EACA,eAAe,CAAC,EAAE,SAAS,MAAM,QAAQ,qBAAqB;AAC7D,QAAIC,KAAU,OAAO,OAAO,MAAM,IAAI;AACrC,YAAM,YAAY,OAAO;AACzB,iBAAW,YAAY,QAAQ;AAAA,QAC9B,IAAI;AAAA,MAAA,CACJ;AACG,UAAA,aAAaC,MAAW,YAAY,SAAS,KAAK,KAAK,SAAS,MAAM,UAAU,MAAM,IAAI,GAAG;AAChG,mBAAW,OAAO,QAAQ,KAAK,OAAO,IAAI,CAAC;AAAA,MAC5C;AACA,aAAO,eAAe;AAAA,IACvB;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"AnchorElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Element as SlateElement, Node as SlateNode, Path, Range as SlateRange, Transforms } from 'slate'\nimport { AnchorModifications } from './AnchorModifications'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const anchorElementType = 'anchor' as const\n\nexport interface AnchorElement extends SlateElement {\n\ttype: typeof anchorElementType\n\thref: string\n\tchildren: SlateEditor['children']\n}\n\nexport const isAnchorElement = (element: SlateNode): element is AnchorElement => SlateElement.isElement(element) && element.type === anchorElementType\n\nexport const isAnchorElementActive = (editor: Editor) => {\n\tconst [link] = Editor.nodes(editor, { match: isAnchorElement })\n\treturn !!link\n}\n\n\nexport const anchorElementPlugin = ({ render }: { render: ElementRenderer<AnchorElement> }): EditorElementPlugin<AnchorElement> => ({\n\ttype: anchorElementType,\n\tisInline: true,\n\trender,\n\tisActive: ({ editor }) => isAnchorElementActive(editor),\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tif (isAnchorElementActive(editor)) {\n\t\t\tAnchorModifications.unwrapAnchor(editor)\n\t\t} else {\n\t\t\tconst href = suchThat?.href ?? prompt('Insert the URL:')\n\t\t\tif (!href) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tAnchorModifications.wrapAnchor(editor, href)\n\t\t}\n\t},\n\tnormalizeNode: ({ element, path, editor, preventDefault }) => {\n\t\tif (SlateNode.string(element) === '') {\n\t\t\tconst selection = editor.selection\n\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\tat: path,\n\t\t\t})\n\t\t\tif (selection && SlateRange.isCollapsed(selection) && Path.isCommon(path, selection.focus.path)) {\n\t\t\t\tTransforms.select(editor, Path.parent(path))\n\t\t\t}\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n})\n"],"names":["SlateElement","SlateNode","SlateRange"],"mappings":";;AAIO,MAAM,oBAAoB;AAQpB,MAAA,kBAAkB,CAAC,YAAiDA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAExH,MAAA,wBAAwB,CAAC,WAAmB;AAClD,QAAA,CAAC,IAAI,IAAI,OAAO,MAAM,QAAQ,EAAE,OAAO,iBAAiB;AAC9D,SAAO,CAAC,CAAC;AACV;AAGO,MAAM,sBAAsB,CAAC,EAAE,cAA8F;AAAA,EACnI,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,UAAU,CAAC,EAAE,aAAa,sBAAsB,MAAM;AAAA,EACtD,eAAe,CAAC,EAAE,QAAQ,eAAe;AACpC,QAAA,sBAAsB,MAAM,GAAG;AAClC,0BAAoB,aAAa,MAAM;AAAA,IAAA,OACjC;AACN,YAAM,OAAO,UAAU,QAAQ,OAAO,iBAAiB;AACvD,UAAI,CAAC,MAAM;AACV;AAAA,MAAA;AAEmB,0BAAA,WAAW,QAAQ,IAAI;AAAA,IAAA;AAAA,EAE7C;AAAA,EACA,eAAe,CAAC,EAAE,SAAS,MAAM,QAAQ,qBAAqB;AAC7D,QAAIC,KAAU,OAAO,OAAO,MAAM,IAAI;AACrC,YAAM,YAAY,OAAO;AACzB,iBAAW,YAAY,QAAQ;AAAA,QAC9B,IAAI;AAAA,MAAA,CACJ;AACG,UAAA,aAAaC,MAAW,YAAY,SAAS,KAAK,KAAK,SAAS,MAAM,UAAU,MAAM,IAAI,GAAG;AAChG,mBAAW,OAAO,QAAQ,KAAK,OAAO,IAAI,CAAC;AAAA,MAAA;AAE5C,aAAO,eAAe;AAAA,IAAA;AAAA,EACvB;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnchorHtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types'\n\nexport const anchorHtmlDeserializer: HtmlDeserializerPlugin = {\n\tprocessInlinePaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (element.tagName === 'A' && element.getAttribute('href')) {\n\t\t\tconst href = element.getAttribute('href')\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: 'anchor',\n\t\t\t\t\thref,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t\treturn null\n\t},\n}\n"],"names":[],"mappings":";;AAEO,MAAM,yBAAkD;AAAA,EAC9D,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC/D,QAAI,QAAQ,YAAY,OAAO,QAAQ,aAAa,MAAM,GAAG;AACtD,YAAA,OAAO,QAAQ,aAAa,MAAM;AAEjC,aAAA;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN;AAAA,UACA,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QACvD;AAAA,MAAA;AAAA,IAEF;AACO,WAAA;AAAA,EACR;AACD;;"}
1
+ {"version":3,"file":"AnchorHtmlDeserializer.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types'\n\nexport const anchorHtmlDeserializer: HtmlDeserializerPlugin = {\n\tprocessInlinePaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (element.tagName === 'A' && element.getAttribute('href')) {\n\t\t\tconst href = element.getAttribute('href')\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: 'anchor',\n\t\t\t\t\thref,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t\treturn null\n\t},\n}\n"],"names":[],"mappings":";;AAEO,MAAM,yBAAkD;AAAA,EAC9D,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC/D,QAAI,QAAQ,YAAY,OAAO,QAAQ,aAAa,MAAM,GAAG;AACtD,YAAA,OAAO,QAAQ,aAAa,MAAM;AAEjC,aAAA;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN;AAAA,UACA,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MAExD;AAAA,IAAA;AAEM,WAAA;AAAA,EAAA;AAET;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnchorHtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types'\n\nexport const anchorHtmlDeserializer: HtmlDeserializerPlugin = {\n\tprocessInlinePaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (element.tagName === 'A' && element.getAttribute('href')) {\n\t\t\tconst href = element.getAttribute('href')\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: 'anchor',\n\t\t\t\t\thref,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t\treturn null\n\t},\n}\n"],"names":[],"mappings":"AAEO,MAAM,yBAAkD;AAAA,EAC9D,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC/D,QAAI,QAAQ,YAAY,OAAO,QAAQ,aAAa,MAAM,GAAG;AACtD,YAAA,OAAO,QAAQ,aAAa,MAAM;AAEjC,aAAA;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN;AAAA,UACA,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QACvD;AAAA,MAAA;AAAA,IAEF;AACO,WAAA;AAAA,EACR;AACD;"}
1
+ {"version":3,"file":"AnchorHtmlDeserializer.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorHtmlDeserializer.ts"],"sourcesContent":["import { HtmlDeserializerPlugin } from '../../../types'\n\nexport const anchorHtmlDeserializer: HtmlDeserializerPlugin = {\n\tprocessInlinePaste: ({ element, next, cumulativeTextAttrs }) => {\n\t\tif (element.tagName === 'A' && element.getAttribute('href')) {\n\t\t\tconst href = element.getAttribute('href')\n\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\ttype: 'anchor',\n\t\t\t\t\thref,\n\t\t\t\t\tchildren: next(element.childNodes, cumulativeTextAttrs),\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t\treturn null\n\t},\n}\n"],"names":[],"mappings":"AAEO,MAAM,yBAAkD;AAAA,EAC9D,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC/D,QAAI,QAAQ,YAAY,OAAO,QAAQ,aAAa,MAAM,GAAG;AACtD,YAAA,OAAO,QAAQ,aAAa,MAAM;AAEjC,aAAA;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN;AAAA,UACA,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MAExD;AAAA,IAAA;AAEM,WAAA;AAAA,EAAA;AAET;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnchorModifications.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorModifications.ts"],"sourcesContent":["import { Editor, Range, Transforms } from 'slate'\nimport { AnchorElement, isAnchorElement, isAnchorElementActive } from './AnchorElement'\n\nexport class AnchorModifications {\n\tpublic static unwrapAnchor(editor: Editor) {\n\t\tTransforms.unwrapNodes(editor, { match: isAnchorElement })\n\t}\n\n\tpublic static wrapAnchor(editor: Editor, url: string) {\n\t\tif (isAnchorElementActive(editor)) {\n\t\t\tAnchorModifications.unwrapAnchor(editor)\n\t\t}\n\n\t\tconst selection = editor.selection\n\t\tconst isCollapsed = selection ? Range.isCollapsed(selection!) : false\n\t\tconst anchor: AnchorElement = {\n\t\t\ttype: 'anchor',\n\t\t\thref: url,\n\t\t\tchildren: isCollapsed ? [{ text: url }] : [{ text: '' }],\n\t\t}\n\n\t\tif (isCollapsed) {\n\t\t\tTransforms.insertNodes(editor, anchor)\n\t\t} else {\n\t\t\tTransforms.wrapNodes(editor, anchor, { split: true })\n\t\t\tTransforms.collapse(editor, { edge: 'end' })\n\t\t}\n\t}\n}\n"],"names":["Transforms","isAnchorElement","isAnchorElementActive","Range"],"mappings":";;;;AAGO,MAAM,oBAAoB;AAAA,EAChC,OAAc,aAAa,QAAgB;AAC1CA,UAAA,WAAW,YAAY,QAAQ,EAAE,OAAOC,cAAAA,gBAAiB,CAAA;AAAA,EAC1D;AAAA,EAEA,OAAc,WAAW,QAAgB,KAAa;AACjD,QAAAC,cAAAA,sBAAsB,MAAM,GAAG;AAClC,0BAAoB,aAAa,MAAM;AAAA,IACxC;AAEA,UAAM,YAAY,OAAO;AACzB,UAAM,cAAc,YAAYC,MAAAA,MAAM,YAAY,SAAU,IAAI;AAChE,UAAM,SAAwB;AAAA,MAC7B,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU,cAAc,CAAC,EAAE,MAAM,IAAK,CAAA,IAAI,CAAC,EAAE,MAAM,IAAI;AAAA,IAAA;AAGxD,QAAI,aAAa;AACLH,YAAAA,WAAA,YAAY,QAAQ,MAAM;AAAA,IAAA,OAC/B;AACNA,YAAA,WAAW,UAAU,QAAQ,QAAQ,EAAE,OAAO,MAAM;AACpDA,YAAA,WAAW,SAAS,QAAQ,EAAE,MAAM,MAAO,CAAA;AAAA,IAC5C;AAAA,EACD;AACD;;"}
1
+ {"version":3,"file":"AnchorModifications.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorModifications.ts"],"sourcesContent":["import { Editor, Range, Transforms } from 'slate'\nimport { AnchorElement, isAnchorElement, isAnchorElementActive } from './AnchorElement'\n\nexport class AnchorModifications {\n\tpublic static unwrapAnchor(editor: Editor) {\n\t\tTransforms.unwrapNodes(editor, { match: isAnchorElement })\n\t}\n\n\tpublic static wrapAnchor(editor: Editor, url: string) {\n\t\tif (isAnchorElementActive(editor)) {\n\t\t\tAnchorModifications.unwrapAnchor(editor)\n\t\t}\n\n\t\tconst selection = editor.selection\n\t\tconst isCollapsed = selection ? Range.isCollapsed(selection!) : false\n\t\tconst anchor: AnchorElement = {\n\t\t\ttype: 'anchor',\n\t\t\thref: url,\n\t\t\tchildren: isCollapsed ? [{ text: url }] : [{ text: '' }],\n\t\t}\n\n\t\tif (isCollapsed) {\n\t\t\tTransforms.insertNodes(editor, anchor)\n\t\t} else {\n\t\t\tTransforms.wrapNodes(editor, anchor, { split: true })\n\t\t\tTransforms.collapse(editor, { edge: 'end' })\n\t\t}\n\t}\n}\n"],"names":["Transforms","isAnchorElement","isAnchorElementActive","Range"],"mappings":";;;;AAGO,MAAM,oBAAoB;AAAA,EAChC,OAAc,aAAa,QAAgB;AAC1CA,UAAAA,WAAW,YAAY,QAAQ,EAAE,OAAOC,+BAAiB;AAAA,EAAA;AAAA,EAG1D,OAAc,WAAW,QAAgB,KAAa;AACjD,QAAAC,cAAAA,sBAAsB,MAAM,GAAG;AAClC,0BAAoB,aAAa,MAAM;AAAA,IAAA;AAGxC,UAAM,YAAY,OAAO;AACzB,UAAM,cAAc,YAAYC,MAAAA,MAAM,YAAY,SAAU,IAAI;AAChE,UAAM,SAAwB;AAAA,MAC7B,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU,cAAc,CAAC,EAAE,MAAM,IAAA,CAAK,IAAI,CAAC,EAAE,MAAM,GAAI,CAAA;AAAA,IACxD;AAEA,QAAI,aAAa;AACLH,uBAAA,YAAY,QAAQ,MAAM;AAAA,IAAA,OAC/B;AACNA,YAAA,WAAW,UAAU,QAAQ,QAAQ,EAAE,OAAO,MAAM;AACpDA,YAAAA,WAAW,SAAS,QAAQ,EAAE,MAAM,OAAO;AAAA,IAAA;AAAA,EAC5C;AAEF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AnchorModifications.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorModifications.ts"],"sourcesContent":["import { Editor, Range, Transforms } from 'slate'\nimport { AnchorElement, isAnchorElement, isAnchorElementActive } from './AnchorElement'\n\nexport class AnchorModifications {\n\tpublic static unwrapAnchor(editor: Editor) {\n\t\tTransforms.unwrapNodes(editor, { match: isAnchorElement })\n\t}\n\n\tpublic static wrapAnchor(editor: Editor, url: string) {\n\t\tif (isAnchorElementActive(editor)) {\n\t\t\tAnchorModifications.unwrapAnchor(editor)\n\t\t}\n\n\t\tconst selection = editor.selection\n\t\tconst isCollapsed = selection ? Range.isCollapsed(selection!) : false\n\t\tconst anchor: AnchorElement = {\n\t\t\ttype: 'anchor',\n\t\t\thref: url,\n\t\t\tchildren: isCollapsed ? [{ text: url }] : [{ text: '' }],\n\t\t}\n\n\t\tif (isCollapsed) {\n\t\t\tTransforms.insertNodes(editor, anchor)\n\t\t} else {\n\t\t\tTransforms.wrapNodes(editor, anchor, { split: true })\n\t\t\tTransforms.collapse(editor, { edge: 'end' })\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB;AAAA,EAChC,OAAc,aAAa,QAAgB;AAC1C,eAAW,YAAY,QAAQ,EAAE,OAAO,gBAAiB,CAAA;AAAA,EAC1D;AAAA,EAEA,OAAc,WAAW,QAAgB,KAAa;AACjD,QAAA,sBAAsB,MAAM,GAAG;AAClC,0BAAoB,aAAa,MAAM;AAAA,IACxC;AAEA,UAAM,YAAY,OAAO;AACzB,UAAM,cAAc,YAAY,MAAM,YAAY,SAAU,IAAI;AAChE,UAAM,SAAwB;AAAA,MAC7B,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU,cAAc,CAAC,EAAE,MAAM,IAAK,CAAA,IAAI,CAAC,EAAE,MAAM,IAAI;AAAA,IAAA;AAGxD,QAAI,aAAa;AACL,iBAAA,YAAY,QAAQ,MAAM;AAAA,IAAA,OAC/B;AACN,iBAAW,UAAU,QAAQ,QAAQ,EAAE,OAAO,MAAM;AACpD,iBAAW,SAAS,QAAQ,EAAE,MAAM,MAAO,CAAA;AAAA,IAC5C;AAAA,EACD;AACD;"}
1
+ {"version":3,"file":"AnchorModifications.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorModifications.ts"],"sourcesContent":["import { Editor, Range, Transforms } from 'slate'\nimport { AnchorElement, isAnchorElement, isAnchorElementActive } from './AnchorElement'\n\nexport class AnchorModifications {\n\tpublic static unwrapAnchor(editor: Editor) {\n\t\tTransforms.unwrapNodes(editor, { match: isAnchorElement })\n\t}\n\n\tpublic static wrapAnchor(editor: Editor, url: string) {\n\t\tif (isAnchorElementActive(editor)) {\n\t\t\tAnchorModifications.unwrapAnchor(editor)\n\t\t}\n\n\t\tconst selection = editor.selection\n\t\tconst isCollapsed = selection ? Range.isCollapsed(selection!) : false\n\t\tconst anchor: AnchorElement = {\n\t\t\ttype: 'anchor',\n\t\t\thref: url,\n\t\t\tchildren: isCollapsed ? [{ text: url }] : [{ text: '' }],\n\t\t}\n\n\t\tif (isCollapsed) {\n\t\t\tTransforms.insertNodes(editor, anchor)\n\t\t} else {\n\t\t\tTransforms.wrapNodes(editor, anchor, { split: true })\n\t\t\tTransforms.collapse(editor, { edge: 'end' })\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB;AAAA,EAChC,OAAc,aAAa,QAAgB;AAC1C,eAAW,YAAY,QAAQ,EAAE,OAAO,iBAAiB;AAAA,EAAA;AAAA,EAG1D,OAAc,WAAW,QAAgB,KAAa;AACjD,QAAA,sBAAsB,MAAM,GAAG;AAClC,0BAAoB,aAAa,MAAM;AAAA,IAAA;AAGxC,UAAM,YAAY,OAAO;AACzB,UAAM,cAAc,YAAY,MAAM,YAAY,SAAU,IAAI;AAChE,UAAM,SAAwB;AAAA,MAC7B,MAAM;AAAA,MACN,MAAM;AAAA,MACN,UAAU,cAAc,CAAC,EAAE,MAAM,IAAA,CAAK,IAAI,CAAC,EAAE,MAAM,GAAI,CAAA;AAAA,IACxD;AAEA,QAAI,aAAa;AACL,iBAAA,YAAY,QAAQ,MAAM;AAAA,IAAA,OAC/B;AACN,iBAAW,UAAU,QAAQ,QAAQ,EAAE,OAAO,MAAM;AACpD,iBAAW,SAAS,QAAQ,EAAE,MAAM,OAAO;AAAA,IAAA;AAAA,EAC5C;AAEF;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withAnchors.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/withAnchors.ts"],"sourcesContent":["import { Editor } from 'slate'\nimport { AnchorModifications } from './AnchorModifications'\nimport { AnchorElement, anchorElementPlugin } from './AnchorElement'\nimport { anchorHtmlDeserializer } from './AnchorHtmlDeserializer'\nimport { ElementRenderer } from '../../../types'\nimport { parseUrl } from '../../../internal/utils'\n\nexport const withAnchors = ({ render }: { render: ElementRenderer<AnchorElement> }) => <E extends Editor>(editor: E): E => {\n\tconst { insertText } = editor\n\n\teditor.registerElement(anchorElementPlugin({ render }))\n\teditor.htmlDeserializer.registerPlugin(anchorHtmlDeserializer)\n\n\teditor.insertText = text => {\n\t\tif (text && parseUrl(text) !== undefined) {\n\t\t\tAnchorModifications.wrapAnchor(editor, text)\n\t\t} else {\n\t\t\tinsertText(text)\n\t\t}\n\t}\n\n\treturn editor\n}\n"],"names":["anchorElementPlugin","anchorHtmlDeserializer","parseUrl","AnchorModifications"],"mappings":";;;;;;AAOO,MAAM,cAAc,CAAC,EAAE,OAAO,MAAkD,CAAmB,WAAiB;AACpH,QAAA,EAAE,WAAe,IAAA;AAEvB,SAAO,gBAAgBA,cAAAA,oBAAoB,EAAE,OAAA,CAAQ,CAAC;AAC/C,SAAA,iBAAiB,eAAeC,uBAAAA,sBAAsB;AAE7D,SAAO,aAAa,CAAQ,SAAA;AAC3B,QAAI,QAAQC,SAAA,SAAS,IAAI,MAAM,QAAW;AACrBC,0BAAAA,oBAAA,WAAW,QAAQ,IAAI;AAAA,IAAA,OACrC;AACN,iBAAW,IAAI;AAAA,IAChB;AAAA,EAAA;AAGM,SAAA;AACR;;"}
1
+ {"version":3,"file":"withAnchors.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/withAnchors.ts"],"sourcesContent":["import { Editor } from 'slate'\nimport { AnchorModifications } from './AnchorModifications'\nimport { AnchorElement, anchorElementPlugin } from './AnchorElement'\nimport { anchorHtmlDeserializer } from './AnchorHtmlDeserializer'\nimport { ElementRenderer } from '../../../types'\nimport { parseUrl } from '../../../internal/utils'\n\nexport const withAnchors = ({ render }: { render: ElementRenderer<AnchorElement> }) => <E extends Editor>(editor: E): E => {\n\tconst { insertText } = editor\n\n\teditor.registerElement(anchorElementPlugin({ render }))\n\teditor.htmlDeserializer.registerPlugin(anchorHtmlDeserializer)\n\n\teditor.insertText = text => {\n\t\tif (text && parseUrl(text) !== undefined) {\n\t\t\tAnchorModifications.wrapAnchor(editor, text)\n\t\t} else {\n\t\t\tinsertText(text)\n\t\t}\n\t}\n\n\treturn editor\n}\n"],"names":["anchorElementPlugin","anchorHtmlDeserializer","parseUrl","AnchorModifications"],"mappings":";;;;;;AAOO,MAAM,cAAc,CAAC,EAAE,OAAO,MAAkD,CAAmB,WAAiB;AACpH,QAAA,EAAE,eAAe;AAEvB,SAAO,gBAAgBA,cAAAA,oBAAoB,EAAE,OAAQ,CAAA,CAAC;AAC/C,SAAA,iBAAiB,eAAeC,6CAAsB;AAE7D,SAAO,aAAa,CAAQ,SAAA;AAC3B,QAAI,QAAQC,SAAA,SAAS,IAAI,MAAM,QAAW;AACrBC,8CAAA,WAAW,QAAQ,IAAI;AAAA,IAAA,OACrC;AACN,iBAAW,IAAI;AAAA,IAAA;AAAA,EAEjB;AAEO,SAAA;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"withAnchors.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/withAnchors.ts"],"sourcesContent":["import { Editor } from 'slate'\nimport { AnchorModifications } from './AnchorModifications'\nimport { AnchorElement, anchorElementPlugin } from './AnchorElement'\nimport { anchorHtmlDeserializer } from './AnchorHtmlDeserializer'\nimport { ElementRenderer } from '../../../types'\nimport { parseUrl } from '../../../internal/utils'\n\nexport const withAnchors = ({ render }: { render: ElementRenderer<AnchorElement> }) => <E extends Editor>(editor: E): E => {\n\tconst { insertText } = editor\n\n\teditor.registerElement(anchorElementPlugin({ render }))\n\teditor.htmlDeserializer.registerPlugin(anchorHtmlDeserializer)\n\n\teditor.insertText = text => {\n\t\tif (text && parseUrl(text) !== undefined) {\n\t\t\tAnchorModifications.wrapAnchor(editor, text)\n\t\t} else {\n\t\t\tinsertText(text)\n\t\t}\n\t}\n\n\treturn editor\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,cAAc,CAAC,EAAE,OAAO,MAAkD,CAAmB,WAAiB;AACpH,QAAA,EAAE,WAAe,IAAA;AAEvB,SAAO,gBAAgB,oBAAoB,EAAE,OAAA,CAAQ,CAAC;AAC/C,SAAA,iBAAiB,eAAe,sBAAsB;AAE7D,SAAO,aAAa,CAAQ,SAAA;AAC3B,QAAI,QAAQ,SAAS,IAAI,MAAM,QAAW;AACrB,0BAAA,WAAW,QAAQ,IAAI;AAAA,IAAA,OACrC;AACN,iBAAW,IAAI;AAAA,IAChB;AAAA,EAAA;AAGM,SAAA;AACR;"}
1
+ {"version":3,"file":"withAnchors.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/withAnchors.ts"],"sourcesContent":["import { Editor } from 'slate'\nimport { AnchorModifications } from './AnchorModifications'\nimport { AnchorElement, anchorElementPlugin } from './AnchorElement'\nimport { anchorHtmlDeserializer } from './AnchorHtmlDeserializer'\nimport { ElementRenderer } from '../../../types'\nimport { parseUrl } from '../../../internal/utils'\n\nexport const withAnchors = ({ render }: { render: ElementRenderer<AnchorElement> }) => <E extends Editor>(editor: E): E => {\n\tconst { insertText } = editor\n\n\teditor.registerElement(anchorElementPlugin({ render }))\n\teditor.htmlDeserializer.registerPlugin(anchorHtmlDeserializer)\n\n\teditor.insertText = text => {\n\t\tif (text && parseUrl(text) !== undefined) {\n\t\t\tAnchorModifications.wrapAnchor(editor, text)\n\t\t} else {\n\t\t\tinsertText(text)\n\t\t}\n\t}\n\n\treturn editor\n}\n"],"names":[],"mappings":";;;;AAOO,MAAM,cAAc,CAAC,EAAE,OAAO,MAAkD,CAAmB,WAAiB;AACpH,QAAA,EAAE,eAAe;AAEvB,SAAO,gBAAgB,oBAAoB,EAAE,OAAQ,CAAA,CAAC;AAC/C,SAAA,iBAAiB,eAAe,sBAAsB;AAE7D,SAAO,aAAa,CAAQ,SAAA;AAC3B,QAAI,QAAQ,SAAS,IAAI,MAAM,QAAW;AACrB,0BAAA,WAAW,QAAQ,IAAI;AAAA,IAAA,OACrC;AACN,iBAAW,IAAI;AAAA,IAAA;AAAA,EAEjB;AAEO,SAAA;AACR;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HeadingElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/headings/HeadingElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element, Node as SlateNode, Path as SlatePath, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { AlignDirection } from '../../attributes'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const headingElementType = 'heading' as const\n\nexport interface HeadingElement extends Element {\n\ttype: typeof headingElementType\n\tlevel: 1 | 2 | 3 | 4 | 5 | 6\n\tisNumbered?: boolean\n\talign?: AlignDirection\n\tchildren: SlateEditor['children']\n}\n\nexport const isHeadingElement = (\n\telement: SlateNode,\n\tsuchThat?: Partial<HeadingElement>,\n): element is HeadingElement => ContemberEditor.isElementType(element, headingElementType, suchThat)\n\nexport const ejectHeadingElement = (editor: Editor, elementPath: SlatePath) => {\n\tContemberEditor.ejectElement(editor, elementPath)\n\tTransforms.setNodes(editor, { type: editor.defaultElementType }, { at: elementPath })\n}\n\n\nexport const headingElementPlugin = ({ render }: { render: ElementRenderer<HeadingElement> }): EditorElementPlugin<HeadingElement> => ({\n\ttype: headingElementType,\n\trender,\n\tcanContainAnyBlocks: false,\n\tacceptsAttributes: ({ editor, suchThat }) => {\n\t\treturn 'align' in suchThat\n\t},\n\t// TODO in the following function, we need to conditionally trim the selection so that it doesn't potentially\n\t// \tinclude empty strings at the edges of top-level elements.\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tSlateEditor.withoutNormalizing(editor, () => {\n\t\t\tconst headings = Array.from(Editor.nodes(editor, { match: it => isHeadingElement(it, suchThat) }))\n\t\t\tif (headings.length) {\n\t\t\t\tfor (const heading of headings) {\n\t\t\t\t\tejectHeadingElement(editor, heading[1])\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTransforms.setNodes(editor, {\n\t\t\t\t\t...suchThat,\n\t\t\t\t\tchildren: [],\n\t\t\t\t\ttype: headingElementType,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t},\n})\n"],"names":["ContemberEditor","Transforms","SlateEditor","Editor"],"mappings":";;;;AAKO,MAAM,qBAAqB;AAUrB,MAAA,mBAAmB,CAC/B,SACA,aAC+BA,MAAAA,gBAAgB,cAAc,SAAS,oBAAoB,QAAQ;AAEtF,MAAA,sBAAsB,CAAC,QAAgB,gBAA2B;AAC9DA,QAAAA,gBAAA,aAAa,QAAQ,WAAW;AACrCC,QAAAA,WAAA,SAAS,QAAQ,EAAE,MAAM,OAAO,sBAAsB,EAAE,IAAI,YAAA,CAAa;AACrF;AAGO,MAAM,uBAAuB,CAAC,EAAE,cAAgG;AAAA,EACtI,MAAM;AAAA,EACN;AAAA,EACA,qBAAqB;AAAA,EACrB,mBAAmB,CAAC,EAAE,QAAQ,eAAe;AAC5C,WAAO,WAAW;AAAA,EACnB;AAAA;AAAA;AAAA,EAGA,eAAe,CAAC,EAAE,QAAQ,eAAe;AAC5BC,iBAAA,mBAAmB,QAAQ,MAAM;AAC5C,YAAM,WAAW,MAAM,KAAKC,MAAAA,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,OAAM,iBAAiB,IAAI,QAAQ,EAAA,CAAG,CAAC;AACjG,UAAI,SAAS,QAAQ;AACpB,mBAAW,WAAW,UAAU;AACX,8BAAA,QAAQ,QAAQ,CAAC,CAAC;AAAA,QACvC;AAAA,MAAA,OACM;AACNF,cAAA,WAAW,SAAS,QAAQ;AAAA,UAC3B,GAAG;AAAA,UACH,UAAU,CAAC;AAAA,UACX,MAAM;AAAA,QAAA,CACN;AAAA,MACF;AAAA,IAAA,CACA;AAAA,EACF;AACD;;;;;"}
1
+ {"version":3,"file":"HeadingElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/headings/HeadingElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, Element, Node as SlateNode, Path as SlatePath, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { AlignDirection } from '../../attributes'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const headingElementType = 'heading' as const\n\nexport interface HeadingElement extends Element {\n\ttype: typeof headingElementType\n\tlevel: 1 | 2 | 3 | 4 | 5 | 6\n\tisNumbered?: boolean\n\talign?: AlignDirection\n\tchildren: SlateEditor['children']\n}\n\nexport const isHeadingElement = (\n\telement: SlateNode,\n\tsuchThat?: Partial<HeadingElement>,\n): element is HeadingElement => ContemberEditor.isElementType(element, headingElementType, suchThat)\n\nexport const ejectHeadingElement = (editor: Editor, elementPath: SlatePath) => {\n\tContemberEditor.ejectElement(editor, elementPath)\n\tTransforms.setNodes(editor, { type: editor.defaultElementType }, { at: elementPath })\n}\n\n\nexport const headingElementPlugin = ({ render }: { render: ElementRenderer<HeadingElement> }): EditorElementPlugin<HeadingElement> => ({\n\ttype: headingElementType,\n\trender,\n\tcanContainAnyBlocks: false,\n\tacceptsAttributes: ({ editor, suchThat }) => {\n\t\treturn 'align' in suchThat\n\t},\n\t// TODO in the following function, we need to conditionally trim the selection so that it doesn't potentially\n\t// \tinclude empty strings at the edges of top-level elements.\n\ttoggleElement: ({ editor, suchThat }) => {\n\t\tSlateEditor.withoutNormalizing(editor, () => {\n\t\t\tconst headings = Array.from(Editor.nodes(editor, { match: it => isHeadingElement(it, suchThat) }))\n\t\t\tif (headings.length) {\n\t\t\t\tfor (const heading of headings) {\n\t\t\t\t\tejectHeadingElement(editor, heading[1])\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTransforms.setNodes(editor, {\n\t\t\t\t\t...suchThat,\n\t\t\t\t\tchildren: [],\n\t\t\t\t\ttype: headingElementType,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t},\n})\n"],"names":["ContemberEditor","Transforms","SlateEditor","Editor"],"mappings":";;;;AAKO,MAAM,qBAAqB;AAUrB,MAAA,mBAAmB,CAC/B,SACA,aAC+BA,sBAAgB,cAAc,SAAS,oBAAoB,QAAQ;AAEtF,MAAA,sBAAsB,CAAC,QAAgB,gBAA2B;AAC9DA,wBAAA,aAAa,QAAQ,WAAW;AACrCC,mBAAA,SAAS,QAAQ,EAAE,MAAM,OAAO,sBAAsB,EAAE,IAAI,aAAa;AACrF;AAGO,MAAM,uBAAuB,CAAC,EAAE,cAAgG;AAAA,EACtI,MAAM;AAAA,EACN;AAAA,EACA,qBAAqB;AAAA,EACrB,mBAAmB,CAAC,EAAE,QAAQ,eAAe;AAC5C,WAAO,WAAW;AAAA,EACnB;AAAA;AAAA;AAAA,EAGA,eAAe,CAAC,EAAE,QAAQ,eAAe;AAC5BC,iBAAA,mBAAmB,QAAQ,MAAM;AAC5C,YAAM,WAAW,MAAM,KAAKC,MAAA,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,OAAM,iBAAiB,IAAI,QAAQ,EAAG,CAAA,CAAC;AACjG,UAAI,SAAS,QAAQ;AACpB,mBAAW,WAAW,UAAU;AACX,8BAAA,QAAQ,QAAQ,CAAC,CAAC;AAAA,QAAA;AAAA,MACvC,OACM;AACNF,cAAA,WAAW,SAAS,QAAQ;AAAA,UAC3B,GAAG;AAAA,UACH,UAAU,CAAC;AAAA,UACX,MAAM;AAAA,QAAA,CACN;AAAA,MAAA;AAAA,IACF,CACA;AAAA,EAAA;AAEH;;;;;"}