@vaadin/rich-text-editor 25.0.4 → 25.0.7

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": "25.0.4",
3
+ "version": "25.0.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,23 +35,23 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "~25.0.4",
39
- "@vaadin/button": "~25.0.4",
40
- "@vaadin/component-base": "~25.0.4",
41
- "@vaadin/confirm-dialog": "~25.0.4",
42
- "@vaadin/overlay": "~25.0.4",
43
- "@vaadin/text-field": "~25.0.4",
44
- "@vaadin/tooltip": "~25.0.4",
45
- "@vaadin/vaadin-themable-mixin": "~25.0.4",
38
+ "@vaadin/a11y-base": "~25.0.7",
39
+ "@vaadin/button": "~25.0.7",
40
+ "@vaadin/component-base": "~25.0.7",
41
+ "@vaadin/confirm-dialog": "~25.0.7",
42
+ "@vaadin/overlay": "~25.0.7",
43
+ "@vaadin/text-field": "~25.0.7",
44
+ "@vaadin/tooltip": "~25.0.7",
45
+ "@vaadin/vaadin-themable-mixin": "~25.0.7",
46
46
  "lit": "^3.0.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@vaadin/a11y-base": "~25.0.2",
50
- "@vaadin/aura": "~25.0.4",
51
- "@vaadin/chai-plugins": "~25.0.4",
52
- "@vaadin/test-runner-commands": "~25.0.4",
50
+ "@vaadin/aura": "~25.0.7",
51
+ "@vaadin/chai-plugins": "~25.0.7",
52
+ "@vaadin/test-runner-commands": "~25.0.7",
53
53
  "@vaadin/testing-helpers": "^2.0.0",
54
- "@vaadin/vaadin-lumo-styles": "~25.0.4",
54
+ "@vaadin/vaadin-lumo-styles": "~25.0.7",
55
55
  "sinon": "^21.0.0"
56
56
  },
57
57
  "cvdlName": "vaadin-rich-text-editor",
@@ -59,5 +59,5 @@
59
59
  "web-types.json",
60
60
  "web-types.lit.json"
61
61
  ],
62
- "gitHead": "17170982c3efa1d426af4fabb70ea36b70151347"
62
+ "gitHead": "8f3a780477d7dbe30fd473470ede41458e5217b9"
63
63
  }
@@ -37,6 +37,8 @@ class CodeBlockContainer extends QuillCodeBlockContainer {
37
37
 
38
38
  Quill.register('formats/code-block-container', CodeBlockContainer, true);
39
39
 
40
+ const NAVIGATION_KEYS = ['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown'];
41
+
40
42
  const HANDLERS = [
41
43
  'bold',
42
44
  'italic',
@@ -379,6 +381,23 @@ export const RichTextEditorMixin = (superClass) =>
379
381
  }
380
382
  });
381
383
 
384
+ // Workaround for Quill 2.0 reporting stale selection on navigation keys.
385
+ // Quill's selectionchange handler reads the selection before the browser
386
+ // commits the new cursor position, causing toolbar to show previous format.
387
+ // Deferring via rAF ensures we read the correct, committed selection.
388
+ // See https://github.com/slab/quill/issues/4305
389
+ // See https://github.com/slab/quill/issues/4168
390
+ editorContent.addEventListener('keydown', (e) => {
391
+ if (NAVIGATION_KEYS.includes(e.key)) {
392
+ requestAnimationFrame(() => {
393
+ const selection = this._editor.getSelection();
394
+ if (selection) {
395
+ this._editor.getModule('toolbar').update(selection);
396
+ }
397
+ });
398
+ }
399
+ });
400
+
382
401
  editorContent.addEventListener('blur', () => {
383
402
  if (this.__tabBindings) {
384
403
  this._editor.keyboard.bindings.Tab = this.__tabBindings;
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": "25.0.4",
4
+ "version": "25.0.7",
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": "25.0.4",
4
+ "version": "25.0.7",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {