@wangeditor-next/yjs-for-react 0.1.13 → 0.1.14
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.
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ImageElement } from 'packages/basic-modules/src/modules/image/custom-types';
|
|
6
6
|
import { VideoElement } from 'packages/video-module/src/module/custom-types';
|
|
7
|
-
import { Node, NodeEntry, Range } from 'slate';
|
|
7
|
+
import { Descendant, Node, NodeEntry, Range } from 'slate';
|
|
8
8
|
import { IDomEditor } from '../editor/interface';
|
|
9
9
|
import { IMenuGroup } from '../menus/interface';
|
|
10
10
|
import { IUploadConfig } from '../upload';
|
|
11
|
+
import { DOMElement } from '../utils/dom';
|
|
11
12
|
interface IHoverbarConf {
|
|
12
13
|
[key: string]: {
|
|
13
14
|
match?: (editor: IDomEditor, n: Node) => boolean;
|
|
@@ -15,6 +16,25 @@ interface IHoverbarConf {
|
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
export type AlertType = 'success' | 'info' | 'warning' | 'error';
|
|
19
|
+
/**
|
|
20
|
+
* EditorEvents 包含所有编辑器的生命周期事件。
|
|
21
|
+
*
|
|
22
|
+
* @property {string} CREATED - 编辑器创建后触发,用于初始化操作。
|
|
23
|
+
* @property {string} DESTROYED - 编辑器销毁时触发,用于清理操作。
|
|
24
|
+
* @property {string} CHANGE - 编辑器内容发生变化时触发,通常用于监听输入或变动。
|
|
25
|
+
* @property {string} SCROLL - 编辑器滚动时触发,用于同步滚动状态或执行相关操作。
|
|
26
|
+
* @property {string} FULLSCREEN - 编辑器进入全屏时触发,通常用于调整布局或容器尺寸。
|
|
27
|
+
* @property {string} UNFULLSCREEN - 编辑器退出全屏时触发,恢复原始布局状态。
|
|
28
|
+
*/
|
|
29
|
+
export declare const EditorEvents: {
|
|
30
|
+
readonly CREATED: "created";
|
|
31
|
+
readonly DESTROYED: "destroyed";
|
|
32
|
+
readonly CHANGE: "change";
|
|
33
|
+
readonly SCROLL: "scroll";
|
|
34
|
+
readonly FULLSCREEN: "fullscreen";
|
|
35
|
+
readonly UNFULLSCREEN: "unFullScreen";
|
|
36
|
+
};
|
|
37
|
+
export type EditorEventType = typeof EditorEvents[keyof typeof EditorEvents];
|
|
18
38
|
export interface ISingleMenuConfig {
|
|
19
39
|
[key: string]: any;
|
|
20
40
|
iconSvg?: string;
|
|
@@ -188,4 +208,12 @@ export interface IToolbarConfig {
|
|
|
188
208
|
excludeKeys: Array<string>;
|
|
189
209
|
modalAppendToBody: boolean;
|
|
190
210
|
}
|
|
211
|
+
type PluginFnType = <T extends IDomEditor>(editor: T) => T;
|
|
212
|
+
export interface ICreateOption {
|
|
213
|
+
selector: string | DOMElement;
|
|
214
|
+
config: Partial<IEditorConfig>;
|
|
215
|
+
content?: Descendant[];
|
|
216
|
+
html?: string;
|
|
217
|
+
plugins: PluginFnType[];
|
|
218
|
+
}
|
|
191
219
|
export {};
|
|
@@ -2,20 +2,9 @@
|
|
|
2
2
|
* @description create editor
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ICreateOption } from '../config/interface';
|
|
6
6
|
import { IDomEditor } from '../editor/interface';
|
|
7
|
-
import { IEditorConfig } from '../config/interface';
|
|
8
|
-
import type { DOMElement } from '../utils/dom';
|
|
9
|
-
type PluginFnType = <T extends IDomEditor>(editor: T) => T;
|
|
10
|
-
interface ICreateOption {
|
|
11
|
-
selector: string | DOMElement;
|
|
12
|
-
config: Partial<IEditorConfig>;
|
|
13
|
-
content?: Descendant[];
|
|
14
|
-
html?: string;
|
|
15
|
-
plugins: PluginFnType[];
|
|
16
|
-
}
|
|
17
7
|
/**
|
|
18
8
|
* 创建编辑器
|
|
19
9
|
*/
|
|
20
|
-
export default function (option: Partial<ICreateOption>):
|
|
21
|
-
export {};
|
|
10
|
+
export default function (option: Partial<ICreateOption>): IDomEditor;
|
|
@@ -28,3 +28,10 @@ export declare function genDefaultContent(): {
|
|
|
28
28
|
* @param html html 字符串
|
|
29
29
|
*/
|
|
30
30
|
export declare function htmlToContent(editor: IDomEditor, html?: string): Descendant[];
|
|
31
|
+
/**
|
|
32
|
+
* 初始化内容(要在 config 和 plugins 后面)
|
|
33
|
+
*/
|
|
34
|
+
export declare function initializeContent(editor: IDomEditor, options: {
|
|
35
|
+
html?: string;
|
|
36
|
+
content?: Descendant[];
|
|
37
|
+
}): Descendant[];
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @description classic toolbar
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { Dom7Array, DOMElement } from '../../utils/dom';
|
|
6
|
-
import { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
7
5
|
import { IToolbarConfig } from '../../config/interface';
|
|
6
|
+
import { Dom7Array, DOMElement } from '../../utils/dom';
|
|
7
|
+
import { IButtonMenu, IDropPanelMenu, IModalMenu, ISelectMenu } from '../interface';
|
|
8
8
|
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
9
9
|
declare class Toolbar {
|
|
10
10
|
$box: Dom7Array;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wangeditor-next/yjs-for-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "React specific components/utils for wangeditor-next-yjs.",
|
|
5
5
|
"author": "cycleccc <2991205548@qq.com>",
|
|
6
6
|
"type": "module",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"y-protocols": "^1.0.5"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@wangeditor-next/core": "1.7.
|
|
59
|
+
"@wangeditor-next/core": "1.7.15",
|
|
60
60
|
"@wangeditor-next/editor": "5.6.4",
|
|
61
|
-
"@wangeditor-next/yjs": "^0.1.
|
|
61
|
+
"@wangeditor-next/yjs": "^0.1.13",
|
|
62
62
|
"react": ">=16.8.0",
|
|
63
63
|
"slate": "^0.72.0",
|
|
64
64
|
"yjs": "^13.5.29"
|