suneditor 3.0.0-rc.4 → 3.0.0

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 (171) hide show
  1. package/README.md +4 -3
  2. package/dist/suneditor-contents.min.css +1 -1
  3. package/dist/suneditor.min.css +1 -1
  4. package/dist/suneditor.min.js +1 -1
  5. package/package.json +10 -6
  6. package/src/assets/design/color.css +14 -2
  7. package/src/assets/design/typography.css +5 -0
  8. package/src/assets/icons/defaultIcons.js +22 -4
  9. package/src/assets/suneditor-contents.css +1 -1
  10. package/src/assets/suneditor.css +312 -18
  11. package/src/core/config/eventManager.js +6 -9
  12. package/src/core/editor.js +1 -1
  13. package/src/core/event/actions/index.js +5 -0
  14. package/src/core/event/effects/keydown.registry.js +25 -0
  15. package/src/core/event/eventOrchestrator.js +69 -2
  16. package/src/core/event/handlers/handler_ww_mouse.js +1 -0
  17. package/src/core/event/rules/keydown.rule.backspace.js +9 -1
  18. package/src/core/kernel/coreKernel.js +4 -0
  19. package/src/core/kernel/store.js +2 -0
  20. package/src/core/logic/dom/char.js +11 -0
  21. package/src/core/logic/dom/format.js +22 -0
  22. package/src/core/logic/dom/html.js +126 -11
  23. package/src/core/logic/dom/nodeTransform.js +13 -0
  24. package/src/core/logic/dom/offset.js +100 -37
  25. package/src/core/logic/dom/selection.js +54 -22
  26. package/src/core/logic/panel/finder.js +982 -0
  27. package/src/core/logic/panel/menu.js +8 -6
  28. package/src/core/logic/panel/toolbar.js +112 -19
  29. package/src/core/logic/panel/viewer.js +214 -43
  30. package/src/core/logic/shell/_commandExecutor.js +7 -1
  31. package/src/core/logic/shell/commandDispatcher.js +1 -1
  32. package/src/core/logic/shell/component.js +5 -7
  33. package/src/core/logic/shell/history.js +24 -0
  34. package/src/core/logic/shell/shortcuts.js +3 -3
  35. package/src/core/logic/shell/ui.js +25 -26
  36. package/src/core/schema/frameContext.js +15 -1
  37. package/src/core/schema/options.js +180 -39
  38. package/src/core/section/constructor.js +61 -20
  39. package/src/core/section/documentType.js +2 -2
  40. package/src/events.js +12 -0
  41. package/src/helper/clipboard.js +1 -1
  42. package/src/helper/converter.js +15 -0
  43. package/src/helper/dom/domQuery.js +12 -0
  44. package/src/helper/dom/domUtils.js +26 -14
  45. package/src/helper/index.js +3 -0
  46. package/src/helper/markdown.js +876 -0
  47. package/src/interfaces/plugins.js +7 -5
  48. package/src/langs/ckb.js +9 -0
  49. package/src/langs/cs.js +9 -0
  50. package/src/langs/da.js +9 -0
  51. package/src/langs/de.js +9 -0
  52. package/src/langs/en.js +9 -0
  53. package/src/langs/es.js +9 -0
  54. package/src/langs/fa.js +9 -0
  55. package/src/langs/fr.js +9 -0
  56. package/src/langs/he.js +9 -0
  57. package/src/langs/hu.js +9 -0
  58. package/src/langs/it.js +9 -0
  59. package/src/langs/ja.js +9 -0
  60. package/src/langs/km.js +9 -0
  61. package/src/langs/ko.js +9 -0
  62. package/src/langs/lv.js +9 -0
  63. package/src/langs/nl.js +9 -0
  64. package/src/langs/pl.js +9 -0
  65. package/src/langs/pt_br.js +9 -0
  66. package/src/langs/ro.js +9 -0
  67. package/src/langs/ru.js +9 -0
  68. package/src/langs/se.js +9 -0
  69. package/src/langs/tr.js +9 -0
  70. package/src/langs/uk.js +9 -0
  71. package/src/langs/ur.js +9 -0
  72. package/src/langs/zh_cn.js +9 -0
  73. package/src/modules/contract/Browser.js +31 -1
  74. package/src/modules/contract/ColorPicker.js +6 -0
  75. package/src/modules/contract/Controller.js +77 -39
  76. package/src/modules/contract/Figure.js +57 -0
  77. package/src/modules/contract/Modal.js +6 -0
  78. package/src/modules/manager/ApiManager.js +53 -4
  79. package/src/modules/manager/FileManager.js +18 -1
  80. package/src/modules/ui/ModalAnchorEditor.js +35 -2
  81. package/src/modules/ui/SelectMenu.js +44 -12
  82. package/src/plugins/browser/fileBrowser.js +5 -2
  83. package/src/plugins/command/codeBlock.js +324 -0
  84. package/src/plugins/command/exportPDF.js +15 -3
  85. package/src/plugins/command/fileUpload.js +4 -1
  86. package/src/plugins/dropdown/backgroundColor.js +5 -1
  87. package/src/plugins/dropdown/blockStyle.js +8 -2
  88. package/src/plugins/dropdown/fontColor.js +5 -1
  89. package/src/plugins/dropdown/hr.js +6 -0
  90. package/src/plugins/dropdown/layout.js +4 -1
  91. package/src/plugins/dropdown/lineHeight.js +3 -0
  92. package/src/plugins/dropdown/paragraphStyle.js +5 -5
  93. package/src/plugins/dropdown/table/index.js +4 -1
  94. package/src/plugins/dropdown/table/render/table.html.js +1 -1
  95. package/src/plugins/dropdown/table/services/table.grid.js +16 -8
  96. package/src/plugins/dropdown/table/services/table.style.js +5 -9
  97. package/src/plugins/dropdown/template.js +3 -0
  98. package/src/plugins/dropdown/textStyle.js +5 -1
  99. package/src/plugins/field/mention.js +5 -1
  100. package/src/plugins/index.js +3 -0
  101. package/src/plugins/input/fontSize.js +10 -3
  102. package/src/plugins/modal/audio.js +7 -3
  103. package/src/plugins/modal/embed.js +23 -20
  104. package/src/plugins/modal/image/index.js +5 -1
  105. package/src/plugins/modal/math.js +7 -2
  106. package/src/plugins/modal/video/index.js +21 -4
  107. package/src/themes/cobalt.css +13 -4
  108. package/src/themes/cream.css +11 -2
  109. package/src/themes/dark.css +13 -4
  110. package/src/themes/midnight.css +13 -4
  111. package/src/typedef.js +4 -4
  112. package/types/assets/icons/defaultIcons.d.ts +12 -1
  113. package/types/assets/suneditor.css.d.ts +1 -1
  114. package/types/core/config/eventManager.d.ts +6 -8
  115. package/types/core/event/actions/index.d.ts +1 -0
  116. package/types/core/event/effects/keydown.registry.d.ts +2 -0
  117. package/types/core/event/eventOrchestrator.d.ts +2 -1
  118. package/types/core/kernel/coreKernel.d.ts +5 -0
  119. package/types/core/kernel/store.d.ts +5 -0
  120. package/types/core/logic/dom/char.d.ts +11 -0
  121. package/types/core/logic/dom/format.d.ts +22 -0
  122. package/types/core/logic/dom/html.d.ts +16 -0
  123. package/types/core/logic/dom/nodeTransform.d.ts +13 -0
  124. package/types/core/logic/dom/offset.d.ts +23 -2
  125. package/types/core/logic/dom/selection.d.ts +9 -3
  126. package/types/core/logic/panel/finder.d.ts +83 -0
  127. package/types/core/logic/panel/toolbar.d.ts +14 -1
  128. package/types/core/logic/panel/viewer.d.ts +22 -2
  129. package/types/core/logic/shell/shortcuts.d.ts +1 -1
  130. package/types/core/schema/frameContext.d.ts +22 -0
  131. package/types/core/schema/options.d.ts +362 -79
  132. package/types/events.d.ts +11 -0
  133. package/types/helper/converter.d.ts +15 -0
  134. package/types/helper/dom/domQuery.d.ts +12 -0
  135. package/types/helper/dom/domUtils.d.ts +23 -2
  136. package/types/helper/index.d.ts +5 -0
  137. package/types/helper/markdown.d.ts +27 -0
  138. package/types/interfaces/plugins.d.ts +7 -5
  139. package/types/langs/_Lang.d.ts +9 -0
  140. package/types/modules/contract/Browser.d.ts +36 -2
  141. package/types/modules/contract/ColorPicker.d.ts +6 -0
  142. package/types/modules/contract/Controller.d.ts +35 -1
  143. package/types/modules/contract/Figure.d.ts +57 -0
  144. package/types/modules/contract/Modal.d.ts +6 -0
  145. package/types/modules/manager/ApiManager.d.ts +26 -0
  146. package/types/modules/manager/FileManager.d.ts +17 -0
  147. package/types/modules/ui/ModalAnchorEditor.d.ts +41 -4
  148. package/types/modules/ui/SelectMenu.d.ts +40 -2
  149. package/types/plugins/browser/fileBrowser.d.ts +10 -4
  150. package/types/plugins/command/codeBlock.d.ts +53 -0
  151. package/types/plugins/command/fileUpload.d.ts +8 -2
  152. package/types/plugins/dropdown/backgroundColor.d.ts +10 -2
  153. package/types/plugins/dropdown/blockStyle.d.ts +14 -2
  154. package/types/plugins/dropdown/fontColor.d.ts +10 -2
  155. package/types/plugins/dropdown/hr.d.ts +12 -0
  156. package/types/plugins/dropdown/layout.d.ts +8 -2
  157. package/types/plugins/dropdown/lineHeight.d.ts +6 -0
  158. package/types/plugins/dropdown/paragraphStyle.d.ts +14 -3
  159. package/types/plugins/dropdown/table/index.d.ts +9 -3
  160. package/types/plugins/dropdown/template.d.ts +6 -0
  161. package/types/plugins/dropdown/textStyle.d.ts +10 -2
  162. package/types/plugins/field/mention.d.ts +10 -2
  163. package/types/plugins/index.d.ts +3 -0
  164. package/types/plugins/input/fontSize.d.ts +18 -4
  165. package/types/plugins/modal/audio.d.ts +14 -6
  166. package/types/plugins/modal/embed.d.ts +44 -38
  167. package/types/plugins/modal/image/index.d.ts +9 -1
  168. package/types/plugins/modal/link.d.ts +6 -2
  169. package/types/plugins/modal/math.d.ts +23 -5
  170. package/types/plugins/modal/video/index.d.ts +49 -9
  171. package/types/typedef.d.ts +5 -2
