suneditor 2.43.5 → 2.43.6
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/dist/suneditor.min.js +2 -2
- package/package.json +1 -1
- package/src/assets/defaultIcons.js +2 -2
- package/src/lib/constructor.js +21 -18
- package/src/lib/context.js +17 -17
- package/src/lib/core.d.ts +0 -7
- package/src/lib/core.js +284 -160
- package/src/lib/util.js +1 -0
- package/src/plugins/dialog/audio.js +3 -3
- package/src/plugins/dialog/image.js +5 -5
- package/src/plugins/dialog/link.js +2 -2
- package/src/plugins/dialog/math.js +2 -2
- package/src/plugins/dialog/mention.js +1 -1
- package/src/plugins/dialog/video.js +5 -5
- package/src/plugins/modules/_anchor.js +2 -2
- package/src/plugins/modules/_colorPicker.js +3 -3
- package/src/plugins/modules/fileBrowser.js +2 -2
- package/src/plugins/submenu/align.js +1 -1
- package/src/plugins/submenu/font.js +2 -2
- package/src/plugins/submenu/fontSize.js +2 -2
- package/src/plugins/submenu/formatBlock.js +1 -1
- package/src/plugins/submenu/horizontalRule.js +1 -1
- package/src/plugins/submenu/lineHeight.js +2 -2
- package/src/plugins/submenu/list.js +2 -2
- package/src/plugins/submenu/paragraphStyle.js +1 -1
- package/src/plugins/submenu/table.js +2 -2
- package/src/plugins/submenu/template.js +1 -1
- package/src/plugins/submenu/textStyle.js +1 -1
package/package.json
CHANGED
|
@@ -28,8 +28,8 @@ export default {
|
|
|
28
28
|
subscript: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 14.61"><g><path d="M15.38,4.33H12.74L11.19,7c-.28.46-.51.87-.69,1.21L10.07,9h0l-.44-.8c-.22-.4-.45-.81-.71-1.23L7.34,4.33H4.68L8.26,10,4.4,16.08H7.1l1.69-2.83c.38-.63.72-1.22,1-1.78l.25-.46h0l.49.92c.24.45.48.89.74,1.32L13,16.08h2.61L11.84,10l1.77-2.84,1.77-2.85Zm4.77,13.75H17v-.15c0-.4.05-.64.16-.72a4.42,4.42,0,0,1,1.16-.31,3.3,3.3,0,0,0,1.54-.56A1.84,1.84,0,0,0,20.15,15a1.78,1.78,0,0,0-.44-1.41A2.8,2.8,0,0,0,18,13.25a2.71,2.71,0,0,0-1.69.37,1.83,1.83,0,0,0-.44,1.43v.23H17v-.23q0-.63.18-.78a1.62,1.62,0,0,1,.88-.15,1.59,1.59,0,0,1,.88.15q.18.15.18.75t-.18.75a3.58,3.58,0,0,1-1.18.33,3.33,3.33,0,0,0-1.52.51,1.57,1.57,0,0,0-.32,1.18v1.15h4.27v-.86Z" transform="translate(-4.4 -4.33)"/></g></svg>',
|
|
29
29
|
superscript: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.75 15.42"><g><path d="M12,13.14l3.61-5.81H12.94L11.33,10c-.28.46-.51.88-.69,1.25l-.45.83h0l-.45-.85c-.22-.41-.45-.82-.71-1.24L7.4,7.33H4.68l3.66,5.81L4.4,19.33H7.14l1.74-2.87q.58-1,1-1.83l.25-.48h0l.51.94.75,1.37,1.72,2.87h2.67l-1.92-3.09c-1.12-1.8-1.76-2.83-1.92-3.1Zm4.84-4.41h0l0,.15h3.27v.86H15.77V8.58a1.66,1.66,0,0,1,.33-1.22,3.51,3.51,0,0,1,1.56-.51,3.68,3.68,0,0,0,1.21-.34c.13-.1.19-.36.19-.77S19,5.07,18.87,5A1.63,1.63,0,0,0,18,4.8a1.58,1.58,0,0,0-.91.17c-.13.11-.19.38-.19.8V6H15.78V5.76a1.87,1.87,0,0,1,.45-1.47A2.84,2.84,0,0,1,18,3.91a2.8,2.8,0,0,1,1.72.38,1.84,1.84,0,0,1,.45,1.44,1.91,1.91,0,0,1-.34,1.35,3.24,3.24,0,0,1-1.58.57A3.69,3.69,0,0,0,17,8c-.12.1-.17.35-.17.76Z" transform="translate(-4.4 -3.91)"/></g></svg>',
|
|
30
30
|
erase: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 13.76"><g><path d="M13.69,17.2h6.46v1.31H8.56L4.41,14.37,14,4.75l6.06,6.06L16.89,14l-3.2,3.19Zm-4.61,0h2.77L14.09,15,9.88,10.75,6.25,14.38l1.41,1.41c.84.82,1.31,1.29,1.42,1.41Z" transform="translate(-4.41 -4.75)"/></g></svg>',
|
|
31
|
-
indent: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 12.36"><g><path d="
|
|
32
|
-
outdent: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 12.36"><g><path d="
|
|
31
|
+
indent: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 12.36"><g><path d="M4.68,14.45a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V9.1a.27.27,0,0,1,.08-.19.28.28,0,0,1,.2-.08.25.25,0,0,1,.19.07l2.54,2.54a.29.29,0,0,1,0,.4L4.88,14.36a.24.24,0,0,1-.2.09Zm15.19,1.12a.27.27,0,0,1,.19.08.25.25,0,0,1,.08.19v1.69a.27.27,0,0,1-.08.19.25.25,0,0,1-.19.08H4.68a.27.27,0,0,1-.19-.08.25.25,0,0,1-.08-.19V15.84a.27.27,0,0,1,.27-.27H19.87Zm0-3.38a.27.27,0,0,1,.19.08.28.28,0,0,1,.08.21v1.68a.32.32,0,0,1-.08.21.25.25,0,0,1-.19.08H10.31a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V12.48a.32.32,0,0,1,.08-.21.24.24,0,0,1,.19-.08h9.56Zm0-3.37a.27.27,0,0,1,.19.08.25.25,0,0,1,.08.19v1.69a.27.27,0,0,1-.08.19.25.25,0,0,1-.19.08H10.31a.27.27,0,0,1-.27-.27V9.1a.27.27,0,0,1,.27-.27h9.56Zm.2-3.29a.28.28,0,0,1,.08.2V7.41a.32.32,0,0,1-.08.21.25.25,0,0,1-.19.08H4.68a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V5.73a.32.32,0,0,1,.08-.21.25.25,0,0,1,.19-.08H19.87a.28.28,0,0,1,.2.09Z" transform="translate(-4.41 -5.44)"/></g></svg>',
|
|
32
|
+
outdent: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 12.36"><g><path d="M19.87,15.57a.27.27,0,0,1,.19.08.25.25,0,0,1,.08.19v1.69a.27.27,0,0,1-.08.19.25.25,0,0,1-.19.08H4.68a.27.27,0,0,1-.19-.08.25.25,0,0,1-.08-.19V15.84a.27.27,0,0,1,.27-.27H19.87ZM7.5,14.45a.25.25,0,0,1-.2-.09L4.76,11.84a.29.29,0,0,1,0-.4L7.3,8.9a.29.29,0,0,1,.4,0,.31.31,0,0,1,.07.2v5.06a.32.32,0,0,1-.08.21.26.26,0,0,1-.19.08ZM19.87,8.82a.27.27,0,0,1,.19.08.25.25,0,0,1,.08.19v1.69a.27.27,0,0,1-.08.19.25.25,0,0,1-.19.08H10.31a.27.27,0,0,1-.27-.27V9.1a.27.27,0,0,1,.27-.27h9.56Zm0,3.37a.27.27,0,0,1,.19.08.28.28,0,0,1,.08.21v1.68a.32.32,0,0,1-.08.21.25.25,0,0,1-.19.08H10.31a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V12.48a.32.32,0,0,1,.08-.21.24.24,0,0,1,.19-.08h9.56Zm.2-6.66a.28.28,0,0,1,.08.2V7.41a.32.32,0,0,1-.08.21.25.25,0,0,1-.19.08H4.68a.27.27,0,0,1-.19-.08.3.3,0,0,1-.08-.21V5.73a.32.32,0,0,1,.08-.21.25.25,0,0,1,.19-.08H19.87a.28.28,0,0,1,.2.09Z" transform="translate(-4.41 -5.44)"/></g></svg>',
|
|
33
33
|
expansion: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.74"><g><path d="M11.8,13.06l-5.1,5.1H9.51V19.5H4.41V14.4H5.75v2.81L8.3,14.66q2.25-2.23,2.55-2.55Zm8.35-9.3v5.1H18.81V6.05l-5.1,5.1-1-1,5.1-5.1H15.05V3.76Z" transform="translate(-4.41 -3.76)"/></g></svg>',
|
|
34
34
|
reduction: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.74 15.74"><g><path d="M14.91,10h2.87v1.38H12.55V6.12h1.38V9l5.24-5.24.48.49.49.48ZM6.77,11.92H12v5.23H10.62V14.26L5.37,19.5l-1-1L9.63,13.3H6.77Z" transform="translate(-4.4 -3.76)"/></g></svg>',
|
|
35
35
|
code_view: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.73 11.8"><g><path d="M8.09,7.94a.76.76,0,0,1,.53.22.72.72,0,0,1,.21.52.76.76,0,0,1-.22.54L6.18,11.63l2.43,2.44a.69.69,0,0,1,.2.51.66.66,0,0,1-.21.51.75.75,0,0,1-.51.22.63.63,0,0,1-.51-.21h0L4.63,12.15a.7.7,0,0,1-.22-.53.67.67,0,0,1,.25-.55L7.57,8.16a.82.82,0,0,1,.52-.22Zm12.05,3.69a.7.7,0,0,1-.23.52L17,15.1h0a.66.66,0,0,1-.51.21.73.73,0,0,1-.51-.22.75.75,0,0,1-.22-.51.63.63,0,0,1,.21-.51l2.43-2.44L15.92,9.22a.73.73,0,0,1-.22-.53A.74.74,0,0,1,17,8.18h0l2.91,2.91a.67.67,0,0,1,.27.54Zm-5.9-5.9a.73.73,0,0,1,.61.32.71.71,0,0,1,.07.68L11,17a1,1,0,0,1-.22.32.6.6,0,0,1-.35.16.75.75,0,0,1-.69-.26.69.69,0,0,1-.12-.72L13.56,6.23a.75.75,0,0,1,.26-.35.74.74,0,0,1,.42-.15Z" transform="translate(-4.41 -5.73)"/></g></svg>',
|
package/src/lib/constructor.js
CHANGED
|
@@ -636,29 +636,30 @@ export default {
|
|
|
636
636
|
const addShift = util.isOSX_IOS ? '⇧' : '+SHIFT';
|
|
637
637
|
const shortcutsDisable = !options.shortcutsHint ? ['bold', 'strike', 'underline', 'italic', 'undo', 'indent', 'save'] : options.shortcutsDisable;
|
|
638
638
|
const indentKey = options.rtl ? ['[',']'] : [']','['];
|
|
639
|
+
const indentIcon = options.rtl ? [icons.outdent, icons.indent] : [icons.indent, icons.outdent];
|
|
639
640
|
|
|
640
641
|
return {
|
|
641
642
|
/** default command */
|
|
642
|
-
bold: ['
|
|
643
|
-
underline: ['
|
|
644
|
-
italic: ['
|
|
645
|
-
strike: ['
|
|
646
|
-
subscript: ['
|
|
647
|
-
superscript: ['
|
|
643
|
+
bold: ['', lang.toolbar.bold + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('bold') > -1 ? '' : cmd + '+<span class="se-shortcut-key">B</span>') + '</span>', 'bold', '', icons.bold],
|
|
644
|
+
underline: ['', lang.toolbar.underline + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('underline') > -1 ? '' : cmd + '+<span class="se-shortcut-key">U</span>') + '</span>', 'underline', '', icons.underline],
|
|
645
|
+
italic: ['', lang.toolbar.italic + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('italic') > -1 ? '' : cmd + '+<span class="se-shortcut-key">I</span>') + '</span>', 'italic', '', icons.italic],
|
|
646
|
+
strike: ['', lang.toolbar.strike + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('strike') > -1 ? '' : cmd + addShift + '+<span class="se-shortcut-key">S</span>') + '</span>', 'strike', '', icons.strike],
|
|
647
|
+
subscript: ['', lang.toolbar.subscript, 'SUB', '', icons.subscript],
|
|
648
|
+
superscript: ['', lang.toolbar.superscript, 'SUP', '', icons.superscript],
|
|
648
649
|
removeFormat: ['', lang.toolbar.removeFormat, 'removeFormat', '', icons.erase],
|
|
649
|
-
indent: ['
|
|
650
|
-
outdent: ['
|
|
651
|
-
fullScreen: ['se-code-view-enabled se-resizing-enabled
|
|
652
|
-
showBlocks: ['
|
|
653
|
-
codeView: ['se-code-view-enabled se-resizing-enabled
|
|
654
|
-
undo: ['
|
|
655
|
-
redo: ['
|
|
650
|
+
indent: ['', lang.toolbar.indent + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('indent') > -1 ? '' : cmd + '+<span class="se-shortcut-key">' + indentKey[0] + '</span>') + '</span>', 'indent', '', indentIcon[0]],
|
|
651
|
+
outdent: ['', lang.toolbar.outdent + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('indent') > -1 ? '' : cmd + '+<span class="se-shortcut-key">' + indentKey[1] + '</span>') + '</span>', 'outdent', '', indentIcon[1]],
|
|
652
|
+
fullScreen: ['se-code-view-enabled se-resizing-enabled', lang.toolbar.fullScreen, 'fullScreen', '', icons.expansion],
|
|
653
|
+
showBlocks: ['', lang.toolbar.showBlocks, 'showBlocks', '', icons.show_blocks],
|
|
654
|
+
codeView: ['se-code-view-enabled se-resizing-enabled', lang.toolbar.codeView, 'codeView', '', icons.code_view],
|
|
655
|
+
undo: ['', lang.toolbar.undo + '<span class="se-shortcut">' + (shortcutsDisable.indexOf('undo') > -1 ? '' : cmd + '+<span class="se-shortcut-key">Z</span>') + '</span>', 'undo', '', icons.undo],
|
|
656
|
+
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],
|
|
656
657
|
preview: ['se-resizing-enabled', lang.toolbar.preview, 'preview', '', icons.preview],
|
|
657
658
|
print: ['se-resizing-enabled', lang.toolbar.print, 'print', '', icons.print],
|
|
658
|
-
dir: ['
|
|
659
|
-
dir_ltr: ['
|
|
660
|
-
dir_rtl: ['
|
|
661
|
-
save: ['
|
|
659
|
+
dir: ['', lang.toolbar[options.rtl ? 'dir_ltr' : 'dir_rtl'], 'dir', '', icons[options.rtl ? 'dir_ltr' : 'dir_rtl']],
|
|
660
|
+
dir_ltr: ['', lang.toolbar.dir_ltr, 'dir_ltr', '', icons.dir_ltr],
|
|
661
|
+
dir_rtl: ['', lang.toolbar.dir_rtl, 'dir_rtl', '', icons.dir_rtl],
|
|
662
|
+
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],
|
|
662
663
|
/** plugins - command */
|
|
663
664
|
blockquote: ['', lang.toolbar.tag_blockquote, 'blockquote', 'command', icons.blockquote],
|
|
664
665
|
/** plugins - submenu */
|
|
@@ -720,11 +721,13 @@ export default {
|
|
|
720
721
|
_createButton: function (buttonClass, title, dataCommand, dataDisplay, innerHTML, _disabled, _icons) {
|
|
721
722
|
const oLi = util.createElement('LI');
|
|
722
723
|
const oButton = util.createElement('BUTTON');
|
|
724
|
+
const label = (title || dataCommand);
|
|
723
725
|
|
|
724
726
|
oButton.setAttribute('type', 'button');
|
|
725
727
|
oButton.setAttribute('class', 'se-btn' + (buttonClass ? ' ' + buttonClass : '') + ' se-tooltip');
|
|
726
728
|
oButton.setAttribute('data-command', dataCommand);
|
|
727
729
|
oButton.setAttribute('data-display', dataDisplay);
|
|
730
|
+
oButton.setAttribute('aria-label', label.replace(/<span .+<\/span>/, ''));
|
|
728
731
|
oButton.setAttribute('tabindex', '-1');
|
|
729
732
|
|
|
730
733
|
if (!innerHTML) innerHTML = '<span class="se-icon-text">!</span>';
|
|
@@ -736,7 +739,7 @@ export default {
|
|
|
736
739
|
oButton.className += ' se-btn-more-text';
|
|
737
740
|
}
|
|
738
741
|
|
|
739
|
-
innerHTML += '<span class="se-tooltip-inner"><span class="se-tooltip-text">' +
|
|
742
|
+
innerHTML += '<span class="se-tooltip-inner"><span class="se-tooltip-text">' + label + '</span></span>';
|
|
740
743
|
|
|
741
744
|
if (_disabled) oButton.setAttribute('disabled', true);
|
|
742
745
|
|
package/src/lib/context.js
CHANGED
|
@@ -44,23 +44,23 @@ const _Context = function (element, cons, options) {
|
|
|
44
44
|
},
|
|
45
45
|
tool: {
|
|
46
46
|
cover: cons._toolBar.querySelector('.se-toolbar-cover'),
|
|
47
|
-
bold: cons._toolBar.querySelector('
|
|
48
|
-
underline: cons._toolBar.querySelector('
|
|
49
|
-
italic: cons._toolBar.querySelector('
|
|
50
|
-
strike: cons._toolBar.querySelector('
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
undo: cons._toolBar.querySelector('
|
|
54
|
-
redo: cons._toolBar.querySelector('
|
|
55
|
-
save: cons._toolBar.querySelector('
|
|
56
|
-
outdent: cons._toolBar.querySelector('
|
|
57
|
-
indent: cons._toolBar.querySelector('
|
|
58
|
-
fullScreen: cons._toolBar.querySelector('
|
|
59
|
-
showBlocks: cons._toolBar.querySelector('
|
|
60
|
-
codeView: cons._toolBar.querySelector('
|
|
61
|
-
dir: cons._toolBar.querySelector('
|
|
62
|
-
dir_ltr: cons._toolBar.querySelector('
|
|
63
|
-
dir_rtl: cons._toolBar.querySelector('
|
|
47
|
+
bold: cons._toolBar.querySelector('[data-command="bold"]'),
|
|
48
|
+
underline: cons._toolBar.querySelector('[data-command="underline"]'),
|
|
49
|
+
italic: cons._toolBar.querySelector('[data-command="italic"]'),
|
|
50
|
+
strike: cons._toolBar.querySelector('[data-command="strike"]'),
|
|
51
|
+
sub: cons._toolBar.querySelector('[data-command="SUB"]'),
|
|
52
|
+
sup: cons._toolBar.querySelector('[data-command="SUP"]'),
|
|
53
|
+
undo: cons._toolBar.querySelector('[data-command="undo"]'),
|
|
54
|
+
redo: cons._toolBar.querySelector('[data-command="redo"]'),
|
|
55
|
+
save: cons._toolBar.querySelector('[data-command="save"]'),
|
|
56
|
+
outdent: cons._toolBar.querySelector('[data-command="outdent"]'),
|
|
57
|
+
indent: cons._toolBar.querySelector('[data-command="indent"]'),
|
|
58
|
+
fullScreen: cons._toolBar.querySelector('[data-command="fullScreen"]'),
|
|
59
|
+
showBlocks: cons._toolBar.querySelector('[data-command="showBlocks"]'),
|
|
60
|
+
codeView: cons._toolBar.querySelector('[data-command="codeView"]'),
|
|
61
|
+
dir: cons._toolBar.querySelector('[data-command="dir"]'),
|
|
62
|
+
dir_ltr: cons._toolBar.querySelector('[data-command="dir_ltr"]'),
|
|
63
|
+
dir_rtl: cons._toolBar.querySelector('[data-command="dir_rtl"]')
|
|
64
64
|
},
|
|
65
65
|
options: options,
|
|
66
66
|
option: options
|
package/src/lib/core.d.ts
CHANGED
|
@@ -192,13 +192,6 @@ interface Core {
|
|
|
192
192
|
*/
|
|
193
193
|
commandMap: Record<string, Element>;
|
|
194
194
|
|
|
195
|
-
/**
|
|
196
|
-
* @description Contains pairs of all "data-commands" and "elements" setted in toolbar over time
|
|
197
|
-
* Used primarily to save and recover button states after the toolbar re-creation
|
|
198
|
-
* Updates each "_cachingButtons()" invocation
|
|
199
|
-
*/
|
|
200
|
-
allCommandButtons: Record<string, Element>;
|
|
201
|
-
|
|
202
195
|
/**
|
|
203
196
|
* @description If the plugin is not added, add the plugin and call the 'add' function.
|
|
204
197
|
* If the plugin is added call callBack function.
|