suneditor 3.0.0-alpha.9 → 3.0.0-beta.2

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