@prokodo/ui 0.1.10 → 0.1.12
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/README.md +3 -0
- package/dist/_virtual/_commonjsHelpers.js +2 -0
- package/dist/_virtual/quill.js +34 -0
- package/dist/_virtual/quill2.js +4 -0
- package/dist/components/RTE/RTE.client.js +367 -0
- package/dist/components/RTE/RTE.css +473 -0
- package/dist/components/RTE/RTE.js +12 -0
- package/dist/components/RTE/RTE.lazy.js +12 -0
- package/dist/components/RTE/RTE.module.css +473 -0
- package/dist/components/RTE/RTE.module.scss.js +22 -0
- package/dist/components/RTE/RTE.server.js +19 -0
- package/dist/components/RTE/RTE.styles.js +21 -0
- package/dist/components/RTE/RTE.theme.js +4 -0
- package/dist/components/RTE/RTE.utils.js +73 -0
- package/dist/components/RTE/RTE.view.js +107 -0
- package/dist/components/RTE/index.js +4 -0
- package/dist/components/avatar/Avatar.css +1 -3
- package/dist/components/avatar/Avatar.module.css +1 -3
- package/dist/components/avatar/Avatar.view.js +30 -17
- package/dist/components/base-link/BaseLink.client.js +11 -1
- package/dist/components/button/Button.css +1 -0
- package/dist/components/button/Button.module.css +1 -0
- package/dist/components/button/Button.view.js +1 -0
- package/dist/components/card/Card.css +10 -1
- package/dist/components/card/Card.module.css +10 -1
- package/dist/components/card/Card.module.scss.js +1 -0
- package/dist/components/chip/Chip.css +2 -2
- package/dist/components/chip/Chip.module.css +2 -2
- package/dist/components/chip/Chip.view.js +1 -1
- package/dist/components/input/Input.css +21 -2
- package/dist/components/input/Input.module.css +21 -2
- package/dist/components/input/Input.view.js +21 -13
- package/dist/components/pagination/Pagination.client.js +14 -0
- package/dist/components/pagination/Pagination.css +191 -0
- package/dist/components/pagination/Pagination.js +12 -0
- package/dist/components/pagination/Pagination.lazy.js +12 -0
- package/dist/components/pagination/Pagination.module.css +191 -0
- package/dist/components/pagination/Pagination.module.scss.js +12 -0
- package/dist/components/pagination/Pagination.server.js +11 -0
- package/dist/components/pagination/Pagination.utils.js +55 -0
- package/dist/components/pagination/Pagination.view.js +98 -0
- package/dist/components/pagination/index.js +4 -0
- package/dist/components/rich-text/RichText.client.js +31 -0
- package/dist/components/rich-text/RichText.css +13 -1
- package/dist/components/rich-text/RichText.module.css +13 -1
- package/dist/components/rich-text/RichText.module.scss.js +2 -0
- package/dist/components/rich-text/RichText.server.js +1 -0
- package/dist/components/select/Select.client.js +230 -8
- package/dist/components/select/Select.css +47 -16
- package/dist/components/select/Select.module.css +47 -16
- package/dist/components/select/Select.module.scss.js +2 -0
- package/dist/components/select/Select.view.js +20 -57
- package/dist/components/switch/Switch.css +1 -1
- package/dist/components/switch/Switch.module.css +1 -1
- package/dist/components/switch/Switch.view.js +3 -1
- package/dist/components/tooltip/Tooltip.client.js +373 -0
- package/dist/components/tooltip/Tooltip.css +241 -0
- package/dist/components/tooltip/Tooltip.js +16 -0
- package/dist/components/tooltip/Tooltip.module.css +241 -0
- package/dist/components/tooltip/Tooltip.module.scss.js +15 -0
- package/dist/components/tooltip/Tooltip.server.js +12 -0
- package/dist/components/tooltip/Tooltip.view.js +127 -0
- package/dist/components/tooltip/index.js +4 -0
- package/dist/constants/project.js +1 -1
- package/dist/index.js +6 -0
- package/dist/node_modules/.pnpm/quill@2.0.3/node_modules/quill/dist/quill.js +6133 -0
- package/dist/node_modules/.pnpm/quill@2.0.3/node_modules/quill/dist/quill.snow.css.js +12 -0
- package/dist/theme.css +214 -26
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/RTE/RTE.client.d.ts +6 -0
- package/dist/types/components/RTE/RTE.d.ts +339 -0
- package/dist/types/components/RTE/RTE.lazy.d.ts +340 -0
- package/dist/types/components/RTE/RTE.model.d.ts +17 -0
- package/dist/types/components/RTE/RTE.server.d.ts +3 -0
- package/dist/types/components/RTE/RTE.styles.d.ts +1 -0
- package/dist/types/components/RTE/RTE.theme.d.ts +2 -0
- package/dist/types/components/RTE/RTE.utils.d.ts +5 -0
- package/dist/types/components/RTE/RTE.view.d.ts +11 -0
- package/dist/types/components/RTE/index.d.ts +2 -0
- package/dist/types/components/avatar/Avatar.model.d.ts +1 -1
- package/dist/types/components/card/Card.model.d.ts +1 -1
- package/dist/types/components/grid/Grid.model.d.ts +37 -7
- package/dist/types/components/input/Input.model.d.ts +13 -1
- package/dist/types/components/input/Input.view.d.ts +1 -1
- package/dist/types/components/pagination/Pagination.client.d.ts +5 -0
- package/dist/types/components/pagination/Pagination.d.ts +4 -0
- package/dist/types/components/pagination/Pagination.lazy.d.ts +5 -0
- package/dist/types/components/pagination/Pagination.model.d.ts +22 -0
- package/dist/types/components/pagination/Pagination.server.d.ts +3 -0
- package/dist/types/components/pagination/Pagination.utils.d.ts +13 -0
- package/dist/types/components/pagination/Pagination.view.d.ts +3 -0
- package/dist/types/components/pagination/index.d.ts +2 -0
- package/dist/types/components/rich-text/RichText.client.d.ts +1 -1
- package/dist/types/components/rich-text/RichText.d.ts +1 -0
- package/dist/types/components/rich-text/RichText.lazy.d.ts +1 -0
- package/dist/types/components/rich-text/RichText.model.d.ts +1 -0
- package/dist/types/components/select/Select.model.d.ts +16 -1
- package/dist/types/components/tooltip/Tooltip.client.d.ts +5 -0
- package/dist/types/components/tooltip/Tooltip.d.ts +4 -0
- package/dist/types/components/tooltip/Tooltip.lazy.d.ts +5 -0
- package/dist/types/components/tooltip/Tooltip.model.d.ts +47 -0
- package/dist/types/components/tooltip/Tooltip.server.d.ts +3 -0
- package/dist/types/components/tooltip/Tooltip.view.d.ts +3 -0
- package/dist/types/components/tooltip/index.d.ts +2 -0
- package/dist/types/helpers/validations.d.ts +2 -2
- package/dist/types/index.d.ts +3 -0
- package/package.json +19 -2
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
/* stylelint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a rem-based value by a given pixel size.
|
|
4
|
+
*/
|
|
5
|
+
/* stylelint-disable */
|
|
6
|
+
/**
|
|
7
|
+
* Applies flex-column and gap.
|
|
8
|
+
*/
|
|
9
|
+
/*
|
|
10
|
+
As example (light, primary)
|
|
11
|
+
See defined modes in designsystem/config/gradients
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Mixin that renders a media query that target screens that are larger than the
|
|
15
|
+
* given size.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Mixin that renders a media query that target screens that are smaller than the
|
|
19
|
+
* given size.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Mixin that renders a media query that target screens in between the given range.
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* Mixin that renders a media query that target screens that have height larger than the
|
|
26
|
+
* given size.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Mixin that renders a media query that target screens that have height smaller than the
|
|
30
|
+
* given size.
|
|
31
|
+
*/
|
|
32
|
+
/* stylelint-disable */
|
|
33
|
+
/* M3/Elevation Light/1 */
|
|
34
|
+
/* M3/Elevation Light/2 */
|
|
35
|
+
/* M3/Elevation/5 */
|
|
36
|
+
/* M3/Elevation/1 Text */
|
|
37
|
+
/* Inner elevations */
|
|
38
|
+
/* stylelint-disable */
|
|
39
|
+
/**
|
|
40
|
+
* Visually hides an element but not removes them for screen readers.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* The inverse of the `hidden` helper to reset a previously hidden element to be
|
|
44
|
+
* visible for users.
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* Creates a selector for :hover effects depending on the current user input
|
|
48
|
+
* device. If the input device is a mouse, this hover effect will appear.
|
|
49
|
+
* Keyboard and touch inputs are ignored.
|
|
50
|
+
*
|
|
51
|
+
* Example usage:
|
|
52
|
+
* .link {
|
|
53
|
+
* color: blue;
|
|
54
|
+
*
|
|
55
|
+
* @include when-hovered() {
|
|
56
|
+
* color: green;
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
*/
|
|
60
|
+
/**
|
|
61
|
+
* Creates a selector for :active effects depending on the current user input
|
|
62
|
+
* device. The state applies when the input device is a mouse or keyboard. Touch
|
|
63
|
+
* devices will not show a pressed state.
|
|
64
|
+
*
|
|
65
|
+
* Example usage:
|
|
66
|
+
* .link {
|
|
67
|
+
* box-shadow: none;
|
|
68
|
+
*
|
|
69
|
+
* @include when-pressed() {
|
|
70
|
+
* box-shadow: inset 0 2px 4px grey;
|
|
71
|
+
* }
|
|
72
|
+
* }
|
|
73
|
+
*/
|
|
74
|
+
/**
|
|
75
|
+
* Creates a selector for :focus effects depending on the current user input
|
|
76
|
+
* device. When the user navigates using a keyboard, the focus effect defined in
|
|
77
|
+
* here is applied. For other input devices they don't show up.
|
|
78
|
+
*
|
|
79
|
+
* Example usage:
|
|
80
|
+
* .link {
|
|
81
|
+
* text-decoration: none;
|
|
82
|
+
*
|
|
83
|
+
* @include when-focused() {
|
|
84
|
+
* text-decoration: underline;
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
*/
|
|
88
|
+
/**
|
|
89
|
+
* Creates a selector for :focus-within effects depending on the current user
|
|
90
|
+
* input device. When the user navigates using a keyboard, the focus effect
|
|
91
|
+
* defined in here is applied. For other input devices they don't show up.
|
|
92
|
+
*
|
|
93
|
+
* Example usage:
|
|
94
|
+
* .link {
|
|
95
|
+
* img {
|
|
96
|
+
* opacity: 0.75;
|
|
97
|
+
*
|
|
98
|
+
* @include when-focused-within() {
|
|
99
|
+
* opacity: 1;
|
|
100
|
+
* }
|
|
101
|
+
* }
|
|
102
|
+
* }
|
|
103
|
+
*/
|
|
104
|
+
/**
|
|
105
|
+
* Wrapper for media query "prefers-reduced-motion".
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
108
|
+
* This helper hides the outline but still makes it visible for
|
|
109
|
+
* Windows high-contrast users. Use this instead of `outline: 0;`.
|
|
110
|
+
*/
|
|
111
|
+
/**
|
|
112
|
+
* This helper hides the outline but still makes it visible for
|
|
113
|
+
* Windows high-contrast users. Use this instead of `outline: 0;`.
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Renders an alternative, but application consistent focus-ring.
|
|
117
|
+
*/
|
|
118
|
+
/**
|
|
119
|
+
* Specifies the outer layout for all contents across breakpoints. Apply this
|
|
120
|
+
* mixin to the container element, to center the contents on the screen within
|
|
121
|
+
* the layout offsets.
|
|
122
|
+
*/
|
|
123
|
+
/**
|
|
124
|
+
* This mixin specifies basic text-styles for components that render a richtext
|
|
125
|
+
* content.
|
|
126
|
+
*/
|
|
127
|
+
.prokodo-RTE {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
width: 100%;
|
|
131
|
+
}
|
|
132
|
+
.prokodo-RTE__surface {
|
|
133
|
+
position: relative;
|
|
134
|
+
width: calc(100% - 4px);
|
|
135
|
+
padding: 0;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
background-color: var(--color-primary-40);
|
|
138
|
+
}
|
|
139
|
+
.prokodo-RTE__surface::after {
|
|
140
|
+
content: none;
|
|
141
|
+
}
|
|
142
|
+
.prokodo-RTE__toolbar {
|
|
143
|
+
border: none !important;
|
|
144
|
+
background-color: var(--color-primary-50);
|
|
145
|
+
}
|
|
146
|
+
.prokodo-RTE__toolbar__icon__part__stroke, .prokodo-RTE__toolbar__icon__part__stroke__miter {
|
|
147
|
+
stroke: var(--color-grey-900) !important;
|
|
148
|
+
opacity: 0.7;
|
|
149
|
+
}
|
|
150
|
+
.prokodo-RTE__toolbar__icon__part__fill {
|
|
151
|
+
fill: var(--color-grey-900) !important;
|
|
152
|
+
opacity: 0.7;
|
|
153
|
+
}
|
|
154
|
+
.prokodo-RTE__toolbar__picker__label {
|
|
155
|
+
position: relative;
|
|
156
|
+
padding-right: calc(0.5rem + 18px);
|
|
157
|
+
}
|
|
158
|
+
.prokodo-RTE__toolbar__picker__label::before {
|
|
159
|
+
content: "Normal";
|
|
160
|
+
color: var(--color-grey-900);
|
|
161
|
+
opacity: 0.85;
|
|
162
|
+
margin-right: 0.25rem;
|
|
163
|
+
white-space: nowrap;
|
|
164
|
+
font-weight: 400;
|
|
165
|
+
font-size: 1rem;
|
|
166
|
+
font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
167
|
+
font-style: normal;
|
|
168
|
+
line-height: 1.45;
|
|
169
|
+
letter-spacing: 0.03em;
|
|
170
|
+
text-transform: none;
|
|
171
|
+
text-align: left;
|
|
172
|
+
text-decoration: none;
|
|
173
|
+
}
|
|
174
|
+
@media screen and (min-width: 480px) {
|
|
175
|
+
.prokodo-RTE__toolbar__picker__label::before {
|
|
176
|
+
font-size: 0.875rem;
|
|
177
|
+
line-height: 1.4;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
@media screen and (min-width: 960px) {
|
|
181
|
+
.prokodo-RTE__toolbar__picker__label::before {
|
|
182
|
+
font-size: 0.875rem;
|
|
183
|
+
line-height: 1.4;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
.prokodo-RTE__toolbar__picker__label[data-value="2"]::before {
|
|
187
|
+
content: "H2";
|
|
188
|
+
}
|
|
189
|
+
.prokodo-RTE__toolbar__picker__label[data-value="3"]::before {
|
|
190
|
+
content: "H3";
|
|
191
|
+
}
|
|
192
|
+
.prokodo-RTE__toolbar__picker__options {
|
|
193
|
+
margin-top: 0.25rem;
|
|
194
|
+
padding: 0.25rem;
|
|
195
|
+
border-radius: 14px;
|
|
196
|
+
background: var(--color-white) !important;
|
|
197
|
+
border-color: var(--color-grey-500) !important;
|
|
198
|
+
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
min-width: 180px;
|
|
201
|
+
z-index: 20;
|
|
202
|
+
}
|
|
203
|
+
.prokodo-RTE__toolbar__picker__item {
|
|
204
|
+
border-radius: 12px;
|
|
205
|
+
padding: 0.25rem 0.5rem;
|
|
206
|
+
display: flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
}
|
|
210
|
+
.prokodo-RTE__toolbar__picker__item::before {
|
|
211
|
+
content: "Normal";
|
|
212
|
+
color: var(--color-grey-900);
|
|
213
|
+
opacity: 0.85;
|
|
214
|
+
font-weight: 400;
|
|
215
|
+
font-size: 1rem;
|
|
216
|
+
font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
217
|
+
font-style: normal;
|
|
218
|
+
line-height: 1.45;
|
|
219
|
+
letter-spacing: 0.03em;
|
|
220
|
+
text-transform: none;
|
|
221
|
+
text-align: left;
|
|
222
|
+
text-decoration: none;
|
|
223
|
+
}
|
|
224
|
+
@media screen and (min-width: 480px) {
|
|
225
|
+
.prokodo-RTE__toolbar__picker__item::before {
|
|
226
|
+
font-size: 0.875rem;
|
|
227
|
+
line-height: 1.4;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
@media screen and (min-width: 960px) {
|
|
231
|
+
.prokodo-RTE__toolbar__picker__item::before {
|
|
232
|
+
font-size: 0.875rem;
|
|
233
|
+
line-height: 1.4;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
.prokodo-RTE__toolbar__picker__item[data-value="2"]::before {
|
|
237
|
+
content: "H2";
|
|
238
|
+
}
|
|
239
|
+
.prokodo-RTE__toolbar__picker__item[data-value="3"]::before {
|
|
240
|
+
content: "H3";
|
|
241
|
+
}
|
|
242
|
+
.prokodo-RTE__toolbar__picker__item:hover {
|
|
243
|
+
background: var(--color-primary-50) !important;
|
|
244
|
+
}
|
|
245
|
+
.prokodo-RTE__toolbar__picker__item[data-selected=true] {
|
|
246
|
+
background: var(--color-primary-100) !important;
|
|
247
|
+
}
|
|
248
|
+
.prokodo-RTE__toolbar__picker__item:focus-visible {
|
|
249
|
+
outline: 2px solid var(--color-primary-100);
|
|
250
|
+
outline-offset: 2px;
|
|
251
|
+
}
|
|
252
|
+
.prokodo-RTE__resize {
|
|
253
|
+
position: absolute;
|
|
254
|
+
right: 0.5rem;
|
|
255
|
+
bottom: 0.5rem;
|
|
256
|
+
width: 18px;
|
|
257
|
+
height: 18px;
|
|
258
|
+
padding: 0;
|
|
259
|
+
border: none;
|
|
260
|
+
background: transparent;
|
|
261
|
+
color: var(--color-grey-900);
|
|
262
|
+
cursor: ns-resize;
|
|
263
|
+
opacity: 0.55;
|
|
264
|
+
}
|
|
265
|
+
.prokodo-RTE__mount {
|
|
266
|
+
position: relative;
|
|
267
|
+
height: 200px;
|
|
268
|
+
border: none;
|
|
269
|
+
background: transparent;
|
|
270
|
+
width: 100%;
|
|
271
|
+
border: none !important;
|
|
272
|
+
}
|
|
273
|
+
.prokodo-RTE__mount--disabled {
|
|
274
|
+
cursor: not-allowed;
|
|
275
|
+
opacity: 0.85;
|
|
276
|
+
}
|
|
277
|
+
.prokodo-RTE__tooltip {
|
|
278
|
+
max-width: calc(100% - 0.75rem - 0.75rem);
|
|
279
|
+
box-sizing: border-box;
|
|
280
|
+
border-radius: 14px;
|
|
281
|
+
overflow: hidden;
|
|
282
|
+
}
|
|
283
|
+
.prokodo-RTE__editor {
|
|
284
|
+
height: 100%;
|
|
285
|
+
padding: 0.75rem;
|
|
286
|
+
outline: none;
|
|
287
|
+
overflow-y: auto;
|
|
288
|
+
font-weight: 400;
|
|
289
|
+
font-size: 1.125rem;
|
|
290
|
+
font-family: var(--font-secondary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
291
|
+
font-style: normal;
|
|
292
|
+
line-height: 1.55;
|
|
293
|
+
letter-spacing: 0.03em;
|
|
294
|
+
text-transform: none;
|
|
295
|
+
text-align: left;
|
|
296
|
+
text-decoration: none;
|
|
297
|
+
}
|
|
298
|
+
@media screen and (min-width: 480px) {
|
|
299
|
+
.prokodo-RTE__editor {
|
|
300
|
+
font-size: 1rem;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
@media screen and (min-width: 960px) {
|
|
304
|
+
.prokodo-RTE__editor {
|
|
305
|
+
font-size: 1rem;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
.prokodo-RTE__editor p {
|
|
309
|
+
margin: 0.75rem 0 !important;
|
|
310
|
+
}
|
|
311
|
+
.prokodo-RTE__editor p:last-child {
|
|
312
|
+
margin-bottom: 0 !important;
|
|
313
|
+
}
|
|
314
|
+
.prokodo-RTE__editor ul,
|
|
315
|
+
.prokodo-RTE__editor ol {
|
|
316
|
+
margin: 0 0 0.5rem 1.25rem !important;
|
|
317
|
+
padding: 0 !important;
|
|
318
|
+
}
|
|
319
|
+
.prokodo-RTE__editor pre {
|
|
320
|
+
margin: 0.5rem 0 !important;
|
|
321
|
+
padding: 0.5rem;
|
|
322
|
+
border-radius: 14px;
|
|
323
|
+
overflow: auto;
|
|
324
|
+
background: rgba(0, 0, 0, 0.06);
|
|
325
|
+
}
|
|
326
|
+
.prokodo-RTE__editor code {
|
|
327
|
+
background: rgba(0, 0, 0, 0.06);
|
|
328
|
+
padding: 0 6px !important;
|
|
329
|
+
border-radius: 8px;
|
|
330
|
+
}
|
|
331
|
+
.prokodo-RTE__editor img {
|
|
332
|
+
max-width: 100%;
|
|
333
|
+
height: auto;
|
|
334
|
+
border-radius: 14px;
|
|
335
|
+
display: block;
|
|
336
|
+
margin: 0.5rem 0;
|
|
337
|
+
}
|
|
338
|
+
.prokodo-RTE__editor h1,
|
|
339
|
+
.prokodo-RTE__editor h2,
|
|
340
|
+
.prokodo-RTE__editor h3,
|
|
341
|
+
.prokodo-RTE__editor h4,
|
|
342
|
+
.prokodo-RTE__editor h5,
|
|
343
|
+
.prokodo-RTE__editor h6 {
|
|
344
|
+
margin: 1rem 0 0.5rem 0 !important;
|
|
345
|
+
}
|
|
346
|
+
.prokodo-RTE__editor > h1:first-child,
|
|
347
|
+
.prokodo-RTE__editor > h2:first-child,
|
|
348
|
+
.prokodo-RTE__editor > h3:first-child,
|
|
349
|
+
.prokodo-RTE__editor > h4:first-child,
|
|
350
|
+
.prokodo-RTE__editor > h5:first-child,
|
|
351
|
+
.prokodo-RTE__editor > h6:first-child {
|
|
352
|
+
margin-top: 0 !important;
|
|
353
|
+
}
|
|
354
|
+
.prokodo-RTE__editor h1 {
|
|
355
|
+
font-weight: 900;
|
|
356
|
+
font-size: 1.75rem;
|
|
357
|
+
font-family: var(--font-primary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
358
|
+
font-style: normal;
|
|
359
|
+
line-height: 1.6;
|
|
360
|
+
letter-spacing: 0.03em;
|
|
361
|
+
text-transform: none;
|
|
362
|
+
text-align: left;
|
|
363
|
+
text-decoration: none;
|
|
364
|
+
}
|
|
365
|
+
@media screen and (min-width: 480px) {
|
|
366
|
+
.prokodo-RTE__editor h1 {
|
|
367
|
+
font-size: 2.25rem;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
@media screen and (min-width: 960px) {
|
|
371
|
+
.prokodo-RTE__editor h1 {
|
|
372
|
+
font-size: 2.75rem;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
.prokodo-RTE__editor h2 {
|
|
376
|
+
font-weight: 700;
|
|
377
|
+
font-size: 1.5rem;
|
|
378
|
+
font-family: var(--font-primary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
379
|
+
font-style: normal;
|
|
380
|
+
line-height: 1.55;
|
|
381
|
+
letter-spacing: 0.03em;
|
|
382
|
+
text-transform: none;
|
|
383
|
+
text-align: left;
|
|
384
|
+
text-decoration: none;
|
|
385
|
+
}
|
|
386
|
+
@media screen and (min-width: 480px) {
|
|
387
|
+
.prokodo-RTE__editor h2 {
|
|
388
|
+
font-size: 1.75rem;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
@media screen and (min-width: 960px) {
|
|
392
|
+
.prokodo-RTE__editor h2 {
|
|
393
|
+
font-size: 2.25rem;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
.prokodo-RTE__editor h3 {
|
|
397
|
+
font-weight: 500;
|
|
398
|
+
font-size: 1.5rem;
|
|
399
|
+
font-family: var(--font-primary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
400
|
+
font-style: normal;
|
|
401
|
+
line-height: 1.5;
|
|
402
|
+
letter-spacing: 0.03em;
|
|
403
|
+
text-transform: none;
|
|
404
|
+
text-align: left;
|
|
405
|
+
text-decoration: none;
|
|
406
|
+
}
|
|
407
|
+
@media screen and (min-width: 480px) {
|
|
408
|
+
.prokodo-RTE__editor h3 {
|
|
409
|
+
font-size: 1.5rem;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
@media screen and (min-width: 960px) {
|
|
413
|
+
.prokodo-RTE__editor h3 {
|
|
414
|
+
font-size: 1.75rem;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
.prokodo-RTE__editor h4 {
|
|
418
|
+
font-weight: 400;
|
|
419
|
+
font-size: 1.125rem;
|
|
420
|
+
font-family: var(--font-primary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
421
|
+
font-style: normal;
|
|
422
|
+
line-height: 1.5;
|
|
423
|
+
letter-spacing: 0.03em;
|
|
424
|
+
text-transform: none;
|
|
425
|
+
text-align: left;
|
|
426
|
+
text-decoration: none;
|
|
427
|
+
}
|
|
428
|
+
@media screen and (min-width: 480px) {
|
|
429
|
+
.prokodo-RTE__editor h4 {
|
|
430
|
+
font-size: 1.5rem;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
@media screen and (min-width: 960px) {
|
|
434
|
+
.prokodo-RTE__editor h4 {
|
|
435
|
+
font-size: 1.5rem;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
.prokodo-RTE__editor h5 {
|
|
439
|
+
font-weight: 400;
|
|
440
|
+
font-size: 1.125rem;
|
|
441
|
+
font-family: var(--font-primary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
442
|
+
font-style: normal;
|
|
443
|
+
line-height: 1.45;
|
|
444
|
+
letter-spacing: 0.03em;
|
|
445
|
+
text-transform: none;
|
|
446
|
+
text-align: left;
|
|
447
|
+
text-decoration: none;
|
|
448
|
+
}
|
|
449
|
+
.prokodo-RTE__editor h6 {
|
|
450
|
+
font-weight: 400;
|
|
451
|
+
font-size: 1rem;
|
|
452
|
+
font-family: var(--font-primary), -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
453
|
+
font-style: normal;
|
|
454
|
+
line-height: 1.4;
|
|
455
|
+
letter-spacing: 0.03em;
|
|
456
|
+
text-transform: none;
|
|
457
|
+
text-align: left;
|
|
458
|
+
text-decoration: none;
|
|
459
|
+
}
|
|
460
|
+
.prokodo-RTE--disabled {
|
|
461
|
+
opacity: 0.9;
|
|
462
|
+
}
|
|
463
|
+
.prokodo-RTE--readonly {
|
|
464
|
+
opacity: 0.95;
|
|
465
|
+
}
|
|
466
|
+
.prokodo-RTE__hidden {
|
|
467
|
+
position: absolute;
|
|
468
|
+
top: auto;
|
|
469
|
+
left: -99999px;
|
|
470
|
+
width: 0;
|
|
471
|
+
height: 0;
|
|
472
|
+
text-indent: -99999px;
|
|
473
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const styles = {
|
|
2
|
+
"prokodo-RTE": "prokodo-RTE",
|
|
3
|
+
"prokodo-RTE__surface": "prokodo-RTE__surface",
|
|
4
|
+
"prokodo-RTE__toolbar": "prokodo-RTE__toolbar",
|
|
5
|
+
"prokodo-RTE__toolbar__icon__part__stroke": "prokodo-RTE__toolbar__icon__part__stroke",
|
|
6
|
+
"prokodo-RTE__toolbar__icon__part__stroke__miter": "prokodo-RTE__toolbar__icon__part__stroke__miter",
|
|
7
|
+
"prokodo-RTE__toolbar__icon__part__fill": "prokodo-RTE__toolbar__icon__part__fill",
|
|
8
|
+
"prokodo-RTE__toolbar__picker__label": "prokodo-RTE__toolbar__picker__label",
|
|
9
|
+
"prokodo-RTE__toolbar__picker__options": "prokodo-RTE__toolbar__picker__options",
|
|
10
|
+
"prokodo-RTE__toolbar__picker__item": "prokodo-RTE__toolbar__picker__item",
|
|
11
|
+
"prokodo-RTE__resize": "prokodo-RTE__resize",
|
|
12
|
+
"prokodo-RTE__mount": "prokodo-RTE__mount",
|
|
13
|
+
"prokodo-RTE__mount--disabled": "prokodo-RTE__mount--disabled",
|
|
14
|
+
"prokodo-RTE__tooltip": "prokodo-RTE__tooltip",
|
|
15
|
+
"prokodo-RTE__editor": "prokodo-RTE__editor",
|
|
16
|
+
"prokodo-RTE--disabled": "prokodo-RTE--disabled",
|
|
17
|
+
"prokodo-RTE--readonly": "prokodo-RTE--readonly",
|
|
18
|
+
"prokodo-RTE__hidden": "prokodo-RTE__hidden"
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
styles as default
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { isString } from "../../helpers/validations.js";
|
|
5
|
+
import { RTEView } from "./RTE.view.js";
|
|
6
|
+
function stripHtml(html) {
|
|
7
|
+
if (!isString(html)) return "";
|
|
8
|
+
return html.replace(/[<>]/g, "").replace(/\s+/g, " ").trim();
|
|
9
|
+
}
|
|
10
|
+
__name(stripHtml, "stripHtml");
|
|
11
|
+
function RTEServer(props) {
|
|
12
|
+
const { value, onChange, ...rest } = props;
|
|
13
|
+
const v = stripHtml(value);
|
|
14
|
+
return /* @__PURE__ */ jsx(RTEView, { ...rest, readOnly: true, htmlValue: v, showResize: false, value: v });
|
|
15
|
+
}
|
|
16
|
+
__name(RTEServer, "RTEServer");
|
|
17
|
+
export {
|
|
18
|
+
RTEServer as default
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
let injected = false;
|
|
4
|
+
function ensureQuillSnowStyles(cssText) {
|
|
5
|
+
if (injected) return;
|
|
6
|
+
if (typeof document === "undefined") return;
|
|
7
|
+
const id = "rte-quill-snow";
|
|
8
|
+
if (document.getElementById(id)) {
|
|
9
|
+
injected = true;
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const style = document.createElement("style");
|
|
13
|
+
style.id = id;
|
|
14
|
+
style.textContent = cssText;
|
|
15
|
+
document.head.appendChild(style);
|
|
16
|
+
injected = true;
|
|
17
|
+
}
|
|
18
|
+
__name(ensureQuillSnowStyles, "ensureQuillSnowStyles");
|
|
19
|
+
export {
|
|
20
|
+
ensureQuillSnowStyles
|
|
21
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { create } from "../../helpers/bem.js";
|
|
4
|
+
import { isString } from "../../helpers/validations.js";
|
|
5
|
+
import styles from "./RTE.module.scss.js";
|
|
6
|
+
const bem = create(styles, "RTE");
|
|
7
|
+
function addClasses(el, className) {
|
|
8
|
+
if (!el) return;
|
|
9
|
+
className.split(/\s+/).map((s) => s.trim()).filter(Boolean).forEach((c) => el.classList.add(c));
|
|
10
|
+
}
|
|
11
|
+
__name(addClasses, "addClasses");
|
|
12
|
+
function decorateToolbar(toolbarEl) {
|
|
13
|
+
toolbarEl.querySelectorAll("button").forEach((btn) => {
|
|
14
|
+
addClasses(btn, bem("toolbar__button"));
|
|
15
|
+
const ql = Array.from(btn.classList).find((c) => c.startsWith("ql-"));
|
|
16
|
+
if (isString(ql))
|
|
17
|
+
addClasses(btn, bem("toolbar__button", { [ql.slice(3)]: true }));
|
|
18
|
+
});
|
|
19
|
+
toolbarEl.querySelectorAll("button svg").forEach((svg) => {
|
|
20
|
+
addClasses(svg, bem("toolbar__icon"));
|
|
21
|
+
});
|
|
22
|
+
toolbarEl.querySelectorAll("button svg *").forEach((node) => {
|
|
23
|
+
const el = node;
|
|
24
|
+
addClasses(el, bem("toolbar__icon__part"));
|
|
25
|
+
if (el.classList.contains("ql-fill"))
|
|
26
|
+
addClasses(el, bem("toolbar__icon__part__fill"));
|
|
27
|
+
if (el.classList.contains("ql-stroke") || el.classList.contains("ql-stroke-miter")) {
|
|
28
|
+
addClasses(el, bem("toolbar__icon__part__stroke"));
|
|
29
|
+
}
|
|
30
|
+
if (el.classList.contains("ql-stroke-miter")) {
|
|
31
|
+
addClasses(el, bem("toolbar__icon__part__stroke__miter"));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
toolbarEl.querySelectorAll(".ql-picker").forEach((picker) => {
|
|
35
|
+
addClasses(picker, bem("toolbar__picker"));
|
|
36
|
+
const label = picker.querySelector(".ql-picker-label");
|
|
37
|
+
const options = picker.querySelector(
|
|
38
|
+
".ql-picker-options"
|
|
39
|
+
);
|
|
40
|
+
addClasses(label, bem("toolbar__picker__label"));
|
|
41
|
+
addClasses(options, bem("toolbar__picker__options"));
|
|
42
|
+
picker.querySelectorAll(".ql-picker-item").forEach((item) => {
|
|
43
|
+
addClasses(item, bem("toolbar__picker__item"));
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
__name(decorateToolbar, "decorateToolbar");
|
|
48
|
+
function syncPickerSelected(toolbarEl) {
|
|
49
|
+
toolbarEl.querySelectorAll(".ql-picker-item").forEach((el) => {
|
|
50
|
+
const item = el;
|
|
51
|
+
const selected = item.classList.contains("ql-selected");
|
|
52
|
+
if (selected) item.setAttribute("data-selected", "true");
|
|
53
|
+
else item.removeAttribute("data-selected");
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
__name(syncPickerSelected, "syncPickerSelected");
|
|
57
|
+
function cleanupQuill(surfaceEl, mountEl) {
|
|
58
|
+
if (!surfaceEl || !mountEl) return;
|
|
59
|
+
surfaceEl.querySelectorAll(":scope > .ql-toolbar").forEach((el) => el.remove());
|
|
60
|
+
surfaceEl.querySelectorAll(".ql-tooltip").forEach((el) => el.remove());
|
|
61
|
+
surfaceEl.querySelectorAll(".ql-container").forEach((el) => {
|
|
62
|
+
if (el !== mountEl) el.remove();
|
|
63
|
+
});
|
|
64
|
+
mountEl.innerHTML = "";
|
|
65
|
+
}
|
|
66
|
+
__name(cleanupQuill, "cleanupQuill");
|
|
67
|
+
export {
|
|
68
|
+
addClasses,
|
|
69
|
+
bem,
|
|
70
|
+
cleanupQuill,
|
|
71
|
+
decorateToolbar,
|
|
72
|
+
syncPickerSelected
|
|
73
|
+
};
|