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
@@ -44,6 +44,18 @@ export type HueSliderParams = {
44
44
  */
45
45
  controllerOptions?: ControllerParams_hueSlider;
46
46
  };
47
+ export function CreateSliderCtx(): {
48
+ slider: HTMLElement;
49
+ offscreenCanvas: HTMLCanvasElement;
50
+ offscreenCtx: CanvasRenderingContext2D;
51
+ wheel: HTMLCanvasElement;
52
+ wheelCtx: CanvasRenderingContext2D;
53
+ wheelPointer: HTMLElement;
54
+ gradientBar: HTMLCanvasElement;
55
+ gradientPointer: HTMLElement;
56
+ fanalColorHex: HTMLElement;
57
+ fanalColorBackground: HTMLElement;
58
+ };
47
59
  /**
48
60
  * @typedef {import('../modules/Controller').ControllerParams} ControllerParams_hueSlider
49
61
  */
@@ -100,9 +112,6 @@ declare class HueSlider {
100
112
  };
101
113
  isOpen: boolean;
102
114
  controlle: any;
103
- __globalMouseDown: any;
104
- __globalMouseMove: any;
105
- __globalMouseUp: any;
106
115
  controller: Controller;
107
116
  /**
108
117
  * @description Get the current color information.
@@ -132,5 +141,6 @@ declare class HueSlider {
132
141
  * @description Initialize the hue slider information.
133
142
  */
134
143
  init(): void;
144
+ #private;
135
145
  }
136
146
  import Controller from './Controller';
@@ -53,26 +53,6 @@ declare class Modal extends CoreInjector {
53
53
  isUpdate: boolean;
54
54
  /** @type {HTMLInputElement} */
55
55
  focusElement: HTMLInputElement;
56
- /** @type {HTMLElement} */
57
- _modalArea: HTMLElement;
58
- /** @type {HTMLElement} */
59
- _modalInner: HTMLElement;
60
- _closeListener: any[];
61
- _bindClose: any;
62
- _onClickEvent: any;
63
- _closeSignal: boolean;
64
- /** @type {HTMLElement} */
65
- _resizeBody: HTMLElement;
66
- _currentHandle: HTMLElement;
67
- __resizeDir: string;
68
- __offetTop: number;
69
- __offetLeft: number;
70
- __globalEventHandlers: {
71
- mousemove: any;
72
- mouseup: any;
73
- };
74
- _bindClose_mousemove: any;
75
- _bindClose_mouseup: any;
76
56
  /**
77
57
  * @description Open a modal plugin
78
58
  * - The plugin's "init" method is called.
@@ -83,29 +63,6 @@ declare class Modal extends CoreInjector {
83
63
  * - The plugin's "init" and "off" method is called.
84
64
  */
85
65
  close(): void;
86
- /**
87
- * @private
88
- * @description Fixes the current controller's display state when the modal is opened or closed.
89
- * @param {boolean} fixed - Whether to fix or unfix the controller.
90
- */
91
- private _fixCurrentController;
92
- /**
93
- * @private
94
- * @description Saves the current offset position of the modal for resizing calculations.
95
- * @returns {__se__Class_OffsetGlobalInfo} The offset position of the modal.
96
- */
97
- private _saveOffset;
98
- /**
99
- * @private
100
- * @description Adds global event listeners for resizing the modal.
101
- * @param {string} dir - The direction in which resizing is occurring.
102
- */
103
- private __addGlobalEvent;
104
- /**
105
- * @private
106
- * @description Removes global event listeners related to modal resizing.
107
- */
108
- private __removeGlobalEvent;
109
66
  #private;
110
67
  }
111
68
  import CoreInjector from '../editorInjector/_core';
