@vaadin/rich-text-editor 24.4.0-dev.b3e1d14600 → 24.5.0-alpha1
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/LICENSE +3 -1141
- package/README.md +0 -1
- package/package.json +11 -11
- package/src/vaadin-lit-rich-text-editor-popup.js +91 -0
- package/src/vaadin-lit-rich-text-editor.d.ts +1 -1
- package/src/vaadin-lit-rich-text-editor.js +48 -2
- 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-mixin.d.ts +13 -1
- package/src/vaadin-rich-text-editor-mixin.js +101 -5
- package/src/vaadin-rich-text-editor-popup-mixin.js +70 -0
- package/src/vaadin-rich-text-editor-popup.js +88 -0
- package/src/vaadin-rich-text-editor-styles.js +1 -1
- package/src/vaadin-rich-text-editor-toolbar-styles.js +35 -1
- package/src/vaadin-rich-text-editor.d.ts +4 -1
- package/src/vaadin-rich-text-editor.js +38 -1
- package/theme/lumo/vaadin-lit-rich-text-editor.d.ts +6 -0
- package/theme/lumo/vaadin-rich-text-editor-styles.d.ts +4 -0
- package/theme/lumo/vaadin-rich-text-editor-styles.js +47 -2
- package/theme/lumo/vaadin-rich-text-editor.d.ts +6 -0
- package/theme/material/vaadin-lit-rich-text-editor.d.ts +6 -0
- package/theme/material/vaadin-rich-text-editor-styles.d.ts +1 -0
- package/theme/material/vaadin-rich-text-editor-styles.js +40 -0
- package/theme/material/vaadin-rich-text-editor.d.ts +6 -0
- package/web-types.json +121 -0
- package/web-types.lit.json +83 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -57,6 +57,7 @@ export interface RichTextEditorEventMap extends HTMLElementEventMap, RichTextEdi
|
|
|
57
57
|
* `toolbar-group-history` | The group for histroy controls
|
|
58
58
|
* `toolbar-group-emphasis` | The group for emphasis controls
|
|
59
59
|
* `toolbar-group-heading` | The group for heading controls
|
|
60
|
+
* `toolbar-group-style` | The group for style controls
|
|
60
61
|
* `toolbar-group-glyph-transformation` | The group for glyph transformation controls
|
|
61
62
|
* `toolbar-group-group-list` | The group for group list controls
|
|
62
63
|
* `toolbar-group-alignment` | The group for alignment controls
|
|
@@ -71,6 +72,8 @@ export interface RichTextEditorEventMap extends HTMLElementEventMap, RichTextEdi
|
|
|
71
72
|
* `toolbar-button-italic` | The "italic" button
|
|
72
73
|
* `toolbar-button-underline` | The "underline" button
|
|
73
74
|
* `toolbar-button-strike` | The "strike-through" button
|
|
75
|
+
* `toolbar-button-color` | The "color" button
|
|
76
|
+
* `toolbar-button-background` | The "background" button
|
|
74
77
|
* `toolbar-button-h1` | The "header 1" button
|
|
75
78
|
* `toolbar-button-h2` | The "header 2" button
|
|
76
79
|
* `toolbar-button-h3` | The "header 3" button
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c) 2000 -
|
|
3
|
+
* Copyright (c) 2000 - 2024 Vaadin Ltd.
|
|
4
4
|
*
|
|
5
5
|
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
6
|
*
|
|
@@ -12,6 +12,7 @@ import '@vaadin/button/src/vaadin-button.js';
|
|
|
12
12
|
import '@vaadin/confirm-dialog/src/vaadin-confirm-dialog.js';
|
|
13
13
|
import '@vaadin/text-field/src/vaadin-text-field.js';
|
|
14
14
|
import '@vaadin/tooltip/src/vaadin-tooltip.js';
|
|
15
|
+
import './vaadin-rich-text-editor-popup.js';
|
|
15
16
|
import './vaadin-rich-text-editor-toolbar-styles.js';
|
|
16
17
|
import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
17
18
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
@@ -55,6 +56,7 @@ registerStyles('vaadin-rich-text-editor', richTextEditorStyles, { moduleId: 'vaa
|
|
|
55
56
|
* `toolbar-group-history` | The group for histroy controls
|
|
56
57
|
* `toolbar-group-emphasis` | The group for emphasis controls
|
|
57
58
|
* `toolbar-group-heading` | The group for heading controls
|
|
59
|
+
* `toolbar-group-style` | The group for style controls
|
|
58
60
|
* `toolbar-group-glyph-transformation` | The group for glyph transformation controls
|
|
59
61
|
* `toolbar-group-group-list` | The group for group list controls
|
|
60
62
|
* `toolbar-group-alignment` | The group for alignment controls
|
|
@@ -69,6 +71,8 @@ registerStyles('vaadin-rich-text-editor', richTextEditorStyles, { moduleId: 'vaa
|
|
|
69
71
|
* `toolbar-button-italic` | The "italic" button
|
|
70
72
|
* `toolbar-button-underline` | The "underline" button
|
|
71
73
|
* `toolbar-button-strike` | The "strike-through" button
|
|
74
|
+
* `toolbar-button-color` | The "color" button
|
|
75
|
+
* `toolbar-button-background` | The "background" button
|
|
72
76
|
* `toolbar-button-h1` | The "header 1" button
|
|
73
77
|
* `toolbar-button-h2` | The "header 2" button
|
|
74
78
|
* `toolbar-button-h3` | The "header 3" button
|
|
@@ -130,6 +134,25 @@ class RichTextEditor extends RichTextEditorMixin(ElementMixin(ThemableMixin(Poly
|
|
|
130
134
|
<vaadin-tooltip for="btn-strike" text="[[i18n.strike]]"></vaadin-tooltip>
|
|
131
135
|
</span>
|
|
132
136
|
|
|
137
|
+
<span part="toolbar-group toolbar-group-style">
|
|
138
|
+
<!-- Color -->
|
|
139
|
+
<button
|
|
140
|
+
id="btn-color"
|
|
141
|
+
type="button"
|
|
142
|
+
part="toolbar-button toolbar-button-color"
|
|
143
|
+
on-click="__onColorClick"
|
|
144
|
+
></button>
|
|
145
|
+
<vaadin-tooltip for="btn-color" text="[[i18n.color]]"></vaadin-tooltip>
|
|
146
|
+
<!-- Background -->
|
|
147
|
+
<button
|
|
148
|
+
id="btn-background"
|
|
149
|
+
type="button"
|
|
150
|
+
part="toolbar-button toolbar-button-background"
|
|
151
|
+
on-click="__onBackgroundClick"
|
|
152
|
+
></button>
|
|
153
|
+
<vaadin-tooltip for="btn-background" text="[[i18n.background]]"></vaadin-tooltip>
|
|
154
|
+
</span>
|
|
155
|
+
|
|
133
156
|
<span part="toolbar-group toolbar-group-heading">
|
|
134
157
|
<!-- Header buttons -->
|
|
135
158
|
<button
|
|
@@ -305,6 +328,20 @@ class RichTextEditor extends RichTextEditorMixin(ElementMixin(ThemableMixin(Poly
|
|
|
305
328
|
[[i18n.cancel]]
|
|
306
329
|
</vaadin-button>
|
|
307
330
|
</vaadin-confirm-dialog>
|
|
331
|
+
|
|
332
|
+
<vaadin-rich-text-editor-popup
|
|
333
|
+
id="colorPopup"
|
|
334
|
+
colors="[[colorOptions]]"
|
|
335
|
+
opened="{{_colorEditing}}"
|
|
336
|
+
on-color-selected="__onColorSelected"
|
|
337
|
+
></vaadin-rich-text-editor-popup>
|
|
338
|
+
|
|
339
|
+
<vaadin-rich-text-editor-popup
|
|
340
|
+
id="backgroundPopup"
|
|
341
|
+
colors="[[colorOptions]]"
|
|
342
|
+
opened="{{_backgroundEditing}}"
|
|
343
|
+
on-color-selected="__onBackgroundSelected"
|
|
344
|
+
></vaadin-rich-text-editor-popup>
|
|
308
345
|
`;
|
|
309
346
|
}
|
|
310
347
|
|
|
@@ -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';
|
|
@@ -3,9 +3,37 @@ import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
|
3
3
|
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
4
4
|
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
5
5
|
import { color } from '@vaadin/vaadin-lumo-styles/color.js';
|
|
6
|
+
import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
|
|
6
7
|
import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
|
|
7
8
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
9
|
|
|
10
|
+
const popupOverlay = css`
|
|
11
|
+
[part='overlay'] {
|
|
12
|
+
margin: var(--lumo-space-xs) 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
[part='content'] {
|
|
16
|
+
padding: var(--lumo-space-xs);
|
|
17
|
+
max-width: calc(7 * (var(--_button-size) + var(--_button-margin) * 2));
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-wrap: wrap;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
--_button-size: 1.25rem;
|
|
22
|
+
--_button-margin: 3px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[part='content'] ::slotted(button) {
|
|
26
|
+
border: none;
|
|
27
|
+
width: var(--_button-size);
|
|
28
|
+
height: var(--_button-size);
|
|
29
|
+
margin: var(--_button-margin);
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
registerStyles('vaadin-rich-text-editor-popup-overlay', [overlay, popupOverlay], {
|
|
34
|
+
moduleId: 'lumo-rich-text-editor-popup-overlay',
|
|
35
|
+
});
|
|
36
|
+
|
|
9
37
|
const richTextEditor = css`
|
|
10
38
|
:host {
|
|
11
39
|
min-height: calc(var(--lumo-size-m) * 8);
|
|
@@ -32,7 +60,8 @@ const richTextEditor = css`
|
|
|
32
60
|
transition: background-color 100ms, color 100ms;
|
|
33
61
|
}
|
|
34
62
|
|
|
35
|
-
[part~='toolbar-button']:focus
|
|
63
|
+
[part~='toolbar-button']:focus,
|
|
64
|
+
[part~='toolbar-button'][aria-expanded='true'] {
|
|
36
65
|
outline: none;
|
|
37
66
|
box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
38
67
|
}
|
|
@@ -40,7 +69,6 @@ const richTextEditor = css`
|
|
|
40
69
|
[part~='toolbar-button']:hover {
|
|
41
70
|
background-color: var(--lumo-contrast-5pct);
|
|
42
71
|
color: var(--lumo-contrast-80pct);
|
|
43
|
-
box-shadow: none;
|
|
44
72
|
}
|
|
45
73
|
|
|
46
74
|
@media (hover: none) {
|
|
@@ -73,6 +101,8 @@ const richTextEditor = css`
|
|
|
73
101
|
}
|
|
74
102
|
|
|
75
103
|
[part~='toolbar-button-bold']::before,
|
|
104
|
+
[part~='toolbar-button-background']::before,
|
|
105
|
+
[part~='toolbar-button-color']::before,
|
|
76
106
|
[part~='toolbar-button-italic']::before,
|
|
77
107
|
[part~='toolbar-button-underline']::before,
|
|
78
108
|
[part~='toolbar-button-strike']::before {
|
|
@@ -84,6 +114,21 @@ const richTextEditor = css`
|
|
|
84
114
|
font-weight: 700;
|
|
85
115
|
}
|
|
86
116
|
|
|
117
|
+
[part~='toolbar-button-background']::before {
|
|
118
|
+
background-color: var(--lumo-base-color);
|
|
119
|
+
background-image: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[part~='toolbar-button-background']:hover::before {
|
|
123
|
+
background-image: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct)),
|
|
124
|
+
linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
[part~='toolbar-button-background']:active::before {
|
|
128
|
+
background-image: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct)),
|
|
129
|
+
linear-gradient(var(--lumo-contrast-10pct), var(--lumo-contrast-10pct));
|
|
130
|
+
}
|
|
131
|
+
|
|
87
132
|
[part~='toolbar-button-h1']::before,
|
|
88
133
|
[part~='toolbar-button-h2']::before,
|
|
89
134
|
[part~='toolbar-button-h3']::before {
|
|
@@ -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';
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
+
import { overlay } from '@vaadin/vaadin-material-styles/mixins/overlay.js';
|
|
2
3
|
import { typography } from '@vaadin/vaadin-material-styles/typography.js';
|
|
3
4
|
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
4
5
|
|
|
6
|
+
const popupOverlay = css`
|
|
7
|
+
[part='overlay'] {
|
|
8
|
+
margin: 0.25rem 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[part='content'] {
|
|
12
|
+
padding: 0.25rem;
|
|
13
|
+
max-width: calc(7 * (var(--_button-size) + var(--_button-margin) * 2));
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
--_button-size: 1.25rem;
|
|
18
|
+
--_button-margin: 3px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[part='content'] ::slotted(button) {
|
|
22
|
+
border: none;
|
|
23
|
+
width: var(--_button-size);
|
|
24
|
+
height: var(--_button-size);
|
|
25
|
+
margin: var(--_button-margin);
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
registerStyles('vaadin-rich-text-editor-popup-overlay', [overlay, popupOverlay], {
|
|
30
|
+
moduleId: 'material-rich-text-editor-popup-overlay',
|
|
31
|
+
});
|
|
32
|
+
|
|
5
33
|
const richTextEditor = css`
|
|
6
34
|
:host {
|
|
7
35
|
background-color: var(--material-background-color);
|
|
@@ -37,6 +65,10 @@ const richTextEditor = css`
|
|
|
37
65
|
color: inherit;
|
|
38
66
|
}
|
|
39
67
|
|
|
68
|
+
[part~='toolbar-button'][aria-expanded='true'] {
|
|
69
|
+
outline: -webkit-focus-ring-color auto 1px;
|
|
70
|
+
}
|
|
71
|
+
|
|
40
72
|
[part~='toolbar-button'][on] {
|
|
41
73
|
background-color: rgba(0, 0, 0, 0.1);
|
|
42
74
|
color: inherit;
|
|
@@ -71,6 +103,14 @@ const richTextEditor = css`
|
|
|
71
103
|
font-size: 20px;
|
|
72
104
|
}
|
|
73
105
|
|
|
106
|
+
[part~='toolbar-button-background']::before {
|
|
107
|
+
background-color: var(--material-secondary-background-color);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[part~='toolbar-button-background']::after {
|
|
111
|
+
inset: 0.25rem;
|
|
112
|
+
}
|
|
113
|
+
|
|
74
114
|
/* TODO unsupported selector */
|
|
75
115
|
[part='content'] > .ql-editor {
|
|
76
116
|
padding: 0 16px;
|
|
@@ -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
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/web-types",
|
|
3
|
+
"name": "@vaadin/rich-text-editor",
|
|
4
|
+
"version": "24.5.0-alpha1",
|
|
5
|
+
"description-markup": "markdown",
|
|
6
|
+
"contributions": {
|
|
7
|
+
"html": {
|
|
8
|
+
"elements": [
|
|
9
|
+
{
|
|
10
|
+
"name": "vaadin-rich-text-editor",
|
|
11
|
+
"description": "`<vaadin-rich-text-editor>` is a Web Component for rich text editing.\nIt provides a set of toolbar controls to apply formatting on the content,\nwhich is stored and can be accessed as HTML5 or JSON string.\n\n```\n<vaadin-rich-text-editor></vaadin-rich-text-editor>\n```\n\nVaadin Rich Text Editor focuses on the structure, not the styling of content.\nTherefore, the semantic HTML5 tags such as <h1>, <strong> and <ul> are used,\nand CSS usage is limited to most common cases, like horizontal text alignment.\n\n### Styling\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-------------|-------------|------------\n`disabled` | Set to a disabled text editor | :host\n`readonly` | Set to a readonly text editor | :host\n`on` | Set to a toolbar button applied to the selected text | toolbar-button\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------------------------------|----------------\n`content` | The content wrapper\n`toolbar` | The toolbar wrapper\n`toolbar-group` | The group for toolbar controls\n`toolbar-group-history` | The group for histroy controls\n`toolbar-group-emphasis` | The group for emphasis controls\n`toolbar-group-heading` | The group for heading controls\n`toolbar-group-style` | The group for style controls\n`toolbar-group-glyph-transformation` | The group for glyph transformation controls\n`toolbar-group-group-list` | The group for group list controls\n`toolbar-group-alignment` | The group for alignment controls\n`toolbar-group-rich-text` | The group for rich text controls\n`toolbar-group-block` | The group for preformatted block controls\n`toolbar-group-format` | The group for format controls\n`toolbar-button` | The toolbar button (applies to all buttons)\n`toolbar-button-pressed` | The toolbar button in pressed state (applies to all buttons)\n`toolbar-button-undo` | The \"undo\" button\n`toolbar-button-redo` | The \"redo\" button\n`toolbar-button-bold` | The \"bold\" button\n`toolbar-button-italic` | The \"italic\" button\n`toolbar-button-underline` | The \"underline\" button\n`toolbar-button-strike` | The \"strike-through\" button\n`toolbar-button-color` | The \"color\" button\n`toolbar-button-background` | The \"background\" button\n`toolbar-button-h1` | The \"header 1\" button\n`toolbar-button-h2` | The \"header 2\" button\n`toolbar-button-h3` | The \"header 3\" button\n`toolbar-button-subscript` | The \"subscript\" button\n`toolbar-button-superscript` | The \"superscript\" button\n`toolbar-button-list-ordered` | The \"ordered list\" button\n`toolbar-button-list-bullet` | The \"bullet list\" button\n`toolbar-button-align-left` | The \"left align\" button\n`toolbar-button-align-center` | The \"center align\" button\n`toolbar-button-align-right` | The \"right align\" button\n`toolbar-button-image` | The \"image\" button\n`toolbar-button-link` | The \"link\" button\n`toolbar-button-blockquote` | The \"blockquote\" button\n`toolbar-button-code-block` | The \"code block\" button\n`toolbar-button-clean` | The \"clean formatting\" button\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
12
|
+
"attributes": [
|
|
13
|
+
{
|
|
14
|
+
"name": "value",
|
|
15
|
+
"description": "Value is a list of the operations which describe change to the document.\nEach of those operations describe the change at the current index.\nThey can be an `insert`, `delete` or `retain`. The format is as follows:\n\n```js\n [\n { insert: 'Hello World' },\n { insert: '!', attributes: { bold: true }}\n ]\n```\n\nSee also https://github.com/quilljs/delta for detailed documentation.",
|
|
16
|
+
"value": {
|
|
17
|
+
"type": [
|
|
18
|
+
"string"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "disabled",
|
|
24
|
+
"description": "When true, the user can not modify, nor copy the editor content.",
|
|
25
|
+
"value": {
|
|
26
|
+
"type": [
|
|
27
|
+
"boolean"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "readonly",
|
|
33
|
+
"description": "When true, the user can not modify the editor content, but can copy it.",
|
|
34
|
+
"value": {
|
|
35
|
+
"type": [
|
|
36
|
+
"boolean"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "theme",
|
|
42
|
+
"description": "The theme variants to apply to the component.",
|
|
43
|
+
"value": {
|
|
44
|
+
"type": [
|
|
45
|
+
"string",
|
|
46
|
+
"null",
|
|
47
|
+
"undefined"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"js": {
|
|
53
|
+
"properties": [
|
|
54
|
+
{
|
|
55
|
+
"name": "value",
|
|
56
|
+
"description": "Value is a list of the operations which describe change to the document.\nEach of those operations describe the change at the current index.\nThey can be an `insert`, `delete` or `retain`. The format is as follows:\n\n```js\n [\n { insert: 'Hello World' },\n { insert: '!', attributes: { bold: true }}\n ]\n```\n\nSee also https://github.com/quilljs/delta for detailed documentation.",
|
|
57
|
+
"value": {
|
|
58
|
+
"type": [
|
|
59
|
+
"string"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "disabled",
|
|
65
|
+
"description": "When true, the user can not modify, nor copy the editor content.",
|
|
66
|
+
"value": {
|
|
67
|
+
"type": [
|
|
68
|
+
"boolean"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"name": "readonly",
|
|
74
|
+
"description": "When true, the user can not modify the editor content, but can copy it.",
|
|
75
|
+
"value": {
|
|
76
|
+
"type": [
|
|
77
|
+
"boolean"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "i18n",
|
|
83
|
+
"description": "An object used to localize this component. The properties are used\ne.g. as the tooltips for the editor toolbar buttons.",
|
|
84
|
+
"value": {
|
|
85
|
+
"type": [
|
|
86
|
+
"RichTextEditorI18n"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "colorOptions",
|
|
92
|
+
"description": "The list of colors used by the background and text color\nselection controls. Should contain an array of HEX strings.\n\nWhen user selects `#000000` (black) as a text color,\nor `#ffffff` (white) as a background color, it resets\nthe corresponding format for the selected text.",
|
|
93
|
+
"value": {
|
|
94
|
+
"type": [
|
|
95
|
+
"Array",
|
|
96
|
+
"null",
|
|
97
|
+
"undefined"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"events": [
|
|
103
|
+
{
|
|
104
|
+
"name": "change",
|
|
105
|
+
"description": "Fired when the user commits a value change."
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"name": "value-changed",
|
|
109
|
+
"description": "Fired when the `value` property changes."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "html-value-changed",
|
|
113
|
+
"description": "Fired when the `htmlValue` property changes."
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/web-types",
|
|
3
|
+
"name": "@vaadin/rich-text-editor",
|
|
4
|
+
"version": "24.5.0-alpha1",
|
|
5
|
+
"description-markup": "markdown",
|
|
6
|
+
"framework": "lit",
|
|
7
|
+
"framework-config": {
|
|
8
|
+
"enable-when": {
|
|
9
|
+
"node-packages": [
|
|
10
|
+
"lit"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"contributions": {
|
|
15
|
+
"html": {
|
|
16
|
+
"elements": [
|
|
17
|
+
{
|
|
18
|
+
"name": "vaadin-rich-text-editor",
|
|
19
|
+
"description": "`<vaadin-rich-text-editor>` is a Web Component for rich text editing.\nIt provides a set of toolbar controls to apply formatting on the content,\nwhich is stored and can be accessed as HTML5 or JSON string.\n\n```\n<vaadin-rich-text-editor></vaadin-rich-text-editor>\n```\n\nVaadin Rich Text Editor focuses on the structure, not the styling of content.\nTherefore, the semantic HTML5 tags such as <h1>, <strong> and <ul> are used,\nand CSS usage is limited to most common cases, like horizontal text alignment.\n\n### Styling\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n-------------|-------------|------------\n`disabled` | Set to a disabled text editor | :host\n`readonly` | Set to a readonly text editor | :host\n`on` | Set to a toolbar button applied to the selected text | toolbar-button\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------------------------------|----------------\n`content` | The content wrapper\n`toolbar` | The toolbar wrapper\n`toolbar-group` | The group for toolbar controls\n`toolbar-group-history` | The group for histroy controls\n`toolbar-group-emphasis` | The group for emphasis controls\n`toolbar-group-heading` | The group for heading controls\n`toolbar-group-style` | The group for style controls\n`toolbar-group-glyph-transformation` | The group for glyph transformation controls\n`toolbar-group-group-list` | The group for group list controls\n`toolbar-group-alignment` | The group for alignment controls\n`toolbar-group-rich-text` | The group for rich text controls\n`toolbar-group-block` | The group for preformatted block controls\n`toolbar-group-format` | The group for format controls\n`toolbar-button` | The toolbar button (applies to all buttons)\n`toolbar-button-pressed` | The toolbar button in pressed state (applies to all buttons)\n`toolbar-button-undo` | The \"undo\" button\n`toolbar-button-redo` | The \"redo\" button\n`toolbar-button-bold` | The \"bold\" button\n`toolbar-button-italic` | The \"italic\" button\n`toolbar-button-underline` | The \"underline\" button\n`toolbar-button-strike` | The \"strike-through\" button\n`toolbar-button-color` | The \"color\" button\n`toolbar-button-background` | The \"background\" button\n`toolbar-button-h1` | The \"header 1\" button\n`toolbar-button-h2` | The \"header 2\" button\n`toolbar-button-h3` | The \"header 3\" button\n`toolbar-button-subscript` | The \"subscript\" button\n`toolbar-button-superscript` | The \"superscript\" button\n`toolbar-button-list-ordered` | The \"ordered list\" button\n`toolbar-button-list-bullet` | The \"bullet list\" button\n`toolbar-button-align-left` | The \"left align\" button\n`toolbar-button-align-center` | The \"center align\" button\n`toolbar-button-align-right` | The \"right align\" button\n`toolbar-button-image` | The \"image\" button\n`toolbar-button-link` | The \"link\" button\n`toolbar-button-blockquote` | The \"blockquote\" button\n`toolbar-button-code-block` | The \"code block\" button\n`toolbar-button-clean` | The \"clean formatting\" button\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
20
|
+
"extension": true,
|
|
21
|
+
"attributes": [
|
|
22
|
+
{
|
|
23
|
+
"name": "?disabled",
|
|
24
|
+
"description": "When true, the user can not modify, nor copy the editor content.",
|
|
25
|
+
"value": {
|
|
26
|
+
"kind": "expression"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "?readonly",
|
|
31
|
+
"description": "When true, the user can not modify the editor content, but can copy it.",
|
|
32
|
+
"value": {
|
|
33
|
+
"kind": "expression"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": ".value",
|
|
38
|
+
"description": "Value is a list of the operations which describe change to the document.\nEach of those operations describe the change at the current index.\nThey can be an `insert`, `delete` or `retain`. The format is as follows:\n\n```js\n [\n { insert: 'Hello World' },\n { insert: '!', attributes: { bold: true }}\n ]\n```\n\nSee also https://github.com/quilljs/delta for detailed documentation.",
|
|
39
|
+
"value": {
|
|
40
|
+
"kind": "expression"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": ".i18n",
|
|
45
|
+
"description": "An object used to localize this component. The properties are used\ne.g. as the tooltips for the editor toolbar buttons.",
|
|
46
|
+
"value": {
|
|
47
|
+
"kind": "expression"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": ".colorOptions",
|
|
52
|
+
"description": "The list of colors used by the background and text color\nselection controls. Should contain an array of HEX strings.\n\nWhen user selects `#000000` (black) as a text color,\nor `#ffffff` (white) as a background color, it resets\nthe corresponding format for the selected text.",
|
|
53
|
+
"value": {
|
|
54
|
+
"kind": "expression"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "@change",
|
|
59
|
+
"description": "Fired when the user commits a value change.",
|
|
60
|
+
"value": {
|
|
61
|
+
"kind": "expression"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "@value-changed",
|
|
66
|
+
"description": "Fired when the `value` property changes.",
|
|
67
|
+
"value": {
|
|
68
|
+
"kind": "expression"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "@html-value-changed",
|
|
73
|
+
"description": "Fired when the `htmlValue` property changes.",
|
|
74
|
+
"value": {
|
|
75
|
+
"kind": "expression"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|