@contember/react-slate-editor-base 2.1.0-alpha.9 → 2.1.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 (451) hide show
  1. package/dist/development/index.cjs +70 -70
  2. package/dist/development/index.js +25 -25
  3. package/dist/development/src/components/RichTextEditor.cjs +1 -0
  4. package/dist/development/src/components/RichTextEditor.cjs.map +1 -1
  5. package/dist/development/src/components/RichTextEditor.js +2 -1
  6. package/dist/development/src/components/RichTextEditor.js.map +1 -1
  7. package/dist/development/src/components/triggers/EditorElementTrigger.cjs.map +1 -1
  8. package/dist/development/src/components/triggers/EditorElementTrigger.js.map +1 -1
  9. package/dist/development/src/components/triggers/EditorGenericTrigger.cjs +1 -1
  10. package/dist/development/src/components/triggers/EditorGenericTrigger.cjs.map +1 -1
  11. package/dist/development/src/components/triggers/EditorGenericTrigger.js +1 -1
  12. package/dist/development/src/components/triggers/EditorGenericTrigger.js.map +1 -1
  13. package/dist/development/src/components/triggers/EditorMarkTrigger.cjs.map +1 -1
  14. package/dist/development/src/components/triggers/EditorMarkTrigger.js.map +1 -1
  15. package/dist/development/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -1
  16. package/dist/development/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -1
  17. package/dist/development/src/editor/createEditor.cjs.map +1 -1
  18. package/dist/development/src/editor/createEditor.js.map +1 -1
  19. package/dist/development/src/editor/createEditorWithEssentials.cjs.map +1 -1
  20. package/dist/development/src/editor/createEditorWithEssentials.js +1 -1
  21. package/dist/development/src/editor/createEditorWithEssentials.js.map +1 -1
  22. package/dist/development/src/editor/index.cjs +18 -18
  23. package/dist/development/src/editor/index.cjs.map +1 -1
  24. package/dist/development/src/editor/index.js +18 -18
  25. package/dist/development/src/editor/methods/addMarks.cjs.map +1 -1
  26. package/dist/development/src/editor/methods/addMarks.js.map +1 -1
  27. package/dist/development/src/editor/methods/closest.cjs.map +1 -1
  28. package/dist/development/src/editor/methods/closest.js.map +1 -1
  29. package/dist/development/src/editor/methods/closestBlockEntry.cjs.map +1 -1
  30. package/dist/development/src/editor/methods/closestBlockEntry.js.map +1 -1
  31. package/dist/development/src/editor/methods/ejectElement.cjs.map +1 -1
  32. package/dist/development/src/editor/methods/ejectElement.js.map +1 -1
  33. package/dist/development/src/editor/methods/elementToSpecifics.cjs.map +1 -1
  34. package/dist/development/src/editor/methods/elementToSpecifics.js.map +1 -1
  35. package/dist/development/src/editor/methods/getElementDataAttributes.cjs.map +1 -1
  36. package/dist/development/src/editor/methods/getElementDataAttributes.js.map +1 -1
  37. package/dist/development/src/editor/methods/getPreviousSibling.cjs.map +1 -1
  38. package/dist/development/src/editor/methods/getPreviousSibling.js.map +1 -1
  39. package/dist/development/src/editor/methods/hasMarks.cjs.map +1 -1
  40. package/dist/development/src/editor/methods/hasMarks.js.map +1 -1
  41. package/dist/development/src/editor/methods/hasParentOfType.cjs.map +1 -1
  42. package/dist/development/src/editor/methods/hasParentOfType.js.map +1 -1
  43. package/dist/development/src/editor/methods/isElementType.cjs.map +1 -1
  44. package/dist/development/src/editor/methods/isElementType.js.map +1 -1
  45. package/dist/development/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -1
  46. package/dist/development/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -1
  47. package/dist/development/src/editor/methods/removeMarks.cjs.map +1 -1
  48. package/dist/development/src/editor/methods/removeMarks.js.map +1 -1
  49. package/dist/development/src/editor/methods/serializeNodes.cjs.map +1 -1
  50. package/dist/development/src/editor/methods/serializeNodes.js.map +1 -1
  51. package/dist/development/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -1
  52. package/dist/development/src/editor/methods/strictlyDeserializeNodes.js.map +1 -1
  53. package/dist/development/src/editor/methods/textToSpecifics.cjs.map +1 -1
  54. package/dist/development/src/editor/methods/textToSpecifics.js.map +1 -1
  55. package/dist/development/src/editor/methods/toLatestFormat.cjs +1 -3
  56. package/dist/development/src/editor/methods/toLatestFormat.cjs.map +1 -1
  57. package/dist/development/src/editor/methods/toLatestFormat.js +1 -3
  58. package/dist/development/src/editor/methods/toLatestFormat.js.map +1 -1
  59. package/dist/development/src/editor/methods/topLevelNodes.cjs.map +1 -1
  60. package/dist/development/src/editor/methods/topLevelNodes.js.map +1 -1
  61. package/dist/development/src/internal/components/DefaultElement.cjs.map +1 -1
  62. package/dist/development/src/internal/components/DefaultElement.js.map +1 -1
  63. package/dist/development/src/internal/hooks/useRichTextFieldNodes.cjs.map +1 -1
  64. package/dist/development/src/internal/hooks/useRichTextFieldNodes.js.map +1 -1
  65. package/dist/development/src/internal/utils/EditorPasteUtils.cjs.map +1 -1
  66. package/dist/development/src/internal/utils/EditorPasteUtils.js.map +1 -1
  67. package/dist/development/src/internal/utils/parseUrl.cjs.map +1 -1
  68. package/dist/development/src/internal/utils/parseUrl.js.map +1 -1
  69. package/dist/development/src/plugins/attributes/alignment/alignButton.cjs.map +1 -1
  70. package/dist/development/src/plugins/attributes/alignment/alignButton.js +1 -1
  71. package/dist/development/src/plugins/attributes/alignment/alignButton.js.map +1 -1
  72. package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.cjs +1 -3
  73. package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -1
  74. package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.js +1 -3
  75. package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -1
  76. package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -1
  77. package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -1
  78. package/dist/development/src/plugins/behaviour/paste/withPaste.cjs.map +1 -1
  79. package/dist/development/src/plugins/behaviour/paste/withPaste.js.map +1 -1
  80. package/dist/development/src/plugins/element/anchors/AnchorElement.cjs.map +1 -1
  81. package/dist/development/src/plugins/element/anchors/AnchorElement.js +1 -1
  82. package/dist/development/src/plugins/element/anchors/AnchorElement.js.map +1 -1
  83. package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -1
  84. package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -1
  85. package/dist/development/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -1
  86. package/dist/development/src/plugins/element/anchors/AnchorModifications.js.map +1 -1
  87. package/dist/development/src/plugins/element/anchors/withAnchors.cjs.map +1 -1
  88. package/dist/development/src/plugins/element/anchors/withAnchors.js.map +1 -1
  89. package/dist/development/src/plugins/element/headings/HeadingElement.cjs.map +1 -1
  90. package/dist/development/src/plugins/element/headings/HeadingElement.js.map +1 -1
  91. package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -1
  92. package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -1
  93. package/dist/development/src/plugins/element/headings/withHeadings.cjs.map +1 -1
  94. package/dist/development/src/plugins/element/headings/withHeadings.js.map +1 -1
  95. package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -1
  96. package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -1
  97. package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -1
  98. package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -1
  99. package/dist/development/src/plugins/element/lists/ListElement.cjs.map +1 -1
  100. package/dist/development/src/plugins/element/lists/ListElement.js.map +1 -1
  101. package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -1
  102. package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -1
  103. package/dist/development/src/plugins/element/lists/ListItemElement.cjs.map +1 -1
  104. package/dist/development/src/plugins/element/lists/ListItemElement.js.map +1 -1
  105. package/dist/development/src/plugins/element/lists/OrderedListElement.cjs +1 -1
  106. package/dist/development/src/plugins/element/lists/OrderedListElement.cjs.map +1 -1
  107. package/dist/development/src/plugins/element/lists/OrderedListElement.js +1 -1
  108. package/dist/development/src/plugins/element/lists/OrderedListElement.js.map +1 -1
  109. package/dist/development/src/plugins/element/lists/UnorderedListElement.cjs +1 -1
  110. package/dist/development/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -1
  111. package/dist/development/src/plugins/element/lists/UnorderedListElement.js +1 -1
  112. package/dist/development/src/plugins/element/lists/UnorderedListElement.js.map +1 -1
  113. package/dist/development/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -1
  114. package/dist/development/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -1
  115. package/dist/development/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -1
  116. package/dist/development/src/plugins/element/lists/transforms/indentListItem.js.map +1 -1
  117. package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -1
  118. package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -1
  119. package/dist/development/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -1
  120. package/dist/development/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -1
  121. package/dist/development/src/plugins/element/lists/withLists.cjs.map +1 -1
  122. package/dist/development/src/plugins/element/lists/withLists.js +1 -1
  123. package/dist/development/src/plugins/element/lists/withLists.js.map +1 -1
  124. package/dist/development/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -1
  125. package/dist/development/src/plugins/element/paragraphs/ParagraphElement.js +1 -1
  126. package/dist/development/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -1
  127. package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -1
  128. package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -1
  129. package/dist/development/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -1
  130. package/dist/development/src/plugins/element/paragraphs/withParagraphs.js.map +1 -1
  131. package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -1
  132. package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -1
  133. package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -1
  134. package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -1
  135. package/dist/development/src/plugins/element/tables/TableCellElement.cjs.map +1 -1
  136. package/dist/development/src/plugins/element/tables/TableCellElement.js.map +1 -1
  137. package/dist/development/src/plugins/element/tables/TableElement.cjs.map +1 -1
  138. package/dist/development/src/plugins/element/tables/TableElement.js +1 -1
  139. package/dist/development/src/plugins/element/tables/TableElement.js.map +1 -1
  140. package/dist/development/src/plugins/element/tables/TableElementSelection.cjs.map +1 -1
  141. package/dist/development/src/plugins/element/tables/TableElementSelection.js.map +1 -1
  142. package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +1 -1
  143. package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.js.map +1 -1
  144. package/dist/development/src/plugins/element/tables/TableModifications.cjs.map +1 -1
  145. package/dist/development/src/plugins/element/tables/TableModifications.js +1 -1
  146. package/dist/development/src/plugins/element/tables/TableModifications.js.map +1 -1
  147. package/dist/development/src/plugins/element/tables/TableRowElement.cjs.map +1 -1
  148. package/dist/development/src/plugins/element/tables/TableRowElement.js.map +1 -1
  149. package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -1
  150. package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -1
  151. package/dist/development/src/plugins/element/tables/withTables.cjs.map +1 -1
  152. package/dist/development/src/plugins/element/tables/withTables.js +2 -2
  153. package/dist/development/src/plugins/element/tables/withTables.js.map +1 -1
  154. package/dist/development/src/plugins/text/bold/boldMark.cjs.map +1 -1
  155. package/dist/development/src/plugins/text/bold/boldMark.js.map +1 -1
  156. package/dist/development/src/plugins/text/bold/withBold.cjs.map +1 -1
  157. package/dist/development/src/plugins/text/bold/withBold.js.map +1 -1
  158. package/dist/development/src/plugins/text/code/codeMark.cjs.map +1 -1
  159. package/dist/development/src/plugins/text/code/codeMark.js.map +1 -1
  160. package/dist/development/src/plugins/text/code/withCode.cjs.map +1 -1
  161. package/dist/development/src/plugins/text/code/withCode.js.map +1 -1
  162. package/dist/development/src/plugins/text/highlight/highlightMark.cjs.map +1 -1
  163. package/dist/development/src/plugins/text/highlight/highlightMark.js.map +1 -1
  164. package/dist/development/src/plugins/text/highlight/withHighlight.cjs.map +1 -1
  165. package/dist/development/src/plugins/text/highlight/withHighlight.js.map +1 -1
  166. package/dist/development/src/plugins/text/italic/italicMark.cjs.map +1 -1
  167. package/dist/development/src/plugins/text/italic/italicMark.js.map +1 -1
  168. package/dist/development/src/plugins/text/italic/withItalic.cjs.map +1 -1
  169. package/dist/development/src/plugins/text/italic/withItalic.js.map +1 -1
  170. package/dist/development/src/plugins/text/newline/withNewline.cjs.map +1 -1
  171. package/dist/development/src/plugins/text/newline/withNewline.js.map +1 -1
  172. package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -1
  173. package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -1
  174. package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -1
  175. package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -1
  176. package/dist/development/src/plugins/text/underline/underlineMark.cjs.map +1 -1
  177. package/dist/development/src/plugins/text/underline/underlineMark.js.map +1 -1
  178. package/dist/development/src/plugins/text/underline/withUnderline.cjs.map +1 -1
  179. package/dist/development/src/plugins/text/underline/withUnderline.js.map +1 -1
  180. package/dist/production/index.cjs +70 -70
  181. package/dist/production/index.js +25 -25
  182. package/dist/production/src/components/RichTextEditor.cjs +1 -0
  183. package/dist/production/src/components/RichTextEditor.cjs.map +1 -1
  184. package/dist/production/src/components/RichTextEditor.js +2 -1
  185. package/dist/production/src/components/RichTextEditor.js.map +1 -1
  186. package/dist/production/src/components/triggers/EditorElementTrigger.cjs.map +1 -1
  187. package/dist/production/src/components/triggers/EditorElementTrigger.js.map +1 -1
  188. package/dist/production/src/components/triggers/EditorGenericTrigger.cjs.map +1 -1
  189. package/dist/production/src/components/triggers/EditorGenericTrigger.js.map +1 -1
  190. package/dist/production/src/components/triggers/EditorMarkTrigger.cjs.map +1 -1
  191. package/dist/production/src/components/triggers/EditorMarkTrigger.js.map +1 -1
  192. package/dist/production/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -1
  193. package/dist/production/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -1
  194. package/dist/production/src/editor/createEditor.cjs.map +1 -1
  195. package/dist/production/src/editor/createEditor.js.map +1 -1
  196. package/dist/production/src/editor/createEditorWithEssentials.cjs.map +1 -1
  197. package/dist/production/src/editor/createEditorWithEssentials.js +1 -1
  198. package/dist/production/src/editor/createEditorWithEssentials.js.map +1 -1
  199. package/dist/production/src/editor/index.cjs +18 -18
  200. package/dist/production/src/editor/index.cjs.map +1 -1
  201. package/dist/production/src/editor/index.js +18 -18
  202. package/dist/production/src/editor/methods/addMarks.cjs.map +1 -1
  203. package/dist/production/src/editor/methods/addMarks.js.map +1 -1
  204. package/dist/production/src/editor/methods/closest.cjs.map +1 -1
  205. package/dist/production/src/editor/methods/closest.js.map +1 -1
  206. package/dist/production/src/editor/methods/closestBlockEntry.cjs.map +1 -1
  207. package/dist/production/src/editor/methods/closestBlockEntry.js.map +1 -1
  208. package/dist/production/src/editor/methods/ejectElement.cjs.map +1 -1
  209. package/dist/production/src/editor/methods/ejectElement.js.map +1 -1
  210. package/dist/production/src/editor/methods/elementToSpecifics.cjs.map +1 -1
  211. package/dist/production/src/editor/methods/elementToSpecifics.js.map +1 -1
  212. package/dist/production/src/editor/methods/getElementDataAttributes.cjs.map +1 -1
  213. package/dist/production/src/editor/methods/getElementDataAttributes.js.map +1 -1
  214. package/dist/production/src/editor/methods/getPreviousSibling.cjs.map +1 -1
  215. package/dist/production/src/editor/methods/getPreviousSibling.js.map +1 -1
  216. package/dist/production/src/editor/methods/hasMarks.cjs.map +1 -1
  217. package/dist/production/src/editor/methods/hasMarks.js.map +1 -1
  218. package/dist/production/src/editor/methods/hasParentOfType.cjs.map +1 -1
  219. package/dist/production/src/editor/methods/hasParentOfType.js.map +1 -1
  220. package/dist/production/src/editor/methods/isElementType.cjs.map +1 -1
  221. package/dist/production/src/editor/methods/isElementType.js.map +1 -1
  222. package/dist/production/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -1
  223. package/dist/production/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -1
  224. package/dist/production/src/editor/methods/removeMarks.cjs.map +1 -1
  225. package/dist/production/src/editor/methods/removeMarks.js.map +1 -1
  226. package/dist/production/src/editor/methods/serializeNodes.cjs.map +1 -1
  227. package/dist/production/src/editor/methods/serializeNodes.js.map +1 -1
  228. package/dist/production/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -1
  229. package/dist/production/src/editor/methods/strictlyDeserializeNodes.js.map +1 -1
  230. package/dist/production/src/editor/methods/textToSpecifics.cjs.map +1 -1
  231. package/dist/production/src/editor/methods/textToSpecifics.js.map +1 -1
  232. package/dist/production/src/editor/methods/toLatestFormat.cjs +1 -3
  233. package/dist/production/src/editor/methods/toLatestFormat.cjs.map +1 -1
  234. package/dist/production/src/editor/methods/toLatestFormat.js +1 -3
  235. package/dist/production/src/editor/methods/toLatestFormat.js.map +1 -1
  236. package/dist/production/src/editor/methods/topLevelNodes.cjs.map +1 -1
  237. package/dist/production/src/editor/methods/topLevelNodes.js.map +1 -1
  238. package/dist/production/src/internal/components/DefaultElement.cjs.map +1 -1
  239. package/dist/production/src/internal/components/DefaultElement.js.map +1 -1
  240. package/dist/production/src/internal/hooks/useRichTextFieldNodes.cjs.map +1 -1
  241. package/dist/production/src/internal/hooks/useRichTextFieldNodes.js.map +1 -1
  242. package/dist/production/src/internal/utils/EditorPasteUtils.cjs.map +1 -1
  243. package/dist/production/src/internal/utils/EditorPasteUtils.js.map +1 -1
  244. package/dist/production/src/internal/utils/parseUrl.cjs.map +1 -1
  245. package/dist/production/src/internal/utils/parseUrl.js.map +1 -1
  246. package/dist/production/src/plugins/attributes/alignment/alignButton.cjs.map +1 -1
  247. package/dist/production/src/plugins/attributes/alignment/alignButton.js +1 -1
  248. package/dist/production/src/plugins/attributes/alignment/alignButton.js.map +1 -1
  249. package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.cjs +1 -3
  250. package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -1
  251. package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.js +1 -3
  252. package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -1
  253. package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -1
  254. package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -1
  255. package/dist/production/src/plugins/behaviour/paste/withPaste.cjs.map +1 -1
  256. package/dist/production/src/plugins/behaviour/paste/withPaste.js.map +1 -1
  257. package/dist/production/src/plugins/element/anchors/AnchorElement.cjs.map +1 -1
  258. package/dist/production/src/plugins/element/anchors/AnchorElement.js +1 -1
  259. package/dist/production/src/plugins/element/anchors/AnchorElement.js.map +1 -1
  260. package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -1
  261. package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -1
  262. package/dist/production/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -1
  263. package/dist/production/src/plugins/element/anchors/AnchorModifications.js.map +1 -1
  264. package/dist/production/src/plugins/element/anchors/withAnchors.cjs.map +1 -1
  265. package/dist/production/src/plugins/element/anchors/withAnchors.js.map +1 -1
  266. package/dist/production/src/plugins/element/headings/HeadingElement.cjs.map +1 -1
  267. package/dist/production/src/plugins/element/headings/HeadingElement.js.map +1 -1
  268. package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -1
  269. package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -1
  270. package/dist/production/src/plugins/element/headings/withHeadings.cjs.map +1 -1
  271. package/dist/production/src/plugins/element/headings/withHeadings.js.map +1 -1
  272. package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -1
  273. package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -1
  274. package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -1
  275. package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -1
  276. package/dist/production/src/plugins/element/lists/ListElement.cjs.map +1 -1
  277. package/dist/production/src/plugins/element/lists/ListElement.js.map +1 -1
  278. package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -1
  279. package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -1
  280. package/dist/production/src/plugins/element/lists/ListItemElement.cjs.map +1 -1
  281. package/dist/production/src/plugins/element/lists/ListItemElement.js.map +1 -1
  282. package/dist/production/src/plugins/element/lists/OrderedListElement.cjs +1 -1
  283. package/dist/production/src/plugins/element/lists/OrderedListElement.cjs.map +1 -1
  284. package/dist/production/src/plugins/element/lists/OrderedListElement.js +1 -1
  285. package/dist/production/src/plugins/element/lists/OrderedListElement.js.map +1 -1
  286. package/dist/production/src/plugins/element/lists/UnorderedListElement.cjs +1 -1
  287. package/dist/production/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -1
  288. package/dist/production/src/plugins/element/lists/UnorderedListElement.js +1 -1
  289. package/dist/production/src/plugins/element/lists/UnorderedListElement.js.map +1 -1
  290. package/dist/production/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -1
  291. package/dist/production/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -1
  292. package/dist/production/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -1
  293. package/dist/production/src/plugins/element/lists/transforms/indentListItem.js.map +1 -1
  294. package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -1
  295. package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -1
  296. package/dist/production/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -1
  297. package/dist/production/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -1
  298. package/dist/production/src/plugins/element/lists/withLists.cjs.map +1 -1
  299. package/dist/production/src/plugins/element/lists/withLists.js +1 -1
  300. package/dist/production/src/plugins/element/lists/withLists.js.map +1 -1
  301. package/dist/production/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -1
  302. package/dist/production/src/plugins/element/paragraphs/ParagraphElement.js +1 -1
  303. package/dist/production/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -1
  304. package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -1
  305. package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -1
  306. package/dist/production/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -1
  307. package/dist/production/src/plugins/element/paragraphs/withParagraphs.js.map +1 -1
  308. package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -1
  309. package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -1
  310. package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -1
  311. package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -1
  312. package/dist/production/src/plugins/element/tables/TableCellElement.cjs.map +1 -1
  313. package/dist/production/src/plugins/element/tables/TableCellElement.js.map +1 -1
  314. package/dist/production/src/plugins/element/tables/TableElement.cjs.map +1 -1
  315. package/dist/production/src/plugins/element/tables/TableElement.js +1 -1
  316. package/dist/production/src/plugins/element/tables/TableElement.js.map +1 -1
  317. package/dist/production/src/plugins/element/tables/TableElementSelection.cjs.map +1 -1
  318. package/dist/production/src/plugins/element/tables/TableElementSelection.js.map +1 -1
  319. package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +1 -1
  320. package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.js.map +1 -1
  321. package/dist/production/src/plugins/element/tables/TableModifications.cjs.map +1 -1
  322. package/dist/production/src/plugins/element/tables/TableModifications.js +1 -1
  323. package/dist/production/src/plugins/element/tables/TableModifications.js.map +1 -1
  324. package/dist/production/src/plugins/element/tables/TableRowElement.cjs.map +1 -1
  325. package/dist/production/src/plugins/element/tables/TableRowElement.js.map +1 -1
  326. package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -1
  327. package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -1
  328. package/dist/production/src/plugins/element/tables/withTables.cjs.map +1 -1
  329. package/dist/production/src/plugins/element/tables/withTables.js +2 -2
  330. package/dist/production/src/plugins/element/tables/withTables.js.map +1 -1
  331. package/dist/production/src/plugins/text/bold/boldMark.cjs.map +1 -1
  332. package/dist/production/src/plugins/text/bold/boldMark.js.map +1 -1
  333. package/dist/production/src/plugins/text/bold/withBold.cjs.map +1 -1
  334. package/dist/production/src/plugins/text/bold/withBold.js.map +1 -1
  335. package/dist/production/src/plugins/text/code/codeMark.cjs.map +1 -1
  336. package/dist/production/src/plugins/text/code/codeMark.js.map +1 -1
  337. package/dist/production/src/plugins/text/code/withCode.cjs.map +1 -1
  338. package/dist/production/src/plugins/text/code/withCode.js.map +1 -1
  339. package/dist/production/src/plugins/text/highlight/highlightMark.cjs.map +1 -1
  340. package/dist/production/src/plugins/text/highlight/highlightMark.js.map +1 -1
  341. package/dist/production/src/plugins/text/highlight/withHighlight.cjs.map +1 -1
  342. package/dist/production/src/plugins/text/highlight/withHighlight.js.map +1 -1
  343. package/dist/production/src/plugins/text/italic/italicMark.cjs.map +1 -1
  344. package/dist/production/src/plugins/text/italic/italicMark.js.map +1 -1
  345. package/dist/production/src/plugins/text/italic/withItalic.cjs.map +1 -1
  346. package/dist/production/src/plugins/text/italic/withItalic.js.map +1 -1
  347. package/dist/production/src/plugins/text/newline/withNewline.cjs.map +1 -1
  348. package/dist/production/src/plugins/text/newline/withNewline.js.map +1 -1
  349. package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -1
  350. package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -1
  351. package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -1
  352. package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -1
  353. package/dist/production/src/plugins/text/underline/underlineMark.cjs.map +1 -1
  354. package/dist/production/src/plugins/text/underline/underlineMark.js.map +1 -1
  355. package/dist/production/src/plugins/text/underline/withUnderline.cjs.map +1 -1
  356. package/dist/production/src/plugins/text/underline/withUnderline.js.map +1 -1
  357. package/dist/types/components/triggers/EditorGenericTrigger.d.ts.map +1 -1
  358. package/dist/types/editor/createEditor.d.ts.map +1 -1
  359. package/dist/types/editor/createEditorWithEssentials.d.ts.map +1 -1
  360. package/dist/types/editor/methods/addMarks.d.ts.map +1 -1
  361. package/dist/types/editor/methods/closest.d.ts +1 -1
  362. package/dist/types/editor/methods/closest.d.ts.map +1 -1
  363. package/dist/types/editor/methods/closestBlockEntry.d.ts +1 -1
  364. package/dist/types/editor/methods/closestBlockEntry.d.ts.map +1 -1
  365. package/dist/types/editor/methods/hasMarks.d.ts.map +1 -1
  366. package/dist/types/editor/methods/removeMarks.d.ts.map +1 -1
  367. package/dist/types/editor/methods/toLatestFormat.d.ts.map +1 -1
  368. package/dist/types/internal/hooks/useRichTextFieldNodes.d.ts.map +1 -1
  369. package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts.map +1 -1
  370. package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts.map +1 -1
  371. package/dist/types/plugins/behaviour/paste/withPaste.d.ts.map +1 -1
  372. package/dist/types/plugins/element/anchors/AnchorElement.d.ts +1 -1
  373. package/dist/types/plugins/element/anchors/AnchorElement.d.ts.map +1 -1
  374. package/dist/types/plugins/element/headings/HeadingElement.d.ts.map +1 -1
  375. package/dist/types/plugins/element/headings/withHeadings.d.ts.map +1 -1
  376. package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts +1 -1
  377. package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts.map +1 -1
  378. package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts.map +1 -1
  379. package/dist/types/plugins/element/lists/ListElement.d.ts.map +1 -1
  380. package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts.map +1 -1
  381. package/dist/types/plugins/element/lists/ListItemElement.d.ts.map +1 -1
  382. package/dist/types/plugins/element/lists/UnorderedListElement.d.ts.map +1 -1
  383. package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts.map +1 -1
  384. package/dist/types/plugins/element/lists/withLists.d.ts.map +1 -1
  385. package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts.map +1 -1
  386. package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts.map +1 -1
  387. package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts.map +1 -1
  388. package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts +1 -1
  389. package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts.map +1 -1
  390. package/dist/types/plugins/element/tables/TableCellElement.d.ts.map +1 -1
  391. package/dist/types/plugins/element/tables/TableElement.d.ts.map +1 -1
  392. package/dist/types/plugins/element/tables/TableModifications.d.ts.map +1 -1
  393. package/dist/types/plugins/element/tables/TableRowElement.d.ts.map +1 -1
  394. package/dist/types/plugins/element/tables/withTables.d.ts.map +1 -1
  395. package/dist/types/plugins/text/bold/withBold.d.ts.map +1 -1
  396. package/dist/types/plugins/text/code/withCode.d.ts.map +1 -1
  397. package/dist/types/plugins/text/highlight/withHighlight.d.ts.map +1 -1
  398. package/dist/types/plugins/text/italic/withItalic.d.ts.map +1 -1
  399. package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts.map +1 -1
  400. package/dist/types/plugins/text/underline/withUnderline.d.ts.map +1 -1
  401. package/dist/types/slate-types.d.ts +1 -1
  402. package/dist/types/slate-types.d.ts.map +1 -1
  403. package/dist/types/tsconfig.tsbuildinfo +1 -1
  404. package/dist/types/types/plugins.d.ts.map +1 -1
  405. package/package.json +13 -13
  406. package/src/components/RichTextEditor.tsx +1 -2
  407. package/src/components/triggers/EditorGenericTrigger.tsx +0 -1
  408. package/src/editor/createEditor.ts +0 -1
  409. package/src/editor/createEditorWithEssentials.tsx +23 -16
  410. package/src/editor/methods/addMarks.ts +1 -1
  411. package/src/editor/methods/closest.ts +1 -1
  412. package/src/editor/methods/closestBlockEntry.ts +1 -1
  413. package/src/editor/methods/hasMarks.ts +6 -4
  414. package/src/editor/methods/removeMarks.ts +1 -1
  415. package/src/editor/methods/toLatestFormat.ts +3 -5
  416. package/src/internal/hooks/useRichTextFieldNodes.ts +10 -11
  417. package/src/internal/utils/EditorPasteUtils.ts +3 -3
  418. package/src/plugins/attributes/alignment/alignButton.ts +1 -4
  419. package/src/plugins/behaviour/paste/HtmlDeserializer.ts +11 -16
  420. package/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts +5 -1
  421. package/src/plugins/behaviour/paste/withPaste.ts +0 -1
  422. package/src/plugins/element/anchors/AnchorElement.ts +1 -2
  423. package/src/plugins/element/anchors/AnchorHtmlDeserializer.ts +1 -1
  424. package/src/plugins/element/headings/HeadingElement.ts +0 -1
  425. package/src/plugins/element/headings/withHeadings.ts +1 -10
  426. package/src/plugins/element/horizonalRules/HorizontalRuleElement.ts +4 -2
  427. package/src/plugins/element/horizonalRules/withHorizontalRules.ts +1 -2
  428. package/src/plugins/element/lists/ListElement.ts +2 -1
  429. package/src/plugins/element/lists/ListHtmlDeserializer.ts +3 -1
  430. package/src/plugins/element/lists/ListItemElement.ts +1 -2
  431. package/src/plugins/element/lists/UnorderedListElement.ts +3 -1
  432. package/src/plugins/element/lists/transforms/indentListItem.ts +3 -12
  433. package/src/plugins/element/lists/withLists.ts +7 -16
  434. package/src/plugins/element/paragraphs/ParagraphElement.ts +2 -2
  435. package/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts +7 -4
  436. package/src/plugins/element/paragraphs/withParagraphs.ts +1 -2
  437. package/src/plugins/element/scrollTargets/ScrollTargetElement.ts +6 -5
  438. package/src/plugins/element/tables/TableCellElement.ts +1 -2
  439. package/src/plugins/element/tables/TableElement.ts +13 -2
  440. package/src/plugins/element/tables/TableModifications.ts +2 -9
  441. package/src/plugins/element/tables/TableRowElement.ts +2 -2
  442. package/src/plugins/element/tables/withTables.ts +20 -20
  443. package/src/plugins/text/bold/withBold.ts +0 -1
  444. package/src/plugins/text/code/withCode.ts +0 -1
  445. package/src/plugins/text/highlight/withHighlight.ts +0 -1
  446. package/src/plugins/text/italic/withItalic.ts +0 -1
  447. package/src/plugins/text/strikeThrough/withStrikeThrough.ts +0 -1
  448. package/src/plugins/text/underline/withUnderline.ts +0 -1
  449. package/src/slate-types.ts +16 -12
  450. package/src/types/htmlDeserializer.ts +2 -2
  451. package/src/types/plugins.ts +0 -2
