@wangeditor-next/core 1.7.6 → 1.7.7

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.
Files changed (94) hide show
  1. package/dist/core/src/config/index.d.ts +13 -13
  2. package/dist/core/src/config/interface.d.ts +58 -58
  3. package/dist/core/src/config/register.d.ts +12 -12
  4. package/dist/core/src/constants/index.d.ts +1 -1
  5. package/dist/core/src/constants/svg.d.ts +12 -12
  6. package/dist/core/src/create/bind-node-relation.d.ts +15 -15
  7. package/dist/core/src/create/create-editor.d.ts +21 -21
  8. package/dist/core/src/create/create-toolbar.d.ts +14 -14
  9. package/dist/core/src/create/helper.d.ts +30 -30
  10. package/dist/core/src/create/index.d.ts +7 -7
  11. package/dist/core/src/editor/dom-editor.d.ts +143 -143
  12. package/dist/core/src/editor/interface.d.ts +67 -67
  13. package/dist/core/src/editor/plugins/with-config.d.ts +7 -6
  14. package/dist/core/src/editor/plugins/with-content.d.ts +7 -6
  15. package/dist/core/src/editor/plugins/with-dom.d.ts +10 -9
  16. package/dist/core/src/editor/plugins/with-emitter.d.ts +7 -6
  17. package/dist/core/src/editor/plugins/with-event-data.d.ts +7 -6
  18. package/dist/core/src/editor/plugins/with-max-length.d.ts +7 -6
  19. package/dist/core/src/editor/plugins/with-selection.d.ts +7 -6
  20. package/dist/core/src/i18n/index.d.ts +32 -32
  21. package/dist/core/src/index.d.ts +32 -32
  22. package/dist/core/src/menus/bar/HoverBar.d.ts +48 -48
  23. package/dist/core/src/menus/bar/Toolbar.d.ts +35 -35
  24. package/dist/core/src/menus/bar-item/BaseButton.d.ts +26 -26
  25. package/dist/core/src/menus/bar-item/DropPanelButton.d.ts +14 -14
  26. package/dist/core/src/menus/bar-item/GroupButton.d.ts +17 -17
  27. package/dist/core/src/menus/bar-item/ModalButton.d.ts +25 -25
  28. package/dist/core/src/menus/bar-item/Select.d.ts +22 -22
  29. package/dist/core/src/menus/bar-item/SimpleButton.d.ts +11 -11
  30. package/dist/core/src/menus/bar-item/index.d.ts +24 -24
  31. package/dist/core/src/menus/bar-item/tooltip.d.ts +6 -6
  32. package/dist/core/src/menus/helpers/helpers.d.ts +18 -18
  33. package/dist/core/src/menus/helpers/position.d.ts +36 -36
  34. package/dist/core/src/menus/index.d.ts +9 -9
  35. package/dist/core/src/menus/interface.d.ts +66 -66
  36. package/dist/core/src/menus/panel-and-modal/BaseClass.d.ts +26 -26
  37. package/dist/core/src/menus/panel-and-modal/DropPanel.d.ts +14 -14
  38. package/dist/core/src/menus/panel-and-modal/Modal.d.ts +44 -44
  39. package/dist/core/src/menus/panel-and-modal/SelectList.d.ts +20 -20
  40. package/dist/core/src/menus/register.d.ts +16 -16
  41. package/dist/core/src/parse-html/helper.d.ts +10 -10
  42. package/dist/core/src/parse-html/index.d.ts +35 -35
  43. package/dist/core/src/parse-html/parse-common-elem-html.d.ts +15 -15
  44. package/dist/core/src/parse-html/parse-elem-html.d.ts +15 -15
  45. package/dist/core/src/parse-html/parse-text-elem-html.d.ts +15 -15
  46. package/dist/core/src/render/element/getRenderElem.d.ts +11 -11
  47. package/dist/core/src/render/element/renderElement.d.ts +9 -9
  48. package/dist/core/src/render/element/renderStyle.d.ts +13 -13
  49. package/dist/core/src/render/helper.d.ts +6 -6
  50. package/dist/core/src/render/index.d.ts +27 -27
  51. package/dist/core/src/render/node2Vnode.d.ts +15 -15
  52. package/dist/core/src/render/text/genVnode.d.ts +9 -9
  53. package/dist/core/src/render/text/renderStyle.d.ts +13 -13
  54. package/dist/core/src/render/text/renderText.d.ts +9 -9
  55. package/dist/core/src/text-area/TextArea.d.ts +47 -47
  56. package/dist/core/src/text-area/event-handlers/beforeInput.d.ts +8 -8
  57. package/dist/core/src/text-area/event-handlers/blur.d.ts +8 -8
  58. package/dist/core/src/text-area/event-handlers/click.d.ts +8 -8
  59. package/dist/core/src/text-area/event-handlers/composition.d.ts +27 -27
  60. package/dist/core/src/text-area/event-handlers/copy.d.ts +8 -8
  61. package/dist/core/src/text-area/event-handlers/cut.d.ts +8 -8
  62. package/dist/core/src/text-area/event-handlers/drag.d.ts +9 -9
  63. package/dist/core/src/text-area/event-handlers/drop.d.ts +8 -8
  64. package/dist/core/src/text-area/event-handlers/focus.d.ts +8 -8
  65. package/dist/core/src/text-area/event-handlers/index.d.ts +35 -35
  66. package/dist/core/src/text-area/event-handlers/keydown.d.ts +8 -8
  67. package/dist/core/src/text-area/event-handlers/keypress.d.ts +8 -8
  68. package/dist/core/src/text-area/event-handlers/paste.d.ts +8 -8
  69. package/dist/core/src/text-area/helpers.d.ts +26 -26
  70. package/dist/core/src/text-area/place-holder.d.ts +18 -18
  71. package/dist/core/src/text-area/syncSelection.d.ts +19 -19
  72. package/dist/core/src/text-area/update-view.d.ts +13 -13
  73. package/dist/core/src/to-html/elem2html.d.ts +8 -8
  74. package/dist/core/src/to-html/index.d.ts +32 -32
  75. package/dist/core/src/to-html/node2html.d.ts +8 -8
  76. package/dist/core/src/to-html/text2html.d.ts +8 -8
  77. package/dist/core/src/upload/createUploader.d.ts +8 -8
  78. package/dist/core/src/upload/index.d.ts +7 -7
  79. package/dist/core/src/upload/interface.d.ts +28 -28
  80. package/dist/core/src/utils/dom.d.ts +102 -102
  81. package/dist/core/src/utils/hotkeys.d.ts +35 -35
  82. package/dist/core/src/utils/key.d.ts +11 -11
  83. package/dist/core/src/utils/line.d.ts +14 -14
  84. package/dist/core/src/utils/ua.d.ts +14 -14
  85. package/dist/core/src/utils/util.d.ts +28 -28
  86. package/dist/core/src/utils/vdom.d.ts +34 -34
  87. package/dist/core/src/utils/weak-maps.d.ts +56 -56
  88. package/dist/index.js +7 -7
  89. package/dist/index.js.map +1 -1
  90. package/dist/index.mjs +9 -0
  91. package/dist/index.mjs.map +1 -0
  92. package/package.json +12 -9
  93. package/dist/index.esm.js +0 -9
  94. package/dist/index.esm.js.map +0 -1
