suneditor 2.44.2 → 2.44.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/LICENSE.txt +20 -20
  2. package/README.md +1585 -1585
  3. package/dist/css/suneditor.min.css +1 -1
  4. package/dist/suneditor.min.js +2 -2
  5. package/package.json +71 -71
  6. package/src/assets/css/suneditor-contents.css +556 -556
  7. package/src/assets/css/suneditor.css +0 -0
  8. package/src/assets/defaultIcons.js +103 -103
  9. package/src/lang/Lang.d.ts +143 -143
  10. package/src/lang/ckb.d.ts +4 -4
  11. package/src/lang/ckb.js +187 -187
  12. package/src/lang/da.d.ts +4 -4
  13. package/src/lang/da.js +191 -191
  14. package/src/lang/de.d.ts +4 -4
  15. package/src/lang/de.js +187 -187
  16. package/src/lang/en.d.ts +4 -4
  17. package/src/lang/en.js +187 -187
  18. package/src/lang/es.d.ts +4 -4
  19. package/src/lang/es.js +187 -187
  20. package/src/lang/fr.d.ts +4 -4
  21. package/src/lang/fr.js +188 -188
  22. package/src/lang/he.d.ts +4 -4
  23. package/src/lang/he.js +188 -188
  24. package/src/lang/index.d.ts +22 -21
  25. package/src/lang/index.js +25 -24
  26. package/src/lang/it.d.ts +4 -4
  27. package/src/lang/it.js +188 -188
  28. package/src/lang/ja.d.ts +4 -4
  29. package/src/lang/ja.js +187 -187
  30. package/src/lang/ko.d.ts +4 -4
  31. package/src/lang/ko.js +187 -187
  32. package/src/lang/lv.d.ts +4 -4
  33. package/src/lang/lv.js +187 -187
  34. package/src/lang/nl.d.ts +4 -4
  35. package/src/lang/nl.js +187 -187
  36. package/src/lang/pl.d.ts +4 -4
  37. package/src/lang/pl.js +187 -187
  38. package/src/lang/pt_br.d.ts +4 -4
  39. package/src/lang/pt_br.js +189 -189
  40. package/src/lang/ro.d.ts +4 -4
  41. package/src/lang/ro.js +187 -187
  42. package/src/lang/ru.d.ts +4 -4
  43. package/src/lang/ru.js +187 -187
  44. package/src/lang/se.d.ts +4 -4
  45. package/src/lang/se.js +191 -191
  46. package/src/lang/ua.d.ts +5 -5
  47. package/src/lang/ua.js +188 -188
  48. package/src/lang/ur.d.ts +5 -0
  49. package/src/lang/ur.js +188 -0
  50. package/src/lang/zh_cn.d.ts +4 -4
  51. package/src/lang/zh_cn.js +187 -187
  52. package/src/lib/constructor.js +1 -2
  53. package/src/lib/context.d.ts +42 -42
  54. package/src/lib/context.js +0 -0
  55. package/src/lib/core.d.ts +1101 -1101
  56. package/src/lib/core.js +220 -99
  57. package/src/lib/history.d.ts +48 -48
  58. package/src/lib/history.js +218 -218
  59. package/src/lib/util.d.ts +677 -677
  60. package/src/lib/util.js +38 -12
  61. package/src/options.d.ts +608 -608
  62. package/src/plugins/CommandPlugin.d.ts +7 -7
  63. package/src/plugins/DialogPlugin.d.ts +19 -19
  64. package/src/plugins/FileBrowserPlugin.d.ts +29 -29
  65. package/src/plugins/Module.d.ts +14 -14
  66. package/src/plugins/Plugin.d.ts +41 -41
  67. package/src/plugins/SubmenuPlugin.d.ts +7 -7
  68. package/src/plugins/command/blockquote.d.ts +4 -4
  69. package/src/plugins/command/blockquote.js +46 -46
  70. package/src/plugins/dialog/audio.d.ts +4 -4
  71. package/src/plugins/dialog/audio.js +556 -554
  72. package/src/plugins/dialog/image.d.ts +4 -4
  73. package/src/plugins/dialog/image.js +1122 -1107
  74. package/src/plugins/dialog/link.d.ts +4 -4
  75. package/src/plugins/dialog/link.js +223 -223
  76. package/src/plugins/dialog/math.d.ts +4 -4
  77. package/src/plugins/dialog/math.js +294 -294
  78. package/src/plugins/dialog/mention.d.ts +5 -5
  79. package/src/plugins/dialog/mention.js +242 -242
  80. package/src/plugins/dialog/video.d.ts +4 -4
  81. package/src/plugins/dialog/video.js +983 -981
  82. package/src/plugins/fileBrowser/imageGallery.d.ts +4 -4
  83. package/src/plugins/fileBrowser/imageGallery.js +63 -63
  84. package/src/plugins/index.d.ts +79 -79
  85. package/src/plugins/index.js +32 -32
  86. package/src/plugins/modules/_anchor.js +461 -462
  87. package/src/plugins/modules/_colorPicker.d.ts +59 -59
  88. package/src/plugins/modules/_colorPicker.js +0 -0
  89. package/src/plugins/modules/_notice.d.ts +20 -20
  90. package/src/plugins/modules/_notice.js +72 -72
  91. package/src/plugins/modules/_selectMenu.js +118 -118
  92. package/src/plugins/modules/component.d.ts +24 -24
  93. package/src/plugins/modules/component.js +82 -82
  94. package/src/plugins/modules/dialog.d.ts +27 -27
  95. package/src/plugins/modules/dialog.js +174 -174
  96. package/src/plugins/modules/fileBrowser.d.ts +41 -41
  97. package/src/plugins/modules/fileBrowser.js +373 -373
  98. package/src/plugins/modules/fileManager.d.ts +66 -66
  99. package/src/plugins/modules/fileManager.js +325 -324
  100. package/src/plugins/modules/index.d.ts +10 -10
  101. package/src/plugins/modules/index.js +8 -8
  102. package/src/plugins/modules/resizing.d.ts +153 -153
  103. package/src/plugins/modules/resizing.js +895 -895
  104. package/src/plugins/submenu/align.d.ts +4 -4
  105. package/src/plugins/submenu/align.js +160 -160
  106. package/src/plugins/submenu/font.d.ts +4 -4
  107. package/src/plugins/submenu/font.js +120 -120
  108. package/src/plugins/submenu/fontColor.d.ts +4 -4
  109. package/src/plugins/submenu/fontColor.js +0 -0
  110. package/src/plugins/submenu/fontSize.d.ts +4 -4
  111. package/src/plugins/submenu/fontSize.js +112 -112
  112. package/src/plugins/submenu/formatBlock.d.ts +4 -4
  113. package/src/plugins/submenu/formatBlock.js +273 -273
  114. package/src/plugins/submenu/hiliteColor.d.ts +4 -4
  115. package/src/plugins/submenu/hiliteColor.js +0 -0
  116. package/src/plugins/submenu/horizontalRule.d.ts +4 -4
  117. package/src/plugins/submenu/horizontalRule.js +98 -98
  118. package/src/plugins/submenu/lineHeight.d.ts +4 -4
  119. package/src/plugins/submenu/lineHeight.js +104 -104
  120. package/src/plugins/submenu/list.d.ts +4 -4
  121. package/src/plugins/submenu/list.js +456 -455
  122. package/src/plugins/submenu/paragraphStyle.d.ts +4 -4
  123. package/src/plugins/submenu/paragraphStyle.js +135 -135
  124. package/src/plugins/submenu/table.d.ts +4 -4
  125. package/src/plugins/submenu/template.d.ts +4 -4
  126. package/src/plugins/submenu/template.js +71 -71
  127. package/src/plugins/submenu/textStyle.d.ts +4 -4
  128. package/src/plugins/submenu/textStyle.js +167 -167
  129. package/src/suneditor.d.ts +9 -9
  130. package/src/suneditor.js +75 -75
  131. package/src/suneditor_build.js +17 -17
