@prokodo/ui 0.1.11 → 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.
Files changed (64) hide show
  1. package/README.md +2 -0
  2. package/dist/components/RTE/RTE.client.js +46 -5
  3. package/dist/components/RTE/RTE.css +226 -6
  4. package/dist/components/RTE/RTE.module.css +226 -6
  5. package/dist/components/RTE/RTE.module.scss.js +3 -0
  6. package/dist/components/RTE/RTE.utils.js +23 -1
  7. package/dist/components/button/Button.css +1 -0
  8. package/dist/components/button/Button.module.css +1 -0
  9. package/dist/components/card/Card.css +9 -0
  10. package/dist/components/card/Card.module.css +9 -0
  11. package/dist/components/card/Card.module.scss.js +1 -0
  12. package/dist/components/input/Input.css +21 -2
  13. package/dist/components/input/Input.module.css +21 -2
  14. package/dist/components/pagination/Pagination.client.js +14 -0
  15. package/dist/components/pagination/Pagination.css +191 -0
  16. package/dist/components/pagination/Pagination.js +12 -0
  17. package/dist/components/pagination/Pagination.lazy.js +12 -0
  18. package/dist/components/pagination/Pagination.module.css +191 -0
  19. package/dist/components/pagination/Pagination.module.scss.js +12 -0
  20. package/dist/components/pagination/Pagination.server.js +11 -0
  21. package/dist/components/pagination/Pagination.utils.js +55 -0
  22. package/dist/components/pagination/Pagination.view.js +98 -0
  23. package/dist/components/pagination/index.js +4 -0
  24. package/dist/components/select/Select.client.js +230 -8
  25. package/dist/components/select/Select.css +47 -16
  26. package/dist/components/select/Select.module.css +47 -16
  27. package/dist/components/select/Select.module.scss.js +2 -0
  28. package/dist/components/select/Select.view.js +20 -57
  29. package/dist/components/switch/Switch.css +1 -1
  30. package/dist/components/switch/Switch.module.css +1 -1
  31. package/dist/components/switch/Switch.view.js +3 -1
  32. package/dist/components/tooltip/Tooltip.client.js +373 -0
  33. package/dist/components/tooltip/Tooltip.css +241 -0
  34. package/dist/components/tooltip/Tooltip.js +16 -0
  35. package/dist/components/tooltip/Tooltip.module.css +241 -0
  36. package/dist/components/tooltip/Tooltip.module.scss.js +15 -0
  37. package/dist/components/tooltip/Tooltip.server.js +12 -0
  38. package/dist/components/tooltip/Tooltip.view.js +127 -0
  39. package/dist/components/tooltip/index.js +4 -0
  40. package/dist/constants/project.js +1 -1
  41. package/dist/index.js +4 -0
  42. package/dist/theme.css +195 -19
  43. package/dist/tsconfig.build.tsbuildinfo +1 -1
  44. package/dist/types/components/RTE/RTE.utils.d.ts +1 -0
  45. package/dist/types/components/card/Card.model.d.ts +1 -1
  46. package/dist/types/components/grid/Grid.model.d.ts +37 -7
  47. package/dist/types/components/pagination/Pagination.client.d.ts +5 -0
  48. package/dist/types/components/pagination/Pagination.d.ts +4 -0
  49. package/dist/types/components/pagination/Pagination.lazy.d.ts +5 -0
  50. package/dist/types/components/pagination/Pagination.model.d.ts +22 -0
  51. package/dist/types/components/pagination/Pagination.server.d.ts +3 -0
  52. package/dist/types/components/pagination/Pagination.utils.d.ts +13 -0
  53. package/dist/types/components/pagination/Pagination.view.d.ts +3 -0
  54. package/dist/types/components/pagination/index.d.ts +2 -0
  55. package/dist/types/components/select/Select.model.d.ts +16 -1
  56. package/dist/types/components/tooltip/Tooltip.client.d.ts +5 -0
  57. package/dist/types/components/tooltip/Tooltip.d.ts +4 -0
  58. package/dist/types/components/tooltip/Tooltip.lazy.d.ts +5 -0
  59. package/dist/types/components/tooltip/Tooltip.model.d.ts +47 -0
  60. package/dist/types/components/tooltip/Tooltip.server.d.ts +3 -0
  61. package/dist/types/components/tooltip/Tooltip.view.d.ts +3 -0
  62. package/dist/types/components/tooltip/index.d.ts +2 -0
  63. package/dist/types/index.d.ts +2 -0
  64. package/package.json +13 -2
