@contember/react-slate-editor-base 2.1.0-alpha.3 → 2.1.0-alpha.35
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":"TableModifications.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableModifications.ts"],"sourcesContent":["import { Editor, NodeEntry, Transforms } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { getTableElementColumnCount, getTableElementRowCount, TableElement } from './TableElement'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement'\nimport { ContemberEditor } from '../../../editor'\nimport {\n\tcreateEmptyTableCellElement,\n\tisTableCellElement,\n\tTableCellElement,\n\ttableCellElementType,\n} from './TableCellElement'\n\nexport class TableModifications {\n\tpublic static deleteTableColumn(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst rowCount = element.children.length\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: [...tablePath, rowIndex, index],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static addTableRow(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowIndex = index ?? element.children.length\n\n\t\tlet tableRow: TableRowElement\n\t\tif (element.children.length === 0) {\n\t\t\ttableRow = createEmptyTableRowElement(columnCount)\n\t\t} else {\n\t\t\tconst blueprintRow = element.children[rowIndex === 0 ? 0 : rowIndex - 1] as TableRowElement\n\n\t\t\ttableRow = {\n\t\t\t\t...ContemberEditor.elementToSpecifics(blueprintRow),\n\t\t\t\ttype: tableRowElementType,\n\t\t\t\tchildren: Array.from(\n\t\t\t\t\t{ length: columnCount },\n\t\t\t\t\t(_, columnIndex): TableCellElement => copyTableCell(blueprintRow.children[columnIndex] as TableCellElement),\n\t\t\t\t),\n\t\t\t}\n\n\t\t\tif (rowIndex === 0) {\n\t\t\t\tconst firstRow = element.children[0] as TableRowElement\n\t\t\t\tif (firstRow.headerScope) {\n\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, 0] })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTransforms.insertNodes(editor, tableRow, {\n\t\t\tat: [...tablePath, rowIndex],\n\t\t})\n\t}\n\n\tpublic static addTableColumn(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowCount = getTableElementRowCount(element)\n\t\tconst columnIndex = index ?? columnCount ?? 0\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tconst tableRow = element.children[rowIndex] as TableRowElement\n\n\t\t\t\tlet tableCell: TableCellElement\n\t\t\t\tif (tableRow.children.length === 0) {\n\t\t\t\t\ttableCell = createEmptyTableCellElement()\n\t\t\t\t} else {\n\t\t\t\t\ttableCell = copyTableCell(tableRow.children[columnIndex === 0 ? 0 : columnIndex - 1] as TableCellElement)\n\n\t\t\t\t\tif (columnIndex === 0) {\n\t\t\t\t\t\tconst firstCell = tableRow.children[0] as TableCellElement\n\t\t\t\t\t\tif (firstCell.headerScope) {\n\t\t\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, rowIndex, 0] })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tTransforms.insertNodes(editor, tableCell, {\n\t\t\t\t\tat: [...tablePath, rowIndex, columnIndex],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static justifyTableColumn(editor: Editor, element: TableElement, columnIndex: number, direction: TableCellElement['justify']) {\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ justify: direction ?? undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static toggleTableRowHeaderScope(editor: Editor, element: TableElement, rowIndex: number, scope: TableRowElement['headerScope']) {\n\t\tconst rowCount = element.children.length\n\t\tif (rowIndex !== 0 || rowCount < 1) {\n\t\t\treturn\n\t\t}\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst firstRow = element.children[0] as TableRowElement\n\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ headerScope: firstRow.headerScope === scope ? undefined : scope },\n\t\t\t{ match: node => isTableRowElement(node), at: [...tablePath, 0] },\n\t\t)\n\t}\n\n\tpublic static toggleTableColumnHeaderScope(editor: Editor, element: TableElement, columnIndex: number, scope: TableCellElement['headerScope']) {\n\t\tlet currentStatusScore = 0\n\t\tconst rowCount = element.children.length\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([cell]) => {\n\t\t\tcurrentStatusScore += cell.headerScope === scope ? 1 : -1\n\t\t})\n\n\t\t// If none have it or the majority does but not all.\n\t\tconst shouldSetScope =\n\t\t\t-currentStatusScore === rowCount || (currentStatusScore > 0 && currentStatusScore !== rowCount)\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ headerScope: shouldSetScope ? scope : undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static deleteTableRow(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tTransforms.removeNodes(editor, {\n\t\t\tat: [...tablePath, index],\n\t\t})\n\t}\n}\n\nconst forEachCellInColumn = (\n\teditor: Editor,\n\telement: TableElement,\n\tcolumnIndex: number,\n\tcallback: (cellEntry: NodeEntry<TableCellElement>) => void,\n) => {\n\tconst tablePath = ReactEditor.findPath(editor, element)\n\tconst rowCount = getTableElementRowCount(element)\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\tcallback(Editor.node(editor, [...tablePath, rowIndex, columnIndex]) as NodeEntry<TableCellElement>)\n\t\t}\n\t})\n}\nconst copyTableCell = (tableCellElement: TableCellElement): TableCellElement => ({\n\t...ContemberEditor.elementToSpecifics(tableCellElement),\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n\n"],"names":["index","ReactEditor","Editor","Transforms","getTableElementColumnCount","createEmptyTableRowElement","ContemberEditor","tableRowElementType","getTableElementRowCount","createEmptyTableCellElement","isTableCellElement","isTableRowElement","tableCellElementType"],"mappings":"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"}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { Editor, Transforms } from "slate";
|
|
2
|
-
import { ReactEditor } from "slate-react";
|
|
3
|
-
import { getTableElementColumnCount, getTableElementRowCount } from "./TableElement.js";
|
|
4
|
-
import { createEmptyTableRowElement, tableRowElementType, isTableRowElement } from "./TableRowElement.js";
|
|
5
|
-
import { ContemberEditor } from "../../../editor/index.js";
|
|
6
|
-
import { tableCellElementType, createEmptyTableCellElement, isTableCellElement } from "./TableCellElement.js";
|
|
7
|
-
class TableModifications {
|
|
8
|
-
static deleteTableColumn(editor, element, index) {
|
|
9
|
-
const tablePath = ReactEditor.findPath(editor, element);
|
|
10
|
-
const rowCount = element.children.length;
|
|
11
|
-
Editor.withoutNormalizing(editor, () => {
|
|
12
|
-
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
13
|
-
Transforms.removeNodes(editor, {
|
|
14
|
-
at: [...tablePath, rowIndex, index]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
static addTableRow(editor, element, index) {
|
|
20
|
-
const tablePath = ReactEditor.findPath(editor, element);
|
|
21
|
-
const columnCount = getTableElementColumnCount(element);
|
|
22
|
-
const rowIndex = index ?? element.children.length;
|
|
23
|
-
let tableRow;
|
|
24
|
-
if (element.children.length === 0) {
|
|
25
|
-
tableRow = createEmptyTableRowElement(columnCount);
|
|
26
|
-
} else {
|
|
27
|
-
const blueprintRow = element.children[rowIndex === 0 ? 0 : rowIndex - 1];
|
|
28
|
-
tableRow = {
|
|
29
|
-
...ContemberEditor.elementToSpecifics(blueprintRow),
|
|
30
|
-
type: tableRowElementType,
|
|
31
|
-
children: Array.from(
|
|
32
|
-
{ length: columnCount },
|
|
33
|
-
(_, columnIndex) => copyTableCell(blueprintRow.children[columnIndex])
|
|
34
|
-
)
|
|
35
|
-
};
|
|
36
|
-
if (rowIndex === 0) {
|
|
37
|
-
const firstRow = element.children[0];
|
|
38
|
-
if (firstRow.headerScope) {
|
|
39
|
-
Transforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, 0] });
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
Transforms.insertNodes(editor, tableRow, {
|
|
44
|
-
at: [...tablePath, rowIndex]
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
static addTableColumn(editor, element, index) {
|
|
48
|
-
const tablePath = ReactEditor.findPath(editor, element);
|
|
49
|
-
const columnCount = getTableElementColumnCount(element);
|
|
50
|
-
const rowCount = getTableElementRowCount(element);
|
|
51
|
-
const columnIndex = index ?? columnCount ?? 0;
|
|
52
|
-
Editor.withoutNormalizing(editor, () => {
|
|
53
|
-
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
54
|
-
const tableRow = element.children[rowIndex];
|
|
55
|
-
let tableCell;
|
|
56
|
-
if (tableRow.children.length === 0) {
|
|
57
|
-
tableCell = createEmptyTableCellElement();
|
|
58
|
-
} else {
|
|
59
|
-
tableCell = copyTableCell(tableRow.children[columnIndex === 0 ? 0 : columnIndex - 1]);
|
|
60
|
-
if (columnIndex === 0) {
|
|
61
|
-
const firstCell = tableRow.children[0];
|
|
62
|
-
if (firstCell.headerScope) {
|
|
63
|
-
Transforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, rowIndex, 0] });
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
Transforms.insertNodes(editor, tableCell, {
|
|
68
|
-
at: [...tablePath, rowIndex, columnIndex]
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
static justifyTableColumn(editor, element, columnIndex, direction) {
|
|
74
|
-
forEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {
|
|
75
|
-
Transforms.setNodes(
|
|
76
|
-
editor,
|
|
77
|
-
{ justify: direction ?? void 0 },
|
|
78
|
-
{ match: (node) => isTableCellElement(node), at: cellPath }
|
|
79
|
-
);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
static toggleTableRowHeaderScope(editor, element, rowIndex, scope) {
|
|
83
|
-
const rowCount = element.children.length;
|
|
84
|
-
if (rowIndex !== 0 || rowCount < 1) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const tablePath = ReactEditor.findPath(editor, element);
|
|
88
|
-
const firstRow = element.children[0];
|
|
89
|
-
Transforms.setNodes(
|
|
90
|
-
editor,
|
|
91
|
-
{ headerScope: firstRow.headerScope === scope ? void 0 : scope },
|
|
92
|
-
{ match: (node) => isTableRowElement(node), at: [...tablePath, 0] }
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
static toggleTableColumnHeaderScope(editor, element, columnIndex, scope) {
|
|
96
|
-
let currentStatusScore = 0;
|
|
97
|
-
const rowCount = element.children.length;
|
|
98
|
-
forEachCellInColumn(editor, element, columnIndex, ([cell]) => {
|
|
99
|
-
currentStatusScore += cell.headerScope === scope ? 1 : -1;
|
|
100
|
-
});
|
|
101
|
-
const shouldSetScope = -currentStatusScore === rowCount || currentStatusScore > 0 && currentStatusScore !== rowCount;
|
|
102
|
-
forEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {
|
|
103
|
-
Transforms.setNodes(
|
|
104
|
-
editor,
|
|
105
|
-
{ headerScope: shouldSetScope ? scope : void 0 },
|
|
106
|
-
{ match: (node) => isTableCellElement(node), at: cellPath }
|
|
107
|
-
);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
static deleteTableRow(editor, element, index) {
|
|
111
|
-
const tablePath = ReactEditor.findPath(editor, element);
|
|
112
|
-
Transforms.removeNodes(editor, {
|
|
113
|
-
at: [...tablePath, index]
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
const forEachCellInColumn = (editor, element, columnIndex, callback) => {
|
|
118
|
-
const tablePath = ReactEditor.findPath(editor, element);
|
|
119
|
-
const rowCount = getTableElementRowCount(element);
|
|
120
|
-
Editor.withoutNormalizing(editor, () => {
|
|
121
|
-
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
122
|
-
callback(Editor.node(editor, [...tablePath, rowIndex, columnIndex]));
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
const copyTableCell = (tableCellElement) => ({
|
|
127
|
-
...ContemberEditor.elementToSpecifics(tableCellElement),
|
|
128
|
-
type: tableCellElementType,
|
|
129
|
-
children: [{ text: "" }]
|
|
130
|
-
});
|
|
131
|
-
export {
|
|
132
|
-
TableModifications
|
|
133
|
-
};
|
|
134
|
-
//# sourceMappingURL=TableModifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableModifications.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableModifications.ts"],"sourcesContent":["import { Editor, NodeEntry, Transforms } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { getTableElementColumnCount, getTableElementRowCount, TableElement } from './TableElement'\nimport { createEmptyTableRowElement, isTableRowElement, TableRowElement, tableRowElementType } from './TableRowElement'\nimport { ContemberEditor } from '../../../editor'\nimport {\n\tcreateEmptyTableCellElement,\n\tisTableCellElement,\n\tTableCellElement,\n\ttableCellElementType,\n} from './TableCellElement'\n\nexport class TableModifications {\n\tpublic static deleteTableColumn(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst rowCount = element.children.length\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tTransforms.removeNodes(editor, {\n\t\t\t\t\tat: [...tablePath, rowIndex, index],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static addTableRow(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowIndex = index ?? element.children.length\n\n\t\tlet tableRow: TableRowElement\n\t\tif (element.children.length === 0) {\n\t\t\ttableRow = createEmptyTableRowElement(columnCount)\n\t\t} else {\n\t\t\tconst blueprintRow = element.children[rowIndex === 0 ? 0 : rowIndex - 1] as TableRowElement\n\n\t\t\ttableRow = {\n\t\t\t\t...ContemberEditor.elementToSpecifics(blueprintRow),\n\t\t\t\ttype: tableRowElementType,\n\t\t\t\tchildren: Array.from(\n\t\t\t\t\t{ length: columnCount },\n\t\t\t\t\t(_, columnIndex): TableCellElement => copyTableCell(blueprintRow.children[columnIndex] as TableCellElement),\n\t\t\t\t),\n\t\t\t}\n\n\t\t\tif (rowIndex === 0) {\n\t\t\t\tconst firstRow = element.children[0] as TableRowElement\n\t\t\t\tif (firstRow.headerScope) {\n\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, 0] })\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTransforms.insertNodes(editor, tableRow, {\n\t\t\tat: [...tablePath, rowIndex],\n\t\t})\n\t}\n\n\tpublic static addTableColumn(editor: Editor, element: TableElement, index?: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst columnCount = getTableElementColumnCount(element)\n\t\tconst rowCount = getTableElementRowCount(element)\n\t\tconst columnIndex = index ?? columnCount ?? 0\n\n\t\tEditor.withoutNormalizing(editor, () => {\n\t\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\t\tconst tableRow = element.children[rowIndex] as TableRowElement\n\n\t\t\t\tlet tableCell: TableCellElement\n\t\t\t\tif (tableRow.children.length === 0) {\n\t\t\t\t\ttableCell = createEmptyTableCellElement()\n\t\t\t\t} else {\n\t\t\t\t\ttableCell = copyTableCell(tableRow.children[columnIndex === 0 ? 0 : columnIndex - 1] as TableCellElement)\n\n\t\t\t\t\tif (columnIndex === 0) {\n\t\t\t\t\t\tconst firstCell = tableRow.children[0] as TableCellElement\n\t\t\t\t\t\tif (firstCell.headerScope) {\n\t\t\t\t\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: [...tablePath, rowIndex, 0] })\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tTransforms.insertNodes(editor, tableCell, {\n\t\t\t\t\tat: [...tablePath, rowIndex, columnIndex],\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tpublic static justifyTableColumn(editor: Editor, element: TableElement, columnIndex: number, direction: TableCellElement['justify']) {\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ justify: direction ?? undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static toggleTableRowHeaderScope(editor: Editor, element: TableElement, rowIndex: number, scope: TableRowElement['headerScope']) {\n\t\tconst rowCount = element.children.length\n\t\tif (rowIndex !== 0 || rowCount < 1) {\n\t\t\treturn\n\t\t}\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tconst firstRow = element.children[0] as TableRowElement\n\n\t\tTransforms.setNodes(\n\t\t\teditor,\n\t\t\t{ headerScope: firstRow.headerScope === scope ? undefined : scope },\n\t\t\t{ match: node => isTableRowElement(node), at: [...tablePath, 0] },\n\t\t)\n\t}\n\n\tpublic static toggleTableColumnHeaderScope(editor: Editor, element: TableElement, columnIndex: number, scope: TableCellElement['headerScope']) {\n\t\tlet currentStatusScore = 0\n\t\tconst rowCount = element.children.length\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([cell]) => {\n\t\t\tcurrentStatusScore += cell.headerScope === scope ? 1 : -1\n\t\t})\n\n\t\t// If none have it or the majority does but not all.\n\t\tconst shouldSetScope =\n\t\t\t-currentStatusScore === rowCount || (currentStatusScore > 0 && currentStatusScore !== rowCount)\n\n\t\tforEachCellInColumn(editor, element, columnIndex, ([, cellPath]) => {\n\t\t\tTransforms.setNodes(\n\t\t\t\teditor,\n\t\t\t\t{ headerScope: shouldSetScope ? scope : undefined },\n\t\t\t\t{ match: node => isTableCellElement(node), at: cellPath },\n\t\t\t)\n\t\t})\n\t}\n\n\tpublic static deleteTableRow(editor: Editor, element: TableElement, index: number) {\n\t\tconst tablePath = ReactEditor.findPath(editor, element)\n\t\tTransforms.removeNodes(editor, {\n\t\t\tat: [...tablePath, index],\n\t\t})\n\t}\n}\n\nconst forEachCellInColumn = (\n\teditor: Editor,\n\telement: TableElement,\n\tcolumnIndex: number,\n\tcallback: (cellEntry: NodeEntry<TableCellElement>) => void,\n) => {\n\tconst tablePath = ReactEditor.findPath(editor, element)\n\tconst rowCount = getTableElementRowCount(element)\n\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n\t\t\tcallback(Editor.node(editor, [...tablePath, rowIndex, columnIndex]) as NodeEntry<TableCellElement>)\n\t\t}\n\t})\n}\nconst copyTableCell = (tableCellElement: TableCellElement): TableCellElement => ({\n\t...ContemberEditor.elementToSpecifics(tableCellElement),\n\ttype: tableCellElementType,\n\tchildren: [{ text: '' }],\n})\n\n"],"names":[],"mappings":"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"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const Slate = require("slate");
|
|
4
|
-
const TableCellElement = require("./TableCellElement.cjs");
|
|
5
|
-
const index = require("../../../editor/index.cjs");
|
|
6
|
-
const TableElement = require("./TableElement.cjs");
|
|
7
|
-
const tableRowElementType = "tableRow";
|
|
8
|
-
const isTableRowElement = (element) => Slate.Element.isElement(element) && element.type === tableRowElementType;
|
|
9
|
-
const createEmptyTableRowElement = (columnCount = 2) => ({
|
|
10
|
-
type: tableRowElementType,
|
|
11
|
-
children: Array.from({ length: columnCount }, () => TableCellElement.createEmptyTableCellElement())
|
|
12
|
-
});
|
|
13
|
-
const tableRowElementPlugin = ({ render }) => ({
|
|
14
|
-
type: tableRowElementType,
|
|
15
|
-
render,
|
|
16
|
-
normalizeNode: ({ editor, path, element, preventDefault }) => {
|
|
17
|
-
for (const [child, childPath] of Slate.Node.children(editor, path)) {
|
|
18
|
-
if (Slate.Element.isElement(child)) {
|
|
19
|
-
if (!TableCellElement.isTableCellElement(child)) {
|
|
20
|
-
index.ContemberEditor.ejectElement(editor, childPath);
|
|
21
|
-
Slate.Transforms.setNodes(editor, { type: TableCellElement.tableCellElementType }, { at: childPath });
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
Slate.Transforms.removeNodes(editor, { at: path });
|
|
25
|
-
return preventDefault();
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
if (!index.ContemberEditor.hasParentOfType(editor, [element, path], TableElement.tableElementType)) {
|
|
29
|
-
Slate.Transforms.unwrapNodes(editor, { at: path });
|
|
30
|
-
return preventDefault();
|
|
31
|
-
}
|
|
32
|
-
if (path[path.length - 1] > 0 && element.headerScope) {
|
|
33
|
-
Slate.Transforms.setNodes(editor, { headerScope: null }, { at: path });
|
|
34
|
-
return preventDefault();
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
canContainAnyBlocks: false
|
|
38
|
-
});
|
|
39
|
-
exports.createEmptyTableRowElement = createEmptyTableRowElement;
|
|
40
|
-
exports.isTableRowElement = isTableRowElement;
|
|
41
|
-
exports.tableRowElementPlugin = tableRowElementPlugin;
|
|
42
|
-
exports.tableRowElementType = tableRowElementType;
|
|
43
|
-
//# sourceMappingURL=TableRowElement.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableRowElement.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableRowElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Element, Node, Node as SlateNode, Transforms } from 'slate'\nimport { createEmptyTableCellElement, isTableCellElement, tableCellElementType } from './TableCellElement'\nimport { ContemberEditor } from '../../../editor'\nimport { tableElementType } from './TableElement'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const tableRowElementType = 'tableRow' as const\n\nexport interface TableRowElement extends SlateElement {\n\ttype: typeof tableRowElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'table'\n}\n\nexport const isTableRowElement = (element: Node): element is TableRowElement => Element.isElement(element) && element.type === tableRowElementType\n\nexport const createEmptyTableRowElement = (columnCount = 2) => ({\n\ttype: tableRowElementType,\n\tchildren: Array.from({ length: columnCount }, () => createEmptyTableCellElement()),\n})\n\nexport const tableRowElementPlugin = ({ render }: {render: ElementRenderer<TableRowElement>}): EditorElementPlugin<TableRowElement> => ({\n\ttype: tableRowElementType,\n\trender,\n\tnormalizeNode: ({ editor, path, element, preventDefault }) => {\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableCellElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableCellElementType }, { at: childPath })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\t\treturn preventDefault()\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableElementType)) {\n\t\t\tTransforms.unwrapNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t\tif (path[path.length - 1] > 0 && element.headerScope) {\n\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n})\n"],"names":["Element","createEmptyTableCellElement","SlateNode","SlateElement","isTableCellElement","ContemberEditor","Transforms","tableCellElementType","tableElementType"],"mappings":";;;;;;AAMO,MAAM,sBAAsB;AAQtB,MAAA,oBAAoB,CAAC,YAA8CA,MAAA,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAElH,MAAA,6BAA6B,CAAC,cAAc,OAAO;AAAA,EAC/D,MAAM;AAAA,EACN,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAY,GAAG,MAAMC,6CAA6B,CAAA;AAClF;AAEO,MAAM,wBAAwB,CAAC,EAAE,cAAgG;AAAA,EACvI,MAAM;AAAA,EACN;AAAA,EACA,eAAe,CAAC,EAAE,QAAQ,MAAM,SAAS,qBAAqB;AAClD,eAAA,CAAC,OAAO,SAAS,KAAKC,WAAU,SAAS,QAAQ,IAAI,GAAG;AAC9D,UAAAC,MAAA,QAAa,UAAU,KAAK,GAAG;AAC9B,YAAA,CAACC,iBAAAA,mBAAmB,KAAK,GAAG;AACfC,gCAAA,aAAa,QAAQ,SAAS;AACnCC,2BAAA,SAAS,QAAQ,EAAE,MAAMC,iBAAAA,wBAAwB,EAAE,IAAI,WAAW;AAAA,QAAA;AAAA,MAC9E,OACM;AACND,cAAAA,WAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,eAAO,eAAe;AAAA,MAAA;AAAA,IACvB;AAEG,QAAA,CAACD,MAAAA,gBAAgB,gBAAgB,QAAQ,CAAC,SAAS,IAAI,GAAGG,aAAAA,gBAAgB,GAAG;AAChFF,YAAAA,WAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,aAAO,eAAe;AAAA,IAAA;AAEvB,QAAI,KAAK,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,aAAa;AAC1CA,uBAAA,SAAS,QAAQ,EAAE,aAAa,QAAQ,EAAE,IAAI,MAAM;AAC/D,aAAO,eAAe;AAAA,IAAA;AAAA,EAExB;AAAA,EACA,qBAAqB;AACtB;;;;;"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Element, Node, Transforms } from "slate";
|
|
2
|
-
import { createEmptyTableCellElement, isTableCellElement, tableCellElementType } from "./TableCellElement.js";
|
|
3
|
-
import { ContemberEditor } from "../../../editor/index.js";
|
|
4
|
-
import { tableElementType } from "./TableElement.js";
|
|
5
|
-
const tableRowElementType = "tableRow";
|
|
6
|
-
const isTableRowElement = (element) => Element.isElement(element) && element.type === tableRowElementType;
|
|
7
|
-
const createEmptyTableRowElement = (columnCount = 2) => ({
|
|
8
|
-
type: tableRowElementType,
|
|
9
|
-
children: Array.from({ length: columnCount }, () => createEmptyTableCellElement())
|
|
10
|
-
});
|
|
11
|
-
const tableRowElementPlugin = ({ render }) => ({
|
|
12
|
-
type: tableRowElementType,
|
|
13
|
-
render,
|
|
14
|
-
normalizeNode: ({ editor, path, element, preventDefault }) => {
|
|
15
|
-
for (const [child, childPath] of Node.children(editor, path)) {
|
|
16
|
-
if (Element.isElement(child)) {
|
|
17
|
-
if (!isTableCellElement(child)) {
|
|
18
|
-
ContemberEditor.ejectElement(editor, childPath);
|
|
19
|
-
Transforms.setNodes(editor, { type: tableCellElementType }, { at: childPath });
|
|
20
|
-
}
|
|
21
|
-
} else {
|
|
22
|
-
Transforms.removeNodes(editor, { at: path });
|
|
23
|
-
return preventDefault();
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
if (!ContemberEditor.hasParentOfType(editor, [element, path], tableElementType)) {
|
|
27
|
-
Transforms.unwrapNodes(editor, { at: path });
|
|
28
|
-
return preventDefault();
|
|
29
|
-
}
|
|
30
|
-
if (path[path.length - 1] > 0 && element.headerScope) {
|
|
31
|
-
Transforms.setNodes(editor, { headerScope: null }, { at: path });
|
|
32
|
-
return preventDefault();
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
canContainAnyBlocks: false
|
|
36
|
-
});
|
|
37
|
-
export {
|
|
38
|
-
createEmptyTableRowElement,
|
|
39
|
-
isTableRowElement,
|
|
40
|
-
tableRowElementPlugin,
|
|
41
|
-
tableRowElementType
|
|
42
|
-
};
|
|
43
|
-
//# sourceMappingURL=TableRowElement.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableRowElement.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/TableRowElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Element, Node, Node as SlateNode, Transforms } from 'slate'\nimport { createEmptyTableCellElement, isTableCellElement, tableCellElementType } from './TableCellElement'\nimport { ContemberEditor } from '../../../editor'\nimport { tableElementType } from './TableElement'\nimport { EditorElementPlugin, ElementRenderer } from '../../../types'\n\nexport const tableRowElementType = 'tableRow' as const\n\nexport interface TableRowElement extends SlateElement {\n\ttype: typeof tableRowElementType\n\tchildren: SlateEditor['children']\n\theaderScope?: 'table'\n}\n\nexport const isTableRowElement = (element: Node): element is TableRowElement => Element.isElement(element) && element.type === tableRowElementType\n\nexport const createEmptyTableRowElement = (columnCount = 2) => ({\n\ttype: tableRowElementType,\n\tchildren: Array.from({ length: columnCount }, () => createEmptyTableCellElement()),\n})\n\nexport const tableRowElementPlugin = ({ render }: {render: ElementRenderer<TableRowElement>}): EditorElementPlugin<TableRowElement> => ({\n\ttype: tableRowElementType,\n\trender,\n\tnormalizeNode: ({ editor, path, element, preventDefault }) => {\n\t\tfor (const [child, childPath] of SlateNode.children(editor, path)) {\n\t\t\tif (SlateElement.isElement(child)) {\n\t\t\t\tif (!isTableCellElement(child)) {\n\t\t\t\t\tContemberEditor.ejectElement(editor, childPath)\n\t\t\t\t\tTransforms.setNodes(editor, { type: tableCellElementType }, { at: childPath })\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tTransforms.removeNodes(editor, { at: path })\n\t\t\t\treturn preventDefault()\n\t\t\t}\n\t\t}\n\t\tif (!ContemberEditor.hasParentOfType(editor, [element, path], tableElementType)) {\n\t\t\tTransforms.unwrapNodes(editor, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t\tif (path[path.length - 1] > 0 && element.headerScope) {\n\t\t\tTransforms.setNodes(editor, { headerScope: null }, { at: path })\n\t\t\treturn preventDefault()\n\t\t}\n\t},\n\tcanContainAnyBlocks: false,\n})\n"],"names":["SlateNode","SlateElement"],"mappings":";;;;AAMO,MAAM,sBAAsB;AAQtB,MAAA,oBAAoB,CAAC,YAA8C,QAAQ,UAAU,OAAO,KAAK,QAAQ,SAAS;AAElH,MAAA,6BAA6B,CAAC,cAAc,OAAO;AAAA,EAC/D,MAAM;AAAA,EACN,UAAU,MAAM,KAAK,EAAE,QAAQ,YAAY,GAAG,MAAM,4BAA6B,CAAA;AAClF;AAEO,MAAM,wBAAwB,CAAC,EAAE,cAAgG;AAAA,EACvI,MAAM;AAAA,EACN;AAAA,EACA,eAAe,CAAC,EAAE,QAAQ,MAAM,SAAS,qBAAqB;AAClD,eAAA,CAAC,OAAO,SAAS,KAAKA,KAAU,SAAS,QAAQ,IAAI,GAAG;AAC9D,UAAAC,QAAa,UAAU,KAAK,GAAG;AAC9B,YAAA,CAAC,mBAAmB,KAAK,GAAG;AACf,0BAAA,aAAa,QAAQ,SAAS;AACnC,qBAAA,SAAS,QAAQ,EAAE,MAAM,wBAAwB,EAAE,IAAI,WAAW;AAAA,QAAA;AAAA,MAC9E,OACM;AACN,mBAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,eAAO,eAAe;AAAA,MAAA;AAAA,IACvB;AAEG,QAAA,CAAC,gBAAgB,gBAAgB,QAAQ,CAAC,SAAS,IAAI,GAAG,gBAAgB,GAAG;AAChF,iBAAW,YAAY,QAAQ,EAAE,IAAI,MAAM;AAC3C,aAAO,eAAe;AAAA,IAAA;AAEvB,QAAI,KAAK,KAAK,SAAS,CAAC,IAAI,KAAK,QAAQ,aAAa;AAC1C,iBAAA,SAAS,QAAQ,EAAE,aAAa,QAAQ,EAAE,IAAI,MAAM;AAC/D,aAAO,eAAe;AAAA,IAAA;AAAA,EAExB;AAAA,EACA,qBAAqB;AACtB;"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const gaugeTableColumnCount = (table) => {
|
|
4
|
-
if (table.children.length === 0) {
|
|
5
|
-
return 0;
|
|
6
|
-
}
|
|
7
|
-
const rowSampleStart = table.children[0];
|
|
8
|
-
const rowSampleMiddle = table.children[Math.floor(table.children.length / 2)];
|
|
9
|
-
const rowSampleEnd = table.children[table.children.length - 1];
|
|
10
|
-
const columnSampleStart = rowSampleStart.children.length;
|
|
11
|
-
const columnSampleMiddle = rowSampleMiddle.children.length;
|
|
12
|
-
const columnSampleEnd = rowSampleEnd.children.length;
|
|
13
|
-
if (columnSampleStart === columnSampleEnd) {
|
|
14
|
-
return columnSampleStart;
|
|
15
|
-
}
|
|
16
|
-
if (columnSampleStart === columnSampleMiddle) {
|
|
17
|
-
return columnSampleStart;
|
|
18
|
-
}
|
|
19
|
-
if (columnSampleMiddle === columnSampleEnd) {
|
|
20
|
-
return columnSampleMiddle;
|
|
21
|
-
}
|
|
22
|
-
return columnSampleStart;
|
|
23
|
-
};
|
|
24
|
-
exports.gaugeTableColumnCount = gaugeTableColumnCount;
|
|
25
|
-
//# sourceMappingURL=gaugeTableColumnCount.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gaugeTableColumnCount.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/gaugeTableColumnCount.ts"],"sourcesContent":["import type { TableElement } from './TableElement'\nimport type { TableRowElement } from './TableRowElement'\n\nexport const gaugeTableColumnCount = (table: TableElement): number => {\n\t// This whole function is obviously very heuristic. It's intended to be called during normalizations (i.e. often),\n\t// and so it aims to be reasonably fast. We want to use this return value to repair corrupted tables.\n\n\tif (table.children.length === 0) {\n\t\treturn 0\n\t}\n\n\tconst rowSampleStart = table.children[0] as TableRowElement\n\tconst rowSampleMiddle = table.children[Math.floor(table.children.length / 2)] as TableRowElement\n\tconst rowSampleEnd = table.children[table.children.length - 1] as TableRowElement\n\n\tconst columnSampleStart = rowSampleStart.children.length\n\tconst columnSampleMiddle = rowSampleMiddle.children.length\n\tconst columnSampleEnd = rowSampleEnd.children.length\n\n\t// Tables most often get corrupted either at the beginning or at the end. Thus we assume that out of these three\n\t// values, two will likely be the same.\n\tif (columnSampleStart === columnSampleEnd) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleStart === columnSampleMiddle) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleMiddle === columnSampleEnd) {\n\t\treturn columnSampleMiddle\n\t}\n\n\t// If we make it here, then all three are different and the table is completely broken. We could consult more rows\n\t// but really, odds are that it wouldn't really help.\n\treturn columnSampleStart\n}\n"],"names":[],"mappings":";;AAGa,MAAA,wBAAwB,CAAC,UAAgC;AAIjE,MAAA,MAAM,SAAS,WAAW,GAAG;AACzB,WAAA;AAAA,EAAA;AAGF,QAAA,iBAAiB,MAAM,SAAS,CAAC;AACjC,QAAA,kBAAkB,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,SAAS,CAAC,CAAC;AAC5E,QAAM,eAAe,MAAM,SAAS,MAAM,SAAS,SAAS,CAAC;AAEvD,QAAA,oBAAoB,eAAe,SAAS;AAC5C,QAAA,qBAAqB,gBAAgB,SAAS;AAC9C,QAAA,kBAAkB,aAAa,SAAS;AAI9C,MAAI,sBAAsB,iBAAiB;AACnC,WAAA;AAAA,EAAA;AAER,MAAI,sBAAsB,oBAAoB;AACtC,WAAA;AAAA,EAAA;AAER,MAAI,uBAAuB,iBAAiB;AACpC,WAAA;AAAA,EAAA;AAKD,SAAA;AACR;;"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const gaugeTableColumnCount = (table) => {
|
|
2
|
-
if (table.children.length === 0) {
|
|
3
|
-
return 0;
|
|
4
|
-
}
|
|
5
|
-
const rowSampleStart = table.children[0];
|
|
6
|
-
const rowSampleMiddle = table.children[Math.floor(table.children.length / 2)];
|
|
7
|
-
const rowSampleEnd = table.children[table.children.length - 1];
|
|
8
|
-
const columnSampleStart = rowSampleStart.children.length;
|
|
9
|
-
const columnSampleMiddle = rowSampleMiddle.children.length;
|
|
10
|
-
const columnSampleEnd = rowSampleEnd.children.length;
|
|
11
|
-
if (columnSampleStart === columnSampleEnd) {
|
|
12
|
-
return columnSampleStart;
|
|
13
|
-
}
|
|
14
|
-
if (columnSampleStart === columnSampleMiddle) {
|
|
15
|
-
return columnSampleStart;
|
|
16
|
-
}
|
|
17
|
-
if (columnSampleMiddle === columnSampleEnd) {
|
|
18
|
-
return columnSampleMiddle;
|
|
19
|
-
}
|
|
20
|
-
return columnSampleStart;
|
|
21
|
-
};
|
|
22
|
-
export {
|
|
23
|
-
gaugeTableColumnCount
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=gaugeTableColumnCount.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gaugeTableColumnCount.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/gaugeTableColumnCount.ts"],"sourcesContent":["import type { TableElement } from './TableElement'\nimport type { TableRowElement } from './TableRowElement'\n\nexport const gaugeTableColumnCount = (table: TableElement): number => {\n\t// This whole function is obviously very heuristic. It's intended to be called during normalizations (i.e. often),\n\t// and so it aims to be reasonably fast. We want to use this return value to repair corrupted tables.\n\n\tif (table.children.length === 0) {\n\t\treturn 0\n\t}\n\n\tconst rowSampleStart = table.children[0] as TableRowElement\n\tconst rowSampleMiddle = table.children[Math.floor(table.children.length / 2)] as TableRowElement\n\tconst rowSampleEnd = table.children[table.children.length - 1] as TableRowElement\n\n\tconst columnSampleStart = rowSampleStart.children.length\n\tconst columnSampleMiddle = rowSampleMiddle.children.length\n\tconst columnSampleEnd = rowSampleEnd.children.length\n\n\t// Tables most often get corrupted either at the beginning or at the end. Thus we assume that out of these three\n\t// values, two will likely be the same.\n\tif (columnSampleStart === columnSampleEnd) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleStart === columnSampleMiddle) {\n\t\treturn columnSampleStart\n\t}\n\tif (columnSampleMiddle === columnSampleEnd) {\n\t\treturn columnSampleMiddle\n\t}\n\n\t// If we make it here, then all three are different and the table is completely broken. We could consult more rows\n\t// but really, odds are that it wouldn't really help.\n\treturn columnSampleStart\n}\n"],"names":[],"mappings":"AAGa,MAAA,wBAAwB,CAAC,UAAgC;AAIjE,MAAA,MAAM,SAAS,WAAW,GAAG;AACzB,WAAA;AAAA,EAAA;AAGF,QAAA,iBAAiB,MAAM,SAAS,CAAC;AACjC,QAAA,kBAAkB,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,SAAS,CAAC,CAAC;AAC5E,QAAM,eAAe,MAAM,SAAS,MAAM,SAAS,SAAS,CAAC;AAEvD,QAAA,oBAAoB,eAAe,SAAS;AAC5C,QAAA,qBAAqB,gBAAgB,SAAS;AAC9C,QAAA,kBAAkB,aAAa,SAAS;AAI9C,MAAI,sBAAsB,iBAAiB;AACnC,WAAA;AAAA,EAAA;AAER,MAAI,sBAAsB,oBAAoB;AACtC,WAAA;AAAA,EAAA;AAER,MAAI,uBAAuB,iBAAiB;AACpC,WAAA;AAAA,EAAA;AAKD,SAAA;AACR;"}
|
|
@@ -1,283 +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 TableCellElement = require("./TableCellElement.cjs");
|
|
6
|
-
const TableElement = require("./TableElement.cjs");
|
|
7
|
-
const TableElementSelection = require("./TableElementSelection.cjs");
|
|
8
|
-
const TableHtmlDeserializer = require("./TableHtmlDeserializer.cjs");
|
|
9
|
-
const TableModifications = require("./TableModifications.cjs");
|
|
10
|
-
const TableRowElement = require("./TableRowElement.cjs");
|
|
11
|
-
const withTables = ({ renderTable, renderTableCell, renderTableRow }) => (editor) => {
|
|
12
|
-
const {
|
|
13
|
-
deleteForward,
|
|
14
|
-
deleteBackward,
|
|
15
|
-
deleteFragment,
|
|
16
|
-
insertBreak,
|
|
17
|
-
onKeyDown
|
|
18
|
-
} = editor;
|
|
19
|
-
editor.registerElement(TableElement.tableElementPlugin({ render: renderTable }));
|
|
20
|
-
editor.registerElement(TableCellElement.tableCellElementPlugin({ render: renderTableCell }));
|
|
21
|
-
editor.registerElement(TableRowElement.tableRowElementPlugin({ render: renderTableRow }));
|
|
22
|
-
editor.htmlDeserializer.registerPlugin(TableHtmlDeserializer.tableHTMLDeserializer);
|
|
23
|
-
Object.assign(editor, {
|
|
24
|
-
insertBreak: () => {
|
|
25
|
-
const closestBlockEntry = index.ContemberEditor.closestBlockEntry(editor);
|
|
26
|
-
if (closestBlockEntry && TableCellElement.isTableCellElement(closestBlockEntry[0])) {
|
|
27
|
-
const selection = editor.selection;
|
|
28
|
-
const [, closestBlockPath] = closestBlockEntry;
|
|
29
|
-
const [cellStart, cellEnd] = Slate.Editor.edges(editor, closestBlockPath);
|
|
30
|
-
if (!selection) {
|
|
31
|
-
return insertBreak();
|
|
32
|
-
}
|
|
33
|
-
return Slate.Editor.withoutNormalizing(editor, () => {
|
|
34
|
-
Slate.Transforms.wrapNodes(editor, editor.createDefaultElement([]), {
|
|
35
|
-
at: {
|
|
36
|
-
anchor: cellStart,
|
|
37
|
-
focus: cellEnd
|
|
38
|
-
},
|
|
39
|
-
match: (node) => Slate.Text.isText(node) || Slate.Element.isElement(node) && editor.isInline(node)
|
|
40
|
-
});
|
|
41
|
-
const relative = Slate.Path.relative(selection.focus.path, closestBlockPath);
|
|
42
|
-
Slate.Transforms.splitNodes(editor, {
|
|
43
|
-
// The zero should be the newly created default element.
|
|
44
|
-
at: {
|
|
45
|
-
path: [...closestBlockPath, 0, ...relative],
|
|
46
|
-
offset: selection.focus.offset
|
|
47
|
-
},
|
|
48
|
-
always: true
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
insertBreak();
|
|
53
|
-
},
|
|
54
|
-
deleteBackward: (unit) => {
|
|
55
|
-
const selection = editor.selection;
|
|
56
|
-
if (selection && Slate.Range.isCollapsed(selection)) {
|
|
57
|
-
const closestBlockEntry = index.ContemberEditor.closestBlockEntry(editor);
|
|
58
|
-
if (closestBlockEntry && TableCellElement.isTableCellElement(closestBlockEntry[0]) && Slate.Point.equals(selection.focus, Slate.Editor.start(editor, closestBlockEntry[1]))) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
deleteBackward(unit);
|
|
63
|
-
},
|
|
64
|
-
deleteForward: (unit) => {
|
|
65
|
-
const selection = editor.selection;
|
|
66
|
-
if (selection && Slate.Range.isCollapsed(selection)) {
|
|
67
|
-
const closestBlockEntry = index.ContemberEditor.closestBlockEntry(editor);
|
|
68
|
-
if (closestBlockEntry && TableCellElement.isTableCellElement(closestBlockEntry[0]) && Slate.Point.equals(selection.focus, Slate.Editor.end(editor, closestBlockEntry[1]))) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
deleteForward(unit);
|
|
73
|
-
},
|
|
74
|
-
deleteFragment: () => {
|
|
75
|
-
const selection = editor.selection;
|
|
76
|
-
if (!selection || Slate.Range.isCollapsed(selection)) {
|
|
77
|
-
return deleteFragment();
|
|
78
|
-
}
|
|
79
|
-
const lowestCommonAncestorPath = Slate.Path.common(selection.anchor.path, selection.focus.path);
|
|
80
|
-
const [lowestCommonAncestor] = Slate.Editor.node(editor, lowestCommonAncestorPath);
|
|
81
|
-
if (TableElement.isTableElement(lowestCommonAncestor) || TableRowElement.isTableRowElement(lowestCommonAncestor)) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
deleteFragment();
|
|
85
|
-
},
|
|
86
|
-
onKeyDown: (event) => {
|
|
87
|
-
const selection = editor.selection;
|
|
88
|
-
if (!selection || !(event.key === "Tab" || event.key === "ArrowUp" || event.key === "ArrowRight" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "Enter" || event.key === "Backspace")) {
|
|
89
|
-
return onKeyDown(event);
|
|
90
|
-
}
|
|
91
|
-
const closestBlockEntry = index.ContemberEditor.closestBlockEntry(editor, { at: selection });
|
|
92
|
-
if (!closestBlockEntry) {
|
|
93
|
-
return onKeyDown(event);
|
|
94
|
-
}
|
|
95
|
-
let cellElement;
|
|
96
|
-
let cellPath;
|
|
97
|
-
if (!TableCellElement.isTableCellElement(closestBlockEntry[0])) {
|
|
98
|
-
const parent = Slate.Node.parent(editor, closestBlockEntry[1]);
|
|
99
|
-
if (Slate.Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && TableCellElement.isTableCellElement(parent)) {
|
|
100
|
-
cellElement = parent;
|
|
101
|
-
cellPath = Slate.Path.parent(closestBlockEntry[1]);
|
|
102
|
-
} else {
|
|
103
|
-
return onKeyDown(event);
|
|
104
|
-
}
|
|
105
|
-
} else {
|
|
106
|
-
[cellElement, cellPath] = closestBlockEntry;
|
|
107
|
-
}
|
|
108
|
-
if (cellPath.length < 3) {
|
|
109
|
-
return onKeyDown(event);
|
|
110
|
-
}
|
|
111
|
-
const [rowIndex, columnIndex] = TableElementSelection.getTableCellCoordinates(editor, cellElement);
|
|
112
|
-
const tablePath = cellPath.slice(0, -2);
|
|
113
|
-
const tableElement = Slate.Node.get(editor, tablePath);
|
|
114
|
-
const rowCount = TableElement.getTableElementRowCount(tableElement);
|
|
115
|
-
const columnCount = TableElement.getTableElementColumnCount(tableElement);
|
|
116
|
-
if (rowCount === 0 || columnCount === 0) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const moveSelectionBeforeTable = () => {
|
|
120
|
-
const pointBeforeTable = Slate.Editor.before(editor, tablePath);
|
|
121
|
-
if (!pointBeforeTable) {
|
|
122
|
-
return onKeyDown(event);
|
|
123
|
-
}
|
|
124
|
-
event.preventDefault();
|
|
125
|
-
return Slate.Transforms.select(editor, pointBeforeTable);
|
|
126
|
-
};
|
|
127
|
-
const moveSelectionAfterTable = () => {
|
|
128
|
-
const pointAfterTable = Slate.Editor.after(editor, tablePath);
|
|
129
|
-
if (!pointAfterTable) {
|
|
130
|
-
return onKeyDown(event);
|
|
131
|
-
}
|
|
132
|
-
event.preventDefault();
|
|
133
|
-
return Slate.Transforms.select(editor, pointAfterTable);
|
|
134
|
-
};
|
|
135
|
-
if (event.key === "Tab") {
|
|
136
|
-
if (event.shiftKey) {
|
|
137
|
-
if (columnIndex > 0) {
|
|
138
|
-
event.preventDefault();
|
|
139
|
-
return TableElementSelection.selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1);
|
|
140
|
-
} else if (columnIndex === 0) {
|
|
141
|
-
if (rowIndex > 0) {
|
|
142
|
-
event.preventDefault();
|
|
143
|
-
return TableElementSelection.selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1);
|
|
144
|
-
}
|
|
145
|
-
return moveSelectionBeforeTable();
|
|
146
|
-
}
|
|
147
|
-
} else {
|
|
148
|
-
if (columnIndex < columnCount - 1) {
|
|
149
|
-
event.preventDefault();
|
|
150
|
-
return TableElementSelection.selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1);
|
|
151
|
-
} else if (columnIndex === columnCount - 1) {
|
|
152
|
-
if (rowIndex < rowCount - 1) {
|
|
153
|
-
event.preventDefault();
|
|
154
|
-
return TableElementSelection.selectTableCellContents(editor, tablePath, rowIndex + 1, 0);
|
|
155
|
-
} else if (rowIndex === rowCount - 1) {
|
|
156
|
-
return moveSelectionAfterTable();
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
if (event.key === "ArrowLeft") {
|
|
162
|
-
if (!Slate.Range.isCollapsed(selection)) {
|
|
163
|
-
return onKeyDown(event);
|
|
164
|
-
}
|
|
165
|
-
if (Slate.Point.equals(selection.focus, Slate.Editor.start(editor, cellPath))) {
|
|
166
|
-
if (columnIndex > 0) {
|
|
167
|
-
event.preventDefault();
|
|
168
|
-
return Slate.Transforms.select(editor, Slate.Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]));
|
|
169
|
-
} else if (columnIndex === 0) {
|
|
170
|
-
if (rowIndex > 0) {
|
|
171
|
-
event.preventDefault();
|
|
172
|
-
return Slate.Transforms.select(editor, Slate.Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]));
|
|
173
|
-
}
|
|
174
|
-
return moveSelectionBeforeTable();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
} else if (event.key === "ArrowRight") {
|
|
178
|
-
if (!Slate.Range.isCollapsed(selection)) {
|
|
179
|
-
return onKeyDown(event);
|
|
180
|
-
}
|
|
181
|
-
if (Slate.Point.equals(selection.focus, Slate.Editor.end(editor, cellPath))) {
|
|
182
|
-
if (columnIndex < columnCount - 1) {
|
|
183
|
-
event.preventDefault();
|
|
184
|
-
return Slate.Transforms.select(editor, Slate.Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]));
|
|
185
|
-
} else if (columnIndex === columnCount - 1) {
|
|
186
|
-
if (rowIndex < rowCount - 1) {
|
|
187
|
-
event.preventDefault();
|
|
188
|
-
return Slate.Transforms.select(editor, Slate.Editor.start(editor, [...tablePath, rowIndex + 1, 0]));
|
|
189
|
-
} else if (rowIndex === rowCount - 1) {
|
|
190
|
-
return moveSelectionAfterTable();
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
} else if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
195
|
-
const withinDefault = editor.isDefaultElement(closestBlockEntry[0]);
|
|
196
|
-
if (withinDefault) {
|
|
197
|
-
const relative = Slate.Path.relative(closestBlockEntry[1], cellPath);
|
|
198
|
-
const defaultIndex = relative[0];
|
|
199
|
-
if (event.key === "ArrowUp" && defaultIndex !== 0 || event.key === "ArrowDown" && defaultIndex !== cellElement.children.length - 1) {
|
|
200
|
-
return onKeyDown(event);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
if (event.key === "ArrowUp") {
|
|
204
|
-
if (rowIndex > 0) {
|
|
205
|
-
event.preventDefault();
|
|
206
|
-
const rowAboveEndPoint = Slate.Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex]);
|
|
207
|
-
if (!Slate.Range.isCollapsed(selection)) {
|
|
208
|
-
return Slate.Transforms.select(editor, rowAboveEndPoint);
|
|
209
|
-
}
|
|
210
|
-
const minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset);
|
|
211
|
-
return Slate.Transforms.select(editor, {
|
|
212
|
-
path: rowAboveEndPoint.path,
|
|
213
|
-
offset: minOffset
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
return moveSelectionBeforeTable();
|
|
217
|
-
} else if (event.key === "ArrowDown") {
|
|
218
|
-
if (rowIndex < rowCount - 1) {
|
|
219
|
-
event.preventDefault();
|
|
220
|
-
const rowBelowStatPoint = Slate.Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex]);
|
|
221
|
-
if (!Slate.Range.isCollapsed(selection)) {
|
|
222
|
-
return Slate.Transforms.select(editor, rowBelowStatPoint);
|
|
223
|
-
}
|
|
224
|
-
const [rowBelowStatPointNode] = Slate.Editor.node(editor, rowBelowStatPoint);
|
|
225
|
-
return Slate.Transforms.select(editor, {
|
|
226
|
-
path: rowBelowStatPoint.path,
|
|
227
|
-
offset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length)
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
return moveSelectionAfterTable();
|
|
231
|
-
}
|
|
232
|
-
} else if (event.ctrlKey || event.metaKey) {
|
|
233
|
-
if (event.key === "Backspace") {
|
|
234
|
-
event.preventDefault();
|
|
235
|
-
if (event.altKey) {
|
|
236
|
-
TableModifications.TableModifications.deleteTableColumn(editor, tableElement, columnIndex);
|
|
237
|
-
if (columnCount > 1) {
|
|
238
|
-
const columnBefore = Slate.Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)]);
|
|
239
|
-
return Slate.Transforms.select(editor, columnBefore);
|
|
240
|
-
} else {
|
|
241
|
-
return moveSelectionBeforeTable();
|
|
242
|
-
}
|
|
243
|
-
} else {
|
|
244
|
-
TableModifications.TableModifications.deleteTableRow(editor, tableElement, rowIndex);
|
|
245
|
-
if (rowCount > 1) {
|
|
246
|
-
const rowAbove = Slate.Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex]);
|
|
247
|
-
return Slate.Transforms.select(editor, rowAbove);
|
|
248
|
-
} else {
|
|
249
|
-
return moveSelectionBeforeTable();
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
} else if (event.key === "Enter") {
|
|
253
|
-
event.preventDefault();
|
|
254
|
-
if (event.altKey) {
|
|
255
|
-
if (event.shiftKey) {
|
|
256
|
-
TableModifications.TableModifications.addTableColumn(editor, tableElement, columnIndex);
|
|
257
|
-
const columnBefore = Slate.Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)]);
|
|
258
|
-
return Slate.Transforms.select(editor, columnBefore);
|
|
259
|
-
} else {
|
|
260
|
-
TableModifications.TableModifications.addTableColumn(editor, tableElement, columnIndex + 1);
|
|
261
|
-
const columnAfter = Slate.Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]);
|
|
262
|
-
return Slate.Transforms.select(editor, columnAfter);
|
|
263
|
-
}
|
|
264
|
-
} else {
|
|
265
|
-
if (event.shiftKey) {
|
|
266
|
-
TableModifications.TableModifications.addTableRow(editor, tableElement, rowIndex);
|
|
267
|
-
const rowAbove = Slate.Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex]);
|
|
268
|
-
return Slate.Transforms.select(editor, rowAbove);
|
|
269
|
-
} else {
|
|
270
|
-
TableModifications.TableModifications.addTableRow(editor, tableElement, rowIndex + 1);
|
|
271
|
-
const rowBelowStat = Slate.Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex]);
|
|
272
|
-
return Slate.Transforms.select(editor, rowBelowStat);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
onKeyDown(event);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
return editor;
|
|
281
|
-
};
|
|
282
|
-
exports.withTables = withTables;
|
|
283
|
-
//# sourceMappingURL=withTables.cjs.map
|