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
@@ -5,48 +5,38 @@
5
5
  * @param {Element|null} button Command button element
6
6
  * @param {Map<string, *>} keyMap Map to store shortcut key info
7
7
  * @param {Array} rc "_reverseCommandArray" option
8
- * @param {Array} reverseKeys Reverse key array
8
+ * @param {Set} reverseKeys Reverse key array
9
+ */
10
+ export function CreateShortcuts(command: string, button: Element | null, values: Array<string>, keyMap: Map<string, any>, rc: any[], reverseKeys: Set<any>): void;
11
+ /**
12
+ * @typedef {Object} InitOptionsReturnType
13
+ * @property {__se__BaseOptions} o - Processed base options (Map containing {@link AllBaseOptions_constructor} keys)
14
+ * @property {Object<string, string>} i - Icon set
15
+ * @property {Object<string, string>} l - Language pack
16
+ * @property {string|null} v - Initial editor value
17
+ * @property {Array<string[]|string>} buttons - Toolbar button list (arrays for groups, strings for single buttons)
18
+ * @property {Array<string[]|string>|null} subButtons - Sub-toolbar button list
19
+ * @property {Element|null} statusbarContainer - Container element for status bar (if specified)
20
+ * @property {Map<string|null, __se__FrameOptions>} frameMap - Map of frame-specific options (frame key => {@link __se__FrameOptions})
9
21
  */
10
- export function CreateShortcuts(command: string, button: Element | null, values: Array<string>, keyMap: Map<string, any>, rc: any[], reverseKeys: any[]): void;
11
22
  /**
12
23
  * @description Initialize options
13
- * @param {EditorInitOptions} options Configuration options for the editor.
14
- * @param {Array<{target: Element, key: *, options: EditorFrameOptions}>} editorTargets Target textarea
24
+ * @param {__se__EditorOptions} options Configuration options for the editor.
25
+ * @param {Array<{target: Element, key: *, options: __se__EditorFrameOptions}>} editorTargets Target textarea
15
26
  * @param {Object<string, *>} plugins Plugins object
16
- * @returns {{o: Map<string, *>, i: Object<string, string>, l: Object<string, string>, v: string, buttons: Array<string[]|string>, subButtons: Array<string[]|string>, statusbarContainer: Element|null, frameMap: Map<*, *>}}
17
- * - o: options
18
- * - i: icons
19
- * - l: lang
20
- * - v: value
21
- * - buttons: Toolbar button list
22
- * - subButtons: Sub-Toolbar button list
23
- * - statusbarContainer: statusbar container
24
- * - frameMap: converted options map
27
+ * @returns {InitOptionsReturnType} Initialized options and configuration
25
28
  */
