suneditor 2.46.3 → 2.47.1
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/README.md +22 -0
- package/README_V3_TEMP.md +630 -0
- package/dist/css/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +2 -2
- package/package.json +1 -1
- package/src/assets/css/suneditor.css +2 -2
- package/src/lib/constructor.js +4 -1
- package/src/lib/core.d.ts +1 -0
- package/src/lib/core.js +91 -64
- package/src/lib/util.js +1 -1
- package/src/options.d.ts +12 -0
- package/src/plugins/dialog/image.js +2 -1
- package/src/plugins/dialog/math.js +5 -0
- package/src/plugins/dialog/video.js +10 -0
- package/src/plugins/fileBrowser/imageGallery.js +2 -1
- package/src/plugins/modules/fileBrowser.js +5 -1
- package/src/plugins/submenu/list.js +1 -1
- package/src/plugins/dialog/mention.d.ts +0 -5
- package/src/plugins/dialog/mention.js +0 -242
package/README.md
CHANGED
|
@@ -392,6 +392,7 @@ plugins: [
|
|
|
392
392
|
|
|
393
393
|
// Values
|
|
394
394
|
strictMode : Option to disable clean mode, which checks the styles, classes, etc. of the editor content. default : false {Boolean}
|
|
395
|
+
strictHTMLValidation : Enforces strict HTML validation based on the editor`s policy. Applies to methods like setContents to ensure content compliance when enabled. default: false {Boolean}
|
|
395
396
|
lang : language object. default : en {Object}
|
|
396
397
|
defaultTag : Specifies default tag name of the editor. default: 'p' {String}
|
|
397
398
|
textTags : You can change the tag of the default text button. default: { bold: 'STRONG', underline: 'U', italic: 'EM', strike: 'DEL' }
|
|
@@ -692,6 +693,16 @@ imageMultipleFile: If true, multiple images can be selected. default: false {
|
|
|
692
693
|
imageAccept : Define the "accept" attribute of the input. default: "*" {String}
|
|
693
694
|
ex) "*" or ".jpg, .png .."
|
|
694
695
|
// Image - image gallery
|
|
696
|
+
imageGalleryData : Direct JSON data without making server requests. default: null {Array}
|
|
697
|
+
ex) [
|
|
698
|
+
{
|
|
699
|
+
"src": "/download/editorImg/test_image.jpg", // @Require
|
|
700
|
+
"thumbnail": "/download/editorImg/test_thumbnail.jpg", // @Option - Thumbnail image to be displayed in the image gallery.
|
|
701
|
+
"name": "Test image", // @Option - default: src.split('/').pop()
|
|
702
|
+
"alt": "Alt text", // @Option - default: src.split('/').pop()
|
|
703
|
+
"tag": "Tag name" // @Option
|
|
704
|
+
}
|
|
705
|
+
]
|
|
695
706
|
imageGalleryUrl : The url of the image gallery, if you use the image gallery.
|
|
696
707
|
When "imageUrlInput" is true, an image gallery button is created in the image modal.
|
|
697
708
|
You can also use it by adding "imageGallery" to the button list. default: null {String}
|
|
@@ -739,6 +750,10 @@ youtubeQuery : The query string of a YouTube embedded URL. default: ''
|
|
|
739
750
|
It takes precedence over the value user entered.
|
|
740
751
|
ex) 'autoplay=1&mute=1&enablejsapi=1&controls=0&rel=0&modestbranding=1'
|
|
741
752
|
// https://developers.google.com/youtube/player_parameters
|
|
753
|
+
vimeoQuery : The query string of a Vimeo embedded URL. default: '' {String}
|
|
754
|
+
It takes precedence over the value user entered.
|
|
755
|
+
ex) 'autoplay=1&muted=1'
|
|
756
|
+
// https://help.vimeo.com/hc/en-us/articles/12426260232977-Player-parameters-overview
|
|
742
757
|
videoFileInput : Choose whether to create a file input tag in the video upload window. default: false {Boolean}
|
|
743
758
|
videoUrlInput : Choose whether to create a video url input tag in the video upload window.
|
|
744
759
|
If the value of videoFileInput is false, it will be unconditionally. default: true {Boolean}
|
|
@@ -1176,6 +1191,13 @@ editor.onload = function (core, reload) {
|
|
|
1176
1191
|
*/
|
|
1177
1192
|
editor.onPaste = function (e, cleanData, maxCharCount, core) { console.log('onPaste', e) }
|
|
1178
1193
|
|
|
1194
|
+
/**
|
|
1195
|
+
* paste event on math plugin
|
|
1196
|
+
* e: Event object
|
|
1197
|
+
* core: Core object
|
|
1198
|
+
*/
|
|
1199
|
+
editor.onPasteMath = function (e, core) { console.log('onPasteMath', e) }
|
|
1200
|
+
|
|
1179
1201
|
// Copy event.
|
|
1180
1202
|
// Called before the editor's default event action.
|
|
1181
1203
|
// If it returns false, it stops without executing the rest of the action.
|
|
@@ -0,0 +1,630 @@
|
|
|
1
|
+
SunEditor Version 3 - Temporary README
|
|
2
|
+
|
|
3
|
+
This is not a finished version and the option information below may be incorrect.
|
|
4
|
+
|
|
5
|
+
https://www.npmjs.com/package/suneditor?activeTab=versions
|
|
6
|
+
|
|
7
|
+
### create
|
|
8
|
+
```javascript
|
|
9
|
+
import suneditor from 'suneditor';
|
|
10
|
+
import langs, { ko } from 'suneditor/src/langs';
|
|
11
|
+
import plugins from 'suneditor/src/plugins';
|
|
12
|
+
|
|
13
|
+
// editor style
|
|
14
|
+
import 'suneditor/src/assets/suneditor.css';
|
|
15
|
+
// editable area style
|
|
16
|
+
import 'suneditor/src/assets/suneditor-contents.css';
|
|
17
|
+
// suneditor.css + suneditor-contents.css
|
|
18
|
+
import 'suneditor/dist/suneditor.min.css';
|
|
19
|
+
|
|
20
|
+
// single
|
|
21
|
+
suneditor.create(document.querySelector('#editor_1'), mainOptions)
|
|
22
|
+
// multi root
|
|
23
|
+
suneditor.create({
|
|
24
|
+
editor1: {
|
|
25
|
+
target: document.querySelector('#multi_editor_1'),
|
|
26
|
+
options: {} // Undefined options default to the "Min option".
|
|
27
|
+
},
|
|
28
|
+
editor2: {
|
|
29
|
+
target: document.querySelector('#multi_editor_2'),
|
|
30
|
+
options: {}
|
|
31
|
+
}
|
|
32
|
+
}, mainOptions)
|
|
33
|
+
```
|
|
34
|
+
[Main options](#user-content-main-options)
|
|
35
|
+
|
|
36
|
+
[Multi Root frame apecific options](#user-content-multi-root-frame-apecific-options)
|
|
37
|
+
|
|
38
|
+
[Plugin options](#user-content-plugin-options)
|
|
39
|
+
|
|
40
|
+
#### Buttons
|
|
41
|
+
```javascript
|
|
42
|
+
[
|
|
43
|
+
"bold",
|
|
44
|
+
"underline",
|
|
45
|
+
"italic",
|
|
46
|
+
"strike",
|
|
47
|
+
"subscript",
|
|
48
|
+
"superscript",
|
|
49
|
+
"removeFormat",
|
|
50
|
+
"copyFormat",
|
|
51
|
+
"indent",
|
|
52
|
+
"outdent",
|
|
53
|
+
"fullScreen",
|
|
54
|
+
"showBlocks",
|
|
55
|
+
"codeView",
|
|
56
|
+
"undo",
|
|
57
|
+
"redo",
|
|
58
|
+
"preview",
|
|
59
|
+
"print",
|
|
60
|
+
"dir",
|
|
61
|
+
"dir_ltr",
|
|
62
|
+
"dir_rtl",
|
|
63
|
+
"save",
|
|
64
|
+
"newDocument",
|
|
65
|
+
"selectAll",
|
|
66
|
+
"pageBreak",
|
|
67
|
+
"pageUp",
|
|
68
|
+
"pageDown",
|
|
69
|
+
"pageNavigator",
|
|
70
|
+
// [pluginName],
|
|
71
|
+
]
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
#### Main options
|
|
75
|
+
```javascript
|
|
76
|
+
const DEFAULT_BUTTON_LIST = [
|
|
77
|
+
['undo', 'redo'],
|
|
78
|
+
'|',
|
|
79
|
+
['bold', 'underline', 'italic', 'strike', '|', 'subscript', 'superscript'],
|
|
80
|
+
'|',
|
|
81
|
+
['removeFormat'],
|
|
82
|
+
'|',
|
|
83
|
+
['outdent', 'indent'],
|
|
84
|
+
'|',
|
|
85
|
+
['fullScreen', 'showBlocks', 'codeView'],
|
|
86
|
+
'|',
|
|
87
|
+
['preview', 'print']
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
const DEFAULT_ELEMENT_WHITELIST =
|
|
91
|
+
'p|pre|blockquote|h1|h2|h3|h4|h5|h6|ol|ul|li|hr|figure|figcaption|img|iframe|audio|video|source|table|thead|tbody|tr|th|td|caption|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|code|svg|path|details|summary';
|
|
92
|
+
const DEFAULT_TEXT_STYLE_TAGS = 'strong|span|font|b|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label|code|summary';
|
|
93
|
+
const DEFAULT_ATTRIBUTE_WHITELIST = 'contenteditable|target|href|title|download|rel|src|alt|class|type|controls|colspan|rowspan';
|
|
94
|
+
|
|
95
|
+
const DEFAULT_FORMAT_LINE = 'P|H[1-6]|LI|TH|TD|DETAILS';
|
|
96
|
+
const DEFAULT_FORMAT_BR_LINE = 'PRE';
|
|
97
|
+
const DEFAULT_FORMAT_CLOSURE_BR_LINE = '';
|
|
98
|
+
const DEFAULT_FORMAT_BLOCK = 'BLOCKQUOTE|OL|UL|FIGCAPTION|TABLE|THEAD|TBODY|TR|CAPTION|DETAILS';
|
|
99
|
+
const DEFAULT_FORMAT_CLOSURE_BLOCK = 'TH|TD';
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
const DEFAULT_CLASS_NAME = '^__se__|^se-|^katex|^MathJax';
|
|
103
|
+
const DEFAULT_EXTRA_TAG_MAP = { script: false, style: false, meta: false, link: false, '[a-z]+:[a-z]+': false };
|
|
104
|
+
|
|
105
|
+
const DEFAULT_TAG_STYLES = {
|
|
106
|
+
'table|th|td': 'border|border-[a-z]+|background-color|text-align|float|font-weight|text-decoration|font-style',
|
|
107
|
+
'ol|ul': 'list-style-type'
|
|
108
|
+
};
|
|
109
|
+
const DEFAULT_CONTENT_STYLES =
|
|
110
|
+
'background|background-clip|background-color|' +
|
|
111
|
+
'border|border-bottom|border-collapse|border-color|border-image|border-left-width|border-radius|border-right-width|border-spacing|border-style|border-top|border-width|' +
|
|
112
|
+
'box-shadow|box-sizing|' +
|
|
113
|
+
'caption-side|color|content|' +
|
|
114
|
+
'direction|display|' +
|
|
115
|
+
'float|font|font-family|font-size|font-style|font-weight|' +
|
|
116
|
+
'height|' +
|
|
117
|
+
'left|letter-spacing|line-height|list-style-position|list-style-type|' +
|
|
118
|
+
'margin|margin-block-end|margin-block-start|margin-bottom|margin-inline-end|margin-inline-start|margin-left|margin-right|margin-top|max-width|min-width|' +
|
|
119
|
+
'outline|overflow|' +
|
|
120
|
+
'position|padding|padding-bottom|padding-inline-start|padding-left|padding-right|padding-top|' +
|
|
121
|
+
'page-break-before|page-break-after|page-break-inside|' +
|
|
122
|
+
'rotate|rotateX|rotateY|' +
|
|
123
|
+
'table-layout|text-align|text-decoration|text-shadow|text-transform|top|' +
|
|
124
|
+
'text-indent|text-rendering|' +
|
|
125
|
+
'vertical-align|visibility|' +
|
|
126
|
+
'white-space|width|word-break|word-wrap';
|
|
127
|
+
|
|
128
|
+
// Whitelist and blacklist are a combination of options and defaults.
|
|
129
|
+
// You can override the defaults by defining them with "__" in front of the list.
|
|
130
|
+
{
|
|
131
|
+
// [pluginName]: {} // plugin options
|
|
132
|
+
buttonList: DEFAULT_BUTTON_LIST, // List of buttons to display in the toolbar
|
|
133
|
+
toolbar_container: null, // Container for the toolbar (if any)
|
|
134
|
+
mode: 'classic', // Editor mode: classic, inline, balloon, or balloon-always
|
|
135
|
+
v2Migration: false, // Flag for version 2 migration
|
|
136
|
+
strictMode: {
|
|
137
|
+
// Strict mode settings
|
|
138
|
+
tagFilter: true,
|
|
139
|
+
formatFilter: true,
|
|
140
|
+
classFilter: true,
|
|
141
|
+
styleNodeFilter: true,
|
|
142
|
+
attrFilter: true,
|
|
143
|
+
styleFilter: true
|
|
144
|
+
},
|
|
145
|
+
__lineFormatFilter: true, // Line format filter
|
|
146
|
+
__pluginRetainFilter: true, // Plugin retain filter
|
|
147
|
+
type: '', // Document type: header, page (ex) 'document:header,page'
|
|
148
|
+
theme: '', // Theme for the editor
|
|
149
|
+
externalLibs: {}, // External libraries
|
|
150
|
+
/** (ex)
|
|
151
|
+
// math - katex
|
|
152
|
+
katex: {
|
|
153
|
+
src: Katex
|
|
154
|
+
},
|
|
155
|
+
// math - mathjax (Not supported if using the iframe option.)
|
|
156
|
+
mathjax: {
|
|
157
|
+
src: mathjax,
|
|
158
|
+
TeX,
|
|
159
|
+
CHTML,
|
|
160
|
+
browserAdaptor,
|
|
161
|
+
RegisterHTMLHandler
|
|
162
|
+
},
|
|
163
|
+
// exportPdf (Rather than using the library below, I recommend processing it on the server.)
|
|
164
|
+
html2canvas: html2canvas,
|
|
165
|
+
jsPDF: jsPDF
|
|
166
|
+
// codeMirror6
|
|
167
|
+
codeMirror: {
|
|
168
|
+
EditorView: EditorView,
|
|
169
|
+
extensions: [
|
|
170
|
+
basicSetup,
|
|
171
|
+
html({
|
|
172
|
+
matchClosingTags: true,
|
|
173
|
+
autoCloseTags: true
|
|
174
|
+
}),
|
|
175
|
+
javascript()
|
|
176
|
+
],
|
|
177
|
+
minimalSetup: minimalSetup
|
|
178
|
+
},
|
|
179
|
+
// codeMirror5
|
|
180
|
+
codeMirror: {
|
|
181
|
+
src: Codemirror5
|
|
182
|
+
},
|
|
183
|
+
*/
|
|
184
|
+
keepStyleOnDelete: false, // Keep style on delete
|
|
185
|
+
fontSizeUnits: ['px', 'pt', 'em', 'rem'], // Font size units
|
|
186
|
+
allowedClassName: DEFAULT_CLASS_NAME, // Allowed class names
|
|
187
|
+
closeModalOutsideClick: false, // Close modal on outside click
|
|
188
|
+
copyFormatKeepOn: false, // Keep format on copy
|
|
189
|
+
syncTab: true, // Synchronize tab
|
|
190
|
+
autoLinkify: false, // Auto convert URLs to links on paste
|
|
191
|
+
autoStyleify: ['bold', 'underline', 'italic', 'strike'], // Auto apply styles on paste
|
|
192
|
+
scrollToOptions: { behavior: 'auto', block: 'nearest' }, // Scroll to options
|
|
193
|
+
componentScrollToOptions: { behavior: 'smooth', block: 'center' }, // Component scroll to options
|
|
194
|
+
retainStyleMode: 'repeat', // Retain style mode
|
|
195
|
+
allowedExtraTags: DEFAULT_EXTRA_TAG_MAP, // Allowed extra tags
|
|
196
|
+
events: {}, // Editor events
|
|
197
|
+
__textStyleTags: DEFAULT_TEXT_STYLE_TAGS, // Text style tags
|
|
198
|
+
textStyleTags: '', // Additional text style tags
|
|
199
|
+
convertTextTags: { bold: 'strong', underline: 'u', italic: 'em', strike: 'del', subscript: 'sub', superscript: 'sup' }, // Convert text tags
|
|
200
|
+
tagStyles: DEFAULT_TAG_STYLES, // Tag styles
|
|
201
|
+
spanStyles: '', // Span styles
|
|
202
|
+
lineStyles: '', // Line styles
|
|
203
|
+
textDirection: 'ltr', // Text direction
|
|
204
|
+
reverseButtons: ['indent-outdent'], // Reverse buttons
|
|
205
|
+
historyStackDelayTime: 400, // History stack delay time
|
|
206
|
+
lineAttrReset: ['id'], // Line attribute reset
|
|
207
|
+
printClass: null, // Print class
|
|
208
|
+
defaultLine: 'p', // Default line element
|
|
209
|
+
elementWhitelist: '*', // Element whitelist
|
|
210
|
+
elementBlacklist: '', // Element blacklist
|
|
211
|
+
attributeWhitelist: null, // Attribute whitelist
|
|
212
|
+
attributeBlacklist: null, // Attribute blacklist
|
|
213
|
+
formatClosureBrLine: DEFAULT_FORMAT_CLOSURE_BR_LINE, // Format closure BR line
|
|
214
|
+
formatBrLine: DEFAULT_FORMAT_BR_LINE, // Format BR line
|
|
215
|
+
formatLine: DEFAULT_FORMAT_LINE, // Format line
|
|
216
|
+
formatClosureBlock: DEFAULT_FORMAT_CLOSURE_BLOCK, // Format closure block
|
|
217
|
+
formatBlock: DEFAULT_FORMAT_BLOCK, // Format block
|
|
218
|
+
__defaultElementWhitelist: DEFAULT_ELEMENT_WHITELIST, // Default element whitelist
|
|
219
|
+
__defaultAttributeWhitelist: DEFAULT_ATTRIBUTE_WHITELIST, // Default attribute whitelist
|
|
220
|
+
toolbar_width: 'auto', // Toolbar width
|
|
221
|
+
toolbar_sticky: 0, // Toolbar sticky position
|
|
222
|
+
toolbar_hide: false, // Hide toolbar
|
|
223
|
+
subToolbar: null, // Sub toolbar
|
|
224
|
+
tabDisable: false, // Disable tab
|
|
225
|
+
shortcutsHint: true, // Show shortcuts hint
|
|
226
|
+
shortcutsDisable: false, // Disable shortcuts
|
|
227
|
+
shortcuts: {
|
|
228
|
+
// Shortcuts configuration
|
|
229
|
+
selectAll: ['65', 'A'],
|
|
230
|
+
bold: ['66', 'B'],
|
|
231
|
+
strike: ['s83', 'S'],
|
|
232
|
+
underline: ['85', 'U'],
|
|
233
|
+
italic: ['73', 'I'],
|
|
234
|
+
redo: ['89', 'Y', 's90', 'Z'],
|
|
235
|
+
undo: ['90', 'Z'],
|
|
236
|
+
indent: ['221', ']'],
|
|
237
|
+
outdent: ['219', '['],
|
|
238
|
+
sup: ['187', '='],
|
|
239
|
+
sub: ['s187', '='],
|
|
240
|
+
save: ['83', 'S'],
|
|
241
|
+
link: ['75', 'K']
|
|
242
|
+
},
|
|
243
|
+
fullScreenOffset: 0, // Fullscreen offset
|
|
244
|
+
previewTemplate: null, // Preview template
|
|
245
|
+
printTemplate: null, // Print template
|
|
246
|
+
componentAutoSelect: false, // Component auto select
|
|
247
|
+
defaultUrlProtocol: null, // Default URL protocol
|
|
248
|
+
codeMirror: null, // CodeMirror settings
|
|
249
|
+
__listCommonStyle: ['fontSize', 'color', 'fontFamily', 'fontWeight', 'fontStyle'], // List of common styles
|
|
250
|
+
icons: '_icons', // Icons configuration
|
|
251
|
+
allUsedStyles: DEFAULT_CONTENT_STYLES, // All used styles
|
|
252
|
+
lang: '_defaultLang', // Language settings
|
|
253
|
+
value: null, // Initial value
|
|
254
|
+
statusbar_container: null // Statusbar container
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### Multi Root frame apecific options
|
|
259
|
+
```javascript
|
|
260
|
+
{
|
|
261
|
+
value: 'origin.value', // Initial content value for the editor
|
|
262
|
+
placeholder: 'origin.placeholder', // Placeholder text for the editor
|
|
263
|
+
editableFrameAttributes: 'origin.editableFrameAttributes', // Attributes for the editable frame
|
|
264
|
+
width: 'origin.width', // Width of the editor
|
|
265
|
+
minWidth: 'origin.minWidth', // Minimum width of the editor
|
|
266
|
+
maxWidth: 'origin.maxWidth', // Maximum width of the editor
|
|
267
|
+
height: 'origin.height', // Height of the editor
|
|
268
|
+
minHeight: 'origin.minHeight', // Minimum height of the editor
|
|
269
|
+
maxHeight: 'origin.maxHeight', // Maximum height of the editor
|
|
270
|
+
editorStyle: 'origin.editorStyle', // Style for the editor
|
|
271
|
+
iframe: 'origin.iframe', // Use iframe for the editor
|
|
272
|
+
iframe_fullPage: 'origin.iframe_fullPage', // Full page iframe for the editor
|
|
273
|
+
iframe_attributes: 'origin.iframe_attributes', // Attributes for the iframe
|
|
274
|
+
iframe_cssFileName: 'origin.iframe_cssFileName', // CSS file name for the iframe
|
|
275
|
+
statusbar: 'origin.statusbar', // Status bar for the editor
|
|
276
|
+
statusbar_showPathLabel: 'origin.statusbar_showPathLabel', // Show path label in the status bar
|
|
277
|
+
statusbar_resizeEnable: 'origin.statusbar_resizeEnable', // Enable resize in the status bar
|
|
278
|
+
charCounter: 'origin.charCounter', // Character counter for the editor
|
|
279
|
+
charCounter_max: 'origin.charCounter_max', // Maximum character count
|
|
280
|
+
charCounter_label: 'origin.charCounter_label', // Label for the character counter
|
|
281
|
+
charCounter_type: 'origin.charCounter_type' // Type of character counter
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### Plugin options
|
|
286
|
+
```javascript
|
|
287
|
+
{
|
|
288
|
+
// --------- command
|
|
289
|
+
blockquote: null, // no options.
|
|
290
|
+
exportPdf: {
|
|
291
|
+
apiUrl: null, // API URL for exporting PDF
|
|
292
|
+
fileName: 'suneditor-pdf', // Default file name for the exported PDF
|
|
293
|
+
jsPDFOptions: {}, // Default options for jsPDF
|
|
294
|
+
html2canvasOptions: {} // Default options for html2canvas
|
|
295
|
+
},
|
|
296
|
+
fileUpload: {
|
|
297
|
+
uploadUrl: null, // URL for file upload (required)
|
|
298
|
+
uploadHeaders: null, // Headers for file upload
|
|
299
|
+
uploadSizeLimit: null, // Upload size limit
|
|
300
|
+
uploadSingleSizeLimit: null, // Single file size limit
|
|
301
|
+
allowMultiple: false, // Allow multiple file uploads
|
|
302
|
+
acceptedFormats: '*', // Accepted file formats
|
|
303
|
+
as: 'box', // Upload mode (box or link)
|
|
304
|
+
controls: [['custom-as', 'edit', 'align', 'remove', 'custom-download']] // Figure controls
|
|
305
|
+
},
|
|
306
|
+
list_bulleted: null, // no options.
|
|
307
|
+
list_numbered: null, // no options.
|
|
308
|
+
|
|
309
|
+
// --------- dropdown
|
|
310
|
+
align: {
|
|
311
|
+
items: ['left', 'center', 'right', 'justify'] // Alignment options (defaults based on text direction)
|
|
312
|
+
},
|
|
313
|
+
backgroundColor: {
|
|
314
|
+
colorList: [], // List of background colors
|
|
315
|
+
splitNum: null, // Number of color splits
|
|
316
|
+
disableHEXInput: null, // Disable HEX color input
|
|
317
|
+
hueSliderOptions: {
|
|
318
|
+
controllerOptions: {
|
|
319
|
+
parents: ['menu'],
|
|
320
|
+
isOutsideForm: true
|
|
321
|
+
}
|
|
322
|
+
} // Options for hue slider
|
|
323
|
+
},
|
|
324
|
+
font: {
|
|
325
|
+
items: ['Arial', 'Comic Sans MS', 'Courier New', 'Impact', 'Georgia', 'tahoma', 'Trebuchet MS', 'Verdana'] // Default list of fonts
|
|
326
|
+
},
|
|
327
|
+
fontColor: {
|
|
328
|
+
colorList: [], // List of font colors
|
|
329
|
+
splitNum: null, // Number of color splits
|
|
330
|
+
disableHEXInput: null // Disable HEX color input
|
|
331
|
+
},
|
|
332
|
+
formatBlock: {
|
|
333
|
+
items: ['p', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'] // Default format block items
|
|
334
|
+
},
|
|
335
|
+
hr: {
|
|
336
|
+
items: [
|
|
337
|
+
{
|
|
338
|
+
name: 'Solid',
|
|
339
|
+
class: '__se__solid'
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
name: 'Dashed',
|
|
343
|
+
class: '__se__dashed'
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: 'Dotted',
|
|
347
|
+
class: '__se__dotted'
|
|
348
|
+
}
|
|
349
|
+
] // Default items for horizontal rules
|
|
350
|
+
},
|
|
351
|
+
layout: {
|
|
352
|
+
items: null // Layout items (user must define this option)
|
|
353
|
+
},
|
|
354
|
+
lineHeight: {
|
|
355
|
+
items: [
|
|
356
|
+
{ text: '1', value: 1 },
|
|
357
|
+
{ text: '1.15', value: 1.15 },
|
|
358
|
+
{ text: '1.5', value: 1.5 },
|
|
359
|
+
{ text: '2', value: 2 }
|
|
360
|
+
] // Default line height options
|
|
361
|
+
},
|
|
362
|
+
list: null, // no options
|
|
363
|
+
paragraphStyle: {
|
|
364
|
+
items: ['spaced', 'bordered', 'neon'] // Default paragraph styles
|
|
365
|
+
},
|
|
366
|
+
table: {
|
|
367
|
+
figureScrollList: ['se-scroll-figure-xy', 'se-scroll-figure-x', 'se-scroll-figure-y'], // Default figure scroll options
|
|
368
|
+
scrollType: 'x', // Default scroll type
|
|
369
|
+
captionPosition: 'top', // Default caption position
|
|
370
|
+
cellControllerPosition: 'table', // Default cell controller position
|
|
371
|
+
colorList: ['#b0dbb0', '#efef7e', '#f2acac', '#dcb0f6', '#99bdff', '#5dbd5d', '#e7c301', '#f64444', '#e57ff4', '#4387f1', '#27836a', '#f69915', '#ba0808', '#a90bed', '#134299', '#e4e4e4', '#B3B3B3', '#808080', '#4D4D4D', '#000000'] // Default color list for table plugin
|
|
372
|
+
},
|
|
373
|
+
template: {
|
|
374
|
+
items: null // template items (user must define this option)
|
|
375
|
+
},
|
|
376
|
+
textStyle: {
|
|
377
|
+
items: {
|
|
378
|
+
code: {
|
|
379
|
+
name: lang.menu_code,
|
|
380
|
+
class: '__se__t-code',
|
|
381
|
+
tag: 'code'
|
|
382
|
+
},
|
|
383
|
+
shadow: {
|
|
384
|
+
name: lang.menu_shadow,
|
|
385
|
+
class: '__se__t-shadow',
|
|
386
|
+
tag: 'span'
|
|
387
|
+
}
|
|
388
|
+
} // test style items
|
|
389
|
+
},
|
|
390
|
+
|
|
391
|
+
// --------- field
|
|
392
|
+
mention: {
|
|
393
|
+
triggerText: '@', // Trigger text for mentions
|
|
394
|
+
limitSize: 5, // Limit size for mentions
|
|
395
|
+
searchStartLength: 0, // Search start length for mentions
|
|
396
|
+
delayTime: 200, // Delay time for mention search
|
|
397
|
+
apiUrl: '', // API URL for mentions
|
|
398
|
+
apiHeaders: null, // API headers for mentions
|
|
399
|
+
useCachingData: true, // Use caching for mention data
|
|
400
|
+
useCachingFieldData: true // Use caching for mention field data
|
|
401
|
+
},
|
|
402
|
+
|
|
403
|
+
// --------- file browser
|
|
404
|
+
imageGallery: {
|
|
405
|
+
url: null, // URL for the image gallery file browser
|
|
406
|
+
headers: null, // Headers for the image gallery file browser
|
|
407
|
+
defaultWidth: '', // Default width for images in the gallery
|
|
408
|
+
defaultHeight: '' // Default height for images in the gallery
|
|
409
|
+
},
|
|
410
|
+
|
|
411
|
+
// --------- input
|
|
412
|
+
fontSize: {
|
|
413
|
+
unitMap: {
|
|
414
|
+
text: {
|
|
415
|
+
default: '13px',
|
|
416
|
+
list: [
|
|
417
|
+
{ title: 'XX-Small', size: '8px' },
|
|
418
|
+
{ title: 'X-Small', size: '10px' },
|
|
419
|
+
{ title: 'Small', size: '13px' },
|
|
420
|
+
{ title: 'Medium', size: '16px' },
|
|
421
|
+
{ title: 'Large', size: '18px' },
|
|
422
|
+
{ title: 'X-Large', size: '24px' },
|
|
423
|
+
{ title: 'XX-Large', size: '32px' }
|
|
424
|
+
]
|
|
425
|
+
},
|
|
426
|
+
px: {
|
|
427
|
+
default: 13,
|
|
428
|
+
inc: 1,
|
|
429
|
+
min: 8,
|
|
430
|
+
max: 72,
|
|
431
|
+
list: [8, 10, 13, 15, 18, 20, 22, 26, 28, 36, 48, 72]
|
|
432
|
+
},
|
|
433
|
+
pt: {
|
|
434
|
+
default: 10,
|
|
435
|
+
inc: 1,
|
|
436
|
+
min: 6,
|
|
437
|
+
max: 72,
|
|
438
|
+
list: [6, 8, 10, 12, 14, 18, 22, 26, 32]
|
|
439
|
+
},
|
|
440
|
+
em: {
|
|
441
|
+
default: 1,
|
|
442
|
+
inc: 0.1,
|
|
443
|
+
min: 0.5,
|
|
444
|
+
max: 5,
|
|
445
|
+
list: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.5, 3]
|
|
446
|
+
},
|
|
447
|
+
rem: {
|
|
448
|
+
default: 1,
|
|
449
|
+
inc: 0.1,
|
|
450
|
+
min: 0.5,
|
|
451
|
+
max: 5,
|
|
452
|
+
list: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.5, 3]
|
|
453
|
+
},
|
|
454
|
+
vw: {
|
|
455
|
+
inc: 0.1,
|
|
456
|
+
min: 0.5,
|
|
457
|
+
max: 10,
|
|
458
|
+
list: [2, 3.5, 4, 4.5, 6, 8]
|
|
459
|
+
},
|
|
460
|
+
vh: {
|
|
461
|
+
default: 1.5,
|
|
462
|
+
inc: 0.1,
|
|
463
|
+
min: 0.5,
|
|
464
|
+
max: 10,
|
|
465
|
+
list: [1, 1.5, 2, 2.5, 3, 3.5, 4]
|
|
466
|
+
},
|
|
467
|
+
'%': {
|
|
468
|
+
default: 100,
|
|
469
|
+
inc: 1,
|
|
470
|
+
min: 50,
|
|
471
|
+
max: 200,
|
|
472
|
+
list: [50, 70, 90, 100, 120, 140, 160, 180, 200]
|
|
473
|
+
}
|
|
474
|
+
}, // Unit map for font sizes
|
|
475
|
+
sizeUnit: 'text', // Size unit for font size (default 'text')
|
|
476
|
+
showDefaultSizeLabel: false, // Show default size label
|
|
477
|
+
showIncDecControls: false, // Show increment/decrement controls
|
|
478
|
+
disableInput: true // Disable input for font size
|
|
479
|
+
},
|
|
480
|
+
pageNavigator: null, // no options
|
|
481
|
+
|
|
482
|
+
// --------- modal
|
|
483
|
+
audio: {
|
|
484
|
+
defaultWidth: '', // Default width for audio player
|
|
485
|
+
defaultHeight: '', // Default height for audio player
|
|
486
|
+
createFileInput: false, // Create file input for audio
|
|
487
|
+
createUrlInput: true, // Create URL input for audio
|
|
488
|
+
uploadUrl: null, // URL for audio upload
|
|
489
|
+
uploadHeaders: null, // Headers for audio upload
|
|
490
|
+
uploadSizeLimit: null, // Upload size limit for audio
|
|
491
|
+
uploadSingleSizeLimit: null, // Single file upload size limit
|
|
492
|
+
allowMultiple: false, // Allow multiple audio uploads
|
|
493
|
+
acceptedFormats: 'audio/*', // Accepted audio formats
|
|
494
|
+
audioTagAttributes: null // Attributes for the audio tag
|
|
495
|
+
},
|
|
496
|
+
drawing: {
|
|
497
|
+
outputFormat: 'dataurl', // Output format for drawing (dataurl, svg)
|
|
498
|
+
useFormatType: false, // Use format type
|
|
499
|
+
defaultFormatType: 'block', // Default format type (block, inline)
|
|
500
|
+
keepFormatType: false, // Keep format type
|
|
501
|
+
lineWidth: 5, // Default line width
|
|
502
|
+
lineReconnect: false, // Line reconnect option
|
|
503
|
+
lineCap: 'round', // Line cap style (butt, round, square)
|
|
504
|
+
lineColor: '', // Default line color
|
|
505
|
+
formSize: {
|
|
506
|
+
width: '750px', // Form width
|
|
507
|
+
height: '50vh', // Form height
|
|
508
|
+
maxWidth: '', // Max form width
|
|
509
|
+
maxHeight: '', // Max form height
|
|
510
|
+
minWidth: '150px', // Min form width
|
|
511
|
+
minHeight: '100px' // Min form height
|
|
512
|
+
},
|
|
513
|
+
canResize: true, // Can resize the drawing area
|
|
514
|
+
maintainRatio: true // Maintain aspect ratio
|
|
515
|
+
},
|
|
516
|
+
image: {
|
|
517
|
+
canResize: true, // Can resize the image
|
|
518
|
+
showHeightInput: true, // Show height input
|
|
519
|
+
defaultWidth: 'auto', // Default width for the image
|
|
520
|
+
defaultHeight: 'auto', // Default height for the image
|
|
521
|
+
percentageOnlySize: false, // Use percentage only for size
|
|
522
|
+
createFileInput: true, // Create file input for image
|
|
523
|
+
createUrlInput: true, // Create URL input for image
|
|
524
|
+
uploadUrl: null, // URL for image upload
|
|
525
|
+
uploadHeaders: null, // Headers for image upload
|
|
526
|
+
uploadSizeLimit: null, // Upload size limit for image
|
|
527
|
+
uploadSingleSizeLimit: null, // Single file upload size limit
|
|
528
|
+
allowMultiple: false, // Allow multiple image uploads
|
|
529
|
+
acceptedFormats: 'image/*', // Accepted image formats
|
|
530
|
+
useFormatType: true, // Use format type for image
|
|
531
|
+
defaultFormatType: 'block', // Default format type (block, inline)
|
|
532
|
+
keepFormatType: false // Keep format type
|
|
533
|
+
},
|
|
534
|
+
link: {
|
|
535
|
+
textToDisplay: true, // Display text input field
|
|
536
|
+
title: true, // Display title input field
|
|
537
|
+
uploadUrl: null, // URL for file upload
|
|
538
|
+
uploadHeaders: null, // Headers for file upload
|
|
539
|
+
uploadSizeLimit: null, // Upload size limit
|
|
540
|
+
uploadSingleSizeLimit: null, // Single file upload size limit
|
|
541
|
+
acceptedFormats: null, // Accepted file formats
|
|
542
|
+
enableFileUpload: false, // Enable file upload
|
|
543
|
+
openNewWindow: false, // Open link in a new window
|
|
544
|
+
relList: [], // List of rel attribute values
|
|
545
|
+
defaultRel: {}, // Default rel attributes
|
|
546
|
+
noAutoPrefix: false // Disable automatic prefix for URLs
|
|
547
|
+
},
|
|
548
|
+
math: {
|
|
549
|
+
formSize: {
|
|
550
|
+
width: '460px', // Default form width
|
|
551
|
+
height: '14em', // Default form height
|
|
552
|
+
maxWidth: '', // Maximum form width
|
|
553
|
+
maxHeight: '', // Maximum form height
|
|
554
|
+
minWidth: '400px', // Minimum form width
|
|
555
|
+
minHeight: '40px' // Minimum form height
|
|
556
|
+
},
|
|
557
|
+
canResize: true, // Can resize the math input area
|
|
558
|
+
autoHeight: false, // Automatically adjust height
|
|
559
|
+
fontSizeList: [
|
|
560
|
+
// List of font sizes
|
|
561
|
+
{ text: '1', value: '1em' },
|
|
562
|
+
{ text: '1.5', value: '1.5em' },
|
|
563
|
+
{ text: '2', value: '2em' },
|
|
564
|
+
{ text: '2.5', value: '2.5em' }
|
|
565
|
+
]
|
|
566
|
+
},
|
|
567
|
+
video: {
|
|
568
|
+
canResize: true, // Can resize the video
|
|
569
|
+
showHeightInput: true, // Show height input field
|
|
570
|
+
defaultWidth: '', // Default width for video
|
|
571
|
+
defaultHeight: '', // Default height for video
|
|
572
|
+
percentageOnlySize: false, // Use percentage only for size
|
|
573
|
+
createFileInput: false, // Create file input for video
|
|
574
|
+
createUrlInput: true, // Create URL input for video
|
|
575
|
+
uploadUrl: null, // URL for video upload
|
|
576
|
+
uploadHeaders: null, // Headers for video upload
|
|
577
|
+
uploadSizeLimit: null, // Upload size limit for video
|
|
578
|
+
uploadSingleSizeLimit: null, // Single file upload size limit
|
|
579
|
+
allowMultiple: false, // Allow multiple video uploads
|
|
580
|
+
acceptedFormats: 'video/*', // Accepted video formats
|
|
581
|
+
defaultRatio: 0.5625, // Default aspect ratio for video
|
|
582
|
+
showRatioOption: true, // Show aspect ratio option
|
|
583
|
+
ratioOptions: null, // Custom aspect ratio options
|
|
584
|
+
videoTagAttributes: null, // Attributes for the video tag
|
|
585
|
+
iframeTagAttributes: null, // Attributes for the iframe tag
|
|
586
|
+
query_youtube: '', // Query parameters for YouTube videos
|
|
587
|
+
query_vimeo: '', // Query parameters for Vimeo videos
|
|
588
|
+
embedQuery: {
|
|
589
|
+
youtube: {
|
|
590
|
+
pattern: /youtu\.?be/i,
|
|
591
|
+
action: (url) => {
|
|
592
|
+
url = this.convertUrlYoutube(url);
|
|
593
|
+
return converter.addUrlQuery(url, 'query_youtube');
|
|
594
|
+
},
|
|
595
|
+
tag: 'iframe'
|
|
596
|
+
},
|
|
597
|
+
vimeo: {
|
|
598
|
+
pattern: /vimeo\.com/i,
|
|
599
|
+
action: (url) => {
|
|
600
|
+
url = this.convertUrlVimeo(url);
|
|
601
|
+
return converter.addUrlQuery(url, 'query_vimeo');
|
|
602
|
+
},
|
|
603
|
+
tag: 'iframe'
|
|
604
|
+
}
|
|
605
|
+
} // Query parameters for video
|
|
606
|
+
},
|
|
607
|
+
|
|
608
|
+
// --------- popup
|
|
609
|
+
anchor: null // no options
|
|
610
|
+
}
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|