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,13 +1,6 @@
1
1
  export default Link;
2
- export type LinkPluginOptions = {
3
- /**
4
- * - Whether to display the link text.
5
- */
6
- textToDisplay?: boolean;
7
- /**
8
- * - Whether to display the link title.
9
- */
10
- title?: boolean;
2
+ export type ModalAnchorEditorParams_link = import('../../modules/ModalAnchorEditor').ModalAnchorEditorParams;
3
+ export type LinkOptions = {
11
4
  /**
12
5
  * - The URL endpoint for file uploads.
13
6
  */
@@ -31,16 +24,21 @@ export type LinkPluginOptions = {
31
24
  */
32
25
  acceptedFormats?: string;
33
26
  };
27
+ export type LinkPluginOptions = Omit<LinkOptions & ModalAnchorEditorParams_link, ''>;
28
+ /**
29
+ * @typedef {import('../../modules/ModalAnchorEditor').ModalAnchorEditorParams} ModalAnchorEditorParams_link
30
+ */
34
31
  /**
35
- * @typedef {Object} LinkPluginOptions
36
- * @property {boolean} [textToDisplay=true] - Whether to display the link text.
37
- * @property {boolean} [title=true] - Whether to display the link title.
32
+ * @typedef {Object} LinkOptions
38
33
  * @property {string} [uploadUrl] - The URL endpoint for file uploads.
39
34
  * @property {Object<string, string>} [uploadHeaders] - Additional headers for file upload requests.
40
35
  * @property {number} [uploadSizeLimit] - The total file upload size limit in bytes.
41
36
  * @property {number} [uploadSingleSizeLimit] - The single file upload size limit in bytes.
42
37
  * @property {string} [acceptedFormats] - Accepted file formats for link uploads.
43
38
  */
39
+ /**
40
+ * @typedef {Omit<LinkOptions & ModalAnchorEditorParams_link, ''>} LinkPluginOptions
41
+ */
44
42
  /**
45
43
  * @class
46
44
  * @description Link plugin.
@@ -59,24 +57,43 @@ declare class Link extends EditorInjector {
59
57
  constructor(editor: __se__EditorCore, pluginOptions: LinkPluginOptions);
60
58
  title: any;
61
59
  icon: string;
60
+ target: HTMLAnchorElement;
62
61
  isUpdateState: boolean;
63
62
  pluginOptions: {
64
63
  uploadUrl: string;
65
64
  uploadHeaders: {
66
65
  [x: string]: string;
66
+ } & {
67
+ [x: string]: string;
67
68
  };
68
69
  uploadSizeLimit: number;
69
70
  uploadSingleSizeLimit: number;
70
71
  acceptedFormats: string;
71
72
  enableFileUpload: boolean;
72
73
  /**
73
- * - Whether to display the link text.
74
+ * - Modal title display.
75
+ */
76
+ title?: boolean;
77
+ /**
78
+ * - Create Text to display input.
74
79
  */
75
80
  textToDisplay?: boolean;
76
81
  /**
77
- * - Whether to display the link title.
82
+ * - Default checked value of the "Open in new window" checkbox.
78
83
  */
79
- title?: boolean;
84
+ openNewWindow?: boolean;
85
+ /**
86
+ * - If true, disables the automatic prefixing of the host URL to the value of the link.
87
+ */
88
+ noAutoPrefix?: boolean;
89
+ /**
90
+ * - The "rel" attribute list of anchor tag.
91
+ */
92
+ relList?: Array<string>;
93
+ /**
94
+ * - Default "rel" attributes of anchor tag.
95
+ */
96
+ defaultRel?: import('../../modules/ModalAnchorEditor').RELAttr;
80
97
  };
81
98
  anchor: ModalAnchorEditor;
82
99
  modal: Modal;
@@ -86,6 +103,7 @@ declare class Link extends EditorInjector {
86
103
  * @description Executes the method that is called whenever the cursor position changes.
87
104
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
88
105
  * @returns {boolean} - Whether the plugin is active
106
+ * - If it returns "undefined", it will no longer be called in this scope.
89
107
  */
90
108
  active(element?: (HTMLElement | null) | undefined): boolean;
91
109
  /**
@@ -121,6 +139,7 @@ declare class Link extends EditorInjector {
121
139
  * @description This function is called before the "controller" before it is closed.
122
140
  */
123
141
  close(): void;
142
+ #private;
124
143
  }
125
144
  import EditorInjector from '../../editorInjector';
126
145
  import { ModalAnchorEditor } from '../../modules';
@@ -110,7 +110,6 @@ declare class Math_ extends EditorInjector {
110
110
  /** @type {HTMLSelectElement} */
111
111
  fontSizeElement: HTMLSelectElement;
112
112
  isUpdateState: boolean;
113
- _element: HTMLElement;
114
113
  /**
115
114
  * @editorMethod Editor.component
116
115
  * @description Executes the method that is called when a component of a plugin is selected.
@@ -171,21 +170,6 @@ declare class Math_ extends EditorInjector {
171
170
  * @param {Node} target Target element
172
171
  */
173
172
  destroy(target: Node): void;
174
- /**
175
- * @private
176
- * @description Renders the given math expression using KaTeX or MathJax.
177
- * @param {string} exp - The math expression to render.
178
- * @returns {string} - The rendered math expression as HTML.
179
- */
180
- private _renderer;
181
- /**
182
- * @private
183
- * @description Escapes or unescapes backslashes in a given string.
184
- * @param {string} str - The input string.
185
- * @param {boolean} decode - If true, decodes escaped backslashes; otherwise, encodes them.
186
- * @returns {string} - The processed string.
187
- */
188
- private _escapeBackslashes;
189
173
  #private;
190
174
  }
191
175
  import EditorInjector from '../../editorInjector';
@@ -125,6 +125,14 @@ export type VideoPluginOptions = {
125
125
  * - Figure controls.
126
126
  */
127
127
  controls?: FigureControls_video;
128
+ /**
129
+ * - Component insertion behavior for selection and cursor placement. [default: options.get('componentInsertBehavior')]
130
+ * - `auto`: Move cursor to the next line if possible, otherwise select the component.
131
+ * - `select`: Always select the inserted component.
132
+ * - `line`: Move cursor to the next line if possible, or create a new line and move there.
133
+ * - `none`: Do nothing.
134
+ */
135
+ insertBehavior?: __se__ComponentInsertBehaviorType;
128
136
  };
129
137
  /**
130
138
  * @typedef {import('../../events').VideoInfo} VideoInfo_video
@@ -158,6 +166,11 @@ export type VideoPluginOptions = {
158
166
  * @property {Array<RegExp>} [urlPatterns] - Additional URL patterns for video embedding.
159
167
  * @property {Array<string>} [extensions] - Additional file extensions to be recognized for video uploads.
160
168
  * @property {FigureControls_video} [controls] - Figure controls.
169
+ * @property {__se__ComponentInsertBehaviorType} [insertBehavior] - Component insertion behavior for selection and cursor placement. [default: options.get('componentInsertBehavior')]
170
+ * - `auto`: Move cursor to the next line if possible, otherwise select the component.
171
+ * - `select`: Always select the inserted component.
172
+ * - `line`: Move cursor to the next line if possible, or create a new line and move there.
173
+ * - `none`: Do nothing.
161
174
  */
162
175
  /**
163
176
  * @class
@@ -210,6 +223,7 @@ declare class Video extends EditorInjector {
210
223
  };
211
224
  query_youtube: string;
212
225
  query_vimeo: string;
226
+ insertBehavior: __se__ComponentInsertBehaviorType;
213
227
  };
214
228
  modal: Modal;
215
229
  figure: Figure;
@@ -219,29 +233,11 @@ declare class Video extends EditorInjector {
219
233
  videoUrlFile: HTMLInputElement;
220
234
  focusElement: HTMLInputElement;
221
235
  previewSrc: HTMLElement;
222
- _linkValue: string;
223
- _align: string;
224
- _frameRatio: string;
225
- _defaultRatio: string;
226
- _defaultSizeX: string;
227
- _defaultSizeY: string;
228
236
  sizeUnit: string;
229
237
  proportion: HTMLInputElement;
230
238
  frameRatioOption: HTMLSelectElement;
231
239
  inputX: HTMLInputElement;
232
240
  inputY: HTMLInputElement;
233
- _element: any;
234
- _cover: HTMLElement;
235
- _container: any;
236
- _ratio: {
237
- w: number;
238
- h: number;
239
- };
240
- _origin_w: string;
241
- _origin_h: string;
242
- _resizing: boolean;
243
- _onlyPercentage: boolean;
244
- _nonResizing: boolean;
245
241
  query: {
246
242
  youtube: {
247
243
  pattern: RegExp;
@@ -314,14 +310,6 @@ declare class Video extends EditorInjector {
314
310
  * @param {HTMLIFrameElement|HTMLVideoElement} target Target component element
315
311
  */
316
312
  select(target: HTMLIFrameElement | HTMLVideoElement): void;
317
- /**
318
- * @private
319
- * @description Prepares the component for selection.
320
- * - Ensures that the controller is properly positioned and initialized.
321
- * - Prevents duplicate event handling if the component is already selected.
322
- * @param {HTMLIFrameElement|HTMLVideoElement} target - The selected element.
323
- */
324
- private _ready;
325
313
  /**
326
314
  * @editorMethod Editor.Component
327
315
  * @description Method to delete a component of a plugin, called by the "FileManager", "Controller" module.
@@ -379,6 +367,7 @@ declare class Video extends EditorInjector {
379
367
  * @param {string} align - The alignment to apply to the video element (e.g., 'left', 'center', 'right').
380
368
  * @param {boolean} isUpdate - Indicates whether this is an update to an existing component (true) or a new creation (false).
381
369
  * @param {{name: string, size: number}} file - File metadata associated with the video
370
+ * @param {boolean} isLast - Indicates whether this is the last file in the batch (used for scroll and insert actions).
382
371
  */
383
372
  create(
384
373
  oFrame: HTMLIFrameElement | HTMLVideoElement,
@@ -390,7 +379,8 @@ declare class Video extends EditorInjector {
390
379
  file: {
391
380
  name: string;
392
381
  size: number;
393
- }
382
+ },
383
+ isLast: boolean
394
384
  ): void;
395
385
  /**
396
386
  * @description Creates a new iframe element for video embedding.
@@ -406,19 +396,6 @@ declare class Video extends EditorInjector {
406
396
  * @returns {HTMLVideoElement} The newly created video element.
407
397
  */
408
398
  createVideoTag(props?: { [x: string]: string }): HTMLVideoElement;
409
- /**
410
- * @private
411
- * @description Sets the size of the video element.
412
- * @param {string|number} w - The width of the video.
413
- * @param {string|number} h - The height of the video.
414
- */
415
- private _applySize;
416
- /**
417
- * @private
418
- * @description Retrieves video information including size and alignment.
419
- * @returns {*} Video information object.
420
- */
421
- private _getInfo;
422
399
  /**
423
400
  * @description Create an "video" component using the provided files.
424
401
  * @param {FileList|File[]} fileList File object list
@@ -431,52 +408,6 @@ declare class Video extends EditorInjector {
431
408
  * @returns {Promise<boolean>} If return false, the file upload will be canceled
432
409
  */
433
410
  submitURL(url: string): Promise<boolean>;
434
- /**
435
- * @private
436
- * @description Updates the video component within the editor.
437
- * @param {HTMLIFrameElement|HTMLVideoElement} oFrame - The video element to update.
438
- */
439
- private _update;
440
- /**
441
- * @private
442
- * @description Registers the uploaded video in the editor.
443
- * @param {VideoInfo_video} info - Video information object.
444
- * @param {Object<string, *>} response - Server response containing video data.
445
- */
446
- private _register;
447
- /**
448
- * @private
449
- * @description Uploads a video to the server using an external upload handler.
450
- * @param {VideoInfo_video} info - Video information object.
451
- * @param {FileList} files - The video files to upload.
452
- */
453
- private _serverUpload;
454
- /**
455
- * @private
456
- * @description Sets attributes for the video tag.
457
- * @param {HTMLVideoElement} element - The video element.
458
- */
459
- private _setTagAttrs;
460
- /**
461
- * @private
462
- * @description Sets attributes for the iframe tag.
463
- * @param {HTMLIFrameElement} element - The iframe element.
464
- */
465
- private _setIframeAttrs;
466
- /**
467
- * @private
468
- * @description Selects a ratio option in the ratio dropdown.
469
- * @param {string|number} value - The selected ratio value.
470
- * @returns {boolean} Returns true if a ratio was selected.
471
- */
472
- private _setRatioSelect;
473
- /**
474
- * @private
475
- * @description Handles video upload errors.
476
- * @param {Object<string, *>} response - The error response object.
477
- * @returns {Promise<void>}
478
- */
479
- private _error;
480
411
  #private;
481
412
  }