@@ -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,IACX;AACO,WAAA,KAAK,UAAU,UAAU;AAAA,WACxB,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,6BAA6B;AAAA,EAAA;AAE/D;"}
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;AACJ,MAAI;AACH,UAAM,aAAqC;AAAA,MAC1C,eAAe,OAAO;AAAA,MACtB,UAAU;AAAA,IAAA;AAEX,WAAO,KAAK,UAAU,UAAU;AAAA,EACjC,SAAS,GAAG;AACX,UAAM,IAAI,MAAM,gBAAgB,6BAA6B;AAAA,EAC9D;AACD;"}
@@ -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,EAAA;AAEzD,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;AACrC,MAAI;AACJ,MAAI;AAGH,mBAAe,KAAK,MAAM,iBAAiB;AAAA,EAC5C,SAAS,GAAG;AACX,UAAM,IAAI,MAAM,gBAAgB,+BAA+B;AAAA,EAChE;AACA,SAAOA,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,EAAA;AAEzD,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;AACrC,MAAI;AACJ,MAAI;AAGH,mBAAe,KAAK,MAAM,iBAAiB;AAAA,EAC5C,SAAS,GAAG;AACX,UAAM,IAAI,MAAM,gBAAgB,+BAA+B;AAAA,EAChE;AACA,SAAO,eAAe,QAAQ,YAAY,EAAE;AAC7C;"}
@@ -1 +1 @@
1
- {"version":3,"file":"textToSpecifics.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/textToSpecifics.ts"],"sourcesContent":["import { Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const textToSpecifics = <Text extends SlateText = SlateText>(textNode: Text): TextSpecifics<Text> => {\n\tconst { text, ...specifics } = textNode\n\treturn specifics\n}\n"],"names":[],"mappings":";;AAGa,MAAA,kBAAkB,CAAqC,aAAwC;AAC3G,QAAM,EAAE,MAAM,GAAG,UAAA,IAAc;AACxB,SAAA;AACR;;"}
1
+ {"version":3,"file":"textToSpecifics.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/textToSpecifics.ts"],"sourcesContent":["import { Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const textToSpecifics = <Text extends SlateText = SlateText>(textNode: Text): TextSpecifics<Text> => {\n\tconst { text, ...specifics } = textNode\n\treturn specifics\n}\n"],"names":[],"mappings":";;AAGO,MAAM,kBAAkB,CAAqC,aAAwC;AAC3G,QAAM,EAAE,MAAM,GAAG,UAAA,IAAc;AAC/B,SAAO;AACR;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"textToSpecifics.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/textToSpecifics.ts"],"sourcesContent":["import { Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const textToSpecifics = <Text extends SlateText = SlateText>(textNode: Text): TextSpecifics<Text> => {\n\tconst { text, ...specifics } = textNode\n\treturn specifics\n}\n"],"names":[],"mappings":"AAGa,MAAA,kBAAkB,CAAqC,aAAwC;AAC3G,QAAM,EAAE,MAAM,GAAG,UAAA,IAAc;AACxB,SAAA;AACR;"}
1
+ {"version":3,"file":"textToSpecifics.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/textToSpecifics.ts"],"sourcesContent":["import { Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const textToSpecifics = <Text extends SlateText = SlateText>(textNode: Text): TextSpecifics<Text> => {\n\tconst { text, ...specifics } = textNode\n\treturn specifics\n}\n"],"names":[],"mappings":"AAGO,MAAM,kBAAkB,CAAqC,aAAwC;AAC3G,QAAM,EAAE,MAAM,GAAG,UAAA,IAAc;AAC/B,SAAO;AACR;"}
@@ -13,9 +13,7 @@ const toLatestFormat = (editor, potentiallyOldNode) => {
13
13
  for (; formatNumber < editor.formatVersion; formatNumber++) {
14
14
  potentiallyOldNode = {
15
15
  formatVersion: formatNumber + 1,
16
- children: potentiallyOldNode.children.map(
17
- (oldChild) => editor.upgradeFormatBySingleVersion(oldChild, formatNumber)
18
- )
16
+ children: potentiallyOldNode.children.map((oldChild) => editor.upgradeFormatBySingleVersion(oldChild, formatNumber))
19
17
  };
20
18
  }
21
19
  return potentiallyOldNode;
@@ -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,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
+ {"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 => editor.upgradeFormatBySingleVersion(oldChild, formatNumber)) 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":";;;AAIO,MAAM,iBAAiB,CAC7B,QACA,uBAC4B;AAC5B,MAAI,mBAAmB,kBAAkB,OAAO,eAAe;AAC9D,WAAO;AAAA,EACR;AACA,MAAI,mBAAmB,gBAAgB,OAAO,eAAe;AAE5D,WAAO;AAAA,EACR;AACA,MAAI,eAAe,mBAAmB;AACtC,MAAI;AACH,WAAO,eAAe,OAAO,eAAe,gBAAgB;AAC3D,2BAAqB;AAAA,QACpB,eAAe,eAAe;AAAA,QAC9B,UAAU,mBAAmB,SAAS,IAAI,cAAY,OAAO,6BAA6B,UAAU,YAAY,CAAC;AAAA,MAAA;AAAA,IAEnH;AACA,WAAO;AAAA,EACR,SAAS,GAAG;AACX,UAAM,iBAAiB,gDAAgD,YAAY;AACnF,QAAI,aAAa,YAAY;AAC5B,YAAM,IAAIA,aAAAA;AAAAA,QACT,GAAG,cAAc;AAAA;AAAA,MAAA;AAAA,IAGnB;AACA,UAAM,IAAIA,aAAAA,aAAa,cAAc;AAAA,EACtC;AACD;;"}
@@ -11,9 +11,7 @@ const toLatestFormat = (editor, potentiallyOldNode) => {
11
11
  for (; formatNumber < editor.formatVersion; formatNumber++) {
12
12
  potentiallyOldNode = {
13
13
  formatVersion: formatNumber + 1,
14
- children: potentiallyOldNode.children.map(
15
- (oldChild) => editor.upgradeFormatBySingleVersion(oldChild, formatNumber)
16
- )
14
+ children: potentiallyOldNode.children.map((oldChild) => editor.upgradeFormatBySingleVersion(oldChild, formatNumber))
17
15
  };
18
16
  }
19
17
  return potentiallyOldNode;
@@ -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,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
+ {"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 => editor.upgradeFormatBySingleVersion(oldChild, formatNumber)) 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":";AAIO,MAAM,iBAAiB,CAC7B,QACA,uBAC4B;AAC5B,MAAI,mBAAmB,kBAAkB,OAAO,eAAe;AAC9D,WAAO;AAAA,EACR;AACA,MAAI,mBAAmB,gBAAgB,OAAO,eAAe;AAE5D,WAAO;AAAA,EACR;AACA,MAAI,eAAe,mBAAmB;AACtC,MAAI;AACH,WAAO,eAAe,OAAO,eAAe,gBAAgB;AAC3D,2BAAqB;AAAA,QACpB,eAAe,eAAe;AAAA,QAC9B,UAAU,mBAAmB,SAAS,IAAI,cAAY,OAAO,6BAA6B,UAAU,YAAY,CAAC;AAAA,MAAA;AAAA,IAEnH;AACA,WAAO;AAAA,EACR,SAAS,GAAG;AACX,UAAM,iBAAiB,gDAAgD,YAAY;AACnF,QAAI,aAAa,YAAY;AAC5B,YAAM,IAAI;AAAA,QACT,GAAG,cAAc;AAAA;AAAA,MAAA;AAAA,IAGnB;AACA,UAAM,IAAI,aAAa,cAAc;AAAA,EACtC;AACD;"}
@@ -1 +1 @@
1
- {"version":3,"file":"topLevelNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/topLevelNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement } from 'slate'\n\nexport const topLevelNodes = <E extends SlateEditor>(editor: E) => {\n\t// We manually filter out void nodes because it appears that Slate doesn't respect the voids setting from here.\n\t// The combination of isElement and mode: 'highest' is really just a roundabout way of excluding the Editor.\n\treturn SlateEditor.nodes(editor, {\n\t\tmatch: node => SlateElement.isElement(node) && !editor.isVoid(node),\n\t\tmode: 'highest',\n\t\tvoids: false,\n\t})\n}\n"],"names":["SlateEditor","SlateElement"],"mappings":";;;AAEa,MAAA,gBAAgB,CAAwB,WAAc;AAG3D,SAAAA,MAAA,OAAY,MAAM,QAAQ;AAAA,IAChC,OAAO,UAAQC,MAAAA,QAAa,UAAU,IAAI,KAAK,CAAC,OAAO,OAAO,IAAI;AAAA,IAClE,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,CACP;AACF;;"}
1
+ {"version":3,"file":"topLevelNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/topLevelNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement } from 'slate'\n\nexport const topLevelNodes = <E extends SlateEditor>(editor: E) => {\n\t// We manually filter out void nodes because it appears that Slate doesn't respect the voids setting from here.\n\t// The combination of isElement and mode: 'highest' is really just a roundabout way of excluding the Editor.\n\treturn SlateEditor.nodes(editor, {\n\t\tmatch: node => SlateElement.isElement(node) && !editor.isVoid(node),\n\t\tmode: 'highest',\n\t\tvoids: false,\n\t})\n}\n"],"names":["SlateEditor","SlateElement"],"mappings":";;;AAEO,MAAM,gBAAgB,CAAwB,WAAc;AAGlE,SAAOA,MAAAA,OAAY,MAAM,QAAQ;AAAA,IAChC,OAAO,UAAQC,MAAAA,QAAa,UAAU,IAAI,KAAK,CAAC,OAAO,OAAO,IAAI;AAAA,IAClE,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,CACP;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"topLevelNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/topLevelNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement } from 'slate'\n\nexport const topLevelNodes = <E extends SlateEditor>(editor: E) => {\n\t// We manually filter out void nodes because it appears that Slate doesn't respect the voids setting from here.\n\t// The combination of isElement and mode: 'highest' is really just a roundabout way of excluding the Editor.\n\treturn SlateEditor.nodes(editor, {\n\t\tmatch: node => SlateElement.isElement(node) && !editor.isVoid(node),\n\t\tmode: 'highest',\n\t\tvoids: false,\n\t})\n}\n"],"names":["SlateEditor","SlateElement"],"mappings":";AAEa,MAAA,gBAAgB,CAAwB,WAAc;AAG3D,SAAAA,OAAY,MAAM,QAAQ;AAAA,IAChC,OAAO,UAAQC,QAAa,UAAU,IAAI,KAAK,CAAC,OAAO,OAAO,IAAI;AAAA,IAClE,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,CACP;AACF;"}
1
+ {"version":3,"file":"topLevelNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/topLevelNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement } from 'slate'\n\nexport const topLevelNodes = <E extends SlateEditor>(editor: E) => {\n\t// We manually filter out void nodes because it appears that Slate doesn't respect the voids setting from here.\n\t// The combination of isElement and mode: 'highest' is really just a roundabout way of excluding the Editor.\n\treturn SlateEditor.nodes(editor, {\n\t\tmatch: node => SlateElement.isElement(node) && !editor.isVoid(node),\n\t\tmode: 'highest',\n\t\tvoids: false,\n\t})\n}\n"],"names":["SlateEditor","SlateElement"],"mappings":";AAEO,MAAM,gBAAgB,CAAwB,WAAc;AAGlE,SAAOA,OAAY,MAAM,QAAQ;AAAA,IAChC,OAAO,UAAQC,QAAa,UAAU,IAAI,KAAK,CAAC,OAAO,OAAO,IAAI;AAAA,IAClE,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,CACP;AACF;"}
@@ -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,eAAe;AAEvB,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,eAAA;AAEf,SAAOC,MAAAA,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,eAAe;AAEvB,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,eAAA;AAEf,SAAO,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,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
+ {"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[] = fieldValue === null || fieldValue === ''\n\t\t? [editor.createDefaultElement([{ text: '' }])]\n\t\t: [\n\t\t\teditor.createDefaultElement(\n\t\t\t\teditor.deserializeNodes(\n\t\t\t\t\tfieldValue,\n\t\t\t\t\t`RichTextField: the underlying field contains invalid JSON.`,\n\t\t\t\t) as Descendant[],\n\t\t\t),\n\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;AACtD,MAAI,2BAA2B,IAAI,aAAa,GAAG;AAClD,WAAO,2BAA2B,IAAI,aAAa;AAAA,EACpD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AAC1D,UAAM,IAAIA,aAAAA,aAAa,sEAAsE;AAAA,EAC9F;AAEA,QAAM,WAAyB,eAAe,QAAQ,eAAe,KAClE,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAA,CAAI,CAAC,CAAC,IAC5C;AAAA,IACD,OAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA;AAAA,MAAA;AAAA,IACD;AAAA,EACD;AAEF,6BAA2B,IAAI,eAAe,QAAQ;AAEtD,SAAO;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,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
+ {"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[] = fieldValue === null || fieldValue === ''\n\t\t? [editor.createDefaultElement([{ text: '' }])]\n\t\t: [\n\t\t\teditor.createDefaultElement(\n\t\t\t\teditor.deserializeNodes(\n\t\t\t\t\tfieldValue,\n\t\t\t\t\t`RichTextField: the underlying field contains invalid JSON.`,\n\t\t\t\t) as Descendant[],\n\t\t\t),\n\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;AACtD,MAAI,2BAA2B,IAAI,aAAa,GAAG;AAClD,WAAO,2BAA2B,IAAI,aAAa;AAAA,EACpD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AAC1D,UAAM,IAAI,aAAa,sEAAsE;AAAA,EAC9F;AAEA,QAAM,WAAyB,eAAe,QAAQ,eAAe,KAClE,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAA,CAAI,CAAC,CAAC,IAC5C;AAAA,IACD,OAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA;AAAA,MAAA;AAAA,IACD;AAAA,EACD;AAEF,6BAA2B,IAAI,eAAe,QAAQ;AAEtD,SAAO;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,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
+ {"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|| (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;AACf,QAAI,gBAAgB,MAAM,KAAK,QAAQ;AACvC,QACE,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UACzD,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAAU,cAAc,CAAC,EAAE,aAAa,OACvG;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;AAClB,mBAAW;AAAA,MACZ,OAAO;AACN,cAAM,cAAc,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAC9E,YAAI,aAAa;AAChB,qBAAW;AAAA,QACZ,OAAO;AACN,cAAI,CAAC,UAAU;AACd,kBAAM,KAAK,IAAI;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAAA,EAEA,OAAc,qBAAqB,UAA2B,uBAAmE;AAChI,UAAM,mBAAmB,SAAS,OAAO,CAAC,SAA+C,SAAS,IAAI;AACtG,UAAM,gBAAgB,iBAAiB,KAAK,CAAC,EAAE,eAAe,aAAa,MAAS,MAAM;AAE1F,QAAI,eAAe;AAClB,aAAO;AAAA,QACN,UAAU,iBAAiB,QAAiB,CAAA,SAAQ;AACnD,cAAI,KAAK,aAAa,QAAW;AAChC,mBAAO,CAAC,sBAAsB,KAAK,KAAK,CAAC;AAAA,UAC1C,OAAO;AACN,mBAAO,KAAK;AAAA,UACb;AAAA,QACD,CAAC;AAAA,MAAA;AAAA,IAEH,OAAO;AACN,aAAO,EAAE,OAAO,iBAAiB,QAAQ,CAAA,SAAQ,KAAK,KAAM,EAAA;AAAA,IAC7D;AAAA,EACD;AACD;;"}
@@ -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,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
+ {"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|| (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;AACf,QAAI,gBAAgB,MAAM,KAAK,QAAQ;AACvC,QACE,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UACzD,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAAU,cAAc,CAAC,EAAE,aAAa,OACvG;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;AAClB,mBAAW;AAAA,MACZ,OAAO;AACN,cAAM,cAAc,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAC9E,YAAI,aAAa;AAChB,qBAAW;AAAA,QACZ,OAAO;AACN,cAAI,CAAC,UAAU;AACd,kBAAM,KAAK,IAAI;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AACA,WAAO;AAAA,EACR;AAAA,EAEA,OAAc,qBAAqB,UAA2B,uBAAmE;AAChI,UAAM,mBAAmB,SAAS,OAAO,CAAC,SAA+C,SAAS,IAAI;AACtG,UAAM,gBAAgB,iBAAiB,KAAK,CAAC,EAAE,eAAe,aAAa,MAAS,MAAM;AAE1F,QAAI,eAAe;AAClB,aAAO;AAAA,QACN,UAAU,iBAAiB,QAAiB,CAAA,SAAQ;AACnD,cAAI,KAAK,aAAa,QAAW;AAChC,mBAAO,CAAC,sBAAsB,KAAK,KAAK,CAAC;AAAA,UAC1C,OAAO;AACN,mBAAO,KAAK;AAAA,UACb;AAAA,QACD,CAAC;AAAA,MAAA;AAAA,IAEH,OAAO;AACN,aAAO,EAAE,OAAO,iBAAiB,QAAQ,CAAA,SAAQ,KAAK,KAAM,EAAA;AAAA,IAC7D;AAAA,EACD;AACD;"}
@@ -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,EAAA;AAEJ,MAAA;AACI,WAAA,IAAI,IAAI,GAAG;AAAA,EAAA,QACX;AACA,WAAA;AAAA,EAAA;AAET;;"}
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":";;AAAO,MAAM,WAAW,CAAC,QAAiC;AACzD,MAAI,IAAI,SAAS,KAAK,IAAI,SAAS,GAAG,GAAG;AAIxC,WAAO;AAAA,EACR;AACA,MAAI;AACH,WAAO,IAAI,IAAI,GAAG;AAAA,EACnB,QAAQ;AACP,WAAO;AAAA,EACR;AACD;;"}
@@ -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,EAAA;AAEJ,MAAA;AACI,WAAA,IAAI,IAAI,GAAG;AAAA,EAAA,QACX;AACA,WAAA;AAAA,EAAA;AAET;"}
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":"AAAO,MAAM,WAAW,CAAC,QAAiC;AACzD,MAAI,IAAI,SAAS,KAAK,IAAI,SAAS,GAAG,GAAG;AAIxC,WAAO;AAAA,EACR;AACA,MAAI;AACH,WAAO,IAAI,IAAI,GAAG;AAAA,EACnB,QAAQ;AACP,WAAO;AAAA,EACR;AACD;"}
@@ -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,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
+ {"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} => ({\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"],"names":["SlateElement","Editor","Transforms"],"mappings":";;;AAIA,MAAM,gBAAgB,CAAC,QAAgB,IAAU,cAChDA,MAAAA,QAAa,UAAU,EAAE,KACtB,OAAO,kBAAkB,GAAG,MAAM,EAAE,OAAO,WAAW;AAEnD,MAAM,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,CAAA,OAAM,cAAc,QAAQ,IAAI,SAAS,KAAM,GAAW,UAAU,WAAW,CAAC,EAAE,SAAS;AAAA,EAC5I;AAAA,EACA,QAAQ,CAAC,EAAE,aAAa;AACvBC,UAAAA,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,4 +1,4 @@
1
- import { Editor, Transforms, Element } from "slate";
1
+ import { Transforms, Editor, Element } from "slate";
2
2
  const isAlignTarget = (editor, it, direction) => Element.isElement(it) && editor.acceptsAttributes(it.type, { align: direction });
3
3
  const createAlignHandler = (direction) => ({
4
4
  shouldDisplay: ({ editor }) => {
@@ -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,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
+ {"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} => ({\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"],"names":["SlateElement"],"mappings":";AAIA,MAAM,gBAAgB,CAAC,QAAgB,IAAU,cAChDA,QAAa,UAAU,EAAE,KACtB,OAAO,kBAAkB,GAAG,MAAM,EAAE,OAAO,WAAW;AAEnD,MAAM,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,CAAA,OAAM,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;"}
@@ -53,9 +53,7 @@ class HtmlDeserializer {
53
53
  } else if (item.element !== void 0) {
54
54
  return [item.element];
55
55
  }
56
- {
57
- return [];
58
- }
56
+ return [];
59
57
  })
60
58
  };
61
59
  } else {
@@ -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":"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"}
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 = childNode instanceof HTMLElement\n\t\t\t\t? this.processBlockPaste(\n\t\t\t\t\tchildNode,\n\t\t\t\t\tcumulativeTextAttrs,\n\t\t\t\t)\n\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? deserializedChildren.texts.map(text => ({ text, isWhiteSpace }))\n\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\treturn []\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\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) => this.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":"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"}
@@ -51,9 +51,7 @@ class HtmlDeserializer {
51
51
  } else if (item.element !== void 0) {
52
52
  return [item.element];
53
53
  }
