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
@@ -0,0 +1,582 @@
1
+ export default Table;
2
+ export type TableCtrlProps = {
3
+ html: HTMLElement;
4
+ controller_props_title: HTMLElement;
5
+ borderButton: HTMLButtonElement;
6
+ borderFormatButton: HTMLButtonElement;
7
+ cell_alignment: HTMLElement;
8
+ cell_alignment_vertical: HTMLElement;
9
+ cell_alignment_table_text: HTMLElement;
10
+ border_style: HTMLButtonElement;
11
+ border_color: HTMLInputElement;
12
+ border_width: HTMLInputElement;
13
+ back_color: HTMLInputElement;
14
+ font_color: HTMLInputElement;
15
+ palette_border_button: HTMLButtonElement;
16
+ font_bold: HTMLButtonElement;
17
+ font_underline: HTMLButtonElement;
18
+ font_italic: HTMLButtonElement;
19
+ font_strike: HTMLButtonElement;
20
+ };
21
+ export type TablePluginOptions = {
22
+ /**
23
+ * - Scroll type ('x', 'y', 'xy')
24
+ */
25
+ scrollType?: 'x' | 'y' | 'xy';
26
+ /**
27
+ * - Caption position ('top', 'bottom')
28
+ */
29
+ captionPosition?: 'top' | 'bottom';
30
+ /**
31
+ * - Cell controller position ('cell', 'table')
32
+ */
33
+ cellControllerPosition?: 'cell' | 'table';
34
+ /**
35
+ * - Color list, used in cell color picker
36
+ */
37
+ colorList?: any[];
38
+ };
39
+ /**
40
+ * @typedef {Object} TablePluginOptions
41
+ * @property {"x"|"y"|"xy"} [scrollType='x'] - Scroll type ('x', 'y', 'xy')
42
+ * @property {"top"|"bottom"} [captionPosition='bottom'] - Caption position ('top', 'bottom')
43
+ * @property {"cell"|"table"} [cellControllerPosition='cell'] - Cell controller position ('cell', 'table')
44
+ * @property {Array} [colorList] - Color list, used in cell color picker
45
+ */
46
+ /**
47
+ * @class
48
+ * @description Table Plugin
49
+ */
50
+ declare class Table extends EditorInjector {
51
+ static key: string;
52
+ static type: string;
53
+ static className: string;
54
+ static options: {
55
+ isInputComponent: boolean;
56
+ };
57
+ /**
58
+ * @this {Table}
59
+ * @param {HTMLElement} node - The node to check.
60
+ * @returns {HTMLElement|null} Returns a node if the node is a valid component.
61
+ */
62
+ static component(this: Table, node: HTMLElement): HTMLElement | null;
63
+ /**
64
+ * @constructor
65
+ * @param {__se__EditorCore} editor - The root editor instance
66
+ * @param {TablePluginOptions} pluginOptions - Plugin options
67
+ */
68
+ constructor(editor: __se__EditorCore, pluginOptions: TablePluginOptions);
69
+ title: any;
70
+ icon: string;
71
+ figureScrollList: string[];
72
+ figureScroll: string;
73
+ captionPosition: string;
74
+ cellControllerTop: boolean;
75
+ controller_cell: Controller;
76
+ controller_table: Controller;
77
+ controller_props: Controller;
78
+ controller_props_title: HTMLElement;
79
+ colorPicker: ColorPicker;
80
+ controller_colorPicker: Controller;
81
+ figure: Figure;
82
+ sliderType: string;
83
+ splitButton: HTMLButtonElement;
84
+ selectMenu_split: SelectMenu;
85
+ selectMenu_column: SelectMenu;
86
+ selectMenu_row: SelectMenu;
87
+ selectMenu_props_border: SelectMenu;
88
+ selectMenu_props_border_format: SelectMenu;
89
+ selectMenu_props_border_format_oneCell: SelectMenu;
90
+ maxText: any;
91
+ minText: any;
92
+ propTargets: {
93
+ cell_alignment: HTMLElement;
94
+ cell_alignment_vertical: HTMLElement;
95
+ cell_alignment_table_text: HTMLElement;
96
+ border_format: HTMLButtonElement;
97
+ border_style: HTMLButtonElement;
98
+ border_color: HTMLInputElement;
99
+ border_width: HTMLInputElement;
100
+ back_color: HTMLInputElement;
101
+ font_color: HTMLInputElement;
102
+ palette_border_button: HTMLButtonElement;
103
+ font_bold: HTMLButtonElement;
104
+ font_underline: HTMLButtonElement;
105
+ font_italic: HTMLButtonElement;
106
+ font_strike: HTMLButtonElement;
107
+ };
108
+ _propsCache: any[];
109
+ _currentFontStyles: any[];
110
+ _propsAlignCache: string;
111
+ _propsVerticalAlignCache: string;
112
+ _typeCache: string;
113
+ /** @type {HTMLElement} */
114
+ tableHighlight: HTMLElement;
115
+ /** @type {HTMLElement} */
116
+ tableUnHighlight: HTMLElement;
117
+ /** @type {HTMLElement} */
118
+ tableDisplay: HTMLElement;
119
+ /** @type {HTMLButtonElement} */
120
+ resizeButton: HTMLButtonElement;
121
+ /** @type {HTMLSpanElement} */
122
+ resizeText: HTMLSpanElement;
123
+ /** @type {HTMLButtonElement} */
124
+ columnFixedButton: HTMLButtonElement;
125
+ /** @type {HTMLButtonElement} */
126
+ headerButton: HTMLButtonElement;
127
+ /** @type {HTMLButtonElement} */
128
+ captionButton: HTMLButtonElement;
129
+ /** @type {HTMLButtonElement} */
130
+ mergeButton: HTMLButtonElement;
131
+ /** @type {HTMLButtonElement} */
132
+ unmergeButton: HTMLButtonElement;
133
+ /**
134
+ * @description Same value a "this._selectedTable", but it maintain prev table element
135
+ * @type {HTMLTableElement}
136
+ */
137
+ _element: HTMLTableElement;
138
+ /**
139
+ * @editorMethod Editor.core
140
+ * @description Executes the main execution method of the plugin.
141
+ * - Called when an item in the "dropdown" menu is clicked.
142
+ */
143
+ action(): void;
144
+ /**
145
+ * @editorMethod Editor.component
146
+ * @description Executes the method that is called when a component of a plugin is selected.
147
+ * @param {HTMLElement} target Target component element
148
+ */
149
+ select(target: HTMLElement): void;
150
+ /**
151
+ * @editorMethod Editor.Component
152
+ * @description Method to delete a component of a plugin, called by the "FileManager", "Controller" module.
153
+ * @param {HTMLElement} target Target element
154
+ * @returns {Promise<void>}
155
+ */
156
+ destroy(target: HTMLElement): Promise<void>;
157
+ /**
158
+ * @editorMethod Editor.component
159
+ * @description Executes the method that is called when a component copy is requested.
160
+ * @param {__se__PluginCopyComponentParams} params
161
+ * @returns {boolean|void}
162
+ */
163
+ onCopyComponent({ event, cloneContainer }: __se__PluginCopyComponentParams): boolean | void;
164
+ /**
165
+ * @editorMethod Editor.EventManager
166
+ * @description Executes the event function of "copy".
167
+ * @param {__se__PluginPasteParams} params
168
+ * @returns {boolean|void}
169
+ */
170
+ onPaste({ event, doc }: __se__PluginPasteParams): boolean | void;
171
+ /**
172
+ * @editorMethod Editor.core
173
+ * @description This method is used to validate and preserve the format of the component within the editor.
174
+ * - It ensures that the structure and attributes of the element are maintained and secure.
175
+ * - The method checks if the element is already wrapped in a valid container and updates its attributes if necessary.
176
+ * - If the element isn't properly contained, a new container is created to retain the format.
177
+ * @returns {{query: string, method: (element: HTMLTableElement) => void}} The format retention object containing the query and method to process the element.
178
+ * - query: The selector query to identify the relevant elements (in this case, 'audio').
179
+ * - method:The function to execute on the element to validate and preserve its format.
180
+ * - The function takes the element as an argument, checks if it is contained correctly, and applies necessary adjustments.
181
+ */
182
+ retainFormat(): {
183
+ query: string;
184
+ method: (element: HTMLTableElement) => void;
185
+ };
186
+ /**
187
+ * @editorMethod Editor.core
188
+ * @description Executes the method called when the rtl, ltr mode changes. ("editor.setDir")
189
+ * @param {string} dir Direction ("rtl" or "ltr")
190
+ */
191
+ setDir(dir: string): void;
192
+ /**
193
+ * @editorMethod Editor.EventManager
194
+ * @description Executes the event function of "mousemove".
195
+ * @param {__se__PluginMouseEventInfo} params
196
+ */
197
+ onMouseMove({ event }: __se__PluginMouseEventInfo): void;
198
+ /**
199
+ * @editorMethod Editor.EventManager
200
+ * @description Executes the event function of "scroll".
201
+ */
202
+ onScroll(): void;
203
+ /**
204
+ * @editorMethod Editor.EventManager
205
+ * @description Executes the event function of "mousedown".
206
+ * @param {__se__PluginMouseEventInfo} params
207
+ */
208
+ onMouseDown({ event }: __se__PluginMouseEventInfo): void;
209
+ /**
210
+ * @editorMethod Editor.EventManager
211
+ * @description Executes the event function of "mouseup".
212
+ */
213
+ onMouseUp(): void;
214
+ /**
215
+ * @editorMethod Editor.EventManager
216
+ * @description Executes the event function of "mouseleave".
217
+ */
218
+ onMouseLeave(): void;
219
+ /**
220
+ * @editorMethod Editor.EventManager
221
+ * @description Executes the event function of "keydown".
222
+ * @param {__se__PluginKeyEventInfo} params
223
+ */
224
+ onKeyDown({ event, range, line }: __se__PluginKeyEventInfo): boolean;
225
+ /**
226
+ * @editorMethod Editor.EventManager
227
+ * @description Executes the event function of "keyup".
228
+ * @param {__se__PluginKeyEventInfo} params
229
+ */
230
+ onKeyUp({ line }: __se__PluginKeyEventInfo): void;
231
+ /**
232
+ * @editorMethod Modules.ColorPicker
233
+ * @description Executes the method called when a button of "ColorPicker" module is clicked.
234
+ * @param {string} color - Color code (hex)
235
+ */
236
+ colorPickerAction(color: string): void;
237
+ /**
238
+ * @editorMethod Modules.Controller
239
+ * @description Executes the method that is called when a button is clicked in the "controller".
240
+ * @param {HTMLButtonElement} target Target button element
241
+ */
242
+ controllerAction(target: HTMLButtonElement): void;
243
+ /**
244
+ * @editorMethod Modules.Controller
245
+ * @description Executes the method called when the "controller" is closed.
246
+ */
247
+ close(): void;
248
+ /**
249
+ * @description Selects a group of table cells and sets internal state related to multi-cell selection.
250
+ * @param {HTMLTableCellElement[]} cells - An array of table cell elements to be selected.
251
+ */
252
+ selectCells(cells: HTMLTableCellElement[]): void;
253
+ /**
254
+ * @description Sets the table and figure elements based on the provided cell element, and stores references to them for later use.
255
+ * @param {Node} element The target table cell (`<td>`) element from which the table info will be extracted.
256
+ * @returns {HTMLTableElement} The `<table>` element that is the parent of the provided `element`.
257
+ */
258
+ setTableInfo(element: Node): HTMLTableElement;
259
+ /**
260
+ * @description Sets various table-related information based on the provided table cell element (`<td>`). This includes updating cell, row, and table attributes, handling spanning cells, and adjusting the UI for elements like headers and captions.
261
+ * @param {HTMLTableCellElement} tdElement The target table cell (`<td>`) element from which table information will be extracted.
262
+ * @param {boolean} reset A flag indicating whether to reset the cell information. If `true`, the cell information will be reset and recalculated.
263
+ */
264
+ setCellInfo(tdElement: HTMLTableCellElement, reset: boolean): void;
265
+ /**
266
+ * @description Sets row-related information based on the provided table row element (`<tr>`). This includes updating the row count and the index of the selected row.
267
+ * @param {HTMLTableRowElement} trElement The target table row (`<tr>`) element from which row information will be extracted.
268
+ */
269
+ setRowInfo(trElement: HTMLTableRowElement): void;
270
+ /**
271
+ * @description Edits the table by adding, removing, or modifying rows and cells, based on the provided options. Supports both single and multi-cell/row editing.
272
+ * @param {"row"|"cell"} type The type of element to edit ('row' or 'cell').
273
+ * @param {?"up"|"down"|"left"|"right"} option The action to perform: 'up', 'down', 'left', 'right', or `null` for removing.
274
+ */
275
+ editTable(type: 'row' | 'cell', option: ('up' | 'down' | 'left' | 'right') | null): void;
276
+ /**
277
+ * @description Edits a table row, either adding, removing, the row
278
+ * @param {?string} option The action to perform on the row ("up"|"down"|null)
279
+ * - null: to remove the row
280
+ * - 'up': to insert the row up
281
+ * - 'down': to insert the row down, or null to remove.
282
+ * @param {?HTMLTableCellElement=} targetCell Target cell, (default: current selected cell)
283
+ * @param {?HTMLTableCellElement=} [positionResetElement] The element to reset the position of (optional). This can be the cell that triggered the row edit.
284
+ */
285
+ editRow(option: string | null, targetCell?: (HTMLTableCellElement | null) | undefined, positionResetElement?: (HTMLTableCellElement | null) | undefined): void;
286
+ /**
287
+ * @description Edits a table cell(column), either adding, removing, or modifying the cell based on the provided option.
288
+ * @param {?string} option The action to perform on the cell ("left"|"right"|null)
289
+ * - null: to remove the cell
290
+ * - left: to insert a new cell to the left
291
+ * - right: to insert a new cell to the right
292
+ * @param {?HTMLTableCellElement=} targetCell Target cell, (default: current selected cell)
293
+ * @param {?HTMLTableCellElement=} positionResetElement The element to reset the position of (optional). This can be the cell that triggered the column edit.
294
+ * @returns {HTMLTableCellElement} Target table cell
295
+ */
296
+ editCell(option: string | null, targetCell?: (HTMLTableCellElement | null) | undefined, positionResetElement?: (HTMLTableCellElement | null) | undefined): HTMLTableCellElement;
297
+ /**
298
+ * @description Updates the target table's cells with the data from the copied table.
299
+ * @param {HTMLTableElement} copyTable The table containing the copied data.
300
+ * @param {HTMLTableCellElement} targetTD The starting cell in the target table where data will be pasted.
301
+ */
302
+ pasteTableCellMatrix(copyTable: HTMLTableElement, targetTD: HTMLTableCellElement): void;
303
+ /**
304
+ * @description Inserts a new row into the table at the specified index to it.
305
+ * @param {HTMLTableElement} table The table element to insert the row into.
306
+ * @param {number} rowIndex The index at which to insert the new row.
307
+ * @param {number} cellCnt The number of cells to create in the new row.
308
+ * @returns {HTMLTableRowElement} The newly inserted row element.
309
+ */
310
+ insertBodyRow(table: HTMLTableElement, rowIndex: number, cellCnt: number): HTMLTableRowElement;
311
+ /**
312
+ * @description Merges the selected table cells into one cell by combining their contents and adjusting their row and column spans.
313
+ * - This method removes the selected cells, consolidates their contents, and applies the appropriate row and column spans to the merged cell.
314
+ * @param {HTMLTableCellElement[]} selectedCells Cells array
315
+ * @param {boolean} [skipPostProcess=false] - If true, skips table cloning, cell re-selection, history stack push, and rendering.
316
+ */
317
+ mergeCells(selectedCells: HTMLTableCellElement[], skipPostProcess?: boolean): void;
318
+ /**
319
+ * @description Unmerges a table cell that has been merged using rowspan and/or colspan.
320
+ * @param {HTMLTableCellElement[]} selectedCells - Cells array
321
+ * @param {boolean} [skipPostProcess=false] - If true, skips table cloning, cell re-selection, history stack push, and rendering.
322
+ */
323
+ unmergeCells(selectedCells: HTMLTableCellElement[], skipPostProcess?: boolean): void;
324
+ /**
325
+ * @description Find merged cells
326
+ * @param {HTMLTableCellElement[]} cells - Cells array
327
+ */
328
+ findMergedCells(cells: HTMLTableCellElement[]): any[];
329
+ /**
330
+ * @description Toggles the visibility of the table header (`<thead>`). If the header is present, it is removed; if absent, it is added.
331
+ */
332
+ toggleHeader(): void;
333
+ /**
334
+ * @description Toggles the visibility of the table caption (`<caption>`). If the caption is present, it is removed; if absent, it is added.
335
+ */
336
+ toggleCaption(): void;
337
+ /**
338
+ * @private
339
+ * @description Sets the controller position for a cell.
340
+ * @param {HTMLTableCellElement} tdElement - The target table cell.
341
+ */
342
+ private _setController;
343
+ /**
344
+ * @private
345
+ * @description Sets the position of the cell controller.
346
+ * @param {HTMLTableCellElement} tdElement - The target table cell.
347
+ * @param {boolean} reset - Whether to reset the controller position.
348
+ */
349
+ private _setCellControllerPosition;
350
+ /**
351
+ * @private
352
+ * @description Adds a new entry to the history stack.
353
+ */
354
+ private _historyPush;
355
+ /**
356
+ * @private
357
+ * @description Opens the figure.
358
+ * @param {Node} target - The target figure element.
359
+ */
360
+ private _figureOpen;
361
+ /**
362
+ * @private
363
+ * @description Converts the width of <col> elements to percentages.
364
+ * @param {HTMLTableElement} target - The target table element.
365
+ */
366
+ private _resizePercentCol;
367
+ /**
368
+ * @private
369
+ * @description Starts resizing a table cell.
370
+ * @param {HTMLElement} col The column element.
371
+ * @param {number} startX The starting X position.
372
+ * @param {number} startWidth The initial width of the column.
373
+ * @param {boolean} isLeftEdge Whether the resizing is on the left edge.
374
+ */
375
+ private _startCellResizing;
376
+ /**
377
+ * @private
378
+ * @description Resizes a table cell.
379
+ * @param {HTMLElement} col The column element.
380
+ * @param {HTMLElement} nextCol The next column element.
381
+ * @param {HTMLElement} figure The table figure element.
382
+ * @param {HTMLElement} tdEl The table cell element.
383
+ * @param {HTMLElement} resizeLine The resize line element.
384
+ * @param {boolean} isLeftEdge Whether the resizing is on the left edge.
385
+ * @param {number} startX The starting X position.
386
+ * @param {number} startWidth The initial width of the column.
387
+ * @param {number} prevWidthPercent The previous width percentage.
388
+ * @param {number} nextColWidthPercent The next column's width percentage.
389
+ * @param {number} tableWidth The total width of the table.
390
+ * @param {MouseEvent} e The mouse event.
391
+ */
392
+ private _cellResize;
393
+ /**
394
+ * @private
395
+ * @description Starts resizing a table row.
396
+ * @param {HTMLElement} row The table row element.
397
+ * @param {number} startY The starting Y position.
398
+ * @param {number} startHeight The initial height of the row.
399
+ */
400
+ private _startRowResizing;
401
+ /**
402
+ * @private
403
+ * @description Resizes a table row.
404
+ * @param {HTMLElement} row The table row element.
405
+ * @param {HTMLElement} figure The table figure element.
406
+ * @param {HTMLElement} resizeLine The resize line element.
407
+ * @param {number} startY The starting Y position.
408
+ * @param {number} startHeight The initial height of the row.
409
+ * @param {MouseEvent} e The mouse event.
410
+ */
411
+ private _rowResize;
412
+ /**
413
+ * @private
414
+ * @description Starts resizing the table figure.
415
+ * @param {number} startX The starting X position.
416
+ * @param {boolean} isLeftEdge Whether the resizing is on the left edge.
417
+ */
418
+ private _startFigureResizing;
419
+ /**
420
+ * @private
421
+ * @description Resizes the table figure.
422
+ * @param {HTMLElement} figure The table figure element.
423
+ * @param {HTMLElement} resizeLine The resize line element.
424
+ * @param {boolean} isLeftEdge Whether the resizing is on the left edge.
425
+ * @param {number} startX The starting X position.
426
+ * @param {number} startWidth The initial width of the figure.
427
+ * @param {number} constNum A constant number used for width calculation.
428
+ * @param {MouseEvent} e The mouse event.
429
+ */
430
+ private _figureResize;
431
+ /**
432
+ * @private
433
+ * @description Sets the resize line position.
434
+ * @param {HTMLElement} figure The table figure element.
435
+ * @param {HTMLElement} target The target element.
436
+ * @param {HTMLElement} resizeLine The resize line element.
437
+ * @param {boolean} isLeftEdge Whether the resizing is on the left edge.
438
+ */
439
+ private _setResizeLinePosition;
440
+ /**
441
+ * @private
442
+ * @description Sets the resize row position.
443
+ * @param {HTMLElement} figure The table figure element.
444
+ * @param {HTMLElement} target The target row element.
445
+ * @param {HTMLElement} resizeLine The resize line element.
446
+ */
447
+ private _setResizeRowPosition;
448
+ /**
449
+ * @private
450
+ * @description Stops resizing the table.
451
+ * @param {HTMLElement} target The target element.
452
+ * @param {string} prevValue The previous style value.
453
+ * @param {string} styleProp The CSS property being changed.
454
+ * @param {KeyboardEvent} e The keyboard event.
455
+ */
456
+ private _stopResize;
457
+ /**
458
+ * @private
459
+ * @description Deletes styles from selected table cells.
460
+ */
461
+ private _deleteStyleSelectedCells;
462
+ /**
463
+ * @private
464
+ * @description Restores styles for selected table cells.
465
+ */
466
+ private _recallStyleSelectedCells;
467
+ /**
468
+ * @private
469
+ * @description Adds global event listeners for resizing.
470
+ * @param {(...args: *) => void} resizeFn The function handling the resize event.
471
+ * @param {(...args: *) => void} stopFn The function handling the stop event.
472
+ * @param {(...args: *) => void} keyDownFn The function handling the keydown event.
473
+ */
474
+ private _addResizeGlobalEvents;
475
+ /**
476
+ * @private
477
+ * @description Enables or disables editor mode.
478
+ * @param {boolean} enabled Whether to enable or disable the editor.
479
+ */
480
+ private _toggleEditor;
481
+ /**
482
+ * @private
483
+ * @description Updates control properties.
484
+ * @param {string} type The type of control property.
485
+ */
486
+ private _setCtrlProps;
487
+ /**
488
+ * @private
489
+ * @description Sets text alignment properties.
490
+ * @param {Element} el The element to apply alignment to.
491
+ * @param {string} align The alignment value.
492
+ * @param {boolean} reset Whether to reset the alignment.
493
+ */
494
+ private _setAlignProps;
495
+ /**
496
+ * @private
497
+ * @description Disables or enables border properties.
498
+ * @param {boolean} disabled Whether to disable or enable border properties.
499
+ */
500
+ private _disableBorderProps;
501
+ /**
502
+ * @private
503
+ * @description Gets the border style.
504
+ * @param {string} borderStyle The border style string.
505
+ * @returns {{w: string, s: string, c: string}} The parsed border style object.
506
+ * - w: The border width.
507
+ * - s: The border style.
508
+ * - c: The border color.
509
+ */
510
+ private _getBorderStyle;
511
+ /**
512
+ * @private
513
+ * @description Applies properties to table cells.
514
+ * @param {HTMLButtonElement} target The target element.
515
+ */
516
+ private _submitProps;
517
+ /**
518
+ * @private
519
+ * @description Sets font styles.
520
+ * @param {CSSStyleDeclaration} styles The style object to modify.
521
+ */
522
+ private _setFontStyle;
523
+ /**
524
+ * @private
525
+ * @description Sets border format and styles.
526
+ * @param {{left: Node[], top: Node[], right: Node[], bottom: Node[], all: Node[]}} cells The table cells categorized by border positions.
527
+ * @param {string} borderKey Border style ("all"|"inside"|"horizon"|"vertical"|"outside"|"left"|"top"|"right"|"bottom")
528
+ * @param {string} s The border style value.
529
+ */
530
+ private _setBorderStyles;
531
+ /**
532
+ * @private
533
+ * @description Selects multiple table cells and applies selection styles.
534
+ * @param {Node} startCell The first cell in the selection.
535
+ * @param {Node} endCell The last cell in the selection.
536
+ */
537
+ private _setMultiCells;
538
+ /**
539
+ * @private
540
+ * @description Resets the table picker display.
541
+ */
542
+ private _resetTablePicker;
543
+ /**
544
+ * @private
545
+ * @description Resets the alignment properties for table cells.
546
+ */
547
+ private _resetPropsAlign;
548
+ /**
549
+ * @private
550
+ * @description Handles color selection from the color palette.
551
+ * @param {Node} button The button triggering the color palette.
552
+ * @param {string} type The type of color selection.
553
+ * @param {HTMLInputElement} color Color text input element.
554
+ */
555
+ private _onColorPalette;
556
+ /**
557
+ * @private
558
+ * @description Closes table-related controllers.
559
+ */
560
+ private _closeController;
561
+ /**
562
+ * @private
563
+ * @description Closes table-related controllers and table figure
564
+ */
565
+ private _closeTableSelectInfo;
566
+ /**
567
+ * @private
568
+ * @description Hides the resize line if it is visible.
569
+ */
570
+ private __hideResizeLine;
571
+ /**
572
+ * @private
573
+ * @description Removes global event listeners and resets resize-related properties.
574
+ */
575
+ private __removeGlobalEvents;
576
+ #private;
577
+ }
578
+ import EditorInjector from '../../../editorInjector';
579
+ import { Controller } from '../../../modules';
580
+ import { ColorPicker } from '../../../modules';
581
+ import { Figure } from '../../../modules';
582
+ import { SelectMenu } from '../../../modules';