suneditor 3.0.0-beta.3 → 3.0.0-beta.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suneditor",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.5",
4
4
  "description": "Vanilla javascript based WYSIWYG web editor",
5
5
  "author": "Yi JiHong",
6
6
  "license": "MIT",
@@ -778,9 +778,7 @@
778
778
  height: 100%;
779
779
  top: 0;
780
780
  left: 0;
781
- background-color: rgba(0, 0, 0, 0.35);
782
- opacity: 0.7;
783
- filter: alpha(opacity=70);
781
+ background-color: transparent;
784
782
  z-index: 2147483647;
785
783
  }
786
784
 
@@ -816,7 +814,7 @@
816
814
  opacity: 0.95;
817
815
  border-radius: var(--se-border-radius);
818
816
  cursor: pointer;
819
- z-index: 2147483647;
817
+ z-index: 2147483646;
820
818
  transition: opacity 0.3s ease, color 0.3s ease, background-color 0.3s ease;
821
819
  }
822
820
  .sun-editor .se-line-breaker-component.se-on-selected {
@@ -873,7 +871,7 @@
873
871
  .sun-editor .se-toolbar.se-toolbar-balloon {
874
872
  display: none;
875
873
  position: absolute;
876
- z-index: 2147483647;
874
+ z-index: 2147483646;
877
875
  width: auto;
878
876
  box-shadow: 0 3px 9px var(--se-shadow-layer-color);
879
877
  -webkit-box-shadow: 0 3px 9px var(--se-shadow-layer-color);
@@ -1062,7 +1060,7 @@
1062
1060
  left: 0px;
1063
1061
  width: 100%;
1064
1062
  height: 0px;
1065
- z-index: 2147483647;
1063
+ z-index: 2147483646;
1066
1064
  }
1067
1065
 
1068
1066
  /** --- dropdown layer ---------------------------------------------------------- */
@@ -1738,7 +1736,7 @@
1738
1736
  -khtml-user-select: none;
1739
1737
  -webkit-user-select: none;
1740
1738
  -ms-user-select: none;
1741
- z-index: 2147483647;
1739
+ z-index: 2147483646;
1742
1740
  background-color: transparent;
1743
1741
  }
1744
1742
 
@@ -1788,7 +1786,7 @@
1788
1786
  left: 0;
1789
1787
  width: 100%;
1790
1788
  height: 100%;
1791
- z-index: 2147483647;
1789
+ z-index: 2147483646;
1792
1790
  }
1793
1791
  .sun-editor .se-modal-area.se-backdrop-show {
1794
1792
  display: block;
@@ -2779,7 +2777,7 @@
2779
2777
  min-width: auto;
2780
2778
  top: 0px;
2781
2779
  left: 0px;
2782
- z-index: 2147483647;
2780
+ z-index: 2147483646;
2783
2781
  display: none;
2784
2782
  width: -webkit-max-content;
2785
2783
  width: -moz-max-content;
@@ -2871,7 +2869,7 @@
2871
2869
  left: 0;
2872
2870
  width: 100%;
2873
2871
  height: 100%;
2874
- z-index: 2147483647;
2872
+ z-index: 2147483646;
2875
2873
  }
2876
2874
 
2877
2875
  .sun-editor .se-browser label,
@@ -3318,7 +3316,7 @@
3318
3316
  left: 0;
3319
3317
  width: 100%;
3320
3318
  height: 100%;
3321
- z-index: 2147483647;
3319
+ z-index: 2147483646;
3322
3320
  pointer-events: none;
3323
3321
  }
3324
3322
 
@@ -4036,7 +4034,7 @@
4036
4034
  pointer-events: none;
4037
4035
  width: 2px;
4038
4036
  background-color: var(--se-active-dark5-color);
4039
- z-index: 2147483647;
4037
+ z-index: 2147483646;
4040
4038
  }
4041
4039
  .sun-editor.sun-editor-carrier-wrapper .se-drag-cursor::before {
4042
4040
  content: '';
@@ -288,7 +288,7 @@ Offset.prototype = {
288
288
  }
289
289
  }
290
290
 
291
- el = /** @type {HTMLElement} */ (this._shadowRoot?.host);
291
+ el = /** @type {HTMLElement} */ (this.editor._shadowRoot?.host);
292
292
  if (el) ohOffsetEl = owOffsetEl = topArea;
