@contember/react-slate-editor-base 2.0.0-alpha.1
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/dist/development/components/RichTextEditor.cjs +93 -0
- package/dist/development/components/RichTextEditor.cjs.map +1 -0
- package/dist/development/components/RichTextEditor.js +93 -0
- package/dist/development/components/RichTextEditor.js.map +1 -0
- package/dist/development/components/triggers/EditorElementTrigger.cjs +16 -0
- package/dist/development/components/triggers/EditorElementTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/EditorElementTrigger.js +16 -0
- package/dist/development/components/triggers/EditorElementTrigger.js.map +1 -0
- package/dist/development/components/triggers/EditorGenericTrigger.cjs +20 -0
- package/dist/development/components/triggers/EditorGenericTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/EditorGenericTrigger.js +20 -0
- package/dist/development/components/triggers/EditorGenericTrigger.js.map +1 -0
- package/dist/development/components/triggers/EditorMarkTrigger.cjs +16 -0
- package/dist/development/components/triggers/EditorMarkTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/EditorMarkTrigger.js +16 -0
- package/dist/development/components/triggers/EditorMarkTrigger.js.map +1 -0
- package/dist/development/components/triggers/EditorWrapNodeTrigger.cjs +28 -0
- package/dist/development/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -0
- package/dist/development/components/triggers/EditorWrapNodeTrigger.js +28 -0
- package/dist/development/components/triggers/EditorWrapNodeTrigger.js.map +1 -0
- package/dist/development/editor/createEditor.cjs +35 -0
- package/dist/development/editor/createEditor.cjs.map +1 -0
- package/dist/development/editor/createEditor.js +35 -0
- package/dist/development/editor/createEditor.js.map +1 -0
- package/dist/development/editor/createEditorWithEssentials.cjs +227 -0
- package/dist/development/editor/createEditorWithEssentials.cjs.map +1 -0
- package/dist/development/editor/createEditorWithEssentials.js +211 -0
- package/dist/development/editor/createEditorWithEssentials.js.map +1 -0
- package/dist/development/editor/index.cjs +44 -0
- package/dist/development/editor/index.cjs.map +1 -0
- package/dist/development/editor/index.js +44 -0
- package/dist/development/editor/index.js.map +1 -0
- package/dist/development/editor/methods/addMarks.cjs +12 -0
- package/dist/development/editor/methods/addMarks.cjs.map +1 -0
- package/dist/development/editor/methods/addMarks.js +12 -0
- package/dist/development/editor/methods/addMarks.js.map +1 -0
- package/dist/development/editor/methods/canToggleMark.cjs +7 -0
- package/dist/development/editor/methods/canToggleMark.cjs.map +1 -0
- package/dist/development/editor/methods/canToggleMark.js +7 -0
- package/dist/development/editor/methods/canToggleMark.js.map +1 -0
- package/dist/development/editor/methods/closest.cjs +18 -0
- package/dist/development/editor/methods/closest.cjs.map +1 -0
- package/dist/development/editor/methods/closest.js +18 -0
- package/dist/development/editor/methods/closest.js.map +1 -0
- package/dist/development/editor/methods/closestBlockEntry.cjs +10 -0
- package/dist/development/editor/methods/closestBlockEntry.cjs.map +1 -0
- package/dist/development/editor/methods/closestBlockEntry.js +10 -0
- package/dist/development/editor/methods/closestBlockEntry.js.map +1 -0
- package/dist/development/editor/methods/closestViableBlockContainerEntry.cjs +9 -0
- package/dist/development/editor/methods/closestViableBlockContainerEntry.cjs.map +1 -0
- package/dist/development/editor/methods/closestViableBlockContainerEntry.js +9 -0
- package/dist/development/editor/methods/closestViableBlockContainerEntry.js.map +1 -0
- package/dist/development/editor/methods/ejectElement.cjs +15 -0
- package/dist/development/editor/methods/ejectElement.cjs.map +1 -0
- package/dist/development/editor/methods/ejectElement.js +15 -0
- package/dist/development/editor/methods/ejectElement.js.map +1 -0
- package/dist/development/editor/methods/elementToSpecifics.cjs +8 -0
- package/dist/development/editor/methods/elementToSpecifics.cjs.map +1 -0
- package/dist/development/editor/methods/elementToSpecifics.js +8 -0
- package/dist/development/editor/methods/elementToSpecifics.js.map +1 -0
- package/dist/development/editor/methods/getElementDataAttributes.cjs +13 -0
- package/dist/development/editor/methods/getElementDataAttributes.cjs.map +1 -0
- package/dist/development/editor/methods/getElementDataAttributes.js +13 -0
- package/dist/development/editor/methods/getElementDataAttributes.js.map +1 -0
- package/dist/development/editor/methods/getPreviousSibling.cjs +13 -0
- package/dist/development/editor/methods/getPreviousSibling.cjs.map +1 -0
- package/dist/development/editor/methods/getPreviousSibling.js +13 -0
- package/dist/development/editor/methods/getPreviousSibling.js.map +1 -0
- package/dist/development/editor/methods/hasMarks.cjs +23 -0
- package/dist/development/editor/methods/hasMarks.cjs.map +1 -0
- package/dist/development/editor/methods/hasMarks.js +23 -0
- package/dist/development/editor/methods/hasMarks.js.map +1 -0
- package/dist/development/editor/methods/hasParentOfType.cjs +15 -0
- package/dist/development/editor/methods/hasParentOfType.cjs.map +1 -0
- package/dist/development/editor/methods/hasParentOfType.js +15 -0
- package/dist/development/editor/methods/hasParentOfType.js.map +1 -0
- package/dist/development/editor/methods/isElementType.cjs +24 -0
- package/dist/development/editor/methods/isElementType.cjs.map +1 -0
- package/dist/development/editor/methods/isElementType.js +24 -0
- package/dist/development/editor/methods/isElementType.js.map +1 -0
- package/dist/development/editor/methods/permissivelyDeserializeNodes.cjs +22 -0
- package/dist/development/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -0
- package/dist/development/editor/methods/permissivelyDeserializeNodes.js +22 -0
- package/dist/development/editor/methods/permissivelyDeserializeNodes.js.map +1 -0
- package/dist/development/editor/methods/removeMarks.cjs +12 -0
- package/dist/development/editor/methods/removeMarks.cjs.map +1 -0
- package/dist/development/editor/methods/removeMarks.js +12 -0
- package/dist/development/editor/methods/removeMarks.js.map +1 -0
- package/dist/development/editor/methods/serializeNodes.cjs +15 -0
- package/dist/development/editor/methods/serializeNodes.cjs.map +1 -0
- package/dist/development/editor/methods/serializeNodes.js +15 -0
- package/dist/development/editor/methods/serializeNodes.js.map +1 -0
- package/dist/development/editor/methods/strictlyDeserializeNodes.cjs +14 -0
- package/dist/development/editor/methods/strictlyDeserializeNodes.cjs.map +1 -0
- package/dist/development/editor/methods/strictlyDeserializeNodes.js +14 -0
- package/dist/development/editor/methods/strictlyDeserializeNodes.js.map +1 -0
- package/dist/development/editor/methods/textToSpecifics.cjs +8 -0
- package/dist/development/editor/methods/textToSpecifics.cjs.map +1 -0
- package/dist/development/editor/methods/textToSpecifics.js +8 -0
- package/dist/development/editor/methods/textToSpecifics.js.map +1 -0
- package/dist/development/editor/methods/toLatestFormat.cjs +34 -0
- package/dist/development/editor/methods/toLatestFormat.cjs.map +1 -0
- package/dist/development/editor/methods/toLatestFormat.js +34 -0
- package/dist/development/editor/methods/toLatestFormat.js.map +1 -0
- package/dist/development/editor/methods/topLevelNodes.cjs +12 -0
- package/dist/development/editor/methods/topLevelNodes.cjs.map +1 -0
- package/dist/development/editor/methods/topLevelNodes.js +12 -0
- package/dist/development/editor/methods/topLevelNodes.js.map +1 -0
- package/dist/development/index.cjs +139 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +136 -0
- package/dist/development/index.js.map +1 -0
- package/dist/development/internal/components/DefaultElement.cjs +11 -0
- package/dist/development/internal/components/DefaultElement.cjs.map +1 -0
- package/dist/development/internal/components/DefaultElement.js +11 -0
- package/dist/development/internal/components/DefaultElement.js.map +1 -0
- package/dist/development/internal/hooks/useRichTextFieldNodes.cjs +28 -0
- package/dist/development/internal/hooks/useRichTextFieldNodes.cjs.map +1 -0
- package/dist/development/internal/hooks/useRichTextFieldNodes.js +28 -0
- package/dist/development/internal/hooks/useRichTextFieldNodes.js.map +1 -0
- package/dist/development/internal/utils/EditorPasteUtils.cjs +47 -0
- package/dist/development/internal/utils/EditorPasteUtils.cjs.map +1 -0
- package/dist/development/internal/utils/EditorPasteUtils.js +47 -0
- package/dist/development/internal/utils/EditorPasteUtils.js.map +1 -0
- package/dist/development/internal/utils/parseUrl.cjs +14 -0
- package/dist/development/internal/utils/parseUrl.cjs.map +1 -0
- package/dist/development/internal/utils/parseUrl.js +14 -0
- package/dist/development/internal/utils/parseUrl.js.map +1 -0
- package/dist/development/plugins/attributes/alignment/alignButton.cjs +21 -0
- package/dist/development/plugins/attributes/alignment/alignButton.cjs.map +1 -0
- package/dist/development/plugins/attributes/alignment/alignButton.js +21 -0
- package/dist/development/plugins/attributes/alignment/alignButton.js.map +1 -0
- package/dist/development/plugins/behaviour/paste/HtmlDeserializer.cjs +138 -0
- package/dist/development/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -0
- package/dist/development/plugins/behaviour/paste/HtmlDeserializer.js +138 -0
- package/dist/development/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -0
- package/dist/development/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs +15 -0
- package/dist/development/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -0
- package/dist/development/plugins/behaviour/paste/createMarkHtmlDeserializer.js +15 -0
- package/dist/development/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -0
- package/dist/development/plugins/behaviour/paste/withPaste.cjs +24 -0
- package/dist/development/plugins/behaviour/paste/withPaste.cjs.map +1 -0
- package/dist/development/plugins/behaviour/paste/withPaste.js +24 -0
- package/dist/development/plugins/behaviour/paste/withPaste.js.map +1 -0
- package/dist/development/plugins/element/anchors/AnchorElement.cjs +44 -0
- package/dist/development/plugins/element/anchors/AnchorElement.cjs.map +1 -0
- package/dist/development/plugins/element/anchors/AnchorElement.js +44 -0
- package/dist/development/plugins/element/anchors/AnchorElement.js.map +1 -0
- package/dist/development/plugins/element/anchors/AnchorHtmlDeserializer.cjs +19 -0
- package/dist/development/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -0
- package/dist/development/plugins/element/anchors/AnchorHtmlDeserializer.js +19 -0
- package/dist/development/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -0
- package/dist/development/plugins/element/anchors/AnchorModifications.cjs +29 -0
- package/dist/development/plugins/element/anchors/AnchorModifications.cjs.map +1 -0
- package/dist/development/plugins/element/anchors/AnchorModifications.js +29 -0
- package/dist/development/plugins/element/anchors/AnchorModifications.js.map +1 -0
- package/dist/development/plugins/element/anchors/withAnchors.cjs +21 -0
- package/dist/development/plugins/element/anchors/withAnchors.cjs.map +1 -0
- package/dist/development/plugins/element/anchors/withAnchors.js +21 -0
- package/dist/development/plugins/element/anchors/withAnchors.js.map +1 -0
- package/dist/development/plugins/element/headings/HeadingElement.cjs +41 -0
- package/dist/development/plugins/element/headings/HeadingElement.cjs.map +1 -0
- package/dist/development/plugins/element/headings/HeadingElement.js +41 -0
- package/dist/development/plugins/element/headings/HeadingElement.js.map +1 -0
- package/dist/development/plugins/element/headings/HeadingHtmlDeserializer.cjs +22 -0
- package/dist/development/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -0
- package/dist/development/plugins/element/headings/HeadingHtmlDeserializer.js +22 -0
- package/dist/development/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -0
- package/dist/development/plugins/element/headings/withHeadings.cjs +70 -0
- package/dist/development/plugins/element/headings/withHeadings.cjs.map +1 -0
- package/dist/development/plugins/element/headings/withHeadings.js +70 -0
- package/dist/development/plugins/element/headings/withHeadings.js.map +1 -0
- package/dist/development/plugins/element/horizonalRules/HorizontalRuleElement.cjs +41 -0
- package/dist/development/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -0
- package/dist/development/plugins/element/horizonalRules/HorizontalRuleElement.js +41 -0
- package/dist/development/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -0
- package/dist/development/plugins/element/horizonalRules/withHorizontalRules.cjs +75 -0
- package/dist/development/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -0
- package/dist/development/plugins/element/horizonalRules/withHorizontalRules.js +75 -0
- package/dist/development/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -0
- package/dist/development/plugins/element/lists/ListElement.cjs +26 -0
- package/dist/development/plugins/element/lists/ListElement.cjs.map +1 -0
- package/dist/development/plugins/element/lists/ListElement.js +26 -0
- package/dist/development/plugins/element/lists/ListElement.js.map +1 -0
- package/dist/development/plugins/element/lists/ListHtmlDeserializer.cjs +98 -0
- package/dist/development/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -0
- package/dist/development/plugins/element/lists/ListHtmlDeserializer.js +98 -0
- package/dist/development/plugins/element/lists/ListHtmlDeserializer.js.map +1 -0
- package/dist/development/plugins/element/lists/ListItemElement.cjs +53 -0
- package/dist/development/plugins/element/lists/ListItemElement.cjs.map +1 -0
- package/dist/development/plugins/element/lists/ListItemElement.js +53 -0
- package/dist/development/plugins/element/lists/ListItemElement.js.map +1 -0
- package/dist/development/plugins/element/lists/OrderedListElement.cjs +25 -0
- package/dist/development/plugins/element/lists/OrderedListElement.cjs.map +1 -0
- package/dist/development/plugins/element/lists/OrderedListElement.js +25 -0
- package/dist/development/plugins/element/lists/OrderedListElement.js.map +1 -0
- package/dist/development/plugins/element/lists/UnorderedListElement.cjs +25 -0
- package/dist/development/plugins/element/lists/UnorderedListElement.cjs.map +1 -0
- package/dist/development/plugins/element/lists/UnorderedListElement.js +25 -0
- package/dist/development/plugins/element/lists/UnorderedListElement.js.map +1 -0
- package/dist/development/plugins/element/lists/transforms/dedentListItem.cjs +57 -0
- package/dist/development/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -0
- package/dist/development/plugins/element/lists/transforms/dedentListItem.js +57 -0
- package/dist/development/plugins/element/lists/transforms/dedentListItem.js.map +1 -0
- package/dist/development/plugins/element/lists/transforms/indentListItem.cjs +57 -0
- package/dist/development/plugins/element/lists/transforms/indentListItem.cjs.map +1 -0
- package/dist/development/plugins/element/lists/transforms/indentListItem.js +57 -0
- package/dist/development/plugins/element/lists/transforms/indentListItem.js.map +1 -0
- package/dist/development/plugins/element/lists/transforms/normalizeListElement.cjs +22 -0
- package/dist/development/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -0
- package/dist/development/plugins/element/lists/transforms/normalizeListElement.js +22 -0
- package/dist/development/plugins/element/lists/transforms/normalizeListElement.js.map +1 -0
- package/dist/development/plugins/element/lists/transforms/toggleListElement.cjs +93 -0
- package/dist/development/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -0
- package/dist/development/plugins/element/lists/transforms/toggleListElement.js +93 -0
- package/dist/development/plugins/element/lists/transforms/toggleListElement.js.map +1 -0
- package/dist/development/plugins/element/lists/withLists.cjs +153 -0
- package/dist/development/plugins/element/lists/withLists.cjs.map +1 -0
- package/dist/development/plugins/element/lists/withLists.js +153 -0
- package/dist/development/plugins/element/lists/withLists.js.map +1 -0
- package/dist/development/plugins/element/paragraphs/ParagraphElement.cjs +49 -0
- package/dist/development/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -0
- package/dist/development/plugins/element/paragraphs/ParagraphElement.js +49 -0
- package/dist/development/plugins/element/paragraphs/ParagraphElement.js.map +1 -0
- package/dist/development/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs +11 -0
- package/dist/development/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -0
- package/dist/development/plugins/element/paragraphs/ParagraphHtmlDeserializer.js +11 -0
- package/dist/development/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -0
- package/dist/development/plugins/element/paragraphs/withParagraphs.cjs +58 -0
- package/dist/development/plugins/element/paragraphs/withParagraphs.cjs.map +1 -0
- package/dist/development/plugins/element/paragraphs/withParagraphs.js +58 -0
- package/dist/development/plugins/element/paragraphs/withParagraphs.js.map +1 -0
- package/dist/development/plugins/element/scrollTargets/ScrollTargetElement.cjs +51 -0
- package/dist/development/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -0
- package/dist/development/plugins/element/scrollTargets/ScrollTargetElement.js +51 -0
- package/dist/development/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -0
- package/dist/development/plugins/element/scrollTargets/withScrollTargets.cjs +9 -0
- package/dist/development/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -0
- package/dist/development/plugins/element/scrollTargets/withScrollTargets.js +9 -0
- package/dist/development/plugins/element/scrollTargets/withScrollTargets.js.map +1 -0
- package/dist/development/plugins/element/tables/TableCellElement.cjs +39 -0
- package/dist/development/plugins/element/tables/TableCellElement.cjs.map +1 -0
- package/dist/development/plugins/element/tables/TableCellElement.js +39 -0
- package/dist/development/plugins/element/tables/TableCellElement.js.map +1 -0
- package/dist/development/plugins/element/tables/TableElement.cjs +114 -0
- package/dist/development/plugins/element/tables/TableElement.cjs.map +1 -0
- package/dist/development/plugins/element/tables/TableElement.js +114 -0
- package/dist/development/plugins/element/tables/TableElement.js.map +1 -0
- package/dist/development/plugins/element/tables/TableElementSelection.cjs +20 -0
- package/dist/development/plugins/element/tables/TableElementSelection.cjs.map +1 -0
- package/dist/development/plugins/element/tables/TableElementSelection.js +20 -0
- package/dist/development/plugins/element/tables/TableElementSelection.js.map +1 -0
- package/dist/development/plugins/element/tables/TableModifications.cjs +134 -0
- package/dist/development/plugins/element/tables/TableModifications.cjs.map +1 -0
- package/dist/development/plugins/element/tables/TableModifications.js +134 -0
- package/dist/development/plugins/element/tables/TableModifications.js.map +1 -0
- package/dist/development/plugins/element/tables/TableRowElement.cjs +43 -0
- package/dist/development/plugins/element/tables/TableRowElement.cjs.map +1 -0
- package/dist/development/plugins/element/tables/TableRowElement.js +43 -0
- package/dist/development/plugins/element/tables/TableRowElement.js.map +1 -0
- package/dist/development/plugins/element/tables/gaugeTableColumnCount.cjs +25 -0
- package/dist/development/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -0
- package/dist/development/plugins/element/tables/gaugeTableColumnCount.js +25 -0
- package/dist/development/plugins/element/tables/gaugeTableColumnCount.js.map +1 -0
- package/dist/development/plugins/element/tables/withTables.cjs +281 -0
- package/dist/development/plugins/element/tables/withTables.cjs.map +1 -0
- package/dist/development/plugins/element/tables/withTables.js +281 -0
- package/dist/development/plugins/element/tables/withTables.js.map +1 -0
- package/dist/development/plugins/text/bold/boldMark.cjs +13 -0
- package/dist/development/plugins/text/bold/boldMark.cjs.map +1 -0
- package/dist/development/plugins/text/bold/boldMark.js +13 -0
- package/dist/development/plugins/text/bold/boldMark.js.map +1 -0
- package/dist/development/plugins/text/bold/withBold.cjs +16 -0
- package/dist/development/plugins/text/bold/withBold.cjs.map +1 -0
- package/dist/development/plugins/text/bold/withBold.js +16 -0
- package/dist/development/plugins/text/bold/withBold.js.map +1 -0
- package/dist/development/plugins/text/code/codeMark.cjs +13 -0
- package/dist/development/plugins/text/code/codeMark.cjs.map +1 -0
- package/dist/development/plugins/text/code/codeMark.js +13 -0
- package/dist/development/plugins/text/code/codeMark.js.map +1 -0
- package/dist/development/plugins/text/code/withCode.cjs +9 -0
- package/dist/development/plugins/text/code/withCode.cjs.map +1 -0
- package/dist/development/plugins/text/code/withCode.js +9 -0
- package/dist/development/plugins/text/code/withCode.js.map +1 -0
- package/dist/development/plugins/text/highlight/highlightMark.cjs +13 -0
- package/dist/development/plugins/text/highlight/highlightMark.cjs.map +1 -0
- package/dist/development/plugins/text/highlight/highlightMark.js +13 -0
- package/dist/development/plugins/text/highlight/highlightMark.js.map +1 -0
- package/dist/development/plugins/text/highlight/withHighlight.cjs +9 -0
- package/dist/development/plugins/text/highlight/withHighlight.cjs.map +1 -0
- package/dist/development/plugins/text/highlight/withHighlight.js +9 -0
- package/dist/development/plugins/text/highlight/withHighlight.js.map +1 -0
- package/dist/development/plugins/text/italic/italicMark.cjs +13 -0
- package/dist/development/plugins/text/italic/italicMark.cjs.map +1 -0
- package/dist/development/plugins/text/italic/italicMark.js +13 -0
- package/dist/development/plugins/text/italic/italicMark.js.map +1 -0
- package/dist/development/plugins/text/italic/withItalic.cjs +16 -0
- package/dist/development/plugins/text/italic/withItalic.cjs.map +1 -0
- package/dist/development/plugins/text/italic/withItalic.js +16 -0
- package/dist/development/plugins/text/italic/withItalic.js.map +1 -0
- package/dist/development/plugins/text/newline/withNewline.cjs +15 -0
- package/dist/development/plugins/text/newline/withNewline.cjs.map +1 -0
- package/dist/development/plugins/text/newline/withNewline.js +15 -0
- package/dist/development/plugins/text/newline/withNewline.js.map +1 -0
- package/dist/development/plugins/text/strikeThrough/strikeThroughMark.cjs +13 -0
- package/dist/development/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -0
- package/dist/development/plugins/text/strikeThrough/strikeThroughMark.js +13 -0
- package/dist/development/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -0
- package/dist/development/plugins/text/strikeThrough/withStrikeThrough.cjs +17 -0
- package/dist/development/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -0
- package/dist/development/plugins/text/strikeThrough/withStrikeThrough.js +17 -0
- package/dist/development/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -0
- package/dist/development/plugins/text/underline/underlineMark.cjs +13 -0
- package/dist/development/plugins/text/underline/underlineMark.cjs.map +1 -0
- package/dist/development/plugins/text/underline/underlineMark.js +13 -0
- package/dist/development/plugins/text/underline/underlineMark.js.map +1 -0
- package/dist/development/plugins/text/underline/withUnderline.cjs +17 -0
- package/dist/development/plugins/text/underline/withUnderline.cjs.map +1 -0
- package/dist/development/plugins/text/underline/withUnderline.js +17 -0
- package/dist/development/plugins/text/underline/withUnderline.js.map +1 -0
- package/dist/development/slate-reexport.cjs +10 -0
- package/dist/development/slate-reexport.cjs.map +1 -0
- package/dist/development/slate-reexport.js +8 -0
- package/dist/development/slate-reexport.js.map +1 -0
- package/dist/production/components/RichTextEditor.cjs +93 -0
- package/dist/production/components/RichTextEditor.cjs.map +1 -0
- package/dist/production/components/RichTextEditor.js +93 -0
- package/dist/production/components/RichTextEditor.js.map +1 -0
- package/dist/production/components/triggers/EditorElementTrigger.cjs +16 -0
- package/dist/production/components/triggers/EditorElementTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/EditorElementTrigger.js +16 -0
- package/dist/production/components/triggers/EditorElementTrigger.js.map +1 -0
- package/dist/production/components/triggers/EditorGenericTrigger.cjs +20 -0
- package/dist/production/components/triggers/EditorGenericTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/EditorGenericTrigger.js +20 -0
- package/dist/production/components/triggers/EditorGenericTrigger.js.map +1 -0
- package/dist/production/components/triggers/EditorMarkTrigger.cjs +16 -0
- package/dist/production/components/triggers/EditorMarkTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/EditorMarkTrigger.js +16 -0
- package/dist/production/components/triggers/EditorMarkTrigger.js.map +1 -0
- package/dist/production/components/triggers/EditorWrapNodeTrigger.cjs +28 -0
- package/dist/production/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -0
- package/dist/production/components/triggers/EditorWrapNodeTrigger.js +28 -0
- package/dist/production/components/triggers/EditorWrapNodeTrigger.js.map +1 -0
- package/dist/production/editor/createEditor.cjs +35 -0
- package/dist/production/editor/createEditor.cjs.map +1 -0
- package/dist/production/editor/createEditor.js +35 -0
- package/dist/production/editor/createEditor.js.map +1 -0
- package/dist/production/editor/createEditorWithEssentials.cjs +227 -0
- package/dist/production/editor/createEditorWithEssentials.cjs.map +1 -0
- package/dist/production/editor/createEditorWithEssentials.js +211 -0
- package/dist/production/editor/createEditorWithEssentials.js.map +1 -0
- package/dist/production/editor/index.cjs +44 -0
- package/dist/production/editor/index.cjs.map +1 -0
- package/dist/production/editor/index.js +44 -0
- package/dist/production/editor/index.js.map +1 -0
- package/dist/production/editor/methods/addMarks.cjs +12 -0
- package/dist/production/editor/methods/addMarks.cjs.map +1 -0
- package/dist/production/editor/methods/addMarks.js +12 -0
- package/dist/production/editor/methods/addMarks.js.map +1 -0
- package/dist/production/editor/methods/canToggleMark.cjs +7 -0
- package/dist/production/editor/methods/canToggleMark.cjs.map +1 -0
- package/dist/production/editor/methods/canToggleMark.js +7 -0
- package/dist/production/editor/methods/canToggleMark.js.map +1 -0
- package/dist/production/editor/methods/closest.cjs +18 -0
- package/dist/production/editor/methods/closest.cjs.map +1 -0
- package/dist/production/editor/methods/closest.js +18 -0
- package/dist/production/editor/methods/closest.js.map +1 -0
- package/dist/production/editor/methods/closestBlockEntry.cjs +10 -0
- package/dist/production/editor/methods/closestBlockEntry.cjs.map +1 -0
- package/dist/production/editor/methods/closestBlockEntry.js +10 -0
- package/dist/production/editor/methods/closestBlockEntry.js.map +1 -0
- package/dist/production/editor/methods/closestViableBlockContainerEntry.cjs +9 -0
- package/dist/production/editor/methods/closestViableBlockContainerEntry.cjs.map +1 -0
- package/dist/production/editor/methods/closestViableBlockContainerEntry.js +9 -0
- package/dist/production/editor/methods/closestViableBlockContainerEntry.js.map +1 -0
- package/dist/production/editor/methods/ejectElement.cjs +15 -0
- package/dist/production/editor/methods/ejectElement.cjs.map +1 -0
- package/dist/production/editor/methods/ejectElement.js +15 -0
- package/dist/production/editor/methods/ejectElement.js.map +1 -0
- package/dist/production/editor/methods/elementToSpecifics.cjs +8 -0
- package/dist/production/editor/methods/elementToSpecifics.cjs.map +1 -0
- package/dist/production/editor/methods/elementToSpecifics.js +8 -0
- package/dist/production/editor/methods/elementToSpecifics.js.map +1 -0
- package/dist/production/editor/methods/getElementDataAttributes.cjs +13 -0
- package/dist/production/editor/methods/getElementDataAttributes.cjs.map +1 -0
- package/dist/production/editor/methods/getElementDataAttributes.js +13 -0
- package/dist/production/editor/methods/getElementDataAttributes.js.map +1 -0
- package/dist/production/editor/methods/getPreviousSibling.cjs +13 -0
- package/dist/production/editor/methods/getPreviousSibling.cjs.map +1 -0
- package/dist/production/editor/methods/getPreviousSibling.js +13 -0
- package/dist/production/editor/methods/getPreviousSibling.js.map +1 -0
- package/dist/production/editor/methods/hasMarks.cjs +23 -0
- package/dist/production/editor/methods/hasMarks.cjs.map +1 -0
- package/dist/production/editor/methods/hasMarks.js +23 -0
- package/dist/production/editor/methods/hasMarks.js.map +1 -0
- package/dist/production/editor/methods/hasParentOfType.cjs +15 -0
- package/dist/production/editor/methods/hasParentOfType.cjs.map +1 -0
- package/dist/production/editor/methods/hasParentOfType.js +15 -0
- package/dist/production/editor/methods/hasParentOfType.js.map +1 -0
- package/dist/production/editor/methods/isElementType.cjs +24 -0
- package/dist/production/editor/methods/isElementType.cjs.map +1 -0
- package/dist/production/editor/methods/isElementType.js +24 -0
- package/dist/production/editor/methods/isElementType.js.map +1 -0
- package/dist/production/editor/methods/permissivelyDeserializeNodes.cjs +22 -0
- package/dist/production/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -0
- package/dist/production/editor/methods/permissivelyDeserializeNodes.js +22 -0
- package/dist/production/editor/methods/permissivelyDeserializeNodes.js.map +1 -0
- package/dist/production/editor/methods/removeMarks.cjs +12 -0
- package/dist/production/editor/methods/removeMarks.cjs.map +1 -0
- package/dist/production/editor/methods/removeMarks.js +12 -0
- package/dist/production/editor/methods/removeMarks.js.map +1 -0
- package/dist/production/editor/methods/serializeNodes.cjs +15 -0
- package/dist/production/editor/methods/serializeNodes.cjs.map +1 -0
- package/dist/production/editor/methods/serializeNodes.js +15 -0
- package/dist/production/editor/methods/serializeNodes.js.map +1 -0
- package/dist/production/editor/methods/strictlyDeserializeNodes.cjs +14 -0
- package/dist/production/editor/methods/strictlyDeserializeNodes.cjs.map +1 -0
- package/dist/production/editor/methods/strictlyDeserializeNodes.js +14 -0
- package/dist/production/editor/methods/strictlyDeserializeNodes.js.map +1 -0
- package/dist/production/editor/methods/textToSpecifics.cjs +8 -0
- package/dist/production/editor/methods/textToSpecifics.cjs.map +1 -0
- package/dist/production/editor/methods/textToSpecifics.js +8 -0
- package/dist/production/editor/methods/textToSpecifics.js.map +1 -0
- package/dist/production/editor/methods/toLatestFormat.cjs +34 -0
- package/dist/production/editor/methods/toLatestFormat.cjs.map +1 -0
- package/dist/production/editor/methods/toLatestFormat.js +34 -0
- package/dist/production/editor/methods/toLatestFormat.js.map +1 -0
- package/dist/production/editor/methods/topLevelNodes.cjs +12 -0
- package/dist/production/editor/methods/topLevelNodes.cjs.map +1 -0
- package/dist/production/editor/methods/topLevelNodes.js +12 -0
- package/dist/production/editor/methods/topLevelNodes.js.map +1 -0
- package/dist/production/index.cjs +139 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +136 -0
- package/dist/production/index.js.map +1 -0
- package/dist/production/internal/components/DefaultElement.cjs +11 -0
- package/dist/production/internal/components/DefaultElement.cjs.map +1 -0
- package/dist/production/internal/components/DefaultElement.js +11 -0
- package/dist/production/internal/components/DefaultElement.js.map +1 -0
- package/dist/production/internal/hooks/useRichTextFieldNodes.cjs +28 -0
- package/dist/production/internal/hooks/useRichTextFieldNodes.cjs.map +1 -0
- package/dist/production/internal/hooks/useRichTextFieldNodes.js +28 -0
- package/dist/production/internal/hooks/useRichTextFieldNodes.js.map +1 -0
- package/dist/production/internal/utils/EditorPasteUtils.cjs +47 -0
- package/dist/production/internal/utils/EditorPasteUtils.cjs.map +1 -0
- package/dist/production/internal/utils/EditorPasteUtils.js +47 -0
- package/dist/production/internal/utils/EditorPasteUtils.js.map +1 -0
- package/dist/production/internal/utils/parseUrl.cjs +14 -0
- package/dist/production/internal/utils/parseUrl.cjs.map +1 -0
- package/dist/production/internal/utils/parseUrl.js +14 -0
- package/dist/production/internal/utils/parseUrl.js.map +1 -0
- package/dist/production/plugins/attributes/alignment/alignButton.cjs +21 -0
- package/dist/production/plugins/attributes/alignment/alignButton.cjs.map +1 -0
- package/dist/production/plugins/attributes/alignment/alignButton.js +21 -0
- package/dist/production/plugins/attributes/alignment/alignButton.js.map +1 -0
- package/dist/production/plugins/behaviour/paste/HtmlDeserializer.cjs +138 -0
- package/dist/production/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -0
- package/dist/production/plugins/behaviour/paste/HtmlDeserializer.js +138 -0
- package/dist/production/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -0
- package/dist/production/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs +15 -0
- package/dist/production/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -0
- package/dist/production/plugins/behaviour/paste/createMarkHtmlDeserializer.js +15 -0
- package/dist/production/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -0
- package/dist/production/plugins/behaviour/paste/withPaste.cjs +24 -0
- package/dist/production/plugins/behaviour/paste/withPaste.cjs.map +1 -0
- package/dist/production/plugins/behaviour/paste/withPaste.js +24 -0
- package/dist/production/plugins/behaviour/paste/withPaste.js.map +1 -0
- package/dist/production/plugins/element/anchors/AnchorElement.cjs +44 -0
- package/dist/production/plugins/element/anchors/AnchorElement.cjs.map +1 -0
- package/dist/production/plugins/element/anchors/AnchorElement.js +44 -0
- package/dist/production/plugins/element/anchors/AnchorElement.js.map +1 -0
- package/dist/production/plugins/element/anchors/AnchorHtmlDeserializer.cjs +19 -0
- package/dist/production/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -0
- package/dist/production/plugins/element/anchors/AnchorHtmlDeserializer.js +19 -0
- package/dist/production/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -0
- package/dist/production/plugins/element/anchors/AnchorModifications.cjs +29 -0
- package/dist/production/plugins/element/anchors/AnchorModifications.cjs.map +1 -0
- package/dist/production/plugins/element/anchors/AnchorModifications.js +29 -0
- package/dist/production/plugins/element/anchors/AnchorModifications.js.map +1 -0
- package/dist/production/plugins/element/anchors/withAnchors.cjs +21 -0
- package/dist/production/plugins/element/anchors/withAnchors.cjs.map +1 -0
- package/dist/production/plugins/element/anchors/withAnchors.js +21 -0
- package/dist/production/plugins/element/anchors/withAnchors.js.map +1 -0
- package/dist/production/plugins/element/headings/HeadingElement.cjs +41 -0
- package/dist/production/plugins/element/headings/HeadingElement.cjs.map +1 -0
- package/dist/production/plugins/element/headings/HeadingElement.js +41 -0
- package/dist/production/plugins/element/headings/HeadingElement.js.map +1 -0
- package/dist/production/plugins/element/headings/HeadingHtmlDeserializer.cjs +22 -0
- package/dist/production/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -0
- package/dist/production/plugins/element/headings/HeadingHtmlDeserializer.js +22 -0
- package/dist/production/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -0
- package/dist/production/plugins/element/headings/withHeadings.cjs +70 -0
- package/dist/production/plugins/element/headings/withHeadings.cjs.map +1 -0
- package/dist/production/plugins/element/headings/withHeadings.js +70 -0
- package/dist/production/plugins/element/headings/withHeadings.js.map +1 -0
- package/dist/production/plugins/element/horizonalRules/HorizontalRuleElement.cjs +41 -0
- package/dist/production/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -0
- package/dist/production/plugins/element/horizonalRules/HorizontalRuleElement.js +41 -0
- package/dist/production/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -0
- package/dist/production/plugins/element/horizonalRules/withHorizontalRules.cjs +75 -0
- package/dist/production/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -0
- package/dist/production/plugins/element/horizonalRules/withHorizontalRules.js +75 -0
- package/dist/production/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -0
- package/dist/production/plugins/element/lists/ListElement.cjs +26 -0
- package/dist/production/plugins/element/lists/ListElement.cjs.map +1 -0
- package/dist/production/plugins/element/lists/ListElement.js +26 -0
- package/dist/production/plugins/element/lists/ListElement.js.map +1 -0
- package/dist/production/plugins/element/lists/ListHtmlDeserializer.cjs +98 -0
- package/dist/production/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -0
- package/dist/production/plugins/element/lists/ListHtmlDeserializer.js +98 -0
- package/dist/production/plugins/element/lists/ListHtmlDeserializer.js.map +1 -0
- package/dist/production/plugins/element/lists/ListItemElement.cjs +53 -0
- package/dist/production/plugins/element/lists/ListItemElement.cjs.map +1 -0
- package/dist/production/plugins/element/lists/ListItemElement.js +53 -0
- package/dist/production/plugins/element/lists/ListItemElement.js.map +1 -0
- package/dist/production/plugins/element/lists/OrderedListElement.cjs +25 -0
- package/dist/production/plugins/element/lists/OrderedListElement.cjs.map +1 -0
- package/dist/production/plugins/element/lists/OrderedListElement.js +25 -0
- package/dist/production/plugins/element/lists/OrderedListElement.js.map +1 -0
- package/dist/production/plugins/element/lists/UnorderedListElement.cjs +25 -0
- package/dist/production/plugins/element/lists/UnorderedListElement.cjs.map +1 -0
- package/dist/production/plugins/element/lists/UnorderedListElement.js +25 -0
- package/dist/production/plugins/element/lists/UnorderedListElement.js.map +1 -0
- package/dist/production/plugins/element/lists/transforms/dedentListItem.cjs +57 -0
- package/dist/production/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -0
- package/dist/production/plugins/element/lists/transforms/dedentListItem.js +57 -0
- package/dist/production/plugins/element/lists/transforms/dedentListItem.js.map +1 -0
- package/dist/production/plugins/element/lists/transforms/indentListItem.cjs +57 -0
- package/dist/production/plugins/element/lists/transforms/indentListItem.cjs.map +1 -0
- package/dist/production/plugins/element/lists/transforms/indentListItem.js +57 -0
- package/dist/production/plugins/element/lists/transforms/indentListItem.js.map +1 -0
- package/dist/production/plugins/element/lists/transforms/normalizeListElement.cjs +22 -0
- package/dist/production/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -0
- package/dist/production/plugins/element/lists/transforms/normalizeListElement.js +22 -0
- package/dist/production/plugins/element/lists/transforms/normalizeListElement.js.map +1 -0
- package/dist/production/plugins/element/lists/transforms/toggleListElement.cjs +93 -0
- package/dist/production/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -0
- package/dist/production/plugins/element/lists/transforms/toggleListElement.js +93 -0
- package/dist/production/plugins/element/lists/transforms/toggleListElement.js.map +1 -0
- package/dist/production/plugins/element/lists/withLists.cjs +153 -0
- package/dist/production/plugins/element/lists/withLists.cjs.map +1 -0
- package/dist/production/plugins/element/lists/withLists.js +153 -0
- package/dist/production/plugins/element/lists/withLists.js.map +1 -0
- package/dist/production/plugins/element/paragraphs/ParagraphElement.cjs +49 -0
- package/dist/production/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -0
- package/dist/production/plugins/element/paragraphs/ParagraphElement.js +49 -0
- package/dist/production/plugins/element/paragraphs/ParagraphElement.js.map +1 -0
- package/dist/production/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs +11 -0
- package/dist/production/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -0
- package/dist/production/plugins/element/paragraphs/ParagraphHtmlDeserializer.js +11 -0
- package/dist/production/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -0
- package/dist/production/plugins/element/paragraphs/withParagraphs.cjs +58 -0
- package/dist/production/plugins/element/paragraphs/withParagraphs.cjs.map +1 -0
- package/dist/production/plugins/element/paragraphs/withParagraphs.js +58 -0
- package/dist/production/plugins/element/paragraphs/withParagraphs.js.map +1 -0
- package/dist/production/plugins/element/scrollTargets/ScrollTargetElement.cjs +51 -0
- package/dist/production/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -0
- package/dist/production/plugins/element/scrollTargets/ScrollTargetElement.js +51 -0
- package/dist/production/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -0
- package/dist/production/plugins/element/scrollTargets/withScrollTargets.cjs +9 -0
- package/dist/production/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -0
- package/dist/production/plugins/element/scrollTargets/withScrollTargets.js +9 -0
- package/dist/production/plugins/element/scrollTargets/withScrollTargets.js.map +1 -0
- package/dist/production/plugins/element/tables/TableCellElement.cjs +39 -0
- package/dist/production/plugins/element/tables/TableCellElement.cjs.map +1 -0
- package/dist/production/plugins/element/tables/TableCellElement.js +39 -0
- package/dist/production/plugins/element/tables/TableCellElement.js.map +1 -0
- package/dist/production/plugins/element/tables/TableElement.cjs +114 -0
- package/dist/production/plugins/element/tables/TableElement.cjs.map +1 -0
- package/dist/production/plugins/element/tables/TableElement.js +114 -0
- package/dist/production/plugins/element/tables/TableElement.js.map +1 -0
- package/dist/production/plugins/element/tables/TableElementSelection.cjs +20 -0
- package/dist/production/plugins/element/tables/TableElementSelection.cjs.map +1 -0
- package/dist/production/plugins/element/tables/TableElementSelection.js +20 -0
- package/dist/production/plugins/element/tables/TableElementSelection.js.map +1 -0
- package/dist/production/plugins/element/tables/TableModifications.cjs +134 -0
- package/dist/production/plugins/element/tables/TableModifications.cjs.map +1 -0
- package/dist/production/plugins/element/tables/TableModifications.js +134 -0
- package/dist/production/plugins/element/tables/TableModifications.js.map +1 -0
- package/dist/production/plugins/element/tables/TableRowElement.cjs +43 -0
- package/dist/production/plugins/element/tables/TableRowElement.cjs.map +1 -0
- package/dist/production/plugins/element/tables/TableRowElement.js +43 -0
- package/dist/production/plugins/element/tables/TableRowElement.js.map +1 -0
- package/dist/production/plugins/element/tables/gaugeTableColumnCount.cjs +25 -0
- package/dist/production/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -0
- package/dist/production/plugins/element/tables/gaugeTableColumnCount.js +25 -0
- package/dist/production/plugins/element/tables/gaugeTableColumnCount.js.map +1 -0
- package/dist/production/plugins/element/tables/withTables.cjs +281 -0
- package/dist/production/plugins/element/tables/withTables.cjs.map +1 -0
- package/dist/production/plugins/element/tables/withTables.js +281 -0
- package/dist/production/plugins/element/tables/withTables.js.map +1 -0
- package/dist/production/plugins/text/bold/boldMark.cjs +13 -0
- package/dist/production/plugins/text/bold/boldMark.cjs.map +1 -0
- package/dist/production/plugins/text/bold/boldMark.js +13 -0
- package/dist/production/plugins/text/bold/boldMark.js.map +1 -0
- package/dist/production/plugins/text/bold/withBold.cjs +16 -0
- package/dist/production/plugins/text/bold/withBold.cjs.map +1 -0
- package/dist/production/plugins/text/bold/withBold.js +16 -0
- package/dist/production/plugins/text/bold/withBold.js.map +1 -0
- package/dist/production/plugins/text/code/codeMark.cjs +13 -0
- package/dist/production/plugins/text/code/codeMark.cjs.map +1 -0
- package/dist/production/plugins/text/code/codeMark.js +13 -0
- package/dist/production/plugins/text/code/codeMark.js.map +1 -0
- package/dist/production/plugins/text/code/withCode.cjs +9 -0
- package/dist/production/plugins/text/code/withCode.cjs.map +1 -0
- package/dist/production/plugins/text/code/withCode.js +9 -0
- package/dist/production/plugins/text/code/withCode.js.map +1 -0
- package/dist/production/plugins/text/highlight/highlightMark.cjs +13 -0
- package/dist/production/plugins/text/highlight/highlightMark.cjs.map +1 -0
- package/dist/production/plugins/text/highlight/highlightMark.js +13 -0
- package/dist/production/plugins/text/highlight/highlightMark.js.map +1 -0
- package/dist/production/plugins/text/highlight/withHighlight.cjs +9 -0
- package/dist/production/plugins/text/highlight/withHighlight.cjs.map +1 -0
- package/dist/production/plugins/text/highlight/withHighlight.js +9 -0
- package/dist/production/plugins/text/highlight/withHighlight.js.map +1 -0
- package/dist/production/plugins/text/italic/italicMark.cjs +13 -0
- package/dist/production/plugins/text/italic/italicMark.cjs.map +1 -0
- package/dist/production/plugins/text/italic/italicMark.js +13 -0
- package/dist/production/plugins/text/italic/italicMark.js.map +1 -0
- package/dist/production/plugins/text/italic/withItalic.cjs +16 -0
- package/dist/production/plugins/text/italic/withItalic.cjs.map +1 -0
- package/dist/production/plugins/text/italic/withItalic.js +16 -0
- package/dist/production/plugins/text/italic/withItalic.js.map +1 -0
- package/dist/production/plugins/text/newline/withNewline.cjs +15 -0
- package/dist/production/plugins/text/newline/withNewline.cjs.map +1 -0
- package/dist/production/plugins/text/newline/withNewline.js +15 -0
- package/dist/production/plugins/text/newline/withNewline.js.map +1 -0
- package/dist/production/plugins/text/strikeThrough/strikeThroughMark.cjs +13 -0
- package/dist/production/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -0
- package/dist/production/plugins/text/strikeThrough/strikeThroughMark.js +13 -0
- package/dist/production/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -0
- package/dist/production/plugins/text/strikeThrough/withStrikeThrough.cjs +17 -0
- package/dist/production/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -0
- package/dist/production/plugins/text/strikeThrough/withStrikeThrough.js +17 -0
- package/dist/production/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -0
- package/dist/production/plugins/text/underline/underlineMark.cjs +13 -0
- package/dist/production/plugins/text/underline/underlineMark.cjs.map +1 -0
- package/dist/production/plugins/text/underline/underlineMark.js +13 -0
- package/dist/production/plugins/text/underline/underlineMark.js.map +1 -0
- package/dist/production/plugins/text/underline/withUnderline.cjs +17 -0
- package/dist/production/plugins/text/underline/withUnderline.cjs.map +1 -0
- package/dist/production/plugins/text/underline/withUnderline.js +17 -0
- package/dist/production/plugins/text/underline/withUnderline.js.map +1 -0
- package/dist/production/slate-reexport.cjs +10 -0
- package/dist/production/slate-reexport.cjs.map +1 -0
- package/dist/production/slate-reexport.js +8 -0
- package/dist/production/slate-reexport.js.map +1 -0
- package/dist/types/components/RichTextEditor.d.ts +13 -0
- package/dist/types/components/RichTextEditor.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/triggers/EditorElementTrigger.d.ts +8 -0
- package/dist/types/components/triggers/EditorElementTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/EditorGenericTrigger.d.ts +16 -0
- package/dist/types/components/triggers/EditorGenericTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/EditorMarkTrigger.d.ts +7 -0
- package/dist/types/components/triggers/EditorMarkTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/EditorWrapNodeTrigger.d.ts +11 -0
- package/dist/types/components/triggers/EditorWrapNodeTrigger.d.ts.map +1 -0
- package/dist/types/components/triggers/index.d.ts +5 -0
- package/dist/types/components/triggers/index.d.ts.map +1 -0
- package/dist/types/editor/createEditor.d.ts +24 -0
- package/dist/types/editor/createEditor.d.ts.map +1 -0
- package/dist/types/editor/createEditorWithEssentials.d.ts +5 -0
- package/dist/types/editor/createEditorWithEssentials.d.ts.map +1 -0
- package/dist/types/editor/index.d.ts +35 -0
- package/dist/types/editor/index.d.ts.map +1 -0
- package/dist/types/editor/methods/addMarks.d.ts +3 -0
- package/dist/types/editor/methods/addMarks.d.ts.map +1 -0
- package/dist/types/editor/methods/canToggleMark.d.ts +2 -0
- package/dist/types/editor/methods/canToggleMark.d.ts.map +1 -0
- package/dist/types/editor/methods/closest.d.ts +6 -0
- package/dist/types/editor/methods/closest.d.ts.map +1 -0
- package/dist/types/editor/methods/closestBlockEntry.d.ts +6 -0
- package/dist/types/editor/methods/closestBlockEntry.d.ts.map +1 -0
- package/dist/types/editor/methods/closestViableBlockContainerEntry.d.ts +6 -0
- package/dist/types/editor/methods/closestViableBlockContainerEntry.d.ts.map +1 -0
- package/dist/types/editor/methods/ejectElement.d.ts +3 -0
- package/dist/types/editor/methods/ejectElement.d.ts.map +1 -0
- package/dist/types/editor/methods/elementToSpecifics.d.ts +2 -0
- package/dist/types/editor/methods/elementToSpecifics.d.ts.map +1 -0
- package/dist/types/editor/methods/getElementDataAttributes.d.ts +6 -0
- package/dist/types/editor/methods/getElementDataAttributes.d.ts.map +1 -0
- package/dist/types/editor/methods/getPreviousSibling.d.ts +3 -0
- package/dist/types/editor/methods/getPreviousSibling.d.ts.map +1 -0
- package/dist/types/editor/methods/hasMarks.d.ts +7 -0
- package/dist/types/editor/methods/hasMarks.d.ts.map +1 -0
- package/dist/types/editor/methods/hasParentOfType.d.ts +3 -0
- package/dist/types/editor/methods/hasParentOfType.d.ts.map +1 -0
- package/dist/types/editor/methods/index.d.ts +20 -0
- package/dist/types/editor/methods/index.d.ts.map +1 -0
- package/dist/types/editor/methods/isElementType.d.ts +3 -0
- package/dist/types/editor/methods/isElementType.d.ts.map +1 -0
- package/dist/types/editor/methods/permissivelyDeserializeNodes.d.ts +3 -0
- package/dist/types/editor/methods/permissivelyDeserializeNodes.d.ts.map +1 -0
- package/dist/types/editor/methods/removeMarks.d.ts +3 -0
- package/dist/types/editor/methods/removeMarks.d.ts.map +1 -0
- package/dist/types/editor/methods/serializeNodes.d.ts +3 -0
- package/dist/types/editor/methods/serializeNodes.d.ts.map +1 -0
- package/dist/types/editor/methods/strictlyDeserializeNodes.d.ts +3 -0
- package/dist/types/editor/methods/strictlyDeserializeNodes.d.ts.map +1 -0
- package/dist/types/editor/methods/textToSpecifics.d.ts +3 -0
- package/dist/types/editor/methods/textToSpecifics.d.ts.map +1 -0
- package/dist/types/editor/methods/toLatestFormat.d.ts +3 -0
- package/dist/types/editor/methods/toLatestFormat.d.ts.map +1 -0
- package/dist/types/editor/methods/topLevelNodes.d.ts +2 -0
- package/dist/types/editor/methods/topLevelNodes.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/internal/components/DefaultElement.d.ts +6 -0
- package/dist/types/internal/components/DefaultElement.d.ts.map +1 -0
- package/dist/types/internal/hooks/useRichTextFieldNodes.d.ts +9 -0
- package/dist/types/internal/hooks/useRichTextFieldNodes.d.ts.map +1 -0
- package/dist/types/internal/utils/EditorPasteUtils.d.ts +7 -0
- package/dist/types/internal/utils/EditorPasteUtils.d.ts.map +1 -0
- package/dist/types/internal/utils/index.d.ts +3 -0
- package/dist/types/internal/utils/index.d.ts.map +1 -0
- package/dist/types/internal/utils/parseIframeSrc.d.ts +2 -0
- package/dist/types/internal/utils/parseIframeSrc.d.ts.map +1 -0
- package/dist/types/internal/utils/parseUrl.d.ts +2 -0
- package/dist/types/internal/utils/parseUrl.d.ts.map +1 -0
- package/dist/types/plugins/attributes/alignment/alignButton.d.ts +14 -0
- package/dist/types/plugins/attributes/alignment/alignButton.d.ts.map +1 -0
- package/dist/types/plugins/attributes/alignment/index.d.ts +2 -0
- package/dist/types/plugins/attributes/alignment/index.d.ts.map +1 -0
- package/dist/types/plugins/attributes/index.d.ts +2 -0
- package/dist/types/plugins/attributes/index.d.ts.map +1 -0
- package/dist/types/plugins/behaviour/index.d.ts +2 -0
- package/dist/types/plugins/behaviour/index.d.ts.map +1 -0
- package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts +34 -0
- package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts.map +1 -0
- package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts +3 -0
- package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts.map +1 -0
- package/dist/types/plugins/behaviour/paste/index.d.ts +3 -0
- package/dist/types/plugins/behaviour/paste/index.d.ts.map +1 -0
- package/dist/types/plugins/behaviour/paste/withPaste.d.ts +3 -0
- package/dist/types/plugins/behaviour/paste/withPaste.d.ts.map +1 -0
- package/dist/types/plugins/element/anchors/AnchorElement.d.ts +14 -0
- package/dist/types/plugins/element/anchors/AnchorElement.d.ts.map +1 -0
- package/dist/types/plugins/element/anchors/AnchorHtmlDeserializer.d.ts +3 -0
- package/dist/types/plugins/element/anchors/AnchorHtmlDeserializer.d.ts.map +1 -0
- package/dist/types/plugins/element/anchors/AnchorModifications.d.ts +6 -0
- package/dist/types/plugins/element/anchors/AnchorModifications.d.ts.map +1 -0
- package/dist/types/plugins/element/anchors/index.d.ts +4 -0
- package/dist/types/plugins/element/anchors/index.d.ts.map +1 -0
- package/dist/types/plugins/element/anchors/withAnchors.d.ts +6 -0
- package/dist/types/plugins/element/anchors/withAnchors.d.ts.map +1 -0
- package/dist/types/plugins/element/headings/HeadingElement.d.ts +17 -0
- package/dist/types/plugins/element/headings/HeadingElement.d.ts.map +1 -0
- package/dist/types/plugins/element/headings/HeadingHtmlDeserializer.d.ts +3 -0
- package/dist/types/plugins/element/headings/HeadingHtmlDeserializer.d.ts.map +1 -0
- package/dist/types/plugins/element/headings/index.d.ts +4 -0
- package/dist/types/plugins/element/headings/index.d.ts.map +1 -0
- package/dist/types/plugins/element/headings/withHeadings.d.ts +6 -0
- package/dist/types/plugins/element/headings/withHeadings.d.ts.map +1 -0
- package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts +13 -0
- package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts.map +1 -0
- package/dist/types/plugins/element/horizonalRules/index.d.ts +3 -0
- package/dist/types/plugins/element/horizonalRules/index.d.ts.map +1 -0
- package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts +6 -0
- package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts.map +1 -0
- package/dist/types/plugins/element/index.d.ts +8 -0
- package/dist/types/plugins/element/index.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/ListElement.d.ts +6 -0
- package/dist/types/plugins/element/lists/ListElement.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts +10 -0
- package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/ListItemElement.d.ts +12 -0
- package/dist/types/plugins/element/lists/ListItemElement.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/OrderedListElement.d.ts +12 -0
- package/dist/types/plugins/element/lists/OrderedListElement.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/UnorderedListElement.d.ts +12 -0
- package/dist/types/plugins/element/lists/UnorderedListElement.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/index.d.ts +6 -0
- package/dist/types/plugins/element/lists/index.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/transforms/dedentListItem.d.ts +4 -0
- package/dist/types/plugins/element/lists/transforms/dedentListItem.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts +4 -0
- package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/transforms/index.d.ts +5 -0
- package/dist/types/plugins/element/lists/transforms/index.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/transforms/normalizeListElement.d.ts +7 -0
- package/dist/types/plugins/element/lists/transforms/normalizeListElement.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts +5 -0
- package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts.map +1 -0
- package/dist/types/plugins/element/lists/withLists.d.ts +10 -0
- package/dist/types/plugins/element/lists/withLists.d.ts.map +1 -0
- package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts +15 -0
- package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts.map +1 -0
- package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts +3 -0
- package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts.map +1 -0
- package/dist/types/plugins/element/paragraphs/index.d.ts +4 -0
- package/dist/types/plugins/element/paragraphs/index.d.ts.map +1 -0
- package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts +6 -0
- package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts.map +1 -0
- package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts +14 -0
- package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts.map +1 -0
- package/dist/types/plugins/element/scrollTargets/index.d.ts +3 -0
- package/dist/types/plugins/element/scrollTargets/index.d.ts.map +1 -0
- package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts +6 -0
- package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts.map +1 -0
- package/dist/types/plugins/element/tables/TableCellElement.d.ts +20 -0
- package/dist/types/plugins/element/tables/TableCellElement.d.ts.map +1 -0
- package/dist/types/plugins/element/tables/TableElement.d.ts +26 -0
- package/dist/types/plugins/element/tables/TableElement.d.ts.map +1 -0
- package/dist/types/plugins/element/tables/TableElementSelection.d.ts +6 -0
- package/dist/types/plugins/element/tables/TableElementSelection.d.ts.map +1 -0
- package/dist/types/plugins/element/tables/TableModifications.d.ts +14 -0
- package/dist/types/plugins/element/tables/TableModifications.d.ts.map +1 -0
- package/dist/types/plugins/element/tables/TableRowElement.d.ts +22 -0
- package/dist/types/plugins/element/tables/TableRowElement.d.ts.map +1 -0
- package/dist/types/plugins/element/tables/gaugeTableColumnCount.d.ts +3 -0
- package/dist/types/plugins/element/tables/gaugeTableColumnCount.d.ts.map +1 -0
- package/dist/types/plugins/element/tables/index.d.ts +6 -0
- package/dist/types/plugins/element/tables/index.d.ts.map +1 -0
- package/dist/types/plugins/element/tables/withTables.d.ts +10 -0
- package/dist/types/plugins/element/tables/withTables.d.ts.map +1 -0
- package/dist/types/plugins/index.d.ts +5 -0
- package/dist/types/plugins/index.d.ts.map +1 -0
- package/dist/types/plugins/text/bold/boldMark.d.ts +4 -0
- package/dist/types/plugins/text/bold/boldMark.d.ts.map +1 -0
- package/dist/types/plugins/text/bold/index.d.ts +3 -0
- package/dist/types/plugins/text/bold/index.d.ts.map +1 -0
- package/dist/types/plugins/text/bold/withBold.d.ts +3 -0
- package/dist/types/plugins/text/bold/withBold.d.ts.map +1 -0
- package/dist/types/plugins/text/code/codeMark.d.ts +4 -0
- package/dist/types/plugins/text/code/codeMark.d.ts.map +1 -0
- package/dist/types/plugins/text/code/index.d.ts +3 -0
- package/dist/types/plugins/text/code/index.d.ts.map +1 -0
- package/dist/types/plugins/text/code/withCode.d.ts +3 -0
- package/dist/types/plugins/text/code/withCode.d.ts.map +1 -0
- package/dist/types/plugins/text/highlight/highlightMark.d.ts +4 -0
- package/dist/types/plugins/text/highlight/highlightMark.d.ts.map +1 -0
- package/dist/types/plugins/text/highlight/index.d.ts +3 -0
- package/dist/types/plugins/text/highlight/index.d.ts.map +1 -0
- package/dist/types/plugins/text/highlight/withHighlight.d.ts +3 -0
- package/dist/types/plugins/text/highlight/withHighlight.d.ts.map +1 -0
- package/dist/types/plugins/text/index.d.ts +8 -0
- package/dist/types/plugins/text/index.d.ts.map +1 -0
- package/dist/types/plugins/text/italic/index.d.ts +3 -0
- package/dist/types/plugins/text/italic/index.d.ts.map +1 -0
- package/dist/types/plugins/text/italic/italicMark.d.ts +4 -0
- package/dist/types/plugins/text/italic/italicMark.d.ts.map +1 -0
- package/dist/types/plugins/text/italic/withItalic.d.ts +3 -0
- package/dist/types/plugins/text/italic/withItalic.d.ts.map +1 -0
- package/dist/types/plugins/text/newline/index.d.ts +2 -0
- package/dist/types/plugins/text/newline/index.d.ts.map +1 -0
- package/dist/types/plugins/text/newline/withNewline.d.ts +3 -0
- package/dist/types/plugins/text/newline/withNewline.d.ts.map +1 -0
- package/dist/types/plugins/text/strikeThrough/index.d.ts +3 -0
- package/dist/types/plugins/text/strikeThrough/index.d.ts.map +1 -0
- package/dist/types/plugins/text/strikeThrough/strikeThroughMark.d.ts +4 -0
- package/dist/types/plugins/text/strikeThrough/strikeThroughMark.d.ts.map +1 -0
- package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts +3 -0
- package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts.map +1 -0
- package/dist/types/plugins/text/underline/index.d.ts +3 -0
- package/dist/types/plugins/text/underline/index.d.ts.map +1 -0
- package/dist/types/plugins/text/underline/underlineMark.d.ts +4 -0
- package/dist/types/plugins/text/underline/underlineMark.d.ts.map +1 -0
- package/dist/types/plugins/text/underline/withUnderline.d.ts +3 -0
- package/dist/types/plugins/text/underline/withUnderline.d.ts.map +1 -0
- package/dist/types/slate-reexport.d.ts +3 -0
- package/dist/types/slate-reexport.d.ts.map +1 -0
- package/dist/types/slate-types.d.ts +31 -0
- package/dist/types/slate-types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dist/types/types/editor.d.ts +43 -0
- package/dist/types/types/editor.d.ts.map +1 -0
- package/dist/types/types/htmlDeserializer.d.ts +38 -0
- package/dist/types/types/htmlDeserializer.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +4 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/plugins.d.ts +59 -0
- package/dist/types/types/plugins.d.ts.map +1 -0
- package/package.json +62 -0
- package/src/components/RichTextEditor.tsx +123 -0
- package/src/components/index.ts +3 -0
- package/src/components/triggers/EditorElementTrigger.tsx +22 -0
- package/src/components/triggers/EditorGenericTrigger.tsx +27 -0
- package/src/components/triggers/EditorMarkTrigger.tsx +21 -0
- package/src/components/triggers/EditorWrapNodeTrigger.tsx +36 -0
- package/src/components/triggers/index.ts +4 -0
- package/src/editor/createEditor.ts +52 -0
- package/src/editor/createEditorWithEssentials.tsx +248 -0
- package/src/editor/index.ts +48 -0
- package/src/editor/methods/addMarks.ts +10 -0
- package/src/editor/methods/canToggleMark.ts +9 -0
- package/src/editor/methods/closest.ts +21 -0
- package/src/editor/methods/closestBlockEntry.ts +14 -0
- package/src/editor/methods/closestViableBlockContainerEntry.ts +14 -0
- package/src/editor/methods/ejectElement.ts +14 -0
- package/src/editor/methods/elementToSpecifics.ts +8 -0
- package/src/editor/methods/getElementDataAttributes.ts +22 -0
- package/src/editor/methods/getPreviousSibling.ts +18 -0
- package/src/editor/methods/hasMarks.ts +30 -0
- package/src/editor/methods/hasParentOfType.ts +18 -0
- package/src/editor/methods/index.ts +19 -0
- package/src/editor/methods/isElementType.ts +29 -0
- package/src/editor/methods/permissivelyDeserializeNodes.ts +30 -0
- package/src/editor/methods/removeMarks.ts +10 -0
- package/src/editor/methods/serializeNodes.ts +18 -0
- package/src/editor/methods/strictlyDeserializeNodes.ts +19 -0
- package/src/editor/methods/textToSpecifics.ts +7 -0
- package/src/editor/methods/toLatestFormat.ts +37 -0
- package/src/editor/methods/topLevelNodes.ts +11 -0
- package/src/index.ts +6 -0
- package/src/internal/components/DefaultElement.tsx +11 -0
- package/src/internal/hooks/useRichTextFieldNodes.ts +38 -0
- package/src/internal/utils/EditorPasteUtils.ts +53 -0
- package/src/internal/utils/index.ts +2 -0
- package/src/internal/utils/parseIframeSrc.ts +13 -0
- package/src/internal/utils/parseUrl.ts +13 -0
- package/src/plugins/attributes/alignment/alignButton.ts +30 -0
- package/src/plugins/attributes/alignment/index.ts +1 -0
- package/src/plugins/attributes/index.ts +1 -0
- package/src/plugins/behaviour/index.ts +1 -0
- package/src/plugins/behaviour/paste/HtmlDeserializer.ts +180 -0
- package/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts +13 -0
- package/src/plugins/behaviour/paste/index.ts +2 -0
- package/src/plugins/behaviour/paste/withPaste.ts +24 -0
- package/src/plugins/element/anchors/AnchorElement.ts +49 -0
- package/src/plugins/element/anchors/AnchorHtmlDeserializer.ts +18 -0
- package/src/plugins/element/anchors/AnchorModifications.ts +29 -0
- package/src/plugins/element/anchors/index.ts +3 -0
- package/src/plugins/element/anchors/withAnchors.ts +23 -0
- package/src/plugins/element/headings/HeadingElement.ts +52 -0
- package/src/plugins/element/headings/HeadingHtmlDeserializer.ts +20 -0
- package/src/plugins/element/headings/index.ts +3 -0
- package/src/plugins/element/headings/withHeadings.ts +120 -0
- package/src/plugins/element/horizonalRules/HorizontalRuleElement.ts +48 -0
- package/src/plugins/element/horizonalRules/index.ts +2 -0
- package/src/plugins/element/horizonalRules/withHorizontalRules.ts +87 -0
- package/src/plugins/element/index.ts +7 -0
- package/src/plugins/element/lists/ListElement.ts +26 -0
- package/src/plugins/element/lists/ListHtmlDeserializer.ts +113 -0
- package/src/plugins/element/lists/ListItemElement.ts +60 -0
- package/src/plugins/element/lists/OrderedListElement.ts +31 -0
- package/src/plugins/element/lists/UnorderedListElement.ts +31 -0
- package/src/plugins/element/lists/index.ts +5 -0
- package/src/plugins/element/lists/transforms/dedentListItem.ts +70 -0
- package/src/plugins/element/lists/transforms/indentListItem.ts +81 -0
- package/src/plugins/element/lists/transforms/index.ts +4 -0
- package/src/plugins/element/lists/transforms/normalizeListElement.ts +20 -0
- package/src/plugins/element/lists/transforms/toggleListElement.ts +113 -0
- package/src/plugins/element/lists/withLists.ts +202 -0
- package/src/plugins/element/paragraphs/ParagraphElement.ts +59 -0
- package/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts +9 -0
- package/src/plugins/element/paragraphs/index.ts +3 -0
- package/src/plugins/element/paragraphs/withParagraphs.ts +70 -0
- package/src/plugins/element/scrollTargets/ScrollTargetElement.ts +61 -0
- package/src/plugins/element/scrollTargets/index.ts +2 -0
- package/src/plugins/element/scrollTargets/withScrollTargets.ts +8 -0
- package/src/plugins/element/tables/TableCellElement.ts +45 -0
- package/src/plugins/element/tables/TableElement.ts +125 -0
- package/src/plugins/element/tables/TableElementSelection.ts +19 -0
- package/src/plugins/element/tables/TableModifications.ts +165 -0
- package/src/plugins/element/tables/TableRowElement.ts +47 -0
- package/src/plugins/element/tables/gaugeTableColumnCount.ts +35 -0
- package/src/plugins/element/tables/index.ts +5 -0
- package/src/plugins/element/tables/withTables.ts +335 -0
- package/src/plugins/index.ts +4 -0
- package/src/plugins/text/bold/boldMark.ts +11 -0
- package/src/plugins/text/bold/index.ts +2 -0
- package/src/plugins/text/bold/withBold.ts +15 -0
- package/src/plugins/text/code/codeMark.ts +11 -0
- package/src/plugins/text/code/index.ts +2 -0
- package/src/plugins/text/code/withCode.ts +10 -0
- package/src/plugins/text/highlight/highlightMark.ts +11 -0
- package/src/plugins/text/highlight/index.ts +2 -0
- package/src/plugins/text/highlight/withHighlight.ts +10 -0
- package/src/plugins/text/index.ts +7 -0
- package/src/plugins/text/italic/index.ts +2 -0
- package/src/plugins/text/italic/italicMark.ts +11 -0
- package/src/plugins/text/italic/withItalic.ts +15 -0
- package/src/plugins/text/newline/index.ts +1 -0
- package/src/plugins/text/newline/withNewline.ts +13 -0
- package/src/plugins/text/strikeThrough/index.ts +2 -0
- package/src/plugins/text/strikeThrough/strikeThroughMark.ts +10 -0
- package/src/plugins/text/strikeThrough/withStrikeThrough.ts +18 -0
- package/src/plugins/text/underline/index.ts +2 -0
- package/src/plugins/text/underline/underlineMark.ts +11 -0
- package/src/plugins/text/underline/withUnderline.ts +17 -0
- package/src/slate-reexport.ts +4 -0
- package/src/slate-types.ts +33 -0
- package/src/tsconfig.json +11 -0
- package/src/types/editor.ts +55 -0
- package/src/types/htmlDeserializer.ts +42 -0
- package/src/types/index.ts +3 -0
- package/src/types/plugins.ts +35 -0
|
@@ -0,0 +1,281 @@
|
|
|
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 TableModifications = require("./TableModifications.cjs");
|
|
9
|
+
const TableRowElement = require("./TableRowElement.cjs");
|
|
10
|
+
const withTables = ({ renderTable, renderTableCell, renderTableRow }) => (editor) => {
|
|
11
|
+
const {
|
|
12
|
+
deleteForward,
|
|
13
|
+
deleteBackward,
|
|
14
|
+
deleteFragment,
|
|
15
|
+
insertBreak,
|
|
16
|
+
onKeyDown
|
|
17
|
+
} = editor;
|
|
18
|
+
editor.registerElement(TableElement.tableElementPlugin({ render: renderTable }));
|
|
19
|
+
editor.registerElement(TableCellElement.tableCellElementPlugin({ render: renderTableCell }));
|
|
20
|
+
editor.registerElement(TableRowElement.tableRowElementPlugin({ render: renderTableRow }));
|
|
21
|
+
Object.assign(editor, {
|
|
22
|
+
insertBreak: () => {
|
|
23
|
+
const closestBlockEntry = index.ContemberEditor.closestBlockEntry(editor);
|
|
24
|
+
if (closestBlockEntry && TableCellElement.isTableCellElement(closestBlockEntry[0])) {
|
|
25
|
+
const selection = editor.selection;
|
|
26
|
+
const [, closestBlockPath] = closestBlockEntry;
|
|
27
|
+
const [cellStart, cellEnd] = Slate.Editor.edges(editor, closestBlockPath);
|
|
28
|
+
if (!selection) {
|
|
29
|
+
return insertBreak();
|
|
30
|
+
}
|
|
31
|
+
return Slate.Editor.withoutNormalizing(editor, () => {
|
|
32
|
+
Slate.Transforms.wrapNodes(editor, editor.createDefaultElement([]), {
|
|
33
|
+
at: {
|
|
34
|
+
anchor: cellStart,
|
|
35
|
+
focus: cellEnd
|
|
36
|
+
},
|
|
37
|
+
match: (node) => Slate.Text.isText(node) || Slate.Element.isElement(node) && editor.isInline(node)
|
|
38
|
+
});
|
|
39
|
+
const relative = Slate.Path.relative(selection.focus.path, closestBlockPath);
|
|
40
|
+
Slate.Transforms.splitNodes(editor, {
|
|
41
|
+
// The zero should be the newly created default element.
|
|
42
|
+
at: {
|
|
43
|
+
path: [...closestBlockPath, 0, ...relative],
|
|
44
|
+
offset: selection.focus.offset
|
|
45
|
+
},
|
|
46
|
+
always: true
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
insertBreak();
|
|
51
|
+
},
|
|
52
|
+
deleteBackward: (unit) => {
|
|
53
|
+
const selection = editor.selection;
|
|
54
|
+
if (selection && Slate.Range.isCollapsed(selection)) {
|
|
55
|
+
const closestBlockEntry = index.ContemberEditor.closestBlockEntry(editor);
|
|
56
|
+
if (closestBlockEntry && TableCellElement.isTableCellElement(closestBlockEntry[0]) && Slate.Point.equals(selection.focus, Slate.Editor.start(editor, closestBlockEntry[1]))) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
deleteBackward(unit);
|
|
61
|
+
},
|
|
62
|
+
deleteForward: (unit) => {
|
|
63
|
+
const selection = editor.selection;
|
|
64
|
+
if (selection && Slate.Range.isCollapsed(selection)) {
|
|
65
|
+
const closestBlockEntry = index.ContemberEditor.closestBlockEntry(editor);
|
|
66
|
+
if (closestBlockEntry && TableCellElement.isTableCellElement(closestBlockEntry[0]) && Slate.Point.equals(selection.focus, Slate.Editor.end(editor, closestBlockEntry[1]))) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
deleteForward(unit);
|
|
71
|
+
},
|
|
72
|
+
deleteFragment: () => {
|
|
73
|
+
const selection = editor.selection;
|
|
74
|
+
if (!selection || Slate.Range.isCollapsed(selection)) {
|
|
75
|
+
return deleteFragment();
|
|
76
|
+
}
|
|
77
|
+
const lowestCommonAncestorPath = Slate.Path.common(selection.anchor.path, selection.focus.path);
|
|
78
|
+
const [lowestCommonAncestor] = Slate.Editor.node(editor, lowestCommonAncestorPath);
|
|
79
|
+
if (TableElement.isTableElement(lowestCommonAncestor) || TableRowElement.isTableRowElement(lowestCommonAncestor)) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
deleteFragment();
|
|
83
|
+
},
|
|
84
|
+
onKeyDown: (event) => {
|
|
85
|
+
const selection = editor.selection;
|
|
86
|
+
if (!selection || !(event.key === "Tab" || event.key === "ArrowUp" || event.key === "ArrowRight" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "Enter" || event.key === "Backspace")) {
|
|
87
|
+
return onKeyDown(event);
|
|
88
|
+
}
|
|
89
|
+
const closestBlockEntry = index.ContemberEditor.closestBlockEntry(editor, { at: selection });
|
|
90
|
+
if (!closestBlockEntry) {
|
|
91
|
+
return onKeyDown(event);
|
|
92
|
+
}
|
|
93
|
+
let cellElement;
|
|
94
|
+
let cellPath;
|
|
95
|
+
if (!TableCellElement.isTableCellElement(closestBlockEntry[0])) {
|
|
96
|
+
const parent = Slate.Node.parent(editor, closestBlockEntry[1]);
|
|
97
|
+
if (Slate.Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && TableCellElement.isTableCellElement(parent)) {
|
|
98
|
+
cellElement = parent;
|
|
99
|
+
cellPath = Slate.Path.parent(closestBlockEntry[1]);
|
|
100
|
+
} else {
|
|
101
|
+
return onKeyDown(event);
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
[cellElement, cellPath] = closestBlockEntry;
|
|
105
|
+
}
|
|
106
|
+
if (cellPath.length < 3) {
|
|
107
|
+
return onKeyDown(event);
|
|
108
|
+
}
|
|
109
|
+
const [rowIndex, columnIndex] = TableElementSelection.getTableCellCoordinates(editor, cellElement);
|
|
110
|
+
const tablePath = cellPath.slice(0, -2);
|
|
111
|
+
const tableElement = Slate.Node.get(editor, tablePath);
|
|
112
|
+
const rowCount = TableElement.getTableElementRowCount(tableElement);
|
|
113
|
+
const columnCount = TableElement.getTableElementColumnCount(tableElement);
|
|
114
|
+
if (rowCount === 0 || columnCount === 0) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const moveSelectionBeforeTable = () => {
|
|
118
|
+
const pointBeforeTable = Slate.Editor.before(editor, tablePath);
|
|
119
|
+
if (!pointBeforeTable) {
|
|
120
|
+
return onKeyDown(event);
|
|
121
|
+
}
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
return Slate.Transforms.select(editor, pointBeforeTable);
|
|
124
|
+
};
|
|
125
|
+
const moveSelectionAfterTable = () => {
|
|
126
|
+
const pointAfterTable = Slate.Editor.after(editor, tablePath);
|
|
127
|
+
if (!pointAfterTable) {
|
|
128
|
+
return onKeyDown(event);
|
|
129
|
+
}
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
return Slate.Transforms.select(editor, pointAfterTable);
|
|
132
|
+
};
|
|
133
|
+
if (event.key === "Tab") {
|
|
134
|
+
if (event.shiftKey) {
|
|
135
|
+
if (columnIndex > 0) {
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
return TableElementSelection.selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1);
|
|
138
|
+
} else if (columnIndex === 0) {
|
|
139
|
+
if (rowIndex > 0) {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
return TableElementSelection.selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1);
|
|
142
|
+
}
|
|
143
|
+
return moveSelectionBeforeTable();
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
if (columnIndex < columnCount - 1) {
|
|
147
|
+
event.preventDefault();
|
|
148
|
+
return TableElementSelection.selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1);
|
|
149
|
+
} else if (columnIndex === columnCount - 1) {
|
|
150
|
+
if (rowIndex < rowCount - 1) {
|
|
151
|
+
event.preventDefault();
|
|
152
|
+
return TableElementSelection.selectTableCellContents(editor, tablePath, rowIndex + 1, 0);
|
|
153
|
+
} else if (rowIndex === rowCount - 1) {
|
|
154
|
+
return moveSelectionAfterTable();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (event.key === "ArrowLeft") {
|
|
160
|
+
if (!Slate.Range.isCollapsed(selection)) {
|
|
161
|
+
return onKeyDown(event);
|
|
162
|
+
}
|
|
163
|
+
if (Slate.Point.equals(selection.focus, Slate.Editor.start(editor, cellPath))) {
|
|
164
|
+
if (columnIndex > 0) {
|
|
165
|
+
event.preventDefault();
|
|
166
|
+
return Slate.Transforms.select(editor, Slate.Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]));
|
|
167
|
+
} else if (columnIndex === 0) {
|
|
168
|
+
if (rowIndex > 0) {
|
|
169
|
+
event.preventDefault();
|
|
170
|
+
return Slate.Transforms.select(editor, Slate.Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]));
|
|
171
|
+
}
|
|
172
|
+
return moveSelectionBeforeTable();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
} else if (event.key === "ArrowRight") {
|
|
176
|
+
if (!Slate.Range.isCollapsed(selection)) {
|
|
177
|
+
return onKeyDown(event);
|
|
178
|
+
}
|
|
179
|
+
if (Slate.Point.equals(selection.focus, Slate.Editor.end(editor, cellPath))) {
|
|
180
|
+
if (columnIndex < columnCount - 1) {
|
|
181
|
+
event.preventDefault();
|
|
182
|
+
return Slate.Transforms.select(editor, Slate.Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]));
|
|
183
|
+
} else if (columnIndex === columnCount - 1) {
|
|
184
|
+
if (rowIndex < rowCount - 1) {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
return Slate.Transforms.select(editor, Slate.Editor.start(editor, [...tablePath, rowIndex + 1, 0]));
|
|
187
|
+
} else if (rowIndex === rowCount - 1) {
|
|
188
|
+
return moveSelectionAfterTable();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
} else if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
193
|
+
const withinDefault = editor.isDefaultElement(closestBlockEntry[0]);
|
|
194
|
+
if (withinDefault) {
|
|
195
|
+
const relative = Slate.Path.relative(closestBlockEntry[1], cellPath);
|
|
196
|
+
const defaultIndex = relative[0];
|
|
197
|
+
if (event.key === "ArrowUp" && defaultIndex !== 0 || event.key === "ArrowDown" && defaultIndex !== cellElement.children.length - 1) {
|
|
198
|
+
return onKeyDown(event);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (event.key === "ArrowUp") {
|
|
202
|
+
if (rowIndex > 0) {
|
|
203
|
+
event.preventDefault();
|
|
204
|
+
const rowAboveEndPoint = Slate.Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex]);
|
|
205
|
+
if (!Slate.Range.isCollapsed(selection)) {
|
|
206
|
+
return Slate.Transforms.select(editor, rowAboveEndPoint);
|
|
207
|
+
}
|
|
208
|
+
const minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset);
|
|
209
|
+
return Slate.Transforms.select(editor, {
|
|
210
|
+
path: rowAboveEndPoint.path,
|
|
211
|
+
offset: minOffset
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
return moveSelectionBeforeTable();
|
|
215
|
+
} else if (event.key === "ArrowDown") {
|
|
216
|
+
if (rowIndex < rowCount - 1) {
|
|
217
|
+
event.preventDefault();
|
|
218
|
+
const rowBelowStatPoint = Slate.Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex]);
|
|
219
|
+
if (!Slate.Range.isCollapsed(selection)) {
|
|
220
|
+
return Slate.Transforms.select(editor, rowBelowStatPoint);
|
|
221
|
+
}
|
|
222
|
+
const [rowBelowStatPointNode] = Slate.Editor.node(editor, rowBelowStatPoint);
|
|
223
|
+
return Slate.Transforms.select(editor, {
|
|
224
|
+
path: rowBelowStatPoint.path,
|
|
225
|
+
offset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length)
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return moveSelectionAfterTable();
|
|
229
|
+
}
|
|
230
|
+
} else if (event.ctrlKey || event.metaKey) {
|
|
231
|
+
if (event.key === "Backspace") {
|
|
232
|
+
event.preventDefault();
|
|
233
|
+
if (event.altKey) {
|
|
234
|
+
TableModifications.TableModifications.deleteTableColumn(editor, tableElement, columnIndex);
|
|
235
|
+
if (columnCount > 1) {
|
|
236
|
+
const columnBefore = Slate.Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)]);
|
|
237
|
+
return Slate.Transforms.select(editor, columnBefore);
|
|
238
|
+
} else {
|
|
239
|
+
return moveSelectionBeforeTable();
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
TableModifications.TableModifications.deleteTableRow(editor, tableElement, rowIndex);
|
|
243
|
+
if (rowCount > 1) {
|
|
244
|
+
const rowAbove = Slate.Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex]);
|
|
245
|
+
return Slate.Transforms.select(editor, rowAbove);
|
|
246
|
+
} else {
|
|
247
|
+
return moveSelectionBeforeTable();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
} else if (event.key === "Enter") {
|
|
251
|
+
event.preventDefault();
|
|
252
|
+
if (event.altKey) {
|
|
253
|
+
if (event.shiftKey) {
|
|
254
|
+
TableModifications.TableModifications.addTableColumn(editor, tableElement, columnIndex);
|
|
255
|
+
const columnBefore = Slate.Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)]);
|
|
256
|
+
return Slate.Transforms.select(editor, columnBefore);
|
|
257
|
+
} else {
|
|
258
|
+
TableModifications.TableModifications.addTableColumn(editor, tableElement, columnIndex + 1);
|
|
259
|
+
const columnAfter = Slate.Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]);
|
|
260
|
+
return Slate.Transforms.select(editor, columnAfter);
|
|
261
|
+
}
|
|
262
|
+
} else {
|
|
263
|
+
if (event.shiftKey) {
|
|
264
|
+
TableModifications.TableModifications.addTableRow(editor, tableElement, rowIndex);
|
|
265
|
+
const rowAbove = Slate.Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex]);
|
|
266
|
+
return Slate.Transforms.select(editor, rowAbove);
|
|
267
|
+
} else {
|
|
268
|
+
TableModifications.TableModifications.addTableRow(editor, tableElement, rowIndex + 1);
|
|
269
|
+
const rowBelowStat = Slate.Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex]);
|
|
270
|
+
return Slate.Transforms.select(editor, rowBelowStat);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
onKeyDown(event);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
return editor;
|
|
279
|
+
};
|
|
280
|
+
exports.withTables = withTables;
|
|
281
|
+
//# sourceMappingURL=withTables.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withTables.cjs","sources":["../../../../../src/plugins/element/tables/withTables.ts"],"sourcesContent":["import { Editor, Element, Node as SlateNode, NodeEntry, Path as SlatePath, Point, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isTableCellElement, TableCellElement, tableCellElementPlugin } from './TableCellElement'\nimport { getTableElementColumnCount, getTableElementRowCount, isTableElement, TableElement, tableElementPlugin } from './TableElement'\nimport { getTableCellCoordinates, selectTableCellContents } from './TableElementSelection'\nimport { TableModifications } from './TableModifications'\nimport { isTableRowElement, TableRowElement, tableRowElementPlugin } from './TableRowElement'\nimport { ElementRenderer } from '../../../types'\n\nexport const withTables = ({ renderTable, renderTableCell, renderTableRow }: {\n\trenderTable: ElementRenderer<TableElement>\n\trenderTableCell: ElementRenderer<TableCellElement>\n\trenderTableRow: ElementRenderer<TableRowElement>\n}) => <E extends Editor>(editor: E): E => {\n\tconst {\n\t\tdeleteForward,\n\t\tdeleteBackward,\n\t\tdeleteFragment,\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(tableElementPlugin({ render: renderTable }))\n\teditor.registerElement(tableCellElementPlugin({ render: renderTableCell }))\n\teditor.registerElement(tableRowElementPlugin({ render: renderTableRow }))\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst selection = editor.selection\n\t\t\t\tconst [, closestBlockPath] = closestBlockEntry\n\t\t\t\tconst [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath)\n\n\t\t\t\tif (!selection) {\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tanchor: cellStart,\n\t\t\t\t\t\t\tfocus: cellEnd,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmatch: node => Text.isText(node) || (Element.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t\tinsertBreak()\n\t\t},\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry &&\n\t\t\t\t\tisTableCellElement(closestBlockEntry[0]) &&\n\t\t\t\t\tPoint.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteBackward(unit)\n\t\t},\n\t\tdeleteForward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry &&\n\t\t\t\t\tisTableCellElement(closestBlockEntry[0]) &&\n\t\t\t\t\tPoint.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteForward(unit)\n\t\t},\n\t\tdeleteFragment: () => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (!selection || SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn deleteFragment()\n\t\t\t}\n\t\t\tconst lowestCommonAncestorPath = SlatePath.common(selection.anchor.path, selection.focus.path)\n\t\t\tconst [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath)\n\n\t\t\tif (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {\n\t\t\t\treturn // TODO nope for now\n\t\t\t}\n\t\t\tdeleteFragment()\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (\n\t\t\t\t!selection ||\n\t\t\t\t!(\n\t\t\t\t\tevent.key === 'Tab' ||\n\t\t\t\t\tevent.key === 'ArrowUp' ||\n\t\t\t\t\tevent.key === 'ArrowRight' ||\n\t\t\t\t\tevent.key === 'ArrowDown' ||\n\t\t\t\t\tevent.key === 'ArrowLeft' ||\n\t\t\t\t\tevent.key === 'Enter' ||\n\t\t\t\t\tevent.key === 'Backspace'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection })\n\n\t\t\tif (!closestBlockEntry) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet cellElement: TableCellElement\n\t\t\tlet cellPath: SlatePath\n\n\t\t\tif (!isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst parent = SlateNode.parent(editor, closestBlockEntry[1])\n\t\t\t\tif (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {\n\t\t\t\t\tcellElement = parent\n\t\t\t\t\tcellPath = SlatePath.parent(closestBlockEntry[1])\n\t\t\t\t} else {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t[cellElement, cellPath] = closestBlockEntry\n\t\t\t}\n\t\t\tif (cellPath.length < 3) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement)\n\t\t\tconst tablePath = cellPath.slice(0, -2)\n\t\t\tconst tableElement = SlateNode.get(editor, tablePath) as TableElement\n\t\t\tconst rowCount = getTableElementRowCount(tableElement)\n\t\t\tconst columnCount = getTableElementColumnCount(tableElement)\n\n\t\t\tif (rowCount === 0 || columnCount === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst moveSelectionBeforeTable = () => {\n\t\t\t\tconst pointBeforeTable = Editor.before(editor, tablePath)\n\t\t\t\tif (!pointBeforeTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointBeforeTable)\n\t\t\t}\n\t\t\tconst moveSelectionAfterTable = () => {\n\t\t\t\tconst pointAfterTable = Editor.after(editor, tablePath)\n\t\t\t\tif (!pointAfterTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointAfterTable)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t// Moving backwards\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1)\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Moving forwards\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1)\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\t// We're at the right edge of the table\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex + 1, 0)\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === 'ArrowLeft') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.start(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]))\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowRight') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.end(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]))\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]))\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\tconst withinDefault = editor.isDefaultElement(closestBlockEntry[0])\n\t\t\t\tif (withinDefault) {\n\t\t\t\t\tconst relative = SlatePath.relative(closestBlockEntry[1], cellPath)\n\t\t\t\t\tconst defaultIndex = relative[0]\n\t\t\t\t\tif (\n\t\t\t\t\t\t(event.key === 'ArrowUp' && defaultIndex !== 0) ||\n\t\t\t\t\t\t(event.key === 'ArrowDown' && defaultIndex !== cellElement.children.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAboveEndPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset)\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowAboveEndPoint.path,\n\t\t\t\t\t\t\toffset: minOffset,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStatPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint) as NodeEntry<Text>\n\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowBelowStatPoint.path,\n\t\t\t\t\t\t\toffset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t}\n\t\t\t} else if (event.ctrlKey || event.metaKey) {\n\t\t\t\tif (event.key === 'Backspace') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tTableModifications.deleteTableColumn(editor, tableElement, columnIndex)\n\n\t\t\t\t\t\tif (columnCount > 1) {\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTableModifications.deleteTableRow(editor, tableElement, rowIndex)\n\n\t\t\t\t\t\tif (rowCount > 1) {\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex)\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex + 1)\n\t\t\t\t\t\t\tconst columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnAfter)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex)\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex + 1)\n\t\t\t\t\t\t\tconst rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStat)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonKeyDown(event)\n\t\t},\n\n\t})\n\n\treturn editor\n}\n"],"names":["tableElementPlugin","tableCellElementPlugin","tableRowElementPlugin","ContemberEditor","isTableCellElement","Editor","Transforms","Text","Element","SlatePath","SlateRange","Point","isTableElement","isTableRowElement","SlateNode","getTableCellCoordinates","getTableElementRowCount","getTableElementColumnCount","selectTableCellContents","TableModifications"],"mappings":";;;;;;;;;AASa,MAAA,aAAa,CAAC,EAAE,aAAa,iBAAiB,eAAe,MAIpE,CAAmB,WAAiB;AACnC,QAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,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AC7D,oBAAM,WAAWd,MAAA,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,KAAK,IAAI,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEjF,qBAAAC,iBAAW,OAAO,QAAQ,QAAQ;AAAA,YAAA,OACnC;AACNa,iCAAA,mBAAmB,YAAY,QAAQ,cAAc,WAAW,CAAC;AAC3D,oBAAA,eAAed,MAAAA,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,WAAW,GAAG,WAAW,CAAC;AAE5E,qBAAAC,iBAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C;AAAA,UACD;AAAA,QACD;AAAA,MACD;AACA,gBAAU,KAAK;AAAA,IAChB;AAAA,EAAA,CAEA;AAEM,SAAA;AACR;;"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { Editor, Transforms, Text, Element, Path, Range, Point, Node } from "slate";
|
|
2
|
+
import { ContemberEditor } from "../../../editor/index.js";
|
|
3
|
+
import { tableCellElementPlugin, isTableCellElement } from "./TableCellElement.js";
|
|
4
|
+
import { tableElementPlugin, isTableElement, getTableElementRowCount, getTableElementColumnCount } from "./TableElement.js";
|
|
5
|
+
import { getTableCellCoordinates, selectTableCellContents } from "./TableElementSelection.js";
|
|
6
|
+
import { TableModifications } from "./TableModifications.js";
|
|
7
|
+
import { tableRowElementPlugin, isTableRowElement } from "./TableRowElement.js";
|
|
8
|
+
const withTables = ({ renderTable, renderTableCell, renderTableRow }) => (editor) => {
|
|
9
|
+
const {
|
|
10
|
+
deleteForward,
|
|
11
|
+
deleteBackward,
|
|
12
|
+
deleteFragment,
|
|
13
|
+
insertBreak,
|
|
14
|
+
onKeyDown
|
|
15
|
+
} = editor;
|
|
16
|
+
editor.registerElement(tableElementPlugin({ render: renderTable }));
|
|
17
|
+
editor.registerElement(tableCellElementPlugin({ render: renderTableCell }));
|
|
18
|
+
editor.registerElement(tableRowElementPlugin({ render: renderTableRow }));
|
|
19
|
+
Object.assign(editor, {
|
|
20
|
+
insertBreak: () => {
|
|
21
|
+
const closestBlockEntry = ContemberEditor.closestBlockEntry(editor);
|
|
22
|
+
if (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {
|
|
23
|
+
const selection = editor.selection;
|
|
24
|
+
const [, closestBlockPath] = closestBlockEntry;
|
|
25
|
+
const [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath);
|
|
26
|
+
if (!selection) {
|
|
27
|
+
return insertBreak();
|
|
28
|
+
}
|
|
29
|
+
return Editor.withoutNormalizing(editor, () => {
|
|
30
|
+
Transforms.wrapNodes(editor, editor.createDefaultElement([]), {
|
|
31
|
+
at: {
|
|
32
|
+
anchor: cellStart,
|
|
33
|
+
focus: cellEnd
|
|
34
|
+
},
|
|
35
|
+
match: (node) => Text.isText(node) || Element.isElement(node) && editor.isInline(node)
|
|
36
|
+
});
|
|
37
|
+
const relative = Path.relative(selection.focus.path, closestBlockPath);
|
|
38
|
+
Transforms.splitNodes(editor, {
|
|
39
|
+
// The zero should be the newly created default element.
|
|
40
|
+
at: {
|
|
41
|
+
path: [...closestBlockPath, 0, ...relative],
|
|
42
|
+
offset: selection.focus.offset
|
|
43
|
+
},
|
|
44
|
+
always: true
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
insertBreak();
|
|
49
|
+
},
|
|
50
|
+
deleteBackward: (unit) => {
|
|
51
|
+
const selection = editor.selection;
|
|
52
|
+
if (selection && Range.isCollapsed(selection)) {
|
|
53
|
+
const closestBlockEntry = ContemberEditor.closestBlockEntry(editor);
|
|
54
|
+
if (closestBlockEntry && isTableCellElement(closestBlockEntry[0]) && Point.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
deleteBackward(unit);
|
|
59
|
+
},
|
|
60
|
+
deleteForward: (unit) => {
|
|
61
|
+
const selection = editor.selection;
|
|
62
|
+
if (selection && Range.isCollapsed(selection)) {
|
|
63
|
+
const closestBlockEntry = ContemberEditor.closestBlockEntry(editor);
|
|
64
|
+
if (closestBlockEntry && isTableCellElement(closestBlockEntry[0]) && Point.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
deleteForward(unit);
|
|
69
|
+
},
|
|
70
|
+
deleteFragment: () => {
|
|
71
|
+
const selection = editor.selection;
|
|
72
|
+
if (!selection || Range.isCollapsed(selection)) {
|
|
73
|
+
return deleteFragment();
|
|
74
|
+
}
|
|
75
|
+
const lowestCommonAncestorPath = Path.common(selection.anchor.path, selection.focus.path);
|
|
76
|
+
const [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath);
|
|
77
|
+
if (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
deleteFragment();
|
|
81
|
+
},
|
|
82
|
+
onKeyDown: (event) => {
|
|
83
|
+
const selection = editor.selection;
|
|
84
|
+
if (!selection || !(event.key === "Tab" || event.key === "ArrowUp" || event.key === "ArrowRight" || event.key === "ArrowDown" || event.key === "ArrowLeft" || event.key === "Enter" || event.key === "Backspace")) {
|
|
85
|
+
return onKeyDown(event);
|
|
86
|
+
}
|
|
87
|
+
const closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection });
|
|
88
|
+
if (!closestBlockEntry) {
|
|
89
|
+
return onKeyDown(event);
|
|
90
|
+
}
|
|
91
|
+
let cellElement;
|
|
92
|
+
let cellPath;
|
|
93
|
+
if (!isTableCellElement(closestBlockEntry[0])) {
|
|
94
|
+
const parent = Node.parent(editor, closestBlockEntry[1]);
|
|
95
|
+
if (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {
|
|
96
|
+
cellElement = parent;
|
|
97
|
+
cellPath = Path.parent(closestBlockEntry[1]);
|
|
98
|
+
} else {
|
|
99
|
+
return onKeyDown(event);
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
[cellElement, cellPath] = closestBlockEntry;
|
|
103
|
+
}
|
|
104
|
+
if (cellPath.length < 3) {
|
|
105
|
+
return onKeyDown(event);
|
|
106
|
+
}
|
|
107
|
+
const [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement);
|
|
108
|
+
const tablePath = cellPath.slice(0, -2);
|
|
109
|
+
const tableElement = Node.get(editor, tablePath);
|
|
110
|
+
const rowCount = getTableElementRowCount(tableElement);
|
|
111
|
+
const columnCount = getTableElementColumnCount(tableElement);
|
|
112
|
+
if (rowCount === 0 || columnCount === 0) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const moveSelectionBeforeTable = () => {
|
|
116
|
+
const pointBeforeTable = Editor.before(editor, tablePath);
|
|
117
|
+
if (!pointBeforeTable) {
|
|
118
|
+
return onKeyDown(event);
|
|
119
|
+
}
|
|
120
|
+
event.preventDefault();
|
|
121
|
+
return Transforms.select(editor, pointBeforeTable);
|
|
122
|
+
};
|
|
123
|
+
const moveSelectionAfterTable = () => {
|
|
124
|
+
const pointAfterTable = Editor.after(editor, tablePath);
|
|
125
|
+
if (!pointAfterTable) {
|
|
126
|
+
return onKeyDown(event);
|
|
127
|
+
}
|
|
128
|
+
event.preventDefault();
|
|
129
|
+
return Transforms.select(editor, pointAfterTable);
|
|
130
|
+
};
|
|
131
|
+
if (event.key === "Tab") {
|
|
132
|
+
if (event.shiftKey) {
|
|
133
|
+
if (columnIndex > 0) {
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
return selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1);
|
|
136
|
+
} else if (columnIndex === 0) {
|
|
137
|
+
if (rowIndex > 0) {
|
|
138
|
+
event.preventDefault();
|
|
139
|
+
return selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1);
|
|
140
|
+
}
|
|
141
|
+
return moveSelectionBeforeTable();
|
|
142
|
+
}
|
|
143
|
+
} else {
|
|
144
|
+
if (columnIndex < columnCount - 1) {
|
|
145
|
+
event.preventDefault();
|
|
146
|
+
return selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1);
|
|
147
|
+
} else if (columnIndex === columnCount - 1) {
|
|
148
|
+
if (rowIndex < rowCount - 1) {
|
|
149
|
+
event.preventDefault();
|
|
150
|
+
return selectTableCellContents(editor, tablePath, rowIndex + 1, 0);
|
|
151
|
+
} else if (rowIndex === rowCount - 1) {
|
|
152
|
+
return moveSelectionAfterTable();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (event.key === "ArrowLeft") {
|
|
158
|
+
if (!Range.isCollapsed(selection)) {
|
|
159
|
+
return onKeyDown(event);
|
|
160
|
+
}
|
|
161
|
+
if (Point.equals(selection.focus, Editor.start(editor, cellPath))) {
|
|
162
|
+
if (columnIndex > 0) {
|
|
163
|
+
event.preventDefault();
|
|
164
|
+
return Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]));
|
|
165
|
+
} else if (columnIndex === 0) {
|
|
166
|
+
if (rowIndex > 0) {
|
|
167
|
+
event.preventDefault();
|
|
168
|
+
return Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]));
|
|
169
|
+
}
|
|
170
|
+
return moveSelectionBeforeTable();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
} else if (event.key === "ArrowRight") {
|
|
174
|
+
if (!Range.isCollapsed(selection)) {
|
|
175
|
+
return onKeyDown(event);
|
|
176
|
+
}
|
|
177
|
+
if (Point.equals(selection.focus, Editor.end(editor, cellPath))) {
|
|
178
|
+
if (columnIndex < columnCount - 1) {
|
|
179
|
+
event.preventDefault();
|
|
180
|
+
return Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]));
|
|
181
|
+
} else if (columnIndex === columnCount - 1) {
|
|
182
|
+
if (rowIndex < rowCount - 1) {
|
|
183
|
+
event.preventDefault();
|
|
184
|
+
return Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]));
|
|
185
|
+
} else if (rowIndex === rowCount - 1) {
|
|
186
|
+
return moveSelectionAfterTable();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
} else if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
191
|
+
const withinDefault = editor.isDefaultElement(closestBlockEntry[0]);
|
|
192
|
+
if (withinDefault) {
|
|
193
|
+
const relative = Path.relative(closestBlockEntry[1], cellPath);
|
|
194
|
+
const defaultIndex = relative[0];
|
|
195
|
+
if (event.key === "ArrowUp" && defaultIndex !== 0 || event.key === "ArrowDown" && defaultIndex !== cellElement.children.length - 1) {
|
|
196
|
+
return onKeyDown(event);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
if (event.key === "ArrowUp") {
|
|
200
|
+
if (rowIndex > 0) {
|
|
201
|
+
event.preventDefault();
|
|
202
|
+
const rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex]);
|
|
203
|
+
if (!Range.isCollapsed(selection)) {
|
|
204
|
+
return Transforms.select(editor, rowAboveEndPoint);
|
|
205
|
+
}
|
|
206
|
+
const minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset);
|
|
207
|
+
return Transforms.select(editor, {
|
|
208
|
+
path: rowAboveEndPoint.path,
|
|
209
|
+
offset: minOffset
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
return moveSelectionBeforeTable();
|
|
213
|
+
} else if (event.key === "ArrowDown") {
|
|
214
|
+
if (rowIndex < rowCount - 1) {
|
|
215
|
+
event.preventDefault();
|
|
216
|
+
const rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex]);
|
|
217
|
+
if (!Range.isCollapsed(selection)) {
|
|
218
|
+
return Transforms.select(editor, rowBelowStatPoint);
|
|
219
|
+
}
|
|
220
|
+
const [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint);
|
|
221
|
+
return Transforms.select(editor, {
|
|
222
|
+
path: rowBelowStatPoint.path,
|
|
223
|
+
offset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length)
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
return moveSelectionAfterTable();
|
|
227
|
+
}
|
|
228
|
+
} else if (event.ctrlKey || event.metaKey) {
|
|
229
|
+
if (event.key === "Backspace") {
|
|
230
|
+
event.preventDefault();
|
|
231
|
+
if (event.altKey) {
|
|
232
|
+
TableModifications.deleteTableColumn(editor, tableElement, columnIndex);
|
|
233
|
+
if (columnCount > 1) {
|
|
234
|
+
const columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)]);
|
|
235
|
+
return Transforms.select(editor, columnBefore);
|
|
236
|
+
} else {
|
|
237
|
+
return moveSelectionBeforeTable();
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
TableModifications.deleteTableRow(editor, tableElement, rowIndex);
|
|
241
|
+
if (rowCount > 1) {
|
|
242
|
+
const rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex]);
|
|
243
|
+
return Transforms.select(editor, rowAbove);
|
|
244
|
+
} else {
|
|
245
|
+
return moveSelectionBeforeTable();
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
} else if (event.key === "Enter") {
|
|
249
|
+
event.preventDefault();
|
|
250
|
+
if (event.altKey) {
|
|
251
|
+
if (event.shiftKey) {
|
|
252
|
+
TableModifications.addTableColumn(editor, tableElement, columnIndex);
|
|
253
|
+
const columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)]);
|
|
254
|
+
return Transforms.select(editor, columnBefore);
|
|
255
|
+
} else {
|
|
256
|
+
TableModifications.addTableColumn(editor, tableElement, columnIndex + 1);
|
|
257
|
+
const columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]);
|
|
258
|
+
return Transforms.select(editor, columnAfter);
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
if (event.shiftKey) {
|
|
262
|
+
TableModifications.addTableRow(editor, tableElement, rowIndex);
|
|
263
|
+
const rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex]);
|
|
264
|
+
return Transforms.select(editor, rowAbove);
|
|
265
|
+
} else {
|
|
266
|
+
TableModifications.addTableRow(editor, tableElement, rowIndex + 1);
|
|
267
|
+
const rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex]);
|
|
268
|
+
return Transforms.select(editor, rowBelowStat);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
onKeyDown(event);
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
return editor;
|
|
277
|
+
};
|
|
278
|
+
export {
|
|
279
|
+
withTables
|
|
280
|
+
};
|
|
281
|
+
//# sourceMappingURL=withTables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withTables.js","sources":["../../../../../src/plugins/element/tables/withTables.ts"],"sourcesContent":["import { Editor, Element, Node as SlateNode, NodeEntry, Path as SlatePath, Point, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isTableCellElement, TableCellElement, tableCellElementPlugin } from './TableCellElement'\nimport { getTableElementColumnCount, getTableElementRowCount, isTableElement, TableElement, tableElementPlugin } from './TableElement'\nimport { getTableCellCoordinates, selectTableCellContents } from './TableElementSelection'\nimport { TableModifications } from './TableModifications'\nimport { isTableRowElement, TableRowElement, tableRowElementPlugin } from './TableRowElement'\nimport { ElementRenderer } from '../../../types'\n\nexport const withTables = ({ renderTable, renderTableCell, renderTableRow }: {\n\trenderTable: ElementRenderer<TableElement>\n\trenderTableCell: ElementRenderer<TableCellElement>\n\trenderTableRow: ElementRenderer<TableRowElement>\n}) => <E extends Editor>(editor: E): E => {\n\tconst {\n\t\tdeleteForward,\n\t\tdeleteBackward,\n\t\tdeleteFragment,\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(tableElementPlugin({ render: renderTable }))\n\teditor.registerElement(tableCellElementPlugin({ render: renderTableCell }))\n\teditor.registerElement(tableRowElementPlugin({ render: renderTableRow }))\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst selection = editor.selection\n\t\t\t\tconst [, closestBlockPath] = closestBlockEntry\n\t\t\t\tconst [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath)\n\n\t\t\t\tif (!selection) {\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tanchor: cellStart,\n\t\t\t\t\t\t\tfocus: cellEnd,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmatch: node => Text.isText(node) || (Element.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t\tinsertBreak()\n\t\t},\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry &&\n\t\t\t\t\tisTableCellElement(closestBlockEntry[0]) &&\n\t\t\t\t\tPoint.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteBackward(unit)\n\t\t},\n\t\tdeleteForward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry &&\n\t\t\t\t\tisTableCellElement(closestBlockEntry[0]) &&\n\t\t\t\t\tPoint.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteForward(unit)\n\t\t},\n\t\tdeleteFragment: () => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (!selection || SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn deleteFragment()\n\t\t\t}\n\t\t\tconst lowestCommonAncestorPath = SlatePath.common(selection.anchor.path, selection.focus.path)\n\t\t\tconst [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath)\n\n\t\t\tif (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {\n\t\t\t\treturn // TODO nope for now\n\t\t\t}\n\t\t\tdeleteFragment()\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (\n\t\t\t\t!selection ||\n\t\t\t\t!(\n\t\t\t\t\tevent.key === 'Tab' ||\n\t\t\t\t\tevent.key === 'ArrowUp' ||\n\t\t\t\t\tevent.key === 'ArrowRight' ||\n\t\t\t\t\tevent.key === 'ArrowDown' ||\n\t\t\t\t\tevent.key === 'ArrowLeft' ||\n\t\t\t\t\tevent.key === 'Enter' ||\n\t\t\t\t\tevent.key === 'Backspace'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection })\n\n\t\t\tif (!closestBlockEntry) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet cellElement: TableCellElement\n\t\t\tlet cellPath: SlatePath\n\n\t\t\tif (!isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst parent = SlateNode.parent(editor, closestBlockEntry[1])\n\t\t\t\tif (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {\n\t\t\t\t\tcellElement = parent\n\t\t\t\t\tcellPath = SlatePath.parent(closestBlockEntry[1])\n\t\t\t\t} else {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t[cellElement, cellPath] = closestBlockEntry\n\t\t\t}\n\t\t\tif (cellPath.length < 3) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement)\n\t\t\tconst tablePath = cellPath.slice(0, -2)\n\t\t\tconst tableElement = SlateNode.get(editor, tablePath) as TableElement\n\t\t\tconst rowCount = getTableElementRowCount(tableElement)\n\t\t\tconst columnCount = getTableElementColumnCount(tableElement)\n\n\t\t\tif (rowCount === 0 || columnCount === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst moveSelectionBeforeTable = () => {\n\t\t\t\tconst pointBeforeTable = Editor.before(editor, tablePath)\n\t\t\t\tif (!pointBeforeTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointBeforeTable)\n\t\t\t}\n\t\t\tconst moveSelectionAfterTable = () => {\n\t\t\t\tconst pointAfterTable = Editor.after(editor, tablePath)\n\t\t\t\tif (!pointAfterTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointAfterTable)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t// Moving backwards\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1)\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Moving forwards\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1)\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\t// We're at the right edge of the table\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex + 1, 0)\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === 'ArrowLeft') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.start(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]))\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowRight') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.end(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]))\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]))\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\tconst withinDefault = editor.isDefaultElement(closestBlockEntry[0])\n\t\t\t\tif (withinDefault) {\n\t\t\t\t\tconst relative = SlatePath.relative(closestBlockEntry[1], cellPath)\n\t\t\t\t\tconst defaultIndex = relative[0]\n\t\t\t\t\tif (\n\t\t\t\t\t\t(event.key === 'ArrowUp' && defaultIndex !== 0) ||\n\t\t\t\t\t\t(event.key === 'ArrowDown' && defaultIndex !== cellElement.children.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAboveEndPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset)\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowAboveEndPoint.path,\n\t\t\t\t\t\t\toffset: minOffset,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStatPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint) as NodeEntry<Text>\n\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowBelowStatPoint.path,\n\t\t\t\t\t\t\toffset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t}\n\t\t\t} else if (event.ctrlKey || event.metaKey) {\n\t\t\t\tif (event.key === 'Backspace') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tTableModifications.deleteTableColumn(editor, tableElement, columnIndex)\n\n\t\t\t\t\t\tif (columnCount > 1) {\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTableModifications.deleteTableRow(editor, tableElement, rowIndex)\n\n\t\t\t\t\t\tif (rowCount > 1) {\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex)\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex + 1)\n\t\t\t\t\t\t\tconst columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnAfter)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex)\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex + 1)\n\t\t\t\t\t\t\tconst rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStat)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonKeyDown(event)\n\t\t},\n\n\t})\n\n\treturn editor\n}\n"],"names":["SlatePath","SlateRange","SlateNode"],"mappings":";;;;;;;AASa,MAAA,aAAa,CAAC,EAAE,aAAa,iBAAiB,eAAe,MAIpE,CAAmB,WAAiB;AACnC,QAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACG,IAAA;AAEJ,SAAO,gBAAgB,mBAAmB,EAAE,QAAQ,YAAa,CAAA,CAAC;AAClE,SAAO,gBAAgB,uBAAuB,EAAE,QAAQ,gBAAiB,CAAA,CAAC;AAC1E,SAAO,gBAAgB,sBAAsB,EAAE,QAAQ,eAAgB,CAAA,CAAC;AAExE,SAAO,OAAgC,QAAQ;AAAA,IAC9C,aAAa,MAAM;AACZ,YAAA,oBAAoB,gBAAgB,kBAAkB,MAAM;AAClE,UAAI,qBAAqB,mBAAmB,kBAAkB,CAAC,CAAC,GAAG;AAClE,cAAM,YAAY,OAAO;AACnB,cAAA,CAAG,EAAA,gBAAgB,IAAI;AAC7B,cAAM,CAAC,WAAW,OAAO,IAAI,OAAO,MAAM,QAAQ,gBAAgB;AAElE,YAAI,CAAC,WAAW;AACf,iBAAO,YAAY;AAAA,QACpB;AAEO,eAAA,OAAO,mBAAmB,QAAQ,MAAM;AAC9C,qBAAW,UAAU,QAAQ,OAAO,qBAAqB,CAAE,CAAA,GAAG;AAAA,YAC7D,IAAI;AAAA,cACH,QAAQ;AAAA,cACR,OAAO;AAAA,YACR;AAA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