@vaadin/rich-text-editor 22.0.1 → 23.0.0-alpha3
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 +9 -9
- package/src/vaadin-rich-text-editor-content-styles.js +1 -1
- package/src/vaadin-rich-text-editor-icons.js +1 -1
- package/src/vaadin-rich-text-editor-styles.js +4 -7
- package/src/vaadin-rich-text-editor-toolbar-styles.js +4 -4
- package/src/vaadin-rich-text-editor.d.ts +11 -2
- package/src/vaadin-rich-text-editor.js +11 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/rich-text-editor",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.0-alpha3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@polymer/polymer": "^3.0.0",
|
|
40
|
-
"@vaadin/button": "
|
|
41
|
-
"@vaadin/component-base": "
|
|
42
|
-
"@vaadin/confirm-dialog": "
|
|
43
|
-
"@vaadin/text-field": "
|
|
40
|
+
"@vaadin/button": "23.0.0-alpha3",
|
|
41
|
+
"@vaadin/component-base": "23.0.0-alpha3",
|
|
42
|
+
"@vaadin/confirm-dialog": "23.0.0-alpha3",
|
|
43
|
+
"@vaadin/text-field": "23.0.0-alpha3",
|
|
44
44
|
"@vaadin/vaadin-license-checker": "^2.1.0",
|
|
45
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
46
|
-
"@vaadin/vaadin-material-styles": "
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
45
|
+
"@vaadin/vaadin-lumo-styles": "23.0.0-alpha3",
|
|
46
|
+
"@vaadin/vaadin-material-styles": "23.0.0-alpha3",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "23.0.0-alpha3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@esm-bundle/chai": "^4.3.4",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"gulp-iconfont": "^11.0.0",
|
|
55
55
|
"sinon": "^9.2.1"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "490037919a9e054cc002c1b3be0c94a1603e1a44"
|
|
58
58
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2018 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
6
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2018 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
6
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2018 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
6
|
import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
7
|
import { contentStyles } from './vaadin-rich-text-editor-content-styles.js';
|
|
8
8
|
import { toolbarStyles } from './vaadin-rich-text-editor-toolbar-styles.js';
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
${toolbarStyles}
|
|
13
|
-
|
|
14
|
-
:host([readonly]) [part='toolbar'] {
|
|
10
|
+
export const statesStyles = css`
|
|
11
|
+
:host([readonly]) [part='toolbar'] {
|
|
15
12
|
display: none;
|
|
16
13
|
}
|
|
17
14
|
|
|
@@ -28,4 +25,4 @@ const richTextEditorStyles = css`
|
|
|
28
25
|
}
|
|
29
26
|
`;
|
|
30
27
|
|
|
31
|
-
export
|
|
28
|
+
export const richTextEditorStyles = [contentStyles, toolbarStyles, statesStyles];
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2018 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
6
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
7
|
import { iconsStyles } from './vaadin-rich-text-editor-icons.js';
|
|
8
8
|
|
|
9
|
-
export const
|
|
10
|
-
${iconsStyles}
|
|
11
|
-
|
|
9
|
+
export const buttonsStyles = css`
|
|
12
10
|
[part='toolbar'] {
|
|
13
11
|
display: flex;
|
|
14
12
|
flex-wrap: wrap;
|
|
@@ -132,5 +130,7 @@ export const toolbarStyles = css`
|
|
|
132
130
|
}
|
|
133
131
|
`;
|
|
134
132
|
|
|
133
|
+
export const toolbarStyles = [iconsStyles, buttonsStyles];
|
|
134
|
+
|
|
135
135
|
// Register a module with ID for backwards compatibility.
|
|
136
136
|
registerStyles('', toolbarStyles, { moduleId: 'vaadin-rich-text-editor-toolbar-styles' });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2018 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
@@ -34,6 +34,13 @@ export interface RichTextEditorI18n {
|
|
|
34
34
|
remove: string;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Fired when the user commits a value change.
|
|
39
|
+
*/
|
|
40
|
+
export type RichTextEditorChangeEvent = Event & {
|
|
41
|
+
target: RichTextEditor;
|
|
42
|
+
};
|
|
43
|
+
|
|
37
44
|
/**
|
|
38
45
|
* Fired when the `htmlValue` property changes.
|
|
39
46
|
*/
|
|
@@ -50,7 +57,9 @@ export interface RichTextEditorCustomEventMap {
|
|
|
50
57
|
'value-changed': RichTextEditorValueChangedEvent;
|
|
51
58
|
}
|
|
52
59
|
|
|
53
|
-
export interface RichTextEditorEventMap extends HTMLElementEventMap, RichTextEditorCustomEventMap {
|
|
60
|
+
export interface RichTextEditorEventMap extends HTMLElementEventMap, RichTextEditorCustomEventMap {
|
|
61
|
+
change: RichTextEditorChangeEvent;
|
|
62
|
+
}
|
|
54
63
|
|
|
55
64
|
/**
|
|
56
65
|
* `<vaadin-rich-text-editor>` is a Web Component for rich text editing.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2018 - 2022 Vaadin Ltd.
|
|
4
4
|
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
|
|
5
5
|
*/
|
|
6
6
|
import '@vaadin/button/src/vaadin-button.js';
|
|
@@ -9,7 +9,6 @@ import '@vaadin/text-field/src/vaadin-text-field.js';
|
|
|
9
9
|
import '@vaadin/vaadin-license-checker/vaadin-license-checker.js';
|
|
10
10
|
import '../vendor/vaadin-quill.js';
|
|
11
11
|
import './vaadin-rich-text-editor-toolbar-styles.js';
|
|
12
|
-
import { resetMouseCanceller } from '@polymer/polymer/lib/utils/gestures.js';
|
|
13
12
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
14
13
|
import { timeOut } from '@vaadin/component-base/src/async.js';
|
|
15
14
|
import { isFirefox } from '@vaadin/component-base/src/browser-utils.js';
|
|
@@ -645,11 +644,14 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
645
644
|
e.preventDefault();
|
|
646
645
|
let index = buttons.indexOf(e.target);
|
|
647
646
|
buttons[index].setAttribute('tabindex', '-1');
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
647
|
+
|
|
648
|
+
let step;
|
|
649
|
+
if (e.keyCode === 39) {
|
|
650
|
+
step = 1;
|
|
651
|
+
} else if (e.keyCode === 37) {
|
|
652
|
+
step = -1;
|
|
652
653
|
}
|
|
654
|
+
index = (buttons.length + index + step) % buttons.length;
|
|
653
655
|
buttons[index].removeAttribute('tabindex');
|
|
654
656
|
buttons[index].focus();
|
|
655
657
|
}
|
|
@@ -714,7 +716,9 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
714
716
|
document.body.appendChild(this.__fakeTarget);
|
|
715
717
|
// let the focus step out of shadow root!
|
|
716
718
|
this.__fakeTarget.focus();
|
|
717
|
-
return new Promise((resolve) =>
|
|
719
|
+
return new Promise((resolve) => {
|
|
720
|
+
setTimeout(resolve);
|
|
721
|
+
});
|
|
718
722
|
};
|
|
719
723
|
|
|
720
724
|
const focusBack = (offsetNode, offset) => {
|
|
@@ -992,18 +996,9 @@ class RichTextEditor extends ElementMixin(ThemableMixin(PolymerElement)) {
|
|
|
992
996
|
_onImageTouchEnd(e) {
|
|
993
997
|
// Cancel the event to avoid the following click event
|
|
994
998
|
e.preventDefault();
|
|
995
|
-
// FIXME(platosha): workaround for Polymer Gestures mouseCanceller
|
|
996
|
-
// cancelling the following synthetic click. See also:
|
|
997
|
-
// https://github.com/Polymer/polymer/issues/5289
|
|
998
|
-
this.__resetMouseCanceller();
|
|
999
999
|
this._onImageClick();
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
|
-
/** @private */
|
|
1003
|
-
__resetMouseCanceller() {
|
|
1004
|
-
resetMouseCanceller();
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
1002
|
/** @private */
|
|
1008
1003
|
_onImageClick() {
|
|
1009
1004
|
this.$.fileInput.value = '';
|