@@ -110,7 +110,6 @@ declare class ModalAnchorEditor extends EditorInjector {
110
110
  fileManager: FileManager;
111
111
  kink: any;
112
112
  inst: any;
113
- modalForm: HTMLElement;
114
113
  host: string;
115
114
  /** @type {HTMLInputElement} */
116
115
  urlInput: HTMLInputElement;
@@ -133,14 +132,10 @@ declare class ModalAnchorEditor extends EditorInjector {
133
132
  currentRel: any[];
134
133
  currentTarget: HTMLAnchorElement;
135
134
  linkValue: string;
136
- _change: boolean;
137
- _isRel: boolean;
138
135
  /** @type {HTMLButtonElement} */
139
136
  relButton: HTMLButtonElement;
140
137
  /** @type {HTMLElement} */
141
138
  relPreview: HTMLElement;
142
- selectMenu_rel: SelectMenu;
143
- selectMenu_bookmark: SelectMenu;
144
139
  /**
145
140
  * @description Initialize.
146
141
  * - Sets the current anchor element to be edited.
@@ -162,75 +157,7 @@ declare class ModalAnchorEditor extends EditorInjector {
162
157
  * @description Resets the ModalAnchorEditor to its initial state.
163
158
  */
164
159
  init(): void;
165
- /**
166
- * @private
167
- * @description Updates the anchor element with new attributes.
168
- * @param {HTMLAnchorElement} anchor - The anchor (`<a>`) element to update.
169
- * @param {string} url - The URL for the anchor's `href` attribute.
170
- * @param {string} displayText - The text to be displayed inside the anchor.
171
- * @param {string} title - The tooltip text (title attribute).
172
- * @param {boolean} notText - If `true`, the anchor will not contain text content.
173
- */
174
- private _updateAnchor;
175
- /**
176
- * @private
177
- * @description Checks if the given path is an internal bookmark.
178
- * @param {string} path - The URL or anchor link.
179
- * @returns {boolean} - `true` if the path is an internal bookmark, otherwise `false`.
180
- */
181
- private _selfPathBookmark;
182
- /**
183
- * @private
184
- * @description Updates the `rel` attribute list in the modal and preview.
185
- * @param {string} relAttr - The `rel` attribute string to set.
186
- */
187
- private _setRel;
188
- /**
189
- * @private
190
- * @description Generates a list of bookmark headers within the editor.
191
- * @param {string} urlValue - The current URL input value.
192
- */
193
- private _createBookmarkList;
194
- /**
195
- * @private
196
- * @description Updates the preview of the anchor link.
197
- * @param {string} value - The current URL value.
198
- */
199
- private _setLinkPreview;
200
- /**
201
- * @private
202
- * @description Merges the given `rel` attribute value with the current list.
203
- * @param {string} relAttr - The `rel` attribute to merge.
204
- * @returns {string} - The updated `rel` attribute string.
205
- */
206
- private _relMerge;
207
- /**
208
- * @private
209
- * @description Removes the specified `rel` attribute from the current list.
210
- * @param {string} relAttr - The `rel` attribute to remove.
211
- * @returns {string} - The updated `rel` attribute string.
212
- */
213
- private _relDelete;
214
- /**
215
- * @private
216
- * @description Registers a newly uploaded file and sets its URL in the modal form.
217
- * @param {Object<string, *>} response - The response object from the file upload request.
218
- */
219
- private _register;
220
- /**
221
- * @private
222
- * @description Handles file upload errors.
223
- * @param {Object<string, *>} response - The error response object.
224
- * @returns {Promise<void>}
225
- */
226
- private _error;
227
- /**
228
- * @description Handles the callback after a file upload completes.
229
- * @param {XMLHttpRequest} xmlHttp - The XMLHttpRequest object containing the response.
230
- */
231
- _uploadCallBack(xmlHttp: XMLHttpRequest): void;
232
160
  #private;
233
161
  }
234
162
  import EditorInjector from '../editorInjector';
235
163
  import FileManager from './FileManager';
236
- import SelectMenu from './SelectMenu';
@@ -58,37 +58,10 @@ declare class SelectMenu extends CoreInjector {
58
58
  checkList: boolean;
59
59
  position: string;
60
60
  subPosition: string;
61
- _dirPosition: string;
62
- _dirSubPosition: string;
63
- _textDirDiff: boolean;
64
61
  splitNum: number;
65
62
  horizontal: boolean;
66
63
  openMethod: () => void;
67
64
  closeMethod: () => void;
68
- _refer: HTMLElement;
69
- _keydownTarget: Window | HTMLInputElement;
70
- _selectMethod: (command: string) => void;
71
- _bindClose_key: any;
72
- _bindClose_mousedown: any;
73
- _bindClose_click: any;
74
- _closeSignal: boolean;
75
- __events: {
76
- mousedown: any;
77
- mousemove: any;
78
- click: any;
79
- keydown: any;
80
- };
81
- __eventHandlers: {
82
- mousedown: any;
83
- mousemove: any;
84
- click: any;
85
- keydown: any;
86
- };
87
- __globalEventHandlers: {
88
- keydown: any;
89
- mousedown: any;
90
- click: any;
91
- };
92
65
  /**
93
66
  * @description Creates the select menu items.
94
67
  * @param {Array<string>|__se__NodeCollection} items - Command list of selectable items.
@@ -130,65 +103,7 @@ declare class SelectMenu extends CoreInjector {
130
103
  * @param {number} index Item index
131
104
  */
132
105
  setItem(index: number): void;
133
- /**
134
- * @private
135
- * @description Appends a formatted list of items to the menu.
136
- * @param {string} html - The HTML string representing the menu items.
137
- */
138
- private _createFormat;
139
- /**
140
- * @private
141
- * @description Resets the menu state and removes event listeners.
142
- */
143
- private _init;
144
106
  _onItem: Element;
145
- /**
146
- * @private
147
- * @description Moves the selection up or down by a specified number of items.
148
- * @param {number} num - The number of items to move (negative for up, positive for down).
149
- */
150
- private _moveItem;
151
- /**
152
- * @private
153
- * @description Highlights and selects an item by index.
154
- * @param {number} selectIndex - The index of the item to select.
155
- */
156
- private _selectItem;
157
- /**
158
- * @private
159
- * @description Sets the position of the select menu relative to the reference element.
160
- * @param {string} position Menu position ("left"|"right") | ("top"|"bottom")
161
- * @param {string} subPosition Sub position ("middle"|"top"|"bottom") | ("center"|"left"|"right")
162
- * @param {string} [onItemQuerySelector] - A query selector string to highlight a specific item.
163
- * @param {boolean} [_re=false] - Whether this is a retry after adjusting the position.
164
- */
165
- private _setPosition;
166
- /**
167
- * @private
168
- * @description Selects an item and triggers the callback function.
169
- * @param {number} index - The index of the item to select.
170
- */
171
- private _select;
172
- /**
173
- * @private
174
- * @description Adds event listeners for menu interactions.
175
- */
176
- private __addEvents;
177
- /**
178
- * @private
179
- * @description Removes event listeners for menu interactions.
180
- */
181
- private __removeEvents;
182
- /**
183
- * @private
184
- * @description Adds global event listeners for closing the menu.
185
- */
186
- private __addGlobalEvent;
187
- /**
188
- * @private
189
- * @description Removes global event listeners for closing the menu.
190
- */
191
- private __removeGlobalEvent;
192
107
  #private;
193
108
  }
194
109
  import CoreInjector from '../editorInjector/_core';
@@ -14,13 +14,13 @@ declare namespace _default {
14
14
  export default _default;
15
15
  import _DragHandle from './_DragHandle';
16
16
  import ApiManager from './ApiManager';
17
+ import Browser from './Browser';
17
18
  import ColorPicker from './ColorPicker';
18
19
  import Controller from './Controller';
19
- import Browser from './Browser';
20
+ import Figure from './Figure';
20
21
  import FileManager from './FileManager';
21
22
  import HueSlider from './HueSlider';
22
- import Figure from './Figure';
23
23
  import Modal from './Modal';
24
24
  import ModalAnchorEditor from './ModalAnchorEditor';
25
25
  import SelectMenu from './SelectMenu';
26
- export { _DragHandle, ApiManager, ColorPicker, Controller, Browser, FileManager, HueSlider, Figure, Modal, ModalAnchorEditor, SelectMenu };
26
+ export { _DragHandle, ApiManager, Browser, ColorPicker, Controller, Figure, FileManager, HueSlider, Modal, ModalAnchorEditor, SelectMenu };
@@ -1,8 +1,35 @@
1
1
  export default AudioGallery;
2
2
  export type BrowserFile_audioGallery = import('../../modules/Browser').BrowserFile;
3
+ export type AudioGalleryPluginOptions = {
4
+ /**
5
+ * - Direct data without server calls
6
+ */
7
+ data?: Array<BrowserFile_audioGallery>;
8
+ /**
9
+ * - Server request URL
10
+ */
11
+ url?: string;
12
+ /**
13
+ * - Server request headers
14
+ */
15
+ headers?: {
16
+ [x: string]: string;
17
+ };
18
+ /**
19
+ * - Default thumbnail
20
+ */
21
+ thumbnail?: string | ((item: BrowserFile_audioGallery) => string);
22
+ };
3
23
  /**
4
24
  * @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_audioGallery
5
25
  */
26
+ /**
27
+ * @typedef {Object} AudioGalleryPluginOptions
28
+ * @property {Array<BrowserFile_audioGallery>} [data] - Direct data without server calls
29
+ * @property {string} [url] - Server request URL
30
+ * @property {Object<string, string>} [headers] - Server request headers
31
+ * @property {string|((item: BrowserFile_audioGallery) => string)} [thumbnail] - Default thumbnail
32
+ */
6
33
  /**
7
34
  * @class
8
35
  * @extends EditorInjector
@@ -15,25 +42,9 @@ declare class AudioGallery extends EditorInjector {
15
42
  /**
16
43
  * @constructor
17
44
  * @param {__se__EditorCore} editor - The root editor instance
18
- * @param {Object} pluginOptions
19
- * @param {Array<*>=} pluginOptions.data - direct data without server calls
20
- * @param {string} pluginOptions.url - server request url
21
- * @param {Object<string, string>=} pluginOptions.headers - server request headers
22
- * @param {string|((item: BrowserFile_audioGallery) => string)} pluginOptions.thumbnail - default thumbnail
45
+ * @param {AudioGalleryPluginOptions} pluginOptions
23
46
  */
24
- constructor(
25
- editor: __se__EditorCore,
26
- pluginOptions: {
27
- data?: Array<any> | undefined;
28
- url: string;
29
- headers?:
30
- | {
31
- [x: string]: string;
32
- }
33
- | undefined;
34
- thumbnail: string | ((item: BrowserFile_audioGallery) => string);
35
- }
36
- );
47
+ constructor(editor: __se__EditorCore, pluginOptions: AudioGalleryPluginOptions);
37
48
  title: any;
38
49
  icon: string;
39
50
  onSelectfunction: (targe: Node) => any;
@@ -1,8 +1,44 @@
1
1
  export default FileBrowser;
2
2
  export type BrowserFile_fileBrowser = import('../../modules/Browser').BrowserFile;
3
+ export type FileBrowserPluginOptions = {
4
+ /**
5
+ * - Direct data without server calls
6
+ */
7
+ data?:
8
+ | {
9
+ [x: string]: any;
10
+ }
11
+ | Array<any>;
12
+ /**
13
+ * - Server request URL
14
+ */
15
+ url?: string;
16
+ /**
17
+ * - Server request headers
18
+ */
19
+ headers?: {
20
+ [x: string]: string;
21
+ };
22
+ /**
23
+ * - Default thumbnail
24
+ */
25
+ thumbnail?: string | ((item: BrowserFile_fileBrowser) => string);
26
+ /**
27
+ * - Additional tag names
28
+ */
29
+ props?: Array<string>;
30
+ };
3
31
  /**
4
32
  * @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_fileBrowser
5
33
  */
34
+ /**
35
+ * @typedef {Object} FileBrowserPluginOptions
36
+ * @property {Object<string, *>|Array<*>} [data] - Direct data without server calls
37
+ * @property {string} [url] - Server request URL
38
+ * @property {Object<string, string>} [headers] - Server request headers
39
+ * @property {string|((item: BrowserFile_fileBrowser) => string)} [thumbnail] - Default thumbnail
40
+ * @property {Array<string>} [props] - Additional tag names
41
+ */
6
42
  /**
7
43
  * @class
8
44
  * @extends EditorInjector
@@ -15,34 +51,9 @@ declare class FileBrowser extends EditorInjector {
15
51
  /**
16
52
  * @constructor
17
53
  * @param {__se__EditorCore} editor - The root editor instance
18
- * @param {Object} pluginOptions
19
- * @param {Object<string, *>|Array<*>=} pluginOptions.data - direct data without server calls
20
- * @param {string} pluginOptions.url - server request url
21
- * @param {Object<string, string>=} pluginOptions.headers - server request headers
22
- * @param {string|((item: BrowserFile_fileBrowser) => string)} pluginOptions.thumbnail - default thumbnail
23
- * @param {Array<string>} pluginOptions.props - additional tag names
54
+ * @param {FileBrowserPluginOptions} pluginOptions
24
55
  */
25
- constructor(
26
- editor: __se__EditorCore,
27
- pluginOptions: {
28
- data?:
29
- | (
30
- | {
31
- [x: string]: any;
32
- }
33
- | Array<any>
34
- )
35
- | undefined;
36
- url: string;
37
- headers?:
38
- | {
39
- [x: string]: string;
40
- }
41
- | undefined;
42
- thumbnail: string | ((item: BrowserFile_fileBrowser) => string);
43
- props: Array<string>;
44
- }
45
- );
56
+ constructor(editor: __se__EditorCore, pluginOptions: FileBrowserPluginOptions);
46
57
  title: any;
47
58
  icon: string;
48
59
  onSelectfunction: (targe: Node) => any;
@@ -1,8 +1,35 @@
1
1
  export default FileGallery;
2
2
  export type BrowserFile_fileGallery = import('../../modules/Browser').BrowserFile;
3
+ export type FileGalleryPluginOptions = {
4
+ /**
5
+ * - Direct data without server calls
6
+ */
7
+ data?: Array<BrowserFile_fileGallery>;
8
+ /**
9
+ * - Server request URL
10
+ */
11
+ url?: string;
12
+ /**
13
+ * - Server request headers
14
+ */
15
+ headers?: {
16
+ [x: string]: string;
17
+ };
18
+ /**
19
+ * - Default thumbnail
20
+ */
21
+ thumbnail?: string | ((item: BrowserFile_fileGallery) => string);
22
+ };
3
23
  /**
4
24
  * @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_fileGallery
5
25
  */
26
+ /**
27
+ * @typedef {Object} FileGalleryPluginOptions
28
+ * @property {Array<BrowserFile_fileGallery>} [data] - Direct data without server calls
29
+ * @property {string} [url] - Server request URL
30
+ * @property {Object<string, string>} [headers] - Server request headers
31
+ * @property {string|((item: BrowserFile_fileGallery) => string)} [thumbnail] - Default thumbnail
32
+ */
6
33
  /**
7
34
  * @class
8
35
  * @extends EditorInjector
@@ -15,25 +42,9 @@ declare class FileGallery extends EditorInjector {
15
42
  /**
16
43
  * @constructor
17
44
  * @param {__se__EditorCore} editor - The root editor instance
18
- * @param {Object} pluginOptions
19
- * @param {Array<*>=} pluginOptions.data - direct data without server calls
20
- * @param {string} pluginOptions.url - server request url
21
- * @param {Object<string, string>=} pluginOptions.headers - server request headers
22
- * @param {string|((item: BrowserFile_fileGallery) => string)} pluginOptions.thumbnail - default thumbnail
45
+ * @param {FileGalleryPluginOptions} pluginOptions
23
46
  */
24
- constructor(
25
- editor: __se__EditorCore,
26
- pluginOptions: {
27
- data?: Array<any> | undefined;
28
- url: string;
29
- headers?:
30
- | {
31
- [x: string]: string;
32
- }
33
- | undefined;
34
- thumbnail: string | ((item: BrowserFile_fileGallery) => string);
35
- }
36
- );
47
+ constructor(editor: __se__EditorCore, pluginOptions: FileGalleryPluginOptions);
37
48
  title: any;
38
49
  icon: string;
39
50
  onSelectfunction: (targe: Node) => any;
@@ -1,4 +1,26 @@
1
1
  export default ImageGallery;
2
+ export type ImageGalleryPluginOptions = {
3
+ /**
4
+ * - Direct data without server calls
5
+ */
6
+ data?: Array<any>;
7
+ /**
8
+ * - Server request URL
9
+ */
10
+ url?: string;
11
+ /**
12
+ * - Server request headers
13
+ */
14
+ headers?: {
15
+ [x: string]: string;
16
+ };
17
+ };
18
+ /**
19
+ * @typedef ImageGalleryPluginOptions
20
+ * @property {Array<*>} [data] - Direct data without server calls
21
+ * @property {string} [url] - Server request URL
22
+ * @property {Object<string, string>} [headers] - Server request headers
23
+ */
2
24
  /**
3
25
  * @class
4
26
  * @extends EditorInjector
@@ -11,23 +33,9 @@ declare class ImageGallery extends EditorInjector {
11
33
  /**
12
34
  * @constructor
13
35
  * @param {__se__EditorCore} editor - The root editor instance
14
- * @param {Object} pluginOptions
15
- * @param {Array<*>=} pluginOptions.data - direct data without server calls
16
- * @param {string=} pluginOptions.url - server request url
17
- * @param {Object<string, string>=} pluginOptions.headers - server request headers
36
+ * @param {ImageGalleryPluginOptions} pluginOptions
18
37
  */
19
- constructor(
20
- editor: __se__EditorCore,
21
- pluginOptions: {
22
- data?: Array<any> | undefined;
23
- url?: string | undefined;
24
- headers?:
25
- | {
26
- [x: string]: string;
27
- }
28
- | undefined;
29
- }
30
- );
38
+ constructor(editor: __se__EditorCore, pluginOptions: ImageGalleryPluginOptions);
31
39
  title: any;
32
40
  icon: string;
33
41
  onSelectfunction: (targe: Node) => any;
@@ -1,8 +1,35 @@
1
1
  export default VideoGallery;
2
2
  export type BrowserFile_videoGallery = import('../../modules/Browser').BrowserFile;
3
+ export type VideoGalleryPluginOptions = {
4
+ /**
5
+ * - Direct data without server calls
6
+ */
7
+ data?: Array<BrowserFile_videoGallery>;
8
+ /**
9
+ * - Server request URL
10
+ */
11
+ url?: string;
12
+ /**
13
+ * - Server request headers
14
+ */
15
+ headers?: {
16
+ [x: string]: string;
17
+ };
18
+ /**
19
+ * - Default thumbnail
20
+ */
21
+ thumbnail?: string | ((item: BrowserFile_videoGallery) => string);
22
+ };
3
23
  /**
4
24
  * @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_videoGallery
5
25
  */
26
+ /**
27
+ * @typedef {Object} VideoGalleryPluginOptions
28
+ * @property {Array<BrowserFile_videoGallery>} [data] - Direct data without server calls
29
+ * @property {string} [url] - Server request URL
30
+ * @property {Object<string, string>} [headers] - Server request headers
31
+ * @property {string|((item: BrowserFile_videoGallery) => string)} [thumbnail] - Default thumbnail
32
+ */
6
33
  /**
7
34
  * @class
8
35
  * @extends EditorInjector
@@ -15,25 +42,9 @@ declare class VideoGallery extends EditorInjector {
15
42
  /**
16
43
  * @constructor
17
44
  * @param {__se__EditorCore} editor - The root editor instance
18
- * @param {Object} pluginOptions
19
- * @param {Array<*>=} pluginOptions.data - direct data without server calls
20
- * @param {string=} pluginOptions.url - server request url
21
- * @param {Object<string, string>=} pluginOptions.headers - server request headers
22
- * @param {string|((item: BrowserFile_videoGallery) => string)} pluginOptions.thumbnail - default thumbnail
45
+ * @param {VideoGalleryPluginOptions} pluginOptions
23
46
  */
24
- constructor(
25
- editor: __se__EditorCore,
26
- pluginOptions: {
27
- data?: Array<any> | undefined;
28
- url?: string | undefined;
29
- headers?:
30
- | {
31
- [x: string]: string;
32
- }
33
- | undefined;
34
- thumbnail: string | ((item: BrowserFile_videoGallery) => string);
35
- }
36
- );
47
+ constructor(editor: __se__EditorCore, pluginOptions: VideoGalleryPluginOptions);
37
48
  title: any;
38
49
  icon: string;
39
50
  onSelectfunction: (targe: Node) => any;
@@ -16,6 +16,7 @@ declare class Blockquote extends EditorInjector {
16
16
  * @param {?HTMLElement=} element - Node element where the cursor is currently located
17
17
  * @param {?HTMLElement=} target - The plugin's toolbar button element
18
18
  * @returns {boolean} - Whether the plugin is active
19
+ * - If it returns "undefined", it will no longer be called in this scope.
19
20
  */
20
21
  active(element?: (HTMLElement | null) | undefined, target?: (HTMLElement | null) | undefined): boolean;
21
22
  /**