@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
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
import { Path } from 'slate';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { Path } from 'slate';
|
|
2
|
+
import type { YooEditor } from '../types';
|
|
3
|
+
import type { GetElementPathOptions } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Get path of an element in the Slate tree
|
|
6
|
+
*
|
|
7
|
+
* @param editor - YooEditor instance
|
|
8
|
+
* @param options - Get options
|
|
9
|
+
* @returns Element path or null if not found
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Get path of element
|
|
14
|
+
* const path = editor.getElementPath({
|
|
15
|
+
* blockId: 'accordion-1',
|
|
16
|
+
* element: accordionItemElement
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function getElementPath(editor: YooEditor, options: GetElementPathOptions): Path | null;
|
|
4
21
|
//# sourceMappingURL=getElementPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getElementPath.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"getElementPath.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAIlC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAsB7F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElementPath.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElementPath.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SlateElement, YooEditor } from '../types';
|
|
2
|
+
import type { GetElementsOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Get multiple elements from a block
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Get options
|
|
8
|
+
* @returns Array of elements (empty array if none found)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Get all items
|
|
13
|
+
* const items = editor.getElements({
|
|
14
|
+
* blockId: 'accordion-1',
|
|
15
|
+
* type: 'accordion-list-item'
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* // Get with custom matcher
|
|
19
|
+
* const expandedItems = editor.getElements({
|
|
20
|
+
* blockId: 'accordion-1',
|
|
21
|
+
* match: (el) => el.type === 'accordion-list-item' && el.props?.isExpanded
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function getElements(editor: YooEditor, options: GetElementsOptions): SlateElement[];
|
|
26
|
+
//# sourceMappingURL=getElements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElements.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElements.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,GAAG,YAAY,EAAE,CA6B1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getElements.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getElements.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,21 @@
|
|
|
1
|
-
import { Path } from 'slate';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import type { Path } from 'slate';
|
|
2
|
+
import type { YooEditor } from '../types';
|
|
3
|
+
import type { GetElementPathOptions } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Get parent path of an element in the Slate tree
|
|
6
|
+
*
|
|
7
|
+
* @param editor - YooEditor instance
|
|
8
|
+
* @param options - Get options
|
|
9
|
+
* @returns Parent path or null if not found
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Get parent path of element
|
|
14
|
+
* const parentPath = editor.getParentElementPath({
|
|
15
|
+
* blockId: 'accordion-1',
|
|
16
|
+
* element: accordionContentElement
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function getParentElementPath(editor: YooEditor, options: GetElementPathOptions): Path | null;
|
|
4
21
|
//# sourceMappingURL=getParentElementPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getParentElementPath.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getParentElementPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"getParentElementPath.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getParentElementPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAKlC,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAsBnG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getParentElementPath.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/getParentElementPath.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Editor, Element, Text } from 'slate';
|
|
2
|
+
import type { YooEditor } from '../types';
|
|
3
|
+
export declare function htmlElToSlateNode(editor: YooEditor, blockId: string, htmlEl: HTMLElement): Editor | Element | Text | undefined;
|
|
4
|
+
//# sourceMappingURL=htmlElToSlateNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"htmlElToSlateNode.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/htmlElToSlateNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAInD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,GAClB,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAgBrC"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { createElement } from './createElement';
|
|
2
1
|
import { deleteElement } from './deleteElement';
|
|
3
|
-
import { updateElement } from './updateElement';
|
|
4
|
-
import { insertElementText } from './insertElementText';
|
|
5
2
|
import { getElement } from './getElement';
|
|
6
3
|
import { getElementChildren } from './getElementChildren';
|
|
7
4
|
import { getElementEntry } from './getElementEntry';
|
|
8
5
|
import { getElementPath } from './getElementPath';
|
|
6
|
+
import { getElements } from './getElements';
|
|
9
7
|
import { getParentElementPath } from './getParentElementPath';
|
|
8
|
+
import { insertElement } from './insertElement';
|
|
10
9
|
import { isElementEmpty } from './isElementEmpty';
|
|
10
|
+
import { updateElement } from './updateElement';
|
|
11
11
|
export declare const Elements: {
|
|
12
|
-
|
|
13
|
-
deleteElement: typeof deleteElement;
|
|
12
|
+
insertElement: typeof insertElement;
|
|
14
13
|
updateElement: typeof updateElement;
|
|
15
|
-
|
|
14
|
+
deleteElement: typeof deleteElement;
|
|
16
15
|
getElement: typeof getElement;
|
|
17
|
-
|
|
16
|
+
getElements: typeof getElements;
|
|
18
17
|
getElementEntry: typeof getElementEntry;
|
|
19
|
-
isElementEmpty: typeof isElementEmpty;
|
|
20
18
|
getElementPath: typeof getElementPath;
|
|
21
19
|
getParentElementPath: typeof getParentElementPath;
|
|
20
|
+
getElementChildren: typeof getElementChildren;
|
|
21
|
+
isElementEmpty: typeof isElementEmpty;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export { deleteElement, getElement, getElementChildren, getElementEntry, getElementPath, getElements, getParentElementPath, insertElement, isElementEmpty, updateElement, };
|
|
24
|
+
export type { DeleteElementOptions, ElementMatcher, ElementPath, GetElementChildrenOptions, GetElementEntryOptions, GetElementOptions, GetElementPathOptions, GetElementsOptions, InsertElementOptions, IsElementEmptyOptions, UpdateElementOptions, } from './types';
|
|
24
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,eAAO,MAAM,QAAQ;;;;;;;;;;;CAYpB,CAAC;AAGF,OAAO,EACL,aAAa,EACb,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,aAAa,GACd,CAAC;AAGF,YAAY,EACV,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,yBAAyB,EACzB,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { YooEditor } from '../types';
|
|
2
|
+
import type { InsertElementOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Insert element into a block
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Insert options
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // Insert at next position
|
|
12
|
+
* editor.insertElement({
|
|
13
|
+
* blockId: 'accordion-1',
|
|
14
|
+
* type: 'accordion-list-item',
|
|
15
|
+
* props: { isExpanded: true },
|
|
16
|
+
* at: 'next',
|
|
17
|
+
* focus: true
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function insertElement(editor: YooEditor, options: InsertElementOptions): void;
|
|
22
|
+
//# sourceMappingURL=insertElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insertElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/insertElement.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAA6B,SAAS,EAAmB,MAAM,UAAU,CAAC;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AA0GpD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CA0DpF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insertElement.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/insertElement.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { YooEditor } from '../types';
|
|
2
|
+
import type { IsElementEmptyOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Check if element is empty (has no text content)
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Check options
|
|
8
|
+
* @returns true if element is empty, false otherwise
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Check if content is empty
|
|
13
|
+
* const isEmpty = editor.isElementEmpty({
|
|
14
|
+
* blockId: 'accordion-1',
|
|
15
|
+
* type: 'accordion-list-item-content',
|
|
16
|
+
* path: [0, 1, 1]
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function isElementEmpty(editor: YooEditor, options: IsElementEmptyOptions): boolean;
|
|
8
21
|
//# sourceMappingURL=isElementEmpty.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isElementEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/isElementEmpty.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isElementEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/isElementEmpty.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAgCzF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isElementEmpty.test.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/isElementEmpty.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { SlateEditor, SlateElement, YooptaBlockData } from '../types';
|
|
2
|
+
export type ElementPath = number[] | 'selection' | 'first' | 'last';
|
|
3
|
+
export type ElementMatcher = (element: SlateElement) => boolean;
|
|
4
|
+
export type InsertElementOptions = {
|
|
5
|
+
blockId: string;
|
|
6
|
+
type: string;
|
|
7
|
+
props?: Record<string, unknown>;
|
|
8
|
+
children?: SlateElement[];
|
|
9
|
+
at?: 'next' | 'prev' | 'start' | 'end' | number[];
|
|
10
|
+
focus?: boolean;
|
|
11
|
+
select?: boolean;
|
|
12
|
+
text?: string;
|
|
13
|
+
match?: ElementMatcher;
|
|
14
|
+
};
|
|
15
|
+
export type UpdateElementOptions = {
|
|
16
|
+
blockId: string;
|
|
17
|
+
type: string;
|
|
18
|
+
props?: Record<string, unknown>;
|
|
19
|
+
path?: ElementPath;
|
|
20
|
+
match?: ElementMatcher;
|
|
21
|
+
text?: string;
|
|
22
|
+
};
|
|
23
|
+
export type DeleteElementOptions = {
|
|
24
|
+
blockId: string;
|
|
25
|
+
type: string;
|
|
26
|
+
path?: ElementPath;
|
|
27
|
+
match?: ElementMatcher;
|
|
28
|
+
mode?: 'unwrap' | 'remove';
|
|
29
|
+
};
|
|
30
|
+
export type GetElementOptions = {
|
|
31
|
+
blockId: string;
|
|
32
|
+
type?: string;
|
|
33
|
+
path?: number[];
|
|
34
|
+
match?: ElementMatcher;
|
|
35
|
+
};
|
|
36
|
+
export type GetElementsOptions = {
|
|
37
|
+
blockId: string;
|
|
38
|
+
type?: string;
|
|
39
|
+
match?: ElementMatcher;
|
|
40
|
+
};
|
|
41
|
+
export type GetElementEntryOptions = {
|
|
42
|
+
blockId: string;
|
|
43
|
+
type?: string;
|
|
44
|
+
path?: number[];
|
|
45
|
+
};
|
|
46
|
+
export type GetElementPathOptions = {
|
|
47
|
+
blockId: string;
|
|
48
|
+
element: SlateElement;
|
|
49
|
+
};
|
|
50
|
+
export type GetElementChildrenOptions = {
|
|
51
|
+
blockId: string;
|
|
52
|
+
type: string;
|
|
53
|
+
path?: number[];
|
|
54
|
+
};
|
|
55
|
+
export type IsElementEmptyOptions = {
|
|
56
|
+
blockId: string;
|
|
57
|
+
type: string;
|
|
58
|
+
path?: number[];
|
|
59
|
+
};
|
|
60
|
+
export type InsertElementTextOptions = {
|
|
61
|
+
blockId: string;
|
|
62
|
+
text: string;
|
|
63
|
+
at?: number[];
|
|
64
|
+
};
|
|
65
|
+
export type GetElementRectOptions = {
|
|
66
|
+
blockId: string;
|
|
67
|
+
element: SlateElement;
|
|
68
|
+
};
|
|
69
|
+
export type TransformBlockOptions = {
|
|
70
|
+
blockId: string;
|
|
71
|
+
transform: (slate: SlateEditor, block: YooptaBlockData) => void;
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,8 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { YooEditor } from '../types';
|
|
2
|
+
import type { UpdateElementOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Update element properties
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Update options
|
|
8
|
+
*
|
|
9
|
+
* @example Update block element by path
|
|
10
|
+
* ```typescript
|
|
11
|
+
* editor.updateElement({
|
|
12
|
+
* blockId: 'accordion-1',
|
|
13
|
+
* type: 'accordion-list-item',
|
|
14
|
+
* path: [0, 1],
|
|
15
|
+
* props: { isExpanded: false }
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example Update block element by type
|
|
20
|
+
* ```typescript
|
|
21
|
+
* editor.updateElement({
|
|
22
|
+
* blockId: 'accordion-1',
|
|
23
|
+
* type: 'accordion-list-item',
|
|
24
|
+
* props: { isExpanded: false }
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Update inline element (link)
|
|
29
|
+
* ```typescript
|
|
30
|
+
* // Update link at current selection
|
|
31
|
+
* editor.updateElement({
|
|
32
|
+
* blockId: 'paragraph-1',
|
|
33
|
+
* type: 'link',
|
|
34
|
+
* props: { url: 'https://new-url.com', target: '_self' }
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @example Update inline element text and props
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Update both link URL and displayed text
|
|
41
|
+
* editor.updateElement({
|
|
42
|
+
* blockId: 'paragraph-1',
|
|
43
|
+
* type: 'link',
|
|
44
|
+
* props: { url: 'https://example.com' },
|
|
45
|
+
* text: 'New link text'
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Update with custom matcher
|
|
50
|
+
* ```typescript
|
|
51
|
+
* editor.updateElement({
|
|
52
|
+
* blockId: 'accordion-1',
|
|
53
|
+
* type: 'accordion-list-item',
|
|
54
|
+
* match: (element) => element.props?.id === 'item-5',
|
|
55
|
+
* props: { isExpanded: true }
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example Update mention user name
|
|
60
|
+
* ```typescript
|
|
61
|
+
* editor.updateElement({
|
|
62
|
+
* blockId: 'paragraph-1',
|
|
63
|
+
* type: 'mention',
|
|
64
|
+
* props: { userName: 'Jane Doe' },
|
|
65
|
+
* text: '@Jane Doe' // Update displayed text too
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export declare function updateElement(editor: YooEditor, options: UpdateElementOptions): void;
|
|
8
70
|
//# sourceMappingURL=updateElement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/updateElement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"updateElement.d.ts","sourceRoot":"","sources":["../../../src/editor/elements/updateElement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAiFpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAG,IAAI,CA8EpF"}
|
package/dist/editor/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,SAAS,EAAsB,MAAM,SAAS,CAAC;AAoB7D,wBAAgB,kBAAkB,IAAI,SAAS,CA6F9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBlockOrder.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/getBlockOrder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAEtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNextBlockOrder.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/getNextBlockOrder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,CAK1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPreviousBlockOrder.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/getPreviousBlockOrder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAKxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSelectedPaths.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/getSelectedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"getSelectedPaths.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/getSelectedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC,UAAU,CAAC,CAE1E"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { getPath } from './getPath';
|
|
1
|
+
import { getBlockOrder } from './getBlockOrder';
|
|
2
|
+
import { getNextBlockOrder } from './getNextBlockOrder';
|
|
3
|
+
import { getPreviousBlockOrder } from './getPreviousBlockOrder';
|
|
5
4
|
import { getSelectedPaths } from './getSelectedPaths';
|
|
5
|
+
import { isBlockSelected } from './isBlockSelected';
|
|
6
6
|
import { isPathEmpty } from './isPathEmpty';
|
|
7
7
|
import { setPath } from './setPath';
|
|
8
|
-
import { getLastNodePoint } from '../../utils/
|
|
8
|
+
import { getLastNodePoint } from '../../utils/get-node-points';
|
|
9
|
+
import { getFirstPoint } from '../selection/getFirstPoint';
|
|
9
10
|
export declare const Paths: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
getBlockOrder: typeof getBlockOrder;
|
|
12
|
+
getNextBlockOrder: typeof getNextBlockOrder;
|
|
13
|
+
getPreviousBlockOrder: typeof getPreviousBlockOrder;
|
|
13
14
|
isBlockSelected: typeof isBlockSelected;
|
|
14
15
|
getSelectedPaths: typeof getSelectedPaths;
|
|
15
16
|
isPathEmpty: typeof isPathEmpty;
|
|
16
17
|
setPath: typeof setPath;
|
|
17
18
|
getLastNodePoint: typeof getLastNodePoint;
|
|
19
|
+
getFirstNodePoint: typeof getFirstPoint;
|
|
18
20
|
};
|
|
19
21
|
export type Paths = typeof Paths;
|
|
20
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D,eAAO,MAAM,KAAK;;;;;;;;;;CAWjB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,OAAO,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isBlockSelected.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/isBlockSelected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"isBlockSelected.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/isBlockSelected.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAG3D,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAQlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isPathEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/isPathEmpty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"isPathEmpty.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/isPathEmpty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAEtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setPath.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/setPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"setPath.d.ts","sourceRoot":"","sources":["../../../src/editor/paths/setPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtD,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,QAE1D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { YooEditor } from '../types';
|
|
2
|
+
import type { GetPointOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Get anchor point from Slate selection
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Get point options
|
|
8
|
+
* @returns Anchor point or null
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Get anchor point from current selection
|
|
13
|
+
* const anchor = Selection.getAnchor(editor);
|
|
14
|
+
*
|
|
15
|
+
* // Get anchor point from specific block
|
|
16
|
+
* const anchor = Selection.getAnchor(editor, { at: 0 });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAnchor(editor: YooEditor, options?: GetPointOptions): any;
|
|
20
|
+
//# sourceMappingURL=getAnchor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAnchor.d.ts","sourceRoot":"","sources":["../../../src/editor/selection/getAnchor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,eAAe,OAcrE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { YooEditor, YooptaPathIndex } from '../types';
|
|
2
|
+
import type { GetCurrentOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Get current block order
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Get current options
|
|
8
|
+
* @returns Current block order or null
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Get current block order
|
|
13
|
+
* const current = Selection.getCurrent(editor);
|
|
14
|
+
*
|
|
15
|
+
* // Get specific block order (same as editor.path.current)
|
|
16
|
+
* const current = Selection.getCurrent(editor, { at: 0 });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCurrent(editor: YooEditor, options?: GetCurrentOptions): YooptaPathIndex;
|
|
20
|
+
//# sourceMappingURL=getCurrent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCurrent.d.ts","sourceRoot":"","sources":["../../../src/editor/selection/getCurrent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,eAAe,CAM1F"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { YooEditor } from '../types';
|
|
2
|
+
import type { GetPointOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Get end point from Slate selection (later point)
|
|
5
|
+
*
|
|
6
|
+
* @param editor - YooEditor instance
|
|
7
|
+
* @param options - Get point options
|
|
8
|
+
* @returns End point or null
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // Get end point from current selection
|
|
13
|
+
* const end = Selection.getEnd(editor);
|
|
14
|
+
*
|
|
15
|
+
* // Get end point from specific block
|
|
16
|
+
* const end = Selection.getEnd(editor, { at: 0 });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function getEnd(editor: YooEditor, options?: GetPointOptions): import("slate").BasePoint | null;
|
|
20
|
+
//# sourceMappingURL=getEnd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEnd.d.ts","sourceRoot":"","sources":["../../../src/editor/selection/getEnd.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,eAAe,oCAgBlE"}
|