@kilivi/payloadcms-theme-management 2.1.0 → 2.2.0

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 (81) hide show
  1. package/README.md +37 -7
  2. package/dist/components/ServerThemeInjector.d.ts +13 -1
  3. package/dist/components/ServerThemeInjector.d.ts.map +1 -1
  4. package/dist/components/ServerThemeInjector.js +24 -1
  5. package/dist/components/ServerThemeInjector.js.map +1 -1
  6. package/dist/components/ThemeLivePreviewSync.d.ts +3 -0
  7. package/dist/components/ThemeLivePreviewSync.d.ts.map +1 -1
  8. package/dist/components/ThemeLivePreviewSync.js +28 -4
  9. package/dist/components/ThemeLivePreviewSync.js.map +1 -1
  10. package/dist/components/typographyPreviewUtils.d.ts +5 -0
  11. package/dist/components/typographyPreviewUtils.d.ts.map +1 -1
  12. package/dist/components/typographyPreviewUtils.js +16 -10
  13. package/dist/components/typographyPreviewUtils.js.map +1 -1
  14. package/dist/constants/themeFonts.d.ts +94 -168
  15. package/dist/constants/themeFonts.d.ts.map +1 -1
  16. package/dist/constants/themeFonts.js +260 -140
  17. package/dist/constants/themeFonts.js.map +1 -1
  18. package/dist/endpoints/themeFonts.d.ts +5 -0
  19. package/dist/endpoints/themeFonts.d.ts.map +1 -0
  20. package/dist/endpoints/themeFonts.js +138 -0
  21. package/dist/endpoints/themeFonts.js.map +1 -0
  22. package/dist/fields/AppearancePreviewField.d.ts.map +1 -1
  23. package/dist/fields/AppearancePreviewField.js +196 -133
  24. package/dist/fields/AppearancePreviewField.js.map +1 -1
  25. package/dist/fields/FontSelectField.css +155 -0
  26. package/dist/fields/FontSelectField.d.ts +4 -2
  27. package/dist/fields/FontSelectField.d.ts.map +1 -1
  28. package/dist/fields/FontSelectField.js +80 -118
  29. package/dist/fields/FontSelectField.js.map +1 -1
  30. package/dist/fields/StylePresetField.d.ts.map +1 -1
  31. package/dist/fields/StylePresetField.js +31 -30
  32. package/dist/fields/StylePresetField.js.map +1 -1
  33. package/dist/fields/ThemePreviewField.css +63 -1
  34. package/dist/fields/ThemePreviewField.d.ts.map +1 -1
  35. package/dist/fields/ThemePreviewField.js +2 -5
  36. package/dist/fields/ThemePreviewField.js.map +1 -1
  37. package/dist/fields/themeConfigurationField.d.ts.map +1 -1
  38. package/dist/fields/themeConfigurationField.js +320 -271
  39. package/dist/fields/themeConfigurationField.js.map +1 -1
  40. package/dist/hooks/useNativeLivePreview.d.ts +15 -0
  41. package/dist/hooks/useNativeLivePreview.d.ts.map +1 -0
  42. package/dist/hooks/useNativeLivePreview.js +18 -0
  43. package/dist/hooks/useNativeLivePreview.js.map +1 -0
  44. package/dist/hooks/useThemeFonts.d.ts +10 -0
  45. package/dist/hooks/useThemeFonts.d.ts.map +1 -0
  46. package/dist/hooks/useThemeFonts.js +36 -0
  47. package/dist/hooks/useThemeFonts.js.map +1 -0
  48. package/dist/index.d.ts +3 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +9 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/next-fonts.d.ts +3 -0
  53. package/dist/next-fonts.d.ts.map +1 -0
  54. package/dist/next-fonts.js +360 -0
  55. package/dist/next-fonts.js.map +1 -0
  56. package/dist/payload-types.d.ts +10 -6
  57. package/dist/payload-types.d.ts.map +1 -1
  58. package/dist/payload-types.js.map +1 -1
  59. package/dist/presets.d.ts +6 -0
  60. package/dist/presets.d.ts.map +1 -1
  61. package/dist/presets.js.map +1 -1
  62. package/dist/style-presets.d.ts +27 -18
  63. package/dist/style-presets.d.ts.map +1 -1
  64. package/dist/style-presets.js +399 -217
  65. package/dist/style-presets.js.map +1 -1
  66. package/dist/translations.d.ts +5 -0
  67. package/dist/translations.d.ts.map +1 -1
  68. package/dist/translations.js +10 -0
  69. package/dist/translations.js.map +1 -1
  70. package/dist/utils/livePreviewThemeRuntime.d.ts +6 -1
  71. package/dist/utils/livePreviewThemeRuntime.d.ts.map +1 -1
  72. package/dist/utils/livePreviewThemeRuntime.js +11 -1
  73. package/dist/utils/livePreviewThemeRuntime.js.map +1 -1
  74. package/dist/utils/resolveThemeConfiguration.d.ts +15 -0
  75. package/dist/utils/resolveThemeConfiguration.d.ts.map +1 -1
  76. package/dist/utils/resolveThemeConfiguration.js +41 -8
  77. package/dist/utils/resolveThemeConfiguration.js.map +1 -1
  78. package/dist/utils/themeUtils.d.ts.map +1 -1
  79. package/dist/utils/themeUtils.js +60 -2
  80. package/dist/utils/themeUtils.js.map +1 -1
  81. package/package.json +5 -1
