@contember/react-slate-editor-base 2.1.0-beta.2 → 2.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/development/src/components/RichTextEditor.cjs.map +1 -1
- package/dist/development/src/components/RichTextEditor.js.map +1 -1
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -1
- package/dist/development/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -1
- package/dist/development/src/editor/createEditor.cjs.map +1 -1
- package/dist/development/src/editor/createEditor.js.map +1 -1
- package/dist/development/src/editor/createEditorWithEssentials.cjs.map +1 -1
- package/dist/development/src/editor/createEditorWithEssentials.js.map +1 -1
- package/dist/development/src/editor/index.cjs.map +1 -1
- package/dist/development/src/editor/index.js.map +1 -1
- package/dist/development/src/editor/methods/addMarks.cjs.map +1 -1
- package/dist/development/src/editor/methods/addMarks.js.map +1 -1
- package/dist/development/src/editor/methods/closestBlockEntry.cjs.map +1 -1
- package/dist/development/src/editor/methods/closestBlockEntry.js.map +1 -1
- package/dist/development/src/editor/methods/closestViableBlockContainerEntry.cjs.map +1 -1
- package/dist/development/src/editor/methods/closestViableBlockContainerEntry.js.map +1 -1
- package/dist/development/src/editor/methods/hasMarks.cjs.map +1 -1
- package/dist/development/src/editor/methods/hasMarks.js.map +1 -1
- package/dist/development/src/editor/methods/hasParentOfType.cjs.map +1 -1
- package/dist/development/src/editor/methods/hasParentOfType.js.map +1 -1
- package/dist/development/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -1
- package/dist/development/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -1
- package/dist/development/src/editor/methods/removeMarks.cjs.map +1 -1
- package/dist/development/src/editor/methods/removeMarks.js.map +1 -1
- package/dist/development/src/editor/methods/serializeNodes.cjs.map +1 -1
- package/dist/development/src/editor/methods/serializeNodes.js.map +1 -1
- package/dist/development/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -1
- package/dist/development/src/editor/methods/strictlyDeserializeNodes.js.map +1 -1
- package/dist/development/src/editor/methods/textToSpecifics.cjs.map +1 -1
- package/dist/development/src/editor/methods/textToSpecifics.js.map +1 -1
- package/dist/development/src/editor/methods/toLatestFormat.cjs.map +1 -1
- package/dist/development/src/editor/methods/toLatestFormat.js.map +1 -1
- package/dist/development/src/internal/utils/EditorPasteUtils.cjs.map +1 -1
- package/dist/development/src/internal/utils/EditorPasteUtils.js.map +1 -1
- package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -1
- package/dist/development/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -1
- package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -1
- package/dist/development/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -1
- package/dist/development/src/plugins/behaviour/paste/withPaste.cjs.map +1 -1
- package/dist/development/src/plugins/behaviour/paste/withPaste.js.map +1 -1
- package/dist/development/src/plugins/element/anchors/AnchorElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/anchors/AnchorElement.js.map +1 -1
- package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -1
- package/dist/development/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -1
- package/dist/development/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -1
- package/dist/development/src/plugins/element/anchors/AnchorModifications.js.map +1 -1
- package/dist/development/src/plugins/element/anchors/withAnchors.cjs.map +1 -1
- package/dist/development/src/plugins/element/anchors/withAnchors.js.map +1 -1
- package/dist/development/src/plugins/element/headings/HeadingElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/headings/HeadingElement.js.map +1 -1
- package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -1
- package/dist/development/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -1
- package/dist/development/src/plugins/element/headings/withHeadings.cjs.map +1 -1
- package/dist/development/src/plugins/element/headings/withHeadings.js.map +1 -1
- package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -1
- package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -1
- package/dist/development/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -1
- package/dist/development/src/plugins/element/lists/ListElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/ListElement.js.map +1 -1
- package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -1
- package/dist/development/src/plugins/element/lists/ListItemElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/ListItemElement.js.map +1 -1
- package/dist/development/src/plugins/element/lists/OrderedListElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/OrderedListElement.js.map +1 -1
- package/dist/development/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/UnorderedListElement.js.map +1 -1
- package/dist/development/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -1
- package/dist/development/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/transforms/indentListItem.js.map +1 -1
- package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -1
- package/dist/development/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -1
- package/dist/development/src/plugins/element/lists/withLists.cjs.map +1 -1
- package/dist/development/src/plugins/element/lists/withLists.js.map +1 -1
- package/dist/development/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -1
- package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -1
- package/dist/development/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -1
- package/dist/development/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -1
- package/dist/development/src/plugins/element/paragraphs/withParagraphs.js.map +1 -1
- package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -1
- package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -1
- package/dist/development/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -1
- package/dist/development/src/plugins/element/tables/TableCellElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/tables/TableCellElement.js.map +1 -1
- package/dist/development/src/plugins/element/tables/TableElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/tables/TableElement.js.map +1 -1
- package/dist/development/src/plugins/element/tables/TableElementSelection.cjs.map +1 -1
- package/dist/development/src/plugins/element/tables/TableElementSelection.js.map +1 -1
- package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +1 -1
- package/dist/development/src/plugins/element/tables/TableHtmlDeserializer.js.map +1 -1
- package/dist/development/src/plugins/element/tables/TableModifications.cjs.map +1 -1
- package/dist/development/src/plugins/element/tables/TableModifications.js.map +1 -1
- package/dist/development/src/plugins/element/tables/TableRowElement.cjs.map +1 -1
- package/dist/development/src/plugins/element/tables/TableRowElement.js.map +1 -1
- package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -1
- package/dist/development/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -1
- package/dist/development/src/plugins/element/tables/withTables.cjs.map +1 -1
- package/dist/development/src/plugins/element/tables/withTables.js.map +1 -1
- package/dist/development/src/plugins/text/bold/boldMark.cjs.map +1 -1
- package/dist/development/src/plugins/text/bold/boldMark.js.map +1 -1
- package/dist/development/src/plugins/text/bold/withBold.cjs.map +1 -1
- package/dist/development/src/plugins/text/bold/withBold.js.map +1 -1
- package/dist/development/src/plugins/text/code/codeMark.cjs.map +1 -1
- package/dist/development/src/plugins/text/code/codeMark.js.map +1 -1
- package/dist/development/src/plugins/text/code/withCode.cjs.map +1 -1
- package/dist/development/src/plugins/text/code/withCode.js.map +1 -1
- package/dist/development/src/plugins/text/highlight/highlightMark.cjs.map +1 -1
- package/dist/development/src/plugins/text/highlight/highlightMark.js.map +1 -1
- package/dist/development/src/plugins/text/highlight/withHighlight.cjs.map +1 -1
- package/dist/development/src/plugins/text/highlight/withHighlight.js.map +1 -1
- package/dist/development/src/plugins/text/italic/italicMark.cjs.map +1 -1
- package/dist/development/src/plugins/text/italic/italicMark.js.map +1 -1
- package/dist/development/src/plugins/text/italic/withItalic.cjs.map +1 -1
- package/dist/development/src/plugins/text/italic/withItalic.js.map +1 -1
- package/dist/development/src/plugins/text/newline/withNewline.cjs.map +1 -1
- package/dist/development/src/plugins/text/newline/withNewline.js.map +1 -1
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -1
- package/dist/development/src/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -1
- package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -1
- package/dist/development/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -1
- package/dist/development/src/plugins/text/underline/underlineMark.cjs.map +1 -1
- package/dist/development/src/plugins/text/underline/underlineMark.js.map +1 -1
- package/dist/development/src/plugins/text/underline/withUnderline.cjs.map +1 -1
- package/dist/development/src/plugins/text/underline/withUnderline.js.map +1 -1
- package/dist/production/src/components/RichTextEditor.cjs.map +1 -1
- package/dist/production/src/components/RichTextEditor.js.map +1 -1
- package/dist/production/src/components/triggers/EditorWrapNodeTrigger.cjs.map +1 -1
- package/dist/production/src/components/triggers/EditorWrapNodeTrigger.js.map +1 -1
- package/dist/production/src/editor/createEditor.cjs.map +1 -1
- package/dist/production/src/editor/createEditor.js.map +1 -1
- package/dist/production/src/editor/createEditorWithEssentials.cjs.map +1 -1
- package/dist/production/src/editor/createEditorWithEssentials.js.map +1 -1
- package/dist/production/src/editor/index.cjs.map +1 -1
- package/dist/production/src/editor/index.js.map +1 -1
- package/dist/production/src/editor/methods/addMarks.cjs.map +1 -1
- package/dist/production/src/editor/methods/addMarks.js.map +1 -1
- package/dist/production/src/editor/methods/closestBlockEntry.cjs.map +1 -1
- package/dist/production/src/editor/methods/closestBlockEntry.js.map +1 -1
- package/dist/production/src/editor/methods/closestViableBlockContainerEntry.cjs.map +1 -1
- package/dist/production/src/editor/methods/closestViableBlockContainerEntry.js.map +1 -1
- package/dist/production/src/editor/methods/hasMarks.cjs.map +1 -1
- package/dist/production/src/editor/methods/hasMarks.js.map +1 -1
- package/dist/production/src/editor/methods/hasParentOfType.cjs.map +1 -1
- package/dist/production/src/editor/methods/hasParentOfType.js.map +1 -1
- package/dist/production/src/editor/methods/permissivelyDeserializeNodes.cjs.map +1 -1
- package/dist/production/src/editor/methods/permissivelyDeserializeNodes.js.map +1 -1
- package/dist/production/src/editor/methods/removeMarks.cjs.map +1 -1
- package/dist/production/src/editor/methods/removeMarks.js.map +1 -1
- package/dist/production/src/editor/methods/serializeNodes.cjs.map +1 -1
- package/dist/production/src/editor/methods/serializeNodes.js.map +1 -1
- package/dist/production/src/editor/methods/strictlyDeserializeNodes.cjs.map +1 -1
- package/dist/production/src/editor/methods/strictlyDeserializeNodes.js.map +1 -1
- package/dist/production/src/editor/methods/textToSpecifics.cjs.map +1 -1
- package/dist/production/src/editor/methods/textToSpecifics.js.map +1 -1
- package/dist/production/src/editor/methods/toLatestFormat.cjs.map +1 -1
- package/dist/production/src/editor/methods/toLatestFormat.js.map +1 -1
- package/dist/production/src/internal/utils/EditorPasteUtils.cjs.map +1 -1
- package/dist/production/src/internal/utils/EditorPasteUtils.js.map +1 -1
- package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.cjs.map +1 -1
- package/dist/production/src/plugins/behaviour/paste/HtmlDeserializer.js.map +1 -1
- package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.cjs.map +1 -1
- package/dist/production/src/plugins/behaviour/paste/createMarkHtmlDeserializer.js.map +1 -1
- package/dist/production/src/plugins/behaviour/paste/withPaste.cjs.map +1 -1
- package/dist/production/src/plugins/behaviour/paste/withPaste.js.map +1 -1
- package/dist/production/src/plugins/element/anchors/AnchorElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/anchors/AnchorElement.js.map +1 -1
- package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.cjs.map +1 -1
- package/dist/production/src/plugins/element/anchors/AnchorHtmlDeserializer.js.map +1 -1
- package/dist/production/src/plugins/element/anchors/AnchorModifications.cjs.map +1 -1
- package/dist/production/src/plugins/element/anchors/AnchorModifications.js.map +1 -1
- package/dist/production/src/plugins/element/anchors/withAnchors.cjs.map +1 -1
- package/dist/production/src/plugins/element/anchors/withAnchors.js.map +1 -1
- package/dist/production/src/plugins/element/headings/HeadingElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/headings/HeadingElement.js.map +1 -1
- package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.cjs.map +1 -1
- package/dist/production/src/plugins/element/headings/HeadingHtmlDeserializer.js.map +1 -1
- package/dist/production/src/plugins/element/headings/withHeadings.cjs.map +1 -1
- package/dist/production/src/plugins/element/headings/withHeadings.js.map +1 -1
- package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/horizonalRules/HorizontalRuleElement.js.map +1 -1
- package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.cjs.map +1 -1
- package/dist/production/src/plugins/element/horizonalRules/withHorizontalRules.js.map +1 -1
- package/dist/production/src/plugins/element/lists/ListElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/ListElement.js.map +1 -1
- package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/ListHtmlDeserializer.js.map +1 -1
- package/dist/production/src/plugins/element/lists/ListItemElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/ListItemElement.js.map +1 -1
- package/dist/production/src/plugins/element/lists/OrderedListElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/OrderedListElement.js.map +1 -1
- package/dist/production/src/plugins/element/lists/UnorderedListElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/UnorderedListElement.js.map +1 -1
- package/dist/production/src/plugins/element/lists/transforms/dedentListItem.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/transforms/dedentListItem.js.map +1 -1
- package/dist/production/src/plugins/element/lists/transforms/indentListItem.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/transforms/indentListItem.js.map +1 -1
- package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/transforms/normalizeListElement.js.map +1 -1
- package/dist/production/src/plugins/element/lists/transforms/toggleListElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/transforms/toggleListElement.js.map +1 -1
- package/dist/production/src/plugins/element/lists/withLists.cjs.map +1 -1
- package/dist/production/src/plugins/element/lists/withLists.js.map +1 -1
- package/dist/production/src/plugins/element/paragraphs/ParagraphElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/paragraphs/ParagraphElement.js.map +1 -1
- package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.cjs.map +1 -1
- package/dist/production/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.js.map +1 -1
- package/dist/production/src/plugins/element/paragraphs/withParagraphs.cjs.map +1 -1
- package/dist/production/src/plugins/element/paragraphs/withParagraphs.js.map +1 -1
- package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/scrollTargets/ScrollTargetElement.js.map +1 -1
- package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.cjs.map +1 -1
- package/dist/production/src/plugins/element/scrollTargets/withScrollTargets.js.map +1 -1
- package/dist/production/src/plugins/element/tables/TableCellElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/tables/TableCellElement.js.map +1 -1
- package/dist/production/src/plugins/element/tables/TableElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/tables/TableElement.js.map +1 -1
- package/dist/production/src/plugins/element/tables/TableElementSelection.cjs.map +1 -1
- package/dist/production/src/plugins/element/tables/TableElementSelection.js.map +1 -1
- package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.cjs.map +1 -1
- package/dist/production/src/plugins/element/tables/TableHtmlDeserializer.js.map +1 -1
- package/dist/production/src/plugins/element/tables/TableModifications.cjs.map +1 -1
- package/dist/production/src/plugins/element/tables/TableModifications.js.map +1 -1
- package/dist/production/src/plugins/element/tables/TableRowElement.cjs.map +1 -1
- package/dist/production/src/plugins/element/tables/TableRowElement.js.map +1 -1
- package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.cjs.map +1 -1
- package/dist/production/src/plugins/element/tables/gaugeTableColumnCount.js.map +1 -1
- package/dist/production/src/plugins/element/tables/withTables.cjs.map +1 -1
- package/dist/production/src/plugins/element/tables/withTables.js.map +1 -1
- package/dist/production/src/plugins/text/bold/boldMark.cjs.map +1 -1
- package/dist/production/src/plugins/text/bold/boldMark.js.map +1 -1
- package/dist/production/src/plugins/text/bold/withBold.cjs.map +1 -1
- package/dist/production/src/plugins/text/bold/withBold.js.map +1 -1
- package/dist/production/src/plugins/text/code/codeMark.cjs.map +1 -1
- package/dist/production/src/plugins/text/code/codeMark.js.map +1 -1
- package/dist/production/src/plugins/text/code/withCode.cjs.map +1 -1
- package/dist/production/src/plugins/text/code/withCode.js.map +1 -1
- package/dist/production/src/plugins/text/highlight/highlightMark.cjs.map +1 -1
- package/dist/production/src/plugins/text/highlight/highlightMark.js.map +1 -1
- package/dist/production/src/plugins/text/highlight/withHighlight.cjs.map +1 -1
- package/dist/production/src/plugins/text/highlight/withHighlight.js.map +1 -1
- package/dist/production/src/plugins/text/italic/italicMark.cjs.map +1 -1
- package/dist/production/src/plugins/text/italic/italicMark.js.map +1 -1
- package/dist/production/src/plugins/text/italic/withItalic.cjs.map +1 -1
- package/dist/production/src/plugins/text/italic/withItalic.js.map +1 -1
- package/dist/production/src/plugins/text/newline/withNewline.cjs.map +1 -1
- package/dist/production/src/plugins/text/newline/withNewline.js.map +1 -1
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.cjs.map +1 -1
- package/dist/production/src/plugins/text/strikeThrough/strikeThroughMark.js.map +1 -1
- package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.cjs.map +1 -1
- package/dist/production/src/plugins/text/strikeThrough/withStrikeThrough.js.map +1 -1
- package/dist/production/src/plugins/text/underline/underlineMark.cjs.map +1 -1
- package/dist/production/src/plugins/text/underline/underlineMark.js.map +1 -1
- package/dist/production/src/plugins/text/underline/withUnderline.cjs.map +1 -1
- package/dist/production/src/plugins/text/underline/withUnderline.js.map +1 -1
- package/dist/types/components/RichTextEditor.d.ts +1 -1
- package/dist/types/components/RichTextEditor.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/triggers/index.d.ts +4 -4
- package/dist/types/components/triggers/index.d.ts.map +1 -1
- 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 +11 -11
- package/dist/types/editor/index.d.ts.map +1 -1
- package/dist/types/editor/methods/addMarks.d.ts +1 -1
- package/dist/types/editor/methods/addMarks.d.ts.map +1 -1
- package/dist/types/editor/methods/closestBlockEntry.d.ts +1 -1
- package/dist/types/editor/methods/closestBlockEntry.d.ts.map +1 -1
- package/dist/types/editor/methods/hasMarks.d.ts +1 -1
- package/dist/types/editor/methods/hasMarks.d.ts.map +1 -1
- package/dist/types/editor/methods/index.d.ts +19 -19
- package/dist/types/editor/methods/index.d.ts.map +1 -1
- package/dist/types/editor/methods/removeMarks.d.ts +1 -1
- package/dist/types/editor/methods/removeMarks.d.ts.map +1 -1
- package/dist/types/editor/methods/textToSpecifics.d.ts +1 -1
- package/dist/types/editor/methods/textToSpecifics.d.ts.map +1 -1
- package/dist/types/editor/methods/toLatestFormat.d.ts +1 -1
- package/dist/types/editor/methods/toLatestFormat.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/internal/utils/EditorPasteUtils.d.ts +2 -2
- package/dist/types/internal/utils/EditorPasteUtils.d.ts.map +1 -1
- package/dist/types/internal/utils/index.d.ts +2 -2
- package/dist/types/internal/utils/index.d.ts.map +1 -1
- package/dist/types/plugins/attributes/alignment/index.d.ts +1 -1
- package/dist/types/plugins/attributes/alignment/index.d.ts.map +1 -1
- package/dist/types/plugins/attributes/index.d.ts +1 -1
- package/dist/types/plugins/attributes/index.d.ts.map +1 -1
- package/dist/types/plugins/behaviour/index.d.ts +1 -1
- package/dist/types/plugins/behaviour/index.d.ts.map +1 -1
- package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts +2 -2
- package/dist/types/plugins/behaviour/paste/HtmlDeserializer.d.ts.map +1 -1
- package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts +1 -1
- package/dist/types/plugins/behaviour/paste/createMarkHtmlDeserializer.d.ts.map +1 -1
- package/dist/types/plugins/behaviour/paste/index.d.ts +2 -2
- package/dist/types/plugins/behaviour/paste/index.d.ts.map +1 -1
- package/dist/types/plugins/element/anchors/AnchorElement.d.ts +1 -1
- package/dist/types/plugins/element/anchors/AnchorElement.d.ts.map +1 -1
- package/dist/types/plugins/element/anchors/AnchorHtmlDeserializer.d.ts +1 -1
- package/dist/types/plugins/element/anchors/AnchorHtmlDeserializer.d.ts.map +1 -1
- package/dist/types/plugins/element/anchors/index.d.ts +3 -3
- package/dist/types/plugins/element/anchors/index.d.ts.map +1 -1
- package/dist/types/plugins/element/anchors/withAnchors.d.ts +2 -2
- package/dist/types/plugins/element/anchors/withAnchors.d.ts.map +1 -1
- package/dist/types/plugins/element/headings/HeadingElement.d.ts +2 -2
- package/dist/types/plugins/element/headings/HeadingElement.d.ts.map +1 -1
- package/dist/types/plugins/element/headings/HeadingHtmlDeserializer.d.ts +1 -1
- package/dist/types/plugins/element/headings/HeadingHtmlDeserializer.d.ts.map +1 -1
- package/dist/types/plugins/element/headings/index.d.ts +3 -3
- package/dist/types/plugins/element/headings/index.d.ts.map +1 -1
- package/dist/types/plugins/element/headings/withHeadings.d.ts +2 -2
- package/dist/types/plugins/element/headings/withHeadings.d.ts.map +1 -1
- package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts +1 -1
- package/dist/types/plugins/element/horizonalRules/HorizontalRuleElement.d.ts.map +1 -1
- package/dist/types/plugins/element/horizonalRules/index.d.ts +2 -2
- package/dist/types/plugins/element/horizonalRules/index.d.ts.map +1 -1
- package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts +2 -2
- package/dist/types/plugins/element/horizonalRules/withHorizontalRules.d.ts.map +1 -1
- package/dist/types/plugins/element/index.d.ts +7 -7
- package/dist/types/plugins/element/index.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/ListElement.d.ts +2 -2
- package/dist/types/plugins/element/lists/ListElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts +1 -1
- package/dist/types/plugins/element/lists/ListHtmlDeserializer.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/ListItemElement.d.ts +1 -1
- package/dist/types/plugins/element/lists/ListItemElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/OrderedListElement.d.ts +1 -1
- package/dist/types/plugins/element/lists/OrderedListElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/UnorderedListElement.d.ts +1 -1
- package/dist/types/plugins/element/lists/UnorderedListElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/index.d.ts +5 -5
- package/dist/types/plugins/element/lists/index.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/transforms/dedentListItem.d.ts +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 +1 -1
- package/dist/types/plugins/element/lists/transforms/indentListItem.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/transforms/index.d.ts +4 -4
- package/dist/types/plugins/element/lists/transforms/index.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts +2 -2
- package/dist/types/plugins/element/lists/transforms/toggleListElement.d.ts.map +1 -1
- package/dist/types/plugins/element/lists/withLists.d.ts +4 -4
- package/dist/types/plugins/element/lists/withLists.d.ts.map +1 -1
- package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts +2 -2
- package/dist/types/plugins/element/paragraphs/ParagraphElement.d.ts.map +1 -1
- package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts +1 -1
- package/dist/types/plugins/element/paragraphs/ParagraphHtmlDeserializer.d.ts.map +1 -1
- package/dist/types/plugins/element/paragraphs/index.d.ts +3 -3
- package/dist/types/plugins/element/paragraphs/index.d.ts.map +1 -1
- package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts +2 -2
- package/dist/types/plugins/element/paragraphs/withParagraphs.d.ts.map +1 -1
- package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts +1 -1
- package/dist/types/plugins/element/scrollTargets/ScrollTargetElement.d.ts.map +1 -1
- package/dist/types/plugins/element/scrollTargets/index.d.ts +2 -2
- package/dist/types/plugins/element/scrollTargets/index.d.ts.map +1 -1
- package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts +2 -2
- package/dist/types/plugins/element/scrollTargets/withScrollTargets.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableCellElement.d.ts +1 -1
- package/dist/types/plugins/element/tables/TableCellElement.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableElement.d.ts +1 -1
- package/dist/types/plugins/element/tables/TableElement.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableElementSelection.d.ts +2 -2
- package/dist/types/plugins/element/tables/TableElementSelection.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableHtmlDeserializer.d.ts +1 -1
- package/dist/types/plugins/element/tables/TableHtmlDeserializer.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableModifications.d.ts +3 -3
- package/dist/types/plugins/element/tables/TableModifications.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/TableRowElement.d.ts +1 -1
- package/dist/types/plugins/element/tables/TableRowElement.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/gaugeTableColumnCount.d.ts +1 -1
- package/dist/types/plugins/element/tables/gaugeTableColumnCount.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/index.d.ts +5 -5
- package/dist/types/plugins/element/tables/index.d.ts.map +1 -1
- package/dist/types/plugins/element/tables/withTables.d.ts +4 -4
- package/dist/types/plugins/element/tables/withTables.d.ts.map +1 -1
- package/dist/types/plugins/index.d.ts +4 -4
- package/dist/types/plugins/index.d.ts.map +1 -1
- package/dist/types/plugins/text/bold/boldMark.d.ts +1 -1
- package/dist/types/plugins/text/bold/boldMark.d.ts.map +1 -1
- package/dist/types/plugins/text/bold/index.d.ts +2 -2
- package/dist/types/plugins/text/bold/index.d.ts.map +1 -1
- package/dist/types/plugins/text/bold/withBold.d.ts +1 -1
- package/dist/types/plugins/text/bold/withBold.d.ts.map +1 -1
- package/dist/types/plugins/text/code/codeMark.d.ts +1 -1
- package/dist/types/plugins/text/code/codeMark.d.ts.map +1 -1
- package/dist/types/plugins/text/code/index.d.ts +2 -2
- package/dist/types/plugins/text/code/index.d.ts.map +1 -1
- package/dist/types/plugins/text/code/withCode.d.ts +1 -1
- package/dist/types/plugins/text/code/withCode.d.ts.map +1 -1
- package/dist/types/plugins/text/highlight/highlightMark.d.ts +1 -1
- package/dist/types/plugins/text/highlight/highlightMark.d.ts.map +1 -1
- package/dist/types/plugins/text/highlight/index.d.ts +2 -2
- package/dist/types/plugins/text/highlight/index.d.ts.map +1 -1
- package/dist/types/plugins/text/highlight/withHighlight.d.ts +1 -1
- package/dist/types/plugins/text/highlight/withHighlight.d.ts.map +1 -1
- package/dist/types/plugins/text/index.d.ts +7 -7
- package/dist/types/plugins/text/index.d.ts.map +1 -1
- package/dist/types/plugins/text/italic/index.d.ts +2 -2
- package/dist/types/plugins/text/italic/index.d.ts.map +1 -1
- package/dist/types/plugins/text/italic/italicMark.d.ts +1 -1
- package/dist/types/plugins/text/italic/italicMark.d.ts.map +1 -1
- package/dist/types/plugins/text/italic/withItalic.d.ts +1 -1
- package/dist/types/plugins/text/italic/withItalic.d.ts.map +1 -1
- package/dist/types/plugins/text/newline/index.d.ts +1 -1
- package/dist/types/plugins/text/newline/index.d.ts.map +1 -1
- package/dist/types/plugins/text/newline/withNewline.d.ts +1 -1
- package/dist/types/plugins/text/newline/withNewline.d.ts.map +1 -1
- package/dist/types/plugins/text/strikeThrough/index.d.ts +2 -2
- package/dist/types/plugins/text/strikeThrough/index.d.ts.map +1 -1
- package/dist/types/plugins/text/strikeThrough/strikeThroughMark.d.ts +1 -1
- package/dist/types/plugins/text/strikeThrough/strikeThroughMark.d.ts.map +1 -1
- package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts +1 -1
- package/dist/types/plugins/text/strikeThrough/withStrikeThrough.d.ts.map +1 -1
- package/dist/types/plugins/text/underline/index.d.ts +2 -2
- package/dist/types/plugins/text/underline/index.d.ts.map +1 -1
- package/dist/types/plugins/text/underline/underlineMark.d.ts +1 -1
- package/dist/types/plugins/text/underline/underlineMark.d.ts.map +1 -1
- package/dist/types/plugins/text/underline/withUnderline.d.ts +1 -1
- package/dist/types/plugins/text/underline/withUnderline.d.ts.map +1 -1
- package/dist/types/slate-types.d.ts +1 -1
- package/dist/types/slate-types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/editor.d.ts +2 -2
- package/dist/types/types/editor.d.ts.map +1 -1
- package/dist/types/types/htmlDeserializer.d.ts +1 -1
- package/dist/types/types/htmlDeserializer.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +3 -3
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/RichTextEditor.tsx +3 -3
- package/src/components/index.ts +2 -2
- package/src/components/triggers/EditorWrapNodeTrigger.tsx +1 -1
- package/src/components/triggers/index.ts +4 -4
- package/src/editor/createEditor.ts +2 -2
- package/src/editor/createEditorWithEssentials.tsx +5 -5
- package/src/editor/index.ts +4 -4
- package/src/editor/methods/addMarks.ts +1 -1
- package/src/editor/methods/closestBlockEntry.ts +1 -1
- package/src/editor/methods/closestViableBlockContainerEntry.ts +1 -1
- package/src/editor/methods/hasMarks.ts +1 -1
- package/src/editor/methods/hasParentOfType.ts +1 -1
- package/src/editor/methods/index.ts +19 -19
- package/src/editor/methods/permissivelyDeserializeNodes.ts +2 -2
- package/src/editor/methods/removeMarks.ts +1 -1
- package/src/editor/methods/serializeNodes.ts +1 -1
- package/src/editor/methods/strictlyDeserializeNodes.ts +2 -2
- package/src/editor/methods/textToSpecifics.ts +1 -1
- package/src/editor/methods/toLatestFormat.ts +1 -1
- package/src/index.ts +6 -6
- package/src/internal/utils/EditorPasteUtils.ts +2 -2
- package/src/internal/utils/index.ts +2 -2
- package/src/plugins/attributes/alignment/index.ts +1 -1
- package/src/plugins/attributes/index.ts +1 -1
- package/src/plugins/behaviour/index.ts +1 -1
- package/src/plugins/behaviour/paste/HtmlDeserializer.ts +2 -2
- package/src/plugins/behaviour/paste/createMarkHtmlDeserializer.ts +1 -1
- package/src/plugins/behaviour/paste/index.ts +2 -2
- package/src/plugins/behaviour/paste/withPaste.ts +3 -3
- package/src/plugins/element/anchors/AnchorElement.ts +2 -2
- package/src/plugins/element/anchors/AnchorHtmlDeserializer.ts +1 -1
- package/src/plugins/element/anchors/AnchorModifications.ts +1 -1
- package/src/plugins/element/anchors/index.ts +3 -3
- package/src/plugins/element/anchors/withAnchors.ts +5 -5
- package/src/plugins/element/headings/HeadingElement.ts +3 -3
- package/src/plugins/element/headings/HeadingHtmlDeserializer.ts +3 -3
- package/src/plugins/element/headings/index.ts +3 -3
- package/src/plugins/element/headings/withHeadings.ts +4 -4
- package/src/plugins/element/horizonalRules/HorizontalRuleElement.ts +1 -1
- package/src/plugins/element/horizonalRules/index.ts +2 -2
- package/src/plugins/element/horizonalRules/withHorizontalRules.ts +2 -2
- package/src/plugins/element/index.ts +7 -7
- package/src/plugins/element/lists/ListElement.ts +4 -4
- package/src/plugins/element/lists/ListHtmlDeserializer.ts +6 -6
- package/src/plugins/element/lists/ListItemElement.ts +3 -3
- package/src/plugins/element/lists/OrderedListElement.ts +5 -5
- package/src/plugins/element/lists/UnorderedListElement.ts +5 -5
- package/src/plugins/element/lists/index.ts +5 -5
- package/src/plugins/element/lists/transforms/dedentListItem.ts +5 -5
- package/src/plugins/element/lists/transforms/indentListItem.ts +4 -4
- package/src/plugins/element/lists/transforms/index.ts +4 -4
- package/src/plugins/element/lists/transforms/normalizeListElement.ts +2 -2
- package/src/plugins/element/lists/transforms/toggleListElement.ts +5 -5
- package/src/plugins/element/lists/withLists.ts +8 -8
- package/src/plugins/element/paragraphs/ParagraphElement.ts +3 -3
- package/src/plugins/element/paragraphs/ParagraphHtmlDeserializer.ts +2 -2
- package/src/plugins/element/paragraphs/index.ts +3 -3
- package/src/plugins/element/paragraphs/withParagraphs.ts +4 -4
- package/src/plugins/element/scrollTargets/ScrollTargetElement.ts +1 -1
- package/src/plugins/element/scrollTargets/index.ts +2 -2
- package/src/plugins/element/scrollTargets/withScrollTargets.ts +2 -2
- package/src/plugins/element/tables/TableCellElement.ts +3 -3
- package/src/plugins/element/tables/TableElement.ts +5 -5
- package/src/plugins/element/tables/TableElementSelection.ts +2 -2
- package/src/plugins/element/tables/TableHtmlDeserializer.ts +4 -4
- package/src/plugins/element/tables/TableModifications.ts +4 -4
- package/src/plugins/element/tables/TableRowElement.ts +4 -4
- package/src/plugins/element/tables/gaugeTableColumnCount.ts +2 -2
- package/src/plugins/element/tables/index.ts +5 -5
- package/src/plugins/element/tables/withTables.ts +8 -8
- package/src/plugins/index.ts +4 -4
- package/src/plugins/text/bold/boldMark.ts +1 -1
- package/src/plugins/text/bold/index.ts +2 -2
- package/src/plugins/text/bold/withBold.ts +3 -3
- package/src/plugins/text/code/codeMark.ts +1 -1
- package/src/plugins/text/code/index.ts +2 -2
- package/src/plugins/text/code/withCode.ts +2 -2
- package/src/plugins/text/highlight/highlightMark.ts +1 -1
- package/src/plugins/text/highlight/index.ts +2 -2
- package/src/plugins/text/highlight/withHighlight.ts +2 -2
- package/src/plugins/text/index.ts +7 -7
- package/src/plugins/text/italic/index.ts +2 -2
- package/src/plugins/text/italic/italicMark.ts +1 -1
- package/src/plugins/text/italic/withItalic.ts +3 -3
- package/src/plugins/text/newline/index.ts +1 -1
- package/src/plugins/text/newline/withNewline.ts +1 -1
- package/src/plugins/text/strikeThrough/index.ts +2 -2
- package/src/plugins/text/strikeThrough/strikeThroughMark.ts +1 -1
- package/src/plugins/text/strikeThrough/withStrikeThrough.ts +3 -3
- package/src/plugins/text/underline/index.ts +2 -2
- package/src/plugins/text/underline/underlineMark.ts +1 -1
- package/src/plugins/text/underline/withUnderline.ts +3 -3
- package/src/slate-types.ts +1 -1
- package/src/types/editor.ts +2 -2
- package/src/types/htmlDeserializer.ts +1 -1
- package/src/types/index.ts +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTables.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/withTables.ts"],"sourcesContent":["import { Editor, Element, Node as SlateNode, NodeEntry, Path as SlatePath, Point, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor'\nimport { isTableCellElement, TableCellElement, tableCellElementPlugin } from './TableCellElement'\nimport { getTableElementColumnCount, getTableElementRowCount, isTableElement, TableElement, tableElementPlugin } from './TableElement'\nimport { getTableCellCoordinates, selectTableCellContents } from './TableElementSelection'\nimport { tableHTMLDeserializer } from './TableHtmlDeserializer'\nimport { TableModifications } from './TableModifications'\nimport { isTableRowElement, TableRowElement, tableRowElementPlugin } from './TableRowElement'\nimport { ElementRenderer } from '../../../types'\n\nexport const withTables = ({ renderTable, renderTableCell, renderTableRow }: {\n\trenderTable: ElementRenderer<TableElement>\n\trenderTableCell: ElementRenderer<TableCellElement>\n\trenderTableRow: ElementRenderer<TableRowElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tdeleteForward,\n\t\tdeleteBackward,\n\t\tdeleteFragment,\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(tableElementPlugin({ render: renderTable }))\n\teditor.registerElement(tableCellElementPlugin({ render: renderTableCell }))\n\teditor.registerElement(tableRowElementPlugin({ render: renderTableRow }))\n\n\teditor.htmlDeserializer.registerPlugin(tableHTMLDeserializer)\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst selection = editor.selection\n\t\t\t\tconst [, closestBlockPath] = closestBlockEntry\n\t\t\t\tconst [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath)\n\n\t\t\t\tif (!selection) {\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tanchor: cellStart,\n\t\t\t\t\t\t\tfocus: cellEnd,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmatch: node => Text.isText(node) || (Element.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t\tinsertBreak()\n\t\t},\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteBackward(unit)\n\t\t},\n\t\tdeleteForward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteForward(unit)\n\t\t},\n\t\tdeleteFragment: () => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (!selection || SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn deleteFragment()\n\t\t\t}\n\t\t\tconst lowestCommonAncestorPath = SlatePath.common(selection.anchor.path, selection.focus.path)\n\t\t\tconst [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath)\n\n\t\t\tif (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {\n\t\t\t\treturn // TODO nope for now\n\t\t\t}\n\t\t\tdeleteFragment()\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (\n\t\t\t\t!selection\n\t\t\t\t|| !(\n\t\t\t\t\tevent.key === 'Tab'\n\t\t\t\t\t|| event.key === 'ArrowUp'\n\t\t\t\t\t|| event.key === 'ArrowRight'\n\t\t\t\t\t|| event.key === 'ArrowDown'\n\t\t\t\t\t|| event.key === 'ArrowLeft'\n\t\t\t\t\t|| event.key === 'Enter'\n\t\t\t\t\t|| event.key === 'Backspace'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection })\n\n\t\t\tif (!closestBlockEntry) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet cellElement: TableCellElement\n\t\t\tlet cellPath: SlatePath\n\n\t\t\tif (!isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst parent = SlateNode.parent(editor, closestBlockEntry[1])\n\t\t\t\tif (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {\n\t\t\t\t\tcellElement = parent\n\t\t\t\t\tcellPath = SlatePath.parent(closestBlockEntry[1])\n\t\t\t\t} else {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;[cellElement, cellPath] = closestBlockEntry\n\t\t\t}\n\t\t\tif (cellPath.length < 3) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement)\n\t\t\tconst tablePath = cellPath.slice(0, -2)\n\t\t\tconst tableElement = SlateNode.get(editor, tablePath) as TableElement\n\t\t\tconst rowCount = getTableElementRowCount(tableElement)\n\t\t\tconst columnCount = getTableElementColumnCount(tableElement)\n\n\t\t\tif (rowCount === 0 || columnCount === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst moveSelectionBeforeTable = () => {\n\t\t\t\tconst pointBeforeTable = Editor.before(editor, tablePath)\n\t\t\t\tif (!pointBeforeTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointBeforeTable)\n\t\t\t}\n\t\t\tconst moveSelectionAfterTable = () => {\n\t\t\t\tconst pointAfterTable = Editor.after(editor, tablePath)\n\t\t\t\tif (!pointAfterTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointAfterTable)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t// Moving backwards\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1)\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Moving forwards\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1)\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\t// We're at the right edge of the table\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex + 1, 0)\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === 'ArrowLeft') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.start(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]))\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowRight') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.end(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]))\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]))\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\tconst withinDefault = editor.isDefaultElement(closestBlockEntry[0])\n\t\t\t\tif (withinDefault) {\n\t\t\t\t\tconst relative = SlatePath.relative(closestBlockEntry[1], cellPath)\n\t\t\t\t\tconst defaultIndex = relative[0]\n\t\t\t\t\tif (\n\t\t\t\t\t\t(event.key === 'ArrowUp' && defaultIndex !== 0)\n\t\t\t\t\t\t|| (event.key === 'ArrowDown' && defaultIndex !== cellElement.children.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAboveEndPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset)\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowAboveEndPoint.path,\n\t\t\t\t\t\t\toffset: minOffset,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStatPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint) as NodeEntry<Text>\n\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowBelowStatPoint.path,\n\t\t\t\t\t\t\toffset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t}\n\t\t\t} else if (event.ctrlKey || event.metaKey) {\n\t\t\t\tif (event.key === 'Backspace') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tTableModifications.deleteTableColumn(editor, tableElement, columnIndex)\n\n\t\t\t\t\t\tif (columnCount > 1) {\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTableModifications.deleteTableRow(editor, tableElement, rowIndex)\n\n\t\t\t\t\t\tif (rowCount > 1) {\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex)\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex + 1)\n\t\t\t\t\t\t\tconst columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnAfter)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex)\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex + 1)\n\t\t\t\t\t\t\tconst rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStat)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["SlatePath","SlateRange","SlateNode"],"mappings":";;;;;;;;AAUO,MAAM,aAAa,CAAC,EAAE,aAAa,iBAAiB,eAAA,MAK3D,CAAmB,WAAiB;AACnC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgB,mBAAmB,EAAE,QAAQ,YAAA,CAAa,CAAC;AAClE,SAAO,gBAAgB,uBAAuB,EAAE,QAAQ,gBAAA,CAAiB,CAAC;AAC1E,SAAO,gBAAgB,sBAAsB,EAAE,QAAQ,eAAA,CAAgB,CAAC;AAExE,SAAO,iBAAiB,eAAe,qBAAqB;AAE5D,SAAO,OAAgC,QAAQ;AAAA,IAC9C,aAAa,MAAM;AAClB,YAAM,oBAAoB,gBAAgB,kBAAkB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AO,MAAM,QAAQ,CAAC,GAAG,WAAW,UAAU,KAAK,IAAI,GAAG,WAAW,CAAC,CAAC;AAE5F,qBAAO,WAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C,OAAO;AACN,iCAAmB,eAAe,QAAQ,cAAc,cAAc,CAAC;AACvE,oBAAM,cAAc,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,UAAU,cAAc,CAAC,CAAC;AAElF,qBAAO,WAAW,OAAO,QAAQ,WAAW;AAAA,YAC7C;AAAA,UACD,OAAO;AACN,gBAAI,MAAM,UAAU;AACnB,iCAAmB,YAAY,QAAQ,cAAc,QAAQ;AAC7D,oBAAM,WAAW,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,KAAK,IAAI,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExF,qBAAO,WAAW,OAAO,QAAQ,QAAQ;AAAA,YAC1C,OAAO;AACN,iCAAmB,YAAY,QAAQ,cAAc,WAAW,CAAC;AACjE,oBAAM,eAAe,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,WAAW,GAAG,WAAW,CAAC;AAEnF,qBAAO,WAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C;AAAA,UACD;AAAA,QACD;AAAA,MACD;AACA,gBAAU,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAED,SAAO;AACR;"}
|
|
1
|
+
{"version":3,"file":"withTables.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/element/tables/withTables.ts"],"sourcesContent":["import { Editor, Element, Node as SlateNode, NodeEntry, Path as SlatePath, Point, Range as SlateRange, Text, Transforms } from 'slate'\nimport { ContemberEditor } from '../../../editor/index.js'\nimport { isTableCellElement, TableCellElement, tableCellElementPlugin } from './TableCellElement.js'\nimport { getTableElementColumnCount, getTableElementRowCount, isTableElement, TableElement, tableElementPlugin } from './TableElement.js'\nimport { getTableCellCoordinates, selectTableCellContents } from './TableElementSelection.js'\nimport { tableHTMLDeserializer } from './TableHtmlDeserializer.js'\nimport { TableModifications } from './TableModifications.js'\nimport { isTableRowElement, TableRowElement, tableRowElementPlugin } from './TableRowElement.js'\nimport { ElementRenderer } from '../../../types/index.js'\n\nexport const withTables = ({ renderTable, renderTableCell, renderTableRow }: {\n\trenderTable: ElementRenderer<TableElement>\n\trenderTableCell: ElementRenderer<TableCellElement>\n\trenderTableRow: ElementRenderer<TableRowElement>\n}) =>\n<E extends Editor>(editor: E): E => {\n\tconst {\n\t\tdeleteForward,\n\t\tdeleteBackward,\n\t\tdeleteFragment,\n\t\tinsertBreak,\n\t\tonKeyDown,\n\t} = editor\n\n\teditor.registerElement(tableElementPlugin({ render: renderTable }))\n\teditor.registerElement(tableCellElementPlugin({ render: renderTableCell }))\n\teditor.registerElement(tableRowElementPlugin({ render: renderTableRow }))\n\n\teditor.htmlDeserializer.registerPlugin(tableHTMLDeserializer)\n\n\tObject.assign<Editor, Partial<Editor>>(editor, {\n\t\tinsertBreak: () => {\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\tif (closestBlockEntry && isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst selection = editor.selection\n\t\t\t\tconst [, closestBlockPath] = closestBlockEntry\n\t\t\t\tconst [cellStart, cellEnd] = Editor.edges(editor, closestBlockPath)\n\n\t\t\t\tif (!selection) {\n\t\t\t\t\treturn insertBreak()\n\t\t\t\t}\n\n\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([]), {\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tanchor: cellStart,\n\t\t\t\t\t\t\tfocus: cellEnd,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmatch: node => Text.isText(node) || (Element.isElement(node) && editor.isInline(node)),\n\t\t\t\t\t})\n\n\t\t\t\t\tconst relative = SlatePath.relative(selection.focus.path, closestBlockPath)\n\t\t\t\t\tTransforms.splitNodes(editor, {\n\t\t\t\t\t\t// The zero should be the newly created default element.\n\t\t\t\t\t\tat: {\n\t\t\t\t\t\t\tpath: [...closestBlockPath, 0, ...relative],\n\t\t\t\t\t\t\toffset: selection.focus.offset,\n\t\t\t\t\t\t},\n\t\t\t\t\t\talways: true,\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t\tinsertBreak()\n\t\t},\n\t\tdeleteBackward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.start(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteBackward(unit)\n\t\t},\n\t\tdeleteForward: unit => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (selection && SlateRange.isCollapsed(selection)) {\n\t\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor)\n\t\t\t\tif (\n\t\t\t\t\tclosestBlockEntry\n\t\t\t\t\t&& isTableCellElement(closestBlockEntry[0])\n\t\t\t\t\t&& Point.equals(selection.focus, Editor.end(editor, closestBlockEntry[1]))\n\t\t\t\t) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t\tdeleteForward(unit)\n\t\t},\n\t\tdeleteFragment: () => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (!selection || SlateRange.isCollapsed(selection)) {\n\t\t\t\treturn deleteFragment()\n\t\t\t}\n\t\t\tconst lowestCommonAncestorPath = SlatePath.common(selection.anchor.path, selection.focus.path)\n\t\t\tconst [lowestCommonAncestor] = Editor.node(editor, lowestCommonAncestorPath)\n\n\t\t\tif (isTableElement(lowestCommonAncestor) || isTableRowElement(lowestCommonAncestor)) {\n\t\t\t\treturn // TODO nope for now\n\t\t\t}\n\t\t\tdeleteFragment()\n\t\t},\n\t\tonKeyDown: event => {\n\t\t\tconst selection = editor.selection\n\t\t\tif (\n\t\t\t\t!selection\n\t\t\t\t|| !(\n\t\t\t\t\tevent.key === 'Tab'\n\t\t\t\t\t|| event.key === 'ArrowUp'\n\t\t\t\t\t|| event.key === 'ArrowRight'\n\t\t\t\t\t|| event.key === 'ArrowDown'\n\t\t\t\t\t|| event.key === 'ArrowLeft'\n\t\t\t\t\t|| event.key === 'Enter'\n\t\t\t\t\t|| event.key === 'Backspace'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst closestBlockEntry = ContemberEditor.closestBlockEntry(editor, { at: selection })\n\n\t\t\tif (!closestBlockEntry) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tlet cellElement: TableCellElement\n\t\t\tlet cellPath: SlatePath\n\n\t\t\tif (!isTableCellElement(closestBlockEntry[0])) {\n\t\t\t\tconst parent = SlateNode.parent(editor, closestBlockEntry[1])\n\t\t\t\tif (Element.isElement(closestBlockEntry[0]) && editor.isDefaultElement(closestBlockEntry[0]) && isTableCellElement(parent)) {\n\t\t\t\t\tcellElement = parent\n\t\t\t\t\tcellPath = SlatePath.parent(closestBlockEntry[1])\n\t\t\t\t} else {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t;[cellElement, cellPath] = closestBlockEntry\n\t\t\t}\n\t\t\tif (cellPath.length < 3) {\n\t\t\t\treturn onKeyDown(event)\n\t\t\t}\n\t\t\tconst [rowIndex, columnIndex] = getTableCellCoordinates(editor, cellElement)\n\t\t\tconst tablePath = cellPath.slice(0, -2)\n\t\t\tconst tableElement = SlateNode.get(editor, tablePath) as TableElement\n\t\t\tconst rowCount = getTableElementRowCount(tableElement)\n\t\t\tconst columnCount = getTableElementColumnCount(tableElement)\n\n\t\t\tif (rowCount === 0 || columnCount === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst moveSelectionBeforeTable = () => {\n\t\t\t\tconst pointBeforeTable = Editor.before(editor, tablePath)\n\t\t\t\tif (!pointBeforeTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointBeforeTable)\n\t\t\t}\n\t\t\tconst moveSelectionAfterTable = () => {\n\t\t\t\tconst pointAfterTable = Editor.after(editor, tablePath)\n\t\t\t\tif (!pointAfterTable) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault()\n\t\t\t\treturn Transforms.select(editor, pointAfterTable)\n\t\t\t}\n\n\t\t\tif (event.key === 'Tab') {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t// Moving backwards\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex - 1)\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex - 1, columnCount - 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Moving forwards\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex, columnIndex + 1)\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\t// We're at the right edge of the table\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn selectTableCellContents(editor, tablePath, rowIndex + 1, 0)\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (event.key === 'ArrowLeft') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.start(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex, columnIndex - 1]))\n\t\t\t\t\t} else if (columnIndex === 0) {\n\t\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.end(editor, [...tablePath, rowIndex - 1, columnCount - 1]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowRight') {\n\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t}\n\t\t\t\tif (Point.equals(selection.focus, Editor.end(editor, cellPath))) {\n\t\t\t\t\tif (columnIndex < columnCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1]))\n\t\t\t\t\t} else if (columnIndex === columnCount - 1) {\n\t\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\t\treturn Transforms.select(editor, Editor.start(editor, [...tablePath, rowIndex + 1, 0]))\n\t\t\t\t\t\t} else if (rowIndex === rowCount - 1) {\n\t\t\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\tconst withinDefault = editor.isDefaultElement(closestBlockEntry[0])\n\t\t\t\tif (withinDefault) {\n\t\t\t\t\tconst relative = SlatePath.relative(closestBlockEntry[1], cellPath)\n\t\t\t\t\tconst defaultIndex = relative[0]\n\t\t\t\t\tif (\n\t\t\t\t\t\t(event.key === 'ArrowUp' && defaultIndex !== 0)\n\t\t\t\t\t\t|| (event.key === 'ArrowDown' && defaultIndex !== cellElement.children.length - 1)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn onKeyDown(event)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (event.key === 'ArrowUp') {\n\t\t\t\t\tif (rowIndex > 0) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowAboveEndPoint = Editor.end(editor, [...tablePath, rowIndex - 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAboveEndPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst minOffset = Math.min(selection.focus.offset, rowAboveEndPoint.offset)\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowAboveEndPoint.path,\n\t\t\t\t\t\t\toffset: minOffset,\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t} else if (event.key === 'ArrowDown') {\n\t\t\t\t\tif (rowIndex < rowCount - 1) {\n\t\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\t\tconst rowBelowStatPoint = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\tif (!SlateRange.isCollapsed(selection)) {\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStatPoint)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst [rowBelowStatPointNode] = Editor.node(editor, rowBelowStatPoint) as NodeEntry<Text>\n\n\t\t\t\t\t\treturn Transforms.select(editor, {\n\t\t\t\t\t\t\tpath: rowBelowStatPoint.path,\n\t\t\t\t\t\t\toffset: Math.min(selection.focus.offset, rowBelowStatPointNode.text.length),\n\t\t\t\t\t\t})\n\t\t\t\t\t}\n\t\t\t\t\treturn moveSelectionAfterTable()\n\t\t\t\t}\n\t\t\t} else if (event.ctrlKey || event.metaKey) {\n\t\t\t\tif (event.key === 'Backspace') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tTableModifications.deleteTableColumn(editor, tableElement, columnIndex)\n\n\t\t\t\t\t\tif (columnCount > 1) {\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex - 1)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTableModifications.deleteTableRow(editor, tableElement, rowIndex)\n\n\t\t\t\t\t\tif (rowCount > 1) {\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex - 1), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn moveSelectionBeforeTable()\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Enter') {\n\t\t\t\t\tevent.preventDefault()\n\n\t\t\t\t\tif (event.altKey) {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex)\n\t\t\t\t\t\t\tconst columnBefore = Editor.start(editor, [...tablePath, rowIndex, Math.max(0, columnIndex)])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnBefore)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableColumn(editor, tableElement, columnIndex + 1)\n\t\t\t\t\t\t\tconst columnAfter = Editor.start(editor, [...tablePath, rowIndex, columnIndex + 1])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, columnAfter)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex)\n\t\t\t\t\t\t\tconst rowAbove = Editor.start(editor, [...tablePath, Math.max(0, rowIndex), columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowAbove)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTableModifications.addTableRow(editor, tableElement, rowIndex + 1)\n\t\t\t\t\t\t\tconst rowBelowStat = Editor.start(editor, [...tablePath, rowIndex + 1, columnIndex])\n\n\t\t\t\t\t\t\treturn Transforms.select(editor, rowBelowStat)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tonKeyDown(event)\n\t\t},\n\t})\n\n\treturn editor\n}\n"],"names":["SlatePath","SlateRange","SlateNode"],"mappings":";;;;;;;;AAUO,MAAM,aAAa,CAAC,EAAE,aAAa,iBAAiB,eAAA,MAK3D,CAAmB,WAAiB;AACnC,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACG;AAEJ,SAAO,gBAAgB,mBAAmB,EAAE,QAAQ,YAAA,CAAa,CAAC;AAClE,SAAO,gBAAgB,uBAAuB,EAAE,QAAQ,gBAAA,CAAiB,CAAC;AAC1E,SAAO,gBAAgB,sBAAsB,EAAE,QAAQ,eAAA,CAAgB,CAAC;AAExE,SAAO,iBAAiB,eAAe,qBAAqB;AAE5D,SAAO,OAAgC,QAAQ;AAAA,IAC9C,aAAa,MAAM;AAClB,YAAM,oBAAoB,gBAAgB,kBAAkB,MAAM;AAClE,UAAI,qBAAqB,mBAAmB,kBAAkB,C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,IAAI,GAAG,WAAW,CAAC,CAAC;AAE5F,qBAAO,WAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C,OAAO;AACN,iCAAmB,eAAe,QAAQ,cAAc,cAAc,CAAC;AACvE,oBAAM,cAAc,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,UAAU,cAAc,CAAC,CAAC;AAElF,qBAAO,WAAW,OAAO,QAAQ,WAAW;AAAA,YAC7C;AAAA,UACD,OAAO;AACN,gBAAI,MAAM,UAAU;AACnB,iCAAmB,YAAY,QAAQ,cAAc,QAAQ;AAC7D,oBAAM,WAAW,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,KAAK,IAAI,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExF,qBAAO,WAAW,OAAO,QAAQ,QAAQ;AAAA,YAC1C,OAAO;AACN,iCAAmB,YAAY,QAAQ,cAAc,WAAW,CAAC;AACjE,oBAAM,eAAe,OAAO,MAAM,QAAQ,CAAC,GAAG,WAAW,WAAW,GAAG,WAAW,CAAC;AAEnF,qBAAO,WAAW,OAAO,QAAQ,YAAY;AAAA,YAC9C;AAAA,UACD;AAAA,QACD;AAAA,MACD;AACA,gBAAU,KAAK;AAAA,IAChB;AAAA,EAAA,CACA;AAED,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boldMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/boldMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const boldMark = 'isBold'\n\nexport const boldMarkPlugin: EditorMarkPlugin = {\n\ttype: boldMark,\n\tisHotKey: isHotkey('mod+b'),\n\trender: ({ children }) => createElement('b', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
|
|
1
|
+
{"version":3,"file":"boldMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/boldMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const boldMark = 'isBold'\n\nexport const boldMarkPlugin: EditorMarkPlugin = {\n\ttype: boldMark,\n\tisHotKey: isHotkey('mod+b'),\n\trender: ({ children }) => createElement('b', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boldMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/boldMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const boldMark = 'isBold'\n\nexport const boldMarkPlugin: EditorMarkPlugin = {\n\ttype: boldMark,\n\tisHotKey: isHotkey('mod+b'),\n\trender: ({ children }) => createElement('b', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
|
|
1
|
+
{"version":3,"file":"boldMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/boldMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const boldMark = 'isBold'\n\nexport const boldMarkPlugin: EditorMarkPlugin = {\n\ttype: boldMark,\n\tisHotKey: isHotkey('mod+b'),\n\trender: ({ children }) => createElement('b', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withBold.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/withBold.ts"],"sourcesContent":["import { boldMark, boldMarkPlugin } from './boldMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withBold = (): EditorPlugin => editor => {\n\teditor.registerMark(boldMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tboldMark,\n\t\t\tel => el.nodeName === 'STRONG' || (el.nodeName === 'B' && !el.id.startsWith('docs-internal-guid')),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":["boldMarkPlugin","createMarkHtmlDeserializer","boldMark"],"mappings":";;;;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAaA,uBAAc;AAClC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,SAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa,YAAa,GAAG,aAAa,OAAO,CAAC,GAAG,GAAG,WAAW,oBAAoB;AAAA,MAChG,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;;"}
|
|
1
|
+
{"version":3,"file":"withBold.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/withBold.ts"],"sourcesContent":["import { boldMark, boldMarkPlugin } from './boldMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withBold = (): EditorPlugin => editor => {\n\teditor.registerMark(boldMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tboldMark,\n\t\t\tel => el.nodeName === 'STRONG' || (el.nodeName === 'B' && !el.id.startsWith('docs-internal-guid')),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":["boldMarkPlugin","createMarkHtmlDeserializer","boldMark"],"mappings":";;;;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAaA,uBAAc;AAClC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,SAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa,YAAa,GAAG,aAAa,OAAO,CAAC,GAAG,GAAG,WAAW,oBAAoB;AAAA,MAChG,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withBold.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/withBold.ts"],"sourcesContent":["import { boldMark, boldMarkPlugin } from './boldMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withBold = (): EditorPlugin => editor => {\n\teditor.registerMark(boldMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tboldMark,\n\t\t\tel => el.nodeName === 'STRONG' || (el.nodeName === 'B' && !el.id.startsWith('docs-internal-guid')),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAa,cAAc;AAClC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa,YAAa,GAAG,aAAa,OAAO,CAAC,GAAG,GAAG,WAAW,oBAAoB;AAAA,MAChG,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;"}
|
|
1
|
+
{"version":3,"file":"withBold.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/bold/withBold.ts"],"sourcesContent":["import { boldMark, boldMarkPlugin } from './boldMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withBold = (): EditorPlugin => editor => {\n\teditor.registerMark(boldMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tboldMark,\n\t\t\tel => el.nodeName === 'STRONG' || (el.nodeName === 'B' && !el.id.startsWith('docs-internal-guid')),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAa,cAAc;AAClC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa,YAAa,GAAG,aAAa,OAAO,CAAC,GAAG,GAAG,WAAW,oBAAoB;AAAA,MAChG,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/codeMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const codeMark = 'isCode'\n\nexport const codeMarkPlugin: EditorMarkPlugin = {\n\ttype: codeMark,\n\tisHotKey: isHotkey('mod+`'),\n\trender: ({ children }) => createElement('code', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,QAAQ,QAAW,QAAQ;AACpE;;;"}
|
|
1
|
+
{"version":3,"file":"codeMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/codeMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const codeMark = 'isCode'\n\nexport const codeMarkPlugin: EditorMarkPlugin = {\n\ttype: codeMark,\n\tisHotKey: isHotkey('mod+`'),\n\trender: ({ children }) => createElement('code', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,QAAQ,QAAW,QAAQ;AACpE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/codeMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const codeMark = 'isCode'\n\nexport const codeMarkPlugin: EditorMarkPlugin = {\n\ttype: codeMark,\n\tisHotKey: isHotkey('mod+`'),\n\trender: ({ children }) => createElement('code', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,QAAQ,QAAW,QAAQ;AACpE;"}
|
|
1
|
+
{"version":3,"file":"codeMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/codeMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const codeMark = 'isCode'\n\nexport const codeMarkPlugin: EditorMarkPlugin = {\n\ttype: codeMark,\n\tisHotKey: isHotkey('mod+`'),\n\trender: ({ children }) => createElement('code', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,WAAW;AAEjB,MAAM,iBAAmC;AAAA,EAC/C,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,QAAQ,QAAW,QAAQ;AACpE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withCode.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/withCode.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { codeMarkPlugin } from './codeMark'\nimport { EditorPlugin } from '../../../types'\n\nexport const withCode = (): EditorPlugin => editor => {\n\teditor.registerMark(codeMarkPlugin)\n\n\treturn editor\n}\n"],"names":["codeMarkPlugin"],"mappings":";;;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAaA,uBAAc;AAElC,SAAO;AACR;;"}
|
|
1
|
+
{"version":3,"file":"withCode.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/withCode.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { codeMarkPlugin } from './codeMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withCode = (): EditorPlugin => editor => {\n\teditor.registerMark(codeMarkPlugin)\n\n\treturn editor\n}\n"],"names":["codeMarkPlugin"],"mappings":";;;AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAaA,uBAAc;AAElC,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withCode.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/withCode.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { codeMarkPlugin } from './codeMark'\nimport { EditorPlugin } from '../../../types'\n\nexport const withCode = (): EditorPlugin => editor => {\n\teditor.registerMark(codeMarkPlugin)\n\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAa,cAAc;AAElC,SAAO;AACR;"}
|
|
1
|
+
{"version":3,"file":"withCode.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/code/withCode.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { codeMarkPlugin } from './codeMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withCode = (): EditorPlugin => editor => {\n\teditor.registerMark(codeMarkPlugin)\n\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,WAAW,MAAoB,CAAA,WAAU;AACrD,SAAO,aAAa,cAAc;AAElC,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlightMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/highlightMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const highlightMark = 'isHighlighted'\n\nexport const highlightMarkPlugin: EditorMarkPlugin = {\n\ttype: highlightMark,\n\tisHotKey: isHotkey('mod+e'),\n\trender: ({ children }) => createElement('em', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,MAAM,QAAW,QAAQ;AAClE;;;"}
|
|
1
|
+
{"version":3,"file":"highlightMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/highlightMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const highlightMark = 'isHighlighted'\n\nexport const highlightMarkPlugin: EditorMarkPlugin = {\n\ttype: highlightMark,\n\tisHotKey: isHotkey('mod+e'),\n\trender: ({ children }) => createElement('em', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,MAAM,QAAW,QAAQ;AAClE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"highlightMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/highlightMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const highlightMark = 'isHighlighted'\n\nexport const highlightMarkPlugin: EditorMarkPlugin = {\n\ttype: highlightMark,\n\tisHotKey: isHotkey('mod+e'),\n\trender: ({ children }) => createElement('em', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,MAAM,QAAW,QAAQ;AAClE;"}
|
|
1
|
+
{"version":3,"file":"highlightMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/highlightMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const highlightMark = 'isHighlighted'\n\nexport const highlightMarkPlugin: EditorMarkPlugin = {\n\ttype: highlightMark,\n\tisHotKey: isHotkey('mod+e'),\n\trender: ({ children }) => createElement('em', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,MAAM,QAAW,QAAQ;AAClE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withHighlight.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/withHighlight.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { highlightMarkPlugin } from './highlightMark'\nimport { EditorPlugin } from '../../../types'\n\nexport const withHighlight = (): EditorPlugin => editor => {\n\teditor.registerMark(highlightMarkPlugin)\n\n\treturn editor\n}\n"],"names":["highlightMarkPlugin"],"mappings":";;;AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAaA,iCAAmB;AAEvC,SAAO;AACR;;"}
|
|
1
|
+
{"version":3,"file":"withHighlight.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/withHighlight.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { highlightMarkPlugin } from './highlightMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withHighlight = (): EditorPlugin => editor => {\n\teditor.registerMark(highlightMarkPlugin)\n\n\treturn editor\n}\n"],"names":["highlightMarkPlugin"],"mappings":";;;AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAaA,iCAAmB;AAEvC,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withHighlight.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/withHighlight.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { highlightMarkPlugin } from './highlightMark'\nimport { EditorPlugin } from '../../../types'\n\nexport const withHighlight = (): EditorPlugin => editor => {\n\teditor.registerMark(highlightMarkPlugin)\n\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAa,mBAAmB;AAEvC,SAAO;AACR;"}
|
|
1
|
+
{"version":3,"file":"withHighlight.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/highlight/withHighlight.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { highlightMarkPlugin } from './highlightMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withHighlight = (): EditorPlugin => editor => {\n\teditor.registerMark(highlightMarkPlugin)\n\n\treturn editor\n}\n"],"names":[],"mappings":";AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAa,mBAAmB;AAEvC,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"italicMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/italicMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const italicMark = 'isItalic'\n\nexport const italicMarkPlugin: EditorMarkPlugin = {\n\ttype: italicMark,\n\tisHotKey: isHotkey('mod+i'),\n\trender: ({ children }) => createElement('i', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,aAAa;AAEnB,MAAM,mBAAqC;AAAA,EACjD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
|
|
1
|
+
{"version":3,"file":"italicMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/italicMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const italicMark = 'isItalic'\n\nexport const italicMarkPlugin: EditorMarkPlugin = {\n\ttype: italicMark,\n\tisHotKey: isHotkey('mod+i'),\n\trender: ({ children }) => createElement('i', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,aAAa;AAEnB,MAAM,mBAAqC;AAAA,EACjD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"italicMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/italicMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const italicMark = 'isItalic'\n\nexport const italicMarkPlugin: EditorMarkPlugin = {\n\ttype: italicMark,\n\tisHotKey: isHotkey('mod+i'),\n\trender: ({ children }) => createElement('i', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,aAAa;AAEnB,MAAM,mBAAqC;AAAA,EACjD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
|
|
1
|
+
{"version":3,"file":"italicMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/italicMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const italicMark = 'isItalic'\n\nexport const italicMarkPlugin: EditorMarkPlugin = {\n\ttype: italicMark,\n\tisHotKey: isHotkey('mod+i'),\n\trender: ({ children }) => createElement('i', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,aAAa;AAEnB,MAAM,mBAAqC;AAAA,EACjD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withItalic.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/withItalic.ts"],"sourcesContent":["import { italicMark, italicMarkPlugin } from './italicMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withItalic = (): EditorPlugin => editor => {\n\teditor.registerMark(italicMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\titalicMark,\n\t\t\tel => ['I', 'EM'].includes(el.nodeName),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":["italicMarkPlugin","createMarkHtmlDeserializer","italicMark"],"mappings":";;;;AAIO,MAAM,aAAa,MAAoB,CAAA,WAAU;AACvD,SAAO,aAAaA,2BAAgB;AACpC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,WAAAA;AAAAA,MACA,QAAM,CAAC,KAAK,IAAI,EAAE,SAAS,GAAG,QAAQ;AAAA,MACtC,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;;"}
|
|
1
|
+
{"version":3,"file":"withItalic.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/withItalic.ts"],"sourcesContent":["import { italicMark, italicMarkPlugin } from './italicMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withItalic = (): EditorPlugin => editor => {\n\teditor.registerMark(italicMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\titalicMark,\n\t\t\tel => ['I', 'EM'].includes(el.nodeName),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":["italicMarkPlugin","createMarkHtmlDeserializer","italicMark"],"mappings":";;;;AAIO,MAAM,aAAa,MAAoB,CAAA,WAAU;AACvD,SAAO,aAAaA,2BAAgB;AACpC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,WAAAA;AAAAA,MACA,QAAM,CAAC,KAAK,IAAI,EAAE,SAAS,GAAG,QAAQ;AAAA,MACtC,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withItalic.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/withItalic.ts"],"sourcesContent":["import { italicMark, italicMarkPlugin } from './italicMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withItalic = (): EditorPlugin => editor => {\n\teditor.registerMark(italicMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\titalicMark,\n\t\t\tel => ['I', 'EM'].includes(el.nodeName),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,aAAa,MAAoB,CAAA,WAAU;AACvD,SAAO,aAAa,gBAAgB;AACpC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,QAAM,CAAC,KAAK,IAAI,EAAE,SAAS,GAAG,QAAQ;AAAA,MACtC,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;"}
|
|
1
|
+
{"version":3,"file":"withItalic.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/italic/withItalic.ts"],"sourcesContent":["import { italicMark, italicMarkPlugin } from './italicMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withItalic = (): EditorPlugin => editor => {\n\teditor.registerMark(italicMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\titalicMark,\n\t\t\tel => ['I', 'EM'].includes(el.nodeName),\n\t\t\tel => ['italic', 'oblique'].includes(el.style.fontWeight),\n\t\t),\n\t)\n}\n"],"names":[],"mappings":";;AAIO,MAAM,aAAa,MAAoB,CAAA,WAAU;AACvD,SAAO,aAAa,gBAAgB;AACpC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,QAAM,CAAC,KAAK,IAAI,EAAE,SAAS,GAAG,QAAQ;AAAA,MACtC,CAAA,OAAM,CAAC,UAAU,SAAS,EAAE,SAAS,GAAG,MAAM,UAAU;AAAA,IAAA;AAAA,EACzD;AAEF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withNewline.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/newline/withNewline.ts"],"sourcesContent":["import { Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types'\n\nexport const withNewline = (): EditorPlugin => editor => {\n\tconst { onKeyDown } = editor\n\teditor.onKeyDown = e => {\n\t\tif (e.key !== 'Enter' || !e.shiftKey) {\n\t\t\treturn onKeyDown(e)\n\t\t}\n\t\te.preventDefault()\n\t\tTransforms.insertText(editor, '\\n')\n\t}\n}\n"],"names":["Transforms"],"mappings":";;;AAGO,MAAM,cAAc,MAAoB,CAAA,WAAU;AACxD,QAAM,EAAE,cAAc;AACtB,SAAO,YAAY,CAAA,MAAK;AACvB,QAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACrC,aAAO,UAAU,CAAC;AAAA,IACnB;AACA,MAAE,eAAA;AACFA,qBAAW,WAAW,QAAQ,IAAI;AAAA,EACnC;AACD;;"}
|
|
1
|
+
{"version":3,"file":"withNewline.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/newline/withNewline.ts"],"sourcesContent":["import { Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withNewline = (): EditorPlugin => editor => {\n\tconst { onKeyDown } = editor\n\teditor.onKeyDown = e => {\n\t\tif (e.key !== 'Enter' || !e.shiftKey) {\n\t\t\treturn onKeyDown(e)\n\t\t}\n\t\te.preventDefault()\n\t\tTransforms.insertText(editor, '\\n')\n\t}\n}\n"],"names":["Transforms"],"mappings":";;;AAGO,MAAM,cAAc,MAAoB,CAAA,WAAU;AACxD,QAAM,EAAE,cAAc;AACtB,SAAO,YAAY,CAAA,MAAK;AACvB,QAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACrC,aAAO,UAAU,CAAC;AAAA,IACnB;AACA,MAAE,eAAA;AACFA,qBAAW,WAAW,QAAQ,IAAI;AAAA,EACnC;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withNewline.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/newline/withNewline.ts"],"sourcesContent":["import { Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types'\n\nexport const withNewline = (): EditorPlugin => editor => {\n\tconst { onKeyDown } = editor\n\teditor.onKeyDown = e => {\n\t\tif (e.key !== 'Enter' || !e.shiftKey) {\n\t\t\treturn onKeyDown(e)\n\t\t}\n\t\te.preventDefault()\n\t\tTransforms.insertText(editor, '\\n')\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,cAAc,MAAoB,CAAA,WAAU;AACxD,QAAM,EAAE,cAAc;AACtB,SAAO,YAAY,CAAA,MAAK;AACvB,QAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACrC,aAAO,UAAU,CAAC;AAAA,IACnB;AACA,MAAE,eAAA;AACF,eAAW,WAAW,QAAQ,IAAI;AAAA,EACnC;AACD;"}
|
|
1
|
+
{"version":3,"file":"withNewline.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/newline/withNewline.ts"],"sourcesContent":["import { Transforms } from 'slate'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withNewline = (): EditorPlugin => editor => {\n\tconst { onKeyDown } = editor\n\teditor.onKeyDown = e => {\n\t\tif (e.key !== 'Enter' || !e.shiftKey) {\n\t\t\treturn onKeyDown(e)\n\t\t}\n\t\te.preventDefault()\n\t\tTransforms.insertText(editor, '\\n')\n\t}\n}\n"],"names":[],"mappings":";AAGO,MAAM,cAAc,MAAoB,CAAA,WAAU;AACxD,QAAM,EAAE,cAAc;AACtB,SAAO,YAAY,CAAA,MAAK;AACvB,QAAI,EAAE,QAAQ,WAAW,CAAC,EAAE,UAAU;AACrC,aAAO,UAAU,CAAC;AAAA,IACnB;AACA,MAAE,eAAA;AACF,eAAW,WAAW,QAAQ,IAAI;AAAA,EACnC;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strikeThroughMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/strikeThroughMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const strikeThroughMark = 'isStruckThrough'\nexport const strikeThroughPlugin: EditorMarkPlugin = {\n\ttype: strikeThroughMark,\n\trender: ({ children }) => createElement('s', undefined, children),\n\tisHotKey: isHotkey('mod+opt+s'),\n}\n"],"names":["createElement","isHotkey"],"mappings":";;;;AAIO,MAAM,oBAAoB;AAC1B,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ,CAAC,EAAE,SAAA,MAAeA,MAAAA,cAAc,KAAK,QAAW,QAAQ;AAAA,EAChE,UAAUC,SAAAA,SAAS,WAAW;AAC/B;;;"}
|
|
1
|
+
{"version":3,"file":"strikeThroughMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/strikeThroughMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const strikeThroughMark = 'isStruckThrough'\nexport const strikeThroughPlugin: EditorMarkPlugin = {\n\ttype: strikeThroughMark,\n\trender: ({ children }) => createElement('s', undefined, children),\n\tisHotKey: isHotkey('mod+opt+s'),\n}\n"],"names":["createElement","isHotkey"],"mappings":";;;;AAIO,MAAM,oBAAoB;AAC1B,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ,CAAC,EAAE,SAAA,MAAeA,MAAAA,cAAc,KAAK,QAAW,QAAQ;AAAA,EAChE,UAAUC,SAAAA,SAAS,WAAW;AAC/B;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strikeThroughMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/strikeThroughMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const strikeThroughMark = 'isStruckThrough'\nexport const strikeThroughPlugin: EditorMarkPlugin = {\n\ttype: strikeThroughMark,\n\trender: ({ children }) => createElement('s', undefined, children),\n\tisHotKey: isHotkey('mod+opt+s'),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,oBAAoB;AAC1B,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AAAA,EAChE,UAAU,SAAS,WAAW;AAC/B;"}
|
|
1
|
+
{"version":3,"file":"strikeThroughMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/strikeThroughMark.ts"],"sourcesContent":["import { createElement } from 'react'\nimport { isHotkey } from 'is-hotkey'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const strikeThroughMark = 'isStruckThrough'\nexport const strikeThroughPlugin: EditorMarkPlugin = {\n\ttype: strikeThroughMark,\n\trender: ({ children }) => createElement('s', undefined, children),\n\tisHotKey: isHotkey('mod+opt+s'),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,oBAAoB;AAC1B,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AAAA,EAChE,UAAU,SAAS,WAAW;AAC/B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withStrikeThrough.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/withStrikeThrough.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { strikeThroughMark, strikeThroughPlugin } from './strikeThroughMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withStrikeThrough = (): EditorPlugin => editor => {\n\teditor.registerMark(strikeThroughPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tstrikeThroughMark,\n\t\t\tel => el.nodeName === 'S',\n\t\t\tel => el.style.textDecoration === 'line-through',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":["strikeThroughPlugin","createMarkHtmlDeserializer","strikeThroughMark"],"mappings":";;;;AAKO,MAAM,oBAAoB,MAAoB,CAAA,WAAU;AAC9D,SAAO,aAAaA,qCAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,kBAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;;"}
|
|
1
|
+
{"version":3,"file":"withStrikeThrough.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/withStrikeThrough.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { strikeThroughMark, strikeThroughPlugin } from './strikeThroughMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withStrikeThrough = (): EditorPlugin => editor => {\n\teditor.registerMark(strikeThroughPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tstrikeThroughMark,\n\t\t\tel => el.nodeName === 'S',\n\t\t\tel => el.style.textDecoration === 'line-through',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":["strikeThroughPlugin","createMarkHtmlDeserializer","strikeThroughMark"],"mappings":";;;;AAKO,MAAM,oBAAoB,MAAoB,CAAA,WAAU;AAC9D,SAAO,aAAaA,qCAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,kBAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withStrikeThrough.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/withStrikeThrough.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { strikeThroughMark, strikeThroughPlugin } from './strikeThroughMark'\nimport { EditorPlugin } from '../../../types'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\n\nexport const withStrikeThrough = (): EditorPlugin => editor => {\n\teditor.registerMark(strikeThroughPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tstrikeThroughMark,\n\t\t\tel => el.nodeName === 'S',\n\t\t\tel => el.style.textDecoration === 'line-through',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":[],"mappings":";;AAKO,MAAM,oBAAoB,MAAoB,CAAA,WAAU;AAC9D,SAAO,aAAa,mBAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;"}
|
|
1
|
+
{"version":3,"file":"withStrikeThrough.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/strikeThrough/withStrikeThrough.ts"],"sourcesContent":["import { Editor as SlateEditor } from 'slate'\nimport { strikeThroughMark, strikeThroughPlugin } from './strikeThroughMark.js'\nimport { EditorPlugin } from '../../../types/index.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\n\nexport const withStrikeThrough = (): EditorPlugin => editor => {\n\teditor.registerMark(strikeThroughPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tstrikeThroughMark,\n\t\t\tel => el.nodeName === 'S',\n\t\t\tel => el.style.textDecoration === 'line-through',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":[],"mappings":";;AAKO,MAAM,oBAAoB,MAAoB,CAAA,WAAU;AAC9D,SAAO,aAAa,mBAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"underlineMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/underline/underlineMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const underlineMark = 'isUnderlined'\n\nexport const underlineMarkPlugin: EditorMarkPlugin = {\n\ttype: underlineMark,\n\tisHotKey: isHotkey('mod+u'),\n\trender: ({ children }) => createElement('u', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
|
|
1
|
+
{"version":3,"file":"underlineMark.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/underline/underlineMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const underlineMark = 'isUnderlined'\n\nexport const underlineMarkPlugin: EditorMarkPlugin = {\n\ttype: underlineMark,\n\tisHotKey: isHotkey('mod+u'),\n\trender: ({ children }) => createElement('u', undefined, children),\n}\n"],"names":["isHotkey","createElement"],"mappings":";;;;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAUA,SAAAA,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAeC,MAAAA,cAAc,KAAK,QAAW,QAAQ;AACjE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"underlineMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/underline/underlineMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types'\n\nexport const underlineMark = 'isUnderlined'\n\nexport const underlineMarkPlugin: EditorMarkPlugin = {\n\ttype: underlineMark,\n\tisHotKey: isHotkey('mod+u'),\n\trender: ({ children }) => createElement('u', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
|
|
1
|
+
{"version":3,"file":"underlineMark.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/underline/underlineMark.ts"],"sourcesContent":["import { isHotkey } from 'is-hotkey'\nimport { createElement } from 'react'\nimport { EditorMarkPlugin } from '../../../types/index.js'\n\nexport const underlineMark = 'isUnderlined'\n\nexport const underlineMarkPlugin: EditorMarkPlugin = {\n\ttype: underlineMark,\n\tisHotKey: isHotkey('mod+u'),\n\trender: ({ children }) => createElement('u', undefined, children),\n}\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB;AAEtB,MAAM,sBAAwC;AAAA,EACpD,MAAM;AAAA,EACN,UAAU,SAAS,OAAO;AAAA,EAC1B,QAAQ,CAAC,EAAE,SAAA,MAAe,cAAc,KAAK,QAAW,QAAQ;AACjE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withUnderline.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/underline/withUnderline.ts"],"sourcesContent":["import { underlineMark, underlineMarkPlugin } from './underlineMark'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\nimport { EditorPlugin } from '../../../types'\n\nexport const withUnderline = (): EditorPlugin => editor => {\n\teditor.registerMark(underlineMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tunderlineMark,\n\t\t\tel => el.nodeName === 'U',\n\t\t\tel => el.style.textDecoration === 'underline',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":["underlineMarkPlugin","createMarkHtmlDeserializer","underlineMark"],"mappings":";;;;AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAaA,iCAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,cAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;;"}
|
|
1
|
+
{"version":3,"file":"withUnderline.cjs","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/underline/withUnderline.ts"],"sourcesContent":["import { underlineMark, underlineMarkPlugin } from './underlineMark.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withUnderline = (): EditorPlugin => editor => {\n\teditor.registerMark(underlineMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tunderlineMark,\n\t\t\tel => el.nodeName === 'U',\n\t\t\tel => el.style.textDecoration === 'underline',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":["underlineMarkPlugin","createMarkHtmlDeserializer","underlineMark"],"mappings":";;;;AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAaA,iCAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvBC,2BAAAA;AAAAA,MACCC,cAAAA;AAAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withUnderline.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/underline/withUnderline.ts"],"sourcesContent":["import { underlineMark, underlineMarkPlugin } from './underlineMark'\nimport { createMarkHtmlDeserializer } from '../../behaviour'\nimport { EditorPlugin } from '../../../types'\n\nexport const withUnderline = (): EditorPlugin => editor => {\n\teditor.registerMark(underlineMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tunderlineMark,\n\t\t\tel => el.nodeName === 'U',\n\t\t\tel => el.style.textDecoration === 'underline',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAa,mBAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;"}
|
|
1
|
+
{"version":3,"file":"withUnderline.js","sources":["../../../../../../../packages/react-slate-editor-base/src/plugins/text/underline/withUnderline.ts"],"sourcesContent":["import { underlineMark, underlineMarkPlugin } from './underlineMark.js'\nimport { createMarkHtmlDeserializer } from '../../behaviour/index.js'\nimport { EditorPlugin } from '../../../types/index.js'\n\nexport const withUnderline = (): EditorPlugin => editor => {\n\teditor.registerMark(underlineMarkPlugin)\n\teditor.htmlDeserializer.registerPlugin(\n\t\tcreateMarkHtmlDeserializer(\n\t\t\tunderlineMark,\n\t\t\tel => el.nodeName === 'U',\n\t\t\tel => el.style.textDecoration === 'underline',\n\t\t),\n\t)\n\n\treturn editor\n}\n"],"names":[],"mappings":";;AAIO,MAAM,gBAAgB,MAAoB,CAAA,WAAU;AAC1D,SAAO,aAAa,mBAAmB;AACvC,SAAO,iBAAiB;AAAA,IACvB;AAAA,MACC;AAAA,MACA,CAAA,OAAM,GAAG,aAAa;AAAA,MACtB,CAAA,OAAM,GAAG,MAAM,mBAAmB;AAAA,IAAA;AAAA,EACnC;AAGD,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.cjs","sources":["../../../../../packages/react-slate-editor-base/src/components/RichTextEditor.tsx"],"sourcesContent":["import { Component, Field, FieldAccessor, FieldBasicProps, QueryLanguage, useEntity } from '@contember/react-binding'\nimport { FunctionComponent, useCallback, useMemo, useState } from 'react'\nimport { Descendant, Editor, Element as SlateElement, Node as SlateNode, NodeEntry, Transforms } from 'slate'\nimport { Slate } from 'slate-react'\nimport { createEditor, CreateEditorPublicOptions } from '../editor'\nimport { paragraphElementType } from '../plugins'\nimport { useRichTextFieldNodes } from '../internal/hooks/useRichTextFieldNodes'\n\nexport type RichTextEditorProps =\n\t& FieldBasicProps\n\t& CreateEditorPublicOptions\n\t& {\n\t\tchildren: React.ReactNode\n\t}\n\n/**\n * Rich text field supports more advanced formatting capabilities. Output of this field is a JSON.\n *\n * @group Form Fields\n */\nexport const RichTextEditor: FunctionComponent<RichTextEditorProps> = Component(\n\tprops => {\n\t\tconst entity = useEntity()\n\t\tconst environment = entity.environment\n\t\tconst getParent = entity.getAccessor\n\n\t\tconst desugaredField = useMemo(\n\t\t\t() => QueryLanguage.desugarRelativeSingleField(props, environment),\n\t\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: props is stable via Component HOC\n\t\t\t[environment, props],\n\t\t)\n\t\tconst fieldAccessor = useMemo(() => entity.getField<string>(desugaredField), [entity, desugaredField])\n\n\t\t// The cache is questionable, really.\n\t\tconst [contemberFieldElementCache] = useState(() => new WeakMap<FieldAccessor<string>, SlateElement[]>())\n\n\t\tconst [editor] = useState(() => {\n\t\t\tconst { editor } = createEditor({\n\t\t\t\tplugins: props.plugins,\n\t\t\t\tdefaultElementType: paragraphElementType,\n\t\t\t\tentity,\n\t\t\t\tenvironment,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\n\t\t\tconst { normalizeNode } = editor\n\t\t\tObject.assign(editor, {\n\t\t\t\tinsertBreak: () => {\n\t\t\t\t\tTransforms.insertText(editor, '\\n')\n\t\t\t\t},\n\t\t\t\tnormalizeNode: (nodeEntry: NodeEntry) => {\n\t\t\t\t\tconst [node, path] = nodeEntry\n\t\t\t\t\tif (path.length === 0 && SlateElement.isAncestor(node)) {\n\t\t\t\t\t\t// Enforce that there's exactly one child and that it's\n\t\t\t\t\t\tif (node.children.length > 1) {\n\t\t\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t\t\tconst targetPath = [0, (editor.children[0] as SlateElement).children.length]\n\t\t\t\t\t\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\t\t\t\t\t\tat: [1],\n\t\t\t\t\t\t\t\t\tto: targetPath,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tTransforms.unwrapNodes(editor, { at: targetPath })\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (SlateElement.isElement(node.children[0]) && !editor.isDefaultElement(node.children[0])) {\n\t\t\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([{ text: '' }]), {\n\t\t\t\t\t\t\t\t\tat: path,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tTransforms.unwrapNodes(editor, { at: [0, 0] })\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (SlateElement.isElement(node) && Editor.isBlock(editor, node) && path.length > 1) {\n\t\t\t\t\t\treturn Transforms.unwrapNodes(editor, { at: path })\n\t\t\t\t\t}\n\t\t\t\t\tnormalizeNode(nodeEntry)\n\t\t\t\t},\n\t\t\t})\n\n\t\t\treturn editor\n\t\t})\n\n\t\tconst valueNodes = useRichTextFieldNodes({\n\t\t\teditor,\n\t\t\tfieldAccessor,\n\t\t\tcontemberFieldElementCache,\n\t\t})\n\n\t\tconst serialize = editor.serializeNodes\n\t\tconst onChange = useCallback(\n\t\t\t(value: Descendant[]) => {\n\t\t\t\tgetParent().batchUpdates(getAccessor => {\n\t\t\t\t\tconst fieldAccessor = getAccessor().getField(desugaredField)\n\n\t\t\t\t\tif (SlateNode.string({ type: 'dummy', children: value }) === '' && fieldAccessor.valueOnServer === null) {\n\t\t\t\t\t\tfieldAccessor.updateValue(null)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (SlateElement.isElement(value[0])) {\n\t\t\t\t\t\tfieldAccessor.updateValue(serialize(value[0].children))\n\t\t\t\t\t\tcontemberFieldElementCache.set(getAccessor().getField(desugaredField), value as SlateElement[])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t[getParent, contemberFieldElementCache, desugaredField, serialize],\n\t\t)\n\n\t\treturn (\n\t\t\t<Slate editor={editor} initialValue={valueNodes} onChange={onChange}>\n\t\t\t\t{props.children}\n\t\t\t</Slate>\n\t\t)\n\t},\n\tprops => (\n\t\t<>\n\t\t\t<Field defaultValue={props.defaultValue} field={props.field} isNonbearing={props.isNonbearing} />\n\t\t</>\n\t),\n\t'RichTextEditor',\n)\n"],"names":["Component","useEntity","useMemo","QueryLanguage","useState","editor","createEditor","paragraphElementType","Transforms","SlateElement","Editor","useRichTextFieldNodes","useCallback","fieldAccessor","SlateNode","Slate","jsx","Fragment","Field"],"mappings":";;;;;;;;;;AAoBO,MAAM,iBAAyDA,aAAAA;AAAAA,EACrE,CAAA,UAAS;AACR,UAAM,SAASC,aAAAA,UAAA;AACf,UAAM,cAAc,OAAO;AAC3B,UAAM,YAAY,OAAO;AAEzB,UAAM,iBAAiBC,MAAAA;AAAAA,MACtB,MAAMC,2BAAc,2BAA2B,OAAO,WAAW;AAAA;AAAA,MAEjE,CAAC,aAAa,KAAK;AAAA,IAAA;AAEpB,UAAM,gBAAgBD,cAAQ,MAAM,OAAO,SAAiB,cAAc,GAAG,CAAC,QAAQ,cAAc,CAAC;AAGrG,UAAM,CAAC,0BAA0B,IAA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../../../../../packages/react-slate-editor-base/src/components/RichTextEditor.tsx"],"sourcesContent":["import { Component, Field, FieldAccessor, FieldBasicProps, QueryLanguage, useEntity } from '@contember/react-binding'\nimport { FunctionComponent, useCallback, useMemo, useState } from 'react'\nimport { Descendant, Editor, Element as SlateElement, Node as SlateNode, NodeEntry, Transforms } from 'slate'\nimport { Slate } from 'slate-react'\nimport { createEditor, CreateEditorPublicOptions } from '../editor/index.js'\nimport { paragraphElementType } from '../plugins/index.js'\nimport { useRichTextFieldNodes } from '../internal/hooks/useRichTextFieldNodes.js'\n\nexport type RichTextEditorProps =\n\t& FieldBasicProps\n\t& CreateEditorPublicOptions\n\t& {\n\t\tchildren: React.ReactNode\n\t}\n\n/**\n * Rich text field supports more advanced formatting capabilities. Output of this field is a JSON.\n *\n * @group Form Fields\n */\nexport const RichTextEditor: FunctionComponent<RichTextEditorProps> = Component(\n\tprops => {\n\t\tconst entity = useEntity()\n\t\tconst environment = entity.environment\n\t\tconst getParent = entity.getAccessor\n\n\t\tconst desugaredField = useMemo(\n\t\t\t() => QueryLanguage.desugarRelativeSingleField(props, environment),\n\t\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: props is stable via Component HOC\n\t\t\t[environment, props],\n\t\t)\n\t\tconst fieldAccessor = useMemo(() => entity.getField<string>(desugaredField), [entity, desugaredField])\n\n\t\t// The cache is questionable, really.\n\t\tconst [contemberFieldElementCache] = useState(() => new WeakMap<FieldAccessor<string>, SlateElement[]>())\n\n\t\tconst [editor] = useState(() => {\n\t\t\tconst { editor } = createEditor({\n\t\t\t\tplugins: props.plugins,\n\t\t\t\tdefaultElementType: paragraphElementType,\n\t\t\t\tentity,\n\t\t\t\tenvironment,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\n\t\t\tconst { normalizeNode } = editor\n\t\t\tObject.assign(editor, {\n\t\t\t\tinsertBreak: () => {\n\t\t\t\t\tTransforms.insertText(editor, '\\n')\n\t\t\t\t},\n\t\t\t\tnormalizeNode: (nodeEntry: NodeEntry) => {\n\t\t\t\t\tconst [node, path] = nodeEntry\n\t\t\t\t\tif (path.length === 0 && SlateElement.isAncestor(node)) {\n\t\t\t\t\t\t// Enforce that there's exactly one child and that it's\n\t\t\t\t\t\tif (node.children.length > 1) {\n\t\t\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t\t\tconst targetPath = [0, (editor.children[0] as SlateElement).children.length]\n\t\t\t\t\t\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\t\t\t\t\t\tat: [1],\n\t\t\t\t\t\t\t\t\tto: targetPath,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tTransforms.unwrapNodes(editor, { at: targetPath })\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (SlateElement.isElement(node.children[0]) && !editor.isDefaultElement(node.children[0])) {\n\t\t\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([{ text: '' }]), {\n\t\t\t\t\t\t\t\t\tat: path,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tTransforms.unwrapNodes(editor, { at: [0, 0] })\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (SlateElement.isElement(node) && Editor.isBlock(editor, node) && path.length > 1) {\n\t\t\t\t\t\treturn Transforms.unwrapNodes(editor, { at: path })\n\t\t\t\t\t}\n\t\t\t\t\tnormalizeNode(nodeEntry)\n\t\t\t\t},\n\t\t\t})\n\n\t\t\treturn editor\n\t\t})\n\n\t\tconst valueNodes = useRichTextFieldNodes({\n\t\t\teditor,\n\t\t\tfieldAccessor,\n\t\t\tcontemberFieldElementCache,\n\t\t})\n\n\t\tconst serialize = editor.serializeNodes\n\t\tconst onChange = useCallback(\n\t\t\t(value: Descendant[]) => {\n\t\t\t\tgetParent().batchUpdates(getAccessor => {\n\t\t\t\t\tconst fieldAccessor = getAccessor().getField(desugaredField)\n\n\t\t\t\t\tif (SlateNode.string({ type: 'dummy', children: value }) === '' && fieldAccessor.valueOnServer === null) {\n\t\t\t\t\t\tfieldAccessor.updateValue(null)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (SlateElement.isElement(value[0])) {\n\t\t\t\t\t\tfieldAccessor.updateValue(serialize(value[0].children))\n\t\t\t\t\t\tcontemberFieldElementCache.set(getAccessor().getField(desugaredField), value as SlateElement[])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t[getParent, contemberFieldElementCache, desugaredField, serialize],\n\t\t)\n\n\t\treturn (\n\t\t\t<Slate editor={editor} initialValue={valueNodes} onChange={onChange}>\n\t\t\t\t{props.children}\n\t\t\t</Slate>\n\t\t)\n\t},\n\tprops => (\n\t\t<>\n\t\t\t<Field defaultValue={props.defaultValue} field={props.field} isNonbearing={props.isNonbearing} />\n\t\t</>\n\t),\n\t'RichTextEditor',\n)\n"],"names":["Component","useEntity","useMemo","QueryLanguage","useState","editor","createEditor","paragraphElementType","Transforms","SlateElement","Editor","useRichTextFieldNodes","useCallback","fieldAccessor","SlateNode","Slate","jsx","Fragment","Field"],"mappings":";;;;;;;;;;AAoBO,MAAM,iBAAyDA,aAAAA;AAAAA,EACrE,CAAA,UAAS;AACR,UAAM,SAASC,aAAAA,UAAA;AACf,UAAM,cAAc,OAAO;AAC3B,UAAM,YAAY,OAAO;AAEzB,UAAM,iBAAiBC,MAAAA;AAAAA,MACtB,MAAMC,2BAAc,2BAA2B,OAAO,WAAW;AAAA;AAAA,MAEjE,CAAC,aAAa,KAAK;AAAA,IAAA;AAEpB,UAAM,gBAAgBD,cAAQ,MAAM,OAAO,SAAiB,cAAc,GAAG,CAAC,QAAQ,cAAc,CAAC;AAGrG,UAAM,CAAC,0BAA0B,IAAIE,MAAAA,SAAS,MAAM,oBAAI,SAAgD;AAExG,UAAM,CAAC,MAAM,IAAIA,MAAAA,SAAS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AAQL,SAAQ,IAAI,KAAK,KAAK,SAAS,GAAG;AACpF,mBAAOG,MAAAA,WAAW,YAAYH,SAAQ,EAAE,IAAI,MAAM;AAAA,UACnD;AACA,wBAAc,SAAS;AAAA,QACxB;AAAA,MAAA,CACA;AAED,aAAOA;AAAAA,IACR,CAAC;AAED,UAAM,aAAaM,sBAAAA,sBAAsB;AAAA,MACxC;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACA;AAED,UAAM,YAAY,OAAO;AACzB,UAAM,WAAWC,MAAAA;AAAAA,MAChB,CAAC,UAAwB;AACxB,kBAAA,EAAY,aAAa,CAAA,gBAAe;AACvC,gBAAMC,iBAAgB,cAAc,SAAS,cAAc;AAE3D,cAAIC,WAAU,OAAO,EAAE,MAAM,SAAS,UAAU,MAAA,CAAO,MAAM,MAAMD,eAAc,kBAAkB,MAAM;AACxGA,2BAAc,YAAY,IAAI;AAC9B;AAAA,UACD;AAEA,cAAIJ,MAAAA,QAAa,UAAU,MAAM,CAAC,CAAC,GAAG;AACrCI,2BAAc,YAAY,UAAU,MAAM,CAAC,EAAE,QAAQ,CAAC;AACtD,uCAA2B,IAAI,YAAA,EAAc,SAAS,cAAc,GAAG,KAAuB;AAAA,UAC/F;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,CAAC,WAAW,4BAA4B,gBAAgB,SAAS;AAAA,IAAA;AAGlE,0CACEE,WAAAA,OAAA,EAAM,QAAgB,cAAc,YAAY,UAC/C,gBAAM,UACR;AAAA,EAEF;AAAA,EACA,CAAA,UACCC,2BAAAA,IAAAC,WAAAA,UAAA,EACC,UAAAD,2BAAAA,IAACE,aAAAA,OAAA,EAAM,cAAc,MAAM,cAAc,OAAO,MAAM,OAAO,cAAc,MAAM,cAAc,GAChG;AAAA,EAED;AACD;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.js","sources":["../../../../../packages/react-slate-editor-base/src/components/RichTextEditor.tsx"],"sourcesContent":["import { Component, Field, FieldAccessor, FieldBasicProps, QueryLanguage, useEntity } from '@contember/react-binding'\nimport { FunctionComponent, useCallback, useMemo, useState } from 'react'\nimport { Descendant, Editor, Element as SlateElement, Node as SlateNode, NodeEntry, Transforms } from 'slate'\nimport { Slate } from 'slate-react'\nimport { createEditor, CreateEditorPublicOptions } from '../editor'\nimport { paragraphElementType } from '../plugins'\nimport { useRichTextFieldNodes } from '../internal/hooks/useRichTextFieldNodes'\n\nexport type RichTextEditorProps =\n\t& FieldBasicProps\n\t& CreateEditorPublicOptions\n\t& {\n\t\tchildren: React.ReactNode\n\t}\n\n/**\n * Rich text field supports more advanced formatting capabilities. Output of this field is a JSON.\n *\n * @group Form Fields\n */\nexport const RichTextEditor: FunctionComponent<RichTextEditorProps> = Component(\n\tprops => {\n\t\tconst entity = useEntity()\n\t\tconst environment = entity.environment\n\t\tconst getParent = entity.getAccessor\n\n\t\tconst desugaredField = useMemo(\n\t\t\t() => QueryLanguage.desugarRelativeSingleField(props, environment),\n\t\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: props is stable via Component HOC\n\t\t\t[environment, props],\n\t\t)\n\t\tconst fieldAccessor = useMemo(() => entity.getField<string>(desugaredField), [entity, desugaredField])\n\n\t\t// The cache is questionable, really.\n\t\tconst [contemberFieldElementCache] = useState(() => new WeakMap<FieldAccessor<string>, SlateElement[]>())\n\n\t\tconst [editor] = useState(() => {\n\t\t\tconst { editor } = createEditor({\n\t\t\t\tplugins: props.plugins,\n\t\t\t\tdefaultElementType: paragraphElementType,\n\t\t\t\tentity,\n\t\t\t\tenvironment,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\n\t\t\tconst { normalizeNode } = editor\n\t\t\tObject.assign(editor, {\n\t\t\t\tinsertBreak: () => {\n\t\t\t\t\tTransforms.insertText(editor, '\\n')\n\t\t\t\t},\n\t\t\t\tnormalizeNode: (nodeEntry: NodeEntry) => {\n\t\t\t\t\tconst [node, path] = nodeEntry\n\t\t\t\t\tif (path.length === 0 && SlateElement.isAncestor(node)) {\n\t\t\t\t\t\t// Enforce that there's exactly one child and that it's\n\t\t\t\t\t\tif (node.children.length > 1) {\n\t\t\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t\t\tconst targetPath = [0, (editor.children[0] as SlateElement).children.length]\n\t\t\t\t\t\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\t\t\t\t\t\tat: [1],\n\t\t\t\t\t\t\t\t\tto: targetPath,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tTransforms.unwrapNodes(editor, { at: targetPath })\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (SlateElement.isElement(node.children[0]) && !editor.isDefaultElement(node.children[0])) {\n\t\t\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([{ text: '' }]), {\n\t\t\t\t\t\t\t\t\tat: path,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tTransforms.unwrapNodes(editor, { at: [0, 0] })\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (SlateElement.isElement(node) && Editor.isBlock(editor, node) && path.length > 1) {\n\t\t\t\t\t\treturn Transforms.unwrapNodes(editor, { at: path })\n\t\t\t\t\t}\n\t\t\t\t\tnormalizeNode(nodeEntry)\n\t\t\t\t},\n\t\t\t})\n\n\t\t\treturn editor\n\t\t})\n\n\t\tconst valueNodes = useRichTextFieldNodes({\n\t\t\teditor,\n\t\t\tfieldAccessor,\n\t\t\tcontemberFieldElementCache,\n\t\t})\n\n\t\tconst serialize = editor.serializeNodes\n\t\tconst onChange = useCallback(\n\t\t\t(value: Descendant[]) => {\n\t\t\t\tgetParent().batchUpdates(getAccessor => {\n\t\t\t\t\tconst fieldAccessor = getAccessor().getField(desugaredField)\n\n\t\t\t\t\tif (SlateNode.string({ type: 'dummy', children: value }) === '' && fieldAccessor.valueOnServer === null) {\n\t\t\t\t\t\tfieldAccessor.updateValue(null)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (SlateElement.isElement(value[0])) {\n\t\t\t\t\t\tfieldAccessor.updateValue(serialize(value[0].children))\n\t\t\t\t\t\tcontemberFieldElementCache.set(getAccessor().getField(desugaredField), value as SlateElement[])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t[getParent, contemberFieldElementCache, desugaredField, serialize],\n\t\t)\n\n\t\treturn (\n\t\t\t<Slate editor={editor} initialValue={valueNodes} onChange={onChange}>\n\t\t\t\t{props.children}\n\t\t\t</Slate>\n\t\t)\n\t},\n\tprops => (\n\t\t<>\n\t\t\t<Field defaultValue={props.defaultValue} field={props.field} isNonbearing={props.isNonbearing} />\n\t\t</>\n\t),\n\t'RichTextEditor',\n)\n"],"names":["editor","SlateElement","fieldAccessor","SlateNode"],"mappings":";;;;;;;;AAoBO,MAAM,iBAAyD;AAAA,EACrE,CAAA,UAAS;AACR,UAAM,SAAS,UAAA;AACf,UAAM,cAAc,OAAO;AAC3B,UAAM,YAAY,OAAO;AAEzB,UAAM,iBAAiB;AAAA,MACtB,MAAM,cAAc,2BAA2B,OAAO,WAAW;AAAA;AAAA,MAEjE,CAAC,aAAa,KAAK;AAAA,IAAA;AAEpB,UAAM,gBAAgB,QAAQ,MAAM,OAAO,SAAiB,cAAc,GAAG,CAAC,QAAQ,cAAc,CAAC;AAGrG,UAAM,CAAC,0BAA0B,IAAI,SAAS,MAAM,oBAAI,SAAgD;AAExG,UAAM,CAAC,MAAM,IAAI,SAAS,MAAM;AAC/B,YAAM,EAAE,QAAAA,QAAAA,IAAW,aAAa;AAAA,QAC/B,SAAS,MAAM;AAAA,QACf,oBAAoB;AAAA,QACpB;AAAA,QACA;AAAA,QACA,UAAU,MAAM;AAAA,MAAA,CAChB;AAED,YAAM,EAAE,kBAAkBA;AAC1B,aAAO,OAAOA,SAAQ;AA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AW;AAAA,MAChB,CAAC,UAAwB;AACxB,kBAAA,EAAY,aAAa,CAAA,gBAAe;AACvC,gBAAME,iBAAgB,cAAc,SAAS,cAAc;AAE3D,cAAIC,KAAU,OAAO,EAAE,MAAM,SAAS,UAAU,MAAA,CAAO,MAAM,MAAMD,eAAc,kBAAkB,MAAM;AACxGA,2BAAc,YAAY,IAAI;AAC9B;AAAA,UACD;AAEA,cAAID,QAAa,UAAU,MAAM,CAAC,CAAC,GAAG;AACrCC,2BAAc,YAAY,UAAU,MAAM,CAAC,EAAE,QAAQ,CAAC;AACtD,uCAA2B,IAAI,YAAA,EAAc,SAAS,cAAc,GAAG,KAAuB;AAAA,UAC/F;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,CAAC,WAAW,4BAA4B,gBAAgB,SAAS;AAAA,IAAA;AAGlE,+BACE,OAAA,EAAM,QAAgB,cAAc,YAAY,UAC/C,gBAAM,UACR;AAAA,EAEF;AAAA,EACA,CAAA,UACC,oBAAA,UAAA,EACC,UAAA,oBAAC,OAAA,EAAM,cAAc,MAAM,cAAc,OAAO,MAAM,OAAO,cAAc,MAAM,cAAc,GAChG;AAAA,EAED;AACD;"}
|
|
1
|
+
{"version":3,"file":"RichTextEditor.js","sources":["../../../../../packages/react-slate-editor-base/src/components/RichTextEditor.tsx"],"sourcesContent":["import { Component, Field, FieldAccessor, FieldBasicProps, QueryLanguage, useEntity } from '@contember/react-binding'\nimport { FunctionComponent, useCallback, useMemo, useState } from 'react'\nimport { Descendant, Editor, Element as SlateElement, Node as SlateNode, NodeEntry, Transforms } from 'slate'\nimport { Slate } from 'slate-react'\nimport { createEditor, CreateEditorPublicOptions } from '../editor/index.js'\nimport { paragraphElementType } from '../plugins/index.js'\nimport { useRichTextFieldNodes } from '../internal/hooks/useRichTextFieldNodes.js'\n\nexport type RichTextEditorProps =\n\t& FieldBasicProps\n\t& CreateEditorPublicOptions\n\t& {\n\t\tchildren: React.ReactNode\n\t}\n\n/**\n * Rich text field supports more advanced formatting capabilities. Output of this field is a JSON.\n *\n * @group Form Fields\n */\nexport const RichTextEditor: FunctionComponent<RichTextEditorProps> = Component(\n\tprops => {\n\t\tconst entity = useEntity()\n\t\tconst environment = entity.environment\n\t\tconst getParent = entity.getAccessor\n\n\t\tconst desugaredField = useMemo(\n\t\t\t() => QueryLanguage.desugarRelativeSingleField(props, environment),\n\t\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: props is stable via Component HOC\n\t\t\t[environment, props],\n\t\t)\n\t\tconst fieldAccessor = useMemo(() => entity.getField<string>(desugaredField), [entity, desugaredField])\n\n\t\t// The cache is questionable, really.\n\t\tconst [contemberFieldElementCache] = useState(() => new WeakMap<FieldAccessor<string>, SlateElement[]>())\n\n\t\tconst [editor] = useState(() => {\n\t\t\tconst { editor } = createEditor({\n\t\t\t\tplugins: props.plugins,\n\t\t\t\tdefaultElementType: paragraphElementType,\n\t\t\t\tentity,\n\t\t\t\tenvironment,\n\t\t\t\tchildren: props.children,\n\t\t\t})\n\n\t\t\tconst { normalizeNode } = editor\n\t\t\tObject.assign(editor, {\n\t\t\t\tinsertBreak: () => {\n\t\t\t\t\tTransforms.insertText(editor, '\\n')\n\t\t\t\t},\n\t\t\t\tnormalizeNode: (nodeEntry: NodeEntry) => {\n\t\t\t\t\tconst [node, path] = nodeEntry\n\t\t\t\t\tif (path.length === 0 && SlateElement.isAncestor(node)) {\n\t\t\t\t\t\t// Enforce that there's exactly one child and that it's\n\t\t\t\t\t\tif (node.children.length > 1) {\n\t\t\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t\t\tconst targetPath = [0, (editor.children[0] as SlateElement).children.length]\n\t\t\t\t\t\t\t\tTransforms.moveNodes(editor, {\n\t\t\t\t\t\t\t\t\tat: [1],\n\t\t\t\t\t\t\t\t\tto: targetPath,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tTransforms.unwrapNodes(editor, { at: targetPath })\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (SlateElement.isElement(node.children[0]) && !editor.isDefaultElement(node.children[0])) {\n\t\t\t\t\t\t\treturn Editor.withoutNormalizing(editor, () => {\n\t\t\t\t\t\t\t\tTransforms.wrapNodes(editor, editor.createDefaultElement([{ text: '' }]), {\n\t\t\t\t\t\t\t\t\tat: path,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\tTransforms.unwrapNodes(editor, { at: [0, 0] })\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (SlateElement.isElement(node) && Editor.isBlock(editor, node) && path.length > 1) {\n\t\t\t\t\t\treturn Transforms.unwrapNodes(editor, { at: path })\n\t\t\t\t\t}\n\t\t\t\t\tnormalizeNode(nodeEntry)\n\t\t\t\t},\n\t\t\t})\n\n\t\t\treturn editor\n\t\t})\n\n\t\tconst valueNodes = useRichTextFieldNodes({\n\t\t\teditor,\n\t\t\tfieldAccessor,\n\t\t\tcontemberFieldElementCache,\n\t\t})\n\n\t\tconst serialize = editor.serializeNodes\n\t\tconst onChange = useCallback(\n\t\t\t(value: Descendant[]) => {\n\t\t\t\tgetParent().batchUpdates(getAccessor => {\n\t\t\t\t\tconst fieldAccessor = getAccessor().getField(desugaredField)\n\n\t\t\t\t\tif (SlateNode.string({ type: 'dummy', children: value }) === '' && fieldAccessor.valueOnServer === null) {\n\t\t\t\t\t\tfieldAccessor.updateValue(null)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tif (SlateElement.isElement(value[0])) {\n\t\t\t\t\t\tfieldAccessor.updateValue(serialize(value[0].children))\n\t\t\t\t\t\tcontemberFieldElementCache.set(getAccessor().getField(desugaredField), value as SlateElement[])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t},\n\t\t\t[getParent, contemberFieldElementCache, desugaredField, serialize],\n\t\t)\n\n\t\treturn (\n\t\t\t<Slate editor={editor} initialValue={valueNodes} onChange={onChange}>\n\t\t\t\t{props.children}\n\t\t\t</Slate>\n\t\t)\n\t},\n\tprops => (\n\t\t<>\n\t\t\t<Field defaultValue={props.defaultValue} field={props.field} isNonbearing={props.isNonbearing} />\n\t\t</>\n\t),\n\t'RichTextEditor',\n)\n"],"names":["editor","SlateElement","fieldAccessor","SlateNode"],"mappings":";;;;;;;;AAoBO,MAAM,iBAAyD;AAAA,EACrE,CAAA,UAAS;AACR,UAAM,SAAS,UAAA;AACf,UAAM,cAAc,OAAO;AAC3B,UAAM,YAAY,OAAO;AAEzB,UAAM,iBAAiB;AAAA,MACtB,MAAM,cAAc,2BAA2B,OAAO,WAAW;AAAA;AAAA,MAEjE,CAAC,aAAa,KAAK;AAAA,IAAA;AAEpB,UAAM,gBAAgB,QAAQ,MAAM,OAAO,SAAiB,cAAc,GAAG,CAAC,QAAQ,cAAc,CAAC;AAGrG,UAAM,CAAC,0BAA0B,IAAI,SAAS,MAAM,oBAAI,SAAgD;AAExG,UAAM,CAAC,MAAM,IAAI,SAAS,MAAM;AAC/B,YAAM,EAAE,QAAAA,QAAAA,IAAW,aAAa;AAAA,QAC/B,SAAS,MAAM;AAAA,QACf,oBAAoB;AAAA,QACpB;AAAA,QACA;AAAA,QACA,UAAU,MAAM;AAAA,MAAA,CAChB;AAED,YAAM,EAAE,kBAAkBA;AAC1B,aAAO,OAAOA,SAAQ;AAAA,QACrB,aAAa,MAAM;AAClB,qBAAW,WAAWA,SAAQ,IAAI;AAAA,QACnC;AAAA,QACA,eAAe,CAAC,cAAyB;AACxC,gBAAM,CAAC,MAAM,IAAI,IAAI;AACrB,cAAI,KAAK,WAAW,KAAKC,QAAa,WAAW,IAAI,GAAG;AAEvD,gBAAI,KAAK,SAAS,SAAS,GAAG;AAC7B,qBAAO,OAAO,mBAAmBD,SAAQ,MAAM;AAC9C,sBAAM,aAAa,CAAC,GAAIA,QAAO,SAAS,CAAC,EAAmB,SAAS,MAAM;AAC3E,2BAAW,UAAUA,SAAQ;AAAA,kBAC5B,I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AAS,cAAc,GAAG,KAAuB;AAAA,UAC/F;AAAA,QACD,CAAC;AAAA,MACF;AAAA,MACA,CAAC,WAAW,4BAA4B,gBAAgB,SAAS;AAAA,IAAA;AAGlE,+BACE,OAAA,EAAM,QAAgB,cAAc,YAAY,UAC/C,gBAAM,UACR;AAAA,EAEF;AAAA,EACA,CAAA,UACC,oBAAA,UAAA,EACC,UAAA,oBAAC,OAAA,EAAM,cAAc,MAAM,cAAc,OAAO,MAAM,OAAO,cAAc,MAAM,cAAc,GAChG;AAAA,EAED;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorWrapNodeTrigger.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/components/triggers/EditorWrapNodeTrigger.tsx"],"sourcesContent":["import { Selection } from 'slate'\nimport { MouseEventHandler, ReactElement } from 'react'\nimport { useSlate } from 'slate-react'\nimport { Slot } from '@radix-ui/react-slot'\nimport * as React from 'react'\nimport { composeEventHandlers } from '@radix-ui/primitive'\nimport { EditorTransforms } from '../../slate-reexport'\n\nexport interface EditorWrapNodeTriggerProps {\n\telementType: string\n\tselection?: Selection\n\tsuchThat?: Record<string, unknown>\n\tchildren: ReactElement\n\tonClick?: MouseEventHandler<HTMLElement>\n}\n\nexport const EditorWrapNodeTrigger = ({ elementType, suchThat, selection, ...props }: EditorWrapNodeTriggerProps) => {\n\tconst editor = useSlate()\n\tconst onClick = () => {\n\t\tif (selection) {\n\t\t\tEditorTransforms.select(editor, selection)\n\t\t}\n\t\tEditorTransforms.wrapNodes(\n\t\t\teditor,\n\t\t\t{\n\t\t\t\ttype: elementType,\n\t\t\t\tchildren: [{ text: '' }],\n\t\t\t\t...suchThat,\n\t\t\t},\n\t\t\t{ split: true },\n\t\t)\n\t\tEditorTransforms.collapse(editor, { edge: 'end' })\n\t}\n\n\treturn <Slot {...props} onClick={composeEventHandlers(props.onClick, onClick)} />\n}\n"],"names":["useSlate","EditorTransforms","jsx","Slot","composeEventHandlers"],"mappings":";;;;;;;AAgBO,MAAM,wBAAwB,CAAC,EAAE,aAAa,UAAU,WAAW,GAAG,YAAwC;AACpH,QAAM,SAASA,WAAAA,SAAA;AACf,QAAM,UAAU,MAAM;AACrB,QAAI,WAAW;AACdC,uBAAiB,OAAO,QAAQ,SAAS;AAAA,IAC1C;AACAA,UAAAA,WAAiB;AAAA,MAChB;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,QACvB,GAAG;AAAA,MAAA;AAAA,MAEJ,EAAE,OAAO,KAAA;AAAA,IAAK;AAEfA,UAAAA,WAAiB,SAAS,QAAQ,EAAE,MAAM,OAAO;AAAA,EAClD;AAEA,SAAOC,+BAACC,UAAAA,QAAM,GAAG,OAAO,SAASC,UAAAA,qBAAqB,MAAM,SAAS,OAAO,GAAG;AAChF;;"}
|
|
1
|
+
{"version":3,"file":"EditorWrapNodeTrigger.cjs","sources":["../../../../../../packages/react-slate-editor-base/src/components/triggers/EditorWrapNodeTrigger.tsx"],"sourcesContent":["import { Selection } from 'slate'\nimport { MouseEventHandler, ReactElement } from 'react'\nimport { useSlate } from 'slate-react'\nimport { Slot } from '@radix-ui/react-slot'\nimport * as React from 'react'\nimport { composeEventHandlers } from '@radix-ui/primitive'\nimport { EditorTransforms } from '../../slate-reexport.js'\n\nexport interface EditorWrapNodeTriggerProps {\n\telementType: string\n\tselection?: Selection\n\tsuchThat?: Record<string, unknown>\n\tchildren: ReactElement\n\tonClick?: MouseEventHandler<HTMLElement>\n}\n\nexport const EditorWrapNodeTrigger = ({ elementType, suchThat, selection, ...props }: EditorWrapNodeTriggerProps) => {\n\tconst editor = useSlate()\n\tconst onClick = () => {\n\t\tif (selection) {\n\t\t\tEditorTransforms.select(editor, selection)\n\t\t}\n\t\tEditorTransforms.wrapNodes(\n\t\t\teditor,\n\t\t\t{\n\t\t\t\ttype: elementType,\n\t\t\t\tchildren: [{ text: '' }],\n\t\t\t\t...suchThat,\n\t\t\t},\n\t\t\t{ split: true },\n\t\t)\n\t\tEditorTransforms.collapse(editor, { edge: 'end' })\n\t}\n\n\treturn <Slot {...props} onClick={composeEventHandlers(props.onClick, onClick)} />\n}\n"],"names":["useSlate","EditorTransforms","jsx","Slot","composeEventHandlers"],"mappings":";;;;;;;AAgBO,MAAM,wBAAwB,CAAC,EAAE,aAAa,UAAU,WAAW,GAAG,YAAwC;AACpH,QAAM,SAASA,WAAAA,SAAA;AACf,QAAM,UAAU,MAAM;AACrB,QAAI,WAAW;AACdC,uBAAiB,OAAO,QAAQ,SAAS;AAAA,IAC1C;AACAA,UAAAA,WAAiB;AAAA,MAChB;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,QACvB,GAAG;AAAA,MAAA;AAAA,MAEJ,EAAE,OAAO,KAAA;AAAA,IAAK;AAEfA,UAAAA,WAAiB,SAAS,QAAQ,EAAE,MAAM,OAAO;AAAA,EAClD;AAEA,SAAOC,+BAACC,UAAAA,QAAM,GAAG,OAAO,SAASC,UAAAA,qBAAqB,MAAM,SAAS,OAAO,GAAG;AAChF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorWrapNodeTrigger.js","sources":["../../../../../../packages/react-slate-editor-base/src/components/triggers/EditorWrapNodeTrigger.tsx"],"sourcesContent":["import { Selection } from 'slate'\nimport { MouseEventHandler, ReactElement } from 'react'\nimport { useSlate } from 'slate-react'\nimport { Slot } from '@radix-ui/react-slot'\nimport * as React from 'react'\nimport { composeEventHandlers } from '@radix-ui/primitive'\nimport { EditorTransforms } from '../../slate-reexport'\n\nexport interface EditorWrapNodeTriggerProps {\n\telementType: string\n\tselection?: Selection\n\tsuchThat?: Record<string, unknown>\n\tchildren: ReactElement\n\tonClick?: MouseEventHandler<HTMLElement>\n}\n\nexport const EditorWrapNodeTrigger = ({ elementType, suchThat, selection, ...props }: EditorWrapNodeTriggerProps) => {\n\tconst editor = useSlate()\n\tconst onClick = () => {\n\t\tif (selection) {\n\t\t\tEditorTransforms.select(editor, selection)\n\t\t}\n\t\tEditorTransforms.wrapNodes(\n\t\t\teditor,\n\t\t\t{\n\t\t\t\ttype: elementType,\n\t\t\t\tchildren: [{ text: '' }],\n\t\t\t\t...suchThat,\n\t\t\t},\n\t\t\t{ split: true },\n\t\t)\n\t\tEditorTransforms.collapse(editor, { edge: 'end' })\n\t}\n\n\treturn <Slot {...props} onClick={composeEventHandlers(props.onClick, onClick)} />\n}\n"],"names":["EditorTransforms"],"mappings":";;;;;AAgBO,MAAM,wBAAwB,CAAC,EAAE,aAAa,UAAU,WAAW,GAAG,YAAwC;AACpH,QAAM,SAAS,SAAA;AACf,QAAM,UAAU,MAAM;AACrB,QAAI,WAAW;AACdA,iBAAiB,OAAO,QAAQ,SAAS;AAAA,IAC1C;AACAA,eAAiB;AAAA,MAChB;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,QACvB,GAAG;AAAA,MAAA;AAAA,MAEJ,EAAE,OAAO,KAAA;AAAA,IAAK;AAEfA,eAAiB,SAAS,QAAQ,EAAE,MAAM,OAAO;AAAA,EAClD;AAEA,SAAO,oBAAC,QAAM,GAAG,OAAO,SAAS,qBAAqB,MAAM,SAAS,OAAO,GAAG;AAChF;"}
|
|
1
|
+
{"version":3,"file":"EditorWrapNodeTrigger.js","sources":["../../../../../../packages/react-slate-editor-base/src/components/triggers/EditorWrapNodeTrigger.tsx"],"sourcesContent":["import { Selection } from 'slate'\nimport { MouseEventHandler, ReactElement } from 'react'\nimport { useSlate } from 'slate-react'\nimport { Slot } from '@radix-ui/react-slot'\nimport * as React from 'react'\nimport { composeEventHandlers } from '@radix-ui/primitive'\nimport { EditorTransforms } from '../../slate-reexport.js'\n\nexport interface EditorWrapNodeTriggerProps {\n\telementType: string\n\tselection?: Selection\n\tsuchThat?: Record<string, unknown>\n\tchildren: ReactElement\n\tonClick?: MouseEventHandler<HTMLElement>\n}\n\nexport const EditorWrapNodeTrigger = ({ elementType, suchThat, selection, ...props }: EditorWrapNodeTriggerProps) => {\n\tconst editor = useSlate()\n\tconst onClick = () => {\n\t\tif (selection) {\n\t\t\tEditorTransforms.select(editor, selection)\n\t\t}\n\t\tEditorTransforms.wrapNodes(\n\t\t\teditor,\n\t\t\t{\n\t\t\t\ttype: elementType,\n\t\t\t\tchildren: [{ text: '' }],\n\t\t\t\t...suchThat,\n\t\t\t},\n\t\t\t{ split: true },\n\t\t)\n\t\tEditorTransforms.collapse(editor, { edge: 'end' })\n\t}\n\n\treturn <Slot {...props} onClick={composeEventHandlers(props.onClick, onClick)} />\n}\n"],"names":["EditorTransforms"],"mappings":";;;;;AAgBO,MAAM,wBAAwB,CAAC,EAAE,aAAa,UAAU,WAAW,GAAG,YAAwC;AACpH,QAAM,SAAS,SAAA;AACf,QAAM,UAAU,MAAM;AACrB,QAAI,WAAW;AACdA,iBAAiB,OAAO,QAAQ,SAAS;AAAA,IAC1C;AACAA,eAAiB;AAAA,MAChB;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,QACvB,GAAG;AAAA,MAAA;AAAA,MAEJ,EAAE,OAAO,KAAA;AAAA,IAAK;AAEfA,eAAiB,SAAS,QAAQ,EAAE,MAAM,OAAO;AAAA,EAClD;AAEA,SAAO,oBAAC,QAAM,GAAG,OAAO,SAAS,qBAAqB,MAAM,SAAS,OAAO,GAAG;AAChF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEditor.cjs","sources":["../../../../../packages/react-slate-editor-base/src/editor/createEditor.ts"],"sourcesContent":["import { createEditorWithEssentials } from './createEditorWithEssentials'\nimport { Editor } from 'slate'\nimport { EditorPlugin, EditorPluginWrapperProps } from '../types'\nimport { createElement, FunctionComponent, ReactNode } from 'react'\nimport { EntityAccessor } from '@contember/react-binding'\nimport { Environment } from '@contember/react-binding'\n\nexport interface CreateEditorPublicOptions {\n\tplugins?: EditorPlugin[]\n}\n\nexport interface CreateEditorOptions extends CreateEditorPublicOptions {\n\tdefaultElementType: string\n\tentity: EntityAccessor\n\tenvironment: Environment\n\tchildren: ReactNode\n}\n\nexport const createEditor = ({\n\tplugins = [],\n\tdefaultElementType,\n\tentity,\n\tenvironment,\n\tchildren,\n}: CreateEditorOptions): {\n\teditor: Editor\n\tOuterWrapper: FunctionComponent<{ children: ReactNode }>\n\tInnerWrapper: FunctionComponent<{ children: ReactNode }>\n} => {\n\tconst editor = createEditorWithEssentials({ defaultElementType })\n\tconst outerWrappers: FunctionComponent<EditorPluginWrapperProps>[] = []\n\tconst innerWrappers: FunctionComponent<EditorPluginWrapperProps>[] = []\n\tplugins?.forEach(plugin => {\n\t\tif (typeof plugin === 'function') {\n\t\t\tplugin(editor)\n\t\t\treturn\n\t\t}\n\t\tplugin.extendEditor?.({ editor, children, environment, entity })\n\t\tif (plugin?.OuterWrapper) {\n\t\t\touterWrappers.push(plugin.OuterWrapper)\n\t\t}\n\t\tif (plugin?.InnerWrapper) {\n\t\t\tinnerWrappers.push(plugin.InnerWrapper)\n\t\t}\n\t})\n\treturn {\n\t\teditor,\n\t\tOuterWrapper: ({ children }) => outerWrappers.reduceRight((acc, Wrapper) => createElement(Wrapper, { editor }, acc), children),\n\t\tInnerWrapper: ({ children }) => innerWrappers.reduceRight((acc, Wrapper) => createElement(Wrapper, { editor }, acc), children),\n\t}\n}\n"],"names":["createEditorWithEssentials","children","createElement"],"mappings":";;;;AAkBO,MAAM,eAAe,CAAC;AAAA,EAC5B,UAAU,CAAA;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAIK;AACJ,QAAM,SAASA,2BAAAA,2BAA2B,EAAE,oBAAoB;AAChE,QAAM,gBAA+D,CAAA;AACrE,QAAM,gBAA+D,CAAA;AACrE,WAAS,QAAQ,CAAA,WAAU;AAC1B,QAAI,OAAO,WAAW,YAAY;AACjC,aAAO,MAAM;AACb;AAAA,IACD;AACA,WAAO,eAAe,EAAE,QAAQ,UAAU,aAAa,QAAQ;AAC/D,QAAI,QAAQ,cAAc;AACzB,oBAAc,KAAK,OAAO,YAAY;AAAA,IACvC;AACA,QAAI,QAAQ,cAAc;AACzB,oBAAc,KAAK,OAAO,YAAY;AAAA,IACvC;AAAA,EACD,CAAC;AACD,SAAO;AAAA,IACN;AAAA,IACA,cAAc,CAAC,EAAE,UAAAC,UAAAA,MAAe,cAAc,YAAY,CAAC,KAAK,YAAYC,MAAAA,cAAc,SAAS,EAAE,UAAU,GAAG,GAAGD,SAAQ;AAAA,IAC7H,cAAc,CAAC,EAAE,UAAAA,UAAAA,MAAe,cAAc,YAAY,CAAC,KAAK,YAAYC,MAAAA,cAAc,SAAS,EAAE,UAAU,GAAG,GAAGD,SAAQ;AAAA,EAAA;AAE/H;;"}
|
|
1
|
+
{"version":3,"file":"createEditor.cjs","sources":["../../../../../packages/react-slate-editor-base/src/editor/createEditor.ts"],"sourcesContent":["import { createEditorWithEssentials } from './createEditorWithEssentials.js'\nimport { Editor } from 'slate'\nimport { EditorPlugin, EditorPluginWrapperProps } from '../types/index.js'\nimport { createElement, FunctionComponent, ReactNode } from 'react'\nimport { EntityAccessor } from '@contember/react-binding'\nimport { Environment } from '@contember/react-binding'\n\nexport interface CreateEditorPublicOptions {\n\tplugins?: EditorPlugin[]\n}\n\nexport interface CreateEditorOptions extends CreateEditorPublicOptions {\n\tdefaultElementType: string\n\tentity: EntityAccessor\n\tenvironment: Environment\n\tchildren: ReactNode\n}\n\nexport const createEditor = ({\n\tplugins = [],\n\tdefaultElementType,\n\tentity,\n\tenvironment,\n\tchildren,\n}: CreateEditorOptions): {\n\teditor: Editor\n\tOuterWrapper: FunctionComponent<{ children: ReactNode }>\n\tInnerWrapper: FunctionComponent<{ children: ReactNode }>\n} => {\n\tconst editor = createEditorWithEssentials({ defaultElementType })\n\tconst outerWrappers: FunctionComponent<EditorPluginWrapperProps>[] = []\n\tconst innerWrappers: FunctionComponent<EditorPluginWrapperProps>[] = []\n\tplugins?.forEach(plugin => {\n\t\tif (typeof plugin === 'function') {\n\t\t\tplugin(editor)\n\t\t\treturn\n\t\t}\n\t\tplugin.extendEditor?.({ editor, children, environment, entity })\n\t\tif (plugin?.OuterWrapper) {\n\t\t\touterWrappers.push(plugin.OuterWrapper)\n\t\t}\n\t\tif (plugin?.InnerWrapper) {\n\t\t\tinnerWrappers.push(plugin.InnerWrapper)\n\t\t}\n\t})\n\treturn {\n\t\teditor,\n\t\tOuterWrapper: ({ children }) => outerWrappers.reduceRight((acc, Wrapper) => createElement(Wrapper, { editor }, acc), children),\n\t\tInnerWrapper: ({ children }) => innerWrappers.reduceRight((acc, Wrapper) => createElement(Wrapper, { editor }, acc), children),\n\t}\n}\n"],"names":["createEditorWithEssentials","children","createElement"],"mappings":";;;;AAkBO,MAAM,eAAe,CAAC;AAAA,EAC5B,UAAU,CAAA;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAIK;AACJ,QAAM,SAASA,2BAAAA,2BAA2B,EAAE,oBAAoB;AAChE,QAAM,gBAA+D,CAAA;AACrE,QAAM,gBAA+D,CAAA;AACrE,WAAS,QAAQ,CAAA,WAAU;AAC1B,QAAI,OAAO,WAAW,YAAY;AACjC,aAAO,MAAM;AACb;AAAA,IACD;AACA,WAAO,eAAe,EAAE,QAAQ,UAAU,aAAa,QAAQ;AAC/D,QAAI,QAAQ,cAAc;AACzB,oBAAc,KAAK,OAAO,YAAY;AAAA,IACvC;AACA,QAAI,QAAQ,cAAc;AACzB,oBAAc,KAAK,OAAO,YAAY;AAAA,IACvC;AAAA,EACD,CAAC;AACD,SAAO;AAAA,IACN;AAAA,IACA,cAAc,CAAC,EAAE,UAAAC,UAAAA,MAAe,cAAc,YAAY,CAAC,KAAK,YAAYC,MAAAA,cAAc,SAAS,EAAE,UAAU,GAAG,GAAGD,SAAQ;AAAA,IAC7H,cAAc,CAAC,EAAE,UAAAA,UAAAA,MAAe,cAAc,YAAY,CAAC,KAAK,YAAYC,MAAAA,cAAc,SAAS,EAAE,UAAU,GAAG,GAAGD,SAAQ;AAAA,EAAA;AAE/H;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEditor.js","sources":["../../../../../packages/react-slate-editor-base/src/editor/createEditor.ts"],"sourcesContent":["import { createEditorWithEssentials } from './createEditorWithEssentials'\nimport { Editor } from 'slate'\nimport { EditorPlugin, EditorPluginWrapperProps } from '../types'\nimport { createElement, FunctionComponent, ReactNode } from 'react'\nimport { EntityAccessor } from '@contember/react-binding'\nimport { Environment } from '@contember/react-binding'\n\nexport interface CreateEditorPublicOptions {\n\tplugins?: EditorPlugin[]\n}\n\nexport interface CreateEditorOptions extends CreateEditorPublicOptions {\n\tdefaultElementType: string\n\tentity: EntityAccessor\n\tenvironment: Environment\n\tchildren: ReactNode\n}\n\nexport const createEditor = ({\n\tplugins = [],\n\tdefaultElementType,\n\tentity,\n\tenvironment,\n\tchildren,\n}: CreateEditorOptions): {\n\teditor: Editor\n\tOuterWrapper: FunctionComponent<{ children: ReactNode }>\n\tInnerWrapper: FunctionComponent<{ children: ReactNode }>\n} => {\n\tconst editor = createEditorWithEssentials({ defaultElementType })\n\tconst outerWrappers: FunctionComponent<EditorPluginWrapperProps>[] = []\n\tconst innerWrappers: FunctionComponent<EditorPluginWrapperProps>[] = []\n\tplugins?.forEach(plugin => {\n\t\tif (typeof plugin === 'function') {\n\t\t\tplugin(editor)\n\t\t\treturn\n\t\t}\n\t\tplugin.extendEditor?.({ editor, children, environment, entity })\n\t\tif (plugin?.OuterWrapper) {\n\t\t\touterWrappers.push(plugin.OuterWrapper)\n\t\t}\n\t\tif (plugin?.InnerWrapper) {\n\t\t\tinnerWrappers.push(plugin.InnerWrapper)\n\t\t}\n\t})\n\treturn {\n\t\teditor,\n\t\tOuterWrapper: ({ children }) => outerWrappers.reduceRight((acc, Wrapper) => createElement(Wrapper, { editor }, acc), children),\n\t\tInnerWrapper: ({ children }) => innerWrappers.reduceRight((acc, Wrapper) => createElement(Wrapper, { editor }, acc), children),\n\t}\n}\n"],"names":["children"],"mappings":";;AAkBO,MAAM,eAAe,CAAC;AAAA,EAC5B,UAAU,CAAA;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAIK;AACJ,QAAM,SAAS,2BAA2B,EAAE,oBAAoB;AAChE,QAAM,gBAA+D,CAAA;AACrE,QAAM,gBAA+D,CAAA;AACrE,WAAS,QAAQ,CAAA,WAAU;AAC1B,QAAI,OAAO,WAAW,YAAY;AACjC,aAAO,MAAM;AACb;AAAA,IACD;AACA,WAAO,eAAe,EAAE,QAAQ,UAAU,aAAa,QAAQ;AAC/D,QAAI,QAAQ,cAAc;AACzB,oBAAc,KAAK,OAAO,YAAY;AAAA,IACvC;AACA,QAAI,QAAQ,cAAc;AACzB,oBAAc,KAAK,OAAO,YAAY;AAAA,IACvC;AAAA,EACD,CAAC;AACD,SAAO;AAAA,IACN;AAAA,IACA,cAAc,CAAC,EAAE,UAAAA,UAAAA,MAAe,cAAc,YAAY,CAAC,KAAK,YAAY,cAAc,SAAS,EAAE,UAAU,GAAG,GAAGA,SAAQ;AAAA,IAC7H,cAAc,CAAC,EAAE,UAAAA,UAAAA,MAAe,cAAc,YAAY,CAAC,KAAK,YAAY,cAAc,SAAS,EAAE,UAAU,GAAG,GAAGA,SAAQ;AAAA,EAAA;AAE/H;"}
|
|
1
|
+
{"version":3,"file":"createEditor.js","sources":["../../../../../packages/react-slate-editor-base/src/editor/createEditor.ts"],"sourcesContent":["import { createEditorWithEssentials } from './createEditorWithEssentials.js'\nimport { Editor } from 'slate'\nimport { EditorPlugin, EditorPluginWrapperProps } from '../types/index.js'\nimport { createElement, FunctionComponent, ReactNode } from 'react'\nimport { EntityAccessor } from '@contember/react-binding'\nimport { Environment } from '@contember/react-binding'\n\nexport interface CreateEditorPublicOptions {\n\tplugins?: EditorPlugin[]\n}\n\nexport interface CreateEditorOptions extends CreateEditorPublicOptions {\n\tdefaultElementType: string\n\tentity: EntityAccessor\n\tenvironment: Environment\n\tchildren: ReactNode\n}\n\nexport const createEditor = ({\n\tplugins = [],\n\tdefaultElementType,\n\tentity,\n\tenvironment,\n\tchildren,\n}: CreateEditorOptions): {\n\teditor: Editor\n\tOuterWrapper: FunctionComponent<{ children: ReactNode }>\n\tInnerWrapper: FunctionComponent<{ children: ReactNode }>\n} => {\n\tconst editor = createEditorWithEssentials({ defaultElementType })\n\tconst outerWrappers: FunctionComponent<EditorPluginWrapperProps>[] = []\n\tconst innerWrappers: FunctionComponent<EditorPluginWrapperProps>[] = []\n\tplugins?.forEach(plugin => {\n\t\tif (typeof plugin === 'function') {\n\t\t\tplugin(editor)\n\t\t\treturn\n\t\t}\n\t\tplugin.extendEditor?.({ editor, children, environment, entity })\n\t\tif (plugin?.OuterWrapper) {\n\t\t\touterWrappers.push(plugin.OuterWrapper)\n\t\t}\n\t\tif (plugin?.InnerWrapper) {\n\t\t\tinnerWrappers.push(plugin.InnerWrapper)\n\t\t}\n\t})\n\treturn {\n\t\teditor,\n\t\tOuterWrapper: ({ children }) => outerWrappers.reduceRight((acc, Wrapper) => createElement(Wrapper, { editor }, acc), children),\n\t\tInnerWrapper: ({ children }) => innerWrappers.reduceRight((acc, Wrapper) => createElement(Wrapper, { editor }, acc), children),\n\t}\n}\n"],"names":["children"],"mappings":";;AAkBO,MAAM,eAAe,CAAC;AAAA,EAC5B,UAAU,CAAA;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAIK;AACJ,QAAM,SAAS,2BAA2B,EAAE,oBAAoB;AAChE,QAAM,gBAA+D,CAAA;AACrE,QAAM,gBAA+D,CAAA;AACrE,WAAS,QAAQ,CAAA,WAAU;AAC1B,QAAI,OAAO,WAAW,YAAY;AACjC,aAAO,MAAM;AACb;AAAA,IACD;AACA,WAAO,eAAe,EAAE,QAAQ,UAAU,aAAa,QAAQ;AAC/D,QAAI,QAAQ,cAAc;AACzB,oBAAc,KAAK,OAAO,YAAY;AAAA,IACvC;AACA,QAAI,QAAQ,cAAc;AACzB,oBAAc,KAAK,OAAO,YAAY;AAAA,IACvC;AAAA,EACD,CAAC;AACD,SAAO;AAAA,IACN;AAAA,IACA,cAAc,CAAC,EAAE,UAAAA,UAAAA,MAAe,cAAc,YAAY,CAAC,KAAK,YAAY,cAAc,SAAS,EAAE,UAAU,GAAG,GAAGA,SAAQ;AAAA,IAC7H,cAAc,CAAC,EAAE,UAAAA,UAAAA,MAAe,cAAc,YAAY,CAAC,KAAK,YAAY,cAAc,SAAS,EAAE,UAAU,GAAG,GAAGA,SAAQ;AAAA,EAAA;AAE/H;"}
|
|
@@ -1 +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 {\n\tcreateEditor,\n\tDescendant,\n\tEditor,\n\tElement as SlateElement,\n\tNode as SlateNode,\n\tPath,\n\tRange as SlateRange,\n\tText as SlateText,\n\tTransforms,\n} 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\t?? Array.from(Editor.nodes(editor, {\n\t\t\t\t\t\t\tmatch: node => SlateElement.isElement(node) && ContemberEditor.isElementType(node, elementType, suchThat),\n\t\t\t\t\t\t\tvoids: false,\n\t\t\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) => ContemberEditor.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\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 = e.key === 'Backspace'\n\t\t\t\t\t\t? Editor.point(editor, Path.next(nodePath), {\n\t\t\t\t\t\t\tedge: 'start',\n\t\t\t\t\t\t})\n\t\t\t\t\t\t: Editor.point(editor, Path.previous(nodePath), {\n\t\t\t\t\t\t\tedge: 'end',\n\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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,6BAA6B,CAAC,EAAE,yBAAiE;AAC7G,QAAM,mBAAmBA,aAAAA,YAAYC,qBAAUC,MAAAA,aAAA,CAA6B,CAAC;AAE7E,QAAM,SAAS;AACf,QAAM,EAAE,eAAe,UAAU,QAAQ,mBAAmB;AAE5D,QAAM,+BAAe,IAAA;AACrB,QAAM,4BAAY,IAAA;AAElB,SAAO,OAAgC,QAAQ;AAAA,IAC9C,OAAOC;AAAAA,IACP,eAAe;AAAA,IACf;AAAA,IACA,kBAAkB,CAAA,YAAW,UAAU,WAAY,QAAgB,SAAS;AAAA,IAC5E,sBAAsB,CAAA,cAAa;AAAA,MAClC,MAAM;AAAA,MACN;AAAA,IAAA;AAAA,IAED,qBAAqB,CAAC,CAAC,SAAS,IAAI,GAAG,SAAS;AAC/C,YAAM,aAAa,SAAS,WAAW,IAAI;AAC3C,YAAM,aAAa,KAAK,MAAM,GAAG,EAAE,EAAE,OAAO,KAAK,KAAK,SAAS,CAAC,IAAI,UAAU;AAC9EC,uBAAW,YAAY,QAAQ,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAA,CAAI,CAAC,GAAG;AAAA,QAC3E,IAAI;AAAA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,OAAO,OAAO,YAAY,GAAG;AACxE,qBAAO,MAAM;AAAA,gBACZ,MAAM;AAAA,gBACN,MAAM;AAAA,gBACN;AAAA,cAAA,CACA;AACD;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,MACD;AACA,qBAAe,IAAI;AAAA,IACpB;AAAA,EAAA,CACA;AAEDO,YAAAA,UAAU,MAAM;AAEhB,SAAO;AACR;;"}
|
|
1
|
+
{"version":3,"file":"createEditorWithEssentials.cjs","sources":["../../../../../packages/react-slate-editor-base/src/editor/createEditorWithEssentials.tsx"],"sourcesContent":["import { createElement, isValidElement, ReactElement } from 'react'\nimport {\n\tcreateEditor,\n\tDescendant,\n\tEditor,\n\tElement as SlateElement,\n\tNode as SlateNode,\n\tPath,\n\tRange as SlateRange,\n\tText as SlateText,\n\tTransforms,\n} from 'slate'\nimport * as Slate from 'slate'\nimport { withHistory } from 'slate-history'\nimport { ReactEditor, withReact } from 'slate-react'\nimport { EditorElementPlugin, EditorMarkPlugin } from '../types/plugins.js'\nimport { TextSpecifics } from '../types/editor.js'\nimport { DefaultElement } from '../internal/components/DefaultElement.js'\nimport { withPaste } from '../plugins/behaviour/index.js'\nimport { ContemberEditor } from './index.js'\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\t?? Array.from(Editor.nodes(editor, {\n\t\t\t\t\t\t\tmatch: node => SlateElement.isElement(node) && ContemberEditor.isElementType(node, elementType, suchThat),\n\t\t\t\t\t\t\tvoids: false,\n\t\t\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) => ContemberEditor.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\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 = e.key === 'Backspace'\n\t\t\t\t\t\t? Editor.point(editor, Path.next(nodePath), {\n\t\t\t\t\t\t\tedge: 'start',\n\t\t\t\t\t\t})\n\t\t\t\t\t\t: Editor.point(editor, Path.previous(nodePath), {\n\t\t\t\t\t\t\tedge: 'end',\n\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":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqBO,MAAM,6BAA6B,CAAC,EAAE,yBAAiE;AAC7G,QAAM,mBAAmBA,aAAAA,YAAYC,qBAAUC,MAAAA,aAAA,CAA6B,CAAC;AAE7E,QAAM,SAAS;AACf,QAAM,EAAE,eAAe,UAAU,QAAQ,mBAAmB;AAE5D,QAAM,+BAAe,IAAA;AACrB,QAAM,4BAAY,IAAA;AAElB,SAAO,OAAgC,QAAQ;AAAA,IAC9C,OAAOC;AAAAA,IACP,eAAe;AAAA,IACf;AAAA,IACA,kBAAkB,CAAA,YAAW,UAAU,WAAY,QAAgB,SAAS;AAAA,IAC5E,sBAAsB,CAAA,cAAa;AAAA,MAClC,MAAM;AAAA,MACN;AAAA,IAAA;AAAA,IAED,qBAAqB,CAAC,CAAC,SAAS,IAAI,GAAG,SAAS;AAC/C,YAAM,aAAa,SAAS,WAAW,IAAI;AAC3C,YAAM,aAAa,KAAK,MAAM,GAAG,EAAE,EAAE,OAAO,KAAK,KAAK,SAAS,CAAC,IAAI,UAAU;AAC9EC,uBAAW,YAAY,QAAQ,OAAO,qBAAqB,CAAC,EAAE,MAAM,GAAA,CAAI,CAAC,GAAG;AAAA,QAC3E,IAAI;AAAA,QACJ,QAAQ;AAAA,MAAA,CACR;AAAA,IACF;AAAA,IAEA,gBAAgB,MAAM;AAAA,IACtB,kBAAkB,MAA8B;AAAA,IAEhD,UAAU,CAAsBC,WAA4BC,MAAAA,gBAAgB,SAAS,QAAQD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