suneditor 3.1.4 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/suneditor-contents.min.css +1 -1
- package/dist/suneditor.min.css +28 -1
- package/dist/suneditor.min.js +1 -1
- package/package.json +2 -1
- package/src/assets/design/color.css +12 -0
- package/src/assets/design/size.css +9 -2
- package/src/assets/icons/defaultIcons.js +96 -47
- package/src/assets/suneditor-contents.css +3 -2
- package/src/assets/suneditor.css +481 -31
- package/src/core/config/contextProvider.js +2 -1
- package/src/core/config/eventManager.js +41 -2
- package/src/core/config/optionProvider.js +23 -2
- package/src/core/editor.js +32 -14
- package/src/core/event/actions/index.js +76 -9
- package/src/core/event/effects/common.registry.js +2 -1
- package/src/core/event/effects/keydown.registry.js +169 -33
- package/src/core/event/effects/ruleHelpers.js +20 -6
- package/src/core/event/eventOrchestrator.js +162 -30
- package/src/core/event/handlers/handler_toolbar.js +4 -2
- package/src/core/event/handlers/handler_ww_dragDrop.js +10 -0
- package/src/core/event/handlers/handler_ww_input.js +84 -2
- package/src/core/event/handlers/handler_ww_key.js +82 -21
- package/src/core/event/handlers/handler_ww_mouse.js +45 -8
- package/src/core/event/ports.js +27 -13
- package/src/core/event/reducers/keydown.reducer.js +33 -5
- package/src/core/event/rules/keydown.rule.arrow.js +12 -2
- package/src/core/event/rules/keydown.rule.backspace.js +110 -15
- package/src/core/event/rules/keydown.rule.delete.js +62 -7
- package/src/core/event/rules/keydown.rule.enter.js +62 -31
- package/src/core/event/support/defaultLineManager.js +9 -2
- package/src/core/event/support/selectionState.js +13 -3
- package/src/core/kernel/coreKernel.js +1 -0
- package/src/core/logic/dom/char.js +13 -3
- package/src/core/logic/dom/format.js +171 -39
- package/src/core/logic/dom/html.js +350 -72
- package/src/core/logic/dom/inline.js +229 -34
- package/src/core/logic/dom/listFormat.js +111 -20
- package/src/core/logic/dom/nodeTransform.js +36 -11
- package/src/core/logic/dom/offset.js +116 -31
- package/src/core/logic/dom/selection.js +147 -29
- package/src/core/logic/panel/blockHandle.js +785 -0
- package/src/core/logic/panel/blockResolver.js +278 -0
- package/src/core/logic/panel/finder.js +16 -6
- package/src/core/logic/panel/menu.js +119 -18
- package/src/core/logic/panel/toolbar.js +75 -19
- package/src/core/logic/panel/viewer.js +76 -20
- package/src/core/logic/shell/_commandExecutor.js +44 -9
- package/src/core/logic/shell/commandDispatcher.js +46 -4
- package/src/core/logic/shell/component.js +102 -25
- package/src/core/logic/shell/focusManager.js +13 -3
- package/src/core/logic/shell/history.js +21 -6
- package/src/core/logic/shell/pluginManager.js +21 -13
- package/src/core/logic/shell/shortcuts.js +9 -1
- package/src/core/logic/shell/ui.js +139 -37
- package/src/core/schema/frameContext.js +34 -3
- package/src/core/schema/options.js +46 -4
- package/src/core/section/constructor.js +537 -106
- package/src/core/section/documentType.js +35 -6
- package/src/helper/converter.js +24 -7
- package/src/helper/dom/domCheck.js +25 -5
- package/src/helper/dom/domQuery.js +2 -1
- package/src/helper/dom/domUtils.js +17 -4
- package/src/helper/env.js +11 -2
- package/src/helper/keyCodeMap.js +6 -2
- package/src/helper/markdown.js +24 -5
- package/src/helper/msOffice.js +9 -2
- package/src/interfaces/plugins.js +1 -1
- package/src/langs/ckb.js +0 -1
- package/src/langs/cs.js +0 -1
- package/src/langs/da.js +0 -1
- package/src/langs/de.js +0 -1
- package/src/langs/en.js +0 -1
- package/src/langs/es.js +0 -1
- package/src/langs/fa.js +0 -1
- package/src/langs/fr.js +0 -1
- package/src/langs/he.js +0 -1
- package/src/langs/hu.js +0 -1
- package/src/langs/index.js +27 -1
- package/src/langs/it.js +0 -1
- package/src/langs/ja.js +0 -1
- package/src/langs/km.js +0 -1
- package/src/langs/ko.js +0 -1
- package/src/langs/lv.js +0 -1
- package/src/langs/nl.js +0 -1
- package/src/langs/pl.js +0 -1
- package/src/langs/pt_br.js +0 -1
- package/src/langs/ro.js +0 -1
- package/src/langs/ru.js +0 -1
- package/src/langs/se.js +0 -1
- package/src/langs/tr.js +0 -1
- package/src/langs/uk.js +0 -1
- package/src/langs/ur.js +0 -1
- package/src/langs/zh_cn.js +0 -1
- package/src/modules/contract/Browser.js +58 -14
- package/src/modules/contract/ColorPicker.js +12 -4
- package/src/modules/contract/Controller.js +37 -7
- package/src/modules/contract/Figure.js +156 -36
- package/src/modules/contract/HueSlider.js +27 -4
- package/src/modules/contract/Modal.js +50 -10
- package/src/modules/manager/FileManager.js +50 -8
- package/src/modules/ui/CommandMenu.js +597 -0
- package/src/modules/ui/ModalAnchorEditor.js +33 -6
- package/src/modules/ui/SelectMenu.js +481 -36
- package/src/modules/ui/index.js +1 -0
- package/src/plugins/browser/audioGallery.js +2 -1
- package/src/plugins/browser/fileBrowser.js +9 -2
- package/src/plugins/browser/fileGallery.js +2 -1
- package/src/plugins/browser/imageGallery.js +18 -3
- package/src/plugins/browser/videoGallery.js +13 -4
- package/src/plugins/command/blockquote.js +6 -1
- package/src/plugins/command/codeBlock.js +43 -5
- package/src/plugins/command/exportPDF.js +20 -4
- package/src/plugins/command/fileUpload.js +46 -11
- package/src/plugins/command/list_bulleted.js +6 -1
- package/src/plugins/command/list_numbered.js +6 -1
- package/src/plugins/dropdown/align.js +21 -33
- package/src/plugins/dropdown/backgroundColor.js +10 -2
- package/src/plugins/dropdown/blockStyle.js +17 -22
- package/src/plugins/dropdown/font.js +34 -34
- package/src/plugins/dropdown/hr.js +15 -43
- package/src/plugins/dropdown/layout.js +10 -27
- package/src/plugins/dropdown/lineHeight.js +10 -33
- package/src/plugins/dropdown/list.js +19 -25
- package/src/plugins/dropdown/paragraphStyle.js +16 -24
- package/src/plugins/dropdown/table/index.js +72 -17
- package/src/plugins/dropdown/table/render/table.html.js +3 -1
- package/src/plugins/dropdown/table/services/table.cell.js +33 -7
- package/src/plugins/dropdown/table/services/table.clipboard.js +5 -1
- package/src/plugins/dropdown/table/services/table.grid.js +40 -9
- package/src/plugins/dropdown/table/services/table.resize.js +55 -11
- package/src/plugins/dropdown/table/services/table.selection.js +27 -7
- package/src/plugins/dropdown/table/services/table.style.js +120 -20
- package/src/plugins/dropdown/template.js +13 -29
- package/src/plugins/dropdown/textStyle.js +22 -35
- package/src/plugins/field/autocomplete.js +8 -4
- package/src/plugins/field/slashCommand.js +297 -0
- package/src/plugins/index.js +3 -0
- package/src/plugins/input/fontSize.js +37 -8
- package/src/plugins/input/pageNavigator.js +7 -1
- package/src/plugins/modal/audio.js +71 -17
- package/src/plugins/modal/drawing.js +41 -11
- package/src/plugins/modal/embed.js +92 -22
- package/src/plugins/modal/image/index.js +114 -28
- package/src/plugins/modal/image/services/image.size.js +9 -2
- package/src/plugins/modal/image/services/image.upload.js +38 -4
- package/src/plugins/modal/link.js +9 -2
- package/src/plugins/modal/math.js +10 -2
- package/src/plugins/modal/video/index.js +112 -26
- package/src/plugins/modal/video/render/video.html.js +4 -1
- package/src/plugins/modal/video/services/video.size.js +15 -4
- package/src/plugins/modal/video/services/video.upload.js +10 -2
- package/src/plugins/popup/anchor.js +14 -2
- package/src/suneditor.js +8 -2
- package/src/themes/cobalt.css +12 -0
- package/src/themes/cream.css +12 -0
- package/src/themes/dark.css +12 -0
- package/src/themes/midnight.css +12 -0
- package/src/typedef.js +32 -21
- package/types/assets/icons/defaultIcons.d.ts +1 -0
- package/types/core/config/contextProvider.d.ts +7 -1
- package/types/core/config/eventManager.d.ts +37 -4
- package/types/core/config/optionProvider.d.ts +5 -1
- package/types/core/event/actions/index.d.ts +44 -6
- package/types/core/event/effects/keydown.registry.d.ts +37 -7
- package/types/core/event/effects/ruleHelpers.d.ts +6 -1
- package/types/core/event/eventOrchestrator.d.ts +13 -3
- package/types/core/event/handlers/handler_ww_clipboard.d.ts +15 -3
- package/types/core/event/handlers/handler_ww_dragDrop.d.ts +14 -2
- package/types/core/event/handlers/handler_ww_input.d.ts +10 -2
- package/types/core/event/handlers/handler_ww_key.d.ts +10 -2
- package/types/core/event/handlers/handler_ww_mouse.d.ts +25 -5
- package/types/core/event/ports.d.ts +11 -4
- package/types/core/event/reducers/keydown.reducer.d.ts +12 -3
- package/types/core/event/rules/keydown.rule.backspace.d.ts +6 -1
- package/types/core/kernel/store.d.ts +4 -1
- package/types/core/logic/dom/format.d.ts +32 -14
- package/types/core/logic/dom/html.d.ts +11 -3
- package/types/core/logic/dom/nodeTransform.d.ts +6 -6
- package/types/core/logic/panel/blockHandle.d.ts +64 -0
- package/types/core/logic/panel/blockResolver.d.ts +50 -0
- package/types/core/logic/panel/menu.d.ts +72 -3
- package/types/core/logic/shell/commandDispatcher.d.ts +8 -0
- package/types/core/logic/shell/component.d.ts +5 -3
- package/types/core/logic/shell/shortcuts.d.ts +10 -1
- package/types/core/logic/shell/ui.d.ts +7 -1
- package/types/core/schema/context.d.ts +7 -1
- package/types/core/schema/frameContext.d.ts +36 -4
- package/types/core/schema/options.d.ts +83 -2
- package/types/core/section/constructor.d.ts +38 -1
- package/types/events.d.ts +208 -32
- package/types/helper/converter.d.ts +4 -2
- package/types/helper/dom/domCheck.d.ts +12 -2
- package/types/helper/dom/domQuery.d.ts +35 -7
- package/types/helper/dom/domUtils.d.ts +4 -1
- package/types/interfaces/plugins.d.ts +2 -2
- package/types/langs/_Lang.d.ts +0 -1
- package/types/modules/contract/ColorPicker.d.ts +2 -2
- package/types/modules/contract/Controller.d.ts +7 -0
- package/types/modules/contract/Figure.d.ts +31 -4
- package/types/modules/ui/CommandMenu.d.ts +262 -0
- package/types/modules/ui/SelectMenu.d.ts +56 -3
- package/types/modules/ui/index.d.ts +1 -0
- package/types/plugins/browser/audioGallery.d.ts +1 -1
- package/types/plugins/browser/fileBrowser.d.ts +1 -1
- package/types/plugins/browser/fileGallery.d.ts +1 -1
- package/types/plugins/browser/imageGallery.d.ts +1 -1
- package/types/plugins/browser/videoGallery.d.ts +1 -1
- package/types/plugins/dropdown/align.d.ts +1 -1
- package/types/plugins/dropdown/blockStyle.d.ts +3 -1
- package/types/plugins/dropdown/table/index.d.ts +4 -1
- package/types/plugins/dropdown/table/services/table.clipboard.d.ts +5 -1
- package/types/plugins/dropdown/table/services/table.grid.d.ts +10 -2
- package/types/plugins/field/autocomplete.d.ts +0 -1
- package/types/plugins/field/slashCommand.d.ts +165 -0
- package/types/plugins/index.d.ts +3 -0
- package/types/plugins/modal/link.d.ts +4 -1
- package/types/typedef.d.ts +48 -23
|
@@ -108,7 +108,10 @@ class Video extends PluginModal {
|
|
|
108
108
|
*/
|
|
109
109
|
static #checkContentType(url) {
|
|
110
110
|
url = url?.toLowerCase() || '';
|
|
111
|
-
if (
|
|
111
|
+
if (
|
|
112
|
+
this.#extensions.some((ext) => url.endsWith(ext)) ||
|
|
113
|
+
this.#urlPatterns.some((pattern) => pattern.test(url))
|
|
114
|
+
) {
|
|
112
115
|
return true;
|
|
113
116
|
}
|
|
114
117
|
|
|
@@ -157,17 +160,33 @@ class Video extends PluginModal {
|
|
|
157
160
|
this.pluginOptions = {
|
|
158
161
|
canResize: pluginOptions.canResize === undefined ? true : pluginOptions.canResize,
|
|
159
162
|
showHeightInput: pluginOptions.showHeightInput === undefined ? true : !!pluginOptions.showHeightInput,
|
|
160
|
-
defaultWidth:
|
|
161
|
-
|
|
163
|
+
defaultWidth:
|
|
164
|
+
!pluginOptions.defaultWidth || !numbers.get(pluginOptions.defaultWidth, 0)
|
|
165
|
+
? ''
|
|
166
|
+
: numbers.is(pluginOptions.defaultWidth)
|
|
167
|
+
? pluginOptions.defaultWidth + 'px'
|
|
168
|
+
: pluginOptions.defaultWidth,
|
|
169
|
+
defaultHeight:
|
|
170
|
+
!pluginOptions.defaultHeight || !numbers.get(pluginOptions.defaultHeight, 0)
|
|
171
|
+
? ''
|
|
172
|
+
: numbers.is(pluginOptions.defaultHeight)
|
|
173
|
+
? pluginOptions.defaultHeight + 'px'
|
|
174
|
+
: pluginOptions.defaultHeight,
|
|
162
175
|
percentageOnlySize: !!pluginOptions.percentageOnlySize,
|
|
163
176
|
createFileInput: !!pluginOptions.createFileInput,
|
|
164
|
-
createUrlInput:
|
|
177
|
+
createUrlInput:
|
|
178
|
+
pluginOptions.createUrlInput === undefined || !pluginOptions.createFileInput
|
|
179
|
+
? true
|
|
180
|
+
: pluginOptions.createUrlInput,
|
|
165
181
|
uploadUrl: typeof pluginOptions.uploadUrl === 'string' ? pluginOptions.uploadUrl : null,
|
|
166
182
|
uploadHeaders: pluginOptions.uploadHeaders || null,
|
|
167
183
|
uploadSizeLimit: numbers.get(pluginOptions.uploadSizeLimit, 0),
|
|
168
184
|
uploadSingleSizeLimit: numbers.get(pluginOptions.uploadSingleSizeLimit, 0),
|
|
169
185
|
allowMultiple: !!pluginOptions.allowMultiple,
|
|
170
|
-
acceptedFormats:
|
|
186
|
+
acceptedFormats:
|
|
187
|
+
typeof pluginOptions.acceptedFormats !== 'string' || pluginOptions.acceptedFormats.trim() === '*'
|
|
188
|
+
? 'video/*'
|
|
189
|
+
: pluginOptions.acceptedFormats.trim() || 'video/*',
|
|
171
190
|
defaultRatio: numbers.get(pluginOptions.defaultRatio, 4) || 0.5625,
|
|
172
191
|
showRatioOption: pluginOptions.showRatioOption === undefined ? true : !!pluginOptions.showRatioOption,
|
|
173
192
|
ratioOptions: !pluginOptions.ratioOptions ? null : pluginOptions.ratioOptions,
|
|
@@ -181,7 +200,11 @@ class Video extends PluginModal {
|
|
|
181
200
|
// create HTML
|
|
182
201
|
const sizeUnit = this.pluginOptions.percentageOnlySize ? '%' : 'px';
|
|
183
202
|
const modalEl = CreateHTML_modal(this.$, this.pluginOptions);
|
|
184
|
-
const figureControls =
|
|
203
|
+
const figureControls =
|
|
204
|
+
pluginOptions.controls ||
|
|
205
|
+
(!this.pluginOptions.canResize
|
|
206
|
+
? [['align', 'edit', 'copy', 'remove']]
|
|
207
|
+
: [['resize_auto,75,50', 'align', 'edit', 'revert', 'copy', 'remove']]);
|
|
185
208
|
|
|
186
209
|
// show align
|
|
187
210
|
if (!figureControls.some((subArray) => subArray.includes('align'))) modalEl.alignForm.style.display = 'none';
|
|
@@ -189,7 +212,10 @@ class Video extends PluginModal {
|
|
|
189
212
|
// modules
|
|
190
213
|
const defaultRatio = this.pluginOptions.defaultRatio * 100 + '%';
|
|
191
214
|
this.modal = new Modal(this, this.$, modalEl.html);
|
|
192
|
-
this.figure = new Figure(this, this.$, figureControls, {
|
|
215
|
+
this.figure = new Figure(this, this.$, figureControls, {
|
|
216
|
+
sizeUnit: sizeUnit,
|
|
217
|
+
autoRatio: { current: defaultRatio, default: defaultRatio },
|
|
218
|
+
});
|
|
193
219
|
this.fileManager = new FileManager(this, this.$, {
|
|
194
220
|
query: 'iframe, video',
|
|
195
221
|
loadEventName: 'onVideoLoad',
|
|
@@ -204,7 +230,8 @@ class Video extends PluginModal {
|
|
|
204
230
|
this.previewSrc = modalEl.previewSrc;
|
|
205
231
|
|
|
206
232
|
this.#resizing = this.pluginOptions.canResize;
|
|
207
|
-
this.#nonResizing =
|
|
233
|
+
this.#nonResizing =
|
|
234
|
+
!this.#resizing || !this.pluginOptions.showHeightInput || this.pluginOptions.percentageOnlySize;
|
|
208
235
|
|
|
209
236
|
this.query = {
|
|
210
237
|
youtube: {
|
|
@@ -247,9 +274,11 @@ class Video extends PluginModal {
|
|
|
247
274
|
const galleryButton = modalEl.galleryButton;
|
|
248
275
|
if (galleryButton) this.$.eventManager.addEvent(galleryButton, 'click', this.#OpenGallery.bind(this));
|
|
249
276
|
|
|
250
|
-
if (this.videoInputFile)
|
|
277
|
+
if (this.videoInputFile)
|
|
278
|
+
this.$.eventManager.addEvent(modalEl.fileRemoveBtn, 'click', this.#RemoveSelectedFiles.bind(this));
|
|
251
279
|
if (this.videoUrlFile) this.$.eventManager.addEvent(this.videoUrlFile, 'input', this.#OnLinkPreview.bind(this));
|
|
252
|
-
if (this.videoInputFile && this.videoUrlFile)
|
|
280
|
+
if (this.videoInputFile && this.videoUrlFile)
|
|
281
|
+
this.$.eventManager.addEvent(this.videoInputFile, 'change', this.#OnfileInputChange.bind(this));
|
|
253
282
|
}
|
|
254
283
|
|
|
255
284
|
/**
|
|
@@ -311,9 +340,11 @@ class Video extends PluginModal {
|
|
|
311
340
|
*/
|
|
312
341
|
modalOn(isUpdate) {
|
|
313
342
|
if (!isUpdate) {
|
|
314
|
-
if (this.videoInputFile && this.pluginOptions.allowMultiple)
|
|
343
|
+
if (this.videoInputFile && this.pluginOptions.allowMultiple)
|
|
344
|
+
this.videoInputFile.setAttribute('multiple', 'multiple');
|
|
315
345
|
} else {
|
|
316
|
-
if (this.videoInputFile && this.pluginOptions.allowMultiple)
|
|
346
|
+
if (this.videoInputFile && this.pluginOptions.allowMultiple)
|
|
347
|
+
this.videoInputFile.removeAttribute('multiple');
|
|
317
348
|
}
|
|
318
349
|
|
|
319
350
|
this.sizeService.on(isUpdate);
|
|
@@ -324,7 +355,9 @@ class Video extends PluginModal {
|
|
|
324
355
|
* @type {SunEditor.Hook.Modal.Action}
|
|
325
356
|
*/
|
|
326
357
|
async modalAction() {
|
|
327
|
-
this.#align = /** @type {HTMLInputElement} */ (
|
|
358
|
+
this.#align = /** @type {HTMLInputElement} */ (
|
|
359
|
+
this.modal.form.querySelector('input[name="suneditor_video_radio"]:checked')
|
|
360
|
+
).value;
|
|
328
361
|
|
|
329
362
|
let result = false;
|
|
330
363
|
if (this.videoInputFile && this.videoInputFile.files.length > 0) {
|
|
@@ -351,7 +384,9 @@ class Video extends PluginModal {
|
|
|
351
384
|
this.previewSrc.style.textDecoration = '';
|
|
352
385
|
}
|
|
353
386
|
|
|
354
|
-
/** @type {HTMLInputElement} */ (
|
|
387
|
+
/** @type {HTMLInputElement} */ (
|
|
388
|
+
this.modal.form.querySelector('input[name="suneditor_video_radio"][value="none"]')
|
|
389
|
+
).checked = true;
|
|
355
390
|
this.#nonResizing = false;
|
|
356
391
|
|
|
357
392
|
this.sizeService.init();
|
|
@@ -384,7 +419,12 @@ class Video extends PluginModal {
|
|
|
384
419
|
const focusEl = container.previousElementSibling || container.nextElementSibling;
|
|
385
420
|
const emptyDiv = container.parentNode;
|
|
386
421
|
|
|
387
|
-
const message = await this.$.eventManager.triggerEvent('onVideoDeleteBefore', {
|
|
422
|
+
const message = await this.$.eventManager.triggerEvent('onVideoDeleteBefore', {
|
|
423
|
+
element: targetEl,
|
|
424
|
+
container,
|
|
425
|
+
align: this.#align,
|
|
426
|
+
url: this.#linkValue,
|
|
427
|
+
});
|
|
388
428
|
if (message === false) return;
|
|
389
429
|
|
|
390
430
|
dom.utils.removeItem(container);
|
|
@@ -524,7 +564,13 @@ class Video extends PluginModal {
|
|
|
524
564
|
/** rendering */
|
|
525
565
|
this.#element = oFrame;
|
|
526
566
|
this.#container = container;
|
|
527
|
-
this.figure.open(oFrame, {
|
|
567
|
+
this.figure.open(oFrame, {
|
|
568
|
+
nonResizing: this.#nonResizing,
|
|
569
|
+
nonSizeInfo: false,
|
|
570
|
+
nonBorder: false,
|
|
571
|
+
figureTarget: false,
|
|
572
|
+
infoOnly: true,
|
|
573
|
+
});
|
|
528
574
|
|
|
529
575
|
// set size
|
|
530
576
|
const resolved = this.sizeService.resolveSize(width, height, oFrame, isUpdate);
|
|
@@ -539,11 +585,15 @@ class Video extends PluginModal {
|
|
|
539
585
|
this.fileManager.setFileData(oFrame, file);
|
|
540
586
|
|
|
541
587
|
if (!isUpdate) {
|
|
542
|
-
this.$.component.insert(container, {
|
|
588
|
+
this.$.component.insert(container, {
|
|
589
|
+
scrollTo: isLast ? true : false,
|
|
590
|
+
insertBehavior: isLast ? this.pluginOptions.insertBehavior : 'line',
|
|
591
|
+
});
|
|
543
592
|
return;
|
|
544
593
|
}
|
|
545
594
|
|
|
546
|
-
if (!this.#resizing || !resolved.isChanged || !this.figure.isVertical)
|
|
595
|
+
if (!this.#resizing || !resolved.isChanged || !this.figure.isVertical)
|
|
596
|
+
this.figure.setTransform(oFrame, width, height, 0);
|
|
547
597
|
this.$.history.push(false);
|
|
548
598
|
}
|
|
549
599
|
|
|
@@ -600,7 +650,8 @@ class Video extends PluginModal {
|
|
|
600
650
|
|
|
601
651
|
s = f.size;
|
|
602
652
|
if (singleSizeLimit > 0 && s > singleSizeLimit) {
|
|
603
|
-
const err =
|
|
653
|
+
const err =
|
|
654
|
+
'[SUNEDITOR.videoUpload.fail] Size of uploadable single file: ' + singleSizeLimit / 1000 + 'KB';
|
|
604
655
|
const message = await this.$.eventManager.triggerEvent('onVideoUploadError', {
|
|
605
656
|
error: err,
|
|
606
657
|
limitSize: singleSizeLimit,
|
|
@@ -621,7 +672,12 @@ class Video extends PluginModal {
|
|
|
621
672
|
const currentSize = this.fileManager.getSize();
|
|
622
673
|
if (limitSize > 0 && fileSize + currentSize > limitSize) {
|
|
623
674
|
const err = '[SUNEDITOR.videoUpload.fail] Size of uploadable total videos: ' + limitSize / 1000 + 'KB';
|
|
624
|
-
const message = await this.$.eventManager.triggerEvent('onVideoUploadError', {
|
|
675
|
+
const message = await this.$.eventManager.triggerEvent('onVideoUploadError', {
|
|
676
|
+
error: err,
|
|
677
|
+
limitSize,
|
|
678
|
+
currentSize,
|
|
679
|
+
uploadSize: fileSize,
|
|
680
|
+
});
|
|
625
681
|
|
|
626
682
|
this.$.ui.alertOpen(message === NO_EVENT ? err : message || err, 'error');
|
|
627
683
|
|
|
@@ -676,7 +732,16 @@ class Video extends PluginModal {
|
|
|
676
732
|
|
|
677
733
|
const handler = function (infos, newInfos) {
|
|
678
734
|
infos = newInfos || infos;
|
|
679
|
-
this.create(
|
|
735
|
+
this.create(
|
|
736
|
+
this[/^iframe$/i.test(infos.process?.tag) ? 'createIframeTag' : 'createVideoTag'](),
|
|
737
|
+
infos.url,
|
|
738
|
+
infos.inputWidth,
|
|
739
|
+
infos.inputHeight,
|
|
740
|
+
infos.align,
|
|
741
|
+
infos.isUpdate,
|
|
742
|
+
infos.files,
|
|
743
|
+
true,
|
|
744
|
+
);
|
|
680
745
|
}.bind(this, videoInfo);
|
|
681
746
|
|
|
682
747
|
const result = await this.$.eventManager.triggerEvent('onVideoUploadBefore', {
|
|
@@ -702,7 +767,13 @@ class Video extends PluginModal {
|
|
|
702
767
|
*/
|
|
703
768
|
#ready(target, infoOnly = false) {
|
|
704
769
|
if (!target) return;
|
|
705
|
-
const figureInfo = this.figure.open(target, {
|
|
770
|
+
const figureInfo = this.figure.open(target, {
|
|
771
|
+
nonResizing: this.#nonResizing,
|
|
772
|
+
nonSizeInfo: false,
|
|
773
|
+
nonBorder: false,
|
|
774
|
+
figureTarget: false,
|
|
775
|
+
infoOnly,
|
|
776
|
+
});
|
|
706
777
|
|
|
707
778
|
this.#element = target;
|
|
708
779
|
this.#container = figureInfo.container;
|
|
@@ -713,10 +784,16 @@ class Video extends PluginModal {
|
|
|
713
784
|
const originHeight = String(figureInfo.height || figureInfo.originHeight || figureInfo.h || '');
|
|
714
785
|
this.sizeService.setOriginSize(originWidth, originHeight);
|
|
715
786
|
|
|
716
|
-
if (this.videoUrlFile)
|
|
787
|
+
if (this.videoUrlFile)
|
|
788
|
+
this.#linkValue =
|
|
789
|
+
this.previewSrc.textContent =
|
|
790
|
+
this.videoUrlFile.value =
|
|
791
|
+
this.#element.src || this.#element.querySelector('source')?.src || '';
|
|
717
792
|
|
|
718
793
|
/** @type {HTMLInputElement} */
|
|
719
|
-
const activeAlign =
|
|
794
|
+
const activeAlign =
|
|
795
|
+
this.modal.form.querySelector('input[name="suneditor_video_radio"][value="' + this.#align + '"]') ||
|
|
796
|
+
this.modal.form.querySelector('input[name="suneditor_video_radio"][value="none"]');
|
|
720
797
|
activeAlign.checked = true;
|
|
721
798
|
|
|
722
799
|
if (!this.#resizing) return;
|
|
@@ -768,7 +845,13 @@ class Video extends PluginModal {
|
|
|
768
845
|
}
|
|
769
846
|
|
|
770
847
|
// size
|
|
771
|
-
this.figure.open(cloneFrame, {
|
|
848
|
+
this.figure.open(cloneFrame, {
|
|
849
|
+
nonResizing: this.#nonResizing,
|
|
850
|
+
nonSizeInfo: false,
|
|
851
|
+
nonBorder: false,
|
|
852
|
+
figureTarget: false,
|
|
853
|
+
infoOnly: true,
|
|
854
|
+
});
|
|
772
855
|
const size = (cloneFrame.getAttribute('data-se-size') || ',').split(',');
|
|
773
856
|
|
|
774
857
|
const width = size[0] || prevFrame.width || '';
|
|
@@ -864,7 +947,10 @@ class Video extends PluginModal {
|
|
|
864
947
|
* @param {HTMLInputElement} target - The selected video element.
|
|
865
948
|
*/
|
|
866
949
|
#SetUrlInput(target) {
|
|
867
|
-
this.#linkValue =
|
|
950
|
+
this.#linkValue =
|
|
951
|
+
this.previewSrc.textContent =
|
|
952
|
+
this.videoUrlFile.value =
|
|
953
|
+
target.getAttribute('data-command') || target.src;
|
|
868
954
|
this.videoUrlFile.focus();
|
|
869
955
|
}
|
|
870
956
|
|
|
@@ -71,7 +71,10 @@ export function CreateHTML_modal({ lang, icons, plugins }, pluginOptions) {
|
|
|
71
71
|
const onlyPercentDisplay = onlyPercentage ? ' style="display: none !important;"' : '';
|
|
72
72
|
const heightDisplay = !pluginOptions.showHeightInput ? ' style="display: none !important;"' : '';
|
|
73
73
|
const ratioDisplay = !pluginOptions.showRatioOption ? ' style="display: none !important;"' : '';
|
|
74
|
-
const onlyWidthDisplay =
|
|
74
|
+
const onlyWidthDisplay =
|
|
75
|
+
!onlyPercentage && !pluginOptions.showHeightInput && !pluginOptions.showRatioOption
|
|
76
|
+
? ' style="display: none !important;"'
|
|
77
|
+
: '';
|
|
75
78
|
html += /*html*/ `
|
|
76
79
|
<div class="se-modal-form">
|
|
77
80
|
<div class="se-modal-size-text">
|
|
@@ -39,7 +39,8 @@ export class VideoSizeService {
|
|
|
39
39
|
this.#defaultSizeX = '100%';
|
|
40
40
|
this.#defaultSizeY = this.#pluginOptions.defaultRatio * 100 + '%';
|
|
41
41
|
this.#origin_w = this.#pluginOptions.defaultWidth === '100%' ? '' : this.#pluginOptions.defaultWidth;
|
|
42
|
-
this.#origin_h =
|
|
42
|
+
this.#origin_h =
|
|
43
|
+
this.#pluginOptions.defaultHeight === this.#state.defaultRatio ? '' : this.#pluginOptions.defaultHeight;
|
|
43
44
|
|
|
44
45
|
if (this.#resizing) {
|
|
45
46
|
this.#proportion = modalEl.proportion;
|
|
@@ -236,7 +237,10 @@ export class VideoSizeService {
|
|
|
236
237
|
/** @type {HTMLSelectElement} */
|
|
237
238
|
const eventTarget = dom.query.getEventTarget(e);
|
|
238
239
|
const value = eventTarget.options[eventTarget.selectedIndex].value;
|
|
239
|
-
this.#defaultSizeY =
|
|
240
|
+
this.#defaultSizeY =
|
|
241
|
+
this.#main.figure.autoRatio.current =
|
|
242
|
+
this.#frameRatio =
|
|
243
|
+
!value ? this.#defaultSizeY : Number(value) * 100 + '%';
|
|
240
244
|
this.#inputY.placeholder = !value ? '' : Number(value) * 100 + '%';
|
|
241
245
|
this.#inputY.value = '';
|
|
242
246
|
}
|
|
@@ -245,7 +249,9 @@ export class VideoSizeService {
|
|
|
245
249
|
* @description Updates the ratio based on current input values.
|
|
246
250
|
*/
|
|
247
251
|
#OnChangeRatio() {
|
|
248
|
-
this.#ratio = this.#proportion.checked
|
|
252
|
+
this.#ratio = this.#proportion.checked
|
|
253
|
+
? Figure.GetRatio(this.#inputX.value, this.#inputY.value, this.#state.sizeUnit)
|
|
254
|
+
: { w: 0, h: 0 };
|
|
249
255
|
}
|
|
250
256
|
|
|
251
257
|
/**
|
|
@@ -264,7 +270,12 @@ export class VideoSizeService {
|
|
|
264
270
|
if (xy === 'x' && this.#state.onlyPercentage && Number(eventTarget.value) > 100) {
|
|
265
271
|
eventTarget.value = '100';
|
|
266
272
|
} else if (this.#proportion.checked && !this.frameRatioOption?.value) {
|
|
267
|
-
const ratioSize = Figure.CalcRatio(
|
|
273
|
+
const ratioSize = Figure.CalcRatio(
|
|
274
|
+
this.#inputX.value,
|
|
275
|
+
this.#inputY.value,
|
|
276
|
+
this.#state.sizeUnit,
|
|
277
|
+
this.#ratio,
|
|
278
|
+
);
|
|
268
279
|
if (xy === 'x') {
|
|
269
280
|
this.#inputY.value = String(ratioSize.h);
|
|
270
281
|
} else {
|
|
@@ -29,7 +29,13 @@ export class VideoUploadService {
|
|
|
29
29
|
|
|
30
30
|
const videoUploadUrl = this.#pluginOptions.uploadUrl;
|
|
31
31
|
if (typeof videoUploadUrl === 'string' && videoUploadUrl.length > 0) {
|
|
32
|
-
this.#main.fileManager.upload(
|
|
32
|
+
this.#main.fileManager.upload(
|
|
33
|
+
videoUploadUrl,
|
|
34
|
+
this.#pluginOptions.uploadHeaders,
|
|
35
|
+
files,
|
|
36
|
+
this.#UploadCallBack.bind(this, info),
|
|
37
|
+
this.#error.bind(this),
|
|
38
|
+
);
|
|
33
39
|
}
|
|
34
40
|
}
|
|
35
41
|
|
|
@@ -43,7 +49,9 @@ export class VideoUploadService {
|
|
|
43
49
|
const videoTag = this.#main.createVideoTag();
|
|
44
50
|
|
|
45
51
|
for (let i = 0, len = fileList.length; i < len; i++) {
|
|
46
|
-
const ctag = info.isUpdate
|
|
52
|
+
const ctag = info.isUpdate
|
|
53
|
+
? info.element
|
|
54
|
+
: /** @type {HTMLIFrameElement|HTMLVideoElement} */ (videoTag.cloneNode(false));
|
|
47
55
|
this.#main.create(
|
|
48
56
|
ctag,
|
|
49
57
|
fileList[i].url,
|
|
@@ -42,11 +42,23 @@ class Anchor extends PluginPopup {
|
|
|
42
42
|
// controller
|
|
43
43
|
const controllerSelectEl = CreateHTML_controller_select(this.$);
|
|
44
44
|
this.displayId = controllerSelectEl.querySelector('.se-controller-display');
|
|
45
|
-
this.controllerSelect = new Controller(
|
|
45
|
+
this.controllerSelect = new Controller(
|
|
46
|
+
this,
|
|
47
|
+
this.$,
|
|
48
|
+
controllerSelectEl,
|
|
49
|
+
{ position: 'bottom', disabled: true },
|
|
50
|
+
Anchor.key,
|
|
51
|
+
);
|
|
46
52
|
|
|
47
53
|
const controllerEl = CreateHTML_controller(this.$);
|
|
48
54
|
this.inputEl = controllerEl.querySelector('input');
|
|
49
|
-
this.controller = new Controller(
|
|
55
|
+
this.controller = new Controller(
|
|
56
|
+
this,
|
|
57
|
+
this.$,
|
|
58
|
+
controllerEl,
|
|
59
|
+
{ position: 'bottom', disabled: true, parents: [this.controllerSelect.form], parentsHide: true },
|
|
60
|
+
Anchor.key,
|
|
61
|
+
);
|
|
50
62
|
}
|
|
51
63
|
|
|
52
64
|
/**
|
package/src/suneditor.js
CHANGED
|
@@ -100,7 +100,10 @@ export default {
|
|
|
100
100
|
const multiTargets = [];
|
|
101
101
|
if (typeof target === 'string') {
|
|
102
102
|
const t = document.querySelector(target);
|
|
103
|
-
if (!t)
|
|
103
|
+
if (!t)
|
|
104
|
+
throw Error(
|
|
105
|
+
`[SUNEDITOR.create.fail]-[document.querySelector(${target})] Cannot find target element. Make sure "${target}" is a valid selector and exists in the document.`,
|
|
106
|
+
);
|
|
104
107
|
multiTargets.push({ key: null, target: t });
|
|
105
108
|
} else if (target.nodeType === 1) {
|
|
106
109
|
multiTargets.push({ key: null, target: target });
|
|
@@ -108,7 +111,10 @@ export default {
|
|
|
108
111
|
let props;
|
|
109
112
|
for (const key in target) {
|
|
110
113
|
props = target[key];
|
|
111
|
-
if (!props.target || props.target.nodeType !== 1)
|
|
114
|
+
if (!props.target || props.target.nodeType !== 1)
|
|
115
|
+
throw Error(
|
|
116
|
+
'[SUNEDITOR.create.fail] suneditor multi root requires textarea\'s element at the "target" property.',
|
|
117
|
+
);
|
|
112
118
|
props.key = key;
|
|
113
119
|
multiTargets.push(props);
|
|
114
120
|
}
|
package/src/themes/cobalt.css
CHANGED
|
@@ -161,4 +161,16 @@
|
|
|
161
161
|
--se-show-blocks-li-color: #d539ff;
|
|
162
162
|
--se-show-blocks-pre-color: #27c022;
|
|
163
163
|
--se-show-blocks-component-color: #f4b124;
|
|
164
|
+
|
|
165
|
+
/* block handle */
|
|
166
|
+
--se-block-handle-color: var(--se-main-color-lighter);
|
|
167
|
+
--se-block-handle-btn-hover-bg: rgba(255, 255, 255, 0.08);
|
|
168
|
+
--se-block-handle-btn-active-bg: rgba(255, 255, 255, 0.14);
|
|
169
|
+
--se-block-hover-bg: rgba(255, 255, 255, 0.04);
|
|
170
|
+
--se-block-hover-outline: rgba(255, 255, 255, 0.04);
|
|
171
|
+
--se-block-drag-indicator-color: var(--se-active-dark3-color);
|
|
172
|
+
|
|
173
|
+
/* select menu interactive states */
|
|
174
|
+
--se-select-menu-hover-bg: rgba(255, 255, 255, 0.08);
|
|
175
|
+
--se-select-menu-active-bg: rgba(255, 255, 255, 0.14);
|
|
164
176
|
}
|
package/src/themes/cream.css
CHANGED
|
@@ -161,4 +161,16 @@
|
|
|
161
161
|
--se-show-blocks-li-color: #8844dd;
|
|
162
162
|
--se-show-blocks-pre-color: #1a8c3a;
|
|
163
163
|
--se-show-blocks-component-color: #e8a020;
|
|
164
|
+
|
|
165
|
+
/* block handle */
|
|
166
|
+
--se-block-handle-color: var(--se-main-color-lighter);
|
|
167
|
+
--se-block-handle-btn-hover-bg: rgba(55, 53, 47, 0.08);
|
|
168
|
+
--se-block-handle-btn-active-bg: rgba(55, 53, 47, 0.14);
|
|
169
|
+
--se-block-hover-bg: rgba(55, 53, 47, 0.04);
|
|
170
|
+
--se-block-hover-outline: rgba(55, 53, 47, 0.04);
|
|
171
|
+
--se-block-drag-indicator-color: var(--se-active-dark3-color);
|
|
172
|
+
|
|
173
|
+
/* select menu interactive states */
|
|
174
|
+
--se-select-menu-hover-bg: #eef3f9;
|
|
175
|
+
--se-select-menu-active-bg: #dde7f3;
|
|
164
176
|
}
|
package/src/themes/dark.css
CHANGED
|
@@ -162,4 +162,16 @@
|
|
|
162
162
|
--se-show-blocks-li-color: #b46cc8;
|
|
163
163
|
--se-show-blocks-pre-color: #80be5a;
|
|
164
164
|
--se-show-blocks-component-color: #cc8844;
|
|
165
|
+
|
|
166
|
+
/* block handle */
|
|
167
|
+
--se-block-handle-color: var(--se-main-color-lighter);
|
|
168
|
+
--se-block-handle-btn-hover-bg: rgba(255, 255, 255, 0.08);
|
|
169
|
+
--se-block-handle-btn-active-bg: rgba(255, 255, 255, 0.14);
|
|
170
|
+
--se-block-hover-bg: rgba(255, 255, 255, 0.04);
|
|
171
|
+
--se-block-hover-outline: rgba(255, 255, 255, 0.04);
|
|
172
|
+
--se-block-drag-indicator-color: var(--se-active-dark3-color);
|
|
173
|
+
|
|
174
|
+
/* select menu interactive states */
|
|
175
|
+
--se-select-menu-hover-bg: rgba(255, 255, 255, 0.08);
|
|
176
|
+
--se-select-menu-active-bg: rgba(255, 255, 255, 0.14);
|
|
165
177
|
}
|
package/src/themes/midnight.css
CHANGED
|
@@ -161,4 +161,16 @@
|
|
|
161
161
|
--se-show-blocks-li-color: #c084fc;
|
|
162
162
|
--se-show-blocks-pre-color: #34d399;
|
|
163
163
|
--se-show-blocks-component-color: #f0c34a;
|
|
164
|
+
|
|
165
|
+
/* block handle */
|
|
166
|
+
--se-block-handle-color: var(--se-main-color-lighter);
|
|
167
|
+
--se-block-handle-btn-hover-bg: rgba(255, 255, 255, 0.08);
|
|
168
|
+
--se-block-handle-btn-active-bg: rgba(255, 255, 255, 0.14);
|
|
169
|
+
--se-block-hover-bg: rgba(255, 255, 255, 0.04);
|
|
170
|
+
--se-block-hover-outline: rgba(255, 255, 255, 0.04);
|
|
171
|
+
--se-block-drag-indicator-color: var(--se-active-dark3-color);
|
|
172
|
+
|
|
173
|
+
/* select menu interactive states */
|
|
174
|
+
--se-select-menu-hover-bg: rgba(255, 255, 255, 0.08);
|
|
175
|
+
--se-select-menu-active-bg: rgba(255, 255, 255, 0.14);
|
|
164
176
|
}
|
package/src/typedef.js
CHANGED
|
@@ -44,6 +44,17 @@
|
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
46
|
// --------------------------------------------------------- [Component Types] ---------------------------------------------------------------------------------------------------
|
|
47
|
+
/**
|
|
48
|
+
* @typedef {Object} SunEditor.ComponentLauncher
|
|
49
|
+
* @property {(target: any) => (void | Promise<void>)} [componentDestroy] - Delete hook (invoked by the selected-component keydown handler).
|
|
50
|
+
* @property {(target: any) => (boolean | void)} [componentSelect] - Optional select hook.
|
|
51
|
+
* @property {(target: any) => void} [componentDeselect] - Optional deselect hook.
|
|
52
|
+
* @description Lightweight plugin stand-in for non-plugin components (e.g. `pageBreak`) registered
|
|
53
|
+
* via `pluginManager` component-checkers. Assigned to `component.currentPlugin` on selection, so its
|
|
54
|
+
* hook names MUST mirror the plugin component hooks — e.g. `componentDestroy`, not `destroy`.
|
|
55
|
+
* NOTE: `@property` tags must precede `@description`, or TS drops them and the excess-property check is lost.
|
|
56
|
+
*/
|
|
57
|
+
|
|
47
58
|
/**
|
|
48
59
|
* @typedef {Object} SunEditor.ComponentInfo
|
|
49
60
|
* @property {HTMLElement} target - The target element associated with the component.
|
|
@@ -54,7 +65,7 @@
|
|
|
54
65
|
* @property {?HTMLElement} inlineCover - The inline cover element, if applicable.
|
|
55
66
|
* @property {?HTMLElement} caption - The caption element, if applicable.
|
|
56
67
|
* @property {boolean} isFile - Whether the component is a file-related component.
|
|
57
|
-
* @property {?
|
|
68
|
+
* @property {?SunEditor.ComponentLauncher} launcher - Hook object for non-plugin components (e.g. `pageBreak`), if applicable.
|
|
58
69
|
* @property {boolean} isInputType - Whether the component is an input component (e.g., table).
|
|
59
70
|
*/
|
|
60
71
|
|
|
@@ -135,33 +146,33 @@
|
|
|
135
146
|
|
|
136
147
|
// component
|
|
137
148
|
/**
|
|
138
|
-
* @typedef {
|
|
139
|
-
* @typedef {
|
|
140
|
-
* @typedef {
|
|
141
|
-
* @typedef {
|
|
142
|
-
* @typedef {
|
|
149
|
+
* @typedef {import('./interfaces/contracts').EditorComponent['componentSelect']} SunEditor.Hook.Component.Select
|
|
150
|
+
* @typedef {import('./interfaces/contracts').EditorComponent['componentDeselect']} SunEditor.Hook.Component.Deselect
|
|
151
|
+
* @typedef {import('./interfaces/contracts').EditorComponent['componentEdit']} SunEditor.Hook.Component.Edit
|
|
152
|
+
* @typedef {import('./interfaces/contracts').EditorComponent['componentDestroy']} SunEditor.Hook.Component.Destroy
|
|
153
|
+
* @typedef {import('./interfaces/contracts').EditorComponent['componentCopy']} SunEditor.Hook.Component.Copy
|
|
143
154
|
*/
|
|
144
155
|
|
|
145
156
|
// Module hooks - Called by Module instances (defined in interfaces/contracts.js)
|
|
146
157
|
/**
|
|
147
|
-
* @typedef {
|
|
148
|
-
* @typedef {
|
|
149
|
-
* @typedef {
|
|
150
|
-
* @typedef {
|
|
151
|
-
* @typedef {
|
|
158
|
+
* @typedef {import('./interfaces/contracts').ModuleModal['modalAction']} SunEditor.Hook.Modal.Action
|
|
159
|
+
* @typedef {import('./interfaces/contracts').ModuleModal['modalOn']} SunEditor.Hook.Modal.On
|
|
160
|
+
* @typedef {import('./interfaces/contracts').ModuleModal['modalInit']} SunEditor.Hook.Modal.Init
|
|
161
|
+
* @typedef {import('./interfaces/contracts').ModuleModal['modalOff']} SunEditor.Hook.Modal.Off
|
|
162
|
+
* @typedef {import('./interfaces/contracts').ModuleModal['modalResize']} SunEditor.Hook.Modal.Resize
|
|
152
163
|
*
|
|
153
|
-
* @typedef {
|
|
154
|
-
* @typedef {
|
|
155
|
-
* @typedef {
|
|
164
|
+
* @typedef {import('./interfaces/contracts').ModuleController['controllerAction']} SunEditor.Hook.Controller.Action
|
|
165
|
+
* @typedef {import('./interfaces/contracts').ModuleController['controllerOn']} SunEditor.Hook.Controller.On
|
|
166
|
+
* @typedef {import('./interfaces/contracts').ModuleController['controllerClose']} SunEditor.Hook.Controller.Close
|
|
156
167
|
*
|
|
157
|
-
* @typedef {
|
|
168
|
+
* @typedef {import('./interfaces/contracts').ModuleBrowser['browserInit']} SunEditor.Hook.Browser.Init
|
|
158
169
|
*
|
|
159
|
-
* @typedef {
|
|
160
|
-
* @typedef {
|
|
161
|
-
* @typedef {
|
|
170
|
+
* @typedef {import('./interfaces/contracts').ModuleColorPicker['colorPickerAction']} SunEditor.Hook.ColorPicker.Action
|
|
171
|
+
* @typedef {import('./interfaces/contracts').ModuleColorPicker['colorPickerHueSliderOpen']} SunEditor.Hook.ColorPicker.HueSliderOpen
|
|
172
|
+
* @typedef {import('./interfaces/contracts').ModuleColorPicker['colorPickerHueSliderClose']} SunEditor.Hook.ColorPicker.HueSliderClose
|
|
162
173
|
*
|
|
163
|
-
* @typedef {
|
|
164
|
-
* @typedef {
|
|
174
|
+
* @typedef {import('./interfaces/contracts').ModuleHueSlider['hueSliderAction']} SunEditor.Hook.HueSlider.Action
|
|
175
|
+
* @typedef {import('./interfaces/contracts').ModuleHueSlider['hueSliderCancelAction']} SunEditor.Hook.HueSlider.CancelAction
|
|
165
176
|
*/
|
|
166
177
|
|
|
167
178
|
// --------------------------------------------------------- [Plugin Hook parameter types] ---------------------------------------------------------------------------------------------------
|
|
@@ -268,7 +279,7 @@
|
|
|
268
279
|
* @typedef {"bold"|"underline"|"italic"|"strike"|"subscript"|"superscript"|"removeFormat"|"copyFormat"|"indent"|"outdent"|"fullScreen"|"showBlocks"|"codeView"|"markdownView"|"undo"|"redo"|"preview"|"print"|"copy"|"dir"|"dir_ltr"|"dir_rtl"|"finder"|"save"|"newDocument"|"selectAll"|"pageBreak"|"pageUp"|"pageDown"|"pageNavigator"} SunEditor.UI.ButtonCommand
|
|
269
280
|
*
|
|
270
281
|
* Plugin buttons available in the toolbar
|
|
271
|
-
* @typedef {"blockquote"|"codeBlock"|"exportPDF"|"fileUpload"|"list_bulleted"|"list_numbered"|"autocomplete"|"align"|"font"|"fontColor"|"backgroundColor"|"list"|"table"|"blockStyle"|"hr"|"layout"|"lineHeight"|"template"|"paragraphStyle"|"textStyle"|"link"|"image"|"video"|"audio"|"embed"|"math"|"drawing"|"imageGallery"|"videoGallery"|"audioGallery"|"fileGallery"|"fileBrowser"|"fontSize"|"pageNavigator"|"anchor"} SunEditor.UI.ButtonPlugin
|
|
282
|
+
* @typedef {"blockquote"|"codeBlock"|"exportPDF"|"fileUpload"|"list_bulleted"|"list_numbered"|"autocomplete"|"slashCommand"|"align"|"font"|"fontColor"|"backgroundColor"|"list"|"table"|"blockStyle"|"hr"|"layout"|"lineHeight"|"template"|"paragraphStyle"|"textStyle"|"link"|"image"|"video"|"audio"|"embed"|"math"|"drawing"|"imageGallery"|"videoGallery"|"audioGallery"|"fileGallery"|"fileBrowser"|"fontSize"|"pageNavigator"|"anchor"} SunEditor.UI.ButtonPlugin
|
|
272
283
|
*
|
|
273
284
|
* Single button item in the toolbar (includes special controls and custom strings)
|
|
274
285
|
* @typedef {SunEditor.UI.ButtonCommand|SunEditor.UI.ButtonPlugin|SunEditor.UI.ButtonSpecial|string} SunEditor.UI.ButtonItem
|
|
@@ -109,6 +109,7 @@ declare namespace _default {
|
|
|
109
109
|
export let download: string;
|
|
110
110
|
export let dir_ltr: string;
|
|
111
111
|
export let dir_rtl: string;
|
|
112
|
+
export let dragHandle: string;
|
|
112
113
|
export let file_upload: string;
|
|
113
114
|
export let file_thumbnail: string;
|
|
114
115
|
export let file_plus: string;
|
|
@@ -76,7 +76,13 @@ export default class ContextProvider {
|
|
|
76
76
|
* @description Execute a function by traversing all root targets.
|
|
77
77
|
* @param {(frameContext: SunEditor.FrameContext, rootKey: string|null, frameRoots: Map<string|null, SunEditor.FrameContext>) => void} f Callback function
|
|
78
78
|
*/
|
|
79
|
-
applyToRoots(
|
|
79
|
+
applyToRoots(
|
|
80
|
+
f: (
|
|
81
|
+
frameContext: SunEditor.FrameContext,
|
|
82
|
+
rootKey: string | null,
|
|
83
|
+
frameRoots: Map<string | null, SunEditor.FrameContext>,
|
|
84
|
+
) => void,
|
|
85
|
+
): void;
|
|
80
86
|
_destroy(): void;
|
|
81
87
|
#private;
|
|
82
88
|
}
|