@@ -1,4 +1,4 @@
1
- import { BASE_FONT_SIZE_OPTIONS, BODY_FONT_OPTIONS, HEADING_FONT_OPTIONS, LINE_HEIGHT_OPTIONS } from '../constants/themeFonts.js';
1
+ import { BASE_FONT_SIZE_OPTIONS, BODY_FONT_OPTIONS, HEADING_FONT_OPTIONS, HEADING_WEIGHT_OPTIONS, LETTER_SPACING_OPTIONS, LINE_HEIGHT_OPTIONS } from '../constants/themeFonts.js';
2
2
  import { getTranslations } from '../translations.js';
3
3
  import { darkModeField, lightModeField } from './colorModeFields.js';
4
4
  /**
@@ -83,207 +83,6 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
83
83
  }
84
84
  ]
85
85
  });
86
- // Border Radius Configuration - Always visible
87
- fields.push({
88
- type: 'row',
89
- fields: [
90
- {
91
- name: 'borderRadius',
92
- type: 'select',
93
- label: {
94
- en: 'Border Radius',
95
- cs: 'Zaoblení rohů'
96
- },
97
- defaultValue: 'medium',
98
- options: [
99
- {
100
- label: {
101
- en: 'None (0px)',
102
- cs: 'Žádné (0px)'
103
- },
104
- value: 'none'
105
- },
106
- {
107
- label: {
108
- en: 'Small (0.25rem)',
109
- cs: 'Malé (0.25rem)'
110
- },
111
- value: 'small'
112
- },
113
- {
114
- label: {
115
- en: 'Medium (0.5rem)',
116
- cs: 'Střední (0.5rem)'
117
- },
118
- value: 'medium'
119
- },
120
- {
121
- label: {
122
- en: 'Large (0.75rem)',
123
- cs: 'Velké (0.75rem)'
124
- },
125
- value: 'large'
126
- },
127
- {
128
- label: {
129
- en: 'XL (1rem)',
130
- cs: 'XL (1rem)'
131
- },
132
- value: 'xl'
133
- }
134
- ],
135
- admin: {
136
- description: {
137
- en: 'Default corner rounding for UI elements',
138
- cs: 'Výchozí zaoblení rohů pro UI prvky'
139
- },
140
- width: '50%'
141
- },
142
- dbName: 'border_radius'
143
- },
144
- {
145
- name: 'spacing',
146
- type: 'select',
147
- label: {
148
- en: 'Spacing Scale',
149
- cs: 'Škála rozestupů'
150
- },
151
- defaultValue: 'medium',
152
- options: [
153
- {
154
- label: {
155
- en: 'Compact',
156
- cs: 'Kompaktní'
157
- },
158
- value: 'compact'
159
- },
160
- {
161
- label: {
162
- en: 'Medium',
163
- cs: 'Střední'
164
- },
165
- value: 'medium'
166
- },
167
- {
168
- label: {
169
- en: 'Comfortable',
170
- cs: 'Pohodlné'
171
- },
172
- value: 'comfortable'
173
- }
174
- ],
175
- admin: {
176
- description: {
177
- en: 'Global spacing between elements',
178
- cs: 'Globální rozestupy mezi prvky'
179
- },
180
- width: '50%'
181
- },
182
- dbName: 'spacing'
183
- }
184
- ]
185
- });
186
- // Color Mode Settings
187
- if (includeColorModeToggle) {
188
- fields.push({
189
- type: 'collapsible',
190
- label: {
191
- en: 'Color Mode Settings',
192
- cs: 'Nastavení barevného režimu'
193
- },
194
- admin: {
195
- // Fine-tuning: collapsed by default so presets and the preview lead the tab.
196
- initCollapsed: true,
197
- description: {
198
- en: 'Individual light and dark mode colours. Edits here take precedence over the theme.',
199
- cs: 'Jednotlivé barvy světlého a tmavého režimu. Úpravy zde mají přednost před motivem.'
200
- }
201
- },
202
- fields: [
203
- {
204
- type: 'row',
205
- fields: [
206
- {
207
- name: 'colorMode',
208
- type: 'select',
209
- label: {
210
- en: 'Default Color Mode',
211
- cs: 'Výchozí barevný režim'
212
- },
213
- defaultValue: 'auto',
214
- options: [
215
- {
216
- label: {
217
- en: 'Auto (System)',
218
- cs: 'Automaticky (Systém)'
219
- },
220
- value: 'auto'
221
- },
222
- {
223
- label: {
224
- en: 'Light',
225
- cs: 'Světlý'
226
- },
227
- value: 'light'
228
- },
229
- {
230
- label: {
231
- en: 'Dark',
232
- cs: 'Tmavý'
233
- },
234
- value: 'dark'
235
- }
236
- ],
237
- admin: {
238
- description: {
239
- en: 'Default color mode for visitors',
240
- cs: 'Výchozí barevný režim pro návštěvníky'
241
- },
242
- width: '50%'
243
- },
244
- dbName: 'color_mode'
245
- },
246
- {
247
- name: 'allowColorModeToggle',
248
- type: 'checkbox',
249
- label: {
250
- en: 'Enable Mode Toggle',
251
- cs: 'Povolit přepínač režimu'
252
- },
253
- defaultValue: true,
254
- admin: {
255
- description: {
256
- en: 'Let visitors switch modes',
257
- cs: 'Umožnit návštěvníkům přepínat režimy'
258
- },
259
- width: '50%'
260
- }
261
- }
262
- ]
263
- },
264
- lightModeField,
265
- darkModeField,
266
- {
267
- name: 'accessibilityAudit',
268
- type: 'ui',
269
- admin: {
270
- components: {
271
- Field: '@kilivi/payloadcms-theme-management/fields/AccessibilityAuditField'
272
- }
273
- }
274
- },
275
- {
276
- name: 'themeExport',
277
- type: 'ui',
278
- admin: {
279
- components: {
280
- Field: '@kilivi/payloadcms-theme-management/fields/ThemeExportField'
281
- }
282
- }
283
- }
284
- ]
285
- });
286
- }
287
86
  // Typography - Always visible
288
87
  fields.push({
289
88
  type: 'collapsible',
@@ -295,14 +94,19 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
295
94
  initCollapsed: true,
296
95
  className: 'tm-section-typography',
297
96
  description: {
298
- en: 'Choose font families and base typography settings. Leave fields on "Use preset" to inherit the theme defaults.',
299
- cs: 'Zvolte rodiny písem a základní typografické nastavení. Hodnota "Použít výchozí" zachová nastavení motivu.'
97
+ en: 'Fonts, text size and the character of headings. "Use theme preset" keeps the colour theme’s defaults.',
98
+ cs: 'Písma, velikost textu a charakter nadpisů. „Podle motivu“ ponechá výchozí nastavení barevného motivu.'
300
99
  }
301
100
  },
302
101
  fields: [
303
102
  {
304
103
  name: 'typography',
305
104
  type: 'group',
105
+ // The collapsible around it already carries the heading.
106
+ label: false,
107
+ admin: {
108
+ hideGutter: true
109
+ },
306
110
  fields: [
307
111
  {
308
112
  type: 'row',
@@ -397,10 +201,7 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
397
201
  cs: 'Základní velikost písma'
398
202
  },
399
203
  defaultValue: 'preset',
400
- options: BASE_FONT_SIZE_OPTIONS.map((option)=>({
401
- label: option.label,
402
- value: option.value
403
- })),
204
+ options: BASE_FONT_SIZE_OPTIONS,
404
205
  admin: {
405
206
  width: '50%'
406
207
  },
@@ -414,56 +215,155 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
414
215
  cs: 'Řádkování'
415
216
  },
416
217
  defaultValue: 'preset',
417
- options: LINE_HEIGHT_OPTIONS.map((option)=>({
418
- label: option.label,
419
- value: option.value
420
- })),
218
+ options: LINE_HEIGHT_OPTIONS,
421
219
  admin: {
422
220
  width: '50%'
423
221
  },
424
222
  dbName: 'line_height'
425
223
  }
426
224
  ]
225
+ },
226
+ {
227
+ type: 'row',
228
+ fields: [
229
+ {
230
+ name: 'headingWeight',
231
+ type: 'select',
232
+ label: {
233
+ en: 'Heading weight',
234
+ cs: 'Tloušťka nadpisů'
235
+ },
236
+ defaultValue: 'preset',
237
+ options: HEADING_WEIGHT_OPTIONS,
238
+ admin: {
239
+ width: '50%'
240
+ },
241
+ dbName: 'heading_weight'
242
+ },
243
+ {
244
+ name: 'letterSpacing',
245
+ type: 'select',
246
+ label: {
247
+ en: 'Heading letter spacing',
248
+ cs: 'Prostrkání nadpisů'
249
+ },
250
+ defaultValue: 'preset',
251
+ options: LETTER_SPACING_OPTIONS,
252
+ admin: {
253
+ width: '50%',
254
+ description: {
255
+ en: '"Extra wide" also sets headings in capitals.',
256
+ cs: '„Velmi široké“ zároveň převede nadpisy na verzálky.'
257
+ }
258
+ },
259
+ dbName: 'letter_spacing'
260
+ }
261
+ ]
427
262
  }
428
263
  ]
429
264
  }
430
265
  ]
431
266
  });
432
- const customPresetsField = {
433
- type: 'collapsible',
434
- label: {
435
- en: 'Custom Theme Presets',
436
- cs: 'Vlastní motivy'
437
- },
438
- admin: {
439
- initCollapsed: true,
440
- className: 'tm-section-custom-presets',
441
- description: {
442
- en: 'Import additional theme presets via JSON to extend or override the defaults. These presets become available instantly in the Theme Selection above.',
443
- cs: 'Importujte další motivy pomocí JSONu a rozšiřte nebo přepište výchozí nabídku. Motivy budou ihned k dispozici ve výběru výše.'
444
- }
445
- },
267
+ // Shape & rhythm — corner rounding and spacing scale
268
+ fields.push({
269
+ type: 'row',
446
270
  fields: [
447
271
  {
448
- name: 'customThemePresets',
449
- type: 'json',
272
+ name: 'borderRadius',
273
+ type: 'select',
274
+ label: {
275
+ en: 'Border Radius',
276
+ cs: 'Zaoblení rohů'
277
+ },
278
+ defaultValue: 'medium',
279
+ options: [
280
+ {
281
+ label: {
282
+ en: 'None (0px)',
283
+ cs: 'Žádné (0px)'
284
+ },
285
+ value: 'none'
286
+ },
287
+ {
288
+ label: {
289
+ en: 'Small (0.25rem)',
290
+ cs: 'Malé (0.25rem)'
291
+ },
292
+ value: 'small'
293
+ },
294
+ {
295
+ label: {
296
+ en: 'Medium (0.5rem)',
297
+ cs: 'Střední (0.5rem)'
298
+ },
299
+ value: 'medium'
300
+ },
301
+ {
302
+ label: {
303
+ en: 'Large (0.75rem)',
304
+ cs: 'Velké (0.75rem)'
305
+ },
306
+ value: 'large'
307
+ },
308
+ {
309
+ label: {
310
+ en: 'XL (1rem)',
311
+ cs: 'XL (1rem)'
312
+ },
313
+ value: 'xl'
314
+ }
315
+ ],
316
+ admin: {
317
+ description: {
318
+ en: 'Default corner rounding for UI elements',
319
+ cs: 'Výchozí zaoblení rohů pro UI prvky'
320
+ },
321
+ width: '50%'
322
+ },
323
+ dbName: 'border_radius'
324
+ },
325
+ {
326
+ name: 'spacing',
327
+ type: 'select',
450
328
  label: {
451
- en: 'Custom Preset JSON',
452
- cs: 'JSON s vlastními motivy'
329
+ en: 'Spacing Scale',
330
+ cs: 'Škála rozestupů'
453
331
  },
332
+ defaultValue: 'medium',
333
+ options: [
334
+ {
335
+ label: {
336
+ en: 'Compact',
337
+ cs: 'Kompaktní'
338
+ },
339
+ value: 'compact'
340
+ },
341
+ {
342
+ label: {
343
+ en: 'Medium',
344
+ cs: 'Střední'
345
+ },
346
+ value: 'medium'
347
+ },
348
+ {
349
+ label: {
350
+ en: 'Comfortable',
351
+ cs: 'Pohodlné'
352
+ },
353
+ value: 'comfortable'
354
+ }
355
+ ],
454
356
  admin: {
455
357
  description: {
456
- en: 'Paste or import an array (or object map) of theme presets. Each entry should include at least a unique "name" and "label" with optional lightMode/darkMode colors.',
457
- cs: 'Vložte nebo importujte pole (či objekt) motivů. Každý motiv musí mít unikátní „name“ a „label“ a volitelně barvy pro světlý a tmavý režim.'
358
+ en: 'Global spacing between elements',
359
+ cs: 'Globální rozestupy mezi prvky'
458
360
  },
459
- components: {
460
- Field: '@kilivi/payloadcms-theme-management/fields/ThemePresetImportField'
461
- }
462
- }
361
+ width: '50%'
362
+ },
363
+ dbName: 'spacing'
463
364
  }
464
365
  ]
465
- };
466
- fields.push(customPresetsField);
366
+ });
467
367
  // Visual Effects — glassmorphism, shadows, border style
468
368
  fields.push({
469
369
  type: 'collapsible',
@@ -483,6 +383,11 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
483
383
  {
484
384
  name: 'visualEffects',
485
385
  type: 'group',
386
+ // The collapsible around it already carries the heading.
387
+ label: false,
388
+ admin: {
389
+ hideGutter: true
390
+ },
486
391
  fields: [
487
392
  {
488
393
  type: 'row',
@@ -647,13 +552,38 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
647
552
  ],
648
553
  admin: {
649
554
  description: {
650
- en: 'Blur effect behind translucent elements (requires glass effect style).',
651
- cs: 'Rozmazání za průhledné prvky (vyžaduje styl skla).'
555
+ en: 'Blur behind translucent glass panels.',
556
+ cs: 'Rozostření za průsvitnými skleněnými panely.'
652
557
  },
653
- width: '50%'
558
+ width: '50%',
559
+ condition: (_, siblingData)=>siblingData?.effectStyle === 'glass'
654
560
  },
655
561
  dbName: 'backdrop_blur'
656
562
  },
563
+ {
564
+ name: 'glassOpacity',
565
+ type: 'number',
566
+ label: {
567
+ en: 'Glass Opacity (%)',
568
+ cs: 'Průhlednost skla (%)'
569
+ },
570
+ defaultValue: 60,
571
+ min: 0,
572
+ max: 100,
573
+ admin: {
574
+ description: {
575
+ en: 'Card/panel opacity when using glass effect (0 = fully transparent, 100 = opaque).',
576
+ cs: 'Průhlednost karet/panelů při skleněném efektu (0 = plně průhledné, 100 = neprůhledné).'
577
+ },
578
+ width: '50%',
579
+ condition: (_, siblingData)=>siblingData?.effectStyle === 'glass'
580
+ }
581
+ }
582
+ ]
583
+ },
584
+ {
585
+ type: 'row',
586
+ fields: [
657
587
  {
658
588
  name: 'borderStyle',
659
589
  type: 'select',
@@ -707,12 +637,7 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
707
637
  width: '50%'
708
638
  },
709
639
  dbName: 'border_style'
710
- }
711
- ]
712
- },
713
- {
714
- type: 'row',
715
- fields: [
640
+ },
716
641
  {
717
642
  name: 'borderWidth',
718
643
  type: 'select',
@@ -744,28 +669,10 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
744
669
  }
745
670
  ],
746
671
  admin: {
747
- width: '50%'
672
+ width: '50%',
673
+ condition: (_, siblingData)=>siblingData?.borderStyle !== 'none'
748
674
  },
749
675
  dbName: 'border_width'
750
- },
751
- {
752
- name: 'glassOpacity',
753
- type: 'number',
754
- label: {
755
- en: 'Glass Opacity (%)',
756
- cs: 'Průhlednost skla (%)'
757
- },
758
- defaultValue: 60,
759
- min: 0,
760
- max: 100,
761
- admin: {
762
- description: {
763
- en: 'Card/panel opacity when using glass effect (0 = fully transparent, 100 = opaque).',
764
- cs: 'Průhlednost karet/panelů při skleněném efektu (0 = plně průhledné, 100 = neprůhledné).'
765
- },
766
- width: '50%',
767
- condition: (_, siblingData)=>siblingData?.effectStyle === 'glass'
768
- }
769
676
  }
770
677
  ]
771
678
  }
@@ -792,6 +699,11 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
792
699
  {
793
700
  name: 'componentStyles',
794
701
  type: 'group',
702
+ // The collapsible around it already carries the heading.
703
+ label: false,
704
+ admin: {
705
+ hideGutter: true
706
+ },
795
707
  fields: [
796
708
  {
797
709
  type: 'row',
@@ -1206,8 +1118,8 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
1206
1118
  ],
1207
1119
  admin: {
1208
1120
  description: {
1209
- en: 'Default treatment for content images (applied via [data-img] / .themed-image).',
1210
- cs: 'Výchozí úprava obsahových obrázků (přes [data-img] / .themed-image).'
1121
+ en: 'How images inside page content are shown.',
1122
+ cs: 'Jak se zobrazují obrázky v obsahu stránek.'
1211
1123
  },
1212
1124
  width: '50%'
1213
1125
  },
@@ -1260,8 +1172,8 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
1260
1172
  ],
1261
1173
  admin: {
1262
1174
  description: {
1263
- en: 'Default style for in-content links (applied via [data-link] / .themed-link).',
1264
- cs: 'Výchozí styl odkazů v obsahu (přes [data-link] / .themed-link).'
1175
+ en: 'How links inside text look.',
1176
+ cs: 'Jak vypadají odkazy v textu.'
1265
1177
  },
1266
1178
  width: '50%'
1267
1179
  },
@@ -1310,6 +1222,143 @@ import { darkModeField, lightModeField } from './colorModeFields.js';
1310
1222
  }
1311
1223
  ]
1312
1224
  });
1225
+ // Color Mode Settings
1226
+ if (includeColorModeToggle) {
1227
+ fields.push({
1228
+ type: 'collapsible',
1229
+ label: {
1230
+ en: 'Color Mode Settings',
1231
+ cs: 'Nastavení barevného režimu'
1232
+ },
1233
+ admin: {
1234
+ className: 'tm-section-colors',
1235
+ // Fine-tuning: collapsed by default so presets and the preview lead the tab.
1236
+ initCollapsed: true,
1237
+ description: {
1238
+ en: 'Individual light and dark mode colours. Edits here take precedence over the theme.',
1239
+ cs: 'Jednotlivé barvy světlého a tmavého režimu. Úpravy zde mají přednost před motivem.'
1240
+ }
1241
+ },
1242
+ fields: [
1243
+ {
1244
+ type: 'row',
1245
+ fields: [
1246
+ {
1247
+ name: 'colorMode',
1248
+ type: 'select',
1249
+ label: {
1250
+ en: 'Default Color Mode',
1251
+ cs: 'Výchozí barevný režim'
1252
+ },
1253
+ defaultValue: 'auto',
1254
+ options: [
1255
+ {
1256
+ label: {
1257
+ en: 'Auto (System)',
1258
+ cs: 'Automaticky (Systém)'
1259
+ },
1260
+ value: 'auto'
1261
+ },
1262
+ {
1263
+ label: {
1264
+ en: 'Light',
1265
+ cs: 'Světlý'
1266
+ },
1267
+ value: 'light'
1268
+ },
1269
+ {
1270
+ label: {
1271
+ en: 'Dark',
1272
+ cs: 'Tmavý'
1273
+ },
1274
+ value: 'dark'
1275
+ }
1276
+ ],
1277
+ admin: {
1278
+ description: {
1279
+ en: 'Default color mode for visitors',
1280
+ cs: 'Výchozí barevný režim pro návštěvníky'
1281
+ },
1282
+ width: '50%'
1283
+ },
1284
+ dbName: 'color_mode'
1285
+ },
1286
+ {
1287
+ name: 'allowColorModeToggle',
1288
+ type: 'checkbox',
1289
+ label: {
1290
+ en: 'Enable Mode Toggle',
1291
+ cs: 'Povolit přepínač režimu'
1292
+ },
1293
+ defaultValue: true,
1294
+ admin: {
1295
+ description: {
1296
+ en: 'Let visitors switch modes',
1297
+ cs: 'Umožnit návštěvníkům přepínat režimy'
1298
+ },
1299
+ width: '50%'
1300
+ }
1301
+ }
1302
+ ]
1303
+ },
1304
+ lightModeField,
1305
+ darkModeField,
1306
+ {
1307
+ name: 'accessibilityAudit',
1308
+ type: 'ui',
1309
+ admin: {
1310
+ components: {
1311
+ Field: '@kilivi/payloadcms-theme-management/fields/AccessibilityAuditField'
1312
+ }
1313
+ }
1314
+ },
1315
+ {
1316
+ name: 'themeExport',
1317
+ type: 'ui',
1318
+ admin: {
1319
+ components: {
1320
+ Field: '@kilivi/payloadcms-theme-management/fields/ThemeExportField'
1321
+ }
1322
+ }
1323
+ }
1324
+ ]
1325
+ });
1326
+ }
1327
+ const customPresetsField = {
1328
+ type: 'collapsible',
1329
+ label: {
1330
+ en: 'Custom Theme Presets',
1331
+ cs: 'Vlastní motivy'
1332
+ },
1333
+ admin: {
1334
+ initCollapsed: true,
1335
+ className: 'tm-section-custom-presets',
1336
+ description: {
1337
+ en: 'For developers: import extra colour themes as JSON. They appear in the theme list at the top straight away.',
1338
+ cs: 'Pro vývojáře: import dalších barevných motivů ve formátu JSON. Hned se objeví v seznamu motivů nahoře.'
1339
+ }
1340
+ },
1341
+ fields: [
1342
+ {
1343
+ name: 'customThemePresets',
1344
+ type: 'json',
1345
+ label: {
1346
+ en: 'Custom Preset JSON',
1347
+ cs: 'JSON s vlastními motivy'
1348
+ },
1349
+ admin: {
1350
+ description: {
1351
+ en: 'Paste or import an array (or object map) of theme presets. Each entry should include at least a unique "name" and "label" with optional lightMode/darkMode colors.',
1352
+ cs: 'Vložte nebo importujte pole (či objekt) motivů. Každý motiv musí mít unikátní „name“ a „label“ a volitelně barvy pro světlý a tmavý režim.'
1353
+ },
1354
+ components: {
1355
+ Field: '@kilivi/payloadcms-theme-management/fields/ThemePresetImportField'
1356
+ }
1357
+ }
1358
+ }
1359
+ ]
1360
+ };
1361
+ fields.push(customPresetsField);
1313
1362
  if (customThemeConfigurationFields?.length) {
1314
1363
  fields.push(...customThemeConfigurationFields);
1315
1364
  }