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
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
export default Format;
|
|
2
2
|
export type FormatThis = Omit<Format & Partial<__se__EditorInjector>, 'format'>;
|
|
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
3
|
/**
|
|
10
4
|
* @typedef {Omit<Format & Partial<__se__EditorInjector>, 'format'>} FormatThis
|
|
11
5
|
*/
|
|
12
|
-
/**
|
|
13
|
-
* @typedef {Object} NodeStyleContainerType
|
|
14
|
-
* @property {?Node=} ancestor
|
|
15
|
-
* @property {?number=} offset
|
|
16
|
-
* @property {?Node=} container
|
|
17
|
-
* @property {?Node=} endContainer
|
|
18
|
-
*/
|
|
19
6
|
/**
|
|
20
7
|
* @constructor
|
|
21
8
|
* @this {FormatThis}
|
|
22
|
-
* @description Classes related to editor formats such as line
|
|
9
|
+
* @description Classes related to editor formats such as "line" and "block".
|
|
23
10
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
24
11
|
*/
|
|
25
12
|
declare function Format(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, editor: __se__EditorCore): void;
|
|
@@ -27,22 +14,13 @@ declare class Format {
|
|
|
27
14
|
/**
|
|
28
15
|
* @typedef {Omit<Format & Partial<__se__EditorInjector>, 'format'>} FormatThis
|
|
29
16
|
*/
|
|
30
|
-
/**
|
|
31
|
-
* @typedef {Object} NodeStyleContainerType
|
|
32
|
-
* @property {?Node=} ancestor
|
|
33
|
-
* @property {?number=} offset
|
|
34
|
-
* @property {?Node=} container
|
|
35
|
-
* @property {?Node=} endContainer
|
|
36
|
-
*/
|
|
37
17
|
/**
|
|
38
18
|
* @constructor
|
|
39
19
|
* @this {FormatThis}
|
|
40
|
-
* @description Classes related to editor formats such as line
|
|
20
|
+
* @description Classes related to editor formats such as "line" and "block".
|
|
41
21
|
* @param {__se__EditorCore} editor - The root editor instance
|
|
42
22
|
*/
|
|
43
23
|
constructor(editor: __se__EditorCore);
|
|
44
|
-
_listCamel: any;
|
|
45
|
-
_listKebab: any;
|
|
46
24
|
_formatLineCheck: any;
|
|
47
25
|
_formatBrLineCheck: any;
|
|
48
26
|
_formatBlockCheck: any;
|
|
@@ -143,42 +121,6 @@ declare class Format {
|
|
|
143
121
|
eo: number;
|
|
144
122
|
removeArray: Array<Node> | null;
|
|
145
123
|
};
|
|
146
|
-
/**
|
|
147
|
-
* @this {FormatThis}
|
|
148
|
-
* @description Append all selected "line" element to the list and insert.
|
|
149
|
-
* @param {string} type List type. (ol | ul):[listStyleType]
|
|
150
|
-
* @param {Array<Node>} selectedCells "line" elements or list cells.
|
|
151
|
-
* @param {boolean} nested If true, indenting existing list cells.
|
|
152
|
-
*/
|
|
153
|
-
applyList(
|
|
154
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
155
|
-
type: string,
|
|
156
|
-
selectedCells: Array<Node>,
|
|
157
|
-
nested: boolean
|
|
158
|
-
): {
|
|
159
|
-
sc: Node;
|
|
160
|
-
so: number;
|
|
161
|
-
ec: Node;
|
|
162
|
-
eo: number;
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* @this {FormatThis}
|
|
166
|
-
* @description "selectedCells" array are detached from the list element.
|
|
167
|
-
* - The return value is applied when the first and last lines of "selectedFormats" are "LI" respectively.
|
|
168
|
-
* @param {Array<Node>} selectedCells Array of ["line", li] elements(LI, P...) to remove.
|
|
169
|
-
* @param {boolean} shouldDelete If true, It does not just remove the list, it deletes the content.
|
|
170
|
-
* @returns {{sc: Node, ec: Node}} Node information after deletion
|
|
171
|
-
* - sc: Start container node
|
|
172
|
-
* - ec: End container node
|
|
173
|
-
*/
|
|
174
|
-
removeList(
|
|
175
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
176
|
-
selectedCells: Array<Node>,
|
|
177
|
-
shouldDelete: boolean
|
|
178
|
-
): {
|
|
179
|
-
sc: Node;
|
|
180
|
-
ec: Node;
|
|
181
|
-
};
|
|
182
124
|
/**
|
|
183
125
|
* @this {FormatThis}
|
|
184
126
|
* @description Indent more the selected lines.
|
|
@@ -191,50 +133,6 @@ declare class Format {
|
|
|
191
133
|
* - margin size - "status.indentSize"px
|
|
192
134
|
*/
|
|
193
135
|
outdent(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>): void;
|
|
194
|
-
/**
|
|
195
|
-
* @this {FormatThis}
|
|
196
|
-
* @description Adds, updates, or deletes style nodes from selected text (a, span, strong, etc.).
|
|
197
|
-
* @param {?Node} styleNode The element to be added to the selection. If null, only existing nodes are modified or removed.
|
|
198
|
-
* @param {Object} [options] Options
|
|
199
|
-
* @param {Array<string>} [options.stylesToModify=null] Array of style or class names to check and modify.
|
|
200
|
-
* (e.g., ['font-size'], ['.className'], ['font-family', 'color', '.className'])
|
|
201
|
-
* @param {Array<string>} [options.nodesToRemove=null] Array of node names to remove.
|
|
202
|
-
* If empty array or null when styleNode is null, all formats are removed.
|
|
203
|
-
* (e.g., ['span'], ['strong', 'em'])
|
|
204
|
-
* @param {boolean} [options.strictRemove=false] If true, only removes nodes from nodesToRemove if all styles and classes are removed.
|
|
205
|
-
* @returns {HTMLElement} The element that was added to or modified in the selection.
|
|
206
|
-
*
|
|
207
|
-
* @details
|
|
208
|
-
* 1. If styleNode is provided, a node with the same tags and attributes is added to the selected text.
|
|
209
|
-
* 2. If the same tag already exists, only its attributes are updated.
|
|
210
|
-
* 3. If styleNode is null, existing nodes are updated or removed without adding new ones.
|
|
211
|
-
* 4. Styles matching those in stylesToModify are removed. (Use CSS attribute names, e.g., "background-color")
|
|
212
|
-
* 5. Classes matching those in stylesToModify (prefixed with ".") are removed.
|
|
213
|
-
* 6. stylesToModify is used to avoid duplicate property values from styleNode.
|
|
214
|
-
* 7. Nodes with all styles and classes removed are deleted if they match styleNode, are in nodesToRemove, or if styleNode is null.
|
|
215
|
-
* 8. Tags matching names in nodesToRemove are deleted regardless of their style and class.
|
|
216
|
-
* 9. If strictRemove is true, nodes in nodesToRemove are only removed if all their styles and classes are removed.
|
|
217
|
-
* 10. The function won't modify nodes if the parent has the same class and style values.
|
|
218
|
-
* - However, if nodesToRemove has values, it will work and separate text nodes even if there's no node to replace.
|
|
219
|
-
*/
|
|
220
|
-
applyInlineElement(
|
|
221
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
222
|
-
styleNode: Node | null,
|
|
223
|
-
{
|
|
224
|
-
stylesToModify,
|
|
225
|
-
nodesToRemove,
|
|
226
|
-
strictRemove
|
|
227
|
-
}?: {
|
|
228
|
-
stylesToModify?: Array<string>;
|
|
229
|
-
nodesToRemove?: Array<string>;
|
|
230
|
-
strictRemove?: boolean;
|
|
231
|
-
}
|
|
232
|
-
): HTMLElement;
|
|
233
|
-
/**
|
|
234
|
-
* @this {FormatThis}
|
|
235
|
-
* @description Remove format of the currently selected text.
|
|
236
|
-
*/
|
|
237
|
-
removeInlineElement(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>): void;
|
|
238
136
|
/**
|
|
239
137
|
* @this {FormatThis}
|
|
240
138
|
* @description Check if the container and offset values are the edges of the "line"
|
|
@@ -262,11 +160,11 @@ declare class Format {
|
|
|
262
160
|
isLine(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, element: Node | string): element is HTMLElement;
|
|
263
161
|
/**
|
|
264
162
|
* @this {FormatThis}
|
|
265
|
-
* @description It is judged whether it is the only "line" element
|
|
163
|
+
* @description It is judged whether it is the only "line" element.
|
|
266
164
|
* @param {Node|string} element The node to check
|
|
267
165
|
* @returns {element is HTMLElement}
|
|
268
166
|
*/
|
|
269
|
-
|
|
167
|
+
isNormalLine(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, element: Node | string): element is HTMLElement;
|
|
270
168
|
/**
|
|
271
169
|
* @this {FormatThis}
|
|
272
170
|
* @description It is judged whether it is the "brLine" element.
|
|
@@ -342,14 +240,6 @@ declare class Format {
|
|
|
342
240
|
* @returns {boolean}
|
|
343
241
|
*/
|
|
344
242
|
_nonFormat(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, element: Node): boolean;
|
|
345
|
-
/**
|
|
346
|
-
* @private
|
|
347
|
-
* @this {FormatThis}
|
|
348
|
-
* @description Nodes that must remain undetached when changing text nodes (A, Label, Code, Span:font-size)
|
|
349
|
-
* @param {Node|string} element Element to check
|
|
350
|
-
* @returns {boolean}
|
|
351
|
-
*/
|
|
352
|
-
_isNonSplitNode(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, element: Node | string): boolean;
|
|
353
243
|
/**
|
|
354
244
|
* @private
|
|
355
245
|
* @this {FormatThis}
|
|
@@ -358,14 +248,6 @@ declare class Format {
|
|
|
358
248
|
* @returns {boolean}
|
|
359
249
|
*/
|
|
360
250
|
_notTextNode(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, element: Node | string): boolean;
|
|
361
|
-
/**
|
|
362
|
-
* @private
|
|
363
|
-
* @this {FormatThis}
|
|
364
|
-
* @description Nodes that need to be added without modification when changing text nodes
|
|
365
|
-
* @param {Node} element Element to check
|
|
366
|
-
* @returns {boolean}
|
|
367
|
-
*/
|
|
368
|
-
_isIgnoreNodeChange(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, element: Node): boolean;
|
|
369
251
|
/**
|
|
370
252
|
* @private
|
|
371
253
|
* @this {FormatThis}
|
|
@@ -381,238 +263,6 @@ declare class Format {
|
|
|
381
263
|
startOffset: number;
|
|
382
264
|
endOffset: number;
|
|
383
265
|
};
|
|
384
|
-
/**
|
|
385
|
-
* @private
|
|
386
|
-
* @this {FormatThis}
|
|
387
|
-
* @description Attaches a nested list structure by merging adjacent lists if applicable.
|
|
388
|
-
* - Ensures that the nested list is placed correctly in the document structure.
|
|
389
|
-
* @param {Element} originList The original list element where the nested list is inserted.
|
|
390
|
-
* @param {Element} innerList The nested list element.
|
|
391
|
-
* @param {Element} prev The previous sibling element.
|
|
392
|
-
* @param {Element} next The next sibling element.
|
|
393
|
-
* @param {{s: Array<number> | null, e: Array<number> | null, sl: Node | null, el: Node | null}} nodePath Object storing the start and end node paths.
|
|
394
|
-
* - s : Start node path.
|
|
395
|
-
* - e : End node path.
|
|
396
|
-
* - sl : Start node's parent element.
|
|
397
|
-
* - el : End node's parent element.
|
|
398
|
-
* @returns {Node} The attached inner list.
|
|
399
|
-
*/
|
|
400
|
-
_attachNested(
|
|
401
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
402
|
-
originList: Element,
|
|
403
|
-
innerList: Element,
|
|
404
|
-
prev: Element,
|
|
405
|
-
next: Element,
|
|
406
|
-
nodePath: {
|
|
407
|
-
s: Array<number> | null;
|
|
408
|
-
e: Array<number> | null;
|
|
409
|
-
sl: Node | null;
|
|
410
|
-
el: Node | null;
|
|
411
|
-
}
|
|
412
|
-
): Node;
|
|
413
|
-
/**
|
|
414
|
-
* @private
|
|
415
|
-
* @this {FormatThis}
|
|
416
|
-
* @description Detaches a nested list structure by extracting list items from their parent list.
|
|
417
|
-
* - Ensures proper restructuring of the list elements.
|
|
418
|
-
* @param {Array<HTMLElement>} cells The list items to be detached.
|
|
419
|
-
* @returns {{cc: Node, sc: Node, ec: Node}} An object containing reference nodes for repositioning.
|
|
420
|
-
* - cc : The parent node of the first list item.
|
|
421
|
-
* - sc : The first list item.
|
|
422
|
-
* - ec : The last list item.
|
|
423
|
-
*/
|
|
424
|
-
_detachNested(
|
|
425
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
426
|
-
cells: Array<HTMLElement>
|
|
427
|
-
): {
|
|
428
|
-
cc: Node;
|
|
429
|
-
sc: Node;
|
|
430
|
-
ec: Node;
|
|
431
|
-
};
|
|
432
|
-
/**
|
|
433
|
-
* @private
|
|
434
|
-
* @this {FormatThis}
|
|
435
|
-
* @description Nest list cells or cancel nested cells.
|
|
436
|
-
* @param selectedCells List cells.
|
|
437
|
-
* @param nested Nested or cancel nested.
|
|
438
|
-
*/
|
|
439
|
-
_applyNestedList(
|
|
440
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
441
|
-
selectedCells: any,
|
|
442
|
-
nested: any
|
|
443
|
-
): {
|
|
444
|
-
sc: any;
|
|
445
|
-
so: number;
|
|
446
|
-
ec: any;
|
|
447
|
-
eo: number;
|
|
448
|
-
};
|
|
449
|
-
/**
|
|
450
|
-
* @private
|
|
451
|
-
* @this {FormatThis}
|
|
452
|
-
* @description Detach Nested all nested lists under the "baseNode".
|
|
453
|
-
* - Returns a list with nested removed.
|
|
454
|
-
* @param {HTMLElement} baseNode Element on which to base.
|
|
455
|
-
* @param {boolean} all If true, it also detach all nested lists of a returned list.
|
|
456
|
-
* @returns {Node} Result element
|
|
457
|
-
*/
|
|
458
|
-
_removeNestedList(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, baseNode: HTMLElement, all: boolean): Node;
|
|
459
|
-
/**
|
|
460
|
-
* @private
|
|
461
|
-
* @this {FormatThis}
|
|
462
|
-
* @description wraps text nodes of line selected text.
|
|
463
|
-
* @param {Node} element The node of the line that contains the selected text node.
|
|
464
|
-
* @param {Node} newInnerNode The dom that will wrap the selected text area
|
|
465
|
-
* @param {(current: Node) => Node|null} validation Check if the node should be stripped.
|
|
466
|
-
* @param {Node} startCon The startContainer property of the selection object.
|
|
467
|
-
* @param {number} startOff The startOffset property of the selection object.
|
|
468
|
-
* @param {Node} endCon The endContainer property of the selection object.
|
|
469
|
-
* @param {number} endOff The endOffset property of the selection object.
|
|
470
|
-
* @param {boolean} isRemoveFormat Is the remove all formats command?
|
|
471
|
-
* @param {boolean} isRemoveNode "newInnerNode" is remove node?
|
|
472
|
-
* @param {boolean} collapsed range.collapsed
|
|
473
|
-
* @returns {{ancestor: *, startContainer: *, startOffset: *, endContainer: *, endOffset: *}}
|
|
474
|
-
*/
|
|
475
|
-
_setNode_oneLine(
|
|
476
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
477
|
-
element: Node,
|
|
478
|
-
newInnerNode: Node,
|
|
479
|
-
validation: (current: Node) => Node | null,
|
|
480
|
-
startCon: Node,
|
|
481
|
-
startOff: number,
|
|
482
|
-
endCon: Node,
|
|
483
|
-
endOff: number,
|
|
484
|
-
isRemoveFormat: boolean,
|
|
485
|
-
isRemoveNode: boolean,
|
|
486
|
-
collapsed: boolean,
|
|
487
|
-
_removeCheck: any,
|
|
488
|
-
_getMaintainedNode: any,
|
|
489
|
-
_isMaintainedNode: any
|
|
490
|
-
): {
|
|
491
|
-
ancestor: any;
|
|
492
|
-
startContainer: any;
|
|
493
|
-
startOffset: any;
|
|
494
|
-
endContainer: any;
|
|
495
|
-
endOffset: any;
|
|
496
|
-
};
|
|
497
|
-
/**
|
|
498
|
-
* @private
|
|
499
|
-
* @this {FormatThis}
|
|
500
|
-
* @description wraps first line selected text.
|
|
501
|
-
* @param {Node} element The node of the line that contains the selected text node.
|
|
502
|
-
* @param {Node} newInnerNode The dom that will wrap the selected text area
|
|
503
|
-
* @param {(current: Node) => Node|null} validation Check if the node should be stripped.
|
|
504
|
-
* @param {Node} startCon The startContainer property of the selection object.
|
|
505
|
-
* @param {number} startOff The startOffset property of the selection object.
|
|
506
|
-
* @param {boolean} isRemoveFormat Is the remove all formats command?
|
|
507
|
-
* @param {boolean} isRemoveNode "newInnerNode" is remove node?
|
|
508
|
-
* @returns {NodeStyleContainerType} { ancestor, container, offset, endContainer }
|
|
509
|
-
*/
|
|
510
|
-
_setNode_startLine(
|
|
511
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
512
|
-
element: Node,
|
|
513
|
-
newInnerNode: Node,
|
|
514
|
-
validation: (current: Node) => Node | null,
|
|
515
|
-
startCon: Node,
|
|
516
|
-
startOff: number,
|
|
517
|
-
isRemoveFormat: boolean,
|
|
518
|
-
isRemoveNode: boolean,
|
|
519
|
-
_removeCheck: any,
|
|
520
|
-
_getMaintainedNode: any,
|
|
521
|
-
_isMaintainedNode: any,
|
|
522
|
-
_endContainer: any
|
|
523
|
-
): NodeStyleContainerType;
|
|
524
|
-
/**
|
|
525
|
-
* @private
|
|
526
|
-
* @this {FormatThis}
|
|
527
|
-
* @description wraps mid lines selected text.
|
|
528
|
-
* @param {HTMLElement} element The node of the line that contains the selected text node.
|
|
529
|
-
* @param {Node} newInnerNode The dom that will wrap the selected text area
|
|
530
|
-
* @param {(current: Node) => Node|null} validation Check if the node should be stripped.
|
|
531
|
-
* @param {boolean} isRemoveFormat Is the remove all formats command?
|
|
532
|
-
* @param {boolean} isRemoveNode "newInnerNode" is remove node?
|
|
533
|
-
* @param {Node} _endContainer Offset node of last line already modified (end.container)
|
|
534
|
-
* @returns {NodeStyleContainerType} { ancestor, endContainer: "If end container is renewed, returned renewed node" }
|
|
535
|
-
*/
|
|
536
|
-
_setNode_middleLine(
|
|
537
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
538
|
-
element: HTMLElement,
|
|
539
|
-
newInnerNode: Node,
|
|
540
|
-
validation: (current: Node) => Node | null,
|
|
541
|
-
isRemoveFormat: boolean,
|
|
542
|
-
isRemoveNode: boolean,
|
|
543
|
-
_removeCheck: any,
|
|
544
|
-
_endContainer: Node
|
|
545
|
-
): NodeStyleContainerType;
|
|
546
|
-
/**
|
|
547
|
-
* @private
|
|
548
|
-
* @this {FormatThis}
|
|
549
|
-
* @description wraps last line selected text.
|
|
550
|
-
* @param {Node} element The node of the line that contains the selected text node.
|
|
551
|
-
* @param {Node} newInnerNode The dom that will wrap the selected text area
|
|
552
|
-
* @param {(current: Node) => Node|null} validation Check if the node should be stripped.
|
|
553
|
-
* @param {Node} endCon The endContainer property of the selection object.
|
|
554
|
-
* @param {number} endOff The endOffset property of the selection object.
|
|
555
|
-
* @param {boolean} isRemoveFormat Is the remove all formats command?
|
|
556
|
-
* @param {boolean} isRemoveNode "newInnerNode" is remove node?
|
|
557
|
-
* @returns {NodeStyleContainerType} { ancestor, container, offset }
|
|
558
|
-
*/
|
|
559
|
-
_setNode_endLine(
|
|
560
|
-
this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
|
|
561
|
-
element: Node,
|
|
562
|
-
newInnerNode: Node,
|
|
563
|
-
validation: (current: Node) => Node | null,
|
|
564
|
-
endCon: Node,
|
|
565
|
-
endOff: number,
|
|
566
|
-
isRemoveFormat: boolean,
|
|
567
|
-
isRemoveNode: boolean,
|
|
568
|
-
_removeCheck: any,
|
|
569
|
-
_getMaintainedNode: any,
|
|
570
|
-
_isMaintainedNode: any
|
|
571
|
-
): NodeStyleContainerType;
|
|
572
|
-
/**
|
|
573
|
-
* @private
|
|
574
|
-
* @this {FormatThis}
|
|
575
|
-
* @description Node with font-size style
|
|
576
|
-
* @param {Node} element Element to check
|
|
577
|
-
* @returns {boolean}
|
|
578
|
-
*/
|
|
579
|
-
_sn_isSizeNode(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, element: Node): boolean;
|
|
580
|
-
/**
|
|
581
|
-
* @private
|
|
582
|
-
* @this {FormatThis}
|
|
583
|
-
* @description Return the parent maintained tag. (bind and use a util object)
|
|
584
|
-
* @param {boolean} _isRemove is remove anchor
|
|
585
|
-
* @param {boolean} _isSizeNode is size span node
|
|
586
|
-
* @param {Node} element Element
|
|
587
|
-
* @returns {Node|null}
|
|
588
|
-
*/
|
|
589
|
-
_sn_getMaintainedNode(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, _isRemove: boolean, _isSizeNode: boolean, element: Node): Node | null;
|
|
590
|
-
/**
|
|
591
|
-
* @private
|
|
592
|
-
* @this {FormatThis}
|
|
593
|
-
* @description Check if element is a tag that should be persisted. (bind and use a util object)
|
|
594
|
-
* @param {boolean} _isRemove is remove anchor
|
|
595
|
-
* @param {boolean} _isSizeNode is size span node
|
|
596
|
-
* @param {Node} element Element
|
|
597
|
-
* @returns {boolean}
|
|
598
|
-
*/
|
|
599
|
-
_sn_isMaintainedNode(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, _isRemove: boolean, _isSizeNode: boolean, element: Node): boolean;
|
|
600
|
-
/**
|
|
601
|
-
* @private
|
|
602
|
-
* @this {FormatThis}
|
|
603
|
-
* @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)
|
|
604
|
-
* @param {Node} el List cell element. <li>
|
|
605
|
-
* @param {?Node} child Variable for recursive call. ("null" on the first call)
|
|
606
|
-
*/
|
|
607
|
-
_sn_setCommonListStyle(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, el: Node, child: Node | null): void;
|
|
608
|
-
/**
|
|
609
|
-
* @private
|
|
610
|
-
* @this {FormatThis}
|
|
611
|
-
* @description Watch the applied text nodes and adjust the common styles of the list.
|
|
612
|
-
* @param {Node} el "LI" element
|
|
613
|
-
* @param {Array|null} styleArray Refer style array
|
|
614
|
-
*/
|
|
615
|
-
_sn_resetCommonListCell(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, el: Node, styleArray: any[] | null): boolean;
|
|
616
266
|
/**
|
|
617
267
|
* @private
|
|
618
268
|
* @this {FormatThis}
|
|
@@ -264,10 +264,10 @@ declare class HTML {
|
|
|
264
264
|
/**
|
|
265
265
|
* @this {HTMLThis}
|
|
266
266
|
* @description Call "clipboard.write" to copy the contents and display a success/failure toast message.
|
|
267
|
-
* @param {Element|Text|string} content Content to be copied to the clipboard
|
|
267
|
+
* @param {Node|Element|Text|string} content Content to be copied to the clipboard
|
|
268
268
|
* @returns {Promise<boolean>} Success or failure
|
|
269
269
|
*/
|
|
270
|
-
copy(this: Omit<HTML & Partial<import('../../editorInjector').default>, 'html'>, content: Element | Text | string): Promise<boolean>;
|
|
270
|
+
copy(this: Omit<HTML & Partial<import('../../editorInjector').default>, 'html'>, content: Node | Element | Text | string): Promise<boolean>;
|
|
271
271
|
/**
|
|
272
272
|
* @this {HTMLThis}
|
|
273
273
|
* @description Sets the content of the iframe's head tag and body tag when using the "iframe" or "iframe_fullPage" option.
|
|
@@ -298,7 +298,7 @@ declare class HTML {
|
|
|
298
298
|
* @private
|
|
299
299
|
* @this {HTMLThis}
|
|
300
300
|
* @description construct wysiwyg area element to html string
|
|
301
|
-
* @param {Node|string} html WYSIWYG element (this.
|
|
301
|
+
* @param {Node|string} html WYSIWYG element (this.frameContext.get('wysiwyg')) or HTML string.
|
|
302
302
|
* @param {boolean} comp If true, does not line break and indentation of tags.
|
|
303
303
|
* @returns {string}
|
|
304
304
|
*/
|
|
@@ -308,8 +308,17 @@ declare class HTML {
|
|
|
308
308
|
* @this {HTMLThis}
|
|
309
309
|
* @description Checks whether the given list item node should be removed and handles necessary clean-up.
|
|
310
310
|
* @param {Node} item The list item node to be checked.
|
|
311
|
+
* @param {boolean} isSingleItem Single item
|
|
312
|
+
* @returns {{sc:Node, ec:Node}|null} An object containing the start and end containers if any transformations were made, otherwise null.
|
|
311
313
|
*/
|
|
312
|
-
_nodeRemoveListItem(
|
|
314
|
+
_nodeRemoveListItem(
|
|
315
|
+
this: Omit<HTML & Partial<import('../../editorInjector').default>, 'html'>,
|
|
316
|
+
item: Node,
|
|
317
|
+
isSingleItem: boolean
|
|
318
|
+
): {
|
|
319
|
+
sc: Node;
|
|
320
|
+
ec: Node;
|
|
321
|
+
} | null;
|
|
313
322
|
/**
|
|
314
323
|
* @private
|
|
315
324
|
* @this {HTMLThis}
|