@@ -1,14 +1,14 @@
1
- /**
2
- * @description 通过 UA 判断浏览器
3
- * @author wangfupeng
4
- */
5
- export declare const IS_IOS: boolean;
6
- export declare const IS_APPLE: boolean;
7
- export declare const IS_FIREFOX: boolean;
8
- export declare const IS_FIREFOX_LEGACY: boolean;
9
- export declare const IS_SAFARI: boolean;
10
- export declare const IS_EDGE_LEGACY: boolean;
11
- export declare const IS_CHROME_LEGACY: boolean;
12
- export declare const IS_CHROME: boolean;
13
- export declare const IS_QQBROWSER: boolean;
14
- export declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
1
+ /**
2
+ * @description 通过 UA 判断浏览器
3
+ * @author wangfupeng
4
+ */
5
+ export declare const IS_IOS: boolean;
6
+ export declare const IS_APPLE: boolean;
7
+ export declare const IS_FIREFOX: boolean;
8
+ export declare const IS_FIREFOX_LEGACY: boolean;
9
+ export declare const IS_SAFARI: boolean;
10
+ export declare const IS_EDGE_LEGACY: boolean;
11
+ export declare const IS_CHROME_LEGACY: boolean;
12
+ export declare const IS_CHROME: boolean;
13
+ export declare const IS_QQBROWSER: boolean;
14
+ export declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
@@ -1,28 +1,28 @@
1
- /**
2
- * @description 工具函数
3
- * @author wangfupeng
4
- */
5
- /**
6
- * 获取随机数字符串
7
- * @param prefix 前缀
8
- * @returns 随机数字符串
9
- */
10
- export declare function genRandomStr(prefix?: string): string;
11
- export declare function promiseResolveThen(fn: Function): void;
12
- /**
13
- * 追加 url query 参数
14
- * @param url url
15
- * @param data data
16
- */
17
- export declare function addQueryToUrl(url: string, data: object): string;
18
- /**
19
- * 替换 html 特殊字符,如 > 替换为 >
20
- * @param str html str
21
- */
22
- export declare function replaceHtmlSpecialSymbols(str: string): string;
23
- /**
24
- *【反转】替换 html 特殊字符,如 > 替换为 >
25
- * @param str html str
26
- */
27
- export declare function deReplaceHtmlSpecialSymbols(str: string): string;
28
- export declare const toString: (val: unknown) => string;
1
+ /**
2
+ * @description 工具函数
3
+ * @author wangfupeng
4
+ */
5
+ /**
6
+ * 获取随机数字符串
7
+ * @param prefix 前缀
8
+ * @returns 随机数字符串
9
+ */
10
+ export declare function genRandomStr(prefix?: string): string;
11
+ export declare function promiseResolveThen(fn: Function): void;
12
+ /**
13
+ * 追加 url query 参数
14
+ * @param url url
15
+ * @param data data
16
+ */
17
+ export declare function addQueryToUrl(url: string, data: object): string;
18
+ /**
19
+ * 替换 html 特殊字符,如 > 替换为 >
20
+ * @param str html str
21
+ */
22
+ export declare function replaceHtmlSpecialSymbols(str: string): string;
23
+ /**
24
+ *【反转】替换 html 特殊字符,如 > 替换为 >
25
+ * @param str html str
26
+ */
27
+ export declare function deReplaceHtmlSpecialSymbols(str: string): string;
28
+ export declare const toString: (val: unknown) => string;
@@ -1,34 +1,34 @@
1
- /**
2
- * @description vdom 相关方法
3
- * @author wangfupeng
4
- */
5
- import { VNode, VNodeStyle, Props, Dataset } from 'snabbdom';
6
- export type PatchFn = (oldVnode: VNode | Element, vnode: VNode) => VNode;
7
- /**
8
- * 创建 snabbdom patch
9
- * @returns snabbdom patch 函数
10
- */
11
- export declare function genPatchFn(): PatchFn;
12
- /**
13
- * 整理 vnode.data ,将暴露出来的零散属性(如 id className data-xxx)放在 data.props 或 data.dataset
14
- * @param vnode vnode
15
- */
16
- export declare function normalizeVnodeData(vnode: VNode): void;
17
- /**
18
- * 给 vnode 添加 prop
19
- * @param vnode vnode
20
- * @param newProp { key: val }
21
- */
22
- export declare function addVnodeProp(vnode: VNode, newProp: Props): void;
23
- /**
24
- * 给 vnode 添加 dataset
25
- * @param vnode vnode
26
- * @param newDataset { key: val }
27
- */
28
- export declare function addVnodeDataset(vnode: VNode, newDataset: Dataset): void;
29
- /**
30
- * 给 vnode 添加样式
31
- * @param vnode vnode
32
- * @param newStyle { key: val }
33
- */
34
- export declare function addVnodeStyle(vnode: VNode, newStyle: VNodeStyle): void;
1
+ /**
2
+ * @description vdom 相关方法
3
+ * @author wangfupeng
4
+ */
5
+ import { VNode, VNodeStyle, Props, Dataset } from 'snabbdom';
6
+ export type PatchFn = (oldVnode: VNode | Element, vnode: VNode) => VNode;
7
+ /**
8
+ * 创建 snabbdom patch
9
+ * @returns snabbdom patch 函数
10
+ */
11
+ export declare function genPatchFn(): PatchFn;
12
+ /**
13
+ * 整理 vnode.data ,将暴露出来的零散属性(如 id className data-xxx)放在 data.props 或 data.dataset
14
+ * @param vnode vnode
15
+ */
16
+ export declare function normalizeVnodeData(vnode: VNode): void;
17
+ /**
18
+ * 给 vnode 添加 prop
19
+ * @param vnode vnode
20
+ * @param newProp { key: val }
21
+ */
22
+ export declare function addVnodeProp(vnode: VNode, newProp: Props): void;
23
+ /**
24
+ * 给 vnode 添加 dataset
25
+ * @param vnode vnode
26
+ * @param newDataset { key: val }
27
+ */
28
+ export declare function addVnodeDataset(vnode: VNode, newDataset: Dataset): void;
29
+ /**
30
+ * 给 vnode 添加样式
31
+ * @param vnode vnode
32
+ * @param newStyle { key: val }
33
+ */
34
+ export declare function addVnodeStyle(vnode: VNode, newStyle: VNodeStyle): void;
@@ -1,56 +1,56 @@
1
- /**
2
- * @description 对象关联关系(部分参考 slate-react weak-maps.ts)
3
- * @author wangfupeng
4
- */
5
- import { Emitter } from 'event-emitter';
6
- import { VNode } from 'snabbdom';
7
- import { Node, Ancestor, Editor, Path, Range } from 'slate';
8
- import { IDomEditor } from '../editor/interface';
9
- import TextArea from '../text-area/TextArea';
10
- import Toolbar from '../menus/bar/Toolbar';
11
- import HoverBar from '../menus/bar/HoverBar';
12
- import { IBarItem } from '../menus/bar-item/index';
13
- import { Key } from './key';
14
- import { PatchFn } from '../utils/vdom';
15
- import { IEditorConfig } from '../config/interface';
16
- import PanelAndModal from '../menus/panel-and-modal/BaseClass';
17
- export declare const EDITOR_TO_TEXTAREA: WeakMap<IDomEditor, TextArea>;
18
- export declare const TEXTAREA_TO_EDITOR: WeakMap<TextArea, IDomEditor>;
19
- export declare const TOOLBAR_TO_EDITOR: WeakMap<Toolbar, IDomEditor>;
20
- export declare const EDITOR_TO_TOOLBAR: WeakMap<IDomEditor, Toolbar>;
21
- export declare const HOVER_BAR_TO_EDITOR: WeakMap<HoverBar, IDomEditor>;
22
- export declare const EDITOR_TO_HOVER_BAR: WeakMap<IDomEditor, HoverBar>;
23
- export declare const BAR_ITEM_TO_EDITOR: WeakMap<IBarItem, IDomEditor>;
24
- export declare const EDITOR_TO_PANEL_AND_MODAL: WeakMap<IDomEditor, Set<PanelAndModal>>;
25
- export declare const PANEL_OR_MODAL_TO_EDITOR: WeakMap<PanelAndModal, IDomEditor>;
26
- export declare const EDITOR_TO_CONFIG: WeakMap<IDomEditor, IEditorConfig>;
27
- export declare const IS_FIRST_PATCH: WeakMap<TextArea, boolean>;
28
- export declare const TEXTAREA_TO_PATCH_FN: WeakMap<TextArea, PatchFn>;
29
- export declare const TEXTAREA_TO_VNODE: WeakMap<TextArea, VNode>;
30
- /**
31
- * Two weak maps that allow us rebuild a path given a node. They are populated
32
- * at render time such that after a render occurs we can always backtrack.
33
- */
34
- export declare const NODE_TO_INDEX: WeakMap<Node, number>;
35
- export declare const NODE_TO_PARENT: WeakMap<Node, Ancestor>;
36
- /**
37
- * Weak maps that allow us to go between Slate nodes and DOM nodes. These
38
- * are used to resolve DOM event-related logic into Slate actions.
39
- */
40
- export declare const EDITOR_TO_ELEMENT: WeakMap<Editor, HTMLElement>;
41
- export declare const EDITOR_TO_PLACEHOLDER: WeakMap<Editor, string>;
42
- export declare const ELEMENT_TO_NODE: WeakMap<HTMLElement, Node>;
43
- export declare const KEY_TO_ELEMENT: WeakMap<Key, HTMLElement>;
44
- export declare const NODE_TO_ELEMENT: WeakMap<Node, HTMLElement>;
45
- export declare const NODE_TO_KEY: WeakMap<Node, Key>;
46
- export declare const EDITOR_TO_WINDOW: WeakMap<Editor, Window>;
47
- /**
48
- * Weak maps for storing editor-related state.
49
- */
50
- export declare const IS_FOCUSED: WeakMap<Editor, boolean>;
51
- export declare const IS_DRAGGING: WeakMap<Editor, boolean>;
52
- export declare const IS_CLICKING: WeakMap<Editor, boolean>;
53
- export declare const CHANGING_NODE_PATH: WeakMap<Editor, Path>;
54
- export declare const EDITOR_TO_SELECTION: WeakMap<Editor, Range>;
55
- export declare const EDITOR_TO_EMITTER: WeakMap<Editor, Emitter>;
56
- export declare const EDITOR_TO_CAN_PASTE: WeakMap<Editor, boolean>;
1
+ /**
2
+ * @description 对象关联关系(部分参考 slate-react weak-maps.ts)
3
+ * @author wangfupeng
4
+ */
5
+ import { Emitter } from 'event-emitter';
6
+ import { VNode } from 'snabbdom';
7
+ import { Node, Ancestor, Editor, Path, Range } from 'slate';
8
+ import { IDomEditor } from '../editor/interface';
9
+ import TextArea from '../text-area/TextArea';
10
+ import Toolbar from '../menus/bar/Toolbar';
11
+ import HoverBar from '../menus/bar/HoverBar';
12
+ import { IBarItem } from '../menus/bar-item/index';
13
+ import { Key } from './key';
14
+ import { PatchFn } from '../utils/vdom';
15
+ import { IEditorConfig } from '../config/interface';
16
+ import PanelAndModal from '../menus/panel-and-modal/BaseClass';
17
+ export declare const EDITOR_TO_TEXTAREA: WeakMap<IDomEditor, TextArea>;
18
+ export declare const TEXTAREA_TO_EDITOR: WeakMap<TextArea, IDomEditor>;
19
+ export declare const TOOLBAR_TO_EDITOR: WeakMap<Toolbar, IDomEditor>;
20
+ export declare const EDITOR_TO_TOOLBAR: WeakMap<IDomEditor, Toolbar>;
21
+ export declare const HOVER_BAR_TO_EDITOR: WeakMap<HoverBar, IDomEditor>;
22
+ export declare const EDITOR_TO_HOVER_BAR: WeakMap<IDomEditor, HoverBar>;
23
+ export declare const BAR_ITEM_TO_EDITOR: WeakMap<IBarItem, IDomEditor>;
24
+ export declare const EDITOR_TO_PANEL_AND_MODAL: WeakMap<IDomEditor, Set<PanelAndModal>>;
25
+ export declare const PANEL_OR_MODAL_TO_EDITOR: WeakMap<PanelAndModal, IDomEditor>;
26
+ export declare const EDITOR_TO_CONFIG: WeakMap<IDomEditor, IEditorConfig>;
27
+ export declare const IS_FIRST_PATCH: WeakMap<TextArea, boolean>;
28
+ export declare const TEXTAREA_TO_PATCH_FN: WeakMap<TextArea, PatchFn>;
29
+ export declare const TEXTAREA_TO_VNODE: WeakMap<TextArea, VNode>;
30
+ /**
31
+ * Two weak maps that allow us rebuild a path given a node. They are populated
32
+ * at render time such that after a render occurs we can always backtrack.
33
+ */
34
+ export declare const NODE_TO_INDEX: WeakMap<Node, number>;
35
+ export declare const NODE_TO_PARENT: WeakMap<Node, Ancestor>;
36
+ /**
37
+ * Weak maps that allow us to go between Slate nodes and DOM nodes. These
38
+ * are used to resolve DOM event-related logic into Slate actions.
39
+ */
40
+ export declare const EDITOR_TO_ELEMENT: WeakMap<Editor, HTMLElement>;
41
+ export declare const EDITOR_TO_PLACEHOLDER: WeakMap<Editor, string>;
42
+ export declare const ELEMENT_TO_NODE: WeakMap<HTMLElement, Node>;
43
+ export declare const KEY_TO_ELEMENT: WeakMap<Key, HTMLElement>;
44
+ export declare const NODE_TO_ELEMENT: WeakMap<Node, HTMLElement>;
45
+ export declare const NODE_TO_KEY: WeakMap<Node, Key>;
46
+ export declare const EDITOR_TO_WINDOW: WeakMap<Editor, Window>;
47
+ /**
48
+ * Weak maps for storing editor-related state.
49
+ */
50
+ export declare const IS_FOCUSED: WeakMap<Editor, boolean>;
51
+ export declare const IS_DRAGGING: WeakMap<Editor, boolean>;
52
+ export declare const IS_CLICKING: WeakMap<Editor, boolean>;
53
+ export declare const CHANGING_NODE_PATH: WeakMap<Editor, Path>;
54
+ export declare const EDITOR_TO_SELECTION: WeakMap<Editor, Range>;
55
+ export declare const EDITOR_TO_EMITTER: WeakMap<Editor, Emitter>;
56
+ export declare const EDITOR_TO_CAN_PASTE: WeakMap<Editor, boolean>;