suneditor 3.0.0-beta.2 → 3.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +186 -184
- package/LICENSE +21 -21
- package/README.md +157 -180
- package/dist/suneditor.min.css +1 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +126 -123
- package/src/assets/design/color.css +131 -121
- package/src/assets/design/index.css +3 -3
- package/src/assets/design/size.css +37 -35
- package/src/assets/design/typography.css +37 -37
- package/src/assets/icons/defaultIcons.js +247 -232
- package/src/assets/suneditor-contents.css +779 -778
- package/src/assets/suneditor.css +43 -35
- package/src/core/base/eventHandlers/handler_toolbar.js +135 -135
- package/src/core/base/eventHandlers/handler_ww_clipboard.js +56 -56
- package/src/core/base/eventHandlers/handler_ww_dragDrop.js +115 -113
- package/src/core/base/eventHandlers/handler_ww_key_input.js +1200 -1200
- package/src/core/base/eventHandlers/handler_ww_mouse.js +194 -194
- package/src/core/base/eventManager.js +1550 -1484
- package/src/core/base/history.js +355 -355
- package/src/core/class/char.js +163 -162
- package/src/core/class/component.js +856 -842
- package/src/core/class/format.js +3433 -3422
- package/src/core/class/html.js +1927 -1890
- package/src/core/class/menu.js +357 -346
- package/src/core/class/nodeTransform.js +424 -424
- package/src/core/class/offset.js +858 -891
- package/src/core/class/selection.js +710 -620
- package/src/core/class/shortcuts.js +98 -98
- package/src/core/class/toolbar.js +438 -430
- package/src/core/class/ui.js +424 -422
- package/src/core/class/viewer.js +750 -750
- package/src/core/editor.js +1810 -1708
- package/src/core/section/actives.js +268 -241
- package/src/core/section/constructor.js +1348 -1661
- package/src/core/section/context.js +102 -102
- package/src/core/section/documentType.js +582 -561
- package/src/core/section/options.js +367 -0
- package/src/core/util/instanceCheck.js +59 -0
- package/src/editorInjector/_classes.js +36 -36
- package/src/editorInjector/_core.js +92 -92
- package/src/editorInjector/index.js +75 -75
- package/src/events.js +634 -622
- package/src/helper/clipboard.js +59 -59
- package/src/helper/converter.js +586 -564
- package/src/helper/dom/domCheck.js +304 -304
- package/src/helper/dom/domQuery.js +677 -669
- package/src/helper/dom/domUtils.js +618 -557
- package/src/helper/dom/index.js +12 -12
- package/src/helper/env.js +249 -240
- package/src/helper/index.js +25 -25
- package/src/helper/keyCodeMap.js +183 -183
- package/src/helper/numbers.js +72 -72
- package/src/helper/unicode.js +47 -47
- package/src/langs/ckb.js +231 -231
- package/src/langs/cs.js +231 -231
- package/src/langs/da.js +231 -231
- package/src/langs/de.js +231 -231
- package/src/langs/en.js +230 -230
- package/src/langs/es.js +231 -231
- package/src/langs/fa.js +231 -231
- package/src/langs/fr.js +231 -231
- package/src/langs/he.js +231 -231
- package/src/langs/hu.js +230 -230
- package/src/langs/index.js +28 -28
- package/src/langs/it.js +231 -231
- package/src/langs/ja.js +230 -230
- package/src/langs/km.js +230 -230
- package/src/langs/ko.js +230 -230
- package/src/langs/lv.js +231 -231
- package/src/langs/nl.js +231 -231
- package/src/langs/pl.js +231 -231
- package/src/langs/pt_br.js +231 -231
- package/src/langs/ro.js +231 -231
- package/src/langs/ru.js +231 -231
- package/src/langs/se.js +231 -231
- package/src/langs/tr.js +231 -231
- package/src/langs/uk.js +231 -231
- package/src/langs/ur.js +231 -231
- package/src/langs/zh_cn.js +231 -231
- package/src/modules/ApiManager.js +191 -191
- package/src/modules/Browser.js +669 -667
- package/src/modules/ColorPicker.js +364 -362
- package/src/modules/Controller.js +474 -454
- package/src/modules/Figure.js +1620 -1617
- package/src/modules/FileManager.js +359 -359
- package/src/modules/HueSlider.js +577 -565
- package/src/modules/Modal.js +346 -346
- package/src/modules/ModalAnchorEditor.js +643 -643
- package/src/modules/SelectMenu.js +549 -549
- package/src/modules/_DragHandle.js +17 -17
- package/src/modules/index.js +14 -14
- package/src/plugins/browser/audioGallery.js +83 -83
- package/src/plugins/browser/fileBrowser.js +103 -103
- package/src/plugins/browser/fileGallery.js +83 -83
- package/src/plugins/browser/imageGallery.js +81 -81
- package/src/plugins/browser/videoGallery.js +103 -103
- package/src/plugins/command/blockquote.js +61 -60
- package/src/plugins/command/exportPDF.js +134 -134
- package/src/plugins/command/fileUpload.js +456 -456
- package/src/plugins/command/list_bulleted.js +149 -148
- package/src/plugins/command/list_numbered.js +152 -151
- package/src/plugins/dropdown/align.js +157 -155
- package/src/plugins/dropdown/backgroundColor.js +108 -104
- package/src/plugins/dropdown/font.js +141 -137
- package/src/plugins/dropdown/fontColor.js +109 -105
- package/src/plugins/dropdown/formatBlock.js +170 -178
- package/src/plugins/dropdown/hr.js +152 -152
- package/src/plugins/dropdown/layout.js +83 -83
- package/src/plugins/dropdown/lineHeight.js +131 -130
- package/src/plugins/dropdown/list.js +123 -122
- package/src/plugins/dropdown/paragraphStyle.js +138 -138
- package/src/plugins/dropdown/table.js +4110 -4000
- package/src/plugins/dropdown/template.js +83 -83
- package/src/plugins/dropdown/textStyle.js +149 -149
- package/src/plugins/field/mention.js +242 -242
- package/src/plugins/index.js +120 -120
- package/src/plugins/input/fontSize.js +414 -410
- package/src/plugins/input/pageNavigator.js +71 -70
- package/src/plugins/modal/audio.js +677 -677
- package/src/plugins/modal/drawing.js +537 -531
- package/src/plugins/modal/embed.js +886 -886
- package/src/plugins/modal/image.js +1377 -1376
- package/src/plugins/modal/link.js +248 -240
- package/src/plugins/modal/math.js +563 -563
- package/src/plugins/modal/video.js +1226 -1226
- package/src/plugins/popup/anchor.js +224 -222
- package/src/suneditor.js +114 -107
- package/src/themes/dark.css +132 -122
- package/src/typedef.js +132 -130
- package/types/assets/icons/defaultIcons.d.ts +8 -0
- package/types/core/base/eventManager.d.ts +29 -4
- package/types/core/class/char.d.ts +2 -1
- package/types/core/class/component.d.ts +1 -2
- package/types/core/class/format.d.ts +8 -1
- package/types/core/class/html.d.ts +8 -0
- package/types/core/class/menu.d.ts +8 -0
- package/types/core/class/offset.d.ts +24 -26
- package/types/core/class/selection.d.ts +2 -0
- package/types/core/class/toolbar.d.ts +6 -0
- package/types/core/class/ui.d.ts +1 -1
- package/types/core/editor.d.ts +34 -12
- package/types/core/section/constructor.d.ts +5 -638
- package/types/core/section/documentType.d.ts +12 -2
- package/types/core/section/options.d.ts +740 -0
- package/types/core/util/instanceCheck.d.ts +50 -0
- package/types/editorInjector/_core.d.ts +5 -5
- package/types/editorInjector/index.d.ts +2 -2
- package/types/events.d.ts +2 -0
- package/types/helper/converter.d.ts +9 -0
- package/types/helper/dom/domQuery.d.ts +5 -5
- package/types/helper/dom/domUtils.d.ts +8 -0
- package/types/helper/env.d.ts +6 -1
- package/types/helper/index.d.ts +4 -1
- package/types/index.d.ts +122 -120
- package/types/langs/_Lang.d.ts +194 -194
- package/types/modules/ColorPicker.d.ts +5 -1
- package/types/modules/Controller.d.ts +8 -4
- package/types/modules/Figure.d.ts +2 -1
- package/types/modules/HueSlider.d.ts +4 -1
- package/types/modules/SelectMenu.d.ts +1 -1
- package/types/plugins/command/blockquote.d.ts +1 -0
- package/types/plugins/command/list_bulleted.d.ts +1 -0
- package/types/plugins/command/list_numbered.d.ts +1 -0
- package/types/plugins/dropdown/align.d.ts +1 -0
- package/types/plugins/dropdown/backgroundColor.d.ts +1 -0
- package/types/plugins/dropdown/font.d.ts +1 -0
- package/types/plugins/dropdown/fontColor.d.ts +1 -0
- package/types/plugins/dropdown/formatBlock.d.ts +3 -2
- package/types/plugins/dropdown/lineHeight.d.ts +1 -0
- package/types/plugins/dropdown/list.d.ts +1 -0
- package/types/plugins/dropdown/table.d.ts +6 -0
- package/types/plugins/input/fontSize.d.ts +1 -0
- package/types/plugins/modal/drawing.d.ts +4 -0
- package/types/plugins/modal/link.d.ts +32 -15
- package/types/suneditor.d.ts +13 -9
- package/types/typedef.d.ts +8 -0
|
@@ -1,430 +1,438 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Toolbar class
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { dom, env } from '../../helper';
|
|
6
|
-
import CoreInjector from '../../editorInjector/_core';
|
|
7
|
-
import { CreateToolBar, UpdateButton } from '../section/constructor';
|
|
8
|
-
|
|
9
|
-
const { _w } = env;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {Omit<Toolbar & Partial<__se__EditorInjector>, 'toolbar' | 'subToolbar'>} ToolbarThis
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @constructor
|
|
17
|
-
* @this {ToolbarThis}
|
|
18
|
-
* @description Toolbar class
|
|
19
|
-
* @param {__se__EditorCore} editor - The root editor instance
|
|
20
|
-
* @param {Object} options - toolbar options
|
|
21
|
-
* @param {String} options.keyName - toolbar key name
|
|
22
|
-
* @param {Boolean} options.balloon - balloon toolbar
|
|
23
|
-
* @param {Boolean} options.inline - inline toolbar
|
|
24
|
-
* @param {Boolean} options.balloonAlways - balloon toolbar always show
|
|
25
|
-
* @param {Array<Node>} options.res - responsive toolbar button list
|
|
26
|
-
*/
|
|
27
|
-
function Toolbar(editor, { keyName, balloon, inline, balloonAlways, res }) {
|
|
28
|
-
CoreInjector.call(this, editor);
|
|
29
|
-
|
|
30
|
-
// members
|
|
31
|
-
this.keyName = keyName;
|
|
32
|
-
this.isSub = /sub/.test(keyName);
|
|
33
|
-
this.currentMoreLayerActiveButton = null;
|
|
34
|
-
this._isBalloon = balloon;
|
|
35
|
-
this._isInline = inline;
|
|
36
|
-
this._isBalloonAlways = balloonAlways;
|
|
37
|
-
this._responsiveCurrentSize = 'default';
|
|
38
|
-
this._originRes = res;
|
|
39
|
-
this._rButtonArray = res;
|
|
40
|
-
this._rButtonsInfo = null;
|
|
41
|
-
this._rButtonsize = null;
|
|
42
|
-
this._sticky = false;
|
|
43
|
-
this._isViewPortSize = 'visualViewport' in _w;
|
|
44
|
-
this._inlineToolbarAttr = {
|
|
45
|
-
top: '',
|
|
46
|
-
width: '',
|
|
47
|
-
isShow: false
|
|
48
|
-
};
|
|
49
|
-
this._balloonOffset = {
|
|
50
|
-
top: 0,
|
|
51
|
-
left: 0
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
this._setResponsive();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
Toolbar.prototype = {
|
|
58
|
-
/**
|
|
59
|
-
* @this {ToolbarThis}
|
|
60
|
-
* @description Disable the toolbar
|
|
61
|
-
*/
|
|
62
|
-
disable() {
|
|
63
|
-
/** off menus */
|
|
64
|
-
this._moreLayerOff();
|
|
65
|
-
this.menu.dropdownOff();
|
|
66
|
-
this.menu.containerOff();
|
|
67
|
-
dom.utils.setDisabled(this.context.get(this.keyName + '.buttonTray').querySelectorAll('.se-menu-list .se-toolbar-btn[data-type]'), true);
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* @this {ToolbarThis}
|
|
72
|
-
* @description Enable the toolbar
|
|
73
|
-
*/
|
|
74
|
-
enable() {
|
|
75
|
-
dom.utils.setDisabled(this.context.get(this.keyName + '.buttonTray').querySelectorAll('.se-menu-list .se-toolbar-btn[data-type]'), false);
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @this {ToolbarThis}
|
|
80
|
-
* @description Show the toolbar
|
|
81
|
-
*/
|
|
82
|
-
show() {
|
|
83
|
-
if (this._isInline) {
|
|
84
|
-
this._showInline();
|
|
85
|
-
} else if (this._isBalloon) {
|
|
86
|
-
this._showBalloon();
|
|
87
|
-
} else {
|
|
88
|
-
this.context.get(this.keyName + '.main').style.display = '';
|
|
89
|
-
if (!this.isSub) this.editor.frameContext.get('_stickyDummy').style.display = '';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (!this.isSub) this.resetResponsiveToolbar();
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* @this {ToolbarThis}
|
|
97
|
-
* @description Hide the toolbar
|
|
98
|
-
*/
|
|
99
|
-
hide() {
|
|
100
|
-
if (this._isInline) {
|
|
101
|
-
this.context.get(this.keyName + '.main').style.display = 'none';
|
|
102
|
-
this.context.get(this.keyName + '.main').style.top = '0px';
|
|
103
|
-
this._inlineToolbarAttr.isShow = false;
|
|
104
|
-
} else {
|
|
105
|
-
this.context.get(this.keyName + '.main').style.display = 'none';
|
|
106
|
-
if (!this.isSub) this.editor.frameContext.get('_stickyDummy').style.display = 'none';
|
|
107
|
-
if (this._isBalloon) {
|
|
108
|
-
this._balloonOffset = {
|
|
109
|
-
top: 0,
|
|
110
|
-
left: 0
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @this {ToolbarThis}
|
|
118
|
-
* @description Reset buttons of the responsive toolbar.
|
|
119
|
-
*/
|
|
120
|
-
resetResponsiveToolbar() {
|
|
121
|
-
this.menu.containerOff();
|
|
122
|
-
|
|
123
|
-
const responsiveSize = this._rButtonsize;
|
|
124
|
-
if (responsiveSize) {
|
|
125
|
-
let w = 0;
|
|
126
|
-
if (((this._isBalloon || this._isInline) && this.options.get('toolbar_width') === 'auto') || (this.editor.isSubBalloon && this.options.get('toolbar.sub_width') === 'auto')) {
|
|
127
|
-
w = this.editor.frameContext.get('topArea').offsetWidth;
|
|
128
|
-
} else {
|
|
129
|
-
w = this.context.get(this.keyName + '.main').offsetWidth;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
let responsiveWidth = 'default';
|
|
133
|
-
for (let i = 1, len = responsiveSize.length; i < len; i++) {
|
|
134
|
-
if (w < responsiveSize[i]) {
|
|
135
|
-
responsiveWidth = responsiveSize[i] + '';
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if (this._responsiveCurrentSize !== responsiveWidth) {
|
|
141
|
-
this._responsiveCurrentSize = responsiveWidth;
|
|
142
|
-
this.setButtons(this._rButtonsInfo[responsiveWidth]);
|
|
143
|
-
// this.viewer._resetFullScreenHeight();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* @this {ToolbarThis}
|
|
150
|
-
* @description Reset the buttons on the toolbar. (Editor is not reloaded)
|
|
151
|
-
* - You cannot set a new plugin for the button.
|
|
152
|
-
* @param {Array} buttonList Button list
|
|
153
|
-
*/
|
|
154
|
-
setButtons(buttonList) {
|
|
155
|
-
this._moreLayerOff();
|
|
156
|
-
this.menu.dropdownOff();
|
|
157
|
-
this.menu.containerOff();
|
|
158
|
-
|
|
159
|
-
const { options, icons, lang
|
|
160
|
-
const newToolbar = CreateToolBar(buttonList, this.plugins, options, icons, lang, true);
|
|
161
|
-
|
|
162
|
-
newToolbar.updateButtons.forEach((v) => UpdateButton(v.button, v.plugin, this.icons, this.lang));
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
this.
|
|
168
|
-
|
|
169
|
-
this.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
this.editor.
|
|
180
|
-
this.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
this.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
this.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
this.
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
toolbar.style.
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Toolbar class
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { dom, env } from '../../helper';
|
|
6
|
+
import CoreInjector from '../../editorInjector/_core';
|
|
7
|
+
import { CreateToolBar, UpdateButton } from '../section/constructor';
|
|
8
|
+
|
|
9
|
+
const { _w } = env;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {Omit<Toolbar & Partial<__se__EditorInjector>, 'toolbar' | 'subToolbar'>} ToolbarThis
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @constructor
|
|
17
|
+
* @this {ToolbarThis}
|
|
18
|
+
* @description Toolbar class
|
|
19
|
+
* @param {__se__EditorCore} editor - The root editor instance
|
|
20
|
+
* @param {Object} options - toolbar options
|
|
21
|
+
* @param {String} options.keyName - toolbar key name
|
|
22
|
+
* @param {Boolean} options.balloon - balloon toolbar
|
|
23
|
+
* @param {Boolean} options.inline - inline toolbar
|
|
24
|
+
* @param {Boolean} options.balloonAlways - balloon toolbar always show
|
|
25
|
+
* @param {Array<Node>} options.res - responsive toolbar button list
|
|
26
|
+
*/
|
|
27
|
+
function Toolbar(editor, { keyName, balloon, inline, balloonAlways, res }) {
|
|
28
|
+
CoreInjector.call(this, editor);
|
|
29
|
+
|
|
30
|
+
// members
|
|
31
|
+
this.keyName = keyName;
|
|
32
|
+
this.isSub = /sub/.test(keyName);
|
|
33
|
+
this.currentMoreLayerActiveButton = null;
|
|
34
|
+
this._isBalloon = balloon;
|
|
35
|
+
this._isInline = inline;
|
|
36
|
+
this._isBalloonAlways = balloonAlways;
|
|
37
|
+
this._responsiveCurrentSize = 'default';
|
|
38
|
+
this._originRes = res;
|
|
39
|
+
this._rButtonArray = res;
|
|
40
|
+
this._rButtonsInfo = null;
|
|
41
|
+
this._rButtonsize = null;
|
|
42
|
+
this._sticky = false;
|
|
43
|
+
this._isViewPortSize = 'visualViewport' in _w;
|
|
44
|
+
this._inlineToolbarAttr = {
|
|
45
|
+
top: '',
|
|
46
|
+
width: '',
|
|
47
|
+
isShow: false
|
|
48
|
+
};
|
|
49
|
+
this._balloonOffset = {
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
this._setResponsive();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
Toolbar.prototype = {
|
|
58
|
+
/**
|
|
59
|
+
* @this {ToolbarThis}
|
|
60
|
+
* @description Disable the toolbar
|
|
61
|
+
*/
|
|
62
|
+
disable() {
|
|
63
|
+
/** off menus */
|
|
64
|
+
this._moreLayerOff();
|
|
65
|
+
this.menu.dropdownOff();
|
|
66
|
+
this.menu.containerOff();
|
|
67
|
+
dom.utils.setDisabled(this.context.get(this.keyName + '.buttonTray').querySelectorAll('.se-menu-list .se-toolbar-btn[data-type]'), true);
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @this {ToolbarThis}
|
|
72
|
+
* @description Enable the toolbar
|
|
73
|
+
*/
|
|
74
|
+
enable() {
|
|
75
|
+
dom.utils.setDisabled(this.context.get(this.keyName + '.buttonTray').querySelectorAll('.se-menu-list .se-toolbar-btn[data-type]'), false);
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @this {ToolbarThis}
|
|
80
|
+
* @description Show the toolbar
|
|
81
|
+
*/
|
|
82
|
+
show() {
|
|
83
|
+
if (this._isInline) {
|
|
84
|
+
this._showInline();
|
|
85
|
+
} else if (this._isBalloon) {
|
|
86
|
+
this._showBalloon();
|
|
87
|
+
} else {
|
|
88
|
+
this.context.get(this.keyName + '.main').style.display = '';
|
|
89
|
+
if (!this.isSub) this.editor.frameContext.get('_stickyDummy').style.display = '';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!this.isSub) this.resetResponsiveToolbar();
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @this {ToolbarThis}
|
|
97
|
+
* @description Hide the toolbar
|
|
98
|
+
*/
|
|
99
|
+
hide() {
|
|
100
|
+
if (this._isInline) {
|
|
101
|
+
this.context.get(this.keyName + '.main').style.display = 'none';
|
|
102
|
+
this.context.get(this.keyName + '.main').style.top = '0px';
|
|
103
|
+
this._inlineToolbarAttr.isShow = false;
|
|
104
|
+
} else {
|
|
105
|
+
this.context.get(this.keyName + '.main').style.display = 'none';
|
|
106
|
+
if (!this.isSub) this.editor.frameContext.get('_stickyDummy').style.display = 'none';
|
|
107
|
+
if (this._isBalloon) {
|
|
108
|
+
this._balloonOffset = {
|
|
109
|
+
top: 0,
|
|
110
|
+
left: 0
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @this {ToolbarThis}
|
|
118
|
+
* @description Reset buttons of the responsive toolbar.
|
|
119
|
+
*/
|
|
120
|
+
resetResponsiveToolbar() {
|
|
121
|
+
this.menu.containerOff();
|
|
122
|
+
|
|
123
|
+
const responsiveSize = this._rButtonsize;
|
|
124
|
+
if (responsiveSize) {
|
|
125
|
+
let w = 0;
|
|
126
|
+
if (((this._isBalloon || this._isInline) && this.options.get('toolbar_width') === 'auto') || (this.editor.isSubBalloon && this.options.get('toolbar.sub_width') === 'auto')) {
|
|
127
|
+
w = this.editor.frameContext.get('topArea').offsetWidth;
|
|
128
|
+
} else {
|
|
129
|
+
w = this.context.get(this.keyName + '.main').offsetWidth;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let responsiveWidth = 'default';
|
|
133
|
+
for (let i = 1, len = responsiveSize.length; i < len; i++) {
|
|
134
|
+
if (w < responsiveSize[i]) {
|
|
135
|
+
responsiveWidth = responsiveSize[i] + '';
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (this._responsiveCurrentSize !== responsiveWidth) {
|
|
141
|
+
this._responsiveCurrentSize = responsiveWidth;
|
|
142
|
+
this.setButtons(this._rButtonsInfo[responsiveWidth]);
|
|
143
|
+
// this.viewer._resetFullScreenHeight();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @this {ToolbarThis}
|
|
150
|
+
* @description Reset the buttons on the toolbar. (Editor is not reloaded)
|
|
151
|
+
* - You cannot set a new plugin for the button.
|
|
152
|
+
* @param {Array} buttonList Button list
|
|
153
|
+
*/
|
|
154
|
+
setButtons(buttonList) {
|
|
155
|
+
this._moreLayerOff();
|
|
156
|
+
this.menu.dropdownOff();
|
|
157
|
+
this.menu.containerOff();
|
|
158
|
+
|
|
159
|
+
const { options, icons, lang } = this;
|
|
160
|
+
const newToolbar = CreateToolBar(buttonList, this.plugins, options, icons, lang, true);
|
|
161
|
+
|
|
162
|
+
newToolbar.updateButtons.forEach((v) => UpdateButton(v.button, v.plugin, this.icons, this.lang));
|
|
163
|
+
|
|
164
|
+
this.context.get(this.keyName + '.main').replaceChild(newToolbar.buttonTray, this.context.get(this.keyName + '.buttonTray'));
|
|
165
|
+
this.context.set(this.keyName + '.buttonTray', newToolbar.buttonTray);
|
|
166
|
+
|
|
167
|
+
this._resetButtonInfo();
|
|
168
|
+
|
|
169
|
+
this.triggerEvent('onSetToolbarButtons', { buttonTray: newToolbar.buttonTray, frameContext: this.editor.frameContext });
|
|
170
|
+
},
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @private
|
|
174
|
+
* @this {ToolbarThis}
|
|
175
|
+
* @description Reset the common buttons info.
|
|
176
|
+
*/
|
|
177
|
+
_resetButtonInfo() {
|
|
178
|
+
this.editor.allCommandButtons = new Map();
|
|
179
|
+
this.editor.subAllCommandButtons = new Map();
|
|
180
|
+
this.editor.commandTargets = new Map();
|
|
181
|
+
this.editor.shortcutsKeyMap = new Map();
|
|
182
|
+
|
|
183
|
+
this.editor.__cachingButtons();
|
|
184
|
+
this.editor.__cachingShortcuts();
|
|
185
|
+
|
|
186
|
+
this.history.resetButtons(this.editor.frameContext.get('key'), null);
|
|
187
|
+
this._resetSticky();
|
|
188
|
+
|
|
189
|
+
this.editor.effectNode = null;
|
|
190
|
+
this.viewer._setButtonsActive();
|
|
191
|
+
if (this.status.hasFocus) this.eventManager.applyTagEffect();
|
|
192
|
+
if (this.editor.frameContext.get('isReadOnly')) this.ui.setControllerOnDisabledButtons(true);
|
|
193
|
+
},
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @private
|
|
197
|
+
* @this {ToolbarThis}
|
|
198
|
+
* @description Reset the sticky toolbar position based on the editor state.
|
|
199
|
+
*/
|
|
200
|
+
_resetSticky() {
|
|
201
|
+
const wrapper = this.editor.frameContext.get('wrapper');
|
|
202
|
+
if (!wrapper) return;
|
|
203
|
+
|
|
204
|
+
const toolbar = this.context.get(this.keyName + '.main');
|
|
205
|
+
if (this.editor.frameContext.get('isFullScreen') || toolbar.offsetWidth === 0 || this.options.get('toolbar_sticky') < 0) return;
|
|
206
|
+
|
|
207
|
+
const currentScrollY = this._isViewPortSize ? _w.visualViewport.pageTop : _w.scrollY;
|
|
208
|
+
|
|
209
|
+
const minHeight = this.editor.frameContext.get('_minHeight');
|
|
210
|
+
const editorHeight = wrapper.offsetHeight;
|
|
211
|
+
const editorOffset = this.offset.getGlobal(this.editor.frameContext.get('topArea'));
|
|
212
|
+
const y = currentScrollY + this.options.get('toolbar_sticky');
|
|
213
|
+
const t = (this._isBalloon || this._isInline ? editorOffset.top : this.offset.getGlobal(this.options.get('toolbar_container')).top) - (this._isInline ? toolbar.offsetHeight : 0);
|
|
214
|
+
const inlineOffset = 1;
|
|
215
|
+
|
|
216
|
+
const offSticky = !this.options.get('toolbar_container')
|
|
217
|
+
? editorHeight + t + this.options.get('toolbar_sticky') - y - minHeight
|
|
218
|
+
: editorOffset.top - currentScrollY + editorHeight - minHeight - this.options.get('toolbar_sticky') - toolbar.offsetHeight;
|
|
219
|
+
if (y < t) {
|
|
220
|
+
this._offSticky();
|
|
221
|
+
} else if (offSticky < 0) {
|
|
222
|
+
if (!this._sticky) this._onSticky(inlineOffset);
|
|
223
|
+
toolbar.style.top = inlineOffset + offSticky + this.__getViewportTop() + 'px';
|
|
224
|
+
} else {
|
|
225
|
+
this._onSticky(inlineOffset);
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @private
|
|
231
|
+
* @this {ToolbarThis}
|
|
232
|
+
* @description Enable sticky toolbar mode and adjust position.
|
|
233
|
+
*/
|
|
234
|
+
_onSticky(inlineOffset) {
|
|
235
|
+
const toolbar = this.context.get(this.keyName + '.main');
|
|
236
|
+
|
|
237
|
+
if (!this._isInline) {
|
|
238
|
+
const stickyDummy = !this.options.get('toolbar_container') ? this.editor.frameContext.get('_stickyDummy') : this.context.get('_stickyDummy');
|
|
239
|
+
stickyDummy.style.height = toolbar.offsetHeight + 'px';
|
|
240
|
+
stickyDummy.style.display = 'block';
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const toolbarTopPosition = this.options.get('toolbar_sticky') + inlineOffset + this.__getViewportTop();
|
|
244
|
+
toolbar.style.top = `${toolbarTopPosition}px`;
|
|
245
|
+
toolbar.style.width = this._isInline ? this._inlineToolbarAttr.width : toolbar.offsetWidth + 'px';
|
|
246
|
+
dom.utils.addClass(toolbar, 'se-toolbar-sticky');
|
|
247
|
+
this._sticky = true;
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* @private
|
|
252
|
+
* @this {ToolbarThis}
|
|
253
|
+
* @description Get the viewport's top offset.
|
|
254
|
+
* @returns {number}
|
|
255
|
+
*/
|
|
256
|
+
__getViewportTop() {
|
|
257
|
+
if (this._isViewPortSize) {
|
|
258
|
+
return _w.visualViewport.offsetTop;
|
|
259
|
+
}
|
|
260
|
+
return 0;
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* @private
|
|
265
|
+
* @this {ToolbarThis}
|
|
266
|
+
* @description Disable sticky toolbar mode.
|
|
267
|
+
*/
|
|
268
|
+
_offSticky() {
|
|
269
|
+
const stickyDummy = !this.options.get('toolbar_container') ? this.editor.frameContext.get('_stickyDummy') : this.context.get('_stickyDummy');
|
|
270
|
+
stickyDummy.style.display = 'none';
|
|
271
|
+
|
|
272
|
+
const toolbar = this.context.get(this.keyName + '.main');
|
|
273
|
+
toolbar.style.top = this._isInline ? this._inlineToolbarAttr.top : '';
|
|
274
|
+
toolbar.style.width = this._isInline ? this._inlineToolbarAttr.width : '';
|
|
275
|
+
this.editor.frameContext.get('wrapper').style.marginTop = '';
|
|
276
|
+
|
|
277
|
+
dom.utils.removeClass(toolbar, 'se-toolbar-sticky');
|
|
278
|
+
this._sticky = false;
|
|
279
|
+
},
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @private
|
|
283
|
+
* @this {ToolbarThis}
|
|
284
|
+
* @description Set up responsive behavior for the toolbar buttons.
|
|
285
|
+
*/
|
|
286
|
+
_setResponsive() {
|
|
287
|
+
if (this._rButtonArray?.length === 0) {
|
|
288
|
+
this._rButtonArray = null;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
this._responsiveCurrentSize = 'default';
|
|
293
|
+
const _rButtonsize = (this._rButtonsize = []);
|
|
294
|
+
const _responsiveButtons = this._originRes;
|
|
295
|
+
const buttonsObj = (this._rButtonsInfo = {
|
|
296
|
+
default: _responsiveButtons[0]
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
for (let i = 1, len = _responsiveButtons.length, size, buttonGroup; i < len; i++) {
|
|
300
|
+
buttonGroup = _responsiveButtons[i];
|
|
301
|
+
size = buttonGroup[0] * 1;
|
|
302
|
+
_rButtonsize.push(size);
|
|
303
|
+
buttonsObj[size] = buttonGroup[1];
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
_rButtonsize.sort((a, b) => a - b).unshift('default');
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* @private
|
|
311
|
+
* @this {ToolbarThis}
|
|
312
|
+
* @description Show the balloon toolbar based on the current selection.
|
|
313
|
+
* @param {?Range=} rangeObj - Selection range
|
|
314
|
+
*/
|
|
315
|
+
_showBalloon(rangeObj) {
|
|
316
|
+
if (!this._isBalloon) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
if (this.isSub) this.resetResponsiveToolbar();
|
|
320
|
+
|
|
321
|
+
const range = rangeObj || this.selection.getRange();
|
|
322
|
+
const toolbar = this.context.get(this.keyName + '.main');
|
|
323
|
+
const selection = this.selection.get();
|
|
324
|
+
|
|
325
|
+
let isDirTop;
|
|
326
|
+
if (this._isBalloonAlways && range.collapsed) {
|
|
327
|
+
isDirTop = true;
|
|
328
|
+
} else if (selection.focusNode === selection.anchorNode) {
|
|
329
|
+
isDirTop = selection.focusOffset < selection.anchorOffset;
|
|
330
|
+
} else {
|
|
331
|
+
const childNodes = dom.query.getListChildNodes(range.commonAncestorContainer, null);
|
|
332
|
+
isDirTop = dom.utils.getArrayIndex(childNodes, selection.focusNode) < dom.utils.getArrayIndex(childNodes, selection.anchorNode);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
this._setBalloonOffset(isDirTop, range);
|
|
336
|
+
|
|
337
|
+
this.triggerEvent('onShowToolbar', { toolbar, mode: 'balloon', frameContext: this.editor.frameContext });
|
|
338
|
+
},
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* @private
|
|
342
|
+
* @this {ToolbarThis}
|
|
343
|
+
* @description Adjust the balloon toolbar's position.
|
|
344
|
+
* @param {boolean} positionTop - Whether the toolbar should be positioned above the selection
|
|
345
|
+
* @param {Range} [range] - Selection range
|
|
346
|
+
*/
|
|
347
|
+
_setBalloonOffset(positionTop, range) {
|
|
348
|
+
const toolbar = this.context.get(this.keyName + '.main');
|
|
349
|
+
const topArea = this.editor.frameContext.get('topArea');
|
|
350
|
+
const offsets = this.offset.getGlobal(topArea);
|
|
351
|
+
const stickyTop = offsets.top;
|
|
352
|
+
|
|
353
|
+
if (!this.offset.setRangePosition(toolbar, range, { position: positionTop ? 'top' : 'bottom', addTop: stickyTop })) {
|
|
354
|
+
this.hide();
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (this.options.get('toolbar_container')) {
|
|
359
|
+
const editorParent = topArea.parentElement;
|
|
360
|
+
|
|
361
|
+
let container = this.options.get('toolbar_container');
|
|
362
|
+
let left = container.offsetLeft;
|
|
363
|
+
let top = container.offsetTop;
|
|
364
|
+
|
|
365
|
+
while (!container.parentElement.contains(editorParent) && !/^(BODY|HTML)$/i.test(container.parentElement.nodeName)) {
|
|
366
|
+
container = container.offsetParent;
|
|
367
|
+
left += container.offsetLeft;
|
|
368
|
+
top += container.offsetTop;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
toolbar.style.left = toolbar.offsetLeft - left + topArea.offsetLeft + 'px';
|
|
372
|
+
toolbar.style.top = toolbar.offsetTop - top + topArea.offsetTop + 'px';
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const wwScroll = this.offset.getWWScroll();
|
|
376
|
+
this._balloonOffset = {
|
|
377
|
+
top: toolbar.offsetTop + wwScroll.top,
|
|
378
|
+
left: toolbar.offsetLeft + wwScroll.left,
|
|
379
|
+
position: positionTop ? 'top' : 'bottom'
|
|
380
|
+
};
|
|
381
|
+
},
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @private
|
|
385
|
+
* @this {ToolbarThis}
|
|
386
|
+
* @description Show the inline toolbar mode.
|
|
387
|
+
*/
|
|
388
|
+
_showInline() {
|
|
389
|
+
if (!this._isInline) return;
|
|
390
|
+
|
|
391
|
+
const toolbar = this.context.get(this.keyName + '.main');
|
|
392
|
+
toolbar.style.visibility = 'hidden';
|
|
393
|
+
this._offSticky();
|
|
394
|
+
|
|
395
|
+
toolbar.style.display = 'block';
|
|
396
|
+
toolbar.style.top = '0px';
|
|
397
|
+
this._inlineToolbarAttr.width = toolbar.style.width = this.options.get(this.keyName + '_width');
|
|
398
|
+
this._inlineToolbarAttr.top = toolbar.style.top = -1 + (this.offset.getGlobal(this.editor.frameContext.get('topArea')).top - this.offset.getGlobal(toolbar).top - toolbar.offsetHeight) + 'px';
|
|
399
|
+
|
|
400
|
+
this._resetSticky();
|
|
401
|
+
this._inlineToolbarAttr.isShow = true;
|
|
402
|
+
|
|
403
|
+
this.triggerEvent('onShowToolbar', { toolbar, mode: 'inline' });
|
|
404
|
+
|
|
405
|
+
toolbar.style.visibility = '';
|
|
406
|
+
},
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* @private
|
|
410
|
+
* @this {ToolbarThis}
|
|
411
|
+
* @description Show a more options layer for toolbar buttons.
|
|
412
|
+
* @param {Node} button - Button element
|
|
413
|
+
* @param {Node} layer - More options layer element
|
|
414
|
+
*/
|
|
415
|
+
_moreLayerOn(button, layer) {
|
|
416
|
+
this._moreLayerOff();
|
|
417
|
+
this.currentMoreLayerActiveButton = /** @type {HTMLButtonElement} */ (button);
|
|
418
|
+
/** @type {HTMLElement} */ (layer).style.display = 'block';
|
|
419
|
+
},
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* @private
|
|
423
|
+
* @this {ToolbarThis}
|
|
424
|
+
* @description Hide the currently active more options layer.
|
|
425
|
+
*/
|
|
426
|
+
_moreLayerOff() {
|
|
427
|
+
if (this.currentMoreLayerActiveButton) {
|
|
428
|
+
const layer = this.context.get(this.keyName + '.main').querySelector('.' + this.currentMoreLayerActiveButton.getAttribute('data-command'));
|
|
429
|
+
layer.style.display = 'none';
|
|
430
|
+
dom.utils.removeClass(this.currentMoreLayerActiveButton, 'on');
|
|
431
|
+
this.currentMoreLayerActiveButton = null;
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
constructor: Toolbar
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
export default Toolbar;
|