suneditor 2.41.3 → 2.42.0
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 +107 -24
- 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 +25 -6
- package/src/assets/defaultIcons.js +2 -0
- package/src/lang/Lang.d.ts +3 -1
- package/src/lang/ckb.js +2 -0
- package/src/lang/da.js +2 -0
- package/src/lang/de.js +2 -0
- package/src/lang/en.js +2 -0
- package/src/lang/es.js +2 -0
- package/src/lang/fr.js +10 -8
- package/src/lang/he.js +2 -0
- package/src/lang/it.js +2 -0
- package/src/lang/ja.js +2 -0
- package/src/lang/ko.js +2 -0
- package/src/lang/lv.js +2 -0
- package/src/lang/nl.js +2 -0
- package/src/lang/pl.js +2 -0
- package/src/lang/pt_br.js +2 -0
- package/src/lang/ro.js +2 -0
- package/src/lang/ru.js +2 -0
- package/src/lang/se.js +2 -0
- package/src/lang/ua.js +2 -0
- package/src/lang/zh_cn.js +2 -0
- package/src/lib/constructor.js +50 -11
- package/src/lib/context.js +4 -1
- package/src/lib/core.d.ts +86 -11
- package/src/lib/core.js +555 -147
- package/src/lib/util.d.ts +24 -1
- package/src/lib/util.js +64 -15
- package/src/options.d.ts +63 -8
- package/src/plugins/dialog/audio.js +5 -5
- package/src/plugins/dialog/image.js +30 -20
- package/src/plugins/dialog/video.js +13 -13
- package/src/plugins/fileBrowser/imageGallery.js +2 -3
- package/src/plugins/modules/_anchor.js +6 -4
- package/src/plugins/modules/component.d.ts +1 -1
- package/src/plugins/modules/fileBrowser.js +6 -1
- package/src/plugins/modules/fileManager.js +1 -3
- package/src/plugins/modules/resizing.js +11 -6
- package/src/plugins/submenu/align.js +32 -27
- package/src/plugins/submenu/font.js +1 -1
- package/src/plugins/submenu/horizontalRule.js +19 -25
package/package.json
CHANGED
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
/** --- toolbar ---------------------------------------------------------- */
|
|
139
139
|
.sun-editor .se-toolbar {display:block; position:relative; height:auto; width:100%; overflow:visible; padding:0; margin:0; background-color:#fafafa; outline:1px solid #dadada; z-index:5;}
|
|
140
140
|
.sun-editor .se-toolbar-cover {position:absolute; display:none; font-size:36px; width:100%; height:100%; top:0; left:0; background-color:#fefefe; opacity:.5; filter:alpha(opacity=50); cursor:not-allowed; z-index:4;}
|
|
141
|
-
.sun-editor .se-toolbar-separator-vertical {display:inline-block; height:0px; width:0px; margin:
|
|
141
|
+
.sun-editor .se-toolbar-separator-vertical {display:inline-block; height:0px; width:0px; margin:0px; vertical-align:top;}
|
|
142
142
|
/* inline toolbar */
|
|
143
143
|
.sun-editor .se-toolbar.se-toolbar-inline {display:none; position:absolute; box-shadow:0 3px 9px rgba(0,0,0,.5); -webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);}
|
|
144
144
|
/* balloon toolbar */
|
|
@@ -150,8 +150,8 @@
|
|
|
150
150
|
/** --- tool bar --- module --- button, module, group ---------------------------------------------------------- */
|
|
151
151
|
/* module */
|
|
152
152
|
.sun-editor .se-btn-module {display:inline-block;}
|
|
153
|
-
.sun-editor .se-btn-module-border {border:1px solid #dadada; border-radius:4px;}
|
|
154
|
-
.sun-editor .se-btn-module-enter {display:block; width:100%; height:
|
|
153
|
+
.sun-editor .se-btn-module-border {border:1px solid #dadada; border-radius:4px; margin-left:1px; margin-right:1px;}
|
|
154
|
+
.sun-editor .se-btn-module-enter {display:block; width:100%; height:0px; margin:0; padding:0; background-color:transparent;}
|
|
155
155
|
/* ---more - layer */
|
|
156
156
|
.sun-editor .se-toolbar-more-layer {margin:0 -3px; background-color:#fafafa;}
|
|
157
157
|
.sun-editor .se-toolbar-more-layer .se-more-layer {display:none; border-top:1px solid #dadada;}
|
|
@@ -167,7 +167,6 @@
|
|
|
167
167
|
/* tool bar select button (font, fontSize, formatBlock) */
|
|
168
168
|
.sun-editor .se-btn-select {width:auto; display:flex; padding:4px 6px;}
|
|
169
169
|
.sun-editor .se-btn-select .txt {flex:auto; text-align:left;}
|
|
170
|
-
.sun-editor.se-rtl .se-btn-select svg {margin:auto 1px;}
|
|
171
170
|
.sun-editor .se-btn-select.se-btn-tool-font {width:100px;}
|
|
172
171
|
.sun-editor .se-btn-select.se-btn-tool-format {width:82px;}
|
|
173
172
|
.sun-editor .se-btn-select.se-btn-tool-size {width:78px;}
|
|
@@ -207,6 +206,7 @@
|
|
|
207
206
|
.sun-editor .se-list-layer.se-list-font-family .default {border-bottom:1px solid #CCC;}
|
|
208
207
|
/* submenu layer - hr */
|
|
209
208
|
.sun-editor .se-list-layer.se-list-line {width:125px;}
|
|
209
|
+
.sun-editor .se-list-layer.se-list-line hr {border-width: 1px 0 0; height: 1px;}
|
|
210
210
|
/* submenu layer - align */
|
|
211
211
|
.sun-editor .se-list-layer.se-list-align .se-list-inner {left:9px; width:125px;}
|
|
212
212
|
/** submenu layer - format block, paragraph style, text style */
|
|
@@ -464,6 +464,7 @@
|
|
|
464
464
|
/** --- RTL ---------------------------------------------------------- */
|
|
465
465
|
/* tray */
|
|
466
466
|
.sun-editor.se-rtl .se-btn-tray {direction:rtl;}
|
|
467
|
+
.sun-editor.se-rtl .se-btn-select svg {margin:auto 1px;}
|
|
467
468
|
|
|
468
469
|
/* button--- */
|
|
469
470
|
/* button - select text */
|
|
@@ -472,8 +473,8 @@
|
|
|
472
473
|
.sun-editor.se-rtl .se-btn-list {text-align:right;}
|
|
473
474
|
.sun-editor.se-rtl .se-btn-list > .se-list-icon {margin:-1px 0 0 10px;}
|
|
474
475
|
/* button - se-menu-list - li */
|
|
475
|
-
.sun-editor.se-rtl .se-menu-list {float:right;}
|
|
476
|
-
.sun-editor.se-rtl .se-menu-list li {float:right;}
|
|
476
|
+
.sun-editor.se-rtl .se-menu-list:not(.se-menu-dir-fix) {float:right;}
|
|
477
|
+
.sun-editor.se-rtl .se-menu-list:not(.se-menu-dir-fix) li {float:right;}
|
|
477
478
|
|
|
478
479
|
/* menu list--- */
|
|
479
480
|
.sun-editor.se-rtl .se-list-layer * {direction:rtl;}
|
|
@@ -523,6 +524,24 @@
|
|
|
523
524
|
.sun-editor.se-rtl .se-resizing-container .se-resize-display {direction:rtl;}
|
|
524
525
|
/** --- RTL ---------------------------------------------------------- */
|
|
525
526
|
|
|
527
|
+
/** button module float --------------------------------------------- */
|
|
528
|
+
.sun-editor .se-btn-module-border.module-float-left {float:left;}
|
|
529
|
+
.sun-editor .se-btn-module-border.module-float-right {float:right;}
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
/** ---------------------------------------------------------- menu items style ---------------------------------------------------------- */
|
|
533
|
+
/** hr menu items */
|
|
534
|
+
.sun-editor hr.__se__solid {
|
|
535
|
+
border-style: solid none none;
|
|
536
|
+
}
|
|
537
|
+
.sun-editor hr.__se__dotted {
|
|
538
|
+
border-style: dotted none none;
|
|
539
|
+
}
|
|
540
|
+
.sun-editor hr.__se__dashed {
|
|
541
|
+
border-style: dashed none none;
|
|
542
|
+
}
|
|
543
|
+
/** ---------------------------------------------------------- menu items style ---------------------------------------------------------- */
|
|
544
|
+
|
|
526
545
|
|
|
527
546
|
/** animation */
|
|
528
547
|
@keyframes blinker { 50% {opacity:0;} }
|
|
@@ -85,6 +85,8 @@ export default {
|
|
|
85
85
|
image_gallery: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="30 30 150 150"><g><path d="M152.775,120.548V51.651c0-12.271-9.984-22.254-22.254-22.254H43.727c-12.271,0-22.254,9.983-22.254,22.254v68.896c0,12.27,9.983,22.254,22.254,22.254h86.795C142.791,142.802,152.775,132.817,152.775,120.548z M36.394,51.651c0-4.042,3.291-7.333,7.333-7.333h86.795c4.042,0,7.332,3.291,7.332,7.333v23.917l-14.938-17.767c-1.41-1.678-3.487-2.649-5.68-2.658h-0.029c-2.184,0-4.255,0.954-5.674,2.613L76.709,98.519l-9.096-9.398c-1.427-1.474-3.392-2.291-5.448-2.273c-2.052,0.025-4.004,0.893-5.396,2.4L36.394,111.32V51.651z M41.684,127.585l20.697-22.416l9.312,9.622c1.461,1.511,3.489,2.334,5.592,2.27c2.101-0.066,4.075-1.013,5.44-2.612l34.436-40.308l20.693,24.613v21.794c0,4.042-3.29,7.332-7.332,7.332H43.727C43.018,127.88,42.334,127.775,41.684,127.585z M182.616,152.5V75.657c0-4.12-3.34-7.46-7.461-7.46c-4.119,0-7.46,3.34-7.46,7.46V152.5c0,4.112-3.347,7.46-7.461,7.46h-94c-4.119,0-7.46,3.339-7.46,7.459c0,4.123,3.341,7.462,7.46,7.462h94C172.576,174.881,182.616,164.841,182.616,152.5z"/></g></svg>',
|
|
86
86
|
bookmark: '<svg viewBox="0 0 24 24"><path d="M17,3H7A2,2 0 0,0 5,5V21L12,18L19,21V5C19,3.89 18.1,3 17,3Z" /></svg>',
|
|
87
87
|
download: '<svg viewBox="0 0 24 24"><path d="M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z" /></svg>',
|
|
88
|
+
dir_ltr: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M9 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2H9C6.79 2 5 3.79 5 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zm0 12v3H5v2h12v3l4-4-4-4z"/></svg>',
|
|
89
|
+
dir_rtl: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M10 4v4c-1.1 0-2-.9-2-2s.9-2 2-2m8-2h-8C7.79 2 6 3.79 6 6s1.79 4 4 4v5h2V4h2v11h2V4h2V2zM8 14l-4 4 4 4v-3h12v-2H8v-3z"/></svg>',
|
|
88
90
|
// More icons
|
|
89
91
|
more_text: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 10 180 180"><g><path d="M49.711,142.188h49.027c2.328,0.002,4.394,1.492,5.129,3.699l9.742,29.252c0.363,1.092,1.385,1.828,2.537,1.83l15.883,0.01c0.859,0,1.667-0.412,2.17-1.109s0.641-1.594,0.37-2.41l-16.625-50.045L86.503,28.953c-0.36-1.097-1.383-1.839-2.537-1.842H64.532c-1.153-0.001-2.178,0.736-2.542,1.831L13.847,173.457c-0.271,0.816-0.135,1.713,0.369,2.412c0.503,0.697,1.311,1.109,2.171,1.109h15.872c1.151,0,2.173-0.736,2.537-1.828l9.793-29.287C45.325,143.66,47.39,142.18,49.711,142.188L49.711,142.188z M53.493,119.098l15.607-46.9c0.744-2.196,2.806-3.674,5.125-3.674s4.381,1.478,5.125,3.674l15.607,46.904c0.537,1.621,0.263,3.402-0.736,4.789c-1.018,1.408-2.649,2.24-4.386,2.24H58.615c-1.736,0-3.368-0.832-4.386-2.24C53.23,122.504,52.956,120.721,53.493,119.098L53.493,119.098z M190.465,63.32c0-2.919-1.015-5.396-3.059-7.428c-2.029-2.031-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.016-7.388,3.047c-2.029,2.032-3.056,4.498-3.056,7.386c0,2.889,1.026,5.354,3.056,7.385c2.032,2.032,4.499,3.059,7.388,3.059c2.887,0,5.354-1.026,7.383-3.059C189.45,68.633,190.465,66.178,190.465,63.32L190.465,63.32z M190.465,101.994c0-2.858-1.015-5.313-3.059-7.333c-2.029-2.042-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.005-7.388,3.047c-2.029,2.021-3.056,4.486-3.056,7.376c0,2.887,1.026,5.352,3.056,7.395c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,107.389,190.465,104.914,190.465,101.994L190.465,101.994z M190.465,140.76c0-2.918-1.015-5.395-3.059-7.438c-2.029-2.041-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.006-7.388,3.047c-2.029,2.043-3.056,4.52-3.056,7.438c0,2.922,1.026,5.398,3.056,7.439c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,146.158,190.465,143.682,190.465,140.76L190.465,140.76z"/></g></svg>',
|
|
90
92
|
more_paragraph: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 10 180 180"><g><path d="M128.39,28.499H63.493c-25.558,0-46.354,20.796-46.354,46.354c0,25.559,20.796,46.353,46.354,46.353h9.271v55.625h18.542V47.04h9.271V176.83h18.543V47.04h9.271V28.499z M72.764,102.664h-9.271c-15.337,0-27.813-12.475-27.813-27.812c0-15.336,12.476-27.813,27.813-27.813h9.271V102.664z M190.465,63.32c0-2.919-1.015-5.396-3.059-7.428c-2.029-2.031-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.016-7.388,3.047c-2.029,2.032-3.056,4.498-3.056,7.386c0,2.889,1.026,5.354,3.056,7.385c2.032,2.032,4.499,3.059,7.388,3.059c2.887,0,5.354-1.026,7.383-3.059C189.45,68.633,190.465,66.178,190.465,63.32L190.465,63.32z M190.465,101.994c0-2.858-1.015-5.313-3.059-7.333c-2.029-2.042-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.005-7.388,3.047c-2.029,2.021-3.056,4.486-3.056,7.376c0,2.887,1.026,5.352,3.056,7.395c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,107.389,190.465,104.914,190.465,101.994L190.465,101.994z M190.465,140.76c0-2.918-1.015-5.395-3.059-7.438c-2.029-2.041-4.496-3.047-7.383-3.047c-2.889,0-5.355,1.006-7.388,3.047c-2.029,2.043-3.056,4.52-3.056,7.438c0,2.922,1.026,5.398,3.056,7.439c2.032,2.021,4.499,3.047,7.388,3.047c2.887,0,5.354-1.025,7.383-3.047C189.45,146.158,190.465,143.682,190.465,140.76L190.465,140.76z"/></g></svg>',
|
package/src/lang/Lang.d.ts
CHANGED
package/src/lang/ckb.js
CHANGED
package/src/lang/da.js
CHANGED
package/src/lang/de.js
CHANGED
package/src/lang/en.js
CHANGED
package/src/lang/es.js
CHANGED
package/src/lang/fr.js
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
strike: 'Barré',
|
|
36
36
|
subscript: 'Indice',
|
|
37
37
|
superscript: 'Exposant',
|
|
38
|
-
removeFormat: '
|
|
38
|
+
removeFormat: 'Effacer le formatage',
|
|
39
39
|
fontColor: 'Couleur du texte',
|
|
40
40
|
hiliteColor: 'Couleur en arrière plan',
|
|
41
41
|
indent: 'Indenter',
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
math: 'Math',
|
|
58
58
|
image: 'Image',
|
|
59
59
|
video: 'Video',
|
|
60
|
-
audio: '
|
|
60
|
+
audio: 'Audio',
|
|
61
61
|
fullScreen: 'Plein écran',
|
|
62
62
|
showBlocks: 'Voir les blocs',
|
|
63
63
|
codeView: 'Voir le code',
|
|
64
64
|
undo: 'Annuler',
|
|
65
65
|
redo: 'Rétablir',
|
|
66
|
-
preview: '
|
|
66
|
+
preview: 'Prévisualiser',
|
|
67
67
|
print: 'Imprimer',
|
|
68
68
|
tag_p: 'Paragraphe',
|
|
69
69
|
tag_div: 'Normal (DIV)',
|
|
@@ -75,6 +75,8 @@
|
|
|
75
75
|
paragraphStyle: 'Style de paragraphe',
|
|
76
76
|
textStyle: 'Style de texte',
|
|
77
77
|
imageGallery: 'Galerie d\'images',
|
|
78
|
+
dir_ltr: 'De gauche à droite',
|
|
79
|
+
dir_rtl: 'De droite à gauche',
|
|
78
80
|
mention: 'Mention'
|
|
79
81
|
},
|
|
80
82
|
dialogBox: {
|
|
@@ -90,7 +92,7 @@
|
|
|
90
92
|
title: 'Math',
|
|
91
93
|
inputLabel: 'Notation mathématique',
|
|
92
94
|
fontSizeLabel: 'Taille',
|
|
93
|
-
previewLabel: '
|
|
95
|
+
previewLabel: 'Prévisualiser'
|
|
94
96
|
},
|
|
95
97
|
imageBox: {
|
|
96
98
|
title: 'Insérer une image',
|
|
@@ -99,12 +101,12 @@
|
|
|
99
101
|
altText: 'Texte Alternatif'
|
|
100
102
|
},
|
|
101
103
|
videoBox: {
|
|
102
|
-
title: 'Insérer une
|
|
104
|
+
title: 'Insérer une vidéo',
|
|
103
105
|
file: 'Sélectionner le fichier',
|
|
104
106
|
url: 'URL d’intégration du média, YouTube/Vimeo'
|
|
105
107
|
},
|
|
106
108
|
audioBox: {
|
|
107
|
-
title: '
|
|
109
|
+
title: 'Insérer un fichier audio',
|
|
108
110
|
file: 'Sélectionner le fichier',
|
|
109
111
|
url: 'Adresse URL du fichier'
|
|
110
112
|
},
|
|
@@ -123,7 +125,7 @@
|
|
|
123
125
|
center: 'Centré',
|
|
124
126
|
width: 'Largeur',
|
|
125
127
|
height: 'Hauteur',
|
|
126
|
-
size: '
|
|
128
|
+
size: 'Taille',
|
|
127
129
|
ratio: 'Rapport'
|
|
128
130
|
},
|
|
129
131
|
controller: {
|
|
@@ -159,7 +161,7 @@
|
|
|
159
161
|
bordered: 'Ligne de démarcation',
|
|
160
162
|
neon: 'Néon',
|
|
161
163
|
translucent: 'Translucide',
|
|
162
|
-
shadow: '
|
|
164
|
+
shadow: 'Ombre',
|
|
163
165
|
code: 'Code'
|
|
164
166
|
}
|
|
165
167
|
};
|
package/src/lang/he.js
CHANGED
package/src/lang/it.js
CHANGED
package/src/lang/ja.js
CHANGED
package/src/lang/ko.js
CHANGED
package/src/lang/lv.js
CHANGED
package/src/lang/nl.js
CHANGED
package/src/lang/pl.js
CHANGED
package/src/lang/pt_br.js
CHANGED
package/src/lang/ro.js
CHANGED
package/src/lang/ru.js
CHANGED
package/src/lang/se.js
CHANGED
package/src/lang/ua.js
CHANGED
package/src/lang/zh_cn.js
CHANGED
package/src/lib/constructor.js
CHANGED
|
@@ -87,6 +87,10 @@ export default {
|
|
|
87
87
|
if (toolbarContainer) {
|
|
88
88
|
toolbarContainer.appendChild(tool_bar.element);
|
|
89
89
|
}
|
|
90
|
+
|
|
91
|
+
// resizingbar
|
|
92
|
+
const resizingBarContainer = options.resizingBarContainer;
|
|
93
|
+
if (resizing_bar && resizingBarContainer) resizingBarContainer.appendChild(resizing_bar);
|
|
90
94
|
|
|
91
95
|
/** append html */
|
|
92
96
|
editor_div.appendChild(textarea);
|
|
@@ -99,7 +103,7 @@ export default {
|
|
|
99
103
|
relative.appendChild(line_breaker);
|
|
100
104
|
relative.appendChild(line_breaker_t);
|
|
101
105
|
relative.appendChild(line_breaker_b);
|
|
102
|
-
if (resizing_bar) relative.appendChild(resizing_bar);
|
|
106
|
+
if (resizing_bar && !resizingBarContainer) relative.appendChild(resizing_bar);
|
|
103
107
|
top_div.appendChild(relative);
|
|
104
108
|
|
|
105
109
|
textarea = this._checkCodeMirror(options, textarea);
|
|
@@ -233,8 +237,14 @@ export default {
|
|
|
233
237
|
const placeholder_span = initElements.placeholder;
|
|
234
238
|
let code = initElements.codeView;
|
|
235
239
|
|
|
236
|
-
if (el.resizingBar)
|
|
237
|
-
if (bottomBar.resizingBar)
|
|
240
|
+
if (el.resizingBar) util.removeItem(el.resizingBar);
|
|
241
|
+
if (bottomBar.resizingBar) {
|
|
242
|
+
if (mergeOptions.resizingBarContainer && mergeOptions.resizingBarContainer !== originOptions.resizingBarContainer) {
|
|
243
|
+
mergeOptions.resizingBarContainer.appendChild(bottomBar.resizingBar);
|
|
244
|
+
} else {
|
|
245
|
+
relative.appendChild(bottomBar.resizingBar);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
238
248
|
|
|
239
249
|
editorArea.innerHTML = '';
|
|
240
250
|
editorArea.appendChild(code);
|
|
@@ -291,6 +301,9 @@ export default {
|
|
|
291
301
|
if (!options.iframe) {
|
|
292
302
|
wysiwygDiv.setAttribute('contenteditable', true);
|
|
293
303
|
wysiwygDiv.setAttribute('scrolling', 'auto');
|
|
304
|
+
for (let key in options.iframeAttributes) {
|
|
305
|
+
wysiwygDiv.setAttribute(key, options.iframeAttributes[key]);
|
|
306
|
+
}
|
|
294
307
|
wysiwygDiv.className += ' ' + options._editableClass;
|
|
295
308
|
wysiwygDiv.style.cssText = options._editorStyles.frame + options._editorStyles.editor;
|
|
296
309
|
} else {
|
|
@@ -376,7 +389,7 @@ export default {
|
|
|
376
389
|
_initOptions: function (element, options) {
|
|
377
390
|
/** Values */
|
|
378
391
|
options.lang = options.lang || _defaultLang;
|
|
379
|
-
options.defaultTag = typeof options.defaultTag === 'string' ? options.defaultTag : 'p';
|
|
392
|
+
options.defaultTag = typeof options.defaultTag === 'string' && options.defaultTag.length > 0 ? options.defaultTag : 'p';
|
|
380
393
|
const textTags = options.textTags = [{bold: 'STRONG', underline: 'U', italic: 'EM', strike: 'DEL', sub: 'SUB', sup: 'SUP'}, (options.textTags || {})].reduce(function (_default, _new) {
|
|
381
394
|
for (let key in _new) {
|
|
382
395
|
_default[key] = _new[key];
|
|
@@ -398,23 +411,31 @@ export default {
|
|
|
398
411
|
};
|
|
399
412
|
options.value = typeof options.value === 'string' ? options.value : null;
|
|
400
413
|
options.historyStackDelayTime = typeof options.historyStackDelayTime === 'number' ? options.historyStackDelayTime : 400;
|
|
401
|
-
/** Whitelist */
|
|
414
|
+
/** Whitelist, Blacklist */
|
|
402
415
|
const whitelist = 'br|p|div|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|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|code|svg|path|details|summary';
|
|
416
|
+
// tags
|
|
417
|
+
options.tagsBlacklist = options.tagsBlacklist || '';
|
|
403
418
|
options._defaultTagsWhitelist = typeof options._defaultTagsWhitelist === 'string' ? options._defaultTagsWhitelist : whitelist;
|
|
404
|
-
options._editorTagsWhitelist = this._setWhitelist(options._defaultTagsWhitelist + (typeof options.addTagsWhitelist === 'string' && options.addTagsWhitelist.length > 0 ? '|' + options.addTagsWhitelist : ''), options.tagsBlacklist);
|
|
405
|
-
|
|
419
|
+
options._editorTagsWhitelist = options.addTagsWhitelist === '*' ? '*' : this._setWhitelist(options._defaultTagsWhitelist + (typeof options.addTagsWhitelist === 'string' && options.addTagsWhitelist.length > 0 ? '|' + options.addTagsWhitelist : ''), options.tagsBlacklist);
|
|
420
|
+
// paste tags
|
|
421
|
+
options.pasteTagsBlacklist = options.tagsBlacklist + (options.tagsBlacklist && options.pasteTagsBlacklist ? ('|' + options.pasteTagsBlacklist) : (options.pasteTagsBlacklist || ''));
|
|
422
|
+
options.pasteTagsWhitelist = options.pasteTagsWhitelist === '*' ? '*' : this._setWhitelist(typeof options.pasteTagsWhitelist === 'string' ? options.pasteTagsWhitelist : options._editorTagsWhitelist, options.pasteTagsBlacklist);
|
|
423
|
+
// tag attributes
|
|
406
424
|
options.attributesWhitelist = (!options.attributesWhitelist || typeof options.attributesWhitelist !== 'object') ? null : options.attributesWhitelist;
|
|
425
|
+
options.attributesBlacklist = (!options.attributesBlacklist || typeof options.attributesBlacklist !== 'object') ? null : options.attributesBlacklist;
|
|
407
426
|
/** Layout */
|
|
408
427
|
options.mode = options.mode || 'classic'; // classic, inline, balloon, balloon-always
|
|
409
428
|
options.rtl = !!options.rtl;
|
|
429
|
+
options.lineAttrReset = typeof options.lineAttrReset === 'string' && options.lineAttrReset ? options.lineAttrReset === '*' ? '*' : new RegExp('^(' + options.lineAttrReset + ')$', 'i') : null;
|
|
410
430
|
options._editableClass = 'sun-editor-editable' + (options.rtl ? ' se-rtl' : '');
|
|
411
431
|
options._printClass = typeof options._printClass === 'string' ? options._printClass : null;
|
|
412
432
|
options.toolbarWidth = options.toolbarWidth ? (util.isNumber(options.toolbarWidth) ? options.toolbarWidth + 'px' : options.toolbarWidth) : 'auto';
|
|
413
433
|
options.toolbarContainer = typeof options.toolbarContainer === 'string' ? document.querySelector(options.toolbarContainer) : options.toolbarContainer;
|
|
414
434
|
options.stickyToolbar = (/balloon/i.test(options.mode) || !!options.toolbarContainer) ? -1 : options.stickyToolbar === undefined ? 0 : (/^\d+/.test(options.stickyToolbar) ? util.getNumber(options.stickyToolbar, 0) : -1);
|
|
415
435
|
options.fullScreenOffset = options.fullScreenOffset === undefined ? 0 : (/^\d+/.test(options.fullScreenOffset) ? util.getNumber(options.fullScreenOffset, 0) : 0);
|
|
416
|
-
options.iframe = options.fullPage || options.iframe;
|
|
417
436
|
options.fullPage = !!options.fullPage;
|
|
437
|
+
options.iframe = options.fullPage || !!options.iframe;
|
|
438
|
+
options.iframeAttributes = options.iframeAttributes || {};
|
|
418
439
|
options.iframeCSSFileName = options.iframe ? typeof options.iframeCSSFileName === 'string' ? [options.iframeCSSFileName] : (options.iframeCSSFileName || ['suneditor']) : null;
|
|
419
440
|
options.previewTemplate = typeof options.previewTemplate === 'string' ? options.previewTemplate : null;
|
|
420
441
|
options.printTemplate = typeof options.printTemplate === 'string' ? options.printTemplate : null;
|
|
@@ -435,6 +456,8 @@ export default {
|
|
|
435
456
|
/** Bottom resizing bar */
|
|
436
457
|
options.resizingBar = options.resizingBar === undefined ? (/inline|balloon/i.test(options.mode) ? false : true) : options.resizingBar;
|
|
437
458
|
options.showPathLabel = !options.resizingBar ? false : typeof options.showPathLabel === 'boolean' ? options.showPathLabel : true;
|
|
459
|
+
options.resizeEnable = options.resizeEnable === undefined ? true : !!options.resizeEnable;
|
|
460
|
+
options.resizingBarContainer = typeof options.resizingBarContainer === 'string' ? document.querySelector(options.resizingBarContainer) : options.resizingBarContainer;
|
|
438
461
|
/** Character count */
|
|
439
462
|
options.charCounter = options.maxCharCount > 0 ? true : typeof options.charCounter === 'boolean' ? options.charCounter : false;
|
|
440
463
|
options.charCounterType = typeof options.charCounterType === 'string' ? options.charCounterType : 'char';
|
|
@@ -459,9 +482,11 @@ export default {
|
|
|
459
482
|
options.paragraphStyles = !options.paragraphStyles ? null : options.paragraphStyles;
|
|
460
483
|
options.textStyles = !options.textStyles ? null : options.textStyles;
|
|
461
484
|
options.fontSizeUnit = typeof options.fontSizeUnit === 'string' ? (options.fontSizeUnit.trim() || 'px') : 'px';
|
|
485
|
+
options.alignItems = typeof options.alignItems === 'object' ? options.alignItems : (options.rtl ? ['right', 'center', 'left', 'justify'] : ['left', 'center', 'right', 'justify']);
|
|
462
486
|
/** Image */
|
|
463
487
|
options.imageResizing = options.imageResizing === undefined ? true : options.imageResizing;
|
|
464
488
|
options.imageHeightShow = options.imageHeightShow === undefined ? true : !!options.imageHeightShow;
|
|
489
|
+
options.imageAlignShow = options.imageAlignShow === undefined ? true : !!options.imageAlignShow;
|
|
465
490
|
options.imageWidth = !options.imageWidth ? 'auto' : util.isNumber(options.imageWidth) ? options.imageWidth + 'px' : options.imageWidth;
|
|
466
491
|
options.imageHeight = !options.imageHeight ? 'auto' : util.isNumber(options.imageHeight) ? options.imageHeight + 'px' : options.imageHeight;
|
|
467
492
|
options.imageSizeOnlyPercentage = !!options.imageSizeOnlyPercentage;
|
|
@@ -480,6 +505,7 @@ export default {
|
|
|
480
505
|
/** Video */
|
|
481
506
|
options.videoResizing = options.videoResizing === undefined ? true : options.videoResizing;
|
|
482
507
|
options.videoHeightShow = options.videoHeightShow === undefined ? true : !!options.videoHeightShow;
|
|
508
|
+
options.videoAlignShow = options.videoAlignShow === undefined ? true : !!options.videoAlignShow;
|
|
483
509
|
options.videoRatioShow = options.videoRatioShow === undefined ? true : !!options.videoRatioShow;
|
|
484
510
|
options.videoWidth = !options.videoWidth || !util.getNumber(options.videoWidth, 0) ? '' : util.isNumber(options.videoWidth) ? options.videoWidth + 'px' : options.videoWidth;
|
|
485
511
|
options.videoHeight = !options.videoHeight || !util.getNumber(options.videoHeight, 0) ? '' : util.isNumber(options.videoHeight) ? options.videoHeight + 'px' : options.videoHeight;
|
|
@@ -512,9 +538,12 @@ export default {
|
|
|
512
538
|
/** Table */
|
|
513
539
|
options.tableCellControllerPosition = typeof options.tableCellControllerPosition === 'string' ? options.tableCellControllerPosition.toLowerCase() : 'cell';
|
|
514
540
|
/** Link */
|
|
541
|
+
options.linkTargetNewWindow = !!options.linkTargetNewWindow;
|
|
515
542
|
options.linkProtocol = typeof options.linkProtocol === 'string' ? options.linkProtocol : null;
|
|
516
543
|
options.linkRel = Array.isArray(options.linkRel) ? options.linkRel : [];
|
|
517
544
|
options.linkRelDefault = options.linkRelDefault || {};
|
|
545
|
+
/** HR */
|
|
546
|
+
// options.hrItems = options.hrItems;
|
|
518
547
|
/** Key actions */
|
|
519
548
|
options.tabDisable = !!options.tabDisable;
|
|
520
549
|
options.shortcutsDisable = Array.isArray(options.shortcutsDisable) ? options.shortcutsDisable : [];
|
|
@@ -599,10 +628,13 @@ export default {
|
|
|
599
628
|
fullScreen: ['se-code-view-enabled se-resizing-enabled _se_command_fullScreen', lang.toolbar.fullScreen, 'fullScreen', '', icons.expansion],
|
|
600
629
|
showBlocks: ['_se_command_showBlocks', lang.toolbar.showBlocks, 'showBlocks', '', icons.show_blocks],
|
|
601
630
|
codeView: ['se-code-view-enabled se-resizing-enabled _se_command_codeView', lang.toolbar.codeView, 'codeView', '', icons.code_view],
|
|
602
|
-
undo: ['_se_command_undo
|
|
603
|
-
redo: ['_se_command_redo
|
|
631
|
+
undo: ['_se_command_undo', lang.toolbar.undo + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('undo') > -1 ? '' : cmd + '+<span class="se-shortcut-key">Z</span>') + '</span>', 'undo', '', icons.undo],
|
|
632
|
+
redo: ['_se_command_redo', lang.toolbar.redo + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('undo') > -1 ? '' : cmd + '+<span class="se-shortcut-key">Y</span> / ' + cmd + addShift + '+<span class="se-shortcut-key">Z</span>') + '</span>', 'redo', '', icons.redo],
|
|
604
633
|
preview: ['se-resizing-enabled', lang.toolbar.preview, 'preview', '', icons.preview],
|
|
605
634
|
print: ['se-resizing-enabled', lang.toolbar.print, 'print', '', icons.print],
|
|
635
|
+
dir: ['_se_command_dir', lang.toolbar[options.rtl ? 'dir_ltr' : 'dir_rtl'], 'dir', '', icons[options.rtl ? 'dir_ltr' : 'dir_rtl']],
|
|
636
|
+
dir_ltr: ['_se_command_dir_ltr', lang.toolbar.dir_ltr, 'dir_ltr', '', icons.dir_ltr],
|
|
637
|
+
dir_rtl: ['_se_command_dir_rtl', lang.toolbar.dir_rtl, 'dir_rtl', '', icons.dir_rtl],
|
|
606
638
|
save: ['_se_command_save se-resizing-enabled', lang.toolbar.save + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('save') > -1 ? '' : cmd + '+<span class="se-shortcut-key">S</span>') + '</span>', 'save', '', icons.save],
|
|
607
639
|
/** plugins - command */
|
|
608
640
|
blockquote: ['', lang.toolbar.tag_blockquote, 'blockquote', 'command', icons.blockquote],
|
|
@@ -772,7 +804,14 @@ export default {
|
|
|
772
804
|
// align
|
|
773
805
|
if (/^\-/.test(button)) {
|
|
774
806
|
align = button.substr(1);
|
|
775
|
-
moduleElement.div.
|
|
807
|
+
moduleElement.div.className += ' module-float-' + align;
|
|
808
|
+
continue;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
// rtl fix
|
|
812
|
+
if (/^\#/.test(button)) {
|
|
813
|
+
const option = button.substr(1);
|
|
814
|
+
if (option === 'fix') moduleElement.ul.className += ' se-menu-dir-fix';
|
|
776
815
|
continue;
|
|
777
816
|
}
|
|
778
817
|
|
package/src/lib/context.js
CHANGED
|
@@ -56,7 +56,10 @@ const _Context = function (element, cons, options) {
|
|
|
56
56
|
indent: cons._toolBar.querySelector('._se_command_indent'),
|
|
57
57
|
fullScreen: cons._toolBar.querySelector('._se_command_fullScreen'),
|
|
58
58
|
showBlocks: cons._toolBar.querySelector('._se_command_showBlocks'),
|
|
59
|
-
codeView: cons._toolBar.querySelector('._se_command_codeView')
|
|
59
|
+
codeView: cons._toolBar.querySelector('._se_command_codeView'),
|
|
60
|
+
dir: cons._toolBar.querySelector('._se_command_dir'),
|
|
61
|
+
dir_ltr: cons._toolBar.querySelector('._se_command_dir_ltr'),
|
|
62
|
+
dir_rtl: cons._toolBar.querySelector('._se_command_dir_rtl')
|
|
60
63
|
},
|
|
61
64
|
options: options,
|
|
62
65
|
option: options
|