@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,242 @@
|
|
|
1
|
+
import { normalizeContent } from "@ecomcx/ecomweb-content";
|
|
2
|
+
import { Check, ChevronRight, Code2, Copy, Keyboard, MoreVertical, SlidersHorizontal, X } from "lucide-react";
|
|
3
|
+
import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
|
|
4
|
+
import { serializeBlocks } from "../core/clipboard";
|
|
5
|
+
import { useEditor, useEditorState } from "../context";
|
|
6
|
+
import { blocksFromDoc, type BNode } from "../core/model";
|
|
7
|
+
import { usePrefs, type EditorPrefs } from "../prefs";
|
|
8
|
+
import { blockLabel } from "./list-view";
|
|
9
|
+
import { Dropdown, MenuItem } from "./toolbar";
|
|
10
|
+
|
|
11
|
+
const cx = (...c: unknown[]) => c.filter((x): x is string => typeof x === "string" && x !== "").join(" ");
|
|
12
|
+
const isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform);
|
|
13
|
+
const MOD = isMac ? "⌘" : "Ctrl";
|
|
14
|
+
|
|
15
|
+
type BoolPref = { [K in keyof EditorPrefs]: EditorPrefs[K] extends boolean ? K : never }[keyof EditorPrefs];
|
|
16
|
+
|
|
17
|
+
/** Mục bật/tắt trong menu (dấu ✓ khi bật). */
|
|
18
|
+
function PrefItem({ name, label, hint, close }: { name: BoolPref; label: string; hint?: string; close(): void }) {
|
|
19
|
+
const { prefs } = useEditor();
|
|
20
|
+
const on = usePrefs(prefs)[name];
|
|
21
|
+
return (
|
|
22
|
+
<button type="button" role="menuitemcheckbox" aria-checked={on} className="ecx-menu-item ecx-menu-pref" title={hint}
|
|
23
|
+
onMouseDown={(e) => e.preventDefault()} onClick={() => { prefs.toggle(name); close(); }}>
|
|
24
|
+
<span className="ecx-icon">{on && <Check className="ecx-icon" />}</span>
|
|
25
|
+
<span className="ecx-menu-text"><span>{label}</span>{hint && <small>{hint}</small>}</span>
|
|
26
|
+
</button>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Menu ⋮ "Tuỳ chọn": cách xem, chế độ soạn, công cụ, hộp tuỳ chọn. `extra` = mục riêng của ứng dụng (lịch sử, thùng rác…). */
|
|
31
|
+
export function MoreMenu({ extra }: { extra?: (close: () => void) => ReactNode }) {
|
|
32
|
+
const { prefs, labels, store, ui } = useEditor();
|
|
33
|
+
const p = usePrefs(prefs);
|
|
34
|
+
const [modal, setModal] = useState<"prefs" | "shortcuts" | null>(null);
|
|
35
|
+
const copyAll = async () => {
|
|
36
|
+
const root = store.getState().docs[store.getState().rootId].blocks;
|
|
37
|
+
const s = serializeBlocks(root);
|
|
38
|
+
try { await navigator.clipboard.write([new ClipboardItem({ "text/plain": new Blob([s.text], { type: "text/plain" }), "text/html": new Blob([s.html], { type: "text/html" }) })]); }
|
|
39
|
+
catch { try { await navigator.clipboard.writeText(s.text); } catch { /* trình duyệt chặn */ } }
|
|
40
|
+
ui.announce(labels.copiedAll);
|
|
41
|
+
};
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<Dropdown label={labels.options} className="ecx-more-menu" trigger={<MoreVertical className="ecx-icon" />}>
|
|
45
|
+
{(close) => (
|
|
46
|
+
<div className="ecx-menu-wide">
|
|
47
|
+
<div className="ecx-menu-group-label">{labels.view}</div>
|
|
48
|
+
<PrefItem name="fixedToolbar" label={labels.fixedToolbar} hint={labels.fixedToolbarHint} close={close} />
|
|
49
|
+
<PrefItem name="distractionFree" label={labels.distractionFree} hint={labels.distractionFreeHint} close={close} />
|
|
50
|
+
<PrefItem name="spotlight" label={labels.spotlight} hint={labels.spotlightHint} close={close} />
|
|
51
|
+
<PrefItem name="fullscreen" label={labels.fullscreen} hint={labels.fullscreenHint} close={close} />
|
|
52
|
+
<div className="ecx-menu-sep" />
|
|
53
|
+
<div className="ecx-menu-group-label">{labels.editorMode}</div>
|
|
54
|
+
{(["visual", "code"] as const).map((m) => (
|
|
55
|
+
<button key={m} type="button" role="menuitemradio" aria-checked={p.mode === m} className="ecx-menu-item" onMouseDown={(e) => e.preventDefault()}
|
|
56
|
+
onClick={() => { prefs.set({ mode: m }); close(); }}>
|
|
57
|
+
<span className="ecx-icon">{p.mode === m && <Check className="ecx-icon" />}</span><span>{m === "visual" ? labels.visualEditor : labels.codeEditor}</span><kbd>{m === "code" ? `${MOD}⇧⌥M` : ""}</kbd>
|
|
58
|
+
</button>
|
|
59
|
+
))}
|
|
60
|
+
<div className="ecx-menu-sep" />
|
|
61
|
+
<div className="ecx-menu-group-label">{labels.tools}</div>
|
|
62
|
+
<MenuItem icon={Keyboard} label={labels.shortcuts} shortcut={isMac ? "⌃⌥H" : "Shift+Alt+H"} onClick={() => { close(); setModal("shortcuts"); }} />
|
|
63
|
+
<MenuItem icon={Copy} label={labels.copyAll} onClick={() => { close(); void copyAll(); }} />
|
|
64
|
+
{extra?.(close)}
|
|
65
|
+
<div className="ecx-menu-sep" />
|
|
66
|
+
<MenuItem icon={SlidersHorizontal} label={`${labels.preferences}…`} onClick={() => { close(); setModal("prefs"); }} />
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
</Dropdown>
|
|
70
|
+
{modal === "prefs" && <PreferencesModal onClose={() => setModal(null)} />}
|
|
71
|
+
{modal === "shortcuts" && <ShortcutsModal onClose={() => setModal(null)} />}
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** Hộp thoại dùng chung (Esc / bấm nền để đóng, giữ focus trong hộp). */
|
|
77
|
+
function Modal({ title, onClose, children, wide }: { title: string; onClose(): void; children: ReactNode; wide?: boolean }) {
|
|
78
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
79
|
+
const { labels } = useEditor();
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
const prev = document.activeElement as HTMLElement | null;
|
|
82
|
+
ref.current?.querySelector<HTMLElement>("button, input, [tabindex]")?.focus();
|
|
83
|
+
const onKey = (e: KeyboardEvent) => { if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); onClose(); } };
|
|
84
|
+
document.addEventListener("keydown", onKey, true);
|
|
85
|
+
return () => { document.removeEventListener("keydown", onKey, true); prev?.focus?.(); };
|
|
86
|
+
}, [onClose]);
|
|
87
|
+
return (
|
|
88
|
+
<div className="ecx-modal-backdrop" onMouseDown={(e) => { if (e.target === e.currentTarget) onClose(); }}>
|
|
89
|
+
<div ref={ref} className={cx("ecx-modal", wide && "is-wide")} role="dialog" aria-modal="true" aria-label={title}>
|
|
90
|
+
<header className="ecx-modal-header"><h2>{title}</h2><button type="button" className="ecx-tool" aria-label={labels.close} onClick={onClose}><X className="ecx-icon" /></button></header>
|
|
91
|
+
{children}
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function Toggle({ name, label, hint }: { name: BoolPref; label: string; hint?: string }) {
|
|
98
|
+
const { prefs } = useEditor();
|
|
99
|
+
const on = usePrefs(prefs)[name];
|
|
100
|
+
return (
|
|
101
|
+
<label className="ecx-pref-row">
|
|
102
|
+
<span><strong>{label}</strong>{hint && <small>{hint}</small>}</span>
|
|
103
|
+
<input type="checkbox" role="switch" className="ecx-switch" checked={on} onChange={() => prefs.toggle(name)} />
|
|
104
|
+
</label>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** Hộp "Tuỳ chọn trình soạn": Chung, Giao diện, Trợ năng, Khối (ẩn bớt loại khối khỏi thư viện). */
|
|
109
|
+
export function PreferencesModal({ onClose }: { onClose(): void }) {
|
|
110
|
+
const { labels, registry, prefs } = useEditor();
|
|
111
|
+
const p = usePrefs(prefs);
|
|
112
|
+
const [tab, setTab] = useState<"general" | "appearance" | "accessibility" | "blocks">("general");
|
|
113
|
+
const tabs = [["general", labels.general], ["appearance", labels.appearance], ["accessibility", labels.accessibility], ["blocks", labels.blocks]] as const;
|
|
114
|
+
const types = registry.all().filter((t) => !t.hidden);
|
|
115
|
+
const cats = [...new Set(types.map((t) => t.category ?? "other"))];
|
|
116
|
+
const catLabel: Record<string, string> = { text: labels.catText, media: labels.catMedia, design: labels.catDesign, widgets: labels.catWidgets, theme: labels.catTheme, embed: labels.catEmbed };
|
|
117
|
+
const hidden = new Set(p.hiddenBlockTypes);
|
|
118
|
+
const setHidden = (names: string[], hide: boolean) => {
|
|
119
|
+
const next = new Set(hidden);
|
|
120
|
+
for (const n of names) if (hide) next.add(n); else next.delete(n);
|
|
121
|
+
prefs.set({ hiddenBlockTypes: [...next] });
|
|
122
|
+
};
|
|
123
|
+
return (
|
|
124
|
+
<Modal title={labels.preferences} onClose={onClose} wide>
|
|
125
|
+
<div className="ecx-prefs">
|
|
126
|
+
<nav className="ecx-prefs-tabs" role="tablist" aria-orientation="vertical">
|
|
127
|
+
{tabs.map(([k, l]) => <button key={k} type="button" role="tab" aria-selected={tab === k} className={cx(tab === k && "is-active")} onClick={() => setTab(k)}>{l}<ChevronRight className="ecx-icon-sm" /></button>)}
|
|
128
|
+
</nav>
|
|
129
|
+
<section className="ecx-prefs-body" role="tabpanel">
|
|
130
|
+
{tab === "general" && <>
|
|
131
|
+
<Toggle name="showListView" label={labels.showListView} hint={labels.showListViewHint} />
|
|
132
|
+
<Toggle name="showBreadcrumbs" label={labels.showBreadcrumbs} hint={labels.showBreadcrumbsHint} />
|
|
133
|
+
</>}
|
|
134
|
+
{tab === "appearance" && <>
|
|
135
|
+
<Toggle name="fixedToolbar" label={labels.fixedToolbar} hint={labels.fixedToolbarHint} />
|
|
136
|
+
<Toggle name="distractionFree" label={labels.distractionFree} hint={labels.distractionFreeHint} />
|
|
137
|
+
<Toggle name="spotlight" label={labels.spotlight} hint={labels.spotlightHint} />
|
|
138
|
+
<Toggle name="fullscreen" label={labels.fullscreen} hint={labels.fullscreenHint} />
|
|
139
|
+
</>}
|
|
140
|
+
{tab === "accessibility" && <>
|
|
141
|
+
<Toggle name="keepCaretInsideBlock" label={labels.keepCaret} hint={labels.keepCaretHint} />
|
|
142
|
+
<Toggle name="showIconLabels" label={labels.iconLabels} hint={labels.iconLabelsHint} />
|
|
143
|
+
</>}
|
|
144
|
+
{tab === "blocks" && <>
|
|
145
|
+
<Toggle name="mostUsedBlocks" label={labels.mostUsed} hint={labels.mostUsedHint} />
|
|
146
|
+
<h3 className="ecx-panel-heading">{labels.blockVisibility}</h3>
|
|
147
|
+
<p className="ecx-muted">{labels.blockVisibilityHint}</p>
|
|
148
|
+
{cats.map((c) => {
|
|
149
|
+
const list = types.filter((t) => (t.category ?? "other") === c);
|
|
150
|
+
const allOn = list.every((t) => !hidden.has(t.name));
|
|
151
|
+
return (
|
|
152
|
+
<fieldset key={c} className="ecx-block-visibility">
|
|
153
|
+
<legend><label className="ecx-check"><input type="checkbox" checked={allOn} onChange={() => setHidden(list.map((t) => t.name), allOn)} /> <strong>{catLabel[c] ?? c}</strong></label></legend>
|
|
154
|
+
{list.map((t) => (
|
|
155
|
+
<label key={t.name} className="ecx-check" data-block-type={t.name}>
|
|
156
|
+
<input type="checkbox" checked={!hidden.has(t.name)} onChange={(e) => setHidden([t.name], !e.target.checked)} /> {t.icon && <t.icon className="ecx-icon" />} {t.title}
|
|
157
|
+
</label>
|
|
158
|
+
))}
|
|
159
|
+
</fieldset>
|
|
160
|
+
);
|
|
161
|
+
})}
|
|
162
|
+
</>}
|
|
163
|
+
</section>
|
|
164
|
+
</div>
|
|
165
|
+
</Modal>
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Bảng phím tắt. */
|
|
170
|
+
export function ShortcutsModal({ onClose }: { onClose(): void }) {
|
|
171
|
+
const { labels } = useEditor();
|
|
172
|
+
const vi = labels.lang === "vi";
|
|
173
|
+
const rows: Array<[string, string]> = vi ? [
|
|
174
|
+
[`${MOD}+Z / ${MOD}+⇧+Z`, "Hoàn tác / làm lại (xuyên header, footer)"], [`${MOD}+S`, "Lưu mọi phần đã đổi"], ["/", "Chèn khối (gõ ở đoạn trống)"],
|
|
175
|
+
["Enter / ⇧+Enter", "Tách khối / xuống dòng trong khối"], ["Tab / ⇧+Tab", "Lồng / đưa mục danh sách ra"], ["Esc", "Chọn cả khối"],
|
|
176
|
+
[`${MOD}+A ×2`, "Chọn mọi khối"], [`${MOD}+⇧+D`, "Nhân bản khối"], ["⇧+⌥+Z", "Xoá khối"], [`${MOD}+⌥+T / Y`, "Thêm khối phía trên / dưới"],
|
|
177
|
+
[`${MOD}+⇧+⌥+T / Y`, "Đưa khối lên / xuống"], ["Alt+F10", "Lên thanh công cụ của khối"], [`${MOD}+B / I / U`, "Đậm / nghiêng / gạch chân"],
|
|
178
|
+
[`${MOD}+K`, "Liên kết"], [`${MOD}+E`, "Mã trong dòng"], ["## · - · 1. · > · ``` · ---", "Gõ tắt: tiêu đề, danh sách, trích dẫn, mã, đường kẻ"],
|
|
179
|
+
] : [
|
|
180
|
+
[`${MOD}+Z / ${MOD}+⇧+Z`, "Undo / redo (across header and footer)"], [`${MOD}+S`, "Save every changed part"], ["/", "Insert a block (in an empty paragraph)"],
|
|
181
|
+
["Enter / ⇧+Enter", "Split block / line break"], ["Tab / ⇧+Tab", "Indent / outdent list item"], ["Esc", "Select the whole block"],
|
|
182
|
+
[`${MOD}+A ×2`, "Select all blocks"], [`${MOD}+⇧+D`, "Duplicate"], ["⇧+⌥+Z", "Delete block"], [`${MOD}+⌥+T / Y`, "Insert before / after"],
|
|
183
|
+
[`${MOD}+⇧+⌥+T / Y`, "Move up / down"], ["Alt+F10", "Go to the block toolbar"], [`${MOD}+B / I / U`, "Bold / italic / underline"],
|
|
184
|
+
[`${MOD}+K`, "Link"], [`${MOD}+E`, "Inline code"], ["## · - · 1. · > · ``` · ---", "Shortcuts: heading, list, quote, code, separator"],
|
|
185
|
+
];
|
|
186
|
+
return (
|
|
187
|
+
<Modal title={labels.shortcuts} onClose={onClose}>
|
|
188
|
+
<dl className="ecx-shortcuts">{rows.map(([k, d]) => <div key={k}><dt>{d}</dt><dd><kbd>{k}</kbd></dd></div>)}</dl>
|
|
189
|
+
</Modal>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Soạn mã: nội dung dạng JSON (định dạng lưu) — áp dụng khi rời ô / bấm nút; sai cấu trúc thì báo, không ghi. */
|
|
194
|
+
export function CodeEditor() {
|
|
195
|
+
const { store, labels, prefs } = useEditor();
|
|
196
|
+
const rootId = useEditorState((s) => s.rootId);
|
|
197
|
+
const blocks = useEditorState((s) => s.docs[s.rootId].blocks);
|
|
198
|
+
const text = useMemo(() => JSON.stringify(JSON.parse(serializeBlocks(blocks).json), null, 2), [blocks]);
|
|
199
|
+
const [draft, setDraft] = useState(text);
|
|
200
|
+
const [error, setError] = useState<string | null>(null);
|
|
201
|
+
useEffect(() => { setDraft(text); setError(null); }, [text]);
|
|
202
|
+
const apply = () => {
|
|
203
|
+
if (draft === text) return true;
|
|
204
|
+
try {
|
|
205
|
+
const parsed = JSON.parse(draft);
|
|
206
|
+
const { doc } = normalizeContent(Array.isArray(parsed) ? { type: "doc", content: parsed } : parsed);
|
|
207
|
+
const rich = doc.blocks.find((b) => b.type === "richtext")?.data as Parameters<typeof blocksFromDoc>[0];
|
|
208
|
+
store.commit(rootId, blocksFromDoc(rich));
|
|
209
|
+
setError(null);
|
|
210
|
+
return true;
|
|
211
|
+
} catch (e) { setError(`${labels.invalidCode}: ${(e as Error).message}`); return false; }
|
|
212
|
+
};
|
|
213
|
+
return (
|
|
214
|
+
<div className="ecx-code-editor">
|
|
215
|
+
<div className="ecx-code-bar"><Code2 className="ecx-icon" /><span>{labels.codeEditorHint}</span><span className="ecx-flex" />
|
|
216
|
+
<button type="button" className="ecx-btn" onClick={() => { if (apply()) prefs.set({ mode: "visual" }); }}>{labels.exitCode}</button></div>
|
|
217
|
+
{error && <div className="ecx-notice is-error" role="alert">{error}</div>}
|
|
218
|
+
<textarea className="ecx-code-input" aria-label={labels.codeEditor} spellCheck={false} value={draft} onChange={(e) => setDraft(e.target.value)} onBlur={apply} />
|
|
219
|
+
</div>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/** Đường dẫn khối ở đáy: Tài liệu › Nhóm › Cột › Đoạn văn — bấm để chọn khối cha. */
|
|
224
|
+
export function Breadcrumbs() {
|
|
225
|
+
const { store, registry, labels } = useEditor();
|
|
226
|
+
const sel = useEditorState((s) => s.selection);
|
|
227
|
+
useEditorState((s) => s.revision);
|
|
228
|
+
const id = sel.ids[0] ?? sel.editing;
|
|
229
|
+
const loc = id ? store.locate(id) : null;
|
|
230
|
+
const chain: BNode[] = loc ? [...loc.ancestors.map((a) => store.block(a)!).filter(Boolean), loc.block] : [];
|
|
231
|
+
const doc = loc ? store.doc(loc.docId) : null;
|
|
232
|
+
return (
|
|
233
|
+
<nav className="ecx-breadcrumbs" aria-label={labels.showBreadcrumbs}>
|
|
234
|
+
<button type="button" onClick={() => store.clearSelection()}>{doc?.title ?? labels.documentRoot}</button>
|
|
235
|
+
{chain.map((b, i) => (
|
|
236
|
+
<span key={b.id} className="ecx-crumb"><ChevronRight className="ecx-icon-sm" />
|
|
237
|
+
<button type="button" aria-current={i === chain.length - 1 ? "true" : undefined} onClick={() => store.select([b.id], { editing: null })}>{blockLabel(b, registry.get(b.type)).split(" · ")[0]}</button>
|
|
238
|
+
</span>
|
|
239
|
+
))}
|
|
240
|
+
</nav>
|
|
241
|
+
);
|
|
242
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Device } from "@ecomcx/ecomweb-content";
|
|
2
|
+
import { ChevronRight } from "lucide-react";
|
|
3
|
+
import { useState, type ComponentType, type ReactNode } from "react";
|
|
4
|
+
import { useEditor } from "../context";
|
|
5
|
+
|
|
6
|
+
/** Thành phần chung của tab Kiểu dáng (cùng một giao diện cho mọi mục). */
|
|
7
|
+
export const cx = (...c: unknown[]) => c.filter((x): x is string => typeof x === "string" && x !== "").join(" ");
|
|
8
|
+
export type Icon = ComponentType<{ className?: string }>;
|
|
9
|
+
|
|
10
|
+
export function Seg<T extends string>({ value, options, onChange, label }: { value: T | undefined; options: Array<[T, Icon | string, string]>; onChange(v: T | undefined): void; label: string }) {
|
|
11
|
+
return (
|
|
12
|
+
<div role="radiogroup" aria-label={label} className="ecx-seg">
|
|
13
|
+
{options.map(([v, I, title]) => (
|
|
14
|
+
<button key={v} type="button" role="radio" aria-checked={value === v} title={title} aria-label={title} className={cx("ecx-seg-btn", value === v && "is-active")}
|
|
15
|
+
onClick={() => onChange(value === v ? undefined : v)}>{typeof I === "string" ? I : <I className="ecx-icon" />}</button>
|
|
16
|
+
))}
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
export function Row({ label, children, device }: { label: string; children: ReactNode; device?: Device }) {
|
|
21
|
+
const { labels } = useEditor();
|
|
22
|
+
return (
|
|
23
|
+
<div className="ecx-style-row">
|
|
24
|
+
<span className="ecx-field-label">{label}{device && device !== "base" && <em className="ecx-device-tag">{device === "tablet" ? labels.lang === "vi" ? "Máy tính bảng" : "Tablet" : labels.lang === "vi" ? "Điện thoại" : "Mobile"}</em>}</span>
|
|
25
|
+
{children}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Một mục của tab Kiểu dáng: tiêu đề bấm để thu / mở (mũi tên), dấu chấm khi mục có giá trị, nút đặt lại,
|
|
31
|
+
* phần "Thêm tuỳ chọn" cho thiết lập ít dùng (tự mở khi đã có giá trị).
|
|
32
|
+
*/
|
|
33
|
+
export function Section({ title, children, more, defaultOpen = true, modified, onReset, moreOpen }: {
|
|
34
|
+
title: string; children?: ReactNode; more?: ReactNode; defaultOpen?: boolean; modified?: boolean; onReset?(): void; moreOpen?: boolean;
|
|
35
|
+
}) {
|
|
36
|
+
const { labels } = useEditor();
|
|
37
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
38
|
+
const [showMore, setShowMore] = useState(!!moreOpen);
|
|
39
|
+
const vi = labels.lang === "vi";
|
|
40
|
+
return (
|
|
41
|
+
<section className="ecx-style-section">
|
|
42
|
+
<div className="ecx-style-section-head">
|
|
43
|
+
<button type="button" className="ecx-style-section-toggle" aria-expanded={open} onClick={() => setOpen(!open)}>
|
|
44
|
+
<ChevronRight className={cx("ecx-icon ecx-icon-sm ecx-chevron", open && "is-open")} aria-hidden />{title}{modified && <span className="ecx-dot" aria-label={vi ? "đã chỉnh" : "modified"} />}
|
|
45
|
+
</button>
|
|
46
|
+
{modified && onReset && <button type="button" className="ecx-link-btn" onClick={onReset}>{vi ? "Đặt lại" : "Reset"}</button>}
|
|
47
|
+
</div>
|
|
48
|
+
{open && (
|
|
49
|
+
<div className="ecx-style-section-body">
|
|
50
|
+
{children}
|
|
51
|
+
{more && (showMore || moreOpen ? more : <button type="button" className="ecx-link-btn ecx-more-btn" onClick={() => setShowMore(true)}>{vi ? "+ Thêm tuỳ chọn" : "+ More options"}</button>)}
|
|
52
|
+
</div>
|
|
53
|
+
)}
|
|
54
|
+
</section>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { normalizeStyle, type BlockStyle, type Device } from "@ecomcx/ecomweb-content";
|
|
2
|
+
import { AlignCenter, AlignJustify, AlignLeft, AlignRight, Monitor, Smartphone, Tablet } from "lucide-react";
|
|
3
|
+
import { useEffect, useState, type ReactNode } from "react";
|
|
4
|
+
import { enLabels, viLabels, type EditorLabels } from "../../shared/labels";
|
|
5
|
+
import { useEditor } from "../context";
|
|
6
|
+
import { ColorInput } from "./color-field";
|
|
7
|
+
import { LayoutEffectsPanel } from "./layout-panel";
|
|
8
|
+
import { Section, Seg, cx } from "./style-controls";
|
|
9
|
+
import { SpacingControl, UnitInput } from "./unit-controls";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Tab Kiểu dáng của khối (attrs.style, @ecomcx/ecomweb-content): một giao diện thống nhất cho chữ, màu, khoảng cách,
|
|
13
|
+
* viền, bố cục, nền / hiệu ứng, hover và hiển thị. Thuộc tính theo khổ màn hình sửa theo khổ đang chọn ở đầu tab;
|
|
14
|
+
* chưa đặt cho khổ nhỏ thì hiện giá trị kế thừa từ khổ lớn hơn.
|
|
15
|
+
*/
|
|
16
|
+
type Style = BlockStyle & Record<string, any>;
|
|
17
|
+
const RESPONSIVE = new Set(["padding", "margin", "gap", "width", "maxWidth", "minHeight", "fontSize", "lineHeight", "letterSpacing", "textAlign"]);
|
|
18
|
+
const SIZES = ["sm", "md", "lg", "xl", "2xl"];
|
|
19
|
+
const SPACES = ["0", "xs", "sm", "md", "lg", "xl", "2xl"];
|
|
20
|
+
const WEIGHTS = ["300", "400", "500", "600", "700", "800", "900"];
|
|
21
|
+
const TYPO = ["fontFamily", "fontSize", "lineHeight", "letterSpacing", "fontWeight", "fontStyle", "textDecoration", "textTransform", "textAlign"];
|
|
22
|
+
const SPACING = ["padding", "margin", "gap", "width", "maxWidth", "minHeight"];
|
|
23
|
+
|
|
24
|
+
/** Ô giá trị (preset như `lg` hoặc `16px`, `1.5rem`…): lưu khi rời ô / Enter; sai thì viền đỏ, không lưu. */
|
|
25
|
+
function ValueInput({ value, onCommit, check, placeholder, label, inherited }: { value?: string | number; onCommit(v: string | null): void; check(v: string): boolean; placeholder?: string; label: string; inherited?: string }) {
|
|
26
|
+
const [text, setText] = useState(value == null ? "" : String(value));
|
|
27
|
+
const [bad, setBad] = useState(false);
|
|
28
|
+
useEffect(() => { setText(value == null ? "" : String(value)); setBad(false); }, [value]);
|
|
29
|
+
const commit = () => {
|
|
30
|
+
const v = text.trim();
|
|
31
|
+
if (v === "") { setBad(false); if (value != null) onCommit(null); return; }
|
|
32
|
+
if (!check(v)) { setBad(true); return; }
|
|
33
|
+
setBad(false);
|
|
34
|
+
if (v !== String(value ?? "")) onCommit(v);
|
|
35
|
+
};
|
|
36
|
+
return <input type="text" className="ecx-input" value={text} placeholder={inherited ?? placeholder} aria-label={label} aria-invalid={bad || undefined}
|
|
37
|
+
onChange={(e) => setText(e.target.value)} onBlur={commit} onKeyDown={(e) => { if (e.key === "Enter") { e.preventDefault(); commit(); } }} />;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function StyleTab({ type, style: raw, onChange, device, onDeviceChange, variants, variant, onVariantChange }: {
|
|
41
|
+
type: string; style: unknown; onChange(style: BlockStyle | null): void; device: Device; onDeviceChange(d: Device): void;
|
|
42
|
+
variants?: Array<{ name: string; label: string }>; variant?: string | null; onVariantChange?(v: string | null): void;
|
|
43
|
+
}) {
|
|
44
|
+
const { host, labels } = useEditor();
|
|
45
|
+
const t = labels.lang === "vi" ? viLabels : enLabels;
|
|
46
|
+
const presets = host.presets;
|
|
47
|
+
const sizes = presets?.fontSizes ? Object.keys(presets.fontSizes) : SIZES;
|
|
48
|
+
const spaces = presets?.spacing ? ["0", ...Object.keys(presets.spacing)] : SPACES;
|
|
49
|
+
const fonts = presets?.fonts ? Object.keys(presets.fonts) : ["body", "heading", "mono"];
|
|
50
|
+
const style: Style = (normalizeStyle(raw) ?? {}) as Style;
|
|
51
|
+
|
|
52
|
+
const commit = (next: Style) => onChange(normalizeStyle(next) ?? null);
|
|
53
|
+
const get = (k: string): any => (RESPONSIVE.has(k) ? style[k]?.[device] : style[k]);
|
|
54
|
+
const inherited = (k: string): string | undefined => {
|
|
55
|
+
if (!RESPONSIVE.has(k) || device === "base" || get(k) !== undefined) return undefined;
|
|
56
|
+
const v = device === "mobile" ? style[k]?.tablet ?? style[k]?.base : style[k]?.base;
|
|
57
|
+
return v === undefined ? undefined : `${t.inherited}: ${typeof v === "object" ? "…" : v}`;
|
|
58
|
+
};
|
|
59
|
+
const set = (k: string, v: unknown) => {
|
|
60
|
+
const next: Style = { ...style };
|
|
61
|
+
if (RESPONSIVE.has(k)) {
|
|
62
|
+
const r = { ...(style[k] ?? {}) };
|
|
63
|
+
if (v === undefined || v === null || v === "") delete r[device]; else r[device] = v;
|
|
64
|
+
next[k] = Object.keys(r).length ? r : undefined;
|
|
65
|
+
} else next[k] = v === "" ? undefined : v;
|
|
66
|
+
commit(next);
|
|
67
|
+
};
|
|
68
|
+
const setGroup = (k: "color" | "border", sub: string, v: unknown) => set(k, { ...(style[k] ?? {}), [sub]: v });
|
|
69
|
+
const reset = (keys: string[]) => { const next: Style = { ...style }; for (const k of keys) delete next[k]; commit(next); };
|
|
70
|
+
const has = (keys: string[]) => keys.some((k) => style[k] !== undefined);
|
|
71
|
+
const ok = (k: string) => (v: string) => !!normalizeStyle({ [k]: v });
|
|
72
|
+
const tag = (k: string) => RESPONSIVE.has(k) && device !== "base" ? <em className="ecx-device-tag">{t[`device_${device}` as keyof EditorLabels]}</em> : null;
|
|
73
|
+
const row = (k: string, label: string, control: ReactNode) => (
|
|
74
|
+
<div className="ecx-style-row" key={k}><span className="ecx-field-label">{label}{tag(k)}</span>{control}</div>
|
|
75
|
+
);
|
|
76
|
+
const appearance = `${style.fontWeight ?? ""}${style.fontStyle === "italic" ? "i" : ""}`;
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<div className="ecx-style-tab">
|
|
80
|
+
<div className="ecx-style-device">
|
|
81
|
+
<span className="ecx-field-label">{t.device}</span>
|
|
82
|
+
<Seg label={t.device} value={device} onChange={(d) => onDeviceChange(d ?? "base")}
|
|
83
|
+
options={[["base", Monitor, t.device_base], ["tablet", Tablet, t.device_tablet], ["mobile", Smartphone, t.device_mobile]]} />
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
{variants && variants.length > 0 && (
|
|
87
|
+
<div className="ecx-style-row">
|
|
88
|
+
<span className="ecx-field-label">{t.blockVariant}</span>
|
|
89
|
+
<div role="radiogroup" aria-label={t.blockVariant} className="ecx-seg is-text">
|
|
90
|
+
{[{ name: "", label: t.variant_default }, ...variants].map((v) => (
|
|
91
|
+
<button key={v.name || "default"} type="button" role="radio" aria-checked={(variant ?? "") === v.name} className={cx("ecx-seg-btn", (variant ?? "") === v.name && "is-active")}
|
|
92
|
+
onClick={() => onVariantChange?.(v.name || null)}>{v.label}</button>
|
|
93
|
+
))}
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
|
|
98
|
+
<Section title={t.style_typography} modified={has(TYPO)} onReset={() => reset(TYPO)} moreOpen={has(["fontFamily", "letterSpacing", "textDecoration", "textTransform"])}
|
|
99
|
+
more={<>
|
|
100
|
+
{row("fontFamily", t.style_fontFamily,
|
|
101
|
+
<select className="ecx-input" value={style.fontFamily ?? ""} aria-label={t.style_fontFamily} onChange={(e) => set("fontFamily", e.target.value || undefined)}>
|
|
102
|
+
<option value="">{t.default}</option>
|
|
103
|
+
{fonts.map((f) => <option key={f} value={f}>{(t as unknown as Record<string, string>)[`font_${f}`] ?? f}</option>)}
|
|
104
|
+
</select>)}
|
|
105
|
+
{row("letterSpacing", t.style_letterSpacing, <ValueInput label={t.style_letterSpacing} value={get("letterSpacing")} inherited={inherited("letterSpacing")} check={ok("letterSpacing")} placeholder="1px, 0.05em" onCommit={(v) => set("letterSpacing", v)} />)}
|
|
106
|
+
{row("decoration", t.style_decoration, <Seg label={t.style_decoration} value={style.textDecoration} onChange={(v) => set("textDecoration", v)}
|
|
107
|
+
options={[["none", "—", t.none], ["underline", "U̲", t.underlineText], ["line-through", "S̶", t.strikeText]]} />)}
|
|
108
|
+
{row("transform", t.style_transform, <Seg label={t.style_transform} value={style.textTransform} onChange={(v) => set("textTransform", v)}
|
|
109
|
+
options={[["none", "—", t.none], ["uppercase", "AB", t.upper], ["lowercase", "ab", t.lower], ["capitalize", "Ab", t.capitalize]]} />)}
|
|
110
|
+
</>}>
|
|
111
|
+
{row("fontSize", t.style_fontSize, <>
|
|
112
|
+
<Seg label={t.style_fontSize} value={get("fontSize")} onChange={(v) => set("fontSize", v)} options={sizes.map((v) => [v, v.toUpperCase(), v] as [string, string, string])} />
|
|
113
|
+
<ValueInput label={`${t.style_fontSize}: ${t.custom}`} value={sizes.includes(get("fontSize")) ? undefined : get("fontSize")} inherited={inherited("fontSize")} check={ok("fontSize")} placeholder="18px, 1.25rem" onCommit={(v) => set("fontSize", v)} />
|
|
114
|
+
</>)}
|
|
115
|
+
{row("appearance", t.style_appearance,
|
|
116
|
+
<select className="ecx-input" value={appearance} aria-label={t.style_appearance} onChange={(e) => {
|
|
117
|
+
const v = e.target.value;
|
|
118
|
+
commit({ ...style, fontWeight: v.replace("i", "") || undefined, fontStyle: v.endsWith("i") ? "italic" : undefined });
|
|
119
|
+
}}>
|
|
120
|
+
<option value="">{t.default}</option>
|
|
121
|
+
{WEIGHTS.flatMap((w) => [<option key={w} value={w}>{t[`weight_${w}` as keyof EditorLabels]}</option>, <option key={`${w}i`} value={`${w}i`}>{t[`weight_${w}` as keyof EditorLabels]} {t.italicSuffix}</option>])}
|
|
122
|
+
</select>)}
|
|
123
|
+
{row("lineHeight", t.style_lineHeight, <ValueInput label={t.style_lineHeight} value={get("lineHeight")} inherited={inherited("lineHeight")} check={ok("lineHeight")} placeholder="1.5" onCommit={(v) => set("lineHeight", v == null ? undefined : Number(v))} />)}
|
|
124
|
+
{row("textAlign", t.textAlign, <Seg label={t.textAlign} value={get("textAlign")} onChange={(v) => set("textAlign", v)}
|
|
125
|
+
options={[["left", AlignLeft, t.alignLeft], ["center", AlignCenter, t.alignCenter], ["right", AlignRight, t.alignRight], ["justify", AlignJustify, t.alignJustify]]} />)}
|
|
126
|
+
</Section>
|
|
127
|
+
|
|
128
|
+
<Section title={t.style_color} modified={has(["color"])} onReset={() => reset(["color"])}>
|
|
129
|
+
{row("text", t.style_text, <ColorInput label={t.style_text} value={style.color?.text} onChange={(v) => setGroup("color", "text", v)} />)}
|
|
130
|
+
{row("background", t.style_background, <ColorInput label={t.style_background} value={style.color?.background} onChange={(v) => setGroup("color", "background", v)} />)}
|
|
131
|
+
</Section>
|
|
132
|
+
|
|
133
|
+
<Section title={t.style_spacing} modified={has(SPACING)} onReset={() => reset(SPACING)} moreOpen={has(["gap", "width", "maxWidth", "minHeight"])}
|
|
134
|
+
more={<>{(["gap", "width", "maxWidth", "minHeight"] as const).map((k) =>
|
|
135
|
+
row(k, t[`style_${k}`], <ValueInput label={t[`style_${k}`]} value={get(k)} inherited={inherited(k)} check={ok(k)} placeholder={k === "gap" ? "md, 24px" : "100%, 640px, 60vh"} onCommit={(v) => set(k, v)} />))}</>}>
|
|
136
|
+
<SpacingControl label={t.style_padding} steps={spaces} value={get("padding")} inherited={inherited("padding")} onChange={(v) => set("padding", v)} labels={{ vertical: labels.lang === "vi" ? "dọc" : "vertical", horizontal: labels.lang === "vi" ? "ngang" : "horizontal", link: t.linkSides, unlink: t.unlinkSides }} />
|
|
137
|
+
<SpacingControl label={t.style_margin} steps={spaces} value={get("margin")} inherited={inherited("margin")} onChange={(v) => set("margin", v)} labels={{ vertical: labels.lang === "vi" ? "dọc" : "vertical", horizontal: labels.lang === "vi" ? "ngang" : "horizontal", link: t.linkSides, unlink: t.unlinkSides }} />
|
|
138
|
+
</Section>
|
|
139
|
+
|
|
140
|
+
<Section title={t.style_border} modified={has(["border", "radius"])} onReset={() => reset(["border", "radius"])} defaultOpen={has(["border", "radius"])}>
|
|
141
|
+
{row("borderWidth", t.style_borderWidth, <UnitInput label={t.style_borderWidth} value={style.border?.width} max={20} units={["px", "em", "rem"]} onChange={(v) => setGroup("border", "width", v)} />)}
|
|
142
|
+
{row("borderStyle", t.style_borderStyle, <Seg label={t.style_borderStyle} value={style.border?.style} onChange={(v) => setGroup("border", "style", v)}
|
|
143
|
+
options={[["solid", "—", t.border_solid], ["dashed", "- -", t.border_dashed], ["dotted", "···", t.border_dotted]]} />)}
|
|
144
|
+
{row("borderColor", t.style_borderColor, <ColorInput label={t.style_borderColor} value={style.border?.color} onChange={(v) => setGroup("border", "color", v)} />)}
|
|
145
|
+
{row("radius", t.style_radius, <UnitInput label={t.style_radius} value={typeof style.radius === "string" ? style.radius : undefined} max={60} units={["px", "%", "em", "rem"]} onChange={(v) => set("radius", v)} />)}
|
|
146
|
+
</Section>
|
|
147
|
+
|
|
148
|
+
<LayoutEffectsPanel type={type} style={raw} onChange={onChange} device={device} />
|
|
149
|
+
|
|
150
|
+
<Section title={t.style_visibility} modified={has(["hide"])} onReset={() => reset(["hide"])} defaultOpen={has(["hide"])}>
|
|
151
|
+
{(["desktop", "tablet", "mobile"] as const).map((d) => (
|
|
152
|
+
<label key={d} className="ecx-check"><input type="checkbox" checked={!!style.hide?.includes(d)}
|
|
153
|
+
onChange={(e) => set("hide", e.target.checked ? [...(style.hide ?? []), d] : (style.hide ?? []).filter((x) => x !== d))} /> {t[`hide_${d}`]}</label>
|
|
154
|
+
))}
|
|
155
|
+
</Section>
|
|
156
|
+
</div>
|
|
157
|
+
);
|
|
158
|
+
}
|