suneditor 3.0.0-beta.21 → 3.0.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/CONTRIBUTING.md +4 -6
  2. package/README.md +29 -12
  3. package/dist/suneditor.min.js +1 -1
  4. package/package.json +11 -11
  5. package/src/core/base/eventHandlers/handler_ww_key_input.js +1 -1
  6. package/src/core/base/eventManager.js +4 -4
  7. package/src/core/class/component.js +112 -32
  8. package/src/core/class/format.js +37 -48
  9. package/src/core/class/html.js +8 -8
  10. package/src/core/class/menu.js +2 -2
  11. package/src/core/class/nodeTransform.js +7 -10
  12. package/src/core/class/offset.js +3 -3
  13. package/src/core/class/selection.js +3 -1
  14. package/src/core/class/ui.js +3 -3
  15. package/src/core/config/options.js +8 -2
  16. package/src/core/editor.js +2 -2
  17. package/src/core/section/actives.js +3 -3
  18. package/src/core/section/constructor.js +4 -4
  19. package/src/helper/clipboard.js +22 -7
  20. package/src/helper/dom/domQuery.js +8 -16
  21. package/src/helper/dom/domUtils.js +3 -10
  22. package/src/modules/ApiManager.js +10 -10
  23. package/src/modules/Browser.js +3 -6
  24. package/src/modules/ColorPicker.js +1 -1
  25. package/src/modules/Controller.js +2 -2
  26. package/src/modules/Figure.js +46 -28
  27. package/src/modules/FileManager.js +4 -6
  28. package/src/modules/HueSlider.js +7 -9
  29. package/src/modules/Modal.js +4 -4
  30. package/src/modules/SelectMenu.js +5 -6
  31. package/src/plugins/browser/audioGallery.js +9 -5
  32. package/src/plugins/browser/fileBrowser.js +10 -6
  33. package/src/plugins/browser/fileGallery.js +9 -5
  34. package/src/plugins/browser/imageGallery.js +8 -4
  35. package/src/plugins/browser/videoGallery.js +9 -5
  36. package/src/plugins/command/exportPDF.js +7 -3
  37. package/src/plugins/command/fileUpload.js +23 -13
  38. package/src/plugins/dropdown/align.js +6 -2
  39. package/src/plugins/dropdown/backgroundColor.js +8 -4
  40. package/src/plugins/dropdown/font.js +6 -4
  41. package/src/plugins/dropdown/fontColor.js +8 -4
  42. package/src/plugins/dropdown/formatBlock.js +6 -2
  43. package/src/plugins/dropdown/hr.js +7 -3
  44. package/src/plugins/dropdown/layout.js +6 -2
  45. package/src/plugins/dropdown/lineHeight.js +6 -2
  46. package/src/plugins/dropdown/paragraphStyle.js +15 -11
  47. package/src/plugins/dropdown/table.js +24 -20
  48. package/src/plugins/dropdown/template.js +6 -2
  49. package/src/plugins/dropdown/textStyle.js +6 -2
  50. package/src/plugins/field/mention.js +14 -10
  51. package/src/plugins/input/fontSize.js +12 -8
  52. package/src/plugins/modal/audio.js +10 -4
  53. package/src/plugins/modal/drawing.js +2 -2
  54. package/src/plugins/modal/embed.js +23 -32
  55. package/src/plugins/modal/image.js +36 -36
  56. package/src/plugins/modal/math.js +2 -2
  57. package/src/plugins/modal/video.js +25 -39
  58. package/src/plugins/popup/anchor.js +6 -5
  59. package/src/typedef.js +11 -0
  60. package/types/core/class/component.d.ts +28 -4
  61. package/types/core/class/format.d.ts +6 -6
  62. package/types/core/class/menu.d.ts +2 -2
  63. package/types/core/class/ui.d.ts +1 -1
  64. package/types/core/config/options.d.ts +15 -3
  65. package/types/modules/Browser.d.ts +1 -1
  66. package/types/modules/Controller.d.ts +2 -2
  67. package/types/modules/Figure.d.ts +3 -4
  68. package/types/modules/Modal.d.ts +3 -3
  69. package/types/modules/SelectMenu.d.ts +2 -2
  70. package/types/plugins/browser/audioGallery.d.ts +29 -18
  71. package/types/plugins/browser/fileBrowser.d.ts +38 -27
  72. package/types/plugins/browser/fileGallery.d.ts +29 -18
  73. package/types/plugins/browser/imageGallery.d.ts +24 -16
  74. package/types/plugins/browser/videoGallery.d.ts +29 -18
  75. package/types/plugins/command/exportPDF.d.ts +17 -10
  76. package/types/plugins/command/fileUpload.d.ts +64 -27
  77. package/types/plugins/dropdown/align.d.ts +12 -8
  78. package/types/plugins/dropdown/backgroundColor.d.ts +28 -18
  79. package/types/plugins/dropdown/font.d.ts +12 -12
  80. package/types/plugins/dropdown/fontColor.d.ts +28 -18
  81. package/types/plugins/dropdown/formatBlock.d.ts +12 -8
  82. package/types/plugins/dropdown/hr.d.ts +15 -11
  83. package/types/plugins/dropdown/layout.d.ts +15 -11
  84. package/types/plugins/dropdown/lineHeight.d.ts +15 -11
  85. package/types/plugins/dropdown/paragraphStyle.d.ts +31 -27
  86. package/types/plugins/dropdown/table.d.ts +28 -15
  87. package/types/plugins/dropdown/template.d.ts +15 -11
  88. package/types/plugins/dropdown/textStyle.d.ts +19 -11
  89. package/types/plugins/field/mention.d.ts +58 -34
  90. package/types/plugins/input/fontSize.d.ts +44 -26
  91. package/types/plugins/modal/audio.d.ts +14 -0
  92. package/types/plugins/modal/embed.d.ts +15 -0
  93. package/types/plugins/modal/image.d.ts +20 -0
  94. package/types/plugins/modal/video.d.ts +15 -0
  95. package/types/typedef.d.ts +1 -0
