@wangeditor-next/list-module 6.4.2 → 6.4.3

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 (119) hide show
  1. package/dist/index.d.ts +8 -0
  2. package/dist/index.js +2 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +2 -2
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +10 -12
  7. package/dist/core/src/config/index.d.ts +0 -13
  8. package/dist/core/src/config/interface.d.ts +0 -339
  9. package/dist/core/src/config/register.d.ts +0 -12
  10. package/dist/core/src/config/style-mode.d.ts +0 -8
  11. package/dist/core/src/constants/index.d.ts +0 -1
  12. package/dist/core/src/constants/svg.d.ts +0 -12
  13. package/dist/core/src/create/bind-node-relation.d.ts +0 -15
  14. package/dist/core/src/create/create-editor.d.ts +0 -10
  15. package/dist/core/src/create/create-toolbar.d.ts +0 -14
  16. package/dist/core/src/create/helper.d.ts +0 -37
  17. package/dist/core/src/create/index.d.ts +0 -8
  18. package/dist/core/src/editor/dom-editor.d.ts +0 -154
  19. package/dist/core/src/editor/interface.d.ts +0 -90
  20. package/dist/core/src/editor/plugins/with-config.d.ts +0 -7
  21. package/dist/core/src/editor/plugins/with-content.d.ts +0 -7
  22. package/dist/core/src/editor/plugins/with-dom.d.ts +0 -10
  23. package/dist/core/src/editor/plugins/with-emitter.d.ts +0 -7
  24. package/dist/core/src/editor/plugins/with-event-data.d.ts +0 -7
  25. package/dist/core/src/editor/plugins/with-history.d.ts +0 -7
  26. package/dist/core/src/editor/plugins/with-max-length.d.ts +0 -7
  27. package/dist/core/src/editor/plugins/with-selection.d.ts +0 -7
  28. package/dist/core/src/i18n/index.d.ts +0 -32
  29. package/dist/core/src/index.d.ts +0 -45
  30. package/dist/core/src/menus/bar/HoverBar.d.ts +0 -48
  31. package/dist/core/src/menus/bar/Toolbar.d.ts +0 -38
  32. package/dist/core/src/menus/bar-item/BaseButton.d.ts +0 -26
  33. package/dist/core/src/menus/bar-item/DropPanelButton.d.ts +0 -14
  34. package/dist/core/src/menus/bar-item/GroupButton.d.ts +0 -17
  35. package/dist/core/src/menus/bar-item/ModalButton.d.ts +0 -25
  36. package/dist/core/src/menus/bar-item/Select.d.ts +0 -22
  37. package/dist/core/src/menus/bar-item/SimpleButton.d.ts +0 -11
  38. package/dist/core/src/menus/bar-item/index.d.ts +0 -24
  39. package/dist/core/src/menus/bar-item/tooltip.d.ts +0 -6
  40. package/dist/core/src/menus/helpers/helpers.d.ts +0 -18
  41. package/dist/core/src/menus/helpers/position.d.ts +0 -36
  42. package/dist/core/src/menus/index.d.ts +0 -9
  43. package/dist/core/src/menus/interface.d.ts +0 -65
  44. package/dist/core/src/menus/panel-and-modal/BaseClass.d.ts +0 -26
  45. package/dist/core/src/menus/panel-and-modal/DropPanel.d.ts +0 -12
  46. package/dist/core/src/menus/panel-and-modal/Modal.d.ts +0 -44
  47. package/dist/core/src/menus/panel-and-modal/SelectList.d.ts +0 -20
  48. package/dist/core/src/menus/register.d.ts +0 -15
  49. package/dist/core/src/parse-html/helper.d.ts +0 -10
  50. package/dist/core/src/parse-html/index.d.ts +0 -35
  51. package/dist/core/src/parse-html/parse-common-elem-html.d.ts +0 -15
  52. package/dist/core/src/parse-html/parse-elem-html.d.ts +0 -15
  53. package/dist/core/src/parse-html/parse-text-elem-html.d.ts +0 -16
  54. package/dist/core/src/render/element/getRenderElem.d.ts +0 -11
  55. package/dist/core/src/render/element/renderElement.d.ts +0 -9
  56. package/dist/core/src/render/element/renderStyle.d.ts +0 -15
  57. package/dist/core/src/render/helper.d.ts +0 -6
  58. package/dist/core/src/render/index.d.ts +0 -27
  59. package/dist/core/src/render/node2Vnode.d.ts +0 -15
  60. package/dist/core/src/render/text/genVnode.d.ts +0 -9
  61. package/dist/core/src/render/text/renderStyle.d.ts +0 -15
  62. package/dist/core/src/render/text/renderText.d.ts +0 -9
  63. package/dist/core/src/text-area/TextArea.d.ts +0 -52
  64. package/dist/core/src/text-area/event-handlers/beforeInput.d.ts +0 -8
  65. package/dist/core/src/text-area/event-handlers/blur.d.ts +0 -8
  66. package/dist/core/src/text-area/event-handlers/click.d.ts +0 -8
  67. package/dist/core/src/text-area/event-handlers/composition.d.ts +0 -27
  68. package/dist/core/src/text-area/event-handlers/copy.d.ts +0 -8
  69. package/dist/core/src/text-area/event-handlers/cut.d.ts +0 -8
  70. package/dist/core/src/text-area/event-handlers/drag.d.ts +0 -9
  71. package/dist/core/src/text-area/event-handlers/drop.d.ts +0 -8
  72. package/dist/core/src/text-area/event-handlers/focus.d.ts +0 -8
  73. package/dist/core/src/text-area/event-handlers/index.d.ts +0 -35
  74. package/dist/core/src/text-area/event-handlers/keydown.d.ts +0 -8
  75. package/dist/core/src/text-area/event-handlers/keypress.d.ts +0 -8
  76. package/dist/core/src/text-area/event-handlers/paste.d.ts +0 -8
  77. package/dist/core/src/text-area/helpers.d.ts +0 -30
  78. package/dist/core/src/text-area/place-holder.d.ts +0 -18
  79. package/dist/core/src/text-area/syncSelection.d.ts +0 -19
  80. package/dist/core/src/text-area/update-view.d.ts +0 -13
  81. package/dist/core/src/to-html/elem2html.d.ts +0 -9
  82. package/dist/core/src/to-html/index.d.ts +0 -44
  83. package/dist/core/src/to-html/node2html.d.ts +0 -12
  84. package/dist/core/src/to-html/text2html.d.ts +0 -9
  85. package/dist/core/src/upload/createUploader.d.ts +0 -14
  86. package/dist/core/src/upload/createUppyUploader.d.ts +0 -7
  87. package/dist/core/src/upload/interface.d.ts +0 -72
  88. package/dist/core/src/utils/dom.d.ts +0 -103
  89. package/dist/core/src/utils/hotkeys.d.ts +0 -35
  90. package/dist/core/src/utils/key.d.ts +0 -11
  91. package/dist/core/src/utils/line.d.ts +0 -14
  92. package/dist/core/src/utils/sanitize-html.d.ts +0 -5
  93. package/dist/core/src/utils/ua.d.ts +0 -14
  94. package/dist/core/src/utils/util.d.ts +0 -28
  95. package/dist/core/src/utils/vdom.d.ts +0 -34
  96. package/dist/core/src/utils/weak-maps.d.ts +0 -60
  97. package/dist/list-module/src/constants/svg.d.ts +0 -11
  98. package/dist/list-module/src/index.d.ts +0 -8
  99. package/dist/list-module/src/locale/en.d.ts +0 -15
  100. package/dist/list-module/src/locale/index.d.ts +0 -5
  101. package/dist/list-module/src/locale/zh-CN.d.ts +0 -15
  102. package/dist/list-module/src/module/custom-types.d.ts +0 -27
  103. package/dist/list-module/src/module/elem-to-html.d.ts +0 -16
  104. package/dist/list-module/src/module/helpers.d.ts +0 -26
  105. package/dist/list-module/src/module/html-transform.d.ts +0 -10
  106. package/dist/list-module/src/module/index.d.ts +0 -7
  107. package/dist/list-module/src/module/menu/BaseMenu.d.ts +0 -20
  108. package/dist/list-module/src/module/menu/BulletedListMenu.d.ts +0 -11
  109. package/dist/list-module/src/module/menu/LowerAlphaListMenu.d.ts +0 -13
  110. package/dist/list-module/src/module/menu/NumberedListMenu.d.ts +0 -11
  111. package/dist/list-module/src/module/menu/index.d.ts +0 -19
  112. package/dist/list-module/src/module/outline-actions.d.ts +0 -9
  113. package/dist/list-module/src/module/parse-elem-html.d.ts +0 -18
  114. package/dist/list-module/src/module/plugin.d.ts +0 -7
  115. package/dist/list-module/src/module/render-elem.d.ts +0 -13
  116. package/dist/list-module/src/module/style-class.d.ts +0 -6
  117. package/dist/list-module/src/utils/dom.d.ts +0 -19
  118. package/dist/list-module/src/utils/maps.d.ts +0 -7
  119. package/dist/list-module/src/utils/util.d.ts +0 -6