54
- {
55
- return [];
56
- }
54
+ return [];
57
55
  })
58
56
  };
59
57
  } else {
@@ -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":"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"}
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 = childNode instanceof HTMLElement\n\t\t\t\t? this.processBlockPaste(\n\t\t\t\t\tchildNode,\n\t\t\t\t\tcumulativeTextAttrs,\n\t\t\t\t)\n\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? deserializedChildren.texts.map(text => ({ text, isWhiteSpace }))\n\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\treturn []\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\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) => this.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":"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"}
@@ -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,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
+ {"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 = (\n\tmarkType: string,\n\ttagMatcher: (el: HTMLElement) => boolean,\n\tattributeMatcher: (el: HTMLElement) => boolean,\n): 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,CACzC,UACA,YACA,sBAC6B;AAAA,EAC7B,wBAAwB,CAAC,EAAE,SAAS,qBAAqB,UAAU;AAClE,WAAO,iBAAiB,OAAO,IAAI,EAAE,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAA,IAAS;AAAA,EACnE;AAAA,EACA,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC/D,QAAI,WAAW,OAAO,GAAG;AACxB,aAAO,KAAK,QAAQ,YAAY,EAAE,GAAG,qBAAqB,CAAC,QAAQ,GAAG,MAAM;AAAA,IAC7E;AACA,WAAO;AAAA,EACR;AACD;;"}
@@ -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,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
+ {"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 = (\n\tmarkType: string,\n\ttagMatcher: (el: HTMLElement) => boolean,\n\tattributeMatcher: (el: HTMLElement) => boolean,\n): 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,CACzC,UACA,YACA,sBAC6B;AAAA,EAC7B,wBAAwB,CAAC,EAAE,SAAS,qBAAqB,UAAU;AAClE,WAAO,iBAAiB,OAAO,IAAI,EAAE,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAA,IAAS;AAAA,EACnE;AAAA,EACA,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC/D,QAAI,WAAW,OAAO,GAAG;AACxB,aAAO,KAAK,QAAQ,YAAY,EAAE,GAAG,qBAAqB,CAAC,QAAQ,GAAG,MAAM;AAAA,IAC7E;AACA,WAAO;AAAA,EACR;AACD;"}
@@ -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,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
+ {"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\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":";;;;AAKO,MAAM,YAAY,CAAC,WAAmB;AAC5C,QAAM,EAAE,eAAe;AACvB,QAAM,mBAAmB,IAAIA,iBAAAA,iBAAiB,OAAO,sBAAsB,CAAA,CAAE;AAC7E,SAAO,aAAa,CAAA,SAAQ;AAC3B,QAAI,KAAK,QAAQ,8BAA8B,GAAG;AACjD,aAAO,WAAW,IAAI;AAAA,IACvB;AACA,UAAM,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,CAAA,CAAE;AAC3DC,qBAAW,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,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
+ {"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\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":";;AAKO,MAAM,YAAY,CAAC,WAAmB;AAC5C,QAAM,EAAE,eAAe;AACvB,QAAM,mBAAmB,IAAI,iBAAiB,OAAO,sBAAsB,CAAA,CAAE;AAC7E,SAAO,aAAa,CAAA,SAAQ;AAC3B,QAAI,KAAK,QAAQ,8BAA8B,GAAG;AACjD,aAAO,WAAW,IAAI;AAAA,IACvB;AACA,UAAM,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,CAAA,CAAE;AAC3D,eAAW,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,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
+ {"version":3,"file":"AnchorElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, 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\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;AAQ1B,MAAM,kBAAkB,CAAC,YAAiDA,MAAAA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE9H,MAAM,wBAAwB,CAAC,WAAmB;AACxD,QAAM,CAAC,IAAI,IAAIC,aAAO,MAAM,QAAQ,EAAE,OAAO,iBAAiB;AAC9D,SAAO,CAAC,CAAC;AACV;AAEO,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;AACxC,QAAI,sBAAsB,MAAM,GAAG;AAClCC,0BAAAA,oBAAoB,aAAa,MAAM;AAAA,IACxC,OAAO;AACN,YAAM,OAAO,UAAU,QAAQ,OAAO,iBAAiB;AACvD,UAAI,CAAC,MAAM;AACV;AAAA,MACD;AACAA,8CAAoB,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,YAAAA,WAAW,YAAY,QAAQ;AAAA,QAC9B,IAAI;AAAA,MAAA,CACJ;AACD,UAAI,aAAaC,MAAAA,MAAW,YAAY,SAAS,KAAKC,MAAAA,KAAK,SAAS,MAAM,UAAU,MAAM,IAAI,GAAG;AAChGF,cAAAA,WAAW,OAAO,QAAQE,MAAAA,KAAK,OAAO,IAAI,CAAC;AAAA,MAC5C;AACA,aAAO,eAAA;AAAA,IACR;AAAA,EACD;AACD;;;;;"}
@@ -1,4 +1,4 @@
1
- import { Element, Editor, Node, Transforms, Range, Path } from "slate";
1
+ import { Node, Transforms, Range, Path, Element, Editor } from "slate";
2
2
  import { AnchorModifications } from "./AnchorModifications.js";
3
3
  const anchorElementType = "anchor";
4
4
  const isAnchorElement = (element) => Element.isElement(element) && element.type === anchorElementType;
@@ -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,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
+ {"version":3,"file":"AnchorElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/anchors/AnchorElement.ts"],"sourcesContent":["import { Editor, Editor as SlateEditor, 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\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;AAQ1B,MAAM,kBAAkB,CAAC,YAAiDA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS;AAE9H,MAAM,wBAAwB,CAAC,WAAmB;AACxD,QAAM,CAAC,IAAI,IAAI,OAAO,MAAM,QAAQ,EAAE,OAAO,iBAAiB;AAC9D,SAAO,CAAC,CAAC;AACV;AAEO,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;AACxC,QAAI,sBAAsB,MAAM,GAAG;AAClC,0BAAoB,aAAa,MAAM;AAAA,IACxC,OAAO;AACN,YAAM,OAAO,UAAU,QAAQ,OAAO,iBAAiB;AACvD,UAAI,CAAC,MAAM;AACV;AAAA,MACD;AACA,0BAAoB,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;AACD,UAAI,aAAaC,MAAW,YAAY,SAAS,KAAK,KAAK,SAAS,MAAM,UAAU,MAAM,IAAI,GAAG;AAChG,mBAAW,OAAO,QAAQ,KAAK,OAAO,IAAI,CAAC;AAAA,MAC5C;AACA,aAAO,eAAA;AAAA,IACR;AAAA,EACD;AACD;"}
@@ -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,QAAA;AAAA,MAExD;AAAA,IAAA;AAEM,WAAA;AAAA,EAAA;AAET;;"}
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,yBAAiD;AAAA,EAC7D,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC/D,QAAI,QAAQ,YAAY,OAAO,QAAQ,aAAa,MAAM,GAAG;AAC5D,YAAM,OAAO,QAAQ,aAAa,MAAM;AAExC,aAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN;AAAA,UACA,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AACA,WAAO;AAAA,EACR;AACD;;"}
@@ -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,QAAA;AAAA,MAExD;AAAA,IAAA;AAEM,WAAA;AAAA,EAAA;AAET;"}
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,yBAAiD;AAAA,EAC7D,oBAAoB,CAAC,EAAE,SAAS,MAAM,0BAA0B;AAC/D,QAAI,QAAQ,YAAY,OAAO,QAAQ,aAAa,MAAM,GAAG;AAC5D,YAAM,OAAO,QAAQ,aAAa,MAAM;AAExC,aAAO;AAAA,QACN;AAAA,UACC,MAAM;AAAA,UACN;AAAA,UACA,UAAU,KAAK,QAAQ,YAAY,mBAAmB;AAAA,QAAA;AAAA,MACvD;AAAA,IAEF;AACA,WAAO;AAAA,EACR;AACD;"}
@@ -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,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
+ {"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,cAAAA,iBAAiB;AAAA,EAC1D;AAAA,EAEA,OAAc,WAAW,QAAgB,KAAa;AACrD,QAAIC,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,IAAA,CAAK,IAAI,CAAC,EAAE,MAAM,GAAA,CAAI;AAAA,IAAA;AAGxD,QAAI,aAAa;AAChBH,uBAAW,YAAY,QAAQ,MAAM;AAAA,IACtC,OAAO;AACNA,YAAAA,WAAW,UAAU,QAAQ,QAAQ,EAAE,OAAO,MAAM;AACpDA,YAAAA,WAAW,SAAS,QAAQ,EAAE,MAAM,OAAO;AAAA,IAC5C;AAAA,EACD;AACD;;"}
@@ -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,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
+ {"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,EAC1D;AAAA,EAEA,OAAc,WAAW,QAAgB,KAAa;AACrD,QAAI,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,IAAA,CAAK,IAAI,CAAC,EAAE,MAAM,GAAA,CAAI;AAAA,IAAA;AAGxD,QAAI,aAAa;AAChB,iBAAW,YAAY,QAAQ,MAAM;AAAA,IACtC,OAAO;AACN,iBAAW,UAAU,QAAQ,QAAQ,EAAE,OAAO,MAAM;AACpD,iBAAW,SAAS,QAAQ,EAAE,MAAM,OAAO;AAAA,IAC5C;AAAA,EACD;AACD;"}
@@ -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,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
+ {"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,OAAA,MAAyD,CAAmB,WAAiB;AAC1H,QAAM,EAAE,eAAe;AAEvB,SAAO,gBAAgBA,cAAAA,oBAAoB,EAAE,OAAA,CAAQ,CAAC;AACtD,SAAO,iBAAiB,eAAeC,6CAAsB;AAE7D,SAAO,aAAa,CAAA,SAAQ;AAC3B,QAAI,QAAQC,SAAAA,SAAS,IAAI,MAAM,QAAW;AACzCC,8CAAoB,WAAW,QAAQ,IAAI;AAAA,IAC5C,OAAO;AACN,iBAAW,IAAI;AAAA,IAChB;AAAA,EACD;AAEA,SAAO;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,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
+ {"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,OAAA,MAAyD,CAAmB,WAAiB;AAC1H,QAAM,EAAE,eAAe;AAEvB,SAAO,gBAAgB,oBAAoB,EAAE,OAAA,CAAQ,CAAC;AACtD,SAAO,iBAAiB,eAAe,sBAAsB;AAE7D,SAAO,aAAa,CAAA,SAAQ;AAC3B,QAAI,QAAQ,SAAS,IAAI,MAAM,QAAW;AACzC,0BAAoB,WAAW,QAAQ,IAAI;AAAA,IAC5C,OAAO;AACN,iBAAW,IAAI;AAAA,IAChB;AAAA,EACD;AAEA,SAAO;AACR;"}