suneditor 3.0.0-beta.2 → 3.0.0-beta.20
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 +186 -184
- package/LICENSE +21 -21
- package/README.md +157 -180
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +126 -123
- package/src/assets/design/color.css +131 -121
- package/src/assets/design/index.css +3 -3
- package/src/assets/design/size.css +37 -35
- package/src/assets/design/typography.css +37 -37
- package/src/assets/icons/defaultIcons.js +247 -232
- package/src/assets/suneditor-contents.css +779 -778
- package/src/assets/suneditor.css +43 -35
- package/src/core/base/eventHandlers/handler_toolbar.js +135 -135
- package/src/core/base/eventHandlers/handler_ww_clipboard.js +56 -56
- package/src/core/base/eventHandlers/handler_ww_dragDrop.js +115 -113
- package/src/core/base/eventHandlers/handler_ww_key_input.js +1200 -1200
- package/src/core/base/eventHandlers/handler_ww_mouse.js +194 -194
- package/src/core/base/eventManager.js +1550 -1484
- package/src/core/base/history.js +355 -355
- package/src/core/class/char.js +163 -162
- package/src/core/class/component.js +856 -842
- package/src/core/class/format.js +3433 -3422
- package/src/core/class/html.js +1927 -1890
- package/src/core/class/menu.js +357 -346
- package/src/core/class/nodeTransform.js +424 -424
- package/src/core/class/offset.js +858 -891
- package/src/core/class/selection.js +710 -620
- package/src/core/class/shortcuts.js +98 -98
- package/src/core/class/toolbar.js +438 -430
- package/src/core/class/ui.js +424 -422
- package/src/core/class/viewer.js +750 -750
- package/src/core/editor.js +1810 -1708
- package/src/core/section/actives.js +268 -241
- package/src/core/section/constructor.js +1348 -1661
- package/src/core/section/context.js +102 -102
- package/src/core/section/documentType.js +582 -561
- package/src/core/section/options.js +367 -0
- package/src/core/util/instanceCheck.js +59 -0
- package/src/editorInjector/_classes.js +36 -36
- package/src/editorInjector/_core.js +92 -92
- package/src/editorInjector/index.js +75 -75
- package/src/events.js +634 -622
- package/src/helper/clipboard.js +59 -59
- package/src/helper/converter.js +586 -564
- package/src/helper/dom/domCheck.js +304 -304
- package/src/helper/dom/domQuery.js +677 -669
- package/src/helper/dom/domUtils.js +618 -557
- package/src/helper/dom/index.js +12 -12
- package/src/helper/env.js +249 -240
- package/src/helper/index.js +25 -25
- package/src/helper/keyCodeMap.js +183 -183
- package/src/helper/numbers.js +72 -72
- package/src/helper/unicode.js +47 -47
- package/src/langs/ckb.js +231 -231
- package/src/langs/cs.js +231 -231
- package/src/langs/da.js +231 -231
- package/src/langs/de.js +231 -231
- package/src/langs/en.js +230 -230
- package/src/langs/es.js +231 -231
- package/src/langs/fa.js +231 -231
- package/src/langs/fr.js +231 -231
- package/src/langs/he.js +231 -231
- package/src/langs/hu.js +230 -230
- package/src/langs/index.js +28 -28
- package/src/langs/it.js +231 -231
- package/src/langs/ja.js +230 -230
- package/src/langs/km.js +230 -230
- package/src/langs/ko.js +230 -230
- package/src/langs/lv.js +231 -231
- package/src/langs/nl.js +231 -231
- package/src/langs/pl.js +231 -231
- package/src/langs/pt_br.js +231 -231
- package/src/langs/ro.js +231 -231
- package/src/langs/ru.js +231 -231
- package/src/langs/se.js +231 -231
- package/src/langs/tr.js +231 -231
- package/src/langs/uk.js +231 -231
- package/src/langs/ur.js +231 -231
- package/src/langs/zh_cn.js +231 -231
- package/src/modules/ApiManager.js +191 -191
- package/src/modules/Browser.js +669 -667
- package/src/modules/ColorPicker.js +364 -362
- package/src/modules/Controller.js +474 -454
- package/src/modules/Figure.js +1620 -1617
- package/src/modules/FileManager.js +359 -359
- package/src/modules/HueSlider.js +577 -565
- package/src/modules/Modal.js +346 -346
- package/src/modules/ModalAnchorEditor.js +643 -643
- package/src/modules/SelectMenu.js +549 -549
- package/src/modules/_DragHandle.js +17 -17
- package/src/modules/index.js +14 -14
- package/src/plugins/browser/audioGallery.js +83 -83
- package/src/plugins/browser/fileBrowser.js +103 -103
- package/src/plugins/browser/fileGallery.js +83 -83
- package/src/plugins/browser/imageGallery.js +81 -81
- package/src/plugins/browser/videoGallery.js +103 -103
- package/src/plugins/command/blockquote.js +61 -60
- package/src/plugins/command/exportPDF.js +134 -134
- package/src/plugins/command/fileUpload.js +456 -456
- package/src/plugins/command/list_bulleted.js +149 -148
- package/src/plugins/command/list_numbered.js +152 -151
- package/src/plugins/dropdown/align.js +157 -155
- package/src/plugins/dropdown/backgroundColor.js +108 -104
- package/src/plugins/dropdown/font.js +141 -137
- package/src/plugins/dropdown/fontColor.js +109 -105
- package/src/plugins/dropdown/formatBlock.js +170 -178
- package/src/plugins/dropdown/hr.js +152 -152
- package/src/plugins/dropdown/layout.js +83 -83
- package/src/plugins/dropdown/lineHeight.js +131 -130
- package/src/plugins/dropdown/list.js +123 -122
- package/src/plugins/dropdown/paragraphStyle.js +138 -138
- package/src/plugins/dropdown/table.js +4110 -4000
- package/src/plugins/dropdown/template.js +83 -83
- package/src/plugins/dropdown/textStyle.js +149 -149
- package/src/plugins/field/mention.js +242 -242
- package/src/plugins/index.js +120 -120
- package/src/plugins/input/fontSize.js +414 -410
- package/src/plugins/input/pageNavigator.js +71 -70
- package/src/plugins/modal/audio.js +677 -677
- package/src/plugins/modal/drawing.js +537 -531
- package/src/plugins/modal/embed.js +886 -886
- package/src/plugins/modal/image.js +1377 -1376
- package/src/plugins/modal/link.js +248 -240
- package/src/plugins/modal/math.js +563 -563
- package/src/plugins/modal/video.js +1226 -1226
- package/src/plugins/popup/anchor.js +224 -222
- package/src/suneditor.js +114 -107
- package/src/themes/dark.css +132 -122
- package/src/typedef.js +132 -130
- package/types/assets/icons/defaultIcons.d.ts +8 -0
- package/types/core/base/eventManager.d.ts +29 -4
- package/types/core/class/char.d.ts +2 -1
- package/types/core/class/component.d.ts +1 -2
- package/types/core/class/format.d.ts +8 -1
- package/types/core/class/html.d.ts +8 -0
- package/types/core/class/menu.d.ts +8 -0
- 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 +6 -0
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/editor.d.ts +34 -12
- package/types/core/section/constructor.d.ts +5 -638
- package/types/core/section/documentType.d.ts +12 -2
- package/types/core/section/options.d.ts +740 -0
- package/types/core/util/instanceCheck.d.ts +50 -0
- package/types/editorInjector/_core.d.ts +5 -5
- package/types/editorInjector/index.d.ts +2 -2
- package/types/events.d.ts +2 -0
- package/types/helper/converter.d.ts +9 -0
- package/types/helper/dom/domQuery.d.ts +5 -5
- package/types/helper/dom/domUtils.d.ts +8 -0
- package/types/helper/env.d.ts +6 -1
- package/types/helper/index.d.ts +4 -1
- package/types/index.d.ts +122 -120
- package/types/langs/_Lang.d.ts +194 -194
- package/types/modules/ColorPicker.d.ts +5 -1
- package/types/modules/Controller.d.ts +8 -4
- package/types/modules/Figure.d.ts +2 -1
- package/types/modules/HueSlider.d.ts +4 -1
- package/types/modules/SelectMenu.d.ts +1 -1
- package/types/plugins/command/blockquote.d.ts +1 -0
- 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 +1 -0
- package/types/plugins/dropdown/backgroundColor.d.ts +1 -0
- package/types/plugins/dropdown/font.d.ts +1 -0
- package/types/plugins/dropdown/fontColor.d.ts +1 -0
- package/types/plugins/dropdown/formatBlock.d.ts +3 -2
- package/types/plugins/dropdown/lineHeight.d.ts +1 -0
- package/types/plugins/dropdown/list.d.ts +1 -0
- package/types/plugins/dropdown/table.d.ts +6 -0
- package/types/plugins/input/fontSize.d.ts +1 -0
- package/types/plugins/modal/drawing.d.ts +4 -0
- package/types/plugins/modal/link.d.ts +32 -15
- package/types/suneditor.d.ts +13 -9
- package/types/typedef.d.ts +8 -0
|
@@ -0,0 +1,740 @@
|
|
|
1
|
+
export namespace DEFAULTS {
|
|
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;
|
|
26
|
+
let TAG_STYLES: {
|
|
27
|
+
'table|th|td': string;
|
|
28
|
+
'table|td': string;
|
|
29
|
+
tr: string;
|
|
30
|
+
col: string;
|
|
31
|
+
'ol|ul': string;
|
|
32
|
+
};
|
|
33
|
+
let SPAN_STYLES: string;
|
|
34
|
+
let LINE_STYLES: string;
|
|
35
|
+
let RETAIN_STYLE_MODE: string[];
|
|
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={spellcheck: "false"}] - 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=null] - The maximum number of characters allowed to be inserted into the editor.
|
|
62
|
+
* @property {string} [charCounter_label=null] - 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 {"repeat"|"always"|"none"} [retainStyleMode="repeat"] - This option determines how inline elements (such as <span>, <strong>, etc.) are handled when deleting text.
|
|
92
|
+
* - "repeat": Inline styles are retained unless the backspace key is repeatedly pressed. If the user continuously presses backspace, the styles will eventually be removed.
|
|
93
|
+
* - "none": Inline styles are not retained at all. When deleting text, the associated inline elements are immediately removed along with it.
|
|
94
|
+
* - "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.
|
|
95
|
+
* @property {Object<string, boolean>} [allowedExtraTags=CONSTANTS.EXTRA_TAG_MAP] - Specifies extra allowed or disallowed tags.
|
|
96
|
+
* - The default follows {@link DEFAULTS.EXTRA_TAG_MAP}
|
|
97
|
+
* @property {Object<string, (...args: *) => *>} [events={}] - Custom event handlers.
|
|
98
|
+
* @property {string} [__textStyleTags=CONSTANTS.TEXT_STYLE_TAGS] - The basic tags that serves as the base for "textStyleTags"
|
|
99
|
+
* - The default follows {@link DEFAULTS.TEXT_STYLE_TAGS}
|
|
100
|
+
* @property {string} [textStyleTags=__textStyleTags] - Additional text style tags.
|
|
101
|
+
* - The default follows {@link EditorBaseOptions.__textStyleTags}
|
|
102
|
+
* @property {Object<string, string>} [convertTextTags={bold: "strong", underline: "u", italic: "em", strike: "del", subscript: "sub", superscript: "sup"}] - Maps text styles to specific HTML tags.
|
|
103
|
+
* @property {string} [allUsedStyles] - Specifies additional styles to the list of allowed styles. Delimiter: "|" (e.g. "color|background-color").
|
|
104
|
+
* @property {Object<string, string>} [__tagStyles=CONSTANTS.TAG_STYLES] - The basic tags that serves as the base for "tagStyles"
|
|
105
|
+
* - The default follows {@link DEFAULTS.TAG_STYLES}
|
|
106
|
+
* @property {Object<string, string>} [tagStyles={}] - Specifies allowed styles for HTML tags.
|
|
107
|
+
* @property {string} [spanStyles=CONSTANTS.SPAN_STYLES] - Specifies allowed styles for the "span" tag.
|
|
108
|
+
* - The default follows {@link DEFAULTS.SPAN_STYLES}
|
|
109
|
+
* @property {string} [lineStyles=CONSTANTS.LINE_STYLES] - Specifies allowed styles for the "line" element (p..).
|
|
110
|
+
* - The default follows {@link DEFAULTS.LINE_STYLES}
|
|
111
|
+
* @property {string} [textDirection="ltr"] - Text direction: "ltr" or "rtl".
|
|
112
|
+
* @property {Array<string>} [reverseButtons=['indent-outdent']] - An array of command pairs whose shortcut icons should be opposite each other, depending on the "textDirection" mode.
|
|
113
|
+
* @property {number} [historyStackDelayTime=400] - Delay time for history stack updates (ms).
|
|
114
|
+
* @property {string} [lineAttrReset=""] - Line properties that should be reset when changing lines (e.g. "id|name").
|
|
115
|
+
* @property {string} [printClass=""] - Class name for printing.
|
|
116
|
+
* @property {string} [defaultLine="p"] - Default line element when inserting new lines.
|
|
117
|
+
* @property {"line"|"br"} [defaultLineBreakFormat="line"] - Specifies the default line break format.
|
|
118
|
+
* - [Recommended] "line" : is a line break that is divided into general tags.
|
|
119
|
+
* - [Not recommended] "br" : Line breaks are treated as <br> on the same line. (like shift+enter)
|
|
120
|
+
* - Line breaks are handled as <br> within "line".
|
|
121
|
+
* - You can create a new "line" by entering a line break twice in a row.
|
|
122
|
+
* - Formats that include "line", such as "Quote", still operate on a "line" basis.
|
|
123
|
+
* - ● suneditor processes work in "line" units.
|
|
124
|
+
* - ● When set to "br", performance may decrease when editing a lot of data.
|
|
125
|
+
* @property {Array<string>} [scopeSelectionTags=CONSTANTS.SCOPE_SELECTION_TAGS] - Tags treated as whole units when selecting all content.
|
|
126
|
+
* - The default follows {@link DEFAULTS.SCOPE_SELECTION_TAGS}
|
|
127
|
+
* @property {string} [__defaultElementWhitelist] - A custom string used to construct a list of HTML elements to allow.
|
|
128
|
+
* - The final list of allowed elements (regex pattern) is dynamically generated according to the following rules:
|
|
129
|
+
* - A list of required elements, {@link DEFAULTS.REQUIRED_ELEMENT_WHITELIST}, is always included.
|
|
130
|
+
* - If a string value is provided for this option (`__defaultElementWhitelist`):** That string value is used.
|
|
131
|
+
* - If this option is not provided or is not a string: The default constant {@link DEFAULTS.ELEMENT_WHITELIST} is used.
|
|
132
|
+
* - 1. If no options are given, the final pattern is:
|
|
133
|
+
* - 'a|img|p|div|...' (REQUIRED + DEFAULT)
|
|
134
|
+
* - 2. If options are given directly, the final pattern is:
|
|
135
|
+
* - 'a|img|custom|tags' (REQUIRED + options.__defaultElementWhitelist)
|
|
136
|
+
* @property {string} [elementWhitelist=""] - Specifies HTML elements to additionally allow beyond the 'default' allow list. Delimiter: "|" (e.g. "p|div", "*").
|
|
137
|
+
* - The value entered here will be added to the end of the default list determined by the {@link EditorBaseOptions.__defaultElementWhitelist} logic above.
|
|
138
|
+
* @property {string} [elementBlacklist=""] - Filters by specifying HTML elements that should not be used. Delimiter: "|" (e.g. "script|style").
|
|
139
|
+
* - Tags specified here will eventually be removed, even if they are included in other whitelists.
|
|
140
|
+
* @property {string} [__defaultAttributeWhitelist=CONSTANTS.ATTRIBUTE_WHITELIST] - A complete list of attributes that are allowed by default on all tags. Delimiter: "|" (e.g. "href|target").
|
|
141
|
+
* - The default follows {@link DEFAULTS.ATTRIBUTE_WHITELIST}
|
|
142
|
+
* @property {Object<string, string>} [attributeWhitelist=null] - Specifies additional attributes to allow for each tag. (e.g. {a: "href|target", img: "src|alt", "*": "id"}).
|
|
143
|
+
* - Rules for objects specified here will be merged into the {@link EditorBaseOptions.__defaultAttributeWhitelist}.
|
|
144
|
+
* @property {Object<string, string>} [attributeBlacklist=null] - Filter by specifying attributes to disallow by tag. (e.g. {a: "href|target", img: "src|alt", "*": "name"}).
|
|
145
|
+
* - Attributes specified here will eventually be removed even if they are allowed by other settings.
|
|
146
|
+
* @property {string} [__defaultFormatLine=CONSTANTS.FORMAT_LINE] - Specifies the tag to be used as the editor's default "line" element.
|
|
147
|
+
* - The default follows {@link DEFAULTS.FORMAT_LINE}
|
|
148
|
+
* - A list of required elements, {@link DEFAULTS.REQUIRED_FORMAT_LINE}, is always included.
|
|
149
|
+
* @property {string} [formatLine=__defaultFormatLine] - Additionally allowed "line" elements beyond the default. Delimiter: "|" (e.g. "p|div").
|
|
150
|
+
* It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatLine} to form the final 'line' element list.
|
|
151
|
+
* - "line" element also contain "brLine" element
|
|
152
|
+
* @property {string} [__defaultFormatBrLine=CONSTANTS.FORMAT_BR_LINE] - Specifies the tag to be used as the editor's default "brLine" element.
|
|
153
|
+
* - The default follows {@link DEFAULTS.FORMAT_BR_LINE}
|
|
154
|
+
* @property {string} [formatBrLine=__defaultFormatBrLine] - Additionally allowed "brLine" elements beyond the default. (e.g. "PRE").
|
|
155
|
+
* - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatBrLine} to form the final 'brLine' element list.
|
|
156
|
+
* - "brLine" elements is included in the "line" element.
|
|
157
|
+
* - "brLine" elements's line break is "BR" tag.
|
|
158
|
+
* ※ Entering the Enter key in the space on the last line ends "brLine" and appends "line".
|
|
159
|
+
* @property {string} [__defaultFormatClosureBrLine=CONSTANTS.FORMAT_CLOSURE_BR_LINE] - Specifies the tag to be used as the editor's default "closureBrLine" element.
|
|
160
|
+
* - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BR_LINE}
|
|
161
|
+
* @property {string} [formatClosureBrLine=__defaultFormatClosureBrLine] - Additionally allowed "closureBrLine" elements beyond the default.
|
|
162
|
+
* - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatClosureBrLine} to form the final 'closureBrLine' element list.
|
|
163
|
+
* - "closureBrLine" elements is included in the "brLine".
|
|
164
|
+
* - "closureBrLine" elements's line break is "BR" tag.
|
|
165
|
+
* - ※ You cannot exit this format with the Enter key or Backspace key.
|
|
166
|
+
* - ※ Use it only in special cases. ([ex] format of table cells)
|
|
167
|
+
* @property {string} [__defaultFormatBlock=CONSTANTS.FORMAT_BLOCK] - Specifies the tag to be used as the editor's default "block" element.
|
|
168
|
+
* - The default follows {@link DEFAULTS.FORMAT_BLOCK}
|
|
169
|
+
* @property {string} [formatBlock=__defaultFormatBlock] - Additionally allowed "block" elements beyond the default.
|
|
170
|
+
* - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatBlock} to form the final 'block' element list.
|
|
171
|
+
* - "block" is wrap the "line" and "component"
|
|
172
|
+
* @property {string} [__defaultFormatClosureBlock=CONSTANTS.FORMAT_CLOSURE_BLOCK] - Specifies the tag to be used as the editor's default "closureBlock" element.
|
|
173
|
+
* - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BLOCK}
|
|
174
|
+
* @property {string} [formatClosureBlock=__defaultFormatClosureBlock] - Additionally allowed "closureBlock" elements beyond the default.
|
|
175
|
+
* - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatClosureBlock} to form the final 'closureBlock' element list.
|
|
176
|
+
* - "closureBlock" elements is included in the "block".
|
|
177
|
+
* - "closureBlock" element is wrap the "line" and "component"
|
|
178
|
+
* - ※ You cannot exit this format with the Enter key or Backspace key.
|
|
179
|
+
* - ※ Use it only in special cases. (e.g. format of table cells)
|
|
180
|
+
* @property {string} [allowedEmptyTags=CONSTANTS.ALLOWED_EMPTY_NODE_LIST] - A list of tags that are allowed to be kept even if their values are empty.
|
|
181
|
+
* - The default follows {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST}
|
|
182
|
+
* - It is concatenated with the value of {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST} to form the final 'allowedEmptyTags' list.
|
|
183
|
+
* @property {number|string} [toolbar_width="auto"] - Toolbar width.
|
|
184
|
+
* @property {Element|string} [toolbar_container] - Container element for the toolbar.
|
|
185
|
+
* @property {number} [toolbar_sticky=0] - Enables sticky toolbar with optional offset.
|
|
186
|
+
* @property {boolean} [toolbar_hide=false] - Hides toolbar initially.
|
|
187
|
+
* @property {Object} [subToolbar={}] - Sub-toolbar configuration.
|
|
188
|
+
* @property {Array<Array<string>>} [subToolbar.buttonList] - List of Sub-toolbar buttons, grouped by sub-arrays.
|
|
189
|
+
* @property {"balloon"|"balloon-always"} [subToolbar.mode="balloon"] - Sub-toolbar mode: "balloon", "balloon-always".
|
|
190
|
+
* @property {number|string} [subToolbar.width="auto"] - Sub-toolbar width.
|
|
191
|
+
* @property {Element|string} [statusbar_container] - Container element for the status bar.
|
|
192
|
+
* @property {boolean} [shortcutsHint=true] - Displays shortcut hints in tooltips.
|
|
193
|
+
* @property {boolean} [shortcutsDisable=false] - Disables keyboard shortcuts.
|
|
194
|
+
* @property {Object<string, Array<string>>} [shortcuts={}] - Custom keyboard shortcuts.
|
|
195
|
+
* @property {number} [fullScreenOffset=0] - Offset applied when entering fullscreen mode.
|
|
196
|
+
* @property {string} [previewTemplate=null] - Custom template for preview mode.
|
|
197
|
+
* @property {string} [printTemplate=null] - Custom template for print mode.
|
|
198
|
+
* @property {boolean} [componentAutoSelect=false] - Enables automatic selection of inserted components.
|
|
199
|
+
* @property {string} [defaultUrlProtocol=null] - Default URL protocol for links.
|
|
200
|
+
* @property {Object<"copy", number>} [toastMessageTime={copy: 1500}] - {"copy": 1500} - Duration for displaying toast messages.
|
|
201
|
+
* @property {Object<string, string>} [icons] - Overrides the default icons.
|
|
202
|
+
* @property {string} [freeCodeViewMode=false] - Enables free code view mode.
|
|
203
|
+
* @property {boolean} [__lineFormatFilter=true] - Line format filter configuration.
|
|
204
|
+
* @property {boolean|Object<string, boolean>} [__pluginRetainFilter=true] - Plugin retain filter configuration.
|
|
205
|
+
* - You can turn it off/on globally with true/false or set it per plugin. (e.g. { table: false })
|
|
206
|
+
* @property {Array<string>} [__listCommonStyle=["fontSize", "color", "fontFamily", "fontWeight", "fontStyle"]] - Defines the list of styles that are applied directly to the `<li>` element
|
|
207
|
+
* - when a text style is applied to the entire list item.
|
|
208
|
+
* - For example, when changing the font size or color of a list item (`<li>`),
|
|
209
|
+
* - these styles will be applied to the `<li>` tag instead of wrapping the content inside additional tags.
|
|
210
|
+
* @property {Object<string, *>} [externalLibs] - External libraries like CodeMirror or MathJax.
|
|
211
|
+
*
|
|
212
|
+
* @property {Object<string, *>} [Dynamic_pluginOptions] - Dynamic plugin options, where the key is the plugin name and the value is its configuration.
|
|
213
|
+
*/
|
|
214
|
+
/**
|
|
215
|
+
* @typedef {EditorBaseOptions & EditorFrameOptions} EditorInitOptions
|
|
216
|
+
*/
|
|
217
|
+
/** ------------- [OPTIONS FRAG] ------------- */
|
|
218
|
+
/**
|
|
219
|
+
* @description For all EditorInitOptions keys, only boolean | null values are allowed.
|
|
220
|
+
* - 'fixed' → Immutable / null → Resettable.
|
|
221
|
+
* @type {Partial<Record<keyof EditorInitOptions, "fixed" | true>>}
|
|
222
|
+
*/
|
|
223
|
+
export const OPTION_FRAME_FIXED_FLAG: Partial<Record<keyof EditorInitOptions, 'fixed' | true>>;
|
|
224
|
+
/**
|
|
225
|
+
* @description For all EditorInitOptions keys, only boolean | null values are allowed.
|
|
226
|
+
* - 'fixed' → Immutable / null → Resettable.
|
|
227
|
+
* @type {Partial<Record<keyof EditorInitOptions, "fixed" | true>>}
|
|
228
|
+
*/
|
|
229
|
+
export const OPTION_FIXED_FLAG: Partial<Record<keyof EditorInitOptions, 'fixed' | true>>;
|
|
230
|
+
export type EditorFrameOptions = {
|
|
231
|
+
/**
|
|
232
|
+
* - Initial value for the editor.
|
|
233
|
+
*/
|
|
234
|
+
value?: string;
|
|
235
|
+
/**
|
|
236
|
+
* - Placeholder text.
|
|
237
|
+
*/
|
|
238
|
+
placeholder?: string;
|
|
239
|
+
/**
|
|
240
|
+
* - Attributes for the editable frame[.sun-editor-editable]. (e.g. [key]: value)
|
|
241
|
+
*/
|
|
242
|
+
editableFrameAttributes?: {
|
|
243
|
+
[x: string]: string;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* - Width for the editor.
|
|
247
|
+
*/
|
|
248
|
+
width?: string;
|
|
249
|
+
/**
|
|
250
|
+
* - Min width for the editor.
|
|
251
|
+
*/
|
|
252
|
+
minWidth?: string;
|
|
253
|
+
/**
|
|
254
|
+
* - Max width for the editor.
|
|
255
|
+
*/
|
|
256
|
+
maxWidth?: string;
|
|
257
|
+
/**
|
|
258
|
+
* - Height for the editor.
|
|
259
|
+
*/
|
|
260
|
+
height?: string;
|
|
261
|
+
/**
|
|
262
|
+
* - Min height for the editor.
|
|
263
|
+
*/
|
|
264
|
+
minHeight?: string;
|
|
265
|
+
/**
|
|
266
|
+
* - Max height for the editor.
|
|
267
|
+
*/
|
|
268
|
+
maxHeight?: string;
|
|
269
|
+
/**
|
|
270
|
+
* - Style string of the top frame of the editor. (e.g. "border: 1px solid #ccc;").
|
|
271
|
+
*/
|
|
272
|
+
editorStyle?: string;
|
|
273
|
+
/**
|
|
274
|
+
* - Content will be placed in an iframe and isolated from the rest of the page.
|
|
275
|
+
*/
|
|
276
|
+
iframe?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* - Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration on the "iframe".
|
|
279
|
+
*/
|
|
280
|
+
iframe_fullPage?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* - Attributes of the "iframe". (e.g. {'scrolling': 'no'})
|
|
283
|
+
*/
|
|
284
|
+
iframe_attributes?: {
|
|
285
|
+
[x: string]: string;
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* - Name or Array of the CSS file to apply inside the iframe.
|
|
289
|
+
* - You can also use regular expressions.
|
|
290
|
+
* - Applied by searching by filename in the link tag of document,
|
|
291
|
+
* - or put the URL value (".css" can be omitted).
|
|
292
|
+
*/
|
|
293
|
+
iframe_cssFileName?: string;
|
|
294
|
+
/**
|
|
295
|
+
* - Enables the status bar.
|
|
296
|
+
*/
|
|
297
|
+
statusbar?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* - Displays the current node structure to status bar.
|
|
300
|
+
*/
|
|
301
|
+
statusbar_showPathLabel?: boolean;
|
|
302
|
+
/**
|
|
303
|
+
* - Enables resize function of bottom status bar
|
|
304
|
+
*/
|
|
305
|
+
statusbar_resizeEnable?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* - Shows the number of characters in the editor.
|
|
308
|
+
* - If the maxCharCount option has a value, it becomes true.
|
|
309
|
+
*/
|
|
310
|
+
charCounter?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* - The maximum number of characters allowed to be inserted into the editor.
|
|
313
|
+
*/
|
|
314
|
+
charCounter_max?: number;
|
|
315
|
+
/**
|
|
316
|
+
* - Text to be displayed in the "charCounter" area of the bottom bar. (e.g. "Characters : 20/200")
|
|
317
|
+
*/
|
|
318
|
+
charCounter_label?: string;
|
|
319
|
+
/**
|
|
320
|
+
* - Defines the calculation method of the "charCounter" option.
|
|
321
|
+
* - 'char': Characters length.
|
|
322
|
+
* - 'byte': Binary data size of characters.
|
|
323
|
+
* - 'byte-html': Binary data size of the full HTML string.
|
|
324
|
+
*/
|
|
325
|
+
charCounter_type?: 'char' | 'byte' | 'byte-html';
|
|
326
|
+
};
|
|
327
|
+
export type EditorBaseOptions = {
|
|
328
|
+
/**
|
|
329
|
+
* - Plugin configuration.
|
|
330
|
+
*/
|
|
331
|
+
plugins?:
|
|
332
|
+
| {
|
|
333
|
+
[x: string]: any;
|
|
334
|
+
}
|
|
335
|
+
| Array<{
|
|
336
|
+
[x: string]: any;
|
|
337
|
+
}>;
|
|
338
|
+
/**
|
|
339
|
+
* - Plugin configuration.
|
|
340
|
+
*/
|
|
341
|
+
excludedPlugins?: Array<string>;
|
|
342
|
+
/**
|
|
343
|
+
* - List of toolbar buttons, grouped by sub-arrays.
|
|
344
|
+
* - The default follows {@link DEFAULTS.BUTTON_LIST}
|
|
345
|
+
*/
|
|
346
|
+
buttonList?: Array<string[] | string>;
|
|
347
|
+
/**
|
|
348
|
+
* - Enables migration mode for SunEditor v2.
|
|
349
|
+
*/
|
|
350
|
+
v2Migration?: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* - Enables strict filtering of tags, attributes, and styles.
|
|
353
|
+
*/
|
|
354
|
+
strictMode?:
|
|
355
|
+
| boolean
|
|
356
|
+
| {
|
|
357
|
+
tagFilter: boolean;
|
|
358
|
+
formatFilter: boolean;
|
|
359
|
+
classFilter: boolean;
|
|
360
|
+
textStyleTagFilter: boolean;
|
|
361
|
+
attrFilter: boolean;
|
|
362
|
+
styleFilter: boolean;
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* - Toolbar mode: "classic", "inline", "balloon", "balloon-always".
|
|
366
|
+
*/
|
|
367
|
+
mode?: 'classic' | 'inline' | 'balloon' | 'balloon-always';
|
|
368
|
+
/**
|
|
369
|
+
* - Editor type: "document:header,page".
|
|
370
|
+
*/
|
|
371
|
+
type?: string;
|
|
372
|
+
/**
|
|
373
|
+
* - Editor theme.
|
|
374
|
+
*/
|
|
375
|
+
theme?: string;
|
|
376
|
+
/**
|
|
377
|
+
* - Language configuration. default : EN
|
|
378
|
+
*/
|
|
379
|
+
lang?: {
|
|
380
|
+
[x: string]: string;
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* - Allowed font size units.
|
|
384
|
+
* - The default follows {@link DEFAULTS.SIZE_UNITS}
|
|
385
|
+
*/
|
|
386
|
+
fontSizeUnits?: Array<string>;
|
|
387
|
+
/**
|
|
388
|
+
* - Allowed class names.
|
|
389
|
+
* - Added the default value {@link DEFAULTS.CLASS_NAME}
|
|
390
|
+
*/
|
|
391
|
+
allowedClassName?: string;
|
|
392
|
+
/**
|
|
393
|
+
* - Closes modals when clicking outside.
|
|
394
|
+
*/
|
|
395
|
+
closeModalOutsideClick?: boolean;
|
|
396
|
+
/**
|
|
397
|
+
* - Keeps the format of the copied content.
|
|
398
|
+
*/
|
|
399
|
+
copyFormatKeepOn?: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* - Synchronizes tab indent with spaces.
|
|
402
|
+
*/
|
|
403
|
+
syncTabIndent?: boolean;
|
|
404
|
+
/**
|
|
405
|
+
* - Disables tab key input.
|
|
406
|
+
*/
|
|
407
|
+
tabDisable?: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* - Automatically converts URLs into hyperlinks. ("Link" plugin required)
|
|
410
|
+
* - Default value is determined dynamically based on whether the 'link' plugin is enabled. (default : Boolean(plugins.link))
|
|
411
|
+
*/
|
|
412
|
+
autoLinkify?: boolean;
|
|
413
|
+
/**
|
|
414
|
+
* - Styles applied automatically on text input.
|
|
415
|
+
*/
|
|
416
|
+
autoStyleify?: Array<string>;
|
|
417
|
+
/**
|
|
418
|
+
* - This option determines how inline elements (such as <span>, <strong>, etc.) are handled when deleting text.
|
|
419
|
+
* - "repeat": Inline styles are retained unless the backspace key is repeatedly pressed. If the user continuously presses backspace, the styles will eventually be removed.
|
|
420
|
+
* - "none": Inline styles are not retained at all. When deleting text, the associated inline elements are immediately removed along with it.
|
|
421
|
+
* - "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.
|
|
422
|
+
*/
|
|
423
|
+
retainStyleMode?: 'repeat' | 'always' | 'none';
|
|
424
|
+
/**
|
|
425
|
+
* - Specifies extra allowed or disallowed tags.
|
|
426
|
+
* - The default follows {@link DEFAULTS.EXTRA_TAG_MAP}
|
|
427
|
+
*/
|
|
428
|
+
allowedExtraTags?: {
|
|
429
|
+
[x: string]: boolean;
|
|
430
|
+
};
|
|
431
|
+
/**
|
|
432
|
+
* - Custom event handlers.
|
|
433
|
+
*/
|
|
434
|
+
events?: {
|
|
435
|
+
[x: string]: (...args: any) => any;
|
|
436
|
+
};
|
|
437
|
+
/**
|
|
438
|
+
* - The basic tags that serves as the base for "textStyleTags"
|
|
439
|
+
* - The default follows {@link DEFAULTS.TEXT_STYLE_TAGS}
|
|
440
|
+
*/
|
|
441
|
+
__textStyleTags?: string;
|
|
442
|
+
/**
|
|
443
|
+
* - Additional text style tags.
|
|
444
|
+
* - The default follows {@link EditorBaseOptions.__textStyleTags}
|
|
445
|
+
*/
|
|
446
|
+
textStyleTags?: string;
|
|
447
|
+
/**
|
|
448
|
+
* - Maps text styles to specific HTML tags.
|
|
449
|
+
*/
|
|
450
|
+
convertTextTags?: {
|
|
451
|
+
[x: string]: string;
|
|
452
|
+
};
|
|
453
|
+
/**
|
|
454
|
+
* - Specifies additional styles to the list of allowed styles. Delimiter: "|" (e.g. "color|background-color").
|
|
455
|
+
*/
|
|
456
|
+
allUsedStyles?: string;
|
|
457
|
+
/**
|
|
458
|
+
* - The basic tags that serves as the base for "tagStyles"
|
|
459
|
+
* - The default follows {@link DEFAULTS.TAG_STYLES}
|
|
460
|
+
*/
|
|
461
|
+
__tagStyles?: {
|
|
462
|
+
[x: string]: string;
|
|
463
|
+
};
|
|
464
|
+
/**
|
|
465
|
+
* - Specifies allowed styles for HTML tags.
|
|
466
|
+
*/
|
|
467
|
+
tagStyles?: {
|
|
468
|
+
[x: string]: string;
|
|
469
|
+
};
|
|
470
|
+
/**
|
|
471
|
+
* - Specifies allowed styles for the "span" tag.
|
|
472
|
+
* - The default follows {@link DEFAULTS.SPAN_STYLES}
|
|
473
|
+
*/
|
|
474
|
+
spanStyles?: string;
|
|
475
|
+
/**
|
|
476
|
+
* - Specifies allowed styles for the "line" element (p..).
|
|
477
|
+
* - The default follows {@link DEFAULTS.LINE_STYLES}
|
|
478
|
+
*/
|
|
479
|
+
lineStyles?: string;
|
|
480
|
+
/**
|
|
481
|
+
* - Text direction: "ltr" or "rtl".
|
|
482
|
+
*/
|
|
483
|
+
textDirection?: string;
|
|
484
|
+
/**
|
|
485
|
+
* - An array of command pairs whose shortcut icons should be opposite each other, depending on the "textDirection" mode.
|
|
486
|
+
*/
|
|
487
|
+
reverseButtons?: Array<string>;
|
|
488
|
+
/**
|
|
489
|
+
* - Delay time for history stack updates (ms).
|
|
490
|
+
*/
|
|
491
|
+
historyStackDelayTime?: number;
|
|
492
|
+
/**
|
|
493
|
+
* - Line properties that should be reset when changing lines (e.g. "id|name").
|
|
494
|
+
*/
|
|
495
|
+
lineAttrReset?: string;
|
|
496
|
+
/**
|
|
497
|
+
* - Class name for printing.
|
|
498
|
+
*/
|
|
499
|
+
printClass?: string;
|
|
500
|
+
/**
|
|
501
|
+
* - Default line element when inserting new lines.
|
|
502
|
+
*/
|
|
503
|
+
defaultLine?: string;
|
|
504
|
+
/**
|
|
505
|
+
* - Specifies the default line break format.
|
|
506
|
+
* - [Recommended] "line" : is a line break that is divided into general tags.
|
|
507
|
+
* - [Not recommended] "br" : Line breaks are treated as <br> on the same line. (like shift+enter)
|
|
508
|
+
* - Line breaks are handled as <br> within "line".
|
|
509
|
+
* - You can create a new "line" by entering a line break twice in a row.
|
|
510
|
+
* - Formats that include "line", such as "Quote", still operate on a "line" basis.
|
|
511
|
+
* - ● suneditor processes work in "line" units.
|
|
512
|
+
* - ● When set to "br", performance may decrease when editing a lot of data.
|
|
513
|
+
*/
|
|
514
|
+
defaultLineBreakFormat?: 'line' | 'br';
|
|
515
|
+
/**
|
|
516
|
+
* - Tags treated as whole units when selecting all content.
|
|
517
|
+
* - The default follows {@link DEFAULTS.SCOPE_SELECTION_TAGS}
|
|
518
|
+
*/
|
|
519
|
+
scopeSelectionTags?: Array<string>;
|
|
520
|
+
/**
|
|
521
|
+
* - A custom string used to construct a list of HTML elements to allow.
|
|
522
|
+
* - The final list of allowed elements (regex pattern) is dynamically generated according to the following rules:
|
|
523
|
+
* - A list of required elements, {@link DEFAULTS.REQUIRED_ELEMENT_WHITELIST}, is always included.
|
|
524
|
+
* - If a string value is provided for this option (`__defaultElementWhitelist`):** That string value is used.
|
|
525
|
+
* - If this option is not provided or is not a string: The default constant {@link DEFAULTS.ELEMENT_WHITELIST} is used.
|
|
526
|
+
* - 1. If no options are given, the final pattern is:
|
|
527
|
+
* - 'a|img|p|div|...' (REQUIRED + DEFAULT)
|
|
528
|
+
* - 2. If options are given directly, the final pattern is:
|
|
529
|
+
* - 'a|img|custom|tags' (REQUIRED + options.__defaultElementWhitelist)
|
|
530
|
+
*/
|
|
531
|
+
__defaultElementWhitelist?: string;
|
|
532
|
+
/**
|
|
533
|
+
* - Specifies HTML elements to additionally allow beyond the 'default' allow list. Delimiter: "|" (e.g. "p|div", "*").
|
|
534
|
+
* - The value entered here will be added to the end of the default list determined by the {@link EditorBaseOptions.__defaultElementWhitelist} logic above.
|
|
535
|
+
*/
|
|
536
|
+
elementWhitelist?: string;
|
|
537
|
+
/**
|
|
538
|
+
* - Filters by specifying HTML elements that should not be used. Delimiter: "|" (e.g. "script|style").
|
|
539
|
+
* - Tags specified here will eventually be removed, even if they are included in other whitelists.
|
|
540
|
+
*/
|
|
541
|
+
elementBlacklist?: string;
|
|
542
|
+
/**
|
|
543
|
+
* - A complete list of attributes that are allowed by default on all tags. Delimiter: "|" (e.g. "href|target").
|
|
544
|
+
* - The default follows {@link DEFAULTS.ATTRIBUTE_WHITELIST}
|
|
545
|
+
*/
|
|
546
|
+
__defaultAttributeWhitelist?: string;
|
|
547
|
+
/**
|
|
548
|
+
* - Specifies additional attributes to allow for each tag. (e.g. {a: "href|target", img: "src|alt", "*": "id"}).
|
|
549
|
+
* - Rules for objects specified here will be merged into the {@link EditorBaseOptions.__defaultAttributeWhitelist}.
|
|
550
|
+
*/
|
|
551
|
+
attributeWhitelist?: {
|
|
552
|
+
[x: string]: string;
|
|
553
|
+
};
|
|
554
|
+
/**
|
|
555
|
+
* - Filter by specifying attributes to disallow by tag. (e.g. {a: "href|target", img: "src|alt", "*": "name"}).
|
|
556
|
+
* - Attributes specified here will eventually be removed even if they are allowed by other settings.
|
|
557
|
+
*/
|
|
558
|
+
attributeBlacklist?: {
|
|
559
|
+
[x: string]: string;
|
|
560
|
+
};
|
|
561
|
+
/**
|
|
562
|
+
* - Specifies the tag to be used as the editor's default "line" element.
|
|
563
|
+
* - The default follows {@link DEFAULTS.FORMAT_LINE}
|
|
564
|
+
* - A list of required elements, {@link DEFAULTS.REQUIRED_FORMAT_LINE}, is always included.
|
|
565
|
+
*/
|
|
566
|
+
__defaultFormatLine?: string;
|
|
567
|
+
/**
|
|
568
|
+
* - Additionally allowed "line" elements beyond the default. Delimiter: "|" (e.g. "p|div").
|
|
569
|
+
* It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatLine} to form the final 'line' element list.
|
|
570
|
+
* - "line" element also contain "brLine" element
|
|
571
|
+
*/
|
|
572
|
+
formatLine?: string;
|
|
573
|
+
/**
|
|
574
|
+
* - Specifies the tag to be used as the editor's default "brLine" element.
|
|
575
|
+
* - The default follows {@link DEFAULTS.FORMAT_BR_LINE}
|
|
576
|
+
*/
|
|
577
|
+
__defaultFormatBrLine?: string;
|
|
578
|
+
/**
|
|
579
|
+
* - Additionally allowed "brLine" elements beyond the default. (e.g. "PRE").
|
|
580
|
+
* - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatBrLine} to form the final 'brLine' element list.
|
|
581
|
+
* - "brLine" elements is included in the "line" element.
|
|
582
|
+
* - "brLine" elements's line break is "BR" tag.
|
|
583
|
+
* ※ Entering the Enter key in the space on the last line ends "brLine" and appends "line".
|
|
584
|
+
*/
|
|
585
|
+
formatBrLine?: string;
|
|
586
|
+
/**
|
|
587
|
+
* - Specifies the tag to be used as the editor's default "closureBrLine" element.
|
|
588
|
+
* - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BR_LINE}
|
|
589
|
+
*/
|
|
590
|
+
__defaultFormatClosureBrLine?: string;
|
|
591
|
+
/**
|
|
592
|
+
* - Additionally allowed "closureBrLine" elements beyond the default.
|
|
593
|
+
* - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatClosureBrLine} to form the final 'closureBrLine' element list.
|
|
594
|
+
* - "closureBrLine" elements is included in the "brLine".
|
|
595
|
+
* - "closureBrLine" elements's line break is "BR" tag.
|
|
596
|
+
* - ※ You cannot exit this format with the Enter key or Backspace key.
|
|
597
|
+
* - ※ Use it only in special cases. ([ex] format of table cells)
|
|
598
|
+
*/
|
|
599
|
+
formatClosureBrLine?: string;
|
|
600
|
+
/**
|
|
601
|
+
* - Specifies the tag to be used as the editor's default "block" element.
|
|
602
|
+
* - The default follows {@link DEFAULTS.FORMAT_BLOCK}
|
|
603
|
+
*/
|
|
604
|
+
__defaultFormatBlock?: string;
|
|
605
|
+
/**
|
|
606
|
+
* - Additionally allowed "block" elements beyond the default.
|
|
607
|
+
* - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatBlock} to form the final 'block' element list.
|
|
608
|
+
* - "block" is wrap the "line" and "component"
|
|
609
|
+
*/
|
|
610
|
+
formatBlock?: string;
|
|
611
|
+
/**
|
|
612
|
+
* - Specifies the tag to be used as the editor's default "closureBlock" element.
|
|
613
|
+
* - The default follows {@link DEFAULTS.FORMAT_CLOSURE_BLOCK}
|
|
614
|
+
*/
|
|
615
|
+
__defaultFormatClosureBlock?: string;
|
|
616
|
+
/**
|
|
617
|
+
* - Additionally allowed "closureBlock" elements beyond the default.
|
|
618
|
+
* - It is concatenated with the value of {@link EditorBaseOptions.__defaultFormatClosureBlock} to form the final 'closureBlock' element list.
|
|
619
|
+
* - "closureBlock" elements is included in the "block".
|
|
620
|
+
* - "closureBlock" element is wrap the "line" and "component"
|
|
621
|
+
* - ※ You cannot exit this format with the Enter key or Backspace key.
|
|
622
|
+
* - ※ Use it only in special cases. (e.g. format of table cells)
|
|
623
|
+
*/
|
|
624
|
+
formatClosureBlock?: string;
|
|
625
|
+
/**
|
|
626
|
+
* - A list of tags that are allowed to be kept even if their values are empty.
|
|
627
|
+
* - The default follows {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST}
|
|
628
|
+
* - It is concatenated with the value of {@link DEFAULTS.ALLOWED_EMPTY_NODE_LIST} to form the final 'allowedEmptyTags' list.
|
|
629
|
+
*/
|
|
630
|
+
allowedEmptyTags?: string;
|
|
631
|
+
/**
|
|
632
|
+
* - Toolbar width.
|
|
633
|
+
*/
|
|
634
|
+
toolbar_width?: number | string;
|
|
635
|
+
/**
|
|
636
|
+
* - Container element for the toolbar.
|
|
637
|
+
*/
|
|
638
|
+
toolbar_container?: Element | string;
|
|
639
|
+
/**
|
|
640
|
+
* - Enables sticky toolbar with optional offset.
|
|
641
|
+
*/
|
|
642
|
+
toolbar_sticky?: number;
|
|
643
|
+
/**
|
|
644
|
+
* - Hides toolbar initially.
|
|
645
|
+
*/
|
|
646
|
+
toolbar_hide?: boolean;
|
|
647
|
+
/**
|
|
648
|
+
* - Sub-toolbar configuration.
|
|
649
|
+
*/
|
|
650
|
+
subToolbar?: {
|
|
651
|
+
buttonList?: Array<Array<string>>;
|
|
652
|
+
mode?: 'balloon' | 'balloon-always';
|
|
653
|
+
width?: number | string;
|
|
654
|
+
};
|
|
655
|
+
/**
|
|
656
|
+
* - Container element for the status bar.
|
|
657
|
+
*/
|
|
658
|
+
statusbar_container?: Element | string;
|
|
659
|
+
/**
|
|
660
|
+
* - Displays shortcut hints in tooltips.
|
|
661
|
+
*/
|
|
662
|
+
shortcutsHint?: boolean;
|
|
663
|
+
/**
|
|
664
|
+
* - Disables keyboard shortcuts.
|
|
665
|
+
*/
|
|
666
|
+
shortcutsDisable?: boolean;
|
|
667
|
+
/**
|
|
668
|
+
* - Custom keyboard shortcuts.
|
|
669
|
+
*/
|
|
670
|
+
shortcuts?: {
|
|
671
|
+
[x: string]: string[];
|
|
672
|
+
};
|
|
673
|
+
/**
|
|
674
|
+
* - Offset applied when entering fullscreen mode.
|
|
675
|
+
*/
|
|
676
|
+
fullScreenOffset?: number;
|
|
677
|
+
/**
|
|
678
|
+
* - Custom template for preview mode.
|
|
679
|
+
*/
|
|
680
|
+
previewTemplate?: string;
|
|
681
|
+
/**
|
|
682
|
+
* - Custom template for print mode.
|
|
683
|
+
*/
|
|
684
|
+
printTemplate?: string;
|
|
685
|
+
/**
|
|
686
|
+
* - Enables automatic selection of inserted components.
|
|
687
|
+
*/
|
|
688
|
+
componentAutoSelect?: boolean;
|
|
689
|
+
/**
|
|
690
|
+
* - Default URL protocol for links.
|
|
691
|
+
*/
|
|
692
|
+
defaultUrlProtocol?: string;
|
|
693
|
+
/**
|
|
694
|
+
* - {"copy": 1500} - Duration for displaying toast messages.
|
|
695
|
+
*/
|
|
696
|
+
toastMessageTime?: any;
|
|
697
|
+
/**
|
|
698
|
+
* - Overrides the default icons.
|
|
699
|
+
*/
|
|
700
|
+
icons?: {
|
|
701
|
+
[x: string]: string;
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* - Enables free code view mode.
|
|
705
|
+
*/
|
|
706
|
+
freeCodeViewMode?: string;
|
|
707
|
+
/**
|
|
708
|
+
* - Line format filter configuration.
|
|
709
|
+
*/
|
|
710
|
+
__lineFormatFilter?: boolean;
|
|
711
|
+
/**
|
|
712
|
+
* - Plugin retain filter configuration.
|
|
713
|
+
* - You can turn it off/on globally with true/false or set it per plugin. (e.g. { table: false })
|
|
714
|
+
*/
|
|
715
|
+
__pluginRetainFilter?:
|
|
716
|
+
| boolean
|
|
717
|
+
| {
|
|
718
|
+
[x: string]: boolean;
|
|
719
|
+
};
|
|
720
|
+
/**
|
|
721
|
+
* - Defines the list of styles that are applied directly to the `<li>` element
|
|
722
|
+
* - when a text style is applied to the entire list item.
|
|
723
|
+
* - For example, when changing the font size or color of a list item (`<li>`),
|
|
724
|
+
* - these styles will be applied to the `<li>` tag instead of wrapping the content inside additional tags.
|
|
725
|
+
*/
|
|
726
|
+
__listCommonStyle?: Array<string>;
|
|
727
|
+
/**
|
|
728
|
+
* - External libraries like CodeMirror or MathJax.
|
|
729
|
+
*/
|
|
730
|
+
externalLibs?: {
|
|
731
|
+
[x: string]: any;
|
|
732
|
+
};
|
|
733
|
+
/**
|
|
734
|
+
* - Dynamic plugin options, where the key is the plugin name and the value is its configuration.
|
|
735
|
+
*/
|
|
736
|
+
Dynamic_pluginOptions?: {
|
|
737
|
+
[x: string]: any;
|
|
738
|
+
};
|
|
739
|
+
};
|
|
740
|
+
export type EditorInitOptions = EditorBaseOptions & EditorFrameOptions;
|