@yoopta/editor 4.9.9 → 6.0.0-beta.1
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/README.md +12 -3
- package/dist/components/Block/Block.d.ts +3 -4
- package/dist/components/Block/Block.d.ts.map +1 -1
- package/dist/components/Block/hooks.d.ts +3 -1706
- package/dist/components/Block/hooks.d.ts.map +1 -1
- package/dist/components/Editor/render-blocks.d.ts +11 -0
- package/dist/components/Editor/render-blocks.d.ts.map +1 -0
- package/dist/components/Editor/{Editor.d.ts → render-editor.d.ts} +3 -3
- package/dist/components/Editor/render-editor.d.ts.map +1 -0
- package/dist/components/Editor/selection.d.ts +1 -1
- package/dist/components/Editor/selection.d.ts.map +1 -1
- package/dist/components/Editor/utils.d.ts +1 -1
- package/dist/components/Editor/utils.d.ts.map +1 -1
- package/dist/components/SelectionBox/SelectionBox.d.ts +1 -1
- package/dist/components/SelectionBox/SelectionBox.d.ts.map +1 -1
- package/dist/components/SelectionBox/hooks.d.ts +2 -2
- package/dist/components/SelectionBox/hooks.d.ts.map +1 -1
- package/dist/components/{TextLeaf/TextLeaf.d.ts → text-leaf/text-leaf.d.ts} +2 -2
- package/dist/components/text-leaf/text-leaf.d.ts.map +1 -0
- package/dist/contexts/YooptaContext/YooptaContext.d.ts +3 -3
- package/dist/contexts/YooptaContext/YooptaContext.d.ts.map +1 -1
- package/dist/editor/blocks/buildBlockData.d.ts +1 -1
- package/dist/editor/blocks/buildBlockData.d.ts.map +1 -1
- package/dist/editor/blocks/decreaseBlockDepth.d.ts +2 -2
- package/dist/editor/blocks/decreaseBlockDepth.d.ts.map +1 -1
- package/dist/editor/blocks/deleteBlock.d.ts +46 -15
- package/dist/editor/blocks/deleteBlock.d.ts.map +1 -1
- package/dist/editor/blocks/deleteBlock.test.d.ts +2 -0
- package/dist/editor/blocks/deleteBlock.test.d.ts.map +1 -0
- package/dist/editor/blocks/duplicateBlock.d.ts +45 -10
- package/dist/editor/blocks/duplicateBlock.d.ts.map +1 -1
- package/dist/editor/blocks/duplicateBlock.test.d.ts +2 -0
- package/dist/editor/blocks/duplicateBlock.test.d.ts.map +1 -0
- package/dist/editor/blocks/focusBlock.d.ts +1 -1
- package/dist/editor/blocks/focusBlock.d.ts.map +1 -1
- package/dist/editor/blocks/getBlock.d.ts +2 -2
- package/dist/editor/blocks/getBlock.d.ts.map +1 -1
- package/dist/editor/blocks/getBlockSlate.d.ts +2 -2
- package/dist/editor/blocks/getBlockSlate.d.ts.map +1 -1
- package/dist/editor/blocks/increaseBlockDepth.d.ts +1 -1
- package/dist/editor/blocks/increaseBlockDepth.d.ts.map +1 -1
- package/dist/editor/blocks/index.d.ts +9 -9
- package/dist/editor/blocks/index.d.ts.map +1 -1
- package/dist/editor/blocks/insertBlock.d.ts +28 -1
- package/dist/editor/blocks/insertBlock.d.ts.map +1 -1
- package/dist/editor/blocks/mergeBlock.d.ts +48 -2
- package/dist/editor/blocks/mergeBlock.d.ts.map +1 -1
- package/dist/editor/blocks/mergeBlock.test.d.ts +2 -0
- package/dist/editor/blocks/mergeBlock.test.d.ts.map +1 -0
- package/dist/editor/blocks/moveBlock.d.ts +1 -1
- package/dist/editor/blocks/moveBlock.d.ts.map +1 -1
- package/dist/editor/blocks/splitBlock.d.ts +51 -3
- package/dist/editor/blocks/splitBlock.d.ts.map +1 -1
- package/dist/editor/blocks/splitBlock.test.d.ts +2 -0
- package/dist/editor/blocks/splitBlock.test.d.ts.map +1 -0
- package/dist/editor/blocks/toggleBlock.d.ts +51 -5
- package/dist/editor/blocks/toggleBlock.d.ts.map +1 -1
- package/dist/editor/blocks/toggleBlock.test.d.ts +2 -0
- package/dist/editor/blocks/toggleBlock.test.d.ts.map +1 -0
- package/dist/editor/blocks/updateBlock.d.ts +1 -1
- package/dist/editor/blocks/updateBlock.d.ts.map +1 -1
- package/dist/editor/core/applyTransforms.d.ts +2 -2
- package/dist/editor/core/applyTransforms.d.ts.map +1 -1
- package/dist/editor/core/batchOperations.d.ts +1 -1
- package/dist/editor/core/batchOperations.d.ts.map +1 -1
- package/dist/editor/core/blur.d.ts +1 -1
- package/dist/editor/core/blur.d.ts.map +1 -1
- package/dist/editor/core/focus.d.ts +1 -1
- package/dist/editor/core/focus.d.ts.map +1 -1
- package/dist/editor/core/getEditorValue.d.ts +1 -1
- package/dist/editor/core/getEditorValue.d.ts.map +1 -1
- package/dist/editor/core/history.d.ts +4 -4
- package/dist/editor/core/history.d.ts.map +1 -1
- package/dist/editor/core/isEmpty.d.ts +1 -1
- package/dist/editor/core/isEmpty.d.ts.map +1 -1
- package/dist/editor/core/isFocused.d.ts +1 -1
- package/dist/editor/core/isFocused.d.ts.map +1 -1
- package/dist/editor/core/setEditorValue.d.ts +1 -1
- package/dist/editor/core/setEditorValue.d.ts.map +1 -1
- package/dist/editor/elements/create-element-structure.d.ts +150 -0
- package/dist/editor/elements/create-element-structure.d.ts.map +1 -0
- package/dist/editor/elements/create-element-structure.test.d.ts +2 -0
- package/dist/editor/elements/create-element-structure.test.d.ts.map +1 -0
- package/dist/editor/elements/deleteElement.d.ts +78 -7
- package/dist/editor/elements/deleteElement.d.ts.map +1 -1
- package/dist/editor/elements/getElement.d.ts +26 -4
- package/dist/editor/elements/getElement.d.ts.map +1 -1
- package/dist/editor/elements/getElement.test.d.ts +2 -0
- package/dist/editor/elements/getElement.test.d.ts.map +1 -0
- package/dist/editor/elements/getElementChildren.d.ts +20 -4
- package/dist/editor/elements/getElementChildren.d.ts.map +1 -1
- package/dist/editor/elements/getElementChildren.test.d.ts +2 -0
- package/dist/editor/elements/getElementChildren.test.d.ts.map +1 -0
- package/dist/editor/elements/getElementEntry.d.ts +26 -7
- package/dist/editor/elements/getElementEntry.d.ts.map +1 -1
- package/dist/editor/elements/getElementEntry.test.d.ts +2 -0
- package/dist/editor/elements/getElementEntry.test.d.ts.map +1 -0
- package/dist/editor/elements/getElementPath.d.ts +20 -3
- package/dist/editor/elements/getElementPath.d.ts.map +1 -1
- package/dist/editor/elements/getElementPath.test.d.ts +2 -0
- package/dist/editor/elements/getElementPath.test.d.ts.map +1 -0
- package/dist/editor/elements/getElements.d.ts +26 -0
- package/dist/editor/elements/getElements.d.ts.map +1 -0
- package/dist/editor/elements/getElements.test.d.ts +2 -0
- package/dist/editor/elements/getElements.test.d.ts.map +1 -0
- package/dist/editor/elements/getParentElementPath.d.ts +20 -3
- package/dist/editor/elements/getParentElementPath.d.ts.map +1 -1
- package/dist/editor/elements/getParentElementPath.test.d.ts +2 -0
- package/dist/editor/elements/getParentElementPath.test.d.ts.map +1 -0
- package/dist/editor/elements/htmlElToSlateNode.d.ts +4 -0
- package/dist/editor/elements/htmlElToSlateNode.d.ts.map +1 -0
- package/dist/editor/elements/index.d.ts +10 -9
- package/dist/editor/elements/index.d.ts.map +1 -1
- package/dist/editor/elements/insertElement.d.ts +22 -0
- package/dist/editor/elements/insertElement.d.ts.map +1 -0
- package/dist/editor/elements/insertElement.test.d.ts +2 -0
- package/dist/editor/elements/insertElement.test.d.ts.map +1 -0
- package/dist/editor/elements/isElementEmpty.d.ts +20 -7
- package/dist/editor/elements/isElementEmpty.d.ts.map +1 -1
- package/dist/editor/elements/isElementEmpty.test.d.ts +2 -0
- package/dist/editor/elements/isElementEmpty.test.d.ts.map +1 -0
- package/dist/editor/elements/types.d.ts +73 -0
- package/dist/editor/elements/types.d.ts.map +1 -0
- package/dist/editor/elements/updateElement.d.ts +69 -7
- package/dist/editor/elements/updateElement.d.ts.map +1 -1
- package/dist/editor/index.d.ts +1 -2
- package/dist/editor/index.d.ts.map +1 -1
- package/dist/editor/paths/getBlockOrder.d.ts +3 -0
- package/dist/editor/paths/getBlockOrder.d.ts.map +1 -0
- package/dist/editor/paths/getNextBlockOrder.d.ts +3 -0
- package/dist/editor/paths/getNextBlockOrder.d.ts.map +1 -0
- package/dist/editor/paths/getPreviousBlockOrder.d.ts +3 -0
- package/dist/editor/paths/getPreviousBlockOrder.d.ts.map +1 -0
- package/dist/editor/paths/getSelectedPaths.d.ts +1 -1
- package/dist/editor/paths/getSelectedPaths.d.ts.map +1 -1
- package/dist/editor/paths/index.d.ts +10 -8
- package/dist/editor/paths/index.d.ts.map +1 -1
- package/dist/editor/paths/isBlockSelected.d.ts +1 -1
- package/dist/editor/paths/isBlockSelected.d.ts.map +1 -1
- package/dist/editor/paths/isPathEmpty.d.ts +1 -1
- package/dist/editor/paths/isPathEmpty.d.ts.map +1 -1
- package/dist/editor/paths/setPath.d.ts +1 -1
- package/dist/editor/paths/setPath.d.ts.map +1 -1
- package/dist/editor/selection/getAnchor.d.ts +20 -0
- package/dist/editor/selection/getAnchor.d.ts.map +1 -0
- package/dist/editor/selection/getCurrent.d.ts +20 -0
- package/dist/editor/selection/getCurrent.d.ts.map +1 -0
- package/dist/editor/selection/getEnd.d.ts +20 -0
- package/dist/editor/selection/getEnd.d.ts.map +1 -0
- package/dist/editor/selection/getFirstPoint.d.ts +23 -0
- package/dist/editor/selection/getFirstPoint.d.ts.map +1 -0
- package/dist/editor/selection/getFocus.d.ts +20 -0
- package/dist/editor/selection/getFocus.d.ts.map +1 -0
- package/dist/editor/selection/getLastPoint.d.ts +23 -0
- package/dist/editor/selection/getLastPoint.d.ts.map +1 -0
- package/dist/editor/selection/getNext.d.ts +20 -0
- package/dist/editor/selection/getNext.d.ts.map +1 -0
- package/dist/editor/selection/getPrevious.d.ts +20 -0
- package/dist/editor/selection/getPrevious.d.ts.map +1 -0
- package/dist/editor/selection/getRange.d.ts +21 -0
- package/dist/editor/selection/getRange.d.ts.map +1 -0
- package/dist/editor/selection/getSelected.d.ts +20 -0
- package/dist/editor/selection/getSelected.d.ts.map +1 -0
- package/dist/editor/selection/getSlateSelection.d.ts +23 -0
- package/dist/editor/selection/getSlateSelection.d.ts.map +1 -0
- package/dist/editor/selection/getStart.d.ts +20 -0
- package/dist/editor/selection/getStart.d.ts.map +1 -0
- package/dist/editor/selection/index.d.ts +43 -0
- package/dist/editor/selection/index.d.ts.map +1 -0
- package/dist/editor/selection/isBlockSelected.d.ts +23 -0
- package/dist/editor/selection/isBlockSelected.d.ts.map +1 -0
- package/dist/editor/selection/isCollapsed.d.ts +20 -0
- package/dist/editor/selection/isCollapsed.d.ts.map +1 -0
- package/dist/editor/selection/isEmpty.d.ts +14 -0
- package/dist/editor/selection/isEmpty.d.ts.map +1 -0
- package/dist/editor/selection/isExpanded.d.ts +20 -0
- package/dist/editor/selection/isExpanded.d.ts.map +1 -0
- package/dist/editor/selection/setCurrent.d.ts +22 -0
- package/dist/editor/selection/setCurrent.d.ts.map +1 -0
- package/dist/editor/selection/setSelected.d.ts +25 -0
- package/dist/editor/selection/setSelected.d.ts.map +1 -0
- package/dist/editor/selection/setSlateSelection.d.ts +24 -0
- package/dist/editor/selection/setSlateSelection.d.ts.map +1 -0
- package/dist/editor/selection/types.d.ts +128 -0
- package/dist/editor/selection/types.d.ts.map +1 -0
- package/dist/editor/textFormats/addMark.d.ts +33 -0
- package/dist/editor/textFormats/addMark.d.ts.map +1 -0
- package/dist/editor/textFormats/clearMarks.d.ts +27 -0
- package/dist/editor/textFormats/clearMarks.d.ts.map +1 -0
- package/dist/editor/textFormats/getMarks.d.ts +20 -0
- package/dist/editor/textFormats/getMarks.d.ts.map +1 -0
- package/dist/editor/textFormats/getValue.d.ts +22 -2
- package/dist/editor/textFormats/getValue.d.ts.map +1 -1
- package/dist/editor/textFormats/index.d.ts +21 -0
- package/dist/editor/textFormats/index.d.ts.map +1 -0
- package/dist/editor/textFormats/isActive.d.ts +22 -2
- package/dist/editor/textFormats/isActive.d.ts.map +1 -1
- package/dist/editor/textFormats/removeMark.d.ts +28 -0
- package/dist/editor/textFormats/removeMark.d.ts.map +1 -0
- package/dist/editor/textFormats/toggle.d.ts +33 -2
- package/dist/editor/textFormats/toggle.d.ts.map +1 -1
- package/dist/editor/textFormats/types.d.ts +177 -0
- package/dist/editor/textFormats/types.d.ts.map +1 -0
- package/dist/editor/textFormats/update.d.ts +32 -2
- package/dist/editor/textFormats/update.d.ts.map +1 -1
- package/dist/editor/types.d.ts +54 -30
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/extensions/shortcuts.d.ts +6 -2
- package/dist/extensions/shortcuts.d.ts.map +1 -1
- package/dist/handlers/index.d.ts +1 -1
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/onKeyDown.d.ts +1 -2
- package/dist/handlers/onKeyDown.d.ts.map +1 -1
- package/dist/index.d.ts +14 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -6
- package/dist/marks/index.d.ts +1 -1
- package/dist/marks/index.d.ts.map +1 -1
- package/dist/parsers/deserializeHTML.d.ts +1 -1
- package/dist/parsers/deserializeHTML.d.ts.map +1 -1
- package/dist/parsers/deserializeTextNodes.d.ts +2 -2
- package/dist/parsers/deserializeTextNodes.d.ts.map +1 -1
- package/dist/parsers/getEmail.d.ts +2 -4
- package/dist/parsers/getEmail.d.ts.map +1 -1
- package/dist/parsers/getHTML.d.ts +1 -1
- package/dist/parsers/getHTML.d.ts.map +1 -1
- package/dist/parsers/getMarkdown.d.ts +1 -1
- package/dist/parsers/getMarkdown.d.ts.map +1 -1
- package/dist/parsers/getPlainText.d.ts +1 -1
- package/dist/parsers/getPlainText.d.ts.map +1 -1
- package/dist/plugins/build-plugin-elements.d.ts +13 -0
- package/dist/plugins/build-plugin-elements.d.ts.map +1 -0
- package/dist/plugins/build-plugin-elements.test.d.ts +2 -0
- package/dist/plugins/build-plugin-elements.test.d.ts.map +1 -0
- package/dist/plugins/create-yoopta-plugin.d.ts +32 -0
- package/dist/plugins/create-yoopta-plugin.d.ts.map +1 -0
- package/dist/plugins/create-yoopta-plugin.test.d.ts +2 -0
- package/dist/plugins/create-yoopta-plugin.test.d.ts.map +1 -0
- package/dist/plugins/extenstions/{withInlines.d.ts → with-inlines.d.ts} +2 -2
- package/dist/plugins/extenstions/with-inlines.d.ts.map +1 -0
- package/dist/plugins/hooks.d.ts +4 -4
- package/dist/plugins/hooks.d.ts.map +1 -1
- package/dist/plugins/index.d.ts +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/slate-editor-component.d.ts +12 -0
- package/dist/plugins/slate-editor-component.d.ts.map +1 -0
- package/dist/plugins/types.d.ts +32 -21
- package/dist/plugins/types.d.ts.map +1 -1
- package/dist/utils/{blockElements.d.ts → block-elements.d.ts} +16 -7
- package/dist/utils/block-elements.d.ts.map +1 -0
- package/dist/utils/build-slate.d.ts +4 -0
- package/dist/utils/build-slate.d.ts.map +1 -0
- package/dist/utils/{editorBuilders.d.ts → editor-builders.d.ts} +4 -6
- package/dist/utils/editor-builders.d.ts.map +1 -0
- package/dist/utils/editor-builders.test.d.ts +2 -0
- package/dist/utils/editor-builders.test.d.ts.map +1 -0
- package/dist/utils/enter-action.d.ts +40 -0
- package/dist/utils/enter-action.d.ts.map +1 -0
- package/dist/utils/enter-action.test.d.ts +2 -0
- package/dist/utils/enter-action.test.d.ts.map +1 -0
- package/dist/utils/execute-backspace-action.d.ts +29 -0
- package/dist/utils/execute-backspace-action.d.ts.map +1 -0
- package/dist/utils/execute-backspace-action.test.d.ts +2 -0
- package/dist/utils/execute-backspace-action.test.d.ts.map +1 -0
- package/dist/utils/findSlateBySelectionPath.d.ts +1 -1
- package/dist/utils/findSlateBySelectionPath.d.ts.map +1 -1
- package/dist/utils/generateId.d.ts.map +1 -1
- package/dist/utils/get-block-plugins.d.ts +4 -0
- package/dist/utils/get-block-plugins.d.ts.map +1 -0
- package/dist/utils/get-block-plugins.test.d.ts +2 -0
- package/dist/utils/get-block-plugins.test.d.ts.map +1 -0
- package/dist/utils/get-next-hierarchical-selection.d.ts +20 -0
- package/dist/utils/get-next-hierarchical-selection.d.ts.map +1 -0
- package/dist/utils/get-next-hierarchical-selection.test.d.ts +2 -0
- package/dist/utils/get-next-hierarchical-selection.test.d.ts.map +1 -0
- package/dist/utils/get-node-points.d.ts +5 -0
- package/dist/utils/get-node-points.d.ts.map +1 -0
- package/dist/utils/get-node-points.test.d.ts +2 -0
- package/dist/utils/get-node-points.test.d.ts.map +1 -0
- package/dist/utils/getMaxOffsetInElement.d.ts.map +1 -1
- package/dist/utils/invariant.d.ts +2 -0
- package/dist/utils/invariant.d.ts.map +1 -0
- package/dist/utils/types.d.ts.map +1 -1
- package/dist/utils/validations.d.ts +3 -0
- package/dist/utils/validations.d.ts.map +1 -0
- package/dist/utils/weakMaps.d.ts +1 -2
- package/dist/utils/weakMaps.d.ts.map +1 -1
- package/dist/yoopta-editor.d.ts +28 -0
- package/dist/yoopta-editor.d.ts.map +1 -0
- package/package.json +11 -11
- package/dist/UI/BlockOptions/BlockOptions.d.ts +0 -25
- package/dist/UI/BlockOptions/BlockOptions.d.ts.map +0 -1
- package/dist/UI/BlockOptions/utils.d.ts +0 -33
- package/dist/UI/BlockOptions/utils.d.ts.map +0 -1
- package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts +0 -11
- package/dist/UI/ExtendedBlockActions/ExtendedBlockActions.d.ts.map +0 -1
- package/dist/UI/Overlay/Overlay.d.ts +0 -12
- package/dist/UI/Overlay/Overlay.d.ts.map +0 -1
- package/dist/UI/Portal/Portal.d.ts +0 -8
- package/dist/UI/Portal/Portal.d.ts.map +0 -1
- package/dist/UI/index.d.ts +0 -38
- package/dist/UI/index.d.ts.map +0 -1
- package/dist/YooptaEditor.d.ts +0 -30
- package/dist/YooptaEditor.d.ts.map +0 -1
- package/dist/components/Block/FloatingBlockActions.d.ts +0 -14
- package/dist/components/Block/FloatingBlockActions.d.ts.map +0 -1
- package/dist/components/Editor/Editor.d.ts.map +0 -1
- package/dist/components/Editor/RenderBlocks.d.ts +0 -10
- package/dist/components/Editor/RenderBlocks.d.ts.map +0 -1
- package/dist/components/Editor/dnd.d.ts +0 -10
- package/dist/components/Editor/dnd.d.ts.map +0 -1
- package/dist/components/TextLeaf/TextLeaf.d.ts.map +0 -1
- package/dist/contexts/YooptaContext/ToolsContext.d.ts +0 -23
- package/dist/contexts/YooptaContext/ToolsContext.d.ts.map +0 -1
- package/dist/editor/elements/createElement.d.ts +0 -13
- package/dist/editor/elements/createElement.d.ts.map +0 -1
- package/dist/editor/elements/insertElementText.d.ts +0 -7
- package/dist/editor/elements/insertElementText.d.ts.map +0 -1
- package/dist/editor/paths/getNextPath.d.ts +0 -3
- package/dist/editor/paths/getNextPath.d.ts.map +0 -1
- package/dist/editor/paths/getPath.d.ts +0 -3
- package/dist/editor/paths/getPath.d.ts.map +0 -1
- package/dist/editor/paths/getPreviousPath.d.ts +0 -3
- package/dist/editor/paths/getPreviousPath.d.ts.map +0 -1
- package/dist/marks/FakeSelectionMark.d.ts +0 -5
- package/dist/marks/FakeSelectionMark.d.ts.map +0 -1
- package/dist/plugins/SlateEditorComponent.d.ts +0 -13
- package/dist/plugins/SlateEditorComponent.d.ts.map +0 -1
- package/dist/plugins/createYooptaPlugin.d.ts +0 -25
- package/dist/plugins/createYooptaPlugin.d.ts.map +0 -1
- package/dist/plugins/extenstions/withInlines.d.ts.map +0 -1
- package/dist/utils/blockElements.d.ts.map +0 -1
- package/dist/utils/buildSlate.d.ts +0 -3
- package/dist/utils/buildSlate.d.ts.map +0 -1
- package/dist/utils/deepClone.d.ts +0 -2
- package/dist/utils/deepClone.d.ts.map +0 -1
- package/dist/utils/editorBuilders.d.ts.map +0 -1
- package/dist/utils/findPluginBlockByPath.d.ts +0 -5
- package/dist/utils/findPluginBlockByPath.d.ts.map +0 -1
- package/dist/utils/getLastNodePoint.d.ts +0 -9
- package/dist/utils/getLastNodePoint.d.ts.map +0 -1
- package/dist/utils/throttle.d.ts +0 -8
- package/dist/utils/throttle.d.ts.map +0 -1
- package/dist/utils/validateYooptaValue.d.ts +0 -2
- package/dist/utils/validateYooptaValue.d.ts.map +0 -1
- package/dist/utils/validators.d.ts +0 -2
- package/dist/utils/validators.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitBlock.test.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/splitBlock.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,56 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SlateElement, YooEditor, YooptaPathIndex } from '../types';
|
|
2
2
|
export type ToggleBlockOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Position of the block to toggle
|
|
5
|
+
* @default editor.path.current
|
|
6
|
+
*/
|
|
3
7
|
at?: YooptaPathIndex;
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Scope of the toggle operation:
|
|
10
|
+
* - 'auto': automatically determine from context (default)
|
|
11
|
+
* - 'block': transform the entire block (Paragraph → Heading)
|
|
12
|
+
* - 'element': insert element in current leaf with injectElementsFromPlugins
|
|
13
|
+
*
|
|
14
|
+
* @default 'auto'
|
|
15
|
+
*/
|
|
16
|
+
scope?: 'auto' | 'block' | 'element';
|
|
17
|
+
/**
|
|
18
|
+
* Whether to preserve existing content
|
|
19
|
+
* - true: keep text and transfer to new block/element
|
|
20
|
+
* - false: start with empty content
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
preserveContent?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Focus after toggle
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
6
28
|
focus?: boolean;
|
|
7
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Custom element structure created with editor.y()
|
|
31
|
+
* If provided, this will be used instead of default structure
|
|
32
|
+
*/
|
|
33
|
+
elements?: SlateElement;
|
|
8
34
|
};
|
|
9
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Toggle block type or insert element in leaf with injectElementsFromPlugins
|
|
37
|
+
*
|
|
38
|
+
* Behavior depends on scope:
|
|
39
|
+
* - scope: 'block' → transforms the block (Paragraph → Heading)
|
|
40
|
+
* - scope: 'element' → inserts element in current leaf with injectElementsFromPlugins
|
|
41
|
+
* - scope: 'auto' → automatically determines based on context
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* // Transform block
|
|
45
|
+
* editor.toggleBlock('Heading', { preserveContent: true });
|
|
46
|
+
*
|
|
47
|
+
* // Insert element in leaf
|
|
48
|
+
* editor.toggleBlock('Paragraph', { scope: 'element', preserveContent: false });
|
|
49
|
+
*
|
|
50
|
+
* // With custom structure
|
|
51
|
+
* editor.toggleBlock('Accordion', {
|
|
52
|
+
* elements: editor.y('accordion-list', { ... })
|
|
53
|
+
* });
|
|
54
|
+
*/
|
|
55
|
+
export declare function toggleBlock(editor: YooEditor, type: string, options?: ToggleBlockOptions): string;
|
|
10
56
|
//# sourceMappingURL=toggleBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggleBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/toggleBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"toggleBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/toggleBlock.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAEV,YAAY,EACZ,SAAS,EAET,eAAe,EAChB,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,EAAE,CAAC,EAAE,eAAe,CAAC;IAErB;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;IAErC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB,CAAC;AAsOF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kBAAuB,GAC/B,MAAM,CAkBR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggleBlock.test.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/toggleBlock.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { YooEditor, YooptaBlockData } from '../types';
|
|
1
|
+
import type { YooEditor, YooptaBlockData } from '../types';
|
|
2
2
|
export declare function updateBlock(editor: YooEditor, blockId: string, newData: Omit<Partial<YooptaBlockData>, 'id' | 'type'>): void;
|
|
3
3
|
//# sourceMappingURL=updateBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/updateBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateBlock.d.ts","sourceRoot":"","sources":["../../../src/editor/blocks/updateBlock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAgB,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGzE,wBAAgB,WAAW,CACzB,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,GACrD,IAAI,CA2CN"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { Operation, Range } from 'slate';
|
|
2
|
+
import type { SlateEditor, SlateElement, YooEditor, YooptaBlockData, YooptaContentValue, YooptaPath } from '../types';
|
|
3
3
|
export type ChangeSource = 'api' | 'user' | 'history';
|
|
4
4
|
export type SetSlateOperation = {
|
|
5
5
|
type: 'set_slate';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyTransforms.d.ts","sourceRoot":"","sources":["../../../src/editor/core/applyTransforms.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"applyTransforms.d.ts","sourceRoot":"","sources":["../../../src/editor/core/applyTransforms.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batchOperations.d.ts","sourceRoot":"","sources":["../../../src/editor/core/batchOperations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"batchOperations.d.ts","sourceRoot":"","sources":["../../../src/editor/core/batchOperations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,IAAI,QAiBtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/editor/core/blur.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/editor/core/blur.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAYF,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,iBAAsB,QAetE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/editor/core/focus.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../../src/editor/core/focus.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,KAAK,CAAC,MAAM,EAAE,SAAS,QAUtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/getEditorValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"getEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/getEditorValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,yCAE/C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { YooptaOperation } from './applyTransforms';
|
|
2
|
+
import type { YooEditor, YooptaPath } from '../types';
|
|
3
3
|
export type HistoryStack = {
|
|
4
4
|
operations: YooptaOperation[];
|
|
5
5
|
path: YooptaPath;
|
|
@@ -9,8 +9,8 @@ export declare function inverseEditorOperation(editor: YooEditor, op: YooptaOper
|
|
|
9
9
|
export type UndoRedoOptions = {
|
|
10
10
|
scroll?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const SAVING: WeakMap<
|
|
13
|
-
export declare const MERGING: WeakMap<
|
|
12
|
+
export declare const SAVING: WeakMap<import("../types").BaseYooEditor, boolean | undefined>;
|
|
13
|
+
export declare const MERGING: WeakMap<import("../types").BaseYooEditor, boolean | undefined>;
|
|
14
14
|
export declare const YooptaHistory: {
|
|
15
15
|
isMergingHistory(editor: YooEditor): boolean | undefined;
|
|
16
16
|
isSavingHistory(editor: YooEditor): boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/editor/core/history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/editor/core/history.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,KAAK,EAAgB,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEpE,MAAM,MAAM,YAAY,GAAG;IACzB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,EAAE,EAAE,eAAe,GAClB,eAAe,GAAG,eAAe,EAAE,CAyGrC;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,MAAM,gEAAgD,CAAC;AACpE,eAAO,MAAM,OAAO,gEAAgD,CAAC;AAErE,eAAO,MAAM,aAAa;6BACC,SAAS,GAAG,OAAO,GAAG,SAAS;4BAIhC,SAAS,GAAG,OAAO,GAAG,SAAS;+BAI5B,SAAS,MAAM,MAAM,IAAI,GAAG,IAAI;8BAOjC,SAAS,MAAM,MAAM,IAAI,GAAG,IAAI;kCAO5B,SAAS,MAAM,MAAM,IAAI,GAAG,IAAI;iCAOjC,SAAS,MAAM,MAAM,IAAI,GAAG,IAAI;mBAO9C,SAAS,YAAY,eAAe;mBA0BpC,SAAS,YAAY,eAAe;CA8BpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isEmpty.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isEmpty.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAoBlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isFocused.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isFocused.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"isFocused.d.ts","sourceRoot":"","sources":["../../../src/editor/core/isFocused.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,WAE1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/setEditorValue.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setEditorValue.d.ts","sourceRoot":"","sources":["../../../src/editor/core/setEditorValue.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9D,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,QAqBjF"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { Descendant } from 'slate';
|
|
2
|
+
import type { SlateElement, SlateElementTextNode, YooEditor } from '../types';
|
|
3
|
+
export type ElementStructureOptions = {
|
|
4
|
+
id?: string;
|
|
5
|
+
props?: Record<string, unknown>;
|
|
6
|
+
children?: Descendant[];
|
|
7
|
+
};
|
|
8
|
+
export type TextNodeOptions = {
|
|
9
|
+
bold?: boolean;
|
|
10
|
+
italic?: boolean;
|
|
11
|
+
underline?: boolean;
|
|
12
|
+
code?: boolean;
|
|
13
|
+
strike?: boolean;
|
|
14
|
+
highlight?: {
|
|
15
|
+
color?: string;
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Creates a text node with optional marks (bold, italic, etc.)
|
|
21
|
+
*
|
|
22
|
+
* @param text - Text content
|
|
23
|
+
* @param marks - Optional marks (bold, italic, underline, code, strike, highlight)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Plain text
|
|
28
|
+
* editor.y.text('Hello world')
|
|
29
|
+
*
|
|
30
|
+
* // Text with marks
|
|
31
|
+
* editor.y.text('Bold text', { bold: true })
|
|
32
|
+
* editor.y.text('Italic text', { italic: true })
|
|
33
|
+
* editor.y.text('Bold and italic', { bold: true, italic: true })
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function yText(text: string, marks?: TextNodeOptions): SlateElementTextNode;
|
|
37
|
+
/**
|
|
38
|
+
* Creates an inline element (e.g., link, mention)
|
|
39
|
+
* Inline elements are embedded within text and can contain text nodes
|
|
40
|
+
*
|
|
41
|
+
* @param editor - YooEditor instance
|
|
42
|
+
* @param type - Inline element type (e.g., 'link', 'mention')
|
|
43
|
+
* @param options - Optional props and children (text nodes)
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* // Simple link
|
|
48
|
+
* editor.y.inline('link', {
|
|
49
|
+
* props: { url: 'https://example.com', target: '_blank' },
|
|
50
|
+
* children: [editor.y.text('Click me')]
|
|
51
|
+
* })
|
|
52
|
+
*
|
|
53
|
+
* // Link with formatted text
|
|
54
|
+
* editor.y.inline('link', {
|
|
55
|
+
* props: { url: 'https://example.com' },
|
|
56
|
+
* children: [
|
|
57
|
+
* editor.y.text('Bold ', { bold: true }),
|
|
58
|
+
* editor.y.text('link')
|
|
59
|
+
* ]
|
|
60
|
+
* })
|
|
61
|
+
*
|
|
62
|
+
* // Inline element in paragraph
|
|
63
|
+
* editor.y('paragraph', {
|
|
64
|
+
* children: [
|
|
65
|
+
* editor.y.text('Visit '),
|
|
66
|
+
* editor.y.inline('link', {
|
|
67
|
+
* props: { url: 'https://example.com' },
|
|
68
|
+
* children: [editor.y.text('example.com')]
|
|
69
|
+
* }),
|
|
70
|
+
* editor.y.text(' for more info')
|
|
71
|
+
* ]
|
|
72
|
+
* })
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
export declare function yInline(editor: YooEditor, type: string, options?: ElementStructureOptions): SlateElement;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a SlateElement structure for use in insertBlock or other operations
|
|
78
|
+
*
|
|
79
|
+
* @param editor - YooEditor instance
|
|
80
|
+
* @param type - Element type (e.g., 'accordion-list', 'paragraph', etc.)
|
|
81
|
+
* @param options - Optional props and children
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* // Simple element
|
|
86
|
+
* editor.y('paragraph')
|
|
87
|
+
*
|
|
88
|
+
* // Element with custom props
|
|
89
|
+
* editor.y('accordion-list-item', { props: { isExpanded: false } })
|
|
90
|
+
*
|
|
91
|
+
* // Nested structure
|
|
92
|
+
* editor.y('accordion-list', {
|
|
93
|
+
* children: [
|
|
94
|
+
* editor.y('accordion-list-item', {
|
|
95
|
+
* props: { isExpanded: false },
|
|
96
|
+
* children: [
|
|
97
|
+
* editor.y('accordion-list-item-heading'),
|
|
98
|
+
* editor.y('accordion-list-item-content')
|
|
99
|
+
* ]
|
|
100
|
+
* })
|
|
101
|
+
* ]
|
|
102
|
+
* })
|
|
103
|
+
*
|
|
104
|
+
* // Element with text and marks
|
|
105
|
+
* editor.y('paragraph', {
|
|
106
|
+
* children: [
|
|
107
|
+
* editor.y.text('Hello '),
|
|
108
|
+
* editor.y.text('world', { bold: true }),
|
|
109
|
+
* editor.y.text('!', { italic: true })
|
|
110
|
+
* ]
|
|
111
|
+
* })
|
|
112
|
+
*
|
|
113
|
+
* // Mixed: elements and text
|
|
114
|
+
* editor.y('step-list-item-content', {
|
|
115
|
+
* children: [
|
|
116
|
+
* editor.y.text('Step 1: '),
|
|
117
|
+
* editor.y('callout', { props: { theme: 'info' } }),
|
|
118
|
+
* editor.y.text(' - completed', { strike: true })
|
|
119
|
+
* ]
|
|
120
|
+
* })
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
export declare function y(editor: YooEditor, type: string, options?: ElementStructureOptions): SlateElement;
|
|
124
|
+
/**
|
|
125
|
+
* Creates a JSX-compatible function bound to the editor
|
|
126
|
+
* Use this for JSX pragma
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* import { createJSXFactory } from '@yoopta/editor';
|
|
131
|
+
*
|
|
132
|
+
* const y = createJSXFactory(editor);
|
|
133
|
+
*
|
|
134
|
+
* // Now you can use JSX:
|
|
135
|
+
* // @jsx y
|
|
136
|
+
* const structure = (
|
|
137
|
+
* <accordion-list>
|
|
138
|
+
* <accordion-list-item props={{ isExpanded: false }}>
|
|
139
|
+
* <accordion-list-item-heading />
|
|
140
|
+
* </accordion-list-item>
|
|
141
|
+
* </accordion-list>
|
|
142
|
+
* );
|
|
143
|
+
*
|
|
144
|
+
* editor.insertBlock('Accordion', {
|
|
145
|
+
* blockData: { value: [structure] }
|
|
146
|
+
* });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export declare function createJSXFactory(editor: YooEditor): (type: string, props: Record<string, unknown> | null, ...children: unknown[]) => SlateElement;
|
|
150
|
+
//# sourceMappingURL=create-element-structure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-element-structure.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/create-element-structure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIxC,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE;QACV,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH,CAAC;AA8BF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,eAAoB,GAAG,oBAAoB,CAKrF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,OAAO,CACrB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,uBAA4B,GACpC,YAAY,CAqCd;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAgB,CAAC,CACf,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,uBAA4B,GACpC,YAAY,CAgDd;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,UAExC,MAAM,SACL,OAAO,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,eACxB,OAAO,EAAE,KACrB,YAAY,CAwBhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-element-structure.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/create-element-structure.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { YooEditor } from '../types';
|
|
2
|
+
import type { DeleteElementOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Delete element from a block
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Delete options
|
|
8
|
+
*
|
|
9
|
+
* @example Delete block element by path
|
|
10
|
+
* ```typescript
|
|
11
|
+
* editor.deleteElement({
|
|
12
|
+
* blockId: 'accordion-1',
|
|
13
|
+
* type: 'accordion-list-item',
|
|
14
|
+
* path: [0, 1]
|
|
15
|
+
* });
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @example Delete block element by type
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Deletes first accordion-list-item found in selection
|
|
21
|
+
* editor.deleteElement({
|
|
22
|
+
* blockId: 'accordion-1',
|
|
23
|
+
* type: 'accordion-list-item'
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example Delete inline element (remove link wrapper, keep text)
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Before: "Hello <link>world</link>!"
|
|
30
|
+
* editor.deleteElement({
|
|
31
|
+
* blockId: 'paragraph-1',
|
|
32
|
+
* type: 'link',
|
|
33
|
+
* mode: 'unwrap' // Keep "world", remove link
|
|
34
|
+
* });
|
|
35
|
+
* // After: "Hello world!"
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example Delete inline element (remove entirely)
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Before: "Hello <mention>@John</mention>!"
|
|
41
|
+
* editor.deleteElement({
|
|
42
|
+
* blockId: 'paragraph-1',
|
|
43
|
+
* type: 'mention',
|
|
44
|
+
* mode: 'remove' // Remove mention entirely
|
|
45
|
+
* });
|
|
46
|
+
* // After: "Hello !"
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Delete with custom matcher
|
|
50
|
+
* ```typescript
|
|
51
|
+
* editor.deleteElement({
|
|
52
|
+
* blockId: 'accordion-1',
|
|
53
|
+
* type: 'accordion-list-item',
|
|
54
|
+
* match: (element) => element.props?.id === 'item-5'
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example Delete link at current selection
|
|
59
|
+
* ```typescript
|
|
60
|
+
* // User has cursor inside link, wants to remove link
|
|
61
|
+
* editor.deleteElement({
|
|
62
|
+
* blockId: 'paragraph-1',
|
|
63
|
+
* type: 'link',
|
|
64
|
+
* mode: 'unwrap'
|
|
65
|
+
* });
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @example Delete all links in selection with matcher
|
|
69
|
+
* ```typescript
|
|
70
|
+
* editor.deleteElement({
|
|
71
|
+
* blockId: 'paragraph-1',
|
|
72
|
+
* type: 'link',
|
|
73
|
+
* match: (element) => element.props?.url.includes('old-domain.com'),
|
|
74
|
+
* mode: 'unwrap'
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function deleteElement(editor: YooEditor, options: DeleteElementOptions): void;
|
|
8
79
|
//# sourceMappingURL=deleteElement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/deleteElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deleteElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/deleteElement.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAkB,MAAM,SAAS,CAAC;AA6FpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAsEpF"}
|
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
import { SlateElement, YooEditor } from '../types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { SlateElement, YooEditor } from '../types';
|
|
2
|
+
import type { GetElementOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Get single element from a block
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Get options
|
|
8
|
+
* @returns Element or null if not found
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Get element by type and path
|
|
13
|
+
* const element = editor.getElement({
|
|
14
|
+
* blockId: 'accordion-1',
|
|
15
|
+
* type: 'accordion-list-item',
|
|
16
|
+
* path: [0, 1]
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* // Get element with custom matcher
|
|
20
|
+
* const activeItem = editor.getElement({
|
|
21
|
+
* blockId: 'accordion-1',
|
|
22
|
+
* match: (el) => el.type === 'accordion-list-item' && el.props?.isExpanded
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function getElement(editor: YooEditor, options: GetElementOptions): SlateElement | null;
|
|
5
27
|
//# sourceMappingURL=getElement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgD9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI,CAsC7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElement.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElement.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
import { SlateElement, YooEditor } from '../types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { SlateElement, YooEditor } from '../types';
|
|
2
|
+
import type { GetElementChildrenOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Get children of an element
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Get options
|
|
8
|
+
* @returns Element children or null if element not found
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Get children of accordion item
|
|
13
|
+
* const children = editor.getElementChildren({
|
|
14
|
+
* blockId: 'accordion-1',
|
|
15
|
+
* type: 'accordion-list-item',
|
|
16
|
+
* path: [0, 1]
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function getElementChildren(editor: YooEditor, options: GetElementChildrenOptions): SlateElement['children'] | null;
|
|
5
21
|
//# sourceMappingURL=getElementChildren.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElementChildren.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementChildren.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getElementChildren.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementChildren.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,yBAAyB,GACjC,YAAY,CAAC,UAAU,CAAC,GAAG,IAAI,CAOjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElementChildren.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementChildren.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SlateElement, YooEditor } from '../types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { NodeEntry } from 'slate';
|
|
2
|
+
import type { SlateElement, YooEditor } from '../types';
|
|
3
|
+
import type { GetElementEntryOptions } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Get element entry [element, path] from a block
|
|
6
|
+
*
|
|
7
|
+
* @param editor - YooEditor instance
|
|
8
|
+
* @param options - Get options
|
|
9
|
+
* @returns Element entry or null if not found
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Get entry by type and path
|
|
14
|
+
* const entry = editor.getElementEntry({
|
|
15
|
+
* blockId: 'accordion-1',
|
|
16
|
+
* type: 'accordion-list-item',
|
|
17
|
+
* path: [0, 1]
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* if (entry) {
|
|
21
|
+
* const [element, path] = entry;
|
|
22
|
+
* console.log('Element at path:', path);
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function getElementEntry(editor: YooEditor, options: GetElementEntryOptions): NodeEntry<SlateElement> | null;
|
|
8
27
|
//# sourceMappingURL=getElementEntry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElementEntry.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementEntry.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"getElementEntry.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementEntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,SAAS,EAAQ,MAAM,OAAO,CAAC;AAIvD,OAAO,KAAK,EAAe,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrE,OAAO,KAAK,EAAe,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAgDnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,sBAAsB,GAC9B,SAAS,CAAC,YAAY,CAAC,GAAG,IAAI,CAgChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElementEntry.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementEntry.test.ts"],"names":[],"mappings":""}
|