@vaadin/rich-text-editor 24.4.0-alpha1 → 24.4.0-alpha11

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.4.0-alpha1",
3
+ "version": "24.4.0-alpha11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,19 +41,19 @@
41
41
  "dependencies": {
42
42
  "@open-wc/dedupe-mixin": "^1.3.0",
43
43
  "@polymer/polymer": "^3.0.0",
44
- "@vaadin/button": "24.4.0-alpha1",
45
- "@vaadin/component-base": "24.4.0-alpha1",
46
- "@vaadin/confirm-dialog": "24.4.0-alpha1",
47
- "@vaadin/text-field": "24.4.0-alpha1",
48
- "@vaadin/tooltip": "24.4.0-alpha1",
49
- "@vaadin/vaadin-lumo-styles": "24.4.0-alpha1",
50
- "@vaadin/vaadin-material-styles": "24.4.0-alpha1",
51
- "@vaadin/vaadin-themable-mixin": "24.4.0-alpha1",
44
+ "@vaadin/button": "24.4.0-alpha11",
45
+ "@vaadin/component-base": "24.4.0-alpha11",
46
+ "@vaadin/confirm-dialog": "24.4.0-alpha11",
47
+ "@vaadin/text-field": "24.4.0-alpha11",
48
+ "@vaadin/tooltip": "24.4.0-alpha11",
49
+ "@vaadin/vaadin-lumo-styles": "24.4.0-alpha11",
50
+ "@vaadin/vaadin-material-styles": "24.4.0-alpha11",
51
+ "@vaadin/vaadin-themable-mixin": "24.4.0-alpha11",
52
52
  "lit": "^3.0.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@esm-bundle/chai": "^4.3.4",
56
- "@vaadin/a11y-base": "24.4.0-alpha1",
56
+ "@vaadin/a11y-base": "24.4.0-alpha11",
57
57
  "@vaadin/testing-helpers": "^0.6.0",
58
58
  "gulp": "^4.0.2",
59
59
  "gulp-cli": "^2.3.0",
@@ -65,5 +65,5 @@
65
65
  "web-types.json",
66
66
  "web-types.lit.json"
67
67
  ],
68
- "gitHead": "3e2ed41c99d618ff7def2734fd863c21c85775a3"
68
+ "gitHead": "09c2f31d69cd611714169e0cd035688f54b2da37"
69
69
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -25,7 +25,7 @@ import { richTextEditorStyles } from './vaadin-rich-text-editor-styles.js';
25
25
  *
26
26
  * ## Disclaimer
27
27
  *
28
- * This component is an experiment not intended for publishing to npm.
28
+ * This component is an experiment and not yet a part of Vaadin platform.
29
29
  * There is no ETA regarding specific Vaadin version where it'll land.
30
30
  */
31
31
  class RichTextEditor extends RichTextEditorMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -255,6 +255,10 @@ export const RichTextEditorMixin = (superClass) =>
255
255
 
256
256
  /** @private */
257
257
  __setDirection(dir) {
258
+ if (!this._editor) {
259
+ return;
260
+ }
261
+
258
262
  // Needed for proper `ql-align` class to be set and activate the toolbar align button
259
263
  const alignAttributor = Quill.import('attributors/class/align');
260
264
  alignAttributor.whitelist = [dir === 'rtl' ? 'left' : 'right', 'center', 'justify'];
@@ -297,6 +301,8 @@ export const RichTextEditorMixin = (superClass) =>
297
301
  this.__patchFirefoxFocus();
298
302
  }
299
303
 
304
+ this.__setDirection(this.__dir);
305
+
300
306
  const editorContent = editor.querySelector('.ql-editor');
301
307
 
302
308
  editorContent.setAttribute('role', 'textbox');
@@ -667,7 +673,12 @@ export const RichTextEditorMixin = (superClass) =>
667
673
  let content = editor.innerHTML;
668
674
 
669
675
  // Remove Quill classes, e.g. ql-syntax, except for align
670
- content = content.replace(/\s*ql-(?!align)[\w-]*\s*/gu, '');
676
+ content = content.replace(/class="([^"]*)"/gu, (match, group1) => {
677
+ const classes = group1.split(' ').filter((className) => {
678
+ return !className.startsWith('ql-') || className.startsWith('ql-align');
679
+ });
680
+ return `class="${classes.join(' ')}"`;
681
+ });
671
682
  // Remove meta spans, e.g. cursor which are empty after Quill classes removed
672
683
  content = content.replace(/<\/?span[^>]*>/gu, '');
673
684
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2000 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2000 - 2024 Vaadin Ltd.
4
4
  *
5
5
  * This program is available under Vaadin Commercial License and Service Terms.
6
6
  *
@@ -0,0 +1,6 @@
1
+ import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
2
+ import '@vaadin/confirm-dialog/theme/lumo/vaadin-confirm-dialog-styles.js';
3
+ import '@vaadin/text-field/theme/lumo/vaadin-text-field-styles.js';
4
+ import '@vaadin/tooltip/theme/lumo/vaadin-tooltip-styles.js';
5
+ import './vaadin-rich-text-editor-styles.js';
6
+ import '../../src/vaadin-lit-rich-text-editor.js';
@@ -0,0 +1,4 @@
1
+ import '@vaadin/vaadin-lumo-styles/font-icons.js';
2
+ import '@vaadin/vaadin-lumo-styles/sizing.js';
3
+ import '@vaadin/vaadin-lumo-styles/spacing.js';
4
+ import '@vaadin/vaadin-lumo-styles/style.js';
@@ -0,0 +1,6 @@
1
+ import '@vaadin/button/theme/lumo/vaadin-button.js';
2
+ import '@vaadin/confirm-dialog/theme/lumo/vaadin-confirm-dialog.js';
3
+ import '@vaadin/text-field/theme/lumo/vaadin-text-field.js';
4
+ import '@vaadin/tooltip/theme/lumo/vaadin-tooltip.js';
5
+ import './vaadin-rich-text-editor-styles.js';
6
+ import '../../src/vaadin-rich-text-editor.js';
@@ -0,0 +1,6 @@
1
+ import '@vaadin/button/theme/material/vaadin-button-styles.js';
2
+ import '@vaadin/confirm-dialog/theme/material/vaadin-confirm-dialog-styles.js';
3
+ import '@vaadin/text-field/theme/material/vaadin-text-field-styles.js';
4
+ import '@vaadin/tooltip/theme/material/vaadin-tooltip-styles.js';
5
+ import './vaadin-rich-text-editor-styles.js';
6
+ import '../../src/vaadin-lit-rich-text-editor.js';
@@ -0,0 +1 @@
1
+ import '@vaadin/vaadin-material-styles/color.js';
@@ -0,0 +1,6 @@
1
+ import '@vaadin/button/theme/material/vaadin-button.js';
2
+ import '@vaadin/confirm-dialog/theme/material/vaadin-confirm-dialog.js';
3
+ import '@vaadin/text-field/theme/material/vaadin-text-field.js';
4
+ import '@vaadin/tooltip/theme/material/vaadin-tooltip.js';
5
+ import './vaadin-rich-text-editor-styles.js';
6
+ import '../../src/vaadin-rich-text-editor.js';
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.4.0-alpha1",
4
+ "version": "24.4.0-alpha11",
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.4.0-alpha1",
4
+ "version": "24.4.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {