@yoopta/editor 1.9.13-rc → 1.9.14-rc
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/dist/components/Editor/Editor.d.ts +2 -2
- package/dist/components/Editor/plugins/deleteFragment.d.ts +2 -2
- package/dist/components/Editor/plugins/nonEmptyEditor.d.ts +2 -2
- package/dist/components/Editor/plugins/pasteHtml.d.ts +2 -2
- package/dist/components/Editor/plugins/shortcuts.d.ts +2 -2
- package/dist/components/Editor/plugins/voids.d.ts +2 -2
- package/dist/hooks/useDragDrop.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/nodes.d.ts +4 -4
- package/dist/utils/plugins.d.ts +7 -7
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ParentYooptaPlugin, YooptaPluginType } from '../../utils/plugins';
|
|
3
3
|
import { YooptaMark } from '../../utils/marks';
|
|
4
|
-
import {
|
|
4
|
+
import { YooEditor, YooptaBaseElement } from '../../types';
|
|
5
5
|
import { YooptaTools } from '../YooptaEditor/YooptaEditor';
|
|
6
6
|
type YooptaProps = {
|
|
7
|
-
editor:
|
|
7
|
+
editor: YooEditor;
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
readOnly?: boolean;
|
|
10
10
|
plugins: ParentYooptaPlugin[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const withDeleteFragment: (editor:
|
|
1
|
+
import { YooEditor } from '../../../types';
|
|
2
|
+
export declare const withDeleteFragment: (editor: YooEditor) => YooEditor;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const withNonEmptyEditor: (editor:
|
|
1
|
+
import { YooEditor } from '../../../types';
|
|
2
|
+
export declare const withNonEmptyEditor: (editor: YooEditor) => YooEditor;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const withHtml: (editor:
|
|
1
|
+
import { YooEditor } from '../../../types';
|
|
2
|
+
declare const withHtml: (editor: YooEditor) => YooEditor;
|
|
3
3
|
export { withHtml };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const withShortcuts: (editor:
|
|
1
|
+
import { YooEditor } from '../../../types';
|
|
2
|
+
export declare const withShortcuts: (editor: YooEditor) => YooEditor;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const withVoidNodes: (editor:
|
|
1
|
+
import { YooEditor } from '../../../types';
|
|
2
|
+
export declare const withVoidNodes: (editor: YooEditor) => YooEditor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DragEvent } from 'react';
|
|
2
2
|
import { Node, NodeEntry } from 'slate';
|
|
3
|
-
import {
|
|
3
|
+
import { YooEditor, YooptaBaseElement } from '../types';
|
|
4
4
|
export type DraggedNode = {
|
|
5
5
|
path: number[] | null;
|
|
6
6
|
element: Pick<YooptaBaseElement<string>, 'id' | 'type'> | null;
|
|
@@ -22,4 +22,4 @@ export type DragDropHandlers = {
|
|
|
22
22
|
onDragStart: (_e: any, from: DraggedNode) => void;
|
|
23
23
|
};
|
|
24
24
|
export declare const DEFAULT_DRAG_STATE: DndState;
|
|
25
|
-
export declare const useDragDrop: (editor:
|
|
25
|
+
export declare const useDragDrop: (editor: YooEditor) => [DragDropValues, DragDropHandlers];
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export { isElementActive, getElementByPath } from './utils/nodes';
|
|
|
17
17
|
export { getElementClassname } from './utils/getElementClassname';
|
|
18
18
|
export type { YooptaPluginType, YooptaPluginEventHandlers, HandlersOptions, YooptaPluginBaseOptions, YooptaRenderHTMLAttributes, } from './utils/plugins';
|
|
19
19
|
export type { YooptaMarksConfig, YooptaMark } from './utils/marks';
|
|
20
|
-
export type {
|
|
20
|
+
export type { YooEditor, RenderYooptaElementProps, YooptaBaseElement, Modify } from './types';
|
|
21
21
|
declare const UI_HELPERS: {
|
|
22
22
|
ElementOptions: ({ onClose, style, element, render, ...props }: {
|
|
23
23
|
style: import("react").CSSProperties | undefined;
|
package/dist/types.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type YooptaBaseElement<T> = {
|
|
|
18
18
|
export type RenderYooptaElementProps<T extends BaseElement = BaseElement> = ElementProps & {
|
|
19
19
|
element: T;
|
|
20
20
|
} & YooptaRenderHTMLAttributes;
|
|
21
|
-
export interface
|
|
21
|
+
export interface YooEditor extends BaseEditor, ReactEditor, HistoryEditor {
|
|
22
22
|
shortcuts: Record<string, YooptaPluginType<string>>;
|
|
23
23
|
plugins: Record<YooptaBaseElement<string>['type'], YooptaPluginType<any, YooptaBaseElement<string>>>;
|
|
24
24
|
}
|
package/dist/utils/nodes.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Path } from 'slate';
|
|
2
|
-
import {
|
|
3
|
-
export declare const getMatchedNode: (editor:
|
|
4
|
-
export declare const isElementActive: (editor:
|
|
5
|
-
export declare const getElementByPath: (editor:
|
|
2
|
+
import { YooEditor } from '../types';
|
|
3
|
+
export declare const getMatchedNode: (editor: YooEditor, type: string) => false | import("slate").NodeEntry<import("slate").Node>;
|
|
4
|
+
export declare const isElementActive: (editor: YooEditor, type: string) => boolean;
|
|
5
|
+
export declare const getElementByPath: (editor: YooEditor, path?: Path, mode?: 'all' | 'highest' | 'lowest') => any;
|
package/dist/utils/plugins.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { Element, NodeEntry, Range } from 'slate';
|
|
3
3
|
import { RenderLeafProps } from 'slate-react';
|
|
4
|
-
import {
|
|
4
|
+
import { YooEditor, RenderYooptaElementProps, YooptaBaseElement } from '../types';
|
|
5
5
|
import { EditorEventHandlers } from '../types/eventHandlers';
|
|
6
6
|
import { HOTKEYS_TYPE } from './hotkeys';
|
|
7
7
|
export type HandlersOptions = {
|
|
@@ -10,14 +10,14 @@ export type HandlersOptions = {
|
|
|
10
10
|
};
|
|
11
11
|
export type DecoratorFn = (nodeEntry: NodeEntry) => Range[];
|
|
12
12
|
export type YooptaPluginEventHandlers = {
|
|
13
|
-
[key in keyof EditorEventHandlers]: (editor:
|
|
13
|
+
[key in keyof EditorEventHandlers]: (editor: YooEditor, options: HandlersOptions) => EditorEventHandlers[key] | void;
|
|
14
14
|
};
|
|
15
15
|
export type YooptaPluginBaseOptions = {
|
|
16
16
|
searchString?: string;
|
|
17
17
|
displayLabel?: string;
|
|
18
18
|
[x: string]: any;
|
|
19
19
|
};
|
|
20
|
-
export type YooptaRenderElementFunc<P extends YooptaBaseElement<string> = YooptaBaseElement<string>> = (editor:
|
|
20
|
+
export type YooptaRenderElementFunc<P extends YooptaBaseElement<string> = YooptaBaseElement<string>> = (editor: YooEditor, plugin: YooptaPluginType) => (props: RenderYooptaElementProps<P> & YooptaRenderHTMLAttributes) => ReactElement;
|
|
21
21
|
export type YooptaRender<P extends YooptaBaseElement<string>> = YooptaRenderElementFunc<P>;
|
|
22
22
|
export type ExtendedYooptaRender<P extends YooptaBaseElement<string>> = {
|
|
23
23
|
editor: YooptaRenderElementFunc<P>;
|
|
@@ -77,17 +77,17 @@ export type YooptaPluginType<O extends YooptaPluginBaseOptions = YooptaPluginBas
|
|
|
77
77
|
* @param editor
|
|
78
78
|
* @returns
|
|
79
79
|
*/
|
|
80
|
-
extendEditor?: (editor:
|
|
80
|
+
extendEditor?: (editor: YooEditor) => YooEditor;
|
|
81
81
|
/**
|
|
82
82
|
* Slate decorator for text ranges. Check docs: https://docs.slatejs.org/concepts/09-rendering#decorations
|
|
83
83
|
*/
|
|
84
|
-
decorator?: (editor:
|
|
84
|
+
decorator?: (editor: YooEditor) => DecoratorFn;
|
|
85
85
|
/** Slate leaves. Check docs: https://docs.slatejs.org/concepts/09-rendering#decorations */
|
|
86
|
-
leaf?: (editor:
|
|
86
|
+
leaf?: (editor: YooEditor) => (props: RenderLeafProps) => any;
|
|
87
87
|
/** Useful key for plugins which contain children as plugin. For example NumberedList contain childPlugin ListItem */
|
|
88
88
|
childPlugin?: YooptaPlugin<any, any>;
|
|
89
89
|
hasParent?: boolean;
|
|
90
|
-
createElement?: (editor:
|
|
90
|
+
createElement?: (editor: YooEditor, elementData?: Partial<P>) => void;
|
|
91
91
|
defineElement: () => P;
|
|
92
92
|
};
|
|
93
93
|
export type ParentYooptaPlugin<O = YooptaPluginBaseOptions> = Omit<YooptaPluginType<O>, 'childPlugin' | 'hasParent'>;
|