@vaadin/rich-text-editor 25.0.0-alpha1 → 25.0.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.
@@ -1,118 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2000 - 2025 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 { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
-
13
- export const contentStyles = css`
14
- [part='content'] {
15
- box-sizing: border-box;
16
- position: relative;
17
- flex: auto;
18
- display: flex;
19
- flex-direction: column;
20
- overflow: hidden;
21
- }
22
-
23
- /*
24
- Quill core styles.
25
- CSS selectors removed: margin & padding reset, check list, indentation, video, colors, ordered & unordered list, h1-6, anchor
26
- */
27
- .ql-clipboard {
28
- left: -100000px;
29
- height: 1px;
30
- overflow-y: hidden;
31
- position: absolute;
32
- top: 50%;
33
- }
34
-
35
- .ql-clipboard p {
36
- margin: 0;
37
- padding: 0;
38
- }
39
-
40
- .ql-editor {
41
- box-sizing: border-box;
42
- line-height: 1.42;
43
- height: 100%;
44
- outline: none;
45
- overflow-y: auto;
46
- padding: 0.75em 1em;
47
- -moz-tab-size: 4;
48
- tab-size: 4;
49
- text-align: left;
50
- white-space: pre-wrap;
51
- word-wrap: break-word;
52
- flex: 1;
53
- }
54
-
55
- .ql-editor > * {
56
- cursor: text;
57
- }
58
-
59
- .ql-align-left {
60
- text-align: left;
61
- }
62
-
63
- .ql-direction-rtl {
64
- direction: rtl;
65
- text-align: inherit;
66
- }
67
-
68
- .ql-align-center {
69
- text-align: center;
70
- }
71
-
72
- .ql-align-justify {
73
- text-align: justify;
74
- }
75
-
76
- .ql-align-right {
77
- text-align: right;
78
- }
79
- /* quill core end */
80
-
81
- blockquote {
82
- border-left: 0.25em solid #ccc;
83
- margin-bottom: 0.3125em;
84
- margin-top: 0.3125em;
85
- padding-left: 1em;
86
- }
87
-
88
- code,
89
- pre {
90
- background-color: #f0f0f0;
91
- border-radius: 0.1875em;
92
- }
93
-
94
- pre {
95
- white-space: pre-wrap;
96
- margin-bottom: 0.3125em;
97
- margin-top: 0.3125em;
98
- padding: 0.3125em 0.625em;
99
- }
100
-
101
- code {
102
- font-size: 85%;
103
- padding: 0.125em 0.25em;
104
- }
105
-
106
- img {
107
- max-width: 100%;
108
- }
109
-
110
- /* RTL specific styles */
111
- :host([dir='rtl']) .ql-editor {
112
- direction: rtl;
113
- text-align: right;
114
- }
115
- `;
116
-
117
- // Register a module with ID for backwards compatibility.
118
- registerStyles('', contentStyles, { moduleId: 'vaadin-rich-text-editor-content-styles' });
@@ -1,93 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2000 - 2025 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 { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
-
13
- const template = document.createElement('template');
14
-
15
- template.innerHTML = `
16
- <style>
17
- @font-face {
18
- font-family: 'vaadin-rte-icons';
19
- src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAbIAAsAAAAAC3AAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAQwAAAFZAIUsmY21hcAAAAYgAAAB2AAAB7jNk7w5nbHlmAAACAAAAAm8AAAOwZpaNL2hlYWQAAARwAAAAMAAAADZbE6SjaGhlYQAABKAAAAAdAAAAJAb9A15obXR4AAAEwAAAABAAAAAsJxAAAGxvY2EAAATQAAAAGAAAABgEUAVEbWF4cAAABOgAAAAfAAAAIAEbADtuYW1lAAAFCAAAAVYAAAMSlciz2nBvc3QAAAZgAAAAZwAAAJOZ/fmIeJxjYGRgY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wKmLESEdJSlcy1gkv85GqZT5NxUpZxfw+W16+ZIvjw2Ohufk1aq0yQs9Rpr3uq6GqOYlOpFNrOq9sMRAzTbGgB4nGNgZGBgAOI3/vVz4vltvjJwM78AijDUqG5oRND/nzGvZLoG5HIwMIFEAVO2DAV4nGNgZGBgDvqfBSRfMAAB80oGRgZUwA0AWFIDYwAAAHicY2BgYGB+QRwGAMEQCS8AAAAAACgATgB2AJgAvgECAUYBhAGuAdh4nGNgZGBg4GbQZ2BjAAEmIOYCQgaG/2A+AwAOlAFXAHicpZK7TsMwGIVPekO0CCEhsSFlQF2Q08vYjaXdO3REShMnTZXEkeNW7cbEI/AevANi5okQJ8YTQwdqS/bnc87/24oC4Aaf8NAMD/d2bUYLFzz9cpv04LhDfnLcxQDPjnvUM8d9POLV8QC3eGcHr3NJZYYPxy1c49txGzPvynGHPHfcxZ334rhH/c1xHyvvy/EAw9ZwH4ZxVgqdRRth5MEIGWdGaZFFqqyXMt3loT6ZOWmupK4zVfqTYHwyt5Cl1KGRsb8++vU+nRqT+IlWhT9XpZF5rvxKq62MTLAxppqNRonTg0gV2CPkjPkVSwho7hE2JAOJA1fBvXENFF1hfcVsjSWdFDvkrNdn9Pl/5YqO5p7Zs48JAozP6LegU9qeoU3H7LnGkWvzyhRTqgYJzwkzCgVpbmubdM6pqFTW21KJqAe8u6mq+BeOOJM/+cDeXvwAG1qfYAAAeJxth2sOAiEMBvut4AO4yh6KXSoSa0mwe3+N/HWSSWZooUmg/0QsOMHB44wLrrghICJRytKqrjur8QhzhO8WZ45WH+Z34ay+vXJlJ02fUdrb1u0QYUu/7qPw4OK+dndo6UQf3z4gAwA=) format('woff');
20
- font-weight: normal;
21
- font-style: normal;
22
- }
23
-
24
- html {
25
- --vaadin-rte-icons-align-center: "\\ea01";
26
- --vaadin-rte-icons-align-left: "\\ea02";
27
- --vaadin-rte-icons-align-right: "\\ea03";
28
- --vaadin-rte-icons-clean: "\\ea04";
29
- --vaadin-rte-icons-image: "\\ea05";
30
- --vaadin-rte-icons-link: "\\ea06";
31
- --vaadin-rte-icons-list-bullet: "\\ea07";
32
- --vaadin-rte-icons-list-ordered: "\\ea08";
33
- --vaadin-rte-icons-redo: "\\ea09";
34
- --vaadin-rte-icons-undo: "\\ea0a";
35
- }
36
- </style>
37
- `;
38
-
39
- document.head.appendChild(template.content);
40
-
41
- export const iconsStyles = css`
42
- [part~='toolbar-button-align-center']::before {
43
- content: var(--vaadin-rte-icons-align-center);
44
- }
45
-
46
- [part~='toolbar-button-align-left']::before {
47
- content: var(--vaadin-rte-icons-align-left);
48
- }
49
-
50
- [part~='toolbar-button-align-right']::before {
51
- content: var(--vaadin-rte-icons-align-right);
52
- }
53
-
54
- [part~='toolbar-button-clean']::before {
55
- content: var(--vaadin-rte-icons-clean);
56
- }
57
-
58
- [part~='toolbar-button-image']::before {
59
- content: var(--vaadin-rte-icons-image);
60
- }
61
-
62
- [part~='toolbar-button-link']::before {
63
- content: var(--vaadin-rte-icons-link);
64
- }
65
-
66
- [part~='toolbar-button-list-bullet']::before {
67
- content: var(--vaadin-rte-icons-list-bullet);
68
- }
69
-
70
- [part~='toolbar-button-list-ordered']::before {
71
- content: var(--vaadin-rte-icons-list-ordered);
72
- }
73
-
74
- [part~='toolbar-button-redo']::before {
75
- content: var(--vaadin-rte-icons-redo);
76
- }
77
-
78
- [part~='toolbar-button-undo']::before {
79
- content: var(--vaadin-rte-icons-undo);
80
- }
81
-
82
- /* RTL specific styles */
83
- :host([dir='rtl']) [part~='toolbar-button-redo']::before {
84
- content: var(--vaadin-rte-icons-undo);
85
- }
86
-
87
- :host([dir='rtl']) [part~='toolbar-button-undo']::before {
88
- content: var(--vaadin-rte-icons-redo);
89
- }
90
- `;
91
-
92
- // Register a module with ID for backwards compatibility.
93
- registerStyles('', iconsStyles, { moduleId: 'vaadin-rich-text-editor-icons' });
@@ -1,70 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2000 - 2025 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
-
12
- /**
13
- * @polymerMixin
14
- */
15
- export const RichTextEditorPopupMixin = (superClass) =>
16
- class RichTextEditorPopupMixinClass extends superClass {
17
- static get properties() {
18
- return {
19
- target: {
20
- type: Object,
21
- },
22
-
23
- opened: {
24
- type: Boolean,
25
- notify: true,
26
- },
27
-
28
- colors: {
29
- type: Array,
30
- },
31
-
32
- renderer: {
33
- type: Object,
34
- },
35
- };
36
- }
37
-
38
- static get observers() {
39
- return ['__openedOrTargetChanged(opened, target)', '__colorsChanged(colors)'];
40
- }
41
-
42
- /** @private */
43
- __colorsChanged(colors) {
44
- this.renderer = (root) => {
45
- if (!root.firstChild) {
46
- colors.forEach((color) => {
47
- const btn = document.createElement('button');
48
- btn.style.background = color;
49
- btn.dataset.color = color;
50
- btn.addEventListener('click', () => {
51
- this.dispatchEvent(new CustomEvent('color-selected', { detail: { color } }));
52
- });
53
- root.appendChild(btn);
54
- });
55
- }
56
- };
57
- }
58
-
59
- /** @private */
60
- __openedOrTargetChanged(opened, target) {
61
- if (target) {
62
- target.setAttribute('aria-expanded', opened ? 'true' : 'false');
63
- }
64
- }
65
-
66
- /** @protected */
67
- _onOverlayEscapePress() {
68
- this.target.focus();
69
- }
70
- };
@@ -1,61 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2000 - 2025 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 { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { contentStyles } from './vaadin-rich-text-editor-content-styles.js';
13
- import { toolbarStyles } from './vaadin-rich-text-editor-toolbar-styles.js';
14
-
15
- export const baseStyles = css`
16
- :host {
17
- display: flex;
18
- flex-direction: column;
19
- box-sizing: border-box;
20
- }
21
-
22
- :host([hidden]) {
23
- display: none !important;
24
- }
25
-
26
- .announcer {
27
- position: fixed;
28
- clip: rect(0, 0, 0, 0);
29
- }
30
-
31
- input[type='file'] {
32
- display: none;
33
- }
34
-
35
- .vaadin-rich-text-editor-container {
36
- display: flex;
37
- flex-direction: column;
38
- min-height: inherit;
39
- max-height: inherit;
40
- flex: auto;
41
- }
42
- `;
43
-
44
- export const statesStyles = css`
45
- :host([readonly]) [part='toolbar'] {
46
- display: none;
47
- }
48
-
49
- :host([disabled]) {
50
- pointer-events: none;
51
- opacity: 0.5;
52
- -webkit-user-select: none;
53
- user-select: none;
54
- }
55
-
56
- :host([disabled]) [part~='toolbar-button'] {
57
- background-color: transparent;
58
- }
59
- `;
60
-
61
- export const richTextEditorStyles = [baseStyles, contentStyles, toolbarStyles, statesStyles];
@@ -1,183 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2000 - 2025 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 { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { iconsStyles } from './vaadin-rich-text-editor-icons.js';
13
-
14
- export const buttonsStyles = css`
15
- [part='toolbar'] {
16
- display: flex;
17
- flex-wrap: wrap;
18
- flex-shrink: 0;
19
- }
20
-
21
- [part~='toolbar-button'] {
22
- width: 2em;
23
- height: 2em;
24
- margin: 0;
25
- padding: 0;
26
- font: inherit;
27
- line-height: 1;
28
- text-transform: none;
29
- background: transparent;
30
- border: none;
31
- position: relative;
32
- }
33
-
34
- [part~='toolbar-button']:hover {
35
- outline: none;
36
- }
37
-
38
- @media (forced-colors: active) {
39
- [part~='toolbar-button']:focus,
40
- [part~='toolbar-button']:hover {
41
- outline: 1px solid !important;
42
- }
43
-
44
- [part~='toolbar-button'][on] {
45
- outline: 2px solid;
46
- outline-offset: -1px;
47
- }
48
- }
49
-
50
- [part~='toolbar-button']::before {
51
- position: absolute;
52
- top: 50%;
53
- left: 50%;
54
- transform: translate(-50%, -50%);
55
- }
56
-
57
- [part~='toolbar-button-undo']::before,
58
- [part~='toolbar-button-redo']::before,
59
- [part~='toolbar-button-list-ordered']::before,
60
- [part~='toolbar-button-list-bullet']::before,
61
- [part~='toolbar-button-align-left']::before,
62
- [part~='toolbar-button-align-center']::before,
63
- [part~='toolbar-button-align-right']::before,
64
- [part~='toolbar-button-image']::before,
65
- [part~='toolbar-button-link']::before,
66
- [part~='toolbar-button-clean']::before {
67
- font-family: 'vaadin-rte-icons', sans-serif;
68
- }
69
-
70
- [part~='toolbar-group'] {
71
- display: flex;
72
- margin: 0 0.5em;
73
- }
74
-
75
- [part~='toolbar-button-bold']::before {
76
- content: 'B';
77
- font-weight: 700;
78
- }
79
-
80
- [part~='toolbar-button-italic']::before {
81
- content: 'I';
82
- font-style: italic;
83
- }
84
-
85
- [part~='toolbar-button-underline']::before {
86
- content: 'U';
87
- text-decoration: underline;
88
- }
89
-
90
- [part~='toolbar-button-strike']::before {
91
- content: 'T';
92
- text-decoration: line-through;
93
- }
94
-
95
- [part~='toolbar-button-h1']::before {
96
- content: 'H1';
97
- font-size: 1.25em;
98
- }
99
-
100
- [part~='toolbar-button-h2']::before {
101
- content: 'H2';
102
- font-size: 1em;
103
- }
104
-
105
- [part~='toolbar-button-h3']::before {
106
- content: 'H3';
107
- font-size: 0.875em;
108
- }
109
-
110
- [part~='toolbar-button-h1']::before,
111
- [part~='toolbar-button-h2']::before,
112
- [part~='toolbar-button-h3']::before {
113
- letter-spacing: -0.05em;
114
- }
115
-
116
- [part~='toolbar-button-subscript']::before,
117
- [part~='toolbar-button-superscript']::before {
118
- content: 'X';
119
- }
120
-
121
- [part~='toolbar-button-subscript']::after,
122
- [part~='toolbar-button-superscript']::after {
123
- content: '2';
124
- position: absolute;
125
- top: 50%;
126
- left: 70%;
127
- font-size: 0.625em;
128
- }
129
-
130
- [part~='toolbar-button-superscript']::after {
131
- top: 20%;
132
- }
133
-
134
- [part~='toolbar-button-blockquote']::before {
135
- content: '\\201D';
136
- font-size: 2em;
137
- height: 0.6em;
138
- }
139
-
140
- [part~='toolbar-button-code-block']::before {
141
- content: '</>';
142
- font-size: 0.875em;
143
- }
144
-
145
- [part~='toolbar-button-background']::before,
146
- [part~='toolbar-button-color']::before {
147
- content: 'A';
148
- font-size: 1em;
149
- }
150
-
151
- [part~='toolbar-button-color']::after {
152
- content: '';
153
- position: absolute;
154
- bottom: 4px;
155
- left: 25%;
156
- right: 25%;
157
- width: 50%;
158
- height: 4px;
159
- background-color: var(--_color-value, currentColor);
160
- }
161
-
162
- [part~='toolbar-button-background']::before {
163
- z-index: 1;
164
- }
165
-
166
- [part~='toolbar-button-background']::after {
167
- content: '';
168
- position: absolute;
169
- inset: 20%;
170
- background: repeating-linear-gradient(
171
- 135deg,
172
- var(--_background-value, currentColor),
173
- var(--_background-value, currentColor) 1px,
174
- transparent 1px,
175
- transparent 2px
176
- );
177
- }
178
- `;
179
-
180
- export const toolbarStyles = [iconsStyles, buttonsStyles];
181
-
182
- // Register a module with ID for backwards compatibility.
183
- registerStyles('', toolbarStyles, { moduleId: 'vaadin-rich-text-editor-toolbar-styles' });
@@ -1,4 +0,0 @@
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';