26
29
  export function InitOptions(
27
- options: EditorInitOptions,
30
+ options: __se__EditorOptions,
28
31
  editorTargets: Array<{
29
32
  target: Element;
30
33
  key: any;
31
- options: EditorFrameOptions;
34
+ options: __se__EditorFrameOptions;
32
35
  }>,
33
36
  plugins: {
34
37
  [x: string]: any;
35
38
  }
36
- ): {
37
- o: Map<string, any>;
38
- i: {
39
- [x: string]: string;
40
- };
41
- l: {
42
- [x: string]: string;
43
- };
44
- v: string;
45
- buttons: Array<string[] | string>;
46
- subButtons: Array<string[] | string>;
47
- statusbarContainer: Element | null;
48
- frameMap: Map<any, any>;
49
- };
39
+ ): InitOptionsReturnType;
50
40
  /**
51
41
  * @description Create a context object for the editor frame.
52
42
  * @param {Map<string, *>} targetOptions - editor.frameOptions
@@ -117,668 +107,148 @@ export function CreateToolBar(
117
107
  key: string;
118
108
  }>;
119
109
  };
120
- /**
121
- * @typedef {Object} EditorFrameOptions
122
- * @property {string} [value=""] - Initial value for the editor.
123
- * @property {string} [placeholder=""] - Placeholder text.
124
- * @property {Object<string, string>} [editableFrameAttributes={}] - Attributes for the editable frame[.sun-editor-editable]. (e.g. [key]: value)
125
- * @property {string} [width="100%"] - Width for the editor.
126
- * @property {string} [minWidth=""] - Min width for the editor.
127
- * @property {string} [maxWidth=""] - Max width for the editor.
128
- * @property {string} [height="auto"] - Height for the editor.
129
- * @property {string} [minHeight=""] - Min height for the editor.
130
- * @property {string} [maxHeight=""] - Max height for the editor.
131
- * @property {string} [editorStyle=""] - Style string of the top frame of the editor. (e.g. "border: 1px solid #ccc;").
132
- * @property {boolean} [iframe=false] - Content will be placed in an iframe and isolated from the rest of the page.
133
- * @property {boolean} [iframe_fullPage=false] - Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration on the "iframe".
134
- * @property {Object<string, string>} [iframe_attributes={}] - Attributes of the "iframe". (e.g. {'scrolling': 'no'})
135
- * @property {string} [iframe_cssFileName="suneditor"] - Name or Array of the CSS file to apply inside the iframe.
136
- * - You can also use regular expressions.
137
- * - Applied by searching by filename in the link tag of document,
138
- * - or put the URL value (".css" can be omitted).
139
- * @property {boolean} [statusbar=true] - Enables the status bar.
140
- * @property {boolean} [statusbar_showPathLabel=true] - Displays the current node structure to status bar.
141
- * @property {boolean} [statusbar_resizeEnable=true] - Enables resize function of bottom status bar
142
- * @property {boolean} [charCounter=false] - Shows the number of characters in the editor.
143
- * - If the maxCharCount option has a value, it becomes true.
144
- * @property {number} [charCounter_max] - The maximum number of characters allowed to be inserted into the editor.
145
- * @property {string} [charCounter_label] - Text to be displayed in the "charCounter" area of the bottom bar. (e.g. "Characters : 20/200")
146
- * @property {"char"|"byte"|"byte-html"} [charCounter_type="char"] - Defines the calculation method of the "charCounter" option.
147
- * - 'char': Characters length.
148
- * - 'byte': Binary data size of characters.
149
- * - 'byte-html': Binary data size of the full HTML string.
150
- */
151
- /**
152
- * @typedef {Object} EditorBaseOptions
153
- * @property {Object<string, *>|Array<Object<string, *>>} [plugins] - Plugin configuration.
154
- * @property {Array<string>} [excludedPlugins] - Plugin configuration.
155
- * @property {Array<string[]|string>} [buttonList] - List of toolbar buttons, grouped by sub-arrays.
156
- * @property {boolean} [v2Migration=false] - Enables migration mode for SunEditor v2.
157
- * @property {boolean|{tagFilter: boolean, formatFilter: boolean, classFilter: boolean, styleNodeFilter: boolean, attrFilter: boolean, styleFilter: boolean}} [strictMode=true] - Enables strict filtering of tags, attributes, and styles.
158
- * @property {"classic"|"inline"|"balloon"|"balloon-always"} [mode="classic"] - Toolbar mode: "classic", "inline", "balloon", "balloon-always".
159
- * @property {string} [type=""] - Editor type: "document:header,page".
160
- * @property {string} [theme=""] - Editor theme.
161
- * @property {Object<string, string>} [lang] - Language configuration.
162
- * @property {Array<string>} [fontSizeUnits=["px", "pt", "em", "rem"]] - Allowed font size units.
163
- * @property {string} [allowedClassName] - Allowed class names.
164
- * @property {boolean} [closeModalOutsideClick=false] - Closes modals when clicking outside.
165
- * @property {boolean} [copyFormatKeepOn=false] - Keeps the format of the copied content.
166
- * @property {boolean} [syncTabIndent=true] - Synchronizes tab indent with spaces.
167
- * @property {boolean} [tabDisable=false] - Disables tab key input.
168
- * @property {boolean} [autoLinkify] - Automatically converts URLs into hyperlinks. ("Link" plugin required)
169
- * @property {Array<string>} [autoStyleify=["bold", "underline", "italic", "strike"]] - Styles applied automatically on text input.
170
- * @property {Object<string, string|number>} [scrollToOptions={behavior: "auto", block: "nearest"}] - Configuration for scroll behavior when navigating editor content.
171
- * @property {Object<string, string|number>} [componentScrollToOptions={behavior: "smooth", block: "center"}] - Configuration for scroll behavior when navigating components.
172
- * @property {"repeat"|"always"|"none"} [retainStyleMode="repeat"] - This option determines how inline elements (such as <span>, <strong>, etc.) are handled when deleting text.
173
- * - "repeat": Inline styles are retained unless the backspace key is repeatedly pressed. If the user continuously presses backspace, the styles will eventually be removed.
174
- * - "none": Inline styles are not retained at all. When deleting text, the associated inline elements are immediately removed along with it.
175
- * - "always": Inline styles persist indefinitely unless explicitly removed. Even if all text inside an inline element is deleted, the element itself remains until manually removed.
176
- * @property {Object<string, boolean>} [allowedExtraTags={script: false, style: false, meta: false, link: false, "[a-z]+:[a-z]+": false}] - Specifies extra allowed or disallowed tags.
177
- * @property {Object<string, (...args: *) => *>} [events={}] - Custom event handlers.
178
- * @property {string} [__textStyleTags="strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary"] - The basic tags that serves as the base for "textStyleTags"
179
- * @property {string} [textStyleTags="strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary"] - Additional text style tags.
180
- * @property {Object<string, string>} [convertTextTags={bold: "strong", underline: "u", italic: "em", strike: "del", subscript: "sub", superscript: "sup"}] - Maps text styles to specific HTML tags.
181
- * @property {Object<string, string>} [__tagStyles={'table|th|td': 'border|border-[a-z]+|background-color|text-align|float|font-weight|text-decoration|font-style', 'ol|ul': 'list-style-type'}] - The basic tags that serves as the base for "tagStyles"
182
- * @property {Object<string, string>} [tagStyles={}] - Specifies allowed styles for HTML tags.
183
- * @property {string} [spanStyles="font-family|font-size|color|background-color"] - Specifies allowed styles for the "span" tag.
184
- * @property {string} [lineStyles="text-align|margin-left|margin-right|line-height"] - Specifies allowed styles for the "line" element (p..).
185
- * @property {string} [textDirection="ltr"] - Text direction: "ltr" or "rtl".
186
- * @property {Array<string>} [reverseButtons=['indent-outdent']] - An array of command pairs whose shortcut icons should be opposite each other, depending on the "textDirection" mode.
187
- * @property {number} [historyStackDelayTime=400] - Delay time for history stack updates (ms).
188
- * @property {string} [lineAttrReset=""] - Line properties that should be reset when changing lines (e.g. "id|name").
189
- * @property {string} [printClass=""] - Class name for printing.
190
- * @property {string} [defaultLine="p"] - Default line element when inserting new lines.
191
- * @property {"line"|"br"} [defaultLineBreakFormat="line"] - Specifies the default line break format.
192
- * - [Recommended] "line" : is a line break that is divided into general tags.
193
- * - [Not recommended] "br" : Line breaks are treated as <br> on the same line. (like shift+enter)
194
- * - Line breaks are handled as <br> within "line".
195
- * - You can create a new "line" by entering a line break twice in a row.
196
- * - Formats that include "line", such as "Quote", still operate on a "line" basis.
197
- * - ● suneditor processes work in "line" units.
198
- * - ● When set to "br", performance may decrease when editing a lot of data.
199
- * @property {Array<string>} [scopeSelectionTags=["td", "table", "li", "ol", "ul", "pre", "figcaption", "blockquote", "dl", "dt", "dd"]] - Tags treated as whole units when selecting all content.
200
- * @property {string} [__defaultElementWhitelist="br|div"] - Default allowed HTML elements. The default values are maintained.
201
- * @property {string} [elementWhitelist=""] - Allowed HTML elements. Delimiter: "|" (e.g. "p|div", "*").
202
- * @property {string} [elementBlacklist=""] - Disallowed HTML elements. Delimiter: "|" (e.g. "script|style").
203
- * @property {string} [__defaultAttributeWhitelist] - Allowed attributes. Delimiter: "|" (e.g. "href|target").
204
- * @property {Object<string, string>} [attributeWhitelist=""] - Allowed attributes. (e.g. {a: "href|target", img: "src|alt"}).
205
- * @property {Object<string, string>} [attributeBlacklist=""] - Disallowed attributes. (e.g. {a: "href|target", img: "src|alt"}).
206
- * @property {string} [__defaultFormatLine="P|DIV|H[1-6]|LI|TH|TD|DETAILS"] - Overrides the editor's default "line" element.
207
- * @property {string} [formatLine="P|DIV|H[1-6]|LI|TH|TD|DETAILS"] - Specifies the editor's "line" elements.
208
- * - (P, DIV, H[1-6], PRE, LI | class="__se__format__line_xxx")
209
- * - "line" element also contain "brLine" element
210
- * @property {string} [__defaultFormatBrLine="PRE"] - Overrides the editor's default "brLine" element.
211
- * @property {string} [formatBrLine="PRE"] - Specifies the editor's "brLine" elements. (e.g. "PRE").
212
- * - (PRE | class="__se__format__br_line_xxx")
213
- * - "brLine" elements is included in the "line" element.
214
- * - "brLine" elements's line break is "BR" tag.
215
- * ※ Entering the Enter key in the space on the last line ends "brLine" and appends "line".
216
- * @property {string} [__defaultFormatClosureBrLine=""] - Overrides the editor's default "closureBrLine" element.
217
- * @property {string} [formatClosureBrLine=""] - Specifies the editor's "closureBrLine" elements.
218
- * - (class="__se__format__br_line__closure_xxx")
219
- * - "closureBrLine" elements is included in the "brLine".
220
- * - "closureBrLine" elements's line break is "BR" tag.
221
- * - ※ You cannot exit this format with the Enter key or Backspace key.
222
- * - ※ Use it only in special cases. ([ex] format of table cells)
223
- * @property {string} [__defaultFormatBlock="BLOCKQUOTE|OL|UL|FIGCAPTION|TABLE|THEAD|TBODY|TR|CAPTION|DETAILS"] - Overrides the editor's default "block" element.
224
- * @property {string} [formatBlock="BLOCKQUOTE|OL|UL|FIGCAPTION|TABLE|THEAD|TBODY|TR|CAPTION|DETAILS"] - Specifies the editor's "block" elements.
225
- * - (BLOCKQUOTE, OL, UL, FIGCAPTION, TABLE, THEAD, TBODY, TR, TH, TD | class="__se__format__block_xxx")
226
- * - "block" is wrap the "line" and "component"
227
- * @property {string} [__defaultFormatClosureBlock="TH|TD"] - Overrides the editor's default "closureBlock" element.
228
- * @property {string} [formatClosureBlock="TH|TD"] - Specifies the editor's "closureBlock" elements.
229
- * - (TH, TD | class="__se__format__block_closure_xxx")
230
- * - "closureBlock" elements is included in the "block".
231
- * - "closureBlock" element is wrap the "line" and "component"
232
- * - ※ You cannot exit this format with the Enter key or Backspace key.
233
- * - ※ Use it only in special cases. ([ex] format of table cells)
234
- * @property {string} [allowedEmptyTags=".se-component, pre, blockquote, hr, li, table, img, iframe, video, audio, canvas, details"] - Allowed empty tags.
235
- * @property {number|string} [toolbar_width="auto"] - Toolbar width.
236
- * @property {Element|string} [toolbar_container] - Container element for the toolbar.
237
- * @property {number} [toolbar_sticky=0] - Enables sticky toolbar with optional offset.
238
- * @property {boolean} [toolbar_hide=false] - Hides toolbar initially.
239
- * @property {Object} [subToolbar] - Sub-toolbar configuration.
240
- * @property {Array<Array<string>>} [subToolbar.buttonList] - List of Sub-toolbar buttons, grouped by sub-arrays.
241
- * @property {"balloon"|"balloon-always"} [subToolbar.mode="balloon"] - Sub-toolbar mode: "balloon", "balloon-always".
242
- * @property {number|string} [subToolbar.width="auto"] - Sub-toolbar width.
243
- * @property {Element|string} [statusbar_container] - Container element for the status bar.
244
- * @property {boolean} [shortcutsHint=true] - Displays shortcut hints in tooltips.
245
- * @property {boolean} [shortcutsDisable=false] - Disables keyboard shortcuts.
246
- * @property {Object<string, Array<string>>} [shortcuts] - Custom keyboard shortcuts.
247
- * @property {number} [fullScreenOffset=0] - Offset applied when entering fullscreen mode.
248
- * @property {string} [previewTemplate] - Custom template for preview mode.
249
- * @property {string} [printTemplate] - Custom template for print mode.
250
- * @property {boolean} [componentAutoSelect=false] - Enables automatic selection of inserted components.
251
- * @property {string} [defaultUrlProtocol] - Default URL protocol for links.
252
- * @property {string} [allUsedStyles] - Specifies additional styles to the list of allowed styles. Delimiter: "|" (e.g. "color|background-color").
253
- * @property {Object<"copy", number>} [toastMessageTime] - {"copy": 1500} - Duration for displaying toast messages.
254
- * @property {Object<string, string>} [icons] - Overrides the default icons.
255
- * @property {string} [freeCodeViewMode=false] - Enables free code view mode.
256
- * @property {boolean} [__lineFormatFilter=true] - Line format filter configuration.
257
- * @property {boolean} [__pluginRetainFilter=true] - Plugin retain filter configuration.
258
- * @property {Array<string>} [__listCommonStyle=["fontSize", "color", "fontFamily", "fontWeight", "fontStyle"]] - Defines the list of styles that are applied directly to the `<li>` element
259
- * - when a text style is applied to the entire list item.
260
- * - For example, when changing the font size or color of a list item (`<li>`),
261
- * - these styles will be applied to the `<li>` tag instead of wrapping the content inside additional tags.
262
- * @property {Object<string, *>} [externalLibs] - External libraries like CodeMirror or MathJax.
263
- *
264
- * @property {Object<string, *>} [Dynamic_pluginOptions] - Dynamic plugin options, where the key is the plugin name and the value is its configuration.
265
- */
266
- /**
267
- * @typedef {EditorBaseOptions & EditorFrameOptions} EditorInitOptions
268
- */
269
- /** ------------- [OPTIONS FRAG] ------------- */
270
- /**
271
- * @description For all EditorInitOptions keys, only boolean | null values are allowed.
272
- * - 'fixed' → Immutable / null → Resettable.
273
- * @type {Partial<Record<keyof EditorInitOptions, "fixed" | true>>}
274
- */
275
- export const OPTION_FRAME_FIXED_FLAG: Partial<Record<keyof EditorInitOptions, 'fixed' | true>>;
276
- /**
277
- * @description For all EditorInitOptions keys, only boolean | null values are allowed.
278
- * - 'fixed' → Immutable / null → Resettable.
279
- * @type {Partial<Record<keyof EditorInitOptions, "fixed" | true>>}
280
- */
281
- export const OPTION_FIXED_FLAG: Partial<Record<keyof EditorInitOptions, 'fixed' | true>>;
282
110
  export default Constructor;