@@ -55,7 +55,10 @@ export namespace DEFAULTS {
55
55
  * === Content & Editing ===
56
56
  * @property {string} [value=""] - Initial value for the editor.
57
57
  * @property {string} [placeholder=""] - Placeholder text.
58
- * @property {Object<string, string>} [editableFrameAttributes={spellcheck: "false"}] - Attributes for the editable frame[.sun-editor-editable]. (e.g. [key]: value)
58
+ * @property {Object<string, string>} [editableFrameAttributes={spellcheck: "false"}] - Attributes for the editable frame[.sun-editor-editable].
59
+ * ```js
60
+ * { editableFrameAttributes: { spellcheck: 'true', autocomplete: 'on' } }
61
+ * ```
59
62
  * ///
60
63
  *
61
64
  * === Layout & Sizing ===
@@ -65,19 +68,26 @@ export namespace DEFAULTS {
65
68
  * @property {string|number} [height="auto"] - Height for the editor.
66
69
  * @property {string|number} [minHeight=""] - Min height for the editor.
67
70
  * @property {string|number} [maxHeight=""] - Max height for the editor.
68
- * @property {string} [editorStyle=""] - Style string of the top frame of the editor. (e.g. "border: 1px solid #ccc;").
71
+ * @property {string} [editorStyle=""] - Style string of the top frame of the editor.
72
+ * ```js
73
+ * { editorStyle: 'border: 1px solid #ccc; border-radius: 4px;' }
74
+ * ```
69
75
  * ///
70
76
  *
71
77
  * === Iframe Mode ===
72
78
  * @property {boolean} [iframe=false] - Content will be placed in an iframe and isolated from the rest of the page.
73
79
  * @property {boolean} [iframe_fullPage=false] - Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration on the `iframe`.
74
- * @property {Object<string, string>} [iframe_attributes={}] - Attributes of the `iframe`. (e.g. {'allow-scripts': 'true'})
80
+ * @property {Object<string, string>} [iframe_attributes={}] - Attributes of the `iframe`.
81
+ * ```js
82
+ * { iframe_attributes: { 'allow-scripts': 'true', sandbox: 'allow-same-origin' } }
83
+ * ```
75
84
  * @property {Array<string>} [iframe_cssFileName=["suneditor"]] - CSS files to apply inside the iframe.
76
85
  * - String: Filename pattern to search in document `<link>` tags.
77
- * - (e.g. "suneditor" or "suneditor.[a-z0-9]+" matches "suneditor.abc123.css")
78
- * - "*": Wildcard to include ALL stylesheets from the page.
79
- * - Array: Multiple patterns (e.g. ["suneditor", "custom", "*"]).
80
- * - Absolute URLs and data URLs (data:text/css,) are also supported.
86
+ * - `"*"`: Wildcard to include ALL stylesheets from the page.
87
+ * - Absolute URLs and data URLs (`data:text/css,`) are also supported.
88
+ * ```js
89
+ * { iframe_cssFileName: ['suneditor', 'custom', 'https://example.com/style.css'] }
90
+ * ```
81
91
  * ///
82
92
  *
83
93
  * === Statusbar & Character Counter ===
@@ -87,12 +97,14 @@ export namespace DEFAULTS {
87
97
  * @property {boolean} [charCounter=false] - Shows the number of characters in the editor.
88
98
  * - If the `maxCharCount` option has a value, it becomes `true`.
89
99
  * @property {?number} [charCounter_max=null] - The maximum number of characters allowed to be inserted into the editor.
90
- * @property {?string} [charCounter_label=null] - Text to be displayed in the `charCounter` area of the bottom bar. (e.g. "Characters : 20/200")
100
+ * @property {?string} [charCounter_label=null] - Text to be displayed in the `charCounter` area of the bottom bar.
101
+ * ```js
102
+ * { charCounter_label: 'Characters :' }
103
+ * ```
91
104
  * @property {"char"|"byte"|"byte-html"} [charCounter_type="char"] - Defines the calculation method of the `charCounter` option.
92
105
  * - `char`: Characters length.
93
106
  * - `byte`: Binary data size of characters.
94
107
  * - `byte-html`: Binary data size of the full HTML string.
95
- *
96
108
  */
97
109
  /** ================================================================================================================================ */
98
110
  /**
@@ -153,9 +165,11 @@ export namespace DEFAULTS {
153
165
  * - 'a|img|p|div|...' (REQUIRED + DEFAULT)
154
166
  * - 2. If options are given directly, the final pattern is:
155
167
  * - 'a|img|custom|tags' (REQUIRED + options.__defaultElementWhitelist)
156
- * @property {string} [__defaultAttributeWhitelist=CONSTANTS.ATTRIBUTE_WHITELIST] - A complete list of attributes that are allowed by default on all tags.
157
- * - Delimiter: "|" (e.g. "href|target").
168
+ * @property {string} [__defaultAttributeWhitelist=CONSTANTS.ATTRIBUTE_WHITELIST] - A complete list of attributes that are allowed by default on all tags. Delimiter: `"|"`.
158
169
  * - The default follows {@link DEFAULTS.ATTRIBUTE_WHITELIST}
170
+ * ```js
171
+ * { __defaultAttributeWhitelist: 'href|target|src|alt|class' }
172
+ * ```
159
173
  * ///
160
174
  *
161
175
  * === Formatting ===
@@ -177,7 +191,13 @@ export namespace DEFAULTS {
177
191
  * - For example, when changing the font size or color of a list item (`<li>`),
178
192
  * - these styles apply to the `<li>` tag instead of wrapping content in additional tags.
179
193
  * @property {{pluginName: string, we: boolean}|boolean} [__pluginRetainFilter=true] - Plugin retain filter configuration. (Internal use primarily)
180
- * - You can turn it off/on globally with `true`/`false` or set it per plugin. (e.g. { table: false })
194
+ * - You can turn it off/on globally with `true`/`false` or set it per plugin.
195
+ * ```js
196
+ * // disable filter for table plugin only
197
+ * {
198
+ * __pluginRetainFilter: { table: false }
199
+ * }
200
+ * ```
181
201
  */
182
202
  /**
183
203
  * ================================================================================================================================
@@ -187,16 +207,30 @@ export namespace DEFAULTS {
187
207
  * -----------------
188
208
  *
189
209
  * === Plugins & Toolbar ===
190
- * @property {Object<string, *>|Array<Object<string, *>>} [plugins] - Plugin configuration.
191
- * @property {Array<string>} [excludedPlugins=[]] - Plugin configuration.
210
+ * @property {Object<string, *>|Array<Object<string, *>>} [plugins] - Plugin configuration. Pass an array of plugin classes or an object keyed by plugin name.
211
+ * ```js
212
+ * import plugins, { image, link, table } from 'suneditor/src/plugins';
213
+ * { plugins: plugins,
214
+ * plugins: [image, link, table],
215
+ * plugins: { image, link, table }
216
+ * }
217
+ * ```
218
+ * @property {Array<string>} [excludedPlugins=[]] - List of plugin names to exclude.
219
+ * ```js
220
+ * { excludedPlugins: ['image', 'video'] }
221
+ * ```
192
222
  * @property {SunEditor.UI.ButtonList} [buttonList=CONSTANTS.BUTTON_LIST] - List of toolbar buttons, grouped by sub-arrays.
193
223
  * - The default follows {@link DEFAULTS.BUTTON_LIST}
194
224
  * ///
195
225
  *
196
226
  * === Modes & Themes ===
197
227
  * @property {boolean} [v2Migration=false] - Enables migration mode for SunEditor v2.
198
- * @property {"classic"|"inline"|"balloon"|"balloon-always"} [mode="classic"] - Toolbar mode: `classic`, `inline`, `balloon`, `balloon-always`.
199
- * @property {string} [type=""] - Editor type: `document:header,page`.
228
+ * @property {"classic"|"inline"|"balloon"|"balloon-always"|"classic:bottom"|"inline:bottom"} [mode="classic"] - Toolbar mode: `classic`, `inline`, `balloon`, `balloon-always`. Append `:bottom` to place toolbar at the bottom (e.g. `classic:bottom`, `inline:bottom`).
229
+ * @property {string} [type=""] - Editor type. Use `"document"` for a document-style layout, with optional sub-types after `:`.
230
+ * ```js
231
+ * // type
232
+ * 'document:header,page'
233
+ * ```
200
234
  * @property {string} [theme=""] - Editor theme.
201
235
  * @property {Object<string, string>} [lang] - Language configuration. default : EN
202
236
  * @property {Object<string, string>} [icons] - Overrides the default icons.
@@ -223,6 +257,19 @@ export namespace DEFAULTS {
223
257
  * - `textStyleTagFilter`: Filters text style tags (b, i, u, span, etc.)
224
258
  * - `attrFilter`: Filters disallowed HTML attributes (`attributeWhitelist`/`attributeBlacklist`)
225
259
  * - `styleFilter`: Filters disallowed inline styles (`spanStyles`/`lineStyles`/`allUsedStyles`)
260
+ * ```js
261
+ * // disable only attribute and style filters
262
+ * {
263
+ * strictMode: {
264
+ * tagFilter: true,
265
+ * formatFilter: true,
266
+ * classFilter: true,
267
+ * textStyleTagFilter: true,
268
+ * attrFilter: false,
269
+ * styleFilter: false
270
+ * }
271
+ * }
272
+ * ```
226
273
  * @property {Array<string>} [scopeSelectionTags=CONSTANTS.SCOPE_SELECTION_TAGS] - Tags treated as whole units when selecting all content.
227
274
  * - The default follows {@link DEFAULTS.SCOPE_SELECTION_TAGS}
228
275
  * ///
@@ -230,12 +277,16 @@ export namespace DEFAULTS {
230
277
  * === Content Filtering & Formatting ===
231
278
  * ==
232
279
  * #### 1) Tag & Element Control
233
- * @property {string} [elementWhitelist=""] - Specifies HTML elements to additionally allow beyond the default allow list.
234
- * - Delimiter: "|" (e.g. "p|div", "*").
280
+ * @property {string} [elementWhitelist=""] - Specifies HTML elements to additionally allow beyond the default allow list. Delimiter: `"|"`.
235
281
  * - Added to the default list determined by {@link PrivateBaseOptions.__defaultElementWhitelist}.
236
- * @property {string} [elementBlacklist=""] - Specifies HTML elements that should not be used.
237
- * - Delimiter: "|" (e.g. "script|style").
282
+ * ```js
283
+ * { elementWhitelist: 'mark|details|summary' }
284
+ * ```
285
+ * @property {string} [elementBlacklist=""] - Specifies HTML elements that should not be used. Delimiter: `"|"`.
238
286
  * - Tags specified here will eventually be removed, even if they are included in other whitelists.
287
+ * ```js
288
+ * { elementBlacklist: 'script|style|iframe' }
289
+ * ```
239
290
  * @property {string} [allowedEmptyTags=CONSTANTS.ALLOWED_EMPTY_NODE_LIST] - A list of tags that are allowed to be kept even if their values are empty.
240
291
  * - The default follows {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST}
241
292
  * - Concatenated with `ALLOWED_EMPTY_NODE_LIST` to form the final `allowedEmptyTags` list.
@@ -244,22 +295,52 @@ export namespace DEFAULTS {
244
295
  * ///
245
296
  *
246
297
  * #### 2) Attribute Control
247
- * @property {{[key: string]: string|undefined}} [attributeWhitelist=null] - Specifies additional attributes to allow for each tag.
248
- * - (e.g. {a: "href|target", img: "src|alt", "*": "id"})
298
+ * @property {{[key: string]: string|undefined}} [attributeWhitelist=null] - Specifies additional attributes to allow for each tag. `"*"` applies to all tags.
249
299
  * - Rules specified here will be merged into {@link PrivateBaseOptions.__defaultAttributeWhitelist}.
250
- * @property {{[key: string]: string|undefined}} [attributeBlacklist=null] - Specifies attributes to disallow by tag.
251
- * - (e.g. {a: "href|target", img: "src|alt", "*": "name"})
300
+ * ```js
301
+ * {
302
+ * attributeWhitelist: {
303
+ * a: 'href|target',
304
+ * img: 'src|alt',
305
+ * '*': 'id|data-*'
306
+ * }
307
+ * }
308
+ * ```
309
+ * @property {{[key: string]: string|undefined}} [attributeBlacklist=null] - Specifies attributes to disallow by tag. `"*"` applies to all tags.
252
310
  * - Attributes specified here will eventually be removed even if they are allowed by other settings.
253
311
  * - A list of required elements, {@link DEFAULTS.REQUIRED_FORMAT_LINE}, is always included.
312
+ * ```js
313
+ * { attributeBlacklist: { '*': 'onclick|onerror' } }
314
+ * ```
254
315
  * ///
255
316
  *
256
317
  * #### 3) Text & Inline Style Control
257
318
  * @property {string} [textStyleTags=__textStyleTags] - Additional text style tags.
258
319
  * - The default follows {@link PrivateBaseOptions.__textStyleTags}
259
320
  * @property {Object<string, string>} [convertTextTags={bold: "strong", underline: "u", italic: "em", strike: "del", subscript: "sub", superscript: "sup"}] - Maps text styles to specific HTML tags.
260
- * @property {string} [allUsedStyles] - Specifies additional styles to the list of allowed styles.
261
- * - Delimiter: "|" (e.g. "color|background-color").
262
- * @property {Object<string, string>} [tagStyles={}] - Specifies allowed styles for HTML tags.
321
+ * ```js
322
+ * {
323
+ * convertTextTags: {
324
+ * bold: 'b',
325
+ * italic: 'i',
326
+ * underline: 'u',
327
+ * strike: 's'
328
+ * }
329
+ * }
330
+ * ```
331
+ * @property {string} [allUsedStyles] - Specifies additional styles to the list of allowed styles. Delimiter: `"|"`.
332
+ * ```js
333
+ * { allUsedStyles: 'color|background-color|text-shadow' }
334
+ * ```
335
+ * @property {Object<string, string>} [tagStyles={}] - Specifies allowed styles for HTML tags. Key is tag name(s), value is pipe-delimited allowed styles.
336
+ * ```js
337
+ * {
338
+ * tagStyles: {
339
+ * 'table|td': 'border|color|background-color',
340
+ * hr: 'border-top'
341
+ * }
342
+ * }
343
+ * ```
263
344
  * @property {string} [spanStyles=CONSTANTS.SPAN_STYLES] - Specifies allowed styles for the `span` tag.
264
345
  * - The default follows {@link DEFAULTS.SPAN_STYLES}
265
346
  * @property {string} [lineStyles=CONSTANTS.LINE_STYLES] - Specifies allowed styles for the `line` element (p..).
@@ -284,14 +365,23 @@ export namespace DEFAULTS {
284
365
  * - Formats that include `line`, such as "Quote", still operate on a `line` basis.
285
366
  * - suneditor processes work in `line` units.
286
367
  * - When set to `br`, performance may decrease when editing a lot of data.
287
- * @property {string} [lineAttrReset=""] - Line properties that should be reset when changing lines (e.g. "id|name").
288
- * @property {string} [formatLine=__defaultFormatLine] - Additionally allowed `line` elements beyond the default. Delimiter: "|" (e.g. "p|div").
368
+ * @property {string} [lineAttrReset=""] - Line properties that should be reset when changing lines. Delimiter: `"|"`.
369
+ * ```js
370
+ * { lineAttrReset: 'id|name' }
371
+ * ```
372
+ * @property {string} [formatLine=__defaultFormatLine] - Additionally allowed `line` elements beyond the default. Delimiter: `"|"`.
289
373
  * - Concatenated with {@link PrivateBaseOptions.__defaultFormatLine} to form the final `line` list.
290
374
  * - `line` element also contains `brLine` element.
291
- * @property {string} [formatBrLine=__defaultFormatBrLine] - Additionally allowed `brLine` elements beyond the default. (e.g. "PRE").
375
+ * ```js
376
+ * { formatLine: 'ARTICLE|SECTION' }
377
+ * ```
378
+ * @property {string} [formatBrLine=__defaultFormatBrLine] - Additionally allowed `brLine` elements beyond the default.
292
379
  * - Concatenated with {@link PrivateBaseOptions.__defaultFormatBrLine} to form the final `brLine` list.
293
380
  * - `brLine` elements are included in the `line` element.
294
381
  * - `brLine` elements' line break is `BR` tag.
382
+ * ```js
383
+ * { formatBrLine: 'CODE' }
384
+ * ```
295
385
  * - ※ Entering the Enter key on the last line ends `brLine` and appends `line`.
296
386
  * @property {string} [formatClosureBrLine=__defaultFormatClosureBrLine] - Additionally allowed `closureBrLine` elements beyond the default.
297
387
  * - Concatenated with {@link PrivateBaseOptions.__defaultFormatClosureBrLine} for the final `closureBrLine` list.
@@ -318,14 +408,28 @@ export namespace DEFAULTS {
318
408
  * @property {?HTMLElement} [toolbar_container] - Container element for the toolbar.
319
409
  * @property {number} [toolbar_sticky=0] - Enables sticky toolbar with optional offset.
320
410
  * @property {boolean} [toolbar_hide=false] - Hides toolbar initially.
321
- * @property {Object} [subToolbar={}] - Sub-toolbar configuration.
411
+ * @property {Object} [subToolbar={}] - Sub-toolbar configuration. A secondary toolbar that appears on text selection.
322
412
  * @property {SunEditor.UI.ButtonList} [subToolbar.buttonList] - List of Sub-toolbar buttons, grouped by sub-arrays.
323
413
  * @property {"balloon"|"balloon-always"} [subToolbar.mode="balloon"] - Sub-toolbar mode: `balloon`, `balloon-always`.
324
414
  * @property {string} [subToolbar.width="auto"] - Sub-toolbar width.
415
+ * ```js
416
+ * { subToolbar: { buttonList: [['bold', 'italic', 'link']], mode: 'balloon' } }
417
+ * ```
325
418
  * @property {?HTMLElement} [statusbar_container] - Container element for the status bar.
326
419
  * @property {boolean} [shortcutsHint=true] - Displays shortcut hints in tooltips.
327
420
  * @property {boolean} [shortcutsDisable=false] - Disables keyboard shortcuts.
328
421
  * @property {{[key: string]: Array<string>|undefined}} [shortcuts={}] - Custom keyboard shortcuts.
422
+ * - Keys starting with `_` are user-defined custom shortcuts. Each value is an array of `[keyCombo, hintLabel]` pairs.
423
+ * - Key combos use `c` (Ctrl/Cmd), `s` (Shift), and `KeyEvent.code` values joined by `+`.
424
+ * - Use `$~pluginName.method` to call a specific plugin method.
425
+ * ```js
426
+ * {
427
+ * shortcuts: {
428
+ * bold: ['c+KeyB', 'B'],
429
+ * _h1: ['c+s+Digit1+$~blockStyle.applyHeaderByShortcut', '']
430
+ * }
431
+ * }
432
+ * ```
329
433
  * ///
330
434
  *
331
435
  * === Advanced Features ===
@@ -334,10 +438,14 @@ export namespace DEFAULTS {
334
438
  * - Default: `Boolean(plugins.link)` — determined by whether the `link` plugin is enabled.
335
439
  * @property {Array<string>} [autoStyleify=["bold", "underline", "italic", "strike"]] - Styles applied automatically on text input.
336
440
  * @property {number} [historyStackDelayTime=400] - Delay time for history stack updates (ms).
441
+ * @property {number} [historyStackSize=100] - Maximum number of history entries per root frame. Oldest entries are discarded when exceeded.
337
442
  * @property {string} [printClass=""] - Class name for printing.
338
443
  * @property {number} [fullScreenOffset=0] - Offset applied when entering fullscreen mode.
339
- * @property {?string} [previewTemplate=null] - Custom template for preview mode.
340
- * @property {?string} [printTemplate=null] - Custom template for print mode.
444
+ * @property {?string} [previewTemplate=null] - Custom HTML template for preview mode. Use `{{ contents }}` as a placeholder for editor content.
445
+ * @property {?string} [printTemplate=null] - Custom HTML template for print mode. Use `{{ contents }}` as a placeholder for editor content.
446
+ * ```js
447
+ * { previewTemplate: '<div class="my-preview"><h1>Preview</h1>{{ contents }}</div>' }
448
+ * ```
341
449
  * @property {SunEditor.ComponentInsertType} [componentInsertBehavior="auto"] - Enables automatic selection of inserted components.
342
450
  * - For inline components: places cursor near the component, or selects if no nearby range.
343
451
  * - For block components: executes behavior based on `selectMode`:
@@ -346,18 +454,48 @@ export namespace DEFAULTS {
346
454
  * - `line`: Move cursor to the next line if possible, or create a new line and move there.
347
455
  * - `none`: Do nothing.
348
456
  * @property {?string} [defaultUrlProtocol=null] - Default URL protocol for links.
349
- * @property {Object<"copy", number>} [toastMessageTime={copy: 1500}] - {"copy": 1500} - Duration for displaying toast messages.
457
+ * @property {Object<"copy", number>} [toastMessageTime={copy: 1500}] - Duration for displaying toast messages (ms).
350
458
  * @property {boolean} [freeCodeViewMode=false] - Enables free code view mode.
459
+ * @property {boolean} [finder_panel=true] - Shows the built-in Find/Replace panel UI.
460
+ * - The finder is always created internally; this option controls whether the panel is visible to users (Ctrl+F / Ctrl+H).
461
+ * @property {boolean} [finder_liveSearch=true] - Searches instantly as you type (debounced). When false, search runs only on Enter.
462
+ *
463
+ * ///
351
464
  *
352
465
  * === Dynamic Options ===
353
- * @property {Object<string, *>} [externalLibs] - External libraries like CodeMirror or MathJax.
466
+ * @property {Object<string, *>} [externalLibs] - External libraries like CodeMirror, KaTeX, or MathJax.
354
467
  * - See {@link https://github.com/ARA-developer/suneditor/blob/develop/guide/external-libraries.md External Libraries Guide}
355
- * @property {Object<string, boolean>} [allowedExtraTags=CONSTANTS.EXTRA_TAG_MAP] - Specifies extra allowed or disallowed tags.
468
+ * ```js
469
+ * {
470
+ * externalLibs: {
471
+ * katex: window.katex,
472
+ * codeMirror: { src: CodeMirror }
473
+ * }
474
+ * }
475
+ * ```
476
+ * @property {Object<string, boolean>} [allowedExtraTags=CONSTANTS.EXTRA_TAG_MAP] - Specifies extra allowed or disallowed tags. `true` to allow, `false` to disallow.
356
477
  * - The default follows {@link DEFAULTS.EXTRA_TAG_MAP}
478
+ * ```js
479
+ * {
480
+ * allowedExtraTags: {
481
+ * script: false,
482
+ * style: false,
483
+ * mark: true
484
+ * }
485
+ * }
486
+ * ```
357
487
  * ///
358
488
  *
359
489
  * === User Events ===
360
- * @property {SunEditor.Event.Handlers} [events] - User event handlers configuration
490
+ * @property {SunEditor.Event.Handlers} [events] - User event handlers configuration.
491
+ * ```js
492
+ * {
493
+ * events: {
494
+ * onChange: (content) => console.log(content),
495
+ * onImageUploadBefore: (files, info) => true
496
+ * }
497
+ * }
498
+ * ```
361
499
  * ///
362
500
  *
363
501
  * === [ Plugin-Specific Options ] ===
@@ -367,6 +505,7 @@ export namespace DEFAULTS {
367
505
  * @property {import('../../plugins/browser/audioGallery.js').AudioGalleryPluginOptions} [audioGallery]
368
506
  * @property {import('../../plugins/dropdown/backgroundColor.js').BackgroundColorPluginOptions} [backgroundColor]
369
507
  * @property {import('../../plugins/dropdown/blockStyle.js').BlockStylePluginOptions} [blockStyle]
508
+ * @property {import('../../plugins/command/codeBlock.js').CodeBlockPluginOptions} [codeBlock]
370
509
  * @property {import('../../plugins/modal/drawing.js').DrawingPluginOptions} [drawing]
371
510
  * @property {import('../../plugins/modal/embed.js').EmbedPluginOptions} [embed]
372
511
  * @property {import('../../plugins/command/exportPDF.js').ExportPDFPluginOptions} [exportPDF]
@@ -425,7 +564,6 @@ export namespace DEFAULTS {
425
564
  * @property {*} [codeMirror] - CodeMirror configuration object from `externalLibs.codeMirror`.
426
565
  * @property {boolean} [codeMirrorEditor] - Whether CodeMirror is available (base-level flag). Frame-level stores the actual CM instance.
427
566
  * @property {boolean} [hasCodeMirror] - Uses CodeMirror for code view.
428
- *
429
567
  * @property {Set<string>} [allUsedStyles] - Processed set of all allowed CSS styles.
430
568
  * - Converted from user's `string` input ("|" delimited) to `Set<string>` in constructor.
431
569
  */
@@ -468,7 +606,10 @@ export type EditorFrameOptions = {
468
606
  */
469
607
  placeholder?: string;
470
608
  /**
471
- * - Attributes for the editable frame[.sun-editor-editable]. (e.g. [key]: value)
609
+ * - Attributes for the editable frame[.sun-editor-editable].
610
+ * ```js
611
+ * { editableFrameAttributes: { spellcheck: 'true', autocomplete: 'on' } }
612
+ * ```
472
613
  * ///
473
614
  *
474
615
  * === Layout & Sizing ===
@@ -501,7 +642,10 @@ export type EditorFrameOptions = {
501
642
  */
502
643
  maxHeight?: string | number;
503
644
  /**
504
- * - Style string of the top frame of the editor. (e.g. "border: 1px solid #ccc;").
645
+ * - Style string of the top frame of the editor.
646
+ * ```js
647
+ * { editorStyle: 'border: 1px solid #ccc; border-radius: 4px;' }
648
+ * ```
505
649
  * ///
506
650
  *
507
651
  * === Iframe Mode ===
@@ -516,7 +660,10 @@ export type EditorFrameOptions = {
516
660
  */
517
661
  iframe_fullPage?: boolean;
518
662
  /**
519
- * - Attributes of the `iframe`. (e.g. {'allow-scripts': 'true'})
663
+ * - Attributes of the `iframe`.
664
+ * ```js
665
+ * { iframe_attributes: { 'allow-scripts': 'true', sandbox: 'allow-same-origin' } }
666
+ * ```
520
667
  */
521
668
  iframe_attributes?: {
522
669
  [x: string]: string;
@@ -524,10 +671,11 @@ export type EditorFrameOptions = {
524
671
  /**
525
672
  * - CSS files to apply inside the iframe.
526
673
  * - String: Filename pattern to search in document `<link>` tags.
527
- * - (e.g. "suneditor" or "suneditor.[a-z0-9]+" matches "suneditor.abc123.css")
528
- * - "*": Wildcard to include ALL stylesheets from the page.
529
- * - Array: Multiple patterns (e.g. ["suneditor", "custom", "*"]).
530
- * - Absolute URLs and data URLs (data:text/css,) are also supported.
674
+ * - `"*"`: Wildcard to include ALL stylesheets from the page.
675
+ * - Absolute URLs and data URLs (`data:text/css,`) are also supported.
676
+ * ```js
677
+ * { iframe_cssFileName: ['suneditor', 'custom', 'https://example.com/style.css'] }
678
+ * ```
531
679
  * ///
532
680
  *
533
681
  * === Statusbar & Character Counter ===
@@ -555,7 +703,10 @@ export type EditorFrameOptions = {
555
703
  */
556
704
  charCounter_max?: number | null;
557
705
  /**
558
- * - Text to be displayed in the `charCounter` area of the bottom bar. (e.g. "Characters : 20/200")
706
+ * - Text to be displayed in the `charCounter` area of the bottom bar.
707
+ * ```js
708
+ * { charCounter_label: 'Characters :' }
709
+ * ```
559
710
  */
560
711
  charCounter_label?: string | null;
561
712
  /**
@@ -644,9 +795,11 @@ export type PrivateBaseOptions = {
644
795
  */
645
796
  __defaultElementWhitelist?: string;
646
797
  /**
647
- * - A complete list of attributes that are allowed by default on all tags.
648
- * - Delimiter: "|" (e.g. "href|target").
649
- * - The default follows {@link DEFAULTS.ATTRIBUTE_WHITELIST}///
798
+ * - A complete list of attributes that are allowed by default on all tags. Delimiter: `"|"`.
799
+ * - The default follows {@link DEFAULTS.ATTRIBUTE_WHITELIST}```js
800
+ * { __defaultAttributeWhitelist: 'href|target|src|alt|class' }
801
+ * ```
802
+ * ///
650
803
  *
651
804
  * === Formatting ===
652
805
  */
@@ -690,7 +843,13 @@ export type PrivateBaseOptions = {
690
843
  __listCommonStyle?: Array<string>;
691
844
  /**
692
845
  * - Plugin retain filter configuration. (Internal use primarily)
693
- * - You can turn it off/on globally with `true`/`false` or set it per plugin. (e.g. { table: false })
846
+ * - You can turn it off/on globally with `true`/`false` or set it per plugin.
847
+ * ```js
848
+ * // disable filter for table plugin only
849
+ * {
850
+ * __pluginRetainFilter: { table: false }
851
+ * }
852
+ * ```
694
853
  */
695
854
  __pluginRetainFilter?:
696
855
  | {
@@ -707,7 +866,14 @@ export type PrivateBaseOptions = {
707
866
  */
708
867
  export type EditorBaseOptions = {
709
868
  /**
710
- * - Plugin configuration.
869
+ * - Plugin configuration. Pass an array of plugin classes or an object keyed by plugin name.
870
+ * ```js
871
+ * import plugins, { image, link, table } from 'suneditor/src/plugins';
872
+ * { plugins: plugins,
873
+ * plugins: [image, link, table],
874
+ * plugins: { image, link, table }
875
+ * }
876
+ * ```
711
877
  */
712
878
  plugins?:
713
879
  | {
@@ -717,7 +883,10 @@ export type EditorBaseOptions = {
717
883
  [x: string]: any;
718
884
  }>;
719
885
  /**
720
- * - Plugin configuration.
886
+ * - List of plugin names to exclude.
887
+ * ```js
888
+ * { excludedPlugins: ['image', 'video'] }
889
+ * ```
721
890
  */
722
891
  excludedPlugins?: Array<string>;
723
892
  /**
@@ -732,11 +901,15 @@ export type EditorBaseOptions = {
732
901
  */
733
902
  v2Migration?: boolean;
734
903
  /**
735
- * - Toolbar mode: `classic`, `inline`, `balloon`, `balloon-always`.
904
+ * - Toolbar mode: `classic`, `inline`, `balloon`, `balloon-always`. Append `:bottom` to place toolbar at the bottom (e.g. `classic:bottom`, `inline:bottom`).
736
905
  */
737
- mode?: 'classic' | 'inline' | 'balloon' | 'balloon-always';
906
+ mode?: 'classic' | 'inline' | 'balloon' | 'balloon-always' | 'classic:bottom' | 'inline:bottom';
738
907
  /**
739
- * - Editor type: `document:header,page`.
908
+ * - Editor type. Use `"document"` for a document-style layout, with optional sub-types after `:`.
909
+ * ```js
910
+ * // type
911
+ * 'document:header,page'
912
+ * ```
740
913
  */
741
914
  type?: string;
742
915
  /**
@@ -778,6 +951,19 @@ export type EditorBaseOptions = {
778
951
  * - `textStyleTagFilter`: Filters text style tags (b, i, u, span, etc.)
779
952
  * - `attrFilter`: Filters disallowed HTML attributes (`attributeWhitelist`/`attributeBlacklist`)
780
953
  * - `styleFilter`: Filters disallowed inline styles (`spanStyles`/`lineStyles`/`allUsedStyles`)
954
+ * ```js
955
+ * // disable only attribute and style filters
956
+ * {
957
+ * strictMode: {
958
+ * tagFilter: true,
959
+ * formatFilter: true,
960
+ * classFilter: true,
961
+ * textStyleTagFilter: true,
962
+ * attrFilter: false,
963
+ * styleFilter: false
964
+ * }
965
+ * }
966
+ * ```
781
967
  */
782
968
  strictMode?:
783
969
  | true
@@ -799,15 +985,19 @@ export type EditorBaseOptions = {
799
985
  */
800
986
  scopeSelectionTags?: Array<string>;
801
987
  /**
802
- * - Specifies HTML elements to additionally allow beyond the default allow list.
803
- * - Delimiter: "|" (e.g. "p|div", "*").
988
+ * - Specifies HTML elements to additionally allow beyond the default allow list. Delimiter: `"|"`.
804
989
  * - Added to the default list determined by {@link PrivateBaseOptions.__defaultElementWhitelist}.
990
+ * ```js
991
+ * { elementWhitelist: 'mark|details|summary' }
992
+ * ```
805
993
  */
806
994
  elementWhitelist?: string;
807
995
  /**
808
- * - Specifies HTML elements that should not be used.
809
- * - Delimiter: "|" (e.g. "script|style").
996
+ * - Specifies HTML elements that should not be used. Delimiter: `"|"`.
810
997
  * - Tags specified here will eventually be removed, even if they are included in other whitelists.
998
+ * ```js
999
+ * { elementBlacklist: 'script|style|iframe' }
1000
+ * ```
811
1001
  */
812
1002
  elementBlacklist?: string;
813
1003
  /**
@@ -823,18 +1013,28 @@ export type EditorBaseOptions = {
823
1013
  */
824
1014
  allowedClassName?: string;
825
1015
  /**
826
- * - Specifies additional attributes to allow for each tag.
827
- * - (e.g. {a: "href|target", img: "src|alt", "*": "id"})
1016
+ * - Specifies additional attributes to allow for each tag. `"*"` applies to all tags.
828
1017
  * - Rules specified here will be merged into {@link PrivateBaseOptions.__defaultAttributeWhitelist}.
1018
+ * ```js
1019
+ * {
1020
+ * attributeWhitelist: {
1021
+ * a: 'href|target',
1022
+ * img: 'src|alt',
1023
+ * '*': 'id|data-*'
1024
+ * }
1025
+ * }
1026
+ * ```
829
1027
  */
830
1028
  attributeWhitelist?: {
831
1029
  [key: string]: string | undefined;
832
1030
  };
833
1031
  /**
834
- * - Specifies attributes to disallow by tag.
835
- * - (e.g. {a: "href|target", img: "src|alt", "*": "name"})
1032
+ * - Specifies attributes to disallow by tag. `"*"` applies to all tags.
836
1033
  * - Attributes specified here will eventually be removed even if they are allowed by other settings.
837
1034
  * - A list of required elements, {@link DEFAULTS.REQUIRED_FORMAT_LINE}, is always included.
1035
+ * ```js
1036
+ * { attributeBlacklist: { '*': 'onclick|onerror' } }
1037
+ * ```
838
1038
  * ///
839
1039
  *
840
1040
  * #### 3) Text & Inline Style Control
@@ -849,17 +1049,37 @@ export type EditorBaseOptions = {
849
1049
  textStyleTags?: string;
850
1050
  /**
851
1051
  * - Maps text styles to specific HTML tags.
1052
+ * ```js
1053
+ * {
1054
+ * convertTextTags: {
1055
+ * bold: 'b',
1056
+ * italic: 'i',
1057
+ * underline: 'u',
1058
+ * strike: 's'
1059
+ * }
1060
+ * }
1061
+ * ```
852
1062
  */
853
1063
  convertTextTags?: {
854
1064
  [x: string]: string;
855
1065
  };
856
1066
  /**
857
- * - Specifies additional styles to the list of allowed styles.
858
- * - Delimiter: "|" (e.g. "color|background-color").
1067
+ * - Specifies additional styles to the list of allowed styles. Delimiter: `"|"`.
1068
+ * ```js
1069
+ * { allUsedStyles: 'color|background-color|text-shadow' }
1070
+ * ```
859
1071
  */
860
1072
  allUsedStyles?: string;
861
1073
  /**
862
- * - Specifies allowed styles for HTML tags.
1074
+ * - Specifies allowed styles for HTML tags. Key is tag name(s), value is pipe-delimited allowed styles.
1075
+ * ```js
1076
+ * {
1077
+ * tagStyles: {
1078
+ * 'table|td': 'border|color|background-color',
1079
+ * hr: 'border-top'
1080
+ * }
1081
+ * }
1082
+ * ```
863
1083
  */
864
1084
  tagStyles?: {
865
1085
  [x: string]: string;
@@ -907,20 +1127,29 @@ export type EditorBaseOptions = {
907
1127
  */
908
1128
  defaultLineBreakFormat?: 'line' | 'br';
909
1129
  /**
910
- * - Line properties that should be reset when changing lines (e.g. "id|name").
1130
+ * - Line properties that should be reset when changing lines. Delimiter: `"|"`.
1131
+ * ```js
1132
+ * { lineAttrReset: 'id|name' }
1133
+ * ```
911
1134
  */
912
1135
  lineAttrReset?: string;
913
1136
  /**
914
- * - Additionally allowed `line` elements beyond the default. Delimiter: "|" (e.g. "p|div").
1137
+ * - Additionally allowed `line` elements beyond the default. Delimiter: `"|"`.
915
1138
  * - Concatenated with {@link PrivateBaseOptions.__defaultFormatLine} to form the final `line` list.
916
1139
  * - `line` element also contains `brLine` element.
1140
+ * ```js
1141
+ * { formatLine: 'ARTICLE|SECTION' }
1142
+ * ```
917
1143
  */
918
1144
  formatLine?: string;
919
1145
  /**
920
- * - Additionally allowed `brLine` elements beyond the default. (e.g. "PRE").
1146
+ * - Additionally allowed `brLine` elements beyond the default.
921
1147
  * - Concatenated with {@link PrivateBaseOptions.__defaultFormatBrLine} to form the final `brLine` list.
922
1148
  * - `brLine` elements are included in the `line` element.
923
1149
  * - `brLine` elements' line break is `BR` tag.
1150
+ * ```js
1151
+ * { formatBrLine: 'CODE' }
1152
+ * ```
924
1153
  * - ※ Entering the Enter key on the last line ends `brLine` and appends `line`.
925
1154
  */
926
1155
  formatBrLine?: string;
@@ -980,7 +1209,7 @@ export type EditorBaseOptions = {
980
1209
  */
981
1210
  toolbar_hide?: boolean;
982
1211
  /**
983
- * - Sub-toolbar configuration.
1212
+ * - Sub-toolbar configuration. A secondary toolbar that appears on text selection.
984
1213
  */
985
1214
  subToolbar?: {
986
1215
  buttonList?: SunEditor.UI.ButtonList;
@@ -1001,6 +1230,17 @@ export type EditorBaseOptions = {
1001
1230
  shortcutsDisable?: boolean;
1002
1231
  /**
1003
1232
  * - Custom keyboard shortcuts.
1233
+ * - Keys starting with `_` are user-defined custom shortcuts. Each value is an array of `[keyCombo, hintLabel]` pairs.
1234
+ * - Key combos use `c` (Ctrl/Cmd), `s` (Shift), and `KeyEvent.code` values joined by `+`.
1235
+ * - Use `$~pluginName.method` to call a specific plugin method.
1236
+ * ```js
1237
+ * {
1238
+ * shortcuts: {
1239
+ * bold: ['c+KeyB', 'B'],
1240
+ * _h1: ['c+s+Digit1+$~blockStyle.applyHeaderByShortcut', '']
1241
+ * }
1242
+ * }
1243
+ * ```
1004
1244
  * ///
1005
1245
  *
1006
1246
  * === Advanced Features ===
@@ -1025,6 +1265,10 @@ export type EditorBaseOptions = {
1025
1265
  * - Delay time for history stack updates (ms).
1026
1266
  */
1027
1267
  historyStackDelayTime?: number;
1268
+ /**
1269
+ * - Maximum number of history entries per root frame. Oldest entries are discarded when exceeded.
1270
+ */
1271
+ historyStackSize?: number;
1028
1272
  /**
1029
1273
  * - Class name for printing.
1030
1274
  */
@@ -1034,11 +1278,14 @@ export type EditorBaseOptions = {
1034
1278
  */
1035
1279
  fullScreenOffset?: number;
1036
1280
  /**
1037
- * - Custom template for preview mode.
1281
+ * - Custom HTML template for preview mode. Use `{{ contents }}` as a placeholder for editor content.
1038
1282
  */
1039
1283
  previewTemplate?: string | null;
1040
1284
  /**
1041
- * - Custom template for print mode.
1285
+ * - Custom HTML template for print mode. Use `{{ contents }}` as a placeholder for editor content.
1286
+ * ```js
1287
+ * { previewTemplate: '<div class="my-preview"><h1>Preview</h1>{{ contents }}</div>' }
1288
+ * ```
1042
1289
  */
1043
1290
  printTemplate?: string | null;
1044
1291
  /**
@@ -1056,25 +1303,52 @@ export type EditorBaseOptions = {
1056
1303
  */
1057
1304
  defaultUrlProtocol?: string | null;
1058
1305
  /**
1059
- * - {"copy": 1500} - Duration for displaying toast messages.
1306
+ * - Duration for displaying toast messages (ms).
1060
1307
  */
1061
1308
  toastMessageTime?: any;
1062
1309
  /**
1063
1310
  * - Enables free code view mode.
1311
+ */
1312
+ freeCodeViewMode?: boolean;
1313
+ /**
1314
+ * - Shows the built-in Find/Replace panel UI.
1315
+ * - The finder is always created internally; this option controls whether the panel is visible to users (Ctrl+F / Ctrl+H).
1316
+ */
1317
+ finder_panel?: boolean;
1318
+ /**
1319
+ * - Searches instantly as you type (debounced). When false, search runs only on Enter.
1320
+ *
1321
+ * ///
1064
1322
  *
1065
1323
  * === Dynamic Options ===
1066
1324
  */
1067
- freeCodeViewMode?: boolean;
1325
+ finder_liveSearch?: boolean;
1068
1326
  /**
1069
- * - External libraries like CodeMirror or MathJax.
1070
- * - See {@link https://github.com/ARA-developer/suneditor/blob/develop/guide/external-libraries.md External Libraries Guide}
1327
+ * - External libraries like CodeMirror, KaTeX, or MathJax.
1328
+ * - See {@link https://github.com/ARA-developer/suneditor/blob/develop/guide/external-libraries.md External Libraries Guide}```js
1329
+ * {
1330
+ * externalLibs: {
1331
+ * katex: window.katex,
1332
+ * codeMirror: { src: CodeMirror }
1333
+ * }
1334
+ * }
1335
+ * ```
1071
1336
  */
1072
1337
  externalLibs?: {
1073
1338
  [x: string]: any;
1074
1339
  };
1075
1340
  /**
1076
- * - Specifies extra allowed or disallowed tags.
1077
- * - The default follows {@link DEFAULTS.EXTRA_TAG_MAP}///
1341
+ * - Specifies extra allowed or disallowed tags. `true` to allow, `false` to disallow.
1342
+ * - The default follows {@link DEFAULTS.EXTRA_TAG_MAP}```js
1343
+ * {
1344
+ * allowedExtraTags: {
1345
+ * script: false,
1346
+ * style: false,
1347
+ * mark: true
1348
+ * }
1349
+ * }
1350
+ * ```
1351
+ * ///
1078
1352
  *
1079
1353
  * === User Events ===
1080
1354
  */
@@ -1082,7 +1356,15 @@ export type EditorBaseOptions = {
1082
1356
  [x: string]: boolean;
1083
1357
  };
1084
1358
  /**
1085
- * - User event handlers configuration
1359
+ * - User event handlers configuration.
1360
+ * ```js
1361
+ * {
1362
+ * events: {
1363
+ * onChange: (content) => console.log(content),
1364
+ * onImageUploadBefore: (files, info) => true
1365
+ * }
1366
+ * }
1367
+ * ```
1086
1368
  * ///
1087
1369
  *
1088
1370
  * === [ Plugin-Specific Options ] ===
@@ -1094,6 +1376,7 @@ export type EditorBaseOptions = {
1094
1376
  audioGallery?: import('../../plugins/browser/audioGallery.js').AudioGalleryPluginOptions;
1095
1377
  backgroundColor?: import('../../plugins/dropdown/backgroundColor.js').BackgroundColorPluginOptions;
1096
1378
  blockStyle?: import('../../plugins/dropdown/blockStyle.js').BlockStylePluginOptions;
1379
+ codeBlock?: import('../../plugins/command/codeBlock.js').CodeBlockPluginOptions;
1097
1380
  drawing?: import('../../plugins/modal/drawing.js').DrawingPluginOptions;
1098
1381
  embed?: import('../../plugins/modal/embed.js').EmbedPluginOptions;
1099
1382
  exportPDF?: import('../../plugins/command/exportPDF.js').ExportPDFPluginOptions;