482
413
  import EditorInjector from '../../editorInjector';
@@ -17,8 +17,6 @@ declare class Anchor extends EditorInjector {
17
17
  title: any;
18
18
  icon: string;
19
19
  bookmarkIcon: HTMLElement;
20
- _element: HTMLElement;
21
- _range: Range;
22
20
  displayId: Element;
23
21
  controllerSelect: Controller;
24
22
  inputEl: HTMLInputElement;
@@ -45,12 +43,7 @@ declare class Anchor extends EditorInjector {
45
43
  * @param {HTMLButtonElement} target Target button element
46
44
  */
47
45
  controllerAction(target: HTMLButtonElement): void;
48
- /**
49
- * @private
50
- * @description Initializes state variables.
51
- * - called when the popup is closed
52
- */
53
- private _init;
46
+ #private;
54
47
  }
55
48
  import EditorInjector from '../../editorInjector';
56
49
  import { Controller } from '../../modules';
@@ -2,50 +2,101 @@ declare namespace _default {
2
2
  /**
3
3
  * Returns the create function with preset options.
4
4
  * If the options overlap, the options of the 'create' function take precedence.
5
- * @param {EditorInitOptions_suneditor} init_options - Initialization options
6
- * @returns {{create: (targets: Element|Object<string, {target: Element, options: EditorFrameOptions_suneditor}>, options: EditorInitOptions_suneditor) => Editor}}}
5
+ * @param {SunEditorOptions} init_options - Initialization options
6
+ * @returns {{create: (targets: Element|Object<string, {target: Element, options: SunEditorFrameOptions}>, options: SunEditorOptions) => Editor}}}
7
7
  */
8
- function init(init_options: EditorInitOptions_suneditor): {
8
+ function init(init_options: SunEditorOptions): {
9
9
  create: (
10
10
  targets:
11
11
  | Element
12
12
  | {
13
13
  [x: string]: {
14
14
  target: Element;
15
- options: EditorFrameOptions_suneditor;
15
+ options: SunEditorFrameOptions;
16
16
  };
17
17
  },
18
- options: EditorInitOptions_suneditor
18
+ options: SunEditorOptions
19
19
  ) => Editor;
20
20
  };
21
21
  /**
22
22
  * Creates a new instance of the SunEditor
23
- * @param {Element|Object<string, {target: Element, options: EditorFrameOptions_suneditor}>} target - Target element or multi-root object
24
- * @param {EditorInitOptions_suneditor} options - Initialization options
25
- * @param {EditorInitOptions_suneditor} [_init_options] - Optional preset initialization options
23
+ * @param {Element|string|Object<string, {target: Element, options: SunEditorFrameOptions}>} target
24
+ * - Element: The direct DOM element to initialize the editor on.
25
+ * - string: A CSS selector string. The corresponding element is selected using `document.querySelector`.
26
+ * - Object: For multi-root setup. Each key maps to a config with `{target, options}`.
27
+ * @param {SunEditorOptions} options - Initialization options
28
+ * @param {SunEditorOptions} [_init_options] - Optional preset initialization options
26
29
  * @returns {Editor} - Instance of the SunEditor
27
30
  * @throws {Error} If the target element is not provided or is invalid
28
31
  */
29
32
  function create(
30
33
  target:
31
34
  | Element
35
+ | string
32
36
  | {
33
37
  [x: string]: {
34
38
  target: Element;
35
- options: EditorFrameOptions_suneditor;
39
+ options: SunEditorFrameOptions;
36
40
  };
37
41
  },
38
- options: EditorInitOptions_suneditor,
39
- _init_options?: EditorInitOptions_suneditor
42
+ options: SunEditorOptions,
43
+ _init_options?: SunEditorOptions
40
44
  ): Editor;
41
45
  }
42
46
  export default _default;
43
- export type EditorFrameOptions_suneditor = import('./core/section/constructor').EditorFrameOptions;
44
- export type EditorInitOptions_suneditor = import('./core/section/constructor').EditorInitOptions;
45
- import EditorInjector from './editorInjector';
46
- import Plugins from './plugins';
47
- import Modules from './modules';
48
- import Langs from './langs';
49
- import Helper from './helper';
47
+ /**
48
+ * Editor initialization options.
49
+ * Used when creating a new editor instance via `SunEditor.create()`.
50
+ */
51
+ export type SunEditorOptions = __se__EditorOptions;
52
+ /**
53
+ * Frame-specific options for multi-root editors.
54
+ * Each frame can have its own width, height, placeholder, and other frame-level settings.
55
+ */
56
+ export type SunEditorFrameOptions = __se__EditorFrameOptions;
57
+ /**
58
+ * Type definition for the SunEditor instance.
59
+ * This is the return type of `SunEditor.create()`.
60
+ */
61
+ export type SunEditorCore = __se__EditorCore;
62
+ /**
63
+ * Information about a component (image, video, table, etc.) in the editor.
64
+ * Contains properties like target element, plugin name, options, and container references.
65
+ */
66
+ export type SunEditorComponentInfo = __se__ComponentInfo;
67
+ /**
68
+ * Parameters passed to plugin mouse event handlers.
69
+ * Includes the frame context and the mouse event object.
70
+ */
71
+ export type SunEditorPluginMouseEvent = __se__PluginMouseEventInfo;
72
+ /**
73
+ * Parameters passed to plugin keyboard event handlers.
74
+ * Includes the frame context, keyboard event, current range, and line element.
75
+ */
76
+ export type SunEditorPluginKeyEvent = __se__PluginKeyEventInfo;
77
+ /**
78
+ * Parameters passed when a toolbar input value changes.
79
+ * Includes the target input element, event object, and the new value.
80
+ */
81
+ export type SunEditorPluginToolbarInputChange = __se__PluginToolbarInputChangeEventInfo;
82
+ /**
83
+ * Information passed to shortcut handlers.
84
+ * Includes range, line element, shortcut info, event object, and key code.
85
+ */
86
+ export type SunEditorPluginShortcut = __se__PluginShortcutInfo;
87
+ /**
88
+ * Parameters passed to plugin paste event handlers.
89
+ * Includes frame context, clipboard event, cleaned HTML data, and parsed document.
90
+ */
91
+ export type SunEditorPluginPaste = __se__PluginPasteParams;
92
+ /**
93
+ * Parameters passed when copying a component.
94
+ * Includes the clipboard event, cloned container, and component info.
95
+ */
96
+ export type SunEditorPluginCopyComponent = __se__PluginCopyComponentParams;
50
97
  import Editor from './core/editor';
51
- export { EditorInjector, Plugins, Modules, Langs, Helper };
98
+ import helper from './helper';
99
+ import langs from './langs';
100
+ import modules from './modules';
101
+ import plugins from './plugins';
102
+ export { helper, langs, modules, plugins };
@@ -4,7 +4,60 @@ declare global {
4
4
  type __se__NodeCollection = Array<Node> | HTMLCollection | NodeList;
5
5
  type __se__EditorCore = import('./core/editor').default;
6
6
  type __se__EditorInjector = import('./editorInjector').default;
7
- type __se__CoreInjector = import('./editorInjector/_core').default;
7
+ type __se__EditorOptions = import('./core/config/options').EditorInitOptions;
8
+ type __se__EditorFrameOptions = import('./core/config/options').EditorFrameOptions;
9
+ type __se__FrameContext = import('./core/config/frameContext').FrameContextUtil;
10
+ type __se__Context = Map<keyof import('./core/config/context').ContextUtil, any>;
11
+ type __se__EditorStatus = {
12
+ /**
13
+ * Boolean value of whether the editor has focus
14
+ */
15
+ hasFocus: boolean;
16
+ /**
17
+ * Indent size of tab (4)
18
+ */
19
+ tabSize: number;
20
+ /**
21
+ * Indent size (25)px
22
+ */
23
+ indentSize: number;
24
+ /**
25
+ * Indent size of Code view mode (2)
26
+ */
27
+ codeIndentSize: number;
28
+ /**
29
+ * An element array of the current cursor's node structure
30
+ */
31
+ currentNodes: Array<string>;
32
+ /**
33
+ * An element name array of the current cursor's node structure
34
+ */
35
+ currentNodesMap: Array<string>;
36
+ /**
37
+ * Current visual viewport height size
38
+ */
39
+ currentViewportHeight: number;
40
+ /**
41
+ * Height of the initial visual viewport height size
42
+ */
43
+ initViewportHeight: number;
44
+ /**
45
+ * Boolean value of whether component is selected
46
+ */
47
+ onSelected: boolean;
48
+ /**
49
+ * Current root key
50
+ */
51
+ rootKey: any;
52
+ /**
53
+ * Current range object
54
+ */
55
+ _range: Range;
56
+ /**
57
+ * Mouse down event status
58
+ */
59
+ _onMousedown: boolean;
60
+ };
8
61
  type __se__ComponentInfo = {
9
62
  /**
10
63
  * - The target element associated with the component.
@@ -49,48 +102,7 @@ declare global {
49
102
  */
50
103
  isInputType: boolean;
51
104
  };
52
- type __se__EditorStatus = {
53
- /**
54
- * Boolean value of whether the editor has focus
55
- */
56
- hasFocus: boolean;
57
- /**
58
- * Indent size of tab (4)
59
- */
60
- tabSize: number;
61
- /**
62
- * Indent size (25)px
63
- */
64
- indentSize: number;
65
- /**
66
- * Indent size of Code view mode (2)
67
- */
68
- codeIndentSize: number;
69
- /**
70
- * An element array of the current cursor's node structure
71
- */
72
- currentNodes: Array<string>;
73
- /**
74
- * An element name array of the current cursor's node structure
75
- */
76
- currentNodesMap: Array<string>;
77
- /**
78
- * Boolean value of whether component is selected
79
- */
80
- onSelected: boolean;
81
- /**
82
- * Current root key
83
- */
84
- rootKey: number;
85
- /**
86
- * Current range object
87
- */
88
- _range: Range;
89
- /**
90
- * Mouse down event status
91
- */
92
- _onMousedown: boolean;
93
- };
105
+ type __se__ComponentInsertBehaviorType = 'auto' | 'select' | 'line' | 'none';
94
106
  type __se__EventInfo = {
95
107
  /**
96
108
  * Target element
@@ -226,8 +238,10 @@ declare global {
226
238
  */
227
239
  info: __se__ComponentInfo;
228
240
  };
229
- type __se__FrameOptions = Map<string, any>;
230
- type __se__FrameContext = Map<string, any>;
231
- type __se__Context = Map<string, any>;
241
+ type __se__FrameOptions = import('./core/config/options').FrameOptionsMap;
242
+ type __se__BaseOptions = import('./core/config/options').BaseOptionsMap;
232
243
  type __se__Class_OffsetGlobalInfo = import('./core/class/offset').OffsetGlobalInfo;
244
+ type __se__EventKeydownCtx = import('./core/event/reducers/keydown.reducer').KeydownReducerCtx;
245
+ type __se__EventActions = import('./core/event/actions').Action[];
246
+ type __se__EventPorts = import('./core/event/ports').EventReducerPorts;
233
247
  }