@ecomcx/ecomweb-editor 1.17.1 → 1.18.0
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/node_modules/@tiptap/core/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/core/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/core/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/core/dist/index.js.map +1 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs.map +1 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.cts.map +1 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.ts.map +1 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js.map +1 -0
- package/node_modules/@tiptap/core/src/CommandManager.test.ts +220 -0
- package/node_modules/@tiptap/core/src/CommandManager.ts +208 -0
- package/node_modules/@tiptap/core/src/Editor.test.ts +756 -0
- package/node_modules/@tiptap/core/src/Editor.ts +908 -0
- package/node_modules/@tiptap/core/src/EventEmitter.ts +71 -0
- package/node_modules/@tiptap/core/src/Extendable.test.ts +764 -0
- package/node_modules/@tiptap/core/src/Extendable.ts +668 -0
- package/node_modules/@tiptap/core/src/Extension.ts +59 -0
- package/node_modules/@tiptap/core/src/ExtensionManager.test.ts +852 -0
- package/node_modules/@tiptap/core/src/ExtensionManager.ts +589 -0
- package/node_modules/@tiptap/core/src/InputRule.test.ts +113 -0
- package/node_modules/@tiptap/core/src/InputRule.ts +373 -0
- package/node_modules/@tiptap/core/src/Mark.ts +231 -0
- package/node_modules/@tiptap/core/src/MarkView.test.ts +53 -0
- package/node_modules/@tiptap/core/src/MarkView.ts +132 -0
- package/node_modules/@tiptap/core/src/Node.ts +390 -0
- package/node_modules/@tiptap/core/src/NodePos.test.ts +722 -0
- package/node_modules/@tiptap/core/src/NodePos.ts +270 -0
- package/node_modules/@tiptap/core/src/NodeView.test.ts +157 -0
- package/node_modules/@tiptap/core/src/NodeView.ts +367 -0
- package/node_modules/@tiptap/core/src/PasteRule.ts +396 -0
- package/node_modules/@tiptap/core/src/Tracker.ts +38 -0
- package/node_modules/@tiptap/core/src/commands/blur.ts +29 -0
- package/node_modules/@tiptap/core/src/commands/canJoinItemsAt.ts +13 -0
- package/node_modules/@tiptap/core/src/commands/clearContent.ts +25 -0
- package/node_modules/@tiptap/core/src/commands/clearNodes.ts +57 -0
- package/node_modules/@tiptap/core/src/commands/command.ts +22 -0
- package/node_modules/@tiptap/core/src/commands/createParagraphNear.ts +21 -0
- package/node_modules/@tiptap/core/src/commands/cut.test.ts +38 -0
- package/node_modules/@tiptap/core/src/commands/cut.ts +36 -0
- package/node_modules/@tiptap/core/src/commands/deleteCurrentNode.ts +44 -0
- package/node_modules/@tiptap/core/src/commands/deleteNode.ts +41 -0
- package/node_modules/@tiptap/core/src/commands/deleteRange.ts +26 -0
- package/node_modules/@tiptap/core/src/commands/deleteSelection.test.ts +125 -0
- package/node_modules/@tiptap/core/src/commands/deleteSelection.ts +109 -0
- package/node_modules/@tiptap/core/src/commands/enter.ts +19 -0
- package/node_modules/@tiptap/core/src/commands/exitCode.ts +21 -0
- package/node_modules/@tiptap/core/src/commands/extendMarkRange.test.ts +455 -0
- package/node_modules/@tiptap/core/src/commands/extendMarkRange.ts +52 -0
- package/node_modules/@tiptap/core/src/commands/first.ts +26 -0
- package/node_modules/@tiptap/core/src/commands/focus.ts +108 -0
- package/node_modules/@tiptap/core/src/commands/forEach.ts +24 -0
- package/node_modules/@tiptap/core/src/commands/index.ts +59 -0
- package/node_modules/@tiptap/core/src/commands/insertContent.test.ts +197 -0
- package/node_modules/@tiptap/core/src/commands/insertContent.ts +50 -0
- package/node_modules/@tiptap/core/src/commands/insertContentAt.test.ts +133 -0
- package/node_modules/@tiptap/core/src/commands/insertContentAt.ts +208 -0
- package/node_modules/@tiptap/core/src/commands/insertDefaultBlock.test.ts +178 -0
- package/node_modules/@tiptap/core/src/commands/insertDefaultBlock.ts +97 -0
- package/node_modules/@tiptap/core/src/commands/join.ts +69 -0
- package/node_modules/@tiptap/core/src/commands/joinItemBackward.ts +42 -0
- package/node_modules/@tiptap/core/src/commands/joinItemForward.test.ts +138 -0
- package/node_modules/@tiptap/core/src/commands/joinItemForward.ts +42 -0
- package/node_modules/@tiptap/core/src/commands/joinTextblockBackward.ts +20 -0
- package/node_modules/@tiptap/core/src/commands/joinTextblockForward.ts +20 -0
- package/node_modules/@tiptap/core/src/commands/keyboardShortcut.ts +100 -0
- package/node_modules/@tiptap/core/src/commands/lift.ts +34 -0
- package/node_modules/@tiptap/core/src/commands/liftEmptyBlock.ts +21 -0
- package/node_modules/@tiptap/core/src/commands/liftListItem.ts +26 -0
- package/node_modules/@tiptap/core/src/commands/newlineInCode.ts +21 -0
- package/node_modules/@tiptap/core/src/commands/resetAttributes.ts +80 -0
- package/node_modules/@tiptap/core/src/commands/scrollIntoView.ts +23 -0
- package/node_modules/@tiptap/core/src/commands/selectAll.ts +27 -0
- package/node_modules/@tiptap/core/src/commands/selectNodeBackward.ts +21 -0
- package/node_modules/@tiptap/core/src/commands/selectNodeForward.ts +21 -0
- package/node_modules/@tiptap/core/src/commands/selectParentNode.ts +21 -0
- package/node_modules/@tiptap/core/src/commands/selectTextblockEnd.ts +23 -0
- package/node_modules/@tiptap/core/src/commands/selectTextblockStart.ts +23 -0
- package/node_modules/@tiptap/core/src/commands/setContent.test.ts +177 -0
- package/node_modules/@tiptap/core/src/commands/setContent.ts +79 -0
- package/node_modules/@tiptap/core/src/commands/setMark.ts +122 -0
- package/node_modules/@tiptap/core/src/commands/setMeta.ts +25 -0
- package/node_modules/@tiptap/core/src/commands/setNode.ts +57 -0
- package/node_modules/@tiptap/core/src/commands/setNodeSelection.ts +31 -0
- package/node_modules/@tiptap/core/src/commands/setTextDirection.ts +51 -0
- package/node_modules/@tiptap/core/src/commands/setTextSelection.ts +36 -0
- package/node_modules/@tiptap/core/src/commands/sinkListItem.ts +26 -0
- package/node_modules/@tiptap/core/src/commands/splitBlock.test.ts +107 -0
- package/node_modules/@tiptap/core/src/commands/splitBlock.ts +136 -0
- package/node_modules/@tiptap/core/src/commands/splitListItem.ts +166 -0
- package/node_modules/@tiptap/core/src/commands/toggleList.ts +308 -0
- package/node_modules/@tiptap/core/src/commands/toggleMark.ts +51 -0
- package/node_modules/@tiptap/core/src/commands/toggleNode.ts +47 -0
- package/node_modules/@tiptap/core/src/commands/toggleWrap.ts +32 -0
- package/node_modules/@tiptap/core/src/commands/undoInputRule.ts +49 -0
- package/node_modules/@tiptap/core/src/commands/unsetAllMarks.test.ts +109 -0
- package/node_modules/@tiptap/core/src/commands/unsetAllMarks.ts +44 -0
- package/node_modules/@tiptap/core/src/commands/unsetMark.ts +65 -0
- package/node_modules/@tiptap/core/src/commands/unsetTextDirection.ts +51 -0
- package/node_modules/@tiptap/core/src/commands/updateAttributes.ts +150 -0
- package/node_modules/@tiptap/core/src/commands/updateDecorations.ts +28 -0
- package/node_modules/@tiptap/core/src/commands/utils/appendContentNode.ts +25 -0
- package/node_modules/@tiptap/core/src/commands/utils/appendNestedList.test.ts +35 -0
- package/node_modules/@tiptap/core/src/commands/utils/appendNestedList.ts +43 -0
- package/node_modules/@tiptap/core/src/commands/utils/convertListItem.ts +32 -0
- package/node_modules/@tiptap/core/src/commands/utils/convertListItems.ts +24 -0
- package/node_modules/@tiptap/core/src/commands/utils/createNode.ts +18 -0
- package/node_modules/@tiptap/core/src/commands/utils/findNodePosition.ts +18 -0
- package/node_modules/@tiptap/core/src/commands/utils/flushPendingContent.ts +23 -0
- package/node_modules/@tiptap/core/src/commands/utils/listConversionTypes.ts +17 -0
- package/node_modules/@tiptap/core/src/commands/wrapIn.ts +27 -0
- package/node_modules/@tiptap/core/src/commands/wrapInList.ts +27 -0
- package/node_modules/@tiptap/core/src/decorations/Decoration.test.ts +40 -0
- package/node_modules/@tiptap/core/src/decorations/Decoration.ts +177 -0
- package/node_modules/@tiptap/core/src/decorations/DecorationManager.test.ts +821 -0
- package/node_modules/@tiptap/core/src/decorations/DecorationManager.ts +440 -0
- package/node_modules/@tiptap/core/src/decorations/constants.ts +7 -0
- package/node_modules/@tiptap/core/src/decorations/createWidgetDecoration.test.ts +224 -0
- package/node_modules/@tiptap/core/src/decorations/createWidgetDecoration.ts +221 -0
- package/node_modules/@tiptap/core/src/decorations/decorationApplyScope.test.ts +50 -0
- package/node_modules/@tiptap/core/src/decorations/decorationApplyScope.ts +45 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/buildDecorationSet.ts +25 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/decorationsToPMDecorations.ts +36 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/filterOutOfRangeDecorations.ts +52 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/findDuplicateWidgetKeys.ts +37 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/getRebuildRanges.test.ts +147 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/getRebuildRanges.ts +96 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/hasResolvableChangedRange.ts +24 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/isAttrStep.ts +21 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mapDecorationSet.ts +31 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mapDecorations.ts +26 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/mergeDecorationSets.ts +16 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/rangeOwnsPosition.ts +38 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/shouldRecomputeDecoration.ts +24 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/unionWidgetKeys.ts +15 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/validateDecorationSpec.ts +49 -0
- package/node_modules/@tiptap/core/src/decorations/helpers/widgetKeyOf.ts +11 -0
- package/node_modules/@tiptap/core/src/decorations/index.ts +28 -0
- package/node_modules/@tiptap/core/src/decorations/types.ts +87 -0
- package/node_modules/@tiptap/core/src/extensions/clipboardTextSerializer.test.ts +68 -0
- package/node_modules/@tiptap/core/src/extensions/clipboardTextSerializer.ts +53 -0
- package/node_modules/@tiptap/core/src/extensions/commands.ts +14 -0
- package/node_modules/@tiptap/core/src/extensions/delete.test.ts +49 -0
- package/node_modules/@tiptap/core/src/extensions/delete.ts +101 -0
- package/node_modules/@tiptap/core/src/extensions/drop.ts +26 -0
- package/node_modules/@tiptap/core/src/extensions/editable.ts +18 -0
- package/node_modules/@tiptap/core/src/extensions/focusEvents.ts +45 -0
- package/node_modules/@tiptap/core/src/extensions/index.ts +10 -0
- package/node_modules/@tiptap/core/src/extensions/keymap.ts +165 -0
- package/node_modules/@tiptap/core/src/extensions/paste.ts +25 -0
- package/node_modules/@tiptap/core/src/extensions/tabindex.test.ts +75 -0
- package/node_modules/@tiptap/core/src/extensions/tabindex.ts +58 -0
- package/node_modules/@tiptap/core/src/extensions/textDirection.ts +88 -0
- package/node_modules/@tiptap/core/src/helpers/MappablePosition.ts +69 -0
- package/node_modules/@tiptap/core/src/helpers/combineTransactionSteps.ts +24 -0
- package/node_modules/@tiptap/core/src/helpers/createChainableState.ts +42 -0
- package/node_modules/@tiptap/core/src/helpers/createDocument.ts +24 -0
- package/node_modules/@tiptap/core/src/helpers/createNodeFromContent.test.ts +332 -0
- package/node_modules/@tiptap/core/src/helpers/createNodeFromContent.ts +128 -0
- package/node_modules/@tiptap/core/src/helpers/defaultBlockAt.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/findChildren.ts +24 -0
- package/node_modules/@tiptap/core/src/helpers/findChildrenInRange.ts +40 -0
- package/node_modules/@tiptap/core/src/helpers/findParentNode.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/findParentNodeClosestToPos.ts +37 -0
- package/node_modules/@tiptap/core/src/helpers/flattenExtensions.ts +34 -0
- package/node_modules/@tiptap/core/src/helpers/generateHTML.test.ts +29 -0
- package/node_modules/@tiptap/core/src/helpers/generateHTML.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/generateJSON.test.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/generateJSON.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/generateText.test.ts +71 -0
- package/node_modules/@tiptap/core/src/helpers/generateText.ts +34 -0
- package/node_modules/@tiptap/core/src/helpers/getAttributes.ts +32 -0
- package/node_modules/@tiptap/core/src/helpers/getAttributesFromExtensions.test.ts +473 -0
- package/node_modules/@tiptap/core/src/helpers/getAttributesFromExtensions.ts +120 -0
- package/node_modules/@tiptap/core/src/helpers/getChangedRanges.test.ts +48 -0
- package/node_modules/@tiptap/core/src/helpers/getChangedRanges.ts +85 -0
- package/node_modules/@tiptap/core/src/helpers/getDebugJSON.ts +54 -0
- package/node_modules/@tiptap/core/src/helpers/getExtensionField.ts +32 -0
- package/node_modules/@tiptap/core/src/helpers/getHTMLFromFragment.ts +13 -0
- package/node_modules/@tiptap/core/src/helpers/getMarkAttributes.ts +33 -0
- package/node_modules/@tiptap/core/src/helpers/getMarkRange.test.ts +237 -0
- package/node_modules/@tiptap/core/src/helpers/getMarkRange.ts +105 -0
- package/node_modules/@tiptap/core/src/helpers/getMarkType.ts +15 -0
- package/node_modules/@tiptap/core/src/helpers/getMarksBetween.ts +44 -0
- package/node_modules/@tiptap/core/src/helpers/getNodeAtPosition.ts +34 -0
- package/node_modules/@tiptap/core/src/helpers/getNodeAttributes.ts +25 -0
- package/node_modules/@tiptap/core/src/helpers/getNodeType.ts +15 -0
- package/node_modules/@tiptap/core/src/helpers/getPreviousBlockSibling.test.ts +111 -0
- package/node_modules/@tiptap/core/src/helpers/getPreviousBlockSibling.ts +36 -0
- package/node_modules/@tiptap/core/src/helpers/getRenderedAttributes.ts +23 -0
- package/node_modules/@tiptap/core/src/helpers/getSchema.ts +12 -0
- package/node_modules/@tiptap/core/src/helpers/getSchemaByResolvedExtensions.test.ts +171 -0
- package/node_modules/@tiptap/core/src/helpers/getSchemaByResolvedExtensions.ts +41 -0
- package/node_modules/@tiptap/core/src/helpers/getSchemaSpecByResolvedExtensions.test.ts +101 -0
- package/node_modules/@tiptap/core/src/helpers/getSchemaSpecByResolvedExtensions.ts +240 -0
- package/node_modules/@tiptap/core/src/helpers/getSchemaTypeByName.ts +11 -0
- package/node_modules/@tiptap/core/src/helpers/getSchemaTypeNameByName.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/getSplittedAttributes.ts +28 -0
- package/node_modules/@tiptap/core/src/helpers/getText.ts +28 -0
- package/node_modules/@tiptap/core/src/helpers/getTextBetween.ts +52 -0
- package/node_modules/@tiptap/core/src/helpers/getTextContentFromNodes.test.ts +40 -0
- package/node_modules/@tiptap/core/src/helpers/getTextContentFromNodes.ts +34 -0
- package/node_modules/@tiptap/core/src/helpers/getTextSerializersFromSchema.ts +16 -0
- package/node_modules/@tiptap/core/src/helpers/index.ts +71 -0
- package/node_modules/@tiptap/core/src/helpers/injectExtensionAttributesToParseRule.ts +47 -0
- package/node_modules/@tiptap/core/src/helpers/isActive.test.ts +106 -0
- package/node_modules/@tiptap/core/src/helpers/isActive.ts +27 -0
- package/node_modules/@tiptap/core/src/helpers/isAtEndOfNode.ts +29 -0
- package/node_modules/@tiptap/core/src/helpers/isAtStartOfNode.ts +11 -0
- package/node_modules/@tiptap/core/src/helpers/isExtensionRulesEnabled.ts +13 -0
- package/node_modules/@tiptap/core/src/helpers/isFragment.ts +14 -0
- package/node_modules/@tiptap/core/src/helpers/isList.ts +27 -0
- package/node_modules/@tiptap/core/src/helpers/isMarkActive.ts +94 -0
- package/node_modules/@tiptap/core/src/helpers/isNodeActive.ts +51 -0
- package/node_modules/@tiptap/core/src/helpers/isNodeEmpty.test.ts +250 -0
- package/node_modules/@tiptap/core/src/helpers/isNodeEmpty.ts +62 -0
- package/node_modules/@tiptap/core/src/helpers/isNodeSelection.ts +5 -0
- package/node_modules/@tiptap/core/src/helpers/isNodeViewSelected.test.ts +218 -0
- package/node_modules/@tiptap/core/src/helpers/isNodeViewSelected.ts +42 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddNodeMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAddNodeMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAttrStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorAttrStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorCellSelection.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorCellSelection.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorContent.ts +14 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorDocAttrStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorDocAttrStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorFragment.test.ts +27 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorFragment.ts +34 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorNodeSelection.test.ts +35 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorNodeSelection.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveNodeMarkStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorRemoveNodeMarkStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceAroundStep.test.ts +19 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceAroundStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceStep.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorReplaceStep.ts +31 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorSlice.test.ts +16 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorSlice.ts +43 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorStep.test.ts +30 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorStep.ts +30 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorStepResult.test.ts +17 -0
- package/node_modules/@tiptap/core/src/helpers/isProseMirrorStepResult.ts +26 -0
- package/node_modules/@tiptap/core/src/helpers/isTextSelection.ts +5 -0
- package/node_modules/@tiptap/core/src/helpers/posToDOMRect.ts +35 -0
- package/node_modules/@tiptap/core/src/helpers/resolveExtensions.ts +25 -0
- package/node_modules/@tiptap/core/src/helpers/resolveFocusPosition.ts +42 -0
- package/node_modules/@tiptap/core/src/helpers/rewriteUnknownContent.test.ts +51 -0
- package/node_modules/@tiptap/core/src/helpers/rewriteUnknownContent.ts +158 -0
- package/node_modules/@tiptap/core/src/helpers/selectionToInsertionEnd.ts +29 -0
- package/node_modules/@tiptap/core/src/helpers/sortExtensions.ts +26 -0
- package/node_modules/@tiptap/core/src/helpers/splitExtensions.ts +18 -0
- package/node_modules/@tiptap/core/src/helpers/warnOnDuplicatedProseMirrorModel.test.ts +23 -0
- package/node_modules/@tiptap/core/src/helpers/warnOnDuplicatedProseMirrorModel.ts +47 -0
- package/node_modules/@tiptap/core/src/index.ts +23 -0
- package/node_modules/@tiptap/core/src/inputRules/index.ts +5 -0
- package/node_modules/@tiptap/core/src/inputRules/markInputRule.ts +72 -0
- package/node_modules/@tiptap/core/src/inputRules/nodeInputRule.ts +80 -0
- package/node_modules/@tiptap/core/src/inputRules/textInputRule.ts +39 -0
- package/node_modules/@tiptap/core/src/inputRules/textblockTypeInputRule.ts +41 -0
- package/node_modules/@tiptap/core/src/inputRules/wrappingInputRule.ts +88 -0
- package/node_modules/@tiptap/core/src/jsx-runtime.test.ts +349 -0
- package/node_modules/@tiptap/core/src/jsx-runtime.ts +145 -0
- package/node_modules/@tiptap/core/src/lib/ResizableNodeView.test.ts +121 -0
- package/node_modules/@tiptap/core/src/lib/ResizableNodeView.ts +1079 -0
- package/node_modules/@tiptap/core/src/lib/index.ts +1 -0
- package/node_modules/@tiptap/core/src/pasteRules/index.ts +3 -0
- package/node_modules/@tiptap/core/src/pasteRules/markPasteRule.test.ts +91 -0
- package/node_modules/@tiptap/core/src/pasteRules/markPasteRule.ts +82 -0
- package/node_modules/@tiptap/core/src/pasteRules/nodePasteRule.ts +44 -0
- package/node_modules/@tiptap/core/src/pasteRules/textPasteRule.ts +34 -0
- package/node_modules/@tiptap/core/src/schema/getSchemaAttributes.ts +45 -0
- package/node_modules/@tiptap/core/src/schema/mergeSchemaSpec.ts +83 -0
- package/node_modules/@tiptap/core/src/schema/schemaSpecFields.ts +24 -0
- package/node_modules/@tiptap/core/src/style.ts +71 -0
- package/node_modules/@tiptap/core/src/types.ts +1114 -0
- package/node_modules/@tiptap/core/src/utilities/attrsEqual.test.ts +54 -0
- package/node_modules/@tiptap/core/src/utilities/attrsEqual.ts +27 -0
- package/node_modules/@tiptap/core/src/utilities/callOrReturn.ts +25 -0
- package/node_modules/@tiptap/core/src/utilities/canInsertNode.ts +30 -0
- package/node_modules/@tiptap/core/src/utilities/createStyleTag.ts +21 -0
- package/node_modules/@tiptap/core/src/utilities/deleteProps.ts +19 -0
- package/node_modules/@tiptap/core/src/utilities/elementFromString.ts +29 -0
- package/node_modules/@tiptap/core/src/utilities/escapeForRegEx.ts +4 -0
- package/node_modules/@tiptap/core/src/utilities/findDuplicates.ts +8 -0
- package/node_modules/@tiptap/core/src/utilities/fromString.test.ts +53 -0
- package/node_modules/@tiptap/core/src/utilities/fromString.ts +19 -0
- package/node_modules/@tiptap/core/src/utilities/getStyleProperty.test.ts +53 -0
- package/node_modules/@tiptap/core/src/utilities/getStyleProperty.ts +52 -0
- package/node_modules/@tiptap/core/src/utilities/htmlEntities.test.ts +159 -0
- package/node_modules/@tiptap/core/src/utilities/htmlEntities.ts +74 -0
- package/node_modules/@tiptap/core/src/utilities/index.ts +31 -0
- package/node_modules/@tiptap/core/src/utilities/isAndroid.test.ts +28 -0
- package/node_modules/@tiptap/core/src/utilities/isAndroid.ts +3 -0
- package/node_modules/@tiptap/core/src/utilities/isDev.ts +12 -0
- package/node_modules/@tiptap/core/src/utilities/isEmptyObject.ts +3 -0
- package/node_modules/@tiptap/core/src/utilities/isFirefox.ts +11 -0
- package/node_modules/@tiptap/core/src/utilities/isFunction.ts +4 -0
- package/node_modules/@tiptap/core/src/utilities/isMacOS.ts +3 -0
- package/node_modules/@tiptap/core/src/utilities/isNumber.ts +3 -0
- package/node_modules/@tiptap/core/src/utilities/isPlainObject.ts +13 -0
- package/node_modules/@tiptap/core/src/utilities/isRegExp.ts +3 -0
- package/node_modules/@tiptap/core/src/utilities/isSafari.ts +13 -0
- package/node_modules/@tiptap/core/src/utilities/isString.ts +3 -0
- package/node_modules/@tiptap/core/src/utilities/isValidCSSStyleValue.test.ts +22 -0
- package/node_modules/@tiptap/core/src/utilities/isValidCSSStyleValue.ts +8 -0
- package/node_modules/@tiptap/core/src/utilities/isiOS.ts +9 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/createAtomBlockMarkdownSpec.ts +138 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/createBlockMarkdownSpec.ts +229 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/createInlineMarkdownSpec.ts +262 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/index.ts +14 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/parseAttributes.test.ts +70 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/parseAttributes.ts +48 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/parseIndentedBlocks.ts +194 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/parseShortcodeAttributes.ts +13 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/renderNestedMarkdownContent.test.ts +51 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/renderNestedMarkdownContent.ts +136 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/serializeAttributes.ts +42 -0
- package/node_modules/@tiptap/core/src/utilities/markdown/tokenizeAttributes.ts +163 -0
- package/node_modules/@tiptap/core/src/utilities/marksEqual.test.ts +101 -0
- package/node_modules/@tiptap/core/src/utilities/marksEqual.ts +44 -0
- package/node_modules/@tiptap/core/src/utilities/mergeAttributes.test.ts +194 -0
- package/node_modules/@tiptap/core/src/utilities/mergeAttributes.ts +128 -0
- package/node_modules/@tiptap/core/src/utilities/mergeDeep.test.ts +98 -0
- package/node_modules/@tiptap/core/src/utilities/mergeDeep.ts +20 -0
- package/node_modules/@tiptap/core/src/utilities/minMax.ts +3 -0
- package/node_modules/@tiptap/core/src/utilities/objectIncludes.ts +30 -0
- package/node_modules/@tiptap/core/src/utilities/removeDuplicates.ts +13 -0
- package/node_modules/@tiptap/extension-blockquote/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-blockquote/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-blockquote/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-blockquote/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-blockquote/src/blockquote.tsx +143 -0
- package/node_modules/@tiptap/extension-blockquote/src/handleBackspace.test.ts +45 -0
- package/node_modules/@tiptap/extension-blockquote/src/handleBackspace.ts +75 -0
- package/node_modules/@tiptap/extension-blockquote/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-bold/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-bold/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-bold/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-bold/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-bold/src/bold.test.ts +25 -0
- package/node_modules/@tiptap/extension-bold/src/bold.tsx +163 -0
- package/node_modules/@tiptap/extension-bold/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-bubble-menu/src/bubble-menu-plugin.test.ts +289 -0
- package/node_modules/@tiptap/extension-bubble-menu/src/bubble-menu-plugin.ts +710 -0
- package/node_modules/@tiptap/extension-bubble-menu/src/bubble-menu.ts +50 -0
- package/node_modules/@tiptap/extension-bubble-menu/src/index.ts +6 -0
- package/node_modules/@tiptap/extension-bullet-list/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-bullet-list/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-bullet-list/src/index.ts +6 -0
- package/node_modules/@tiptap/extension-code/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-code/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-code/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-code/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-code/src/code.test.ts +122 -0
- package/node_modules/@tiptap/extension-code/src/code.ts +200 -0
- package/node_modules/@tiptap/extension-code/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-code-block/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-code-block/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-code-block/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-code-block/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-code-block/src/code-block.test.ts +97 -0
- package/node_modules/@tiptap/extension-code-block/src/code-block.ts +514 -0
- package/node_modules/@tiptap/extension-code-block/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-document/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-document/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-document/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-document/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-document/src/document.ts +19 -0
- package/node_modules/@tiptap/extension-document/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-dropcursor/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-dropcursor/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-dropcursor/src/index.ts +6 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-floating-menu/src/floating-menu-plugin.test.ts +250 -0
- package/node_modules/@tiptap/extension-floating-menu/src/floating-menu-plugin.ts +580 -0
- package/node_modules/@tiptap/extension-floating-menu/src/floating-menu.ts +77 -0
- package/node_modules/@tiptap/extension-floating-menu/src/index.ts +6 -0
- package/node_modules/@tiptap/extension-gapcursor/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-gapcursor/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-gapcursor/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-hard-break/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-hard-break/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-hard-break/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-hard-break/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-hard-break/src/hard-break.test.ts +78 -0
- package/node_modules/@tiptap/extension-hard-break/src/hard-break.ts +121 -0
- package/node_modules/@tiptap/extension-hard-break/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-heading/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-heading/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-heading/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-heading/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-heading/src/heading.ts +152 -0
- package/node_modules/@tiptap/extension-heading/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-highlight/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-highlight/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-highlight/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-highlight/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-highlight/src/highlight.test.ts +44 -0
- package/node_modules/@tiptap/extension-highlight/src/highlight.ts +190 -0
- package/node_modules/@tiptap/extension-highlight/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-horizontal-rule/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-horizontal-rule/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-horizontal-rule/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-horizontal-rule/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-horizontal-rule/src/horizontal-rule.test.ts +58 -0
- package/node_modules/@tiptap/extension-horizontal-rule/src/horizontal-rule.ts +136 -0
- package/node_modules/@tiptap/extension-horizontal-rule/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-image/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-image/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-image/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-image/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-image/src/image.test.ts +556 -0
- package/node_modules/@tiptap/extension-image/src/image.ts +330 -0
- package/node_modules/@tiptap/extension-image/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-italic/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-italic/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-italic/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-italic/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-italic/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-italic/src/italic.ts +160 -0
- package/node_modules/@tiptap/extension-link/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-link/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-link/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-link/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-link/src/helpers/autolink.ts +211 -0
- package/node_modules/@tiptap/extension-link/src/helpers/clickHandler.ts +73 -0
- package/node_modules/@tiptap/extension-link/src/helpers/markdownLink.ts +205 -0
- package/node_modules/@tiptap/extension-link/src/helpers/pasteHandler.ts +53 -0
- package/node_modules/@tiptap/extension-link/src/helpers/unlinkTrailingWhitespace.ts +46 -0
- package/node_modules/@tiptap/extension-link/src/helpers/whitespace.ts +8 -0
- package/node_modules/@tiptap/extension-link/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-link/src/link.ts +555 -0
- package/node_modules/@tiptap/extension-list/dist/bullet-list/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/bullet-list/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/bullet-list/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/bullet-list/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/item/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/item/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/item/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/item/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/kit/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/kit/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/kit/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/kit/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/ordered-list/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/ordered-list/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/ordered-list/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/ordered-list/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/task-item/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/task-item/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/task-item/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/task-item/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/task-list/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/task-list/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/task-list/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-list/dist/task-list/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list/src/bullet-list/bullet-list.ts +151 -0
- package/node_modules/@tiptap/extension-list/src/bullet-list/index.ts +1 -0
- package/node_modules/@tiptap/extension-list/src/helpers/createBranchingListDeleteKeymap.ts +24 -0
- package/node_modules/@tiptap/extension-list/src/helpers/getBranchingNestedListAtCursor.ts +116 -0
- package/node_modules/@tiptap/extension-list/src/helpers/handleDeleteBranchingNestedList.ts +25 -0
- package/node_modules/@tiptap/extension-list/src/helpers/hasBranchingNestedListAfterCursor.ts +30 -0
- package/node_modules/@tiptap/extension-list/src/helpers/hoistBranchingNestedList.ts +56 -0
- package/node_modules/@tiptap/extension-list/src/index.ts +7 -0
- package/node_modules/@tiptap/extension-list/src/item/index.ts +1 -0
- package/node_modules/@tiptap/extension-list/src/item/list-item.test.ts +46 -0
- package/node_modules/@tiptap/extension-list/src/item/list-item.ts +206 -0
- package/node_modules/@tiptap/extension-list/src/keymap/index.ts +2 -0
- package/node_modules/@tiptap/extension-list/src/keymap/list-keymap.ts +120 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/findListItemPos.ts +30 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/getNextListDepth.ts +16 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/handleBackspace.ts +70 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/handleDelete.ts +44 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/handleTab.ts +48 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/hasListBefore.ts +19 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/hasListItemAfter.ts +17 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/hasListItemBefore.ts +17 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/index.ts +11 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/listItemHasSubList.ts +21 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/nextListIsDeeper.ts +19 -0
- package/node_modules/@tiptap/extension-list/src/keymap/listHelpers/nextListIsHigher.ts +19 -0
- package/node_modules/@tiptap/extension-list/src/kit/index.ts +81 -0
- package/node_modules/@tiptap/extension-list/src/ordered-list/collectOrderedListItemsFromSource.ts +58 -0
- package/node_modules/@tiptap/extension-list/src/ordered-list/index.ts +13 -0
- package/node_modules/@tiptap/extension-list/src/ordered-list/ordered-list.ts +360 -0
- package/node_modules/@tiptap/extension-list/src/ordered-list/roman.test.ts +122 -0
- package/node_modules/@tiptap/extension-list/src/ordered-list/roman.ts +295 -0
- package/node_modules/@tiptap/extension-list/src/ordered-list/utils.test.ts +105 -0
- package/node_modules/@tiptap/extension-list/src/ordered-list/utils.ts +399 -0
- package/node_modules/@tiptap/extension-list/src/task-item/index.ts +1 -0
- package/node_modules/@tiptap/extension-list/src/task-item/task-item.test.ts +1394 -0
- package/node_modules/@tiptap/extension-list/src/task-item/task-item.ts +359 -0
- package/node_modules/@tiptap/extension-list/src/task-list/index.ts +1 -0
- package/node_modules/@tiptap/extension-list/src/task-list/task-list.ts +194 -0
- package/node_modules/@tiptap/extension-list-item/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list-item/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list-item/src/index.ts +6 -0
- package/node_modules/@tiptap/extension-list-keymap/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-list-keymap/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-list-keymap/src/index.ts +6 -0
- package/node_modules/@tiptap/extension-ordered-list/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-ordered-list/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-ordered-list/src/index.ts +6 -0
- package/node_modules/@tiptap/extension-paragraph/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-paragraph/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-paragraph/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-paragraph/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-paragraph/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-paragraph/src/paragraph.ts +139 -0
- package/node_modules/@tiptap/extension-strike/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-strike/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-strike/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-strike/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-strike/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-strike/src/strike.ts +134 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-subscript/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-subscript/src/subscript.test.ts +48 -0
- package/node_modules/@tiptap/extension-subscript/src/subscript.ts +97 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-superscript/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-superscript/src/superscript.test.ts +48 -0
- package/node_modules/@tiptap/extension-superscript/src/superscript.ts +97 -0
- package/node_modules/@tiptap/extension-table/dist/cell/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/cell/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/cell/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/cell/index.js.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/header/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/header/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/header/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/header/index.js.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/kit/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/kit/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/kit/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/kit/index.js.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/row/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/row/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/row/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/row/index.js.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/table/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/table/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/table/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-table/dist/table/index.js.map +1 -0
- package/node_modules/@tiptap/extension-table/src/cell/index.ts +1 -0
- package/node_modules/@tiptap/extension-table/src/cell/table-cell.test.ts +220 -0
- package/node_modules/@tiptap/extension-table/src/cell/table-cell.ts +74 -0
- package/node_modules/@tiptap/extension-table/src/header/index.ts +1 -0
- package/node_modules/@tiptap/extension-table/src/header/table-header.test.ts +193 -0
- package/node_modules/@tiptap/extension-table/src/header/table-header.ts +74 -0
- package/node_modules/@tiptap/extension-table/src/index.ts +6 -0
- package/node_modules/@tiptap/extension-table/src/kit/index.ts +64 -0
- package/node_modules/@tiptap/extension-table/src/row/index.ts +1 -0
- package/node_modules/@tiptap/extension-table/src/row/table-row.ts +38 -0
- package/node_modules/@tiptap/extension-table/src/table/TableView.ts +154 -0
- package/node_modules/@tiptap/extension-table/src/table/index.ts +4 -0
- package/node_modules/@tiptap/extension-table/src/table/table.test.ts +76 -0
- package/node_modules/@tiptap/extension-table/src/table/table.ts +648 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/colStyle.ts +12 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/createCell.ts +12 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/createColGroup.ts +69 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/createTable.ts +40 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/deleteTableWhenAllCellsSelected.ts +37 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/getTableNodeTypes.ts +21 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/isCellSelection.ts +5 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/keepCursorInTable.ts +29 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/markdown.test.ts +123 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/markdown.ts +233 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/preserveCellSelectionOnContextMenu.test.ts +166 -0
- package/node_modules/@tiptap/extension-table/src/table/utilities/preserveCellSelectionOnContextMenu.ts +69 -0
- package/node_modules/@tiptap/extension-table/src/types.ts +19 -0
- package/node_modules/@tiptap/extension-table/src/utils/fillEmptyCellContent.ts +25 -0
- package/node_modules/@tiptap/extension-table/src/utils/omitDefaultSpanAttribute.ts +15 -0
- package/node_modules/@tiptap/extension-table/src/utils/parseAlign.ts +80 -0
- package/node_modules/@tiptap/extension-table/src/utils/parseColwidth.ts +37 -0
- package/node_modules/@tiptap/extension-text/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-text/src/text.ts +20 -0
- package/node_modules/@tiptap/extension-text-align/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-align/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-align/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-align/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-align/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-text-align/src/text-align.test.ts +41 -0
- package/node_modules/@tiptap/extension-text-align/src/text-align.ts +140 -0
- package/node_modules/@tiptap/extension-text-style/dist/background-color/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/background-color/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/background-color/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/background-color/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/color/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/color/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/color/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/color/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-family/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-family/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-family/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-family/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-size/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-size/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-size/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-size/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/line-height/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/line-height/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/line-height/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/line-height/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.js.map +1 -0
- package/node_modules/@tiptap/extension-text-style/src/background-color/background-color.test.ts +35 -0
- package/node_modules/@tiptap/extension-text-style/src/background-color/background-color.ts +100 -0
- package/node_modules/@tiptap/extension-text-style/src/background-color/index.ts +5 -0
- package/node_modules/@tiptap/extension-text-style/src/color/color.test.ts +35 -0
- package/node_modules/@tiptap/extension-text-style/src/color/color.ts +96 -0
- package/node_modules/@tiptap/extension-text-style/src/color/index.ts +5 -0
- package/node_modules/@tiptap/extension-text-style/src/font-family/font-family.test.ts +89 -0
- package/node_modules/@tiptap/extension-text-style/src/font-family/font-family.ts +94 -0
- package/node_modules/@tiptap/extension-text-style/src/font-family/index.ts +5 -0
- package/node_modules/@tiptap/extension-text-style/src/font-size/font-size.test.ts +35 -0
- package/node_modules/@tiptap/extension-text-style/src/font-size/font-size.ts +92 -0
- package/node_modules/@tiptap/extension-text-style/src/font-size/index.ts +5 -0
- package/node_modules/@tiptap/extension-text-style/src/index.ts +14 -0
- package/node_modules/@tiptap/extension-text-style/src/line-height/index.ts +5 -0
- package/node_modules/@tiptap/extension-text-style/src/line-height/line-height.test.ts +35 -0
- package/node_modules/@tiptap/extension-text-style/src/line-height/line-height.ts +93 -0
- package/node_modules/@tiptap/extension-text-style/src/text-style/index.ts +168 -0
- package/node_modules/@tiptap/extension-text-style/src/text-style-kit/index.ts +86 -0
- package/node_modules/@tiptap/extension-underline/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-underline/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-underline/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-underline/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-underline/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-underline/src/underline.ts +123 -0
- package/node_modules/@tiptap/extension-youtube/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extension-youtube/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extension-youtube/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extension-youtube/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extension-youtube/src/index.ts +5 -0
- package/node_modules/@tiptap/extension-youtube/src/utils.test.ts +163 -0
- package/node_modules/@tiptap/extension-youtube/src/utils.ts +234 -0
- package/node_modules/@tiptap/extension-youtube/src/youtube.ts +399 -0
- package/node_modules/@tiptap/extensions/dist/character-count/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/character-count/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/character-count/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/character-count/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/dist/drop-cursor/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/drop-cursor/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/drop-cursor/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/drop-cursor/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/dist/focus/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/focus/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/focus/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/focus/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/dist/gap-cursor/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/gap-cursor/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/gap-cursor/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/gap-cursor/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/dist/placeholder/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/placeholder/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/placeholder/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/placeholder/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/dist/selection/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/selection/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/selection/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/selection/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/dist/trailing-node/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/trailing-node/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/trailing-node/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/trailing-node/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/dist/undo-redo/index.cjs.map +1 -0
- package/node_modules/@tiptap/extensions/dist/undo-redo/index.d.cts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/undo-redo/index.d.ts.map +1 -0
- package/node_modules/@tiptap/extensions/dist/undo-redo/index.js.map +1 -0
- package/node_modules/@tiptap/extensions/src/character-count/character-count.ts +203 -0
- package/node_modules/@tiptap/extensions/src/character-count/index.ts +1 -0
- package/node_modules/@tiptap/extensions/src/drop-cursor/drop-cursor.ts +47 -0
- package/node_modules/@tiptap/extensions/src/drop-cursor/index.ts +1 -0
- package/node_modules/@tiptap/extensions/src/focus/focus.ts +110 -0
- package/node_modules/@tiptap/extensions/src/focus/index.ts +1 -0
- package/node_modules/@tiptap/extensions/src/gap-cursor/gap-cursor.ts +47 -0
- package/node_modules/@tiptap/extensions/src/gap-cursor/index.ts +1 -0
- package/node_modules/@tiptap/extensions/src/index.ts +8 -0
- package/node_modules/@tiptap/extensions/src/placeholder/constants.ts +8 -0
- package/node_modules/@tiptap/extensions/src/placeholder/index.ts +4 -0
- package/node_modules/@tiptap/extensions/src/placeholder/placeholder.ts +30 -0
- package/node_modules/@tiptap/extensions/src/placeholder/plugins/PlaceholderPlugin.ts +49 -0
- package/node_modules/@tiptap/extensions/src/placeholder/types.ts +74 -0
- package/node_modules/@tiptap/extensions/src/placeholder/utils/buildPlaceholderDecorations.ts +164 -0
- package/node_modules/@tiptap/extensions/src/placeholder/utils/createPlaceholderDecoration.ts +61 -0
- package/node_modules/@tiptap/extensions/src/placeholder/utils/index.ts +3 -0
- package/node_modules/@tiptap/extensions/src/placeholder/utils/placeholderStateField.ts +204 -0
- package/node_modules/@tiptap/extensions/src/placeholder/utils/preparePlaceholderAttribute.ts +21 -0
- package/node_modules/@tiptap/extensions/src/placeholder/utils/resolveTopLevelRange.test.ts +78 -0
- package/node_modules/@tiptap/extensions/src/placeholder/utils/resolveTopLevelRange.ts +93 -0
- package/node_modules/@tiptap/extensions/src/selection/index.ts +1 -0
- package/node_modules/@tiptap/extensions/src/selection/selection.test.ts +97 -0
- package/node_modules/@tiptap/extensions/src/selection/selection.ts +106 -0
- package/node_modules/@tiptap/extensions/src/trailing-node/index.ts +1 -0
- package/node_modules/@tiptap/extensions/src/trailing-node/trailing-node.test.ts +90 -0
- package/node_modules/@tiptap/extensions/src/trailing-node/trailing-node.ts +107 -0
- package/node_modules/@tiptap/extensions/src/undo-redo/index.ts +1 -0
- package/node_modules/@tiptap/extensions/src/undo-redo/undo-redo.ts +86 -0
- package/node_modules/@tiptap/react/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/react/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/react/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/react/dist/index.js.map +1 -0
- package/node_modules/@tiptap/react/dist/menus/index.cjs.map +1 -0
- package/node_modules/@tiptap/react/dist/menus/index.d.cts.map +1 -0
- package/node_modules/@tiptap/react/dist/menus/index.d.ts.map +1 -0
- package/node_modules/@tiptap/react/dist/menus/index.js.map +1 -0
- package/node_modules/@tiptap/react/src/Context.tsx +62 -0
- package/node_modules/@tiptap/react/src/Editor.ts +16 -0
- package/node_modules/@tiptap/react/src/EditorContent.test.ts +39 -0
- package/node_modules/@tiptap/react/src/EditorContent.tsx +230 -0
- package/node_modules/@tiptap/react/src/NodeViewContent.tsx +30 -0
- package/node_modules/@tiptap/react/src/NodeViewWrapper.tsx +27 -0
- package/node_modules/@tiptap/react/src/ReactMarkViewRenderer.tsx +114 -0
- package/node_modules/@tiptap/react/src/ReactNodeViewRenderer.test.ts +566 -0
- package/node_modules/@tiptap/react/src/ReactNodeViewRenderer.tsx +465 -0
- package/node_modules/@tiptap/react/src/ReactNodeViewSelectionTracker.ts +113 -0
- package/node_modules/@tiptap/react/src/ReactRenderer.tsx +304 -0
- package/node_modules/@tiptap/react/src/ReactWidgetRenderer.test.ts +448 -0
- package/node_modules/@tiptap/react/src/ReactWidgetRenderer.tsx +97 -0
- package/node_modules/@tiptap/react/src/Tiptap.tsx +232 -0
- package/node_modules/@tiptap/react/src/captureDOMSelection.test.ts +76 -0
- package/node_modules/@tiptap/react/src/captureDOMSelection.ts +35 -0
- package/node_modules/@tiptap/react/src/handleMobileEnter.test.ts +218 -0
- package/node_modules/@tiptap/react/src/handleMobileEnter.ts +60 -0
- package/node_modules/@tiptap/react/src/index.ts +16 -0
- package/node_modules/@tiptap/react/src/lib/utils/getTextSelectionAncestorPositions.ts +27 -0
- package/node_modules/@tiptap/react/src/menus/BubbleMenu.test.ts +178 -0
- package/node_modules/@tiptap/react/src/menus/BubbleMenu.tsx +160 -0
- package/node_modules/@tiptap/react/src/menus/FloatingMenu.test.ts +168 -0
- package/node_modules/@tiptap/react/src/menus/FloatingMenu.tsx +161 -0
- package/node_modules/@tiptap/react/src/menus/getAutoPluginKey.ts +5 -0
- package/node_modules/@tiptap/react/src/menus/index.ts +4 -0
- package/node_modules/@tiptap/react/src/menus/useMenuElementProps.ts +369 -0
- package/node_modules/@tiptap/react/src/types.ts +8 -0
- package/node_modules/@tiptap/react/src/useEditor.ts +379 -0
- package/node_modules/@tiptap/react/src/useEditorState.test.ts +160 -0
- package/node_modules/@tiptap/react/src/useEditorState.ts +187 -0
- package/node_modules/@tiptap/react/src/useReactNodeView.ts +38 -0
- package/node_modules/@tiptap/starter-kit/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/starter-kit/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/starter-kit/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/starter-kit/dist/index.js.map +1 -0
- package/node_modules/@tiptap/starter-kit/src/index.ts +6 -0
- package/node_modules/@tiptap/starter-kit/src/starter-kit.ts +273 -0
- package/node_modules/@tiptap/suggestion/dist/index.cjs.map +1 -0
- package/node_modules/@tiptap/suggestion/dist/index.d.cts.map +1 -0
- package/node_modules/@tiptap/suggestion/dist/index.d.ts.map +1 -0
- package/node_modules/@tiptap/suggestion/dist/index.js.map +1 -0
- package/node_modules/@tiptap/suggestion/src/findSuggestionMatch.ts +86 -0
- package/node_modules/@tiptap/suggestion/src/helpers.ts +129 -0
- package/node_modules/@tiptap/suggestion/src/index.ts +8 -0
- package/node_modules/@tiptap/suggestion/src/plugin/async.ts +89 -0
- package/node_modules/@tiptap/suggestion/src/plugin/floating-ui.ts +204 -0
- package/node_modules/@tiptap/suggestion/src/plugin/props.ts +94 -0
- package/node_modules/@tiptap/suggestion/src/plugin/state.ts +182 -0
- package/node_modules/@tiptap/suggestion/src/plugin/view.ts +236 -0
- package/node_modules/@tiptap/suggestion/src/suggestion.ts +151 -0
- package/node_modules/@tiptap/suggestion/src/types.ts +439 -0
- package/node_modules/fast-equals/dist/cjs/index.cjs.map +1 -0
- package/node_modules/fast-equals/dist/es/index.mjs.map +1 -0
- package/node_modules/fast-equals/dist/umd/index.js.map +1 -0
- package/node_modules/prosemirror-changeset/src/README.md +32 -0
- package/node_modules/prosemirror-changeset/src/change.ts +189 -0
- package/node_modules/prosemirror-changeset/src/changeset.ts +212 -0
- package/node_modules/prosemirror-changeset/src/diff.ts +158 -0
- package/node_modules/prosemirror-changeset/src/simplify.ts +132 -0
- package/node_modules/prosemirror-commands/src/README.md +40 -0
- package/node_modules/prosemirror-commands/src/commands.ts +786 -0
- package/node_modules/prosemirror-dropcursor/src/dropcursor.ts +186 -0
- package/node_modules/prosemirror-gapcursor/src/README.md +21 -0
- package/node_modules/prosemirror-gapcursor/src/gapcursor.ts +141 -0
- package/node_modules/prosemirror-gapcursor/src/index.ts +91 -0
- package/node_modules/prosemirror-history/src/README.md +23 -0
- package/node_modules/prosemirror-history/src/history.ts +466 -0
- package/node_modules/prosemirror-inputrules/src/README.md +23 -0
- package/node_modules/prosemirror-inputrules/src/index.ts +4 -0
- package/node_modules/prosemirror-inputrules/src/inputrules.ts +167 -0
- package/node_modules/prosemirror-inputrules/src/rulebuilders.ts +59 -0
- package/node_modules/prosemirror-inputrules/src/rules.ts +17 -0
- package/node_modules/prosemirror-keymap/src/README.md +5 -0
- package/node_modules/prosemirror-keymap/src/keymap.ts +105 -0
- package/node_modules/prosemirror-model/src/README.md +62 -0
- package/node_modules/prosemirror-model/src/comparedeep.ts +15 -0
- package/node_modules/prosemirror-model/src/content.ts +413 -0
- package/node_modules/prosemirror-model/src/diff.ts +57 -0
- package/node_modules/prosemirror-model/src/dom.ts +1 -0
- package/node_modules/prosemirror-model/src/fragment.ts +268 -0
- package/node_modules/prosemirror-model/src/from_dom.ts +851 -0
- package/node_modules/prosemirror-model/src/index.ts +11 -0
- package/node_modules/prosemirror-model/src/mark.ts +110 -0
- package/node_modules/prosemirror-model/src/node.ts +410 -0
- package/node_modules/prosemirror-model/src/replace.ts +217 -0
- package/node_modules/prosemirror-model/src/resolvedpos.ts +289 -0
- package/node_modules/prosemirror-model/src/schema.ts +691 -0
- package/node_modules/prosemirror-model/src/to_dom.ts +242 -0
- package/node_modules/prosemirror-schema-list/src/README.md +29 -0
- package/node_modules/prosemirror-schema-list/src/schema-list.ts +267 -0
- package/node_modules/prosemirror-state/src/README.md +42 -0
- package/node_modules/prosemirror-state/src/index.ts +7 -0
- package/node_modules/prosemirror-state/src/plugin.ts +142 -0
- package/node_modules/prosemirror-state/src/selection.ts +462 -0
- package/node_modules/prosemirror-state/src/state.ts +266 -0
- package/node_modules/prosemirror-state/src/transaction.ts +215 -0
- package/node_modules/prosemirror-tables/dist/index.d.cts.map +1 -0
- package/node_modules/prosemirror-tables/dist/index.d.ts.map +1 -0
- package/node_modules/prosemirror-tables/dist/index.js.map +1 -0
- package/node_modules/prosemirror-transform/src/README.md +59 -0
- package/node_modules/prosemirror-transform/src/attr_step.ts +98 -0
- package/node_modules/prosemirror-transform/src/index.ts +11 -0
- package/node_modules/prosemirror-transform/src/map.ts +287 -0
- package/node_modules/prosemirror-transform/src/mark.ts +90 -0
- package/node_modules/prosemirror-transform/src/mark_step.ts +287 -0
- package/node_modules/prosemirror-transform/src/replace.ts +483 -0
- package/node_modules/prosemirror-transform/src/replace_step.ts +187 -0
- package/node_modules/prosemirror-transform/src/step.ts +97 -0
- package/node_modules/prosemirror-transform/src/structure.ts +349 -0
- package/node_modules/prosemirror-transform/src/transform.ts +271 -0
- package/node_modules/prosemirror-view/src/README.md +38 -0
- package/node_modules/prosemirror-view/src/browser.ts +24 -0
- package/node_modules/prosemirror-view/src/capturekeys.ts +344 -0
- package/node_modules/prosemirror-view/src/clipboard.ts +282 -0
- package/node_modules/prosemirror-view/src/decoration.ts +817 -0
- package/node_modules/prosemirror-view/src/dom.ts +166 -0
- package/node_modules/prosemirror-view/src/domchange.ts +383 -0
- package/node_modules/prosemirror-view/src/domcoords.ts +517 -0
- package/node_modules/prosemirror-view/src/domobserver.ts +397 -0
- package/node_modules/prosemirror-view/src/index.ts +826 -0
- package/node_modules/prosemirror-view/src/input.ts +885 -0
- package/node_modules/prosemirror-view/src/selection.ts +229 -0
- package/node_modules/prosemirror-view/src/viewdesc.ts +1624 -0
- package/package.json +1 -1
- package/src/dynamic.tsx +57 -1
- package/src/editor.css +11 -0
- package/src/index.ts +1 -1
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
import {Node, Mark, Fragment} from "prosemirror-model"
|
|
2
|
+
import {Mappable, Mapping} from "prosemirror-transform"
|
|
3
|
+
import {EditorView} from "./index"
|
|
4
|
+
import {DOMNode} from "./dom"
|
|
5
|
+
|
|
6
|
+
function compareObjs(a: {[prop: string]: any}, b: {[prop: string]: any}) {
|
|
7
|
+
if (a == b) return true
|
|
8
|
+
for (let p in a) if (a[p] !== b[p]) return false
|
|
9
|
+
for (let p in b) if (!(p in a)) return false
|
|
10
|
+
return true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
class FragmentCursor {
|
|
14
|
+
index = 0
|
|
15
|
+
off = 0
|
|
16
|
+
constructor(readonly frag: Fragment) {}
|
|
17
|
+
nodeAt(off: number) {
|
|
18
|
+
while (this.off <= off && this.index < this.frag.childCount) {
|
|
19
|
+
let next = this.frag.child(this.index)
|
|
20
|
+
if (this.off == off) return next
|
|
21
|
+
this.off += next.nodeSize
|
|
22
|
+
this.index++
|
|
23
|
+
}
|
|
24
|
+
return null
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface DecorationType {
|
|
29
|
+
spec: any
|
|
30
|
+
map(mapping: Mappable, span: Decoration, offset: number, oldOffset: number): Decoration | null
|
|
31
|
+
valid(node: Node, span: Decoration, cur: FragmentCursor): boolean
|
|
32
|
+
eq(other: DecorationType): boolean
|
|
33
|
+
destroy(dom: DOMNode): void
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type WidgetConstructor = ((view: EditorView, getPos: () => number | undefined) => DOMNode) | DOMNode
|
|
37
|
+
|
|
38
|
+
export class WidgetType implements DecorationType {
|
|
39
|
+
spec: any
|
|
40
|
+
side: number
|
|
41
|
+
|
|
42
|
+
constructor(readonly toDOM: WidgetConstructor, spec: any) {
|
|
43
|
+
this.spec = spec || noSpec
|
|
44
|
+
this.side = this.spec.side || 0
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
map(mapping: Mappable, span: Decoration, offset: number, oldOffset: number): Decoration | null {
|
|
48
|
+
let {pos, deleted} = mapping.mapResult(span.from + oldOffset, this.side < 0 ? -1 : 1)
|
|
49
|
+
return deleted ? null : new Decoration(pos - offset, pos - offset, this)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
valid() { return true }
|
|
53
|
+
|
|
54
|
+
eq(other: WidgetType) {
|
|
55
|
+
return this == other ||
|
|
56
|
+
(other instanceof WidgetType &&
|
|
57
|
+
(this.spec.key && this.spec.key == other.spec.key ||
|
|
58
|
+
this.toDOM == other.toDOM && compareObjs(this.spec, other.spec)))
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
destroy(node: DOMNode) {
|
|
62
|
+
if (this.spec.destroy) this.spec.destroy(node)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export class InlineType implements DecorationType {
|
|
67
|
+
spec: any
|
|
68
|
+
|
|
69
|
+
constructor(readonly attrs: DecorationAttrs, spec: any) {
|
|
70
|
+
this.spec = spec || noSpec
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
map(mapping: Mappable, span: Decoration, offset: number, oldOffset: number): Decoration | null {
|
|
74
|
+
let from = mapping.map(span.from + oldOffset, this.spec.inclusiveStart ? -1 : 1) - offset
|
|
75
|
+
let to = mapping.map(span.to + oldOffset, this.spec.inclusiveEnd ? 1 : -1) - offset
|
|
76
|
+
return from >= to ? null : new Decoration(from, to, this)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
valid(_: Node, span: Decoration) { return span.from < span.to }
|
|
80
|
+
|
|
81
|
+
eq(other: DecorationType): boolean {
|
|
82
|
+
return this == other ||
|
|
83
|
+
(other instanceof InlineType && compareObjs(this.attrs, other.attrs) &&
|
|
84
|
+
compareObjs(this.spec, other.spec))
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static is(span: Decoration) { return span.type instanceof InlineType }
|
|
88
|
+
|
|
89
|
+
destroy() {}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export class NodeType implements DecorationType {
|
|
93
|
+
spec: any
|
|
94
|
+
constructor(readonly attrs: DecorationAttrs, spec: any) {
|
|
95
|
+
this.spec = spec || noSpec
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
map(mapping: Mappable, span: Decoration, offset: number, oldOffset: number): Decoration | null {
|
|
99
|
+
let from = mapping.mapResult(span.from + oldOffset, 1)
|
|
100
|
+
if (from.deleted) return null
|
|
101
|
+
let to = mapping.mapResult(span.to + oldOffset, -1)
|
|
102
|
+
if (to.deleted || to.pos <= from.pos) return null
|
|
103
|
+
return new Decoration(from.pos - offset, to.pos - offset, this)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
valid(node: Node, span: Decoration, cursor: FragmentCursor): boolean {
|
|
107
|
+
let found = cursor.nodeAt(span.from)
|
|
108
|
+
return !!found && !found.isText && span.from + found.nodeSize == span.to
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
eq(other: DecorationType): boolean {
|
|
112
|
+
return this == other ||
|
|
113
|
+
(other instanceof NodeType && compareObjs(this.attrs, other.attrs) &&
|
|
114
|
+
compareObjs(this.spec, other.spec))
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
destroy() {}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/// Decoration objects can be provided to the view through the
|
|
121
|
+
/// [`decorations` prop](#view.EditorProps.decorations). They come in
|
|
122
|
+
/// several variants—see the static members of this class for details.
|
|
123
|
+
export class Decoration {
|
|
124
|
+
/// @internal
|
|
125
|
+
constructor(
|
|
126
|
+
/// The start position of the decoration.
|
|
127
|
+
readonly from: number,
|
|
128
|
+
/// The end position. Will be the same as `from` for [widget
|
|
129
|
+
/// decorations](#view.Decoration^widget).
|
|
130
|
+
readonly to: number,
|
|
131
|
+
/// @internal
|
|
132
|
+
readonly type: DecorationType
|
|
133
|
+
) {}
|
|
134
|
+
|
|
135
|
+
/// @internal
|
|
136
|
+
copy(from: number, to: number) {
|
|
137
|
+
return new Decoration(from, to, this.type)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/// @internal
|
|
141
|
+
eq(other: Decoration, offset = 0) {
|
|
142
|
+
return this.type.eq(other.type) && this.from + offset == other.from && this.to + offset == other.to
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/// @internal
|
|
146
|
+
map(mapping: Mappable, offset: number, oldOffset: number) {
|
|
147
|
+
return this.type.map(mapping, this, offset, oldOffset)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/// Creates a widget decoration, which is a DOM node that's shown in
|
|
151
|
+
/// the document at the given position. It is recommended that you
|
|
152
|
+
/// delay rendering the widget by passing a function that will be
|
|
153
|
+
/// called when the widget is actually drawn in a view, but you can
|
|
154
|
+
/// also directly pass a DOM node. `getPos` can be used to find the
|
|
155
|
+
/// widget's current document position.
|
|
156
|
+
static widget(pos: number, toDOM: WidgetConstructor, spec?: {
|
|
157
|
+
/// Controls which side of the document position this widget is
|
|
158
|
+
/// associated with. When negative, it is drawn before a cursor
|
|
159
|
+
/// at its position, and content inserted at that position ends
|
|
160
|
+
/// up after the widget. When zero (the default) or positive, the
|
|
161
|
+
/// widget is drawn after the cursor and content inserted there
|
|
162
|
+
/// ends up before the widget.
|
|
163
|
+
///
|
|
164
|
+
/// When there are multiple widgets at a given position, their
|
|
165
|
+
/// `side` values determine the order in which they appear. Those
|
|
166
|
+
/// with lower values appear first. The ordering of widgets with
|
|
167
|
+
/// the same `side` value is unspecified.
|
|
168
|
+
///
|
|
169
|
+
/// When `marks` is null, `side` also determines the marks that
|
|
170
|
+
/// the widget is wrapped in—those of the node before when
|
|
171
|
+
/// negative, those of the node after when positive.
|
|
172
|
+
side?: number
|
|
173
|
+
|
|
174
|
+
/// By default, the cursor, when at the position of the widget,
|
|
175
|
+
/// will be strictly kept on the side indicated by
|
|
176
|
+
/// [`side`](#view.Decoration^widget^spec.side). Set this to true
|
|
177
|
+
/// to allow the DOM selection to stay on the other side if the
|
|
178
|
+
/// client sets it there.
|
|
179
|
+
///
|
|
180
|
+
/// **Note**: Mapping of this decoration, which decides on which
|
|
181
|
+
/// side insertions at its position appear, will still happen
|
|
182
|
+
/// according to `side`, and keyboard cursor motion will not,
|
|
183
|
+
/// without further custom handling, visit both sides of the
|
|
184
|
+
/// widget.
|
|
185
|
+
relaxedSide?: boolean
|
|
186
|
+
|
|
187
|
+
/// The precise set of marks to draw around the widget.
|
|
188
|
+
marks?: readonly Mark[]
|
|
189
|
+
|
|
190
|
+
/// Can be used to control which DOM events, when they bubble out
|
|
191
|
+
/// of this widget, the editor view should ignore.
|
|
192
|
+
stopEvent?: (event: Event) => boolean
|
|
193
|
+
|
|
194
|
+
/// When set (defaults to false), selection changes inside the
|
|
195
|
+
/// widget are ignored, and don't cause ProseMirror to try and
|
|
196
|
+
/// re-sync the selection with its selection state.
|
|
197
|
+
ignoreSelection?: boolean
|
|
198
|
+
|
|
199
|
+
/// When comparing decorations of this type (in order to decide
|
|
200
|
+
/// whether it needs to be redrawn), ProseMirror will by default
|
|
201
|
+
/// compare the widget DOM node by identity. If you pass a key,
|
|
202
|
+
/// that key will be compared instead, which can be useful when
|
|
203
|
+
/// you generate decorations on the fly and don't want to store
|
|
204
|
+
/// and reuse DOM nodes. Make sure that any widgets with the same
|
|
205
|
+
/// key are interchangeable—if widgets differ in, for example,
|
|
206
|
+
/// the behavior of some event handler, they should get
|
|
207
|
+
/// different keys.
|
|
208
|
+
key?: string
|
|
209
|
+
|
|
210
|
+
/// Called when the widget decoration is removed or the editor is
|
|
211
|
+
/// destroyed.
|
|
212
|
+
destroy?: (node: DOMNode) => void
|
|
213
|
+
|
|
214
|
+
/// Specs allow arbitrary additional properties.
|
|
215
|
+
[key: string]: any
|
|
216
|
+
}): Decoration {
|
|
217
|
+
return new Decoration(pos, pos, new WidgetType(toDOM, spec))
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/// Creates an inline decoration, which adds the given attributes to
|
|
221
|
+
/// each inline node between `from` and `to`.
|
|
222
|
+
static inline(from: number, to: number, attrs: DecorationAttrs, spec?: {
|
|
223
|
+
/// Determines how the left side of the decoration is
|
|
224
|
+
/// [mapped](#transform.Position_Mapping) when content is
|
|
225
|
+
/// inserted directly at that position. By default, the decoration
|
|
226
|
+
/// won't include the new content, but you can set this to `true`
|
|
227
|
+
/// to make it inclusive.
|
|
228
|
+
inclusiveStart?: boolean
|
|
229
|
+
|
|
230
|
+
/// Determines how the right side of the decoration is mapped.
|
|
231
|
+
/// See
|
|
232
|
+
/// [`inclusiveStart`](#view.Decoration^inline^spec.inclusiveStart).
|
|
233
|
+
inclusiveEnd?: boolean
|
|
234
|
+
|
|
235
|
+
/// Specs may have arbitrary additional properties.
|
|
236
|
+
[key: string]: any
|
|
237
|
+
}) {
|
|
238
|
+
return new Decoration(from, to, new InlineType(attrs, spec))
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/// Creates a node decoration. `from` and `to` should point precisely
|
|
242
|
+
/// before and after a node in the document. That node, and only that
|
|
243
|
+
/// node, will receive the given attributes.
|
|
244
|
+
static node(from: number, to: number, attrs: DecorationAttrs, spec?: any) {
|
|
245
|
+
return new Decoration(from, to, new NodeType(attrs, spec))
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/// The spec provided when creating this decoration. Can be useful
|
|
249
|
+
/// if you've stored extra information in that object.
|
|
250
|
+
get spec() { return this.type.spec }
|
|
251
|
+
|
|
252
|
+
/// @internal
|
|
253
|
+
get inline() { return this.type instanceof InlineType }
|
|
254
|
+
|
|
255
|
+
/// @internal
|
|
256
|
+
get widget() { return this.type instanceof WidgetType }
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/// A set of attributes to add to a decorated node. Most properties
|
|
260
|
+
/// simply directly correspond to DOM attributes of the same name,
|
|
261
|
+
/// which will be set to the property's value. These are exceptions:
|
|
262
|
+
export type DecorationAttrs = {
|
|
263
|
+
/// When non-null, the target node is wrapped in a DOM element of
|
|
264
|
+
/// this type (and the other attributes are applied to this element).
|
|
265
|
+
nodeName?: string
|
|
266
|
+
|
|
267
|
+
/// A CSS class name or a space-separated set of class names to be
|
|
268
|
+
/// _added_ to the classes that the node already had.
|
|
269
|
+
class?: string
|
|
270
|
+
|
|
271
|
+
/// A string of CSS to be _added_ to the node's existing `style` property.
|
|
272
|
+
style?: string
|
|
273
|
+
|
|
274
|
+
/// Any other properties are treated as regular DOM attributes.
|
|
275
|
+
[attribute: string]: string | undefined
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const none: readonly any[] = [], noSpec = {}
|
|
279
|
+
|
|
280
|
+
/// An object that can [provide](#view.EditorProps.decorations)
|
|
281
|
+
/// decorations. Implemented by [`DecorationSet`](#view.DecorationSet),
|
|
282
|
+
/// and passed to [node views](#view.EditorProps.nodeViews).
|
|
283
|
+
export interface DecorationSource {
|
|
284
|
+
/// Map the set of decorations in response to a change in the
|
|
285
|
+
/// document.
|
|
286
|
+
map: (mapping: Mapping, node: Node) => DecorationSource
|
|
287
|
+
/// @internal
|
|
288
|
+
locals(node: Node): readonly Decoration[]
|
|
289
|
+
/// Extract a DecorationSource containing decorations for the given child node at the given offset.
|
|
290
|
+
forChild(offset: number, child: Node): DecorationSource
|
|
291
|
+
/// @internal
|
|
292
|
+
eq(other: DecorationSource): boolean
|
|
293
|
+
/// Call the given function for each decoration set in the group.
|
|
294
|
+
forEachSet(f: (set: DecorationSet) => void): void
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/// A collection of [decorations](#view.Decoration), organized in such
|
|
298
|
+
/// a way that the drawing algorithm can efficiently use and compare
|
|
299
|
+
/// them. This is a persistent data structure—it is not modified,
|
|
300
|
+
/// updates create a new value.
|
|
301
|
+
export class DecorationSet implements DecorationSource {
|
|
302
|
+
/// @internal
|
|
303
|
+
local: readonly Decoration[]
|
|
304
|
+
/// @internal
|
|
305
|
+
children: readonly (number | DecorationSet)[]
|
|
306
|
+
|
|
307
|
+
/// @internal
|
|
308
|
+
constructor(local: readonly Decoration[], children: readonly (number | DecorationSet)[]) {
|
|
309
|
+
this.local = local.length ? local : none
|
|
310
|
+
this.children = children.length ? children : none
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/// Create a set of decorations, using the structure of the given
|
|
314
|
+
/// document. This will consume (modify) the `decorations` array, so
|
|
315
|
+
/// you must make a copy if you want need to preserve that.
|
|
316
|
+
static create(doc: Node, decorations: Decoration[]) {
|
|
317
|
+
return decorations.length ? buildTree(decorations, doc, 0, noSpec) : empty
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/// Find all decorations in this set which touch the given range
|
|
321
|
+
/// (including decorations that start or end directly at the
|
|
322
|
+
/// boundaries) and match the given predicate on their spec. When
|
|
323
|
+
/// `start` and `end` are omitted, all decorations in the set are
|
|
324
|
+
/// considered. When `predicate` isn't given, all decorations are
|
|
325
|
+
/// assumed to match.
|
|
326
|
+
find(start?: number, end?: number, predicate?: (spec: any) => boolean): Decoration[] {
|
|
327
|
+
let result: Decoration[] = []
|
|
328
|
+
this.findInner(start == null ? 0 : start, end == null ? 1e9 : end, result, 0, predicate)
|
|
329
|
+
return result
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
private findInner(start: number, end: number, result: Decoration[], offset: number, predicate?: (spec: any) => boolean) {
|
|
333
|
+
for (let i = 0; i < this.local.length; i++) {
|
|
334
|
+
let span = this.local[i]
|
|
335
|
+
if (span.from <= end && span.to >= start && (!predicate || predicate(span.spec)))
|
|
336
|
+
result.push(span.copy(span.from + offset, span.to + offset))
|
|
337
|
+
}
|
|
338
|
+
for (let i = 0; i < this.children.length; i += 3) {
|
|
339
|
+
if ((this.children[i] as number) < end && (this.children[i + 1] as number) > start) {
|
|
340
|
+
let childOff = (this.children[i] as number) + 1
|
|
341
|
+
;(this.children[i + 2] as DecorationSet).findInner(start - childOff, end - childOff,
|
|
342
|
+
result, offset + childOff, predicate)
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/// Map the set of decorations in response to a change in the
|
|
348
|
+
/// document.
|
|
349
|
+
map(mapping: Mapping, doc: Node, options?: {
|
|
350
|
+
/// When given, this function will be called for each decoration
|
|
351
|
+
/// that gets dropped as a result of the mapping, passing the
|
|
352
|
+
/// spec of that decoration.
|
|
353
|
+
onRemove?: (decorationSpec: any) => void
|
|
354
|
+
}) {
|
|
355
|
+
if (this == empty || mapping.maps.length == 0) return this
|
|
356
|
+
return this.mapInner(mapping, doc, 0, 0, options || noSpec)
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/// @internal
|
|
360
|
+
mapInner(mapping: Mapping, node: Node, offset: number, oldOffset: number, options: {
|
|
361
|
+
onRemove?: (decorationSpec: any) => void
|
|
362
|
+
}) {
|
|
363
|
+
let newLocal: Decoration[] | undefined
|
|
364
|
+
if (this.local.length) {
|
|
365
|
+
let cur = new FragmentCursor(node.content)
|
|
366
|
+
for (let i = 0; i < this.local.length; i++) {
|
|
367
|
+
let mapped = this.local[i].map(mapping, offset, oldOffset)
|
|
368
|
+
if (mapped && mapped.type.valid(node, mapped, cur)) (newLocal || (newLocal = [])).push(mapped)
|
|
369
|
+
else if (options.onRemove) options.onRemove(this.local[i].spec)
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
if (this.children.length)
|
|
374
|
+
return mapChildren(this.children, newLocal || [], mapping, node, offset, oldOffset, options)
|
|
375
|
+
else
|
|
376
|
+
return newLocal ? new DecorationSet(newLocal.sort(byPos), none) : empty
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/// Add the given array of decorations to the ones in the set,
|
|
380
|
+
/// producing a new set. Consumes the `decorations` array. Needs
|
|
381
|
+
/// access to the current document to create the appropriate tree
|
|
382
|
+
/// structure.
|
|
383
|
+
add(doc: Node, decorations: Decoration[]) {
|
|
384
|
+
if (!decorations.length) return this
|
|
385
|
+
if (this == empty) return DecorationSet.create(doc, decorations)
|
|
386
|
+
return this.addInner(doc, decorations, 0)
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
private addInner(doc: Node, decorations: Decoration[], offset: number) {
|
|
390
|
+
let children: (number | DecorationSet)[] | undefined, childIndex = 0
|
|
391
|
+
doc.forEach((childNode, childOffset) => {
|
|
392
|
+
let baseOffset = childOffset + offset, found
|
|
393
|
+
if (!(found = takeSpansForNode(decorations, childNode, baseOffset))) return
|
|
394
|
+
|
|
395
|
+
if (!children) children = this.children.slice()
|
|
396
|
+
while (childIndex < children.length && (children[childIndex] as number) < childOffset) childIndex += 3
|
|
397
|
+
if (children[childIndex] == childOffset)
|
|
398
|
+
children[childIndex + 2] = (children[childIndex + 2] as DecorationSet).addInner(childNode, found, baseOffset + 1)
|
|
399
|
+
else
|
|
400
|
+
children.splice(childIndex, 0, childOffset, childOffset + childNode.nodeSize, buildTree(found, childNode, baseOffset + 1, noSpec))
|
|
401
|
+
childIndex += 3
|
|
402
|
+
})
|
|
403
|
+
|
|
404
|
+
let local = moveSpans(childIndex ? withoutNulls(decorations) : decorations, -offset)
|
|
405
|
+
if (local.length) {
|
|
406
|
+
let cur = new FragmentCursor(doc.content)
|
|
407
|
+
for (let i = 0; i < local.length; i++) if (!local[i].type.valid(doc, local[i], cur)) local.splice(i--, 1)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
return new DecorationSet(local.length ? this.local.concat(local).sort(byPos) : this.local,
|
|
411
|
+
children || this.children)
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/// Create a new set that contains the decorations in this set, minus
|
|
415
|
+
/// the ones in the given array.
|
|
416
|
+
remove(decorations: Decoration[]) {
|
|
417
|
+
if (decorations.length == 0 || this == empty) return this
|
|
418
|
+
return this.removeInner(decorations, 0)
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
private removeInner(decorations: (Decoration | null)[], offset: number) {
|
|
422
|
+
let children = this.children as (number | DecorationSet)[], local = this.local as Decoration[]
|
|
423
|
+
for (let i = 0; i < children.length; i += 3) {
|
|
424
|
+
let found: Decoration[] | undefined
|
|
425
|
+
let from = (children[i] as number) + offset, to = (children[i + 1] as number) + offset
|
|
426
|
+
for (let j = 0, span; j < decorations.length; j++) if (span = decorations[j]) {
|
|
427
|
+
if (span.from > from && span.to < to) {
|
|
428
|
+
decorations[j] = null
|
|
429
|
+
;(found || (found = [])).push(span)
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (!found) continue
|
|
433
|
+
if (children == this.children) children = this.children.slice()
|
|
434
|
+
let removed = (children[i + 2] as DecorationSet).removeInner(found, from + 1)
|
|
435
|
+
if (removed != empty) {
|
|
436
|
+
children[i + 2] = removed
|
|
437
|
+
} else {
|
|
438
|
+
children.splice(i, 3)
|
|
439
|
+
i -= 3
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
if (local.length) for (let i = 0, span; i < decorations.length; i++) if (span = decorations[i]) {
|
|
443
|
+
for (let j = 0; j < local.length; j++) if (local[j].eq(span, offset)) {
|
|
444
|
+
if (local == this.local) local = this.local.slice()
|
|
445
|
+
local.splice(j--, 1)
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if (children == this.children && local == this.local) return this
|
|
449
|
+
return local.length || children.length ? new DecorationSet(local, children) : empty
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
forChild(offset: number, node: Node): DecorationSet | DecorationGroup {
|
|
453
|
+
if (this == empty) return this
|
|
454
|
+
if (node.isLeaf) return DecorationSet.empty
|
|
455
|
+
|
|
456
|
+
let child, local: Decoration[] | undefined
|
|
457
|
+
for (let i = 0; i < this.children.length; i += 3) if ((this.children[i] as number) >= offset) {
|
|
458
|
+
if (this.children[i] == offset) child = this.children[i + 2] as DecorationSet
|
|
459
|
+
break
|
|
460
|
+
}
|
|
461
|
+
let start = offset + 1, end = start + node.content.size
|
|
462
|
+
for (let i = 0; i < this.local.length; i++) {
|
|
463
|
+
let dec = this.local[i]
|
|
464
|
+
if (dec.from < end && dec.to > start && (dec.type instanceof InlineType)) {
|
|
465
|
+
let from = Math.max(start, dec.from) - start, to = Math.min(end, dec.to) - start
|
|
466
|
+
if (from < to) (local || (local = [])).push(dec.copy(from, to))
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (local) {
|
|
470
|
+
let localSet = new DecorationSet(local.sort(byPos), none)
|
|
471
|
+
return child ? new DecorationGroup([localSet, child]) : localSet
|
|
472
|
+
}
|
|
473
|
+
return child || empty
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/// @internal
|
|
477
|
+
eq(other: DecorationSet) {
|
|
478
|
+
if (this == other) return true
|
|
479
|
+
if (!(other instanceof DecorationSet) ||
|
|
480
|
+
this.local.length != other.local.length ||
|
|
481
|
+
this.children.length != other.children.length) return false
|
|
482
|
+
for (let i = 0; i < this.local.length; i++)
|
|
483
|
+
if (!this.local[i].eq(other.local[i])) return false
|
|
484
|
+
for (let i = 0; i < this.children.length; i += 3)
|
|
485
|
+
if (this.children[i] != other.children[i] ||
|
|
486
|
+
this.children[i + 1] != other.children[i + 1] ||
|
|
487
|
+
!(this.children[i + 2] as DecorationSet).eq(other.children[i + 2] as DecorationSet))
|
|
488
|
+
return false
|
|
489
|
+
return true
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/// @internal
|
|
493
|
+
locals(node: Node) {
|
|
494
|
+
return removeOverlap(this.localsInner(node))
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/// @internal
|
|
498
|
+
localsInner(node: Node): readonly Decoration[] {
|
|
499
|
+
if (this == empty) return none
|
|
500
|
+
if (node.inlineContent || !this.local.some(InlineType.is)) return this.local
|
|
501
|
+
let result = []
|
|
502
|
+
for (let i = 0; i < this.local.length; i++) {
|
|
503
|
+
if (!(this.local[i].type instanceof InlineType))
|
|
504
|
+
result.push(this.local[i])
|
|
505
|
+
}
|
|
506
|
+
return result
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/// The empty set of decorations.
|
|
510
|
+
static empty: DecorationSet = new DecorationSet([], [])
|
|
511
|
+
|
|
512
|
+
/// @internal
|
|
513
|
+
static removeOverlap = removeOverlap
|
|
514
|
+
|
|
515
|
+
forEachSet(f: (set: DecorationSet) => void) { f(this) }
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const empty = DecorationSet.empty
|
|
519
|
+
|
|
520
|
+
// An abstraction that allows the code dealing with decorations to
|
|
521
|
+
// treat multiple DecorationSet objects as if it were a single object
|
|
522
|
+
// with (a subset of) the same interface.
|
|
523
|
+
class DecorationGroup implements DecorationSource {
|
|
524
|
+
constructor(readonly members: readonly DecorationSet[]) {}
|
|
525
|
+
|
|
526
|
+
map(mapping: Mapping, doc: Node) {
|
|
527
|
+
const mappedDecos = this.members.map(
|
|
528
|
+
member => member.map(mapping, doc, noSpec)
|
|
529
|
+
)
|
|
530
|
+
return DecorationGroup.from(mappedDecos)
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
forChild(offset: number, child: Node) {
|
|
534
|
+
if (child.isLeaf) return DecorationSet.empty
|
|
535
|
+
let found: DecorationSet[] = []
|
|
536
|
+
for (let i = 0; i < this.members.length; i++) {
|
|
537
|
+
let result = this.members[i].forChild(offset, child)
|
|
538
|
+
if (result == empty) continue
|
|
539
|
+
if (result instanceof DecorationGroup) found = found.concat(result.members)
|
|
540
|
+
else found.push(result)
|
|
541
|
+
}
|
|
542
|
+
return DecorationGroup.from(found)
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
eq(other: DecorationGroup) {
|
|
546
|
+
if (!(other instanceof DecorationGroup) ||
|
|
547
|
+
other.members.length != this.members.length) return false
|
|
548
|
+
for (let i = 0; i < this.members.length; i++)
|
|
549
|
+
if (!this.members[i].eq(other.members[i])) return false
|
|
550
|
+
return true
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
locals(node: Node) {
|
|
554
|
+
let result: Decoration[] | undefined, sorted = true
|
|
555
|
+
for (let i = 0; i < this.members.length; i++) {
|
|
556
|
+
let locals = this.members[i].localsInner(node)
|
|
557
|
+
if (!locals.length) continue
|
|
558
|
+
if (!result) {
|
|
559
|
+
result = locals as Decoration[]
|
|
560
|
+
} else {
|
|
561
|
+
if (sorted) {
|
|
562
|
+
result = result.slice()
|
|
563
|
+
sorted = false
|
|
564
|
+
}
|
|
565
|
+
for (let j = 0; j < locals.length; j++) result.push(locals[j])
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return result ? removeOverlap(sorted ? result : result.sort(byPos)) : none
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// Create a group for the given array of decoration sets, or return
|
|
572
|
+
// a single set when possible.
|
|
573
|
+
static from(members: readonly DecorationSource[]): DecorationSource {
|
|
574
|
+
switch (members.length) {
|
|
575
|
+
case 0: return empty
|
|
576
|
+
case 1: return members[0]
|
|
577
|
+
default: return new DecorationGroup(
|
|
578
|
+
members.every(m => m instanceof DecorationSet) ? members as DecorationSet[] :
|
|
579
|
+
members.reduce((r, m) => r.concat(m instanceof DecorationSet ? m : (m as DecorationGroup).members),
|
|
580
|
+
[] as DecorationSet[]))
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
forEachSet(f: (set: DecorationSet) => void) {
|
|
585
|
+
for (let i = 0; i < this.members.length; i++) this.members[i].forEachSet(f)
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
function mapChildren(
|
|
590
|
+
oldChildren: readonly (number | DecorationSet)[],
|
|
591
|
+
newLocal: Decoration[],
|
|
592
|
+
mapping: Mapping,
|
|
593
|
+
node: Node,
|
|
594
|
+
offset: number,
|
|
595
|
+
oldOffset: number,
|
|
596
|
+
options: {onRemove?: (decorationSpec: any) => void}
|
|
597
|
+
) {
|
|
598
|
+
let children = oldChildren.slice() as (number | DecorationSet)[]
|
|
599
|
+
|
|
600
|
+
// Mark the children that are directly touched by changes, and
|
|
601
|
+
// move those that are after the changes.
|
|
602
|
+
for (let i = 0, baseOffset = oldOffset; i < mapping.maps.length; i++) {
|
|
603
|
+
let moved = 0
|
|
604
|
+
mapping.maps[i].forEach((oldStart: number, oldEnd: number, newStart: number, newEnd: number) => {
|
|
605
|
+
let dSize = (newEnd - newStart) - (oldEnd - oldStart)
|
|
606
|
+
for (let i = 0; i < children.length; i += 3) {
|
|
607
|
+
let end = children[i + 1] as number
|
|
608
|
+
if (end < 0 || oldStart > end + baseOffset - moved) continue
|
|
609
|
+
let start = (children[i] as number) + baseOffset - moved
|
|
610
|
+
if (oldEnd >= start) {
|
|
611
|
+
children[i + 1] = oldStart <= start ? -2 : -1
|
|
612
|
+
} else if (oldStart >= baseOffset && dSize) {
|
|
613
|
+
;(children[i] as number) += dSize
|
|
614
|
+
;(children[i + 1] as number) += dSize
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
moved += dSize
|
|
618
|
+
})
|
|
619
|
+
baseOffset = mapping.maps[i].map(baseOffset, -1)
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
// Find the child nodes that still correspond to a single node,
|
|
623
|
+
// recursively call mapInner on them and update their positions.
|
|
624
|
+
let mustRebuild = false
|
|
625
|
+
for (let i = 0; i < children.length; i += 3) if ((children[i + 1] as number) < 0) { // Touched nodes
|
|
626
|
+
if (children[i + 1] == -2) {
|
|
627
|
+
mustRebuild = true
|
|
628
|
+
children[i + 1] = -1
|
|
629
|
+
continue
|
|
630
|
+
}
|
|
631
|
+
let from = mapping.map((oldChildren[i] as number) + oldOffset), fromLocal = from - offset
|
|
632
|
+
if (fromLocal < 0 || fromLocal >= node.content.size) {
|
|
633
|
+
mustRebuild = true
|
|
634
|
+
continue
|
|
635
|
+
}
|
|
636
|
+
// Must read oldChildren because children was tagged with -1
|
|
637
|
+
let to = mapping.map((oldChildren[i + 1] as number) + oldOffset, -1), toLocal = to - offset
|
|
638
|
+
let {index, offset: childOffset} = node.content.findIndex(fromLocal)
|
|
639
|
+
let childNode = node.maybeChild(index)
|
|
640
|
+
if (childNode && childOffset == fromLocal && childOffset + childNode.nodeSize == toLocal) {
|
|
641
|
+
let mapped = (children[i + 2] as DecorationSet)
|
|
642
|
+
.mapInner(mapping, childNode, from + 1, (oldChildren[i] as number) + oldOffset + 1, options)
|
|
643
|
+
if (mapped != empty) {
|
|
644
|
+
children[i] = fromLocal
|
|
645
|
+
children[i + 1] = toLocal
|
|
646
|
+
children[i + 2] = mapped
|
|
647
|
+
} else {
|
|
648
|
+
children[i + 1] = -2
|
|
649
|
+
mustRebuild = true
|
|
650
|
+
}
|
|
651
|
+
} else {
|
|
652
|
+
mustRebuild = true
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
// Remaining children must be collected and rebuilt into the appropriate structure
|
|
657
|
+
if (mustRebuild) {
|
|
658
|
+
let decorations = mapAndGatherRemainingDecorations(children, oldChildren, newLocal, mapping,
|
|
659
|
+
offset, oldOffset, options)
|
|
660
|
+
let built = buildTree(decorations, node, 0, options)
|
|
661
|
+
newLocal = built.local as Decoration[]
|
|
662
|
+
for (let i = 0; i < children.length; i += 3) if ((children[i + 1] as number) < 0) {
|
|
663
|
+
children.splice(i, 3)
|
|
664
|
+
i -= 3
|
|
665
|
+
}
|
|
666
|
+
for (let i = 0, j = 0; i < built.children.length; i += 3) {
|
|
667
|
+
let from = built.children[i]
|
|
668
|
+
while (j < children.length && children[j] < from) j += 3
|
|
669
|
+
children.splice(j, 0, built.children[i], built.children[i + 1], built.children[i + 2])
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
return new DecorationSet(newLocal.sort(byPos), children)
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
function moveSpans(spans: Decoration[], offset: number) {
|
|
677
|
+
if (!offset || !spans.length) return spans
|
|
678
|
+
let result = []
|
|
679
|
+
for (let i = 0; i < spans.length; i++) {
|
|
680
|
+
let span = spans[i]
|
|
681
|
+
result.push(new Decoration(span.from + offset, span.to + offset, span.type))
|
|
682
|
+
}
|
|
683
|
+
return result
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
function mapAndGatherRemainingDecorations(
|
|
687
|
+
children: (number | DecorationSet)[],
|
|
688
|
+
oldChildren: readonly (number | DecorationSet)[],
|
|
689
|
+
decorations: Decoration[],
|
|
690
|
+
mapping: Mapping,
|
|
691
|
+
offset: number,
|
|
692
|
+
oldOffset: number,
|
|
693
|
+
options: {onRemove?: (decorationSpec: any) => void}
|
|
694
|
+
) {
|
|
695
|
+
// Gather all decorations from the remaining marked children
|
|
696
|
+
function gather(set: DecorationSet, oldOffset: number) {
|
|
697
|
+
for (let i = 0; i < set.local.length; i++) {
|
|
698
|
+
let mapped = set.local[i].map(mapping, offset, oldOffset)
|
|
699
|
+
if (mapped) decorations.push(mapped)
|
|
700
|
+
else if (options.onRemove) options.onRemove(set.local[i].spec)
|
|
701
|
+
}
|
|
702
|
+
for (let i = 0; i < set.children.length; i += 3)
|
|
703
|
+
gather(set.children[i + 2] as DecorationSet, set.children[i] as number + oldOffset + 1)
|
|
704
|
+
}
|
|
705
|
+
for (let i = 0; i < children.length; i += 3) if (children[i + 1] == -1)
|
|
706
|
+
gather(children[i + 2] as DecorationSet, oldChildren[i] as number + oldOffset + 1)
|
|
707
|
+
|
|
708
|
+
return decorations
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
function takeSpansForNode(spans: (Decoration | null)[], node: Node, offset: number): Decoration[] | null {
|
|
712
|
+
if (node.isLeaf) return null
|
|
713
|
+
let end = offset + node.nodeSize, found = null
|
|
714
|
+
for (let i = 0, span; i < spans.length; i++) {
|
|
715
|
+
if ((span = spans[i]) && span.from > offset && span.to < end) {
|
|
716
|
+
;(found || (found = [])).push(span)
|
|
717
|
+
spans[i] = null
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
return found
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
function withoutNulls<T>(array: readonly (T | null)[]): T[] {
|
|
724
|
+
let result: T[] = []
|
|
725
|
+
for (let i = 0; i < array.length; i++)
|
|
726
|
+
if (array[i] != null) result.push(array[i]!)
|
|
727
|
+
return result
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
// Build up a tree that corresponds to a set of decorations. `offset`
|
|
731
|
+
// is a base offset that should be subtracted from the `from` and `to`
|
|
732
|
+
// positions in the spans (so that we don't have to allocate new spans
|
|
733
|
+
// for recursive calls).
|
|
734
|
+
function buildTree(
|
|
735
|
+
spans: Decoration[],
|
|
736
|
+
node: Node,
|
|
737
|
+
offset: number,
|
|
738
|
+
options: {onRemove?: (decorationSpec: any) => void}
|
|
739
|
+
) {
|
|
740
|
+
let children: (DecorationSet | number)[] = [], hasNulls = false
|
|
741
|
+
node.forEach((childNode, localStart) => {
|
|
742
|
+
let found = takeSpansForNode(spans, childNode, localStart + offset)
|
|
743
|
+
if (found) {
|
|
744
|
+
hasNulls = true
|
|
745
|
+
let subtree = buildTree(found, childNode, offset + localStart + 1, options)
|
|
746
|
+
if (subtree != empty)
|
|
747
|
+
children.push(localStart, localStart + childNode.nodeSize, subtree)
|
|
748
|
+
}
|
|
749
|
+
})
|
|
750
|
+
let locals = moveSpans(hasNulls ? withoutNulls(spans) : spans, -offset).sort(byPos)
|
|
751
|
+
if (locals.length) {
|
|
752
|
+
let cur = new FragmentCursor(node.content)
|
|
753
|
+
for (let i = 0; i < locals.length; i++) if (!locals[i].type.valid(node, locals[i], cur)) {
|
|
754
|
+
if (options.onRemove) options.onRemove(locals[i].spec)
|
|
755
|
+
locals.splice(i--, 1)
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
return locals.length || children.length ? new DecorationSet(locals, children) : empty
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
// Used to sort decorations so that ones with a low start position
|
|
762
|
+
// come first, and within a set with the same start position, those
|
|
763
|
+
// with an smaller end position come first.
|
|
764
|
+
function byPos(a: Decoration, b: Decoration) {
|
|
765
|
+
return a.from - b.from || a.to - b.to
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// Scan a sorted array of decorations for partially overlapping spans,
|
|
769
|
+
// and split those so that only fully overlapping spans are left (to
|
|
770
|
+
// make subsequent rendering easier). Will return the input array if
|
|
771
|
+
// no partially overlapping spans are found (the common case).
|
|
772
|
+
function removeOverlap(spans: readonly Decoration[]): Decoration[] {
|
|
773
|
+
let working: Decoration[] = spans as Decoration[]
|
|
774
|
+
for (let i = 0; i < working.length - 1; i++) {
|
|
775
|
+
let span = working[i]
|
|
776
|
+
if (span.from != span.to) for (let j = i + 1; j < working.length; j++) {
|
|
777
|
+
let next = working[j]
|
|
778
|
+
if (next.from == span.from) {
|
|
779
|
+
if (next.to != span.to) {
|
|
780
|
+
if (working == spans) working = spans.slice()
|
|
781
|
+
// Followed by a partially overlapping larger span. Split that
|
|
782
|
+
// span.
|
|
783
|
+
working[j] = next.copy(next.from, span.to)
|
|
784
|
+
insertAhead(working, j + 1, next.copy(span.to, next.to))
|
|
785
|
+
}
|
|
786
|
+
continue
|
|
787
|
+
} else {
|
|
788
|
+
if (next.from < span.to) {
|
|
789
|
+
if (working == spans) working = spans.slice()
|
|
790
|
+
// The end of this one overlaps with a subsequent span. Split
|
|
791
|
+
// this one.
|
|
792
|
+
working[i] = span.copy(span.from, next.from)
|
|
793
|
+
insertAhead(working, j, span.copy(next.from, span.to))
|
|
794
|
+
}
|
|
795
|
+
break
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
return working
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
function insertAhead(array: Decoration[], i: number, deco: Decoration) {
|
|
803
|
+
while (i < array.length && byPos(deco, array[i]) > 0) i++
|
|
804
|
+
array.splice(i, 0, deco)
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
// Get the decorations associated with the current props of a view.
|
|
808
|
+
export function viewDecorations(view: EditorView): DecorationSource {
|
|
809
|
+
let found: DecorationSource[] = []
|
|
810
|
+
view.someProp("decorations", f => {
|
|
811
|
+
let result = f(view.state)
|
|
812
|
+
if (result && result != empty) found.push(result)
|
|
813
|
+
})
|
|
814
|
+
if (view.cursorWrapper)
|
|
815
|
+
found.push(DecorationSet.create(view.state.doc, [view.cursorWrapper.deco]))
|
|
816
|
+
return DecorationGroup.from(found)
|
|
817
|
+
}
|