283
- export type EditorFrameOptions = {
284
- /**
285
- * - Initial value for the editor.
286
- */
287
- value?: string;
111
+ export type AllBaseOptions_constructor = import('../config/options').AllBaseOptions;
112
+ export type ConstructorReturnType = {
288
113
  /**
289
- * - Placeholder text.
114
+ * - Editor context object
290
115
  */
291
- placeholder?: string;
292
- /**
293
- * - Attributes for the editable frame[.sun-editor-editable]. (e.g. [key]: value)
294
- */
295
- editableFrameAttributes?: {
296
- [x: string]: string;
297
- };
116
+ context: __se__Context;
298
117
  /**
299
- * - Width for the editor.
118
+ * - Carrier wrapper element
300
119
  */
301
- width?: string;
120
+ carrierWrapper: HTMLElement;
302
121
  /**
303
- * - Min width for the editor.
122
+ * - Processed editor options (Map)
304
123
  */
305
- minWidth?: string;
124
+ options: __se__BaseOptions;
306
125
  /**
307
- * - Max width for the editor.
126
+ * - Loaded plugins
308
127
  */
309
- maxWidth?: string;
310
- /**
311
- * - Height for the editor.
312
- */
313
- height?: string;
314
- /**
315
- * - Min height for the editor.
316
- */
317
- minHeight?: string;
318
- /**
319
- * - Max height for the editor.
320
- */
321
- maxHeight?: string;
322
- /**
323
- * - Style string of the top frame of the editor. (e.g. "border: 1px solid #ccc;").
324
- */
325
- editorStyle?: string;
326
- /**
327
- * - Content will be placed in an iframe and isolated from the rest of the page.
328
- */
329
- iframe?: boolean;
330
- /**
331
- * - Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration on the "iframe".
332
- */
333
- iframe_fullPage?: boolean;
334
- /**
335
- * - Attributes of the "iframe". (e.g. {'scrolling': 'no'})
336
- */
337
- iframe_attributes?: {
338
- [x: string]: string;
339
- };
340
- /**
341
- * - Name or Array of the CSS file to apply inside the iframe.
342
- * - You can also use regular expressions.
343
- * - Applied by searching by filename in the link tag of document,
344
- * - or put the URL value (".css" can be omitted).
345
- */
346
- iframe_cssFileName?: string;
347
- /**
348
- * - Enables the status bar.
349
- */
350
- statusbar?: boolean;
351
- /**
352
- * - Displays the current node structure to status bar.
353
- */
354
- statusbar_showPathLabel?: boolean;
355
- /**
356
- * - Enables resize function of bottom status bar
357
- */
358
- statusbar_resizeEnable?: boolean;
359
- /**
360
- * - Shows the number of characters in the editor.
361
- * - If the maxCharCount option has a value, it becomes true.
362
- */
363
- charCounter?: boolean;
364
- /**
365
- * - The maximum number of characters allowed to be inserted into the editor.
366
- */
367
- charCounter_max?: number;
368
- /**
369
- * - Text to be displayed in the "charCounter" area of the bottom bar. (e.g. "Characters : 20/200")
370
- */
371
- charCounter_label?: string;
372
- /**
373
- * - Defines the calculation method of the "charCounter" option.
374
- * - 'char': Characters length.
375
- * - 'byte': Binary data size of characters.
376
- * - 'byte-html': Binary data size of the full HTML string.
377
- */
378
- charCounter_type?: 'char' | 'byte' | 'byte-html';
379
- };
380
- export type EditorBaseOptions = {
381
- /**
382
- * - Plugin configuration.
383
- */
384
- plugins?:
385
- | {
386
- [x: string]: any;
387
- }
388
- | Array<{
389
- [x: string]: any;
390
- }>;
391
- /**
392
- * - Plugin configuration.
393
- */
394
- excludedPlugins?: Array<string>;
395
- /**
396
- * - List of toolbar buttons, grouped by sub-arrays.
397
- */
398
- buttonList?: Array<string[] | string>;
399
- /**
400
- * - Enables migration mode for SunEditor v2.
401
- */
402
- v2Migration?: boolean;
403
- /**
404
- * - Enables strict filtering of tags, attributes, and styles.
405
- */
406
- strictMode?:
407
- | boolean
408
- | {
409
- tagFilter: boolean;
410
- formatFilter: boolean;
411
- classFilter: boolean;
412
- styleNodeFilter: boolean;
413
- attrFilter: boolean;
414
- styleFilter: boolean;
415
- };
416
- /**
417
- * - Toolbar mode: "classic", "inline", "balloon", "balloon-always".
418
- */
419
- mode?: 'classic' | 'inline' | 'balloon' | 'balloon-always';
420
- /**
421
- * - Editor type: "document:header,page".
422
- */
423
- type?: string;
424
- /**
425
- * - Editor theme.
426
- */
427
- theme?: string;
428
- /**
429
- * - Language configuration.
430
- */
431
- lang?: {
432
- [x: string]: string;
433
- };
434
- /**
435
- * - Allowed font size units.
436
- */
437
- fontSizeUnits?: Array<string>;
438
- /**
439
- * - Allowed class names.
440
- */
441
- allowedClassName?: string;
442
- /**
443
- * - Closes modals when clicking outside.
444
- */
445
- closeModalOutsideClick?: boolean;
446
- /**
447
- * - Keeps the format of the copied content.
448
- */
449
- copyFormatKeepOn?: boolean;
450
- /**
451
- * - Synchronizes tab indent with spaces.
452
- */
453
- syncTabIndent?: boolean;
454
- /**
455
- * - Disables tab key input.
456
- */
457
- tabDisable?: boolean;
458
- /**
459
- * - Automatically converts URLs into hyperlinks. ("Link" plugin required)
460
- */
461
- autoLinkify?: boolean;
462
- /**
463
- * - Styles applied automatically on text input.
464
- */
465
- autoStyleify?: Array<string>;
466
- /**
467
- * - Configuration for scroll behavior when navigating editor content.
468
- */
469
- scrollToOptions?: {
470
- [x: string]: string | number;
471
- };
472
- /**
473
- * - Configuration for scroll behavior when navigating components.
474
- */
475
- componentScrollToOptions?: {
476
- [x: string]: string | number;
477
- };
478
- /**
479
- * - This option determines how inline elements (such as <span>, <strong>, etc.) are handled when deleting text.
480
- * - "repeat": Inline styles are retained unless the backspace key is repeatedly pressed. If the user continuously presses backspace, the styles will eventually be removed.
481
- * - "none": Inline styles are not retained at all. When deleting text, the associated inline elements are immediately removed along with it.
482
- * - "always": Inline styles persist indefinitely unless explicitly removed. Even if all text inside an inline element is deleted, the element itself remains until manually removed.
483
- */
484
- retainStyleMode?: 'repeat' | 'always' | 'none';
485
- /**
486
- * - Specifies extra allowed or disallowed tags.
487
- */
488
- allowedExtraTags?: {
489
- [x: string]: boolean;
490
- };
491
- /**
492
- * - Custom event handlers.
493
- */
494
- events?: {
495
- [x: string]: (...args: any) => any;
496
- };
497
- /**
498
- * - The basic tags that serves as the base for "textStyleTags"
499
- */
500
- __textStyleTags?: string;
501
- /**
502
- * - Additional text style tags.
503
- */
504
- textStyleTags?: string;
505
- /**
506
- * - Maps text styles to specific HTML tags.
507
- */
508
- convertTextTags?: {
509
- [x: string]: string;
128
+ plugins: {
129
+ [x: string]: any;
510
130
  };
511
131
  /**
512
- * - The basic tags that serves as the base for "tagStyles"
132
+ * - Icon set
513
133
  */
514
- __tagStyles?: {
134
+ icons: {
515
135
  [x: string]: string;
516
136
  };
517
137
  /**
518
- * - Specifies allowed styles for HTML tags.
138
+ * - Language pack
519
139
  */
520
- tagStyles?: {
140
+ lang: {
521
141
  [x: string]: string;
522
142
  };
523
143
  /**
524
- * - Specifies allowed styles for the "span" tag.
525
- */
526
- spanStyles?: string;
527
- /**
528
- * - Specifies allowed styles for the "line" element (p..).
529
- */
530
- lineStyles?: string;
531
- /**
532
- * - Text direction: "ltr" or "rtl".
533
- */
534
- textDirection?: string;
535
- /**
536
- * - An array of command pairs whose shortcut icons should be opposite each other, depending on the "textDirection" mode.
537
- */
538
- reverseButtons?: Array<string>;
539
- /**
540
- * - Delay time for history stack updates (ms).
541
- */
542
- historyStackDelayTime?: number;
543
- /**
544
- * - Line properties that should be reset when changing lines (e.g. "id|name").
545
- */
546
- lineAttrReset?: string;
547
- /**
548
- * - Class name for printing.
549
- */
550
- printClass?: string;
551
- /**
552
- * - Default line element when inserting new lines.
553
- */
554
- defaultLine?: string;
555
- /**
556
- * - Specifies the default line break format.
557
- * - [Recommended] "line" : is a line break that is divided into general tags.
558
- * - [Not recommended] "br" : Line breaks are treated as <br> on the same line. (like shift+enter)
559
- * - Line breaks are handled as <br> within "line".
560
- * - You can create a new "line" by entering a line break twice in a row.
561
- * - Formats that include "line", such as "Quote", still operate on a "line" basis.
562
- * - ● suneditor processes work in "line" units.
563
- * - ● When set to "br", performance may decrease when editing a lot of data.
564
- */
565
- defaultLineBreakFormat?: 'line' | 'br';
566
- /**
567
- * - Tags treated as whole units when selecting all content.
144
+ * - Initial editor value
568
145
  */
569
- scopeSelectionTags?: Array<string>;
146
+ value: string | null;
570
147
  /**
571
- * - Default allowed HTML elements. The default values are maintained.
148
+ * - Root frame ID
572
149
  */
573
- __defaultElementWhitelist?: string;
150
+ rootId: string | null;
574
151
  /**
575
- * - Allowed HTML elements. Delimiter: "|" (e.g. "p|div", "*").
152
+ * - Array of frame keys
576
153
  */
577
- elementWhitelist?: string;
154
+ rootKeys: Array<string | null>;
578
155
  /**
579
- * - Disallowed HTML elements. Delimiter: "|" (e.g. "script|style").
156
+ * - Map of frame contexts
580
157
  */
581
- elementBlacklist?: string;
158
+ frameRoots: Map<string | null, ReturnType<typeof CreateFrameContext>>;
582
159
  /**
583
- * - Allowed attributes. Delimiter: "|" (e.g. "href|target").
160
+ * - Plugin toolbar buttons
584
161
  */
585
- __defaultAttributeWhitelist?: string;
586
- /**
587
- * - Allowed attributes. (e.g. {a: "href|target", img: "src|alt"}).
588
- */
589
- attributeWhitelist?: {
590
- [x: string]: string;
591
- };
592
- /**
593
- * - Disallowed attributes. (e.g. {a: "href|target", img: "src|alt"}).
594
- */
595
- attributeBlacklist?: {
596
- [x: string]: string;
162
+ pluginCallButtons: {
163
+ [x: string]: HTMLElement[];
597
164
  };
598
165
  /**
599
- * - Overrides the editor's default "line" element.
600
- */
601
- __defaultFormatLine?: string;
602
- /**
603
- * - Specifies the editor's "line" elements.
604
- * - (P, DIV, H[1-6], PRE, LI | class="__se__format__line_xxx")
605
- * - "line" element also contain "brLine" element
606
- */
607
- formatLine?: string;
608
- /**
609
- * - Overrides the editor's default "brLine" element.
610
- */
611
- __defaultFormatBrLine?: string;
612
- /**
613
- * - Specifies the editor's "brLine" elements. (e.g. "PRE").
614
- * - (PRE | class="__se__format__br_line_xxx")
615
- * - "brLine" elements is included in the "line" element.
616
- * - "brLine" elements's line break is "BR" tag.
617
- * ※ Entering the Enter key in the space on the last line ends "brLine" and appends "line".
618
- */
619
- formatBrLine?: string;
620
- /**
621
- * - Overrides the editor's default "closureBrLine" element.
622
- */
623
- __defaultFormatClosureBrLine?: string;
624
- /**
625
- * - Specifies the editor's "closureBrLine" elements.
626
- * - (class="__se__format__br_line__closure_xxx")
627
- * - "closureBrLine" elements is included in the "brLine".
628
- * - "closureBrLine" elements's line break is "BR" tag.
629
- * - ※ You cannot exit this format with the Enter key or Backspace key.
630
- * - ※ Use it only in special cases. ([ex] format of table cells)
631
- */
632
- formatClosureBrLine?: string;
633
- /**
634
- * - Overrides the editor's default "block" element.
166
+ * - Responsive toolbar buttons
635
167
  */
636
- __defaultFormatBlock?: string;
637
- /**
638
- * - Specifies the editor's "block" elements.
639
- * - (BLOCKQUOTE, OL, UL, FIGCAPTION, TABLE, THEAD, TBODY, TR, TH, TD | class="__se__format__block_xxx")
640
- * - "block" is wrap the "line" and "component"
641
- */
642
- formatBlock?: string;
643
- /**
644
- * - Overrides the editor's default "closureBlock" element.
645
- */
646
- __defaultFormatClosureBlock?: string;
647
- /**
648
- * - Specifies the editor's "closureBlock" elements.
649
- * - (TH, TD | class="__se__format__block_closure_xxx")
650
- * - "closureBlock" elements is included in the "block".
651
- * - "closureBlock" element is wrap the "line" and "component"
652
- * - ※ You cannot exit this format with the Enter key or Backspace key.
653
- * - ※ Use it only in special cases. ([ex] format of table cells)
654
- */
655
- formatClosureBlock?: string;
656
- /**
657
- * - Allowed empty tags.
658
- */
659
- allowedEmptyTags?: string;
660
- /**
661
- * - Toolbar width.
662
- */
663
- toolbar_width?: number | string;
664
- /**
665
- * - Container element for the toolbar.
666
- */
667
- toolbar_container?: Element | string;
668
- /**
669
- * - Enables sticky toolbar with optional offset.
670
- */
671
- toolbar_sticky?: number;
672
- /**
673
- * - Hides toolbar initially.
674
- */
675
- toolbar_hide?: boolean;
676
- /**
677
- * - Sub-toolbar configuration.
678
- */
679
- subToolbar?: {
680
- buttonList?: Array<Array<string>>;
681
- mode?: 'balloon' | 'balloon-always';
682
- width?: number | string;
683
- };
168
+ responsiveButtons: Array<HTMLElement>;
684
169
  /**
685
- * - Container element for the status bar.
170
+ * - Sub-toolbar plugin buttons
686
171
  */
687
- statusbar_container?: Element | string;
172
+ pluginCallButtons_sub:
173
+ | {
174
+ [x: string]: Array<HTMLElement>;
175
+ }
176
+ | [];
688
177
  /**
689
- * - Displays shortcut hints in tooltips.
178
+ * - Sub-toolbar responsive buttons
690
179
  */
691
- shortcutsHint?: boolean;
180
+ responsiveButtons_sub: Array<HTMLElement>;
181
+ };
182
+ export type InitOptionsReturnType = {
692
183
  /**
693
- * - Disables keyboard shortcuts.
184
+ * - Processed base options (Map containing {@link AllBaseOptions_constructor} keys)
694
185
  */
695
- shortcutsDisable?: boolean;
186
+ o: __se__BaseOptions;
696
187
  /**
697
- * - Custom keyboard shortcuts.
188
+ * - Icon set
698
189
  */
699
- shortcuts?: {
700
- [x: string]: string[];
190
+ i: {
191
+ [x: string]: string;
701
192
  };
702
193
  /**
703
- * - Offset applied when entering fullscreen mode.
704
- */
705
- fullScreenOffset?: number;
706
- /**
707
- * - Custom template for preview mode.
194
+ * - Language pack
708
195
  */
709
- previewTemplate?: string;
710
- /**
711
- * - Custom template for print mode.
712
- */
713
- printTemplate?: string;
714
- /**
715
- * - Enables automatic selection of inserted components.
716
- */
717
- componentAutoSelect?: boolean;
718
- /**
719
- * - Default URL protocol for links.
720
- */
721
- defaultUrlProtocol?: string;
722
- /**
723
- * - Specifies additional styles to the list of allowed styles. Delimiter: "|" (e.g. "color|background-color").
724
- */
725
- allUsedStyles?: string;
726
- /**
727
- * - {"copy": 1500} - Duration for displaying toast messages.
728
- */
729
- toastMessageTime?: any;
730
- /**
731
- * - Overrides the default icons.
732
- */
733
- icons?: {
196
+ l: {
734
197
  [x: string]: string;
735
198
  };
736
199
  /**
737
- * - Enables free code view mode.
200
+ * - Initial editor value
738
201
  */
739
- freeCodeViewMode?: string;
202
+ v: string | null;
740
203
  /**
741
- * - Line format filter configuration.
204
+ * - Toolbar button list (arrays for groups, strings for single buttons)
742
205
  */
743
- __lineFormatFilter?: boolean;
744
- /**
745
- * - Plugin retain filter configuration.
746
- */
747
- __pluginRetainFilter?: boolean;
206
+ buttons: Array<string[] | string>;
748
207
  /**
749
- * - Defines the list of styles that are applied directly to the `<li>` element
750
- * - when a text style is applied to the entire list item.
751
- * - For example, when changing the font size or color of a list item (`<li>`),
752
- * - these styles will be applied to the `<li>` tag instead of wrapping the content inside additional tags.
208
+ * - Sub-toolbar button list
753
209
  */
754
- __listCommonStyle?: Array<string>;
210
+ subButtons: Array<string[] | string> | null;
755
211
  /**
756
- * - External libraries like CodeMirror or MathJax.
212
+ * - Container element for status bar (if specified)
757
213
  */
758
- externalLibs?: {
759
- [x: string]: any;
760
- };
214
+ statusbarContainer: Element | null;
761
215
  /**
762
- * - Dynamic plugin options, where the key is the plugin name and the value is its configuration.
216
+ * - Map of frame-specific options (frame key => {@link __se__FrameOptions})
763
217
  */
764
- Dynamic_pluginOptions?: {
765
- [x: string]: any;
766
- };
218
+ frameMap: Map<string | null, __se__FrameOptions>;
767
219
  };
768
- export type EditorInitOptions = EditorBaseOptions & EditorFrameOptions;
220
+ /**
221
+ * @typedef {import('../config/options').AllBaseOptions} AllBaseOptions_constructor
222
+ */
223
+ /**
224
+ * @typedef {Object} ConstructorReturnType
225
+ * @property {__se__Context} context - Editor context object
226
+ * @property {HTMLElement} carrierWrapper - Carrier wrapper element
227
+ * @property {__se__BaseOptions} options - Processed editor options (Map)
228
+ * @property {Object<string, *>} plugins - Loaded plugins
229
+ * @property {Object<string, string>} icons - Icon set
230
+ * @property {Object<string, string>} lang - Language pack
231
+ * @property {string|null} value - Initial editor value
232
+ * @property {string|null} rootId - Root frame ID
233
+ * @property {Array<string|null>} rootKeys - Array of frame keys
234
+ * @property {Map<string|null, ReturnType<import('../config/frameContext').CreateFrameContext>>} frameRoots - Map of frame contexts
235
+ * @property {Object<string, Array<HTMLElement>>} pluginCallButtons - Plugin toolbar buttons
236
+ * @property {Array<HTMLElement>} responsiveButtons - Responsive toolbar buttons
237
+ * @property {Object<string, Array<HTMLElement>>|[]} pluginCallButtons_sub - Sub-toolbar plugin buttons
238
+ * @property {Array<HTMLElement>} responsiveButtons_sub - Sub-toolbar responsive buttons
239
+ */
769
240
  /**
770
241
  * @description Creates a new SunEditor instance with specified options.
771
- * @param {Array<{target: Element, key: *, options: EditorFrameOptions}>} editorTargets - Target element or multi-root object.
772
- * @param {EditorInitOptions} options - Configuration options for the editor.
773
- * @returns {Object<string, *>} - SunEditor instance with context, options, and DOM elements.
242
+ * @param {Array<{target: Element, key: *, options: __se__EditorFrameOptions}>} editorTargets - Target element or multi-root object.
243
+ * @param {__se__EditorOptions} options - Configuration options for the editor.
244
+ * @returns {ConstructorReturnType} - SunEditor instance with context, options, and DOM elements.
774
245
  */
775
246
  declare function Constructor(
776
247
  editorTargets: Array<{
777
248
  target: Element;
778
249
  key: any;
779
- options: EditorFrameOptions;
250
+ options: __se__EditorFrameOptions;
780
251
  }>,
781
- options: EditorInitOptions
782
- ): {
783
- [x: string]: any;
784
- };
252
+ options: __se__EditorOptions
253
+ ): ConstructorReturnType;
254
+ import { CreateFrameContext } from '../config/frameContext';