@yoopta/editor 1.9.15-rc → 1.9.16-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/YooptaEditor.d.ts +2 -1
- package/dist/components/Editor/Editor.d.ts +1 -3
- package/dist/components/YooptaEditor/YooptaEditor.d.ts +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5716 -3
- package/dist/types.d.ts +13 -1
- package/dist/utils/plugins.d.ts +3 -4
- package/dist/utils/storage.d.ts +2 -2
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { BaseEditor, BaseElement } from 'slate';
|
|
|
2
2
|
import { ReactEditor, RenderElementProps as ElementProps } from 'slate-react';
|
|
3
3
|
import { HistoryEditor } from 'slate-history';
|
|
4
4
|
import { YooptaPluginType, YooptaRenderHTMLAttributes } from './utils/plugins';
|
|
5
|
+
import { CSSProperties } from 'react';
|
|
5
6
|
export type EmptyText = {
|
|
6
7
|
text: string;
|
|
7
8
|
};
|
|
@@ -18,7 +19,18 @@ export type YooptaBaseElement<T> = {
|
|
|
18
19
|
export type RenderYooptaElementProps<T extends BaseElement = BaseElement> = ElementProps & {
|
|
19
20
|
element: T;
|
|
20
21
|
} & YooptaRenderHTMLAttributes;
|
|
22
|
+
export type YooptaEditorValue<V> = V[];
|
|
23
|
+
export type YooptaBaseToolEvents = {
|
|
24
|
+
[x: string]: (...args: any) => void;
|
|
25
|
+
};
|
|
26
|
+
export type YooptaBaseToolProps<P extends YooptaPluginType = YooptaPluginType, Events extends YooptaBaseToolEvents = YooptaBaseToolEvents> = {
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
className?: string;
|
|
29
|
+
plugins?: P[];
|
|
30
|
+
fromHook?: boolean;
|
|
31
|
+
on?: Events;
|
|
32
|
+
};
|
|
21
33
|
export interface YooEditor extends BaseEditor, ReactEditor, HistoryEditor {
|
|
22
|
-
shortcuts: Record<string, YooptaPluginType
|
|
34
|
+
shortcuts: Record<string, YooptaPluginType>;
|
|
23
35
|
plugins: Record<YooptaBaseElement<string>['type'], YooptaPluginType<any, YooptaBaseElement<string>>>;
|
|
24
36
|
}
|
package/dist/utils/plugins.d.ts
CHANGED
|
@@ -12,10 +12,9 @@ export type DecoratorFn = (nodeEntry: NodeEntry) => Range[];
|
|
|
12
12
|
export type YooptaPluginEventHandlers = {
|
|
13
13
|
[key in keyof EditorEventHandlers]: (editor: YooEditor, options: HandlersOptions) => EditorEventHandlers[key] | void;
|
|
14
14
|
};
|
|
15
|
-
export type YooptaPluginBaseOptions = {
|
|
15
|
+
export type YooptaPluginBaseOptions = YooptaRenderHTMLAttributes & {
|
|
16
16
|
searchString?: string;
|
|
17
17
|
displayLabel?: string;
|
|
18
|
-
[x: string]: any;
|
|
19
18
|
};
|
|
20
19
|
export type YooptaRenderElementFunc<P extends YooptaBaseElement<string> = YooptaBaseElement<string>> = (editor: YooEditor, plugin: YooptaPluginType) => (props: RenderYooptaElementProps<P> & YooptaRenderHTMLAttributes) => ReactElement;
|
|
21
20
|
export type YooptaRender<P extends YooptaBaseElement<string>> = YooptaRenderElementFunc<P>;
|
|
@@ -71,7 +70,7 @@ export type YooptaPluginType<O extends YooptaPluginBaseOptions = YooptaPluginBas
|
|
|
71
70
|
* The element's options object that can be extended with custom options for your plugin
|
|
72
71
|
* Default options: HTMLAttributes
|
|
73
72
|
*/
|
|
74
|
-
options?: O
|
|
73
|
+
options?: O;
|
|
75
74
|
/**
|
|
76
75
|
*
|
|
77
76
|
* @param editor
|
|
@@ -90,7 +89,7 @@ export type YooptaPluginType<O extends YooptaPluginBaseOptions = YooptaPluginBas
|
|
|
90
89
|
createElement?: (editor: YooEditor, elementData?: Partial<P>) => void;
|
|
91
90
|
defineElement: () => P;
|
|
92
91
|
};
|
|
93
|
-
export type ParentYooptaPlugin
|
|
92
|
+
export type ParentYooptaPlugin = Omit<YooptaPluginType, 'childPlugin' | 'hasParent'>;
|
|
94
93
|
export declare class YooptaPlugin<O extends YooptaPluginBaseOptions, P extends YooptaBaseElement<string>> {
|
|
95
94
|
#private;
|
|
96
95
|
constructor(inputPlugin: YooptaPluginType<O, P>);
|
package/dist/utils/storage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { YooptaEditorValue } from '../types';
|
|
2
2
|
export type OFFLINE_STORAGE = boolean | string;
|
|
3
3
|
export declare function getStorageName(offline?: OFFLINE_STORAGE): string;
|
|
4
|
-
export declare function getInitialState(storageName: string, offline?: OFFLINE_STORAGE, value?:
|
|
4
|
+
export declare function getInitialState<V>(storageName: string, offline?: OFFLINE_STORAGE, value?: YooptaEditorValue<V>): YooptaEditorValue<V>;
|