293
293
  while (el) {
294
294
  t += el.scrollTop;
@@ -37,15 +37,12 @@ Selection_.prototype = {
37
37
  * @returns {Selection}
38
38
  */
39
39
  get() {
40
- const wSelection = this.editor.frameContext.get('_ww').getSelection();
41
40
  let selection = null;
42
41
 
43
- if (this._shadowRoot) {
44
- selection = wSelection.getComposedRanges?.();
45
- }
46
-
47
- if (!selection) {
48
- selection = wSelection;
42
+ if (typeof this.editor._shadowRoot?.getSelection === 'function') {
43
+ selection = this.editor._shadowRoot.getSelection();
44
+ } else {
45
+ selection = this.editor.frameContext.get('_ww').getSelection();
49
46
  }
50
47
 
51
48
  if (!selection) return null;
@@ -188,7 +188,7 @@ Viewer.prototype = {
188
188
  topArea.style.width = '100%';
189
189
  topArea.style.maxWidth = '100%';
190
190
  topArea.style.height = '100%';
191
- topArea.style.zIndex = '2147483646';
191
+ topArea.style.zIndex = '2147483639';
192
192
 
193
193
  if (fc.get('_stickyDummy').style.display !== 'none' && fc.get('_stickyDummy').style.display !== '') {
194
194
  this.fullScreenSticky = true;
@@ -311,7 +311,7 @@ function Editor(multiTargets, options) {
311
311
 
312
312
  /**
313
313
  * @description Closest ShadowRoot to editor if found
314
- * @type {ShadowRoot}
314
+ * @type {ShadowRoot & { getSelection?: () => Selection }} - Chromium-based browsers (Chrome, Edge, etc.) has a getSelection method on the ShadowRoot
315
315
  */
316
316
  this._shadowRoot = null;
317
317
 
@@ -84,9 +84,4 @@ export default function CoreInjector(editor) {
84
84
  * @type {Document}
85
85
  */
86
86
  this._d = editor._d;
87
- /**
88
- * @description The shadow root object (if any).
89
- * @type {__se__EditorCore['_shadowRoot']}
90
- */
91
- this._shadowRoot = editor._shadowRoot;
92
87
  }
@@ -37,8 +37,6 @@ function EditorInjector(editor) {
37
37
  this._w;
38
38
  /** @type {import('./_core').default['_d']} */
39
39
  this._d;
40
- /** @type {import('./_core').default['_shadowRoot']} */
41
- this._shadowRoot;
42
40
 
43
41
  // ClassInjector props
44
42
  /** @type {import('./_classes').default['toolbar']} */
@@ -235,7 +235,7 @@ class Controller extends EditorInjector {
235
235
  if ((await this.triggerEvent('onBeforeShowController', { caller: this.kind, frameContext: this.editor.frameContext, info })) === false) return;
236
236
 
237
237
  form.style.display = 'block';
238
- if (this._shadowRoot) {
238
+ if (this.editor._shadowRoot) {
239
239
  this.__shadowRootEventForm = form;
240
240
  this.__shadowRootEventListener = (e) => e.stopPropagation();
241
241
  form.addEventListener('mousedown', this.__shadowRootEventListener);
@@ -266,9 +266,11 @@ declare class Editor {
266
266
  _lineBreaker_b: HTMLElement;
267
267
  /**
268
268
  * @description Closest ShadowRoot to editor if found
269
- * @type {ShadowRoot}
269
+ * @type {ShadowRoot & { getSelection?: () => Selection }} - Chromium-based browsers (Chrome, Edge, etc.) has a getSelection method on the ShadowRoot
270
270
  */
271
- _shadowRoot: ShadowRoot;
271
+ _shadowRoot: ShadowRoot & {
272
+ getSelection?: () => Selection;
273
+ };
272
274
  /**
273
275
  * @description Plugin call event map
274
276
  * @type {Map<string, Array<((...args: *) => *) & { index: number }>>}
@@ -84,9 +84,4 @@ export default class CoreInjector {
84
84
  * @type {Document}
85
85
  */
86
86
  _d: Document;
87
- /**
88
- * @description The shadow root object (if any).
89
- * @type {__se__EditorCore['_shadowRoot']}
90
- */
91
- _shadowRoot: __se__EditorCore['_shadowRoot'];
92
87
  }
@@ -40,8 +40,6 @@ declare class EditorInjector {
40
40
  _w: import('./_core').default['_w'];
41
41
  /** @type {import('./_core').default['_d']} */
42
42
  _d: import('./_core').default['_d'];
43
- /** @type {import('./_core').default['_shadowRoot']} */
44
- _shadowRoot: import('./_core').default['_shadowRoot'];
45
43
  /** @type {import('./_classes').default['toolbar']} */
46
44
  toolbar: import('./_classes').default['toolbar'];
47
45
  /** @type {import('./_classes').default['subToolbar']} */