@vaadin/rich-text-editor 24.2.3 → 24.3.0-alpha10
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 +15 -12
- package/src/vaadin-rich-text-editor-mixin.d.ts +109 -0
- package/src/vaadin-rich-text-editor-mixin.js +872 -0
- package/src/vaadin-rich-text-editor-styles.js +30 -1
- package/src/vaadin-rich-text-editor.d.ts +4 -93
- package/src/vaadin-rich-text-editor.js +4 -880
- package/theme/lumo/vaadin-rich-text-editor-styles.js +4 -2
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/rich-text-editor",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.3.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -24,6 +24,8 @@
|
|
|
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",
|
|
27
29
|
"theme",
|
|
28
30
|
"vaadin-*.d.ts",
|
|
29
31
|
"vaadin-*.js",
|
|
@@ -39,20 +41,21 @@
|
|
|
39
41
|
"polymer"
|
|
40
42
|
],
|
|
41
43
|
"dependencies": {
|
|
44
|
+
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
42
45
|
"@polymer/polymer": "^3.0.0",
|
|
43
|
-
"@vaadin/button": "
|
|
44
|
-
"@vaadin/component-base": "
|
|
45
|
-
"@vaadin/confirm-dialog": "
|
|
46
|
-
"@vaadin/text-field": "
|
|
47
|
-
"@vaadin/tooltip": "
|
|
48
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
49
|
-
"@vaadin/vaadin-material-styles": "
|
|
50
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
46
|
+
"@vaadin/button": "24.3.0-alpha10",
|
|
47
|
+
"@vaadin/component-base": "24.3.0-alpha10",
|
|
48
|
+
"@vaadin/confirm-dialog": "24.3.0-alpha10",
|
|
49
|
+
"@vaadin/text-field": "24.3.0-alpha10",
|
|
50
|
+
"@vaadin/tooltip": "24.3.0-alpha10",
|
|
51
|
+
"@vaadin/vaadin-lumo-styles": "24.3.0-alpha10",
|
|
52
|
+
"@vaadin/vaadin-material-styles": "24.3.0-alpha10",
|
|
53
|
+
"@vaadin/vaadin-themable-mixin": "24.3.0-alpha10"
|
|
51
54
|
},
|
|
52
55
|
"devDependencies": {
|
|
53
56
|
"@esm-bundle/chai": "^4.3.4",
|
|
54
|
-
"@vaadin/a11y-base": "
|
|
55
|
-
"@vaadin/testing-helpers": "^0.
|
|
57
|
+
"@vaadin/a11y-base": "24.3.0-alpha10",
|
|
58
|
+
"@vaadin/testing-helpers": "^0.6.0",
|
|
56
59
|
"gulp": "^4.0.2",
|
|
57
60
|
"gulp-cli": "^2.3.0",
|
|
58
61
|
"gulp-iconfont": "^11.0.0",
|
|
@@ -63,5 +66,5 @@
|
|
|
63
66
|
"web-types.json",
|
|
64
67
|
"web-types.lit.json"
|
|
65
68
|
],
|
|
66
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "0271523d93fe5df0425ff64206886614f3c6f401"
|
|
67
70
|
}
|
|
@@ -0,0 +1,109 @@
|
|
|
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 type { Constructor } from '@open-wc/dedupe-mixin';
|
|
12
|
+
|
|
13
|
+
export interface RichTextEditorI18n {
|
|
14
|
+
undo: string;
|
|
15
|
+
redo: string;
|
|
16
|
+
bold: string;
|
|
17
|
+
italic: string;
|
|
18
|
+
underline: string;
|
|
19
|
+
strike: string;
|
|
20
|
+
h1: string;
|
|
21
|
+
h2: string;
|
|
22
|
+
h3: string;
|
|
23
|
+
subscript: string;
|
|
24
|
+
superscript: string;
|
|
25
|
+
listOrdered: string;
|
|
26
|
+
listBullet: string;
|
|
27
|
+
alignLeft: string;
|
|
28
|
+
alignCenter: string;
|
|
29
|
+
alignRight: string;
|
|
30
|
+
image: string;
|
|
31
|
+
link: string;
|
|
32
|
+
blockquote: string;
|
|
33
|
+
codeBlock: string;
|
|
34
|
+
clean: string;
|
|
35
|
+
linkDialogTitle: string;
|
|
36
|
+
ok: string;
|
|
37
|
+
cancel: string;
|
|
38
|
+
remove: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Fired when the `htmlValue` property changes.
|
|
43
|
+
*/
|
|
44
|
+
export type RichTextEditorHtmlValueChangedEvent = CustomEvent<{ value: string }>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Fired when the `value` property changes.
|
|
48
|
+
*/
|
|
49
|
+
export type RichTextEditorValueChangedEvent = CustomEvent<{ value: string }>;
|
|
50
|
+
|
|
51
|
+
export interface RichTextEditorCustomEventMap {
|
|
52
|
+
'html-value-changed': RichTextEditorHtmlValueChangedEvent;
|
|
53
|
+
|
|
54
|
+
'value-changed': RichTextEditorValueChangedEvent;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export declare function RichTextEditorMixin<T extends Constructor<HTMLElement>>(
|
|
58
|
+
base: T,
|
|
59
|
+
): Constructor<RichTextEditorMixinClass> & T;
|
|
60
|
+
|
|
61
|
+
export declare class RichTextEditorMixinClass {
|
|
62
|
+
/**
|
|
63
|
+
* Value is a list of the operations which describe change to the document.
|
|
64
|
+
* Each of those operations describe the change at the current index.
|
|
65
|
+
* They can be an `insert`, `delete` or `retain`. The format is as follows:
|
|
66
|
+
*
|
|
67
|
+
* ```js
|
|
68
|
+
* [
|
|
69
|
+
* { insert: 'Hello World' },
|
|
70
|
+
* { insert: '!', attributes: { bold: true }}
|
|
71
|
+
* ]
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* See also https://github.com/quilljs/delta for detailed documentation.
|
|
75
|
+
*/
|
|
76
|
+
value: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* HTML representation of the rich text editor content.
|
|
80
|
+
*/
|
|
81
|
+
readonly htmlValue: string | null | undefined;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* When true, the user can not modify, nor copy the editor content.
|
|
85
|
+
*/
|
|
86
|
+
disabled: boolean;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* When true, the user can not modify the editor content, but can copy it.
|
|
90
|
+
*/
|
|
91
|
+
readonly: boolean;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* An object used to localize this component. The properties are used
|
|
95
|
+
* e.g. as the tooltips for the editor toolbar buttons.
|
|
96
|
+
*/
|
|
97
|
+
i18n: RichTextEditorI18n;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Sets content represented by HTML snippet into the editor.
|
|
101
|
+
* The snippet is interpreted by [Quill's Clipboard matchers](https://quilljs.com/docs/modules/clipboard/#matchers),
|
|
102
|
+
* which may not produce the exactly input HTML.
|
|
103
|
+
*
|
|
104
|
+
* **NOTE:** Improper handling of HTML can lead to cross site scripting (XSS) and failure to sanitize
|
|
105
|
+
* properly is both notoriously error-prone and a leading cause of web vulnerabilities.
|
|
106
|
+
* This method is aptly named to ensure the developer has taken the necessary precautions.
|
|
107
|
+
*/
|
|
108
|
+
dangerouslySetHtmlValue(htmlValue: string): void;
|
|
109
|
+
}
|