@contember/react-slate-editor-base 2.1.0-alpha.30 → 2.1.0-alpha.36
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.
- package/package.json +15 -15
- package/src/components/RichTextEditor.tsx +1 -2
- package/src/components/triggers/EditorGenericTrigger.tsx +0 -1
- package/src/editor/createEditor.ts +0 -1
- package/src/editor/createEditorWithEssentials.tsx +23 -16
- package/src/editor/methods/addMarks.ts +1 -1
- package/src/editor/methods/closest.ts +1 -1
- package/src/editor/methods/closestBlockEntry.ts +1 -1
- package/src/editor/methods/hasMarks.ts +6 -4
- package/src/editor/methods/removeMarks.ts +1 -1
- package/src/editor/methods/toLatestFormat.ts +3 -5
- package/src/internal/hooks/useRichTextFieldNodes.ts +10 -11
- package/src/internal/utils/EditorPasteUtils.ts +3 -3
- package/src/plugins/attributes/alignment/alignButton.ts +1 -4
- package/src/plugins/behaviour/paste/HtmlDeserializer.ts +11 -16
- package/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts +5 -1
- package/src/plugins/behaviour/paste/withPaste.ts +0 -1
- package/src/plugins/element/anchors/AnchorElement.ts +1 -2
- package/src/plugins/element/anchors/AnchorHtmlDeserializer.ts +1 -1
- package/src/plugins/element/headings/HeadingElement.ts +0 -1
- package/src/plugins/element/headings/withHeadings.ts +1 -10
- package/src/plugins/element/horizonalRules/HorizontalRuleElement.ts +4 -2
- package/src/plugins/element/horizonalRules/withHorizontalRules.ts +1 -2
- package/src/plugins/element/lists/ListElement.ts +2 -1
- package/src/plugins/element/lists/ListHtmlDeserializer.ts +3 -1
- package/src/plugins/element/lists/ListItemElement.ts +1 -2
- package/src/plugins/element/lists/UnorderedListElement.ts +3 -1
- package/src/plugins/element/lists/transforms/indentListItem.ts +3 -12
- package/src/plugins/element/lists/withLists.ts +7 -16
- package/src/plugins/element/paragraphs/ParagraphElement.ts +2 -2
- package/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts +7 -4
- package/src/plugins/element/paragraphs/withParagraphs.ts +1 -2
- package/src/plugins/element/scrollTargets/ScrollTargetElement.ts +6 -5
- package/src/plugins/element/tables/TableCellElement.ts +1 -2
- package/src/plugins/element/tables/TableElement.ts +13 -2
- package/src/plugins/element/tables/TableModifications.ts +2 -9
- package/src/plugins/element/tables/TableRowElement.ts +2 -2
- package/src/plugins/element/tables/withTables.ts +20 -20
- package/src/plugins/text/bold/withBold.ts +0 -1
- package/src/plugins/text/code/withCode.ts +0 -1
- package/src/plugins/text/highlight/withHighlight.ts +0 -1
- package/src/plugins/text/italic/withItalic.ts +0 -1
- package/src/plugins/text/strikeThrough/withStrikeThrough.ts +0 -1
- package/src/plugins/text/underline/withUnderline.ts +0 -1
- package/src/slate-types.ts +16 -12
- package/src/types/htmlDeserializer.ts +2 -2
- package/src/types/plugins.ts +0 -2
- package/dist/development/index.cjs +0 -139
- package/dist/development/index.cjs.map +0 -1
- package/dist/development/index.js +0 -136
- package/dist/development/index.js.map +0 -1
- package/dist/development/src/components/RichTextEditor.cjs +0 -105
- package/dist/development/src/components/RichTextEditor.cjs.map +0 -1
- package/dist/development/src/components/RichTextEditor.js +0 -105
- package/dist/development/src/components/RichTextEditor.js.map +0 -1
- package/dist/development/src/components/triggers/EditorElementTrigger.cjs +0 -20
- package/dist/development/src/components/triggers/EditorElementTrigger.cjs.map +0 -1
- package/dist/development/src/components/triggers/EditorElementTrigger.js +0 -20
- package/dist/development/src/components/triggers/EditorElementTrigger.js.map +0 -1
- package/dist/development/src/components/triggers/EditorGenericTrigger.cjs +0 -24
- package/dist/development/src/components/triggers/EditorGenericTrigger.cjs.map +0 -1
- package/dist/development/src/components/triggers/EditorGenericTrigger.js +0 -24
- package/dist/development/src/components/triggers/EditorGenericTrigger.js.map +0 -1
- package/dist/development/src/components/triggers/EditorMarkTrigger.cjs +0 -20
- package/dist/development/src/components/triggers/EditorMarkTrigger.cjs.map +0 -1
- package/dist/development/src/components/triggers/EditorMarkTrigger.js +0 -20
- package/dist/development/src/components/triggers/EditorMarkTrigger.js.map +0 -1
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.cjs +0 -32
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.cjs.map +0 -1
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.js +0 -32
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.js.map +0 -1
- package/dist/development/src/editor/createEditor.cjs +0 -35
- package/dist/development/src/editor/createEditor.cjs.map +0 -1
- package/dist/development/src/editor/createEditor.js +0 -35
- package/dist/development/src/editor/createEditor.js.map +0 -1
- package/dist/development/src/editor/createEditorWithEssentials.cjs +0 -227
- package/dist/development/src/editor/createEditorWithEssentials.cjs.map +0 -1
- package/dist/development/src/editor/createEditorWithEssentials.js +0 -211
- package/dist/development/src/editor/createEditorWithEssentials.js.map +0 -1
- package/dist/development/src/editor/index.cjs +0 -44
- package/dist/development/src/editor/index.cjs.map +0 -1
- package/dist/development/src/editor/index.js +0 -44
- package/dist/development/src/editor/index.js.map +0 -1
- package/dist/development/src/editor/methods/addMarks.cjs +0 -12
- package/dist/development/src/editor/methods/addMarks.cjs.map +0 -1
- package/dist/development/src/editor/methods/addMarks.js +0 -12
- package/dist/development/src/editor/methods/addMarks.js.map +0 -1
- package/dist/development/src/editor/methods/canToggleMark.cjs +0 -7
- package/dist/development/src/editor/methods/canToggleMark.cjs.map +0 -1
- package/dist/development/src/editor/methods/canToggleMark.js +0 -7
- package/dist/development/src/editor/methods/canToggleMark.js.map +0 -1
- package/dist/development/src/editor/methods/closest.cjs +0 -18
- package/dist/development/src/editor/methods/closest.cjs.map +0 -1
- package/dist/development/src/editor/methods/closest.js +0 -18
- package/dist/development/src/editor/methods/closest.js.map +0 -1
- package/dist/development/src/editor/methods/closestBlockEntry.cjs +0 -10
- package/dist/development/src/editor/methods/closestBlockEntry.cjs.map +0 -1
- package/dist/development/src/editor/methods/closestBlockEntry.js +0 -10
- package/dist/development/src/editor/methods/closestBlockEntry.js.map +0 -1
- package/dist/development/src/editor/methods/closestViableBlockContainerEntry.cjs +0 -9
- package/dist/development/src/editor/methods/closestViableBlockContainerEntry.cjs.map +0 -1
- package/dist/development/src/editor/methods/closestViableBlockContainerEntry.js +0 -9
- package/dist/development/src/editor/methods/closestViableBlockContainerEntry.js.map +0 -1
- package/dist/development/src/editor/methods/ejectElement.cjs +0 -15
- package/dist/development/src/editor/methods/ejectElement.cjs.map +0 -1
- package/dist/development/src/editor/methods/ejectElement.js +0 -15
- package/dist/development/src/editor/methods/ejectElement.js.map +0 -1
- package/dist/development/src/editor/methods/elementToSpecifics.cjs +0 -8
- package/dist/development/src/editor/methods/elementToSpecifics.cjs.map +0 -1
- package/dist/development/src/editor/methods/elementToSpecifics.js +0 -8
- package/dist/development/src/editor/methods/elementToSpecifics.js.map +0 -1
- package/dist/development/src/editor/methods/getElementDataAttributes.cjs +0 -13
- package/dist/development/src/editor/methods/getElementDataAttributes.cjs.map +0 -1
- package/dist/development/src/editor/methods/getElementDataAttributes.js +0 -13
- package/dist/development/src/editor/methods/getElementDataAttributes.js.map +0 -1
- package/dist/development/src/editor/methods/getPreviousSibling.cjs +0 -13
- package/dist/development/src/editor/methods/getPreviousSibling.cjs.map +0 -1
- package/dist/development/src/editor/methods/getPreviousSibling.js +0 -13
- package/dist/development/src/editor/methods/getPreviousSibling.js.map +0 -1
- package/dist/development/src/editor/methods/hasMarks.cjs +0 -23
- package/dist/development/src/editor/methods/hasMarks.cjs.map +0 -1
- package/dist/development/src/editor/methods/hasMarks.js +0 -23
- package/dist/development/src/editor/methods/hasMarks.js.map +0 -1
- package/dist/development/src/editor/methods/hasParentOfType.cjs +0 -15
- package/dist/development/src/editor/methods/hasParentOfType.cjs.map +0 -1
- package/dist/development/src/editor/methods/hasParentOfType.js +0 -15
- package/dist/development/src/editor/methods/hasParentOfType.js.map +0 -1
- package/dist/development/src/editor/methods/isElementType.cjs +0 -24
- package/dist/development/src/editor/methods/isElementType.cjs.map +0 -1
- package/dist/development/src/editor/methods/isElementType.js +0 -24
- package/dist/development/src/editor/methods/isElementType.js.map +0 -1
- package/dist/development/src/editor/methods/permissivelyDeserializeNodes.cjs +0 -22
- package/dist/development/src/editor/methods/permissivelyDeserializeNodes.cjs.map +0 -1
- package/dist/development/src/editor/methods/permissivelyDeserializeNodes.js +0 -22
- package/dist/development/src/editor/methods/permissivelyDeserializeNodes.js.map +0 -1
- package/dist/development/src/editor/methods/removeMarks.cjs +0 -12
- package/dist/development/src/editor/methods/removeMarks.cjs.map +0 -1
- package/dist/development/src/editor/methods/removeMarks.js +0 -12
- package/dist/development/src/editor/methods/removeMarks.js.map +0 -1
- package/dist/development/src/editor/methods/serializeNodes.cjs +0 -15
- package/dist/development/src/editor/methods/serializeNodes.cjs.map +0 -1
- package/dist/development/src/editor/methods/serializeNodes.js +0 -15
- package/dist/development/src/editor/methods/serializeNodes.js.map +0 -1
- package/dist/development/src/editor/methods/strictlyDeserializeNodes.cjs +0 -14
- package/dist/development/src/editor/methods/strictlyDeserializeNodes.cjs.map +0 -1
- package/dist/development/src/editor/methods/strictlyDeserializeNodes.js +0 -14
- package/dist/development/src/editor/methods/strictlyDeserializeNodes.js.map +0 -1
- package/dist/development/src/editor/methods/textToSpecifics.cjs +0 -8
- package/dist/development/src/editor/methods/textToSpecifics.cjs.map +0 -1
- package/dist/development/src/editor/methods/textToSpecifics.js +0 -8
- package/dist/development/src/editor/methods/textToSpecifics.js.map +0 -1
- package/dist/development/src/editor/methods/toLatestFormat.cjs +0 -34
- package/dist/development/src/editor/methods/toLatestFormat.cjs.map +0 -1
- package/dist/development/src/editor/methods/toLatestFormat.js +0 -34
- package/dist/development/src/editor/methods/toLatestFormat.js.map +0 -1
- package/dist/development/src/editor/methods/topLevelNodes.cjs +0 -12
- package/dist/development/src/editor/methods/topLevelNodes.cjs.map +0 -1
- package/dist/development/src/editor/methods/topLevelNodes.js +0 -12
- package/dist/development/src/editor/methods/topLevelNodes.js.map +0 -1
- package/dist/development/src/internal/components/DefaultElement.cjs +0 -11
- package/dist/development/src/internal/components/DefaultElement.cjs.map +0 -1
- package/dist/development/src/internal/components/DefaultElement.js +0 -11
- package/dist/development/src/internal/components/DefaultElement.js.map +0 -1
- package/dist/development/src/internal/hooks/useRichTextFieldNodes.cjs +0 -28
- package/dist/development/src/internal/hooks/useRichTextFieldNodes.cjs.map +0 -1
- package/dist/development/src/internal/hooks/useRichTextFieldNodes.js +0 -28
- package/dist/development/src/internal/hooks/useRichTextFieldNodes.js.map +0 -1
- package/dist/development/src/internal/utils/EditorPasteUtils.cjs +0 -47
- package/dist/development/src/internal/utils/EditorPasteUtils.cjs.map +0 -1
- package/dist/development/src/internal/utils/EditorPasteUtils.js +0 -47
- package/dist/development/src/internal/utils/EditorPasteUtils.js.map +0 -1
- package/dist/development/src/internal/utils/parseUrl.cjs +0 -14
- package/dist/development/src/internal/utils/parseUrl.cjs.map +0 -1
- package/dist/development/src/internal/utils/parseUrl.js +0 -14
- package/dist/development/src/internal/utils/parseUrl.js.map +0 -1
- package/dist/development/src/plugins/attributes/alignment/alignButton.cjs +0 -21
- package/dist/development/src/plugins/attributes/alignment/alignButton.cjs.map +0 -1
- package/dist/development/src/plugins/attributes/alignment/alignButton.js +0 -21
- package/dist/development/src/plugins/attributes/alignment/alignButton.js.map +0 -1
- package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.cjs +0 -138
- package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +0 -1
- package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.js +0 -138
- package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.js.map +0 -1
- package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs +0 -15
- package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +0 -1
- package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js +0 -15
- package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +0 -1
- package/dist/development/src/plugins/behaviour/paste/withPaste.cjs +0 -24
- package/dist/development/src/plugins/behaviour/paste/withPaste.cjs.map +0 -1
- package/dist/development/src/plugins/behaviour/paste/withPaste.js +0 -24
- package/dist/development/src/plugins/behaviour/paste/withPaste.js.map +0 -1
- package/dist/development/src/plugins/element/anchors/AnchorElement.cjs +0 -44
- package/dist/development/src/plugins/element/anchors/AnchorElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/anchors/AnchorElement.js +0 -44
- package/dist/development/src/plugins/element/anchors/AnchorElement.js.map +0 -1
- package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs +0 -19
- package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +0 -1
- package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.js +0 -19
- package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +0 -1
- package/dist/development/src/plugins/element/anchors/AnchorModifications.cjs +0 -29
- package/dist/development/src/plugins/element/anchors/AnchorModifications.cjs.map +0 -1
- package/dist/development/src/plugins/element/anchors/AnchorModifications.js +0 -29
- package/dist/development/src/plugins/element/anchors/AnchorModifications.js.map +0 -1
- package/dist/development/src/plugins/element/anchors/withAnchors.cjs +0 -21
- package/dist/development/src/plugins/element/anchors/withAnchors.cjs.map +0 -1
- package/dist/development/src/plugins/element/anchors/withAnchors.js +0 -21
- package/dist/development/src/plugins/element/anchors/withAnchors.js.map +0 -1
- package/dist/development/src/plugins/element/headings/HeadingElement.cjs +0 -41
- package/dist/development/src/plugins/element/headings/HeadingElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/headings/HeadingElement.js +0 -41
- package/dist/development/src/plugins/element/headings/HeadingElement.js.map +0 -1
- package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.cjs +0 -22
- package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +0 -1
- package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.js +0 -22
- package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +0 -1
- package/dist/development/src/plugins/element/headings/withHeadings.cjs +0 -70
- package/dist/development/src/plugins/element/headings/withHeadings.cjs.map +0 -1
- package/dist/development/src/plugins/element/headings/withHeadings.js +0 -70
- package/dist/development/src/plugins/element/headings/withHeadings.js.map +0 -1
- package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs +0 -41
- package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.js +0 -41
- package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +0 -1
- package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.cjs +0 -75
- package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +0 -1
- package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.js +0 -75
- package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.js.map +0 -1
- package/dist/development/src/plugins/element/lists/ListElement.cjs +0 -26
- package/dist/development/src/plugins/element/lists/ListElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/ListElement.js +0 -26
- package/dist/development/src/plugins/element/lists/ListElement.js.map +0 -1
- package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.cjs +0 -98
- package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.js +0 -98
- package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.js.map +0 -1
- package/dist/development/src/plugins/element/lists/ListItemElement.cjs +0 -53
- package/dist/development/src/plugins/element/lists/ListItemElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/ListItemElement.js +0 -53
- package/dist/development/src/plugins/element/lists/ListItemElement.js.map +0 -1
- package/dist/development/src/plugins/element/lists/OrderedListElement.cjs +0 -25
- package/dist/development/src/plugins/element/lists/OrderedListElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/OrderedListElement.js +0 -25
- package/dist/development/src/plugins/element/lists/OrderedListElement.js.map +0 -1
- package/dist/development/src/plugins/element/lists/UnorderedListElement.cjs +0 -25
- package/dist/development/src/plugins/element/lists/UnorderedListElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/UnorderedListElement.js +0 -25
- package/dist/development/src/plugins/element/lists/UnorderedListElement.js.map +0 -1
- package/dist/development/src/plugins/element/lists/transforms/dedentListItem.cjs +0 -57
- package/dist/development/src/plugins/element/lists/transforms/dedentListItem.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/transforms/dedentListItem.js +0 -57
- package/dist/development/src/plugins/element/lists/transforms/dedentListItem.js.map +0 -1
- package/dist/development/src/plugins/element/lists/transforms/indentListItem.cjs +0 -57
- package/dist/development/src/plugins/element/lists/transforms/indentListItem.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/transforms/indentListItem.js +0 -57
- package/dist/development/src/plugins/element/lists/transforms/indentListItem.js.map +0 -1
- package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.cjs +0 -22
- package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.js +0 -22
- package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.js.map +0 -1
- package/dist/development/src/plugins/element/lists/transforms/toggleListElement.cjs +0 -93
- package/dist/development/src/plugins/element/lists/transforms/toggleListElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/transforms/toggleListElement.js +0 -93
- package/dist/development/src/plugins/element/lists/transforms/toggleListElement.js.map +0 -1
- package/dist/development/src/plugins/element/lists/withLists.cjs +0 -153
- package/dist/development/src/plugins/element/lists/withLists.cjs.map +0 -1
- package/dist/development/src/plugins/element/lists/withLists.js +0 -153
- package/dist/development/src/plugins/element/lists/withLists.js.map +0 -1
- package/dist/development/src/plugins/element/paragraphs/ParagraphElement.cjs +0 -49
- package/dist/development/src/plugins/element/paragraphs/ParagraphElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/paragraphs/ParagraphElement.js +0 -49
- package/dist/development/src/plugins/element/paragraphs/ParagraphElement.js.map +0 -1
- package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs +0 -11
- package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +0 -1
- package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js +0 -11
- package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +0 -1
- package/dist/development/src/plugins/element/paragraphs/withParagraphs.cjs +0 -58
- package/dist/development/src/plugins/element/paragraphs/withParagraphs.cjs.map +0 -1
- package/dist/development/src/plugins/element/paragraphs/withParagraphs.js +0 -58
- package/dist/development/src/plugins/element/paragraphs/withParagraphs.js.map +0 -1
- package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.cjs +0 -51
- package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.js +0 -51
- package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +0 -1
- package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.cjs +0 -9
- package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +0 -1
- package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.js +0 -9
- package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.js.map +0 -1
- package/dist/development/src/plugins/element/tables/TableCellElement.cjs +0 -39
- package/dist/development/src/plugins/element/tables/TableCellElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/tables/TableCellElement.js +0 -39
- package/dist/development/src/plugins/element/tables/TableCellElement.js.map +0 -1
- package/dist/development/src/plugins/element/tables/TableElement.cjs +0 -114
- package/dist/development/src/plugins/element/tables/TableElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/tables/TableElement.js +0 -114
- package/dist/development/src/plugins/element/tables/TableElement.js.map +0 -1
- package/dist/development/src/plugins/element/tables/TableElementSelection.cjs +0 -20
- package/dist/development/src/plugins/element/tables/TableElementSelection.cjs.map +0 -1
- package/dist/development/src/plugins/element/tables/TableElementSelection.js +0 -20
- package/dist/development/src/plugins/element/tables/TableElementSelection.js.map +0 -1
- package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.cjs +0 -36
- package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +0 -1
- package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.js +0 -36
- package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.js.map +0 -1
- package/dist/development/src/plugins/element/tables/TableModifications.cjs +0 -134
- package/dist/development/src/plugins/element/tables/TableModifications.cjs.map +0 -1
- package/dist/development/src/plugins/element/tables/TableModifications.js +0 -134
- package/dist/development/src/plugins/element/tables/TableModifications.js.map +0 -1
- package/dist/development/src/plugins/element/tables/TableRowElement.cjs +0 -43
- package/dist/development/src/plugins/element/tables/TableRowElement.cjs.map +0 -1
- package/dist/development/src/plugins/element/tables/TableRowElement.js +0 -43
- package/dist/development/src/plugins/element/tables/TableRowElement.js.map +0 -1
- package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.cjs +0 -25
- package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +0 -1
- package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.js +0 -25
- package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.js.map +0 -1
- package/dist/development/src/plugins/element/tables/withTables.cjs +0 -283
- package/dist/development/src/plugins/element/tables/withTables.cjs.map +0 -1
- package/dist/development/src/plugins/element/tables/withTables.js +0 -283
- package/dist/development/src/plugins/element/tables/withTables.js.map +0 -1
- package/dist/development/src/plugins/text/bold/boldMark.cjs +0 -13
- package/dist/development/src/plugins/text/bold/boldMark.cjs.map +0 -1
- package/dist/development/src/plugins/text/bold/boldMark.js +0 -13
- package/dist/development/src/plugins/text/bold/boldMark.js.map +0 -1
- package/dist/development/src/plugins/text/bold/withBold.cjs +0 -16
- package/dist/development/src/plugins/text/bold/withBold.cjs.map +0 -1
- package/dist/development/src/plugins/text/bold/withBold.js +0 -16
- package/dist/development/src/plugins/text/bold/withBold.js.map +0 -1
- package/dist/development/src/plugins/text/code/codeMark.cjs +0 -13
- package/dist/development/src/plugins/text/code/codeMark.cjs.map +0 -1
- package/dist/development/src/plugins/text/code/codeMark.js +0 -13
- package/dist/development/src/plugins/text/code/codeMark.js.map +0 -1
- package/dist/development/src/plugins/text/code/withCode.cjs +0 -9
- package/dist/development/src/plugins/text/code/withCode.cjs.map +0 -1
- package/dist/development/src/plugins/text/code/withCode.js +0 -9
- package/dist/development/src/plugins/text/code/withCode.js.map +0 -1
- package/dist/development/src/plugins/text/highlight/highlightMark.cjs +0 -13
- package/dist/development/src/plugins/text/highlight/highlightMark.cjs.map +0 -1
- package/dist/development/src/plugins/text/highlight/highlightMark.js +0 -13
- package/dist/development/src/plugins/text/highlight/highlightMark.js.map +0 -1
- package/dist/development/src/plugins/text/highlight/withHighlight.cjs +0 -9
- package/dist/development/src/plugins/text/highlight/withHighlight.cjs.map +0 -1
- package/dist/development/src/plugins/text/highlight/withHighlight.js +0 -9
- package/dist/development/src/plugins/text/highlight/withHighlight.js.map +0 -1
- package/dist/development/src/plugins/text/italic/italicMark.cjs +0 -13
- package/dist/development/src/plugins/text/italic/italicMark.cjs.map +0 -1
- package/dist/development/src/plugins/text/italic/italicMark.js +0 -13
- package/dist/development/src/plugins/text/italic/italicMark.js.map +0 -1
- package/dist/development/src/plugins/text/italic/withItalic.cjs +0 -16
- package/dist/development/src/plugins/text/italic/withItalic.cjs.map +0 -1
- package/dist/development/src/plugins/text/italic/withItalic.js +0 -16
- package/dist/development/src/plugins/text/italic/withItalic.js.map +0 -1
- package/dist/development/src/plugins/text/newline/withNewline.cjs +0 -15
- package/dist/development/src/plugins/text/newline/withNewline.cjs.map +0 -1
- package/dist/development/src/plugins/text/newline/withNewline.js +0 -15
- package/dist/development/src/plugins/text/newline/withNewline.js.map +0 -1
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.cjs +0 -13
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +0 -1
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.js +0 -13
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.js.map +0 -1
- package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.cjs +0 -17
- package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +0 -1
- package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.js +0 -17
- package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.js.map +0 -1
- package/dist/development/src/plugins/text/underline/underlineMark.cjs +0 -13
- package/dist/development/src/plugins/text/underline/underlineMark.cjs.map +0 -1
- package/dist/development/src/plugins/text/underline/underlineMark.js +0 -13
- package/dist/development/src/plugins/text/underline/underlineMark.js.map +0 -1
- package/dist/development/src/plugins/text/underline/withUnderline.cjs +0 -17
- package/dist/development/src/plugins/text/underline/withUnderline.cjs.map +0 -1
- package/dist/development/src/plugins/text/underline/withUnderline.js +0 -17
- package/dist/development/src/plugins/text/underline/withUnderline.js.map +0 -1
- package/dist/development/src/slate-reexport.cjs +0 -10
- package/dist/development/src/slate-reexport.cjs.map +0 -1
- package/dist/development/src/slate-reexport.js +0 -8
- package/dist/development/src/slate-reexport.js.map +0 -1
- package/dist/production/index.cjs +0 -139
- package/dist/production/index.cjs.map +0 -1
- package/dist/production/index.js +0 -136
- package/dist/production/index.js.map +0 -1
- package/dist/production/src/components/RichTextEditor.cjs +0 -93
- package/dist/production/src/components/RichTextEditor.cjs.map +0 -1
- package/dist/production/src/components/RichTextEditor.js +0 -93
- package/dist/production/src/components/RichTextEditor.js.map +0 -1
- package/dist/production/src/components/triggers/EditorElementTrigger.cjs +0 -16
- package/dist/production/src/components/triggers/EditorElementTrigger.cjs.map +0 -1
- package/dist/production/src/components/triggers/EditorElementTrigger.js +0 -16
- package/dist/production/src/components/triggers/EditorElementTrigger.js.map +0 -1
- package/dist/production/src/components/triggers/EditorGenericTrigger.cjs +0 -20
- package/dist/production/src/components/triggers/EditorGenericTrigger.cjs.map +0 -1
- package/dist/production/src/components/triggers/EditorGenericTrigger.js +0 -20
- package/dist/production/src/components/triggers/EditorGenericTrigger.js.map +0 -1
- package/dist/production/src/components/triggers/EditorMarkTrigger.cjs +0 -16
- package/dist/production/src/components/triggers/EditorMarkTrigger.cjs.map +0 -1
- package/dist/production/src/components/triggers/EditorMarkTrigger.js +0 -16
- package/dist/production/src/components/triggers/EditorMarkTrigger.js.map +0 -1
- package/dist/production/src/components/triggers/EditorWrapNodeTrigger.cjs +0 -28
- package/dist/production/src/components/triggers/EditorWrapNodeTrigger.cjs.map +0 -1
- package/dist/production/src/components/triggers/EditorWrapNodeTrigger.js +0 -28
- package/dist/production/src/components/triggers/EditorWrapNodeTrigger.js.map +0 -1
- package/dist/production/src/editor/createEditor.cjs +0 -35
- package/dist/production/src/editor/createEditor.cjs.map +0 -1
- package/dist/production/src/editor/createEditor.js +0 -35
- package/dist/production/src/editor/createEditor.js.map +0 -1
- package/dist/production/src/editor/createEditorWithEssentials.cjs +0 -227
- package/dist/production/src/editor/createEditorWithEssentials.cjs.map +0 -1
- package/dist/production/src/editor/createEditorWithEssentials.js +0 -211
- package/dist/production/src/editor/createEditorWithEssentials.js.map +0 -1
- package/dist/production/src/editor/index.cjs +0 -44
- package/dist/production/src/editor/index.cjs.map +0 -1
- package/dist/production/src/editor/index.js +0 -44
- package/dist/production/src/editor/index.js.map +0 -1
- package/dist/production/src/editor/methods/addMarks.cjs +0 -12
- package/dist/production/src/editor/methods/addMarks.cjs.map +0 -1
- package/dist/production/src/editor/methods/addMarks.js +0 -12
- package/dist/production/src/editor/methods/addMarks.js.map +0 -1
- package/dist/production/src/editor/methods/canToggleMark.cjs +0 -7
- package/dist/production/src/editor/methods/canToggleMark.cjs.map +0 -1
- package/dist/production/src/editor/methods/canToggleMark.js +0 -7
- package/dist/production/src/editor/methods/canToggleMark.js.map +0 -1
- package/dist/production/src/editor/methods/closest.cjs +0 -18
- package/dist/production/src/editor/methods/closest.cjs.map +0 -1
- package/dist/production/src/editor/methods/closest.js +0 -18
- package/dist/production/src/editor/methods/closest.js.map +0 -1
- package/dist/production/src/editor/methods/closestBlockEntry.cjs +0 -10
- package/dist/production/src/editor/methods/closestBlockEntry.cjs.map +0 -1
- package/dist/production/src/editor/methods/closestBlockEntry.js +0 -10
- package/dist/production/src/editor/methods/closestBlockEntry.js.map +0 -1
- package/dist/production/src/editor/methods/closestViableBlockContainerEntry.cjs +0 -9
- package/dist/production/src/editor/methods/closestViableBlockContainerEntry.cjs.map +0 -1
- package/dist/production/src/editor/methods/closestViableBlockContainerEntry.js +0 -9
- package/dist/production/src/editor/methods/closestViableBlockContainerEntry.js.map +0 -1
- package/dist/production/src/editor/methods/ejectElement.cjs +0 -15
- package/dist/production/src/editor/methods/ejectElement.cjs.map +0 -1
- package/dist/production/src/editor/methods/ejectElement.js +0 -15
- package/dist/production/src/editor/methods/ejectElement.js.map +0 -1
- package/dist/production/src/editor/methods/elementToSpecifics.cjs +0 -8
- package/dist/production/src/editor/methods/elementToSpecifics.cjs.map +0 -1
- package/dist/production/src/editor/methods/elementToSpecifics.js +0 -8
- package/dist/production/src/editor/methods/elementToSpecifics.js.map +0 -1
- package/dist/production/src/editor/methods/getElementDataAttributes.cjs +0 -13
- package/dist/production/src/editor/methods/getElementDataAttributes.cjs.map +0 -1
- package/dist/production/src/editor/methods/getElementDataAttributes.js +0 -13
- package/dist/production/src/editor/methods/getElementDataAttributes.js.map +0 -1
- package/dist/production/src/editor/methods/getPreviousSibling.cjs +0 -13
- package/dist/production/src/editor/methods/getPreviousSibling.cjs.map +0 -1
- package/dist/production/src/editor/methods/getPreviousSibling.js +0 -13
- package/dist/production/src/editor/methods/getPreviousSibling.js.map +0 -1
- package/dist/production/src/editor/methods/hasMarks.cjs +0 -23
- package/dist/production/src/editor/methods/hasMarks.cjs.map +0 -1
- package/dist/production/src/editor/methods/hasMarks.js +0 -23
- package/dist/production/src/editor/methods/hasMarks.js.map +0 -1
- package/dist/production/src/editor/methods/hasParentOfType.cjs +0 -15
- package/dist/production/src/editor/methods/hasParentOfType.cjs.map +0 -1
- package/dist/production/src/editor/methods/hasParentOfType.js +0 -15
- package/dist/production/src/editor/methods/hasParentOfType.js.map +0 -1
- package/dist/production/src/editor/methods/isElementType.cjs +0 -24
- package/dist/production/src/editor/methods/isElementType.cjs.map +0 -1
- package/dist/production/src/editor/methods/isElementType.js +0 -24
- package/dist/production/src/editor/methods/isElementType.js.map +0 -1
- package/dist/production/src/editor/methods/permissivelyDeserializeNodes.cjs +0 -22
- package/dist/production/src/editor/methods/permissivelyDeserializeNodes.cjs.map +0 -1
- package/dist/production/src/editor/methods/permissivelyDeserializeNodes.js +0 -22
- package/dist/production/src/editor/methods/permissivelyDeserializeNodes.js.map +0 -1
- package/dist/production/src/editor/methods/removeMarks.cjs +0 -12
- package/dist/production/src/editor/methods/removeMarks.cjs.map +0 -1
- package/dist/production/src/editor/methods/removeMarks.js +0 -12
- package/dist/production/src/editor/methods/removeMarks.js.map +0 -1
- package/dist/production/src/editor/methods/serializeNodes.cjs +0 -15
- package/dist/production/src/editor/methods/serializeNodes.cjs.map +0 -1
- package/dist/production/src/editor/methods/serializeNodes.js +0 -15
- package/dist/production/src/editor/methods/serializeNodes.js.map +0 -1
- package/dist/production/src/editor/methods/strictlyDeserializeNodes.cjs +0 -14
- package/dist/production/src/editor/methods/strictlyDeserializeNodes.cjs.map +0 -1
- package/dist/production/src/editor/methods/strictlyDeserializeNodes.js +0 -14
- package/dist/production/src/editor/methods/strictlyDeserializeNodes.js.map +0 -1
- package/dist/production/src/editor/methods/textToSpecifics.cjs +0 -8
- package/dist/production/src/editor/methods/textToSpecifics.cjs.map +0 -1
- package/dist/production/src/editor/methods/textToSpecifics.js +0 -8
- package/dist/production/src/editor/methods/textToSpecifics.js.map +0 -1
- package/dist/production/src/editor/methods/toLatestFormat.cjs +0 -34
- package/dist/production/src/editor/methods/toLatestFormat.cjs.map +0 -1
- package/dist/production/src/editor/methods/toLatestFormat.js +0 -34
- package/dist/production/src/editor/methods/toLatestFormat.js.map +0 -1
- package/dist/production/src/editor/methods/topLevelNodes.cjs +0 -12
- package/dist/production/src/editor/methods/topLevelNodes.cjs.map +0 -1
- package/dist/production/src/editor/methods/topLevelNodes.js +0 -12
- package/dist/production/src/editor/methods/topLevelNodes.js.map +0 -1
- package/dist/production/src/internal/components/DefaultElement.cjs +0 -11
- package/dist/production/src/internal/components/DefaultElement.cjs.map +0 -1
- package/dist/production/src/internal/components/DefaultElement.js +0 -11
- package/dist/production/src/internal/components/DefaultElement.js.map +0 -1
- package/dist/production/src/internal/hooks/useRichTextFieldNodes.cjs +0 -28
- package/dist/production/src/internal/hooks/useRichTextFieldNodes.cjs.map +0 -1
- package/dist/production/src/internal/hooks/useRichTextFieldNodes.js +0 -28
- package/dist/production/src/internal/hooks/useRichTextFieldNodes.js.map +0 -1
- package/dist/production/src/internal/utils/EditorPasteUtils.cjs +0 -47
- package/dist/production/src/internal/utils/EditorPasteUtils.cjs.map +0 -1
- package/dist/production/src/internal/utils/EditorPasteUtils.js +0 -47
- package/dist/production/src/internal/utils/EditorPasteUtils.js.map +0 -1
- package/dist/production/src/internal/utils/parseUrl.cjs +0 -14
- package/dist/production/src/internal/utils/parseUrl.cjs.map +0 -1
- package/dist/production/src/internal/utils/parseUrl.js +0 -14
- package/dist/production/src/internal/utils/parseUrl.js.map +0 -1
- package/dist/production/src/plugins/attributes/alignment/alignButton.cjs +0 -21
- package/dist/production/src/plugins/attributes/alignment/alignButton.cjs.map +0 -1
- package/dist/production/src/plugins/attributes/alignment/alignButton.js +0 -21
- package/dist/production/src/plugins/attributes/alignment/alignButton.js.map +0 -1
- package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.cjs +0 -138
- package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +0 -1
- package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.js +0 -138
- package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.js.map +0 -1
- package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs +0 -15
- package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +0 -1
- package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js +0 -15
- package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +0 -1
- package/dist/production/src/plugins/behaviour/paste/withPaste.cjs +0 -24
- package/dist/production/src/plugins/behaviour/paste/withPaste.cjs.map +0 -1
- package/dist/production/src/plugins/behaviour/paste/withPaste.js +0 -24
- package/dist/production/src/plugins/behaviour/paste/withPaste.js.map +0 -1
- package/dist/production/src/plugins/element/anchors/AnchorElement.cjs +0 -44
- package/dist/production/src/plugins/element/anchors/AnchorElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/anchors/AnchorElement.js +0 -44
- package/dist/production/src/plugins/element/anchors/AnchorElement.js.map +0 -1
- package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs +0 -19
- package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +0 -1
- package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.js +0 -19
- package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +0 -1
- package/dist/production/src/plugins/element/anchors/AnchorModifications.cjs +0 -29
- package/dist/production/src/plugins/element/anchors/AnchorModifications.cjs.map +0 -1
- package/dist/production/src/plugins/element/anchors/AnchorModifications.js +0 -29
- package/dist/production/src/plugins/element/anchors/AnchorModifications.js.map +0 -1
- package/dist/production/src/plugins/element/anchors/withAnchors.cjs +0 -21
- package/dist/production/src/plugins/element/anchors/withAnchors.cjs.map +0 -1
- package/dist/production/src/plugins/element/anchors/withAnchors.js +0 -21
- package/dist/production/src/plugins/element/anchors/withAnchors.js.map +0 -1
- package/dist/production/src/plugins/element/headings/HeadingElement.cjs +0 -41
- package/dist/production/src/plugins/element/headings/HeadingElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/headings/HeadingElement.js +0 -41
- package/dist/production/src/plugins/element/headings/HeadingElement.js.map +0 -1
- package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.cjs +0 -22
- package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +0 -1
- package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.js +0 -22
- package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +0 -1
- package/dist/production/src/plugins/element/headings/withHeadings.cjs +0 -70
- package/dist/production/src/plugins/element/headings/withHeadings.cjs.map +0 -1
- package/dist/production/src/plugins/element/headings/withHeadings.js +0 -70
- package/dist/production/src/plugins/element/headings/withHeadings.js.map +0 -1
- package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs +0 -41
- package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.js +0 -41
- package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +0 -1
- package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.cjs +0 -75
- package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +0 -1
- package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.js +0 -75
- package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.js.map +0 -1
- package/dist/production/src/plugins/element/lists/ListElement.cjs +0 -26
- package/dist/production/src/plugins/element/lists/ListElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/ListElement.js +0 -26
- package/dist/production/src/plugins/element/lists/ListElement.js.map +0 -1
- package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.cjs +0 -98
- package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.js +0 -98
- package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.js.map +0 -1
- package/dist/production/src/plugins/element/lists/ListItemElement.cjs +0 -53
- package/dist/production/src/plugins/element/lists/ListItemElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/ListItemElement.js +0 -53
- package/dist/production/src/plugins/element/lists/ListItemElement.js.map +0 -1
- package/dist/production/src/plugins/element/lists/OrderedListElement.cjs +0 -25
- package/dist/production/src/plugins/element/lists/OrderedListElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/OrderedListElement.js +0 -25
- package/dist/production/src/plugins/element/lists/OrderedListElement.js.map +0 -1
- package/dist/production/src/plugins/element/lists/UnorderedListElement.cjs +0 -25
- package/dist/production/src/plugins/element/lists/UnorderedListElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/UnorderedListElement.js +0 -25
- package/dist/production/src/plugins/element/lists/UnorderedListElement.js.map +0 -1
- package/dist/production/src/plugins/element/lists/transforms/dedentListItem.cjs +0 -57
- package/dist/production/src/plugins/element/lists/transforms/dedentListItem.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/transforms/dedentListItem.js +0 -57
- package/dist/production/src/plugins/element/lists/transforms/dedentListItem.js.map +0 -1
- package/dist/production/src/plugins/element/lists/transforms/indentListItem.cjs +0 -57
- package/dist/production/src/plugins/element/lists/transforms/indentListItem.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/transforms/indentListItem.js +0 -57
- package/dist/production/src/plugins/element/lists/transforms/indentListItem.js.map +0 -1
- package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.cjs +0 -22
- package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.js +0 -22
- package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.js.map +0 -1
- package/dist/production/src/plugins/element/lists/transforms/toggleListElement.cjs +0 -93
- package/dist/production/src/plugins/element/lists/transforms/toggleListElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/transforms/toggleListElement.js +0 -93
- package/dist/production/src/plugins/element/lists/transforms/toggleListElement.js.map +0 -1
- package/dist/production/src/plugins/element/lists/withLists.cjs +0 -153
- package/dist/production/src/plugins/element/lists/withLists.cjs.map +0 -1
- package/dist/production/src/plugins/element/lists/withLists.js +0 -153
- package/dist/production/src/plugins/element/lists/withLists.js.map +0 -1
- package/dist/production/src/plugins/element/paragraphs/ParagraphElement.cjs +0 -49
- package/dist/production/src/plugins/element/paragraphs/ParagraphElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/paragraphs/ParagraphElement.js +0 -49
- package/dist/production/src/plugins/element/paragraphs/ParagraphElement.js.map +0 -1
- package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs +0 -11
- package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +0 -1
- package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js +0 -11
- package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +0 -1
- package/dist/production/src/plugins/element/paragraphs/withParagraphs.cjs +0 -58
- package/dist/production/src/plugins/element/paragraphs/withParagraphs.cjs.map +0 -1
- package/dist/production/src/plugins/element/paragraphs/withParagraphs.js +0 -58
- package/dist/production/src/plugins/element/paragraphs/withParagraphs.js.map +0 -1
- package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.cjs +0 -51
- package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.js +0 -51
- package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +0 -1
- package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.cjs +0 -9
- package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +0 -1
- package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.js +0 -9
- package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.js.map +0 -1
- package/dist/production/src/plugins/element/tables/TableCellElement.cjs +0 -39
- package/dist/production/src/plugins/element/tables/TableCellElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/tables/TableCellElement.js +0 -39
- package/dist/production/src/plugins/element/tables/TableCellElement.js.map +0 -1
- package/dist/production/src/plugins/element/tables/TableElement.cjs +0 -114
- package/dist/production/src/plugins/element/tables/TableElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/tables/TableElement.js +0 -114
- package/dist/production/src/plugins/element/tables/TableElement.js.map +0 -1
- package/dist/production/src/plugins/element/tables/TableElementSelection.cjs +0 -20
- package/dist/production/src/plugins/element/tables/TableElementSelection.cjs.map +0 -1
- package/dist/production/src/plugins/element/tables/TableElementSelection.js +0 -20
- package/dist/production/src/plugins/element/tables/TableElementSelection.js.map +0 -1
- package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.cjs +0 -36
- package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +0 -1
- package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.js +0 -36
- package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.js.map +0 -1
- package/dist/production/src/plugins/element/tables/TableModifications.cjs +0 -134
- package/dist/production/src/plugins/element/tables/TableModifications.cjs.map +0 -1
- package/dist/production/src/plugins/element/tables/TableModifications.js +0 -134
- package/dist/production/src/plugins/element/tables/TableModifications.js.map +0 -1
- package/dist/production/src/plugins/element/tables/TableRowElement.cjs +0 -43
- package/dist/production/src/plugins/element/tables/TableRowElement.cjs.map +0 -1
- package/dist/production/src/plugins/element/tables/TableRowElement.js +0 -43
- package/dist/production/src/plugins/element/tables/TableRowElement.js.map +0 -1
- package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.cjs +0 -25
- package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +0 -1
- package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.js +0 -25
- package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.js.map +0 -1
- package/dist/production/src/plugins/element/tables/withTables.cjs +0 -283
- package/dist/production/src/plugins/element/tables/withTables.cjs.map +0 -1
- package/dist/production/src/plugins/element/tables/withTables.js +0 -283
- package/dist/production/src/plugins/element/tables/withTables.js.map +0 -1
- package/dist/production/src/plugins/text/bold/boldMark.cjs +0 -13
- package/dist/production/src/plugins/text/bold/boldMark.cjs.map +0 -1
- package/dist/production/src/plugins/text/bold/boldMark.js +0 -13
- package/dist/production/src/plugins/text/bold/boldMark.js.map +0 -1
- package/dist/production/src/plugins/text/bold/withBold.cjs +0 -16
- package/dist/production/src/plugins/text/bold/withBold.cjs.map +0 -1
- package/dist/production/src/plugins/text/bold/withBold.js +0 -16
- package/dist/production/src/plugins/text/bold/withBold.js.map +0 -1
- package/dist/production/src/plugins/text/code/codeMark.cjs +0 -13
- package/dist/production/src/plugins/text/code/codeMark.cjs.map +0 -1
- package/dist/production/src/plugins/text/code/codeMark.js +0 -13
- package/dist/production/src/plugins/text/code/codeMark.js.map +0 -1
- package/dist/production/src/plugins/text/code/withCode.cjs +0 -9
- package/dist/production/src/plugins/text/code/withCode.cjs.map +0 -1
- package/dist/production/src/plugins/text/code/withCode.js +0 -9
- package/dist/production/src/plugins/text/code/withCode.js.map +0 -1
- package/dist/production/src/plugins/text/highlight/highlightMark.cjs +0 -13
- package/dist/production/src/plugins/text/highlight/highlightMark.cjs.map +0 -1
- package/dist/production/src/plugins/text/highlight/highlightMark.js +0 -13
- package/dist/production/src/plugins/text/highlight/highlightMark.js.map +0 -1
- package/dist/production/src/plugins/text/highlight/withHighlight.cjs +0 -9
- package/dist/production/src/plugins/text/highlight/withHighlight.cjs.map +0 -1
- package/dist/production/src/plugins/text/highlight/withHighlight.js +0 -9
- package/dist/production/src/plugins/text/highlight/withHighlight.js.map +0 -1
- package/dist/production/src/plugins/text/italic/italicMark.cjs +0 -13
- package/dist/production/src/plugins/text/italic/italicMark.cjs.map +0 -1
- package/dist/production/src/plugins/text/italic/italicMark.js +0 -13
- package/dist/production/src/plugins/text/italic/italicMark.js.map +0 -1
- package/dist/production/src/plugins/text/italic/withItalic.cjs +0 -16
- package/dist/production/src/plugins/text/italic/withItalic.cjs.map +0 -1
- package/dist/production/src/plugins/text/italic/withItalic.js +0 -16
- package/dist/production/src/plugins/text/italic/withItalic.js.map +0 -1
- package/dist/production/src/plugins/text/newline/withNewline.cjs +0 -15
- package/dist/production/src/plugins/text/newline/withNewline.cjs.map +0 -1
- package/dist/production/src/plugins/text/newline/withNewline.js +0 -15
- package/dist/production/src/plugins/text/newline/withNewline.js.map +0 -1
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.cjs +0 -13
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +0 -1
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.js +0 -13
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.js.map +0 -1
- package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.cjs +0 -17
- package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +0 -1
- package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.js +0 -17
- package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.js.map +0 -1
- package/dist/production/src/plugins/text/underline/underlineMark.cjs +0 -13
- package/dist/production/src/plugins/text/underline/underlineMark.cjs.map +0 -1
- package/dist/production/src/plugins/text/underline/underlineMark.js +0 -13
- package/dist/production/src/plugins/text/underline/underlineMark.js.map +0 -1
- package/dist/production/src/plugins/text/underline/withUnderline.cjs +0 -17
- package/dist/production/src/plugins/text/underline/withUnderline.cjs.map +0 -1
- package/dist/production/src/plugins/text/underline/withUnderline.js +0 -17
- package/dist/production/src/plugins/text/underline/withUnderline.js.map +0 -1
- package/dist/production/src/slate-reexport.cjs +0 -10
- package/dist/production/src/slate-reexport.cjs.map +0 -1
- package/dist/production/src/slate-reexport.js +0 -8
- package/dist/production/src/slate-reexport.js.map +0 -1
- package/dist/types/components/RichTextEditor.d.ts +0 -13
- package/dist/types/components/RichTextEditor.d.ts.map +0 -1
- package/dist/types/components/index.d.ts +0 -3
- package/dist/types/components/index.d.ts.map +0 -1
- package/dist/types/components/triggers/EditorElementTrigger.d.ts +0 -8
- package/dist/types/components/triggers/EditorElementTrigger.d.ts.map +0 -1
- package/dist/types/components/triggers/EditorGenericTrigger.d.ts +0 -16
- package/dist/types/components/triggers/EditorGenericTrigger.d.ts.map +0 -1
- package/dist/types/components/triggers/EditorMarkTrigger.d.ts +0 -7
- package/dist/types/components/triggers/EditorMarkTrigger.d.ts.map +0 -1
- package/dist/types/components/triggers/EditorWrapNodeTrigger.d.ts +0 -11
- package/dist/types/components/triggers/EditorWrapNodeTrigger.d.ts.map +0 -1
- package/dist/types/components/triggers/index.d.ts +0 -5
- package/dist/types/components/triggers/index.d.ts.map +0 -1
- package/dist/types/editor/createEditor.d.ts +0 -24
- package/dist/types/editor/createEditor.d.ts.map +0 -1
- package/dist/types/editor/createEditorWithEssentials.d.ts +0 -5
- package/dist/types/editor/createEditorWithEssentials.d.ts.map +0 -1
- package/dist/types/editor/index.d.ts +0 -35
- package/dist/types/editor/index.d.ts.map +0 -1
- package/dist/types/editor/methods/addMarks.d.ts +0 -4
- package/dist/types/editor/methods/addMarks.d.ts.map +0 -1
- package/dist/types/editor/methods/canToggleMark.d.ts +0 -3
- package/dist/types/editor/methods/canToggleMark.d.ts.map +0 -1
- package/dist/types/editor/methods/closest.d.ts +0 -6
- package/dist/types/editor/methods/closest.d.ts.map +0 -1
- package/dist/types/editor/methods/closestBlockEntry.d.ts +0 -6
- package/dist/types/editor/methods/closestBlockEntry.d.ts.map +0 -1
- package/dist/types/editor/methods/closestViableBlockContainerEntry.d.ts +0 -6
- package/dist/types/editor/methods/closestViableBlockContainerEntry.d.ts.map +0 -1
- package/dist/types/editor/methods/ejectElement.d.ts +0 -3
- package/dist/types/editor/methods/ejectElement.d.ts.map +0 -1
- package/dist/types/editor/methods/elementToSpecifics.d.ts +0 -3
- package/dist/types/editor/methods/elementToSpecifics.d.ts.map +0 -1
- package/dist/types/editor/methods/getElementDataAttributes.d.ts +0 -7
- package/dist/types/editor/methods/getElementDataAttributes.d.ts.map +0 -1
- package/dist/types/editor/methods/getPreviousSibling.d.ts +0 -3
- package/dist/types/editor/methods/getPreviousSibling.d.ts.map +0 -1
- package/dist/types/editor/methods/hasMarks.d.ts +0 -7
- package/dist/types/editor/methods/hasMarks.d.ts.map +0 -1
- package/dist/types/editor/methods/hasParentOfType.d.ts +0 -3
- package/dist/types/editor/methods/hasParentOfType.d.ts.map +0 -1
- package/dist/types/editor/methods/index.d.ts +0 -20
- package/dist/types/editor/methods/index.d.ts.map +0 -1
- package/dist/types/editor/methods/isElementType.d.ts +0 -3
- package/dist/types/editor/methods/isElementType.d.ts.map +0 -1
- package/dist/types/editor/methods/permissivelyDeserializeNodes.d.ts +0 -3
- package/dist/types/editor/methods/permissivelyDeserializeNodes.d.ts.map +0 -1
- package/dist/types/editor/methods/removeMarks.d.ts +0 -4
- package/dist/types/editor/methods/removeMarks.d.ts.map +0 -1
- package/dist/types/editor/methods/serializeNodes.d.ts +0 -3
- package/dist/types/editor/methods/serializeNodes.d.ts.map +0 -1
- package/dist/types/editor/methods/strictlyDeserializeNodes.d.ts +0 -3
- package/dist/types/editor/methods/strictlyDeserializeNodes.d.ts.map +0 -1
- package/dist/types/editor/methods/textToSpecifics.d.ts +0 -4
- package/dist/types/editor/methods/textToSpecifics.d.ts.map +0 -1
- package/dist/types/editor/methods/toLatestFormat.d.ts +0 -4
- package/dist/types/editor/methods/toLatestFormat.d.ts.map +0 -1
- package/dist/types/editor/methods/topLevelNodes.d.ts +0 -3
- package/dist/types/editor/methods/topLevelNodes.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -7
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/internal/components/DefaultElement.d.ts +0 -6
- package/dist/types/internal/components/DefaultElement.d.ts.map +0 -1
- package/dist/types/internal/hooks/useRichTextFieldNodes.d.ts +0 -9
- package/dist/types/internal/hooks/useRichTextFieldNodes.d.ts.map +0 -1
- package/dist/types/internal/utils/EditorPasteUtils.d.ts +0 -7
- package/dist/types/internal/utils/EditorPasteUtils.d.ts.map +0 -1
- package/dist/types/internal/utils/index.d.ts +0 -3
- package/dist/types/internal/utils/index.d.ts.map +0 -1
- package/dist/types/internal/utils/parseIframeSrc.d.ts +0 -2
- package/dist/types/internal/utils/parseIframeSrc.d.ts.map +0 -1
- package/dist/types/internal/utils/parseUrl.d.ts +0 -2
- package/dist/types/internal/utils/parseUrl.d.ts.map +0 -1
- package/dist/types/plugins/attributes/alignment/alignButton.d.ts +0 -14
- package/dist/types/plugins/attributes/alignment/alignButton.d.ts.map +0 -1
- package/dist/types/plugins/attributes/alignment/index.d.ts +0 -2
- package/dist/types/plugins/attributes/alignment/index.d.ts.map +0 -1
- package/dist/types/plugins/attributes/index.d.ts +0 -2
- package/dist/types/plugins/attributes/index.d.ts.map +0 -1
- package/dist/types/plugins/behaviour/index.d.ts +0 -2
- package/dist/types/plugins/behaviour/index.d.ts.map +0 -1
- package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts +0 -34
- package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts.map +0 -1
- package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts +0 -3
- package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts.map +0 -1
- package/dist/types/plugins/behaviour/paste/index.d.ts +0 -3
- package/dist/types/plugins/behaviour/paste/index.d.ts.map +0 -1
- package/dist/types/plugins/behaviour/paste/withPaste.d.ts +0 -3
- package/dist/types/plugins/behaviour/paste/withPaste.d.ts.map +0 -1
- package/dist/types/plugins/element/anchors/AnchorElement.d.ts +0 -14
- package/dist/types/plugins/element/anchors/AnchorElement.d.ts.map +0 -1
- package/dist/types/plugins/element/anchors/AnchorHtmlDeserializer.d.ts +0 -3
- package/dist/types/plugins/element/anchors/AnchorHtmlDeserializer.d.ts.map +0 -1
- package/dist/types/plugins/element/anchors/AnchorModifications.d.ts +0 -6
- package/dist/types/plugins/element/anchors/AnchorModifications.d.ts.map +0 -1
- package/dist/types/plugins/element/anchors/index.d.ts +0 -4
- package/dist/types/plugins/element/anchors/index.d.ts.map +0 -1
- package/dist/types/plugins/element/anchors/withAnchors.d.ts +0 -7
- package/dist/types/plugins/element/anchors/withAnchors.d.ts.map +0 -1
- package/dist/types/plugins/element/headings/HeadingElement.d.ts +0 -17
- package/dist/types/plugins/element/headings/HeadingElement.d.ts.map +0 -1
- package/dist/types/plugins/element/headings/HeadingHtmlDeserializer.d.ts +0 -3
- package/dist/types/plugins/element/headings/HeadingHtmlDeserializer.d.ts.map +0 -1
- package/dist/types/plugins/element/headings/index.d.ts +0 -4
- package/dist/types/plugins/element/headings/index.d.ts.map +0 -1
- package/dist/types/plugins/element/headings/withHeadings.d.ts +0 -7
- package/dist/types/plugins/element/headings/withHeadings.d.ts.map +0 -1
- package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts +0 -13
- package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts.map +0 -1
- package/dist/types/plugins/element/horizonalRules/index.d.ts +0 -3
- package/dist/types/plugins/element/horizonalRules/index.d.ts.map +0 -1
- package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts +0 -7
- package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts.map +0 -1
- package/dist/types/plugins/element/index.d.ts +0 -8
- package/dist/types/plugins/element/index.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/ListElement.d.ts +0 -6
- package/dist/types/plugins/element/lists/ListElement.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts +0 -10
- package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/ListItemElement.d.ts +0 -12
- package/dist/types/plugins/element/lists/ListItemElement.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/OrderedListElement.d.ts +0 -12
- package/dist/types/plugins/element/lists/OrderedListElement.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/UnorderedListElement.d.ts +0 -12
- package/dist/types/plugins/element/lists/UnorderedListElement.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/index.d.ts +0 -6
- package/dist/types/plugins/element/lists/index.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/transforms/dedentListItem.d.ts +0 -4
- package/dist/types/plugins/element/lists/transforms/dedentListItem.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts +0 -4
- package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/transforms/index.d.ts +0 -5
- package/dist/types/plugins/element/lists/transforms/index.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/transforms/normalizeListElement.d.ts +0 -7
- package/dist/types/plugins/element/lists/transforms/normalizeListElement.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts +0 -5
- package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts.map +0 -1
- package/dist/types/plugins/element/lists/withLists.d.ts +0 -11
- package/dist/types/plugins/element/lists/withLists.d.ts.map +0 -1
- package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts +0 -15
- package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts.map +0 -1
- package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts +0 -3
- package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts.map +0 -1
- package/dist/types/plugins/element/paragraphs/index.d.ts +0 -4
- package/dist/types/plugins/element/paragraphs/index.d.ts.map +0 -1
- package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts +0 -7
- package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts.map +0 -1
- package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts +0 -14
- package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts.map +0 -1
- package/dist/types/plugins/element/scrollTargets/index.d.ts +0 -3
- package/dist/types/plugins/element/scrollTargets/index.d.ts.map +0 -1
- package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts +0 -7
- package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/TableCellElement.d.ts +0 -20
- package/dist/types/plugins/element/tables/TableCellElement.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/TableElement.d.ts +0 -26
- package/dist/types/plugins/element/tables/TableElement.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/TableElementSelection.d.ts +0 -6
- package/dist/types/plugins/element/tables/TableElementSelection.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/TableHtmlDeserializer.d.ts +0 -3
- package/dist/types/plugins/element/tables/TableHtmlDeserializer.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/TableModifications.d.ts +0 -14
- package/dist/types/plugins/element/tables/TableModifications.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/TableRowElement.d.ts +0 -22
- package/dist/types/plugins/element/tables/TableRowElement.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/gaugeTableColumnCount.d.ts +0 -3
- package/dist/types/plugins/element/tables/gaugeTableColumnCount.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/index.d.ts +0 -6
- package/dist/types/plugins/element/tables/index.d.ts.map +0 -1
- package/dist/types/plugins/element/tables/withTables.d.ts +0 -11
- package/dist/types/plugins/element/tables/withTables.d.ts.map +0 -1
- package/dist/types/plugins/index.d.ts +0 -5
- package/dist/types/plugins/index.d.ts.map +0 -1
- package/dist/types/plugins/text/bold/boldMark.d.ts +0 -4
- package/dist/types/plugins/text/bold/boldMark.d.ts.map +0 -1
- package/dist/types/plugins/text/bold/index.d.ts +0 -3
- package/dist/types/plugins/text/bold/index.d.ts.map +0 -1
- package/dist/types/plugins/text/bold/withBold.d.ts +0 -3
- package/dist/types/plugins/text/bold/withBold.d.ts.map +0 -1
- package/dist/types/plugins/text/code/codeMark.d.ts +0 -4
- package/dist/types/plugins/text/code/codeMark.d.ts.map +0 -1
- package/dist/types/plugins/text/code/index.d.ts +0 -3
- package/dist/types/plugins/text/code/index.d.ts.map +0 -1
- package/dist/types/plugins/text/code/withCode.d.ts +0 -3
- package/dist/types/plugins/text/code/withCode.d.ts.map +0 -1
- package/dist/types/plugins/text/highlight/highlightMark.d.ts +0 -4
- package/dist/types/plugins/text/highlight/highlightMark.d.ts.map +0 -1
- package/dist/types/plugins/text/highlight/index.d.ts +0 -3
- package/dist/types/plugins/text/highlight/index.d.ts.map +0 -1
- package/dist/types/plugins/text/highlight/withHighlight.d.ts +0 -3
- package/dist/types/plugins/text/highlight/withHighlight.d.ts.map +0 -1
- package/dist/types/plugins/text/index.d.ts +0 -8
- package/dist/types/plugins/text/index.d.ts.map +0 -1
- package/dist/types/plugins/text/italic/index.d.ts +0 -3
- package/dist/types/plugins/text/italic/index.d.ts.map +0 -1
- package/dist/types/plugins/text/italic/italicMark.d.ts +0 -4
- package/dist/types/plugins/text/italic/italicMark.d.ts.map +0 -1
- package/dist/types/plugins/text/italic/withItalic.d.ts +0 -3
- package/dist/types/plugins/text/italic/withItalic.d.ts.map +0 -1
- package/dist/types/plugins/text/newline/index.d.ts +0 -2
- package/dist/types/plugins/text/newline/index.d.ts.map +0 -1
- package/dist/types/plugins/text/newline/withNewline.d.ts +0 -3
- package/dist/types/plugins/text/newline/withNewline.d.ts.map +0 -1
- package/dist/types/plugins/text/strikeThrough/index.d.ts +0 -3
- package/dist/types/plugins/text/strikeThrough/index.d.ts.map +0 -1
- package/dist/types/plugins/text/strikeThrough/strikeThroughMark.d.ts +0 -4
- package/dist/types/plugins/text/strikeThrough/strikeThroughMark.d.ts.map +0 -1
- package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts +0 -3
- package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts.map +0 -1
- package/dist/types/plugins/text/underline/index.d.ts +0 -3
- package/dist/types/plugins/text/underline/index.d.ts.map +0 -1
- package/dist/types/plugins/text/underline/underlineMark.d.ts +0 -4
- package/dist/types/plugins/text/underline/underlineMark.d.ts.map +0 -1
- package/dist/types/plugins/text/underline/withUnderline.d.ts +0 -3
- package/dist/types/plugins/text/underline/withUnderline.d.ts.map +0 -1
- package/dist/types/slate-reexport.d.ts +0 -3
- package/dist/types/slate-reexport.d.ts.map +0 -1
- package/dist/types/slate-types.d.ts +0 -31
- package/dist/types/slate-types.d.ts.map +0 -1
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/dist/types/types/editor.d.ts +0 -43
- package/dist/types/types/editor.d.ts.map +0 -1
- package/dist/types/types/htmlDeserializer.d.ts +0 -38
- package/dist/types/types/htmlDeserializer.d.ts.map +0 -1
- package/dist/types/types/index.d.ts +0 -4
- package/dist/types/types/index.d.ts.map +0 -1
- package/dist/types/types/plugins.d.ts +0 -58
- package/dist/types/types/plugins.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
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,138 +0,0 @@
|
|
|
1
|
-
const ignoredElements = ["SCRIPT", "STYLE", "TEMPLATE"];
|
|
2
|
-
class HtmlDeserializer {
|
|
3
|
-
constructor(createDefaultElement, plugins) {
|
|
4
|
-
this.createDefaultElement = createDefaultElement;
|
|
5
|
-
this.plugins = plugins;
|
|
6
|
-
}
|
|
7
|
-
registerPlugin(plugin, prepend = true) {
|
|
8
|
-
prepend ? this.plugins.unshift(plugin) : this.plugins.push(plugin);
|
|
9
|
-
}
|
|
10
|
-
processNodeListPaste(nodeList, cumulativeTextAttrs) {
|
|
11
|
-
for (const plugin of this.plugins) {
|
|
12
|
-
const result = plugin.processNodeListPaste?.({ nodeList, cumulativeTextAttrs, deserializer: this }) ?? null;
|
|
13
|
-
if (result !== null) {
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const processed = [];
|
|
18
|
-
for (const childNode of nodeList) {
|
|
19
|
-
const isWhiteSpace = childNode.nodeType === Node.TEXT_NODE && childNode.textContent?.match(/^\s*$/) !== null;
|
|
20
|
-
const attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs);
|
|
21
|
-
const result = childNode instanceof HTMLElement ? this.processBlockPaste(
|
|
22
|
-
childNode,
|
|
23
|
-
cumulativeTextAttrs
|
|
24
|
-
) : null;
|
|
25
|
-
if (result !== null) {
|
|
26
|
-
processed.push(...(Array.isArray(result) ? result : [result]).map((element) => ({ element })));
|
|
27
|
-
} else {
|
|
28
|
-
const result2 = this.deserializeTextNode(childNode, cumulativeTextAttrs);
|
|
29
|
-
if (result2 !== null) {
|
|
30
|
-
processed.push(...result2.map((text) => ({ text, isWhiteSpace })));
|
|
31
|
-
} else {
|
|
32
|
-
const deserializedChildren = this.processNodeListPaste(
|
|
33
|
-
Array.from(childNode.childNodes),
|
|
34
|
-
attrs
|
|
35
|
-
);
|
|
36
|
-
processed.push(
|
|
37
|
-
...deserializedChildren === null ? [] : deserializedChildren.texts !== void 0 ? deserializedChildren.texts.map((text) => ({ text, isWhiteSpace })) : deserializedChildren.elements.map((element) => ({ element }))
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (processed.length === 0) {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
const containsBlock = processed.find(({ element }) => element !== void 0) !== void 0;
|
|
46
|
-
if (containsBlock) {
|
|
47
|
-
return {
|
|
48
|
-
elements: processed.flatMap((item) => {
|
|
49
|
-
if (item.text !== void 0) {
|
|
50
|
-
return item.isWhiteSpace ? [] : [this.createDefaultElement([item.text])];
|
|
51
|
-
} else if (item.element !== void 0) {
|
|
52
|
-
return [item.element];
|
|
53
|
-
}
|
|
54
|
-
{
|
|
55
|
-
return [];
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
};
|
|
59
|
-
} else {
|
|
60
|
-
return { texts: processed.map((item) => item.text) };
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
deserializeInline(list, cumulativeTextAttrs) {
|
|
64
|
-
return Array.from(list).flatMap((childNode) => {
|
|
65
|
-
const result = this.deserializeTextNode(childNode, cumulativeTextAttrs);
|
|
66
|
-
if (result !== null) {
|
|
67
|
-
return result;
|
|
68
|
-
} else {
|
|
69
|
-
const attrs = this.processWithAttributeProcessor(childNode, cumulativeTextAttrs);
|
|
70
|
-
return this.deserializeInline(childNode.childNodes, attrs);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
deserializeBlocks(list, cumulativeTextAttrs) {
|
|
75
|
-
const result = this.processNodeListPaste(list, cumulativeTextAttrs);
|
|
76
|
-
return result?.texts ?? result?.elements ?? [];
|
|
77
|
-
}
|
|
78
|
-
deserializeTextNode(node, cumulativeTextAttrs) {
|
|
79
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
80
|
-
const text = node.textContent ?? "";
|
|
81
|
-
return [{ ...cumulativeTextAttrs, text: text.replace(/[ \t]*(?:\r?\n[ \t]*)+/g, " ") }];
|
|
82
|
-
} else if (node instanceof HTMLElement) {
|
|
83
|
-
const result = this.processInlinePaste(
|
|
84
|
-
node,
|
|
85
|
-
cumulativeTextAttrs
|
|
86
|
-
);
|
|
87
|
-
if (result !== null) {
|
|
88
|
-
return Array.isArray(result) ? result : [result];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
processInlinePaste(element, cumulativeTextAttrs) {
|
|
94
|
-
if (ignoredElements.includes(element.tagName)) {
|
|
95
|
-
return [];
|
|
96
|
-
}
|
|
97
|
-
if (element.tagName === "BR") {
|
|
98
|
-
return { ...cumulativeTextAttrs, text: " " };
|
|
99
|
-
}
|
|
100
|
-
const next = (list, cta) => {
|
|
101
|
-
const attrs = this.processWithAttributeProcessor(element, cta);
|
|
102
|
-
return this.deserializeInline(list, attrs);
|
|
103
|
-
};
|
|
104
|
-
for (const plugin of this.plugins) {
|
|
105
|
-
const result = plugin.processInlinePaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null;
|
|
106
|
-
if (result !== null) {
|
|
107
|
-
return result;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
|
-
processWithAttributeProcessor(element, cumulativeTextAttrs) {
|
|
113
|
-
if (!(element instanceof HTMLElement)) {
|
|
114
|
-
return {};
|
|
115
|
-
}
|
|
116
|
-
return this.plugins.reduce(
|
|
117
|
-
(cta, plugin) => plugin.processAttributesPaste?.({ element, cumulativeTextAttrs, deserializer: this }) ?? cta,
|
|
118
|
-
cumulativeTextAttrs
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
processBlockPaste(element, cumulativeTextAttrs) {
|
|
122
|
-
if (ignoredElements.includes(element.tagName)) {
|
|
123
|
-
return [];
|
|
124
|
-
}
|
|
125
|
-
const next = (list, cta) => this.deserializeBlocks(Array.from(list), { ...cumulativeTextAttrs, ...cta });
|
|
126
|
-
for (const plugin of this.plugins) {
|
|
127
|
-
const result = plugin.processBlockPaste?.({ element, next, cumulativeTextAttrs, deserializer: this }) ?? null;
|
|
128
|
-
if (result !== null) {
|
|
129
|
-
return result;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
export {
|
|
136
|
-
HtmlDeserializer
|
|
137
|
-
};
|
|
138
|
-
//# sourceMappingURL=HtmlDeserializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const createMarkHtmlDeserializer = (markType, tagMatcher, attributeMatcher) => ({
|
|
4
|
-
processAttributesPaste: ({ element, cumulativeTextAttrs: cta }) => {
|
|
5
|
-
return attributeMatcher(element) ? { ...cta, [markType]: true } : cta;
|
|
6
|
-
},
|
|
7
|
-
processInlinePaste: ({ element, next, cumulativeTextAttrs }) => {
|
|
8
|
-
if (tagMatcher(element)) {
|
|
9
|
-
return next(element.childNodes, { ...cumulativeTextAttrs, [markType]: true });
|
|
10
|
-
}
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
exports.createMarkHtmlDeserializer = createMarkHtmlDeserializer;
|
|
15
|
-
//# sourceMappingURL=createMarkHtmlDeserializer.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,15 +0,0 @@
|
|
|
1
|
-
const createMarkHtmlDeserializer = (markType, tagMatcher, attributeMatcher) => ({
|
|
2
|
-
processAttributesPaste: ({ element, cumulativeTextAttrs: cta }) => {
|
|
3
|
-
return attributeMatcher(element) ? { ...cta, [markType]: true } : cta;
|
|
4
|
-
},
|
|
5
|
-
processInlinePaste: ({ element, next, cumulativeTextAttrs }) => {
|
|
6
|
-
if (tagMatcher(element)) {
|
|
7
|
-
return next(element.childNodes, { ...cumulativeTextAttrs, [markType]: true });
|
|
8
|
-
}
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
export {
|
|
13
|
-
createMarkHtmlDeserializer
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=createMarkHtmlDeserializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Slate = require("slate");
|
|
4
|
-
const HtmlDeserializer = require("./HtmlDeserializer.cjs");
|
|
5
|
-
const withPaste = (editor) => {
|
|
6
|
-
const { insertData } = editor;
|
|
7
|
-
const htmlDeserializer = new HtmlDeserializer.HtmlDeserializer(editor.createDefaultElement, []);
|
|
8
|
-
editor.insertData = (data) => {
|
|
9
|
-
if (data.getData("application/x-slate-fragment")) {
|
|
10
|
-
return insertData(data);
|
|
11
|
-
}
|
|
12
|
-
const html = data.getData("text/html");
|
|
13
|
-
if (!html) {
|
|
14
|
-
return insertData(data);
|
|
15
|
-
}
|
|
16
|
-
const document = new DOMParser().parseFromString(html, "text/html");
|
|
17
|
-
const nodes = Array.from(document.body.childNodes);
|
|
18
|
-
const result = htmlDeserializer.deserializeBlocks(nodes, {});
|
|
19
|
-
Slate.Transforms.insertFragment(editor, result);
|
|
20
|
-
};
|
|
21
|
-
editor.htmlDeserializer = htmlDeserializer;
|
|
22
|
-
};
|
|
23
|
-
exports.withPaste = withPaste;
|
|
24
|
-
//# sourceMappingURL=withPaste.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,24 +0,0 @@
|
|
|
1
|
-
import { Transforms } from "slate";
|
|
2
|
-
import { HtmlDeserializer } from "./HtmlDeserializer.js";
|
|
3
|
-
const withPaste = (editor) => {
|
|
4
|
-
const { insertData } = editor;
|
|
5
|
-
const htmlDeserializer = new HtmlDeserializer(editor.createDefaultElement, []);
|
|
6
|
-
editor.insertData = (data) => {
|
|
7
|
-
if (data.getData("application/x-slate-fragment")) {
|
|
8
|
-
return insertData(data);
|
|
9
|
-
}
|
|
10
|
-
const html = data.getData("text/html");
|
|
11
|
-
if (!html) {
|
|
12
|
-
return insertData(data);
|
|
13
|
-
}
|
|
14
|
-
const document = new DOMParser().parseFromString(html, "text/html");
|
|
15
|
-
const nodes = Array.from(document.body.childNodes);
|
|
16
|
-
const result = htmlDeserializer.deserializeBlocks(nodes, {});
|
|
17
|
-
Transforms.insertFragment(editor, result);
|
|
18
|
-
};
|
|
19
|
-
editor.htmlDeserializer = htmlDeserializer;
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
withPaste
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=withPaste.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Slate = require("slate");
|
|
4
|
-
const AnchorModifications = require("./AnchorModifications.cjs");
|
|
5
|
-
const anchorElementType = "anchor";
|
|
6
|
-
const isAnchorElement = (element) => Slate.Element.isElement(element) && element.type === anchorElementType;
|
|
7
|
-
const isAnchorElementActive = (editor) => {
|
|
8
|
-
const [link] = Slate.Editor.nodes(editor, { match: isAnchorElement });
|
|
9
|
-
return !!link;
|
|
10
|
-
};
|
|
11
|
-
const anchorElementPlugin = ({ render }) => ({
|
|
12
|
-
type: anchorElementType,
|
|
13
|
-
isInline: true,
|
|
14
|
-
render,
|
|
15
|
-
isActive: ({ editor }) => isAnchorElementActive(editor),
|
|
16
|
-
toggleElement: ({ editor, suchThat }) => {
|
|
17
|
-
if (isAnchorElementActive(editor)) {
|
|
18
|
-
AnchorModifications.AnchorModifications.unwrapAnchor(editor);
|
|
19
|
-
} else {
|
|
20
|
-
const href = suchThat?.href ?? prompt("Insert the URL:");
|
|
21
|
-
if (!href) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
AnchorModifications.AnchorModifications.wrapAnchor(editor, href);
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
normalizeNode: ({ element, path, editor, preventDefault }) => {
|
|
28
|
-
if (Slate.Node.string(element) === "") {
|
|
29
|
-
const selection = editor.selection;
|
|
30
|
-
Slate.Transforms.removeNodes(editor, {
|
|
31
|
-
at: path
|
|
32
|
-
});
|
|
33
|
-
if (selection && Slate.Range.isCollapsed(selection) && Slate.Path.isCommon(path, selection.focus.path)) {
|
|
34
|
-
Slate.Transforms.select(editor, Slate.Path.parent(path));
|
|
35
|
-
}
|
|
36
|
-
return preventDefault();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
exports.anchorElementPlugin = anchorElementPlugin;
|
|
41
|
-
exports.anchorElementType = anchorElementType;
|
|
42
|
-
exports.isAnchorElement = isAnchorElement;
|
|
43
|
-
exports.isAnchorElementActive = isAnchorElementActive;
|
|
44
|
-
//# sourceMappingURL=AnchorElement.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,44 +0,0 @@
|
|
|
1
|
-
import { Element, Editor, Node, Transforms, Range, Path } from "slate";
|
|
2
|
-
import { AnchorModifications } from "./AnchorModifications.js";
|
|
3
|
-
const anchorElementType = "anchor";
|
|
4
|
-
const isAnchorElement = (element) => Element.isElement(element) && element.type === anchorElementType;
|
|
5
|
-
const isAnchorElementActive = (editor) => {
|
|
6
|
-
const [link] = Editor.nodes(editor, { match: isAnchorElement });
|
|
7
|
-
return !!link;
|
|
8
|
-
};
|
|
9
|
-
const anchorElementPlugin = ({ render }) => ({
|
|
10
|
-
type: anchorElementType,
|
|
11
|
-
isInline: true,
|
|
12
|
-
render,
|
|
13
|
-
isActive: ({ editor }) => isAnchorElementActive(editor),
|
|
14
|
-
toggleElement: ({ editor, suchThat }) => {
|
|
15
|
-
if (isAnchorElementActive(editor)) {
|
|
16
|
-
AnchorModifications.unwrapAnchor(editor);
|
|
17
|
-
} else {
|
|
18
|
-
const href = suchThat?.href ?? prompt("Insert the URL:");
|
|
19
|
-
if (!href) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
AnchorModifications.wrapAnchor(editor, href);
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
normalizeNode: ({ element, path, editor, preventDefault }) => {
|
|
26
|
-
if (Node.string(element) === "") {
|
|
27
|
-
const selection = editor.selection;
|
|
28
|
-
Transforms.removeNodes(editor, {
|
|
29
|
-
at: path
|
|
30
|
-
});
|
|
31
|
-
if (selection && Range.isCollapsed(selection) && Path.isCommon(path, selection.focus.path)) {
|
|
32
|
-
Transforms.select(editor, Path.parent(path));
|
|
33
|
-
}
|
|
34
|
-
return preventDefault();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
export {
|
|
39
|
-
anchorElementPlugin,
|
|
40
|
-
anchorElementType,
|
|
41
|
-
isAnchorElement,
|
|
42
|
-
isAnchorElementActive
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=AnchorElement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const anchorHtmlDeserializer = {
|
|
4
|
-
processInlinePaste: ({ element, next, cumulativeTextAttrs }) => {
|
|
5
|
-
if (element.tagName === "A" && element.getAttribute("href")) {
|
|
6
|
-
const href = element.getAttribute("href");
|
|
7
|
-
return [
|
|
8
|
-
{
|
|
9
|
-
type: "anchor",
|
|
10
|
-
href,
|
|
11
|
-
children: next(element.childNodes, cumulativeTextAttrs)
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
}
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
exports.anchorHtmlDeserializer = anchorHtmlDeserializer;
|
|
19
|
-
//# sourceMappingURL=AnchorHtmlDeserializer.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,19 +0,0 @@
|
|
|
1
|
-
const anchorHtmlDeserializer = {
|
|
2
|
-
processInlinePaste: ({ element, next, cumulativeTextAttrs }) => {
|
|
3
|
-
if (element.tagName === "A" && element.getAttribute("href")) {
|
|
4
|
-
const href = element.getAttribute("href");
|
|
5
|
-
return [
|
|
6
|
-
{
|
|
7
|
-
type: "anchor",
|
|
8
|
-
href,
|
|
9
|
-
children: next(element.childNodes, cumulativeTextAttrs)
|
|
10
|
-
}
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
export {
|
|
17
|
-
anchorHtmlDeserializer
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=AnchorHtmlDeserializer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Slate = require("slate");
|
|
4
|
-
const AnchorElement = require("./AnchorElement.cjs");
|
|
5
|
-
class AnchorModifications {
|
|
6
|
-
static unwrapAnchor(editor) {
|
|
7
|
-
Slate.Transforms.unwrapNodes(editor, { match: AnchorElement.isAnchorElement });
|
|
8
|
-
}
|
|
9
|
-
static wrapAnchor(editor, url) {
|
|
10
|
-
if (AnchorElement.isAnchorElementActive(editor)) {
|
|
11
|
-
AnchorModifications.unwrapAnchor(editor);
|
|
12
|
-
}
|
|
13
|
-
const selection = editor.selection;
|
|
14
|
-
const isCollapsed = selection ? Slate.Range.isCollapsed(selection) : false;
|
|
15
|
-
const anchor = {
|
|
16
|
-
type: "anchor",
|
|
17
|
-
href: url,
|
|
18
|
-
children: isCollapsed ? [{ text: url }] : [{ text: "" }]
|
|
19
|
-
};
|
|
20
|
-
if (isCollapsed) {
|
|
21
|
-
Slate.Transforms.insertNodes(editor, anchor);
|
|
22
|
-
} else {
|
|
23
|
-
Slate.Transforms.wrapNodes(editor, anchor, { split: true });
|
|
24
|
-
Slate.Transforms.collapse(editor, { edge: "end" });
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.AnchorModifications = AnchorModifications;
|
|
29
|
-
//# sourceMappingURL=AnchorModifications.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,29 +0,0 @@
|
|
|
1
|
-
import { Transforms, Range } from "slate";
|
|
2
|
-
import { isAnchorElement, isAnchorElementActive } from "./AnchorElement.js";
|
|
3
|
-
class AnchorModifications {
|
|
4
|
-
static unwrapAnchor(editor) {
|
|
5
|
-
Transforms.unwrapNodes(editor, { match: isAnchorElement });
|
|
6
|
-
}
|
|
7
|
-
static wrapAnchor(editor, url) {
|
|
8
|
-
if (isAnchorElementActive(editor)) {
|
|
9
|
-
AnchorModifications.unwrapAnchor(editor);
|
|
10
|
-
}
|
|
11
|
-
const selection = editor.selection;
|
|
12
|
-
const isCollapsed = selection ? Range.isCollapsed(selection) : false;
|
|
13
|
-
const anchor = {
|
|
14
|
-
type: "anchor",
|
|
15
|
-
href: url,
|
|
16
|
-
children: isCollapsed ? [{ text: url }] : [{ text: "" }]
|
|
17
|
-
};
|
|
18
|
-
if (isCollapsed) {
|
|
19
|
-
Transforms.insertNodes(editor, anchor);
|
|
20
|
-
} else {
|
|
21
|
-
Transforms.wrapNodes(editor, anchor, { split: true });
|
|
22
|
-
Transforms.collapse(editor, { edge: "end" });
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
AnchorModifications
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=AnchorModifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const AnchorModifications = require("./AnchorModifications.cjs");
|
|
4
|
-
const AnchorElement = require("./AnchorElement.cjs");
|
|
5
|
-
const AnchorHtmlDeserializer = require("./AnchorHtmlDeserializer.cjs");
|
|
6
|
-
const parseUrl = require("../../../internal/utils/parseUrl.cjs");
|
|
7
|
-
const withAnchors = ({ render }) => (editor) => {
|
|
8
|
-
const { insertText } = editor;
|
|
9
|
-
editor.registerElement(AnchorElement.anchorElementPlugin({ render }));
|
|
10
|
-
editor.htmlDeserializer.registerPlugin(AnchorHtmlDeserializer.anchorHtmlDeserializer);
|
|
11
|
-
editor.insertText = (text) => {
|
|
12
|
-
if (text && parseUrl.parseUrl(text) !== void 0) {
|
|
13
|
-
AnchorModifications.AnchorModifications.wrapAnchor(editor, text);
|
|
14
|
-
} else {
|
|
15
|
-
insertText(text);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
return editor;
|
|
19
|
-
};
|
|
20
|
-
exports.withAnchors = withAnchors;
|
|
21
|
-
//# sourceMappingURL=withAnchors.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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,21 +0,0 @@
|
|
|
1
|
-
import { AnchorModifications } from "./AnchorModifications.js";
|
|
2
|
-
import { anchorElementPlugin } from "./AnchorElement.js";
|
|
3
|
-
import { anchorHtmlDeserializer } from "./AnchorHtmlDeserializer.js";
|
|
4
|
-
import { parseUrl } from "../../../internal/utils/parseUrl.js";
|
|
5
|
-
const withAnchors = ({ render }) => (editor) => {
|
|
6
|
-
const { insertText } = editor;
|
|
7
|
-
editor.registerElement(anchorElementPlugin({ render }));
|
|
8
|
-
editor.htmlDeserializer.registerPlugin(anchorHtmlDeserializer);
|
|
9
|
-
editor.insertText = (text) => {
|
|
10
|
-
if (text && parseUrl(text) !== void 0) {
|
|
11
|
-
AnchorModifications.wrapAnchor(editor, text);
|
|
12
|
-
} else {
|
|
13
|
-
insertText(text);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
return editor;
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
withAnchors
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=withAnchors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Slate = require("slate");
|
|
4
|
-
const index = require("../../../editor/index.cjs");
|
|
5
|
-
const headingElementType = "heading";
|
|
6
|
-
const isHeadingElement = (element, suchThat) => index.ContemberEditor.isElementType(element, headingElementType, suchThat);
|
|
7
|
-
const ejectHeadingElement = (editor, elementPath) => {
|
|
8
|
-
index.ContemberEditor.ejectElement(editor, elementPath);
|
|
9
|
-
Slate.Transforms.setNodes(editor, { type: editor.defaultElementType }, { at: elementPath });
|
|
10
|
-
};
|
|
11
|
-
const headingElementPlugin = ({ render }) => ({
|
|
12
|
-
type: headingElementType,
|
|
13
|
-
render,
|
|
14
|
-
canContainAnyBlocks: false,
|
|
15
|
-
acceptsAttributes: ({ editor, suchThat }) => {
|
|
16
|
-
return "align" in suchThat;
|
|
17
|
-
},
|
|
18
|
-
// TODO in the following function, we need to conditionally trim the selection so that it doesn't potentially
|
|
19
|
-
// include empty strings at the edges of top-level elements.
|
|
20
|
-
toggleElement: ({ editor, suchThat }) => {
|
|
21
|
-
Slate.Editor.withoutNormalizing(editor, () => {
|
|
22
|
-
const headings = Array.from(Slate.Editor.nodes(editor, { match: (it) => isHeadingElement(it, suchThat) }));
|
|
23
|
-
if (headings.length) {
|
|
24
|
-
for (const heading of headings) {
|
|
25
|
-
ejectHeadingElement(editor, heading[1]);
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
Slate.Transforms.setNodes(editor, {
|
|
29
|
-
...suchThat,
|
|
30
|
-
children: [],
|
|
31
|
-
type: headingElementType
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
exports.ejectHeadingElement = ejectHeadingElement;
|
|
38
|
-
exports.headingElementPlugin = headingElementPlugin;
|
|
39
|
-
exports.headingElementType = headingElementType;
|
|
40
|
-
exports.isHeadingElement = isHeadingElement;
|
|
41
|
-
//# sourceMappingURL=HeadingElement.cjs.map
|