suneditor 3.0.0-beta.3 → 3.0.0-beta.30
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/CONTRIBUTING.md +8 -8
- package/README.md +44 -49
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +95 -53
- package/src/assets/design/color.css +2 -2
- package/src/assets/design/size.css +2 -0
- package/src/assets/icons/defaultIcons.js +16 -1
- package/src/assets/suneditor-contents.css +9 -8
- package/src/assets/suneditor.css +29 -26
- package/src/core/{section → base}/actives.js +20 -12
- package/src/core/base/history.js +4 -4
- package/src/core/class/char.js +10 -10
- package/src/core/class/component.js +146 -57
- package/src/core/class/format.js +94 -2458
- package/src/core/class/html.js +187 -129
- package/src/core/class/inline.js +1853 -0
- package/src/core/class/listFormat.js +582 -0
- package/src/core/class/menu.js +14 -3
- package/src/core/class/nodeTransform.js +9 -14
- package/src/core/class/offset.js +162 -197
- package/src/core/class/selection.js +137 -34
- package/src/core/class/toolbar.js +73 -52
- package/src/core/class/ui.js +11 -11
- package/src/core/class/viewer.js +56 -55
- package/src/core/config/context.js +122 -0
- package/src/core/config/frameContext.js +204 -0
- package/src/core/config/options.js +639 -0
- package/src/core/editor.js +181 -108
- package/src/core/event/actions/index.js +229 -0
- package/src/core/event/effects/common.registry.js +60 -0
- package/src/core/event/effects/keydown.registry.js +551 -0
- package/src/core/event/effects/ruleHelpers.js +145 -0
- package/src/core/{base → event}/eventManager.js +119 -201
- package/src/core/event/executor.js +21 -0
- package/src/core/{base/eventHandlers → event/handlers}/handler_toolbar.js +4 -4
- package/src/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.js +2 -2
- package/src/core/event/handlers/handler_ww_input.js +77 -0
- package/src/core/event/handlers/handler_ww_key.js +228 -0
- package/src/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.js +3 -3
- package/src/core/event/ports.js +211 -0
- package/src/core/event/reducers/keydown.reducer.js +89 -0
- package/src/core/event/rules/keydown.rule.arrow.js +54 -0
- package/src/core/event/rules/keydown.rule.backspace.js +202 -0
- package/src/core/event/rules/keydown.rule.delete.js +126 -0
- package/src/core/event/rules/keydown.rule.enter.js +144 -0
- package/src/core/event/rules/keydown.rule.tab.js +29 -0
- package/src/core/section/constructor.js +79 -388
- package/src/core/section/documentType.js +47 -26
- package/src/core/util/instanceCheck.js +59 -0
- package/src/editorInjector/_classes.js +4 -0
- package/src/editorInjector/_core.js +17 -7
- package/src/editorInjector/index.js +10 -2
- package/src/events.js +6 -0
- package/src/helper/clipboard.js +24 -10
- package/src/helper/converter.js +17 -12
- package/src/helper/dom/domCheck.js +22 -3
- package/src/helper/dom/domQuery.js +91 -45
- package/src/helper/dom/domUtils.js +93 -19
- package/src/helper/dom/index.js +4 -0
- package/src/helper/env.js +11 -7
- package/src/helper/keyCodeMap.js +4 -3
- package/src/langs/ckb.js +1 -1
- package/src/langs/cs.js +1 -1
- package/src/langs/da.js +1 -1
- package/src/langs/de.js +1 -1
- package/src/langs/en.js +1 -1
- package/src/langs/es.js +1 -1
- package/src/langs/fa.js +1 -1
- package/src/langs/fr.js +1 -1
- package/src/langs/he.js +1 -1
- package/src/langs/hu.js +1 -1
- package/src/langs/it.js +1 -1
- package/src/langs/ja.js +1 -1
- package/src/langs/km.js +1 -1
- package/src/langs/ko.js +1 -1
- package/src/langs/lv.js +1 -1
- package/src/langs/nl.js +1 -1
- package/src/langs/pl.js +1 -1
- package/src/langs/pt_br.js +10 -10
- package/src/langs/ro.js +1 -1
- package/src/langs/ru.js +1 -1
- package/src/langs/se.js +1 -1
- package/src/langs/tr.js +1 -1
- package/src/langs/uk.js +1 -1
- package/src/langs/ur.js +1 -1
- package/src/langs/zh_cn.js +1 -1
- package/src/modules/ApiManager.js +25 -18
- package/src/modules/Browser.js +52 -61
- package/src/modules/ColorPicker.js +37 -38
- package/src/modules/Controller.js +85 -79
- package/src/modules/Figure.js +275 -187
- package/src/modules/FileManager.js +86 -92
- package/src/modules/HueSlider.js +67 -35
- package/src/modules/Modal.js +84 -77
- package/src/modules/ModalAnchorEditor.js +62 -79
- package/src/modules/SelectMenu.js +89 -86
- package/src/plugins/browser/audioGallery.js +9 -5
- package/src/plugins/browser/fileBrowser.js +10 -6
- package/src/plugins/browser/fileGallery.js +9 -5
- package/src/plugins/browser/imageGallery.js +9 -5
- package/src/plugins/browser/videoGallery.js +11 -6
- package/src/plugins/command/blockquote.js +1 -0
- package/src/plugins/command/exportPDF.js +11 -8
- package/src/plugins/command/fileUpload.js +41 -29
- package/src/plugins/command/list_bulleted.js +2 -1
- package/src/plugins/command/list_numbered.js +2 -1
- package/src/plugins/dropdown/align.js +8 -2
- package/src/plugins/dropdown/backgroundColor.js +19 -11
- package/src/plugins/dropdown/font.js +15 -9
- package/src/plugins/dropdown/fontColor.js +19 -11
- package/src/plugins/dropdown/formatBlock.js +7 -2
- package/src/plugins/dropdown/hr.js +7 -3
- package/src/plugins/dropdown/layout.js +6 -2
- package/src/plugins/dropdown/lineHeight.js +8 -3
- package/src/plugins/dropdown/list.js +2 -1
- package/src/plugins/dropdown/paragraphStyle.js +15 -11
- package/src/plugins/dropdown/{table.js → table/index.js} +514 -362
- package/src/plugins/dropdown/template.js +6 -2
- package/src/plugins/dropdown/textStyle.js +7 -3
- package/src/plugins/field/mention.js +33 -27
- package/src/plugins/input/fontSize.js +44 -37
- package/src/plugins/input/pageNavigator.js +3 -2
- package/src/plugins/modal/audio.js +90 -85
- package/src/plugins/modal/drawing.js +58 -66
- package/src/plugins/modal/embed.js +193 -180
- package/src/plugins/modal/image.js +441 -439
- package/src/plugins/modal/link.js +31 -8
- package/src/plugins/modal/math.js +23 -22
- package/src/plugins/modal/video.js +233 -230
- package/src/plugins/popup/anchor.js +24 -18
- package/src/suneditor.js +69 -24
- package/src/typedef.js +42 -19
- package/types/assets/icons/defaultIcons.d.ts +8 -0
- package/types/core/class/char.d.ts +1 -1
- package/types/core/class/component.d.ts +29 -7
- package/types/core/class/format.d.ts +4 -354
- package/types/core/class/html.d.ts +13 -4
- package/types/core/class/inline.d.ts +263 -0
- package/types/core/class/listFormat.d.ts +135 -0
- package/types/core/class/menu.d.ts +10 -2
- package/types/core/class/offset.d.ts +24 -26
- package/types/core/class/selection.d.ts +2 -0
- package/types/core/class/toolbar.d.ts +24 -11
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/class/viewer.d.ts +1 -1
- package/types/core/config/context.d.ts +157 -0
- package/types/core/config/frameContext.d.ts +367 -0
- package/types/core/config/options.d.ts +1119 -0
- package/types/core/editor.d.ts +101 -66
- package/types/core/event/actions/index.d.ts +47 -0
- package/types/core/event/effects/common.registry.d.ts +50 -0
- package/types/core/event/effects/keydown.registry.d.ts +73 -0
- package/types/core/event/effects/ruleHelpers.d.ts +31 -0
- package/types/core/{base → event}/eventManager.d.ts +15 -46
- package/types/core/event/executor.d.ts +6 -0
- package/types/core/event/handlers/handler_ww_input.d.ts +41 -0
- package/types/core/{base/eventHandlers/handler_ww_key_input.d.ts → event/handlers/handler_ww_key.d.ts} +4 -6
- package/types/core/event/ports.d.ts +255 -0
- package/types/core/event/reducers/keydown.reducer.d.ts +75 -0
- package/types/core/event/rules/keydown.rule.arrow.d.ts +8 -0
- package/types/core/event/rules/keydown.rule.backspace.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.delete.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.enter.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.tab.d.ts +9 -0
- package/types/core/section/constructor.d.ts +101 -631
- package/types/core/section/documentType.d.ts +14 -4
- package/types/core/util/instanceCheck.d.ts +50 -0
- package/types/editorInjector/_classes.d.ts +4 -0
- package/types/editorInjector/_core.d.ts +17 -7
- package/types/editorInjector/index.d.ts +10 -2
- package/types/events.d.ts +1 -0
- package/types/helper/clipboard.d.ts +2 -2
- package/types/helper/converter.d.ts +6 -9
- package/types/helper/dom/domCheck.d.ts +7 -0
- package/types/helper/dom/domQuery.d.ts +19 -8
- package/types/helper/dom/domUtils.d.ts +24 -2
- package/types/helper/dom/index.d.ts +86 -1
- package/types/helper/env.d.ts +6 -1
- package/types/helper/index.d.ts +7 -1
- package/types/helper/keyCodeMap.d.ts +3 -3
- package/types/index.d.ts +23 -117
- package/types/langs/index.d.ts +2 -2
- package/types/modules/ApiManager.d.ts +1 -8
- package/types/modules/Browser.d.ts +4 -62
- package/types/modules/ColorPicker.d.ts +4 -21
- package/types/modules/Controller.d.ts +8 -64
- package/types/modules/Figure.d.ts +54 -50
- package/types/modules/FileManager.d.ts +1 -13
- package/types/modules/HueSlider.d.ts +13 -3
- package/types/modules/Modal.d.ts +0 -43
- package/types/modules/ModalAnchorEditor.d.ts +0 -73
- package/types/modules/SelectMenu.d.ts +0 -85
- package/types/modules/index.d.ts +3 -3
- package/types/plugins/browser/audioGallery.d.ts +29 -18
- package/types/plugins/browser/fileBrowser.d.ts +38 -27
- package/types/plugins/browser/fileGallery.d.ts +29 -18
- package/types/plugins/browser/imageGallery.d.ts +24 -16
- package/types/plugins/browser/videoGallery.d.ts +29 -18
- package/types/plugins/command/blockquote.d.ts +1 -0
- package/types/plugins/command/exportPDF.d.ts +18 -18
- package/types/plugins/command/fileUpload.d.ts +65 -45
- package/types/plugins/command/list_bulleted.d.ts +1 -0
- package/types/plugins/command/list_numbered.d.ts +1 -0
- package/types/plugins/dropdown/align.d.ts +13 -8
- package/types/plugins/dropdown/backgroundColor.d.ts +30 -19
- package/types/plugins/dropdown/font.d.ts +13 -12
- package/types/plugins/dropdown/fontColor.d.ts +30 -19
- package/types/plugins/dropdown/formatBlock.d.ts +13 -8
- package/types/plugins/dropdown/hr.d.ts +15 -11
- package/types/plugins/dropdown/layout.d.ts +15 -11
- package/types/plugins/dropdown/lineHeight.d.ts +16 -11
- package/types/plugins/dropdown/list.d.ts +1 -0
- package/types/plugins/dropdown/paragraphStyle.d.ts +31 -27
- package/types/plugins/dropdown/table/index.d.ts +582 -0
- package/types/plugins/dropdown/table.d.ts +41 -86
- package/types/plugins/dropdown/template.d.ts +15 -11
- package/types/plugins/dropdown/textStyle.d.ts +19 -11
- package/types/plugins/field/mention.d.ts +58 -56
- package/types/plugins/index.d.ts +38 -38
- package/types/plugins/input/fontSize.d.ts +46 -50
- package/types/plugins/modal/audio.d.ts +26 -56
- package/types/plugins/modal/drawing.d.ts +0 -85
- package/types/plugins/modal/embed.d.ts +15 -79
- package/types/plugins/modal/image.d.ts +24 -136
- package/types/plugins/modal/link.d.ts +34 -15
- package/types/plugins/modal/math.d.ts +0 -16
- package/types/plugins/modal/video.d.ts +17 -86
- package/types/plugins/popup/anchor.d.ts +1 -8
- package/types/suneditor.d.ts +70 -19
- package/types/typedef.d.ts +60 -46
- package/src/core/base/eventHandlers/handler_ww_key_input.js +0 -1200
- package/src/core/section/context.js +0 -102
- package/types/core/section/context.d.ts +0 -45
- package/types/langs/_Lang.d.ts +0 -194
- /package/src/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.js +0 -0
- /package/types/core/{section → base}/actives.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_toolbar.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.d.ts +0 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
export default Inline;
|
|
2
|
+
export type InlineThis = Omit<Inline & Partial<__se__EditorInjector>, 'inline'>;
|
|
3
|
+
export type NodeStyleContainerType = {
|
|
4
|
+
ancestor?: (Node | null) | undefined;
|
|
5
|
+
offset?: (number | null) | undefined;
|
|
6
|
+
container?: (Node | null) | undefined;
|
|
7
|
+
endContainer?: (Node | null) | undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Omit<Inline & Partial<__se__EditorInjector>, 'inline'>} InlineThis
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {Object} NodeStyleContainerType
|
|
14
|
+
* @property {?Node=} ancestor
|
|
15
|
+
* @property {?number=} offset
|
|
16
|
+
* @property {?Node=} container
|
|
17
|
+
* @property {?Node=} endContainer
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @constructor
|
|
21
|
+
* @this {InlineThis}
|
|
22
|
+
* @description Classes related to editor inline formats such as style node like strong, span, etc.
|
|
23
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
24
|
+
*/
|
|
25
|
+
declare function Inline(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>, editor: __se__EditorCore): void;
|
|
26
|
+
declare class Inline {
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {Omit<Inline & Partial<__se__EditorInjector>, 'inline'>} InlineThis
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {Object} NodeStyleContainerType
|
|
32
|
+
* @property {?Node=} ancestor
|
|
33
|
+
* @property {?number=} offset
|
|
34
|
+
* @property {?Node=} container
|
|
35
|
+
* @property {?Node=} endContainer
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* @constructor
|
|
39
|
+
* @this {InlineThis}
|
|
40
|
+
* @description Classes related to editor inline formats such as style node like strong, span, etc.
|
|
41
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
42
|
+
*/
|
|
43
|
+
constructor(editor: __se__EditorCore);
|
|
44
|
+
_listCamel: any;
|
|
45
|
+
_listKebab: any;
|
|
46
|
+
/**
|
|
47
|
+
* @this {InlineThis}
|
|
48
|
+
* @description Adds, updates, or deletes style nodes from selected text (a, span, strong, etc.).
|
|
49
|
+
* @param {?Node} styleNode The element to be added to the selection. If null, only existing nodes are modified or removed.
|
|
50
|
+
* @param {Object} [options] Options
|
|
51
|
+
* @param {Array<string>} [options.stylesToModify=null] Array of style or class names to check and modify.
|
|
52
|
+
* (e.g., ['font-size'], ['.className'], ['font-family', 'color', '.className'])
|
|
53
|
+
* @param {Array<string>} [options.nodesToRemove=null] Array of node names to remove.
|
|
54
|
+
* If empty array or null when styleNode is null, all formats are removed.
|
|
55
|
+
* (e.g., ['span'], ['strong', 'em'])
|
|
56
|
+
* @param {boolean} [options.strictRemove=false] If true, only removes nodes from nodesToRemove if all styles and classes are removed.
|
|
57
|
+
* @returns {HTMLElement} The element that was added to or modified in the selection.
|
|
58
|
+
*
|
|
59
|
+
* @details
|
|
60
|
+
* 1. If styleNode is provided, a node with the same tags and attributes is added to the selected text.
|
|
61
|
+
* 2. If the same tag already exists, only its attributes are updated.
|
|
62
|
+
* 3. If styleNode is null, existing nodes are updated or removed without adding new ones.
|
|
63
|
+
* 4. Styles matching those in stylesToModify are removed. (Use CSS attribute names, e.g., "background-color")
|
|
64
|
+
* 5. Classes matching those in stylesToModify (prefixed with ".") are removed.
|
|
65
|
+
* 6. stylesToModify is used to avoid duplicate property values from styleNode.
|
|
66
|
+
* 7. Nodes with all styles and classes removed are deleted if they match styleNode, are in nodesToRemove, or if styleNode is null.
|
|
67
|
+
* 8. Tags matching names in nodesToRemove are deleted regardless of their style and class.
|
|
68
|
+
* 9. If strictRemove is true, nodes in nodesToRemove are only removed if all their styles and classes are removed.
|
|
69
|
+
* 10. The function won't modify nodes if the parent has the same class and style values.
|
|
70
|
+
* - However, if nodesToRemove has values, it will work and separate text nodes even if there's no node to replace.
|
|
71
|
+
*/
|
|
72
|
+
apply(
|
|
73
|
+
this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>,
|
|
74
|
+
styleNode: Node | null,
|
|
75
|
+
{
|
|
76
|
+
stylesToModify,
|
|
77
|
+
nodesToRemove,
|
|
78
|
+
strictRemove
|
|
79
|
+
}?: {
|
|
80
|
+
stylesToModify?: Array<string>;
|
|
81
|
+
nodesToRemove?: Array<string>;
|
|
82
|
+
strictRemove?: boolean;
|
|
83
|
+
}
|
|
84
|
+
): HTMLElement;
|
|
85
|
+
/**
|
|
86
|
+
* @this {InlineThis}
|
|
87
|
+
* @description Remove format of the currently selected text.
|
|
88
|
+
*/
|
|
89
|
+
remove(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>): void;
|
|
90
|
+
/**
|
|
91
|
+
* @private
|
|
92
|
+
* @this {InlineThis}
|
|
93
|
+
* @description Nodes that must remain undetached when changing text nodes (A, Label, Code, Span:font-size)
|
|
94
|
+
* @param {Node|string} element Element to check
|
|
95
|
+
* @returns {boolean}
|
|
96
|
+
*/
|
|
97
|
+
_isNonSplitNode(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>, element: Node | string): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* @private
|
|
100
|
+
* @this {InlineThis}
|
|
101
|
+
* @description Nodes that need to be added without modification when changing text nodes
|
|
102
|
+
* @param {Node} element Element to check
|
|
103
|
+
* @returns {boolean}
|
|
104
|
+
*/
|
|
105
|
+
_isIgnoreNodeChange(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>, element: Node): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* @private
|
|
108
|
+
* @this {InlineThis}
|
|
109
|
+
* @description wraps text nodes of line selected text.
|
|
110
|
+
* @param {Node} element The node of the line that contains the selected text node.
|
|
111
|
+
* @param {Node} newInnerNode The dom that will wrap the selected text area
|
|
112
|
+
* @param {(current: Node) => Node|null} validation Check if the node should be stripped.
|
|
113
|
+
* @param {Node} startCon The startContainer property of the selection object.
|
|
114
|
+
* @param {number} startOff The startOffset property of the selection object.
|
|
115
|
+
* @param {Node} endCon The endContainer property of the selection object.
|
|
116
|
+
* @param {number} endOff The endOffset property of the selection object.
|
|
117
|
+
* @param {boolean} isRemoveFormat Is the remove all formats command?
|
|
118
|
+
* @param {boolean} isRemoveNode "newInnerNode" is remove node?
|
|
119
|
+
* @param {boolean} collapsed range.collapsed
|
|
120
|
+
* @returns {{ancestor: *, startContainer: *, startOffset: *, endContainer: *, endOffset: *}}
|
|
121
|
+
*/
|
|
122
|
+
_setNode_oneLine(
|
|
123
|
+
this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>,
|
|
124
|
+
element: Node,
|
|
125
|
+
newInnerNode: Node,
|
|
126
|
+
validation: (current: Node) => Node | null,
|
|
127
|
+
startCon: Node,
|
|
128
|
+
startOff: number,
|
|
129
|
+
endCon: Node,
|
|
130
|
+
endOff: number,
|
|
131
|
+
isRemoveFormat: boolean,
|
|
132
|
+
isRemoveNode: boolean,
|
|
133
|
+
collapsed: boolean,
|
|
134
|
+
_removeCheck: any,
|
|
135
|
+
_getMaintainedNode: any,
|
|
136
|
+
_isMaintainedNode: any
|
|
137
|
+
): {
|
|
138
|
+
ancestor: any;
|
|
139
|
+
startContainer: any;
|
|
140
|
+
startOffset: any;
|
|
141
|
+
endContainer: any;
|
|
142
|
+
endOffset: any;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* @private
|
|
146
|
+
* @this {InlineThis}
|
|
147
|
+
* @description wraps first line selected text.
|
|
148
|
+
* @param {Node} element The node of the line that contains the selected text node.
|
|
149
|
+
* @param {Node} newInnerNode The dom that will wrap the selected text area
|
|
150
|
+
* @param {(current: Node) => Node|null} validation Check if the node should be stripped.
|
|
151
|
+
* @param {Node} startCon The startContainer property of the selection object.
|
|
152
|
+
* @param {number} startOff The startOffset property of the selection object.
|
|
153
|
+
* @param {boolean} isRemoveFormat Is the remove all formats command?
|
|
154
|
+
* @param {boolean} isRemoveNode "newInnerNode" is remove node?
|
|
155
|
+
* @returns {NodeStyleContainerType} { ancestor, container, offset, endContainer }
|
|
156
|
+
*/
|
|
157
|
+
_setNode_startLine(
|
|
158
|
+
this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>,
|
|
159
|
+
element: Node,
|
|
160
|
+
newInnerNode: Node,
|
|
161
|
+
validation: (current: Node) => Node | null,
|
|
162
|
+
startCon: Node,
|
|
163
|
+
startOff: number,
|
|
164
|
+
isRemoveFormat: boolean,
|
|
165
|
+
isRemoveNode: boolean,
|
|
166
|
+
_removeCheck: any,
|
|
167
|
+
_getMaintainedNode: any,
|
|
168
|
+
_isMaintainedNode: any,
|
|
169
|
+
_endContainer: any
|
|
170
|
+
): NodeStyleContainerType;
|
|
171
|
+
/**
|
|
172
|
+
* @private
|
|
173
|
+
* @this {InlineThis}
|
|
174
|
+
* @description wraps mid lines selected text.
|
|
175
|
+
* @param {HTMLElement} element The node of the line that contains the selected text node.
|
|
176
|
+
* @param {Node} newInnerNode The dom that will wrap the selected text area
|
|
177
|
+
* @param {(current: Node) => Node|null} validation Check if the node should be stripped.
|
|
178
|
+
* @param {boolean} isRemoveFormat Is the remove all formats command?
|
|
179
|
+
* @param {boolean} isRemoveNode "newInnerNode" is remove node?
|
|
180
|
+
* @param {Node} _endContainer Offset node of last line already modified (end.container)
|
|
181
|
+
* @returns {NodeStyleContainerType} { ancestor, endContainer: "If end container is renewed, returned renewed node" }
|
|
182
|
+
*/
|
|
183
|
+
_setNode_middleLine(
|
|
184
|
+
this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>,
|
|
185
|
+
element: HTMLElement,
|
|
186
|
+
newInnerNode: Node,
|
|
187
|
+
validation: (current: Node) => Node | null,
|
|
188
|
+
isRemoveFormat: boolean,
|
|
189
|
+
isRemoveNode: boolean,
|
|
190
|
+
_removeCheck: any,
|
|
191
|
+
_endContainer: Node
|
|
192
|
+
): NodeStyleContainerType;
|
|
193
|
+
/**
|
|
194
|
+
* @private
|
|
195
|
+
* @this {InlineThis}
|
|
196
|
+
* @description wraps last line selected text.
|
|
197
|
+
* @param {Node} element The node of the line that contains the selected text node.
|
|
198
|
+
* @param {Node} newInnerNode The dom that will wrap the selected text area
|
|
199
|
+
* @param {(current: Node) => Node|null} validation Check if the node should be stripped.
|
|
200
|
+
* @param {Node} endCon The endContainer property of the selection object.
|
|
201
|
+
* @param {number} endOff The endOffset property of the selection object.
|
|
202
|
+
* @param {boolean} isRemoveFormat Is the remove all formats command?
|
|
203
|
+
* @param {boolean} isRemoveNode "newInnerNode" is remove node?
|
|
204
|
+
* @returns {NodeStyleContainerType} { ancestor, container, offset }
|
|
205
|
+
*/
|
|
206
|
+
_setNode_endLine(
|
|
207
|
+
this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>,
|
|
208
|
+
element: Node,
|
|
209
|
+
newInnerNode: Node,
|
|
210
|
+
validation: (current: Node) => Node | null,
|
|
211
|
+
endCon: Node,
|
|
212
|
+
endOff: number,
|
|
213
|
+
isRemoveFormat: boolean,
|
|
214
|
+
isRemoveNode: boolean,
|
|
215
|
+
_removeCheck: any,
|
|
216
|
+
_getMaintainedNode: any,
|
|
217
|
+
_isMaintainedNode: any
|
|
218
|
+
): NodeStyleContainerType;
|
|
219
|
+
/**
|
|
220
|
+
* @private
|
|
221
|
+
* @this {InlineThis}
|
|
222
|
+
* @description Node with font-size style
|
|
223
|
+
* @param {Node} element Element to check
|
|
224
|
+
* @returns {boolean}
|
|
225
|
+
*/
|
|
226
|
+
_sn_isSizeNode(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>, element: Node): boolean;
|
|
227
|
+
/**
|
|
228
|
+
* @private
|
|
229
|
+
* @this {InlineThis}
|
|
230
|
+
* @description Return the parent maintained tag. (bind and use a util object)
|
|
231
|
+
* @param {boolean} _isRemove is remove anchor
|
|
232
|
+
* @param {boolean} _isSizeNode is size span node
|
|
233
|
+
* @param {Node} element Element
|
|
234
|
+
* @returns {Node|null}
|
|
235
|
+
*/
|
|
236
|
+
_sn_getMaintainedNode(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>, _isRemove: boolean, _isSizeNode: boolean, element: Node): Node | null;
|
|
237
|
+
/**
|
|
238
|
+
* @private
|
|
239
|
+
* @this {InlineThis}
|
|
240
|
+
* @description Check if element is a tag that should be persisted. (bind and use a util object)
|
|
241
|
+
* @param {boolean} _isRemove is remove anchor
|
|
242
|
+
* @param {boolean} _isSizeNode is size span node
|
|
243
|
+
* @param {Node} element Element
|
|
244
|
+
* @returns {boolean}
|
|
245
|
+
*/
|
|
246
|
+
_sn_isMaintainedNode(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>, _isRemove: boolean, _isSizeNode: boolean, element: Node): boolean;
|
|
247
|
+
/**
|
|
248
|
+
* @private
|
|
249
|
+
* @this {InlineThis}
|
|
250
|
+
* @description If certain styles are applied to all child nodes of the list cell, the style of the list cell is also changed. (bold, color, size)
|
|
251
|
+
* @param {Node} el List cell element. <li>
|
|
252
|
+
* @param {?Node} child Variable for recursive call. ("null" on the first call)
|
|
253
|
+
*/
|
|
254
|
+
_sn_setCommonListStyle(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>, el: Node, child: Node | null): void;
|
|
255
|
+
/**
|
|
256
|
+
* @private
|
|
257
|
+
* @this {InlineThis}
|
|
258
|
+
* @description Watch the applied text nodes and adjust the common styles of the list.
|
|
259
|
+
* @param {Node} el "LI" element
|
|
260
|
+
* @param {Array|null} styleArray Refer style array
|
|
261
|
+
*/
|
|
262
|
+
_sn_resetCommonListCell(this: Omit<Inline & Partial<import('../../editorInjector').default>, 'inline'>, el: Node, styleArray: any[] | null): boolean;
|
|
263
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export default ListFormat;
|
|
2
|
+
export type ListFormatThis = Omit<ListFormat & Partial<__se__EditorInjector>, 'ListFormat'>;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {Omit<ListFormat & Partial<__se__EditorInjector>, 'ListFormat'>} ListFormatThis
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @constructor
|
|
8
|
+
* @this {ListFormatThis}
|
|
9
|
+
* @description Classes related to editor formats such as "list" (ol, ul, li)
|
|
10
|
+
* - "list" is a special "line", "block" format.
|
|
11
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
12
|
+
*/
|
|
13
|
+
declare function ListFormat(this: Omit<ListFormat & Partial<import('../../editorInjector').default>, 'ListFormat'>, editor: __se__EditorCore): void;
|
|
14
|
+
declare class ListFormat {
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {Omit<ListFormat & Partial<__se__EditorInjector>, 'ListFormat'>} ListFormatThis
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* @constructor
|
|
20
|
+
* @this {ListFormatThis}
|
|
21
|
+
* @description Classes related to editor formats such as "list" (ol, ul, li)
|
|
22
|
+
* - "list" is a special "line", "block" format.
|
|
23
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
24
|
+
*/
|
|
25
|
+
constructor(editor: __se__EditorCore);
|
|
26
|
+
/**
|
|
27
|
+
* @this {ListFormatThis}
|
|
28
|
+
* @description Append all selected "line" element to the list and insert.
|
|
29
|
+
* @param {string} type List type. (ol | ul):[listStyleType]
|
|
30
|
+
* @param {Array<Node>} selectedCells "line" elements or list cells.
|
|
31
|
+
* @param {boolean} nested If true, indenting existing list cells.
|
|
32
|
+
*/
|
|
33
|
+
apply(
|
|
34
|
+
this: Omit<ListFormat & Partial<import('../../editorInjector').default>, 'ListFormat'>,
|
|
35
|
+
type: string,
|
|
36
|
+
selectedCells: Array<Node>,
|
|
37
|
+
nested: boolean
|
|
38
|
+
): {
|
|
39
|
+
sc: Node;
|
|
40
|
+
so: number;
|
|
41
|
+
ec: Node;
|
|
42
|
+
eo: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* @this {ListFormatThis}
|
|
46
|
+
* @description "selectedCells" array are detached from the list element.
|
|
47
|
+
* - The return value is applied when the first and last lines of "selectedFormats" are "LI" respectively.
|
|
48
|
+
* @param {Array<Node>} selectedCells Array of ["line", li] elements(LI, P...) to remove.
|
|
49
|
+
* @param {boolean} shouldDelete If true, It does not just remove the list, it deletes the content.
|
|
50
|
+
* @returns {{sc: Node, ec: Node}} Node information after deletion
|
|
51
|
+
* - sc: Start container node
|
|
52
|
+
* - ec: End container node
|
|
53
|
+
*/
|
|
54
|
+
remove(
|
|
55
|
+
this: Omit<ListFormat & Partial<import('../../editorInjector').default>, 'ListFormat'>,
|
|
56
|
+
selectedCells: Array<Node>,
|
|
57
|
+
shouldDelete: boolean
|
|
58
|
+
): {
|
|
59
|
+
sc: Node;
|
|
60
|
+
ec: Node;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @this {ListFormatThis}
|
|
64
|
+
* @description Nest list cells or cancel nested cells.
|
|
65
|
+
* @param {Array<HTMLElement>} selectedCells List cells.
|
|
66
|
+
* @param {boolean} nested Nested or cancel nested.
|
|
67
|
+
*/
|
|
68
|
+
applyNested(
|
|
69
|
+
this: Omit<ListFormat & Partial<import('../../editorInjector').default>, 'ListFormat'>,
|
|
70
|
+
selectedCells: Array<HTMLElement>,
|
|
71
|
+
nested: boolean
|
|
72
|
+
): {
|
|
73
|
+
sc: Node;
|
|
74
|
+
so: number;
|
|
75
|
+
ec: Node;
|
|
76
|
+
eo: number;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* @this {ListFormatThis}
|
|
80
|
+
* @description Detach Nested all nested lists under the "baseNode".
|
|
81
|
+
* - Returns a list with nested removed.
|
|
82
|
+
* @param {HTMLElement} baseNode Element on which to base.
|
|
83
|
+
* @param {boolean} all If true, it also detach all nested lists of a returned list.
|
|
84
|
+
* @returns {Node} Result element
|
|
85
|
+
*/
|
|
86
|
+
removeNested(this: Omit<ListFormat & Partial<import('../../editorInjector').default>, 'ListFormat'>, baseNode: HTMLElement, all: boolean): Node;
|
|
87
|
+
/**
|
|
88
|
+
* @private
|
|
89
|
+
* @this {ListFormatThis}
|
|
90
|
+
* @description Attaches a nested list structure by merging adjacent lists if applicable.
|
|
91
|
+
* - Ensures that the nested list is placed correctly in the document structure.
|
|
92
|
+
* @param {Element} originList The original list element where the nested list is inserted.
|
|
93
|
+
* @param {Element} innerList The nested list element.
|
|
94
|
+
* @param {Element} prev The previous sibling element.
|
|
95
|
+
* @param {Element} next The next sibling element.
|
|
96
|
+
* @param {{s: Array<number> | null, e: Array<number> | null, sl: Node | null, el: Node | null}} nodePath Object storing the start and end node paths.
|
|
97
|
+
* - s : Start node path.
|
|
98
|
+
* - e : End node path.
|
|
99
|
+
* - sl : Start node's parent element.
|
|
100
|
+
* - el : End node's parent element.
|
|
101
|
+
* @returns {Node} The attached inner list.
|
|
102
|
+
*/
|
|
103
|
+
_attachNested(
|
|
104
|
+
this: Omit<ListFormat & Partial<import('../../editorInjector').default>, 'ListFormat'>,
|
|
105
|
+
originList: Element,
|
|
106
|
+
innerList: Element,
|
|
107
|
+
prev: Element,
|
|
108
|
+
next: Element,
|
|
109
|
+
nodePath: {
|
|
110
|
+
s: Array<number> | null;
|
|
111
|
+
e: Array<number> | null;
|
|
112
|
+
sl: Node | null;
|
|
113
|
+
el: Node | null;
|
|
114
|
+
}
|
|
115
|
+
): Node;
|
|
116
|
+
/**
|
|
117
|
+
* @private
|
|
118
|
+
* @this {ListFormatThis}
|
|
119
|
+
* @description Detaches a nested list structure by extracting list items from their parent list.
|
|
120
|
+
* - Ensures proper restructuring of the list elements.
|
|
121
|
+
* @param {Array<HTMLElement>} cells The list items to be detached.
|
|
122
|
+
* @returns {{cc: Node, sc: Node, ec: Node}} An object containing reference nodes for repositioning.
|
|
123
|
+
* - cc : The parent node of the first list item.
|
|
124
|
+
* - sc : The first list item.
|
|
125
|
+
* - ec : The last list item.
|
|
126
|
+
*/
|
|
127
|
+
_detachNested(
|
|
128
|
+
this: Omit<ListFormat & Partial<import('../../editorInjector').default>, 'ListFormat'>,
|
|
129
|
+
cells: Array<HTMLElement>
|
|
130
|
+
): {
|
|
131
|
+
cc: Node;
|
|
132
|
+
sc: Node;
|
|
133
|
+
ec: Node;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -42,9 +42,9 @@ declare class Menu {
|
|
|
42
42
|
mousemove: any;
|
|
43
43
|
mouseout: any;
|
|
44
44
|
};
|
|
45
|
-
_bindClose_dropdown_mouse:
|
|
45
|
+
_bindClose_dropdown_mouse: __se__GlobalEventInfo;
|
|
46
46
|
_bindClose_dropdown_key: any;
|
|
47
|
-
_bindClose_cons_mouse:
|
|
47
|
+
_bindClose_cons_mouse: __se__GlobalEventInfo;
|
|
48
48
|
currentDropdownPlugin: any;
|
|
49
49
|
__menuBtn: Node;
|
|
50
50
|
__menuContainer: HTMLElement;
|
|
@@ -96,6 +96,14 @@ declare class Menu {
|
|
|
96
96
|
* @param {HTMLElement} menu Menu element
|
|
97
97
|
*/
|
|
98
98
|
_setMenuPosition(this: Omit<Menu & Partial<import('../../editorInjector').default>, 'menu'>, element: Node, menu: HTMLElement): void;
|
|
99
|
+
/**
|
|
100
|
+
* @private
|
|
101
|
+
* @this {MenuThis}
|
|
102
|
+
* @description Reset the menu position.
|
|
103
|
+
* @param {Node} element Button element
|
|
104
|
+
* @param {HTMLElement} menu Menu element
|
|
105
|
+
*/
|
|
106
|
+
_resetMenuPosition(this: Omit<Menu & Partial<import('../../editorInjector').default>, 'menu'>, element: Node, menu: HTMLElement): void;
|
|
99
107
|
/**
|
|
100
108
|
* @private
|
|
101
109
|
* @this {MenuThis}
|
|
@@ -75,21 +75,21 @@ export type OffsetGlobalInfo = {
|
|
|
75
75
|
*/
|
|
76
76
|
left: number;
|
|
77
77
|
/**
|
|
78
|
-
* - The
|
|
78
|
+
* - The top position within the current viewport, without taking scrolling into account.
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
fixedTop: number;
|
|
81
81
|
/**
|
|
82
|
-
* - The
|
|
82
|
+
* - The left position within the current viewport, without taking scrolling into account.
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
fixedLeft: number;
|
|
85
85
|
/**
|
|
86
|
-
* - The
|
|
86
|
+
* - The total width of the element, including its content, padding, and border.
|
|
87
87
|
*/
|
|
88
|
-
|
|
88
|
+
width: number;
|
|
89
89
|
/**
|
|
90
|
-
* - The
|
|
90
|
+
* - The total height of the element, including its content, padding, and border.
|
|
91
91
|
*/
|
|
92
|
-
|
|
92
|
+
height: number;
|
|
93
93
|
};
|
|
94
94
|
export type OffsetGlobalScrollInfo = {
|
|
95
95
|
/**
|
|
@@ -205,10 +205,10 @@ export type OffsetWWScrollInfo = {
|
|
|
205
205
|
* @typedef {Object} OffsetGlobalInfo
|
|
206
206
|
* @property {number} top - The top position of the element relative to the entire document.
|
|
207
207
|
* @property {number} left - The left position of the element relative to the entire document.
|
|
208
|
+
* @property {number} fixedTop - The top position within the current viewport, without taking scrolling into account.
|
|
209
|
+
* @property {number} fixedLeft - The left position within the current viewport, without taking scrolling into account.
|
|
208
210
|
* @property {number} width - The total width of the element, including its content, padding, and border.
|
|
209
211
|
* @property {number} height - The total height of the element, including its content, padding, and border.
|
|
210
|
-
* @property {number} scrollTop - The amount of vertical scrolling applied to the element.
|
|
211
|
-
* @property {number} scrollLeft - The amount of horizontal scrolling applied to the element.
|
|
212
212
|
*/
|
|
213
213
|
/**
|
|
214
214
|
* @typedef {Object} OffsetGlobalScrollInfo
|
|
@@ -274,10 +274,10 @@ declare class Offset {
|
|
|
274
274
|
* @typedef {Object} OffsetGlobalInfo
|
|
275
275
|
* @property {number} top - The top position of the element relative to the entire document.
|
|
276
276
|
* @property {number} left - The left position of the element relative to the entire document.
|
|
277
|
+
* @property {number} fixedTop - The top position within the current viewport, without taking scrolling into account.
|
|
278
|
+
* @property {number} fixedLeft - The left position within the current viewport, without taking scrolling into account.
|
|
277
279
|
* @property {number} width - The total width of the element, including its content, padding, and border.
|
|
278
280
|
* @property {number} height - The total height of the element, including its content, padding, and border.
|
|
279
|
-
* @property {number} scrollTop - The amount of vertical scrolling applied to the element.
|
|
280
|
-
* @property {number} scrollLeft - The amount of horizontal scrolling applied to the element.
|
|
281
281
|
*/
|
|
282
282
|
/**
|
|
283
283
|
* @typedef {Object} OffsetGlobalScrollInfo
|
|
@@ -312,10 +312,6 @@ declare class Offset {
|
|
|
312
312
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
313
313
|
*/
|
|
314
314
|
constructor(editor: __se__EditorCore);
|
|
315
|
-
_scrollEvent: any;
|
|
316
|
-
_elTop: number;
|
|
317
|
-
_scrollY: number;
|
|
318
|
-
_isFixed: boolean;
|
|
319
315
|
/**
|
|
320
316
|
* @this {OffsetThis}
|
|
321
317
|
* @description Gets the position just outside the argument's internal editor (wysiwygFrame).
|
|
@@ -333,6 +329,7 @@ declare class Offset {
|
|
|
333
329
|
/**
|
|
334
330
|
* @this {OffsetThis}
|
|
335
331
|
* @description Returns the position of the argument relative to the global document.
|
|
332
|
+
* This is a refactored version using getBoundingClientRect for better performance and accuracy.
|
|
336
333
|
* @param {?Node=} node Target element.
|
|
337
334
|
* @returns {OffsetGlobalInfo} Global position and scroll values.
|
|
338
335
|
*/
|
|
@@ -357,9 +354,8 @@ declare class Offset {
|
|
|
357
354
|
* @param {HTMLElement} e_container Element's root container
|
|
358
355
|
* @param {HTMLElement} target Target element to position against
|
|
359
356
|
* @param {HTMLElement} t_container Target's root container
|
|
360
|
-
* @param {boolean} _reload Whether to reload position
|
|
361
357
|
*/
|
|
362
|
-
setRelPosition(this: Omit<Offset & Partial<import('../../editorInjector').default>, 'offset'>, element: HTMLElement, e_container: HTMLElement, target: HTMLElement, t_container: HTMLElement
|
|
358
|
+
setRelPosition(this: Omit<Offset & Partial<import('../../editorInjector').default>, 'offset'>, element: HTMLElement, e_container: HTMLElement, target: HTMLElement, t_container: HTMLElement): void;
|
|
363
359
|
/**
|
|
364
360
|
* @this {OffsetThis}
|
|
365
361
|
* @description Sets the absolute position of an element
|
|
@@ -370,6 +366,7 @@ declare class Offset {
|
|
|
370
366
|
* @param {{left:number, top:number}} [params.addOffset={left:0, top:0}] Additional offset
|
|
371
367
|
* @param {"bottom"|"top"} [params.position="bottom"] Position ('bottom'|'top')
|
|
372
368
|
* @param {*} params.inst Instance object of caller
|
|
369
|
+
* @param {HTMLElement} [params.sibling] The sibling controller element
|
|
373
370
|
* @returns {{position: "top" | "bottom"} | undefined} Success -> {position: current position}
|
|
374
371
|
*/
|
|
375
372
|
setAbsPosition(
|
|
@@ -384,6 +381,7 @@ declare class Offset {
|
|
|
384
381
|
};
|
|
385
382
|
position?: 'bottom' | 'top';
|
|
386
383
|
inst: any;
|
|
384
|
+
sibling?: HTMLElement;
|
|
387
385
|
}
|
|
388
386
|
):
|
|
389
387
|
| {
|
|
@@ -459,7 +457,12 @@ declare class Offset {
|
|
|
459
457
|
* @param {RectsInfo} targetRect Target rect object
|
|
460
458
|
* @param {boolean} isTargetAbs Is target absolute position
|
|
461
459
|
* @param {OffsetWWScrollInfo} wwScroll WYSIWYG scroll info
|
|
462
|
-
* @returns {{rmt:number, rmb:number, rt:number
|
|
460
|
+
* @returns {{rmt:number, rmb:number, rt:number, tMargin:number, bMargin:number}} Margin values
|
|
461
|
+
* - rmt: top margin to frame
|
|
462
|
+
* - rmb: bottom margin to frame
|
|
463
|
+
* - rt: Toolbar height offset adjustment
|
|
464
|
+
* - tMargin: top margin
|
|
465
|
+
* - bMargin: bottom margin
|
|
463
466
|
*/
|
|
464
467
|
_getVMargin(
|
|
465
468
|
this: Omit<Offset & Partial<import('../../editorInjector').default>, 'offset'>,
|
|
@@ -477,6 +480,8 @@ declare class Offset {
|
|
|
477
480
|
rmt: number;
|
|
478
481
|
rmb: number;
|
|
479
482
|
rt: number;
|
|
483
|
+
tMargin: number;
|
|
484
|
+
bMargin: number;
|
|
480
485
|
};
|
|
481
486
|
/**
|
|
482
487
|
* @private
|
|
@@ -512,11 +517,4 @@ declare class Offset {
|
|
|
512
517
|
bottom: number;
|
|
513
518
|
rects: RectsInfo;
|
|
514
519
|
};
|
|
515
|
-
/**
|
|
516
|
-
* @private
|
|
517
|
-
* @this {OffsetThis}
|
|
518
|
-
* @description Removes the global scroll event listener from the editor.
|
|
519
|
-
* - Resets related scroll tracking properties.
|
|
520
|
-
*/
|
|
521
|
-
__removeGlobalEvent(this: Omit<Offset & Partial<import('../../editorInjector').default>, 'offset'>): void;
|
|
522
520
|
}
|
|
@@ -33,6 +33,8 @@ declare class Selection_ {
|
|
|
33
33
|
/** @type {HTMLElement|Text} */
|
|
34
34
|
selectionNode: HTMLElement | Text;
|
|
35
35
|
__iframeFocus: boolean;
|
|
36
|
+
__hasScrollParents: boolean;
|
|
37
|
+
_scrollMargin: number;
|
|
36
38
|
/**
|
|
37
39
|
* @this {SelectionThis}
|
|
38
40
|
* @description Get window selection obejct
|
|
@@ -9,10 +9,10 @@ export type ToolbarThis = Omit<Toolbar & Partial<__se__EditorInjector>, 'toolbar
|
|
|
9
9
|
* @description Toolbar class
|
|
10
10
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
11
11
|
* @param {Object} options - toolbar options
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {
|
|
14
|
-
* @param {
|
|
15
|
-
* @param {
|
|
12
|
+
* @param {"toolbar"|"toolbar_sub"} options.keyName - toolbar key name
|
|
13
|
+
* @param {boolean} options.balloon - balloon toolbar
|
|
14
|
+
* @param {boolean} options.inline - inline toolbar
|
|
15
|
+
* @param {boolean} options.balloonAlways - balloon toolbar always show
|
|
16
16
|
* @param {Array<Node>} options.res - responsive toolbar button list
|
|
17
17
|
*/
|
|
18
18
|
declare function Toolbar(
|
|
@@ -25,7 +25,7 @@ declare function Toolbar(
|
|
|
25
25
|
balloonAlways,
|
|
26
26
|
res
|
|
27
27
|
}: {
|
|
28
|
-
keyName:
|
|
28
|
+
keyName: 'toolbar' | 'toolbar_sub';
|
|
29
29
|
balloon: boolean;
|
|
30
30
|
inline: boolean;
|
|
31
31
|
balloonAlways: boolean;
|
|
@@ -42,10 +42,10 @@ declare class Toolbar {
|
|
|
42
42
|
* @description Toolbar class
|
|
43
43
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
44
44
|
* @param {Object} options - toolbar options
|
|
45
|
-
* @param {
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {
|
|
45
|
+
* @param {"toolbar"|"toolbar_sub"} options.keyName - toolbar key name
|
|
46
|
+
* @param {boolean} options.balloon - balloon toolbar
|
|
47
|
+
* @param {boolean} options.inline - inline toolbar
|
|
48
|
+
* @param {boolean} options.balloonAlways - balloon toolbar always show
|
|
49
49
|
* @param {Array<Node>} options.res - responsive toolbar button list
|
|
50
50
|
*/
|
|
51
51
|
constructor(
|
|
@@ -57,15 +57,22 @@ declare class Toolbar {
|
|
|
57
57
|
balloonAlways,
|
|
58
58
|
res
|
|
59
59
|
}: {
|
|
60
|
-
keyName:
|
|
60
|
+
keyName: 'toolbar' | 'toolbar_sub';
|
|
61
61
|
balloon: boolean;
|
|
62
62
|
inline: boolean;
|
|
63
63
|
balloonAlways: boolean;
|
|
64
64
|
res: Array<Node>;
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
keyName: string;
|
|
68
67
|
isSub: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* @type {Object}
|
|
70
|
+
* @description Key names for the toolbar elements.
|
|
71
|
+
* @property {"toolbar_sub_main"|"toolbar_main"} main - Main toolbar key name
|
|
72
|
+
* @property {"toolbar_sub_buttonTray"|"toolbar_buttonTray"} buttonTray - Button tray key name
|
|
73
|
+
* @property {"toolbar_sub_width"|"toolbar_width"} width - Toolbar width key name
|
|
74
|
+
*/
|
|
75
|
+
keyName: any;
|
|
69
76
|
currentMoreLayerActiveButton: HTMLButtonElement;
|
|
70
77
|
_isBalloon: boolean;
|
|
71
78
|
_isInline: boolean;
|
|
@@ -120,6 +127,12 @@ declare class Toolbar {
|
|
|
120
127
|
* @param {Array} buttonList Button list
|
|
121
128
|
*/
|
|
122
129
|
setButtons(this: Omit<Toolbar & Partial<import('../../editorInjector').default>, 'toolbar' | 'subToolbar'>, buttonList: any[]): void;
|
|
130
|
+
/**
|
|
131
|
+
* @private
|
|
132
|
+
* @this {ToolbarThis}
|
|
133
|
+
* @description Reset the common buttons info.
|
|
134
|
+
*/
|
|
135
|
+
_resetButtonInfo(this: Omit<Toolbar & Partial<import('../../editorInjector').default>, 'toolbar' | 'subToolbar'>): void;
|
|
123
136
|
/**
|
|
124
137
|
* @private
|
|
125
138
|
* @this {ToolbarThis}
|
package/types/core/class/ui.d.ts
CHANGED