@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.js","names":["Node"],"sources":["../../src/utils/parseAlign.ts","../../src/table/utilities/colStyle.ts","../../src/table/TableView.ts","../../src/table/utilities/createColGroup.ts","../../src/table/utilities/createCell.ts","../../src/table/utilities/getTableNodeTypes.ts","../../src/table/utilities/createTable.ts","../../src/table/utilities/isCellSelection.ts","../../src/table/utilities/deleteTableWhenAllCellsSelected.ts","../../src/table/utilities/keepCursorInTable.ts","../../src/table/utilities/markdown.ts","../../src/table/utilities/preserveCellSelectionOnContextMenu.ts","../../src/table/table.ts"],"sourcesContent":["import { type Attribute, isValidCSSStyleValue } from '@tiptap/core'\n\n/**\n * Supported table cell alignment values\n */\nexport enum TableCellAlign {\n Left = 'left',\n Right = 'right',\n Center = 'center',\n}\n\n/**\n * Normalize unknown input into a supported table alignment\n *\n * @param value - A potential alignment value\n * @returns A valid TableCellAlign value or null\n */\nexport function normalizeTableCellAlign(value: unknown): TableCellAlign | null {\n if (\n value === TableCellAlign.Left ||\n value === TableCellAlign.Right ||\n value === TableCellAlign.Center\n ) {\n return value\n }\n\n return null\n}\n\n/**\n * Parse table cell alignment from an HTML element\n *\n * Prefers inline style (${\"`\"}text-align${\"`\"}) and falls back to the legacy\n * ${\"`\"}align${\"`\"} attribute.\n *\n * @param element - The table cell/header DOM element\n * @returns A valid TableCellAlign value or null\n */\nfunction parseAlign(element: HTMLElement): TableCellAlign | null {\n const styleAlign = (element.style.textAlign || '').trim().toLowerCase()\n const attrAlign = (element.getAttribute('align') || '').trim().toLowerCase()\n const align = styleAlign || attrAlign\n\n return normalizeTableCellAlign(align)\n}\n\n/**\n * Normalize alignment from a generic attrs object that may include an align field\n *\n * @param attributes - A node attrs-like object with an optional align field\n * @returns A valid TableCellAlign value or null.\n */\nexport function normalizeTableCellAlignFromAttributes(\n attributes: { align?: TableCellAlign } | null | undefined,\n): TableCellAlign | null {\n return normalizeTableCellAlign(attributes?.align)\n}\n\n/**\n * Create a reusable Tiptap attribute config for table alignment\n *\n * @returns A Tiptap Attribute definition that parses and renders table alignment\n */\nexport function createAlignAttribute(): Attribute {\n return {\n default: null,\n parseHTML: (element: HTMLElement) => parseAlign(element),\n renderHTML: (attributes: { align?: unknown }) => {\n const align = normalizeTableCellAlign(attributes.align)\n\n if (!isValidCSSStyleValue(align)) {\n return {}\n }\n\n return {\n style: `text-align: ${align}`,\n }\n },\n }\n}\n","export function getColStyleDeclaration(\n minWidth: number,\n width: number | undefined,\n): [string, string] {\n if (width) {\n // apply the stored width unless it is below the configured minimum cell width\n return ['width', `${Math.max(width, minWidth)}px`]\n }\n\n // set the minimum with on the column if it has no stored width\n return ['min-width', `${minWidth}px`]\n}\n","import type { Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport type { EditorView, NodeView, ViewMutationRecord } from '@tiptap/pm/view'\n\nimport { getColStyleDeclaration } from './utilities/colStyle.js'\n\nexport function updateColumns(\n node: ProseMirrorNode,\n colgroup: HTMLTableColElement, // <colgroup> has the same prototype as <col>\n table: HTMLTableElement,\n cellMinWidth: number,\n overrideCol?: number,\n overrideValue?: number,\n) {\n let totalWidth = 0\n let fixedWidth = true\n let nextDOM = colgroup.firstChild\n const row = node.firstChild\n\n if (row !== null) {\n for (let i = 0, col = 0; i < row.childCount; i += 1) {\n const { colspan, colwidth } = row.child(i).attrs\n\n for (let j = 0; j < colspan; j += 1, col += 1) {\n const hasWidth =\n overrideCol === col ? overrideValue : ((colwidth && colwidth[j]) as number | undefined)\n const cssWidth = hasWidth ? `${hasWidth}px` : ''\n\n totalWidth += hasWidth || cellMinWidth\n\n if (!hasWidth) {\n fixedWidth = false\n }\n\n if (!nextDOM) {\n const colElement = document.createElement('col')\n\n const [propertyKey, propertyValue] = getColStyleDeclaration(cellMinWidth, hasWidth)\n\n colElement.style.setProperty(propertyKey, propertyValue)\n\n colgroup.appendChild(colElement)\n } else {\n if ((nextDOM as HTMLTableColElement).style.width !== cssWidth) {\n const [propertyKey, propertyValue] = getColStyleDeclaration(cellMinWidth, hasWidth)\n\n ;(nextDOM as HTMLTableColElement).style.setProperty(propertyKey, propertyValue)\n }\n\n nextDOM = nextDOM.nextSibling\n }\n }\n }\n }\n\n while (nextDOM) {\n const after = nextDOM.nextSibling\n\n nextDOM.parentNode?.removeChild(nextDOM)\n nextDOM = after\n }\n\n // Check if user has set a width style on the table node\n const hasUserWidth =\n node.attrs.style &&\n typeof node.attrs.style === 'string' &&\n /\\bwidth\\s*:/i.test(node.attrs.style)\n\n if (fixedWidth && !hasUserWidth) {\n table.style.width = `${totalWidth}px`\n table.style.minWidth = ''\n } else {\n table.style.width = ''\n table.style.minWidth = `${totalWidth}px`\n }\n}\n\nexport class TableView implements NodeView {\n node: ProseMirrorNode\n\n cellMinWidth: number\n\n dom: HTMLDivElement\n\n table: HTMLTableElement\n\n colgroup: HTMLTableColElement\n\n contentDOM: HTMLTableSectionElement\n\n constructor(\n node: ProseMirrorNode,\n cellMinWidth: number,\n _view?: EditorView,\n HTMLAttributes: Record<string, any> = {},\n ) {\n this.node = node\n this.cellMinWidth = cellMinWidth\n this.dom = document.createElement('div')\n this.dom.className = 'tableWrapper'\n this.table = this.dom.appendChild(document.createElement('table'))\n\n // Apply extension-configured HTMLAttributes to the table element\n // (e.g. class, data-* set via Table.configure({ HTMLAttributes }))\n for (const [key, value] of Object.entries(HTMLAttributes)) {\n if (value !== undefined && value !== null) {\n if (key === 'style') {\n this.table.style.cssText = String(value)\n } else {\n this.table.setAttribute(key, String(value))\n }\n }\n }\n\n // Apply user styles from the ProseMirror document node.\n // This may come from HTML parsing (e.g. <table style=\"...\">) and should\n // override any style set via extension-configured HTMLAttributes above.\n if (node.attrs.style) {\n this.table.style.cssText = node.attrs.style\n }\n\n this.colgroup = this.table.appendChild(document.createElement('colgroup'))\n updateColumns(node, this.colgroup, this.table, cellMinWidth)\n this.contentDOM = this.table.appendChild(document.createElement('tbody'))\n }\n\n update(node: ProseMirrorNode) {\n if (node.type !== this.node.type) {\n return false\n }\n\n this.node = node\n updateColumns(node, this.colgroup, this.table, this.cellMinWidth)\n\n return true\n }\n\n ignoreMutation(mutation: ViewMutationRecord) {\n const target = mutation.target as Node\n const isInsideWrapper = this.dom.contains(target)\n const isInsideContent = this.contentDOM.contains(target)\n\n if (isInsideWrapper && !isInsideContent) {\n if (\n mutation.type === 'attributes' ||\n mutation.type === 'childList' ||\n mutation.type === 'characterData'\n ) {\n return true\n }\n }\n\n return false\n }\n}\n","import type { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model'\n\nimport { getColStyleDeclaration } from './colStyle.js'\n\nexport type ColGroup =\n | {\n colgroup: DOMOutputSpec\n tableWidth: string\n tableMinWidth: string\n }\n | Record<string, never>\n\n/**\n * Creates a colgroup element for a table node in ProseMirror.\n *\n * @param node - The ProseMirror node representing the table.\n * @param cellMinWidth - The minimum width of a cell in the table.\n * @param overrideCol - (Optional) The index of the column to override the width of.\n * @param overrideValue - (Optional) The width value to use for the overridden column.\n * @returns An object containing the colgroup element, the total width of the table, and the minimum width of the table.\n */\nexport function createColGroup(node: ProseMirrorNode, cellMinWidth: number): ColGroup\nexport function createColGroup(\n node: ProseMirrorNode,\n cellMinWidth: number,\n overrideCol: number,\n overrideValue: number,\n): ColGroup\nexport function createColGroup(\n node: ProseMirrorNode,\n cellMinWidth: number,\n overrideCol?: number,\n overrideValue?: number,\n): ColGroup {\n let totalWidth = 0\n let fixedWidth = true\n const cols: DOMOutputSpec[] = []\n const row = node.firstChild\n\n if (!row) {\n return {}\n }\n\n for (let i = 0, col = 0; i < row.childCount; i += 1) {\n const { colspan, colwidth } = row.child(i).attrs\n\n for (let j = 0; j < colspan; j += 1, col += 1) {\n const hasWidth =\n overrideCol === col ? overrideValue : colwidth && (colwidth[j] as number | undefined)\n\n totalWidth += hasWidth || cellMinWidth\n\n if (!hasWidth) {\n fixedWidth = false\n }\n\n const [property, value] = getColStyleDeclaration(cellMinWidth, hasWidth)\n\n cols.push(['col', { style: `${property}: ${value}` }])\n }\n }\n\n const tableWidth = fixedWidth ? `${totalWidth}px` : ''\n const tableMinWidth = fixedWidth ? '' : `${totalWidth}px`\n\n const colgroup: DOMOutputSpec = ['colgroup', {}, ...cols]\n\n return { colgroup, tableWidth, tableMinWidth }\n}\n","import type { Fragment, Node as ProsemirrorNode, NodeType } from '@tiptap/pm/model'\n\nexport function createCell(\n cellType: NodeType,\n cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>,\n): ProsemirrorNode | null | undefined {\n if (cellContent) {\n return cellType.createChecked(null, cellContent)\n }\n\n return cellType.createAndFill()\n}\n","import type { NodeType, Schema } from '@tiptap/pm/model'\n\nexport function getTableNodeTypes(schema: Schema): { [key: string]: NodeType } {\n if (schema.cached.tableNodeTypes) {\n return schema.cached.tableNodeTypes\n }\n\n const roles: { [key: string]: NodeType } = {}\n\n Object.keys(schema.nodes).forEach(type => {\n const nodeType = schema.nodes[type]\n\n if (nodeType.spec.tableRole) {\n roles[nodeType.spec.tableRole] = nodeType\n }\n })\n\n schema.cached.tableNodeTypes = roles\n\n return roles\n}\n","import type { Fragment, Node as ProsemirrorNode, Schema } from '@tiptap/pm/model'\n\nimport { createCell } from './createCell.js'\nimport { getTableNodeTypes } from './getTableNodeTypes.js'\n\nexport function createTable(\n schema: Schema,\n rowsCount: number,\n colsCount: number,\n withHeaderRow: boolean,\n cellContent?: Fragment | ProsemirrorNode | Array<ProsemirrorNode>,\n): ProsemirrorNode {\n const types = getTableNodeTypes(schema)\n const headerCells: ProsemirrorNode[] = []\n const cells: ProsemirrorNode[] = []\n\n for (let index = 0; index < colsCount; index += 1) {\n const cell = createCell(types.cell, cellContent)\n\n if (cell) {\n cells.push(cell)\n }\n\n if (withHeaderRow) {\n const headerCell = createCell(types.header_cell, cellContent)\n\n if (headerCell) {\n headerCells.push(headerCell)\n }\n }\n }\n\n const rows: ProsemirrorNode[] = []\n\n for (let index = 0; index < rowsCount; index += 1) {\n rows.push(types.row.createChecked(null, withHeaderRow && index === 0 ? headerCells : cells))\n }\n\n return types.table.createChecked(null, rows)\n}\n","import { CellSelection } from '@tiptap/pm/tables'\n\nexport function isCellSelection(value: unknown): value is CellSelection {\n return value instanceof CellSelection\n}\n","import type { KeyboardShortcutCommand } from '@tiptap/core'\nimport { findParentNodeClosestToPos } from '@tiptap/core'\n\nimport { isCellSelection } from './isCellSelection.js'\n\nexport const deleteTableWhenAllCellsSelected: KeyboardShortcutCommand = ({ editor }) => {\n const { selection } = editor.state\n\n if (!isCellSelection(selection)) {\n return false\n }\n\n let cellCount = 0\n const table = findParentNodeClosestToPos(selection.ranges[0].$from, node => {\n return node.type.name === 'table'\n })\n\n table?.node.descendants(node => {\n if (node.type.name === 'table') {\n return false\n }\n\n if (['tableCell', 'tableHeader'].includes(node.type.name)) {\n cellCount += 1\n }\n })\n\n const allCellsSelected = cellCount === selection.ranges.length\n\n if (!allCellsSelected) {\n return false\n }\n\n editor.commands.deleteTable()\n\n return true\n}\n","import { findParentNodeClosestToPos } from '@tiptap/core'\nimport { TextSelection, type Transaction } from '@tiptap/pm/state'\n\n// prosemirror-tables does not move the selection after a deletion, so removing the\n// last row or column can push the cursor out of the table into the content below.\nexport function keepCursorInTable(tr: Transaction, tablePos: number) {\n const mappedTablePos = tr.mapping.map(tablePos)\n\n // The delete can push the cursor into a following table, so compare the\n // mapped position to confirm it is still the table we edited.\n const stillInTable = findParentNodeClosestToPos(\n tr.selection.$from,\n node => node.type.name === 'table',\n )\n\n if (stillInTable?.pos === mappedTablePos) {\n return\n }\n\n const tableNode = tr.doc.nodeAt(mappedTablePos)\n\n if (!tableNode) {\n return\n }\n\n const endOfTable = mappedTablePos + tableNode.nodeSize - 1\n\n tr.setSelection(TextSelection.near(tr.doc.resolve(endOfTable), -1))\n}\n","import type { JSONContent, MarkdownRendererHelpers } from '@tiptap/core'\n\nimport {\n type TableCellAlign as TableCellAlignType,\n normalizeTableCellAlignFromAttributes,\n TableCellAlign,\n} from '../../utils/parseAlign.js'\n\nexport const DEFAULT_CELL_LINE_SEPARATOR = '\\u001F'\n\n/**\n * Walk a single table-row line and escape any `|` characters that appear\n * inside backtick code spans so marked's cell splitter ignores them.\n * Backslash escape sequences outside code spans are passed through untouched.\n * If a backtick run has no matching closer on the same line it is emitted\n * as-is — no over-escaping for malformed input.\n */\nexport function escapeTableCellPipes(line: string): string {\n let result = ''\n let i = 0\n while (i < line.length) {\n if (line[i] === '\\\\' && i + 1 < line.length) {\n result += line[i] + line[i + 1]\n i += 2\n continue\n }\n if (line[i] !== '`') {\n result += line[i++]\n continue\n }\n let runLen = 0\n while (i + runLen < line.length && line[i + runLen] === '`') runLen += 1\n let j = i + runLen\n let found = false\n while (j < line.length) {\n if (line[j] !== '`') {\n j += 1\n continue\n }\n let closeLen = 0\n while (j + closeLen < line.length && line[j + closeLen] === '`') closeLen += 1\n if (closeLen === runLen) {\n const spanContent = line.slice(i + runLen, j)\n // Matches an already-escaped pipe (`\\|`, kept as-is) or a bare pipe\n // (escaped). Deliberately avoids a negative lookbehind assertion:\n // WebKit before Safari 16.4 cannot parse lookbehind, and a regex\n // literal fails the whole chunk at parse time, not at call time.\n result +=\n line.slice(i, i + runLen) +\n spanContent.replace(/\\\\\\||\\|/g, match => (match === '|' ? '\\\\|' : match)) +\n line.slice(j, j + runLen)\n i = j + runLen\n found = true\n break\n }\n j += closeLen\n }\n if (!found) {\n result += line.slice(i, i + runLen)\n i += runLen\n }\n }\n return result\n}\n\n/**\n * Escape pipe characters inside backtick code spans on table-row lines.\n * marked's `splitCells` only recognises backslash-escaped pipes (`\\|`) and\n * splits on every other `|`, so \\`a || b\\` in a table cell would be treated\n * as multiple column delimiters. Escaping them here lets `splitCells` skip\n * them; it already converts `\\|` → `|` after splitting, so the cell content\n * is restored correctly.\n */\nexport function preprocessTablePipes(src: string): string {\n return src\n .split('\\n')\n .map(line => {\n if (!line.includes('|') || !line.includes('`')) return line\n return escapeTableCellPipes(line)\n })\n .join('\\n')\n}\n\nfunction collapseWhitespace(s: string) {\n return (s || '').replaceAll(DEFAULT_CELL_LINE_SEPARATOR, ' ').replace(/\\s+/g, ' ').trim()\n}\n\nfunction replaceCellLineSeparator(value: string, cellLineSeparator?: string) {\n if (!cellLineSeparator) {\n return value\n }\n\n return value.split(cellLineSeparator).join('\\n')\n}\n\nfunction escapePipesInCellText(text: string) {\n // Keep already escaped pipes as they are\n return text.replace(/\\\\.|\\|/g, match => (match === '|' ? '\\\\|' : match))\n}\n\nexport function renderTableToMarkdown(\n node: JSONContent,\n h: MarkdownRendererHelpers,\n options: { cellLineSeparator?: string } = {},\n) {\n if (!node || !node.content || node.content.length === 0) {\n return ''\n }\n\n // Build rows: each cell is { text, isHeader, align }\n const rows: { text: string; isHeader: boolean; align: TableCellAlignType | null }[][] = []\n\n node.content.forEach(rowNode => {\n const cells: { text: string; isHeader: boolean; align: TableCellAlignType | null }[] = []\n\n if (rowNode.content) {\n rowNode.content.forEach(cellNode => {\n let raw = ''\n\n if (cellNode.content && Array.isArray(cellNode.content) && cellNode.content.length > 1) {\n const parts = cellNode.content.map(child =>\n replaceCellLineSeparator(\n h.renderChildren(child as unknown as JSONContent),\n options.cellLineSeparator,\n ),\n )\n raw = parts.join('\\n')\n } else {\n raw = replaceCellLineSeparator(\n cellNode.content ? h.renderChildren(cellNode.content as unknown as JSONContent[]) : '',\n options.cellLineSeparator,\n )\n }\n\n // Cells have to stay on a single line, so line breaks become <br> tags.\n // The parser already turns <br> back into hard breaks, so this round trips.\n const singleLine = collapseWhitespace(raw.replace(/[ \\t]*\\r?\\n[ \\t]*/g, '<br>'))\n const text = escapePipesInCellText(singleLine)\n const isHeader = cellNode.type === 'tableHeader'\n const align = normalizeTableCellAlignFromAttributes(cellNode.attrs)\n\n cells.push({ text, isHeader, align })\n })\n }\n\n rows.push(cells)\n })\n\n const columnCount = rows.reduce((max, r) => Math.max(max, r.length), 0)\n\n if (columnCount === 0) {\n return ''\n }\n\n // Compute max width for each column\n const colWidths = Array.from<number>({ length: columnCount }).fill(0)\n\n rows.forEach(r => {\n for (let i = 0; i < columnCount; i += 1) {\n const cell = r[i]?.text || ''\n const len = cell.length\n if (len > colWidths[i]) {\n colWidths[i] = len\n }\n\n if (colWidths[i] < 3) {\n colWidths[i] = 3\n }\n }\n })\n\n const pad = (s: string, width: number) => s + ' '.repeat(Math.max(0, width - s.length))\n\n const headerRow = rows[0]\n const hasHeader = headerRow.some(c => c.isHeader)\n const colAlignments: Array<TableCellAlignType | null> = Array.from<TableCellAlignType | null>({\n length: columnCount,\n }).fill(null)\n\n rows.forEach(r => {\n for (let i = 0; i < columnCount; i += 1) {\n if (!colAlignments[i] && r[i]?.align) {\n colAlignments[i] = r[i].align\n }\n }\n })\n\n let out = '\\n'\n\n // Render header: if the document has a header row (tableHeader cells) use it,\n // otherwise emit an empty header row so most Markdown parsers will recognize\n // the table (this makes roundtripping to Markdown -> JSON more reliable).\n const headerTexts = Array.from<number>({ length: columnCount }).map((_, i) =>\n hasHeader ? (headerRow[i] && headerRow[i].text) || '' : '',\n )\n\n out += `| ${headerTexts.map((t, i) => pad(t, colWidths[i])).join(' | ')} |\\n`\n\n // Separator (use at least 3 dashes per column and include alignment markers)\n out += `| ${colWidths\n .map((w, index) => {\n const dashCount = Math.max(3, w)\n const alignment = colAlignments[index]\n\n if (alignment === TableCellAlign.Left) {\n return `:${'-'.repeat(dashCount)}`\n }\n\n if (alignment === TableCellAlign.Right) {\n return `${'-'.repeat(dashCount)}:`\n }\n\n if (alignment === TableCellAlign.Center) {\n return `:${'-'.repeat(dashCount)}:`\n }\n\n return '-'.repeat(dashCount)\n })\n .join(' | ')} |\\n`\n\n // Body rows: if we had a header, skip the first row; otherwise render all rows\n const body = hasHeader ? rows.slice(1) : rows\n body.forEach(r => {\n out += `| ${Array.from<number>({ length: columnCount })\n .fill(0)\n .map((_, i) => pad((r[i] && r[i].text) || '', colWidths[i]))\n .join(' | ')} |\\n`\n })\n\n return out\n}\n\nexport default renderTableToMarkdown\n","import { Plugin, PluginKey } from '@tiptap/pm/state'\nimport type { CellSelection } from '@tiptap/pm/tables'\nimport type { EditorView } from '@tiptap/pm/view'\n\nimport { isCellSelection } from './isCellSelection.js'\n\nconst preserveCellSelectionOnContextMenuPluginKey = new PluginKey(\n 'preserveCellSelectionOnContextMenu',\n)\n\nfunction resolveClickPos(view: EditorView, event: MouseEvent): number | null {\n const coords = view.posAtCoords({ left: event.clientX, top: event.clientY })\n\n if (coords) {\n return coords.pos\n }\n\n if (!(event.target instanceof Node)) {\n return null\n }\n\n try {\n return view.posAtDOM(event.target, 0)\n } catch {\n return null\n }\n}\n\nfunction isPosInsideCellSelection(selection: CellSelection, pos: number): boolean {\n let inside = false\n\n selection.forEachCell((cell, cellPos) => {\n if (pos >= cellPos && pos < cellPos + cell.nodeSize) {\n inside = true\n }\n })\n\n return inside\n}\n\nexport function preserveCellSelectionOnContextMenu() {\n return new Plugin({\n key: preserveCellSelectionOnContextMenuPluginKey,\n props: {\n handleDOMEvents: {\n mousedown(view, event) {\n if (event.button !== 2) {\n return false\n }\n\n const { selection } = view.state\n\n if (!isCellSelection(selection) || selection.ranges.length < 2) {\n return false\n }\n\n const clickPos = resolveClickPos(view, event)\n\n if (clickPos == null || !isPosInsideCellSelection(selection, clickPos)) {\n return false\n }\n\n event.preventDefault()\n return true\n },\n },\n },\n })\n}\n","import '../types.js'\n\nimport {\n type JSONContent,\n type MarkdownToken,\n callOrReturn,\n findParentNodeClosestToPos,\n getExtensionField,\n mergeAttributes,\n Node,\n} from '@tiptap/core'\nimport type { DOMOutputSpec, Node as ProseMirrorNode } from '@tiptap/pm/model'\nimport { TextSelection } from '@tiptap/pm/state'\nimport {\n addColumnAfter,\n addColumnBefore,\n addRowAfter,\n addRowBefore,\n CellSelection,\n columnResizing,\n deleteColumn,\n deleteRow,\n deleteTable,\n fixTables,\n goToNextCell,\n mergeCells,\n setCellAttr,\n splitCell,\n tableEditing,\n toggleHeader,\n toggleHeaderCell,\n} from '@tiptap/pm/tables'\nimport type { EditorView, NodeView } from '@tiptap/pm/view'\n\nimport { type TableCellAlign, normalizeTableCellAlign } from '../utils/parseAlign.js'\nimport { TableView } from './TableView.js'\nimport { createColGroup } from './utilities/createColGroup.js'\nimport { createTable } from './utilities/createTable.js'\nimport { deleteTableWhenAllCellsSelected } from './utilities/deleteTableWhenAllCellsSelected.js'\nimport { keepCursorInTable } from './utilities/keepCursorInTable.js'\nimport renderTableToMarkdown, { preprocessTablePipes } from './utilities/markdown.js'\nimport { preserveCellSelectionOnContextMenu } from './utilities/preserveCellSelectionOnContextMenu.js'\n\ntype MarkdownTableToken = {\n align?: Array<TableCellAlign | null>\n header?: { tokens: MarkdownToken[]; align?: TableCellAlign | null }[]\n rows?: { tokens: MarkdownToken[]; align?: TableCellAlign | null }[][]\n} & MarkdownToken\n\nexport interface TableOptions {\n /**\n * HTML attributes for the table element.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>\n\n /**\n * Enables the resizing of tables.\n * @default false\n * @example true\n */\n resizable: boolean\n\n /**\n * Controls whether the table should be wrapped in a div with class \"tableWrapper\" when rendered.\n * In editable mode with resizable tables, this wrapper is always present via TableView.\n * @default false\n * @example true\n */\n renderWrapper: boolean\n\n /**\n * The width of the resize handle.\n * @default 5\n * @example 10\n */\n handleWidth: number\n\n /**\n * The minimum width of a cell.\n * @default 25\n * @example 50\n */\n cellMinWidth: number\n\n /**\n * The node view to render the table.\n * @default TableView\n */\n View:\n | (new (\n node: ProseMirrorNode,\n cellMinWidth: number,\n view: EditorView,\n HTMLAttributes?: Record<string, any>,\n ) => NodeView)\n | null\n\n /**\n * Enables the resizing of the last column.\n * @default true\n * @example false\n */\n lastColumnResizable: boolean\n\n /**\n * Allow table node selection.\n * @default false\n * @example true\n */\n allowTableNodeSelection: boolean\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n table: {\n /**\n * Insert a table\n * @param options The table attributes\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.insertTable({ rows: 3, cols: 3, withHeaderRow: true })\n */\n insertTable: (options?: {\n rows?: number\n cols?: number\n withHeaderRow?: boolean\n }) => ReturnType\n\n /**\n * Add a column before the current column\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.addColumnBefore()\n */\n addColumnBefore: () => ReturnType\n\n /**\n * Add a column after the current column\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.addColumnAfter()\n */\n addColumnAfter: () => ReturnType\n\n /**\n * Delete the current column\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.deleteColumn()\n */\n deleteColumn: () => ReturnType\n\n /**\n * Add a row before the current row\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.addRowBefore()\n */\n addRowBefore: () => ReturnType\n\n /**\n * Add a row after the current row\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.addRowAfter()\n */\n addRowAfter: () => ReturnType\n\n /**\n * Delete the current row\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.deleteRow()\n */\n deleteRow: () => ReturnType\n\n /**\n * Delete the current table\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.deleteTable()\n */\n deleteTable: () => ReturnType\n\n /**\n * Merge the currently selected cells\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.mergeCells()\n */\n mergeCells: () => ReturnType\n\n /**\n * Split the currently selected cell\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.splitCell()\n */\n splitCell: () => ReturnType\n\n /**\n * Toggle the header column\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.toggleHeaderColumn()\n */\n toggleHeaderColumn: () => ReturnType\n\n /**\n * Toggle the header row\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.toggleHeaderRow()\n */\n toggleHeaderRow: () => ReturnType\n\n /**\n * Toggle the header cell\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.toggleHeaderCell()\n */\n toggleHeaderCell: () => ReturnType\n\n /**\n * Merge or split the currently selected cells\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.mergeOrSplit()\n */\n mergeOrSplit: () => ReturnType\n\n /**\n * Set a cell attribute\n * @param name The attribute name\n * @param value The attribute value\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.setCellAttribute('align', 'right')\n */\n setCellAttribute: (name: string, value: any) => ReturnType\n\n /**\n * Moves the selection to the next cell\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.goToNextCell()\n */\n goToNextCell: () => ReturnType\n\n /**\n * Moves the selection to the previous cell\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.goToPreviousCell()\n */\n goToPreviousCell: () => ReturnType\n\n /**\n * Try to fix the table structure if necessary\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.fixTables()\n */\n fixTables: () => ReturnType\n\n /**\n * Set a cell selection inside the current table\n * @param position The cell position\n * @returns True if the command was successful, otherwise false\n * @example editor.commands.setCellSelection({ anchorCell: 1, headCell: 2 })\n */\n setCellSelection: (position: { anchorCell: number; headCell?: number }) => ReturnType\n }\n }\n}\n\n/**\n * This extension allows you to create tables.\n * @see https://www.tiptap.dev/api/nodes/table\n */\nexport const Table = Node.create<TableOptions>({\n name: 'table',\n\n // @ts-ignore\n addOptions() {\n return {\n HTMLAttributes: {},\n resizable: false,\n renderWrapper: false,\n handleWidth: 5,\n cellMinWidth: 25,\n // TODO: fix\n View: TableView,\n lastColumnResizable: true,\n allowTableNodeSelection: false,\n }\n },\n\n content: 'tableRow+',\n\n tableRole: 'table',\n\n isolating: true,\n\n group: 'block',\n\n parseHTML() {\n return [{ tag: 'table' }]\n },\n\n renderHTML({ node, HTMLAttributes }) {\n const { colgroup, tableWidth, tableMinWidth } = createColGroup(node, this.options.cellMinWidth)\n\n const userStyles = HTMLAttributes.style as string | undefined\n\n function getTableStyle() {\n if (userStyles) {\n return userStyles\n }\n\n return tableWidth ? `width: ${tableWidth}` : `min-width: ${tableMinWidth}`\n }\n\n const table: DOMOutputSpec = [\n 'table',\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {\n style: getTableStyle(),\n }),\n colgroup,\n ['tbody', 0],\n ]\n\n return this.options.renderWrapper ? ['div', { class: 'tableWrapper' }, table] : table\n },\n\n parseMarkdown: (token: MarkdownTableToken, h) => {\n const rows = []\n const alignments = Array.isArray(token.align) ? token.align : []\n\n if (token.header) {\n const headerCells: JSONContent[] = []\n\n token.header.forEach((cell, index) => {\n const align = normalizeTableCellAlign(alignments[index] ?? cell.align)\n const attrs = align ? { align } : {}\n\n headerCells.push(\n h.createNode('tableHeader', attrs, [\n { type: 'paragraph', content: h.parseInline(cell.tokens) },\n ]),\n )\n })\n\n rows.push(h.createNode('tableRow', {}, headerCells))\n }\n\n if (token.rows) {\n token.rows.forEach(row => {\n const bodyCells: JSONContent[] = []\n row.forEach((cell, index) => {\n const align = normalizeTableCellAlign(alignments[index] ?? cell.align)\n const attrs = align ? { align } : {}\n\n bodyCells.push(\n h.createNode('tableCell', attrs, [\n { type: 'paragraph', content: h.parseInline(cell.tokens) },\n ]),\n )\n })\n rows.push(h.createNode('tableRow', {}, bodyCells))\n })\n }\n\n return h.createNode('table', undefined, rows)\n },\n\n renderMarkdown: (node, h) => {\n return renderTableToMarkdown(node, h)\n },\n\n markdownTokenizer: {\n name: 'table',\n level: 'block' as const,\n start: (src: string) => {\n const lines = src.split('\\n')\n if (lines.length < 2) return -1\n const sep = lines[1]\n if (!/^[ \\t|:]*-[ \\t|:-]*$/.test(sep) || !sep.includes('|')) return -1\n return lines[0].includes('|') ? 0 : -1\n },\n tokenize(src, _tokens, helper) {\n // Marked terminates a table block at a blank line. Slicing to the first\n // \\n\\n keeps helper.blockTokens isolated to the candidate table so it\n // cannot consume content that follows. When no blank line exists the\n // full remaining source is used and marked's own table regex determines\n // the boundary (it excludes headings, fences, blockquotes, etc.).\n const blankLineIndex = src.indexOf('\\n\\n')\n const candidate = blankLineIndex >= 0 ? src.slice(0, blankLineIndex) : src\n\n // A GFM table needs at least a header and a separator row (two lines).\n const candidateLines = candidate.split('\\n')\n if (candidateLines.length < 2) return undefined\n\n // Guard: the second line must match a GFM delimiter row (dashes, colons,\n // pipes, spaces) AND must contain at least one '|'. A bare '---' matches\n // the dash pattern but is a setext heading marker, not a table separator.\n // Calling helper.blockTokens on non-table content contaminates the outer\n // lexer's inline queue with preprocessed (backslash-modified) content.\n const sep = candidateLines[1]\n if (!/^[ \\t|:]*-[ \\t|:-]*$/.test(sep) || !sep.includes('|')) return undefined\n\n const preprocessed = preprocessTablePipes(candidate)\n\n // Nothing to fix — let marked's built-in handle it.\n if (preprocessed === candidate) return undefined\n\n // Re-lex only the preprocessed candidate. The recursive call to our\n // tokenizer finds no unescaped pipes left inside code spans and returns\n // undefined, so marked's built-in table tokenizer produces\n // correctly-split cells.\n const block = helper.blockTokens(preprocessed)\n const tableToken = block[0]\n if (tableToken?.type !== 'table' || !tableToken.raw) return undefined\n\n // preprocessTablePipes only inserts backslashes (never adds or removes\n // newlines), so line N in preprocessed maps 1-to-1 to line N in src.\n // Use the token's line count to reconstruct raw from the original src so\n // marked advances its cursor by the correct amount.\n const lineCount = tableToken.raw.split('\\n').length\n const raw = src.split('\\n').slice(0, lineCount).join('\\n')\n\n return { ...tableToken, raw }\n },\n },\n\n addCommands() {\n return {\n insertTable:\n ({ rows = 3, cols = 3, withHeaderRow = true } = {}) =>\n ({ tr, dispatch, editor }) => {\n const node = createTable(editor.schema, rows, cols, withHeaderRow)\n\n if (dispatch) {\n const offset = tr.selection.from + 1\n\n tr.replaceSelectionWith(node)\n .scrollIntoView()\n .setSelection(TextSelection.near(tr.doc.resolve(offset)))\n }\n\n return true\n },\n addColumnBefore:\n () =>\n ({ state, dispatch }) => {\n return addColumnBefore(state, dispatch)\n },\n addColumnAfter:\n () =>\n ({ state, dispatch }) => {\n return addColumnAfter(state, dispatch)\n },\n deleteColumn:\n () =>\n ({ state, dispatch }) => {\n const table = findParentNodeClosestToPos(\n state.selection.$from,\n node => node.type.name === 'table',\n )\n\n return deleteColumn(\n state,\n dispatch &&\n (tr => {\n if (table) {\n keepCursorInTable(tr, table.pos)\n }\n\n dispatch(tr)\n }),\n )\n },\n addRowBefore:\n () =>\n ({ state, dispatch }) => {\n return addRowBefore(state, dispatch)\n },\n addRowAfter:\n () =>\n ({ state, dispatch }) => {\n return addRowAfter(state, dispatch)\n },\n deleteRow:\n () =>\n ({ state, dispatch }) => {\n const table = findParentNodeClosestToPos(\n state.selection.$from,\n node => node.type.name === 'table',\n )\n\n return deleteRow(\n state,\n dispatch &&\n (tr => {\n if (table) {\n keepCursorInTable(tr, table.pos)\n }\n\n dispatch(tr)\n }),\n )\n },\n deleteTable:\n () =>\n ({ state, dispatch }) => {\n return deleteTable(state, dispatch)\n },\n mergeCells:\n () =>\n ({ state, dispatch }) => {\n return mergeCells(state, dispatch)\n },\n splitCell:\n () =>\n ({ state, dispatch }) => {\n return splitCell(state, dispatch)\n },\n toggleHeaderColumn:\n () =>\n ({ state, dispatch }) => {\n return toggleHeader('column')(state, dispatch)\n },\n toggleHeaderRow:\n () =>\n ({ state, dispatch }) => {\n return toggleHeader('row')(state, dispatch)\n },\n toggleHeaderCell:\n () =>\n ({ state, dispatch }) => {\n return toggleHeaderCell(state, dispatch)\n },\n mergeOrSplit:\n () =>\n ({ state, dispatch }) => {\n if (mergeCells(state, dispatch)) {\n return true\n }\n\n return splitCell(state, dispatch)\n },\n setCellAttribute:\n (name, value) =>\n ({ state, dispatch }) => {\n return setCellAttr(name, value)(state, dispatch)\n },\n goToNextCell:\n () =>\n ({ state, dispatch }) => {\n return goToNextCell(1)(state, dispatch)\n },\n goToPreviousCell:\n () =>\n ({ state, dispatch }) => {\n return goToNextCell(-1)(state, dispatch)\n },\n fixTables:\n () =>\n ({ state, dispatch }) => {\n if (dispatch) {\n fixTables(state)\n }\n\n return true\n },\n setCellSelection:\n position =>\n ({ tr, dispatch }) => {\n if (dispatch) {\n const selection = CellSelection.create(tr.doc, position.anchorCell, position.headCell)\n\n // @ts-ignore\n tr.setSelection(selection)\n }\n\n return true\n },\n }\n },\n\n addKeyboardShortcuts() {\n return {\n Tab: () => {\n if (this.editor.commands.goToNextCell()) {\n return true\n }\n\n if (!this.editor.can().addRowAfter()) {\n return false\n }\n\n return this.editor.chain().addRowAfter().goToNextCell().run()\n },\n 'Shift-Tab': () => this.editor.commands.goToPreviousCell(),\n Backspace: deleteTableWhenAllCellsSelected,\n 'Mod-Backspace': deleteTableWhenAllCellsSelected,\n Delete: deleteTableWhenAllCellsSelected,\n 'Mod-Delete': deleteTableWhenAllCellsSelected,\n }\n },\n\n addProseMirrorPlugins() {\n const isResizable = this.options.resizable && this.editor.isEditable\n\n return [\n ...(isResizable\n ? [\n columnResizing({\n handleWidth: this.options.handleWidth,\n cellMinWidth: this.options.cellMinWidth,\n defaultCellMinWidth: this.options.cellMinWidth,\n View: this.options.View,\n lastColumnResizable: this.options.lastColumnResizable,\n }),\n ]\n : []),\n tableEditing({\n allowTableNodeSelection: this.options.allowTableNodeSelection,\n }),\n preserveCellSelectionOnContextMenu(),\n ]\n },\n\n addNodeView() {\n // When resizable, the columnResizing plugin registers its own NodeView.\n // We only register one here for the non-resizable case so that\n // <colgroup> stays in sync with column changes (issue #7015).\n const isResizable = this.options.resizable && this.editor.isEditable\n const View = this.options.View\n\n if (isResizable || !View) {\n return null\n }\n\n return ({ node, view, HTMLAttributes }) => {\n const mergedAttributes = mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)\n\n return new View(node, this.options.cellMinWidth, view, mergedAttributes) as NodeView\n }\n },\n\n extendNodeSchema(extension) {\n const context = {\n name: extension.name,\n options: extension.options,\n storage: extension.storage,\n }\n\n return {\n tableRole: callOrReturn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9D;GACA,mBAAmB,KAAK,OAAO,SAAS,iBAAiB;GACzD,WAAW;GACX,iBAAiB;GACjB,QAAQ;GACR,cAAc;EAChB;CACF;CAEA,wBAAwB;EAGtB,OAAO;GACL,GAHkB,KAAK,QAAQ,aAAa,KAAK,OAAO,aAIpD,CACE,eAAe;IACb,aAAa,KAAK,QAAQ;IAC1B,cAAc,KAAK,QAAQ;IAC3B,qBAAqB,KAAK,QAAQ;IAClC,MAAM,KAAK,QAAQ;IACnB,qBAAqB,KAAK,QAAQ;GACpC,CAAC,CACH,IACA,CAAC;GACL,aAAa,EACX,yBAAyB,KAAK,QAAQ,wBACxC,CAAC;GACD,mCAAmC;EACrC;CACF;CAEA,cAAc;EAIZ,MAAM,cAAc,KAAK,QAAQ,aAAa,KAAK,OAAO;EAC1D,MAAM,OAAO,KAAK,QAAQ;EAE1B,IAAI,eAAe,CAAC,MAClB,OAAO;EAGT,QAAQ,EAAE,MAAM,MAAM,qBAAqB;GACzC,MAAM,mBAAmB,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc;GAEpF,OAAO,IAAI,KAAK,MAAM,KAAK,QAAQ,cAAc,MAAM,gBAAgB;EACzE;CACF;CAEA,iBAAiB,WAAW;EAC1B,MAAM,UAAU;GACd,MAAM,UAAU;GAChB,SAAS,UAAU;GACnB,SAAS,UAAU;EACrB;EAEA,OAAO,EACL,WAAW,aAAa,kBAAkB,WAAW,aAAa,OAAO,CAAC,EAC5E;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-cell.js'
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core'
|
|
2
|
+
import Document from '@tiptap/extension-document'
|
|
3
|
+
import Paragraph from '@tiptap/extension-paragraph'
|
|
4
|
+
import Text from '@tiptap/extension-text'
|
|
5
|
+
import { describe, expect, it } from 'vite-plus/test'
|
|
6
|
+
|
|
7
|
+
import { TableHeader } from '../header/table-header.js'
|
|
8
|
+
import { TableRow } from '../row/table-row.js'
|
|
9
|
+
import { Table } from '../table/table.js'
|
|
10
|
+
import { TableCell } from './table-cell.js'
|
|
11
|
+
|
|
12
|
+
describe('extension table cell', () => {
|
|
13
|
+
const editorElClass = 'tiptap'
|
|
14
|
+
let editor: Editor | null = null
|
|
15
|
+
|
|
16
|
+
const createEditorEl = () => {
|
|
17
|
+
const editorEl = document.createElement('div')
|
|
18
|
+
|
|
19
|
+
editorEl.classList.add(editorElClass)
|
|
20
|
+
document.body.appendChild(editorEl)
|
|
21
|
+
return editorEl
|
|
22
|
+
}
|
|
23
|
+
const getEditorEl = () => document.querySelector(`.${editorElClass}`)
|
|
24
|
+
|
|
25
|
+
it('should start with a Table', () => {
|
|
26
|
+
const content =
|
|
27
|
+
'<table style="width:100%"><tr><td>Firstname</td><td>Lastname</td><td>Age</td></tr><tr><td>Jill</td><td>Smith</td><td>50</td></tr><tr><td>Eve</td><td>Jackson</td><td>94</td></tr><tr><td>John</td><td>Doe</td><td>80</td></tr></table>'
|
|
28
|
+
|
|
29
|
+
editor = new Editor({
|
|
30
|
+
element: createEditorEl(),
|
|
31
|
+
extensions: [
|
|
32
|
+
Document,
|
|
33
|
+
Text,
|
|
34
|
+
Paragraph,
|
|
35
|
+
TableCell,
|
|
36
|
+
TableHeader,
|
|
37
|
+
TableRow,
|
|
38
|
+
Table.configure({
|
|
39
|
+
resizable: true,
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
content,
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
expect(editor.getHTML()).toContain('Jackson')
|
|
46
|
+
|
|
47
|
+
editor?.destroy()
|
|
48
|
+
getEditorEl()?.remove()
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('should parse a single colWidth', () => {
|
|
52
|
+
const content =
|
|
53
|
+
'<table><tbody><tr><td colwidth="200">Name</td><td>Description</td></tr><tr><td>Cyndi Lauper</td><td>Singer</td><td>Songwriter</td><td>Actress</td></tr><tr><td>Marie Curie</td><td>Scientist</td><td>Chemist</td><td>Physicist</td></tr><tr><td>Indira Gandhi</td><td>Prime minister</td><td colspan="2">Politician</td></tr></tbody></table>'
|
|
54
|
+
|
|
55
|
+
editor = new Editor({
|
|
56
|
+
element: createEditorEl(),
|
|
57
|
+
extensions: [
|
|
58
|
+
Document,
|
|
59
|
+
Text,
|
|
60
|
+
Paragraph,
|
|
61
|
+
TableCell,
|
|
62
|
+
TableHeader,
|
|
63
|
+
TableRow,
|
|
64
|
+
Table.configure({
|
|
65
|
+
resizable: true,
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
content,
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// @ts-expect-error content is not guaranteed to be this shape
|
|
72
|
+
expect(editor.getJSON().content[0].content[0].content[0].attrs.colwidth[0]).toBe(200)
|
|
73
|
+
|
|
74
|
+
editor?.destroy()
|
|
75
|
+
getEditorEl()?.remove()
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('should parse multiple colWidths', () => {
|
|
79
|
+
const content =
|
|
80
|
+
'<table><tbody><tr><td colwidth="200">Name</td><td colspan="3" colwidth="150,100">Description</td></tr><tr><td>Cyndi Lauper</td><td>Singer</td><td>Songwriter</td><td>Actress</td></tr><tr><td>Marie Curie</td><td>Scientist</td><td>Chemist</td><td>Physicist</td></tr><tr><td>Indira Gandhi</td><td>Prime minister</td><td colspan="2">Politician</td></tr></tbody></table>'
|
|
81
|
+
|
|
82
|
+
editor = new Editor({
|
|
83
|
+
element: createEditorEl(),
|
|
84
|
+
extensions: [
|
|
85
|
+
Document,
|
|
86
|
+
Text,
|
|
87
|
+
Paragraph,
|
|
88
|
+
TableCell,
|
|
89
|
+
TableHeader,
|
|
90
|
+
TableRow,
|
|
91
|
+
Table.configure({
|
|
92
|
+
resizable: true,
|
|
93
|
+
}),
|
|
94
|
+
],
|
|
95
|
+
content,
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
// @ts-expect-error content is not guaranteed to be this shape
|
|
99
|
+
expect(editor.getJSON().content[0].content[0].content[1].attrs.colwidth).toEqual([150, 100])
|
|
100
|
+
|
|
101
|
+
editor?.destroy()
|
|
102
|
+
getEditorEl()?.remove()
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it('should parse the colgroup col width for the first column', () => {
|
|
106
|
+
const content =
|
|
107
|
+
'<table><colgroup><col width="64" /><col /></colgroup><tbody><tr><td>hello</td><td>world</td></tr></tbody></table>'
|
|
108
|
+
|
|
109
|
+
editor = new Editor({
|
|
110
|
+
element: createEditorEl(),
|
|
111
|
+
extensions: [
|
|
112
|
+
Document,
|
|
113
|
+
Text,
|
|
114
|
+
Paragraph,
|
|
115
|
+
TableCell,
|
|
116
|
+
TableHeader,
|
|
117
|
+
TableRow,
|
|
118
|
+
Table.configure({
|
|
119
|
+
resizable: true,
|
|
120
|
+
}),
|
|
121
|
+
],
|
|
122
|
+
content,
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
const firstRow = editor.getJSON().content?.[0].content?.[0]
|
|
126
|
+
|
|
127
|
+
expect(firstRow?.content?.[0].attrs?.colwidth).toEqual([64])
|
|
128
|
+
expect(firstRow?.content?.[1].attrs?.colwidth).toBeNull()
|
|
129
|
+
|
|
130
|
+
editor?.destroy()
|
|
131
|
+
getEditorEl()?.remove()
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it('should not serialize the default colspan and rowspan', () => {
|
|
135
|
+
const content = '<table><tbody><tr><td>Cell</td></tr></tbody></table>'
|
|
136
|
+
|
|
137
|
+
editor = new Editor({
|
|
138
|
+
element: createEditorEl(),
|
|
139
|
+
extensions: [Document, Text, Paragraph, TableCell, TableHeader, TableRow, Table],
|
|
140
|
+
content,
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
const html = editor.getHTML()
|
|
144
|
+
|
|
145
|
+
expect(html).toContain('<td><p>Cell</p></td>')
|
|
146
|
+
expect(html).not.toContain('colspan="1"')
|
|
147
|
+
expect(html).not.toContain('rowspan="1"')
|
|
148
|
+
|
|
149
|
+
editor?.destroy()
|
|
150
|
+
getEditorEl()?.remove()
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('should not render configured spans for a cell with default spans', () => {
|
|
154
|
+
editor = new Editor({
|
|
155
|
+
element: createEditorEl(),
|
|
156
|
+
extensions: [
|
|
157
|
+
Document,
|
|
158
|
+
Text,
|
|
159
|
+
Paragraph,
|
|
160
|
+
TableCell.configure({ HTMLAttributes: { colspan: 2, rowspan: 2 } }),
|
|
161
|
+
TableHeader,
|
|
162
|
+
TableRow,
|
|
163
|
+
Table,
|
|
164
|
+
],
|
|
165
|
+
content: '<table><tr><td>Cell</td></tr></table>',
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
expect(editor.getHTML()).toContain('<td><p>Cell</p></td>')
|
|
169
|
+
expect(editor.view.dom.querySelector('td')?.hasAttribute('colspan')).toBe(false)
|
|
170
|
+
expect(editor.view.dom.querySelector('td')?.hasAttribute('rowspan')).toBe(false)
|
|
171
|
+
|
|
172
|
+
editor.destroy()
|
|
173
|
+
getEditorEl()?.remove()
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
it('should keep colspan and rowspan when a cell actually spans', () => {
|
|
177
|
+
const content = '<table><tbody><tr><td colspan="2" rowspan="3">Cell</td></tr></tbody></table>'
|
|
178
|
+
|
|
179
|
+
editor = new Editor({
|
|
180
|
+
element: createEditorEl(),
|
|
181
|
+
extensions: [Document, Text, Paragraph, TableCell, TableHeader, TableRow, Table],
|
|
182
|
+
content,
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
const html = editor.getHTML()
|
|
186
|
+
|
|
187
|
+
expect(html).toContain('colspan="2"')
|
|
188
|
+
expect(html).toContain('rowspan="3"')
|
|
189
|
+
|
|
190
|
+
editor?.destroy()
|
|
191
|
+
getEditorEl()?.remove()
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
it('should prefer the colwidth attribute over the colgroup col width', () => {
|
|
195
|
+
const content =
|
|
196
|
+
'<table><colgroup><col width="64" /><col /></colgroup><tbody><tr><td colwidth="200">hello</td><td>world</td></tr></tbody></table>'
|
|
197
|
+
|
|
198
|
+
editor = new Editor({
|
|
199
|
+
element: createEditorEl(),
|
|
200
|
+
extensions: [
|
|
201
|
+
Document,
|
|
202
|
+
Text,
|
|
203
|
+
Paragraph,
|
|
204
|
+
TableCell,
|
|
205
|
+
TableHeader,
|
|
206
|
+
TableRow,
|
|
207
|
+
Table.configure({
|
|
208
|
+
resizable: true,
|
|
209
|
+
}),
|
|
210
|
+
],
|
|
211
|
+
content,
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
// @ts-expect-error content is not guaranteed to be this shape
|
|
215
|
+
expect(editor.getJSON().content[0].content[0].content[0].attrs.colwidth).toEqual([200])
|
|
216
|
+
|
|
217
|
+
editor?.destroy()
|
|
218
|
+
getEditorEl()?.remove()
|
|
219
|
+
})
|
|
220
|
+
})
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import '../types.js'
|
|
2
|
+
|
|
3
|
+
import { mergeAttributes, Node } from '@tiptap/core'
|
|
4
|
+
|
|
5
|
+
import { createAlignAttribute } from '../utils/parseAlign.js'
|
|
6
|
+
import { parseColwidth } from '../utils/parseColwidth.js'
|
|
7
|
+
import { fillEmptyCellContent, isEmptyCellElement } from '../utils/fillEmptyCellContent.js'
|
|
8
|
+
import { omitDefaultSpanAttribute } from '../utils/omitDefaultSpanAttribute.js'
|
|
9
|
+
|
|
10
|
+
export interface TableCellOptions {
|
|
11
|
+
/**
|
|
12
|
+
* The HTML attributes for a table cell node.
|
|
13
|
+
* @default {}
|
|
14
|
+
* @example { class: 'foo' }
|
|
15
|
+
*/
|
|
16
|
+
HTMLAttributes: Record<string, any>
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This extension allows you to create table cells.
|
|
21
|
+
* @see https://www.tiptap.dev/api/nodes/table-cell
|
|
22
|
+
*/
|
|
23
|
+
export const TableCell = Node.create<TableCellOptions>({
|
|
24
|
+
name: 'tableCell',
|
|
25
|
+
|
|
26
|
+
addOptions() {
|
|
27
|
+
return {
|
|
28
|
+
HTMLAttributes: {},
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
content: 'block+',
|
|
33
|
+
|
|
34
|
+
addAttributes() {
|
|
35
|
+
return {
|
|
36
|
+
colspan: {
|
|
37
|
+
default: 1,
|
|
38
|
+
},
|
|
39
|
+
rowspan: {
|
|
40
|
+
default: 1,
|
|
41
|
+
},
|
|
42
|
+
colwidth: {
|
|
43
|
+
default: null,
|
|
44
|
+
parseHTML: parseColwidth,
|
|
45
|
+
},
|
|
46
|
+
align: createAlignAttribute(),
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
tableRole: 'cell',
|
|
51
|
+
|
|
52
|
+
isolating: true,
|
|
53
|
+
|
|
54
|
+
parseHTML() {
|
|
55
|
+
return [
|
|
56
|
+
{
|
|
57
|
+
// Backfill empty cells; non-empty cells fall through to the rule below.
|
|
58
|
+
tag: 'td',
|
|
59
|
+
getAttrs: node => (isEmptyCellElement(node) ? {} : false),
|
|
60
|
+
getContent: (_node, schema) => fillEmptyCellContent(schema.nodes[this.name]),
|
|
61
|
+
},
|
|
62
|
+
{ tag: 'td' },
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
renderHTML({ HTMLAttributes }) {
|
|
67
|
+
const attributes = mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)
|
|
68
|
+
|
|
69
|
+
omitDefaultSpanAttribute(attributes, HTMLAttributes, 'colspan')
|
|
70
|
+
omitDefaultSpanAttribute(attributes, HTMLAttributes, 'rowspan')
|
|
71
|
+
|
|
72
|
+
return ['td', attributes, 0]
|
|
73
|
+
},
|
|
74
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './table-header.js'
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core'
|
|
2
|
+
import Document from '@tiptap/extension-document'
|
|
3
|
+
import Paragraph from '@tiptap/extension-paragraph'
|
|
4
|
+
import Text from '@tiptap/extension-text'
|
|
5
|
+
import { describe, expect, it } from 'vite-plus/test'
|
|
6
|
+
|
|
7
|
+
import { TableCell } from '../cell/table-cell.js'
|
|
8
|
+
import { TableRow } from '../row/table-row.js'
|
|
9
|
+
import { Table } from '../table/table.js'
|
|
10
|
+
import { TableHeader } from './table-header.js'
|
|
11
|
+
|
|
12
|
+
describe('extension table header', () => {
|
|
13
|
+
const editorElClass = 'tiptap'
|
|
14
|
+
let editor: Editor | null = null
|
|
15
|
+
|
|
16
|
+
const createEditorEl = () => {
|
|
17
|
+
const editorEl = document.createElement('div')
|
|
18
|
+
|
|
19
|
+
editorEl.classList.add(editorElClass)
|
|
20
|
+
document.body.appendChild(editorEl)
|
|
21
|
+
return editorEl
|
|
22
|
+
}
|
|
23
|
+
const getEditorEl = () => document.querySelector(`.${editorElClass}`)
|
|
24
|
+
|
|
25
|
+
it('should start with a Table', () => {
|
|
26
|
+
const content =
|
|
27
|
+
'<table style="width:100%"><tr><th>Firstname</th><th>Lastname</th><th>Age</th></tr><tr><td>Jill</td><td>Smith</td><td>50</td></tr><tr><td>Eve</td><td>Jackson</td><td>94</td></tr><tr><td>John</td><td>Doe</td><td>80</td></tr></table>'
|
|
28
|
+
|
|
29
|
+
editor = new Editor({
|
|
30
|
+
element: createEditorEl(),
|
|
31
|
+
extensions: [
|
|
32
|
+
Document,
|
|
33
|
+
Text,
|
|
34
|
+
Paragraph,
|
|
35
|
+
TableCell,
|
|
36
|
+
TableHeader,
|
|
37
|
+
TableRow,
|
|
38
|
+
Table.configure({
|
|
39
|
+
resizable: true,
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
content,
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
expect(editor.getHTML()).toContain('Jackson')
|
|
46
|
+
|
|
47
|
+
editor?.destroy()
|
|
48
|
+
getEditorEl()?.remove()
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('should parse a single colWidth', () => {
|
|
52
|
+
const content =
|
|
53
|
+
'<table><tbody><tr><th colwidth="200">Name</th><th>Description</th></tr><tr><td>Cyndi Lauper</td><td>Singer</td><td>Songwriter</td><td>Actress</td></tr><tr><td>Marie Curie</td><td>Scientist</td><td>Chemist</td><td>Physicist</td></tr><tr><td>Indira Gandhi</td><td>Prime minister</td><td colspan="2">Politician</td></tr></tbody></table>'
|
|
54
|
+
|
|
55
|
+
editor = new Editor({
|
|
56
|
+
element: createEditorEl(),
|
|
57
|
+
extensions: [
|
|
58
|
+
Document,
|
|
59
|
+
Text,
|
|
60
|
+
Paragraph,
|
|
61
|
+
TableCell,
|
|
62
|
+
TableHeader,
|
|
63
|
+
TableRow,
|
|
64
|
+
Table.configure({
|
|
65
|
+
resizable: true,
|
|
66
|
+
}),
|
|
67
|
+
],
|
|
68
|
+
content,
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
// @ts-expect-error content is not guaranteed to be this shape
|
|
72
|
+
expect(editor.getJSON().content[0].content[0].content[0].attrs.colwidth[0]).toBe(200)
|
|
73
|
+
|
|
74
|
+
editor?.destroy()
|
|
75
|
+
getEditorEl()?.remove()
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('should parse multiple colWidths', () => {
|
|
79
|
+
const content =
|
|
80
|
+
'<table><tbody><tr><th colwidth="200">Name</th><th colspan="3" colwidth="150,100">Description</th></tr><tr><td>Cyndi Lauper</td><td>Singer</td><td>Songwriter</td><td>Actress</td></tr><tr><td>Marie Curie</td><td>Scientist</td><td>Chemist</td><td>Physicist</td></tr><tr><td>Indira Gandhi</td><td>Prime minister</td><td colspan="2">Politician</td></tr></tbody></table>'
|
|
81
|
+
|
|
82
|
+
editor = new Editor({
|
|
83
|
+
element: createEditorEl(),
|
|
84
|
+
extensions: [
|
|
85
|
+
Document,
|
|
86
|
+
Text,
|
|
87
|
+
Paragraph,
|
|
88
|
+
TableCell,
|
|
89
|
+
TableHeader,
|
|
90
|
+
TableRow,
|
|
91
|
+
Table.configure({
|
|
92
|
+
resizable: true,
|
|
93
|
+
}),
|
|
94
|
+
],
|
|
95
|
+
content,
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
// @ts-expect-error content is not guaranteed to be this shape
|
|
99
|
+
expect(editor.getJSON().content[0].content[0].content[1].attrs.colwidth).toEqual([150, 100])
|
|
100
|
+
|
|
101
|
+
editor?.destroy()
|
|
102
|
+
getEditorEl()?.remove()
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it('should parse the colgroup col widths for a header row', () => {
|
|
106
|
+
const content =
|
|
107
|
+
'<table><colgroup><col width="64" /><col width="128" /></colgroup><tbody><tr><th>Name</th><th>Description</th></tr><tr><td>Cyndi Lauper</td><td>Singer</td></tr></tbody></table>'
|
|
108
|
+
|
|
109
|
+
editor = new Editor({
|
|
110
|
+
element: createEditorEl(),
|
|
111
|
+
extensions: [
|
|
112
|
+
Document,
|
|
113
|
+
Text,
|
|
114
|
+
Paragraph,
|
|
115
|
+
TableCell,
|
|
116
|
+
TableHeader,
|
|
117
|
+
TableRow,
|
|
118
|
+
Table.configure({
|
|
119
|
+
resizable: true,
|
|
120
|
+
}),
|
|
121
|
+
],
|
|
122
|
+
content,
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
const headerRow = editor.getJSON().content?.[0].content?.[0]
|
|
126
|
+
|
|
127
|
+
expect(headerRow?.content?.[0].attrs?.colwidth).toEqual([64])
|
|
128
|
+
expect(headerRow?.content?.[1].attrs?.colwidth).toEqual([128])
|
|
129
|
+
|
|
130
|
+
editor?.destroy()
|
|
131
|
+
getEditorEl()?.remove()
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
it('should not serialize the default colspan and rowspan', () => {
|
|
135
|
+
const content = '<table><tbody><tr><th>Cell</th></tr></tbody></table>'
|
|
136
|
+
|
|
137
|
+
editor = new Editor({
|
|
138
|
+
element: createEditorEl(),
|
|
139
|
+
extensions: [Document, Text, Paragraph, TableCell, TableHeader, TableRow, Table],
|
|
140
|
+
content,
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
const html = editor.getHTML()
|
|
144
|
+
|
|
145
|
+
expect(html).toContain('<th><p>Cell</p></th>')
|
|
146
|
+
expect(html).not.toContain('colspan="1"')
|
|
147
|
+
expect(html).not.toContain('rowspan="1"')
|
|
148
|
+
|
|
149
|
+
editor?.destroy()
|
|
150
|
+
getEditorEl()?.remove()
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
it('should not render configured spans for a header with default spans', () => {
|
|
154
|
+
editor = new Editor({
|
|
155
|
+
element: createEditorEl(),
|
|
156
|
+
extensions: [
|
|
157
|
+
Document,
|
|
158
|
+
Text,
|
|
159
|
+
Paragraph,
|
|
160
|
+
TableCell,
|
|
161
|
+
TableHeader.configure({ HTMLAttributes: { colspan: 2, rowspan: 2 } }),
|
|
162
|
+
TableRow,
|
|
163
|
+
Table,
|
|
164
|
+
],
|
|
165
|
+
content: '<table><tr><th>Cell</th></tr></table>',
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
expect(editor.getHTML()).toContain('<th><p>Cell</p></th>')
|
|
169
|
+
expect(editor.view.dom.querySelector('th')?.hasAttribute('colspan')).toBe(false)
|
|
170
|
+
expect(editor.view.dom.querySelector('th')?.hasAttribute('rowspan')).toBe(false)
|
|
171
|
+
|
|
172
|
+
editor.destroy()
|
|
173
|
+
getEditorEl()?.remove()
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
it('should keep colspan and rowspan when a header actually spans', () => {
|
|
177
|
+
const content = '<table><tbody><tr><th colspan="2" rowspan="3">Cell</th></tr></tbody></table>'
|
|
178
|
+
|
|
179
|
+
editor = new Editor({
|
|
180
|
+
element: createEditorEl(),
|
|
181
|
+
extensions: [Document, Text, Paragraph, TableCell, TableHeader, TableRow, Table],
|
|
182
|
+
content,
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
const html = editor.getHTML()
|
|
186
|
+
|
|
187
|
+
expect(html).toContain('colspan="2"')
|
|
188
|
+
expect(html).toContain('rowspan="3"')
|
|
189
|
+
|
|
190
|
+
editor?.destroy()
|
|
191
|
+
getEditorEl()?.remove()
|
|
192
|
+
})
|
|
193
|
+
})
|