suneditor 3.0.0-beta.13 → 3.0.0-beta.15

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.
@@ -117,28 +117,15 @@ export function CreateToolBar(
117
117
  key: string;
118
118
  }>;
119
119
  };
120
+ export default Constructor;
121
+ export type EditorFrameOptions = import('./options').EditorFrameOptions;
122
+ export type EditorInitOptions = import('./options').EditorInitOptions;
120
123
  /**
121
124
  * @typedef {import('./options').EditorFrameOptions} EditorFrameOptions
122
125
  */
123
126
  /**
124
127
  * @typedef {import('./options').EditorInitOptions} EditorInitOptions
125
128
  */
126
- /** ------------- [OPTIONS FRAG] ------------- */
127
- /**
128
- * @description For all EditorInitOptions keys, only boolean | null values are allowed.
129
- * - 'fixed' → Immutable / null → Resettable.
130
- * @type {Partial<Record<keyof EditorInitOptions, "fixed" | true>>}
131
- */
132
- export const OPTION_FRAME_FIXED_FLAG: Partial<Record<keyof EditorInitOptions, 'fixed' | true>>;
133
- /**
134
- * @description For all EditorInitOptions keys, only boolean | null values are allowed.
135
- * - 'fixed' → Immutable / null → Resettable.
136
- * @type {Partial<Record<keyof EditorInitOptions, "fixed" | true>>}
137
- */
138
- export const OPTION_FIXED_FLAG: Partial<Record<keyof EditorInitOptions, 'fixed' | true>>;
139
- export default Constructor;
140
- export type EditorFrameOptions = import('./options').EditorFrameOptions;
141
- export type EditorInitOptions = import('./options').EditorInitOptions;
142
129
  /**
143
130
  * @description Creates a new SunEditor instance with specified options.
144
131
  * @param {Array<{target: Element, key: *, options: EditorFrameOptions}>} editorTargets - Target element or multi-root object.
@@ -57,6 +57,16 @@ declare class DocumentType {
57
57
  * @returns {Promise<void>}
58
58
  */
59
59
  rePage(force: boolean): Promise<void>;
60
+ /**
61
+ * @private
62
+ * @description Calculates and compensates for the vertical gap between the rendered content (current page)
63
+ * - and the mirrored preview page due to differences in width and layout.
64
+ * @param {number} t - The initial top position value to be adjusted.
65
+ * @param {HTMLElement[]} chr - The elements array in the current (main) page.
66
+ * @param {HTMLElement[]} mChr - The elements array in the mirrored page.
67
+ * @returns {number|null} - The adjusted top value.
68
+ */
69
+ _calcPageBreakTop(t: number, chr: HTMLElement[], mChr: HTMLElement[]): number | null;
60
70
  /**
61
71
  * @private
62
72
  * @description Initializes the cache for document elements.
@@ -67,7 +77,7 @@ declare class DocumentType {
67
77
  * @private
68
78
  * @description Retrieves the element at a given position.
69
79
  * @param {number} pageTop - The vertical position to check.
70
- * @param {NodeList} mChr - List of mirrored elements.
80
+ * @param {HTMLElement[]} mChr - List of mirrored elements.
71
81
  * @returns {{ci: number, cm: number, ch: number}} The closest element and its related data.
72
82
  * - ci: The index of the closest element.
73
83
  * - cm: The distance between the top of the closest element and the given position.
@@ -75,7 +85,7 @@ declare class DocumentType {
75
85
  */
