suneditor 2.45.1 → 2.46.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.
@@ -84,6 +84,11 @@ export default {
84
84
  const resize_back = doc.createElement('DIV');
85
85
  resize_back.className = 'se-resizing-back';
86
86
 
87
+ /// focus temp
88
+ const focusTemp = doc.createElement('INPUT');
89
+ focusTemp.tabIndex = -1;
90
+ focusTemp.style.cssText = 'position: absolute !important; top: -10000px !important; display: block !important; width: 0 !important; height: 0 !important; margin: 0 !important; padding: 0 !important;';
91
+
87
92
  // toolbar container
88
93
  const toolbarContainer = options.toolbarContainer;
89
94
  if (toolbarContainer) {
@@ -109,6 +114,7 @@ export default {
109
114
  relative.appendChild(line_breaker);
110
115
  relative.appendChild(line_breaker_t);
111
116
  relative.appendChild(line_breaker_b);
117
+ relative.appendChild(focusTemp);
112
118
  if (resizing_bar && !resizingBarContainer) relative.appendChild(resizing_bar);
113
119
  top_div.appendChild(relative);
114
120
 
@@ -135,7 +141,8 @@ export default {
135
141
  _lineBreaker_b: line_breaker_b,
136
142
  _resizeBack: resize_back,
137
143
  _stickyDummy: sticky_dummy,
138
- _arrow: arrow
144
+ _arrow: arrow,
145
+ _focusTemp: focusTemp
139
146
  },
140
147
  options: options,
141
148
  plugins: tool_bar.plugins,
@@ -307,6 +314,7 @@ export default {
307
314
 
308
315
  if (!options.iframe) {
309
316
  wysiwygDiv.setAttribute('contenteditable', true);
317
+ wysiwygDiv.setAttribute('autocorrect', "off");
310
318
  wysiwygDiv.setAttribute('scrolling', 'auto');
311
319
  for (let key in options.iframeAttributes) {
312
320
  wysiwygDiv.setAttribute(key, options.iframeAttributes[key]);
@@ -407,6 +415,7 @@ export default {
407
415
  }
408
416
  options.plugins = plugins;
409
417
  /** Values */
418
+ options.strictMode = options.strictMode !== false;
410
419
  options.lang = options.lang || _defaultLang;
411
420
  options.value = typeof options.value === 'string' ? options.value : null;
412
421
  options.allowedClassNames = new util._w.RegExp((options.allowedClassNames && typeof options.allowedClassNames === 'string' ? options.allowedClassNames + '|' : '') + '^__se__|se-|katex');
@@ -40,7 +40,8 @@ const _Context = function (element, cons, options) {
40
40
  lineBreaker_b: cons._lineBreaker_b,
41
41
  resizeBackground: cons._resizeBack,
42
42
  _stickyDummy: cons._stickyDummy,
43
- _arrow: cons._arrow
43
+ _arrow: cons._arrow,
44
+ _focusTemp: cons._focusTemp
44
45
  },
45
46
  tool: {
46
47
  cover: cons._toolBar.querySelector('.se-toolbar-cover'),
package/src/lib/core.d.ts CHANGED
@@ -606,7 +606,7 @@ interface Core {
606
606
 
607
607
  /**
608
608
  * @description Remove events from document.
609
-   * When created as an Iframe, the event of the document inside the Iframe is also removed.
609
+ * When created as an Iframe, the event of the document inside the Iframe is also removed.
610
610
  * @param type Event type
611
611
  * @param listener Event listener
612
612
  */
@@ -920,6 +920,39 @@ export default class SunEditor {
920
920
  */
921
921
  onAudioUploadError: (errorMessage: string, result: any, core: Core) => boolean;
922
922
 
923
+ /**
924
+ * @description Called when the audio image delete before.
925
+ * "false" is returned, the event will be aborted.
926
+ * @param targetElement target element
927
+ * @param container target's container
928
+ * @param dataIndex target's dataIndex
929
+ * @param core Core object
930
+ * @returns {boolean|undefined}
931
+ */
932
+ onAudioDeleteBefore: (targetElement: Element, container: Element, dataIndex: number, core: Core) => boolean;
933
+
934
+ /**
935
+ * @description Called when the image image delete before.
936
+ * "false" is returned, the event will be aborted.
937
+ * @param targetElement target element
938
+ * @param container target's container
939
+ * @param dataIndex target's dataIndex
940
+ * @param core Core object
941
+ * @returns {boolean|undefined}
942
+ */
943
+ onImageDeleteBefore: (targetElement: Element, container: Element, dataIndex: number, core: Core) => boolean;
944
+
945
+ /**
946
+ * @description Called when the image image delete before.
947
+ * "false" is returned, the event will be aborted.
948
+ * @param targetElement target element
949
+ * @param container target's container
950
+ * @param dataIndex target's dataIndex
951
+ * @param core Core object
952
+ * @returns {boolean|undefined}
953
+ */
954
+ onVideoDeleteBefore: (targetElement: Element, container: Element, dataIndex: number, core: Core) => boolean;
955
+
923
956
  /**
924
957
  * @description Called when the audio upload failed
925
958
  * @param height Height after resized (px)