@ecomcx/ecomweb-editor 1.17.1 → 1.19.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 +25 -7
- package/src/index.ts +26 -25
- package/src/{ask.tsx → legacy/ask.tsx} +2 -2
- package/src/{blockMeta.ts → legacy/block-meta.ts} +1 -1
- package/src/{blocks.tsx → legacy/blocks.tsx} +8 -32
- package/src/{content.ts → legacy/content.ts} +1 -1
- package/src/{handle.tsx → legacy/drag-handle.tsx} +3 -3
- package/src/{dynamic.tsx → legacy/dynamic.tsx} +64 -4
- package/src/{editor.css → legacy/editor.css} +11 -0
- package/src/{Editor.tsx → legacy/editor.tsx} +9 -9
- package/src/{extensions.ts → legacy/extensions.ts} +1 -1
- package/src/legacy/insert-pattern.ts +13 -0
- package/src/{inserter.tsx → legacy/inserter.tsx} +6 -5
- package/src/{inspector.tsx → legacy/inspector.tsx} +7 -7
- package/src/{layoutUi.tsx → legacy/layout-ui.tsx} +6 -5
- package/src/{layout.tsx → legacy/layout.tsx} +2 -2
- package/src/{media.ts → legacy/media.ts} +1 -1
- package/src/{nodes.tsx → legacy/nodes.tsx} +2 -2
- package/src/{outline.tsx → legacy/outline.tsx} +4 -4
- package/src/legacy/panels.ts +22 -0
- package/src/{rank.ts → legacy/rank.ts} +2 -2
- package/src/{registry.ts → legacy/registry.ts} +1 -1
- package/src/{handles.tsx → legacy/resize-handles.tsx} +1 -1
- package/src/{styleattr.ts → legacy/style-attr.ts} +15 -1
- package/src/{synced.tsx → legacy/synced.tsx} +2 -2
- package/src/{toolbar.tsx → legacy/toolbar.tsx} +7 -7
- package/src/{unknown.tsx → legacy/unknown.tsx} +1 -1
- package/src/shared/block-defs.ts +38 -0
- package/src/shared/color-swatch.tsx +19 -0
- package/src/{panels.ts → shared/panel-store.ts} +4 -21
- package/src/{patterns.ts → shared/patterns.ts} +0 -12
- package/src/{stylepanel.tsx → shared/style-panel.tsx} +2 -2
- package/src/{types.ts → shared/types.ts} +2 -0
- package/src/v2/blocks/compat.tsx +51 -0
- package/src/v2/blocks/index.ts +42 -0
- package/src/v2/blocks/layout.tsx +281 -0
- package/src/v2/blocks/media-actions.tsx +76 -0
- package/src/v2/blocks/media.tsx +234 -0
- package/src/v2/blocks/resize.tsx +111 -0
- package/src/v2/blocks/text.tsx +149 -0
- package/src/v2/blocks/theme.tsx +293 -0
- package/src/v2/blocks/tools.tsx +72 -0
- package/src/v2/canvas/block-list.tsx +216 -0
- package/src/v2/canvas/canvas-css.ts +131 -0
- package/src/v2/canvas/canvas.tsx +379 -0
- package/src/v2/canvas/dnd.ts +192 -0
- package/src/v2/context.tsx +146 -0
- package/src/v2/core/bindings.ts +64 -0
- package/src/v2/core/clipboard.ts +238 -0
- package/src/v2/core/host.ts +80 -0
- package/src/v2/core/model.ts +157 -0
- package/src/v2/core/ops.ts +151 -0
- package/src/v2/core/patterns.ts +10 -0
- package/src/v2/core/registry.ts +135 -0
- package/src/v2/core/store.ts +804 -0
- package/src/v2/core/structure.ts +106 -0
- package/src/v2/core/tables.ts +194 -0
- package/src/v2/editor.css +310 -0
- package/src/v2/editor.tsx +288 -0
- package/src/v2/index.ts +28 -0
- package/src/v2/labels.ts +341 -0
- package/src/v2/prefs.ts +69 -0
- package/src/v2/text/paste.ts +75 -0
- package/src/v2/text/rich-schema.ts +96 -0
- package/src/v2/text/rich-text.tsx +512 -0
- package/src/v2/ui/attr-form.tsx +182 -0
- package/src/v2/ui/attr-hints.ts +109 -0
- package/src/v2/ui/bindings.tsx +91 -0
- package/src/v2/ui/block-descriptions.ts +34 -0
- package/src/v2/ui/color-field.tsx +17 -0
- package/src/v2/ui/doc-title.tsx +45 -0
- package/src/v2/ui/inserter.tsx +300 -0
- package/src/v2/ui/inspector.tsx +85 -0
- package/src/v2/ui/layout-panel.tsx +159 -0
- package/src/v2/ui/list-view.tsx +65 -0
- package/src/v2/ui/options.tsx +242 -0
- package/src/v2/ui/style-controls.tsx +57 -0
- package/src/v2/ui/style-tab.tsx +158 -0
- package/src/v2/ui/toolbar.tsx +397 -0
- package/src/v2/ui/unit-controls.tsx +99 -0
- /package/src/{basic.tsx → legacy/basic.tsx} +0 -0
- /package/src/{blockops.ts → legacy/block-ops.ts} +0 -0
- /package/src/{boundary.tsx → legacy/boundary.tsx} +0 -0
- /package/src/{insert.ts → legacy/insert.ts} +0 -0
- /package/src/{labels.ts → shared/labels.ts} +0 -0
- /package/src/{paste.ts → shared/paste.ts} +0 -0
- /package/src/{util.ts → shared/util.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["isiOS","isAndroid","PluginKey","useSyncExternalStore","ReactDOM","React","Plugin","forwardRef","useLayoutEffect","useEffect","useState","useSyncExternalStoreWithSelector","circularDeepEqual","Editor","useRef","useState","useSyncExternalStore","createContext","useContext","useMemo","createContext","createElement","useContext","React","reactVersion","React","MarkView","isTextSelection","NodeView","createRef","memo","createElement","getRenderedAttributes","createWidgetDecoration","createContext","useContext","useMemo"],"sources":["../src/handleMobileEnter.ts","../src/EditorContent.tsx","../src/useEditorState.ts","../src/useEditor.ts","../src/Context.tsx","../src/useReactNodeView.ts","../src/NodeViewContent.tsx","../src/NodeViewWrapper.tsx","../src/ReactRenderer.tsx","../src/ReactMarkViewRenderer.tsx","../src/captureDOMSelection.ts","../src/lib/utils/getTextSelectionAncestorPositions.ts","../src/ReactNodeViewSelectionTracker.ts","../src/ReactNodeViewRenderer.tsx","../src/ReactWidgetRenderer.tsx","../src/Tiptap.tsx"],"sourcesContent":["import { type Editor, isAndroid, isiOS } from '@tiptap/core'\nimport type { EditorView } from '@tiptap/pm/view'\n\ntype MobileEditorView = EditorView & {\n domObserver: { forceFlush: () => void; flush: () => void }\n input: { lastKeyCode: number | null; lastIOSEnter: number; lastIOSEnterFallbackTimeout: number }\n}\n\nexport function handleMobileEnter(editor: Editor, event: InputEvent): void {\n if (\n editor.isDestroyed ||\n event.defaultPrevented ||\n !event.cancelable ||\n !editor.isEditable ||\n (event.inputType !== 'insertParagraph' && event.inputType !== 'insertLineBreak') ||\n (!isiOS() && !isAndroid())\n ) {\n return\n }\n\n const view = editor.view as MobileEditorView\n const root = view.root as (Document | ShadowRoot) & { getSelection?: () => Selection | null }\n const selection = root.getSelection?.() ?? view.dom.ownerDocument.getSelection()\n const anchor = selection?.anchorNode\n const element = anchor?.nodeType === 1 ? (anchor as Element) : anchor?.parentElement\n const contentDOM = element?.closest('[data-node-view-content-react]')\n\n if (!contentDOM || !view.dom.contains(contentDOM)) {\n return\n }\n\n const lastKeyCode = view.input.lastKeyCode\n\n // Prevent the Android selection flush from handling Enter at the old caret.\n if (lastKeyCode === 13) {\n view.input.lastKeyCode = null\n }\n\n // Commit pending text before the Enter handler reads the selection.\n view.domObserver.forceFlush()\n view.domObserver.flush()\n\n const keyEvent = new KeyboardEvent('keydown', {\n key: 'Enter',\n code: 'Enter',\n keyCode: 13,\n shiftKey: event.inputType === 'insertLineBreak',\n bubbles: true,\n cancelable: true,\n })\n\n if (view.someProp('handleKeyDown', handleKeyDown => handleKeyDown(view, keyEvent))) {\n event.preventDefault()\n // Prevent the iOS fallback from handling this Enter a second time.\n view.input.lastIOSEnter = 0\n clearTimeout(view.input.lastIOSEnterFallbackTimeout)\n } else if (lastKeyCode === 13) {\n view.input.lastKeyCode = lastKeyCode\n }\n}\n","import type { Editor } from '@tiptap/core'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport type { ForwardedRef, HTMLProps, LegacyRef, MutableRefObject } from 'react'\nimport React, { forwardRef } from 'react'\nimport ReactDOM from 'react-dom'\nimport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js'\n\nimport type { ContentComponent, EditorWithContentComponent } from './Editor.js'\nimport { handleMobileEnter } from './handleMobileEnter.js'\nimport type { ReactRenderer } from './ReactRenderer.js'\n\nconst mobileEnterPluginKey = new PluginKey('reactMobileEnter')\n\nconst mergeRefs = <T extends HTMLDivElement>(\n ...refs: Array<MutableRefObject<T> | LegacyRef<T> | undefined>\n) => {\n return (node: T) => {\n refs.forEach(ref => {\n if (typeof ref === 'function') {\n ref(node)\n } else if (ref) {\n ;(ref as MutableRefObject<T | null>).current = node\n }\n })\n }\n}\n\n/**\n * This component renders all of the editor's node views.\n */\nconst Portals: React.FC<{ contentComponent: ContentComponent }> = ({ contentComponent }) => {\n // For performance reasons, we render the node view portals on state changes only\n const renderers = useSyncExternalStore(\n contentComponent.subscribe,\n contentComponent.getSnapshot,\n contentComponent.getServerSnapshot,\n )\n\n // This allows us to directly render the portals without any additional wrapper\n return <>{Object.values(renderers)}</>\n}\n\nexport interface EditorContentProps extends HTMLProps<HTMLDivElement> {\n editor: Editor | null\n innerRef?: ForwardedRef<HTMLDivElement | null>\n}\n\nexport function createContentComponent(): ContentComponent {\n const subscribers = new Set<() => void>()\n let renderers: Record<string, React.ReactPortal> = {}\n let isNotificationQueued = false\n\n const notifySubscribers = () => {\n if (isNotificationQueued || !subscribers.size) {\n return\n }\n\n isNotificationQueued = true\n\n queueMicrotask(() => {\n isNotificationQueued = false\n subscribers.forEach(subscriber => subscriber())\n })\n }\n\n return {\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback: () => void) {\n subscribers.add(callback)\n return () => {\n subscribers.delete(callback)\n }\n },\n getSnapshot() {\n return renderers\n },\n getServerSnapshot() {\n return renderers\n },\n /**\n * Adds a new NodeView Renderer to the editor.\n */\n setRenderer(id: string, renderer: ReactRenderer) {\n renderers = {\n ...renderers,\n [id]: ReactDOM.createPortal(renderer.reactElement, renderer.element, id),\n }\n\n notifySubscribers()\n },\n /**\n * Removes a NodeView Renderer from the editor.\n */\n removeRenderer(id: string) {\n const nextRenderers = { ...renderers }\n\n delete nextRenderers[id]\n renderers = nextRenderers\n notifySubscribers()\n },\n }\n}\n\nexport class PureEditorContent extends React.Component<\n EditorContentProps,\n { hasContentComponentInitialized: boolean }\n> {\n editorContentRef: React.RefObject<any>\n\n constructor(props: EditorContentProps) {\n super(props)\n this.editorContentRef = React.createRef()\n }\n\n componentDidMount() {\n this.init()\n }\n\n componentDidUpdate() {\n this.init()\n }\n\n init() {\n const editor = this.props.editor as EditorWithContentComponent | null\n\n if (editor && !editor.isDestroyed && editor.view.dom?.parentNode) {\n if (editor.contentComponent) {\n return\n }\n\n const element = this.editorContentRef.current\n\n element.append(...editor.view.dom.parentNode.childNodes)\n\n editor.setOptions({\n element,\n })\n\n editor.contentComponent = createContentComponent()\n\n editor.createNodeViews()\n\n editor.registerPlugin(\n new Plugin({\n key: mobileEnterPluginKey,\n props: {\n handleDOMEvents: {\n beforeinput: (_view, event) => handleMobileEnter(editor, event),\n },\n },\n }),\n )\n\n editor.isEditorContentInitialized = true\n\n this.forceUpdate()\n }\n }\n\n componentWillUnmount() {\n const editor = this.props.editor as EditorWithContentComponent | null\n\n if (!editor) {\n return\n }\n\n editor.isEditorContentInitialized = false\n\n if (!editor.isDestroyed) {\n editor.unregisterPlugin(mobileEnterPluginKey)\n editor.view.setProps({\n nodeViews: {},\n })\n }\n\n editor.contentComponent = null\n\n // try to reset the editor element\n // may fail if this editor's view.dom was never initialized/mounted yet\n try {\n if (!editor.view.dom?.parentNode) {\n return\n }\n\n // TODO using the new editor.mount method might allow us to remove this\n const newElement = document.createElement('div')\n\n newElement.append(...editor.view.dom.parentNode.childNodes)\n\n editor.setOptions({\n element: newElement,\n })\n } catch {\n // do nothing, nothing to reset\n }\n }\n\n render() {\n const { editor, innerRef, ...rest } = this.props\n\n return (\n <>\n <div ref={mergeRefs(innerRef, this.editorContentRef)} {...rest} />\n {/* @ts-ignore */}\n {editor?.contentComponent && <Portals contentComponent={editor.contentComponent} />}\n </>\n )\n }\n}\n\n// EditorContent should be re-created whenever the Editor instance changes\nconst EditorContentWithKey = forwardRef<HTMLDivElement, EditorContentProps>(\n (props: Omit<EditorContentProps, 'innerRef'>, ref) => {\n const key = React.useMemo(() => {\n return Math.floor(Math.random() * 0xffffffff).toString()\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [props.editor])\n\n // Can't use JSX here because it conflicts with the type definition of Vue's JSX, so use createElement\n return React.createElement(PureEditorContent, {\n key,\n innerRef: ref,\n ...props,\n })\n },\n)\n\nexport const EditorContent = React.memo(EditorContentWithKey)\n","import type { Editor } from '@tiptap/core'\nimport { circularDeepEqual } from 'fast-equals'\nimport { useDebugValue, useEffect, useLayoutEffect, useState } from 'react'\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js'\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nexport type EditorStateSnapshot<TEditor extends Editor | null = Editor | null> = {\n editor: TEditor\n transactionNumber: number\n}\n\nexport type UseEditorStateOptions<\n TSelectorResult,\n TEditor extends Editor | null = Editor | null,\n> = {\n /**\n * The editor instance.\n */\n editor: TEditor\n /**\n * A selector function to determine the value to compare for re-rendering.\n */\n selector: (context: EditorStateSnapshot<TEditor>) => TSelectorResult\n /**\n * A custom equality function to determine if the editor should re-render.\n * @default `circularDeepEqual` from `fast-equals`\n */\n equalityFn?: (a: TSelectorResult, b: TSelectorResult | null) => boolean\n}\n\n/**\n * To synchronize the editor instance with the component state,\n * we need to create a separate instance that is not affected by the component re-renders.\n */\nclass EditorStateManager<TEditor extends Editor | null = Editor | null> {\n private transactionNumber = 0\n\n private lastTransactionNumber = 0\n\n private lastSnapshot: EditorStateSnapshot<TEditor>\n\n private editor: TEditor\n\n private subscribers = new Set<() => void>()\n\n constructor(initialEditor: TEditor) {\n this.editor = initialEditor\n this.lastSnapshot = { editor: initialEditor, transactionNumber: 0 }\n\n this.getSnapshot = this.getSnapshot.bind(this)\n this.getServerSnapshot = this.getServerSnapshot.bind(this)\n this.watch = this.watch.bind(this)\n this.subscribe = this.subscribe.bind(this)\n }\n\n /**\n * Get the current editor instance.\n */\n getSnapshot(): EditorStateSnapshot<TEditor> {\n if (this.transactionNumber === this.lastTransactionNumber) {\n return this.lastSnapshot\n }\n this.lastTransactionNumber = this.transactionNumber\n this.lastSnapshot = { editor: this.editor, transactionNumber: this.transactionNumber }\n return this.lastSnapshot\n }\n\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot(): EditorStateSnapshot<null> {\n return { editor: null, transactionNumber: 0 }\n }\n\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback: () => void): () => void {\n this.subscribers.add(callback)\n return () => {\n this.subscribers.delete(callback)\n }\n }\n\n /**\n * Watch the editor instance for changes.\n */\n watch(nextEditor: Editor | null): undefined | (() => void) {\n this.editor = nextEditor as TEditor\n\n if (this.editor) {\n /**\n * This will force a re-render when the editor state changes.\n * This is to support things like `editor.can().toggleBold()` in components that `useEditor`.\n * This could be more efficient, but it's a good trade-off for now.\n */\n // Changes can emit both events, so notify only once\n let lastTransaction: unknown\n const fn = (props?: { transaction?: unknown }) => {\n if (props?.transaction !== undefined && props.transaction === lastTransaction) {\n return\n }\n lastTransaction = props?.transaction\n\n this.transactionNumber += 1\n this.subscribers.forEach(callback => callback())\n }\n\n const currentEditor = this.editor\n\n currentEditor.on('transaction', fn)\n currentEditor.on('update', fn)\n return () => {\n currentEditor.off('transaction', fn)\n currentEditor.off('update', fn)\n }\n }\n\n return undefined\n }\n}\n\n/**\n * This hook allows you to watch for changes on the editor instance.\n * It will allow you to select a part of the editor state and re-render the component when it changes.\n * @example\n * ```tsx\n * const editor = useEditor({...options})\n * const { currentSelection } = useEditorState({\n * editor,\n * selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),\n * })\n */\nexport function useEditorState<TSelectorResult>(\n options: UseEditorStateOptions<TSelectorResult, Editor>,\n): TSelectorResult\n/**\n * This hook allows you to watch for changes on the editor instance.\n * It will allow you to select a part of the editor state and re-render the component when it changes.\n * @example\n * ```tsx\n * const editor = useEditor({...options})\n * const { currentSelection } = useEditorState({\n * editor,\n * selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),\n * })\n */\nexport function useEditorState<TSelectorResult>(\n options: UseEditorStateOptions<TSelectorResult, Editor | null>,\n): TSelectorResult | null\n\n/**\n * This hook allows you to watch for changes on the editor instance.\n * It will allow you to select a part of the editor state and re-render the component when it changes.\n * @example\n * ```tsx\n * const editor = useEditor({...options})\n * const { currentSelection } = useEditorState({\n * editor,\n * selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),\n * })\n */\nexport function useEditorState<TSelectorResult>(\n options:\n | UseEditorStateOptions<TSelectorResult, Editor>\n | UseEditorStateOptions<TSelectorResult, Editor | null>,\n): TSelectorResult | null {\n const [editorStateManager] = useState(() => new EditorStateManager(options.editor))\n\n // Using the `useSyncExternalStore` hook to sync the editor instance with the component state\n const selectedState = useSyncExternalStoreWithSelector(\n editorStateManager.subscribe,\n editorStateManager.getSnapshot,\n editorStateManager.getServerSnapshot,\n options.selector as UseEditorStateOptions<TSelectorResult, Editor | null>['selector'],\n options.equalityFn ?? circularDeepEqual,\n )\n\n useIsomorphicLayoutEffect(() => {\n return editorStateManager.watch(options.editor)\n }, [options.editor, editorStateManager])\n\n useDebugValue(selectedState)\n\n return selectedState\n}\n","import { type EditorOptions, Editor } from '@tiptap/core'\nimport type { DependencyList, MutableRefObject } from 'react'\nimport { useDebugValue, useEffect, useRef, useState } from 'react'\nimport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js'\n\nimport { useEditorState } from './useEditorState.js'\n\n// @ts-ignore\nconst isDev = process.env.NODE_ENV !== 'production'\nconst isSSR = typeof window === 'undefined'\nconst isNext = isSSR || Boolean(typeof window !== 'undefined' && (window as any).next)\n\n/**\n * The options for the `useEditor` hook.\n */\nexport type UseEditorOptions = Partial<EditorOptions> & {\n /**\n * Whether to render the editor on the first render.\n * If client-side rendering, set this to `true`.\n * If server-side rendering, set this to `false`.\n * @default true\n */\n immediatelyRender?: boolean\n /**\n * Whether to re-render the editor on each transaction.\n * This is legacy behavior that will be removed in future versions.\n * @default false\n */\n shouldRerenderOnTransaction?: boolean\n}\n\n/**\n * This class handles the creation, destruction, and re-creation of the editor instance.\n */\nclass EditorInstanceManager {\n /**\n * The current editor instance.\n */\n private editor: Editor | null = null\n\n /**\n * The most recent options to apply to the editor.\n */\n private options: MutableRefObject<UseEditorOptions>\n\n /**\n * The subscriptions to notify when the editor instance\n * has been created or destroyed.\n */\n private subscriptions = new Set<() => void>()\n\n /**\n * A timeout to destroy the editor if it was not mounted within a time frame.\n */\n private scheduledDestructionTimeout: ReturnType<typeof setTimeout> | undefined\n\n /**\n * Whether the editor has been mounted.\n */\n private isComponentMounted = false\n\n /**\n * The most recent dependencies array.\n */\n private previousDeps: DependencyList | null = null\n\n /**\n * The unique instance ID. This is used to identify the editor instance. And will be re-generated for each new instance.\n */\n public instanceId = ''\n\n constructor(options: MutableRefObject<UseEditorOptions>) {\n this.options = options\n this.subscriptions = new Set<() => void>()\n this.setEditor(this.getInitialEditor())\n this.scheduleDestroy()\n\n this.getEditor = this.getEditor.bind(this)\n this.getServerSnapshot = this.getServerSnapshot.bind(this)\n this.subscribe = this.subscribe.bind(this)\n this.refreshEditorInstance = this.refreshEditorInstance.bind(this)\n this.scheduleDestroy = this.scheduleDestroy.bind(this)\n this.onRender = this.onRender.bind(this)\n this.createEditor = this.createEditor.bind(this)\n }\n\n private setEditor(editor: Editor | null) {\n this.editor = editor\n this.instanceId = Math.random().toString(36).slice(2, 9)\n\n // Notify all subscribers that the editor instance has been created\n this.subscriptions.forEach(cb => cb())\n }\n\n private getInitialEditor() {\n const explicit = this.options.current.immediatelyRender\n let immediatelyRender = explicit ?? true\n\n if (isSSR) {\n if (immediatelyRender && isDev) {\n console.warn(\n 'SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches',\n )\n }\n immediatelyRender = false\n } else if (isNext && explicit === undefined) {\n immediatelyRender = false\n if (isDev) {\n console.warn(\n 'Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.',\n )\n }\n }\n\n return immediatelyRender ? this.createEditor() : null\n }\n\n /**\n * Create a new editor instance. And attach event listeners.\n */\n private createEditor(): Editor {\n const optionsToApply: Partial<EditorOptions> = {\n ...this.options.current,\n // Always call the most recent version of the callback function by default\n onBeforeCreate: (...args) => this.options.current.onBeforeCreate?.(...args),\n onBlur: (...args) => this.options.current.onBlur?.(...args),\n onCreate: (...args) => this.options.current.onCreate?.(...args),\n onDestroy: (...args) => this.options.current.onDestroy?.(...args),\n onFocus: (...args) => this.options.current.onFocus?.(...args),\n onSelectionUpdate: (...args) => this.options.current.onSelectionUpdate?.(...args),\n onTransaction: (...args) => this.options.current.onTransaction?.(...args),\n onUpdate: (...args) => this.options.current.onUpdate?.(...args),\n onContentError: (...args) => this.options.current.onContentError?.(...args),\n onDrop: (...args) => this.options.current.onDrop?.(...args),\n onPaste: (...args) => this.options.current.onPaste?.(...args),\n onDelete: (...args) => this.options.current.onDelete?.(...args),\n onMount: (...args) => this.options.current.onMount?.(...args),\n onUnmount: (...args) => this.options.current.onUnmount?.(...args),\n }\n const editor = new Editor(optionsToApply)\n\n // no need to keep track of the event listeners, they will be removed when the editor is destroyed\n\n return editor\n }\n\n /**\n * Get the current editor instance.\n */\n getEditor(): Editor | null {\n return this.editor\n }\n\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot(): null {\n return null\n }\n\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(onStoreChange: () => void) {\n this.subscriptions.add(onStoreChange)\n\n return () => {\n this.subscriptions.delete(onStoreChange)\n }\n }\n\n static compareOptions(a: UseEditorOptions, b: UseEditorOptions) {\n return (Object.keys(a) as (keyof UseEditorOptions)[]).every(key => {\n if (\n [\n 'onCreate',\n 'onBeforeCreate',\n 'onDestroy',\n 'onUpdate',\n 'onTransaction',\n 'onFocus',\n 'onBlur',\n 'onSelectionUpdate',\n 'onContentError',\n 'onDrop',\n 'onPaste',\n ].includes(key)\n ) {\n // we don't want to compare callbacks, they are always different and only registered once\n return true\n }\n\n // We often encourage putting extensions inlined in the options object, so we will do a slightly deeper comparison here\n if (key === 'extensions' && a.extensions && b.extensions) {\n if (a.extensions.length !== b.extensions.length) {\n return false\n }\n return a.extensions.every((extension, index) => {\n if (extension !== b.extensions?.[index]) {\n return false\n }\n return true\n })\n }\n if (a[key] !== b[key]) {\n // if any of the options have changed, we should update the editor options\n return false\n }\n return true\n })\n }\n\n /**\n * On each render, we will create, update, or destroy the editor instance.\n * @param deps The dependencies to watch for changes\n * @returns A cleanup function\n */\n onRender(deps: DependencyList) {\n // The returned callback will run on each render\n return () => {\n this.isComponentMounted = true\n // Cleanup any scheduled destructions, since we are currently rendering\n clearTimeout(this.scheduledDestructionTimeout)\n\n if (this.editor && !this.editor.isDestroyed && deps.length === 0) {\n // if the editor does exist & deps are empty, we don't need to re-initialize the editor generally\n if (!EditorInstanceManager.compareOptions(this.options.current, this.editor.options)) {\n // But, the options are different, so we need to update the editor options\n // Still, this is faster than re-creating the editor\n this.editor.setOptions({\n ...this.options.current,\n editable: this.editor.isEditable,\n })\n }\n } else {\n // When the editor:\n // - does not yet exist\n // - is destroyed\n // - the deps array changes\n // We need to destroy the editor instance and re-initialize it\n this.refreshEditorInstance(deps)\n }\n\n return () => {\n this.isComponentMounted = false\n this.scheduleDestroy()\n }\n }\n }\n\n /**\n * Recreate the editor instance if the dependencies have changed.\n */\n private refreshEditorInstance(deps: DependencyList) {\n if (this.editor && !this.editor.isDestroyed) {\n // Editor instance already exists\n if (this.previousDeps === null) {\n // If lastDeps has not yet been initialized, reuse the current editor instance\n this.previousDeps = deps\n return\n }\n const depsAreEqual =\n this.previousDeps.length === deps.length &&\n this.previousDeps.every((dep, index) => dep === deps[index])\n\n if (depsAreEqual) {\n // deps exist and are equal, no need to recreate\n return\n }\n }\n\n if (this.editor && !this.editor.isDestroyed) {\n // Destroy the editor instance if it exists\n this.editor.destroy()\n }\n\n this.setEditor(this.createEditor())\n\n // Update the lastDeps to the current deps\n this.previousDeps = deps\n }\n\n /**\n * Schedule the destruction of the editor instance.\n * This will only destroy the editor if it was not mounted on the next tick.\n * This is to avoid destroying the editor instance when it's actually still mounted.\n */\n private scheduleDestroy() {\n const currentInstanceId = this.instanceId\n const currentEditor = this.editor\n\n // Wait two ticks to see if the component is still mounted\n this.scheduledDestructionTimeout = setTimeout(() => {\n if (this.isComponentMounted && this.instanceId === currentInstanceId) {\n // If still mounted on the following tick, with the same instanceId, do not destroy the editor\n if (currentEditor) {\n // just re-apply options as they might have changed\n currentEditor.setOptions(this.options.current)\n }\n return\n }\n if (currentEditor && !currentEditor.isDestroyed) {\n currentEditor.destroy()\n if (this.instanceId === currentInstanceId) {\n this.setEditor(null)\n }\n }\n // This allows the effect to run again between ticks\n // which may save us from having to re-create the editor\n }, 1)\n }\n}\n\n/**\n * This hook allows you to create an editor instance.\n * @param options The editor options\n * @param deps The dependencies to watch for changes\n * @returns The editor instance\n * @example const editor = useEditor({ extensions: [...] })\n */\nexport function useEditor(\n options: UseEditorOptions & { immediatelyRender: false },\n deps?: DependencyList,\n): Editor | null\n\n/**\n * This hook allows you to create an editor instance.\n * @param options The editor options\n * @param deps The dependencies to watch for changes\n * @returns The editor instance\n * @example const editor = useEditor({ extensions: [...] })\n */\nexport function useEditor(options: UseEditorOptions, deps?: DependencyList): Editor\n\nexport function useEditor(\n options: UseEditorOptions = {},\n deps: DependencyList = [],\n): Editor | null {\n const mostRecentOptions = useRef(options)\n\n mostRecentOptions.current = options\n\n const [instanceManager] = useState(() => new EditorInstanceManager(mostRecentOptions))\n\n const editor = useSyncExternalStore(\n instanceManager.subscribe,\n instanceManager.getEditor,\n instanceManager.getServerSnapshot,\n )\n\n useDebugValue(editor)\n\n // This effect will handle creating/updating the editor instance\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n useEffect(instanceManager.onRender(deps))\n\n // The default behavior is to re-render on each transaction\n // This is legacy behavior that will be removed in future versions\n useEditorState({\n editor,\n selector: ({ transactionNumber }) => {\n if (\n options.shouldRerenderOnTransaction === false ||\n options.shouldRerenderOnTransaction === undefined\n ) {\n // This will prevent the editor from re-rendering on each transaction\n return null\n }\n\n // This will avoid re-rendering on the first transaction when `immediatelyRender` is set to `true`\n if (options.immediatelyRender && transactionNumber === 0) {\n return 0\n }\n return transactionNumber + 1\n },\n })\n\n return editor\n}\n","import type { Editor } from '@tiptap/core'\nimport type { HTMLAttributes, ReactNode } from 'react'\nimport React, { createContext, useContext, useMemo } from 'react'\n\nimport { EditorContent } from './EditorContent.js'\nimport type { UseEditorOptions } from './useEditor.js'\nimport { useEditor } from './useEditor.js'\n\nexport type EditorContextValue = {\n editor: Editor | null\n}\n\nexport const EditorContext = createContext<EditorContextValue>({\n editor: null,\n})\n\nexport const EditorConsumer = EditorContext.Consumer\n\n/**\n * A hook to get the current editor instance.\n */\nexport const useCurrentEditor = () => useContext(EditorContext)\n\nexport type EditorProviderProps = {\n children?: ReactNode\n slotBefore?: ReactNode\n slotAfter?: ReactNode\n editorContainerProps?: HTMLAttributes<HTMLDivElement>\n} & UseEditorOptions\n\n/**\n * This is the provider component for the editor.\n * It allows the editor to be accessible across the entire component tree\n * with `useCurrentEditor`.\n */\nexport function EditorProvider({\n children,\n slotAfter,\n slotBefore,\n editorContainerProps = {},\n ...editorOptions\n}: EditorProviderProps) {\n const editor = useEditor(editorOptions)\n const contextValue = useMemo(() => ({ editor }), [editor])\n\n if (!editor) {\n return null\n }\n\n return (\n <EditorContext.Provider value={contextValue}>\n {slotBefore}\n <EditorConsumer>\n {({ editor: currentEditor }) => (\n <EditorContent editor={currentEditor} {...editorContainerProps} />\n )}\n </EditorConsumer>\n {children}\n {slotAfter}\n </EditorContext.Provider>\n )\n}\n","import type { ReactNode } from 'react'\nimport { createContext, createElement, useContext } from 'react'\n\nexport interface ReactNodeViewContextProps {\n onDragStart?: (event: DragEvent) => void\n nodeViewContentRef?: (element: HTMLElement | null) => void\n /**\n * This allows you to add children into the NodeViewContent component.\n * This is useful when statically rendering the content of a node view.\n */\n nodeViewContentChildren?: ReactNode\n}\n\nexport const ReactNodeViewContext = createContext<ReactNodeViewContextProps>({\n onDragStart: () => {\n // no-op\n },\n nodeViewContentChildren: undefined,\n nodeViewContentRef: () => {\n // no-op\n },\n})\n\nexport const ReactNodeViewContentProvider = ({\n children,\n content,\n}: {\n children: ReactNode\n content: ReactNode\n}) => {\n return createElement(\n ReactNodeViewContext.Provider,\n { value: { nodeViewContentChildren: content } },\n children,\n )\n}\n\nexport const useReactNodeView = () => useContext(ReactNodeViewContext)\n","import type { ComponentProps } from 'react'\nimport React from 'react'\n\nimport { useReactNodeView } from './useReactNodeView.js'\n\nexport type NodeViewContentProps<T extends keyof React.JSX.IntrinsicElements = 'div'> = {\n as?: NoInfer<T>\n} & ComponentProps<T>\n\nexport function NodeViewContent<T extends keyof React.JSX.IntrinsicElements = 'div'>({\n as: Tag = 'div' as T,\n ...props\n}: NodeViewContentProps<T>) {\n const { nodeViewContentRef, nodeViewContentChildren } = useReactNodeView()\n\n return (\n // @ts-ignore\n <Tag\n {...props}\n ref={nodeViewContentRef}\n data-node-view-content=\"\"\n style={{\n whiteSpace: 'pre-wrap',\n ...props.style,\n }}\n >\n {nodeViewContentChildren}\n </Tag>\n )\n}\n","import React from 'react'\n\nimport { useReactNodeView } from './useReactNodeView.js'\n\nexport interface NodeViewWrapperProps {\n [key: string]: any\n as?: React.ElementType\n}\n\nexport const NodeViewWrapper: React.FC<NodeViewWrapperProps> = React.forwardRef((props, ref) => {\n const { onDragStart } = useReactNodeView()\n const Tag = props.as || 'div'\n\n return (\n // @ts-ignore\n <Tag\n {...props}\n ref={ref}\n data-node-view-wrapper=\"\"\n onDragStart={onDragStart}\n style={{\n whiteSpace: 'normal',\n ...props.style,\n }}\n />\n )\n})\n","import type { Editor } from '@tiptap/core'\nimport type {\n ComponentClass,\n ForwardRefExoticComponent,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n RefAttributes,\n} from 'react'\nimport { version as reactVersion } from 'react'\nimport { flushSync } from 'react-dom'\n\nimport type { EditorWithContentComponent } from './Editor.js'\n\n/**\n * Check if a component is a class component.\n * @param Component\n * @returns {boolean}\n */\nfunction isClassComponent(Component: any) {\n return !!(\n typeof Component === 'function' &&\n Component.prototype &&\n Component.prototype.isReactComponent\n )\n}\n\n/**\n * Check if a component is a forward ref component.\n * @param Component\n * @returns {boolean}\n */\nfunction isForwardRefComponent(Component: any) {\n return !!(\n typeof Component === 'object' &&\n Component.$$typeof &&\n (Component.$$typeof.toString() === 'Symbol(react.forward_ref)' ||\n Component.$$typeof.description === 'react.forward_ref')\n )\n}\n\n/**\n * Check if a component is a memoized component.\n * @param Component\n * @returns {boolean}\n */\nfunction isMemoComponent(Component: any) {\n return !!(\n typeof Component === 'object' &&\n Component.$$typeof &&\n (Component.$$typeof.toString() === 'Symbol(react.memo)' ||\n Component.$$typeof.description === 'react.memo')\n )\n}\n\n/**\n * Check if a component can safely receive a ref prop.\n * This includes class components, forwardRef components, and memoized components\n * that wrap forwardRef or class components.\n * @param Component\n * @returns {boolean}\n */\nfunction canReceiveRef(Component: any) {\n // Check if it's a class component\n if (isClassComponent(Component)) {\n return true\n }\n\n // Check if it's a forwardRef component\n if (isForwardRefComponent(Component)) {\n return true\n }\n\n // Check if it's a memoized component\n if (isMemoComponent(Component)) {\n // For memoized components, check the wrapped component\n const wrappedComponent = Component.type\n if (wrappedComponent) {\n return isClassComponent(wrappedComponent) || isForwardRefComponent(wrappedComponent)\n }\n }\n\n return false\n}\n\n/**\n * Check if we're running React 19+ by detecting if function components support ref props\n * @returns {boolean}\n */\nfunction isReact19Plus(): boolean {\n // React 19 is detected by checking React version if available\n // In practice, we'll use a more conservative approach and assume React 18 behavior\n // unless we can definitively detect React 19\n try {\n // @ts-ignore\n if (reactVersion) {\n const majorVersion = parseInt(reactVersion.split('.')[0], 10)\n return majorVersion >= 19\n }\n } catch {\n // Fallback to React 18 behavior if we can't determine version\n }\n return false\n}\n\nexport interface ReactRendererOptions {\n /**\n * The editor instance.\n * @type {Editor}\n */\n editor: Editor\n\n /**\n * The props for the component.\n * @type {Record<string, any>}\n * @default {}\n */\n props?: Record<string, any>\n\n /**\n * The tag name of the element.\n * @type {string}\n * @default 'div'\n */\n as?: string\n\n /**\n * The class name of the element.\n * @type {string}\n * @default ''\n * @example 'foo bar'\n */\n className?: string\n}\n\ntype ComponentType<R, P> =\n | ComponentClass<P>\n | FunctionComponent<P>\n | ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<R>>\n\n/**\n * The ReactRenderer class. It's responsible for rendering React components inside the editor.\n * @example\n * new ReactRenderer(MyComponent, {\n * editor,\n * props: {\n * foo: 'bar',\n * },\n * as: 'span',\n * })\n */\nexport class ReactRenderer<R = unknown, P extends Record<string, any> = object> {\n id: string\n\n editor: EditorWithContentComponent\n\n component: any\n\n element: HTMLElement\n\n props: P\n\n reactElement: ReactNode\n\n ref: R | null = null\n\n /**\n * Flag to track if the renderer has been destroyed, preventing queued or asynchronous renders from executing after teardown.\n */\n destroyed = false\n\n /**\n * Immediately creates element and renders the provided React component.\n */\n constructor(\n component: ComponentType<R, P>,\n { editor, props = {}, as = 'div', className = '' }: ReactRendererOptions,\n ) {\n this.id = Math.floor(Math.random() * 0xffffffff).toString()\n this.component = component\n this.editor = editor\n this.props = props as P\n this.element = document.createElement(as)\n this.element.classList.add('react-renderer')\n\n if (className) {\n this.element.classList.add(...className.split(' '))\n }\n\n if (this.editor.isEditorContentInitialized) {\n // If EditorContent is mounted, flush synchronously to maintain cursor positioning consistency.\n // Subsequent renders can be async without affecting cursor behavior.\n flushSync(() => {\n this.render()\n })\n } else {\n queueMicrotask(() => {\n if (this.destroyed) {\n return\n }\n this.render()\n })\n }\n }\n\n /**\n * Render the React component.\n */\n render(): void {\n if (this.destroyed) {\n return\n }\n\n const Component = this.component\n const props = this.props\n const editor = this.editor as EditorWithContentComponent\n\n // Handle ref forwarding with React 18/19 compatibility\n const isReact19 = isReact19Plus()\n const componentCanReceiveRef = canReceiveRef(Component)\n\n const elementProps = { ...props }\n\n // Always remove ref if the component cannot receive it (unless React 19+)\n if (elementProps.ref && !(isReact19 || componentCanReceiveRef)) {\n delete elementProps.ref\n }\n\n // Only assign our own ref if allowed\n if (!elementProps.ref && (isReact19 || componentCanReceiveRef)) {\n // @ts-ignore - Setting ref prop for compatible components\n elementProps.ref = (ref: R) => {\n this.ref = ref\n }\n }\n\n this.reactElement = <Component {...elementProps} />\n\n editor?.contentComponent?.setRenderer(this.id, this)\n }\n\n /**\n * Re-renders the React component with new props.\n * Skips the render if none of the supplied props actually changed,\n * to avoid unnecessary portal re-creation.\n */\n updateProps(props: Record<string, any> = {}): void {\n if (this.destroyed) {\n return\n }\n\n // Shallow comparison — skip if every supplied key already holds the same value.\n let changed = false\n const keys = Object.keys(props)\n\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i]\n if (props[key] !== this.props[key]) {\n changed = true\n break\n }\n }\n\n if (!changed) {\n return\n }\n\n this.props = {\n ...this.props,\n ...props,\n }\n\n this.render()\n }\n\n /**\n * Destroy the React component.\n */\n destroy(): void {\n this.destroyed = true\n const editor = this.editor as EditorWithContentComponent\n\n editor?.contentComponent?.removeRenderer(this.id)\n // If the consumer appended the element to the document (for example\n // many demos append the renderer element to document.body), make sure\n // we remove it here to avoid leaking DOM nodes / React roots.\n try {\n if (this.element && this.element.parentNode) {\n this.element.parentNode.removeChild(this.element)\n }\n } catch {\n // ignore DOM removal errors\n }\n }\n\n /**\n * Update the attributes of the element that holds the React component.\n */\n updateAttributes(attributes: Record<string, string>): void {\n Object.keys(attributes).forEach(key => {\n this.element.setAttribute(key, attributes[key])\n })\n }\n}\n","/* oslint-disableno-shadow */\nimport type { MarkViewProps, MarkViewRenderer, MarkViewRendererOptions } from '@tiptap/core'\nimport { MarkView } from '@tiptap/core'\nimport React from 'react'\n\n// import { flushSync } from 'react-dom'\nimport { ReactRenderer } from './ReactRenderer.js'\n\nexport interface MarkViewContextProps {\n markViewContentRef: (element: HTMLElement | null) => void\n}\nexport const ReactMarkViewContext = React.createContext<MarkViewContextProps>({\n markViewContentRef: () => {\n // do nothing\n },\n})\n\nexport type MarkViewContentProps<T extends keyof React.JSX.IntrinsicElements = 'span'> = {\n as?: T\n} & Omit<React.ComponentProps<T>, 'as'>\n\nexport const MarkViewContent = <T extends keyof React.JSX.IntrinsicElements = 'span'>(\n props: MarkViewContentProps<T>,\n) => {\n const { as: Tag = 'span', ...rest } = props\n const { markViewContentRef } = React.useContext(ReactMarkViewContext)\n\n return (\n // @ts-ignore\n <Tag {...rest} ref={markViewContentRef} data-mark-view-content=\"\" />\n )\n}\n\nexport interface ReactMarkViewRendererOptions extends MarkViewRendererOptions {\n /**\n * The tag name of the element wrapping the React component.\n */\n as?: string\n className?: string\n attrs?: { [key: string]: string }\n}\n\nexport class ReactMarkView extends MarkView<\n React.ComponentType<MarkViewProps>,\n ReactMarkViewRendererOptions\n> {\n renderer: ReactRenderer\n contentDOMElement: HTMLElement\n\n constructor(\n component: React.ComponentType<MarkViewProps>,\n props: MarkViewProps,\n options?: Partial<ReactMarkViewRendererOptions>,\n ) {\n super(component, props, options)\n\n const { as = 'span', attrs, className = '' } = options || {}\n const componentProps = {\n ...props,\n updateAttributes: this.updateAttributes.bind(this),\n } satisfies MarkViewProps\n\n this.contentDOMElement = document.createElement('span')\n\n const markViewContentRef: MarkViewContextProps['markViewContentRef'] = el => {\n if (el && !el.contains(this.contentDOMElement)) {\n el.appendChild(this.contentDOMElement)\n }\n }\n const context: MarkViewContextProps = {\n markViewContentRef,\n }\n\n // For performance reasons, we memoize the provider component\n // And all of the things it requires are declared outside of the component, so it doesn't need to re-render\n const ReactMarkViewProvider: React.FunctionComponent<MarkViewProps> = React.memo(\n componentProps => {\n return (\n <ReactMarkViewContext.Provider value={context}>\n {React.createElement(component, componentProps)}\n </ReactMarkViewContext.Provider>\n )\n },\n )\n\n ReactMarkViewProvider.displayName = 'ReactMarkView'\n\n this.renderer = new ReactRenderer(ReactMarkViewProvider, {\n editor: props.editor,\n props: componentProps,\n as,\n className: `mark-${props.mark.type.name} ${className}`.trim(),\n })\n\n if (attrs) {\n this.renderer.updateAttributes(attrs)\n }\n }\n\n get dom() {\n return this.renderer.element\n }\n\n get contentDOM() {\n return this.contentDOMElement\n }\n}\n\nexport function ReactMarkViewRenderer(\n component: React.ComponentType<MarkViewProps>,\n options: Partial<ReactMarkViewRendererOptions> = {},\n): MarkViewRenderer {\n return props => new ReactMarkView(component, props, options)\n}\n","type SelectionRoot = Node & { getSelection?: () => Selection | null }\n\n/**\n * Saves the DOM selection inside `element`, returns a function to put it back.\n * Browsers drop the selection when an element moves, so restore it after the move.\n */\nexport function captureDOMSelection(element: HTMLElement): (() => void) | null {\n const root = element.getRootNode() as SelectionRoot\n const selection =\n typeof root.getSelection === 'function'\n ? root.getSelection()\n : element.ownerDocument?.defaultView?.getSelection()\n\n if (!selection || selection.rangeCount === 0) {\n return null\n }\n\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection\n\n if (!anchorNode || !focusNode) {\n return null\n }\n\n if (!element.contains(anchorNode) || !element.contains(focusNode)) {\n return null\n }\n\n return () => {\n try {\n selection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset)\n } catch {\n // The saved nodes can be gone by now.\n }\n }\n}\n","import { isTextSelection } from '@tiptap/core'\nimport type { ResolvedPos } from '@tiptap/pm/model'\nimport type { Selection } from '@tiptap/pm/state'\n\nfunction isSameAncestor($from: ResolvedPos, $to: ResolvedPos, depth: number): boolean {\n return $from.node(depth) === $to.node(depth) && $from.before(depth) === $to.before(depth)\n}\n\nexport function getTextSelectionAncestorPositions(selection: Selection): number[] {\n if (!isTextSelection(selection)) {\n return []\n }\n\n const { $from, $to } = selection\n const positions: number[] = []\n const maxDepth = Math.min($from.depth, $to.depth)\n\n for (let depth = 1; depth <= maxDepth; depth += 1) {\n if (!isSameAncestor($from, $to, depth)) {\n break\n }\n\n positions.push($from.before(depth))\n }\n\n return positions\n}\n","import type { Editor } from '@tiptap/core'\n\nimport { getTextSelectionAncestorPositions } from './lib/utils/getTextSelectionAncestorPositions.js'\n\n/** A React node view that receives `selectionInside` updates. */\ninterface TrackedNodeView {\n dom: HTMLElement\n setSelectionInside(selectionInside: boolean): void\n}\n\nclass ReactNodeViewSelectionTracker {\n private editor: Editor\n\n private views = new WeakMap<Node, TrackedNodeView>()\n\n private viewCount = 0\n\n private insideViews = new Set<TrackedNodeView>()\n\n private syncQueued = false\n\n constructor(editor: Editor) {\n this.editor = editor\n }\n\n register(view: TrackedNodeView) {\n if (this.viewCount === 0) {\n this.editor.on('transaction', this.handleTransaction)\n }\n\n this.views.set(view.dom, view)\n this.viewCount += 1\n this.scheduleSync()\n }\n\n unregister(view: TrackedNodeView) {\n this.views.delete(view.dom)\n this.viewCount -= 1\n this.insideViews.delete(view)\n\n if (this.viewCount === 0) {\n this.editor.off('transaction', this.handleTransaction)\n }\n }\n\n private scheduleSync = () => {\n if (this.syncQueued) {\n return\n }\n\n this.syncQueued = true\n\n queueMicrotask(() => {\n this.syncQueued = false\n this.sync()\n })\n }\n\n private handleTransaction = () => this.scheduleSync()\n\n private sync() {\n if (this.viewCount === 0 || this.editor.isDestroyed) {\n return\n }\n\n const nextInsideViews = this.findInsideViews()\n\n this.updateViews(this.insideViews, nextInsideViews, false)\n this.updateViews(nextInsideViews, this.insideViews, true)\n\n this.insideViews = nextInsideViews\n }\n\n private updateViews(\n views: Set<TrackedNodeView>,\n unchangedViews: Set<TrackedNodeView>,\n selectionInside: boolean,\n ) {\n for (const view of views) {\n if (!unchangedViews.has(view)) {\n view.setSelectionInside(selectionInside)\n }\n }\n }\n\n private findInsideViews(): Set<TrackedNodeView> {\n const insideViews = new Set<TrackedNodeView>()\n\n for (const position of getTextSelectionAncestorPositions(this.editor.state.selection)) {\n const dom = this.editor.view.nodeDOM(position)\n const view = dom ? this.views.get(dom) : undefined\n\n if (view) {\n insideViews.add(view)\n }\n }\n\n return insideViews\n }\n}\n\nconst trackers = new WeakMap<Editor, ReactNodeViewSelectionTracker>()\n\nexport function getReactNodeViewSelectionTracker(editor: Editor): ReactNodeViewSelectionTracker {\n let tracker = trackers.get(editor)\n\n if (!tracker) {\n tracker = new ReactNodeViewSelectionTracker(editor)\n trackers.set(editor, tracker)\n }\n\n return tracker\n}\n","import type {\n DecorationWithType,\n Editor,\n NodeViewRenderer,\n NodeViewRendererOptions,\n NodeViewRendererProps,\n} from '@tiptap/core'\nimport { getRenderedAttributes, NodeView } from '@tiptap/core'\nimport type { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport type { Decoration, DecorationSource, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'\nimport type { ComponentType, NamedExoticComponent } from 'react'\nimport { createElement, createRef, memo } from 'react'\n\nimport { captureDOMSelection } from './captureDOMSelection.js'\nimport type { EditorWithContentComponent } from './Editor.js'\nimport { getTextSelectionAncestorPositions } from './lib/utils/getTextSelectionAncestorPositions.js'\nimport { getReactNodeViewSelectionTracker } from './ReactNodeViewSelectionTracker.js'\nimport { ReactRenderer } from './ReactRenderer.js'\nimport type { ReactNodeViewProps } from './types.js'\nimport type { ReactNodeViewContextProps } from './useReactNodeView.js'\nimport { ReactNodeViewContext } from './useReactNodeView.js'\n\nexport interface ReactNodeViewRendererOptions extends NodeViewRendererOptions {\n /**\n * @deprecated Read `selectionInside` from the node view props instead.\n */\n selectedOnTextSelection?: boolean\n /**\n * This function is called when the node view is updated.\n * It allows you to compare the old node with the new node and decide if the component should update.\n */\n update:\n | ((props: {\n oldNode: ProseMirrorNode\n oldDecorations: readonly Decoration[]\n oldInnerDecorations: DecorationSource\n newNode: ProseMirrorNode\n newDecorations: readonly Decoration[]\n innerDecorations: DecorationSource\n updateProps: () => void\n }) => boolean)\n | null\n /**\n * The tag name of the element wrapping the React component.\n */\n as?: string\n /**\n * The class name of the element wrapping the React component.\n */\n className?: string\n /**\n * Attributes that should be applied to the element wrapping the React component.\n * If this is a function, it will be called each time the node view is updated.\n * If this is an object, it will be applied once when the node view is mounted.\n */\n attrs?:\n | Record<string, string>\n | ((props: {\n node: ProseMirrorNode\n HTMLAttributes: Record<string, any>\n }) => Record<string, string>)\n}\n\nexport class ReactNodeView<\n T = HTMLElement,\n Component extends ComponentType<ReactNodeViewProps<T>> = ComponentType<ReactNodeViewProps<T>>,\n NodeEditor extends Editor = Editor,\n Options extends ReactNodeViewRendererOptions = ReactNodeViewRendererOptions,\n> extends NodeView<Component, NodeEditor, Options> {\n /**\n * The renderer instance.\n */\n renderer!: ReactRenderer<unknown, ReactNodeViewProps<T>>\n\n /**\n * The element that holds the rich-text content of the node.\n */\n contentDOMElement!: HTMLElement | null\n\n /**\n * The last known position of this node view, used to detect position-only\n * changes that don't produce a new node object reference.\n */\n private currentPos: number | undefined\n\n private nodeSelected = false\n\n /**\n * Fires on editor updates when trackNodeViewPosition is enabled.\n * Detects position shifts where update() is NOT called (e.g. typing above).\n */\n private handlePositionUpdate = () => {\n const newPos = this.getPos()\n if (typeof newPos !== 'number' || newPos === this.currentPos) {\n return\n }\n this.currentPos = newPos\n this.renderer.updateProps({ getPos: () => this.getPos() })\n\n if (typeof this.options.attrs === 'function') {\n this.updateElementAttributes()\n }\n }\n\n constructor(component: Component, props: NodeViewRendererProps, options?: Partial<Options>) {\n super(component, props, options)\n\n if (!this.node.isLeaf) {\n if (this.options.contentDOMElementTag) {\n this.contentDOMElement = document.createElement(this.options.contentDOMElementTag)\n } else {\n this.contentDOMElement = document.createElement(this.node.isInline ? 'span' : 'div')\n }\n\n this.contentDOMElement.dataset.nodeViewContentReact = ''\n this.contentDOMElement.dataset.nodeViewWrapper = ''\n\n // For some reason the whiteSpace prop is not inherited properly in Chrome and Safari\n // With this fix it seems to work fine\n // See: https://github.com/ueberdosis/tiptap/issues/1197\n this.contentDOMElement.style.whiteSpace = 'inherit'\n\n const contentTarget = this.dom.querySelector('[data-node-view-content]')\n\n if (contentTarget) {\n contentTarget.appendChild(this.contentDOMElement)\n } else {\n // ProseMirror maps the selection before the queued portal render.\n this.dom.appendChild(this.contentDOMElement)\n }\n }\n\n if (this.options.trackNodeViewPosition) {\n this.editor.on('update', this.handlePositionUpdate)\n }\n }\n\n private cachedExtensionWithSyncedStorage: NodeViewRendererProps['extension'] | null = null\n\n /**\n * Returns a proxy of the extension that redirects storage access to the editor's mutable storage.\n * This preserves the original prototype chain (instanceof checks, methods like configure/extend work).\n * Cached to avoid proxy creation on every update.\n */\n get extensionWithSyncedStorage(): NodeViewRendererProps['extension'] {\n if (!this.cachedExtensionWithSyncedStorage) {\n const editor = this.editor\n const extension = this.extension\n\n this.cachedExtensionWithSyncedStorage = new Proxy(extension, {\n get(target, prop, receiver) {\n if (prop === 'storage') {\n return editor.storage[extension.name as keyof typeof editor.storage] ?? {}\n }\n return Reflect.get(target, prop, receiver)\n },\n })\n }\n\n return this.cachedExtensionWithSyncedStorage\n }\n\n /**\n * Setup the React component.\n * Called on initialization.\n */\n mount() {\n const props: Record<string, any> = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations as DecorationWithType[],\n innerDecorations: this.innerDecorations,\n view: this.view,\n selected: false,\n selectionInside: false,\n extension: this.extensionWithSyncedStorage,\n HTMLAttributes: this.HTMLAttributes,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n ref: createRef<T>(),\n }\n\n const mountProps = props as ReactNodeViewProps<T>\n\n if (!(this.component as any).displayName) {\n const capitalizeFirstChar = (string: string): string => {\n return string.charAt(0).toUpperCase() + string.substring(1)\n }\n\n this.component.displayName = capitalizeFirstChar(this.extension.name)\n }\n\n const onDragStart = this.onDragStart.bind(this)\n const nodeViewContentRef: ReactNodeViewContextProps['nodeViewContentRef'] = element => {\n if (element && this.contentDOMElement && element.firstChild !== this.contentDOMElement) {\n // remove the nodeViewWrapper attribute from the element\n if (element.hasAttribute('data-node-view-wrapper')) {\n element.removeAttribute('data-node-view-wrapper')\n }\n\n // The caret can already be inside here. Moving would lose it.\n const restoreSelection = captureDOMSelection(this.contentDOMElement)\n\n element.appendChild(this.contentDOMElement)\n\n restoreSelection?.()\n }\n }\n const context = { onDragStart, nodeViewContentRef }\n const Component = this.component\n // For performance reasons, we memoize the provider component\n // And all of the things it requires are declared outside of the component, so it doesn't need to re-render\n const ReactNodeViewProvider: NamedExoticComponent<ReactNodeViewProps<T>> = memo(\n componentProps => {\n return (\n <ReactNodeViewContext.Provider value={context}>\n {createElement(Component, componentProps)}\n </ReactNodeViewContext.Provider>\n )\n },\n )\n\n ReactNodeViewProvider.displayName = 'ReactNodeView'\n\n let as = this.node.isInline ? 'span' : 'div'\n\n if (this.options.as) {\n as = this.options.as\n }\n\n const { className = '' } = this.options\n\n this.renderer = new ReactRenderer(ReactNodeViewProvider, {\n editor: this.editor,\n props: mountProps,\n as,\n className: `node-${this.node.type.name} ${className}`.trim(),\n })\n\n getReactNodeViewSelectionTracker(this.editor).register(this)\n this.updateElementAttributes()\n this.currentPos = this.getPos()\n }\n\n /**\n * Return the DOM element.\n * This is the element that will be used to display the node view.\n */\n get dom() {\n if (\n this.renderer.element.firstElementChild &&\n !this.renderer.element.firstElementChild?.hasAttribute('data-node-view-wrapper')\n ) {\n throw Error('Please use the NodeViewWrapper component for your node view.')\n }\n\n return this.renderer.element\n }\n\n /**\n * Return the content DOM element.\n * This is the element that will be used to display the rich-text content of the node.\n */\n get contentDOM() {\n if (this.node.isLeaf) {\n return null\n }\n\n return this.contentDOMElement\n }\n\n /**\n * On update, update the React component.\n * To prevent unnecessary updates, the `update` option can be used.\n */\n update(\n node: ProseMirrorNode,\n decorations: readonly Decoration[],\n innerDecorations: DecorationSource,\n ): boolean {\n const rerenderComponent = (props?: Record<string, any>) => {\n this.renderer.updateProps(props)\n if (typeof this.options.attrs === 'function') {\n this.updateElementAttributes()\n }\n }\n\n if (node.type !== this.node.type) {\n return false\n }\n\n if (typeof this.options.update === 'function') {\n const oldNode = this.node\n const oldDecorations = this.decorations\n const oldInnerDecorations = this.innerDecorations\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n this.currentPos = this.getPos()\n\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n oldInnerDecorations,\n innerDecorations,\n updateProps: () =>\n rerenderComponent({\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage,\n }),\n })\n }\n\n const nodeChanged = node !== this.node\n\n // Node reference unchanged — only decorations may have changed.\n // ProseMirror renders decorations independently on the contentDOM,\n // and the getPos closure (bound in mount()) calls through to\n // ProseMirror's position function at call time, so it is always\n // current. Update internal refs and skip the React re-render.\n // Keep currentPos unchanged here so the editor update listener can\n // still detect and publish a position shift for tracked node views.\n if (!nodeChanged) {\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n return true\n }\n\n const newPos = this.getPos()\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n this.currentPos = newPos\n\n const extraProps: Record<string, any> = {\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage,\n }\n\n if (this.options.trackNodeViewPosition) {\n extraProps.getPos = () => this.getPos()\n }\n\n rerenderComponent(extraProps)\n return true\n }\n\n /**\n * Select the node.\n * Add the `selected` prop and the `ProseMirror-selectednode` class.\n */\n selectNode() {\n this.nodeSelected = true\n this.updateSelectedState(true)\n }\n\n /**\n * Deselect the node.\n * Remove the `selected` prop and the `ProseMirror-selectednode` class.\n */\n deselectNode() {\n this.nodeSelected = false\n this.updateSelectedState(\n this.options.selectedOnTextSelection === true && this.isTextSelectionInside(),\n )\n }\n\n setSelectionInside(selectionInside: boolean) {\n const selected =\n this.nodeSelected || (this.options.selectedOnTextSelection === true && selectionInside)\n\n this.renderer.updateProps({ selectionInside, selected })\n this.renderer.element.classList.toggle('ProseMirror-selectednode', selected)\n }\n\n private updateSelectedState(selected: boolean) {\n this.renderer.updateProps({ selected })\n this.renderer.element.classList.toggle('ProseMirror-selectednode', selected)\n }\n\n private isTextSelectionInside() {\n const pos = this.getPos()\n\n return (\n typeof pos === 'number' &&\n getTextSelectionAncestorPositions(this.editor.state.selection).includes(pos)\n )\n }\n\n /**\n * Destroy the React component instance.\n */\n destroy() {\n this.renderer.destroy()\n getReactNodeViewSelectionTracker(this.editor).unregister(this)\n\n if (this.options.trackNodeViewPosition) {\n this.editor.off('update', this.handlePositionUpdate)\n }\n\n this.contentDOMElement = null\n }\n\n /**\n * Update the attributes of the top-level element that holds the React component.\n * Applying the attributes defined in the `attrs` option.\n */\n updateElementAttributes() {\n if (this.options.attrs) {\n let attrsObj: Record<string, string> = {}\n\n if (typeof this.options.attrs === 'function') {\n const extensionAttributes = this.editor.extensionManager.attributes\n const HTMLAttributes = getRenderedAttributes(this.node, extensionAttributes)\n\n attrsObj = this.options.attrs({ node: this.node, HTMLAttributes })\n } else {\n attrsObj = this.options.attrs\n }\n\n this.renderer.updateAttributes(attrsObj)\n }\n }\n}\n\n/**\n * Create a React node view renderer.\n */\nexport function ReactNodeViewRenderer<T = HTMLElement>(\n component: ComponentType<ReactNodeViewProps<T>>,\n options?: Partial<ReactNodeViewRendererOptions>,\n): NodeViewRenderer {\n return props => {\n // try to get the parent component\n // this is important for vue devtools to show the component hierarchy correctly\n // maybe it's `undefined` because <editor-content> isn't rendered yet\n if (!(props.editor as EditorWithContentComponent).contentComponent) {\n // Return a minimal valid NodeView with a placeholder DOM element\n // to prevent ProseMirror from crashing when calling hasAttribute on undefined\n const placeholder = document.createElement('span')\n return {\n dom: placeholder,\n contentDOM: null,\n update: () => false,\n destroy: () => {},\n selectNode: () => {},\n deselectNode: () => {},\n stopEvent: () => false,\n ignoreMutation: () => true,\n } as unknown as ProseMirrorNodeView\n }\n\n return new ReactNodeView<T>(component, props, options)\n }\n}\n","import { createWidgetDecoration } from '@tiptap/core'\nimport type { Editor, WidgetDecoration, WidgetDecorationOptions } from '@tiptap/core'\nimport type { ComponentType } from 'react'\n\nimport { ReactRenderer } from './ReactRenderer.js'\n\n/**\n * Props every widget-decoration component receives in addition to the props you\n * pass through `ReactWidgetRenderer`.\n */\nexport interface ReactWidgetDecorationProps {\n editor: Editor\n getPos: () => number | undefined\n}\n\nexport interface ReactWidgetRendererOptions<\n P extends Record<string, any> = object,\n> extends WidgetDecorationOptions {\n /**\n * The editor instance.\n */\n editor: Editor\n /**\n * The document position the widget is rendered at.\n */\n pos: number\n /**\n * A stable, position-independent identifier for the widget.\n * Reusing the same key keeps the component mounted across re-renders.\n * Good: `comment-${id}`. Bad: paragraph index or document position.\n */\n key: string\n /**\n * Props passed to the component (merged with {@link ReactWidgetDecorationProps}).\n */\n props?: P\n /**\n * The tag name of the wrapper element. Defaults to `'span'` (widgets are\n * usually inline). Applied only when the renderer is first created; later\n * renders with the same `key` keep the original tag.\n */\n as?: string\n /**\n * Applied only when the renderer is first created; later renders with the\n * same `key` keep the original class.\n */\n className?: string\n}\n\nconst WIDGET_CACHE = Symbol('tiptapReactWidgetCache')\n\n/**\n * Renders a React component into a ProseMirror widget decoration.\n * Reuses Tiptap's `ReactRenderer` so the component lives in the editor's\n * React tree (context and hooks work as usual). Use a stable `key` for\n * stateful widgets.\n * @example\n * addDecorations() {\n * return {\n * create: ({ editor, state }) =>\n * findMatches(state.doc).map(match =>\n * ReactWidgetRenderer(MyWidget, {\n * editor, pos: match.pos, key: `match-${match.id}`,\n * props: { label: match.label },\n * }),\n * ),\n * }\n * }\n */\nexport function ReactWidgetRenderer<P extends Record<string, any> = object>(\n component: ComponentType<P & ReactWidgetDecorationProps>,\n options: ReactWidgetRendererOptions<P>,\n): WidgetDecoration {\n const { editor, props = {} as P, as = 'span', className } = options\n\n return createWidgetDecoration<ReactRenderer>({\n // Forwards editor, pos, key and the ProseMirror widget options unchanged.\n ...options,\n props,\n cacheKey: WIDGET_CACHE,\n context: getPos => ({ editor, getPos }),\n create: renderProps =>\n new ReactRenderer(component, {\n editor,\n as,\n className,\n props: renderProps,\n }),\n materialize: renderer => {\n // Re-register the portal on every materialization so the editor's\n // content component is available even on late first renders.\n renderer.render()\n\n return renderer.element\n },\n })\n}\n","import type { Editor } from '@tiptap/core'\nimport type { ReactNode } from 'react'\nimport { createContext, useContext, useMemo } from 'react'\n\nimport { EditorContext } from './Context.js'\nimport type { EditorContentProps, EditorStateSnapshot } from './index.js'\nimport { EditorContent, useEditorState } from './index.js'\n\n/**\n * The shape of the React context used by the `<Tiptap />` components.\n *\n * The editor instance is always available when using the default `useEditor`\n * configuration. For SSR scenarios where `immediatelyRender: false` is used,\n * consider using the legacy `EditorProvider` pattern instead.\n */\nexport type TiptapContextType = {\n /** The Tiptap editor instance. */\n editor: Editor\n}\n\n/**\n * React context that stores the current editor instance.\n *\n * Use `useTiptap()` to read from this context in child components.\n */\nexport const TiptapContext = createContext<TiptapContextType>({\n get editor(): Editor {\n throw new Error('useTiptap must be used within a <Tiptap> provider')\n },\n})\n\nTiptapContext.displayName = 'TiptapContext'\n\n/**\n * Hook to read the Tiptap context and access the editor instance.\n *\n * This is a small convenience wrapper around `useContext(TiptapContext)`.\n * The editor is always available when used within a `<Tiptap>` provider.\n *\n * @returns The current `TiptapContextType` value from the provider.\n *\n * @example\n * ```tsx\n * import { useTiptap } from '@tiptap/react'\n *\n * function Toolbar() {\n * const { editor } = useTiptap()\n *\n * return (\n * <button onClick={() => editor.chain().focus().toggleBold().run()}>\n * Bold\n * </button>\n * )\n * }\n * ```\n */\nexport const useTiptap = () => useContext(TiptapContext)\n\n/**\n * Select a slice of the editor state using the context-provided editor.\n *\n * This is a thin wrapper around `useEditorState` that reads the `editor`\n * instance from `useTiptap()` so callers don't have to pass it manually.\n *\n * @typeParam TSelectorResult - The type returned by the selector.\n * @param selector - Function that receives the editor state snapshot and\n * returns the piece of state you want to subscribe to.\n * @param equalityFn - Optional function to compare previous/next selected\n * values and avoid unnecessary updates.\n * @returns The selected slice of the editor state.\n *\n * @example\n * ```tsx\n * function WordCount() {\n * const wordCount = useTiptapState(state => {\n * const text = state.editor.state.doc.textContent\n * return text.split(/\\s+/).filter(Boolean).length\n * })\n *\n * return <span>{wordCount} words</span>\n * }\n * ```\n */\nexport function useTiptapState<TSelectorResult>(\n selector: (context: EditorStateSnapshot<Editor>) => TSelectorResult,\n equalityFn?: (a: TSelectorResult, b: TSelectorResult | null) => boolean,\n) {\n const { editor } = useTiptap()\n\n return useEditorState({\n editor,\n selector,\n equalityFn,\n })\n}\n\nexport type TiptapWrapperEditorInstanceProps =\n | {\n /**\n * The editor instance to provide to child components.\n * Use `useEditor()` to create this instance.\n */\n editor: Editor\n }\n | {\n /**\n * @deprecated Use `editor` instead. Will be removed in the next major version.\n */\n instance: Editor\n }\n\n/**\n * Props for the `Tiptap` root/provider component.\n */\nexport type TiptapWrapperProps = TiptapWrapperEditorInstanceProps & {\n children: ReactNode\n}\n\n/**\n * Top-level provider component that makes the editor instance available via\n * React context to all child components.\n *\n * This component also provides backwards compatibility with the legacy\n * `EditorContext`, so components using `useCurrentEditor()` will work\n * inside a `<Tiptap>` provider.\n *\n * @param props - Component props.\n * @returns A context provider element wrapping `children`.\n *\n * @example\n * ```tsx\n * import { Tiptap, useEditor } from '@tiptap/react'\n *\n * function App() {\n * const editor = useEditor({ extensions: [...] })\n *\n * return (\n * <Tiptap editor={editor}>\n * <Toolbar />\n * <Tiptap.Content />\n * </Tiptap>\n * )\n * }\n * ```\n */\nexport function TiptapWrapper({ children, ...props }: TiptapWrapperProps) {\n const resolvedEditor = 'editor' in props ? props.editor : props.instance\n\n if (!resolvedEditor) {\n throw new Error('Tiptap: An editor instance is required. Pass a non-null `editor` prop.')\n }\n\n const tiptapContextValue = useMemo<TiptapContextType>(\n () => ({ editor: resolvedEditor }),\n [resolvedEditor],\n )\n\n // Provide backwards compatibility with the legacy EditorContext\n // so components using useCurrentEditor() work inside <Tiptap>\n const legacyContextValue = useMemo(() => ({ editor: resolvedEditor }), [resolvedEditor])\n\n return (\n <EditorContext.Provider value={legacyContextValue}>\n <TiptapContext.Provider value={tiptapContextValue}>{children}</TiptapContext.Provider>\n </EditorContext.Provider>\n )\n}\n\nTiptapWrapper.displayName = 'Tiptap'\n\n/**\n * Convenience component that renders `EditorContent` using the context-provided\n * editor instance. Use this instead of manually passing the `editor` prop.\n *\n * @param props - All `EditorContent` props except `editor` and `ref`.\n * @returns An `EditorContent` element bound to the context editor.\n *\n * @example\n * ```tsx\n * // inside a Tiptap provider\n * <Tiptap.Content className=\"editor\" />\n * ```\n */\nexport function TiptapContent({ ...rest }: Omit<EditorContentProps, 'editor' | 'ref'>) {\n const { editor } = useTiptap()\n\n return <EditorContent editor={editor} {...rest} />\n}\n\nTiptapContent.displayName = 'Tiptap.Content'\n\n/**\n * Root `Tiptap` component. Use it as the provider for all child components.\n *\n * The exported object includes the `Content` subcomponent for rendering the\n * editor content area.\n *\n * This component provides both the new `TiptapContext` (accessed via `useTiptap()`)\n * and the legacy `EditorContext` (accessed via `useCurrentEditor()`) for\n * backwards compatibility.\n *\n * For bubble menus and floating menus, import them separately from\n * `@tiptap/react/menus` to keep floating-ui as an optional dependency.\n *\n * @example\n * ```tsx\n * import { Tiptap, useEditor } from '@tiptap/react'\n * import { BubbleMenu } from '@tiptap/react/menus'\n *\n * function App() {\n * const editor = useEditor({ extensions: [...] })\n *\n * return (\n * <Tiptap editor={editor}>\n * <Tiptap.Content />\n * <BubbleMenu>\n * <button onClick={() => editor.chain().focus().toggleBold().run()}>Bold</button>\n * </BubbleMenu>\n * </Tiptap>\n * )\n * }\n * ```\n */\nexport const Tiptap = Object.assign(TiptapWrapper, {\n /**\n * The Tiptap Content component that renders the EditorContent with the editor instance from the context.\n * @see TiptapContent\n */\n Content: TiptapContent,\n})\n\nexport default Tiptap\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAgB,kBAAkB,QAAgB,OAAyB;;CACzE,IACE,OAAO,eACP,MAAM,oBACN,CAAC,MAAM,cACP,CAAC,OAAO,cACP,MAAM,cAAc,qBAAqB,MAAM,cAAc,qBAC7D,EAAA,GAACA,aAAAA,MAAAA,CAAM,KAAK,EAAA,GAACC,aAAAA,UAAAA,CAAU,GAExB;CAGF,MAAM,OAAO,OAAO;CACpB,MAAM,OAAO,KAAK;CAClB,MAAM,aAAA,sBAAA,sBAAY,KAAK,kBAAA,QAAA,wBAAA,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iC,CAAA;CAC/D,CAAA;AAE5B;AAEA,cAAc,cAAc;;;;;;;;;;;;;;AAe5B,SAAgB,cAAc,EAAE,GAAG,QAAoD;CACrF,MAAM,EAAE,WAAW,UAAU;CAE7B,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD;EAAuB;EAAQ,GAAI;CAAO,CAAA;AACnD;AAEA,cAAc,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkC5B,MAAa,SAAS,OAAO,OAAO,eAAe;;;;;AAKjD,SAAS,cACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/useEditor.ts","../src/Context.tsx","../src/ReactRenderer.tsx","../src/Editor.ts","../src/EditorContent.tsx","../src/NodeViewContent.tsx","../src/NodeViewWrapper.tsx","../src/ReactMarkViewRenderer.tsx","../src/types.ts","../src/ReactNodeViewRenderer.tsx","../src/ReactWidgetRenderer.tsx","../src/Tiptap.tsx","../src/useEditorState.ts","../src/useReactNodeView.ts"],"mappings":";;;;;;;;;KAeY,mBAAmB,QAAQ;;;;;;;EAOrC;;;;;;EAMA;;;;;;;;;iBAoSc,UACd,SAAS;EAAqB;GAC9B,OAAO,iBACN;;;;;;;;iBASa,UAAU,SAAS,kBAAkB,OAAO,iBAAiB;;;KCpUjE;EACV,QAAQ;;cAGG,eAAa,MAAA,QAAA;cAIb,gBAAc,MAAA,SAAA;;;;cAKd,wBAAgB;KAEjB;EACV,WAAW;EACX,aAAa;EACb,YAAY;EACZ,uBAAuB,eAAe;IACpC;;;;;;iBAOY,iBACd,UACA,WACA,YACA,yBACG,iBACF,sBAAmB,MAAA,IAAA;;;UCgEL;;;;;EAKf,QAAQ;;;;;;EAOR,QAAQ;;;;;;EAOR;;;;;;;EAQA;;KAGG,gBAAc,GAAG,KAClB,eAAe,KACf,kBAAkB,KAClB,0BAA0B,gBAAgB,KAAK,cAAc;;;;;;;;;;;;cAapD,cAAc,aAAa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;;;;;;;;;;;iBA2BN,eAAe,iBAC7B,WAAW,SAAS,oBAAoB,YAAY,iBACpD,cAAc,GAAG,iBAAiB,GAAG,qCAAkC;KAW7D;;;;;EAMN,QAAQ;;;;;EAMR,UAAU;;;;;KAMJ,qBAAqB;EAC/B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8BI,gBAAgB,aAAa,SAAS,qCAAkB,IAAA;kBAAxD;MAAA;;;;;;;;;;;;;;;iBAsCA,mBAAmB,QAAQ,KAAK,wDAAqC,IAAA;kBAArE;MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwCH,eAAM;;;;;kBAAA;;;;KCxNP,oBAAoB,gBAAgB,gBAAgB;EAC9D,QAAQ;EACR;;KAGU,sBACV,iBACA,gBAAgB,gBAAgB;;;;EAKhC,QAAQ;;;;EAIR,WAAW,SAAS,oBAAoB,aAAa;;;;;EAKrD,cAAc,GAAG,iBAAiB,GAAG;;;;;;;;;;;;;iBA0GvB,eAAe,iBAC7B,SAAS,sBAAsB,iBAAiB,UAC/C;;;;;;;;;;;;iBAYa,eAAe,iBAC7B,SAAS,sBAAsB,iBAAiB,iBAC/C;;;UCnJc;EACf,eAAe,OAAO;EACtB,sBAAsB,SAAS;;;;;EAK/B,0BAA0B;;cAGf,sCAAoB,QAAA;cAUpB,iCAAgC,UAAA;EAI3C,UAAU;EACV,SAAS;sBACV,yCAAA,cAAA;cAQY,wBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/useEditor.ts","../src/Context.tsx","../src/ReactRenderer.tsx","../src/Editor.ts","../src/EditorContent.tsx","../src/NodeViewContent.tsx","../src/NodeViewWrapper.tsx","../src/ReactMarkViewRenderer.tsx","../src/types.ts","../src/ReactNodeViewRenderer.tsx","../src/ReactWidgetRenderer.tsx","../src/Tiptap.tsx","../src/useEditorState.ts","../src/useReactNodeView.ts"],"mappings":";;;;;;;;;KAeY,mB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Ya,eAAe,iBAC7B,SAAS,sBAAsB,iBAAiB,iBAC/C;;;UCnJc;EACf,eAAe,OAAO;EACtB,sBAAsB,SAAS;;;;;EAK/B,0BAA0B;;cAGf,sCAAoB,QAAA;cAUpB,iCAAgC,UAAA;EAI3C,UAAU;EACV,SAAS;sBACV,yCAAA,cAAA;cAQY,wBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["reactVersion"],"sources":["../src/handleMobileEnter.ts","../src/EditorContent.tsx","../src/useEditorState.ts","../src/useEditor.ts","../src/Context.tsx","../src/useReactNodeView.ts","../src/NodeViewContent.tsx","../src/NodeViewWrapper.tsx","../src/ReactRenderer.tsx","../src/ReactMarkViewRenderer.tsx","../src/captureDOMSelection.ts","../src/lib/utils/getTextSelectionAncestorPositions.ts","../src/ReactNodeViewSelectionTracker.ts","../src/ReactNodeViewRenderer.tsx","../src/ReactWidgetRenderer.tsx","../src/Tiptap.tsx"],"sourcesContent":["import { type Editor, isAndroid, isiOS } from '@tiptap/core'\nimport type { EditorView } from '@tiptap/pm/view'\n\ntype MobileEditorView = EditorView & {\n domObserver: { forceFlush: () => void; flush: () => void }\n input: { lastKeyCode: number | null; lastIOSEnter: number; lastIOSEnterFallbackTimeout: number }\n}\n\nexport function handleMobileEnter(editor: Editor, event: InputEvent): void {\n if (\n editor.isDestroyed ||\n event.defaultPrevented ||\n !event.cancelable ||\n !editor.isEditable ||\n (event.inputType !== 'insertParagraph' && event.inputType !== 'insertLineBreak') ||\n (!isiOS() && !isAndroid())\n ) {\n return\n }\n\n const view = editor.view as MobileEditorView\n const root = view.root as (Document | ShadowRoot) & { getSelection?: () => Selection | null }\n const selection = root.getSelection?.() ?? view.dom.ownerDocument.getSelection()\n const anchor = selection?.anchorNode\n const element = anchor?.nodeType === 1 ? (anchor as Element) : anchor?.parentElement\n const contentDOM = element?.closest('[data-node-view-content-react]')\n\n if (!contentDOM || !view.dom.contains(contentDOM)) {\n return\n }\n\n const lastKeyCode = view.input.lastKeyCode\n\n // Prevent the Android selection flush from handling Enter at the old caret.\n if (lastKeyCode === 13) {\n view.input.lastKeyCode = null\n }\n\n // Commit pending text before the Enter handler reads the selection.\n view.domObserver.forceFlush()\n view.domObserver.flush()\n\n const keyEvent = new KeyboardEvent('keydown', {\n key: 'Enter',\n code: 'Enter',\n keyCode: 13,\n shiftKey: event.inputType === 'insertLineBreak',\n bubbles: true,\n cancelable: true,\n })\n\n if (view.someProp('handleKeyDown', handleKeyDown => handleKeyDown(view, keyEvent))) {\n event.preventDefault()\n // Prevent the iOS fallback from handling this Enter a second time.\n view.input.lastIOSEnter = 0\n clearTimeout(view.input.lastIOSEnterFallbackTimeout)\n } else if (lastKeyCode === 13) {\n view.input.lastKeyCode = lastKeyCode\n }\n}\n","import type { Editor } from '@tiptap/core'\nimport { Plugin, PluginKey } from '@tiptap/pm/state'\nimport type { ForwardedRef, HTMLProps, LegacyRef, MutableRefObject } from 'react'\nimport React, { forwardRef } from 'react'\nimport ReactDOM from 'react-dom'\nimport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js'\n\nimport type { ContentComponent, EditorWithContentComponent } from './Editor.js'\nimport { handleMobileEnter } from './handleMobileEnter.js'\nimport type { ReactRenderer } from './ReactRenderer.js'\n\nconst mobileEnterPluginKey = new PluginKey('reactMobileEnter')\n\nconst mergeRefs = <T extends HTMLDivElement>(\n ...refs: Array<MutableRefObject<T> | LegacyRef<T> | undefined>\n) => {\n return (node: T) => {\n refs.forEach(ref => {\n if (typeof ref === 'function') {\n ref(node)\n } else if (ref) {\n ;(ref as MutableRefObject<T | null>).current = node\n }\n })\n }\n}\n\n/**\n * This component renders all of the editor's node views.\n */\nconst Portals: React.FC<{ contentComponent: ContentComponent }> = ({ contentComponent }) => {\n // For performance reasons, we render the node view portals on state changes only\n const renderers = useSyncExternalStore(\n contentComponent.subscribe,\n contentComponent.getSnapshot,\n contentComponent.getServerSnapshot,\n )\n\n // This allows us to directly render the portals without any additional wrapper\n return <>{Object.values(renderers)}</>\n}\n\nexport interface EditorContentProps extends HTMLProps<HTMLDivElement> {\n editor: Editor | null\n innerRef?: ForwardedRef<HTMLDivElement | null>\n}\n\nexport function createContentComponent(): ContentComponent {\n const subscribers = new Set<() => void>()\n let renderers: Record<string, React.ReactPortal> = {}\n let isNotificationQueued = false\n\n const notifySubscribers = () => {\n if (isNotificationQueued || !subscribers.size) {\n return\n }\n\n isNotificationQueued = true\n\n queueMicrotask(() => {\n isNotificationQueued = false\n subscribers.forEach(subscriber => subscriber())\n })\n }\n\n return {\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback: () => void) {\n subscribers.add(callback)\n return () => {\n subscribers.delete(callback)\n }\n },\n getSnapshot() {\n return renderers\n },\n getServerSnapshot() {\n return renderers\n },\n /**\n * Adds a new NodeView Renderer to the editor.\n */\n setRenderer(id: string, renderer: ReactRenderer) {\n renderers = {\n ...renderers,\n [id]: ReactDOM.createPortal(renderer.reactElement, renderer.element, id),\n }\n\n notifySubscribers()\n },\n /**\n * Removes a NodeView Renderer from the editor.\n */\n removeRenderer(id: string) {\n const nextRenderers = { ...renderers }\n\n delete nextRenderers[id]\n renderers = nextRenderers\n notifySubscribers()\n },\n }\n}\n\nexport class PureEditorContent extends React.Component<\n EditorContentProps,\n { hasContentComponentInitialized: boolean }\n> {\n editorContentRef: React.RefObject<any>\n\n constructor(props: EditorContentProps) {\n super(props)\n this.editorContentRef = React.createRef()\n }\n\n componentDidMount() {\n this.init()\n }\n\n componentDidUpdate() {\n this.init()\n }\n\n init() {\n const editor = this.props.editor as EditorWithContentComponent | null\n\n if (editor && !editor.isDestroyed && editor.view.dom?.parentNode) {\n if (editor.contentComponent) {\n return\n }\n\n const element = this.editorContentRef.current\n\n element.append(...editor.view.dom.parentNode.childNodes)\n\n editor.setOptions({\n element,\n })\n\n editor.contentComponent = createContentComponent()\n\n editor.createNodeViews()\n\n editor.registerPlugin(\n new Plugin({\n key: mobileEnterPluginKey,\n props: {\n handleDOMEvents: {\n beforeinput: (_view, event) => handleMobileEnter(editor, event),\n },\n },\n }),\n )\n\n editor.isEditorContentInitialized = true\n\n this.forceUpdate()\n }\n }\n\n componentWillUnmount() {\n const editor = this.props.editor as EditorWithContentComponent | null\n\n if (!editor) {\n return\n }\n\n editor.isEditorContentInitialized = false\n\n if (!editor.isDestroyed) {\n editor.unregisterPlugin(mobileEnterPluginKey)\n editor.view.setProps({\n nodeViews: {},\n })\n }\n\n editor.contentComponent = null\n\n // try to reset the editor element\n // may fail if this editor's view.dom was never initialized/mounted yet\n try {\n if (!editor.view.dom?.parentNode) {\n return\n }\n\n // TODO using the new editor.mount method might allow us to remove this\n const newElement = document.createElement('div')\n\n newElement.append(...editor.view.dom.parentNode.childNodes)\n\n editor.setOptions({\n element: newElement,\n })\n } catch {\n // do nothing, nothing to reset\n }\n }\n\n render() {\n const { editor, innerRef, ...rest } = this.props\n\n return (\n <>\n <div ref={mergeRefs(innerRef, this.editorContentRef)} {...rest} />\n {/* @ts-ignore */}\n {editor?.contentComponent && <Portals contentComponent={editor.contentComponent} />}\n </>\n )\n }\n}\n\n// EditorContent should be re-created whenever the Editor instance changes\nconst EditorContentWithKey = forwardRef<HTMLDivElement, EditorContentProps>(\n (props: Omit<EditorContentProps, 'innerRef'>, ref) => {\n const key = React.useMemo(() => {\n return Math.floor(Math.random() * 0xffffffff).toString()\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n }, [props.editor])\n\n // Can't use JSX here because it conflicts with the type definition of Vue's JSX, so use createElement\n return React.createElement(PureEditorContent, {\n key,\n innerRef: ref,\n ...props,\n })\n },\n)\n\nexport const EditorContent = React.memo(EditorContentWithKey)\n","import type { Editor } from '@tiptap/core'\nimport { circularDeepEqual } from 'fast-equals'\nimport { useDebugValue, useEffect, useLayoutEffect, useState } from 'react'\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js'\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\nexport type EditorStateSnapshot<TEditor extends Editor | null = Editor | null> = {\n editor: TEditor\n transactionNumber: number\n}\n\nexport type UseEditorStateOptions<\n TSelectorResult,\n TEditor extends Editor | null = Editor | null,\n> = {\n /**\n * The editor instance.\n */\n editor: TEditor\n /**\n * A selector function to determine the value to compare for re-rendering.\n */\n selector: (context: EditorStateSnapshot<TEditor>) => TSelectorResult\n /**\n * A custom equality function to determine if the editor should re-render.\n * @default `circularDeepEqual` from `fast-equals`\n */\n equalityFn?: (a: TSelectorResult, b: TSelectorResult | null) => boolean\n}\n\n/**\n * To synchronize the editor instance with the component state,\n * we need to create a separate instance that is not affected by the component re-renders.\n */\nclass EditorStateManager<TEditor extends Editor | null = Editor | null> {\n private transactionNumber = 0\n\n private lastTransactionNumber = 0\n\n private lastSnapshot: EditorStateSnapshot<TEditor>\n\n private editor: TEditor\n\n private subscribers = new Set<() => void>()\n\n constructor(initialEditor: TEditor) {\n this.editor = initialEditor\n this.lastSnapshot = { editor: initialEditor, transactionNumber: 0 }\n\n this.getSnapshot = this.getSnapshot.bind(this)\n this.getServerSnapshot = this.getServerSnapshot.bind(this)\n this.watch = this.watch.bind(this)\n this.subscribe = this.subscribe.bind(this)\n }\n\n /**\n * Get the current editor instance.\n */\n getSnapshot(): EditorStateSnapshot<TEditor> {\n if (this.transactionNumber === this.lastTransactionNumber) {\n return this.lastSnapshot\n }\n this.lastTransactionNumber = this.transactionNumber\n this.lastSnapshot = { editor: this.editor, transactionNumber: this.transactionNumber }\n return this.lastSnapshot\n }\n\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot(): EditorStateSnapshot<null> {\n return { editor: null, transactionNumber: 0 }\n }\n\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(callback: () => void): () => void {\n this.subscribers.add(callback)\n return () => {\n this.subscribers.delete(callback)\n }\n }\n\n /**\n * Watch the editor instance for changes.\n */\n watch(nextEditor: Editor | null): undefined | (() => void) {\n this.editor = nextEditor as TEditor\n\n if (this.editor) {\n /**\n * This will force a re-render when the editor state changes.\n * This is to support things like `editor.can().toggleBold()` in components that `useEditor`.\n * This could be more efficient, but it's a good trade-off for now.\n */\n // Changes can emit both events, so notify only once\n let lastTransaction: unknown\n const fn = (props?: { transaction?: unknown }) => {\n if (props?.transaction !== undefined && props.transaction === lastTransaction) {\n return\n }\n lastTransaction = props?.transaction\n\n this.transactionNumber += 1\n this.subscribers.forEach(callback => callback())\n }\n\n const currentEditor = this.editor\n\n currentEditor.on('transaction', fn)\n currentEditor.on('update', fn)\n return () => {\n currentEditor.off('transaction', fn)\n currentEditor.off('update', fn)\n }\n }\n\n return undefined\n }\n}\n\n/**\n * This hook allows you to watch for changes on the editor instance.\n * It will allow you to select a part of the editor state and re-render the component when it changes.\n * @example\n * ```tsx\n * const editor = useEditor({...options})\n * const { currentSelection } = useEditorState({\n * editor,\n * selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),\n * })\n */\nexport function useEditorState<TSelectorResult>(\n options: UseEditorStateOptions<TSelectorResult, Editor>,\n): TSelectorResult\n/**\n * This hook allows you to watch for changes on the editor instance.\n * It will allow you to select a part of the editor state and re-render the component when it changes.\n * @example\n * ```tsx\n * const editor = useEditor({...options})\n * const { currentSelection } = useEditorState({\n * editor,\n * selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),\n * })\n */\nexport function useEditorState<TSelectorResult>(\n options: UseEditorStateOptions<TSelectorResult, Editor | null>,\n): TSelectorResult | null\n\n/**\n * This hook allows you to watch for changes on the editor instance.\n * It will allow you to select a part of the editor state and re-render the component when it changes.\n * @example\n * ```tsx\n * const editor = useEditor({...options})\n * const { currentSelection } = useEditorState({\n * editor,\n * selector: snapshot => ({ currentSelection: snapshot.editor.state.selection }),\n * })\n */\nexport function useEditorState<TSelectorResult>(\n options:\n | UseEditorStateOptions<TSelectorResult, Editor>\n | UseEditorStateOptions<TSelectorResult, Editor | null>,\n): TSelectorResult | null {\n const [editorStateManager] = useState(() => new EditorStateManager(options.editor))\n\n // Using the `useSyncExternalStore` hook to sync the editor instance with the component state\n const selectedState = useSyncExternalStoreWithSelector(\n editorStateManager.subscribe,\n editorStateManager.getSnapshot,\n editorStateManager.getServerSnapshot,\n options.selector as UseEditorStateOptions<TSelectorResult, Editor | null>['selector'],\n options.equalityFn ?? circularDeepEqual,\n )\n\n useIsomorphicLayoutEffect(() => {\n return editorStateManager.watch(options.editor)\n }, [options.editor, editorStateManager])\n\n useDebugValue(selectedState)\n\n return selectedState\n}\n","import { type EditorOptions, Editor } from '@tiptap/core'\nimport type { DependencyList, MutableRefObject } from 'react'\nimport { useDebugValue, useEffect, useRef, useState } from 'react'\nimport { useSyncExternalStore } from 'use-sync-external-store/shim/index.js'\n\nimport { useEditorState } from './useEditorState.js'\n\n// @ts-ignore\nconst isDev = process.env.NODE_ENV !== 'production'\nconst isSSR = typeof window === 'undefined'\nconst isNext = isSSR || Boolean(typeof window !== 'undefined' && (window as any).next)\n\n/**\n * The options for the `useEditor` hook.\n */\nexport type UseEditorOptions = Partial<EditorOptions> & {\n /**\n * Whether to render the editor on the first render.\n * If client-side rendering, set this to `true`.\n * If server-side rendering, set this to `false`.\n * @default true\n */\n immediatelyRender?: boolean\n /**\n * Whether to re-render the editor on each transaction.\n * This is legacy behavior that will be removed in future versions.\n * @default false\n */\n shouldRerenderOnTransaction?: boolean\n}\n\n/**\n * This class handles the creation, destruction, and re-creation of the editor instance.\n */\nclass EditorInstanceManager {\n /**\n * The current editor instance.\n */\n private editor: Editor | null = null\n\n /**\n * The most recent options to apply to the editor.\n */\n private options: MutableRefObject<UseEditorOptions>\n\n /**\n * The subscriptions to notify when the editor instance\n * has been created or destroyed.\n */\n private subscriptions = new Set<() => void>()\n\n /**\n * A timeout to destroy the editor if it was not mounted within a time frame.\n */\n private scheduledDestructionTimeout: ReturnType<typeof setTimeout> | undefined\n\n /**\n * Whether the editor has been mounted.\n */\n private isComponentMounted = false\n\n /**\n * The most recent dependencies array.\n */\n private previousDeps: DependencyList | null = null\n\n /**\n * The unique instance ID. This is used to identify the editor instance. And will be re-generated for each new instance.\n */\n public instanceId = ''\n\n constructor(options: MutableRefObject<UseEditorOptions>) {\n this.options = options\n this.subscriptions = new Set<() => void>()\n this.setEditor(this.getInitialEditor())\n this.scheduleDestroy()\n\n this.getEditor = this.getEditor.bind(this)\n this.getServerSnapshot = this.getServerSnapshot.bind(this)\n this.subscribe = this.subscribe.bind(this)\n this.refreshEditorInstance = this.refreshEditorInstance.bind(this)\n this.scheduleDestroy = this.scheduleDestroy.bind(this)\n this.onRender = this.onRender.bind(this)\n this.createEditor = this.createEditor.bind(this)\n }\n\n private setEditor(editor: Editor | null) {\n this.editor = editor\n this.instanceId = Math.random().toString(36).slice(2, 9)\n\n // Notify all subscribers that the editor instance has been created\n this.subscriptions.forEach(cb => cb())\n }\n\n private getInitialEditor() {\n const explicit = this.options.current.immediatelyRender\n let immediatelyRender = explicit ?? true\n\n if (isSSR) {\n if (immediatelyRender && isDev) {\n console.warn(\n 'SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches',\n )\n }\n immediatelyRender = false\n } else if (isNext && explicit === undefined) {\n immediatelyRender = false\n if (isDev) {\n console.warn(\n 'Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.',\n )\n }\n }\n\n return immediatelyRender ? this.createEditor() : null\n }\n\n /**\n * Create a new editor instance. And attach event listeners.\n */\n private createEditor(): Editor {\n const optionsToApply: Partial<EditorOptions> = {\n ...this.options.current,\n // Always call the most recent version of the callback function by default\n onBeforeCreate: (...args) => this.options.current.onBeforeCreate?.(...args),\n onBlur: (...args) => this.options.current.onBlur?.(...args),\n onCreate: (...args) => this.options.current.onCreate?.(...args),\n onDestroy: (...args) => this.options.current.onDestroy?.(...args),\n onFocus: (...args) => this.options.current.onFocus?.(...args),\n onSelectionUpdate: (...args) => this.options.current.onSelectionUpdate?.(...args),\n onTransaction: (...args) => this.options.current.onTransaction?.(...args),\n onUpdate: (...args) => this.options.current.onUpdate?.(...args),\n onContentError: (...args) => this.options.current.onContentError?.(...args),\n onDrop: (...args) => this.options.current.onDrop?.(...args),\n onPaste: (...args) => this.options.current.onPaste?.(...args),\n onDelete: (...args) => this.options.current.onDelete?.(...args),\n onMount: (...args) => this.options.current.onMount?.(...args),\n onUnmount: (...args) => this.options.current.onUnmount?.(...args),\n }\n const editor = new Editor(optionsToApply)\n\n // no need to keep track of the event listeners, they will be removed when the editor is destroyed\n\n return editor\n }\n\n /**\n * Get the current editor instance.\n */\n getEditor(): Editor | null {\n return this.editor\n }\n\n /**\n * Always disable the editor on the server-side.\n */\n getServerSnapshot(): null {\n return null\n }\n\n /**\n * Subscribe to the editor instance's changes.\n */\n subscribe(onStoreChange: () => void) {\n this.subscriptions.add(onStoreChange)\n\n return () => {\n this.subscriptions.delete(onStoreChange)\n }\n }\n\n static compareOptions(a: UseEditorOptions, b: UseEditorOptions) {\n return (Object.keys(a) as (keyof UseEditorOptions)[]).every(key => {\n if (\n [\n 'onCreate',\n 'onBeforeCreate',\n 'onDestroy',\n 'onUpdate',\n 'onTransaction',\n 'onFocus',\n 'onBlur',\n 'onSelectionUpdate',\n 'onContentError',\n 'onDrop',\n 'onPaste',\n ].includes(key)\n ) {\n // we don't want to compare callbacks, they are always different and only registered once\n return true\n }\n\n // We often encourage putting extensions inlined in the options object, so we will do a slightly deeper comparison here\n if (key === 'extensions' && a.extensions && b.extensions) {\n if (a.extensions.length !== b.extensions.length) {\n return false\n }\n return a.extensions.every((extension, index) => {\n if (extension !== b.extensions?.[index]) {\n return false\n }\n return true\n })\n }\n if (a[key] !== b[key]) {\n // if any of the options have changed, we should update the editor options\n return false\n }\n return true\n })\n }\n\n /**\n * On each render, we will create, update, or destroy the editor instance.\n * @param deps The dependencies to watch for changes\n * @returns A cleanup function\n */\n onRender(deps: DependencyList) {\n // The returned callback will run on each render\n return () => {\n this.isComponentMounted = true\n // Cleanup any scheduled destructions, since we are currently rendering\n clearTimeout(this.scheduledDestructionTimeout)\n\n if (this.editor && !this.editor.isDestroyed && deps.length === 0) {\n // if the editor does exist & deps are empty, we don't need to re-initialize the editor generally\n if (!EditorInstanceManager.compareOptions(this.options.current, this.editor.options)) {\n // But, the options are different, so we need to update the editor options\n // Still, this is faster than re-creating the editor\n this.editor.setOptions({\n ...this.options.current,\n editable: this.editor.isEditable,\n })\n }\n } else {\n // When the editor:\n // - does not yet exist\n // - is destroyed\n // - the deps array changes\n // We need to destroy the editor instance and re-initialize it\n this.refreshEditorInstance(deps)\n }\n\n return () => {\n this.isComponentMounted = false\n this.scheduleDestroy()\n }\n }\n }\n\n /**\n * Recreate the editor instance if the dependencies have changed.\n */\n private refreshEditorInstance(deps: DependencyList) {\n if (this.editor && !this.editor.isDestroyed) {\n // Editor instance already exists\n if (this.previousDeps === null) {\n // If lastDeps has not yet been initialized, reuse the current editor instance\n this.previousDeps = deps\n return\n }\n const depsAreEqual =\n this.previousDeps.length === deps.length &&\n this.previousDeps.every((dep, index) => dep === deps[index])\n\n if (depsAreEqual) {\n // deps exist and are equal, no need to recreate\n return\n }\n }\n\n if (this.editor && !this.editor.isDestroyed) {\n // Destroy the editor instance if it exists\n this.editor.destroy()\n }\n\n this.setEditor(this.createEditor())\n\n // Update the lastDeps to the current deps\n this.previousDeps = deps\n }\n\n /**\n * Schedule the destruction of the editor instance.\n * This will only destroy the editor if it was not mounted on the next tick.\n * This is to avoid destroying the editor instance when it's actually still mounted.\n */\n private scheduleDestroy() {\n const currentInstanceId = this.instanceId\n const currentEditor = this.editor\n\n // Wait two ticks to see if the component is still mounted\n this.scheduledDestructionTimeout = setTimeout(() => {\n if (this.isComponentMounted && this.instanceId === currentInstanceId) {\n // If still mounted on the following tick, with the same instanceId, do not destroy the editor\n if (currentEditor) {\n // just re-apply options as they might have changed\n currentEditor.setOptions(this.options.current)\n }\n return\n }\n if (currentEditor && !currentEditor.isDestroyed) {\n currentEditor.destroy()\n if (this.instanceId === currentInstanceId) {\n this.setEditor(null)\n }\n }\n // This allows the effect to run again between ticks\n // which may save us from having to re-create the editor\n }, 1)\n }\n}\n\n/**\n * This hook allows you to create an editor instance.\n * @param options The editor options\n * @param deps The dependencies to watch for changes\n * @returns The editor instance\n * @example const editor = useEditor({ extensions: [...] })\n */\nexport function useEditor(\n options: UseEditorOptions & { immediatelyRender: false },\n deps?: DependencyList,\n): Editor | null\n\n/**\n * This hook allows you to create an editor instance.\n * @param options The editor options\n * @param deps The dependencies to watch for changes\n * @returns The editor instance\n * @example const editor = useEditor({ extensions: [...] })\n */\nexport function useEditor(options: UseEditorOptions, deps?: DependencyList): Editor\n\nexport function useEditor(\n options: UseEditorOptions = {},\n deps: DependencyList = [],\n): Editor | null {\n const mostRecentOptions = useRef(options)\n\n mostRecentOptions.current = options\n\n const [instanceManager] = useState(() => new EditorInstanceManager(mostRecentOptions))\n\n const editor = useSyncExternalStore(\n instanceManager.subscribe,\n instanceManager.getEditor,\n instanceManager.getServerSnapshot,\n )\n\n useDebugValue(editor)\n\n // This effect will handle creating/updating the editor instance\n // oxlint-disable-next-line react-hooks/exhaustive-deps\n useEffect(instanceManager.onRender(deps))\n\n // The default behavior is to re-render on each transaction\n // This is legacy behavior that will be removed in future versions\n useEditorState({\n editor,\n selector: ({ transactionNumber }) => {\n if (\n options.shouldRerenderOnTransaction === false ||\n options.shouldRerenderOnTransaction === undefined\n ) {\n // This will prevent the editor from re-rendering on each transaction\n return null\n }\n\n // This will avoid re-rendering on the first transaction when `immediatelyRender` is set to `true`\n if (options.immediatelyRender && transactionNumber === 0) {\n return 0\n }\n return transactionNumber + 1\n },\n })\n\n return editor\n}\n","import type { Editor } from '@tiptap/core'\nimport type { HTMLAttributes, ReactNode } from 'react'\nimport React, { createContext, useContext, useMemo } from 'react'\n\nimport { EditorContent } from './EditorContent.js'\nimport type { UseEditorOptions } from './useEditor.js'\nimport { useEditor } from './useEditor.js'\n\nexport type EditorContextValue = {\n editor: Editor | null\n}\n\nexport const EditorContext = createContext<EditorContextValue>({\n editor: null,\n})\n\nexport const EditorConsumer = EditorContext.Consumer\n\n/**\n * A hook to get the current editor instance.\n */\nexport const useCurrentEditor = () => useContext(EditorContext)\n\nexport type EditorProviderProps = {\n children?: ReactNode\n slotBefore?: ReactNode\n slotAfter?: ReactNode\n editorContainerProps?: HTMLAttributes<HTMLDivElement>\n} & UseEditorOptions\n\n/**\n * This is the provider component for the editor.\n * It allows the editor to be accessible across the entire component tree\n * with `useCurrentEditor`.\n */\nexport function EditorProvider({\n children,\n slotAfter,\n slotBefore,\n editorContainerProps = {},\n ...editorOptions\n}: EditorProviderProps) {\n const editor = useEditor(editorOptions)\n const contextValue = useMemo(() => ({ editor }), [editor])\n\n if (!editor) {\n return null\n }\n\n return (\n <EditorContext.Provider value={contextValue}>\n {slotBefore}\n <EditorConsumer>\n {({ editor: currentEditor }) => (\n <EditorContent editor={currentEditor} {...editorContainerProps} />\n )}\n </EditorConsumer>\n {children}\n {slotAfter}\n </EditorContext.Provider>\n )\n}\n","import type { ReactNode } from 'react'\nimport { createContext, createElement, useContext } from 'react'\n\nexport interface ReactNodeViewContextProps {\n onDragStart?: (event: DragEvent) => void\n nodeViewContentRef?: (element: HTMLElement | null) => void\n /**\n * This allows you to add children into the NodeViewContent component.\n * This is useful when statically rendering the content of a node view.\n */\n nodeViewContentChildren?: ReactNode\n}\n\nexport const ReactNodeViewContext = createContext<ReactNodeViewContextProps>({\n onDragStart: () => {\n // no-op\n },\n nodeViewContentChildren: undefined,\n nodeViewContentRef: () => {\n // no-op\n },\n})\n\nexport const ReactNodeViewContentProvider = ({\n children,\n content,\n}: {\n children: ReactNode\n content: ReactNode\n}) => {\n return createElement(\n ReactNodeViewContext.Provider,\n { value: { nodeViewContentChildren: content } },\n children,\n )\n}\n\nexport const useReactNodeView = () => useContext(ReactNodeViewContext)\n","import type { ComponentProps } from 'react'\nimport React from 'react'\n\nimport { useReactNodeView } from './useReactNodeView.js'\n\nexport type NodeViewContentProps<T extends keyof React.JSX.IntrinsicElements = 'div'> = {\n as?: NoInfer<T>\n} & ComponentProps<T>\n\nexport function NodeViewContent<T extends keyof React.JSX.IntrinsicElements = 'div'>({\n as: Tag = 'div' as T,\n ...props\n}: NodeViewContentProps<T>) {\n const { nodeViewContentRef, nodeViewContentChildren } = useReactNodeView()\n\n return (\n // @ts-ignore\n <Tag\n {...props}\n ref={nodeViewContentRef}\n data-node-view-content=\"\"\n style={{\n whiteSpace: 'pre-wrap',\n ...props.style,\n }}\n >\n {nodeViewContentChildren}\n </Tag>\n )\n}\n","import React from 'react'\n\nimport { useReactNodeView } from './useReactNodeView.js'\n\nexport interface NodeViewWrapperProps {\n [key: string]: any\n as?: React.ElementType\n}\n\nexport const NodeViewWrapper: React.FC<NodeViewWrapperProps> = React.forwardRef((props, ref) => {\n const { onDragStart } = useReactNodeView()\n const Tag = props.as || 'div'\n\n return (\n // @ts-ignore\n <Tag\n {...props}\n ref={ref}\n data-node-view-wrapper=\"\"\n onDragStart={onDragStart}\n style={{\n whiteSpace: 'normal',\n ...props.style,\n }}\n />\n )\n})\n","import type { Editor } from '@tiptap/core'\nimport type {\n ComponentClass,\n ForwardRefExoticComponent,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n RefAttributes,\n} from 'react'\nimport { version as reactVersion } from 'react'\nimport { flushSync } from 'react-dom'\n\nimport type { EditorWithContentComponent } from './Editor.js'\n\n/**\n * Check if a component is a class component.\n * @param Component\n * @returns {boolean}\n */\nfunction isClassComponent(Component: any) {\n return !!(\n typeof Component === 'function' &&\n Component.prototype &&\n Component.prototype.isReactComponent\n )\n}\n\n/**\n * Check if a component is a forward ref component.\n * @param Component\n * @returns {boolean}\n */\nfunction isForwardRefComponent(Component: any) {\n return !!(\n typeof Component === 'object' &&\n Component.$$typeof &&\n (Component.$$typeof.toString() === 'Symbol(react.forward_ref)' ||\n Component.$$typeof.description === 'react.forward_ref')\n )\n}\n\n/**\n * Check if a component is a memoized component.\n * @param Component\n * @returns {boolean}\n */\nfunction isMemoComponent(Component: any) {\n return !!(\n typeof Component === 'object' &&\n Component.$$typeof &&\n (Component.$$typeof.toString() === 'Symbol(react.memo)' ||\n Component.$$typeof.description === 'react.memo')\n )\n}\n\n/**\n * Check if a component can safely receive a ref prop.\n * This includes class components, forwardRef components, and memoized components\n * that wrap forwardRef or class components.\n * @param Component\n * @returns {boolean}\n */\nfunction canReceiveRef(Component: any) {\n // Check if it's a class component\n if (isClassComponent(Component)) {\n return true\n }\n\n // Check if it's a forwardRef component\n if (isForwardRefComponent(Component)) {\n return true\n }\n\n // Check if it's a memoized component\n if (isMemoComponent(Component)) {\n // For memoized components, check the wrapped component\n const wrappedComponent = Component.type\n if (wrappedComponent) {\n return isClassComponent(wrappedComponent) || isForwardRefComponent(wrappedComponent)\n }\n }\n\n return false\n}\n\n/**\n * Check if we're running React 19+ by detecting if function components support ref props\n * @returns {boolean}\n */\nfunction isReact19Plus(): boolean {\n // React 19 is detected by checking React version if available\n // In practice, we'll use a more conservative approach and assume React 18 behavior\n // unless we can definitively detect React 19\n try {\n // @ts-ignore\n if (reactVersion) {\n const majorVersion = parseInt(reactVersion.split('.')[0], 10)\n return majorVersion >= 19\n }\n } catch {\n // Fallback to React 18 behavior if we can't determine version\n }\n return false\n}\n\nexport interface ReactRendererOptions {\n /**\n * The editor instance.\n * @type {Editor}\n */\n editor: Editor\n\n /**\n * The props for the component.\n * @type {Record<string, any>}\n * @default {}\n */\n props?: Record<string, any>\n\n /**\n * The tag name of the element.\n * @type {string}\n * @default 'div'\n */\n as?: string\n\n /**\n * The class name of the element.\n * @type {string}\n * @default ''\n * @example 'foo bar'\n */\n className?: string\n}\n\ntype ComponentType<R, P> =\n | ComponentClass<P>\n | FunctionComponent<P>\n | ForwardRefExoticComponent<PropsWithoutRef<P> & RefAttributes<R>>\n\n/**\n * The ReactRenderer class. It's responsible for rendering React components inside the editor.\n * @example\n * new ReactRenderer(MyComponent, {\n * editor,\n * props: {\n * foo: 'bar',\n * },\n * as: 'span',\n * })\n */\nexport class ReactRenderer<R = unknown, P extends Record<string, any> = object> {\n id: string\n\n editor: EditorWithContentComponent\n\n component: any\n\n element: HTMLElement\n\n props: P\n\n reactElement: ReactNode\n\n ref: R | null = null\n\n /**\n * Flag to track if the renderer has been destroyed, preventing queued or asynchronous renders from executing after teardown.\n */\n destroyed = false\n\n /**\n * Immediately creates element and renders the provided React component.\n */\n constructor(\n component: ComponentType<R, P>,\n { editor, props = {}, as = 'div', className = '' }: ReactRendererOptions,\n ) {\n this.id = Math.floor(Math.random() * 0xffffffff).toString()\n this.component = component\n this.editor = editor\n this.props = props as P\n this.element = document.createElement(as)\n this.element.classList.add('react-renderer')\n\n if (className) {\n this.element.classList.add(...className.split(' '))\n }\n\n if (this.editor.isEditorContentInitialized) {\n // If EditorContent is mounted, flush synchronously to maintain cursor positioning consistency.\n // Subsequent renders can be async without affecting cursor behavior.\n flushSync(() => {\n this.render()\n })\n } else {\n queueMicrotask(() => {\n if (this.destroyed) {\n return\n }\n this.render()\n })\n }\n }\n\n /**\n * Render the React component.\n */\n render(): void {\n if (this.destroyed) {\n return\n }\n\n const Component = this.component\n const props = this.props\n const editor = this.editor as EditorWithContentComponent\n\n // Handle ref forwarding with React 18/19 compatibility\n const isReact19 = isReact19Plus()\n const componentCanReceiveRef = canReceiveRef(Component)\n\n const elementProps = { ...props }\n\n // Always remove ref if the component cannot receive it (unless React 19+)\n if (elementProps.ref && !(isReact19 || componentCanReceiveRef)) {\n delete elementProps.ref\n }\n\n // Only assign our own ref if allowed\n if (!elementProps.ref && (isReact19 || componentCanReceiveRef)) {\n // @ts-ignore - Setting ref prop for compatible components\n elementProps.ref = (ref: R) => {\n this.ref = ref\n }\n }\n\n this.reactElement = <Component {...elementProps} />\n\n editor?.contentComponent?.setRenderer(this.id, this)\n }\n\n /**\n * Re-renders the React component with new props.\n * Skips the render if none of the supplied props actually changed,\n * to avoid unnecessary portal re-creation.\n */\n updateProps(props: Record<string, any> = {}): void {\n if (this.destroyed) {\n return\n }\n\n // Shallow comparison — skip if every supplied key already holds the same value.\n let changed = false\n const keys = Object.keys(props)\n\n for (let i = 0; i < keys.length; i += 1) {\n const key = keys[i]\n if (props[key] !== this.props[key]) {\n changed = true\n break\n }\n }\n\n if (!changed) {\n return\n }\n\n this.props = {\n ...this.props,\n ...props,\n }\n\n this.render()\n }\n\n /**\n * Destroy the React component.\n */\n destroy(): void {\n this.destroyed = true\n const editor = this.editor as EditorWithContentComponent\n\n editor?.contentComponent?.removeRenderer(this.id)\n // If the consumer appended the element to the document (for example\n // many demos append the renderer element to document.body), make sure\n // we remove it here to avoid leaking DOM nodes / React roots.\n try {\n if (this.element && this.element.parentNode) {\n this.element.parentNode.removeChild(this.element)\n }\n } catch {\n // ignore DOM removal errors\n }\n }\n\n /**\n * Update the attributes of the element that holds the React component.\n */\n updateAttributes(attributes: Record<string, string>): void {\n Object.keys(attributes).forEach(key => {\n this.element.setAttribute(key, attributes[key])\n })\n }\n}\n","/* oslint-disableno-shadow */\nimport type { MarkViewProps, MarkViewRenderer, MarkViewRendererOptions } from '@tiptap/core'\nimport { MarkView } from '@tiptap/core'\nimport React from 'react'\n\n// import { flushSync } from 'react-dom'\nimport { ReactRenderer } from './ReactRenderer.js'\n\nexport interface MarkViewContextProps {\n markViewContentRef: (element: HTMLElement | null) => void\n}\nexport const ReactMarkViewContext = React.createContext<MarkViewContextProps>({\n markViewContentRef: () => {\n // do nothing\n },\n})\n\nexport type MarkViewContentProps<T extends keyof React.JSX.IntrinsicElements = 'span'> = {\n as?: T\n} & Omit<React.ComponentProps<T>, 'as'>\n\nexport const MarkViewContent = <T extends keyof React.JSX.IntrinsicElements = 'span'>(\n props: MarkViewContentProps<T>,\n) => {\n const { as: Tag = 'span', ...rest } = props\n const { markViewContentRef } = React.useContext(ReactMarkViewContext)\n\n return (\n // @ts-ignore\n <Tag {...rest} ref={markViewContentRef} data-mark-view-content=\"\" />\n )\n}\n\nexport interface ReactMarkViewRendererOptions extends MarkViewRendererOptions {\n /**\n * The tag name of the element wrapping the React component.\n */\n as?: string\n className?: string\n attrs?: { [key: string]: string }\n}\n\nexport class ReactMarkView extends MarkView<\n React.ComponentType<MarkViewProps>,\n ReactMarkViewRendererOptions\n> {\n renderer: ReactRenderer\n contentDOMElement: HTMLElement\n\n constructor(\n component: React.ComponentType<MarkViewProps>,\n props: MarkViewProps,\n options?: Partial<ReactMarkViewRendererOptions>,\n ) {\n super(component, props, options)\n\n const { as = 'span', attrs, className = '' } = options || {}\n const componentProps = {\n ...props,\n updateAttributes: this.updateAttributes.bind(this),\n } satisfies MarkViewProps\n\n this.contentDOMElement = document.createElement('span')\n\n const markViewContentRef: MarkViewContextProps['markViewContentRef'] = el => {\n if (el && !el.contains(this.contentDOMElement)) {\n el.appendChild(this.contentDOMElement)\n }\n }\n const context: MarkViewContextProps = {\n markViewContentRef,\n }\n\n // For performance reasons, we memoize the provider component\n // And all of the things it requires are declared outside of the component, so it doesn't need to re-render\n const ReactMarkViewProvider: React.FunctionComponent<MarkViewProps> = React.memo(\n componentProps => {\n return (\n <ReactMarkViewContext.Provider value={context}>\n {React.createElement(component, componentProps)}\n </ReactMarkViewContext.Provider>\n )\n },\n )\n\n ReactMarkViewProvider.displayName = 'ReactMarkView'\n\n this.renderer = new ReactRenderer(ReactMarkViewProvider, {\n editor: props.editor,\n props: componentProps,\n as,\n className: `mark-${props.mark.type.name} ${className}`.trim(),\n })\n\n if (attrs) {\n this.renderer.updateAttributes(attrs)\n }\n }\n\n get dom() {\n return this.renderer.element\n }\n\n get contentDOM() {\n return this.contentDOMElement\n }\n}\n\nexport function ReactMarkViewRenderer(\n component: React.ComponentType<MarkViewProps>,\n options: Partial<ReactMarkViewRendererOptions> = {},\n): MarkViewRenderer {\n return props => new ReactMarkView(component, props, options)\n}\n","type SelectionRoot = Node & { getSelection?: () => Selection | null }\n\n/**\n * Saves the DOM selection inside `element`, returns a function to put it back.\n * Browsers drop the selection when an element moves, so restore it after the move.\n */\nexport function captureDOMSelection(element: HTMLElement): (() => void) | null {\n const root = element.getRootNode() as SelectionRoot\n const selection =\n typeof root.getSelection === 'function'\n ? root.getSelection()\n : element.ownerDocument?.defaultView?.getSelection()\n\n if (!selection || selection.rangeCount === 0) {\n return null\n }\n\n const { anchorNode, anchorOffset, focusNode, focusOffset } = selection\n\n if (!anchorNode || !focusNode) {\n return null\n }\n\n if (!element.contains(anchorNode) || !element.contains(focusNode)) {\n return null\n }\n\n return () => {\n try {\n selection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset)\n } catch {\n // The saved nodes can be gone by now.\n }\n }\n}\n","import { isTextSelection } from '@tiptap/core'\nimport type { ResolvedPos } from '@tiptap/pm/model'\nimport type { Selection } from '@tiptap/pm/state'\n\nfunction isSameAncestor($from: ResolvedPos, $to: ResolvedPos, depth: number): boolean {\n return $from.node(depth) === $to.node(depth) && $from.before(depth) === $to.before(depth)\n}\n\nexport function getTextSelectionAncestorPositions(selection: Selection): number[] {\n if (!isTextSelection(selection)) {\n return []\n }\n\n const { $from, $to } = selection\n const positions: number[] = []\n const maxDepth = Math.min($from.depth, $to.depth)\n\n for (let depth = 1; depth <= maxDepth; depth += 1) {\n if (!isSameAncestor($from, $to, depth)) {\n break\n }\n\n positions.push($from.before(depth))\n }\n\n return positions\n}\n","import type { Editor } from '@tiptap/core'\n\nimport { getTextSelectionAncestorPositions } from './lib/utils/getTextSelectionAncestorPositions.js'\n\n/** A React node view that receives `selectionInside` updates. */\ninterface TrackedNodeView {\n dom: HTMLElement\n setSelectionInside(selectionInside: boolean): void\n}\n\nclass ReactNodeViewSelectionTracker {\n private editor: Editor\n\n private views = new WeakMap<Node, TrackedNodeView>()\n\n private viewCount = 0\n\n private insideViews = new Set<TrackedNodeView>()\n\n private syncQueued = false\n\n constructor(editor: Editor) {\n this.editor = editor\n }\n\n register(view: TrackedNodeView) {\n if (this.viewCount === 0) {\n this.editor.on('transaction', this.handleTransaction)\n }\n\n this.views.set(view.dom, view)\n this.viewCount += 1\n this.scheduleSync()\n }\n\n unregister(view: TrackedNodeView) {\n this.views.delete(view.dom)\n this.viewCount -= 1\n this.insideViews.delete(view)\n\n if (this.viewCount === 0) {\n this.editor.off('transaction', this.handleTransaction)\n }\n }\n\n private scheduleSync = () => {\n if (this.syncQueued) {\n return\n }\n\n this.syncQueued = true\n\n queueMicrotask(() => {\n this.syncQueued = false\n this.sync()\n })\n }\n\n private handleTransaction = () => this.scheduleSync()\n\n private sync() {\n if (this.viewCount === 0 || this.editor.isDestroyed) {\n return\n }\n\n const nextInsideViews = this.findInsideViews()\n\n this.updateViews(this.insideViews, nextInsideViews, false)\n this.updateViews(nextInsideViews, this.insideViews, true)\n\n this.insideViews = nextInsideViews\n }\n\n private updateViews(\n views: Set<TrackedNodeView>,\n unchangedViews: Set<TrackedNodeView>,\n selectionInside: boolean,\n ) {\n for (const view of views) {\n if (!unchangedViews.has(view)) {\n view.setSelectionInside(selectionInside)\n }\n }\n }\n\n private findInsideViews(): Set<TrackedNodeView> {\n const insideViews = new Set<TrackedNodeView>()\n\n for (const position of getTextSelectionAncestorPositions(this.editor.state.selection)) {\n const dom = this.editor.view.nodeDOM(position)\n const view = dom ? this.views.get(dom) : undefined\n\n if (view) {\n insideViews.add(view)\n }\n }\n\n return insideViews\n }\n}\n\nconst trackers = new WeakMap<Editor, ReactNodeViewSelectionTracker>()\n\nexport function getReactNodeViewSelectionTracker(editor: Editor): ReactNodeViewSelectionTracker {\n let tracker = trackers.get(editor)\n\n if (!tracker) {\n tracker = new ReactNodeViewSelectionTracker(editor)\n trackers.set(editor, tracker)\n }\n\n return tracker\n}\n","import type {\n DecorationWithType,\n Editor,\n NodeViewRenderer,\n NodeViewRendererOptions,\n NodeViewRendererProps,\n} from '@tiptap/core'\nimport { getRenderedAttributes, NodeView } from '@tiptap/core'\nimport type { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport type { Decoration, DecorationSource, NodeView as ProseMirrorNodeView } from '@tiptap/pm/view'\nimport type { ComponentType, NamedExoticComponent } from 'react'\nimport { createElement, createRef, memo } from 'react'\n\nimport { captureDOMSelection } from './captureDOMSelection.js'\nimport type { EditorWithContentComponent } from './Editor.js'\nimport { getTextSelectionAncestorPositions } from './lib/utils/getTextSelectionAncestorPositions.js'\nimport { getReactNodeViewSelectionTracker } from './ReactNodeViewSelectionTracker.js'\nimport { ReactRenderer } from './ReactRenderer.js'\nimport type { ReactNodeViewProps } from './types.js'\nimport type { ReactNodeViewContextProps } from './useReactNodeView.js'\nimport { ReactNodeViewContext } from './useReactNodeView.js'\n\nexport interface ReactNodeViewRendererOptions extends NodeViewRendererOptions {\n /**\n * @deprecated Read `selectionInside` from the node view props instead.\n */\n selectedOnTextSelection?: boolean\n /**\n * This function is called when the node view is updated.\n * It allows you to compare the old node with the new node and decide if the component should update.\n */\n update:\n | ((props: {\n oldNode: ProseMirrorNode\n oldDecorations: readonly Decoration[]\n oldInnerDecorations: DecorationSource\n newNode: ProseMirrorNode\n newDecorations: readonly Decoration[]\n innerDecorations: DecorationSource\n updateProps: () => void\n }) => boolean)\n | null\n /**\n * The tag name of the element wrapping the React component.\n */\n as?: string\n /**\n * The class name of the element wrapping the React component.\n */\n className?: string\n /**\n * Attributes that should be applied to the element wrapping the React component.\n * If this is a function, it will be called each time the node view is updated.\n * If this is an object, it will be applied once when the node view is mounted.\n */\n attrs?:\n | Record<string, string>\n | ((props: {\n node: ProseMirrorNode\n HTMLAttributes: Record<string, any>\n }) => Record<string, string>)\n}\n\nexport class ReactNodeView<\n T = HTMLElement,\n Component extends ComponentType<ReactNodeViewProps<T>> = ComponentType<ReactNodeViewProps<T>>,\n NodeEditor extends Editor = Editor,\n Options extends ReactNodeViewRendererOptions = ReactNodeViewRendererOptions,\n> extends NodeView<Component, NodeEditor, Options> {\n /**\n * The renderer instance.\n */\n renderer!: ReactRenderer<unknown, ReactNodeViewProps<T>>\n\n /**\n * The element that holds the rich-text content of the node.\n */\n contentDOMElement!: HTMLElement | null\n\n /**\n * The last known position of this node view, used to detect position-only\n * changes that don't produce a new node object reference.\n */\n private currentPos: number | undefined\n\n private nodeSelected = false\n\n /**\n * Fires on editor updates when trackNodeViewPosition is enabled.\n * Detects position shifts where update() is NOT called (e.g. typing above).\n */\n private handlePositionUpdate = () => {\n const newPos = this.getPos()\n if (typeof newPos !== 'number' || newPos === this.currentPos) {\n return\n }\n this.currentPos = newPos\n this.renderer.updateProps({ getPos: () => this.getPos() })\n\n if (typeof this.options.attrs === 'function') {\n this.updateElementAttributes()\n }\n }\n\n constructor(component: Component, props: NodeViewRendererProps, options?: Partial<Options>) {\n super(component, props, options)\n\n if (!this.node.isLeaf) {\n if (this.options.contentDOMElementTag) {\n this.contentDOMElement = document.createElement(this.options.contentDOMElementTag)\n } else {\n this.contentDOMElement = document.createElement(this.node.isInline ? 'span' : 'div')\n }\n\n this.contentDOMElement.dataset.nodeViewContentReact = ''\n this.contentDOMElement.dataset.nodeViewWrapper = ''\n\n // For some reason the whiteSpace prop is not inherited properly in Chrome and Safari\n // With this fix it seems to work fine\n // See: https://github.com/ueberdosis/tiptap/issues/1197\n this.contentDOMElement.style.whiteSpace = 'inherit'\n\n const contentTarget = this.dom.querySelector('[data-node-view-content]')\n\n if (contentTarget) {\n contentTarget.appendChild(this.contentDOMElement)\n } else {\n // ProseMirror maps the selection before the queued portal render.\n this.dom.appendChild(this.contentDOMElement)\n }\n }\n\n if (this.options.trackNodeViewPosition) {\n this.editor.on('update', this.handlePositionUpdate)\n }\n }\n\n private cachedExtensionWithSyncedStorage: NodeViewRendererProps['extension'] | null = null\n\n /**\n * Returns a proxy of the extension that redirects storage access to the editor's mutable storage.\n * This preserves the original prototype chain (instanceof checks, methods like configure/extend work).\n * Cached to avoid proxy creation on every update.\n */\n get extensionWithSyncedStorage(): NodeViewRendererProps['extension'] {\n if (!this.cachedExtensionWithSyncedStorage) {\n const editor = this.editor\n const extension = this.extension\n\n this.cachedExtensionWithSyncedStorage = new Proxy(extension, {\n get(target, prop, receiver) {\n if (prop === 'storage') {\n return editor.storage[extension.name as keyof typeof editor.storage] ?? {}\n }\n return Reflect.get(target, prop, receiver)\n },\n })\n }\n\n return this.cachedExtensionWithSyncedStorage\n }\n\n /**\n * Setup the React component.\n * Called on initialization.\n */\n mount() {\n const props: Record<string, any> = {\n editor: this.editor,\n node: this.node,\n decorations: this.decorations as DecorationWithType[],\n innerDecorations: this.innerDecorations,\n view: this.view,\n selected: false,\n selectionInside: false,\n extension: this.extensionWithSyncedStorage,\n HTMLAttributes: this.HTMLAttributes,\n getPos: () => this.getPos(),\n updateAttributes: (attributes = {}) => this.updateAttributes(attributes),\n deleteNode: () => this.deleteNode(),\n ref: createRef<T>(),\n }\n\n const mountProps = props as ReactNodeViewProps<T>\n\n if (!(this.component as any).displayName) {\n const capitalizeFirstChar = (string: string): string => {\n return string.charAt(0).toUpperCase() + string.substring(1)\n }\n\n this.component.displayName = capitalizeFirstChar(this.extension.name)\n }\n\n const onDragStart = this.onDragStart.bind(this)\n const nodeViewContentRef: ReactNodeViewContextProps['nodeViewContentRef'] = element => {\n if (element && this.contentDOMElement && element.firstChild !== this.contentDOMElement) {\n // remove the nodeViewWrapper attribute from the element\n if (element.hasAttribute('data-node-view-wrapper')) {\n element.removeAttribute('data-node-view-wrapper')\n }\n\n // The caret can already be inside here. Moving would lose it.\n const restoreSelection = captureDOMSelection(this.contentDOMElement)\n\n element.appendChild(this.contentDOMElement)\n\n restoreSelection?.()\n }\n }\n const context = { onDragStart, nodeViewContentRef }\n const Component = this.component\n // For performance reasons, we memoize the provider component\n // And all of the things it requires are declared outside of the component, so it doesn't need to re-render\n const ReactNodeViewProvider: NamedExoticComponent<ReactNodeViewProps<T>> = memo(\n componentProps => {\n return (\n <ReactNodeViewContext.Provider value={context}>\n {createElement(Component, componentProps)}\n </ReactNodeViewContext.Provider>\n )\n },\n )\n\n ReactNodeViewProvider.displayName = 'ReactNodeView'\n\n let as = this.node.isInline ? 'span' : 'div'\n\n if (this.options.as) {\n as = this.options.as\n }\n\n const { className = '' } = this.options\n\n this.renderer = new ReactRenderer(ReactNodeViewProvider, {\n editor: this.editor,\n props: mountProps,\n as,\n className: `node-${this.node.type.name} ${className}`.trim(),\n })\n\n getReactNodeViewSelectionTracker(this.editor).register(this)\n this.updateElementAttributes()\n this.currentPos = this.getPos()\n }\n\n /**\n * Return the DOM element.\n * This is the element that will be used to display the node view.\n */\n get dom() {\n if (\n this.renderer.element.firstElementChild &&\n !this.renderer.element.firstElementChild?.hasAttribute('data-node-view-wrapper')\n ) {\n throw Error('Please use the NodeViewWrapper component for your node view.')\n }\n\n return this.renderer.element\n }\n\n /**\n * Return the content DOM element.\n * This is the element that will be used to display the rich-text content of the node.\n */\n get contentDOM() {\n if (this.node.isLeaf) {\n return null\n }\n\n return this.contentDOMElement\n }\n\n /**\n * On update, update the React component.\n * To prevent unnecessary updates, the `update` option can be used.\n */\n update(\n node: ProseMirrorNode,\n decorations: readonly Decoration[],\n innerDecorations: DecorationSource,\n ): boolean {\n const rerenderComponent = (props?: Record<string, any>) => {\n this.renderer.updateProps(props)\n if (typeof this.options.attrs === 'function') {\n this.updateElementAttributes()\n }\n }\n\n if (node.type !== this.node.type) {\n return false\n }\n\n if (typeof this.options.update === 'function') {\n const oldNode = this.node\n const oldDecorations = this.decorations\n const oldInnerDecorations = this.innerDecorations\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n this.currentPos = this.getPos()\n\n return this.options.update({\n oldNode,\n oldDecorations,\n newNode: node,\n newDecorations: decorations,\n oldInnerDecorations,\n innerDecorations,\n updateProps: () =>\n rerenderComponent({\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage,\n }),\n })\n }\n\n const nodeChanged = node !== this.node\n\n // Node reference unchanged — only decorations may have changed.\n // ProseMirror renders decorations independently on the contentDOM,\n // and the getPos closure (bound in mount()) calls through to\n // ProseMirror's position function at call time, so it is always\n // current. Update internal refs and skip the React re-render.\n // Keep currentPos unchanged here so the editor update listener can\n // still detect and publish a position shift for tracked node views.\n if (!nodeChanged) {\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n return true\n }\n\n const newPos = this.getPos()\n\n this.node = node\n this.decorations = decorations\n this.innerDecorations = innerDecorations\n this.currentPos = newPos\n\n const extraProps: Record<string, any> = {\n node,\n decorations,\n innerDecorations,\n extension: this.extensionWithSyncedStorage,\n }\n\n if (this.options.trackNodeViewPosition) {\n extraProps.getPos = () => this.getPos()\n }\n\n rerenderComponent(extraProps)\n return true\n }\n\n /**\n * Select the node.\n * Add the `selected` prop and the `ProseMirror-selectednode` class.\n */\n selectNode() {\n this.nodeSelected = true\n this.updateSelectedState(true)\n }\n\n /**\n * Deselect the node.\n * Remove the `selected` prop and the `ProseMirror-selectednode` class.\n */\n deselectNode() {\n this.nodeSelected = false\n this.updateSelectedState(\n this.options.selectedOnTextSelection === true && this.isTextSelectionInside(),\n )\n }\n\n setSelectionInside(selectionInside: boolean) {\n const selected =\n this.nodeSelected || (this.options.selectedOnTextSelection === true && selectionInside)\n\n this.renderer.updateProps({ selectionInside, selected })\n this.renderer.element.classList.toggle('ProseMirror-selectednode', selected)\n }\n\n private updateSelectedState(selected: boolean) {\n this.renderer.updateProps({ selected })\n this.renderer.element.classList.toggle('ProseMirror-selectednode', selected)\n }\n\n private isTextSelectionInside() {\n const pos = this.getPos()\n\n return (\n typeof pos === 'number' &&\n getTextSelectionAncestorPositions(this.editor.state.selection).includes(pos)\n )\n }\n\n /**\n * Destroy the React component instance.\n */\n destroy() {\n this.renderer.destroy()\n getReactNodeViewSelectionTracker(this.editor).unregister(this)\n\n if (this.options.trackNodeViewPosition) {\n this.editor.off('update', this.handlePositionUpdate)\n }\n\n this.contentDOMElement = null\n }\n\n /**\n * Update the attributes of the top-level element that holds the React component.\n * Applying the attributes defined in the `attrs` option.\n */\n updateElementAttributes() {\n if (this.options.attrs) {\n let attrsObj: Record<string, string> = {}\n\n if (typeof this.options.attrs === 'function') {\n const extensionAttributes = this.editor.extensionManager.attributes\n const HTMLAttributes = getRenderedAttributes(this.node, extensionAttributes)\n\n attrsObj = this.options.attrs({ node: this.node, HTMLAttributes })\n } else {\n attrsObj = this.options.attrs\n }\n\n this.renderer.updateAttributes(attrsObj)\n }\n }\n}\n\n/**\n * Create a React node view renderer.\n */\nexport function ReactNodeViewRenderer<T = HTMLElement>(\n component: ComponentType<ReactNodeViewProps<T>>,\n options?: Partial<ReactNodeViewRendererOptions>,\n): NodeViewRenderer {\n return props => {\n // try to get the parent component\n // this is important for vue devtools to show the component hierarchy correctly\n // maybe it's `undefined` because <editor-content> isn't rendered yet\n if (!(props.editor as EditorWithContentComponent).contentComponent) {\n // Return a minimal valid NodeView with a placeholder DOM element\n // to prevent ProseMirror from crashing when calling hasAttribute on undefined\n const placeholder = document.createElement('span')\n return {\n dom: placeholder,\n contentDOM: null,\n update: () => false,\n destroy: () => {},\n selectNode: () => {},\n deselectNode: () => {},\n stopEvent: () => false,\n ignoreMutation: () => true,\n } as unknown as ProseMirrorNodeView\n }\n\n return new ReactNodeView<T>(component, props, options)\n }\n}\n","import { createWidgetDecoration } from '@tiptap/core'\nimport type { Editor, WidgetDecoration, WidgetDecorationOptions } from '@tiptap/core'\nimport type { ComponentType } from 'react'\n\nimport { ReactRenderer } from './ReactRenderer.js'\n\n/**\n * Props every widget-decoration component receives in addition to the props you\n * pass through `ReactWidgetRenderer`.\n */\nexport interface ReactWidgetDecorationProps {\n editor: Editor\n getPos: () => number | undefined\n}\n\nexport interface ReactWidgetRendererOptions<\n P extends Record<string, any> = object,\n> extends WidgetDecorationOptions {\n /**\n * The editor instance.\n */\n editor: Editor\n /**\n * The document position the widget is rendered at.\n */\n pos: number\n /**\n * A stable, position-independent identifier for the widget.\n * Reusing the same key keeps the component mounted across re-renders.\n * Good: `comment-${id}`. Bad: paragraph index or document position.\n */\n key: string\n /**\n * Props passed to the component (merged with {@link ReactWidgetDecorationProps}).\n */\n props?: P\n /**\n * The tag name of the wrapper element. Defaults to `'span'` (widgets are\n * usually inline). Applied only when the renderer is first created; later\n * renders with the same `key` keep the original tag.\n */\n as?: string\n /**\n * Applied only when the renderer is first created; later renders with the\n * same `key` keep the original class.\n */\n className?: string\n}\n\nconst WIDGET_CACHE = Symbol('tiptapReactWidgetCache')\n\n/**\n * Renders a React component into a ProseMirror widget decoration.\n * Reuses Tiptap's `ReactRenderer` so the component lives in the editor's\n * React tree (context and hooks work as usual). Use a stable `key` for\n * stateful widgets.\n * @example\n * addDecorations() {\n * return {\n * create: ({ editor, state }) =>\n * findMatches(state.doc).map(match =>\n * ReactWidgetRenderer(MyWidget, {\n * editor, pos: match.pos, key: `match-${match.id}`,\n * props: { label: match.label },\n * }),\n * ),\n * }\n * }\n */\nexport function ReactWidgetRenderer<P extends Record<string, any> = object>(\n component: ComponentType<P & ReactWidgetDecorationProps>,\n options: ReactWidgetRendererOptions<P>,\n): WidgetDecoration {\n const { editor, props = {} as P, as = 'span', className } = options\n\n return createWidgetDecoration<ReactRenderer>({\n // Forwards editor, pos, key and the ProseMirror widget options unchanged.\n ...options,\n props,\n cacheKey: WIDGET_CACHE,\n context: getPos => ({ editor, getPos }),\n create: renderProps =>\n new ReactRenderer(component, {\n editor,\n as,\n className,\n props: renderProps,\n }),\n materialize: renderer => {\n // Re-register the portal on every materialization so the editor's\n // content component is available even on late first renders.\n renderer.render()\n\n return renderer.element\n },\n })\n}\n","import type { Editor } from '@tiptap/core'\nimport type { ReactNode } from 'react'\nimport { createContext, useContext, useMemo } from 'react'\n\nimport { EditorContext } from './Context.js'\nimport type { EditorContentProps, EditorStateSnapshot } from './index.js'\nimport { EditorContent, useEditorState } from './index.js'\n\n/**\n * The shape of the React context used by the `<Tiptap />` components.\n *\n * The editor instance is always available when using the default `useEditor`\n * configuration. For SSR scenarios where `immediatelyRender: false` is used,\n * consider using the legacy `EditorProvider` pattern instead.\n */\nexport type TiptapContextType = {\n /** The Tiptap editor instance. */\n editor: Editor\n}\n\n/**\n * React context that stores the current editor instance.\n *\n * Use `useTiptap()` to read from this context in child components.\n */\nexport const TiptapContext = createContext<TiptapContextType>({\n get editor(): Editor {\n throw new Error('useTiptap must be used within a <Tiptap> provider')\n },\n})\n\nTiptapContext.displayName = 'TiptapContext'\n\n/**\n * Hook to read the Tiptap context and access the editor instance.\n *\n * This is a small convenience wrapper around `useContext(TiptapContext)`.\n * The editor is always available when used within a `<Tiptap>` provider.\n *\n * @returns The current `TiptapContextType` value from the provider.\n *\n * @example\n * ```tsx\n * import { useTiptap } from '@tiptap/react'\n *\n * function Toolbar() {\n * const { editor } = useTiptap()\n *\n * return (\n * <button onClick={() => editor.chain().focus().toggleBold().run()}>\n * Bold\n * </button>\n * )\n * }\n * ```\n */\nexport const useTiptap = () => useContext(TiptapContext)\n\n/**\n * Select a slice of the editor state using the context-provided editor.\n *\n * This is a thin wrapper around `useEditorState` that reads the `editor`\n * instance from `useTiptap()` so callers don't have to pass it manually.\n *\n * @typeParam TSelectorResult - The type returned by the selector.\n * @param selector - Function that receives the editor state snapshot and\n * returns the piece of state you want to subscribe to.\n * @param equalityFn - Optional function to compare previous/next selected\n * values and avoid unnecessary updates.\n * @returns The selected slice of the editor state.\n *\n * @example\n * ```tsx\n * function WordCount() {\n * const wordCount = useTiptapState(state => {\n * const text = state.editor.state.doc.textContent\n * return text.split(/\\s+/).filter(Boolean).length\n * })\n *\n * return <span>{wordCount} words</span>\n * }\n * ```\n */\nexport function useTiptapState<TSelectorResult>(\n selector: (context: EditorStateSnapshot<Editor>) => TSelectorResult,\n equalityFn?: (a: TSelectorResult, b: TSelectorResult | null) => boolean,\n) {\n const { editor } = useTiptap()\n\n return useEditorState({\n editor,\n selector,\n equalityFn,\n })\n}\n\nexport type TiptapWrapperEditorInstanceProps =\n | {\n /**\n * The editor instance to provide to child components.\n * Use `useEditor()` to create this instance.\n */\n editor: Editor\n }\n | {\n /**\n * @deprecated Use `editor` instead. Will be removed in the next major version.\n */\n instance: Editor\n }\n\n/**\n * Props for the `Tiptap` root/provider component.\n */\nexport type TiptapWrapperProps = TiptapWrapperEditorInstanceProps & {\n children: ReactNode\n}\n\n/**\n * Top-level provider component that makes the editor instance available via\n * React context to all child components.\n *\n * This component also provides backwards compatibility with the legacy\n * `EditorContext`, so components using `useCurrentEditor()` will work\n * inside a `<Tiptap>` provider.\n *\n * @param props - Component props.\n * @returns A context provider element wrapping `children`.\n *\n * @example\n * ```tsx\n * import { Tiptap, useEditor } from '@tiptap/react'\n *\n * function App() {\n * const editor = useEditor({ extensions: [...] })\n *\n * return (\n * <Tiptap editor={editor}>\n * <Toolbar />\n * <Tiptap.Content />\n * </Tiptap>\n * )\n * }\n * ```\n */\nexport function TiptapWrapper({ children, ...props }: TiptapWrapperProps) {\n const resolvedEditor = 'editor' in props ? props.editor : props.instance\n\n if (!resolvedEditor) {\n throw new Error('Tiptap: An editor instance is required. Pass a non-null `editor` prop.')\n }\n\n const tiptapContextValue = useMemo<TiptapContextType>(\n () => ({ editor: resolvedEditor }),\n [resolvedEditor],\n )\n\n // Provide backwards compatibility with the legacy EditorContext\n // so components using useCurrentEditor() work inside <Tiptap>\n const legacyContextValue = useMemo(() => ({ editor: resolvedEditor }), [resolvedEditor])\n\n return (\n <EditorContext.Provider value={legacyContextValue}>\n <TiptapContext.Provider value={tiptapContextValue}>{children}</TiptapContext.Provider>\n </EditorContext.Provider>\n )\n}\n\nTiptapWrapper.displayName = 'Tiptap'\n\n/**\n * Convenience component that renders `EditorContent` using the context-provided\n * editor instance. Use this instead of manually passing the `editor` prop.\n *\n * @param props - All `EditorContent` props except `editor` and `ref`.\n * @returns An `EditorContent` element bound to the context editor.\n *\n * @example\n * ```tsx\n * // inside a Tiptap provider\n * <Tiptap.Content className=\"editor\" />\n * ```\n */\nexport function TiptapContent({ ...rest }: Omit<EditorContentProps, 'editor' | 'ref'>) {\n const { editor } = useTiptap()\n\n return <EditorContent editor={editor} {...rest} />\n}\n\nTiptapContent.displayName = 'Tiptap.Content'\n\n/**\n * Root `Tiptap` component. Use it as the provider for all child components.\n *\n * The exported object includes the `Content` subcomponent for rendering the\n * editor content area.\n *\n * This component provides both the new `TiptapContext` (accessed via `useTiptap()`)\n * and the legacy `EditorContext` (accessed via `useCurrentEditor()`) for\n * backwards compatibility.\n *\n * For bubble menus and floating menus, import them separately from\n * `@tiptap/react/menus` to keep floating-ui as an optional dependency.\n *\n * @example\n * ```tsx\n * import { Tiptap, useEditor } from '@tiptap/react'\n * import { BubbleMenu } from '@tiptap/react/menus'\n *\n * function App() {\n * const editor = useEditor({ extensions: [...] })\n *\n * return (\n * <Tiptap editor={editor}>\n * <Tiptap.Content />\n * <BubbleMenu>\n * <button onClick={() => editor.chain().focus().toggleBold().run()}>Bold</button>\n * </BubbleMenu>\n * </Tiptap>\n * )\n * }\n * ```\n */\nexport const Tiptap = Object.assign(TiptapWrapper, {\n /**\n * The Tiptap Content component that renders the EditorContent with the editor instance from the context.\n * @see TiptapContent\n */\n Content: TiptapContent,\n})\n\nexport default Tiptap\n"],"mappings":";;;;;;;;;;;AAQA,SAAgB,kBAAkB,QAAgB,OAAyB;;CACzE,IACE,OAAO,eACP,MAAM,oBACN,CAAC,MAAM,cACP,CAAC,OAAO,cACP,MAAM,cAAc,qBAAqB,MAAM,cAAc,qBAC7D,CAAC,MAAM,KAAK,CAAC,UAAU,GAExB;CAGF,MAAM,OAAO,OAAO;CACpB,MAAM,OAAO,KAAK;CAClB,MAAM,aAAA,sBAAA,sBAAY,KAAK,kBAAA,QAAA,wBAAA,KAAA,IAAA,KAAA,IAAA,oBAAA,KAAA,IAAe,OAAA,QAAA,uBAAA,KAAA,IAAA,qBAAK,KAAK,IAAI,cAAc,aAAa;CAC/E,MAAM,SAAA,cAAA,QAAA,cAAA,KAAA,IAAA,KAAA,IAAS,UAAW;CAC1B,MAAM,WAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IAAU,OAAQ,cAAa,IAAK,SAAA,WAAA,QAAA,WAAA,KAAA,IAAA,KAAA,IAAqB,OAAQ;CACvE,MAAM,aAAA,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAa,QAAS,QAAQ,gCA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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["PluginKey","useLayoutEffect","useEffect","useRef","React","useRef","useCurrentEditor","useState","BubbleMenuPlugin","createPortal","React","useRef","useCurrentEditor","useState","FloatingMenuPlugin","createPortal"],"sources":["../../src/menus/getAutoPluginKey.ts","../../src/menus/useMenuElementProps.ts","../../src/menus/BubbleMenu.tsx","../../src/menus/FloatingMenu.tsx"],"sourcesContent":["import { PluginKey } from '@tiptap/pm/state'\n\nexport function getAutoPluginKey(pluginKey: PluginKey | string | undefined, defaultName: string) {\n return pluginKey ?? new PluginKey(defaultName)\n}\n","import type { CSSProperties, HTMLAttributes } from 'react'\nimport { useEffect, useLayoutEffect, useRef } from 'react'\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect\n\ntype MenuElementProps = HTMLAttributes<HTMLDivElement>\ntype MenuSyntheticEvent = Event & {\n nativeEvent: Event\n currentTarget: HTMLDivElement\n target: EventTarget | null\n persist: () => void\n isDefaultPrevented: () => boolean\n isPropagationStopped: () => boolean\n}\ntype MenuEventListener = (event: MenuSyntheticEvent) => void\ntype MenuNativeListener = (event: Event) => void\ntype MenuEventListenerOptions = {\n capture?: boolean\n}\n\ntype EventListenerEntry = {\n eventName: string\n listener: MenuNativeListener\n options?: MenuEventListenerOptions\n}\n\nconst PLUGIN_MANAGED_STYLE_PROPERTIES = new Set([\n 'left',\n 'opacity',\n 'position',\n 'top',\n 'visibility',\n 'width',\n])\nconst UNITLESS_STYLE_PROPERTIES = new Set([\n 'animationIterationCount',\n 'aspectRatio',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'columnCount',\n 'columns',\n 'fillOpacity',\n 'flex',\n 'flexGrow',\n 'flexShrink',\n 'fontWeight',\n 'gridArea',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnStart',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowStart',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'scale',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n])\nconst ATTRIBUTE_EXCLUSIONS = new Set(['children', 'className', 'style'])\nconst DIRECT_PROPERTY_KEYS = new Set(['tabIndex'])\nconst FORWARDED_ATTRIBUTE_KEYS = new Set([\n 'accessKey',\n 'autoCapitalize',\n 'contentEditable',\n 'contextMenu',\n 'dir',\n 'draggable',\n 'enterKeyHint',\n 'hidden',\n 'id',\n 'lang',\n 'nonce',\n 'role',\n 'slot',\n 'spellCheck',\n 'tabIndex',\n 'title',\n 'translate',\n])\nconst SPECIAL_EVENT_NAMES: Record<string, string> = {\n Blur: 'focusout',\n DoubleClick: 'dblclick',\n Focus: 'focusin',\n MouseEnter: 'mouseenter',\n MouseLeave: 'mouseleave',\n}\n\nfunction isEventProp(key: string, value: unknown): value is MenuEventListener {\n return /^on[A-Z]/.test(key) && typeof value === 'function'\n}\n\nfunction toAttributeName(key: string) {\n if (key.startsWith('aria-') || key.startsWith('data-')) {\n return key\n }\n\n return key\n}\n\nfunction isForwardedAttributeKey(key: string) {\n return key.startsWith('aria-') || key.startsWith('data-') || FORWARDED_ATTRIBUTE_KEYS.has(key)\n}\n\nfunction toStylePropertyName(key: string) {\n if (key.startsWith('--')) {\n return key\n }\n\n return key.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)\n}\n\nfunction toEventConfig(key: string) {\n const useCapture = key.endsWith('Capture')\n const baseKey = useCapture ? key.slice(0, -7) : key\n const reactEventName = baseKey.slice(2)\n const eventName = SPECIAL_EVENT_NAMES[reactEventName] ?? reactEventName.toLowerCase()\n\n return {\n eventName,\n options: useCapture ? { capture: true } : undefined,\n }\n}\n\nfunction createSyntheticEvent(element: HTMLDivElement, nativeEvent: Event): MenuSyntheticEvent {\n let defaultPrevented = nativeEvent.defaultPrevented\n let propagationStopped = false\n const syntheticEvent = Object.create(nativeEvent)\n\n Object.defineProperties(syntheticEvent, {\n nativeEvent: { value: nativeEvent },\n currentTarget: { value: element },\n target: { value: nativeEvent.target },\n persist: { value: () => undefined },\n isDefaultPrevented: { value: () => defaultPrevented },\n isPropagationStopped: { value: () => propagationStopped },\n preventDefault: {\n value: () => {\n defaultPrevented = true\n nativeEvent.preventDefault()\n },\n },\n stopPropagation: {\n value: () => {\n propagationStopped = true\n nativeEvent.stopPropagation()\n },\n },\n })\n\n return syntheticEvent as MenuSyntheticEvent\n}\n\nfunction isDirectPropertyKey(key: string) {\n return DIRECT_PROPERTY_KEYS.has(key)\n}\n\nfunction setDirectProperty(element: HTMLDivElement, key: string, value: unknown) {\n if (key === 'tabIndex') {\n element.tabIndex = Number(value)\n return\n }\n\n ;(element as unknown as Record<string, unknown>)[key] = value\n}\n\nfunction clearDirectProperty(element: HTMLDivElement, key: string) {\n if (key === 'tabIndex') {\n element.removeAttribute('tabindex')\n return\n }\n\n const propertyValue = (element as unknown as Record<string, unknown>)[key]\n\n if (typeof propertyValue === 'boolean') {\n ;(element as unknown as Record<string, unknown>)[key] = false\n return\n }\n\n if (typeof propertyValue === 'number') {\n ;(element as unknown as Record<string, unknown>)[key] = 0\n return\n }\n\n ;(element as unknown as Record<string, unknown>)[key] = ''\n}\n\nfunction toStyleValue(styleName: string, value: string | number) {\n if (\n typeof value !== 'number' ||\n value === 0 ||\n styleName.startsWith('--') ||\n UNITLESS_STYLE_PROPERTIES.has(styleName)\n ) {\n return String(value)\n }\n\n return `${value}px`\n}\n\nfunction removeStyleProperty(element: HTMLDivElement, styleName: string) {\n if (PLUGIN_MANAGED_STYLE_PROPERTIES.has(styleName)) {\n return\n }\n\n element.style.removeProperty(toStylePropertyName(styleName))\n}\n\nfunction applyStyleProperty(element: HTMLDivElement, styleName: string, value: string | number) {\n if (PLUGIN_MANAGED_STYLE_PROPERTIES.has(styleName)) {\n return\n }\n\n element.style.setProperty(toStylePropertyName(styleName), toStyleValue(styleName, value))\n}\n\nfunction syncAttributes(\n element: HTMLDivElement,\n prevProps: MenuElementProps,\n nextProps: MenuElementProps,\n) {\n const allKeys = new Set([...Object.keys(prevProps), ...Object.keys(nextProps)])\n\n allKeys.forEach(key => {\n if (\n ATTRIBUTE_EXCLUSIONS.has(key) ||\n !isForwardedAttributeKey(key) ||\n isEventProp(key, prevProps[key as keyof MenuElementProps]) ||\n isEventProp(key, nextProps[key as keyof MenuElementProps])\n ) {\n return\n }\n\n const prevValue = prevProps[key as keyof MenuElementProps]\n const nextValue = nextProps[key as keyof MenuElementProps]\n\n if (prevValue === nextValue) {\n return\n }\n\n const attributeName = toAttributeName(key)\n\n if (nextValue == null || nextValue === false) {\n if (isDirectPropertyKey(key)) {\n clearDirectProperty(element, key)\n }\n\n element.removeAttribute(attributeName)\n return\n }\n\n if (nextValue === true) {\n if (isDirectPropertyKey(key)) {\n setDirectProperty(element, key, true)\n }\n\n element.setAttribute(attributeName, '')\n return\n }\n\n if (isDirectPropertyKey(key)) {\n setDirectProperty(element, key, nextValue)\n return\n }\n\n element.setAttribute(attributeName, String(nextValue))\n })\n}\n\nfunction syncClassName(element: HTMLDivElement, prevClassName?: string, nextClassName?: string) {\n if (prevClassName === nextClassName) {\n return\n }\n\n if (nextClassName) {\n element.className = nextClassName\n return\n }\n\n element.removeAttribute('class')\n}\n\nfunction syncStyles(\n element: HTMLDivElement,\n prevStyle: CSSProperties | undefined,\n nextStyle: CSSProperties | undefined,\n) {\n const previousStyle = prevStyle ?? {}\n const currentStyle = nextStyle ?? {}\n const allStyleNames = new Set([...Object.keys(previousStyle), ...Object.keys(currentStyle)])\n\n allStyleNames.forEach(styleName => {\n const prevValue = previousStyle[styleName as keyof CSSProperties]\n const nextValue = currentStyle[styleName as keyof CSSProperties]\n\n if (prevValue === nextValue) {\n return\n }\n\n if (nextValue == null) {\n removeStyleProperty(element, styleName)\n return\n }\n\n applyStyleProperty(element, styleName, nextValue as string | number)\n })\n}\n\nfunction syncEventListeners(\n element: HTMLDivElement,\n prevListeners: EventListenerEntry[],\n nextProps: MenuElementProps,\n) {\n prevListeners.forEach(({ eventName, listener, options }) => {\n element.removeEventListener(eventName, listener, options)\n })\n\n const nextListeners: EventListenerEntry[] = []\n\n Object.entries(nextProps).forEach(([key, value]) => {\n if (!isEventProp(key, value)) {\n return\n }\n\n const { eventName, options } = toEventConfig(key)\n const listener: MenuNativeListener = event => {\n value(createSyntheticEvent(element, event))\n }\n\n element.addEventListener(eventName, listener, options)\n nextListeners.push({ eventName, listener, options })\n })\n\n return nextListeners\n}\n\nexport function useMenuElementProps(element: HTMLDivElement, props: MenuElementProps) {\n const previousPropsRef = useRef<MenuElementProps>({})\n const listenersRef = useRef<EventListenerEntry[]>([])\n\n useIsomorphicLayoutEffect(() => {\n const previousProps = previousPropsRef.current\n\n syncClassName(element, previousProps.className, props.className)\n syncStyles(element, previousProps.style, props.style)\n syncAttributes(element, previousProps, props)\n listenersRef.current = syncEventListeners(element, listenersRef.current, props)\n previousPropsRef.current = props\n\n return () => {\n listenersRef.current.forEach(({ eventName, listener, options }) => {\n element.removeEventListener(eventName, listener, options)\n })\n listenersRef.current = []\n }\n }, [element, props])\n}\n","import { type BubbleMenuPluginProps, BubbleMenuPlugin } from '@tiptap/extension-bubble-menu'\nimport type { PluginKey } from '@tiptap/pm/state'\nimport { useCurrentEditor } from '@tiptap/react'\nimport React, { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { getAutoPluginKey } from './getAutoPluginKey.js'\nimport { useMenuElementProps } from './useMenuElementProps.js'\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type BubbleMenuProps = Optional<\n Omit<Optional<BubbleMenuPluginProps, 'pluginKey'>, 'element'>,\n 'editor'\n> &\n React.HTMLAttributes<HTMLDivElement>\n\nexport const BubbleMenu = React.forwardRef<HTMLDivElement, BubbleMenuProps>(\n (\n {\n pluginKey,\n editor,\n updateDelay,\n resizeDelay,\n appendTo,\n shouldShow = null,\n getReferencedVirtualElement,\n options,\n children,\n ...restProps\n },\n ref,\n ) => {\n const menuEl = useRef(document.createElement('div'))\n const resolvedPluginKey = useRef<PluginKey | string>(\n getAutoPluginKey(pluginKey, 'bubbleMenu'),\n ).current\n\n useMenuElementProps(menuEl.current, restProps)\n\n if (typeof ref === 'function') {\n ref(menuEl.current)\n } else if (ref) {\n ref.current = menuEl.current\n }\n\n const { editor: currentEditor } = useCurrentEditor()\n\n /**\n * The editor instance where the bubble menu plugin will be registered.\n */\n const pluginEditor = editor || currentEditor\n\n // Creating a useMemo would be more computationally expensive than just\n // re-creating this object on every render.\n const bubbleMenuPluginProps: Omit<BubbleMenuPluginProps, 'editor' | 'element'> = {\n updateDelay,\n resizeDelay,\n appendTo,\n pluginKey: resolvedPluginKey,\n shouldShow,\n getReferencedVirtualElement,\n options,\n }\n /**\n * The props for the bubble menu plugin. They are accessed inside a ref to\n * avoid running the useEffect hook and re-registering the plugin when the\n * props change.\n */\n const bubbleMenuPluginPropsRef = useRef(bubbleMenuPluginProps)\n bubbleMenuPluginPropsRef.current = bubbleMenuPluginProps\n\n /**\n * Track whether the plugin has been initialized, so we only send updates\n * after the initial registration.\n */\n const [pluginInitialized, setPluginInitialized] = useState(false)\n\n /**\n * Track whether we need to skip the first options update dispatch.\n * This prevents unnecessary updates right after plugin initialization.\n */\n const skipFirstUpdateRef = useRef(true)\n\n useEffect(() => {\n if (pluginEditor?.isDestroyed) {\n return\n }\n\n if (!pluginEditor) {\n console.warn(\n 'BubbleMenu component is not rendered inside of an editor component or does not have editor prop.',\n )\n return\n }\n\n const bubbleMenuElement = menuEl.current\n bubbleMenuElement.style.visibility = 'hidden'\n bubbleMenuElement.style.position = 'absolute'\n\n const plugin = BubbleMenuPlugin({\n ...bubbleMenuPluginPropsRef.current,\n editor: pluginEditor,\n element: bubbleMenuElement,\n })\n\n pluginEditor.registerPlugin(plugin)\n\n const createdPluginKey = bubbleMenuPluginPropsRef.current.pluginKey\n\n skipFirstUpdateRef.current = true\n setPluginInitialized(true)\n\n return () => {\n setPluginInitialized(false)\n pluginEditor.unregisterPlugin(createdPluginKey)\n window.requestAnimationFrame(() => {\n if (bubbleMenuElement.parentNode) {\n bubbleMenuElement.parentNode.removeChild(bubbleMenuElement)\n }\n })\n }\n }, [pluginEditor])\n\n /**\n * Update the plugin options when props change after the plugin has been initialized.\n * This allows dynamic updates to options like scrollTarget without re-registering the entire plugin.\n */\n useEffect(() => {\n if (!pluginInitialized || !pluginEditor || pluginEditor.isDestroyed) {\n return\n }\n\n // Skip the first update right after initialization since the plugin was just created with these options\n if (skipFirstUpdateRef.current) {\n skipFirstUpdateRef.current = false\n return\n }\n\n pluginEditor.view.dispatch(\n pluginEditor.state.tr.setMeta(resolvedPluginKey, {\n type: 'updateOptions',\n options: bubbleMenuPluginPropsRef.current,\n }),\n )\n }, [\n pluginInitialized,\n pluginEditor,\n updateDelay,\n resizeDelay,\n shouldShow,\n options,\n appendTo,\n getReferencedVirtualElement,\n resolvedPluginKey,\n ])\n\n return createPortal(children, menuEl.current)\n },\n)\n","import type { FloatingMenuPluginProps } from '@tiptap/extension-floating-menu'\nimport { FloatingMenuPlugin } from '@tiptap/extension-floating-menu'\nimport type { PluginKey } from '@tiptap/pm/state'\nimport { useCurrentEditor } from '@tiptap/react'\nimport React, { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { getAutoPluginKey } from './getAutoPluginKey.js'\nimport { useMenuElementProps } from './useMenuElementProps.js'\n\ntype Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type FloatingMenuProps = Omit<\n Optional<FloatingMenuPluginProps, 'pluginKey'>,\n 'element' | 'editor'\n> & {\n editor: FloatingMenuPluginProps['editor'] | null\n options?: FloatingMenuPluginProps['options']\n} & React.HTMLAttributes<HTMLDivElement>\n\nexport const FloatingMenu = React.forwardRef<HTMLDivElement, FloatingMenuProps>(\n (\n {\n pluginKey,\n editor,\n updateDelay,\n resizeDelay,\n appendTo,\n shouldShow = null,\n options,\n children,\n ...restProps\n },\n ref,\n ) => {\n const menuEl = useRef(document.createElement('div'))\n const resolvedPluginKey = useRef<PluginKey | string>(\n getAutoPluginKey(pluginKey, 'floatingMenu'),\n ).current\n\n useMenuElementProps(menuEl.current, restProps)\n\n if (typeof ref === 'function') {\n ref(menuEl.current)\n } else if (ref) {\n ref.current = menuEl.current\n }\n\n const { editor: currentEditor } = useCurrentEditor()\n\n /**\n * The editor instance where the floating menu plugin will be registered.\n */\n const pluginEditor = editor || currentEditor\n\n // Creating a useMemo would be more computationally expensive than just\n // re-creating this object on every render.\n const floatingMenuPluginProps: Omit<FloatingMenuPluginProps, 'editor' | 'element'> = {\n updateDelay,\n resizeDelay,\n appendTo,\n pluginKey: resolvedPluginKey,\n shouldShow,\n options,\n }\n\n /**\n * The props for the floating menu plugin. They are accessed inside a ref to\n * avoid running the useEffect hook and re-registering the plugin when the\n * props change.\n */\n const floatingMenuPluginPropsRef = useRef(floatingMenuPluginProps)\n floatingMenuPluginPropsRef.current = floatingMenuPluginProps\n\n /**\n * Track whether the plugin has been initialized, so we only send updates\n * after the initial registration.\n */\n const [pluginInitialized, setPluginInitialized] = useState(false)\n\n /**\n * Track whether we need to skip the first options update dispatch.\n * This prevents unnecessary updates right after plugin initialization.\n */\n const skipFirstUpdateRef = useRef(true)\n\n useEffect(() => {\n if (pluginEditor?.isDestroyed) {\n return\n }\n\n if (!pluginEditor) {\n console.warn(\n 'FloatingMenu component is not rendered inside of an editor component or does not have editor prop.',\n )\n return\n }\n\n const floatingMenuElement = menuEl.current\n floatingMenuElement.style.visibility = 'hidden'\n floatingMenuElement.style.position = 'absolute'\n\n const plugin = FloatingMenuPlugin({\n ...floatingMenuPluginPropsRef.current,\n editor: pluginEditor,\n element: floatingMenuElement,\n })\n\n pluginEditor.registerPlugin(plugin)\n\n const createdPluginKey = floatingMenuPluginPropsRef.current.pluginKey\n\n skipFirstUpdateRef.current = true\n setPluginInitialized(true)\n\n return () => {\n setPluginInitialized(false)\n pluginEditor.unregisterPlugin(createdPluginKey)\n window.requestAnimationFrame(() => {\n if (floatingMenuElement.parentNode) {\n floatingMenuElement.parentNode.removeChild(floatingMenuElement)\n }\n })\n }\n }, [pluginEditor])\n\n /**\n * Update the plugin options when props change after the plugin has been initialized.\n * This allows dynamic updates to options like scrollTarget without re-registering the entire plugin.\n */\n useEffect(() => {\n if (!pluginInitialized || !pluginEditor || pluginEditor.isDestroyed) {\n return\n }\n\n // Skip the first update right after initialization since the plugin was just created with these options\n if (skipFirstUpdateRef.current) {\n skipFirstUpdateRef.current = false\n return\n }\n\n pluginEditor.view.dispatch(\n pluginEditor.state.tr.setMeta(resolvedPluginKey, {\n type: 'updateOptions',\n options: floatingMenuPluginPropsRef.current,\n }),\n )\n }, [\n pluginInitialized,\n pluginEditor,\n updateDelay,\n resizeDelay,\n shouldShow,\n options,\n appendTo,\n resolvedPluginKey,\n ])\n\n return createPortal(children, menuEl.current)\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAgB,iBAAiB,WAA2C,aAAqB;CAC/F,OAAO,cAAA,QAAA,cAAA,KAAA,IAAA,YAAa,IAAIA,iBAAAA,UAAU,WAAW;AAC/C;;;ACDA,MAAM,4BAA4B,OAAO,WAAW,cAAcC,MAAAA,kBAAkBC,MAAAA;AAuBpF,MAAM,kDAAkC,IAAI,IAAI;CAC9C;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,4CAA4B,IAAI,IAAI;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AACD,MAAM,uCAAuB,IAAI,IAAI;CAAC;CAAY;CAAa;AAAO,CAAC;AACvE,MAA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sx"],"mappings":";;;;KASK,WAAS,GAAG,gBAAgB,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,GAAG;KAExD,kBAAkB,WAC5B,KAAK,WAAS,6DAGd,MAAM,eAAe;cAEV,YAAU,MAAA,0BAAA,KAAA,QAAA,KAAA,WAAA,8DAAA,KAAA,KAAA,WAAA,6DAAA,MAAA,eAAA,kBAAA,MAAA,cAAA;;;KCPlB,SAAS,GAAG,gBAAgB,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,GAAG;KAExD,oBAAoB,KAC9B,SAAS;EAGT,QAAQ;EACR,UAAU;IACR,MAAM,eAAe;cAEZ,cAAY,MAAA,0BAAA,KAAA,SAAA;EAJf,QAAA;EACE,UAAA;IA+IX,MAAA,eAAA,kBAAA,MAAA,cAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/menus/BubbleMenu.tsx","../../src/menus/FloatingMenu.tsx"],"mappings":";;;;KASK,WAAS,GAAG,gBAAgB,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,GAAG;KAExD,kBAAkB,WAC5B,KAAK,WAAS,6DAGd,MAAM,eAAe;cAEV,YAAU,MAAA,0BAAA,KAAA,QAAA,KAAA,WAAA,8DAAA,KAAA,KAAA,WAAA,6DAAA,MAAA,eAAA,kBAAA,MAAA,cAAA;;;KCPlB,SAAS,GAAG,gBAAgB,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,GAAG;KAExD,oBAAoB,KAC9B,SAAS;EAGT,QAAQ;EACR,UAAU;IACR,MAAM,eAAe;cAEZ,cAAY,MAAA,0BAAA,KAAA,SAAA;EAJf,QAAA;EACE,UAAA;IA+IX,MAAA,eAAA,kBAAA,MAAA,cAAA"}
|