76
86
  _getElementAtPosition(
77
87
  pageTop: number,
78
- mChr: NodeList
88
+ mChr: HTMLElement[]
79
89
  ): {
80
90
  ci: number;
81
91
  cm: number;
@@ -1,45 +1,234 @@
1
1
  export namespace DEFAULTS {
2
- let BUTTON_LIST: [
3
- ['undo', 'redo'],
4
- '|',
5
- ['bold', 'underline', 'italic', 'strike', '|', 'subscript', 'superscript'],
6
- '|',
7
- ['removeFormat'],
8
- '|',
9
- ['outdent', 'indent'],
10
- '|',
11
- ['fullScreen', 'showBlocks', 'codeView'],
12
- '|',
13
- ['preview', 'print']
14
- ];
15
- let REQUIRED_FORMAT_LINE: 'div';
16
- let REQUIRED_ELEMENT_WHITELIST: 'br|div';
17
- let ELEMENT_WHITELIST: 'p|pre|blockquote|h1|h2|h3|h4|h5|h6|ol|ul|li|hr|figure|figcaption|img|iframe|audio|video|source|table|colgroup|col|thead|tbody|tr|th|td|caption|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|code|svg|path|details|summary';
18
- let TEXT_STYLE_TAGS: 'strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary';
19
- let SCOPE_SELECTION_TAGS: ['td', 'table', 'li', 'ol', 'ul', 'pre', 'figcaption', 'blockquote', 'dl', 'dt', 'dd'];
20
- let ATTRIBUTE_WHITELIST: 'contenteditable|target|href|title|download|rel|src|alt|class|type|colspan|rowspan|width|height|controls|autoplay|loop|muted|poster|preload|playsinline|volume|crossorigin|disableRemotePlayback|controlsList|allowfullscreen|sandbox|loading|allow|referrerpolicy|frameborder|scrolling';
21
- let FORMAT_LINE: 'P|H[1-6]|LI|TH|TD|DETAILS';
22
- let FORMAT_BR_LINE: 'PRE';
23
- let FORMAT_CLOSURE_BR_LINE: '';
24
- let FORMAT_BLOCK: 'BLOCKQUOTE|OL|UL|FIGCAPTION|TABLE|THEAD|TBODY|TR|CAPTION|DETAILS';
25
- let FORMAT_CLOSURE_BLOCK: 'TH|TD';
26
- let ALLOWED_EMPTY_NODE_LIST: '.se-component, pre, blockquote, hr, li, table, img, iframe, video, audio, canvas, details';
27
- let SIZE_UNITS: ['px', 'pt', 'em', 'rem'];
28
- let CLASS_NAME: '^__se__|^se-|^katex|^MathJax';
29
- let CLASS_MJX: 'mjx-container|mjx-math|mjx-mrow|mjx-mi|mjx-mo|mjx-mn|mjx-msup|mjx-mfrac|mjx-munderover';
30
- let EXTRA_TAG_MAP: { script: false; style: false; meta: false; link: false; '[a-z]+:[a-z]+': false };
31
- let CONTENT_STYLES: 'background|background-clip|background-color|border|border-bottom|border-collapse|border-color|border-image|border-left-width|border-radius|border-right-width|border-spacing|border-style|border-top|border-width|box-shadow|box-sizing|caption-side|color|content|direction|display|float|font|font-family|font-size|font-style|font-weight|height|left|letter-spacing|line-height|list-style-position|list-style-type|margin|margin-block-end|margin-block-start|margin-bottom|margin-inline-end|margin-inline-start|margin-left|margin-right|margin-top|max-width|min-width|outline|overflow|position|padding|padding-bottom|padding-inline-start|padding-left|padding-right|padding-top|page-break-before|page-break-after|page-break-inside|rotate|rotateX|rotateY|table-layout|text-align|text-decoration|text-shadow|text-transform|top|text-indent|text-rendering|vertical-align|visibility|white-space|width|word-break|word-wrap';
2
+ let BUTTON_LIST: (string | string[])[];
3
+ let REQUIRED_FORMAT_LINE: string;
4
+ let REQUIRED_ELEMENT_WHITELIST: string;
5
+ let ELEMENT_WHITELIST: string;
6
+ let TEXT_STYLE_TAGS: string;
7
+ let SCOPE_SELECTION_TAGS: string[];
8
+ let ATTRIBUTE_WHITELIST: string;
9
+ let FORMAT_LINE: string;
10
+ let FORMAT_BR_LINE: string;
11
+ let FORMAT_CLOSURE_BR_LINE: string;
12
+ let FORMAT_BLOCK: string;
13
+ let FORMAT_CLOSURE_BLOCK: string;
14
+ let ALLOWED_EMPTY_NODE_LIST: string;
15
+ let SIZE_UNITS: string[];
16
+ let CLASS_NAME: string;
17
+ let CLASS_MJX: string;
18
+ let EXTRA_TAG_MAP: {
19
+ script: boolean;
20
+ style: boolean;
21
+ meta: boolean;
22
+ link: boolean;
23
+ '[a-z]+:[a-z]+': boolean;
24
+ };
25
+ let CONTENT_STYLES: string;
32
26
  let TAG_STYLES: {
33
- 'table|th|td': 'border|border-[a-z]+|color|background-color|text-align|float|font-weight|text-decoration|font-style|vertical-align|text-align';
34
- 'table|td': 'width';
35
- tr: 'height';
36
- col: 'width';
37
- 'ol|ul': 'list-style-type';
27
+ 'table|th|td': string;
28
+ 'table|td': string;
29
+ tr: string;
30
+ col: string;
31
+ 'ol|ul': string;
38
32
  };
39
- let TEXT_STYLES: 'font-family|font-size|color|background-color';
40
- let LINE_STYLES: 'text-align|margin-left|margin-right|line-height';
41
- let RETAIN_STYLE_MODE: ['repeat', 'always', 'none'];
33
+ let SPAN_STYLES: string;
34
+ let LINE_STYLES: string;
35
+ let RETAIN_STYLE_MODE: string[];
42
36
  }
37
+ /**
38
+ * @typedef {Object} EditorFrameOptions
39
+ * @property {string} [value=""] - Initial value for the editor.
40
+ * @property {string} [placeholder=""] - Placeholder text.
41
+ * @property {Object<string, string>} [editableFrameAttributes={}] - Attributes for the editable frame[.sun-editor-editable]. (e.g. [key]: value)
42
+ * @property {string} [width="100%"] - Width for the editor.
43
+ * @property {string} [minWidth=""] - Min width for the editor.
44
+ * @property {string} [maxWidth=""] - Max width for the editor.
45
+ * @property {string} [height="auto"] - Height for the editor.
46
+ * @property {string} [minHeight=""] - Min height for the editor.
47
+ * @property {string} [maxHeight=""] - Max height for the editor.
48
+ * @property {string} [editorStyle=""] - Style string of the top frame of the editor. (e.g. "border: 1px solid #ccc;").
49
+ * @property {boolean} [iframe=false] - Content will be placed in an iframe and isolated from the rest of the page.
50
+ * @property {boolean} [iframe_fullPage=false] - Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration on the "iframe".
51
+ * @property {Object<string, string>} [iframe_attributes={}] - Attributes of the "iframe". (e.g. {'scrolling': 'no'})
52
+ * @property {string} [iframe_cssFileName="suneditor"] - Name or Array of the CSS file to apply inside the iframe.
53
+ * - You can also use regular expressions.
54
+ * - Applied by searching by filename in the link tag of document,
55
+ * - or put the URL value (".css" can be omitted).
56
+ * @property {boolean} [statusbar=true] - Enables the status bar.
57
+ * @property {boolean} [statusbar_showPathLabel=true] - Displays the current node structure to status bar.
58
+ * @property {boolean} [statusbar_resizeEnable=true] - Enables resize function of bottom status bar
59
+ * @property {boolean} [charCounter=false] - Shows the number of characters in the editor.
60
+ * - If the maxCharCount option has a value, it becomes true.
61
+ * @property {number} [charCounter_max] - The maximum number of characters allowed to be inserted into the editor.
62
+ * @property {string} [charCounter_label] - Text to be displayed in the "charCounter" area of the bottom bar. (e.g. "Characters : 20/200")
63
+ * @property {"char"|"byte"|"byte-html"} [charCounter_type="char"] - Defines the calculation method of the "charCounter" option.
64
+ * - 'char': Characters length.
65
+ * - 'byte': Binary data size of characters.
66
+ * - 'byte-html': Binary data size of the full HTML string.
67
+ */
68
+ /**
69
+ * @typedef {Object} EditorBaseOptions
70
+ * @property {Object<string, *>|Array<Object<string, *>>} [plugins] - Plugin configuration.
71
+ * @property {Array<string>} [excludedPlugins=[]] - Plugin configuration.
72
+ * @property {Array<string[]|string>} [buttonList=CONSTANTS.BUTTON_LIST] - List of toolbar buttons, grouped by sub-arrays.
73
+ * - The default follows {@link DEFAULTS.BUTTON_LIST}
74
+ * @property {boolean} [v2Migration=false] - Enables migration mode for SunEditor v2.
75
+ * @property {boolean|{tagFilter: boolean, formatFilter: boolean, classFilter: boolean, textStyleTagFilter: boolean, attrFilter: boolean, styleFilter: boolean}} [strictMode=true] - Enables strict filtering of tags, attributes, and styles.
76
+ * @property {"classic"|"inline"|"balloon"|"balloon-always"} [mode="classic"] - Toolbar mode: "classic", "inline", "balloon", "balloon-always".
77
+ * @property {string} [type=""] - Editor type: "document:header,page".
78
+ * @property {string} [theme=""] - Editor theme.
79
+ * @property {Object<string, string>} [lang] - Language configuration. default : EN
80
+ * @property {Array<string>} [fontSizeUnits=CONSTANTS.SIZE_UNITS] - Allowed font size units.
81
+ * - The default follows {@link DEFAULTS.SIZE_UNITS}
82
+ * @property {string} [allowedClassName=""] - Allowed class names.
83
+ * - Added the default value {@link DEFAULTS.CLASS_NAME}
84
+ * @property {boolean} [closeModalOutsideClick=false] - Closes modals when clicking outside.
85
+ * @property {boolean} [copyFormatKeepOn=false] - Keeps the format of the copied content.
86
+ * @property {boolean} [syncTabIndent=true] - Synchronizes tab indent with spaces.
87
+ * @property {boolean} [tabDisable=false] - Disables tab key input.
88
+ * @property {boolean} [autoLinkify] - Automatically converts URLs into hyperlinks. ("Link" plugin required)
89
+ * - Default value is determined dynamically based on whether the 'link' plugin is enabled. (default : Boolean(plugins.link))
90
+ * @property {Array<string>} [autoStyleify=["bold", "underline", "italic", "strike"]] - Styles applied automatically on text input.
91
+ * @property {Object<string, string|number>} [scrollToOptions={behavior: "auto", block: "nearest"}] - Configuration for scroll behavior when navigating editor content.
92
+ * @property {Object<string, string|number>} [componentScrollToOptions={behavior: "smooth", block: "center"}] - Configuration for scroll behavior when navigating components.
93
+ * @property {"repeat"|"always"|"none"} [retainStyleMode="repeat"] - This option determines how inline elements (such as <span>, <strong>, etc.) are handled when deleting text.
94
+ * - "repeat": Inline styles are retained unless the backspace key is repeatedly pressed. If the user continuously presses backspace, the styles will eventually be removed.
95
+ * - "none": Inline styles are not retained at all. When deleting text, the associated inline elements are immediately removed along with it.
96
+ * - "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.
97
+ * @property {Object<string, boolean>} [allowedExtraTags=CONSTANTS.EXTRA_TAG_MAP] - Specifies extra allowed or disallowed tags.
98
+ * - The default follows {@link DEFAULTS.EXTRA_TAG_MAP}
99
+ * @property {Object<string, (...args: *) => *>} [events={}] - Custom event handlers.
100
+ * @property {string} [__textStyleTags=CONSTANTS.TEXT_STYLE_TAGS] - The basic tags that serves as the base for "textStyleTags"
101
+ * - The default follows {@link DEFAULTS.TEXT_STYLE_TAGS}
102
+ * @property {string} [textStyleTags=__textStyleTags] - Additional text style tags.
103
+ * - The default follows {@link EditorBaseOptions.__textStyleTags}
104
+ * @property {Object<string, string>} [convertTextTags={bold: "strong", underline: "u", italic: "em", strike: "del", subscript: "sub", superscript: "sup"}] - Maps text styles to specific HTML tags.
105
+ * @property {string} [allUsedStyles] - Specifies additional styles to the list of allowed styles. Delimiter: "|" (e.g. "color|background-color").
106
+ * @property {Object<string, string>} [__tagStyles=CONSTANTS.TAG_STYLES] - The basic tags that serves as the base for "tagStyles"
107
+ * - The default follows {@link DEFAULTS.TAG_STYLES}
108
+ * @property {Object<string, string>} [tagStyles={}] - Specifies allowed styles for HTML tags.
109
+ * @property {string} [spanStyles=CONSTANTS.SPAN_STYLES] - Specifies allowed styles for the "span" tag.
110
+ * - The default follows {@link DEFAULTS.SPAN_STYLES}
111
+ * @property {string} [lineStyles=CONSTANTS.LINE_STYLES] - Specifies allowed styles for the "line" element (p..).
112
+ * - The default follows {@link DEFAULTS.LINE_STYLES}
113
+ * @property {string} [textDirection="ltr"] - Text direction: "ltr" or "rtl".
114
+ * @property {Array<string>} [reverseButtons=['indent-outdent']] - An array of command pairs whose shortcut icons should be opposite each other, depending on the "textDirection" mode.
115
+ * @property {number} [historyStackDelayTime=400] - Delay time for history stack updates (ms).
116
+ * @property {string} [lineAttrReset=""] - Line properties that should be reset when changing lines (e.g. "id|name").
117
+ * @property {string} [printClass=""] - Class name for printing.
118
+ * @property {string} [defaultLine="p"] - Default line element when inserting new lines.
119
+ * @property {"line"|"br"} [defaultLineBreakFormat="line"] - Specifies the default line break format.
120
+ * - [Recommended] "line" : is a line break that is divided into general tags.
121
+ * - [Not recommended] "br" : Line breaks are treated as <br> on the same line. (like shift+enter)
122
+ * - Line breaks are handled as <br> within "line".
123
+ * - You can create a new "line" by entering a line break twice in a row.
124
+ * - Formats that include "line", such as "Quote", still operate on a "line" basis.
125
+ * - ● suneditor processes work in "line" units.
126
+ * - ● When set to "br", performance may decrease when editing a lot of data.
127
+ * @property {Array<string>} [scopeSelectionTags=CONSTANTS.SCOPE_SELECTION_TAGS] - Tags treated as whole units when selecting all content.
128
+ * - The default follows {@link DEFAULTS.SCOPE_SELECTION_TAGS}
129
+ * @property {string} [__defaultElementWhitelist] - A custom string used to construct a list of HTML elements to allow.
130
+ * - The final list of allowed elements (regex pattern) is dynamically generated according to the following rules:
131
+ * - A list of required elements, {@link DEFAULTS.REQUIRED_ELEMENT_WHITELIST}, is always included.
132
+ * - If a string value is provided for this option (`__defaultElementWhitelist`):** That string value is used.
133
+ * - If this option is not provided or is not a string: The default constant {@link DEFAULTS.ELEMENT_WHITELIST} is used.
134
+ * - 1. If no options are given, the final pattern is:
135
+ * - 'a|img|p|div|...' (REQUIRED + DEFAULT)
136
+ * - 2. If options are given directly, the final pattern is:
137
+ * - 'a|img|custom|tags' (REQUIRED + options.__defaultElementWhitelist)
138
+ * @property {string} [elementWhitelist=""] - Specifies HTML elements to additionally allow beyond the 'default' allow list. Delimiter: "|" (e.g. "p|div", "*").
139
+ * - The value entered here will be added to the end of the default list determined by the {@link EditorBaseOptions.__defaultElementWhitelist} logic above.
140
+ * @property {string} [elementBlacklist=""] - Filters by specifying HTML elements that should not be used. Delimiter: "|" (e.g. "script|style").
141
+ * - Tags specified here will eventually be removed, even if they are included in other whitelists.
142
+ * @property {string} [__defaultAttributeWhitelist=CONSTANTS.ATTRIBUTE_WHITELIST] - A complete list of attributes that are allowed by default on all tags. Delimiter: "|" (e.g. "href|target").
143
+ * - The default follows {@link DEFAULTS.ATTRIBUTE_WHITELIST}
144
+ * @property {Object<string, string>} [attributeWhitelist=""] - Specifies additional attributes to allow for each tag. (e.g. {a: "href|target", img: "src|alt", "*": "id"}).
145
+ * - Rules for objects specified here will be merged into the {@link EditorBaseOptions.__defaultAttributeWhitelist}.
146
+ * @property {Object<string, string>} [attributeBlacklist=""] - Filter by specifying attributes to disallow by tag. (e.g. {a: "href|target", img: "src|alt", "*": "name"}).
147
+ * - Attributes specified here will eventually be removed even if they are allowed by other settings.
148
+ * @property {string} [__defaultFormatLine=CONSTANTS.FORMAT_LINE] - Specifies the tag to be used as the editor's default "line" element.
149
+ * - The default follows {@link DEFAULTS.FORMAT_LINE}
150
+ * - A list of required elements, {@link DEFAULTS.REQUIRED_FORMAT_LINE}, is always included.
151
+ * @property {string} [formatLine=__defaultFormatLine] - Additionally allowed "line" elements beyond the default. Delimiter: "|" (e.g. "p|div").
152
+ * It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatLine} to form the final 'line' element list.
153
+ * - "line" element also contain "brLine" element
154
+ * @property {string} [__defaultFormatBrLine=CONSTANTS.FORMAT_BR_LINE] - Specifies the tag to be used as the editor's default "brLine" element.
155
+ * - The default follows {@link DEFAULTS.FORMAT_BR_LINE}
156
+ * @property {string} [formatBrLine=__defaultFormatBrLine] - Additionally allowed "brLine" elements beyond the default. (e.g. "PRE").
157
+ * - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatBrLine} to form the final 'brLine' element list.
158
+ * - "brLine" elements is included in the "line" element.
159
+ * - "brLine" elements's line break is "BR" tag.
160
+ * ※ Entering the Enter key in the space on the last line ends "brLine" and appends "line".
161
+ * @property {string} [__defaultFormatClosureBrLine=CONSTANTS.FORMAT_CLOSURE_BR_LINE] - Specifies the tag to be used as the editor's default "closureBrLine" element.
162
+ * - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BR_LINE}
163
+ * @property {string} [formatClosureBrLine=__defaultFormatClosureBrLine] - Additionally allowed "closureBrLine" elements beyond the default.
164
+ * - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatClosureBrLine} to form the final 'closureBrLine' element list.
165
+ * - "closureBrLine" elements is included in the "brLine".
166
+ * - "closureBrLine" elements's line break is "BR" tag.
167
+ * - ※ You cannot exit this format with the Enter key or Backspace key.
168
+ * - ※ Use it only in special cases. ([ex] format of table cells)
169
+ * @property {string} [__defaultFormatBlock=CONSTANTS.FORMAT_BLOCK] - Specifies the tag to be used as the editor's default "block" element.
170
+ * - The default follows {@link DEFAULTS.FORMAT_BLOCK}
171
+ * @property {string} [formatBlock=__defaultFormatBlock] - Additionally allowed "block" elements beyond the default.
172
+ * - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatBlock} to form the final 'block' element list.
173
+ * - "block" is wrap the "line" and "component"
174
+ * @property {string} [__defaultFormatClosureBlock=CONSTANTS.FORMAT_CLOSURE_BLOCK] - Specifies the tag to be used as the editor's default "closureBlock" element.
175
+ * - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BLOCK}
176
+ * @property {string} [formatClosureBlock=__defaultFormatClosureBlock] - Additionally allowed "closureBlock" elements beyond the default.
177
+ * - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatClosureBlock} to form the final 'closureBlock' element list.
178
+ * - "closureBlock" elements is included in the "block".
179
+ * - "closureBlock" element is wrap the "line" and "component"
180
+ * - ※ You cannot exit this format with the Enter key or Backspace key.
181
+ * - ※ Use it only in special cases. (e.g. format of table cells)
182
+ * @property {string} [allowedEmptyTags=CONSTANTS.ALLOWED_EMPTY_NODE_LIST] - A list of tags that are allowed to be kept even if their values are empty.
183
+ * - The default follows {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST}
184
+ * - It is concatenated with the value of {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST} to form the final 'allowedEmptyTags' list.
185
+ * @property {number|string} [toolbar_width="auto"] - Toolbar width.
186
+ * @property {Element|string} [toolbar_container] - Container element for the toolbar.
187
+ * @property {number} [toolbar_sticky=0] - Enables sticky toolbar with optional offset.
188
+ * @property {boolean} [toolbar_hide=false] - Hides toolbar initially.
189
+ * @property {Object} [subToolbar] - Sub-toolbar configuration.
190
+ * @property {Array<Array<string>>} [subToolbar.buttonList] - List of Sub-toolbar buttons, grouped by sub-arrays.
191
+ * @property {"balloon"|"balloon-always"} [subToolbar.mode="balloon"] - Sub-toolbar mode: "balloon", "balloon-always".
192
+ * @property {number|string} [subToolbar.width="auto"] - Sub-toolbar width.
193
+ * @property {Element|string} [statusbar_container] - Container element for the status bar.
194
+ * @property {boolean} [shortcutsHint=true] - Displays shortcut hints in tooltips.
195
+ * @property {boolean} [shortcutsDisable=false] - Disables keyboard shortcuts.
196
+ * @property {Object<string, Array<string>>} [shortcuts] - Custom keyboard shortcuts.
197
+ * @property {number} [fullScreenOffset=0] - Offset applied when entering fullscreen mode.
198
+ * @property {string} [previewTemplate] - Custom template for preview mode.
199
+ * @property {string} [printTemplate] - Custom template for print mode.
200
+ * @property {boolean} [componentAutoSelect=false] - Enables automatic selection of inserted components.
201
+ * @property {string} [defaultUrlProtocol] - Default URL protocol for links.
202
+ * @property {Object<"copy", number>} [toastMessageTime] - {"copy": 1500} - Duration for displaying toast messages.
203
+ * @property {Object<string, string>} [icons] - Overrides the default icons.
204
+ * @property {string} [freeCodeViewMode=false] - Enables free code view mode.
205
+ * @property {boolean} [__lineFormatFilter=true] - Line format filter configuration.
206
+ * @property {boolean|Object<string, boolean>} [__pluginRetainFilter=true] - Plugin retain filter configuration.
207
+ * - You can turn it off/on globally with true/false or set it per plugin. (e.g. { table: false })
208
+ * @property {Array<string>} [__listCommonStyle=["fontSize", "color", "fontFamily", "fontWeight", "fontStyle"]] - Defines the list of styles that are applied directly to the `<li>` element
209
+ * - when a text style is applied to the entire list item.
210
+ * - For example, when changing the font size or color of a list item (`<li>`),
211
+ * - these styles will be applied to the `<li>` tag instead of wrapping the content inside additional tags.
212
+ * @property {Object<string, *>} [externalLibs] - External libraries like CodeMirror or MathJax.
213
+ *
214
+ * @property {Object<string, *>} [Dynamic_pluginOptions] - Dynamic plugin options, where the key is the plugin name and the value is its configuration.
215
+ */
216
+ /**
217
+ * @typedef {EditorBaseOptions & EditorFrameOptions} EditorInitOptions
218
+ */
219
+ /** ------------- [OPTIONS FRAG] ------------- */
220
+ /**
221
+ * @description For all EditorInitOptions keys, only boolean | null values are allowed.
222
+ * - 'fixed' → Immutable / null → Resettable.
223
+ * @type {Partial<Record<keyof EditorInitOptions, "fixed" | true>>}
224
+ */
225
+ export const OPTION_FRAME_FIXED_FLAG: Partial<Record<keyof EditorInitOptions, 'fixed' | true>>;
226
+ /**
227
+ * @description For all EditorInitOptions keys, only boolean | null values are allowed.
228
+ * - 'fixed' → Immutable / null → Resettable.
229
+ * @type {Partial<Record<keyof EditorInitOptions, "fixed" | true>>}
230
+ */
231
+ export const OPTION_FIXED_FLAG: Partial<Record<keyof EditorInitOptions, 'fixed' | true>>;
43
232
  export type EditorFrameOptions = {
44
233
  /**
45
234
  * - Initial value for the editor.
@@ -294,7 +483,7 @@ export type EditorBaseOptions = {
294
483
  };
295
484
  /**
296
485
  * - Specifies allowed styles for the "span" tag.
297
- * - The default follows {@link DEFAULTS.TEXT_STYLES}
486
+ * - The default follows {@link DEFAULTS.SPAN_STYLES}
298
487
  */
299
488
  spanStyles?: string;
300
489
  /**
@@ -56,12 +56,14 @@ export type ControllerParams = {
56
56
  parentsHide?: boolean | undefined;
57
57
  /**
58
58
  * The related sibling controller element that this controller is positioned relative to.
59
+ * - e.g.) table plugin :: 118
59
60
  */
60
61
  sibling?: HTMLElement | undefined;
61
62
  /**
62
- * The relative position of this controller to the sibling element (e.g., display above or beside the sibling).
63
+ * If true, This sibling controller is the main controller.
64
+ * - You must specify this option, if use "sibling"
63
65
  */
64
- siblingPosition?: 'top' | 'side';
66
+ siblingMain?: boolean | undefined;
65
67
  /**
66
68
  * If the controller is inside a form, set it to true.
67
69
  */
@@ -90,7 +92,9 @@ export type ControllerParams = {
90
92
  * @property {Array<HTMLElement>=} [parents=[]] The parent "controller" array when "controller" is opened nested.
91
93
  * @property {boolean=} [parentsHide=false] If true, the parent element is hidden when the controller is opened.
92
94
  * @property {HTMLElement=} [sibling=null] The related sibling controller element that this controller is positioned relative to.
93
- * @property {"top"|"side"} [siblingPosition="top"] The relative position of this controller to the sibling element (e.g., display above or beside the sibling).
95
+ * - e.g.) table plugin :: 118
96
+ * @property {boolean=} [siblingMain=false] If true, This sibling controller is the main controller.
97
+ * - You must specify this option, if use "sibling"
94
98
  * @property {boolean=} [isInsideForm=false] If the controller is inside a form, set it to true.
95
99
  * @property {boolean=} [isOutsideForm=false] If the controller is outside a form, set it to true.
96
100
  */
@@ -119,7 +123,7 @@ declare class Controller extends EditorInjector {
119
123
  parents: HTMLElement[];
120
124
  parentsHide: boolean;
121
125
  sibling: HTMLElement;
122
- siblingPosition: 'top' | 'side';
126
+ siblingMain: boolean;
123
127
  isInsideForm: boolean;
124
128
  isOutsideForm: boolean;
125
129
  toTop: boolean;
@@ -378,8 +378,9 @@ declare class Figure extends EditorInjector {
378
378
  * @description As style[block, inline] the component
379
379
  * @param {?Node} targetNode Target element
380
380
  * @param {"block"|"inline"} formatStyle Format style
381
+ * @returns {HTMLElement} New target element after conversion
381
382
  */
382
- convertAsFormat(targetNode: Node | null, formatStyle: 'block' | 'inline'): void;
383
+ convertAsFormat(targetNode: Node | null, formatStyle: 'block' | 'inline'): HTMLElement;
383
384
  /**
384
385
  * @private
385
386
  * @description Handles format conversion (block/inline) for the figure component and applies size changes.
@@ -66,7 +66,7 @@ declare class SelectMenu extends CoreInjector {
66
66
  openMethod: () => void;
67
67
  closeMethod: () => void;
68
68
  _refer: HTMLElement;
69
- _keydownTarget: Window | HTMLInputElement;
69
+ _keydownTarget: any;
70
70
  _selectMethod: (command: string) => void;
71
71
  _bindClose_key: any;
72
72
  _bindClose_mousedown: any;
@@ -412,6 +412,7 @@ declare class Table extends EditorInjector {
412
412
  /**
413
413
  * @private
414
414
  * @description Converts the width of <col> elements to percentages.
415
+ * @param {HTMLTableElement} target - The target table element.
415
416
  */
416
417
  private _resizePercentCol;
417
418
  /**
@@ -20,7 +20,10 @@ declare namespace _default {
20
20
  };
21
21
  /**
22
22
  * Creates a new instance of the SunEditor
23
- * @param {Element|Object<string, {target: Element, options: EditorFrameOptions_suneditor}>} target - Target element or multi-root object
23
+ * @param {Element|string|Object<string, {target: Element, options: EditorFrameOptions_suneditor}>} target
24
+ * - Element: The direct DOM element to initialize the editor on.
25
+ * - string: A CSS selector string. The corresponding element is selected using `document.querySelector`.
26
+ * - Object: For multi-root setup. Each key maps to a config with `{target, options}`.
24
27
  * @param {EditorInitOptions_suneditor} options - Initialization options
25
28
  * @param {EditorInitOptions_suneditor} [_init_options] - Optional preset initialization options
26
29
  * @returns {Editor} - Instance of the SunEditor
@@ -29,6 +32,7 @@ declare namespace _default {
29
32
  function create(
30
33
  target:
31
34
  | Element
35
+ | string
32
36
  | {
33
37
  [x: string]: {
34
38
  target: Element;
@@ -42,10 +46,10 @@ declare namespace _default {
42
46
  export default _default;
43
47
  export type EditorFrameOptions_suneditor = import('./core/section/options').EditorFrameOptions;
44
48
  export type EditorInitOptions_suneditor = import('./core/section/options').EditorInitOptions;
45
- import EditorInjector from './editorInjector';
46
- import Plugins from './plugins';
47
- import Modules from './modules';
48
- import Langs from './langs';
49
- import Helper from './helper';
49
+ import editorInjector from './editorInjector';
50
+ import plugins from './plugins';
51
+ import modules from './modules';
52
+ import langs from './langs';
53
+ import helper from './helper';
50
54
  import Editor from './core/editor';
51
- export { EditorInjector, Plugins, Modules, Langs, Helper };
55
+ export { editorInjector, plugins, modules, langs, helper };