@@ -37,6 +37,11 @@ const { NO_EVENT } = env;
37
37
  * @property {Array<RegExp>} [urlPatterns] - Additional URL patterns for video embedding.
38
38
  * @property {Array<string>} [extensions] - Additional file extensions to be recognized for video uploads.
39
39
  * @property {FigureControls_video} [controls] - Figure controls.
40
+ * @property {__se__ComponentInsertBehaviorType} [insertBehavior] - Component insertion behavior for selection and cursor placement. [default: options.get('componentInsertBehavior')]
41
+ * - `auto`: Move cursor to the next line if possible, otherwise select the component.
42
+ * - `select`: Always select the inserted component.
43
+ * - `line`: Move cursor to the next line if possible, or create a new line and move there.
44
+ * - `none`: Do nothing.
40
45
  */
41
46
 
42
47
  /**
@@ -95,7 +100,8 @@ class Video extends EditorInjector {
95
100
  videoTagAttributes: pluginOptions.videoTagAttributes || null,
96
101
  iframeTagAttributes: pluginOptions.iframeTagAttributes || null,
97
102
  query_youtube: pluginOptions.query_youtube || '',
98
- query_vimeo: pluginOptions.query_vimeo || ''
103
+ query_vimeo: pluginOptions.query_vimeo || '',
104
+ insertBehavior: pluginOptions.insertBehavior
99
105
  };
100
106
 
101
107
  // create HTML
@@ -314,7 +320,7 @@ class Video extends EditorInjector {
314
320
  const figureInfo = Figure.GetContainer(element);
315
321
  if (figureInfo && figureInfo.container && figureInfo.cover) return;
316
322
 
317
- this._ready(element);
323
+ this._ready(element, true);
318
324
  const line = this.format.getLine(element);
319
325
  if (line) this._align = line.style.textAlign || line.style.float;
320
326
 
@@ -364,10 +370,11 @@ class Video extends EditorInjector {
364
370
  * - Ensures that the controller is properly positioned and initialized.
365
371
  * - Prevents duplicate event handling if the component is already selected.
366
372
  * @param {HTMLIFrameElement|HTMLVideoElement} target - The selected element.
373
+ * @param {boolean} [infoOnly=false] - If true, only retrieves information without opening the controller.
367
374
  */
