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.
- package/CONTRIBUTING.md +8 -8
- package/README.md +44 -49
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +95 -53
- package/src/assets/design/color.css +2 -2
- package/src/assets/design/size.css +2 -0
- package/src/assets/icons/defaultIcons.js +16 -1
- package/src/assets/suneditor-contents.css +9 -8
- package/src/assets/suneditor.css +29 -26
- package/src/core/{section → base}/actives.js +20 -12
- package/src/core/base/history.js +4 -4
- package/src/core/class/char.js +10 -10
- package/src/core/class/component.js +146 -57
- package/src/core/class/format.js +94 -2458
- package/src/core/class/html.js +187 -129
- package/src/core/class/inline.js +1853 -0
- package/src/core/class/listFormat.js +582 -0
- package/src/core/class/menu.js +14 -3
- package/src/core/class/nodeTransform.js +9 -14
- package/src/core/class/offset.js +162 -197
- package/src/core/class/selection.js +137 -34
- package/src/core/class/toolbar.js +73 -52
- package/src/core/class/ui.js +11 -11
- package/src/core/class/viewer.js +56 -55
- package/src/core/config/context.js +122 -0
- package/src/core/config/frameContext.js +204 -0
- package/src/core/config/options.js +639 -0
- package/src/core/editor.js +181 -108
- package/src/core/event/actions/index.js +229 -0
- package/src/core/event/effects/common.registry.js +60 -0
- package/src/core/event/effects/keydown.registry.js +551 -0
- package/src/core/event/effects/ruleHelpers.js +145 -0
- package/src/core/{base → event}/eventManager.js +119 -201
- package/src/core/event/executor.js +21 -0
- package/src/core/{base/eventHandlers → event/handlers}/handler_toolbar.js +4 -4
- package/src/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.js +2 -2
- package/src/core/event/handlers/handler_ww_input.js +77 -0
- package/src/core/event/handlers/handler_ww_key.js +228 -0
- package/src/core/{base/eventHandlers → event/handlers}/handler_ww_mouse.js +3 -3
- package/src/core/event/ports.js +211 -0
- package/src/core/event/reducers/keydown.reducer.js +89 -0
- package/src/core/event/rules/keydown.rule.arrow.js +54 -0
- package/src/core/event/rules/keydown.rule.backspace.js +202 -0
- package/src/core/event/rules/keydown.rule.delete.js +126 -0
- package/src/core/event/rules/keydown.rule.enter.js +144 -0
- package/src/core/event/rules/keydown.rule.tab.js +29 -0
- package/src/core/section/constructor.js +79 -388
- package/src/core/section/documentType.js +47 -26
- package/src/core/util/instanceCheck.js +59 -0
- package/src/editorInjector/_classes.js +4 -0
- package/src/editorInjector/_core.js +17 -7
- package/src/editorInjector/index.js +10 -2
- package/src/events.js +6 -0
- package/src/helper/clipboard.js +24 -10
- package/src/helper/converter.js +17 -12
- package/src/helper/dom/domCheck.js +22 -3
- package/src/helper/dom/domQuery.js +91 -45
- package/src/helper/dom/domUtils.js +93 -19
- package/src/helper/dom/index.js +4 -0
- package/src/helper/env.js +11 -7
- package/src/helper/keyCodeMap.js +4 -3
- package/src/langs/ckb.js +1 -1
- package/src/langs/cs.js +1 -1
- package/src/langs/da.js +1 -1
- package/src/langs/de.js +1 -1
- package/src/langs/en.js +1 -1
- package/src/langs/es.js +1 -1
- package/src/langs/fa.js +1 -1
- package/src/langs/fr.js +1 -1
- package/src/langs/he.js +1 -1
- package/src/langs/hu.js +1 -1
- package/src/langs/it.js +1 -1
- package/src/langs/ja.js +1 -1
- package/src/langs/km.js +1 -1
- package/src/langs/ko.js +1 -1
- package/src/langs/lv.js +1 -1
- package/src/langs/nl.js +1 -1
- package/src/langs/pl.js +1 -1
- package/src/langs/pt_br.js +10 -10
- package/src/langs/ro.js +1 -1
- package/src/langs/ru.js +1 -1
- package/src/langs/se.js +1 -1
- package/src/langs/tr.js +1 -1
- package/src/langs/uk.js +1 -1
- package/src/langs/ur.js +1 -1
- package/src/langs/zh_cn.js +1 -1
- package/src/modules/ApiManager.js +25 -18
- package/src/modules/Browser.js +52 -61
- package/src/modules/ColorPicker.js +37 -38
- package/src/modules/Controller.js +85 -79
- package/src/modules/Figure.js +275 -187
- package/src/modules/FileManager.js +86 -92
- package/src/modules/HueSlider.js +67 -35
- package/src/modules/Modal.js +84 -77
- package/src/modules/ModalAnchorEditor.js +62 -79
- package/src/modules/SelectMenu.js +89 -86
- package/src/plugins/browser/audioGallery.js +9 -5
- package/src/plugins/browser/fileBrowser.js +10 -6
- package/src/plugins/browser/fileGallery.js +9 -5
- package/src/plugins/browser/imageGallery.js +9 -5
- package/src/plugins/browser/videoGallery.js +11 -6
- package/src/plugins/command/blockquote.js +1 -0
- package/src/plugins/command/exportPDF.js +11 -8
- package/src/plugins/command/fileUpload.js +41 -29
- package/src/plugins/command/list_bulleted.js +2 -1
- package/src/plugins/command/list_numbered.js +2 -1
- package/src/plugins/dropdown/align.js +8 -2
- package/src/plugins/dropdown/backgroundColor.js +19 -11
- package/src/plugins/dropdown/font.js +15 -9
- package/src/plugins/dropdown/fontColor.js +19 -11
- package/src/plugins/dropdown/formatBlock.js +7 -2
- package/src/plugins/dropdown/hr.js +7 -3
- package/src/plugins/dropdown/layout.js +6 -2
- package/src/plugins/dropdown/lineHeight.js +8 -3
- package/src/plugins/dropdown/list.js +2 -1
- package/src/plugins/dropdown/paragraphStyle.js +15 -11
- package/src/plugins/dropdown/{table.js → table/index.js} +514 -362
- package/src/plugins/dropdown/template.js +6 -2
- package/src/plugins/dropdown/textStyle.js +7 -3
- package/src/plugins/field/mention.js +33 -27
- package/src/plugins/input/fontSize.js +44 -37
- package/src/plugins/input/pageNavigator.js +3 -2
- package/src/plugins/modal/audio.js +90 -85
- package/src/plugins/modal/drawing.js +58 -66
- package/src/plugins/modal/embed.js +193 -180
- package/src/plugins/modal/image.js +441 -439
- package/src/plugins/modal/link.js +31 -8
- package/src/plugins/modal/math.js +23 -22
- package/src/plugins/modal/video.js +233 -230
- package/src/plugins/popup/anchor.js +24 -18
- package/src/suneditor.js +69 -24
- package/src/typedef.js +42 -19
- package/types/assets/icons/defaultIcons.d.ts +8 -0
- package/types/core/class/char.d.ts +1 -1
- package/types/core/class/component.d.ts +29 -7
- package/types/core/class/format.d.ts +4 -354
- package/types/core/class/html.d.ts +13 -4
- package/types/core/class/inline.d.ts +263 -0
- package/types/core/class/listFormat.d.ts +135 -0
- package/types/core/class/menu.d.ts +10 -2
- package/types/core/class/offset.d.ts +24 -26
- package/types/core/class/selection.d.ts +2 -0
- package/types/core/class/toolbar.d.ts +24 -11
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/class/viewer.d.ts +1 -1
- package/types/core/config/context.d.ts +157 -0
- package/types/core/config/frameContext.d.ts +367 -0
- package/types/core/config/options.d.ts +1119 -0
- package/types/core/editor.d.ts +101 -66
- package/types/core/event/actions/index.d.ts +47 -0
- package/types/core/event/effects/common.registry.d.ts +50 -0
- package/types/core/event/effects/keydown.registry.d.ts +73 -0
- package/types/core/event/effects/ruleHelpers.d.ts +31 -0
- package/types/core/{base → event}/eventManager.d.ts +15 -46
- package/types/core/event/executor.d.ts +6 -0
- package/types/core/event/handlers/handler_ww_input.d.ts +41 -0
- package/types/core/{base/eventHandlers/handler_ww_key_input.d.ts → event/handlers/handler_ww_key.d.ts} +4 -6
- package/types/core/event/ports.d.ts +255 -0
- package/types/core/event/reducers/keydown.reducer.d.ts +75 -0
- package/types/core/event/rules/keydown.rule.arrow.d.ts +8 -0
- package/types/core/event/rules/keydown.rule.backspace.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.delete.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.enter.d.ts +9 -0
- package/types/core/event/rules/keydown.rule.tab.d.ts +9 -0
- package/types/core/section/constructor.d.ts +101 -631
- package/types/core/section/documentType.d.ts +14 -4
- package/types/core/util/instanceCheck.d.ts +50 -0
- package/types/editorInjector/_classes.d.ts +4 -0
- package/types/editorInjector/_core.d.ts +17 -7
- package/types/editorInjector/index.d.ts +10 -2
- package/types/events.d.ts +1 -0
- package/types/helper/clipboard.d.ts +2 -2
- package/types/helper/converter.d.ts +6 -9
- package/types/helper/dom/domCheck.d.ts +7 -0
- package/types/helper/dom/domQuery.d.ts +19 -8
- package/types/helper/dom/domUtils.d.ts +24 -2
- package/types/helper/dom/index.d.ts +86 -1
- package/types/helper/env.d.ts +6 -1
- package/types/helper/index.d.ts +7 -1
- package/types/helper/keyCodeMap.d.ts +3 -3
- package/types/index.d.ts +23 -117
- package/types/langs/index.d.ts +2 -2
- package/types/modules/ApiManager.d.ts +1 -8
- package/types/modules/Browser.d.ts +4 -62
- package/types/modules/ColorPicker.d.ts +4 -21
- package/types/modules/Controller.d.ts +8 -64
- package/types/modules/Figure.d.ts +54 -50
- package/types/modules/FileManager.d.ts +1 -13
- package/types/modules/HueSlider.d.ts +13 -3
- package/types/modules/Modal.d.ts +0 -43
- package/types/modules/ModalAnchorEditor.d.ts +0 -73
- package/types/modules/SelectMenu.d.ts +0 -85
- package/types/modules/index.d.ts +3 -3
- package/types/plugins/browser/audioGallery.d.ts +29 -18
- package/types/plugins/browser/fileBrowser.d.ts +38 -27
- package/types/plugins/browser/fileGallery.d.ts +29 -18
- package/types/plugins/browser/imageGallery.d.ts +24 -16
- package/types/plugins/browser/videoGallery.d.ts +29 -18
- package/types/plugins/command/blockquote.d.ts +1 -0
- package/types/plugins/command/exportPDF.d.ts +18 -18
- package/types/plugins/command/fileUpload.d.ts +65 -45
- package/types/plugins/command/list_bulleted.d.ts +1 -0
- package/types/plugins/command/list_numbered.d.ts +1 -0
- package/types/plugins/dropdown/align.d.ts +13 -8
- package/types/plugins/dropdown/backgroundColor.d.ts +30 -19
- package/types/plugins/dropdown/font.d.ts +13 -12
- package/types/plugins/dropdown/fontColor.d.ts +30 -19
- package/types/plugins/dropdown/formatBlock.d.ts +13 -8
- package/types/plugins/dropdown/hr.d.ts +15 -11
- package/types/plugins/dropdown/layout.d.ts +15 -11
- package/types/plugins/dropdown/lineHeight.d.ts +16 -11
- package/types/plugins/dropdown/list.d.ts +1 -0
- package/types/plugins/dropdown/paragraphStyle.d.ts +31 -27
- package/types/plugins/dropdown/table/index.d.ts +582 -0
- package/types/plugins/dropdown/table.d.ts +41 -86
- package/types/plugins/dropdown/template.d.ts +15 -11
- package/types/plugins/dropdown/textStyle.d.ts +19 -11
- package/types/plugins/field/mention.d.ts +58 -56
- package/types/plugins/index.d.ts +38 -38
- package/types/plugins/input/fontSize.d.ts +46 -50
- package/types/plugins/modal/audio.d.ts +26 -56
- package/types/plugins/modal/drawing.d.ts +0 -85
- package/types/plugins/modal/embed.d.ts +15 -79
- package/types/plugins/modal/image.d.ts +24 -136
- package/types/plugins/modal/link.d.ts +34 -15
- package/types/plugins/modal/math.d.ts +0 -16
- package/types/plugins/modal/video.d.ts +17 -86
- package/types/plugins/popup/anchor.d.ts +1 -8
- package/types/suneditor.d.ts +70 -19
- package/types/typedef.d.ts +60 -46
- package/src/core/base/eventHandlers/handler_ww_key_input.js +0 -1200
- package/src/core/section/context.js +0 -102
- package/types/core/section/context.d.ts +0 -45
- package/types/langs/_Lang.d.ts +0 -194
- /package/src/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.js +0 -0
- /package/types/core/{section → base}/actives.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_toolbar.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_clipboard.d.ts +0 -0
- /package/types/core/{base/eventHandlers → event/handlers}/handler_ww_dragDrop.d.ts +0 -0
- /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 {
|
|
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 {
|
|
14
|
-
* @param {Array<{target: Element, key: *, options:
|
|
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 {
|
|
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:
|
|
30
|
+
options: __se__EditorOptions,
|
|
28
31
|
editorTargets: Array<{
|
|
29
32
|
target: Element;
|
|
30
33
|
key: any;
|
|
31
|
-
options:
|
|
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
|
|
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
|
-
* -
|
|
114
|
+
* - Editor context object
|
|
290
115
|
*/
|
|
291
|
-
|
|
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
|
-
* -
|
|
118
|
+
* - Carrier wrapper element
|
|
300
119
|
*/
|
|
301
|
-
|
|
120
|
+
carrierWrapper: HTMLElement;
|
|
302
121
|
/**
|
|
303
|
-
* -
|
|
122
|
+
* - Processed editor options (Map)
|
|
304
123
|
*/
|
|
305
|
-
|
|
124
|
+
options: __se__BaseOptions;
|
|
306
125
|
/**
|
|
307
|
-
* -
|
|
126
|
+
* - Loaded plugins
|
|
308
127
|
*/
|
|
309
|
-
|
|
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
|
-
* -
|
|
132
|
+
* - Icon set
|
|
513
133
|
*/
|
|
514
|
-
|
|
134
|
+
icons: {
|
|
515
135
|
[x: string]: string;
|
|
516
136
|
};
|
|
517
137
|
/**
|
|
518
|
-
* -
|
|
138
|
+
* - Language pack
|
|
519
139
|
*/
|
|
520
|
-
|
|
140
|
+
lang: {
|
|
521
141
|
[x: string]: string;
|
|
522
142
|
};
|
|
523
143
|
/**
|
|
524
|
-
* -
|
|
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
|
-
|
|
146
|
+
value: string | null;
|
|
570
147
|
/**
|
|
571
|
-
* -
|
|
148
|
+
* - Root frame ID
|
|
572
149
|
*/
|
|
573
|
-
|
|
150
|
+
rootId: string | null;
|
|
574
151
|
/**
|
|
575
|
-
* -
|
|
152
|
+
* - Array of frame keys
|
|
576
153
|
*/
|
|
577
|
-
|
|
154
|
+
rootKeys: Array<string | null>;
|
|
578
155
|
/**
|
|
579
|
-
* -
|
|
156
|
+
* - Map of frame contexts
|
|
580
157
|
*/
|
|
581
|
-
|
|
158
|
+
frameRoots: Map<string | null, ReturnType<typeof CreateFrameContext>>;
|
|
582
159
|
/**
|
|
583
|
-
* -
|
|
160
|
+
* - Plugin toolbar buttons
|
|
584
161
|
*/
|
|
585
|
-
|
|
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
|
-
* -
|
|
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
|
-
|
|
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
|
-
* -
|
|
170
|
+
* - Sub-toolbar plugin buttons
|
|
686
171
|
*/
|
|
687
|
-
|
|
172
|
+
pluginCallButtons_sub:
|
|
173
|
+
| {
|
|
174
|
+
[x: string]: Array<HTMLElement>;
|
|
175
|
+
}
|
|
176
|
+
| [];
|
|
688
177
|
/**
|
|
689
|
-
* -
|
|
178
|
+
* - Sub-toolbar responsive buttons
|
|
690
179
|
*/
|
|
691
|
-
|
|
180
|
+
responsiveButtons_sub: Array<HTMLElement>;
|
|
181
|
+
};
|
|
182
|
+
export type InitOptionsReturnType = {
|
|
692
183
|
/**
|
|
693
|
-
* -
|
|
184
|
+
* - Processed base options (Map containing {@link AllBaseOptions_constructor} keys)
|
|
694
185
|
*/
|
|
695
|
-
|
|
186
|
+
o: __se__BaseOptions;
|
|
696
187
|
/**
|
|
697
|
-
* -
|
|
188
|
+
* - Icon set
|
|
698
189
|
*/
|
|
699
|
-
|
|
700
|
-
[x: string]: string
|
|
190
|
+
i: {
|
|
191
|
+
[x: string]: string;
|
|
701
192
|
};
|
|
702
193
|
/**
|
|
703
|
-
* -
|
|
704
|
-
*/
|
|
705
|
-
fullScreenOffset?: number;
|
|
706
|
-
/**
|
|
707
|
-
* - Custom template for preview mode.
|
|
194
|
+
* - Language pack
|
|
708
195
|
*/
|
|
709
|
-
|
|
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
|
-
* -
|
|
200
|
+
* - Initial editor value
|
|
738
201
|
*/
|
|
739
|
-
|
|
202
|
+
v: string | null;
|
|
740
203
|
/**
|
|
741
|
-
* -
|
|
204
|
+
* - Toolbar button list (arrays for groups, strings for single buttons)
|
|
742
205
|
*/
|
|
743
|
-
|
|
744
|
-
/**
|
|
745
|
-
* - Plugin retain filter configuration.
|
|
746
|
-
*/
|
|
747
|
-
__pluginRetainFilter?: boolean;
|
|
206
|
+
buttons: Array<string[] | string>;
|
|
748
207
|
/**
|
|
749
|
-
* -
|
|
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
|
-
|
|
210
|
+
subButtons: Array<string[] | string> | null;
|
|
755
211
|
/**
|
|
756
|
-
* -
|
|
212
|
+
* - Container element for status bar (if specified)
|
|
757
213
|
*/
|
|
758
|
-
|
|
759
|
-
[x: string]: any;
|
|
760
|
-
};
|
|
214
|
+
statusbarContainer: Element | null;
|
|
761
215
|
/**
|
|
762
|
-
* -
|
|
216
|
+
* - Map of frame-specific options (frame key => {@link __se__FrameOptions})
|
|
763
217
|
*/
|
|
764
|
-
|
|
765
|
-
[x: string]: any;
|
|
766
|
-
};
|
|
218
|
+
frameMap: Map<string | null, __se__FrameOptions>;
|
|
767
219
|
};
|
|
768
|
-
|
|
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:
|
|
772
|
-
* @param {
|
|
773
|
-
* @returns {
|
|
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:
|
|
250
|
+
options: __se__EditorFrameOptions;
|
|
780
251
|
}>,
|
|
781
|
-
options:
|
|
782
|
-
):
|
|
783
|
-
|
|
784
|
-
};
|
|
252
|
+
options: __se__EditorOptions
|
|
253
|
+
): ConstructorReturnType;
|
|
254
|
+
import { CreateFrameContext } from '../config/frameContext';
|