@vaadin/rich-text-editor 24.3.0-alpha8 → 24.3.0-beta1
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 +11 -13
- package/src/vaadin-lit-rich-text-editor.d.ts +11 -0
- package/src/vaadin-lit-rich-text-editor.js +284 -0
- package/theme/lumo/vaadin-lit-rich-text-editor.js +6 -0
- package/theme/material/vaadin-lit-rich-text-editor.js +6 -0
- package/theme/material/vaadin-rich-text-editor-styles.js +5 -0
- package/vaadin-lit-rich-text-editor.d.ts +1 -0
- package/vaadin-lit-rich-text-editor.js +2 -0
- package/vendor/vaadin-quill.js +2 -2
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/rich-text-editor",
|
|
3
|
-
"version": "24.3.0-
|
|
3
|
+
"version": "24.3.0-beta1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -24,8 +24,6 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"src",
|
|
27
|
-
"!src/vaadin-lit-rich-text-editor.d.ts",
|
|
28
|
-
"!src/vaadin-lit-rich-text-editor.js",
|
|
29
27
|
"theme",
|
|
30
28
|
"vaadin-*.d.ts",
|
|
31
29
|
"vaadin-*.js",
|
|
@@ -43,18 +41,18 @@
|
|
|
43
41
|
"dependencies": {
|
|
44
42
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
45
43
|
"@polymer/polymer": "^3.0.0",
|
|
46
|
-
"@vaadin/button": "24.3.0-
|
|
47
|
-
"@vaadin/component-base": "24.3.0-
|
|
48
|
-
"@vaadin/confirm-dialog": "24.3.0-
|
|
49
|
-
"@vaadin/text-field": "24.3.0-
|
|
50
|
-
"@vaadin/tooltip": "24.3.0-
|
|
51
|
-
"@vaadin/vaadin-lumo-styles": "24.3.0-
|
|
52
|
-
"@vaadin/vaadin-material-styles": "24.3.0-
|
|
53
|
-
"@vaadin/vaadin-themable-mixin": "24.3.0-
|
|
44
|
+
"@vaadin/button": "24.3.0-beta1",
|
|
45
|
+
"@vaadin/component-base": "24.3.0-beta1",
|
|
46
|
+
"@vaadin/confirm-dialog": "24.3.0-beta1",
|
|
47
|
+
"@vaadin/text-field": "24.3.0-beta1",
|
|
48
|
+
"@vaadin/tooltip": "24.3.0-beta1",
|
|
49
|
+
"@vaadin/vaadin-lumo-styles": "24.3.0-beta1",
|
|
50
|
+
"@vaadin/vaadin-material-styles": "24.3.0-beta1",
|
|
51
|
+
"@vaadin/vaadin-themable-mixin": "24.3.0-beta1"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
54
|
"@esm-bundle/chai": "^4.3.4",
|
|
57
|
-
"@vaadin/a11y-base": "24.3.0-
|
|
55
|
+
"@vaadin/a11y-base": "24.3.0-beta1",
|
|
58
56
|
"@vaadin/testing-helpers": "^0.6.0",
|
|
59
57
|
"gulp": "^4.0.2",
|
|
60
58
|
"gulp-cli": "^2.3.0",
|
|
@@ -66,5 +64,5 @@
|
|
|
66
64
|
"web-types.json",
|
|
67
65
|
"web-types.lit.json"
|
|
68
66
|
],
|
|
69
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "a197041861e1bbf8d3e966d893648f5dd462b036"
|
|
70
68
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
10
|
+
*/
|
|
11
|
+
export * from './vaadin-rich-text-editor.js';
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
10
|
+
*/
|
|
11
|
+
import '@vaadin/button/src/vaadin-lit-button.js';
|
|
12
|
+
import '@vaadin/confirm-dialog/src/vaadin-lit-confirm-dialog.js';
|
|
13
|
+
import '@vaadin/text-field/src/vaadin-lit-text-field.js';
|
|
14
|
+
import '@vaadin/tooltip/src/vaadin-lit-tooltip.js';
|
|
15
|
+
import { html, LitElement } from 'lit';
|
|
16
|
+
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
17
|
+
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
18
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
19
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
20
|
+
import { RichTextEditorMixin } from './vaadin-rich-text-editor-mixin.js';
|
|
21
|
+
import { richTextEditorStyles } from './vaadin-rich-text-editor-styles.js';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* LitElement based version of `<vaadin-rich-text-editor>` web component.
|
|
25
|
+
*
|
|
26
|
+
* ## Disclaimer
|
|
27
|
+
*
|
|
28
|
+
* This component is an experiment not intended for publishing to npm.
|
|
29
|
+
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
30
|
+
*/
|
|
31
|
+
class RichTextEditor extends RichTextEditorMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
32
|
+
static get is() {
|
|
33
|
+
return 'vaadin-rich-text-editor';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static get cvdlName() {
|
|
37
|
+
return 'vaadin-rich-text-editor';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static get styles() {
|
|
41
|
+
return richTextEditorStyles;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** @protected */
|
|
45
|
+
render() {
|
|
46
|
+
return html`
|
|
47
|
+
<div class="vaadin-rich-text-editor-container">
|
|
48
|
+
<!-- Create toolbar container -->
|
|
49
|
+
<div part="toolbar" role="toolbar">
|
|
50
|
+
<span part="toolbar-group toolbar-group-history">
|
|
51
|
+
<!-- Undo and Redo -->
|
|
52
|
+
<button
|
|
53
|
+
id="btn-undo"
|
|
54
|
+
type="button"
|
|
55
|
+
part="toolbar-button toolbar-button-undo"
|
|
56
|
+
@click="${this._undo}"
|
|
57
|
+
></button>
|
|
58
|
+
<vaadin-tooltip for="btn-undo" .text="${this.i18n.undo}"></vaadin-tooltip>
|
|
59
|
+
|
|
60
|
+
<button
|
|
61
|
+
id="btn-redo"
|
|
62
|
+
type="button"
|
|
63
|
+
part="toolbar-button toolbar-button-redo"
|
|
64
|
+
@click="${this._redo}"
|
|
65
|
+
></button>
|
|
66
|
+
<vaadin-tooltip for="btn-redo" .text="${this.i18n.redo}"></vaadin-tooltip>
|
|
67
|
+
</span>
|
|
68
|
+
|
|
69
|
+
<span part="toolbar-group toolbar-group-emphasis">
|
|
70
|
+
<!-- Bold -->
|
|
71
|
+
<button id="btn-bold" class="ql-bold" part="toolbar-button toolbar-button-bold"></button>
|
|
72
|
+
<vaadin-tooltip for="btn-bold" .text="${this.i18n.bold}"></vaadin-tooltip>
|
|
73
|
+
|
|
74
|
+
<!-- Italic -->
|
|
75
|
+
<button id="btn-italic" class="ql-italic" part="toolbar-button toolbar-button-italic"></button>
|
|
76
|
+
<vaadin-tooltip for="btn-italic" .text="${this.i18n.italic}"></vaadin-tooltip>
|
|
77
|
+
|
|
78
|
+
<!-- Underline -->
|
|
79
|
+
<button id="btn-underline" class="ql-underline" part="toolbar-button toolbar-button-underline"></button>
|
|
80
|
+
<vaadin-tooltip for="btn-underline" .text="${this.i18n.underline}"></vaadin-tooltip>
|
|
81
|
+
|
|
82
|
+
<!-- Strike -->
|
|
83
|
+
<button id="btn-strike" class="ql-strike" part="toolbar-button toolbar-button-strike"></button>
|
|
84
|
+
<vaadin-tooltip for="btn-strike" .text="${this.i18n.strike}"></vaadin-tooltip>
|
|
85
|
+
</span>
|
|
86
|
+
|
|
87
|
+
<span part="toolbar-group toolbar-group-heading">
|
|
88
|
+
<!-- Header buttons -->
|
|
89
|
+
<button
|
|
90
|
+
id="btn-h1"
|
|
91
|
+
type="button"
|
|
92
|
+
class="ql-header"
|
|
93
|
+
value="1"
|
|
94
|
+
part="toolbar-button toolbar-button-h1"
|
|
95
|
+
></button>
|
|
96
|
+
<vaadin-tooltip for="btn-h1" .text="${this.i18n.h1}"></vaadin-tooltip>
|
|
97
|
+
<button
|
|
98
|
+
id="btn-h2"
|
|
99
|
+
type="button"
|
|
100
|
+
class="ql-header"
|
|
101
|
+
value="2"
|
|
102
|
+
part="toolbar-button toolbar-button-h2"
|
|
103
|
+
></button>
|
|
104
|
+
<vaadin-tooltip for="btn-h2" .text="${this.i18n.h2}"></vaadin-tooltip>
|
|
105
|
+
<button
|
|
106
|
+
id="btn-h3"
|
|
107
|
+
type="button"
|
|
108
|
+
class="ql-header"
|
|
109
|
+
value="3"
|
|
110
|
+
part="toolbar-button toolbar-button-h3"
|
|
111
|
+
></button>
|
|
112
|
+
<vaadin-tooltip for="btn-h3" .text="${this.i18n.h3}"></vaadin-tooltip>
|
|
113
|
+
</span>
|
|
114
|
+
|
|
115
|
+
<span part="toolbar-group toolbar-group-glyph-transformation">
|
|
116
|
+
<!-- Subscript and superscript -->
|
|
117
|
+
<button
|
|
118
|
+
id="btn-subscript"
|
|
119
|
+
class="ql-script"
|
|
120
|
+
value="sub"
|
|
121
|
+
part="toolbar-button toolbar-button-subscript"
|
|
122
|
+
></button>
|
|
123
|
+
<vaadin-tooltip for="btn-subscript" .text="${this.i18n.subscript}"></vaadin-tooltip>
|
|
124
|
+
<button
|
|
125
|
+
id="btn-superscript"
|
|
126
|
+
class="ql-script"
|
|
127
|
+
value="super"
|
|
128
|
+
part="toolbar-button toolbar-button-superscript"
|
|
129
|
+
></button>
|
|
130
|
+
<vaadin-tooltip for="btn-superscript" text="${this.i18n.superscript}"></vaadin-tooltip>
|
|
131
|
+
</span>
|
|
132
|
+
|
|
133
|
+
<span part="toolbar-group toolbar-group-list">
|
|
134
|
+
<!-- List buttons -->
|
|
135
|
+
<button
|
|
136
|
+
id="btn-ol"
|
|
137
|
+
type="button"
|
|
138
|
+
class="ql-list"
|
|
139
|
+
value="ordered"
|
|
140
|
+
part="toolbar-button toolbar-button-list-ordered"
|
|
141
|
+
></button>
|
|
142
|
+
<vaadin-tooltip for="btn-ol" text="${this.i18n.listOrdered}"></vaadin-tooltip>
|
|
143
|
+
<button
|
|
144
|
+
id="btn-ul"
|
|
145
|
+
type="button"
|
|
146
|
+
class="ql-list"
|
|
147
|
+
value="bullet"
|
|
148
|
+
part="toolbar-button toolbar-button-list-bullet"
|
|
149
|
+
></button>
|
|
150
|
+
<vaadin-tooltip for="btn-ul" text="${this.i18n.listBullet}"></vaadin-tooltip>
|
|
151
|
+
</span>
|
|
152
|
+
|
|
153
|
+
<span part="toolbar-group toolbar-group-alignment">
|
|
154
|
+
<!-- Align buttons -->
|
|
155
|
+
<button
|
|
156
|
+
id="btn-left"
|
|
157
|
+
type="button"
|
|
158
|
+
class="ql-align"
|
|
159
|
+
value=""
|
|
160
|
+
part="toolbar-button toolbar-button-align-left"
|
|
161
|
+
></button>
|
|
162
|
+
<vaadin-tooltip for="btn-left" .text="${this.i18n.alignLeft}"></vaadin-tooltip>
|
|
163
|
+
<button
|
|
164
|
+
id="btn-center"
|
|
165
|
+
type="button"
|
|
166
|
+
class="ql-align"
|
|
167
|
+
value="center"
|
|
168
|
+
part="toolbar-button toolbar-button-align-center"
|
|
169
|
+
></button>
|
|
170
|
+
<vaadin-tooltip for="btn-center" .text="${this.i18n.alignCenter}"></vaadin-tooltip>
|
|
171
|
+
<button
|
|
172
|
+
id="btn-right"
|
|
173
|
+
type="button"
|
|
174
|
+
class="ql-align"
|
|
175
|
+
value="right"
|
|
176
|
+
part="toolbar-button toolbar-button-align-right"
|
|
177
|
+
></button>
|
|
178
|
+
<vaadin-tooltip for="btn-right" .text="${this.i18n.alignRight}"></vaadin-tooltip>
|
|
179
|
+
</span>
|
|
180
|
+
|
|
181
|
+
<span part="toolbar-group toolbar-group-rich-text">
|
|
182
|
+
<!-- Image -->
|
|
183
|
+
<button
|
|
184
|
+
id="btn-image"
|
|
185
|
+
type="button"
|
|
186
|
+
part="toolbar-button toolbar-button-image"
|
|
187
|
+
@touchend="${this._onImageTouchEnd}"
|
|
188
|
+
@click="${this._onImageClick}"
|
|
189
|
+
></button>
|
|
190
|
+
<vaadin-tooltip for="btn-image" .text="${this.i18n.image}"></vaadin-tooltip>
|
|
191
|
+
<!-- Link -->
|
|
192
|
+
<button
|
|
193
|
+
id="btn-link"
|
|
194
|
+
type="button"
|
|
195
|
+
part="toolbar-button toolbar-button-link"
|
|
196
|
+
@click="${this._onLinkClick}"
|
|
197
|
+
></button>
|
|
198
|
+
<vaadin-tooltip for="btn-link" .text="${this.i18n.link}"></vaadin-tooltip>
|
|
199
|
+
</span>
|
|
200
|
+
|
|
201
|
+
<span part="toolbar-group toolbar-group-block">
|
|
202
|
+
<!-- Blockquote -->
|
|
203
|
+
<button
|
|
204
|
+
id="btn-blockquote"
|
|
205
|
+
type="button"
|
|
206
|
+
class="ql-blockquote"
|
|
207
|
+
part="toolbar-button toolbar-button-blockquote"
|
|
208
|
+
></button>
|
|
209
|
+
<vaadin-tooltip for="btn-blockquote" .text="${this.i18n.blockquote}"></vaadin-tooltip>
|
|
210
|
+
<!-- Code block -->
|
|
211
|
+
<button
|
|
212
|
+
id="btn-code"
|
|
213
|
+
type="button"
|
|
214
|
+
class="ql-code-block"
|
|
215
|
+
part="toolbar-button toolbar-button-code-block"
|
|
216
|
+
></button>
|
|
217
|
+
<vaadin-tooltip for="btn-code" .text="${this.i18n.codeBlock}"></vaadin-tooltip>
|
|
218
|
+
</span>
|
|
219
|
+
|
|
220
|
+
<span part="toolbar-group toolbar-group-format">
|
|
221
|
+
<!-- Clean -->
|
|
222
|
+
<button id="btn-clean" type="button" class="ql-clean" part="toolbar-button toolbar-button-clean"></button>
|
|
223
|
+
<vaadin-tooltip for="btn-clean" .text="${this.i18n.clean}"></vaadin-tooltip>
|
|
224
|
+
</span>
|
|
225
|
+
|
|
226
|
+
<input
|
|
227
|
+
id="fileInput"
|
|
228
|
+
type="file"
|
|
229
|
+
accept="image/png, image/gif, image/jpeg, image/bmp, image/x-icon"
|
|
230
|
+
@change="${this._uploadImage}"
|
|
231
|
+
/>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<div part="content"></div>
|
|
235
|
+
|
|
236
|
+
<div class="announcer" aria-live="polite"></div>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<vaadin-confirm-dialog
|
|
240
|
+
id="linkDialog"
|
|
241
|
+
.opened="${this._linkEditing}"
|
|
242
|
+
.header="${this.i18n.linkDialogTitle}"
|
|
243
|
+
@opened-changed="${this._onLinkEditingChanged}"
|
|
244
|
+
>
|
|
245
|
+
<vaadin-text-field
|
|
246
|
+
id="linkUrl"
|
|
247
|
+
.value="${this._linkUrl}"
|
|
248
|
+
style="width: 100%;"
|
|
249
|
+
@keydown="${this._onLinkKeydown}"
|
|
250
|
+
@value-changed="${this._onLinkUrlChanged}"
|
|
251
|
+
></vaadin-text-field>
|
|
252
|
+
<vaadin-button id="confirmLink" slot="confirm-button" theme="primary" @click="${this._onLinkEditConfirm}">
|
|
253
|
+
${this.i18n.ok}
|
|
254
|
+
</vaadin-button>
|
|
255
|
+
<vaadin-button
|
|
256
|
+
id="removeLink"
|
|
257
|
+
slot="reject-button"
|
|
258
|
+
theme="error"
|
|
259
|
+
@click="${this._onLinkEditRemove}"
|
|
260
|
+
?hidden="${!this._linkRange}"
|
|
261
|
+
>
|
|
262
|
+
${this.i18n.remove}
|
|
263
|
+
</vaadin-button>
|
|
264
|
+
<vaadin-button id="cancelLink" slot="cancel-button" @click="${this._onLinkEditCancel}">
|
|
265
|
+
${this.i18n.cancel}
|
|
266
|
+
</vaadin-button>
|
|
267
|
+
</vaadin-confirm-dialog>
|
|
268
|
+
`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** @private */
|
|
272
|
+
_onLinkEditingChanged(event) {
|
|
273
|
+
this._linkEditing = event.detail.value;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** @private */
|
|
277
|
+
_onLinkUrlChanged(event) {
|
|
278
|
+
this._linkUrl = event.detail.value;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
defineCustomElement(RichTextEditor);
|
|
283
|
+
|
|
284
|
+
export { RichTextEditor };
|
|
@@ -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,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
|
+
export * from './src/vaadin-rich-text-editor.js';
|