@vaadin/rich-text-editor 24.10.10 → 24.10.11

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": "@vaadin/rich-text-editor",
3
- "version": "24.10.10",
3
+ "version": "24.10.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,22 +41,22 @@
41
41
  "dependencies": {
42
42
  "@open-wc/dedupe-mixin": "^1.3.0",
43
43
  "@polymer/polymer": "^3.0.0",
44
- "@vaadin/a11y-base": "~24.10.10",
45
- "@vaadin/button": "~24.10.10",
46
- "@vaadin/component-base": "~24.10.10",
47
- "@vaadin/confirm-dialog": "~24.10.10",
48
- "@vaadin/overlay": "~24.10.10",
49
- "@vaadin/text-field": "~24.10.10",
50
- "@vaadin/tooltip": "~24.10.10",
51
- "@vaadin/vaadin-lumo-styles": "~24.10.10",
52
- "@vaadin/vaadin-material-styles": "~24.10.10",
53
- "@vaadin/vaadin-themable-mixin": "~24.10.10",
44
+ "@vaadin/a11y-base": "~24.10.11",
45
+ "@vaadin/button": "~24.10.11",
46
+ "@vaadin/component-base": "~24.10.11",
47
+ "@vaadin/confirm-dialog": "~24.10.11",
48
+ "@vaadin/overlay": "~24.10.11",
49
+ "@vaadin/text-field": "~24.10.11",
50
+ "@vaadin/tooltip": "~24.10.11",
51
+ "@vaadin/vaadin-lumo-styles": "~24.10.11",
52
+ "@vaadin/vaadin-material-styles": "~24.10.11",
53
+ "@vaadin/vaadin-themable-mixin": "~24.10.11",
54
54
  "lit": "^3.0.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@vaadin/a11y-base": "24.9.0-beta1",
58
- "@vaadin/chai-plugins": "~24.10.10",
59
- "@vaadin/test-runner-commands": "~24.10.10",
58
+ "@vaadin/chai-plugins": "~24.10.11",
59
+ "@vaadin/test-runner-commands": "~24.10.11",
60
60
  "@vaadin/testing-helpers": "^1.1.0",
61
61
  "gulp": "^5.0.0",
62
62
  "gulp-cli": "^3.0.0",
@@ -68,5 +68,5 @@
68
68
  "web-types.json",
69
69
  "web-types.lit.json"
70
70
  ],
71
- "gitHead": "e0df05b282cba861120700bd049842bf94247d5c"
71
+ "gitHead": "44ad157c18dfc68b6d9b5e5de9594e021863fa1c"
72
72
  }
@@ -11,7 +11,6 @@
11
11
  import '../vendor/vaadin-quill.js';
12
12
  import { isKeyboardActive } from '@vaadin/a11y-base/src/focus-utils.js';
13
13
  import { timeOut } from '@vaadin/component-base/src/async.js';
14
- import { isFirefox } from '@vaadin/component-base/src/browser-utils.js';
15
14
  import { Debouncer } from '@vaadin/component-base/src/debounce.js';
16
15
  import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
17
16
 
@@ -353,11 +352,6 @@ export const RichTextEditorMixin = (superClass) =>
353
352
  this.__patchToolbar();
354
353
  this.__patchKeyboard();
355
354
 
356
- /* c8 ignore next 3 */
357
- if (isFirefox) {
358
- this.__patchFirefoxFocus();
359
- }
360
-
361
355
  this.__setDirection(this.__dir);
362
356
 
363
357
  const editorContent = editor.querySelector('.ql-editor');
@@ -513,69 +507,6 @@ export const RichTextEditorMixin = (superClass) =>
513
507
  this._toolbarState = STATE.DEFAULT;
514
508
  }
515
509
 
516
- /** @private */
517
- __createFakeFocusTarget() {
518
- const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
519
- const elem = document.createElement('textarea');
520
- // Reset box model
521
- elem.style.border = '0';
522
- elem.style.padding = '0';
523
- elem.style.margin = '0';
524
- // Move element out of screen horizontally
525
- elem.style.position = 'absolute';
526
- elem.style[isRTL ? 'right' : 'left'] = '-9999px';
527
- // Move element to the same position vertically
528
- const yPosition = window.pageYOffset || document.documentElement.scrollTop;
529
- elem.style.top = `${yPosition}px`;
530
- return elem;
531
- }
532
-
533
- /** @private */
534
- __patchFirefoxFocus() {
535
- // In Firefox 63+ with native Shadow DOM, when moving focus out of
536
- // contenteditable and back again within same shadow root, cursor
537
- // disappears. See https://bugzilla.mozilla.org/show_bug.cgi?id=1496769
538
- const editorContent = this.shadowRoot.querySelector('.ql-editor');
539
- let isFake = false;
540
-
541
- const focusFake = () => {
542
- isFake = true;
543
- this.__fakeTarget = this.__createFakeFocusTarget();
544
- document.body.appendChild(this.__fakeTarget);
545
- // Let the focus step out of shadow root!
546
- this.__fakeTarget.focus();
547
- return new Promise((resolve) => {
548
- setTimeout(resolve);
549
- });
550
- };
551
-
552
- const focusBack = (offsetNode, offset) => {
553
- this._editor.focus();
554
- if (offsetNode) {
555
- this._editor.selection.setNativeRange(offsetNode, offset);
556
- }
557
- document.body.removeChild(this.__fakeTarget);
558
- delete this.__fakeTarget;
559
- isFake = false;
560
- };
561
-
562
- editorContent.addEventListener('mousedown', (e) => {
563
- if (!this._editor.hasFocus()) {
564
- const { x, y } = e;
565
- const { offset, offsetNode } = document.caretPositionFromPoint(x, y);
566
- focusFake().then(() => {
567
- focusBack(offsetNode, offset);
568
- });
569
- }
570
- });
571
-
572
- editorContent.addEventListener('focusin', () => {
573
- if (isFake === false) {
574
- focusFake().then(() => focusBack());
575
- }
576
- });
577
- }
578
-
579
510
  /** @private */
580
511
  __patchToolbar() {
581
512
  const toolbar = this._editor.getModule('toolbar');
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/rich-text-editor",
4
- "version": "24.10.10",
4
+ "version": "24.10.11",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/rich-text-editor",
4
- "version": "24.10.10",
4
+ "version": "24.10.11",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {