@contember/react-slate-editor-base 2.0.0-alpha.2 → 2.0.0-alpha.21
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/api-extractor.json +3 -0
- package/dist/development/index.cjs +47 -47
- package/dist/development/index.js +47 -47
- package/dist/development/src/components/RichTextEditor.cjs +105 -0
- package/dist/development/src/components/RichTextEditor.cjs.map +1 -0
- package/dist/development/src/components/RichTextEditor.js +105 -0
- package/dist/development/src/components/RichTextEditor.js.map +1 -0
- package/dist/development/src/components/triggers/EditorElementTrigger.cjs +20 -0
- package/dist/development/src/components/triggers/EditorElementTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/EditorElementTrigger.js +20 -0
- package/dist/development/src/components/triggers/EditorElementTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/EditorGenericTrigger.cjs +24 -0
- package/dist/development/src/components/triggers/EditorGenericTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/EditorGenericTrigger.js +24 -0
- package/dist/development/src/components/triggers/EditorGenericTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/EditorMarkTrigger.cjs +20 -0
- package/dist/development/src/components/triggers/EditorMarkTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/EditorMarkTrigger.js +20 -0
- package/dist/development/src/components/triggers/EditorMarkTrigger.js.map +1 -0
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.cjs +32 -0
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -0
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.js +32 -0
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -0
- package/dist/development/src/editor/createEditor.cjs +35 -0
- package/dist/development/src/editor/createEditor.cjs.map +1 -0
- package/dist/development/src/editor/createEditor.js.map +1 -0
- package/dist/development/src/editor/createEditorWithEssentials.cjs +227 -0
- package/dist/development/src/editor/createEditorWithEssentials.cjs.map +1 -0
- package/dist/development/src/editor/createEditorWithEssentials.js.map +1 -0
- package/dist/development/src/editor/index.cjs.map +1 -0
- package/dist/development/src/editor/index.js.map +1 -0
- package/dist/development/src/editor/methods/addMarks.cjs.map +1 -0
- package/dist/development/src/editor/methods/addMarks.js.map +1 -0
- package/dist/development/src/editor/methods/canToggleMark.cjs.map +1 -0
- package/dist/development/src/editor/methods/canToggleMark.js.map +1 -0
- package/dist/development/src/editor/methods/closest.cjs.map +1 -0
- package/dist/development/src/editor/methods/closest.js.map +1 -0
- package/dist/development/src/editor/methods/closestBlockEntry.cjs.map +1 -0
- package/dist/development/src/editor/methods/closestBlockEntry.js.map +1 -0
- package/dist/development/src/editor/methods/closestViableBlockContainerEntry.cjs.map +1 -0
- package/dist/development/src/editor/methods/closestViableBlockContainerEntry.js.map +1 -0
- package/dist/development/src/editor/methods/ejectElement.cjs.map +1 -0
- package/dist/development/src/editor/methods/ejectElement.js.map +1 -0
- package/dist/development/src/editor/methods/elementToSpecifics.cjs.map +1 -0
- package/dist/development/src/editor/methods/elementToSpecifics.js.map +1 -0
- package/dist/development/src/editor/methods/getElementDataAttributes.cjs.map +1 -0
- package/dist/development/src/editor/methods/getElementDataAttributes.js.map +1 -0
- package/dist/development/src/editor/methods/getPreviousSibling.cjs.map +1 -0
- package/dist/development/src/editor/methods/getPreviousSibling.js.map +1 -0
- package/dist/development/src/editor/methods/hasMarks.cjs.map +1 -0
- package/dist/development/src/editor/methods/hasMarks.js.map +1 -0
- package/dist/development/src/editor/methods/hasParentOfType.cjs.map +1 -0
- package/dist/development/src/editor/methods/hasParentOfType.js.map +1 -0
- package/dist/development/src/editor/methods/isElementType.cjs.map +1 -0
- package/dist/development/src/editor/methods/isElementType.js.map +1 -0
- package/dist/development/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -0
- package/dist/development/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -0
- package/dist/development/src/editor/methods/removeMarks.cjs.map +1 -0
- package/dist/development/src/editor/methods/removeMarks.js.map +1 -0
- package/dist/development/src/editor/methods/serializeNodes.cjs.map +1 -0
- package/dist/development/src/editor/methods/serializeNodes.js.map +1 -0
- package/dist/development/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -0
- package/dist/development/src/editor/methods/strictlyDeserializeNodes.js.map +1 -0
- package/dist/development/src/editor/methods/textToSpecifics.cjs.map +1 -0
- package/dist/development/src/editor/methods/textToSpecifics.js.map +1 -0
- package/dist/development/src/editor/methods/toLatestFormat.cjs.map +1 -0
- package/dist/development/src/editor/methods/toLatestFormat.js.map +1 -0
- package/dist/development/src/editor/methods/topLevelNodes.cjs.map +1 -0
- package/dist/development/src/editor/methods/topLevelNodes.js.map +1 -0
- package/dist/development/src/internal/components/DefaultElement.cjs +11 -0
- package/dist/development/src/internal/components/DefaultElement.cjs.map +1 -0
- package/dist/development/src/internal/components/DefaultElement.js.map +1 -0
- package/dist/development/src/internal/hooks/useRichTextFieldNodes.cjs.map +1 -0
- package/dist/development/src/internal/hooks/useRichTextFieldNodes.js.map +1 -0
- package/dist/development/src/internal/utils/EditorPasteUtils.cjs.map +1 -0
- package/dist/development/src/internal/utils/EditorPasteUtils.js.map +1 -0
- package/dist/development/src/internal/utils/parseUrl.cjs.map +1 -0
- package/dist/development/src/internal/utils/parseUrl.js.map +1 -0
- package/dist/development/src/plugins/attributes/alignment/alignButton.cjs.map +1 -0
- package/dist/development/src/plugins/attributes/alignment/alignButton.js.map +1 -0
- package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -0
- package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -0
- package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -0
- package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -0
- package/dist/development/src/plugins/behaviour/paste/withPaste.cjs.map +1 -0
- package/dist/development/src/plugins/behaviour/paste/withPaste.js.map +1 -0
- package/dist/development/src/plugins/element/anchors/AnchorElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/anchors/AnchorElement.js.map +1 -0
- package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -0
- package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -0
- package/dist/development/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -0
- package/dist/development/src/plugins/element/anchors/AnchorModifications.js.map +1 -0
- package/dist/development/src/plugins/element/anchors/withAnchors.cjs.map +1 -0
- package/dist/development/src/plugins/element/anchors/withAnchors.js.map +1 -0
- package/dist/development/src/plugins/element/headings/HeadingElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/headings/HeadingElement.js.map +1 -0
- package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -0
- package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -0
- package/dist/development/src/plugins/element/headings/withHeadings.cjs.map +1 -0
- package/dist/development/src/plugins/element/headings/withHeadings.js.map +1 -0
- package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -0
- package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -0
- package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -0
- package/dist/development/src/plugins/element/lists/ListElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/ListElement.js.map +1 -0
- package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -0
- package/dist/development/src/plugins/element/lists/ListItemElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/ListItemElement.js.map +1 -0
- package/dist/development/src/plugins/element/lists/OrderedListElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/OrderedListElement.js.map +1 -0
- package/dist/development/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/UnorderedListElement.js.map +1 -0
- package/dist/development/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -0
- package/dist/development/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/transforms/indentListItem.js.map +1 -0
- package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -0
- package/dist/development/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -0
- package/dist/development/src/plugins/element/lists/withLists.cjs.map +1 -0
- package/dist/development/src/plugins/element/lists/withLists.js.map +1 -0
- package/dist/development/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -0
- package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -0
- package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -0
- package/dist/development/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -0
- package/dist/development/src/plugins/element/paragraphs/withParagraphs.js.map +1 -0
- package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -0
- package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -0
- package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -0
- package/dist/development/src/plugins/element/tables/TableCellElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/tables/TableCellElement.js.map +1 -0
- package/dist/development/src/plugins/element/tables/TableElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/tables/TableElement.js.map +1 -0
- package/dist/development/src/plugins/element/tables/TableElementSelection.cjs.map +1 -0
- package/dist/development/src/plugins/element/tables/TableElementSelection.js.map +1 -0
- package/dist/development/src/plugins/element/tables/TableModifications.cjs +134 -0
- package/dist/development/src/plugins/element/tables/TableModifications.cjs.map +1 -0
- package/dist/development/src/plugins/element/tables/TableModifications.js +134 -0
- package/dist/development/src/plugins/element/tables/TableModifications.js.map +1 -0
- package/dist/development/src/plugins/element/tables/TableRowElement.cjs.map +1 -0
- package/dist/development/src/plugins/element/tables/TableRowElement.js.map +1 -0
- package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -0
- package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -0
- package/dist/development/src/plugins/element/tables/withTables.cjs.map +1 -0
- package/dist/development/src/plugins/element/tables/withTables.js.map +1 -0
- package/dist/development/src/plugins/text/bold/boldMark.cjs +13 -0
- package/dist/development/src/plugins/text/bold/boldMark.cjs.map +1 -0
- package/dist/development/src/plugins/text/bold/boldMark.js.map +1 -0
- package/dist/development/src/plugins/text/bold/withBold.cjs.map +1 -0
- package/dist/development/src/plugins/text/bold/withBold.js.map +1 -0
- package/dist/development/src/plugins/text/code/codeMark.cjs +13 -0
- package/dist/development/src/plugins/text/code/codeMark.cjs.map +1 -0
- package/dist/development/src/plugins/text/code/codeMark.js.map +1 -0
- package/dist/development/src/plugins/text/code/withCode.cjs.map +1 -0
- package/dist/development/src/plugins/text/code/withCode.js.map +1 -0
- package/dist/development/src/plugins/text/highlight/highlightMark.cjs +13 -0
- package/dist/development/src/plugins/text/highlight/highlightMark.cjs.map +1 -0
- package/dist/development/src/plugins/text/highlight/highlightMark.js.map +1 -0
- package/dist/development/src/plugins/text/highlight/withHighlight.cjs.map +1 -0
- package/dist/development/src/plugins/text/highlight/withHighlight.js.map +1 -0
- package/dist/development/src/plugins/text/italic/italicMark.cjs +13 -0
- package/dist/development/src/plugins/text/italic/italicMark.cjs.map +1 -0
- package/dist/development/src/plugins/text/italic/italicMark.js.map +1 -0
- package/dist/development/src/plugins/text/italic/withItalic.cjs.map +1 -0
- package/dist/development/src/plugins/text/italic/withItalic.js.map +1 -0
- package/dist/development/src/plugins/text/newline/withNewline.cjs.map +1 -0
- package/dist/development/src/plugins/text/newline/withNewline.js.map +1 -0
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.cjs +13 -0
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -0
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -0
- package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -0
- package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -0
- package/dist/development/src/plugins/text/underline/underlineMark.cjs +13 -0
- package/dist/development/src/plugins/text/underline/underlineMark.cjs.map +1 -0
- package/dist/development/src/plugins/text/underline/underlineMark.js.map +1 -0
- package/dist/development/src/plugins/text/underline/withUnderline.cjs.map +1 -0
- package/dist/development/src/plugins/text/underline/withUnderline.js.map +1 -0
- package/dist/development/src/slate-reexport.cjs.map +1 -0
- package/dist/development/src/slate-reexport.js.map +1 -0
- package/dist/production/index.cjs +47 -47
- package/dist/production/index.js +47 -47
- package/dist/production/src/components/RichTextEditor.cjs +93 -0
- package/dist/production/src/components/RichTextEditor.cjs.map +1 -0
- package/dist/production/src/components/RichTextEditor.js +93 -0
- package/dist/production/src/components/RichTextEditor.js.map +1 -0
- package/dist/production/src/components/triggers/EditorElementTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/EditorElementTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/EditorGenericTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/EditorGenericTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/EditorMarkTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/EditorMarkTrigger.js.map +1 -0
- package/dist/production/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -0
- package/dist/production/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -0
- package/dist/production/src/editor/createEditor.cjs +35 -0
- package/dist/production/src/editor/createEditor.cjs.map +1 -0
- package/dist/production/src/editor/createEditor.js.map +1 -0
- package/dist/production/src/editor/createEditorWithEssentials.cjs +227 -0
- package/dist/production/src/editor/createEditorWithEssentials.cjs.map +1 -0
- package/dist/production/src/editor/createEditorWithEssentials.js.map +1 -0
- package/dist/production/src/editor/index.cjs.map +1 -0
- package/dist/production/src/editor/index.js.map +1 -0
- package/dist/production/src/editor/methods/addMarks.cjs.map +1 -0
- package/dist/production/src/editor/methods/addMarks.js.map +1 -0
- package/dist/production/src/editor/methods/canToggleMark.cjs.map +1 -0
- package/dist/production/src/editor/methods/canToggleMark.js.map +1 -0
- package/dist/production/src/editor/methods/closest.cjs.map +1 -0
- package/dist/production/src/editor/methods/closest.js.map +1 -0
- package/dist/production/src/editor/methods/closestBlockEntry.cjs.map +1 -0
- package/dist/production/src/editor/methods/closestBlockEntry.js.map +1 -0
- package/dist/production/src/editor/methods/closestViableBlockContainerEntry.cjs.map +1 -0
- package/dist/production/src/editor/methods/closestViableBlockContainerEntry.js.map +1 -0
- package/dist/production/src/editor/methods/ejectElement.cjs.map +1 -0
- package/dist/production/src/editor/methods/ejectElement.js.map +1 -0
- package/dist/production/src/editor/methods/elementToSpecifics.cjs.map +1 -0
- package/dist/production/src/editor/methods/elementToSpecifics.js.map +1 -0
- package/dist/production/src/editor/methods/getElementDataAttributes.cjs.map +1 -0
- package/dist/production/src/editor/methods/getElementDataAttributes.js.map +1 -0
- package/dist/production/src/editor/methods/getPreviousSibling.cjs.map +1 -0
- package/dist/production/src/editor/methods/getPreviousSibling.js.map +1 -0
- package/dist/production/src/editor/methods/hasMarks.cjs.map +1 -0
- package/dist/production/src/editor/methods/hasMarks.js.map +1 -0
- package/dist/production/src/editor/methods/hasParentOfType.cjs.map +1 -0
- package/dist/production/src/editor/methods/hasParentOfType.js.map +1 -0
- package/dist/production/src/editor/methods/isElementType.cjs.map +1 -0
- package/dist/production/src/editor/methods/isElementType.js.map +1 -0
- package/dist/production/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -0
- package/dist/production/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -0
- package/dist/production/src/editor/methods/removeMarks.cjs.map +1 -0
- package/dist/production/src/editor/methods/removeMarks.js.map +1 -0
- package/dist/production/src/editor/methods/serializeNodes.cjs.map +1 -0
- package/dist/production/src/editor/methods/serializeNodes.js.map +1 -0
- package/dist/production/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -0
- package/dist/production/src/editor/methods/strictlyDeserializeNodes.js.map +1 -0
- package/dist/production/src/editor/methods/textToSpecifics.cjs.map +1 -0
- package/dist/production/src/editor/methods/textToSpecifics.js.map +1 -0
- package/dist/production/src/editor/methods/toLatestFormat.cjs.map +1 -0
- package/dist/production/src/editor/methods/toLatestFormat.js.map +1 -0
- package/dist/production/src/editor/methods/topLevelNodes.cjs.map +1 -0
- package/dist/production/src/editor/methods/topLevelNodes.js.map +1 -0
- package/dist/production/src/internal/components/DefaultElement.cjs +11 -0
- package/dist/production/src/internal/components/DefaultElement.cjs.map +1 -0
- package/dist/production/src/internal/components/DefaultElement.js.map +1 -0
- package/dist/production/src/internal/hooks/useRichTextFieldNodes.cjs.map +1 -0
- package/dist/production/src/internal/hooks/useRichTextFieldNodes.js.map +1 -0
- package/dist/production/src/internal/utils/EditorPasteUtils.cjs.map +1 -0
- package/dist/production/src/internal/utils/EditorPasteUtils.js.map +1 -0
- package/dist/production/src/internal/utils/parseUrl.cjs.map +1 -0
- package/dist/production/src/internal/utils/parseUrl.js.map +1 -0
- package/dist/production/src/plugins/attributes/alignment/alignButton.cjs.map +1 -0
- package/dist/production/src/plugins/attributes/alignment/alignButton.js.map +1 -0
- package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -0
- package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -0
- package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -0
- package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -0
- package/dist/production/src/plugins/behaviour/paste/withPaste.cjs.map +1 -0
- package/dist/production/src/plugins/behaviour/paste/withPaste.js.map +1 -0
- package/dist/production/src/plugins/element/anchors/AnchorElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/anchors/AnchorElement.js.map +1 -0
- package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -0
- package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -0
- package/dist/production/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -0
- package/dist/production/src/plugins/element/anchors/AnchorModifications.js.map +1 -0
- package/dist/production/src/plugins/element/anchors/withAnchors.cjs.map +1 -0
- package/dist/production/src/plugins/element/anchors/withAnchors.js.map +1 -0
- package/dist/production/src/plugins/element/headings/HeadingElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/headings/HeadingElement.js.map +1 -0
- package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -0
- package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -0
- package/dist/production/src/plugins/element/headings/withHeadings.cjs.map +1 -0
- package/dist/production/src/plugins/element/headings/withHeadings.js.map +1 -0
- package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -0
- package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -0
- package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -0
- package/dist/production/src/plugins/element/lists/ListElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/ListElement.js.map +1 -0
- package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -0
- package/dist/production/src/plugins/element/lists/ListItemElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/ListItemElement.js.map +1 -0
- package/dist/production/src/plugins/element/lists/OrderedListElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/OrderedListElement.js.map +1 -0
- package/dist/production/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/UnorderedListElement.js.map +1 -0
- package/dist/production/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -0
- package/dist/production/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/transforms/indentListItem.js.map +1 -0
- package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -0
- package/dist/production/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -0
- package/dist/production/src/plugins/element/lists/withLists.cjs.map +1 -0
- package/dist/production/src/plugins/element/lists/withLists.js.map +1 -0
- package/dist/production/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -0
- package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -0
- package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -0
- package/dist/production/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -0
- package/dist/production/src/plugins/element/paragraphs/withParagraphs.js.map +1 -0
- package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -0
- package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -0
- package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -0
- package/dist/production/src/plugins/element/tables/TableCellElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/tables/TableCellElement.js.map +1 -0
- package/dist/production/src/plugins/element/tables/TableElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/tables/TableElement.js.map +1 -0
- package/dist/production/src/plugins/element/tables/TableElementSelection.cjs.map +1 -0
- package/dist/production/src/plugins/element/tables/TableElementSelection.js.map +1 -0
- package/dist/production/src/plugins/element/tables/TableModifications.cjs +134 -0
- package/dist/production/src/plugins/element/tables/TableModifications.cjs.map +1 -0
- package/dist/production/src/plugins/element/tables/TableModifications.js +134 -0
- package/dist/production/src/plugins/element/tables/TableModifications.js.map +1 -0
- package/dist/production/src/plugins/element/tables/TableRowElement.cjs.map +1 -0
- package/dist/production/src/plugins/element/tables/TableRowElement.js.map +1 -0
- package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -0
- package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -0
- package/dist/production/src/plugins/element/tables/withTables.cjs.map +1 -0
- package/dist/production/src/plugins/element/tables/withTables.js.map +1 -0
- package/dist/production/src/plugins/text/bold/boldMark.cjs +13 -0
- package/dist/production/src/plugins/text/bold/boldMark.cjs.map +1 -0
- package/dist/production/src/plugins/text/bold/boldMark.js.map +1 -0
- package/dist/production/src/plugins/text/bold/withBold.cjs.map +1 -0
- package/dist/production/src/plugins/text/bold/withBold.js.map +1 -0
- package/dist/production/src/plugins/text/code/codeMark.cjs +13 -0
- package/dist/production/src/plugins/text/code/codeMark.cjs.map +1 -0
- package/dist/production/src/plugins/text/code/codeMark.js.map +1 -0
- package/dist/production/src/plugins/text/code/withCode.cjs.map +1 -0
- package/dist/production/src/plugins/text/code/withCode.js.map +1 -0
- package/dist/production/src/plugins/text/highlight/highlightMark.cjs +13 -0
- package/dist/production/src/plugins/text/highlight/highlightMark.cjs.map +1 -0
- package/dist/production/src/plugins/text/highlight/highlightMark.js.map +1 -0
- package/dist/production/src/plugins/text/highlight/withHighlight.cjs.map +1 -0
- package/dist/production/src/plugins/text/highlight/withHighlight.js.map +1 -0
- package/dist/production/src/plugins/text/italic/italicMark.cjs +13 -0
- package/dist/production/src/plugins/text/italic/italicMark.cjs.map +1 -0
- package/dist/production/src/plugins/text/italic/italicMark.js.map +1 -0
- package/dist/production/src/plugins/text/italic/withItalic.cjs.map +1 -0
- package/dist/production/src/plugins/text/italic/withItalic.js.map +1 -0
- package/dist/production/src/plugins/text/newline/withNewline.cjs.map +1 -0
- package/dist/production/src/plugins/text/newline/withNewline.js.map +1 -0
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.cjs +13 -0
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -0
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -0
- package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -0
- package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -0
- package/dist/production/src/plugins/text/underline/underlineMark.cjs +13 -0
- package/dist/production/src/plugins/text/underline/underlineMark.cjs.map +1 -0
- package/dist/production/src/plugins/text/underline/underlineMark.js.map +1 -0
- package/dist/production/src/plugins/text/underline/withUnderline.cjs.map +1 -0
- package/dist/production/src/plugins/text/underline/withUnderline.js.map +1 -0
- package/dist/production/src/slate-reexport.cjs.map +1 -0
- package/dist/production/src/slate-reexport.js.map +1 -0
- package/dist/types/editor/createEditor.d.ts +1 -1
- package/dist/types/editor/createEditor.d.ts.map +1 -1
- package/dist/types/editor/index.d.ts +28 -28
- package/dist/types/editor/index.d.ts.map +1 -1
- package/dist/types/editor/methods/addMarks.d.ts +2 -1
- package/dist/types/editor/methods/addMarks.d.ts.map +1 -1
- package/dist/types/editor/methods/canToggleMark.d.ts +2 -1
- package/dist/types/editor/methods/canToggleMark.d.ts.map +1 -1
- package/dist/types/editor/methods/closest.d.ts +2 -2
- package/dist/types/editor/methods/closest.d.ts.map +1 -1
- package/dist/types/editor/methods/closestBlockEntry.d.ts +2 -2
- package/dist/types/editor/methods/closestBlockEntry.d.ts.map +1 -1
- package/dist/types/editor/methods/closestViableBlockContainerEntry.d.ts +1 -1
- package/dist/types/editor/methods/closestViableBlockContainerEntry.d.ts.map +1 -1
- package/dist/types/editor/methods/ejectElement.d.ts +2 -2
- package/dist/types/editor/methods/ejectElement.d.ts.map +1 -1
- package/dist/types/editor/methods/elementToSpecifics.d.ts +2 -1
- package/dist/types/editor/methods/elementToSpecifics.d.ts.map +1 -1
- package/dist/types/editor/methods/getElementDataAttributes.d.ts +2 -1
- package/dist/types/editor/methods/getElementDataAttributes.d.ts.map +1 -1
- package/dist/types/editor/methods/getPreviousSibling.d.ts +2 -2
- package/dist/types/editor/methods/getPreviousSibling.d.ts.map +1 -1
- package/dist/types/editor/methods/hasMarks.d.ts +2 -2
- package/dist/types/editor/methods/hasMarks.d.ts.map +1 -1
- package/dist/types/editor/methods/hasParentOfType.d.ts +2 -2
- package/dist/types/editor/methods/hasParentOfType.d.ts.map +1 -1
- package/dist/types/editor/methods/isElementType.d.ts +2 -2
- package/dist/types/editor/methods/isElementType.d.ts.map +1 -1
- package/dist/types/editor/methods/permissivelyDeserializeNodes.d.ts +2 -2
- package/dist/types/editor/methods/permissivelyDeserializeNodes.d.ts.map +1 -1
- package/dist/types/editor/methods/removeMarks.d.ts +2 -1
- package/dist/types/editor/methods/removeMarks.d.ts.map +1 -1
- package/dist/types/editor/methods/serializeNodes.d.ts +2 -2
- package/dist/types/editor/methods/serializeNodes.d.ts.map +1 -1
- package/dist/types/editor/methods/strictlyDeserializeNodes.d.ts +2 -2
- package/dist/types/editor/methods/strictlyDeserializeNodes.d.ts.map +1 -1
- package/dist/types/editor/methods/textToSpecifics.d.ts +2 -1
- package/dist/types/editor/methods/textToSpecifics.d.ts.map +1 -1
- package/dist/types/editor/methods/toLatestFormat.d.ts +2 -1
- package/dist/types/editor/methods/toLatestFormat.d.ts.map +1 -1
- package/dist/types/editor/methods/topLevelNodes.d.ts +2 -1
- package/dist/types/editor/methods/topLevelNodes.d.ts.map +1 -1
- package/dist/types/internal/utils/EditorPasteUtils.d.ts.map +1 -1
- package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts +1 -1
- package/dist/types/plugins/element/anchors/AnchorElement.d.ts.map +1 -1
- package/dist/types/plugins/element/anchors/withAnchors.d.ts +2 -1
- package/dist/types/plugins/element/anchors/withAnchors.d.ts.map +1 -1
- package/dist/types/plugins/element/headings/HeadingElement.d.ts.map +1 -1
- package/dist/types/plugins/element/headings/withHeadings.d.ts +2 -1
- package/dist/types/plugins/element/headings/withHeadings.d.ts.map +1 -1
- package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts.map +1 -1
- package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts +2 -1
- package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/ListElement.d.ts +1 -1
- package/dist/types/plugins/element/lists/ListElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/ListItemElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/OrderedListElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/UnorderedListElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/transforms/dedentListItem.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts +1 -1
- package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/withLists.d.ts +2 -1
- package/dist/types/plugins/element/lists/withLists.d.ts.map +1 -1
- package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts.map +1 -1
- package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts +2 -1
- package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts.map +1 -1
- package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts.map +1 -1
- package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts +2 -1
- package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableCellElement.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableElement.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableElementSelection.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableRowElement.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/withTables.d.ts +2 -1
- package/dist/types/plugins/element/tables/withTables.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/editor.d.ts.map +1 -1
- package/dist/types/types/htmlDeserializer.d.ts.map +1 -1
- package/dist/types/types/plugins.d.ts +1 -2
- package/dist/types/types/plugins.d.ts.map +1 -1
- package/package.json +11 -19
- package/src/components/RichTextEditor.tsx +6 -6
- package/src/editor/createEditor.ts +2 -2
- package/src/editor/createEditorWithEssentials.tsx +2 -2
- package/src/internal/hooks/useRichTextFieldNodes.ts +6 -6
- package/src/internal/utils/EditorPasteUtils.ts +36 -36
- package/src/plugins/behaviour/paste/HtmlDeserializer.ts +1 -1
- package/src/plugins/element/lists/transforms/normalizeListElement.ts +1 -1
- package/src/plugins/element/tables/TableModifications.ts +3 -3
- package/src/tsconfig.json +0 -1
- package/src/types/editor.ts +1 -1
- package/src/types/htmlDeserializer.ts +14 -14
- package/src/types/plugins.ts +8 -9
- package/tsconfig.json +7 -0
- package/tsdoc.json +6 -0
- package/dist/development/components/RichTextEditor.cjs +0 -93
- package/dist/development/components/RichTextEditor.cjs.map +0 -1
- package/dist/development/components/RichTextEditor.js +0 -93
- package/dist/development/components/RichTextEditor.js.map +0 -1
- package/dist/development/components/triggers/EditorElementTrigger.cjs.map +0 -1
- package/dist/development/components/triggers/EditorElementTrigger.js.map +0 -1
- package/dist/development/components/triggers/EditorGenericTrigger.cjs.map +0 -1
- package/dist/development/components/triggers/EditorGenericTrigger.js.map +0 -1
- package/dist/development/components/triggers/EditorMarkTrigger.cjs.map +0 -1
- package/dist/development/components/triggers/EditorMarkTrigger.js.map +0 -1
- package/dist/development/components/triggers/EditorWrapNodeTrigger.cjs.map +0 -1
- package/dist/development/components/triggers/EditorWrapNodeTrigger.js.map +0 -1
- package/dist/development/editor/createEditor.cjs +0 -35
- package/dist/development/editor/createEditor.cjs.map +0 -1
- package/dist/development/editor/createEditor.js.map +0 -1
- package/dist/development/editor/createEditorWithEssentials.cjs +0 -227
- package/dist/development/editor/createEditorWithEssentials.cjs.map +0 -1
- package/dist/development/editor/createEditorWithEssentials.js.map +0 -1
- package/dist/development/editor/index.cjs.map +0 -1
- package/dist/development/editor/index.js.map +0 -1
- package/dist/development/editor/methods/addMarks.cjs.map +0 -1
- package/dist/development/editor/methods/addMarks.js.map +0 -1
- package/dist/development/editor/methods/canToggleMark.cjs.map +0 -1
- package/dist/development/editor/methods/canToggleMark.js.map +0 -1
- package/dist/development/editor/methods/closest.cjs.map +0 -1
- package/dist/development/editor/methods/closest.js.map +0 -1
- package/dist/development/editor/methods/closestBlockEntry.cjs.map +0 -1
- package/dist/development/editor/methods/closestBlockEntry.js.map +0 -1
- package/dist/development/editor/methods/closestViableBlockContainerEntry.cjs.map +0 -1
- package/dist/development/editor/methods/closestViableBlockContainerEntry.js.map +0 -1
- package/dist/development/editor/methods/ejectElement.cjs.map +0 -1
- package/dist/development/editor/methods/ejectElement.js.map +0 -1
- package/dist/development/editor/methods/elementToSpecifics.cjs.map +0 -1
- package/dist/development/editor/methods/elementToSpecifics.js.map +0 -1
- package/dist/development/editor/methods/getElementDataAttributes.cjs.map +0 -1
- package/dist/development/editor/methods/getElementDataAttributes.js.map +0 -1
- package/dist/development/editor/methods/getPreviousSibling.cjs.map +0 -1
- package/dist/development/editor/methods/getPreviousSibling.js.map +0 -1
- package/dist/development/editor/methods/hasMarks.cjs.map +0 -1
- package/dist/development/editor/methods/hasMarks.js.map +0 -1
- package/dist/development/editor/methods/hasParentOfType.cjs.map +0 -1
- package/dist/development/editor/methods/hasParentOfType.js.map +0 -1
- package/dist/development/editor/methods/isElementType.cjs.map +0 -1
- package/dist/development/editor/methods/isElementType.js.map +0 -1
- package/dist/development/editor/methods/permissivelyDeserializeNodes.cjs.map +0 -1
- package/dist/development/editor/methods/permissivelyDeserializeNodes.js.map +0 -1
- package/dist/development/editor/methods/removeMarks.cjs.map +0 -1
- package/dist/development/editor/methods/removeMarks.js.map +0 -1
- package/dist/development/editor/methods/serializeNodes.cjs.map +0 -1
- package/dist/development/editor/methods/serializeNodes.js.map +0 -1
- package/dist/development/editor/methods/strictlyDeserializeNodes.cjs.map +0 -1
- package/dist/development/editor/methods/strictlyDeserializeNodes.js.map +0 -1
- package/dist/development/editor/methods/textToSpecifics.cjs.map +0 -1
- package/dist/development/editor/methods/textToSpecifics.js.map +0 -1
- package/dist/development/editor/methods/toLatestFormat.cjs.map +0 -1
- package/dist/development/editor/methods/toLatestFormat.js.map +0 -1
- package/dist/development/editor/methods/topLevelNodes.cjs.map +0 -1
- package/dist/development/editor/methods/topLevelNodes.js.map +0 -1
- package/dist/development/internal/components/DefaultElement.cjs +0 -11
- package/dist/development/internal/components/DefaultElement.cjs.map +0 -1
- package/dist/development/internal/components/DefaultElement.js.map +0 -1
- package/dist/development/internal/hooks/useRichTextFieldNodes.cjs.map +0 -1
- package/dist/development/internal/hooks/useRichTextFieldNodes.js.map +0 -1
- package/dist/development/internal/utils/EditorPasteUtils.cjs.map +0 -1
- package/dist/development/internal/utils/EditorPasteUtils.js.map +0 -1
- package/dist/development/internal/utils/parseUrl.cjs.map +0 -1
- package/dist/development/internal/utils/parseUrl.js.map +0 -1
- package/dist/development/plugins/attributes/alignment/alignButton.cjs.map +0 -1
- package/dist/development/plugins/attributes/alignment/alignButton.js.map +0 -1
- package/dist/development/plugins/behaviour/paste/HtmlDeserializer.cjs.map +0 -1
- package/dist/development/plugins/behaviour/paste/HtmlDeserializer.js.map +0 -1
- package/dist/development/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +0 -1
- package/dist/development/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +0 -1
- package/dist/development/plugins/behaviour/paste/withPaste.cjs.map +0 -1
- package/dist/development/plugins/behaviour/paste/withPaste.js.map +0 -1
- package/dist/development/plugins/element/anchors/AnchorElement.cjs.map +0 -1
- package/dist/development/plugins/element/anchors/AnchorElement.js.map +0 -1
- package/dist/development/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +0 -1
- package/dist/development/plugins/element/anchors/AnchorHtmlDeserializer.js.map +0 -1
- package/dist/development/plugins/element/anchors/AnchorModifications.cjs.map +0 -1
- package/dist/development/plugins/element/anchors/AnchorModifications.js.map +0 -1
- package/dist/development/plugins/element/anchors/withAnchors.cjs.map +0 -1
- package/dist/development/plugins/element/anchors/withAnchors.js.map +0 -1
- package/dist/development/plugins/element/headings/HeadingElement.cjs.map +0 -1
- package/dist/development/plugins/element/headings/HeadingElement.js.map +0 -1
- package/dist/development/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +0 -1
- package/dist/development/plugins/element/headings/HeadingHtmlDeserializer.js.map +0 -1
- package/dist/development/plugins/element/headings/withHeadings.cjs.map +0 -1
- package/dist/development/plugins/element/headings/withHeadings.js.map +0 -1
- package/dist/development/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +0 -1
- package/dist/development/plugins/element/horizonalRules/HorizontalRuleElement.js.map +0 -1
- package/dist/development/plugins/element/horizonalRules/withHorizontalRules.cjs.map +0 -1
- package/dist/development/plugins/element/horizonalRules/withHorizontalRules.js.map +0 -1
- package/dist/development/plugins/element/lists/ListElement.cjs.map +0 -1
- package/dist/development/plugins/element/lists/ListElement.js.map +0 -1
- package/dist/development/plugins/element/lists/ListHtmlDeserializer.cjs.map +0 -1
- package/dist/development/plugins/element/lists/ListHtmlDeserializer.js.map +0 -1
- package/dist/development/plugins/element/lists/ListItemElement.cjs.map +0 -1
- package/dist/development/plugins/element/lists/ListItemElement.js.map +0 -1
- package/dist/development/plugins/element/lists/OrderedListElement.cjs.map +0 -1
- package/dist/development/plugins/element/lists/OrderedListElement.js.map +0 -1
- package/dist/development/plugins/element/lists/UnorderedListElement.cjs.map +0 -1
- package/dist/development/plugins/element/lists/UnorderedListElement.js.map +0 -1
- package/dist/development/plugins/element/lists/transforms/dedentListItem.cjs.map +0 -1
- package/dist/development/plugins/element/lists/transforms/dedentListItem.js.map +0 -1
- package/dist/development/plugins/element/lists/transforms/indentListItem.cjs.map +0 -1
- package/dist/development/plugins/element/lists/transforms/indentListItem.js.map +0 -1
- package/dist/development/plugins/element/lists/transforms/normalizeListElement.cjs.map +0 -1
- package/dist/development/plugins/element/lists/transforms/normalizeListElement.js.map +0 -1
- package/dist/development/plugins/element/lists/transforms/toggleListElement.cjs.map +0 -1
- package/dist/development/plugins/element/lists/transforms/toggleListElement.js.map +0 -1
- package/dist/development/plugins/element/lists/withLists.cjs.map +0 -1
- package/dist/development/plugins/element/lists/withLists.js.map +0 -1
- package/dist/development/plugins/element/paragraphs/ParagraphElement.cjs.map +0 -1
- package/dist/development/plugins/element/paragraphs/ParagraphElement.js.map +0 -1
- package/dist/development/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +0 -1
- package/dist/development/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +0 -1
- package/dist/development/plugins/element/paragraphs/withParagraphs.cjs.map +0 -1
- package/dist/development/plugins/element/paragraphs/withParagraphs.js.map +0 -1
- package/dist/development/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +0 -1
- package/dist/development/plugins/element/scrollTargets/ScrollTargetElement.js.map +0 -1
- package/dist/development/plugins/element/scrollTargets/withScrollTargets.cjs.map +0 -1
- package/dist/development/plugins/element/scrollTargets/withScrollTargets.js.map +0 -1
- package/dist/development/plugins/element/tables/TableCellElement.cjs.map +0 -1
- package/dist/development/plugins/element/tables/TableCellElement.js.map +0 -1
- package/dist/development/plugins/element/tables/TableElement.cjs.map +0 -1
- package/dist/development/plugins/element/tables/TableElement.js.map +0 -1
- package/dist/development/plugins/element/tables/TableElementSelection.cjs.map +0 -1
- package/dist/development/plugins/element/tables/TableElementSelection.js.map +0 -1
- package/dist/development/plugins/element/tables/TableModifications.cjs +0 -134
- package/dist/development/plugins/element/tables/TableModifications.cjs.map +0 -1
- package/dist/development/plugins/element/tables/TableModifications.js +0 -134
- package/dist/development/plugins/element/tables/TableModifications.js.map +0 -1
- package/dist/development/plugins/element/tables/TableRowElement.cjs.map +0 -1
- package/dist/development/plugins/element/tables/TableRowElement.js.map +0 -1
- package/dist/development/plugins/element/tables/gaugeTableColumnCount.cjs.map +0 -1
- package/dist/development/plugins/element/tables/gaugeTableColumnCount.js.map +0 -1
- package/dist/development/plugins/element/tables/withTables.cjs.map +0 -1
- package/dist/development/plugins/element/tables/withTables.js.map +0 -1
- package/dist/development/plugins/text/bold/boldMark.cjs +0 -13
- package/dist/development/plugins/text/bold/boldMark.cjs.map +0 -1
- package/dist/development/plugins/text/bold/boldMark.js.map +0 -1
- package/dist/development/plugins/text/bold/withBold.cjs.map +0 -1
- package/dist/development/plugins/text/bold/withBold.js.map +0 -1
- package/dist/development/plugins/text/code/codeMark.cjs +0 -13
- package/dist/development/plugins/text/code/codeMark.cjs.map +0 -1
- package/dist/development/plugins/text/code/codeMark.js.map +0 -1
- package/dist/development/plugins/text/code/withCode.cjs.map +0 -1
- package/dist/development/plugins/text/code/withCode.js.map +0 -1
- package/dist/development/plugins/text/highlight/highlightMark.cjs +0 -13
- package/dist/development/plugins/text/highlight/highlightMark.cjs.map +0 -1
- package/dist/development/plugins/text/highlight/highlightMark.js.map +0 -1
- package/dist/development/plugins/text/highlight/withHighlight.cjs.map +0 -1
- package/dist/development/plugins/text/highlight/withHighlight.js.map +0 -1
- package/dist/development/plugins/text/italic/italicMark.cjs +0 -13
- package/dist/development/plugins/text/italic/italicMark.cjs.map +0 -1
- package/dist/development/plugins/text/italic/italicMark.js.map +0 -1
- package/dist/development/plugins/text/italic/withItalic.cjs.map +0 -1
- package/dist/development/plugins/text/italic/withItalic.js.map +0 -1
- package/dist/development/plugins/text/newline/withNewline.cjs.map +0 -1
- package/dist/development/plugins/text/newline/withNewline.js.map +0 -1
- package/dist/development/plugins/text/strikeThrough/strikeThroughMark.cjs +0 -13
- package/dist/development/plugins/text/strikeThrough/strikeThroughMark.cjs.map +0 -1
- package/dist/development/plugins/text/strikeThrough/strikeThroughMark.js.map +0 -1
- package/dist/development/plugins/text/strikeThrough/withStrikeThrough.cjs.map +0 -1
- package/dist/development/plugins/text/strikeThrough/withStrikeThrough.js.map +0 -1
- package/dist/development/plugins/text/underline/underlineMark.cjs +0 -13
- package/dist/development/plugins/text/underline/underlineMark.cjs.map +0 -1
- package/dist/development/plugins/text/underline/underlineMark.js.map +0 -1
- package/dist/development/plugins/text/underline/withUnderline.cjs.map +0 -1
- package/dist/development/plugins/text/underline/withUnderline.js.map +0 -1
- package/dist/development/slate-reexport.cjs.map +0 -1
- package/dist/development/slate-reexport.js.map +0 -1
- package/dist/production/components/RichTextEditor.cjs +0 -93
- package/dist/production/components/RichTextEditor.cjs.map +0 -1
- package/dist/production/components/RichTextEditor.js +0 -93
- package/dist/production/components/RichTextEditor.js.map +0 -1
- package/dist/production/components/triggers/EditorElementTrigger.cjs +0 -16
- package/dist/production/components/triggers/EditorElementTrigger.cjs.map +0 -1
- package/dist/production/components/triggers/EditorElementTrigger.js +0 -16
- package/dist/production/components/triggers/EditorElementTrigger.js.map +0 -1
- package/dist/production/components/triggers/EditorGenericTrigger.cjs +0 -20
- package/dist/production/components/triggers/EditorGenericTrigger.cjs.map +0 -1
- package/dist/production/components/triggers/EditorGenericTrigger.js +0 -20
- package/dist/production/components/triggers/EditorGenericTrigger.js.map +0 -1
- package/dist/production/components/triggers/EditorMarkTrigger.cjs +0 -16
- package/dist/production/components/triggers/EditorMarkTrigger.cjs.map +0 -1
- package/dist/production/components/triggers/EditorMarkTrigger.js +0 -16
- package/dist/production/components/triggers/EditorMarkTrigger.js.map +0 -1
- package/dist/production/components/triggers/EditorWrapNodeTrigger.cjs +0 -28
- package/dist/production/components/triggers/EditorWrapNodeTrigger.cjs.map +0 -1
- package/dist/production/components/triggers/EditorWrapNodeTrigger.js +0 -28
- package/dist/production/components/triggers/EditorWrapNodeTrigger.js.map +0 -1
- package/dist/production/editor/createEditor.cjs +0 -35
- package/dist/production/editor/createEditor.cjs.map +0 -1
- package/dist/production/editor/createEditor.js.map +0 -1
- package/dist/production/editor/createEditorWithEssentials.cjs +0 -227
- package/dist/production/editor/createEditorWithEssentials.cjs.map +0 -1
- package/dist/production/editor/createEditorWithEssentials.js.map +0 -1
- package/dist/production/editor/index.cjs.map +0 -1
- package/dist/production/editor/index.js.map +0 -1
- package/dist/production/editor/methods/addMarks.cjs.map +0 -1
- package/dist/production/editor/methods/addMarks.js.map +0 -1
- package/dist/production/editor/methods/canToggleMark.cjs.map +0 -1
- package/dist/production/editor/methods/canToggleMark.js.map +0 -1
- package/dist/production/editor/methods/closest.cjs.map +0 -1
- package/dist/production/editor/methods/closest.js.map +0 -1
- package/dist/production/editor/methods/closestBlockEntry.cjs.map +0 -1
- package/dist/production/editor/methods/closestBlockEntry.js.map +0 -1
- package/dist/production/editor/methods/closestViableBlockContainerEntry.cjs.map +0 -1
- package/dist/production/editor/methods/closestViableBlockContainerEntry.js.map +0 -1
- package/dist/production/editor/methods/ejectElement.cjs.map +0 -1
- package/dist/production/editor/methods/ejectElement.js.map +0 -1
- package/dist/production/editor/methods/elementToSpecifics.cjs.map +0 -1
- package/dist/production/editor/methods/elementToSpecifics.js.map +0 -1
- package/dist/production/editor/methods/getElementDataAttributes.cjs.map +0 -1
- package/dist/production/editor/methods/getElementDataAttributes.js.map +0 -1
- package/dist/production/editor/methods/getPreviousSibling.cjs.map +0 -1
- package/dist/production/editor/methods/getPreviousSibling.js.map +0 -1
- package/dist/production/editor/methods/hasMarks.cjs.map +0 -1
- package/dist/production/editor/methods/hasMarks.js.map +0 -1
- package/dist/production/editor/methods/hasParentOfType.cjs.map +0 -1
- package/dist/production/editor/methods/hasParentOfType.js.map +0 -1
- package/dist/production/editor/methods/isElementType.cjs.map +0 -1
- package/dist/production/editor/methods/isElementType.js.map +0 -1
- package/dist/production/editor/methods/permissivelyDeserializeNodes.cjs.map +0 -1
- package/dist/production/editor/methods/permissivelyDeserializeNodes.js.map +0 -1
- package/dist/production/editor/methods/removeMarks.cjs.map +0 -1
- package/dist/production/editor/methods/removeMarks.js.map +0 -1
- package/dist/production/editor/methods/serializeNodes.cjs.map +0 -1
- package/dist/production/editor/methods/serializeNodes.js.map +0 -1
- package/dist/production/editor/methods/strictlyDeserializeNodes.cjs.map +0 -1
- package/dist/production/editor/methods/strictlyDeserializeNodes.js.map +0 -1
- package/dist/production/editor/methods/textToSpecifics.cjs.map +0 -1
- package/dist/production/editor/methods/textToSpecifics.js.map +0 -1
- package/dist/production/editor/methods/toLatestFormat.cjs.map +0 -1
- package/dist/production/editor/methods/toLatestFormat.js.map +0 -1
- package/dist/production/editor/methods/topLevelNodes.cjs.map +0 -1
- package/dist/production/editor/methods/topLevelNodes.js.map +0 -1
- package/dist/production/internal/components/DefaultElement.cjs +0 -11
- package/dist/production/internal/components/DefaultElement.cjs.map +0 -1
- package/dist/production/internal/components/DefaultElement.js.map +0 -1
- package/dist/production/internal/hooks/useRichTextFieldNodes.cjs.map +0 -1
- package/dist/production/internal/hooks/useRichTextFieldNodes.js.map +0 -1
- package/dist/production/internal/utils/EditorPasteUtils.cjs.map +0 -1
- package/dist/production/internal/utils/EditorPasteUtils.js.map +0 -1
- package/dist/production/internal/utils/parseUrl.cjs.map +0 -1
- package/dist/production/internal/utils/parseUrl.js.map +0 -1
- package/dist/production/plugins/attributes/alignment/alignButton.cjs.map +0 -1
- package/dist/production/plugins/attributes/alignment/alignButton.js.map +0 -1
- package/dist/production/plugins/behaviour/paste/HtmlDeserializer.cjs.map +0 -1
- package/dist/production/plugins/behaviour/paste/HtmlDeserializer.js.map +0 -1
- package/dist/production/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +0 -1
- package/dist/production/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +0 -1
- package/dist/production/plugins/behaviour/paste/withPaste.cjs.map +0 -1
- package/dist/production/plugins/behaviour/paste/withPaste.js.map +0 -1
- package/dist/production/plugins/element/anchors/AnchorElement.cjs.map +0 -1
- package/dist/production/plugins/element/anchors/AnchorElement.js.map +0 -1
- package/dist/production/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +0 -1
- package/dist/production/plugins/element/anchors/AnchorHtmlDeserializer.js.map +0 -1
- package/dist/production/plugins/element/anchors/AnchorModifications.cjs.map +0 -1
- package/dist/production/plugins/element/anchors/AnchorModifications.js.map +0 -1
- package/dist/production/plugins/element/anchors/withAnchors.cjs.map +0 -1
- package/dist/production/plugins/element/anchors/withAnchors.js.map +0 -1
- package/dist/production/plugins/element/headings/HeadingElement.cjs.map +0 -1
- package/dist/production/plugins/element/headings/HeadingElement.js.map +0 -1
- package/dist/production/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +0 -1
- package/dist/production/plugins/element/headings/HeadingHtmlDeserializer.js.map +0 -1
- package/dist/production/plugins/element/headings/withHeadings.cjs.map +0 -1
- package/dist/production/plugins/element/headings/withHeadings.js.map +0 -1
- package/dist/production/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +0 -1
- package/dist/production/plugins/element/horizonalRules/HorizontalRuleElement.js.map +0 -1
- package/dist/production/plugins/element/horizonalRules/withHorizontalRules.cjs.map +0 -1
- package/dist/production/plugins/element/horizonalRules/withHorizontalRules.js.map +0 -1
- package/dist/production/plugins/element/lists/ListElement.cjs.map +0 -1
- package/dist/production/plugins/element/lists/ListElement.js.map +0 -1
- package/dist/production/plugins/element/lists/ListHtmlDeserializer.cjs.map +0 -1
- package/dist/production/plugins/element/lists/ListHtmlDeserializer.js.map +0 -1
- package/dist/production/plugins/element/lists/ListItemElement.cjs.map +0 -1
- package/dist/production/plugins/element/lists/ListItemElement.js.map +0 -1
- package/dist/production/plugins/element/lists/OrderedListElement.cjs.map +0 -1
- package/dist/production/plugins/element/lists/OrderedListElement.js.map +0 -1
- package/dist/production/plugins/element/lists/UnorderedListElement.cjs.map +0 -1
- package/dist/production/plugins/element/lists/UnorderedListElement.js.map +0 -1
- package/dist/production/plugins/element/lists/transforms/dedentListItem.cjs.map +0 -1
- package/dist/production/plugins/element/lists/transforms/dedentListItem.js.map +0 -1
- package/dist/production/plugins/element/lists/transforms/indentListItem.cjs.map +0 -1
- package/dist/production/plugins/element/lists/transforms/indentListItem.js.map +0 -1
- package/dist/production/plugins/element/lists/transforms/normalizeListElement.cjs.map +0 -1
- package/dist/production/plugins/element/lists/transforms/normalizeListElement.js.map +0 -1
- package/dist/production/plugins/element/lists/transforms/toggleListElement.cjs.map +0 -1
- package/dist/production/plugins/element/lists/transforms/toggleListElement.js.map +0 -1
- package/dist/production/plugins/element/lists/withLists.cjs.map +0 -1
- package/dist/production/plugins/element/lists/withLists.js.map +0 -1
- package/dist/production/plugins/element/paragraphs/ParagraphElement.cjs.map +0 -1
- package/dist/production/plugins/element/paragraphs/ParagraphElement.js.map +0 -1
- package/dist/production/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +0 -1
- package/dist/production/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +0 -1
- package/dist/production/plugins/element/paragraphs/withParagraphs.cjs.map +0 -1
- package/dist/production/plugins/element/paragraphs/withParagraphs.js.map +0 -1
- package/dist/production/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +0 -1
- package/dist/production/plugins/element/scrollTargets/ScrollTargetElement.js.map +0 -1
- package/dist/production/plugins/element/scrollTargets/withScrollTargets.cjs.map +0 -1
- package/dist/production/plugins/element/scrollTargets/withScrollTargets.js.map +0 -1
- package/dist/production/plugins/element/tables/TableCellElement.cjs.map +0 -1
- package/dist/production/plugins/element/tables/TableCellElement.js.map +0 -1
- package/dist/production/plugins/element/tables/TableElement.cjs.map +0 -1
- package/dist/production/plugins/element/tables/TableElement.js.map +0 -1
- package/dist/production/plugins/element/tables/TableElementSelection.cjs.map +0 -1
- package/dist/production/plugins/element/tables/TableElementSelection.js.map +0 -1
- package/dist/production/plugins/element/tables/TableModifications.cjs +0 -134
- package/dist/production/plugins/element/tables/TableModifications.cjs.map +0 -1
- package/dist/production/plugins/element/tables/TableModifications.js +0 -134
- package/dist/production/plugins/element/tables/TableModifications.js.map +0 -1
- package/dist/production/plugins/element/tables/TableRowElement.cjs.map +0 -1
- package/dist/production/plugins/element/tables/TableRowElement.js.map +0 -1
- package/dist/production/plugins/element/tables/gaugeTableColumnCount.cjs.map +0 -1
- package/dist/production/plugins/element/tables/gaugeTableColumnCount.js.map +0 -1
- package/dist/production/plugins/element/tables/withTables.cjs.map +0 -1
- package/dist/production/plugins/element/tables/withTables.js.map +0 -1
- package/dist/production/plugins/text/bold/boldMark.cjs +0 -13
- package/dist/production/plugins/text/bold/boldMark.cjs.map +0 -1
- package/dist/production/plugins/text/bold/boldMark.js.map +0 -1
- package/dist/production/plugins/text/bold/withBold.cjs.map +0 -1
- package/dist/production/plugins/text/bold/withBold.js.map +0 -1
- package/dist/production/plugins/text/code/codeMark.cjs +0 -13
- package/dist/production/plugins/text/code/codeMark.cjs.map +0 -1
- package/dist/production/plugins/text/code/codeMark.js.map +0 -1
- package/dist/production/plugins/text/code/withCode.cjs.map +0 -1
- package/dist/production/plugins/text/code/withCode.js.map +0 -1
- package/dist/production/plugins/text/highlight/highlightMark.cjs +0 -13
- package/dist/production/plugins/text/highlight/highlightMark.cjs.map +0 -1
- package/dist/production/plugins/text/highlight/highlightMark.js.map +0 -1
- package/dist/production/plugins/text/highlight/withHighlight.cjs.map +0 -1
- package/dist/production/plugins/text/highlight/withHighlight.js.map +0 -1
- package/dist/production/plugins/text/italic/italicMark.cjs +0 -13
- package/dist/production/plugins/text/italic/italicMark.cjs.map +0 -1
- package/dist/production/plugins/text/italic/italicMark.js.map +0 -1
- package/dist/production/plugins/text/italic/withItalic.cjs.map +0 -1
- package/dist/production/plugins/text/italic/withItalic.js.map +0 -1
- package/dist/production/plugins/text/newline/withNewline.cjs.map +0 -1
- package/dist/production/plugins/text/newline/withNewline.js.map +0 -1
- package/dist/production/plugins/text/strikeThrough/strikeThroughMark.cjs +0 -13
- package/dist/production/plugins/text/strikeThrough/strikeThroughMark.cjs.map +0 -1
- package/dist/production/plugins/text/strikeThrough/strikeThroughMark.js.map +0 -1
- package/dist/production/plugins/text/strikeThrough/withStrikeThrough.cjs.map +0 -1
- package/dist/production/plugins/text/strikeThrough/withStrikeThrough.js.map +0 -1
- package/dist/production/plugins/text/underline/underlineMark.cjs +0 -13
- package/dist/production/plugins/text/underline/underlineMark.cjs.map +0 -1
- package/dist/production/plugins/text/underline/underlineMark.js.map +0 -1
- package/dist/production/plugins/text/underline/withUnderline.cjs.map +0 -1
- package/dist/production/plugins/text/underline/withUnderline.js.map +0 -1
- package/dist/production/slate-reexport.cjs.map +0 -1
- package/dist/production/slate-reexport.js.map +0 -1
- /package/dist/development/{editor → src/editor}/createEditor.js +0 -0
- /package/dist/development/{editor → src/editor}/createEditorWithEssentials.js +0 -0
- /package/dist/development/{editor → src/editor}/index.cjs +0 -0
- /package/dist/development/{editor → src/editor}/index.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/addMarks.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/addMarks.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/canToggleMark.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/canToggleMark.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/closest.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/closest.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/closestBlockEntry.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/closestBlockEntry.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/closestViableBlockContainerEntry.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/closestViableBlockContainerEntry.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/ejectElement.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/ejectElement.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/elementToSpecifics.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/elementToSpecifics.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/getElementDataAttributes.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/getElementDataAttributes.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/getPreviousSibling.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/getPreviousSibling.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/hasMarks.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/hasMarks.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/hasParentOfType.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/hasParentOfType.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/isElementType.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/isElementType.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/permissivelyDeserializeNodes.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/permissivelyDeserializeNodes.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/removeMarks.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/removeMarks.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/serializeNodes.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/serializeNodes.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/strictlyDeserializeNodes.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/strictlyDeserializeNodes.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/textToSpecifics.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/textToSpecifics.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/toLatestFormat.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/toLatestFormat.js +0 -0
- /package/dist/development/{editor → src/editor}/methods/topLevelNodes.cjs +0 -0
- /package/dist/development/{editor → src/editor}/methods/topLevelNodes.js +0 -0
- /package/dist/development/{internal → src/internal}/components/DefaultElement.js +0 -0
- /package/dist/development/{internal → src/internal}/hooks/useRichTextFieldNodes.cjs +0 -0
- /package/dist/development/{internal → src/internal}/hooks/useRichTextFieldNodes.js +0 -0
- /package/dist/development/{internal → src/internal}/utils/EditorPasteUtils.cjs +0 -0
- /package/dist/development/{internal → src/internal}/utils/EditorPasteUtils.js +0 -0
- /package/dist/development/{internal → src/internal}/utils/parseUrl.cjs +0 -0
- /package/dist/development/{internal → src/internal}/utils/parseUrl.js +0 -0
- /package/dist/development/{plugins → src/plugins}/attributes/alignment/alignButton.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/attributes/alignment/alignButton.js +0 -0
- /package/dist/development/{plugins → src/plugins}/behaviour/paste/HtmlDeserializer.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/behaviour/paste/HtmlDeserializer.js +0 -0
- /package/dist/development/{plugins → src/plugins}/behaviour/paste/createMarkHtmlDeserializer.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/behaviour/paste/createMarkHtmlDeserializer.js +0 -0
- /package/dist/development/{plugins → src/plugins}/behaviour/paste/withPaste.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/behaviour/paste/withPaste.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/anchors/AnchorElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/anchors/AnchorElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/anchors/AnchorHtmlDeserializer.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/anchors/AnchorHtmlDeserializer.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/anchors/AnchorModifications.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/anchors/AnchorModifications.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/anchors/withAnchors.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/anchors/withAnchors.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/headings/HeadingElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/headings/HeadingElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/headings/HeadingHtmlDeserializer.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/headings/HeadingHtmlDeserializer.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/headings/withHeadings.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/headings/withHeadings.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/horizonalRules/HorizontalRuleElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/horizonalRules/HorizontalRuleElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/horizonalRules/withHorizontalRules.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/horizonalRules/withHorizontalRules.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/ListElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/ListElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/ListHtmlDeserializer.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/ListHtmlDeserializer.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/ListItemElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/ListItemElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/OrderedListElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/OrderedListElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/UnorderedListElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/UnorderedListElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/transforms/dedentListItem.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/transforms/dedentListItem.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/transforms/indentListItem.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/transforms/indentListItem.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/transforms/normalizeListElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/transforms/normalizeListElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/transforms/toggleListElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/transforms/toggleListElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/withLists.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/lists/withLists.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/paragraphs/ParagraphElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/paragraphs/ParagraphElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/paragraphs/ParagraphHtmlDeserializer.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/paragraphs/ParagraphHtmlDeserializer.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/paragraphs/withParagraphs.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/paragraphs/withParagraphs.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/scrollTargets/ScrollTargetElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/scrollTargets/ScrollTargetElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/scrollTargets/withScrollTargets.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/scrollTargets/withScrollTargets.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/TableCellElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/TableCellElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/TableElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/TableElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/TableElementSelection.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/TableElementSelection.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/TableRowElement.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/TableRowElement.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/gaugeTableColumnCount.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/gaugeTableColumnCount.js +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/withTables.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/element/tables/withTables.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/bold/boldMark.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/bold/withBold.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/text/bold/withBold.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/code/codeMark.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/code/withCode.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/text/code/withCode.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/highlight/highlightMark.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/highlight/withHighlight.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/text/highlight/withHighlight.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/italic/italicMark.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/italic/withItalic.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/text/italic/withItalic.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/newline/withNewline.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/text/newline/withNewline.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/strikeThrough/strikeThroughMark.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/strikeThrough/withStrikeThrough.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/text/strikeThrough/withStrikeThrough.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/underline/underlineMark.js +0 -0
- /package/dist/development/{plugins → src/plugins}/text/underline/withUnderline.cjs +0 -0
- /package/dist/development/{plugins → src/plugins}/text/underline/withUnderline.js +0 -0
- /package/dist/development/{slate-reexport.cjs → src/slate-reexport.cjs} +0 -0
- /package/dist/development/{slate-reexport.js → src/slate-reexport.js} +0 -0
- /package/dist/{development → production/src}/components/triggers/EditorElementTrigger.cjs +0 -0
- /package/dist/{development → production/src}/components/triggers/EditorElementTrigger.js +0 -0
- /package/dist/{development → production/src}/components/triggers/EditorGenericTrigger.cjs +0 -0
- /package/dist/{development → production/src}/components/triggers/EditorGenericTrigger.js +0 -0
- /package/dist/{development → production/src}/components/triggers/EditorMarkTrigger.cjs +0 -0
- /package/dist/{development → production/src}/components/triggers/EditorMarkTrigger.js +0 -0
- /package/dist/{development → production/src}/components/triggers/EditorWrapNodeTrigger.cjs +0 -0
- /package/dist/{development → production/src}/components/triggers/EditorWrapNodeTrigger.js +0 -0
- /package/dist/production/{editor → src/editor}/createEditor.js +0 -0
- /package/dist/production/{editor → src/editor}/createEditorWithEssentials.js +0 -0
- /package/dist/production/{editor → src/editor}/index.cjs +0 -0
- /package/dist/production/{editor → src/editor}/index.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/addMarks.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/addMarks.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/canToggleMark.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/canToggleMark.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/closest.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/closest.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/closestBlockEntry.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/closestBlockEntry.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/closestViableBlockContainerEntry.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/closestViableBlockContainerEntry.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/ejectElement.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/ejectElement.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/elementToSpecifics.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/elementToSpecifics.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/getElementDataAttributes.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/getElementDataAttributes.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/getPreviousSibling.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/getPreviousSibling.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/hasMarks.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/hasMarks.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/hasParentOfType.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/hasParentOfType.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/isElementType.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/isElementType.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/permissivelyDeserializeNodes.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/permissivelyDeserializeNodes.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/removeMarks.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/removeMarks.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/serializeNodes.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/serializeNodes.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/strictlyDeserializeNodes.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/strictlyDeserializeNodes.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/textToSpecifics.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/textToSpecifics.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/toLatestFormat.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/toLatestFormat.js +0 -0
- /package/dist/production/{editor → src/editor}/methods/topLevelNodes.cjs +0 -0
- /package/dist/production/{editor → src/editor}/methods/topLevelNodes.js +0 -0
- /package/dist/production/{internal → src/internal}/components/DefaultElement.js +0 -0
- /package/dist/production/{internal → src/internal}/hooks/useRichTextFieldNodes.cjs +0 -0
- /package/dist/production/{internal → src/internal}/hooks/useRichTextFieldNodes.js +0 -0
- /package/dist/production/{internal → src/internal}/utils/EditorPasteUtils.cjs +0 -0
- /package/dist/production/{internal → src/internal}/utils/EditorPasteUtils.js +0 -0
- /package/dist/production/{internal → src/internal}/utils/parseUrl.cjs +0 -0
- /package/dist/production/{internal → src/internal}/utils/parseUrl.js +0 -0
- /package/dist/production/{plugins → src/plugins}/attributes/alignment/alignButton.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/attributes/alignment/alignButton.js +0 -0
- /package/dist/production/{plugins → src/plugins}/behaviour/paste/HtmlDeserializer.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/behaviour/paste/HtmlDeserializer.js +0 -0
- /package/dist/production/{plugins → src/plugins}/behaviour/paste/createMarkHtmlDeserializer.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/behaviour/paste/createMarkHtmlDeserializer.js +0 -0
- /package/dist/production/{plugins → src/plugins}/behaviour/paste/withPaste.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/behaviour/paste/withPaste.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/anchors/AnchorElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/anchors/AnchorElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/anchors/AnchorHtmlDeserializer.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/anchors/AnchorHtmlDeserializer.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/anchors/AnchorModifications.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/anchors/AnchorModifications.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/anchors/withAnchors.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/anchors/withAnchors.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/headings/HeadingElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/headings/HeadingElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/headings/HeadingHtmlDeserializer.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/headings/HeadingHtmlDeserializer.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/headings/withHeadings.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/headings/withHeadings.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/horizonalRules/HorizontalRuleElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/horizonalRules/HorizontalRuleElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/horizonalRules/withHorizontalRules.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/horizonalRules/withHorizontalRules.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/ListElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/ListElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/ListHtmlDeserializer.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/ListHtmlDeserializer.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/ListItemElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/ListItemElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/OrderedListElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/OrderedListElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/UnorderedListElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/UnorderedListElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/transforms/dedentListItem.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/transforms/dedentListItem.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/transforms/indentListItem.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/transforms/indentListItem.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/transforms/normalizeListElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/transforms/normalizeListElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/transforms/toggleListElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/transforms/toggleListElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/withLists.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/lists/withLists.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/paragraphs/ParagraphElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/paragraphs/ParagraphElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/paragraphs/ParagraphHtmlDeserializer.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/paragraphs/ParagraphHtmlDeserializer.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/paragraphs/withParagraphs.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/paragraphs/withParagraphs.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/scrollTargets/ScrollTargetElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/scrollTargets/ScrollTargetElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/scrollTargets/withScrollTargets.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/scrollTargets/withScrollTargets.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/TableCellElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/TableCellElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/TableElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/TableElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/TableElementSelection.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/TableElementSelection.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/TableRowElement.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/TableRowElement.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/gaugeTableColumnCount.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/gaugeTableColumnCount.js +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/withTables.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/element/tables/withTables.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/bold/boldMark.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/bold/withBold.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/text/bold/withBold.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/code/codeMark.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/code/withCode.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/text/code/withCode.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/highlight/highlightMark.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/highlight/withHighlight.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/text/highlight/withHighlight.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/italic/italicMark.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/italic/withItalic.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/text/italic/withItalic.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/newline/withNewline.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/text/newline/withNewline.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/strikeThrough/strikeThroughMark.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/strikeThrough/withStrikeThrough.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/text/strikeThrough/withStrikeThrough.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/underline/underlineMark.js +0 -0
- /package/dist/production/{plugins → src/plugins}/text/underline/withUnderline.cjs +0 -0
- /package/dist/production/{plugins → src/plugins}/text/underline/withUnderline.js +0 -0
- /package/dist/production/{slate-reexport.cjs → src/slate-reexport.cjs} +0 -0
- /package/dist/production/{slate-reexport.js → src/slate-reexport.js} +0 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const Slate = require("slate");
|
|
5
|
+
const slateHistory = require("slate-history");
|
|
6
|
+
const slateReact = require("slate-react");
|
|
7
|
+
const DefaultElement = require("../internal/components/DefaultElement.cjs");
|
|
8
|
+
const index = require("./index.cjs");
|
|
9
|
+
const withPaste = require("../plugins/behaviour/paste/withPaste.cjs");
|
|
10
|
+
function _interopNamespaceDefault(e) {
|
|
11
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
if (k !== "default") {
|
|
15
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: () => e[k]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
const Slate__namespace = /* @__PURE__ */ _interopNamespaceDefault(Slate);
|
|
27
|
+
const createEditorWithEssentials = ({ defaultElementType }) => {
|
|
28
|
+
const underlyingEditor = slateHistory.withHistory(slateReact.withReact(Slate.createEditor()));
|
|
29
|
+
const editor = underlyingEditor;
|
|
30
|
+
const { normalizeNode, isInline, isVoid, deleteBackward } = editor;
|
|
31
|
+
const elements = /* @__PURE__ */ new Map();
|
|
32
|
+
const marks = /* @__PURE__ */ new Map();
|
|
33
|
+
Object.assign(editor, {
|
|
34
|
+
slate: Slate__namespace,
|
|
35
|
+
formatVersion: 1,
|
|
36
|
+
defaultElementType,
|
|
37
|
+
isDefaultElement: (element) => "type" in element && element.type === defaultElementType,
|
|
38
|
+
createDefaultElement: (children) => ({
|
|
39
|
+
type: defaultElementType,
|
|
40
|
+
children
|
|
41
|
+
}),
|
|
42
|
+
insertBetweenBlocks: ([element, path], edge) => {
|
|
43
|
+
const edgeOffset = edge === "before" ? 0 : 1;
|
|
44
|
+
const targetPath = path.slice(0, -1).concat(path[path.length - 1] + edgeOffset);
|
|
45
|
+
Slate.Transforms.insertNodes(editor, editor.createDefaultElement([{ text: "" }]), {
|
|
46
|
+
at: targetPath,
|
|
47
|
+
select: true
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
canToggleMarks: () => true,
|
|
51
|
+
canToggleElement: () => true,
|
|
52
|
+
hasMarks: (marks2) => index.ContemberEditor.hasMarks(editor, marks2),
|
|
53
|
+
// TODO in the following function, we need to conditionally trim the selection so that it doesn't potentially
|
|
54
|
+
// include empty strings at the edges of top-level elements.
|
|
55
|
+
isElementActive: (elementType, suchThat) => {
|
|
56
|
+
return elements.get(elementType)?.isActive?.({ editor, suchThat }) ?? Array.from(Slate.Editor.nodes(editor, {
|
|
57
|
+
match: (node) => Slate.Element.isElement(node) && index.ContemberEditor.isElementType(node, elementType, suchThat),
|
|
58
|
+
voids: false
|
|
59
|
+
})).length > 0;
|
|
60
|
+
},
|
|
61
|
+
acceptsAttributes: (elementType, suchThat) => {
|
|
62
|
+
return elements.get(elementType)?.acceptsAttributes?.({ editor, suchThat }) ?? false;
|
|
63
|
+
},
|
|
64
|
+
toggleMarks: (marks2) => {
|
|
65
|
+
if (!editor.canToggleMarks(marks2)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const isActive = editor.hasMarks(marks2);
|
|
69
|
+
if (isActive) {
|
|
70
|
+
index.ContemberEditor.removeMarks(editor, marks2);
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
index.ContemberEditor.addMarks(editor, marks2);
|
|
74
|
+
return true;
|
|
75
|
+
},
|
|
76
|
+
toggleElement: (elementType, suchThat) => {
|
|
77
|
+
elements.get(elementType)?.toggleElement?.({
|
|
78
|
+
editor,
|
|
79
|
+
suchThat
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
isInline: (element) => {
|
|
83
|
+
return elements.get(element.type)?.isInline ?? isInline(element);
|
|
84
|
+
},
|
|
85
|
+
isVoid: (element) => {
|
|
86
|
+
const elIsVoid = elements.get(element.type)?.isVoid;
|
|
87
|
+
if (elIsVoid === void 0) {
|
|
88
|
+
return isVoid(element);
|
|
89
|
+
}
|
|
90
|
+
if (typeof elIsVoid === "boolean") {
|
|
91
|
+
return elIsVoid;
|
|
92
|
+
}
|
|
93
|
+
return elIsVoid({ editor, element });
|
|
94
|
+
},
|
|
95
|
+
canContainAnyBlocks: (element) => {
|
|
96
|
+
if (Slate.Editor.isEditor(element)) {
|
|
97
|
+
return true;
|
|
98
|
+
}
|
|
99
|
+
return !editor.isInline(element) && !editor.isVoid(element) && (elements.has(element.type) ? elements.get(element.type).canContainAnyBlocks ?? false : true);
|
|
100
|
+
},
|
|
101
|
+
serializeNodes: (nodes, errorMessage) => index.ContemberEditor.serializeNodes(editor, nodes, errorMessage),
|
|
102
|
+
deserializeNodes: (serializedNodes, errorMessage) => index.ContemberEditor.permissivelyDeserializeNodes(editor, serializedNodes, errorMessage),
|
|
103
|
+
upgradeFormatBySingleVersion: (node, oldVersion) => {
|
|
104
|
+
if (Slate.Element.isElement(node)) {
|
|
105
|
+
return {
|
|
106
|
+
...node,
|
|
107
|
+
children: node.children.map((child) => editor.upgradeFormatBySingleVersion(child, oldVersion))
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return node;
|
|
111
|
+
},
|
|
112
|
+
renderElement: (props) => {
|
|
113
|
+
const component = elements.get(props.element.type)?.render ?? DefaultElement.DefaultElement;
|
|
114
|
+
return React.createElement(component, props);
|
|
115
|
+
},
|
|
116
|
+
renderLeafChildren: (props) => props.children,
|
|
117
|
+
renderLeaf: (props) => {
|
|
118
|
+
let el = React.createElement("span", props.attributes, editor.renderLeafChildren(props));
|
|
119
|
+
for (const [, mark] of marks) {
|
|
120
|
+
if (props.leaf[mark.type] === true) {
|
|
121
|
+
const markerEl = mark.render({ ...props, children: el });
|
|
122
|
+
if (markerEl !== null) {
|
|
123
|
+
if (!React.isValidElement(markerEl)) {
|
|
124
|
+
throw new Error(`Mark plugin ${mark.type} returned a non-React element`);
|
|
125
|
+
}
|
|
126
|
+
el = markerEl;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return el;
|
|
131
|
+
},
|
|
132
|
+
// Just noop functions so that other plugins can safely bubble-call
|
|
133
|
+
onDOMBeforeInput: () => {
|
|
134
|
+
},
|
|
135
|
+
onKeyDown: (e) => {
|
|
136
|
+
for (const [, mark] of marks) {
|
|
137
|
+
if (mark.isHotKey(e.nativeEvent)) {
|
|
138
|
+
editor.toggleMarks({ [mark.type]: true });
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (e.key !== "Delete" && e.key !== "Backspace") {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const selection = editor.selection;
|
|
147
|
+
if (selection && Slate.Range.isCollapsed(selection)) {
|
|
148
|
+
const voidEntry = Slate.Editor.void(editor, {
|
|
149
|
+
at: selection,
|
|
150
|
+
mode: "lowest",
|
|
151
|
+
voids: true
|
|
152
|
+
});
|
|
153
|
+
if (!voidEntry) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const [node, nodePath] = voidEntry;
|
|
157
|
+
if (editor.isInline(node)) {
|
|
158
|
+
const adjacentPoint = e.key === "Backspace" ? Slate.Editor.point(editor, Slate.Path.next(nodePath), {
|
|
159
|
+
edge: "start"
|
|
160
|
+
}) : Slate.Editor.point(editor, Slate.Path.previous(nodePath), {
|
|
161
|
+
edge: "end"
|
|
162
|
+
});
|
|
163
|
+
Slate.Transforms.select(editor, adjacentPoint);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
onFocus: () => {
|
|
168
|
+
},
|
|
169
|
+
onBlur: () => {
|
|
170
|
+
},
|
|
171
|
+
normalizeNode: ([node, path]) => {
|
|
172
|
+
if (Slate.Editor.isEditor(node) && node.children.length === 0) {
|
|
173
|
+
Slate.Transforms.insertNodes(editor, editor.createDefaultElement([{ text: "" }]));
|
|
174
|
+
}
|
|
175
|
+
if (!Slate.Element.isElement(node)) {
|
|
176
|
+
normalizeNode([node, path]);
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
let defaultPrevented = false;
|
|
180
|
+
elements.get(node.type)?.normalizeNode?.({
|
|
181
|
+
element: node,
|
|
182
|
+
path,
|
|
183
|
+
editor,
|
|
184
|
+
preventDefault: () => {
|
|
185
|
+
defaultPrevented = true;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
if (!defaultPrevented) {
|
|
189
|
+
normalizeNode([node, path]);
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
registerElement: (plugin) => {
|
|
193
|
+
elements.set(plugin.type, plugin);
|
|
194
|
+
},
|
|
195
|
+
registerMark: (plugin) => {
|
|
196
|
+
marks.set(plugin.type, plugin);
|
|
197
|
+
},
|
|
198
|
+
deleteBackward: (unit) => {
|
|
199
|
+
const selection = editor.selection;
|
|
200
|
+
if (selection && Slate.Range.isCollapsed(selection)) {
|
|
201
|
+
const [node, nodePath] = Slate.Editor.node(editor, [selection.focus.path[0]]);
|
|
202
|
+
if (Slate.Element.isElement(node) && Slate.Node.string(node) === "") {
|
|
203
|
+
const previous = Slate.Editor.previous(editor, {
|
|
204
|
+
at: nodePath,
|
|
205
|
+
voids: true
|
|
206
|
+
});
|
|
207
|
+
if (previous) {
|
|
208
|
+
const [previousNode] = previous;
|
|
209
|
+
if (Slate.Element.isElement(previousNode) && editor.isVoid(previousNode)) {
|
|
210
|
+
editor.apply({
|
|
211
|
+
type: "remove_node",
|
|
212
|
+
path: nodePath,
|
|
213
|
+
node
|
|
214
|
+
});
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
deleteBackward(unit);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
withPaste.withPaste(editor);
|
|
224
|
+
return editor;
|
|
225
|
+
};
|
|
226
|
+
exports.createEditorWithEssentials = createEditorWithEssentials;
|
|
227
|
+
//# sourceMappingURL=createEditorWithEssentials.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createEditorWithEssentials.cjs","sources":["../../../../../packages/react-slate-editor-base/src/editor/createEditorWithEssentials.tsx"],"sourcesContent":["import { createElement, isValidElement, ReactElement } from 'react'\nimport { createEditor, Descendant, Editor, Element as SlateElement, Node as SlateNode, Path, Range as SlateRange, Text as SlateText, Transforms } from 'slate'\nimport * as Slate from 'slate'\nimport { withHistory } from 'slate-history'\nimport { ReactEditor, withReact } from 'slate-react'\nimport { EditorElementPlugin, EditorMarkPlugin } from '../types/plugins'\nimport { TextSpecifics } from '../types/editor'\nimport { DefaultElement } from '../internal/components/DefaultElement'\nimport { withPaste } from '../plugins/behaviour'\nimport { ContemberEditor } from './index'\n\nexport const createEditorWithEssentials = ({ defaultElementType }: { defaultElementType: string }): Editor => {\n\tconst underlyingEditor = withHistory(withReact(createEditor() as ReactEditor))\n\n\tconst editor = underlyingEditor as unknown as Editor\n\tconst { normalizeNode, isInline, isVoid, deleteBackward } = editor\n\n\tconst elements = new Map<string, EditorElementPlugin<any>>()\n\tconst marks = new Map<string, EditorMarkPlugin>()\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tslate: Slate,\n\t\tformatVersion: 1,\n\t\tdefaultElementType,\n\t\tisDefaultElement: element => 'type' in element && (element as any).type === defaultElementType,\n\t\tcreateDefaultElement: children => ({\n\t\t\ttype: defaultElementType,\n\t\t\tchildren,\n\t\t}),\n\t\tinsertBetweenBlocks: ([element, path], edge) => {\n\t\t\tconst edgeOffset = edge === 'before' ? 0 : 1\n\t\t\tconst targetPath = path.slice(0, -1).concat(path[path.length - 1] + edgeOffset)\n\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), {\n\t\t\t\tat: targetPath,\n\t\t\t\tselect: true,\n\t\t\t})\n\t\t},\n\n\t\tcanToggleMarks: () => true,\n\t\tcanToggleElement: <E extends SlateElement>() => true,\n\n\t\thasMarks: <T extends SlateText>(marks: TextSpecifics<T>) => ContemberEditor.hasMarks(editor, marks),\n\n\t\t// TODO in the following function, we need to conditionally trim the selection so that it doesn't potentially\n\t\t// \tinclude empty strings at the edges of top-level elements.\n\t\tisElementActive: <E extends SlateElement>(elementType: E['type'], suchThat?: Partial<E>) => {\n\t\t\treturn (\n\t\t\t\telements.get(elementType)?.isActive?.({ editor, suchThat })\n\t\t\t\t?? Array.from(Editor.nodes(editor, {\n\t\t\t\t\tmatch: node => SlateElement.isElement(node) && ContemberEditor.isElementType(node, elementType, suchThat),\n\t\t\t\t\tvoids: false,\n\t\t\t\t})).length > 0\n\t\t\t)\n\t\t},\n\n\t\tacceptsAttributes: <E extends SlateElement>(elementType: E['type'], suchThat: Partial<E>) => {\n\t\t\treturn elements.get(elementType)?.acceptsAttributes?.({ editor, suchThat }) ?? false\n\t\t},\n\n\t\ttoggleMarks: <T extends SlateText>(marks: TextSpecifics<T>) => {\n\t\t\tif (!editor.canToggleMarks(marks)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst isActive = editor.hasMarks(marks)\n\t\t\tif (isActive) {\n\t\t\t\tContemberEditor.removeMarks(editor, marks)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tContemberEditor.addMarks(editor, marks)\n\t\t\treturn true\n\t\t},\n\t\ttoggleElement: <E extends SlateElement>(elementType: E['type'], suchThat?: Partial<E>) => {\n\t\t\telements.get(elementType)?.toggleElement?.({\n\t\t\t\teditor,\n\t\t\t\tsuchThat,\n\t\t\t})\n\t\t},\n\n\t\tisInline: element => {\n\t\t\treturn elements.get(element.type)?.isInline ?? isInline(element)\n\t\t},\n\n\t\tisVoid: element => {\n\t\t\tconst elIsVoid = elements.get(element.type)?.isVoid\n\t\t\tif (elIsVoid === undefined) {\n\t\t\t\treturn isVoid(element)\n\t\t\t}\n\t\t\tif (typeof elIsVoid === 'boolean') {\n\t\t\t\treturn elIsVoid\n\t\t\t}\n\t\t\treturn elIsVoid({ editor, element })\n\t\t},\n\n\t\tcanContainAnyBlocks: element => {\n\t\t\tif (Editor.isEditor(element)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn !editor.isInline(element)\n\t\t\t\t&& !editor.isVoid(element)\n\t\t\t\t&& (elements.has(element.type) ? elements.get(element.type)!.canContainAnyBlocks ?? false : true)\n\t\t},\n\n\t\tserializeNodes: (nodes, errorMessage) => ContemberEditor.serializeNodes(editor, nodes, errorMessage),\n\t\tdeserializeNodes: (serializedNodes, errorMessage) =>\n\t\t\tContemberEditor.permissivelyDeserializeNodes(editor, serializedNodes, errorMessage),\n\n\t\tupgradeFormatBySingleVersion: (node, oldVersion) => {\n\t\t\tif (SlateElement.isElement(node)) {\n\t\t\t\treturn {\n\t\t\t\t\t...node,\n\t\t\t\t\tchildren: node.children.map(child => editor.upgradeFormatBySingleVersion(child, oldVersion) as Descendant),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn node\n\t\t},\n\n\t\trenderElement: props => {\n\t\t\tconst component = elements.get(props.element.type)?.render ?? DefaultElement\n\t\t\treturn createElement(component, props)\n\t\t},\n\n\t\trenderLeafChildren: props => props.children,\n\n\t\trenderLeaf: props => {\n\t\t\tlet el: ReactElement = createElement('span', props.attributes, editor.renderLeafChildren(props))\n\t\t\tfor (const [, mark] of marks) {\n\t\t\t\tif (props.leaf[mark.type] === true) {\n\t\t\t\t\tconst markerEl = mark.render({ ...props, children: el })\n\t\t\t\t\tif (markerEl !== null) {\n\t\t\t\t\t\tif (!isValidElement(markerEl)) {\n\t\t\t\t\t\t\tthrow new Error(`Mark plugin ${mark.type} returned a non-React element`)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tel = markerEl\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn el\n\t\t},\n\n\t\t// Just noop functions so that other plugins can safely bubble-call\n\t\tonDOMBeforeInput: () => {},\n\t\tonKeyDown: e => {\n\t\t\tfor (const [, mark] of marks) {\n\t\t\t\tif (mark.isHotKey(e.nativeEvent)) {\n\t\t\t\t\teditor.toggleMarks({ [mark.type]: true })\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// Inline void nodes cannot be deleted by default: https://github.com/ianstormtaylor/slate/issues/3456\n\t\t\t// This is a hack to get around this issue. The problem is that when an inline void node is selected, Slate's\n\t\t\t// beforeInput handler doesn't get triggered. However, when we put the caret right after the inline void\n\t\t\t// and press Backspace (or the other way around with Delete), it works just fine. Furthermore, if we deleted the\n\t\t\t// node directly, either we'd lose the selection state or Slate, not knowing about us deleting, would still\n\t\t\t// try to delete things on its own so as to respond to the user interaction. So we take advantage of this and\n\t\t\t// instead of deleting the void node, we just carefully move the selection and have Slate do the deleting.\n\t\t\tif (e.key !== 'Delete' && e.key !== 'Backspace') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst selection = editor.selection\n\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst voidEntry = Editor.void(editor, {\n\t\t\t\t\tat: selection,\n\t\t\t\t\tmode: 'lowest',\n\t\t\t\t\tvoids: true,\n\t\t\t\t})\n\t\t\t\tif (!voidEntry) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst [node, nodePath] = voidEntry\n\t\t\t\tif (editor.isInline(node)) {\n\t\t\t\t\tconst adjacentPoint =\n\t\t\t\t\t\te.key === 'Backspace'\n\t\t\t\t\t\t\t? Editor.point(editor, Path.next(nodePath), {\n\t\t\t\t\t\t\t\tedge: 'start',\n\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t: Editor.point(editor, Path.previous(nodePath), {\n\t\t\t\t\t\t\t\tedge: 'end',\n\t\t\t\t\t\t\t })\n\t\t\t\t\tTransforms.select(editor, adjacentPoint)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonFocus: () => {},\n\t\tonBlur: () => {},\n\t\tnormalizeNode: ([node, path]) => {\n\t\t\tif (Editor.isEditor(node) && node.children.length === 0) {\n\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]))\n\t\t\t}\n\t\t\tif (!SlateElement.isElement(node)) {\n\t\t\t\tnormalizeNode([node, path])\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet defaultPrevented = false\n\t\t\telements.get(node.type)?.normalizeNode?.({\n\t\t\t\telement: node,\n\t\t\t\tpath,\n\t\t\t\teditor,\n\t\t\t\tpreventDefault: () => {\n\t\t\t\t\tdefaultPrevented = true\n\t\t\t\t},\n\t\t\t})\n\t\t\tif (!defaultPrevented) {\n\t\t\t\tnormalizeNode([node, path])\n\t\t\t}\n\t\t},\n\t\tregisterElement: plugin => {\n\t\t\telements.set(plugin.type, plugin)\n\t\t},\n\t\tregisterMark: plugin => {\n\t\t\tmarks.set(plugin.type, plugin)\n\t\t},\n\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst [node, nodePath] = Editor.node(editor, [selection.focus.path[0]])\n\t\t\t\tif (SlateElement.isElement(node) && SlateNode.string(node) === '') {\n\t\t\t\t\tconst previous = Editor.previous(editor, {\n\t\t\t\t\t\tat: nodePath,\n\t\t\t\t\t\tvoids: true,\n\t\t\t\t\t})\n\n\t\t\t\t\tif (previous) {\n\t\t\t\t\t\tconst [previousNode] = previous\n\t\t\t\t\t\tif (SlateElement.isElement(previousNode) && editor.isVoid(previousNode)) {\n\t\t\t\t\t\t\teditor.apply({\n\t\t\t\t\t\t\t\ttype: 'remove_node',\n\t\t\t\t\t\t\t\tpath: nodePath,\n\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\treturn\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\tdeleteBackward(unit)\n\t\t},\n\t})\n\n\twithPaste(editor)\n\n\treturn editor\n}\n"],"names":["withHistory","withReact","createEditor","Slate","Transforms","marks","ContemberEditor","Editor","SlateElement","DefaultElement","createElement","isValidElement","SlateRange","Path","SlateNode","withPaste"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createEditorWithEssentials.js","sources":["../../../../../packages/react-slate-editor-base/src/editor/createEditorWithEssentials.tsx"],"sourcesContent":["import { createElement, isValidElement, ReactElement } from 'react'\nimport { createEditor, Descendant, Editor, Element as SlateElement, Node as SlateNode, Path, Range as SlateRange, Text as SlateText, Transforms } from 'slate'\nimport * as Slate from 'slate'\nimport { withHistory } from 'slate-history'\nimport { ReactEditor, withReact } from 'slate-react'\nimport { EditorElementPlugin, EditorMarkPlugin } from '../types/plugins'\nimport { TextSpecifics } from '../types/editor'\nimport { DefaultElement } from '../internal/components/DefaultElement'\nimport { withPaste } from '../plugins/behaviour'\nimport { ContemberEditor } from './index'\n\nexport const createEditorWithEssentials = ({ defaultElementType }: { defaultElementType: string }): Editor => {\n\tconst underlyingEditor = withHistory(withReact(createEditor() as ReactEditor))\n\n\tconst editor = underlyingEditor as unknown as Editor\n\tconst { normalizeNode, isInline, isVoid, deleteBackward } = editor\n\n\tconst elements = new Map<string, EditorElementPlugin<any>>()\n\tconst marks = new Map<string, EditorMarkPlugin>()\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tslate: Slate,\n\t\tformatVersion: 1,\n\t\tdefaultElementType,\n\t\tisDefaultElement: element => 'type' in element && (element as any).type === defaultElementType,\n\t\tcreateDefaultElement: children => ({\n\t\t\ttype: defaultElementType,\n\t\t\tchildren,\n\t\t}),\n\t\tinsertBetweenBlocks: ([element, path], edge) => {\n\t\t\tconst edgeOffset = edge === 'before' ? 0 : 1\n\t\t\tconst targetPath = path.slice(0, -1).concat(path[path.length - 1] + edgeOffset)\n\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]), {\n\t\t\t\tat: targetPath,\n\t\t\t\tselect: true,\n\t\t\t})\n\t\t},\n\n\t\tcanToggleMarks: () => true,\n\t\tcanToggleElement: <E extends SlateElement>() => true,\n\n\t\thasMarks: <T extends SlateText>(marks: TextSpecifics<T>) => ContemberEditor.hasMarks(editor, marks),\n\n\t\t// TODO in the following function, we need to conditionally trim the selection so that it doesn't potentially\n\t\t// \tinclude empty strings at the edges of top-level elements.\n\t\tisElementActive: <E extends SlateElement>(elementType: E['type'], suchThat?: Partial<E>) => {\n\t\t\treturn (\n\t\t\t\telements.get(elementType)?.isActive?.({ editor, suchThat })\n\t\t\t\t?? Array.from(Editor.nodes(editor, {\n\t\t\t\t\tmatch: node => SlateElement.isElement(node) && ContemberEditor.isElementType(node, elementType, suchThat),\n\t\t\t\t\tvoids: false,\n\t\t\t\t})).length > 0\n\t\t\t)\n\t\t},\n\n\t\tacceptsAttributes: <E extends SlateElement>(elementType: E['type'], suchThat: Partial<E>) => {\n\t\t\treturn elements.get(elementType)?.acceptsAttributes?.({ editor, suchThat }) ?? false\n\t\t},\n\n\t\ttoggleMarks: <T extends SlateText>(marks: TextSpecifics<T>) => {\n\t\t\tif (!editor.canToggleMarks(marks)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst isActive = editor.hasMarks(marks)\n\t\t\tif (isActive) {\n\t\t\t\tContemberEditor.removeMarks(editor, marks)\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tContemberEditor.addMarks(editor, marks)\n\t\t\treturn true\n\t\t},\n\t\ttoggleElement: <E extends SlateElement>(elementType: E['type'], suchThat?: Partial<E>) => {\n\t\t\telements.get(elementType)?.toggleElement?.({\n\t\t\t\teditor,\n\t\t\t\tsuchThat,\n\t\t\t})\n\t\t},\n\n\t\tisInline: element => {\n\t\t\treturn elements.get(element.type)?.isInline ?? isInline(element)\n\t\t},\n\n\t\tisVoid: element => {\n\t\t\tconst elIsVoid = elements.get(element.type)?.isVoid\n\t\t\tif (elIsVoid === undefined) {\n\t\t\t\treturn isVoid(element)\n\t\t\t}\n\t\t\tif (typeof elIsVoid === 'boolean') {\n\t\t\t\treturn elIsVoid\n\t\t\t}\n\t\t\treturn elIsVoid({ editor, element })\n\t\t},\n\n\t\tcanContainAnyBlocks: element => {\n\t\t\tif (Editor.isEditor(element)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn !editor.isInline(element)\n\t\t\t\t&& !editor.isVoid(element)\n\t\t\t\t&& (elements.has(element.type) ? elements.get(element.type)!.canContainAnyBlocks ?? false : true)\n\t\t},\n\n\t\tserializeNodes: (nodes, errorMessage) => ContemberEditor.serializeNodes(editor, nodes, errorMessage),\n\t\tdeserializeNodes: (serializedNodes, errorMessage) =>\n\t\t\tContemberEditor.permissivelyDeserializeNodes(editor, serializedNodes, errorMessage),\n\n\t\tupgradeFormatBySingleVersion: (node, oldVersion) => {\n\t\t\tif (SlateElement.isElement(node)) {\n\t\t\t\treturn {\n\t\t\t\t\t...node,\n\t\t\t\t\tchildren: node.children.map(child => editor.upgradeFormatBySingleVersion(child, oldVersion) as Descendant),\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn node\n\t\t},\n\n\t\trenderElement: props => {\n\t\t\tconst component = elements.get(props.element.type)?.render ?? DefaultElement\n\t\t\treturn createElement(component, props)\n\t\t},\n\n\t\trenderLeafChildren: props => props.children,\n\n\t\trenderLeaf: props => {\n\t\t\tlet el: ReactElement = createElement('span', props.attributes, editor.renderLeafChildren(props))\n\t\t\tfor (const [, mark] of marks) {\n\t\t\t\tif (props.leaf[mark.type] === true) {\n\t\t\t\t\tconst markerEl = mark.render({ ...props, children: el })\n\t\t\t\t\tif (markerEl !== null) {\n\t\t\t\t\t\tif (!isValidElement(markerEl)) {\n\t\t\t\t\t\t\tthrow new Error(`Mark plugin ${mark.type} returned a non-React element`)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tel = markerEl\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn el\n\t\t},\n\n\t\t// Just noop functions so that other plugins can safely bubble-call\n\t\tonDOMBeforeInput: () => {},\n\t\tonKeyDown: e => {\n\t\t\tfor (const [, mark] of marks) {\n\t\t\t\tif (mark.isHotKey(e.nativeEvent)) {\n\t\t\t\t\teditor.toggleMarks({ [mark.type]: true })\n\t\t\t\t\te.preventDefault()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// Inline void nodes cannot be deleted by default: https://github.com/ianstormtaylor/slate/issues/3456\n\t\t\t// This is a hack to get around this issue. The problem is that when an inline void node is selected, Slate's\n\t\t\t// beforeInput handler doesn't get triggered. However, when we put the caret right after the inline void\n\t\t\t// and press Backspace (or the other way around with Delete), it works just fine. Furthermore, if we deleted the\n\t\t\t// node directly, either we'd lose the selection state or Slate, not knowing about us deleting, would still\n\t\t\t// try to delete things on its own so as to respond to the user interaction. So we take advantage of this and\n\t\t\t// instead of deleting the void node, we just carefully move the selection and have Slate do the deleting.\n\t\t\tif (e.key !== 'Delete' && e.key !== 'Backspace') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst selection = editor.selection\n\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst voidEntry = Editor.void(editor, {\n\t\t\t\t\tat: selection,\n\t\t\t\t\tmode: 'lowest',\n\t\t\t\t\tvoids: true,\n\t\t\t\t})\n\t\t\t\tif (!voidEntry) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst [node, nodePath] = voidEntry\n\t\t\t\tif (editor.isInline(node)) {\n\t\t\t\t\tconst adjacentPoint =\n\t\t\t\t\t\te.key === 'Backspace'\n\t\t\t\t\t\t\t? Editor.point(editor, Path.next(nodePath), {\n\t\t\t\t\t\t\t\tedge: 'start',\n\t\t\t\t\t\t\t })\n\t\t\t\t\t\t\t: Editor.point(editor, Path.previous(nodePath), {\n\t\t\t\t\t\t\t\tedge: 'end',\n\t\t\t\t\t\t\t })\n\t\t\t\t\tTransforms.select(editor, adjacentPoint)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonFocus: () => {},\n\t\tonBlur: () => {},\n\t\tnormalizeNode: ([node, path]) => {\n\t\t\tif (Editor.isEditor(node) && node.children.length === 0) {\n\t\t\t\tTransforms.insertNodes(editor, editor.createDefaultElement([{ text: '' }]))\n\t\t\t}\n\t\t\tif (!SlateElement.isElement(node)) {\n\t\t\t\tnormalizeNode([node, path])\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet defaultPrevented = false\n\t\t\telements.get(node.type)?.normalizeNode?.({\n\t\t\t\telement: node,\n\t\t\t\tpath,\n\t\t\t\teditor,\n\t\t\t\tpreventDefault: () => {\n\t\t\t\t\tdefaultPrevented = true\n\t\t\t\t},\n\t\t\t})\n\t\t\tif (!defaultPrevented) {\n\t\t\t\tnormalizeNode([node, path])\n\t\t\t}\n\t\t},\n\t\tregisterElement: plugin => {\n\t\t\telements.set(plugin.type, plugin)\n\t\t},\n\t\tregisterMark: plugin => {\n\t\t\tmarks.set(plugin.type, plugin)\n\t\t},\n\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst [node, nodePath] = Editor.node(editor, [selection.focus.path[0]])\n\t\t\t\tif (SlateElement.isElement(node) && SlateNode.string(node) === '') {\n\t\t\t\t\tconst previous = Editor.previous(editor, {\n\t\t\t\t\t\tat: nodePath,\n\t\t\t\t\t\tvoids: true,\n\t\t\t\t\t})\n\n\t\t\t\t\tif (previous) {\n\t\t\t\t\t\tconst [previousNode] = previous\n\t\t\t\t\t\tif (SlateElement.isElement(previousNode) && editor.isVoid(previousNode)) {\n\t\t\t\t\t\t\teditor.apply({\n\t\t\t\t\t\t\t\ttype: 'remove_node',\n\t\t\t\t\t\t\t\tpath: nodePath,\n\t\t\t\t\t\t\t\tnode,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\treturn\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\tdeleteBackward(unit)\n\t\t},\n\t})\n\n\twithPaste(editor)\n\n\treturn editor\n}\n"],"names":["marks","SlateElement","SlateRange","SlateNode"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../../packages/react-slate-editor-base/src/editor/index.ts"],"sourcesContent":["import {\n\taddMarks,\n\tcanToggleMark,\n\tclosest,\n\tclosestBlockEntry,\n\tclosestViableBlockContainerEntry,\n\tejectElement,\n\telementToSpecifics,\n\tgetElementDataAttributes,\n\tgetPreviousSibling,\n\thasMarks,\n\thasParentOfType,\n\tisElementType,\n\tpermissivelyDeserializeNodes,\n\tremoveMarks,\n\tserializeNodes,\n\tstrictlyDeserializeNodes,\n\ttextToSpecifics,\n\ttoLatestFormat,\n\ttopLevelNodes,\n} from './methods'\n\nexport type { ElementDataAttributes } from './methods'\n\n// TODO use export * as ContemberEditor from './methods' once the tooling is ready.\nexport const ContemberEditor = {\n\taddMarks,\n\tcanToggleMark,\n\tclosest,\n\tclosestBlockEntry,\n\tclosestViableBlockContainerEntry,\n\tejectElement,\n\telementToSpecifics,\n\tgetElementDataAttributes,\n\tgetPreviousSibling,\n\thasMarks,\n\thasParentOfType,\n\tisElementType,\n\tpermissivelyDeserializeNodes,\n\tremoveMarks,\n\tserializeNodes,\n\tstrictlyDeserializeNodes,\n\ttextToSpecifics,\n\ttoLatestFormat,\n\ttopLevelNodes,\n}\n\nexport * from './createEditor'\n"],"names":["addMarks","canToggleMark","closest","closestBlockEntry","closestViableBlockContainerEntry","ejectElement","elementToSpecifics","getElementDataAttributes","getPreviousSibling","hasMarks","hasParentOfType","isElementType","permissivelyDeserializeNodes","removeMarks","serializeNodes","strictlyDeserializeNodes","textToSpecifics","toLatestFormat","topLevelNodes"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBO,MAAM,kBAAkB;AAAA,EAAA,UAC9BA,SAAA;AAAA,EAAA,eACAC,cAAA;AAAA,EAAA,SACAC,QAAA;AAAA,EAAA,mBACAC,kBAAA;AAAA,EAAA,kCACAC,iCAAA;AAAA,EAAA,cACAC,aAAA;AAAA,EAAA,oBACAC,mBAAA;AAAA,EAAA,0BACAC,yBAAA;AAAA,EAAA,oBACAC,mBAAA;AAAA,EAAA,UACAC,SAAA;AAAA,EAAA,iBACAC,gBAAA;AAAA,EAAA,eACAC,cAAA;AAAA,EAAA,8BACAC,6BAAA;AAAA,EAAA,aACAC,YAAA;AAAA,EAAA,gBACAC,eAAA;AAAA,EAAA,0BACAC,yBAAA;AAAA,EAAA,iBACAC,gBAAA;AAAA,EAAA,gBACAC,eAAA;AAAA,EAAA,eACAC,cAAA;AACD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/react-slate-editor-base/src/editor/index.ts"],"sourcesContent":["import {\n\taddMarks,\n\tcanToggleMark,\n\tclosest,\n\tclosestBlockEntry,\n\tclosestViableBlockContainerEntry,\n\tejectElement,\n\telementToSpecifics,\n\tgetElementDataAttributes,\n\tgetPreviousSibling,\n\thasMarks,\n\thasParentOfType,\n\tisElementType,\n\tpermissivelyDeserializeNodes,\n\tremoveMarks,\n\tserializeNodes,\n\tstrictlyDeserializeNodes,\n\ttextToSpecifics,\n\ttoLatestFormat,\n\ttopLevelNodes,\n} from './methods'\n\nexport type { ElementDataAttributes } from './methods'\n\n// TODO use export * as ContemberEditor from './methods' once the tooling is ready.\nexport const ContemberEditor = {\n\taddMarks,\n\tcanToggleMark,\n\tclosest,\n\tclosestBlockEntry,\n\tclosestViableBlockContainerEntry,\n\tejectElement,\n\telementToSpecifics,\n\tgetElementDataAttributes,\n\tgetPreviousSibling,\n\thasMarks,\n\thasParentOfType,\n\tisElementType,\n\tpermissivelyDeserializeNodes,\n\tremoveMarks,\n\tserializeNodes,\n\tstrictlyDeserializeNodes,\n\ttextToSpecifics,\n\ttoLatestFormat,\n\ttopLevelNodes,\n}\n\nexport * from './createEditor'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAyBO,MAAM,kBAAkB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addMarks.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/addMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const addMarks = <T extends SlateText, E extends SlateEditor>(editor: E, marks: TextSpecifics<T>) => {\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (const mark in marks) {\n\t\t\tEditor.addMark(editor, mark, (marks as any)[mark])\n\t\t}\n\t})\n}\n"],"names":["Editor"],"mappings":";;;AAGa,MAAA,WAAW,CAA6C,QAAW,UAA4B;AACpGA,eAAA,mBAAmB,QAAQ,MAAM;AACvC,eAAW,QAAQ,OAAO;AACzBA,YAAA,OAAO,QAAQ,QAAQ,MAAO,MAAc,IAAI,CAAC;AAAA,IAClD;AAAA,EAAA,CACA;AACF;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addMarks.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/addMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const addMarks = <T extends SlateText, E extends SlateEditor>(editor: E, marks: TextSpecifics<T>) => {\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (const mark in marks) {\n\t\t\tEditor.addMark(editor, mark, (marks as any)[mark])\n\t\t}\n\t})\n}\n"],"names":[],"mappings":";AAGa,MAAA,WAAW,CAA6C,QAAW,UAA4B;AACpG,SAAA,mBAAmB,QAAQ,MAAM;AACvC,eAAW,QAAQ,OAAO;AACzB,aAAO,QAAQ,QAAQ,MAAO,MAAc,IAAI,CAAC;AAAA,IAClD;AAAA,EAAA,CACA;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canToggleMark.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/canToggleMark.ts"],"sourcesContent":["import { Editor as SlateEditor, Text as SlateText } from 'slate'\n\nexport const canToggleMark = <T extends SlateText, E extends SlateEditor>(\n\teditor: E,\n\tmarkName: string,\n\tmarkValue: unknown = true,\n) => {\n\treturn editor.canToggleMarks({ [markName]: markValue })\n}\n"],"names":[],"mappings":";;AAEO,MAAM,gBAAgB,CAC5B,QACA,UACA,YAAqB,SACjB;AACJ,SAAO,OAAO,eAAe,EAAE,CAAC,QAAQ,GAAG,UAAW,CAAA;AACvD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canToggleMark.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/canToggleMark.ts"],"sourcesContent":["import { Editor as SlateEditor, Text as SlateText } from 'slate'\n\nexport const canToggleMark = <T extends SlateText, E extends SlateEditor>(\n\teditor: E,\n\tmarkName: string,\n\tmarkValue: unknown = true,\n) => {\n\treturn editor.canToggleMarks({ [markName]: markValue })\n}\n"],"names":[],"mappings":"AAEO,MAAM,gBAAgB,CAC5B,QACA,UACA,YAAqB,SACjB;AACJ,SAAO,OAAO,eAAe,EAAE,CAAC,QAAQ,GAAG,UAAW,CAAA;AACvD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closest.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/closest.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Element, Location, NodeEntry, Text } from 'slate'\n\nexport const closest = <E extends SlateEditor>(\n\teditor: E,\n\toptions: {\n\t\tat?: Location\n\t\tmatch: (node: Editor | Element) => boolean\n\t},\n): NodeEntry<Editor | Element> | undefined => {\n\tconst entries = Editor.levels<Editor | Element>(editor, {\n\t\tat: options.at,\n\t\tmatch: node => {\n\t\t\treturn !Text.isText(node) && options.match(node)\n\t\t},\n\t\treverse: true,\n\t})\n\tfor (const entry of entries) {\n\t\treturn entry\n\t}\n\treturn undefined\n}\n"],"names":["Editor","Text"],"mappings":";;;AAEa,MAAA,UAAU,CACtB,QACA,YAI6C;AACvC,QAAA,UAAUA,MAAAA,OAAO,OAAyB,QAAQ;AAAA,IACvD,IAAI,QAAQ;AAAA,IACZ,OAAO,CAAQ,SAAA;AACd,aAAO,CAACC,MAAK,KAAA,OAAO,IAAI,KAAK,QAAQ,MAAM,IAAI;AAAA,IAChD;AAAA,IACA,SAAS;AAAA,EAAA,CACT;AACD,aAAW,SAAS,SAAS;AACrB,WAAA;AAAA,EACR;AACO,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closest.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/closest.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Element, Location, NodeEntry, Text } from 'slate'\n\nexport const closest = <E extends SlateEditor>(\n\teditor: E,\n\toptions: {\n\t\tat?: Location\n\t\tmatch: (node: Editor | Element) => boolean\n\t},\n): NodeEntry<Editor | Element> | undefined => {\n\tconst entries = Editor.levels<Editor | Element>(editor, {\n\t\tat: options.at,\n\t\tmatch: node => {\n\t\t\treturn !Text.isText(node) && options.match(node)\n\t\t},\n\t\treverse: true,\n\t})\n\tfor (const entry of entries) {\n\t\treturn entry\n\t}\n\treturn undefined\n}\n"],"names":[],"mappings":";AAEa,MAAA,UAAU,CACtB,QACA,YAI6C;AACvC,QAAA,UAAU,OAAO,OAAyB,QAAQ;AAAA,IACvD,IAAI,QAAQ;AAAA,IACZ,OAAO,CAAQ,SAAA;AACd,aAAO,CAAC,KAAK,OAAO,IAAI,KAAK,QAAQ,MAAM,IAAI;AAAA,IAChD;AAAA,IACA,SAAS;AAAA,EAAA,CACT;AACD,aAAW,SAAS,SAAS;AACrB,WAAA;AAAA,EACR;AACO,SAAA;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closestBlockEntry.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/closestBlockEntry.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Location, Element } from 'slate'\nimport { closest } from './closest'\n\nexport const closestBlockEntry = <E extends SlateEditor>(\n\teditor: E,\n\toptions?: {\n\t\tat?: Location\n\t\tmatch?: (node: Element) => boolean\n\t},\n) =>\n\tclosest(editor, {\n\t\tat: options?.at,\n\t\tmatch: node => !Editor.isEditor(node) && Editor.isBlock(editor, node) && (options?.match ? options.match(node) : true),\n\t})\n"],"names":["closest","Editor"],"mappings":";;;;AAGO,MAAM,oBAAoB,CAChC,QACA,YAKAA,QAAAA,QAAQ,QAAQ;AAAA,EACf,IAAI,SAAS;AAAA,EACb,OAAO,CAAQ,SAAA,CAACC,MAAAA,OAAO,SAAS,IAAI,KAAKA,MAAAA,OAAO,QAAQ,QAAQ,IAAI,MAAM,SAAS,QAAQ,QAAQ,MAAM,IAAI,IAAI;AAClH,CAAC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closestBlockEntry.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/closestBlockEntry.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Location, Element } from 'slate'\nimport { closest } from './closest'\n\nexport const closestBlockEntry = <E extends SlateEditor>(\n\teditor: E,\n\toptions?: {\n\t\tat?: Location\n\t\tmatch?: (node: Element) => boolean\n\t},\n) =>\n\tclosest(editor, {\n\t\tat: options?.at,\n\t\tmatch: node => !Editor.isEditor(node) && Editor.isBlock(editor, node) && (options?.match ? options.match(node) : true),\n\t})\n"],"names":[],"mappings":";;AAGO,MAAM,oBAAoB,CAChC,QACA,YAKA,QAAQ,QAAQ;AAAA,EACf,IAAI,SAAS;AAAA,EACb,OAAO,CAAQ,SAAA,CAAC,OAAO,SAAS,IAAI,KAAK,OAAO,QAAQ,QAAQ,IAAI,MAAM,SAAS,QAAQ,QAAQ,MAAM,IAAI,IAAI;AAClH,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closestViableBlockContainerEntry.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/closestViableBlockContainerEntry.ts"],"sourcesContent":["import type { Location as SlateLocation, NodeEntry } from 'slate'\nimport { Editor as SlateEditor, Element as SlateElement } from 'slate'\nimport { closest } from './closest'\n\nexport const closestViableBlockContainerEntry = <E extends SlateEditor>(\n\teditor: E,\n\toptions?: {\n\t\tat?: SlateLocation\n\t},\n): NodeEntry<SlateElement | SlateEditor> | undefined =>\n\tclosest(editor, {\n\t\tat: options?.at,\n\t\tmatch: node => editor.canContainAnyBlocks(node),\n\t})\n"],"names":["closest"],"mappings":";;;AAIO,MAAM,mCAAmC,CAC/C,QACA,YAIAA,QAAAA,QAAQ,QAAQ;AAAA,EACf,IAAI,SAAS;AAAA,EACb,OAAO,CAAA,SAAQ,OAAO,oBAAoB,IAAI;AAC/C,CAAC;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"closestViableBlockContainerEntry.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/closestViableBlockContainerEntry.ts"],"sourcesContent":["import type { Location as SlateLocation, NodeEntry } from 'slate'\nimport { Editor as SlateEditor, Element as SlateElement } from 'slate'\nimport { closest } from './closest'\n\nexport const closestViableBlockContainerEntry = <E extends SlateEditor>(\n\teditor: E,\n\toptions?: {\n\t\tat?: SlateLocation\n\t},\n): NodeEntry<SlateElement | SlateEditor> | undefined =>\n\tclosest(editor, {\n\t\tat: options?.at,\n\t\tmatch: node => editor.canContainAnyBlocks(node),\n\t})\n"],"names":[],"mappings":";AAIO,MAAM,mCAAmC,CAC/C,QACA,YAIA,QAAQ,QAAQ;AAAA,EACf,IAAI,SAAS;AAAA,EACb,OAAO,CAAA,SAAQ,OAAO,oBAAoB,IAAI;AAC/C,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ejectElement.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/ejectElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Path, Transforms } from 'slate'\n\nexport const ejectElement = <E extends SlateEditor>(editor: E, path: Path) => {\n\tconst element = SlateNode.get(editor, path)\n\n\tif (!SlateElement.isElement(element)) {\n\t\treturn\n\t}\n\tconst { children, ...otherProperties } = element\n\n\tTransforms.unsetNodes(editor, Object.keys(otherProperties), {\n\t\tat: path,\n\t})\n}\n"],"names":["SlateNode","SlateElement","Transforms"],"mappings":";;;AAEa,MAAA,eAAe,CAAwB,QAAW,SAAe;AAC7E,QAAM,UAAUA,MAAA,KAAU,IAAI,QAAQ,IAAI;AAE1C,MAAI,CAACC,MAAA,QAAa,UAAU,OAAO,GAAG;AACrC;AAAA,EACD;AACA,QAAM,EAAE,UAAU,GAAG,gBAAA,IAAoB;AAEzCC,QAAA,WAAW,WAAW,QAAQ,OAAO,KAAK,eAAe,GAAG;AAAA,IAC3D,IAAI;AAAA,EAAA,CACJ;AACF;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ejectElement.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/ejectElement.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Path, Transforms } from 'slate'\n\nexport const ejectElement = <E extends SlateEditor>(editor: E, path: Path) => {\n\tconst element = SlateNode.get(editor, path)\n\n\tif (!SlateElement.isElement(element)) {\n\t\treturn\n\t}\n\tconst { children, ...otherProperties } = element\n\n\tTransforms.unsetNodes(editor, Object.keys(otherProperties), {\n\t\tat: path,\n\t})\n}\n"],"names":["SlateNode","SlateElement"],"mappings":";AAEa,MAAA,eAAe,CAAwB,QAAW,SAAe;AAC7E,QAAM,UAAUA,KAAU,IAAI,QAAQ,IAAI;AAE1C,MAAI,CAACC,QAAa,UAAU,OAAO,GAAG;AACrC;AAAA,EACD;AACA,QAAM,EAAE,UAAU,GAAG,gBAAA,IAAoB;AAEzC,aAAW,WAAW,QAAQ,OAAO,KAAK,eAAe,GAAG;AAAA,IAC3D,IAAI;AAAA,EAAA,CACJ;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementToSpecifics.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/elementToSpecifics.ts"],"sourcesContent":["import { Element as SlateElement } from 'slate'\n\nexport const elementToSpecifics = <Element extends SlateElement = SlateElement>(\n\telement: Element,\n): Partial<Element> => {\n\tconst { type, children, referenceId, ...specifics } = element\n\treturn specifics as Partial<Element>\n}\n"],"names":[],"mappings":";;AAEa,MAAA,qBAAqB,CACjC,YACsB;AACtB,QAAM,EAAE,MAAM,UAAU,aAAa,GAAG,UAAc,IAAA;AAC/C,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elementToSpecifics.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/elementToSpecifics.ts"],"sourcesContent":["import { Element as SlateElement } from 'slate'\n\nexport const elementToSpecifics = <Element extends SlateElement = SlateElement>(\n\telement: Element,\n): Partial<Element> => {\n\tconst { type, children, referenceId, ...specifics } = element\n\treturn specifics as Partial<Element>\n}\n"],"names":[],"mappings":"AAEa,MAAA,qBAAqB,CACjC,YACsB;AACtB,QAAM,EAAE,MAAM,UAAU,aAAa,GAAG,UAAc,IAAA;AAC/C,SAAA;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElementDataAttributes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/getElementDataAttributes.ts"],"sourcesContent":["import type { Scalar } from '@contember/react-binding'\nimport { Element as SlateElement } from 'slate'\n\nexport interface ElementDataAttributes {\n\t[dataAttribute: string]: Scalar\n}\n\nexport const getElementDataAttributes = <Element extends SlateElement = SlateElement>(\n\telement: Element,\n\tattributeNamePrefix: string = 'contember',\n): ElementDataAttributes => {\n\tconst { children, ...extendedSpecifics } = element\n\n\treturn Object.fromEntries(\n\t\tObject.entries(extendedSpecifics)\n\t\t\t.filter(([, value]) => {\n\t\t\t\tconst t = typeof value\n\t\t\t\treturn t === 'string' || t === 'number' || t === 'boolean'\n\t\t\t})\n\t\t\t.map(([attribute, value]) => [`data-${attributeNamePrefix}-${attribute.toLowerCase()}`, value as Scalar]),\n\t)\n}\n"],"names":[],"mappings":";;AAOO,MAAM,2BAA2B,CACvC,SACA,sBAA8B,gBACH;AAC3B,QAAM,EAAE,UAAU,GAAG,kBAAA,IAAsB;AAE3C,SAAO,OAAO;AAAA,IACb,OAAO,QAAQ,iBAAiB,EAC9B,OAAO,CAAC,CAAG,EAAA,KAAK,MAAM;AACtB,YAAM,IAAI,OAAO;AACjB,aAAO,MAAM,YAAY,MAAM,YAAY,MAAM;AAAA,IAAA,CACjD,EACA,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,QAAQ,mBAAmB,IAAI,UAAU,YAAa,CAAA,IAAI,KAAe,CAAC;AAAA,EAAA;AAE3G;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElementDataAttributes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/getElementDataAttributes.ts"],"sourcesContent":["import type { Scalar } from '@contember/react-binding'\nimport { Element as SlateElement } from 'slate'\n\nexport interface ElementDataAttributes {\n\t[dataAttribute: string]: Scalar\n}\n\nexport const getElementDataAttributes = <Element extends SlateElement = SlateElement>(\n\telement: Element,\n\tattributeNamePrefix: string = 'contember',\n): ElementDataAttributes => {\n\tconst { children, ...extendedSpecifics } = element\n\n\treturn Object.fromEntries(\n\t\tObject.entries(extendedSpecifics)\n\t\t\t.filter(([, value]) => {\n\t\t\t\tconst t = typeof value\n\t\t\t\treturn t === 'string' || t === 'number' || t === 'boolean'\n\t\t\t})\n\t\t\t.map(([attribute, value]) => [`data-${attributeNamePrefix}-${attribute.toLowerCase()}`, value as Scalar]),\n\t)\n}\n"],"names":[],"mappings":"AAOO,MAAM,2BAA2B,CACvC,SACA,sBAA8B,gBACH;AAC3B,QAAM,EAAE,UAAU,GAAG,kBAAA,IAAsB;AAE3C,SAAO,OAAO;AAAA,IACb,OAAO,QAAQ,iBAAiB,EAC9B,OAAO,CAAC,CAAG,EAAA,KAAK,MAAM;AACtB,YAAM,IAAI,OAAO;AACjB,aAAO,MAAM,YAAY,MAAM,YAAY,MAAM;AAAA,IAAA,CACjD,EACA,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,QAAQ,mBAAmB,IAAI,UAAU,YAAa,CAAA,IAAI,KAAe,CAAC;AAAA,EAAA;AAE3G;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPreviousSibling.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/getPreviousSibling.ts"],"sourcesContent":["import { Editor as SlateEditor, Node as SlateNode, NodeEntry, Path as SlatePath } from 'slate'\n\nexport const getPreviousSibling = <\n\tE extends SlateEditor = SlateEditor,\n\tCurrentNode extends SlateNode = SlateNode,\n\tPreviousNode extends SlateNode = CurrentNode,\n>(\n\teditor: E,\n\tnode: CurrentNode,\n\tnodePath: SlatePath,\n): NodeEntry<PreviousNode> | undefined => {\n\tconst lastPathIndex = nodePath[nodePath.length - 1]\n\tif (lastPathIndex === 0) {\n\t\treturn undefined\n\t}\n\tconst previousPath = nodePath.slice(0, -1).concat(lastPathIndex - 1)\n\treturn [SlateNode.get(editor, previousPath) as PreviousNode, previousPath]\n}\n"],"names":["SlateNode"],"mappings":";;;AAEO,MAAM,qBAAqB,CAKjC,QACA,MACA,aACyC;AACzC,QAAM,gBAAgB,SAAS,SAAS,SAAS,CAAC;AAClD,MAAI,kBAAkB,GAAG;AACjB,WAAA;AAAA,EACR;AACM,QAAA,eAAe,SAAS,MAAM,GAAG,EAAE,EAAE,OAAO,gBAAgB,CAAC;AACnE,SAAO,CAACA,MAAU,KAAA,IAAI,QAAQ,YAAY,GAAmB,YAAY;AAC1E;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPreviousSibling.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/getPreviousSibling.ts"],"sourcesContent":["import { Editor as SlateEditor, Node as SlateNode, NodeEntry, Path as SlatePath } from 'slate'\n\nexport const getPreviousSibling = <\n\tE extends SlateEditor = SlateEditor,\n\tCurrentNode extends SlateNode = SlateNode,\n\tPreviousNode extends SlateNode = CurrentNode,\n>(\n\teditor: E,\n\tnode: CurrentNode,\n\tnodePath: SlatePath,\n): NodeEntry<PreviousNode> | undefined => {\n\tconst lastPathIndex = nodePath[nodePath.length - 1]\n\tif (lastPathIndex === 0) {\n\t\treturn undefined\n\t}\n\tconst previousPath = nodePath.slice(0, -1).concat(lastPathIndex - 1)\n\treturn [SlateNode.get(editor, previousPath) as PreviousNode, previousPath]\n}\n"],"names":["SlateNode"],"mappings":";AAEO,MAAM,qBAAqB,CAKjC,QACA,MACA,aACyC;AACzC,QAAM,gBAAgB,SAAS,SAAS,SAAS,CAAC;AAClD,MAAI,kBAAkB,GAAG;AACjB,WAAA;AAAA,EACR;AACM,QAAA,eAAe,SAAS,MAAM,GAAG,EAAE,EAAE,OAAO,gBAAgB,CAAC;AACnE,SAAO,CAACA,KAAU,IAAI,QAAQ,YAAY,GAAmB,YAAY;AAC1E;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasMarks.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/hasMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Node as SlateNode, Path, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const hasMarks = <T extends SlateText, E extends SlateEditor>(\n\teditor: E,\n\tmarks: TextSpecifics<T>,\n\toptions: {\n\t\tfrom?: Path\n\t\tto?: Path\n\t} = {},\n) => {\n\tconst from = options.from ?? editor.selection?.anchor.path\n\tconst to = options.to ?? editor.selection?.focus.path\n\n\tif (!from && !to) {\n\t\treturn false\n\t}\n\n\tfor (const [text] of SlateNode.texts(editor, {\n\t\tfrom,\n\t\tto,\n\t})) {\n\t\tfor (const markName in marks) {\n\t\t\tif (!(markName in text) || text[markName] !== (marks as any)[markName]) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n"],"names":["SlateNode"],"mappings":";;;AAGO,MAAM,WAAW,CACvB,QACA,OACA,UAGI,CAAA,MACA;AACJ,QAAM,OAAO,QAAQ,QAAQ,OAAO,WAAW,OAAO;AACtD,QAAM,KAAK,QAAQ,MAAM,OAAO,WAAW,MAAM;AAE7C,MAAA,CAAC,QAAQ,CAAC,IAAI;AACV,WAAA;AAAA,EACR;AAEA,aAAW,CAAC,IAAI,KAAKA,MAAAA,KAAU,MAAM,QAAQ;AAAA,IAC5C;AAAA,IACA;AAAA,EAAA,CACA,GAAG;AACH,eAAW,YAAY,OAAO;AACzB,UAAA,EAAE,YAAY,SAAS,KAAK,QAAQ,MAAO,MAAc,QAAQ,GAAG;AAChE,eAAA;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACO,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasMarks.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/hasMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Node as SlateNode, Path, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const hasMarks = <T extends SlateText, E extends SlateEditor>(\n\teditor: E,\n\tmarks: TextSpecifics<T>,\n\toptions: {\n\t\tfrom?: Path\n\t\tto?: Path\n\t} = {},\n) => {\n\tconst from = options.from ?? editor.selection?.anchor.path\n\tconst to = options.to ?? editor.selection?.focus.path\n\n\tif (!from && !to) {\n\t\treturn false\n\t}\n\n\tfor (const [text] of SlateNode.texts(editor, {\n\t\tfrom,\n\t\tto,\n\t})) {\n\t\tfor (const markName in marks) {\n\t\t\tif (!(markName in text) || text[markName] !== (marks as any)[markName]) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n"],"names":["SlateNode"],"mappings":";AAGO,MAAM,WAAW,CACvB,QACA,OACA,UAGI,CAAA,MACA;AACJ,QAAM,OAAO,QAAQ,QAAQ,OAAO,WAAW,OAAO;AACtD,QAAM,KAAK,QAAQ,MAAM,OAAO,WAAW,MAAM;AAE7C,MAAA,CAAC,QAAQ,CAAC,IAAI;AACV,WAAA;AAAA,EACR;AAEA,aAAW,CAAC,IAAI,KAAKA,KAAU,MAAM,QAAQ;AAAA,IAC5C;AAAA,IACA;AAAA,EAAA,CACA,GAAG;AACH,eAAW,YAAY,OAAO;AACzB,UAAA,EAAE,YAAY,SAAS,KAAK,QAAQ,MAAO,MAAc,QAAQ,GAAG;AAChE,eAAA;AAAA,MACR;AAAA,IACD;AAAA,EACD;AACO,SAAA;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasParentOfType.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/hasParentOfType.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, NodeEntry, Path as SlatePath } from 'slate'\nimport { ContemberEditor } from '../index'\n\nexport const hasParentOfType = <Editor extends SlateEditor, Element extends SlateElement>(\n\teditor: Editor,\n\tnodeEntry: NodeEntry<SlateNode | SlateElement>,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tconst [, path] = nodeEntry\n\tif (path.length === 1) {\n\t\treturn false // Doesn't have a parent\n\t}\n\tconst parentPath = SlatePath.parent(path)\n\tconst parent = SlateNode.get(editor, parentPath)\n\n\treturn ContemberEditor.isElementType(parent, type, suchThat)\n}\n"],"names":["SlatePath","SlateNode","ContemberEditor"],"mappings":";;;;AAGO,MAAM,kBAAkB,CAC9B,QACA,WACA,MACA,aACa;AACP,QAAA,CAAG,EAAA,IAAI,IAAI;AACb,MAAA,KAAK,WAAW,GAAG;AACf,WAAA;AAAA,EACR;AACM,QAAA,aAAaA,MAAAA,KAAU,OAAO,IAAI;AACxC,QAAM,SAASC,MAAA,KAAU,IAAI,QAAQ,UAAU;AAE/C,SAAOC,MAAgB,gBAAA,cAAc,QAAQ,MAAM,QAAQ;AAC5D;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasParentOfType.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/hasParentOfType.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, NodeEntry, Path as SlatePath } from 'slate'\nimport { ContemberEditor } from '../index'\n\nexport const hasParentOfType = <Editor extends SlateEditor, Element extends SlateElement>(\n\teditor: Editor,\n\tnodeEntry: NodeEntry<SlateNode | SlateElement>,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tconst [, path] = nodeEntry\n\tif (path.length === 1) {\n\t\treturn false // Doesn't have a parent\n\t}\n\tconst parentPath = SlatePath.parent(path)\n\tconst parent = SlateNode.get(editor, parentPath)\n\n\treturn ContemberEditor.isElementType(parent, type, suchThat)\n}\n"],"names":["SlatePath","SlateNode"],"mappings":";;AAGO,MAAM,kBAAkB,CAC9B,QACA,WACA,MACA,aACa;AACP,QAAA,CAAG,EAAA,IAAI,IAAI;AACb,MAAA,KAAK,WAAW,GAAG;AACf,WAAA;AAAA,EACR;AACM,QAAA,aAAaA,KAAU,OAAO,IAAI;AACxC,QAAM,SAASC,KAAU,IAAI,QAAQ,UAAU;AAE/C,SAAO,gBAAgB,cAAc,QAAQ,MAAM,QAAQ;AAC5D;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isElementType.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/isElementType.ts"],"sourcesContent":["import { Element as SlateElement, Node as SlateNode } from 'slate'\n\nexport const isElementType = <Element extends SlateElement>(\n\telement: SlateNode,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tif (!SlateElement.isElement(element) || element.type !== type) {\n\t\treturn false\n\t}\n\tif (suchThat === undefined) {\n\t\treturn true\n\t}\n\n\tfor (const prop in suchThat) {\n\t\tconst propValue = suchThat[prop]\n\t\tconst propPresent = prop in element\n\n\t\tif (!propValue && !propPresent) {\n\t\t\t// Falsy values get special treatment.\n\t\t\tcontinue\n\t\t}\n\n\t\tif (!propPresent || (element as Element)[prop as keyof Element] !== propValue) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"],"names":["SlateElement"],"mappings":";;;AAEO,MAAM,gBAAgB,CAC5B,SACA,MACA,aACa;AACb,MAAI,CAACA,MAAa,QAAA,UAAU,OAAO,KAAK,QAAQ,SAAS,MAAM;AACvD,WAAA;AAAA,EACR;AACA,MAAI,aAAa,QAAW;AACpB,WAAA;AAAA,EACR;AAEA,aAAW,QAAQ,UAAU;AACtB,UAAA,YAAY,SAAS,IAAI;AAC/B,UAAM,cAAc,QAAQ;AAExB,QAAA,CAAC,aAAa,CAAC,aAAa;AAE/B;AAAA,IACD;AAEA,QAAI,CAAC,eAAgB,QAAoB,IAAqB,MAAM,WAAW;AACvE,aAAA;AAAA,IACR;AAAA,EACD;AACO,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isElementType.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/isElementType.ts"],"sourcesContent":["import { Element as SlateElement, Node as SlateNode } from 'slate'\n\nexport const isElementType = <Element extends SlateElement>(\n\telement: SlateNode,\n\ttype: Element['type'],\n\tsuchThat?: Partial<Element>,\n): boolean => {\n\tif (!SlateElement.isElement(element) || element.type !== type) {\n\t\treturn false\n\t}\n\tif (suchThat === undefined) {\n\t\treturn true\n\t}\n\n\tfor (const prop in suchThat) {\n\t\tconst propValue = suchThat[prop]\n\t\tconst propPresent = prop in element\n\n\t\tif (!propValue && !propPresent) {\n\t\t\t// Falsy values get special treatment.\n\t\t\tcontinue\n\t\t}\n\n\t\tif (!propPresent || (element as Element)[prop as keyof Element] !== propValue) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n"],"names":["SlateElement"],"mappings":";AAEO,MAAM,gBAAgB,CAC5B,SACA,MACA,aACa;AACb,MAAI,CAACA,QAAa,UAAU,OAAO,KAAK,QAAQ,SAAS,MAAM;AACvD,WAAA;AAAA,EACR;AACA,MAAI,aAAa,QAAW;AACpB,WAAA;AAAA,EACR;AAEA,aAAW,QAAQ,UAAU;AACtB,UAAA,YAAY,SAAS,IAAI;AAC/B,UAAM,cAAc,QAAQ;AAExB,QAAA,CAAC,aAAa,CAAC,aAAa;AAE/B;AAAA,IACD;AAEA,QAAI,CAAC,eAAgB,QAAoB,IAAqB,MAAM,WAAW;AACvE,aAAA;AAAA,IACR;AAAA,EACD;AACO,SAAA;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissivelyDeserializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/permissivelyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const permissivelyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode | SlateElement | null = null\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {}\n\n\tif (typeof deserialized !== 'object' || deserialized === null) {\n\t\treturn [editor.createDefaultElement([{ text: serializedElement }])]\n\t}\n\n\tif ('formatVersion' in deserialized) {\n\t\treturn toLatestFormat(editor, deserialized as SerializableEditorNode).children\n\t}\n\n\t// If no format version is specified, assume zero.\n\treturn toLatestFormat(editor, {\n\t\tformatVersion: 0,\n\t\tchildren: [deserialized],\n\t}).children\n}\n"],"names":["toLatestFormat"],"mappings":";;;AAIO,MAAM,+BAA+B,CAC3C,QACA,mBACA,iBACqC;AACrC,MAAI,eAA6D;AAC7D,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AAAA,EAAC;AAEb,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,MAAM;AACvD,WAAA,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,kBAAA,CAAmB,CAAC,CAAC;AAAA,EACnE;AAEA,MAAI,mBAAmB,cAAc;AAC7B,WAAAA,8BAAe,QAAQ,YAAsC,EAAE;AAAA,EACvE;AAGA,SAAOA,eAAAA,eAAe,QAAQ;AAAA,IAC7B,eAAe;AAAA,IACf,UAAU,CAAC,YAAY;AAAA,EACvB,CAAA,EAAE;AACJ;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissivelyDeserializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/permissivelyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const permissivelyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode | SlateElement | null = null\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {}\n\n\tif (typeof deserialized !== 'object' || deserialized === null) {\n\t\treturn [editor.createDefaultElement([{ text: serializedElement }])]\n\t}\n\n\tif ('formatVersion' in deserialized) {\n\t\treturn toLatestFormat(editor, deserialized as SerializableEditorNode).children\n\t}\n\n\t// If no format version is specified, assume zero.\n\treturn toLatestFormat(editor, {\n\t\tformatVersion: 0,\n\t\tchildren: [deserialized],\n\t}).children\n}\n"],"names":[],"mappings":";AAIO,MAAM,+BAA+B,CAC3C,QACA,mBACA,iBACqC;AACrC,MAAI,eAA6D;AAC7D,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AAAA,EAAC;AAEb,MAAI,OAAO,iBAAiB,YAAY,iBAAiB,MAAM;AACvD,WAAA,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,kBAAA,CAAmB,CAAC,CAAC;AAAA,EACnE;AAEA,MAAI,mBAAmB,cAAc;AAC7B,WAAA,eAAe,QAAQ,YAAsC,EAAE;AAAA,EACvE;AAGA,SAAO,eAAe,QAAQ;AAAA,IAC7B,eAAe;AAAA,IACf,UAAU,CAAC,YAAY;AAAA,EACvB,CAAA,EAAE;AACJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeMarks.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/removeMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const removeMarks = <T extends SlateText, E extends SlateEditor>(editor: E, marks: TextSpecifics<T>) => {\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (const mark in marks) {\n\t\t\tEditor.removeMark(editor, mark)\n\t\t}\n\t})\n}\n"],"names":["Editor"],"mappings":";;;AAGa,MAAA,cAAc,CAA6C,QAAW,UAA4B;AACvGA,eAAA,mBAAmB,QAAQ,MAAM;AACvC,eAAW,QAAQ,OAAO;AAClBA,YAAAA,OAAA,WAAW,QAAQ,IAAI;AAAA,IAC/B;AAAA,EAAA,CACA;AACF;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeMarks.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/removeMarks.ts"],"sourcesContent":["import { Editor as SlateEditor, Editor, Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const removeMarks = <T extends SlateText, E extends SlateEditor>(editor: E, marks: TextSpecifics<T>) => {\n\tEditor.withoutNormalizing(editor, () => {\n\t\tfor (const mark in marks) {\n\t\t\tEditor.removeMark(editor, mark)\n\t\t}\n\t})\n}\n"],"names":[],"mappings":";AAGa,MAAA,cAAc,CAA6C,QAAW,UAA4B;AACvG,SAAA,mBAAmB,QAAQ,MAAM;AACvC,eAAW,QAAQ,OAAO;AAClB,aAAA,WAAW,QAAQ,IAAI;AAAA,IAC/B;AAAA,EAAA,CACA;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/serializeNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const serializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\telements: Array<SlateElement | SlateText>,\n\terrorMessage?: string,\n) => {\n\ttry {\n\t\tconst serialized: SerializableEditorNode = {\n\t\t\tformatVersion: editor.formatVersion,\n\t\t\tchildren: elements,\n\t\t}\n\t\treturn JSON.stringify(serialized)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: serialization error`)\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,iBAAiB,CAC7B,QACA,UACA,iBACI;AACA,MAAA;AACH,UAAM,aAAqC;AAAA,MAC1C,eAAe,OAAO;AAAA,MACtB,UAAU;AAAA,IAAA;AAEJ,WAAA,KAAK,UAAU,UAAU;AAAA,WACxB,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,6BAA6B;AAAA,EAC9D;AACD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/serializeNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const serializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\telements: Array<SlateElement | SlateText>,\n\terrorMessage?: string,\n) => {\n\ttry {\n\t\tconst serialized: SerializableEditorNode = {\n\t\t\tformatVersion: editor.formatVersion,\n\t\t\tchildren: elements,\n\t\t}\n\t\treturn JSON.stringify(serialized)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: serialization error`)\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,iBAAiB,CAC7B,QACA,UACA,iBACI;AACA,MAAA;AACH,UAAM,aAAqC;AAAA,MAC1C,eAAe,OAAO;AAAA,MACtB,UAAU;AAAA,IAAA;AAEJ,WAAA,KAAK,UAAU,UAAU;AAAA,WACxB,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,6BAA6B;AAAA,EAC9D;AACD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strictlyDeserializeNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/strictlyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const strictlyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: deserialization error`)\n\t}\n\treturn toLatestFormat(editor, deserialized).children\n}\n"],"names":["toLatestFormat"],"mappings":";;;AAIO,MAAM,2BAA2B,CACvC,QACA,mBACA,iBACqC;AACjC,MAAA;AACA,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,+BAA+B;AAAA,EAChE;AACO,SAAAA,8BAAe,QAAQ,YAAY,EAAE;AAC7C;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strictlyDeserializeNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/strictlyDeserializeNodes.ts"],"sourcesContent":["import { toLatestFormat } from './toLatestFormat'\nimport { Editor as SlateEditor, Element as SlateElement, Text as SlateText } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const strictlyDeserializeNodes = <E extends SlateEditor>(\n\teditor: E,\n\tserializedElement: string,\n\terrorMessage?: string,\n): Array<SlateElement | SlateText> => {\n\tlet deserialized: SerializableEditorNode\n\ttry {\n\t\t// It is important that only the JSON.parse call is inside the try block.\n\t\t// We don't want to catch other exceptions from here.\n\t\tdeserialized = JSON.parse(serializedElement)\n\t} catch (e) {\n\t\tthrow new Error(errorMessage || `Editor: deserialization error`)\n\t}\n\treturn toLatestFormat(editor, deserialized).children\n}\n"],"names":[],"mappings":";AAIO,MAAM,2BAA2B,CACvC,QACA,mBACA,iBACqC;AACjC,MAAA;AACA,MAAA;AAGY,mBAAA,KAAK,MAAM,iBAAiB;AAAA,WACnC,GAAG;AACL,UAAA,IAAI,MAAM,gBAAgB,+BAA+B;AAAA,EAChE;AACO,SAAA,eAAe,QAAQ,YAAY,EAAE;AAC7C;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textToSpecifics.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/textToSpecifics.ts"],"sourcesContent":["import { Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const textToSpecifics = <Text extends SlateText = SlateText>(textNode: Text): TextSpecifics<Text> => {\n\tconst { text, ...specifics } = textNode\n\treturn specifics\n}\n"],"names":[],"mappings":";;AAGa,MAAA,kBAAkB,CAAqC,aAAwC;AAC3G,QAAM,EAAE,MAAM,GAAG,UAAA,IAAc;AACxB,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textToSpecifics.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/textToSpecifics.ts"],"sourcesContent":["import { Text as SlateText } from 'slate'\nimport { TextSpecifics } from '../../types/editor'\n\nexport const textToSpecifics = <Text extends SlateText = SlateText>(textNode: Text): TextSpecifics<Text> => {\n\tconst { text, ...specifics } = textNode\n\treturn specifics\n}\n"],"names":[],"mappings":"AAGa,MAAA,kBAAkB,CAAqC,aAAwC;AAC3G,QAAM,EAAE,MAAM,GAAG,UAAA,IAAc;AACxB,SAAA;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toLatestFormat.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/toLatestFormat.ts"],"sourcesContent":["import { BindingError } from '@contember/react-binding'\nimport { Editor as SlateEditor, Element as SlateElement } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const toLatestFormat = <E extends SlateEditor>(\n\teditor: E,\n\tpotentiallyOldNode: SerializableEditorNode,\n): SerializableEditorNode => {\n\tif (potentiallyOldNode.formatVersion === editor.formatVersion) {\n\t\treturn potentiallyOldNode\n\t}\n\tif (potentiallyOldNode.formatVersion > editor.formatVersion) {\n\t\t// Boy oh boy, do we have a situation…\n\t\treturn potentiallyOldNode // Just hope it's at least somewhat backwards compatible.\n\t}\n\tlet formatNumber = potentiallyOldNode.formatVersion\n\ttry {\n\t\tfor (; formatNumber < editor.formatVersion; formatNumber++) {\n\t\t\tpotentiallyOldNode = {\n\t\t\t\tformatVersion: formatNumber + 1,\n\t\t\t\tchildren: potentiallyOldNode.children.map(oldChild =>\n\t\t\t\t\teditor.upgradeFormatBySingleVersion(oldChild, formatNumber),\n\t\t\t\t) as SlateElement[],\n\t\t\t}\n\t\t}\n\t\treturn potentiallyOldNode\n\t} catch (e) {\n\t\tconst genericMessage = `Failed to upgrade editor format from version ${formatNumber}.`\n\t\tif (e instanceof RangeError) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`${genericMessage}\\nDetected a stack overflow. ` +\n\t\t\t\t\t`Perhaps you incorrectly implemented 'upgradeFormatBySingleVersion'?`,\n\t\t\t)\n\t\t}\n\t\tthrow new BindingError(genericMessage)\n\t}\n}\n"],"names":["BindingError"],"mappings":";;;AAIa,MAAA,iBAAiB,CAC7B,QACA,uBAC4B;AACxB,MAAA,mBAAmB,kBAAkB,OAAO,eAAe;AACvD,WAAA;AAAA,EACR;AACI,MAAA,mBAAmB,gBAAgB,OAAO,eAAe;AAErD,WAAA;AAAA,EACR;AACA,MAAI,eAAe,mBAAmB;AAClC,MAAA;AACI,WAAA,eAAe,OAAO,eAAe,gBAAgB;AACtC,2BAAA;AAAA,QACpB,eAAe,eAAe;AAAA,QAC9B,UAAU,mBAAmB,SAAS;AAAA,UAAI,CACzC,aAAA,OAAO,6BAA6B,UAAU,YAAY;AAAA,QAC3D;AAAA,MAAA;AAAA,IAEF;AACO,WAAA;AAAA,WACC,GAAG;AACL,UAAA,iBAAiB,gDAAgD,YAAY;AACnF,QAAI,aAAa,YAAY;AAC5B,YAAM,IAAIA,aAAA;AAAA,QACT,GAAG,cAAc;AAAA;AAAA,MAAA;AAAA,IAGnB;AACM,UAAA,IAAIA,aAAAA,aAAa,cAAc;AAAA,EACtC;AACD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toLatestFormat.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/toLatestFormat.ts"],"sourcesContent":["import { BindingError } from '@contember/react-binding'\nimport { Editor as SlateEditor, Element as SlateElement } from 'slate'\nimport { SerializableEditorNode } from '../../types/editor'\n\nexport const toLatestFormat = <E extends SlateEditor>(\n\teditor: E,\n\tpotentiallyOldNode: SerializableEditorNode,\n): SerializableEditorNode => {\n\tif (potentiallyOldNode.formatVersion === editor.formatVersion) {\n\t\treturn potentiallyOldNode\n\t}\n\tif (potentiallyOldNode.formatVersion > editor.formatVersion) {\n\t\t// Boy oh boy, do we have a situation…\n\t\treturn potentiallyOldNode // Just hope it's at least somewhat backwards compatible.\n\t}\n\tlet formatNumber = potentiallyOldNode.formatVersion\n\ttry {\n\t\tfor (; formatNumber < editor.formatVersion; formatNumber++) {\n\t\t\tpotentiallyOldNode = {\n\t\t\t\tformatVersion: formatNumber + 1,\n\t\t\t\tchildren: potentiallyOldNode.children.map(oldChild =>\n\t\t\t\t\teditor.upgradeFormatBySingleVersion(oldChild, formatNumber),\n\t\t\t\t) as SlateElement[],\n\t\t\t}\n\t\t}\n\t\treturn potentiallyOldNode\n\t} catch (e) {\n\t\tconst genericMessage = `Failed to upgrade editor format from version ${formatNumber}.`\n\t\tif (e instanceof RangeError) {\n\t\t\tthrow new BindingError(\n\t\t\t\t`${genericMessage}\\nDetected a stack overflow. ` +\n\t\t\t\t\t`Perhaps you incorrectly implemented 'upgradeFormatBySingleVersion'?`,\n\t\t\t)\n\t\t}\n\t\tthrow new BindingError(genericMessage)\n\t}\n}\n"],"names":[],"mappings":";AAIa,MAAA,iBAAiB,CAC7B,QACA,uBAC4B;AACxB,MAAA,mBAAmB,kBAAkB,OAAO,eAAe;AACvD,WAAA;AAAA,EACR;AACI,MAAA,mBAAmB,gBAAgB,OAAO,eAAe;AAErD,WAAA;AAAA,EACR;AACA,MAAI,eAAe,mBAAmB;AAClC,MAAA;AACI,WAAA,eAAe,OAAO,eAAe,gBAAgB;AACtC,2BAAA;AAAA,QACpB,eAAe,eAAe;AAAA,QAC9B,UAAU,mBAAmB,SAAS;AAAA,UAAI,CACzC,aAAA,OAAO,6BAA6B,UAAU,YAAY;AAAA,QAC3D;AAAA,MAAA;AAAA,IAEF;AACO,WAAA;AAAA,WACC,GAAG;AACL,UAAA,iBAAiB,gDAAgD,YAAY;AACnF,QAAI,aAAa,YAAY;AAC5B,YAAM,IAAI;AAAA,QACT,GAAG,cAAc;AAAA;AAAA,MAAA;AAAA,IAGnB;AACM,UAAA,IAAI,aAAa,cAAc;AAAA,EACtC;AACD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topLevelNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/topLevelNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement } from 'slate'\n\nexport const topLevelNodes = <E extends SlateEditor>(editor: E) => {\n\t// We manually filter out void nodes because it appears that Slate doesn't respect the voids setting from here.\n\t// The combination of isElement and mode: 'highest' is really just a roundabout way of excluding the Editor.\n\treturn SlateEditor.nodes(editor, {\n\t\tmatch: node => SlateElement.isElement(node) && !editor.isVoid(node),\n\t\tmode: 'highest',\n\t\tvoids: false,\n\t})\n}\n"],"names":["SlateEditor","SlateElement"],"mappings":";;;AAEa,MAAA,gBAAgB,CAAwB,WAAc;AAG3D,SAAAA,MAAA,OAAY,MAAM,QAAQ;AAAA,IAChC,OAAO,UAAQC,MAAAA,QAAa,UAAU,IAAI,KAAK,CAAC,OAAO,OAAO,IAAI;AAAA,IAClE,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,CACP;AACF;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topLevelNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/editor/methods/topLevelNodes.ts"],"sourcesContent":["import { Editor as SlateEditor, Element as SlateElement } from 'slate'\n\nexport const topLevelNodes = <E extends SlateEditor>(editor: E) => {\n\t// We manually filter out void nodes because it appears that Slate doesn't respect the voids setting from here.\n\t// The combination of isElement and mode: 'highest' is really just a roundabout way of excluding the Editor.\n\treturn SlateEditor.nodes(editor, {\n\t\tmatch: node => SlateElement.isElement(node) && !editor.isVoid(node),\n\t\tmode: 'highest',\n\t\tvoids: false,\n\t})\n}\n"],"names":["SlateEditor","SlateElement"],"mappings":";AAEa,MAAA,gBAAgB,CAAwB,WAAc;AAG3D,SAAAA,OAAY,MAAM,QAAQ;AAAA,IAChC,OAAO,UAAQC,QAAa,UAAU,IAAI,KAAK,CAAC,OAAO,OAAO,IAAI;AAAA,IAClE,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,CACP;AACF;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const slateReact = require("slate-react");
|
|
5
|
+
const DefaultElement = ({ attributes, children, element }) => {
|
|
6
|
+
const editor = slateReact.useSlateStatic();
|
|
7
|
+
return React.createElement(editor.isInline(element) ? "span" : "div", attributes, children);
|
|
8
|
+
};
|
|
9
|
+
DefaultElement.displayName = "DefaultElement";
|
|
10
|
+
exports.DefaultElement = DefaultElement;
|
|
11
|
+
//# sourceMappingURL=DefaultElement.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultElement.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/components/DefaultElement.tsx"],"sourcesContent":["import { createElement, FunctionComponent } from 'react'\nimport { RenderElementProps, useSlateStatic } from 'slate-react'\n\nexport interface DefaultElementProps extends RenderElementProps {}\n\nexport const DefaultElement: FunctionComponent<DefaultElementProps> = ({ attributes, children, element }) => {\n\tconst editor = useSlateStatic()\n\n\treturn createElement(editor.isInline(element) ? 'span' : 'div', attributes, children)\n}\nDefaultElement.displayName = 'DefaultElement'\n"],"names":["useSlateStatic","createElement"],"mappings":";;;;AAKO,MAAM,iBAAyD,CAAC,EAAE,YAAY,UAAU,cAAc;AAC5G,QAAM,SAASA,WAAAA;AAER,SAAAC,MAAA,cAAc,OAAO,SAAS,OAAO,IAAI,SAAS,OAAO,YAAY,QAAQ;AACrF;AACA,eAAe,cAAc;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultElement.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/components/DefaultElement.tsx"],"sourcesContent":["import { createElement, FunctionComponent } from 'react'\nimport { RenderElementProps, useSlateStatic } from 'slate-react'\n\nexport interface DefaultElementProps extends RenderElementProps {}\n\nexport const DefaultElement: FunctionComponent<DefaultElementProps> = ({ attributes, children, element }) => {\n\tconst editor = useSlateStatic()\n\n\treturn createElement(editor.isInline(element) ? 'span' : 'div', attributes, children)\n}\nDefaultElement.displayName = 'DefaultElement'\n"],"names":[],"mappings":";;AAKO,MAAM,iBAAyD,CAAC,EAAE,YAAY,UAAU,cAAc;AAC5G,QAAM,SAAS;AAER,SAAA,cAAc,OAAO,SAAS,OAAO,IAAI,SAAS,OAAO,YAAY,QAAQ;AACrF;AACA,eAAe,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRichTextFieldNodes.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/hooks/useRichTextFieldNodes.ts"],"sourcesContent":["import { BindingError, FieldAccessor } from '@contember/react-binding'\nimport { Descendant, Editor } from 'slate'\n\nexport interface UseRichTextFieldEditorNodeOptions {\n\teditor: Editor\n\tfieldAccessor: FieldAccessor<string>\n\tcontemberFieldElementCache: WeakMap<FieldAccessor<string>, Descendant[]>\n}\n\nexport const useRichTextFieldNodes = ({\n\teditor,\n\tfieldAccessor,\n\tcontemberFieldElementCache,\n}: UseRichTextFieldEditorNodeOptions): Descendant[] => {\n\tif (contemberFieldElementCache.has(fieldAccessor)) {\n\t\treturn contemberFieldElementCache.get(fieldAccessor)!\n\t}\n\n\tconst fieldValue = fieldAccessor.value\n\tif (typeof fieldValue !== 'string' && fieldValue !== null) {\n\t\tthrow new BindingError(`RichTextField: the underlying field does not contain a string value.`)\n\t}\n\n\tconst elements: Descendant[] =\n\t\tfieldValue === null || fieldValue === ''\n\t\t\t? [editor.createDefaultElement([{ text: '' }])]\n\t\t\t: [\n\t\t\t\teditor.createDefaultElement(\n\t\t\t\t\teditor.deserializeNodes(\n\t\t\t\t\t\tfieldValue,\n\t\t\t\t\t\t`RichTextField: the underlying field contains invalid JSON.`,\n\t\t\t\t\t) as Descendant[],\n\t\t\t\t),\n\t\t\t ]\n\tcontemberFieldElementCache.set(fieldAccessor, elements)\n\n\treturn elements\n}\n"],"names":["BindingError"],"mappings":";;;AASO,MAAM,wBAAwB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACD,MAAuD;AAClD,MAAA,2BAA2B,IAAI,aAAa,GAAG;AAC3C,WAAA,2BAA2B,IAAI,aAAa;AAAA,EACpD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AACpD,UAAA,IAAIA,0BAAa,sEAAsE;AAAA,EAC9F;AAEA,QAAM,WACL,eAAe,QAAQ,eAAe,KACnC,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAI,CAAA,CAAC,CAAC,IAC5C;AAAA,IACD,OAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EAAA;AAEwB,6BAAA,IAAI,eAAe,QAAQ;AAE/C,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRichTextFieldNodes.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/hooks/useRichTextFieldNodes.ts"],"sourcesContent":["import { BindingError, FieldAccessor } from '@contember/react-binding'\nimport { Descendant, Editor } from 'slate'\n\nexport interface UseRichTextFieldEditorNodeOptions {\n\teditor: Editor\n\tfieldAccessor: FieldAccessor<string>\n\tcontemberFieldElementCache: WeakMap<FieldAccessor<string>, Descendant[]>\n}\n\nexport const useRichTextFieldNodes = ({\n\teditor,\n\tfieldAccessor,\n\tcontemberFieldElementCache,\n}: UseRichTextFieldEditorNodeOptions): Descendant[] => {\n\tif (contemberFieldElementCache.has(fieldAccessor)) {\n\t\treturn contemberFieldElementCache.get(fieldAccessor)!\n\t}\n\n\tconst fieldValue = fieldAccessor.value\n\tif (typeof fieldValue !== 'string' && fieldValue !== null) {\n\t\tthrow new BindingError(`RichTextField: the underlying field does not contain a string value.`)\n\t}\n\n\tconst elements: Descendant[] =\n\t\tfieldValue === null || fieldValue === ''\n\t\t\t? [editor.createDefaultElement([{ text: '' }])]\n\t\t\t: [\n\t\t\t\teditor.createDefaultElement(\n\t\t\t\t\teditor.deserializeNodes(\n\t\t\t\t\t\tfieldValue,\n\t\t\t\t\t\t`RichTextField: the underlying field contains invalid JSON.`,\n\t\t\t\t\t) as Descendant[],\n\t\t\t\t),\n\t\t\t ]\n\tcontemberFieldElementCache.set(fieldAccessor, elements)\n\n\treturn elements\n}\n"],"names":[],"mappings":";AASO,MAAM,wBAAwB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACD,MAAuD;AAClD,MAAA,2BAA2B,IAAI,aAAa,GAAG;AAC3C,WAAA,2BAA2B,IAAI,aAAa;AAAA,EACpD;AAEA,QAAM,aAAa,cAAc;AACjC,MAAI,OAAO,eAAe,YAAY,eAAe,MAAM;AACpD,UAAA,IAAI,aAAa,sEAAsE;AAAA,EAC9F;AAEA,QAAM,WACL,eAAe,QAAQ,eAAe,KACnC,CAAC,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAI,CAAA,CAAC,CAAC,IAC5C;AAAA,IACD,OAAO;AAAA,MACN,OAAO;AAAA,QACN;AAAA,QACA;AAAA,MACD;AAAA,IACD;AAAA,EAAA;AAEwB,6BAAA,IAAI,eAAe,QAAQ;AAE/C,SAAA;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorPasteUtils.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/EditorPasteUtils.ts"],"sourcesContent":["import { Element } from 'slate'\nimport { NodesWithType } from '../../plugins/behaviour/paste/HtmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../types/editor'\n\nexport class EditorPasteUtils {\n\tpublic static wordPasteListItemContent(allNodes: Iterable<Node> | ArrayLike<Node>): Node[] {\n\t\tconst nodes: Node[] = []\n\t\tlet ignoring = false\n\t\tlet forProcessing = Array.from(allNodes)\n\t\tif (\n\t\t\t(forProcessing.length === 1 && forProcessing[0].nodeName === 'SPAN') ||\n\t\t\t\t(forProcessing.length === 2 && forProcessing[0].nodeName === 'SPAN' && forProcessing[1].nodeName === 'O:P')\n\t\t) {\n\t\t\tforProcessing = Array.from(forProcessing[0].childNodes)\n\t\t}\n\n\t\tfor (const node of forProcessing) {\n\t\t\tconst isStartIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[if !supportLists]'\n\t\t\tif (isStartIgnore) {\n\t\t\t\tignoring = true\n\t\t\t} else {\n\t\t\t\tconst isEndIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[endif]'\n\t\t\t\tif (isEndIgnore) {\n\t\t\t\t\tignoring = false\n\t\t\t\t} else {\n\t\t\t\t\tif (!ignoring) {\n\t\t\t\t\t\tnodes.push(node)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nodes\n\t}\n\n\tpublic static flattenNodesWithType(withType: NodesWithType[], defaultElementFactory: EditorDefaultElementFactory): NodesWithType {\n\t\tconst withTypeFiltered = withType.filter((item): item is Exclude<NodesWithType, null> => item !== null)\n\t\tconst containsBlock = withTypeFiltered.find(({ elements }) => elements !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: withTypeFiltered.flatMap<Element>(item => {\n\t\t\t\t\tif (item.elements === undefined) {\n\t\t\t\t\t\treturn [defaultElementFactory(item.texts)]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn item.elements\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: withTypeFiltered.flatMap(item => item.texts!) }\n\t\t}\n\t}\n}\n"],"names":[],"mappings":";;AAIO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,yBAAyB,UAAoD;AAC1F,UAAM,QAAgB,CAAA;AACtB,QAAI,WAAW;AACX,QAAA,gBAAgB,MAAM,KAAK,QAAQ;AAErC,QAAA,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAC3D,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAAU,cAAc,CAAC,EAAE,aAAa,OACrG;AACD,sBAAgB,MAAM,KAAK,cAAc,CAAC,EAAE,UAAU;AAAA,IACvD;AAEA,eAAW,QAAQ,eAAe;AACjC,YAAM,gBAAgB,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAChF,UAAI,eAAe;AACP,mBAAA;AAAA,MAAA,OACL;AACN,cAAM,cAAc,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAC9E,YAAI,aAAa;AACL,qBAAA;AAAA,QAAA,OACL;AACN,cAAI,CAAC,UAAU;AACd,kBAAM,KAAK,IAAI;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAc,qBAAqB,UAA2B,uBAAoE;AACjI,UAAM,mBAAmB,SAAS,OAAO,CAAC,SAA+C,SAAS,IAAI;AAChG,UAAA,gBAAgB,iBAAiB,KAAK,CAAC,EAAE,eAAe,aAAa,MAAS,MAAM;AAE1F,QAAI,eAAe;AACX,aAAA;AAAA,QACN,UAAU,iBAAiB,QAAiB,CAAQ,SAAA;AAC/C,cAAA,KAAK,aAAa,QAAW;AAChC,mBAAO,CAAC,sBAAsB,KAAK,KAAK,CAAC;AAAA,UAAA,OACnC;AACN,mBAAO,KAAK;AAAA,UACb;AAAA,QAAA,CACA;AAAA,MAAA;AAAA,IACF,OACM;AACN,aAAO,EAAE,OAAO,iBAAiB,QAAQ,CAAQ,SAAA,KAAK,KAAM;IAC7D;AAAA,EACD;AACD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorPasteUtils.js","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/EditorPasteUtils.ts"],"sourcesContent":["import { Element } from 'slate'\nimport { NodesWithType } from '../../plugins/behaviour/paste/HtmlDeserializer'\nimport { EditorDefaultElementFactory } from '../../types/editor'\n\nexport class EditorPasteUtils {\n\tpublic static wordPasteListItemContent(allNodes: Iterable<Node> | ArrayLike<Node>): Node[] {\n\t\tconst nodes: Node[] = []\n\t\tlet ignoring = false\n\t\tlet forProcessing = Array.from(allNodes)\n\t\tif (\n\t\t\t(forProcessing.length === 1 && forProcessing[0].nodeName === 'SPAN') ||\n\t\t\t\t(forProcessing.length === 2 && forProcessing[0].nodeName === 'SPAN' && forProcessing[1].nodeName === 'O:P')\n\t\t) {\n\t\t\tforProcessing = Array.from(forProcessing[0].childNodes)\n\t\t}\n\n\t\tfor (const node of forProcessing) {\n\t\t\tconst isStartIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[if !supportLists]'\n\t\t\tif (isStartIgnore) {\n\t\t\t\tignoring = true\n\t\t\t} else {\n\t\t\t\tconst isEndIgnore = node.nodeType === Node.COMMENT_NODE && node.nodeValue === '[endif]'\n\t\t\t\tif (isEndIgnore) {\n\t\t\t\t\tignoring = false\n\t\t\t\t} else {\n\t\t\t\t\tif (!ignoring) {\n\t\t\t\t\t\tnodes.push(node)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nodes\n\t}\n\n\tpublic static flattenNodesWithType(withType: NodesWithType[], defaultElementFactory: EditorDefaultElementFactory): NodesWithType {\n\t\tconst withTypeFiltered = withType.filter((item): item is Exclude<NodesWithType, null> => item !== null)\n\t\tconst containsBlock = withTypeFiltered.find(({ elements }) => elements !== undefined) !== undefined\n\n\t\tif (containsBlock) {\n\t\t\treturn {\n\t\t\t\telements: withTypeFiltered.flatMap<Element>(item => {\n\t\t\t\t\tif (item.elements === undefined) {\n\t\t\t\t\t\treturn [defaultElementFactory(item.texts)]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn item.elements\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t}\n\t\t} else {\n\t\t\treturn { texts: withTypeFiltered.flatMap(item => item.texts!) }\n\t\t}\n\t}\n}\n"],"names":[],"mappings":"AAIO,MAAM,iBAAiB;AAAA,EAC7B,OAAc,yBAAyB,UAAoD;AAC1F,UAAM,QAAgB,CAAA;AACtB,QAAI,WAAW;AACX,QAAA,gBAAgB,MAAM,KAAK,QAAQ;AAErC,QAAA,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAC3D,cAAc,WAAW,KAAK,cAAc,CAAC,EAAE,aAAa,UAAU,cAAc,CAAC,EAAE,aAAa,OACrG;AACD,sBAAgB,MAAM,KAAK,cAAc,CAAC,EAAE,UAAU;AAAA,IACvD;AAEA,eAAW,QAAQ,eAAe;AACjC,YAAM,gBAAgB,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAChF,UAAI,eAAe;AACP,mBAAA;AAAA,MAAA,OACL;AACN,cAAM,cAAc,KAAK,aAAa,KAAK,gBAAgB,KAAK,cAAc;AAC9E,YAAI,aAAa;AACL,qBAAA;AAAA,QAAA,OACL;AACN,cAAI,CAAC,UAAU;AACd,kBAAM,KAAK,IAAI;AAAA,UAChB;AAAA,QACD;AAAA,MACD;AAAA,IACD;AACO,WAAA;AAAA,EACR;AAAA,EAEA,OAAc,qBAAqB,UAA2B,uBAAoE;AACjI,UAAM,mBAAmB,SAAS,OAAO,CAAC,SAA+C,SAAS,IAAI;AAChG,UAAA,gBAAgB,iBAAiB,KAAK,CAAC,EAAE,eAAe,aAAa,MAAS,MAAM;AAE1F,QAAI,eAAe;AACX,aAAA;AAAA,QACN,UAAU,iBAAiB,QAAiB,CAAQ,SAAA;AAC/C,cAAA,KAAK,aAAa,QAAW;AAChC,mBAAO,CAAC,sBAAsB,KAAK,KAAK,CAAC;AAAA,UAAA,OACnC;AACN,mBAAO,KAAK;AAAA,UACb;AAAA,QAAA,CACA;AAAA,MAAA;AAAA,IACF,OACM;AACN,aAAO,EAAE,OAAO,iBAAiB,QAAQ,CAAQ,SAAA,KAAK,KAAM;IAC7D;AAAA,EACD;AACD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseUrl.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/internal/utils/parseUrl.ts"],"sourcesContent":["export const parseUrl = (url: string): URL | undefined => {\n\tif (url.length < 4 || url.includes(' ')) {\n\t\t// This is almost definitely not an url anyway.\n\t\t// By returning early, we avoid the relatively costly URL constructor and can speed up the most common case of\n\t\t// just inserting a single character which better be as fast as possible.\n\t\treturn undefined\n\t}\n\ttry {\n\t\treturn new URL(url)\n\t} catch {\n\t\treturn undefined\n\t}\n}\n"],"names":[],"mappings":";;AAAa,MAAA,WAAW,CAAC,QAAiC;AACzD,MAAI,IAAI,SAAS,KAAK,IAAI,SAAS,GAAG,GAAG;AAIjC,WAAA;AAAA,EACR;AACI,MAAA;AACI,WAAA,IAAI,IAAI,GAAG;AAAA,EAAA,QACX;AACA,WAAA;AAAA,EACR;AACD;;"}
|