368
- _ready(target) {
375
+ _ready(target, infoOnly = false) {
369
376
  if (!target) return;
370
- const figureInfo = this.figure.open(target, { nonResizing: this._nonResizing, nonSizeInfo: false, nonBorder: false, figureTarget: false, __fileManagerInfo: false });
377
+ const figureInfo = this.figure.open(target, { nonResizing: this._nonResizing, nonSizeInfo: false, nonBorder: false, figureTarget: false, infoOnly });
371
378
 
372
379
  this._element = target;
373
380
  this._cover = figureInfo.cover;
@@ -574,10 +581,11 @@ class Video extends EditorInjector {
574
581
  this._element = oFrame;
575
582
  this._cover = cover;
576
583
  this._container = container;
577
- this.figure.open(oFrame, { nonResizing: this._nonResizing, nonSizeInfo: false, nonBorder: false, figureTarget: false, __fileManagerInfo: true });
584
+ this.figure.open(oFrame, { nonResizing: this._nonResizing, nonSizeInfo: false, nonBorder: false, figureTarget: false, infoOnly: true });
585
+
586
+ width ||= this._defaultSizeX;
587
+ height ||= this._frameRatio;
578
588
 
579
- width = width || this._defaultSizeX;
580
- height = height || this._frameRatio;
581
589
  const size = this.figure.getSize(oFrame);
582
590
  const inputUpdate = size.w !== width || size.h !== height;
583
591
  const changeSize = !isUpdate || inputUpdate;
@@ -596,11 +604,7 @@ class Video extends EditorInjector {
596
604
  this.fileManager.setFileData(oFrame, file);
597
605
 
598
606
  if (!isUpdate) {
599
- this.component.insert(container, { skipCharCount: false, skipSelection: true, skipHistory: false });
600
- if (!this.options.get('componentAutoSelect')) {
601
- const line = this.format.addLine(container, null);
602
- if (line) this.selection.setRange(line, 0, line, 0);
603
- }
607
+ this.component.insert(container, { insertBehavior: this.pluginOptions.insertBehavior });
604
608
  return;
605
609
  }
606
610
 
@@ -651,8 +655,9 @@ class Video extends EditorInjector {
651
655
  * @param {string|number} h - The height of the video.
652
656
  */
653
657
  _applySize(w, h) {
654
- if (!w) w = this.inputX?.value || this.pluginOptions.defaultWidth;
655
- if (!h) h = this.inputY?.value || this.pluginOptions.defaultHeight;
658
+ w ||= this.inputX?.value || this.pluginOptions.defaultWidth;
659
+ h ||= this.inputY?.value || this.pluginOptions.defaultHeight;
660
+
656
661
  if (this._onlyPercentage) {
657
662
  if (!w) w = '100%';
658
663
  else if (/%$/.test(w + '')) w += '%';
@@ -751,8 +756,7 @@ class Video extends EditorInjector {
751
756
  * @returns {Promise<boolean>} If return false, the file upload will be canceled
752
757
  */
753
758
  async submitURL(url) {
754
- if (!url) url = this._linkValue;
755
- if (!url) return false;
759
+ if (!(url = this._linkValue)) return false;
756
760
 
757
761
  /** iframe source */
758
762
  if (/^<iframe.*\/iframe>$/.test(url)) {
@@ -802,23 +806,22 @@ class Video extends EditorInjector {
802
806
  this._setIframeAttrs(/** @type {HTMLIFrameElement} */ (oFrame));
803
807
  }
804
808
 
805
- let existElement = this.format.isBlock(oFrame.parentNode) || dom.check.isWysiwygFrame(oFrame.parentNode) ? oFrame : this.format.getLine(oFrame) || oFrame;
806
-
807
809
  const prevFrame = oFrame;
808
810
  const cloneFrame = /** @type {HTMLIFrameElement|HTMLVideoElement} */ (oFrame.cloneNode(true));
809
811
  const figure = Figure.CreateContainer(cloneFrame, 'se-video-container');
810
812
  const container = figure.container;
811
813
 
812
- const figcaption = existElement.querySelector('figcaption');
814
+ const figcaption = Figure.GetContainer(prevFrame)?.container.querySelector('figcaption');
813
815
  let caption = null;
814
816
  if (figcaption) {
815
- caption = dom.utils.createElement('DIV');
817
+ caption = dom.utils.createElement('figcaption');
816
818
  caption.innerHTML = figcaption.innerHTML;
817
819
  dom.utils.removeItem(figcaption);
820
+ figure.cover.appendChild(caption);
818
821
  }
819
822
 
820
823
  // size
821
- this.figure.open(cloneFrame, { nonResizing: this._nonResizing, nonSizeInfo: false, nonBorder: false, figureTarget: false, __fileManagerInfo: true });
824
+ this.figure.open(cloneFrame, { nonResizing: this._nonResizing, nonSizeInfo: false, nonBorder: false, figureTarget: false, infoOnly: true });
822
825
  const size = (cloneFrame.getAttribute('data-se-size') || ',').split(',');
823
826
 
824
827
  const width = size[0] || prevFrame.style.width || prevFrame.width || '';
@@ -830,24 +833,7 @@ class Video extends EditorInjector {
830
833
  if (format) this._align = format.style.textAlign || format.style.float;
831
834
  this.figure.setAlign(cloneFrame, this._align);
832
835
 
833
- if (dom.query.getParentElement(prevFrame, dom.check.isExcludeFormat)) {
834
- prevFrame.replaceWith(container);
835
- } else if (dom.check.isListCell(existElement)) {
836
- const refer = dom.query.getParentElement(prevFrame, (current) => current.parentNode === existElement);
837
- existElement.insertBefore(container, refer);
838
- dom.utils.removeItem(prevFrame);
839
- this.nodeTransform.removeEmptyNode(refer, null, true);
840
- } else if (this.format.isLine(existElement)) {
841
- const refer = dom.query.getParentElement(prevFrame, (current) => current.parentNode === existElement);
842
- existElement = this.nodeTransform.split(existElement, refer);
843
- existElement.parentNode.insertBefore(container, existElement);
844
- dom.utils.removeItem(prevFrame);
845
- this.nodeTransform.removeEmptyNode(existElement, null, true);
846
- } else {
847
- /** @type {Element} */ (existElement).replaceWith(container);
848
- }
849
-
850
- if (caption) existElement.parentNode.insertBefore(caption, container.nextElementSibling);
836
+ this.figure.retainFigureFormat(container, this._element, null, this.fileManager);
851
837
 
852
838
  return cloneFrame;
853
839
  }
@@ -91,6 +91,8 @@ class Anchor extends EditorInjector {
91
91
 
92
92
  switch (command) {
93
93
  case 'submit': {
94
+ this.controller.close();
95
+
94
96
  if (!currentElement) {
95
97
  const id = this.inputEl.value.trim();
96
98
  if (!id) {
@@ -106,7 +108,7 @@ class Anchor extends EditorInjector {
106
108
  class: 'se-component se-inline-component'
107
109
  });
108
110
 
109
- this.component.insert(a, { skipCharCount: false, skipSelection: true, skipHistory: false });
111
+ this.component.insert(a, { insertBehavior: 'none', scrollTo: false });
110
112
 
111
113
  const r = this.selection.getNearRange(a);
112
114
  if (r) {
@@ -114,15 +116,13 @@ class Anchor extends EditorInjector {
114
116
  } else {
115
117
  this.component.select(a, Anchor.key);
116
118
  }
119
+
117
120
  this._init();
118
121
  } else {
119
- this.controller.close();
120
122
  currentElement.id = this.inputEl.value;
121
- this.select(currentElement);
123
+ this.component.select(currentElement, Anchor.key);
122
124
  }
123
125
 
124
- this.controller.close();
125
-
126
126
  break;
127
127
  }
128
128
  case 'cancel': {
@@ -142,6 +142,7 @@ class Anchor extends EditorInjector {
142
142
  this.inputEl.value = this.displayId.textContent;
143
143
  this.controllerSelect.hide();
144
144
  this.controller.open(currentElement);
145
+ this.inputEl.focus();
145
146
 
146
147
  break;
147
148
  }
package/src/typedef.js CHANGED
@@ -50,6 +50,17 @@
50
50
  * @property {boolean} _onMousedown Mouse down event status
51
51
  */
52
52
 
53
+ /**
54
+ * @typedef {"auto"|"select"|"line"|"none"} __se__ComponentInsertBehaviorType
55
+ * @description Component insertion behavior for selection and cursor placement.
56
+ * - For inline components: places the cursor near the inserted component or selects it if no nearby range is available.
57
+ * - For block components: executes behavior based on `selectMode`:
58
+ * - `auto`: Move cursor to the next line if possible, otherwise select the component.
59
+ * - `select`: Always select the inserted component.
60
+ * - `line`: Move cursor to the next line if possible, or create a new line and move there.
61
+ * - `none`: Do nothing.
62
+ */
63
+
53
64
  // --------------------------------------------------------- [Event] ---------------------------------------------------------------------------------------------------
54
65
  /**
55
66
  * @typedef {Object} __se__EventInfo
@@ -73,8 +73,10 @@ declare class Component {
73
73
  * @param {Node} element Element to be inserted
74
74
  * @param {Object} [options] Options
75
75
  * @param {boolean} [options.skipCharCount=false] If true, it will be inserted even if "frameOptions.get('charCounter_max')" is exceeded.
76
- * @param {boolean} [options.skipSelection=false] If true, do not automatically select the inserted component.
77
76
  * @param {boolean} [options.skipHistory=false] If true, do not push to history.
77
+ * @param {boolean} [options.scrollTo=true] true : Scroll to the inserted element, false : Do not scroll.
78
+ * @param {?__se__ComponentInsertBehaviorType} [options.insertBehavior] If true, do not automatically select the inserted component. [default: options.get('componentInsertBehavior')]
79
+ * - If null, noting action is performed after insertion.
78
80
  * @returns {HTMLElement} The inserted element or new line (for HR)
79
81
  */
80
82
  insert(
@@ -82,14 +84,24 @@ declare class Component {
82
84
  element: Node,
83
85
  {
84
86
  skipCharCount,
85
- skipSelection,
86
- skipHistory
87
+ skipHistory,
88
+ scrollTo,
89
+ insertBehavior
87
90
  }?: {
88
91
  skipCharCount?: boolean;
89
- skipSelection?: boolean;
90
92
  skipHistory?: boolean;
93
+ scrollTo?: boolean;
94
+ insertBehavior?: __se__ComponentInsertBehaviorType | null;
91
95
  }
92
96
  ): HTMLElement;
97
+ /**
98
+ * @this {ComponentThis}
99
+ * @description Handles post-insertion behavior for a newly created component based on the specified mode.
100
+ * @param {Node} element The inserted component element.
101
+ * @param {Node|null} [oNode] Optional node to use for selection if the component cannot be selected.
102
+ * @param {__se__ComponentInsertBehaviorType} [insertBehavior] Behavior mode after component insertion.
103
+ */
104
+ applyInsertBehavior(this: Omit<Component & Partial<import('../../editorInjector').default>, 'component'>, element: Node, oNode?: Node | null, insertBehavior?: __se__ComponentInsertBehaviorType): void;
93
105
  /**
94
106
  * @this {ComponentThis}
95
107
  * @description Gets the file component and that plugin name
@@ -171,6 +183,18 @@ declare class Component {
171
183
  * - This method resets the selection state and hides UI elements related to the component selection.
172
184
  */
173
185
  __deselect(this: Omit<Component & Partial<import('../../editorInjector').default>, 'component'>): void;
186
+ /**
187
+ * @private
188
+ * @this {ComponentThis}
189
+ * @description
190
+ * Attempts to move the cursor to a valid line after the given container.
191
+ * - If a valid next sibling line exists, moves the selection there.
192
+ * - If no next sibling exists, creates a new line after the container and moves the selection there.
193
+ * - If the next sibling exists but is not a valid line element and cannot create a new line, returns false.
194
+ * @param {HTMLElement} container The component container element.
195
+ * @returns {boolean} Returns true if the selection moved to a line (existing or newly created), otherwise false.
196
+ */
197
+ __moveToNextLineOrAdd(this: Omit<Component & Partial<import('../../editorInjector').default>, 'component'>, container: HTMLElement): boolean;
174
198
  /**
175
199
  * @private
176
200
  * @this {ComponentThis}
@@ -433,17 +433,17 @@ declare class Format {
433
433
  * @private
434
434
  * @this {FormatThis}
435
435
  * @description Nest list cells or cancel nested cells.
436
- * @param selectedCells List cells.
437
- * @param nested Nested or cancel nested.
436
+ * @param {Array<HTMLElement>} selectedCells List cells.
437
+ * @param {boolean} nested Nested or cancel nested.
438
438
  */
439
439
  _applyNestedList(
440
440
  this: Omit<Format & Partial<import('../../editorInjector').default>, 'format'>,
441
- selectedCells: any,
442
- nested: any
441
+ selectedCells: Array<HTMLElement>,
442
+ nested: boolean
443
443
  ): {
444
- sc: any;
444
+ sc: Node;
445
445
  so: number;
446
- ec: any;
446
+ ec: Node;
447
447
  eo: number;
448
448
  };
449
449
  /**
@@ -42,9 +42,9 @@ declare class Menu {
42
42
  mousemove: any;
43
43
  mouseout: any;
44
44
  };
45
- _bindClose_dropdown_mouse: any;
45
+ _bindClose_dropdown_mouse: __se__GlobalEventInfo;
46
46
  _bindClose_dropdown_key: any;
47
- _bindClose_cons_mouse: any;
47
+ _bindClose_cons_mouse: __se__GlobalEventInfo;
48
48
  currentDropdownPlugin: any;
49
49
  __menuBtn: Node;
50
50
  __menuContainer: HTMLElement;
@@ -30,7 +30,7 @@ declare class UI {
30
30
  _alertInner: HTMLElement;
31
31
  _closeListener: any[];
32
32
  _closeSignal: boolean;
33
- _bindClose: any;
33
+ _bindClose: __se__GlobalEventInfo;
34
34
  _backWrapper: HTMLElement;
35
35
  toastPopup: HTMLElement;
36
36
  toastContainer: Element;
@@ -383,7 +383,13 @@ export namespace DEFAULTS {
383
383
  * @property {number} [fullScreenOffset=0] - Offset applied when entering fullscreen mode.
384
384
  * @property {string} [previewTemplate=null] - Custom template for preview mode.
385
385
  * @property {string} [printTemplate=null] - Custom template for print mode.
386
- * @property {boolean} [componentAutoSelect=false] - Enables automatic selection of inserted components.
386
+ * @property {__se__ComponentInsertBehaviorType} [componentInsertBehavior="auto"] - Enables automatic selection of inserted components.
387
+ * - For inline components: places the cursor near the inserted component or selects it if no nearby range is available.
388
+ * - For block components: executes behavior based on `selectMode`:
389
+ * - `auto`: Move cursor to the next line if possible, otherwise select the component.
390
+ * - `select`: Always select the inserted component.
391
+ * - `line`: Move cursor to the next line if possible, or create a new line and move there.
392
+ * - `none`: Do nothing.
387
393
  * @property {string} [defaultUrlProtocol=null] - Default URL protocol for links.
388
394
  * @property {Object<"copy", number>} [toastMessageTime={copy: 1500}] - {"copy": 1500} - Duration for displaying toast messages.
389
395
  * @property {string} [freeCodeViewMode=false] - Enables free code view mode.
@@ -984,8 +990,14 @@ export type EditorBaseOptions = {
984
990
  printTemplate?: string;
985
991
  /**
986
992
  * - Enables automatic selection of inserted components.
987
- */
988
- componentAutoSelect?: boolean;
993
+ * - For inline components: places the cursor near the inserted component or selects it if no nearby range is available.
994
+ * - For block components: executes behavior based on `selectMode`:
995
+ * - `auto`: Move cursor to the next line if possible, otherwise select the component.
996
+ * - `select`: Always select the inserted component.
997
+ * - `line`: Move cursor to the next line if possible, or create a new line and move there.
998
+ * - `none`: Do nothing.
999
+ */
1000
+ componentInsertBehavior?: __se__ComponentInsertBehaviorType;
989
1001
  /**
990
1002
  * - Default URL protocol for links.
991
1003
  */
@@ -228,7 +228,7 @@ declare class Browser extends CoreInjector {
228
228
  keyword: string;
229
229
  sideInner: HTMLElement;
230
230
  _closeSignal: boolean;
231
- _bindClose: any;
231
+ _bindClose: __se__GlobalEventInfo;
232
232
  __globalEventHandler: (e: any) => void;
233
233
  apiManager: ApiManager;
234
234
  sideOpenBtn: HTMLButtonElement;
@@ -133,8 +133,8 @@ declare class Controller extends EditorInjector {
133
133
  keydown: any;
134
134
  mousedown: any;
135
135
  };
136
- _bindClose_key: any;
137
- _bindClose_mouse: any;
136
+ _bindClose_key: __se__GlobalEventInfo;
137
+ _bindClose_mouse: __se__GlobalEventInfo;
138
138
  /** @type {{left?: number, top?: number, addOfffset?: {left?: number, top?: number}}} */
139
139
  __offset: {
140
140
  left?: number;
@@ -302,7 +302,6 @@ declare class Figure extends EditorInjector {
302
302
  __onContainerEvent: any;
303
303
  __offContainerEvent: any;
304
304
  __onResizeESCEvent: __se__GlobalEventInfo;
305
- __fileManagerInfo: boolean;
306
305
  /**
307
306
  * @description Close the figure's controller
308
307
  */
@@ -315,7 +314,7 @@ declare class Figure extends EditorInjector {
315
314
  * @param {boolean} [params.nonSizeInfo=false] Do not display the size information
316
315
  * @param {boolean} [params.nonBorder=false] Do not display the selected style line
317
316
  * @param {boolean} [params.figureTarget=false] If true, the target is a figure element
318
- * @param {boolean} [params.__fileManagerInfo=false] If true, the file manager is called
317
+ * @param {boolean} [params.infoOnly=false] If true, returns only the figure target info without opening the controller
319
318
  * @returns {FigureTargetInfo|undefined} figure target info
320
319
  */
321
320
  open(
@@ -325,13 +324,13 @@ declare class Figure extends EditorInjector {
325
324
  nonSizeInfo,
326
325
  nonBorder,
327
326
  figureTarget,
328
- __fileManagerInfo
327
+ infoOnly
329
328
  }: {
330
329
  nonResizing?: boolean;
331
330
  nonSizeInfo?: boolean;
332
331
  nonBorder?: boolean;
333
332
  figureTarget?: boolean;
334
- __fileManagerInfo?: boolean;
333
+ infoOnly?: boolean;
335
334
  }
336
335
  ): FigureTargetInfo | undefined;
337
336
  /**
@@ -58,7 +58,7 @@ declare class Modal extends CoreInjector {
58
58
  /** @type {HTMLElement} */
59
59
  _modalInner: HTMLElement;
60
60
  _closeListener: any[];
61
- _bindClose: any;
61
+ _bindClose: __se__GlobalEventInfo;
62
62
  _onClickEvent: any;
63
63
  _closeSignal: boolean;
64
64
  /** @type {HTMLElement} */
@@ -71,8 +71,8 @@ declare class Modal extends CoreInjector {
71
71
  mousemove: any;
72
72
  mouseup: any;
73
73
  };
74
- _bindClose_mousemove: any;
75
- _bindClose_mouseup: any;
74
+ _bindClose_mousemove: __se__GlobalEventInfo;
75
+ _bindClose_mouseup: __se__GlobalEventInfo;
76
76
  /**
77
77
  * @description Open a modal plugin
78
78
  * - The plugin's "init" method is called.
@@ -68,8 +68,8 @@ declare class SelectMenu extends CoreInjector {
68
68
  _refer: HTMLElement;
69
69
  _keydownTarget: any;
70
70
  _selectMethod: (command: string) => void;
71
- _bindClose_key: any;
72
- _bindClose_mousedown: any;
71
+ _bindClose_key: __se__GlobalEventInfo;
72
+ _bindClose_mousedown: __se__GlobalEventInfo;
73
73
  _bindClose_click: any;
74
74
  _closeSignal: boolean;
75
75
  __events: {
@@ -1,8 +1,35 @@
1
1
  export default AudioGallery;
2
2
  export type BrowserFile_audioGallery = import('../../modules/Browser').BrowserFile;
3
+ export type AudioGalleryPluginOptions = {
4
+ /**
5
+ * - Direct data without server calls
6
+ */
7
+ data?: Array<BrowserFile_audioGallery>;
8
+ /**
9
+ * - Server request URL
10
+ */
11
+ url?: string;
12
+ /**
13
+ * - Server request headers
14
+ */
15
+ headers?: {
16
+ [x: string]: string;
17
+ };
18
+ /**
19
+ * - Default thumbnail
20
+ */
21
+ thumbnail?: string | ((item: BrowserFile_audioGallery) => string);
22
+ };
3
23
  /**
4
24
  * @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_audioGallery
5
25
  */
26
+ /**
27
+ * @typedef {Object} AudioGalleryPluginOptions
28
+ * @property {Array<BrowserFile_audioGallery>} [data] - Direct data without server calls
29
+ * @property {string} [url] - Server request URL
30
+ * @property {Object<string, string>} [headers] - Server request headers
31
+ * @property {string|((item: BrowserFile_audioGallery) => string)} [thumbnail] - Default thumbnail
32
+ */
6
33
  /**
7
34
  * @class
8
35
  * @extends EditorInjector
@@ -15,25 +42,9 @@ declare class AudioGallery extends EditorInjector {
15
42
  /**
16
43
  * @constructor
17
44
  * @param {__se__EditorCore} editor - The root editor instance
18
- * @param {Object} pluginOptions
19
- * @param {Array<*>=} pluginOptions.data - direct data without server calls
20
- * @param {string} pluginOptions.url - server request url
21
- * @param {Object<string, string>=} pluginOptions.headers - server request headers
22
- * @param {string|((item: BrowserFile_audioGallery) => string)} pluginOptions.thumbnail - default thumbnail
45
+ * @param {AudioGalleryPluginOptions} pluginOptions
23
46
  */
24
- constructor(
25
- editor: __se__EditorCore,
26
- pluginOptions: {
27
- data?: Array<any> | undefined;
28
- url: string;
29
- headers?:
30
- | {
31
- [x: string]: string;
32
- }
33
- | undefined;
34
- thumbnail: string | ((item: BrowserFile_audioGallery) => string);
35
- }
36
- );
47
+ constructor(editor: __se__EditorCore, pluginOptions: AudioGalleryPluginOptions);
37
48
  title: any;
38
49
  icon: string;
39
50
  onSelectfunction: (targe: Node) => any;
@@ -1,8 +1,44 @@
1
1
  export default FileBrowser;
2
2
  export type BrowserFile_fileBrowser = import('../../modules/Browser').BrowserFile;
3
+ export type FileBrowserPluginOptions = {
4
+ /**
5
+ * - Direct data without server calls
6
+ */
7
+ data?:
8
+ | {
9
+ [x: string]: any;
10
+ }
11
+ | Array<any>;
12
+ /**
13
+ * - Server request URL
14
+ */
15
+ url?: string;
16
+ /**
17
+ * - Server request headers
18
+ */
19
+ headers?: {
20
+ [x: string]: string;
21
+ };
22
+ /**
23
+ * - Default thumbnail
24
+ */
25
+ thumbnail?: string | ((item: BrowserFile_fileBrowser) => string);
26
+ /**
27
+ * - Additional tag names
28
+ */
29
+ props?: Array<string>;
30
+ };
3
31
  /**
4
32
  * @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_fileBrowser
5
33
  */
34
+ /**
35
+ * @typedef {Object} FileBrowserPluginOptions
36
+ * @property {Object<string, *>|Array<*>} [data] - Direct data without server calls
37
+ * @property {string} [url] - Server request URL
38
+ * @property {Object<string, string>} [headers] - Server request headers
39
+ * @property {string|((item: BrowserFile_fileBrowser) => string)} [thumbnail] - Default thumbnail
40
+ * @property {Array<string>} [props] - Additional tag names
41
+ */
6
42
  /**
7
43
  * @class
8
44
  * @extends EditorInjector
@@ -15,34 +51,9 @@ declare class FileBrowser extends EditorInjector {
15
51
  /**
16
52
  * @constructor
17
53
  * @param {__se__EditorCore} editor - The root editor instance
18
- * @param {Object} pluginOptions
19
- * @param {Object<string, *>|Array<*>=} pluginOptions.data - direct data without server calls
20
- * @param {string} pluginOptions.url - server request url
21
- * @param {Object<string, string>=} pluginOptions.headers - server request headers
22
- * @param {string|((item: BrowserFile_fileBrowser) => string)} pluginOptions.thumbnail - default thumbnail
23
- * @param {Array<string>} pluginOptions.props - additional tag names
54
+ * @param {FileBrowserPluginOptions} pluginOptions
24
55
  */
25
- constructor(
26
- editor: __se__EditorCore,
27
- pluginOptions: {
28
- data?:
29
- | (
30
- | {
31
- [x: string]: any;
32
- }
33
- | Array<any>
34
- )
35
- | undefined;
36
- url: string;
37
- headers?:
38
- | {
39
- [x: string]: string;
40
- }
41
- | undefined;
42
- thumbnail: string | ((item: BrowserFile_fileBrowser) => string);
43
- props: Array<string>;
44
- }
45
- );
56
+ constructor(editor: __se__EditorCore, pluginOptions: FileBrowserPluginOptions);
46
57
  title: any;
47
58
  icon: string;
48
59
  onSelectfunction: (targe: Node) => any;
@@ -1,8 +1,35 @@
1
1
  export default FileGallery;
2
2
  export type BrowserFile_fileGallery = import('../../modules/Browser').BrowserFile;
3
+ export type FileGalleryPluginOptions = {
4
+ /**
5
+ * - Direct data without server calls
6
+ */
7
+ data?: Array<BrowserFile_fileGallery>;
8
+ /**
9
+ * - Server request URL
10
+ */
11
+ url?: string;
12
+ /**
13
+ * - Server request headers
14
+ */
15
+ headers?: {
16
+ [x: string]: string;
17
+ };
18
+ /**
19
+ * - Default thumbnail
20
+ */
21
+ thumbnail?: string | ((item: BrowserFile_fileGallery) => string);
22
+ };
3
23
  /**
4
24
  * @typedef {import('../../modules/Browser').BrowserFile} BrowserFile_fileGallery
5
25
  */
26
+ /**
27
+ * @typedef {Object} FileGalleryPluginOptions
28
+ * @property {Array<BrowserFile_fileGallery>} [data] - Direct data without server calls
29
+ * @property {string} [url] - Server request URL
30
+ * @property {Object<string, string>} [headers] - Server request headers
31
+ * @property {string|((item: BrowserFile_fileGallery) => string)} [thumbnail] - Default thumbnail
32
+ */
6
33
  /**
7
34
  * @class
8
35
  * @extends EditorInjector
@@ -15,25 +42,9 @@ declare class FileGallery extends EditorInjector {
15
42
  /**
16
43
  * @constructor
17
44
  * @param {__se__EditorCore} editor - The root editor instance
18
- * @param {Object} pluginOptions
19
- * @param {Array<*>=} pluginOptions.data - direct data without server calls
20
- * @param {string} pluginOptions.url - server request url
21
- * @param {Object<string, string>=} pluginOptions.headers - server request headers
22
- * @param {string|((item: BrowserFile_fileGallery) => string)} pluginOptions.thumbnail - default thumbnail
45
+ * @param {FileGalleryPluginOptions} pluginOptions
23
46
  */
24
- constructor(
25
- editor: __se__EditorCore,
26
- pluginOptions: {
27
- data?: Array<any> | undefined;
28
- url: string;
29
- headers?:
30
- | {
31
- [x: string]: string;
32
- }
33
- | undefined;
34
- thumbnail: string | ((item: BrowserFile_fileGallery) => string);
35
- }
36
- );
47
+ constructor(editor: __se__EditorCore, pluginOptions: FileGalleryPluginOptions);
37
48
  title: any;
38
49
  icon: string;
39
50
  onSelectfunction: (targe: Node) => any;