@ecomcx/ecomweb-editor 1.17.0 → 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/Editor.tsx +8 -7
- package/src/boundary.tsx +17 -0
- package/src/dynamic.tsx +57 -1
- package/src/editor.css +11 -0
- package/src/handle.tsx +3 -1
- package/src/index.ts +1 -1
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import RopeSequence from "rope-sequence"
|
|
2
|
+
import {Mapping, Step, StepMap, Transform} from "prosemirror-transform"
|
|
3
|
+
import {Plugin, Command, PluginKey, EditorState, Transaction, SelectionBookmark} from "prosemirror-state"
|
|
4
|
+
|
|
5
|
+
// ProseMirror's history isn't simply a way to roll back to a previous
|
|
6
|
+
// state, because ProseMirror supports applying changes without adding
|
|
7
|
+
// them to the history (for example during collaboration).
|
|
8
|
+
//
|
|
9
|
+
// To this end, each 'Branch' (one for the undo history and one for
|
|
10
|
+
// the redo history) keeps an array of 'Items', which can optionally
|
|
11
|
+
// hold a step (an actual undoable change), and always hold a position
|
|
12
|
+
// map (which is needed to move changes below them to apply to the
|
|
13
|
+
// current document).
|
|
14
|
+
//
|
|
15
|
+
// An item that has both a step and a selection bookmark is the start
|
|
16
|
+
// of an 'event' — a group of changes that will be undone or redone at
|
|
17
|
+
// once. (It stores only the bookmark, since that way we don't have to
|
|
18
|
+
// provide a document until the selection is actually applied, which
|
|
19
|
+
// is useful when compressing.)
|
|
20
|
+
|
|
21
|
+
// Used to schedule history compression
|
|
22
|
+
const max_empty_items = 500
|
|
23
|
+
|
|
24
|
+
class Branch {
|
|
25
|
+
constructor(readonly items: RopeSequence<Item>, readonly eventCount: number) {}
|
|
26
|
+
|
|
27
|
+
// Pop the latest event off the branch's history and apply it
|
|
28
|
+
// to a document transform.
|
|
29
|
+
popEvent(state: EditorState, preserveItems: boolean) {
|
|
30
|
+
if (this.eventCount == 0) return null
|
|
31
|
+
|
|
32
|
+
let end = this.items.length
|
|
33
|
+
for (;; end--) {
|
|
34
|
+
let next = this.items.get(end - 1)
|
|
35
|
+
if (next.selection) { --end; break }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
let remap: Mapping | undefined, mapFrom: number | undefined
|
|
39
|
+
if (preserveItems) {
|
|
40
|
+
remap = this.remapping(end, this.items.length)
|
|
41
|
+
mapFrom = remap.maps.length
|
|
42
|
+
}
|
|
43
|
+
let transform = state.tr
|
|
44
|
+
let selection: SelectionBookmark | undefined, remaining: Branch | undefined
|
|
45
|
+
let addAfter: Item[] = [], addBefore: Item[] = []
|
|
46
|
+
|
|
47
|
+
this.items.forEach((item, i) => {
|
|
48
|
+
if (!item.step) {
|
|
49
|
+
if (!remap) {
|
|
50
|
+
remap = this.remapping(end, i + 1)
|
|
51
|
+
mapFrom = remap.maps.length
|
|
52
|
+
}
|
|
53
|
+
mapFrom!--
|
|
54
|
+
addBefore.push(item)
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (remap) {
|
|
59
|
+
addBefore.push(new Item(item.map))
|
|
60
|
+
let step = item.step.map(remap.slice(mapFrom)), map
|
|
61
|
+
|
|
62
|
+
if (step && transform.maybeStep(step).doc) {
|
|
63
|
+
map = transform.mapping.maps[transform.mapping.maps.length - 1]
|
|
64
|
+
addAfter.push(new Item(map, undefined, undefined, addAfter.length + addBefore.length))
|
|
65
|
+
}
|
|
66
|
+
mapFrom!--
|
|
67
|
+
if (map) remap.appendMap(map, mapFrom)
|
|
68
|
+
} else {
|
|
69
|
+
transform.maybeStep(item.step)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (item.selection) {
|
|
73
|
+
selection = remap ? item.selection.map(remap.slice(mapFrom)) : item.selection
|
|
74
|
+
remaining = new Branch(this.items.slice(0, end).append(addBefore.reverse().concat(addAfter)), this.eventCount - 1)
|
|
75
|
+
return false
|
|
76
|
+
}
|
|
77
|
+
}, this.items.length, 0)
|
|
78
|
+
|
|
79
|
+
return {remaining: remaining!, transform, selection: selection!}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Create a new branch with the given transform added.
|
|
83
|
+
addTransform(transform: Transform, selection: SelectionBookmark | undefined,
|
|
84
|
+
histOptions: Required<HistoryOptions>, preserveItems: boolean) {
|
|
85
|
+
let newItems = [], eventCount = this.eventCount
|
|
86
|
+
let oldItems = this.items, lastItem = !preserveItems && oldItems.length ? oldItems.get(oldItems.length - 1) : null
|
|
87
|
+
|
|
88
|
+
for (let i = 0; i < transform.steps.length; i++) {
|
|
89
|
+
let step = transform.steps[i].invert(transform.docs[i])
|
|
90
|
+
let item = new Item(transform.mapping.maps[i], step, selection), merged
|
|
91
|
+
if (merged = lastItem && lastItem.merge(item)) {
|
|
92
|
+
item = merged
|
|
93
|
+
if (i) newItems.pop()
|
|
94
|
+
else oldItems = oldItems.slice(0, oldItems.length - 1)
|
|
95
|
+
}
|
|
96
|
+
newItems.push(item)
|
|
97
|
+
if (selection) {
|
|
98
|
+
eventCount++
|
|
99
|
+
selection = undefined
|
|
100
|
+
}
|
|
101
|
+
if (!preserveItems) lastItem = item
|
|
102
|
+
}
|
|
103
|
+
let overflow = eventCount - histOptions.depth
|
|
104
|
+
if (overflow > DEPTH_OVERFLOW) {
|
|
105
|
+
oldItems = cutOffEvents(oldItems, overflow)
|
|
106
|
+
eventCount -= overflow
|
|
107
|
+
}
|
|
108
|
+
return new Branch(oldItems.append(newItems), eventCount)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
remapping(from: number, to: number): Mapping {
|
|
112
|
+
let maps = new Mapping
|
|
113
|
+
this.items.forEach((item, i) => {
|
|
114
|
+
let mirrorPos = item.mirrorOffset != null && i - item.mirrorOffset >= from
|
|
115
|
+
? maps.maps.length - item.mirrorOffset : undefined
|
|
116
|
+
maps.appendMap(item.map, mirrorPos)
|
|
117
|
+
}, from, to)
|
|
118
|
+
return maps
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
addMaps(array: readonly StepMap[]) {
|
|
122
|
+
if (this.eventCount == 0) return this
|
|
123
|
+
return new Branch(this.items.append(array.map(map => new Item(map))), this.eventCount)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// When the collab module receives remote changes, the history has
|
|
127
|
+
// to know about those, so that it can adjust the steps that were
|
|
128
|
+
// rebased on top of the remote changes, and include the position
|
|
129
|
+
// maps for the remote changes in its array of items.
|
|
130
|
+
rebased(rebasedTransform: Transform, rebasedCount: number) {
|
|
131
|
+
if (!this.eventCount) return this
|
|
132
|
+
|
|
133
|
+
rebasedCount = Math.min(this.items.length, rebasedCount)
|
|
134
|
+
let rebasedItems: Item[] = [], start = this.items.length - rebasedCount
|
|
135
|
+
|
|
136
|
+
let mapping = rebasedTransform.mapping
|
|
137
|
+
let newUntil = rebasedTransform.steps.length
|
|
138
|
+
let eventCount = this.eventCount
|
|
139
|
+
this.items.forEach(item => { if (item.selection) eventCount-- }, start)
|
|
140
|
+
|
|
141
|
+
let iRebased = rebasedCount
|
|
142
|
+
this.items.forEach(item => {
|
|
143
|
+
let pos = mapping.getMirror(--iRebased)
|
|
144
|
+
if (pos == null) return
|
|
145
|
+
newUntil = Math.min(newUntil, pos)
|
|
146
|
+
let map = mapping.maps[pos]
|
|
147
|
+
if (item.step) {
|
|
148
|
+
let step = rebasedTransform.steps[pos].invert(rebasedTransform.docs[pos])
|
|
149
|
+
let selection = item.selection && item.selection.map(mapping.slice(iRebased + 1, pos))
|
|
150
|
+
if (selection) eventCount++
|
|
151
|
+
rebasedItems.push(new Item(map, step, selection))
|
|
152
|
+
} else {
|
|
153
|
+
rebasedItems.push(new Item(map))
|
|
154
|
+
}
|
|
155
|
+
}, start)
|
|
156
|
+
|
|
157
|
+
let newMaps = []
|
|
158
|
+
for (let i = rebasedCount; i < newUntil; i++)
|
|
159
|
+
newMaps.push(new Item(mapping.maps[i]))
|
|
160
|
+
let items = this.items.slice(0, start).append(newMaps).append(rebasedItems)
|
|
161
|
+
let branch = new Branch(items, eventCount)
|
|
162
|
+
|
|
163
|
+
if (branch.emptyItemCount() > max_empty_items)
|
|
164
|
+
branch = branch.compress(this.items.length - rebasedItems.length)
|
|
165
|
+
return branch
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
emptyItemCount() {
|
|
169
|
+
let count = 0
|
|
170
|
+
this.items.forEach(item => { if (!item.step) count++ })
|
|
171
|
+
return count
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Compressing a branch means rewriting it to push the air (map-only
|
|
175
|
+
// items) out. During collaboration, these naturally accumulate
|
|
176
|
+
// because each remote change adds one. The `upto` argument is used
|
|
177
|
+
// to ensure that only the items below a given level are compressed,
|
|
178
|
+
// because `rebased` relies on a clean, untouched set of items in
|
|
179
|
+
// order to associate old items with rebased steps.
|
|
180
|
+
compress(upto = this.items.length) {
|
|
181
|
+
let remap = this.remapping(0, upto), mapFrom = remap.maps.length
|
|
182
|
+
let items: Item[] = [], events = 0
|
|
183
|
+
this.items.forEach((item, i) => {
|
|
184
|
+
if (i >= upto) {
|
|
185
|
+
items.push(item)
|
|
186
|
+
if (item.selection) events++
|
|
187
|
+
} else if (item.step) {
|
|
188
|
+
let step = item.step.map(remap.slice(mapFrom)), map = step && step.getMap()
|
|
189
|
+
mapFrom--
|
|
190
|
+
if (map) remap.appendMap(map, mapFrom)
|
|
191
|
+
if (step) {
|
|
192
|
+
let selection = item.selection && item.selection.map(remap.slice(mapFrom))
|
|
193
|
+
if (selection) events++
|
|
194
|
+
let newItem = new Item(map!.invert(), step, selection), merged, last = items.length - 1
|
|
195
|
+
if (merged = items.length && items[last].merge(newItem))
|
|
196
|
+
items[last] = merged
|
|
197
|
+
else
|
|
198
|
+
items.push(newItem)
|
|
199
|
+
}
|
|
200
|
+
} else if (item.map) {
|
|
201
|
+
mapFrom--
|
|
202
|
+
}
|
|
203
|
+
}, this.items.length, 0)
|
|
204
|
+
return new Branch(RopeSequence.from(items.reverse()), events)
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
static empty = new Branch(RopeSequence.empty, 0)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function cutOffEvents(items: RopeSequence<Item>, n: number) {
|
|
211
|
+
let cutPoint: number | undefined
|
|
212
|
+
items.forEach((item, i) => {
|
|
213
|
+
if (item.selection && (n-- == 0)) {
|
|
214
|
+
cutPoint = i
|
|
215
|
+
return false
|
|
216
|
+
}
|
|
217
|
+
})
|
|
218
|
+
return items.slice(cutPoint!)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
class Item {
|
|
222
|
+
constructor(
|
|
223
|
+
// The (forward) step map for this item.
|
|
224
|
+
readonly map: StepMap,
|
|
225
|
+
// The inverted step
|
|
226
|
+
readonly step?: Step,
|
|
227
|
+
// If this is non-null, this item is the start of a group, and
|
|
228
|
+
// this selection is the starting selection for the group (the one
|
|
229
|
+
// that was active before the first step was applied)
|
|
230
|
+
readonly selection?: SelectionBookmark,
|
|
231
|
+
// If this item is the inverse of a previous mapping on the stack,
|
|
232
|
+
// this points at the inverse's offset
|
|
233
|
+
readonly mirrorOffset?: number
|
|
234
|
+
) {}
|
|
235
|
+
|
|
236
|
+
merge(other: Item) {
|
|
237
|
+
if (this.step && other.step && !other.selection) {
|
|
238
|
+
let step = other.step.merge(this.step)
|
|
239
|
+
if (step) return new Item(step.getMap().invert(), step, this.selection)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// The value of the state field that tracks undo/redo history for that
|
|
245
|
+
// state. Will be stored in the plugin state when the history plugin
|
|
246
|
+
// is active.
|
|
247
|
+
class HistoryState {
|
|
248
|
+
constructor(
|
|
249
|
+
readonly done: Branch,
|
|
250
|
+
readonly undone: Branch,
|
|
251
|
+
readonly prevRanges: readonly number[] | null,
|
|
252
|
+
readonly prevTime: number,
|
|
253
|
+
readonly prevComposition: number
|
|
254
|
+
) {}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const DEPTH_OVERFLOW = 20
|
|
258
|
+
|
|
259
|
+
// Record a transformation in undo history.
|
|
260
|
+
function applyTransaction(history: HistoryState, state: EditorState, tr: Transaction, options: Required<HistoryOptions>) {
|
|
261
|
+
let historyTr = tr.getMeta(historyKey), rebased
|
|
262
|
+
if (historyTr) return historyTr.historyState
|
|
263
|
+
|
|
264
|
+
if (tr.getMeta(closeHistoryKey)) history = new HistoryState(history.done, history.undone, null, 0, -1)
|
|
265
|
+
|
|
266
|
+
let appended = tr.getMeta("appendedTransaction")
|
|
267
|
+
|
|
268
|
+
if (tr.steps.length == 0) {
|
|
269
|
+
return history
|
|
270
|
+
} else if (appended && appended.getMeta(historyKey)) {
|
|
271
|
+
if (appended.getMeta(historyKey).redo)
|
|
272
|
+
return new HistoryState(history.done.addTransform(tr, undefined, options, mustPreserveItems(state)),
|
|
273
|
+
history.undone, rangesFor(tr.mapping.maps),
|
|
274
|
+
history.prevTime, history.prevComposition)
|
|
275
|
+
else
|
|
276
|
+
return new HistoryState(history.done, history.undone.addTransform(tr, undefined, options, mustPreserveItems(state)),
|
|
277
|
+
null, history.prevTime, history.prevComposition)
|
|
278
|
+
} else if (tr.getMeta("addToHistory") !== false && !(appended && appended.getMeta("addToHistory") === false)) {
|
|
279
|
+
// Group transforms that occur in quick succession into one event.
|
|
280
|
+
let composition = tr.getMeta("composition")
|
|
281
|
+
let newGroup = history.prevTime == 0 ||
|
|
282
|
+
(!appended && history.prevComposition != composition &&
|
|
283
|
+
(history.prevTime < (tr.time || 0) - options.newGroupDelay || !isAdjacentTo(tr, history.prevRanges!)))
|
|
284
|
+
let prevRanges = appended ? mapRanges(history.prevRanges!, tr.mapping) : rangesFor(tr.mapping.maps)
|
|
285
|
+
return new HistoryState(history.done.addTransform(tr, newGroup ? state.selection.getBookmark() : undefined,
|
|
286
|
+
options, mustPreserveItems(state)),
|
|
287
|
+
Branch.empty, prevRanges, tr.time, composition == null ? history.prevComposition : composition)
|
|
288
|
+
} else if (rebased = tr.getMeta("rebased")) {
|
|
289
|
+
// Used by the collab module to tell the history that some of its
|
|
290
|
+
// content has been rebased.
|
|
291
|
+
return new HistoryState(history.done.rebased(tr, rebased),
|
|
292
|
+
history.undone.rebased(tr, rebased),
|
|
293
|
+
mapRanges(history.prevRanges!, tr.mapping), history.prevTime, history.prevComposition)
|
|
294
|
+
} else {
|
|
295
|
+
return new HistoryState(history.done.addMaps(tr.mapping.maps),
|
|
296
|
+
history.undone.addMaps(tr.mapping.maps),
|
|
297
|
+
mapRanges(history.prevRanges!, tr.mapping), history.prevTime, history.prevComposition)
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
function isAdjacentTo(transform: Transform, prevRanges: readonly number[]) {
|
|
302
|
+
if (!prevRanges) return false
|
|
303
|
+
if (!transform.docChanged) return true
|
|
304
|
+
let adjacent = false
|
|
305
|
+
transform.mapping.maps[0].forEach((start, end) => {
|
|
306
|
+
for (let i = 0; i < prevRanges.length; i += 2)
|
|
307
|
+
if (start <= prevRanges[i + 1] && end >= prevRanges[i])
|
|
308
|
+
adjacent = true
|
|
309
|
+
})
|
|
310
|
+
return adjacent
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function rangesFor(maps: readonly StepMap[]) {
|
|
314
|
+
let result: number[] = []
|
|
315
|
+
for (let i = maps.length - 1; i >= 0 && result.length == 0; i--)
|
|
316
|
+
maps[i].forEach((_from, _to, from, to) => result.push(from, to))
|
|
317
|
+
return result
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function mapRanges(ranges: readonly number[], mapping: Mapping) {
|
|
321
|
+
if (!ranges) return null
|
|
322
|
+
let result = []
|
|
323
|
+
for (let i = 0; i < ranges.length; i += 2) {
|
|
324
|
+
let from = mapping.map(ranges[i], 1), to = mapping.map(ranges[i + 1], -1)
|
|
325
|
+
if (from <= to) result.push(from, to)
|
|
326
|
+
}
|
|
327
|
+
return result
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Apply the latest event from one branch to the document and shift the event
|
|
331
|
+
// onto the other branch.
|
|
332
|
+
function histTransaction(history: HistoryState, state: EditorState, redo: boolean): Transaction | null {
|
|
333
|
+
let preserveItems = mustPreserveItems(state)
|
|
334
|
+
let histOptions = (historyKey.get(state)!.spec as any).config as Required<HistoryOptions>
|
|
335
|
+
let pop = (redo ? history.undone : history.done).popEvent(state, preserveItems)
|
|
336
|
+
if (!pop) return null
|
|
337
|
+
|
|
338
|
+
let selection = pop.selection!.resolve(pop.transform.doc)
|
|
339
|
+
let added = (redo ? history.done : history.undone).addTransform(pop.transform, state.selection.getBookmark(),
|
|
340
|
+
histOptions, preserveItems)
|
|
341
|
+
|
|
342
|
+
let newHist = new HistoryState(redo ? added : pop.remaining, redo ? pop.remaining : added, null, 0, -1)
|
|
343
|
+
return pop.transform.setSelection(selection).setMeta(historyKey, {redo, historyState: newHist})
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
let cachedPreserveItems = false, cachedPreserveItemsPlugins: readonly Plugin[] | null = null
|
|
347
|
+
// Check whether any plugin in the given state has a
|
|
348
|
+
// `historyPreserveItems` property in its spec, in which case we must
|
|
349
|
+
// preserve steps exactly as they came in, so that they can be
|
|
350
|
+
// rebased.
|
|
351
|
+
function mustPreserveItems(state: EditorState) {
|
|
352
|
+
let plugins = state.plugins
|
|
353
|
+
if (cachedPreserveItemsPlugins != plugins) {
|
|
354
|
+
cachedPreserveItems = false
|
|
355
|
+
cachedPreserveItemsPlugins = plugins
|
|
356
|
+
for (let i = 0; i < plugins.length; i++) if ((plugins[i].spec as any).historyPreserveItems) {
|
|
357
|
+
cachedPreserveItems = true
|
|
358
|
+
break
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return cachedPreserveItems
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/// Set a flag on the given transaction that will prevent further steps
|
|
365
|
+
/// from being appended to an existing history event (so that they
|
|
366
|
+
/// require a separate undo command to undo).
|
|
367
|
+
export function closeHistory(tr: Transaction) {
|
|
368
|
+
return tr.setMeta(closeHistoryKey, true)
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const historyKey = new PluginKey("history")
|
|
372
|
+
const closeHistoryKey = new PluginKey("closeHistory")
|
|
373
|
+
|
|
374
|
+
interface HistoryOptions {
|
|
375
|
+
/// The amount of history events that are collected before the
|
|
376
|
+
/// oldest events are discarded. Defaults to 100.
|
|
377
|
+
depth?: number
|
|
378
|
+
|
|
379
|
+
/// The delay between changes after which a new group should be
|
|
380
|
+
/// started. Defaults to 500 (milliseconds). Note that when changes
|
|
381
|
+
/// aren't adjacent, a new group is always started.
|
|
382
|
+
newGroupDelay?: number
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/// Returns a plugin that enables the undo history for an editor. The
|
|
386
|
+
/// plugin will track undo and redo stacks, which can be used with the
|
|
387
|
+
/// [`undo`](#history.undo) and [`redo`](#history.redo) commands.
|
|
388
|
+
///
|
|
389
|
+
/// You can set an `"addToHistory"` [metadata
|
|
390
|
+
/// property](#state.Transaction.setMeta) of `false` on a transaction
|
|
391
|
+
/// to prevent it from being rolled back by undo.
|
|
392
|
+
export function history(config: HistoryOptions = {}): Plugin {
|
|
393
|
+
config = {depth: config.depth || 100,
|
|
394
|
+
newGroupDelay: config.newGroupDelay || 500}
|
|
395
|
+
|
|
396
|
+
return new Plugin({
|
|
397
|
+
key: historyKey,
|
|
398
|
+
|
|
399
|
+
state: {
|
|
400
|
+
init() {
|
|
401
|
+
return new HistoryState(Branch.empty, Branch.empty, null, 0, -1)
|
|
402
|
+
},
|
|
403
|
+
apply(tr, hist, state) {
|
|
404
|
+
return applyTransaction(hist, state, tr, config as Required<HistoryOptions>)
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
config,
|
|
409
|
+
|
|
410
|
+
props: {
|
|
411
|
+
handleDOMEvents: {
|
|
412
|
+
beforeinput(view, e: Event) {
|
|
413
|
+
let inputType = (e as InputEvent).inputType
|
|
414
|
+
let command = inputType == "historyUndo" ? undo : inputType == "historyRedo" ? redo : null
|
|
415
|
+
if (!command || !view.editable) return false
|
|
416
|
+
e.preventDefault()
|
|
417
|
+
return command(view.state, view.dispatch)
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
})
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
function buildCommand(redo: boolean, scroll: boolean): Command {
|
|
425
|
+
return (state, dispatch) => {
|
|
426
|
+
let hist = historyKey.getState(state)
|
|
427
|
+
if (!hist || (redo ? hist.undone : hist.done).eventCount == 0) return false
|
|
428
|
+
if (dispatch) {
|
|
429
|
+
let tr = histTransaction(hist, state, redo)
|
|
430
|
+
if (tr) dispatch(scroll ? tr.scrollIntoView() : tr)
|
|
431
|
+
}
|
|
432
|
+
return true
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/// A command function that undoes the last change, if any.
|
|
437
|
+
export const undo = buildCommand(false, true)
|
|
438
|
+
|
|
439
|
+
/// A command function that redoes the last undone change, if any.
|
|
440
|
+
export const redo = buildCommand(true, true)
|
|
441
|
+
|
|
442
|
+
/// A command function that undoes the last change. Don't scroll the
|
|
443
|
+
/// selection into view.
|
|
444
|
+
export const undoNoScroll = buildCommand(false, false)
|
|
445
|
+
|
|
446
|
+
/// A command function that redoes the last undone change. Don't
|
|
447
|
+
/// scroll the selection into view.
|
|
448
|
+
export const redoNoScroll = buildCommand(true, false)
|
|
449
|
+
|
|
450
|
+
/// The amount of undoable events available in a given state.
|
|
451
|
+
export function undoDepth(state: EditorState) {
|
|
452
|
+
let hist = historyKey.getState(state)
|
|
453
|
+
return hist ? hist.done.eventCount : 0
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/// The amount of redoable events available in a given editor state.
|
|
457
|
+
export function redoDepth(state: EditorState) {
|
|
458
|
+
let hist = historyKey.getState(state)
|
|
459
|
+
return hist ? hist.undone.eventCount : 0
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/// Returns true if the given transaction was generated by the history
|
|
463
|
+
/// plugin.
|
|
464
|
+
export function isHistoryTransaction(tr: Transaction) {
|
|
465
|
+
return tr.getMeta(historyKey) != null
|
|
466
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
This module defines a plugin for attaching _input rules_ to an editor,
|
|
2
|
+
which can react to or transform text typed by the user. It also comes
|
|
3
|
+
with a bunch of default rules that can be enabled in this plugin.
|
|
4
|
+
|
|
5
|
+
@InputRule
|
|
6
|
+
@inputRules
|
|
7
|
+
@undoInputRule
|
|
8
|
+
|
|
9
|
+
The module comes with a number of predefined rules:
|
|
10
|
+
|
|
11
|
+
@emDash
|
|
12
|
+
@ellipsis
|
|
13
|
+
@openDoubleQuote
|
|
14
|
+
@closeDoubleQuote
|
|
15
|
+
@openSingleQuote
|
|
16
|
+
@closeSingleQuote
|
|
17
|
+
@smartQuotes
|
|
18
|
+
|
|
19
|
+
These utility functions take schema-specific parameters and create
|
|
20
|
+
input rules specific to that schema.
|
|
21
|
+
|
|
22
|
+
@wrappingInputRule
|
|
23
|
+
@textblockTypeInputRule
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import {Plugin, Transaction, EditorState, TextSelection, Command} from "prosemirror-state"
|
|
2
|
+
import {EditorView} from "prosemirror-view"
|
|
3
|
+
|
|
4
|
+
/// Input rules are regular expressions describing a piece of text
|
|
5
|
+
/// that, when typed, causes something to happen. This might be
|
|
6
|
+
/// changing two dashes into an emdash, wrapping a paragraph starting
|
|
7
|
+
/// with `"> "` into a blockquote, or something entirely different.
|
|
8
|
+
export class InputRule {
|
|
9
|
+
/// @internal
|
|
10
|
+
handler: (state: EditorState, match: RegExpMatchArray, start: number, end: number) => Transaction | null
|
|
11
|
+
|
|
12
|
+
/// @internal
|
|
13
|
+
undoable: boolean
|
|
14
|
+
inCode: boolean | "only"
|
|
15
|
+
inCodeMark: boolean | "only"
|
|
16
|
+
|
|
17
|
+
/// Create an input rule. The rule applies when the user typed
|
|
18
|
+
/// something and the text directly in front of the cursor matches
|
|
19
|
+
/// `match`, which should end with `$`.
|
|
20
|
+
///
|
|
21
|
+
/// The `handler` can be a string, in which case the matched text, or
|
|
22
|
+
/// the first matched group in the regexp, is replaced by that
|
|
23
|
+
/// string.
|
|
24
|
+
///
|
|
25
|
+
/// Or a it can be a function, which will be called with the match
|
|
26
|
+
/// array produced by
|
|
27
|
+
/// [`RegExp.exec`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec),
|
|
28
|
+
/// as well as the start and end of the matched range, and which can
|
|
29
|
+
/// return a [transaction](#state.Transaction) that describes the
|
|
30
|
+
/// rule's effect, or null to indicate the input was not handled.
|
|
31
|
+
constructor(
|
|
32
|
+
/// @internal
|
|
33
|
+
readonly match: RegExp,
|
|
34
|
+
handler: string | ((state: EditorState, match: RegExpMatchArray, start: number, end: number) => Transaction | null),
|
|
35
|
+
options: {
|
|
36
|
+
/// When set to false,
|
|
37
|
+
/// [`undoInputRule`](#inputrules.undoInputRule) doesn't work on
|
|
38
|
+
/// this rule.
|
|
39
|
+
undoable?: boolean,
|
|
40
|
+
/// By default, input rules will not apply inside nodes marked
|
|
41
|
+
/// as [code](#model.NodeSpec.code). Set this to true to change
|
|
42
|
+
/// that, or to `"only"` to _only_ match in such nodes.
|
|
43
|
+
inCode?: boolean | "only"
|
|
44
|
+
/// When set to `false`, this rule will not fire inside marks
|
|
45
|
+
/// marked as [code](#model.MarkSpec.code). The default is
|
|
46
|
+
/// `true`.
|
|
47
|
+
inCodeMark?: boolean
|
|
48
|
+
} = {}
|
|
49
|
+
) {
|
|
50
|
+
this.match = match
|
|
51
|
+
this.handler = typeof handler == "string" ? stringHandler(handler) : handler
|
|
52
|
+
this.undoable = options.undoable !== false
|
|
53
|
+
this.inCode = options.inCode || false
|
|
54
|
+
this.inCodeMark = options.inCodeMark !== false
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function stringHandler(string: string) {
|
|
59
|
+
return function(state: EditorState, match: RegExpMatchArray, start: number, end: number) {
|
|
60
|
+
let insert = string
|
|
61
|
+
if (match[1]) {
|
|
62
|
+
let offset = match[0].lastIndexOf(match[1])
|
|
63
|
+
insert += match[0].slice(offset + match[1].length)
|
|
64
|
+
start += offset
|
|
65
|
+
let cutOff = start - end
|
|
66
|
+
if (cutOff > 0) {
|
|
67
|
+
insert = match[0].slice(offset - cutOff, offset) + insert
|
|
68
|
+
start = end
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return state.tr.insertText(insert, start, end)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const MAX_MATCH = 500
|
|
76
|
+
|
|
77
|
+
type PluginState = {transform: Transaction, from: number, to: number, text: string} | null
|
|
78
|
+
|
|
79
|
+
/// Create an input rules plugin. When enabled, it will cause text
|
|
80
|
+
/// input that matches any of the given rules to trigger the rule's
|
|
81
|
+
/// action.
|
|
82
|
+
export function inputRules({rules}: {rules: readonly InputRule[]}) {
|
|
83
|
+
let plugin: Plugin<PluginState> = new Plugin<PluginState>({
|
|
84
|
+
state: {
|
|
85
|
+
init() { return null },
|
|
86
|
+
apply(this: typeof plugin, tr, prev) {
|
|
87
|
+
let stored = tr.getMeta(this)
|
|
88
|
+
if (stored) return stored
|
|
89
|
+
return tr.selectionSet || tr.docChanged ? null : prev
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
props: {
|
|
94
|
+
handleTextInput(view, from, to, text) {
|
|
95
|
+
return run(view, from, to, text, rules, plugin)
|
|
96
|
+
},
|
|
97
|
+
handleDOMEvents: {
|
|
98
|
+
compositionend: (view) => {
|
|
99
|
+
setTimeout(() => {
|
|
100
|
+
let {$cursor} = view.state.selection as TextSelection
|
|
101
|
+
if ($cursor) run(view, $cursor.pos, $cursor.pos, "", rules, plugin)
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
isInputRules: true
|
|
108
|
+
})
|
|
109
|
+
return plugin
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function run(view: EditorView, from: number, to: number, text: string, rules: readonly InputRule[], plugin: Plugin) {
|
|
113
|
+
if (view.composing) return false
|
|
114
|
+
let state = view.state, $from = state.doc.resolve(from)
|
|
115
|
+
let textBefore = $from.parent.textBetween(Math.max(0, $from.parentOffset - MAX_MATCH), $from.parentOffset,
|
|
116
|
+
null, "\ufffc") + text
|
|
117
|
+
for (let i = 0; i < rules.length; i++) {
|
|
118
|
+
let rule = rules[i];
|
|
119
|
+
if (!rule.inCodeMark && $from.marks().some(m => m.type.spec.code)) continue
|
|
120
|
+
if ($from.parent.type.spec.code) {
|
|
121
|
+
if (!rule.inCode) continue
|
|
122
|
+
} else if (rule.inCode === "only") {
|
|
123
|
+
continue
|
|
124
|
+
}
|
|
125
|
+
let match = rule.match.exec(textBefore)
|
|
126
|
+
if (!match || match[0].length < text.length) continue
|
|
127
|
+
let startPos = from - (match[0].length - text.length)
|
|
128
|
+
if (!rule.inCodeMark) {
|
|
129
|
+
let hasMark = false
|
|
130
|
+
state.doc.nodesBetween(startPos, $from.pos, node => {
|
|
131
|
+
if (node.isInline && node.marks.some(m => m.type.spec.code)) hasMark = true
|
|
132
|
+
})
|
|
133
|
+
if (hasMark) continue
|
|
134
|
+
}
|
|
135
|
+
let tr = rule.handler(state, match, startPos, to)
|
|
136
|
+
if (!tr) continue
|
|
137
|
+
if (rule.undoable) tr.setMeta(plugin, {transform: tr, from, to, text})
|
|
138
|
+
view.dispatch(tr)
|
|
139
|
+
return true
|
|
140
|
+
}
|
|
141
|
+
return false
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/// This is a command that will undo an input rule, if applying such a
|
|
145
|
+
/// rule was the last thing that the user did.
|
|
146
|
+
export const undoInputRule: Command = (state, dispatch) => {
|
|
147
|
+
let plugins = state.plugins
|
|
148
|
+
for (let i = 0; i < plugins.length; i++) {
|
|
149
|
+
let plugin = plugins[i], undoable
|
|
150
|
+
if ((plugin.spec as any).isInputRules && (undoable = plugin.getState(state))) {
|
|
151
|
+
if (dispatch) {
|
|
152
|
+
let tr = state.tr, toUndo = undoable.transform
|
|
153
|
+
for (let j = toUndo.steps.length - 1; j >= 0; j--)
|
|
154
|
+
tr.step(toUndo.steps[j].invert(toUndo.docs[j]))
|
|
155
|
+
if (undoable.text) {
|
|
156
|
+
let marks = tr.doc.resolve(undoable.from).marks()
|
|
157
|
+
tr.replaceWith(undoable.from, undoable.to, state.schema.text(undoable.text, marks))
|
|
158
|
+
} else {
|
|
159
|
+
tr.delete(undoable.from, undoable.to)
|
|
160
|
+
}
|
|
161
|
+
dispatch(tr)
|
|
162
|
+
}
|
|
163
|
+
return true
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return false
|
|
167
|
+
}
|