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.
Files changed (241) hide show
  1. package/CONTRIBUTING.md +8 -8
  2. package/README.md +44 -49
  3. package/dist/suneditor.min.css +1 -1
  4. package/dist/suneditor.min.js +1 -1
  5. package/package.json +95 -53
  6. package/src/assets/design/color.css +2 -2
  7. package/src/assets/design/size.css +2 -0
  8. package/src/assets/icons/defaultIcons.js +16 -1
  9. package/src/assets/suneditor-contents.css +9 -8
  10. package/src/assets/suneditor.css +29 -26
  11. package/src/core/{section → base}/actives.js +20 -12
  12. package/src/core/base/history.js +4 -4
  13. package/src/core/class/char.js +10 -10
  14. package/src/core/class/component.js +146 -57
  15. package/src/core/class/format.js +94 -2458
  16. package/src/core/class/html.js +187 -129
  17. package/src/core/class/inline.js +1853 -0
  18. package/src/core/class/listFormat.js +582 -0
  19. package/src/core/class/menu.js +14 -3
  20. package/src/core/class/nodeTransform.js +9 -14
  21. package/src/core/class/offset.js +162 -197
  22. package/src/core/class/selection.js +137 -34
  23. package/src/core/class/toolbar.js +73 -52
  24. package/src/core/class/ui.js +11 -11
  25. package/src/core/class/viewer.js +56 -55
  26. package/src/core/config/context.js +122 -0
  27. package/src/core/config/frameContext.js +204 -0
  28. package/src/core/config/options.js +639 -0
  29. package/src/core/editor.js +181 -108
  30. package/src/core/event/actions/index.js +229 -0
  31. package/src/core/event/effects/common.registry.js +60 -0
  32. package/src/core/event/effects/keydown.registry.js +551 -0
  33. package/src/core/event/effects/ruleHelpers.js +145 -0
  34. package/src/core/{base → event}/eventManager.js +119 -201
  35. package/src/core/event/executor.js +21 -0
  36. package/src/core/{base/eventHandlers → event/handlers}/handler_toolbar.js +4 -4
  37. package/src/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.js +2 -2
  38. package/src/core/event/handlers/handler_ww_input.js +77 -0
  39. package/src/core/event/handlers/handler_ww_key.js +228 -0
  40. package/src/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.js +3 -3
  41. package/src/core/event/ports.js +211 -0
  42. package/src/core/event/reducers/keydown.reducer.js +89 -0
  43. package/src/core/event/rules/keydown.rule.arrow.js +54 -0
  44. package/src/core/event/rules/keydown.rule.backspace.js +202 -0
  45. package/src/core/event/rules/keydown.rule.delete.js +126 -0
  46. package/src/core/event/rules/keydown.rule.enter.js +144 -0
  47. package/src/core/event/rules/keydown.rule.tab.js +29 -0
  48. package/src/core/section/constructor.js +79 -388
  49. package/src/core/section/documentType.js +47 -26
  50. package/src/core/util/instanceCheck.js +59 -0
  51. package/src/editorInjector/_classes.js +4 -0
  52. package/src/editorInjector/_core.js +17 -7
  53. package/src/editorInjector/index.js +10 -2
  54. package/src/events.js +6 -0
  55. package/src/helper/clipboard.js +24 -10
  56. package/src/helper/converter.js +17 -12
  57. package/src/helper/dom/domCheck.js +22 -3
  58. package/src/helper/dom/domQuery.js +91 -45
  59. package/src/helper/dom/domUtils.js +93 -19
  60. package/src/helper/dom/index.js +4 -0
  61. package/src/helper/env.js +11 -7
  62. package/src/helper/keyCodeMap.js +4 -3
  63. package/src/langs/ckb.js +1 -1
  64. package/src/langs/cs.js +1 -1
  65. package/src/langs/da.js +1 -1
  66. package/src/langs/de.js +1 -1
  67. package/src/langs/en.js +1 -1
  68. package/src/langs/es.js +1 -1
  69. package/src/langs/fa.js +1 -1
  70. package/src/langs/fr.js +1 -1
  71. package/src/langs/he.js +1 -1
  72. package/src/langs/hu.js +1 -1
  73. package/src/langs/it.js +1 -1
  74. package/src/langs/ja.js +1 -1
  75. package/src/langs/km.js +1 -1
  76. package/src/langs/ko.js +1 -1
  77. package/src/langs/lv.js +1 -1
  78. package/src/langs/nl.js +1 -1
  79. package/src/langs/pl.js +1 -1
  80. package/src/langs/pt_br.js +10 -10
  81. package/src/langs/ro.js +1 -1
  82. package/src/langs/ru.js +1 -1
  83. package/src/langs/se.js +1 -1
  84. package/src/langs/tr.js +1 -1
  85. package/src/langs/uk.js +1 -1
  86. package/src/langs/ur.js +1 -1
  87. package/src/langs/zh_cn.js +1 -1
  88. package/src/modules/ApiManager.js +25 -18
  89. package/src/modules/Browser.js +52 -61
  90. package/src/modules/ColorPicker.js +37 -38
  91. package/src/modules/Controller.js +85 -79
  92. package/src/modules/Figure.js +275 -187
  93. package/src/modules/FileManager.js +86 -92
  94. package/src/modules/HueSlider.js +67 -35
  95. package/src/modules/Modal.js +84 -77
  96. package/src/modules/ModalAnchorEditor.js +62 -79
  97. package/src/modules/SelectMenu.js +89 -86
  98. package/src/plugins/browser/audioGallery.js +9 -5
  99. package/src/plugins/browser/fileBrowser.js +10 -6
  100. package/src/plugins/browser/fileGallery.js +9 -5
  101. package/src/plugins/browser/imageGallery.js +9 -5
  102. package/src/plugins/browser/videoGallery.js +11 -6
  103. package/src/plugins/command/blockquote.js +1 -0
  104. package/src/plugins/command/exportPDF.js +11 -8
  105. package/src/plugins/command/fileUpload.js +41 -29
  106. package/src/plugins/command/list_bulleted.js +2 -1
  107. package/src/plugins/command/list_numbered.js +2 -1
  108. package/src/plugins/dropdown/align.js +8 -2
  109. package/src/plugins/dropdown/backgroundColor.js +19 -11
  110. package/src/plugins/dropdown/font.js +15 -9
  111. package/src/plugins/dropdown/fontColor.js +19 -11
  112. package/src/plugins/dropdown/formatBlock.js +7 -2
  113. package/src/plugins/dropdown/hr.js +7 -3
  114. package/src/plugins/dropdown/layout.js +6 -2
  115. package/src/plugins/dropdown/lineHeight.js +8 -3
  116. package/src/plugins/dropdown/list.js +2 -1
  117. package/src/plugins/dropdown/paragraphStyle.js +15 -11
  118. package/src/plugins/dropdown/{table.js → table/index.js} +514 -362
  119. package/src/plugins/dropdown/template.js +6 -2
  120. package/src/plugins/dropdown/textStyle.js +7 -3
  121. package/src/plugins/field/mention.js +33 -27
  122. package/src/plugins/input/fontSize.js +44 -37
  123. package/src/plugins/input/pageNavigator.js +3 -2
  124. package/src/plugins/modal/audio.js +90 -85
  125. package/src/plugins/modal/drawing.js +58 -66
  126. package/src/plugins/modal/embed.js +193 -180
  127. package/src/plugins/modal/image.js +441 -439
  128. package/src/plugins/modal/link.js +31 -8
  129. package/src/plugins/modal/math.js +23 -22
  130. package/src/plugins/modal/video.js +233 -230
  131. package/src/plugins/popup/anchor.js +24 -18
  132. package/src/suneditor.js +69 -24
  133. package/src/typedef.js +42 -19
  134. package/types/assets/icons/defaultIcons.d.ts +8 -0
  135. package/types/core/class/char.d.ts +1 -1
  136. package/types/core/class/component.d.ts +29 -7
  137. package/types/core/class/format.d.ts +4 -354
  138. package/types/core/class/html.d.ts +13 -4
  139. package/types/core/class/inline.d.ts +263 -0
  140. package/types/core/class/listFormat.d.ts +135 -0
  141. package/types/core/class/menu.d.ts +10 -2
  142. package/types/core/class/offset.d.ts +24 -26
  143. package/types/core/class/selection.d.ts +2 -0
  144. package/types/core/class/toolbar.d.ts +24 -11
  145. package/types/core/class/ui.d.ts +1 -1
  146. package/types/core/class/viewer.d.ts +1 -1
  147. package/types/core/config/context.d.ts +157 -0
  148. package/types/core/config/frameContext.d.ts +367 -0
  149. package/types/core/config/options.d.ts +1119 -0
  150. package/types/core/editor.d.ts +101 -66
  151. package/types/core/event/actions/index.d.ts +47 -0
  152. package/types/core/event/effects/common.registry.d.ts +50 -0
  153. package/types/core/event/effects/keydown.registry.d.ts +73 -0
  154. package/types/core/event/effects/ruleHelpers.d.ts +31 -0
  155. package/types/core/{base → event}/eventManager.d.ts +15 -46
  156. package/types/core/event/executor.d.ts +6 -0
  157. package/types/core/event/handlers/handler_ww_input.d.ts +41 -0
  158. package/types/core/{base/eventHandlers/handler_ww_key_input.d.ts → event/handlers/handler_ww_key.d.ts} +4 -6
  159. package/types/core/event/ports.d.ts +255 -0
  160. package/types/core/event/reducers/keydown.reducer.d.ts +75 -0
  161. package/types/core/event/rules/keydown.rule.arrow.d.ts +8 -0
  162. package/types/core/event/rules/keydown.rule.backspace.d.ts +9 -0
  163. package/types/core/event/rules/keydown.rule.delete.d.ts +9 -0
  164. package/types/core/event/rules/keydown.rule.enter.d.ts +9 -0
  165. package/types/core/event/rules/keydown.rule.tab.d.ts +9 -0
  166. package/types/core/section/constructor.d.ts +101 -631
  167. package/types/core/section/documentType.d.ts +14 -4
  168. package/types/core/util/instanceCheck.d.ts +50 -0
  169. package/types/editorInjector/_classes.d.ts +4 -0
  170. package/types/editorInjector/_core.d.ts +17 -7
  171. package/types/editorInjector/index.d.ts +10 -2
  172. package/types/events.d.ts +1 -0
  173. package/types/helper/clipboard.d.ts +2 -2
  174. package/types/helper/converter.d.ts +6 -9
  175. package/types/helper/dom/domCheck.d.ts +7 -0
  176. package/types/helper/dom/domQuery.d.ts +19 -8
  177. package/types/helper/dom/domUtils.d.ts +24 -2
  178. package/types/helper/dom/index.d.ts +86 -1
  179. package/types/helper/env.d.ts +6 -1
  180. package/types/helper/index.d.ts +7 -1
  181. package/types/helper/keyCodeMap.d.ts +3 -3
  182. package/types/index.d.ts +23 -117
  183. package/types/langs/index.d.ts +2 -2
  184. package/types/modules/ApiManager.d.ts +1 -8
  185. package/types/modules/Browser.d.ts +4 -62
  186. package/types/modules/ColorPicker.d.ts +4 -21
  187. package/types/modules/Controller.d.ts +8 -64
  188. package/types/modules/Figure.d.ts +54 -50
  189. package/types/modules/FileManager.d.ts +1 -13
  190. package/types/modules/HueSlider.d.ts +13 -3
  191. package/types/modules/Modal.d.ts +0 -43
  192. package/types/modules/ModalAnchorEditor.d.ts +0 -73
  193. package/types/modules/SelectMenu.d.ts +0 -85
  194. package/types/modules/index.d.ts +3 -3
  195. package/types/plugins/browser/audioGallery.d.ts +29 -18
  196. package/types/plugins/browser/fileBrowser.d.ts +38 -27
  197. package/types/plugins/browser/fileGallery.d.ts +29 -18
  198. package/types/plugins/browser/imageGallery.d.ts +24 -16
  199. package/types/plugins/browser/videoGallery.d.ts +29 -18
  200. package/types/plugins/command/blockquote.d.ts +1 -0
  201. package/types/plugins/command/exportPDF.d.ts +18 -18
  202. package/types/plugins/command/fileUpload.d.ts +65 -45
  203. package/types/plugins/command/list_bulleted.d.ts +1 -0
  204. package/types/plugins/command/list_numbered.d.ts +1 -0
  205. package/types/plugins/dropdown/align.d.ts +13 -8
  206. package/types/plugins/dropdown/backgroundColor.d.ts +30 -19
  207. package/types/plugins/dropdown/font.d.ts +13 -12
  208. package/types/plugins/dropdown/fontColor.d.ts +30 -19
  209. package/types/plugins/dropdown/formatBlock.d.ts +13 -8
  210. package/types/plugins/dropdown/hr.d.ts +15 -11
  211. package/types/plugins/dropdown/layout.d.ts +15 -11
  212. package/types/plugins/dropdown/lineHeight.d.ts +16 -11
  213. package/types/plugins/dropdown/list.d.ts +1 -0
  214. package/types/plugins/dropdown/paragraphStyle.d.ts +31 -27
  215. package/types/plugins/dropdown/table/index.d.ts +582 -0
  216. package/types/plugins/dropdown/table.d.ts +41 -86
  217. package/types/plugins/dropdown/template.d.ts +15 -11
  218. package/types/plugins/dropdown/textStyle.d.ts +19 -11
  219. package/types/plugins/field/mention.d.ts +58 -56
  220. package/types/plugins/index.d.ts +38 -38
  221. package/types/plugins/input/fontSize.d.ts +46 -50
  222. package/types/plugins/modal/audio.d.ts +26 -56
  223. package/types/plugins/modal/drawing.d.ts +0 -85
  224. package/types/plugins/modal/embed.d.ts +15 -79
  225. package/types/plugins/modal/image.d.ts +24 -136
  226. package/types/plugins/modal/link.d.ts +34 -15
  227. package/types/plugins/modal/math.d.ts +0 -16
  228. package/types/plugins/modal/video.d.ts +17 -86
  229. package/types/plugins/popup/anchor.d.ts +1 -8
  230. package/types/suneditor.d.ts +70 -19
  231. package/types/typedef.d.ts +60 -46
  232. package/src/core/base/eventHandlers/handler_ww_key_input.js +0 -1200
  233. package/src/core/section/context.js +0 -102
  234. package/types/core/section/context.d.ts +0 -45
  235. package/types/langs/_Lang.d.ts +0 -194
  236. /package/src/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.js +0 -0
  237. /package/types/core/{section → base}/actives.d.ts +0 -0
  238. /package/types/core/{base/eventHandlers → event/handlers}/handler_toolbar.d.ts +0 -0
  239. /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.d.ts +0 -0
  240. /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.d.ts +0 -0
  241. /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 creation, line retrieval from selected range, etc.
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 creation, line retrieval from selected range, etc.
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, not "brLine".
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
- isLineOnly(this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>, element: Node | string): element is HTMLElement;
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.editor.frameContext.get('wysiwyg')) or HTML string.
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(this: Omit<HTML & Partial<import('../../editorInjector').default>, 'html'>, item: Node): void;
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}