@@ -1,44 +0,0 @@
1
- /**
2
- * @description to-html entry
3
- * @author wangfupeng
4
- */
5
- import { Descendant, Element as SlateElement } from 'slate';
6
- import { IDomEditor } from '../editor/interface';
7
- import type { INodeToHtmlOptions } from './node2html';
8
- export type styleToHtmlFnType = (node: Descendant, elemHtml: string, editor?: IDomEditor) => string;
9
- export declare const STYLE_TO_HTML_FN_LIST: styleToHtmlFnType[];
10
- /**
11
- * 注册 toHtml 处理文本样式的函数
12
- * @param fn 处理 toHtml 文本样式的函数
13
- */
14
- export declare function registerStyleToHtmlHandler(fn: styleToHtmlFnType): void;
15
- /**
16
- * Transform the HTML fragments of the document's top-level nodes.
17
- *
18
- * Element serializers intentionally stay node-local. Modules that need
19
- * neighboring blocks to produce valid HTML (for example semantic lists) use
20
- * this hook after every node has been serialized.
21
- */
22
- export type HtmlTransformFnType = (htmlList: string[], nodes: Descendant[], editor: IDomEditor, options: INodeToHtmlOptions) => string[];
23
- export declare const HTML_TRANSFORM_HANDLER_LIST: HtmlTransformFnType[];
24
- export declare function registerHtmlTransformHandler(fn: HtmlTransformFnType): void;
25
- export declare function transformHtml(htmlList: string[], nodes: Descendant[], editor: IDomEditor, options?: INodeToHtmlOptions): string[];
26
- interface IElemToHtmlRes {
27
- html: string;
28
- prefix?: string;
29
- suffix?: string;
30
- }
31
- export type ElemToHtmlFnType = (elemNode: SlateElement, childrenHtml: string, editor?: IDomEditor) => string | IElemToHtmlRes;
32
- export declare const ELEM_TO_HTML_CONF: {
33
- [key: string]: ElemToHtmlFnType;
34
- };
35
- export interface IElemToHtmlConf {
36
- type: string;
37
- elemToHtml: ElemToHtmlFnType;
38
- }
39
- /**
40
- * 注册 elem to html 函数
41
- * @param conf { type, elemToHtml } ,type 即 node.type
42
- */
43
- export declare function registerElemToHtmlConf(conf: IElemToHtmlConf): void;
44
- export {};
@@ -1,12 +0,0 @@
1
- /**
2
- * @description node -> html
3
- * @author wangfupeng
4
- */
5
- import { Descendant } from 'slate';
6
- import type { IDomEditor } from '../editor/interface';
7
- export interface INodeToHtmlOptions {
8
- includeId?: boolean;
9
- idKey?: string;
10
- }
11
- declare function node2html(node: Descendant, editor: IDomEditor, options?: INodeToHtmlOptions): string;
12
- export default node2html;
@@ -1,9 +0,0 @@
1
- /**
2
- * @description text -> html
3
- * @author wangfupeng
4
- */
5
- import { Text } from 'slate';
6
- import { IDomEditor } from '../editor/interface';
7
- import type { INodeToHtmlOptions } from './node2html';
8
- declare function textToHtml(textNode: Text, editor: IDomEditor, _options?: INodeToHtmlOptions): string;
9
- export default textToHtml;
@@ -1,14 +0,0 @@
1
- /**
2
- * @description gen uploader
3
- * @author wangfupeng
4
- */
5
- import type { IDomEditor } from '../editor/interface';
6
- import type { IUploadAdapter, IUploadConfig, IUploader } from './interface';
7
- type IUploadConfigWithAdapter = IUploadConfig & {
8
- uploadAdapter: IUploadAdapter;
9
- };
10
- type IDefaultUploader = IUploader & {
11
- [key: string]: any;
12
- };
13
- declare function createUploader<T extends IUploadConfig>(config: T, editor?: IDomEditor): T extends IUploadConfigWithAdapter ? IUploader : IDefaultUploader;
14
- export default createUploader;
@@ -1,7 +0,0 @@
1
- /**
2
- * @description create default uppy uploader
3
- * @author wangfupeng
4
- */
5
- import type { IUploadConfig, IUploader } from './interface';
6
- declare function createUppyUploader(config: IUploadConfig): IUploader;
7
- export default createUppyUploader;
@@ -1,72 +0,0 @@
1
- /**
2
- * @description upload interface
3
- * @author wangfupeng
4
- */
5
- import type { IDomEditor } from '../editor/interface';
6
- export type IUploadHeaders = Record<string, string | number>;
7
- export interface IUploadResultFile {
8
- name: string;
9
- type?: string;
10
- size?: number;
11
- [key: string]: any;
12
- }
13
- export interface IUploadFile {
14
- name: string;
15
- type: string;
16
- size: number;
17
- data: Blob | File;
18
- source?: string;
19
- }
20
- export interface IUploader {
21
- addFiles: (files: IUploadFile[]) => void;
22
- upload: () => Promise<unknown>;
23
- destroy?: () => void;
24
- }
25
- type FilesType = Record<string, any>;
26
- type InsertFn = (src: string, poster?: string, alt?: string, href?: string) => void | Promise<void>;
27
- export interface IUploadAdapterContext {
28
- config: IUploadConfig;
29
- editor?: IDomEditor;
30
- }
31
- export type IUploadAdapter = (context: IUploadAdapterContext) => IUploader;
32
- interface IBaseUploadConfig {
33
- fieldName?: string;
34
- maxFileSize?: number;
35
- maxNumberOfFiles?: number;
36
- meta?: Record<string, unknown>;
37
- metaWithUrl: boolean;
38
- headers?: IUploadHeaders | ((file: IUploadResultFile) => IUploadHeaders) | undefined;
39
- withCredentials?: boolean;
40
- timeout?: number;
41
- onBeforeUpload?: (files: FilesType) => boolean | FilesType;
42
- onSuccess: (file: IUploadResultFile, response: any) => void;
43
- onProgress?: (progress: number) => void;
44
- onFailed: (file: IUploadResultFile, response: any) => void;
45
- onError: (file: IUploadResultFile, error: any, res: any) => void;
46
- allowedFileTypes?: string[];
47
- customInsert?: (res: any, insertFn: InsertFn) => void;
48
- customUpload?: (files: File, insertFn: InsertFn, editor: IDomEditor) => void;
49
- customBrowseAndUpload?: (insertFn: InsertFn) => void;
50
- uploadAdapter?: IUploadAdapter;
51
- uppyConfig?: Record<string, any>;
52
- xhrConfig?: Record<string, any>;
53
- }
54
- interface IUploadConfigWithCustomUpload extends IBaseUploadConfig {
55
- server?: string;
56
- customUpload: (files: File, insertFn: InsertFn, editor: IDomEditor) => void;
57
- }
58
- interface IUploadConfigWithUploadAdapter extends IBaseUploadConfig {
59
- server?: string;
60
- uploadAdapter: IUploadAdapter;
61
- customUpload?: (files: File, insertFn: InsertFn, editor: IDomEditor) => void;
62
- }
63
- interface IUploadConfigWithoutCustomUpload extends IBaseUploadConfig {
64
- server: string;
65
- customUpload?: never;
66
- uploadAdapter?: never;
67
- }
68
- /**
69
- * 配置参考 https://uppy.io/docs/uppy/
70
- */
71
- export type IUploadConfig = IUploadConfigWithCustomUpload | IUploadConfigWithUploadAdapter | IUploadConfigWithoutCustomUpload;
72
- export {};
@@ -1,103 +0,0 @@
1
- /**
2
- * @description DOM 操作 part1 - DOM7 文档 https://framework7.io/docs/dom7.html
3
- * @author wangfupeng
4
- */
5
- import $, { Dom7Array } from 'dom7';
6
- import DOMNode = globalThis.Node;
7
- import DOMComment = globalThis.Comment;
8
- import DOMElement = globalThis.Element;
9
- import DOMText = globalThis.Text;
10
- import DOMRange = globalThis.Range;
11
- import DOMSelection = globalThis.Selection;
12
- import DOMStaticRange = globalThis.StaticRange;
13
- export type { Dom7Array } from 'dom7';
14
- export default $;
15
- export declare enum NodeType {
16
- ELEMENT_NODE = 1,
17
- TEXT_NODE = 3,
18
- CDATA_SECTION_NODE = 4,
19
- PROCESSING_INSTRUCTION_NODE = 7,
20
- COMMENT_NODE = 8,
21
- DOCUMENT_NODE = 9,
22
- DOCUMENT_TYPE_NODE = 10,
23
- DOCUMENT_FRAGMENT_NODE = 11
24
- }
25
- export declare const isDocument: (value: any) => value is Document;
26
- export declare const isShadowRoot: (value: any) => value is ShadowRoot;
27
- export declare const isDataTransfer: (value: any) => value is DataTransfer;
28
- export declare const isUnprocessedListElement: (el: Element) => boolean;
29
- export declare const isHTMLElememt: (value: any) => value is HTMLElement;
30
- export { DOMComment, DOMElement, DOMNode, DOMRange, DOMSelection, DOMStaticRange, DOMText, };
31
- export type DOMPoint = [Node, number];
32
- /**
33
- * Returns the host window of a DOM node
34
- */
35
- export declare const getDefaultView: (value: any) => Window | null;
36
- /**
37
- * Check if a value is a DOM node.
38
- */
39
- export declare const isDOMNode: (value: any) => value is DOMNode;
40
- /**
41
- * Check if a DOM node is a comment node.
42
- */
43
- export declare const isDOMComment: (value: any) => value is DOMComment;
44
- /**
45
- * Check if a DOM node is an element node.
46
- */
47
- export declare const isDOMElement: (value: any) => value is DOMElement;
48
- /**
49
- * Check if a value is a DOM selection.
50
- */
51
- export declare const isDOMSelection: (value: any) => value is DOMSelection;
52
- /**
53
- * Check if a DOM node is an element node.
54
- */
55
- export declare const isDOMText: (value: any) => value is DOMText;
56
- /**
57
- * Checks whether a paste event is a plaintext-only event.
58
- */
59
- export declare const isPlainTextOnlyPaste: (event: ClipboardEvent) => boolean | null;
60
- /**
61
- * Normalize a DOM point so that it always refers to a text node.
62
- */
63
- export declare const normalizeDOMPoint: (domPoint: DOMPoint) => DOMPoint;
64
- /**
65
- * Determines wether the active element is nested within a shadowRoot
66
- */
67
- export declare const hasShadowRoot: () => boolean;
68
- /**
69
- * Get the element with the specified id
70
- */
71
- export declare const getElementById: (id: string) => null | HTMLElement;
72
- /**
73
- * Get the nearest editable child and index at `index` in a `parent`, preferring `direction`.
74
- */
75
- export declare const getEditableChildAndIndex: (parent: DOMElement, index: number, direction: "forward" | "backward") => [DOMNode, number];
76
- /**
77
- * Get the nearest editable child at `index` in a `parent`, preferring
78
- * `direction`.
79
- */
80
- export declare const getEditableChild: (parent: DOMElement, index: number, direction: "forward" | "backward") => DOMNode;
81
- /**
82
- * Get a plaintext representation of the content of a node, accounting for block
83
- * elements which get a newline appended.
84
- *
85
- * The domNode must be attached to the DOM.
86
- */
87
- export declare const getPlainText: (domNode: DOMNode) => string;
88
- /**
89
- * 在下级节点中找到第一个 void elem
90
- * @param elem elem
91
- */
92
- export declare function getFirstVoidChild(elem: DOMElement): DOMElement | null;
93
- /**
94
- * 遍历一个 elem 内所有的 text node ,执行函数
95
- * @param elem elem
96
- * @param handler handler
97
- */
98
- export declare function walkTextNodes(elem: DOMElement, handler: (textNode: DOMNode, parent: DOMElement) => void): void;
99
- /**
100
- * 获取 tagName lower-case
101
- * @param $elem $elem
102
- */
103
- export declare function getTagName($elem: Dom7Array): string;
@@ -1,35 +0,0 @@
1
- /**
2
- * @description 快捷键
3
- * @author wangfupeng
4
- */
5
- /**
6
- * Hotkeys.
7
- */
8
- declare const _default: {
9
- isBold: (event: KeyboardEvent) => boolean;
10
- isCompose: (event: KeyboardEvent) => boolean;
11
- isMoveBackward: (event: KeyboardEvent) => boolean;
12
- isMoveForward: (event: KeyboardEvent) => boolean;
13
- isDeleteBackward: (event: KeyboardEvent) => boolean;
14
- isDeleteForward: (event: KeyboardEvent) => boolean;
15
- isDeleteLineBackward: (event: KeyboardEvent) => boolean;
16
- isDeleteLineForward: (event: KeyboardEvent) => boolean;
17
- isDeleteWordBackward: (event: KeyboardEvent) => boolean;
18
- isDeleteWordForward: (event: KeyboardEvent) => boolean;
19
- isExtendBackward: (event: KeyboardEvent) => boolean;
20
- isExtendForward: (event: KeyboardEvent) => boolean;
21
- isExtendLineBackward: (event: KeyboardEvent) => boolean;
22
- isExtendLineForward: (event: KeyboardEvent) => boolean;
23
- isItalic: (event: KeyboardEvent) => boolean;
24
- isMoveLineBackward: (event: KeyboardEvent) => boolean;
25
- isMoveLineForward: (event: KeyboardEvent) => boolean;
26
- isMoveWordBackward: (event: KeyboardEvent) => boolean;
27
- isMoveWordForward: (event: KeyboardEvent) => boolean;
28
- isRedo: (event: KeyboardEvent) => boolean;
29
- isSplitBlock: (event: KeyboardEvent) => boolean;
30
- isTransposeCharacter: (event: KeyboardEvent) => boolean;
31
- isUndo: (event: KeyboardEvent) => boolean;
32
- isTab: (event: KeyboardEvent) => boolean;
33
- isSelectAll: (event: KeyboardEvent) => boolean;
34
- };
35
- export default _default;
@@ -1,11 +0,0 @@
1
- /**
2
- * An auto-incrementing identifier for keys.
3
- */
4
- /**
5
- * A class that keeps track of a key string. We use a full class here because we
6
- * want to be able to use them as keys in `WeakMap` objects.
7
- */
8
- export declare class Key {
9
- id: string;
10
- constructor();
11
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * @description Utilities for single-line deletion
3
- */
4
- import { Range } from 'slate';
5
- import { IDomEditor } from '../editor/interface';
6
- /**
7
- * A helper utility that returns the end portion of a `Range`
8
- * which is located on a single line.
9
- *
10
- * @param {Editor} editor The editor object to compare against
11
- * @param {Range} parentRange The parent range to compare against
12
- * @returns {Range} A valid portion of the parentRange which is one a single line
13
- */
14
- export declare const findCurrentLineRange: (editor: IDomEditor, parentRange: Range) => Range;
@@ -1,5 +0,0 @@
1
- /**
2
- * @description sanitize html before parsing/importing into editor
3
- * @author Codex
4
- */
5
- export declare function defaultSanitizeHtml(html?: string): string;
@@ -1,14 +0,0 @@
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 +0,0 @@
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 特殊字符,如 > 替换为 &gt;
20
- * @param str html str
21
- */
22
- export declare function replaceHtmlSpecialSymbols(str: string): string;
23
- /**
24
- *【反转】替换 html 特殊字符,如 &gt; 替换为 >
25
- * @param str html str
26
- */
27
- export declare function deReplaceHtmlSpecialSymbols(str: string): string;
28
- export declare const toString: (val: unknown) => string;
@@ -1,34 +0,0 @@
1
- /**
2
- * @description vdom 相关方法
3
- * @author wangfupeng
4
- */
5
- import { Dataset, Props, VNode, VNodeStyle } 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 添加 prop
14
- * @param vnode vnode
15
- * @param newProp { key: val }
16
- */
17
- export declare function addVnodeProp(vnode: VNode, newProp: Props): void;
18
- /**
19
- * 给 vnode 添加 dataset
20
- * @param vnode vnode
21
- * @param newDataset { key: val }
22
- */
23
- export declare function addVnodeDataset(vnode: VNode, newDataset: Dataset): void;
24
- /**
25
- * 给 vnode 添加样式
26
- * @param vnode vnode
27
- * @param newStyle { key: val }
28
- */
29
- export declare function addVnodeStyle(vnode: VNode, newStyle: VNodeStyle): void;
30
- /**
31
- * 整理 vnode.data ,将暴露出来的零散属性(如 id className data-xxx)放在 data.props 或 data.dataset
32
- * @param vnode vnode
33
- */
34
- export declare function normalizeVnodeData(vnode: VNode): void;
@@ -1,60 +0,0 @@
1
- /**
2
- * @description 对象关联关系(部分参考 slate-react weak-maps.ts)
3
- * @author wangfupeng
4
- */
5
- import { Emitter } from 'event-emitter';
6
- import { Ancestor, Editor, Node, Path, Range } from 'slate';
7
- import { VNode } from 'snabbdom';
8
- import { IEditorConfig } from '../config/interface';
9
- import { IDomEditor } from '../editor/interface';
10
- import HoverBar from '../menus/bar/HoverBar';
11
- import Toolbar from '../menus/bar/Toolbar';
12
- import { IBarItem } from '../menus/bar-item/index';
13
- import PanelAndModal from '../menus/panel-and-modal/BaseClass';
14
- import TextArea from '../text-area/TextArea';
15
- import { PatchFn } from '../utils/vdom';
16
- import { Key } from './key';
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
- export declare const NODE_TO_VNODE: WeakMap<Node, [number, VNode]>;
31
- export declare const NODE_TO_HTML: WeakMap<Node, String>;
32
- /**
33
- * Two weak maps that allow us rebuild a path given a node. They are populated
34
- * at render time such that after a render occurs we can always backtrack.
35
- */
36
- export declare const NODE_TO_INDEX: WeakMap<Node, number>;
37
- export declare const NODE_TO_PARENT: WeakMap<Node, Ancestor>;
38
- /**
39
- * Weak maps that allow us to go between Slate nodes and DOM nodes. These
40
- * are used to resolve DOM event-related logic into Slate actions.
41
- */
42
- export declare const EDITOR_TO_ELEMENT: WeakMap<Editor, HTMLElement>;
43
- export declare const EDITOR_TO_PLACEHOLDER: WeakMap<Editor, string>;
44
- export declare const ELEMENT_TO_NODE: WeakMap<HTMLElement, Node>;
45
- export declare const KEY_TO_ELEMENT: WeakMap<Key, HTMLElement>;
46
- export declare const NODE_TO_ELEMENT: WeakMap<Node, HTMLElement>;
47
- export declare const NODE_TO_KEY: WeakMap<Node, Key>;
48
- export declare const EDITOR_TO_WINDOW: WeakMap<Editor, Window>;
49
- /**
50
- * Weak maps for storing editor-related state.
51
- */
52
- export declare const IS_FOCUSED: WeakMap<Editor, boolean>;
53
- export declare const IS_DRAGGING: WeakMap<Editor, boolean>;
54
- export declare const IS_CLICKING: WeakMap<Editor, boolean>;
55
- export declare const CHANGING_NODE_PATH: WeakMap<Editor, Path>;
56
- export declare const EDITOR_TO_SELECTION: WeakMap<Editor, Range>;
57
- export declare const EDITOR_TO_EMITTER: WeakMap<Editor, Emitter>;
58
- export declare const EDITOR_TO_CAN_PASTE: WeakMap<Editor, boolean>;
59
- export declare const EDITOR_TO_PENDING_COMPOSITION_END: WeakMap<Editor, boolean>;
60
- export declare const EDITOR_TO_PENDING_SELECTION: WeakMap<Editor, Range | null>;
@@ -1,11 +0,0 @@
1
- /**
2
- * @description icon svg
3
- * @author wangfupeng
4
- */
5
- /**
6
- * 【注意】svg 字符串的长度 ,否则会导致代码体积过大
7
- * 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
8
- * 找不到再从 iconfont.com 搜索
9
- */
10
- export declare const BULLETED_LIST_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M384 64h640v128H384V64z m0 384h640v128H384v-128z m0 384h640v128H384v-128zM0 128a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z m0 384a128 128 0 1 1 256 0 128 128 0 0 1-256 0z\"></path></svg>";
11
- export declare const NUMBERED_LIST_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M384 832h640v128H384z m0-384h640v128H384z m0-384h640v128H384zM192 0v256H128V64H64V0zM128 526.016v50.016h128v64H64v-146.016l128-60V384H64v-64h192v146.016zM256 704v320H64v-64h128v-64H64v-64h128v-64H64v-64z\"></path></svg>";
@@ -1,8 +0,0 @@
1
- /**
2
- * @description list module
3
- * @author wangfupeng
4
- */
5
- import './assets/index.less';
6
- import './locale/index';
7
- import wangEditorListModule from './module/index';
8
- export default wangEditorListModule;
@@ -1,15 +0,0 @@
1
- /**
2
- * @description i18n en
3
- * @author wangfupeng
4
- */
5
- declare const _default: {
6
- listModule: {
7
- unOrderedList: string;
8
- orderedList: string;
9
- lowerAlphaList: string;
10
- numberingActions: string;
11
- continueNumbering: string;
12
- restartNumbering: string;
13
- };
14
- };
15
- export default _default;
@@ -1,5 +0,0 @@
1
- /**
2
- * @description i18n entry
3
- * @author wangfupeng
4
- */
5
- export {};
@@ -1,15 +0,0 @@
1
- /**
2
- * @description i18n zh-CN
3
- * @author wangfupeng
4
- */
5
- declare const _default: {
6
- listModule: {
7
- unOrderedList: string;
8
- orderedList: string;
9
- lowerAlphaList: string;
10
- numberingActions: string;
11
- continueNumbering: string;
12
- restartNumbering: string;
13
- };
14
- };
15
- export default _default;
@@ -1,27 +0,0 @@
1
- /**
2
- * @description list element
3
- * @author wangfupeng
4
- */
5
- import { Text } from 'slate';
6
- export type OrderedListType = '1' | 'a' | 'A' | 'i' | 'I';
7
- /**
8
- * An outline keeps the established list-item wire format and records the
9
- * heading semantics as additive metadata.
10
- */
11
- export type HeadingType = 'header1' | 'header2' | 'header3' | 'header4' | 'header5' | 'header6';
12
- export type ListItemElement = {
13
- type: 'list-item';
14
- ordered: boolean;
15
- level: number;
16
- start?: number;
17
- orderType?: OrderedListType;
18
- headingType?: HeadingType;
19
- listMode?: 'outline';
20
- listRestart?: number;
21
- children: Text[];
22
- };
23
- export type OutlineListItemElement = ListItemElement & {
24
- ordered: true;
25
- headingType: HeadingType;
26
- listMode: 'outline';
27
- };
@@ -1,16 +0,0 @@
1
- /**
2
- * @description to html
3
- * @author wangfupeng
4
- */
5
- import { IDomEditor } from '@wangeditor-next/core';
6
- import { Element } from 'slate';
7
- declare function elemToHtml(elem: Element, childrenHtml: string, editor?: IDomEditor): {
8
- html: string;
9
- prefix?: string;
10
- suffix?: string;
11
- };
12
- declare const listItemToHtmlConf: {
13
- type: string;
14
- elemToHtml: typeof elemToHtml;
15
- };
16
- export default listItemToHtmlConf;
@@ -1,26 +0,0 @@
1
- /**
2
- * @description list helpers
3
- */
4
- import { IDomEditor } from '@wangeditor-next/core';
5
- import { Node } from 'slate';
6
- import { HeadingType, ListItemElement, OrderedListType, OutlineListItemElement } from './custom-types';
7
- export declare function isListNode(node: Node): node is ListItemElement;
8
- export declare const isLegacyListItem: typeof isListNode;
9
- export declare function isHeadingType(value: unknown): value is HeadingType;
10
- export declare function getHeadingType(node: Node): HeadingType | null;
11
- export declare function getListIndent(node: Node): number;
12
- export declare function getListMode(node: Node): 'standard' | 'outline';
13
- export declare function isOutlineListNode(node: Node): node is OutlineListItemElement;
14
- export declare function getOutlineLevel(node: Node): number;
15
- export declare function getNormalizedOrderedListStart(elem: ListItemElement): number;
16
- export declare function getNormalizedOrderedListType(elem: ListItemElement): OrderedListType;
17
- export declare function hasSameListConfig(a: ListItemElement, b: ListItemElement): boolean;
18
- export declare function getOrderedItemNumber(editor: IDomEditor, elem: ListItemElement): number;
19
- export declare function getOutlineNumber(editor: IDomEditor, elem: ListItemElement): string;
20
- /**
21
- * 获取上一个同一 level 的 list item
22
- * @param editor editor
23
- * @param elem elem
24
- */
25
- export declare function getBrotherListNodeByLevel(editor: IDomEditor, elem: ListItemElement, level?: number): ListItemElement | null;
26
- export declare function hasSameOrderWithBrother(editor: IDomEditor, elem: ListItemElement, level?: number): boolean;
@@ -1,10 +0,0 @@
1
- /**
2
- * @description compose semantic outline HTML from additive list-item metadata
3
- */
4
- import { HtmlTransformFnType } from '@wangeditor-next/core';
5
- /**
6
- * List-item serialization remains backward compatible for ordinary lists.
7
- * Only outline list items need document-level composition to create valid
8
- * `ol > li > hN` structure.
9
- */
10
- export declare const transformListHtml: HtmlTransformFnType;
@@ -1,7 +0,0 @@
1
- /**
2
- * @description list module entry
3
- * @author wangfupeng
4
- */
5
- import { IModuleConf } from '@wangeditor-next/core';
6
- declare const list: Partial<IModuleConf>;
7
- export default list;
@@ -1,20 +0,0 @@
1
- /**
2
- * @description list menu base class
3
- * @author wangfupeng
4
- */
5
- import { IButtonMenu, IDomEditor } from '@wangeditor-next/core';
6
- import { OrderedListType } from '../custom-types';
7
- declare abstract class BaseMenu implements IButtonMenu {
8
- readonly type = "list-item";
9
- abstract readonly ordered: boolean;
10
- readonly orderType?: OrderedListType;
11
- abstract readonly title: string;
12
- abstract readonly iconSvg: string;
13
- readonly tag = "button";
14
- private isTargetListNode;
15
- getValue(_editor: IDomEditor): string | boolean;
16
- isActive(editor: IDomEditor): boolean;
17
- isDisabled(editor: IDomEditor): boolean;
18
- exec(editor: IDomEditor, _value: string | boolean): void;
19
- }
20
- export default BaseMenu;