package/README.md CHANGED
@@ -186,6 +186,7 @@ export default function GalleryPage() {
186
186
  | Loading | ✅ | – |
187
187
  | Lottie | ❌ | ✅ |
188
188
  | Map | ❌ | ✅ |
189
+ | Pagination | ✅ | ✅ |
189
190
  | PostItem | ✅ | ✅ |
190
191
  | PostTeaser | ✅ | ✅ |
191
192
  | PostWidget | ✅ | ✅ |
@@ -204,6 +205,7 @@ export default function GalleryPage() {
204
205
  | Switch | ✅ | ✅ |
205
206
  | Table | ✅ | – |
206
207
  | Teaser | ✅ | - |
208
+ | Tooltip | ✅ | ✅ |
207
209
 
208
210
  ## Since Next.js 16
209
211
 
@@ -11,9 +11,20 @@ import { isString, isNull } from "../../helpers/validations.js";
11
11
  import styles from "./RTE.module.scss.js";
12
12
  import { ensureQuillSnowStyles } from "./RTE.styles.js";
13
13
  import cssText from "../../node_modules/.pnpm/quill@2.0.3/node_modules/quill/dist/quill.snow.css.js";
14
- import { cleanupQuill, addClasses, decorateToolbar } from "./RTE.utils.js";
14
+ import { cleanupQuill, addClasses, decorateToolbar, syncPickerSelected } from "./RTE.utils.js";
15
15
  import { RTEView } from "./RTE.view.js";
16
16
  const bem = create(styles, "RTE");
17
+ const ALLOWED_FORMATS = [
18
+ "header",
19
+ "bold",
20
+ "italic",
21
+ "underline",
22
+ "strike",
23
+ "list",
24
+ "link",
25
+ "code-block",
26
+ "image"
27
+ ];
17
28
  function RTEClient(props) {
18
29
  const {
19
30
  name,
@@ -126,7 +137,7 @@ function RTEClient(props) {
126
137
  const mountEl = mountRef.current;
127
138
  const surfaceEl = surfaceRef.current;
128
139
  async function init() {
129
- var _a, _b, _c, _d, _e;
140
+ var _a, _b, _c, _d, _e, _f;
130
141
  if (!mountEl || !surfaceEl) return;
131
142
  if (Boolean(disabled) || Boolean(readOnly)) return;
132
143
  cleanupQuill(surfaceEl, mountEl);
@@ -171,6 +182,7 @@ function RTEClient(props) {
171
182
  const opts = rteOptionsRef.current;
172
183
  const extraToolbar = rteToolbarRef.current;
173
184
  const baseToolbar = [
185
+ [{ header: [3, 4, false] }],
174
186
  ["bold", "italic", "underline", "strike"],
175
187
  [{ list: "ordered" }, { list: "bullet" }],
176
188
  ["link", "code-block", "image"],
@@ -181,6 +193,7 @@ function RTEClient(props) {
181
193
  ...opts,
182
194
  theme: "snow",
183
195
  placeholder: placeholder ?? "",
196
+ formats: ALLOWED_FORMATS,
184
197
  modules: {
185
198
  history: {
186
199
  delay: 1e3,
@@ -196,12 +209,40 @@ function RTEClient(props) {
196
209
  }
197
210
  });
198
211
  quillRef.current = q;
199
- (_c = opts == null ? void 0 : opts.onInit) == null ? void 0 : _c.call(opts, q);
212
+ const Keyboard = q.getModule("keyboard");
213
+ (_c = Keyboard == null ? void 0 : Keyboard.addBinding) == null ? void 0 : _c.call(
214
+ Keyboard,
215
+ {
216
+ key: 13,
217
+ // Enter
218
+ shiftKey: false,
219
+ collapsed: true
220
+ },
221
+ (range, ctx) => {
222
+ var _a2;
223
+ const header = (_a2 = ctx == null ? void 0 : ctx.format) == null ? void 0 : _a2.header;
224
+ if (!header) return true;
225
+ q.insertText(range.index, "\n", "user");
226
+ q.formatLine(range.index + 1, 1, { header: false }, "user");
227
+ q.setSelection(range.index + 1, 0, "silent");
228
+ return false;
229
+ }
230
+ );
231
+ (_d = opts == null ? void 0 : opts.onInit) == null ? void 0 : _d.call(opts, q);
200
232
  addClasses(q.root, bem("editor"));
201
233
  const toolbarModule = q.getModule("toolbar");
202
234
  addClasses((toolbarModule == null ? void 0 : toolbarModule.container) ?? null, bem("toolbar"));
203
235
  const toolbarEl = (toolbarModule == null ? void 0 : toolbarModule.container) ?? null;
204
- if (toolbarEl) decorateToolbar(toolbarEl);
236
+ if (toolbarEl) {
237
+ decorateToolbar(toolbarEl);
238
+ syncPickerSelected(toolbarEl);
239
+ const obs = new MutationObserver(() => syncPickerSelected(toolbarEl));
240
+ obs.observe(toolbarEl, {
241
+ subtree: true,
242
+ attributes: true,
243
+ attributeFilter: ["class"]
244
+ });
245
+ }
205
246
  const tooltipEl = q.container.querySelector(
206
247
  ".ql-tooltip"
207
248
  );
@@ -215,7 +256,7 @@ function RTEClient(props) {
215
256
  if (container && !container.style.height) container.style.height = "220px";
216
257
  if (htmlRef.current)
217
258
  q.clipboard.dangerouslyPasteHTML(htmlRef.current, "silent");
218
- emitValidation(((_e = (_d = q.getText()) == null ? void 0 : _d.trim) == null ? void 0 : _e.call(_d)) ?? "");
259
+ emitValidation(((_f = (_e = q.getText()) == null ? void 0 : _e.trim) == null ? void 0 : _f.call(_e)) ?? "");
219
260
  q.on("text-change", (_d2, _o, source) => {
220
261
  if (source === "user") syncFromQuill();
221
262
  });
@@ -151,6 +151,104 @@
151
151
  fill: var(--color-grey-900) !important;
152
152
  opacity: 0.7;
153
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
+ }
154
252
  .prokodo-RTE__resize {
155
253
  position: absolute;
156
254
  right: 0.5rem;
@@ -208,18 +306,18 @@
208
306
  }
209
307
  }
210
308
  .prokodo-RTE__editor p {
211
- margin: 0 0 0.5rem 0;
309
+ margin: 0.75rem 0 !important;
212
310
  }
213
311
  .prokodo-RTE__editor p:last-child {
214
- margin-bottom: 0;
312
+ margin-bottom: 0 !important;
215
313
  }
216
314
  .prokodo-RTE__editor ul,
217
315
  .prokodo-RTE__editor ol {
218
- margin: 0 0 0.5rem 1.25rem;
219
- padding: 0;
316
+ margin: 0 0 0.5rem 1.25rem !important;
317
+ padding: 0 !important;
220
318
  }
221
319
  .prokodo-RTE__editor pre {
222
- margin: 0.5rem 0;
320
+ margin: 0.5rem 0 !important;
223
321
  padding: 0.5rem;
224
322
  border-radius: 14px;
225
323
  overflow: auto;
@@ -227,7 +325,7 @@
227
325
  }
228
326
  .prokodo-RTE__editor code {
229
327
  background: rgba(0, 0, 0, 0.06);
230
- padding: 0 6px;
328
+ padding: 0 6px !important;
231
329
  border-radius: 8px;
232
330
  }
233
331
  .prokodo-RTE__editor img {
@@ -237,6 +335,128 @@
237
335
  display: block;
238
336
  margin: 0.5rem 0;
239
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
+ }
240
460
  .prokodo-RTE--disabled {
241
461
  opacity: 0.9;
242
462
  }
@@ -151,6 +151,104 @@
151
151
  fill: var(--color-grey-900) !important;
152
152
  opacity: 0.7;
153
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
+ }
154
252
  .prokodo-RTE__resize {
155
253
  position: absolute;
156
254
  right: 0.5rem;
@@ -208,18 +306,18 @@
208
306
  }
209
307
  }
210
308
  .prokodo-RTE__editor p {
211
- margin: 0 0 0.5rem 0;
309
+ margin: 0.75rem 0 !important;
212
310
  }
213
311
  .prokodo-RTE__editor p:last-child {
214
- margin-bottom: 0;
312
+ margin-bottom: 0 !important;
215
313
  }
216
314
  .prokodo-RTE__editor ul,
217
315
  .prokodo-RTE__editor ol {
218
- margin: 0 0 0.5rem 1.25rem;
219
- padding: 0;
316
+ margin: 0 0 0.5rem 1.25rem !important;
317
+ padding: 0 !important;
220
318
  }
221
319
  .prokodo-RTE__editor pre {
222
- margin: 0.5rem 0;
320
+ margin: 0.5rem 0 !important;
223
321
  padding: 0.5rem;
224
322
  border-radius: 14px;
225
323
  overflow: auto;
@@ -227,7 +325,7 @@
227
325
  }
228
326
  .prokodo-RTE__editor code {
229
327
  background: rgba(0, 0, 0, 0.06);
230
- padding: 0 6px;
328
+ padding: 0 6px !important;
231
329
  border-radius: 8px;
232
330
  }
233
331
  .prokodo-RTE__editor img {
@@ -237,6 +335,128 @@
237
335
  display: block;
238
336
  margin: 0.5rem 0;
239
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
+ }
240
460
  .prokodo-RTE--disabled {
241
461
  opacity: 0.9;
242
462
  }
@@ -5,6 +5,9 @@ const styles = {
5
5
  "prokodo-RTE__toolbar__icon__part__stroke": "prokodo-RTE__toolbar__icon__part__stroke",
6
6
  "prokodo-RTE__toolbar__icon__part__stroke__miter": "prokodo-RTE__toolbar__icon__part__stroke__miter",
7
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",
8
11
  "prokodo-RTE__resize": "prokodo-RTE__resize",
9
12
  "prokodo-RTE__mount": "prokodo-RTE__mount",
10
13
  "prokodo-RTE__mount--disabled": "prokodo-RTE__mount--disabled",
@@ -31,8 +31,29 @@ function decorateToolbar(toolbarEl) {
31
31
  addClasses(el, bem("toolbar__icon__part__stroke__miter"));
32
32
  }
33
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
+ });
34
46
  }
35
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");
36
57
  function cleanupQuill(surfaceEl, mountEl) {
37
58
  if (!surfaceEl || !mountEl) return;
38
59
  surfaceEl.querySelectorAll(":scope > .ql-toolbar").forEach((el) => el.remove());
@@ -47,5 +68,6 @@ export {
47
68
  addClasses,
48
69
  bem,
49
70
  cleanupQuill,
50
- decorateToolbar
71
+ decorateToolbar,
72
+ syncPickerSelected
51
73
  };
@@ -255,6 +255,7 @@ html[data-theme=dark] .prokodo-Button--has-variant-outlined {
255
255
  background: none;
256
256
  }
257
257
  .prokodo-Button--has-image, .prokodo-Button--has-icon {
258
+ display: flex;
258
259
  align-items: center;
259
260
  }
260
261
  .prokodo-Button--icon-only {