package/src/options.d.ts CHANGED
@@ -1,608 +1,608 @@
1
- import { Lang } from './lang/Lang';
2
- import { Plugin } from './plugins/Plugin';
3
-
4
- export interface SunEditorOptions {
5
- plugins?: Plugin[] | Record<string, Plugin>;
6
- /**
7
- * Values
8
- * ======
9
- */
10
- /**
11
- * language object
12
- */
13
- lang?: Lang;
14
- /**
15
- * Specifies default tag name of the editor. (default: "p")
16
- */
17
- defaultTag?: string;
18
- /**
19
- * You can change the tag of the default text button. default: { bold: 'STRONG', underline: 'U', italic: 'EM', strike: 'DEL', sub: 'SUB', sup: 'SUP' }
20
- */
21
- textTags?: { bold?: string; underline?: string; italic?: string; strike?: string; sub?: string; sup?: string;};
22
- /**
23
- * Initial value(html string) of the edit area.
24
- * If not, the value of the "target textarea".
25
- */
26
- value?: string;
27
- /**
28
- * When recording the history stack, this is the delay time (miliseconds) since the last input. default: 400
29
- */
30
- historyStackDelayTime?: number;
31
- /**
32
- * Whitelist
33
- * ======
34
- */
35
- /**
36
- * Add tags to the default tags whitelist of editor.
37
- */
38
- addTagsWhitelist?: string | '*';
39
- /**
40
- * Blacklist of the editor default tags.
41
- */
42
- tagsBlacklist?: string;
43
- /**
44
- * Whitelist of tags when pasting.
45
- */
46
- pasteTagsWhitelist?: string | '*';
47
- /**
48
- * Blacklist of tags when pasting.
49
- */
50
- pasteTagsBlacklist?: string;
51
- /**
52
- * Add attributes whitelist of tags that should be kept undeleted from the editor.
53
- */
54
- attributesWhitelist?: Record<string, string | '*'>;
55
- /**
56
- * Add attribute blacklist of tags that should be deleted in editor.
57
- */
58
- attributesBlacklist?: Record<string, string | '*'>;
59
- /**
60
- * Layout
61
- * ======
62
- */
63
- /**
64
- * The mode of the editor (classic, inline, balloon, balloon-always)
65
- */
66
- mode?: 'classic' | 'inline' | 'balloon' | 'balloon-always';
67
- /**
68
- * If true, the editor is set to RTL(Right To Left) mode.
69
- */
70
- rtl?: boolean;
71
- /**
72
- * Deletes other attributes except for the property set at the time of line break.
73
- * If there is no value, no all attribute is deleted.
74
- * @example 'class|style': Attributes other than "class" and "style" are deleted at line break.
75
- * '*': All attributes are deleted at line break.
76
- */
77
- lineAttrReset?: string;
78
- /**
79
- * Button List
80
- */
81
- buttonList?: ButtonListItem[];
82
- /**
83
- * The width of the toolbar.
84
- Applies only when the editor mode is 'inline' or 'balloon' mode.
85
- */
86
- toolbarWidth?: string;
87
- /**
88
- * A custom HTML selector placing the toolbar inside.
89
- The class name of the element must be 'sun-editor'.
90
- Element or querySelector argument.
91
- */
92
- toolbarContainer?: HTMLElement | string;
93
- /**
94
- * Top offset value of "sticky toolbar".
95
- */
96
- stickyToolbar?: number | string;
97
- /**
98
- * The toolbar is rendered hidden.
99
- */
100
- hideToolbar?: boolean;
101
- /**
102
- * Top offset value of "full Screen".
103
- */
104
- fullScreenOffset?: number | string;
105
- /**
106
- * Content will be placed in an iframe and isolated from the rest of the page
107
- */
108
- iframe?: boolean;
109
- /**
110
- * Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration
111
- */
112
- fullPage?: boolean;
113
- /**
114
- * Attributes of the iframe.
115
- */
116
- iframeAttributes?: Record<string, string>;
117
- /**
118
- * Name of the CSS file(s) to apply inside the iframe.
119
- */
120
- iframeCSSFileName?: string | string[];
121
- /**
122
- * A template of the "preview".
123
- * The {{contents}} part in the HTML string is replaced with the contents of the editor.
124
- * @example "<h1>Preview Template</h1> {{contents}} <div>_Footer_</div>"
125
- */
126
- previewTemplate?: string;
127
- /**
128
- * A template of the "print".
129
- * The {{contents}} part in the HTML string is replaced with the contents of the editor.
130
- * @example "<h1>Print Template</h1> {{contents}} <div>_Footer_</div>"
131
- */
132
- printTemplate?: string;
133
- /**
134
- * CodeMirror object
135
- */
136
- codeMirror?: any | { src: any; options: object };
137
- /**
138
- * Katex object (Use "math" plugin)
139
- */
140
- katex?: any | { src: any; options: object };
141
- /**
142
- * Math plugin font size list
143
- */
144
- mathFontSize?: { text: string; value: string; default?: boolean; }[];
145
- /**
146
- * Display
147
- * =======
148
- */
149
- /**
150
- * The position property of editor
151
- */
152
- position?: string;
153
- /**
154
- * The display property of editor
155
- */
156
- display?: string;
157
- /**
158
- * Size of background area when activating dialog window ('full'||'local')
159
- */
160
- popupDisplay?: 'full' | 'local';
161
- /**
162
- * Bottom resizing bar
163
- * ===================
164
- */
165
- /**
166
- * Show the bottom resizing bar
167
- */
168
- resizingBar?: boolean;
169
- /**
170
- * Displays the current node structure to resizingBar
171
- */
172
- showPathLabel?: boolean;
173
- /**
174
- * Enable/disable resize function of bottom resizing bar.
175
- */
176
- resizeEnable?: boolean;
177
- /**
178
- * A custom HTML selector placing the resizing bar inside.
179
- The class name of the element must be 'sun-editor'.
180
- Element or querySelector argument.
181
- */
182
- resizingBarContainer?: HTMLElement | string;
183
- /**
184
- * Character count
185
- * ===============
186
- */
187
- /**
188
- * Shows the number of characters in the editor
189
- */
190
- charCounter?: boolean;
191
- /**
192
- * Defines the calculation method of the "charCounter" option
193
- */
194
- charCounterType?: 'char' | 'byte' | 'byte-html';
195
- /**
196
- * Text to be displayed in the "charCounter" area of the bottom bar.
197
- */
198
- charCounterLabel?: string;
199
- /**
200
- * The maximum number of characters allowed to be inserted into the editor
201
- */
202
- maxCharCount?: number;
203
- /**
204
- * Size
205
- * ====
206
- */
207
- /**
208
- * The width size of the editor
209
- */
210
- width?: string;
211
- /**
212
- * The min-width size of the editor
213
- */
214
- minWidth?: string;
215
- /**
216
- * The max-width size of the editor
217
- */
218
- maxWidth?: string;
219
- /**
220
- * The height size of the editor
221
- */
222
- height?: string;
223
- /**
224
- * The min-height size of the editor
225
- */
226
- minHeight?: string;
227
- /**
228
- * The max-height size of the editor
229
- */
230
- maxHeight?: string;
231
- /**
232
- * Editing area
233
- * ===================
234
- */
235
- /**
236
- * Add a "class" to the editing area[.sun-editor-editable]
237
- */
238
- className?: string;
239
- /**
240
- * You can define the style of the editing area[.sun-editor-editable].
241
- * It affects the entire editing area.
242
- * ('z-index', 'position' and 'width' properties apply to the top div.)
243
- * @example 'font-family: cursive; font-size: 10px;'
244
- */
245
- defaultStyle?: string;
246
- /**
247
- * Defining menu items
248
- * ===================
249
- */
250
- /**
251
- * Change default font-family array
252
- */
253
- font?: string[];
254
- /**
255
- * Change default font-size array
256
- */
257
- fontSize?: number[];
258
- /**
259
- * The font size unit
260
- */
261
- fontSizeUnit?: string;
262
- /**
263
- * A list of drop-down options for the 'align' plugin.
264
- */
265
- alignItems?: ('left' | 'center' | 'right' | 'justify')[];
266
- /**
267
- * Change default formatBlock array
268
- */
269
- formats?: FormatTagName[];
270
- /**
271
- * Change default color array of color picker
272
- */
273
- colorList?: string[];
274
- /**
275
- * Line Heights
276
- */
277
- lineHeights?: LineHeightsItem[];
278
- /**
279
- * Paragraph Styles
280
- */
281
- paragraphStyles?: ParagraphStyles;
282
- /**
283
- * Text Styles
284
- */
285
- textStyles?: TextStyles;
286
- /**
287
- * Image
288
- * =====
289
- */
290
- /**
291
- * Can resize the image
292
- */
293
- imageResizing?: boolean;
294
- /**
295
- * Choose whether the image height input is visible.
296
- */
297
- imageHeightShow?: boolean;
298
- /**
299
- * Choose whether the image align radio buttons are visible.
300
- */
301
- imageAlignShow?: boolean;
302
- /**
303
- * The default width size of the image frame
304
- */
305
- imageWidth?: string;
306
- /**
307
- * The default height size of the image frame
308
- */
309
- imageHeight?: string;
310
- /**
311
- * If true, image size can only be scaled by percentage.
312
- */
313
- imageSizeOnlyPercentage?: boolean;
314
- /**
315
- * It is determined by "imageSizeOnlyPercentage".
316
- * @pivate
317
- */
318
- _videoSizeUnit?: '%' | 'px';
319
- /**
320
- * Choose whether to image rotation buttons display.
321
- * When "imageSizeOnlyPercentage" is "true" or or "imageHeightShow" is "false" the default value is false.
322
- * If you want the button to be visible, put it a true.
323
- */
324
- imageRotation?: boolean;
325
- /**
326
- * Choose whether to create a file input tag in the image upload window
327
- */
328
- imageFileInput?: boolean;
329
- /**
330
- * Choose whether to create a image url input tag in the image upload window
331
- */
332
- imageUrlInput?: boolean;
333
- /**
334
- * Http Header when uploading images.
335
- */
336
- imageUploadHeader?: Record<string, string>;
337
- /**
338
- * The image upload to server mapping address
339
- */
340
- imageUploadUrl?: string;
341
- /**
342
- * The size of the total uploadable images (in bytes)
343
- */
344
- imageUploadSizeLimit?: number;
345
- /**
346
- * If true, multiple images can be selected.
347
- */
348
- imageMultipleFile?: boolean;
349
- /**
350
- * Define the "accept" attribute of the input.
351
- * @example "*" or ".jpg, .png .."
352
- */
353
- imageAccept?: string;
354
- /**
355
- * Image - image gallery
356
- * =====
357
- */
358
- /**
359
- * The url of the image gallery, if you use the image gallery
360
- */
361
- imageGalleryUrl?: string;
362
- /**
363
- * Http Header when get image gallery.
364
- */
365
- imageGalleryHeader?: Record<string, string>;
366
- /**
367
- * Video
368
- * =====
369
- */
370
- /**
371
- * Can resize the video iframe
372
- */
373
- videoResizing?: boolean;
374
- /**
375
- * Choose whether the video height input is visible.
376
- */
377
- videoHeightShow?: boolean;
378
- /**
379
- * Choose whether the video align radio buttons are visible.
380
- */
381
- videoAlignShow?: boolean;
382
- /**
383
- * Choose whether the video ratio options is visible.
384
- */
385
- videoRatioShow?: boolean;
386
- /**
387
- * The default width size of the video frame
388
- */
389
- videoWidth?: string;
390
- /**
391
- * The default height size of the video frame
392
- */
393
- videoHeight?: string;
394
- /**
395
- * If true, video size can only be scaled by percentage.
396
- */
397
- videoSizeOnlyPercentage?: boolean;
398
- /**
399
- * Choose whether to video rotation buttons display.
400
- * When "videoSizeOnlyPercentage" is "true" or "videoHeightShow" is "false" the default value is false.
401
- * If you want the button to be visible, put it a true.
402
- */
403
- videoRotation?: boolean;
404
- /**
405
- * The default aspect ratio of the video.
406
- * Up to four decimal places are allowed.
407
- */
408
- videoRatio?: number;
409
- /**
410
- * Video ratio selection options.
411
- */
412
- videoRatioList?: { name: string; value: number }[];
413
- /**
414
- * The query string of a YouTube embedded URL
415
- */
416
- youtubeQuery?: string;
417
- /**
418
- * Choose whether to create a file input tag in the video upload window
419
- */
420
- videoFileInput?: boolean;
421
- /**
422
- * Choose whether to create a video url input tag in the video upload window
423
- */
424
- videoUrlInput?: boolean;
425
- /**
426
- * Http Header when uploading videos.
427
- */
428
- videoUploadHeader?: Record<string, string>;
429
- /**
430
- * The video upload to server mapping address
431
- */
432
- videoUploadUrl?: string;
433
- /**
434
- * The size of the total uploadable videos (in bytes)
435
- */
436
- videoUploadSizeLimit?: number;
437
- /**
438
- * If true, multiple videos can be selected.
439
- */
440
- videoMultipleFile?: boolean;
441
- /**
442
- * Define "Attributes" of the video tag.
443
- * @example { poster: "http://suneditor.com/docs/loading.gif", autoplay: true }
444
- */
445
- videoTagAttrs?: Record<string, string | boolean>;
446
- /**
447
- * Define "Attributes" of the iframe tag. (Youtube, Vimeo).
448
- * @example { style: "border: 2px solid red;" }
449
- */
450
- videoIframeAttrs?: Record<string, string | boolean>;
451
- /**
452
- * Define the "accept" attribute of the input.
453
- * "*" or ".mp4, .avi .."
454
- */
455
- videoAccept?: string;
456
- /**
457
- * Audio
458
- * =====
459
- */
460
- /**
461
- * The default width size of the audio frame
462
- */
463
- audioWidth?: string;
464
- /**
465
- * The default height size of the audio frame
466
- */
467
- audioHeight?: string;
468
- /**
469
- * Choose whether to create a file input tag in the audio upload window
470
- */
471
- audioFileInput?: boolean;
472
- /**
473
- * Choose whether to create a audio url input tag in the audio upload window
474
- */
475
- audioUrlInput?: boolean;
476
- /**
477
- * Http Header when uploading audios.
478
- */
479
- audioUploadHeader?: Record<string, string>;
480
- /**
481
- * The audio upload to server mapping address
482
- */
483
- audioUploadUrl?: string;
484
- /**
485
- * The size of the total uploadable audios (in bytes)
486
- */
487
- audioUploadSizeLimit?: number;
488
- /**
489
- * If true, videos images can be selected.
490
- */
491
- audioMultipleFile?: boolean;
492
- /**
493
- * Define "Attributes" of the audio tag.
494
- * @example { controlslist: "nodownload", autoplay: true }
495
- */
496
- audioTagAttrs?: Record<string, string | boolean>;
497
- /**
498
- * Define the "accept" attribute of the input.
499
- * "*" or ".mp3, .wav .."
500
- */
501
- audioAccept?: string;
502
- /**
503
- * Table
504
- * =====
505
- */
506
- /**
507
- * Define position to the table cell controller. ('cell', 'top')
508
- */
509
- tableCellControllerPosition?: string;
510
- /**
511
- * Link
512
- * =====
513
- */
514
- /**
515
- * Default checked value of the "Open in new window" checkbox.
516
- */
517
- linkTargetNewWindow?: boolean;
518
- /**
519
- * Protocol for the links (if link has been added without any protocol this one will be used).
520
- */
521
- linkProtocol?: string;
522
- /**
523
- * Defines "rel" attribute list of anchor tag.
524
- */
525
- linkRel?: string[];
526
- /**
527
- * Defines default "rel" attribute list of anchor tag.
528
- */
529
- linkRelDefault?: {default?: string; check_new_window?: string; check_bookmark?: string;};
530
- /**
531
- * If true, disables the automatic prefixing of the host URL to the value of the link. default: false {Boolean}
532
- */
533
- linkNoPrefix?: boolean;
534
- /*
535
- * HR
536
- * =====
537
- */
538
- /**
539
- * Defines the hr items.
540
- * "class" or "style" must be specified.
541
- * @example [{name: "solid", class: "__se__xxx", style: "border-style: outset;"}]
542
- */
543
- hrItems?: { name: string; class?: string; style?: string }[];
544
- /**
545
- * Key actions
546
- * =====
547
- */
548
- /**
549
- * If true, disables the interaction of the editor and tab key
550
- */
551
- tabDisable?: boolean;
552
- shortcutsDisable?: string[];
553
- shortcutsHint?: boolean;
554
- /**
555
- * Defining save button
556
- * ====================
557
- */
558
- /**
559
- * Callback functions that is called when the Save button is clicked
560
- */
561
- callBackSave?: (contents: string, isChanged: boolean) => void;
562
- /**
563
- * Templates Array
564
- * ===============
565
- */
566
- /**
567
- * Templates array
568
- */
569
- templates?: TemplatesItem[];
570
- /**
571
- * ETC
572
- * ===
573
- */
574
- /**
575
- * The placeholder text
576
- */
577
- placeholder?: string;
578
- /**
579
- * Activate the media[image, video, audio] selection status immediately after inserting the media tag. (default: true)
580
- */
581
- mediaAutoSelect?: boolean;
582
- /**
583
- * You can redefine icons.
584
- */
585
- icons?: Record<string, string>;
586
-
587
- /**
588
- * private options
589
- */
590
- _printClass?: string;
591
- }
592
- export type FormatTagName =
593
- 'p'
594
- | 'div'
595
- | 'blockquote'
596
- | 'pre'
597
- | 'h1'
598
- | 'h2'
599
- | 'h3'
600
- | 'h4'
601
- | 'h5'
602
- | 'h6'
603
- | { tag: string; name?: string; command: 'replace' | 'range' | 'free'; class: string };
604
- export type TemplatesItem = { name: string; html: string };
605
- export type LineHeightsItem = { text: string; value: number };
606
- export type ParagraphStyles = (string | { name: string; class: string; _class?: string })[];
607
- export type TextStyles = (string | { name: string; style: string; tag: string; _class?: string })[];
608
- export type ButtonListItem = any;
1
+ import { Lang } from './lang/Lang';
2
+ import { Plugin } from './plugins/Plugin';
3
+
4
+ export interface SunEditorOptions {
5
+ plugins?: Plugin[] | Record<string, Plugin>;
6
+ /**
7
+ * Values
8
+ * ======
9
+ */
10
+ /**
11
+ * language object
12
+ */
13
+ lang?: Lang;
14
+ /**
15
+ * Specifies default tag name of the editor. (default: "p")
16
+ */
17
+ defaultTag?: string;
18
+ /**
19
+ * You can change the tag of the default text button. default: { bold: 'STRONG', underline: 'U', italic: 'EM', strike: 'DEL', sub: 'SUB', sup: 'SUP' }
20
+ */
21
+ textTags?: { bold?: string; underline?: string; italic?: string; strike?: string; sub?: string; sup?: string;};
22
+ /**
23
+ * Initial value(html string) of the edit area.
24
+ * If not, the value of the "target textarea".
25
+ */
26
+ value?: string;
27
+ /**
28
+ * When recording the history stack, this is the delay time (miliseconds) since the last input. default: 400
29
+ */
30
+ historyStackDelayTime?: number;
31
+ /**
32
+ * Whitelist
33
+ * ======
34
+ */
35
+ /**
36
+ * Add tags to the default tags whitelist of editor.
37
+ */
38
+ addTagsWhitelist?: string | '*';
39
+ /**
40
+ * Blacklist of the editor default tags.
41
+ */
42
+ tagsBlacklist?: string;
43
+ /**
44
+ * Whitelist of tags when pasting.
45
+ */
46
+ pasteTagsWhitelist?: string | '*';
47
+ /**
48
+ * Blacklist of tags when pasting.
49
+ */
50
+ pasteTagsBlacklist?: string;
51
+ /**
52
+ * Add attributes whitelist of tags that should be kept undeleted from the editor.
53
+ */
54
+ attributesWhitelist?: Record<string, string | '*'>;
55
+ /**
56
+ * Add attribute blacklist of tags that should be deleted in editor.
57
+ */
58
+ attributesBlacklist?: Record<string, string | '*'>;
59
+ /**
60
+ * Layout
61
+ * ======
62
+ */
63
+ /**
64
+ * The mode of the editor (classic, inline, balloon, balloon-always)
65
+ */
66
+ mode?: 'classic' | 'inline' | 'balloon' | 'balloon-always';
67
+ /**
68
+ * If true, the editor is set to RTL(Right To Left) mode.
69
+ */
70
+ rtl?: boolean;
71
+ /**
72
+ * Deletes other attributes except for the property set at the time of line break.
73
+ * If there is no value, no all attribute is deleted.
74
+ * @example 'class|style': Attributes other than "class" and "style" are deleted at line break.
75
+ * '*': All attributes are deleted at line break.
76
+ */
77
+ lineAttrReset?: string;
78
+ /**
79
+ * Button List
80
+ */
81
+ buttonList?: ButtonListItem[];
82
+ /**
83
+ * The width of the toolbar.
84
+ Applies only when the editor mode is 'inline' or 'balloon' mode.
85
+ */
86
+ toolbarWidth?: string;
87
+ /**
88
+ * A custom HTML selector placing the toolbar inside.
89
+ The class name of the element must be 'sun-editor'.
90
+ Element or querySelector argument.
91
+ */
92
+ toolbarContainer?: HTMLElement | string;
93
+ /**
94
+ * Top offset value of "sticky toolbar".
95
+ */
96
+ stickyToolbar?: number | string;
97
+ /**
98
+ * The toolbar is rendered hidden.
99
+ */
100
+ hideToolbar?: boolean;
101
+ /**
102
+ * Top offset value of "full Screen".
103
+ */
104
+ fullScreenOffset?: number | string;
105
+ /**
106
+ * Content will be placed in an iframe and isolated from the rest of the page
107
+ */
108
+ iframe?: boolean;
109
+ /**
110
+ * Allows the usage of HTML, HEAD, BODY tags and DOCTYPE declaration
111
+ */
112
+ fullPage?: boolean;
113
+ /**
114
+ * Attributes of the iframe.
115
+ */
116
+ iframeAttributes?: Record<string, string>;
117
+ /**
118
+ * Name of the CSS file(s) to apply inside the iframe.
119
+ */
120
+ iframeCSSFileName?: string | string[];
121
+ /**
122
+ * A template of the "preview".
123
+ * The {{contents}} part in the HTML string is replaced with the contents of the editor.
124
+ * @example "<h1>Preview Template</h1> {{contents}} <div>_Footer_</div>"
125
+ */
126
+ previewTemplate?: string;
127
+ /**
128
+ * A template of the "print".
129
+ * The {{contents}} part in the HTML string is replaced with the contents of the editor.
130
+ * @example "<h1>Print Template</h1> {{contents}} <div>_Footer_</div>"
131
+ */
132
+ printTemplate?: string;
133
+ /**
134
+ * CodeMirror object
135
+ */
136
+ codeMirror?: any | { src: any; options: object };
137
+ /**
138
+ * Katex object (Use "math" plugin)
139
+ */
140
+ katex?: any | { src: any; options: object };
141
+ /**
142
+ * Math plugin font size list
143
+ */
144
+ mathFontSize?: { text: string; value: string; default?: boolean; }[];
145
+ /**
146
+ * Display
147
+ * =======
148
+ */
149
+ /**
150
+ * The position property of editor
151
+ */
152
+ position?: string;
153
+ /**
154
+ * The display property of editor
155
+ */
156
+ display?: string;
157
+ /**
158
+ * Size of background area when activating dialog window ('full'||'local')
159
+ */
160
+ popupDisplay?: 'full' | 'local';
161
+ /**
162
+ * Bottom resizing bar
163
+ * ===================
164
+ */
165
+ /**
166
+ * Show the bottom resizing bar
167
+ */
168
+ resizingBar?: boolean;
169
+ /**
170
+ * Displays the current node structure to resizingBar
171
+ */
172
+ showPathLabel?: boolean;
173
+ /**
174
+ * Enable/disable resize function of bottom resizing bar.
175
+ */
176
+ resizeEnable?: boolean;
177
+ /**
178
+ * A custom HTML selector placing the resizing bar inside.
179
+ The class name of the element must be 'sun-editor'.
180
+ Element or querySelector argument.
181
+ */
182
+ resizingBarContainer?: HTMLElement | string;
183
+ /**
184
+ * Character count
185
+ * ===============
186
+ */
187
+ /**
188
+ * Shows the number of characters in the editor
189
+ */
190
+ charCounter?: boolean;
191
+ /**
192
+ * Defines the calculation method of the "charCounter" option
193
+ */
194
+ charCounterType?: 'char' | 'byte' | 'byte-html';
195
+ /**
196
+ * Text to be displayed in the "charCounter" area of the bottom bar.
197
+ */
198
+ charCounterLabel?: string;
199
+ /**
200
+ * The maximum number of characters allowed to be inserted into the editor
201
+ */
202
+ maxCharCount?: number;
203
+ /**
204
+ * Size
205
+ * ====
206
+ */
207
+ /**
208
+ * The width size of the editor
209
+ */
210
+ width?: string;
211
+ /**
212
+ * The min-width size of the editor
213
+ */
214
+ minWidth?: string;
215
+ /**
216
+ * The max-width size of the editor
217
+ */
218
+ maxWidth?: string;
219
+ /**
220
+ * The height size of the editor
221
+ */
222
+ height?: string;
223
+ /**
224
+ * The min-height size of the editor
225
+ */
226
+ minHeight?: string;
227
+ /**
228
+ * The max-height size of the editor
229
+ */
230
+ maxHeight?: string;
231
+ /**
232
+ * Editing area
233
+ * ===================
234
+ */
235
+ /**
236
+ * Add a "class" to the editing area[.sun-editor-editable]
237
+ */
238
+ className?: string;
239
+ /**
240
+ * You can define the style of the editing area[.sun-editor-editable].
241
+ * It affects the entire editing area.
242
+ * ('z-index', 'position' and 'width' properties apply to the top div.)
243
+ * @example 'font-family: cursive; font-size: 10px;'
244
+ */
245
+ defaultStyle?: string;
246
+ /**
247
+ * Defining menu items
248
+ * ===================
249
+ */
250
+ /**
251
+ * Change default font-family array
252
+ */
253
+ font?: string[];
254
+ /**
255
+ * Change default font-size array
256
+ */
257
+ fontSize?: number[];
258
+ /**
259
+ * The font size unit
260
+ */
261
+ fontSizeUnit?: string;
262
+ /**
263
+ * A list of drop-down options for the 'align' plugin.
264
+ */
265
+ alignItems?: ('left' | 'center' | 'right' | 'justify')[];
266
+ /**
267
+ * Change default formatBlock array
268
+ */
269
+ formats?: FormatTagName[];
270
+ /**
271
+ * Change default color array of color picker
272
+ */
273
+ colorList?: string[];
274
+ /**
275
+ * Line Heights
276
+ */
277
+ lineHeights?: LineHeightsItem[];
278
+ /**
279
+ * Paragraph Styles
280
+ */
281
+ paragraphStyles?: ParagraphStyles;
282
+ /**
283
+ * Text Styles
284
+ */
285
+ textStyles?: TextStyles;
286
+ /**
287
+ * Image
288
+ * =====
289
+ */
290
+ /**
291
+ * Can resize the image
292
+ */
293
+ imageResizing?: boolean;
294
+ /**
295
+ * Choose whether the image height input is visible.
296
+ */
297
+ imageHeightShow?: boolean;
298
+ /**
299
+ * Choose whether the image align radio buttons are visible.
300
+ */
301
+ imageAlignShow?: boolean;
302
+ /**
303
+ * The default width size of the image frame
304
+ */
305
+ imageWidth?: string;
306
+ /**
307
+ * The default height size of the image frame
308
+ */
309
+ imageHeight?: string;
310
+ /**
311
+ * If true, image size can only be scaled by percentage.
312
+ */
313
+ imageSizeOnlyPercentage?: boolean;
314
+ /**
315
+ * It is determined by "imageSizeOnlyPercentage".
316
+ * @pivate
317
+ */
318
+ _videoSizeUnit?: '%' | 'px';
319
+ /**
320
+ * Choose whether to image rotation buttons display.
321
+ * When "imageSizeOnlyPercentage" is "true" or or "imageHeightShow" is "false" the default value is false.
322
+ * If you want the button to be visible, put it a true.
323
+ */
324
+ imageRotation?: boolean;
325
+ /**
326
+ * Choose whether to create a file input tag in the image upload window
327
+ */
328
+ imageFileInput?: boolean;
329
+ /**
330
+ * Choose whether to create a image url input tag in the image upload window
331
+ */
332
+ imageUrlInput?: boolean;
333
+ /**
334
+ * Http Header when uploading images.
335
+ */
336
+ imageUploadHeader?: Record<string, string>;
337
+ /**
338
+ * The image upload to server mapping address
339
+ */
340
+ imageUploadUrl?: string;
341
+ /**
342
+ * The size of the total uploadable images (in bytes)
343
+ */
344
+ imageUploadSizeLimit?: number;
345
+ /**
346
+ * If true, multiple images can be selected.
347
+ */
348
+ imageMultipleFile?: boolean;
349
+ /**
350
+ * Define the "accept" attribute of the input.
351
+ * @example "*" or ".jpg, .png .."
352
+ */
353
+ imageAccept?: string;
354
+ /**
355
+ * Image - image gallery
356
+ * =====
357
+ */
358
+ /**
359
+ * The url of the image gallery, if you use the image gallery
360
+ */
361
+ imageGalleryUrl?: string;
362
+ /**
363
+ * Http Header when get image gallery.
364
+ */
365
+ imageGalleryHeader?: Record<string, string>;
366
+ /**
367
+ * Video
368
+ * =====
369
+ */
370
+ /**
371
+ * Can resize the video iframe
372
+ */
373
+ videoResizing?: boolean;
374
+ /**
375
+ * Choose whether the video height input is visible.
376
+ */
377
+ videoHeightShow?: boolean;
378
+ /**
379
+ * Choose whether the video align radio buttons are visible.
380
+ */
381
+ videoAlignShow?: boolean;
382
+ /**
383
+ * Choose whether the video ratio options is visible.
384
+ */
385
+ videoRatioShow?: boolean;
386
+ /**
387
+ * The default width size of the video frame
388
+ */
389
+ videoWidth?: string;
390
+ /**
391
+ * The default height size of the video frame
392
+ */
393
+ videoHeight?: string;
394
+ /**
395
+ * If true, video size can only be scaled by percentage.
396
+ */
397
+ videoSizeOnlyPercentage?: boolean;
398
+ /**
399
+ * Choose whether to video rotation buttons display.
400
+ * When "videoSizeOnlyPercentage" is "true" or "videoHeightShow" is "false" the default value is false.
401
+ * If you want the button to be visible, put it a true.
402
+ */
403
+ videoRotation?: boolean;
404
+ /**
405
+ * The default aspect ratio of the video.
406
+ * Up to four decimal places are allowed.
407
+ */
408
+ videoRatio?: number;
409
+ /**
410
+ * Video ratio selection options.
411
+ */
412
+ videoRatioList?: { name: string; value: number }[];
413
+ /**
414
+ * The query string of a YouTube embedded URL
415
+ */
416
+ youtubeQuery?: string;
417
+ /**
418
+ * Choose whether to create a file input tag in the video upload window
419
+ */
420
+ videoFileInput?: boolean;
421
+ /**
422
+ * Choose whether to create a video url input tag in the video upload window
423
+ */
424
+ videoUrlInput?: boolean;
425
+ /**
426
+ * Http Header when uploading videos.
427
+ */
428
+ videoUploadHeader?: Record<string, string>;
429
+ /**
430
+ * The video upload to server mapping address
431
+ */
432
+ videoUploadUrl?: string;
433
+ /**
434
+ * The size of the total uploadable videos (in bytes)
435
+ */
436
+ videoUploadSizeLimit?: number;
437
+ /**
438
+ * If true, multiple videos can be selected.
439
+ */
440
+ videoMultipleFile?: boolean;
441
+ /**
442
+ * Define "Attributes" of the video tag.
443
+ * @example { poster: "http://suneditor.com/docs/loading.gif", autoplay: true }
444
+ */
445
+ videoTagAttrs?: Record<string, string | boolean>;
446
+ /**
447
+ * Define "Attributes" of the iframe tag. (Youtube, Vimeo).
448
+ * @example { style: "border: 2px solid red;" }
449
+ */
450
+ videoIframeAttrs?: Record<string, string | boolean>;
451
+ /**
452
+ * Define the "accept" attribute of the input.
453
+ * "*" or ".mp4, .avi .."
454
+ */
455
+ videoAccept?: string;
456
+ /**
457
+ * Audio
458
+ * =====
459
+ */
460
+ /**
461
+ * The default width size of the audio frame
462
+ */
463
+ audioWidth?: string;
464
+ /**
465
+ * The default height size of the audio frame
466
+ */
467
+ audioHeight?: string;
468
+ /**
469
+ * Choose whether to create a file input tag in the audio upload window
470
+ */
471
+ audioFileInput?: boolean;
472
+ /**
473
+ * Choose whether to create a audio url input tag in the audio upload window
474
+ */
475
+ audioUrlInput?: boolean;
476
+ /**
477
+ * Http Header when uploading audios.
478
+ */
479
+ audioUploadHeader?: Record<string, string>;
480
+ /**
481
+ * The audio upload to server mapping address
482
+ */
483
+ audioUploadUrl?: string;
484
+ /**
485
+ * The size of the total uploadable audios (in bytes)
486
+ */
487
+ audioUploadSizeLimit?: number;
488
+ /**
489
+ * If true, videos images can be selected.
490
+ */
491
+ audioMultipleFile?: boolean;
492
+ /**
493
+ * Define "Attributes" of the audio tag.
494
+ * @example { controlslist: "nodownload", autoplay: true }
495
+ */
496
+ audioTagAttrs?: Record<string, string | boolean>;
497
+ /**
498
+ * Define the "accept" attribute of the input.
499
+ * "*" or ".mp3, .wav .."
500
+ */
501
+ audioAccept?: string;
502
+ /**
503
+ * Table
504
+ * =====
505
+ */
506
+ /**
507
+ * Define position to the table cell controller. ('cell', 'top')
508
+ */
509
+ tableCellControllerPosition?: string;
510
+ /**
511
+ * Link
512
+ * =====
513
+ */
514
+ /**
515
+ * Default checked value of the "Open in new window" checkbox.
516
+ */
517
+ linkTargetNewWindow?: boolean;
518
+ /**
519
+ * Protocol for the links (if link has been added without any protocol this one will be used).
520
+ */
521
+ linkProtocol?: string;
522
+ /**
523
+ * Defines "rel" attribute list of anchor tag.
524
+ */
525
+ linkRel?: string[];
526
+ /**
527
+ * Defines default "rel" attribute list of anchor tag.
528
+ */
529
+ linkRelDefault?: {default?: string; check_new_window?: string; check_bookmark?: string;};
530
+ /**
531
+ * If true, disables the automatic prefixing of the host URL to the value of the link. default: false {Boolean}
532
+ */
533
+ linkNoPrefix?: boolean;
534
+ /*
535
+ * HR
536
+ * =====
537
+ */
538
+ /**
539
+ * Defines the hr items.
540
+ * "class" or "style" must be specified.
541
+ * @example [{name: "solid", class: "__se__xxx", style: "border-style: outset;"}]
542
+ */
543
+ hrItems?: { name: string; class?: string; style?: string }[];
544
+ /**
545
+ * Key actions
546
+ * =====
547
+ */
548
+ /**
549
+ * If true, disables the interaction of the editor and tab key
550
+ */
551
+ tabDisable?: boolean;
552
+ shortcutsDisable?: string[];
553
+ shortcutsHint?: boolean;
554
+ /**
555
+ * Defining save button
556
+ * ====================
557
+ */
558
+ /**
559
+ * Callback functions that is called when the Save button is clicked
560
+ */
561
+ callBackSave?: (contents: string, isChanged: boolean) => void;
562
+ /**
563
+ * Templates Array
564
+ * ===============
565
+ */
566
+ /**
567
+ * Templates array
568
+ */
569
+ templates?: TemplatesItem[];
570
+ /**
571
+ * ETC
572
+ * ===
573
+ */
574
+ /**
575
+ * The placeholder text
576
+ */
577
+ placeholder?: string;
578
+ /**
579
+ * Activate the media[image, video, audio] selection status immediately after inserting the media tag. (default: true)
580
+ */
581
+ mediaAutoSelect?: boolean;
582
+ /**
583
+ * You can redefine icons.
584
+ */
585
+ icons?: Record<string, string>;
586
+
587
+ /**
588
+ * private options
589
+ */
590
+ _printClass?: string;
591
+ }
592
+ export type FormatTagName =
593
+ 'p'
594
+ | 'div'
595
+ | 'blockquote'
596
+ | 'pre'
597
+ | 'h1'
598
+ | 'h2'
599
+ | 'h3'
600
+ | 'h4'
601
+ | 'h5'
602
+ | 'h6'
603
+ | { tag: string; name?: string; command: 'replace' | 'range' | 'free'; class: string };
604
+ export type TemplatesItem = { name: string; html: string };
605
+ export type LineHeightsItem = { text: string; value: number };
606
+ export type ParagraphStyles = (string | { name: string; class: string; _class?: string })[];
607
+ export type TextStyles = (string | { name: string; style: string; tag: string; _class?: string })[];
608
+ export type ButtonListItem = any;