@frontlit/page-builder 0.1.0-alpha.1 → 0.1.0-alpha.2

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 (58) hide show
  1. package/README.md +6 -2
  2. package/dist/blocks/index.d.ts +7 -5
  3. package/dist/blocks/index.js +4 -3
  4. package/dist/builder/index.d.ts +5 -7
  5. package/dist/builder/index.js +6 -5
  6. package/dist/{button-C3VrMJkr.d.ts → button-Bzt1GDO-.d.ts} +2 -2
  7. package/dist/{chunk-GTY75HW2.js → chunk-ATNM5JHI.js} +2 -2
  8. package/dist/chunk-ATNM5JHI.js.map +1 -0
  9. package/dist/{chunk-7W6Q4WA7.js → chunk-H4P5MFJI.js} +89 -73
  10. package/dist/chunk-H4P5MFJI.js.map +1 -0
  11. package/dist/{chunk-SSQWYMQR.js → chunk-HDINUNI2.js} +11 -39
  12. package/dist/chunk-HDINUNI2.js.map +1 -0
  13. package/dist/{chunk-MO76KZY2.js → chunk-KQKSLI3L.js} +339 -314
  14. package/dist/chunk-KQKSLI3L.js.map +1 -0
  15. package/dist/{chunk-RBJBODQP.js → chunk-SGNRWWG3.js} +1931 -919
  16. package/dist/chunk-SGNRWWG3.js.map +1 -0
  17. package/dist/{chunk-7KIX4WAO.js → chunk-UO7XGBGM.js} +439 -535
  18. package/dist/chunk-UO7XGBGM.js.map +1 -0
  19. package/dist/chunk-XU7ALPGQ.js +22 -0
  20. package/dist/chunk-XU7ALPGQ.js.map +1 -0
  21. package/dist/components/index.d.ts +3 -3
  22. package/dist/components/index.js +3 -2
  23. package/dist/data-slots.d.ts +3 -3
  24. package/dist/data-slots.js +1 -1
  25. package/dist/{image-D7GlnOio.d.ts → image-DAWVx1zQ.d.ts} +3 -2
  26. package/dist/index.d.ts +7 -7
  27. package/dist/index.js +7 -6
  28. package/dist/media-CnLImjVC.d.ts +21 -0
  29. package/dist/models/index.d.ts +5 -5
  30. package/dist/models/index.js +1 -0
  31. package/dist/{page-DfVl_aHX.d.ts → page-W3hQga4w.d.ts} +2 -3
  32. package/dist/primitives/index.d.ts +251 -60
  33. package/dist/primitives/index.js +2 -1
  34. package/dist/renderer/index.d.ts +3 -3
  35. package/dist/renderer/index.js +5 -4
  36. package/dist/{section-background-BgOCp5l3.d.ts → section-background-MsdE40Rk.d.ts} +1 -1
  37. package/dist/styles.css +3896 -8303
  38. package/dist/{theme-style-39nxXQy0.d.ts → theme-style-Cbl7NM-T.d.ts} +23 -1
  39. package/dist/theme.css +174 -191
  40. package/dist/{widget--uEOpdq3.d.ts → widget-B_RoG6se.d.ts} +10 -6
  41. package/package.json +21 -10
  42. package/dist/chunk-7KIX4WAO.js.map +0 -1
  43. package/dist/chunk-7W6Q4WA7.js.map +0 -1
  44. package/dist/chunk-GTY75HW2.js.map +0 -1
  45. package/dist/chunk-MO76KZY2.js.map +0 -1
  46. package/dist/chunk-RBJBODQP.js.map +0 -1
  47. package/dist/chunk-SSQWYMQR.js.map +0 -1
  48. package/dist/fonts/montserrat/montserrat-latin-100-normal.woff2 +0 -0
  49. package/dist/fonts/montserrat/montserrat-latin-200-normal.woff2 +0 -0
  50. package/dist/fonts/montserrat/montserrat-latin-300-normal.woff2 +0 -0
  51. package/dist/fonts/montserrat/montserrat-latin-400-normal.woff2 +0 -0
  52. package/dist/fonts/montserrat/montserrat-latin-500-normal.woff2 +0 -0
  53. package/dist/fonts/montserrat/montserrat-latin-600-normal.woff2 +0 -0
  54. package/dist/fonts/montserrat/montserrat-latin-700-normal.woff2 +0 -0
  55. package/dist/fonts/montserrat/montserrat-latin-800-normal.woff2 +0 -0
  56. package/dist/fonts/montserrat/montserrat-latin-900-normal.woff2 +0 -0
  57. package/dist/fonts/source-sans-3/source-sans-3-latin-400-normal.woff2 +0 -0
  58. package/dist/media-Njv378j7.d.ts +0 -13
@@ -1,11 +1,13 @@
1
1
  "use client";
2
- import { NavLink, VideoWithPreview, Image, TextRenderer, SandboxedEmbed, ThemeModeSwitcher } from './chunk-7W6Q4WA7.js';
3
- import { Button2, Drawer, Section, cn, Preheader, Header1, Subheader1, PageCard, PageCardContent, Header2, Header4, Text2, Badge, PageCardHeader, Text1, Input, Label, Link, Caption, Header3 } from './chunk-RBJBODQP.js';
2
+ import { NavLink, VideoWithPreview, Image, TextRenderer, SandboxedEmbed, ThemeModeSwitcher } from './chunk-H4P5MFJI.js';
3
+ import { Button2, Drawer, Section, cn, Preheader, Header1, Subheader1, PageCard, PageCardContent, Header2, Header4, Text2, Badge, PageCardHeader, Text1, Input, Label, Link, Caption, Header3 } from './chunk-SGNRWWG3.js';
4
+ import { getMediaUrl, getMediaAlt } from './chunk-XU7ALPGQ.js';
4
5
  import React7, { useState, useId, useRef, useEffect } from 'react';
5
6
  import clsx3 from 'clsx';
6
7
  import * as Icons from 'lucide-react';
7
- import { MenuIcon, Code2, LockKeyhole, ChevronDown, Plus } from 'lucide-react';
8
+ import { MenuIcon, Code2, LockKeyhole, ChevronDown, ImageIcon, Plus } from 'lucide-react';
8
9
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
+ import { ImageUploadDialog } from '@frontlit/media-uploader';
9
11
  import { Editor, emptyDoc } from '@frontlit/text-editor';
10
12
 
11
13
  // src/blocks/header/metadata.ts
@@ -41,6 +43,8 @@ function HeaderWidget({
41
43
  settings: {
42
44
  logoText,
43
45
  logoImage,
46
+ logoCorners,
47
+ logoRadius,
44
48
  links = [],
45
49
  ctaLabel,
46
50
  ctaHref,
@@ -69,6 +73,7 @@ function HeaderWidget({
69
73
  const buttonLinks = links.filter((link) => link.isButton);
70
74
  const resolvedLogoImage = pageData.siteLogoUrl || logoImage;
71
75
  const resolvedLogoAlt = pageData.siteLogoAlt || logoText || "";
76
+ const effectiveLogoCorners = logoCorners ?? logoRadius ?? 2;
72
77
  const logo = /* @__PURE__ */ jsx(NavLink, { href: "/", className: "no-underline", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
73
78
  resolvedLogoImage && /* @__PURE__ */ jsx(
74
79
  Image,
@@ -77,7 +82,8 @@ function HeaderWidget({
77
82
  alt: resolvedLogoAlt,
78
83
  width: "w-8",
79
84
  height: "h-8",
80
- borderRadius: 2
85
+ className: "aspect-square shrink-0",
86
+ borderRadius: effectiveLogoCorners
81
87
  }
82
88
  ),
83
89
  logoText && /* @__PURE__ */ jsx(Header4, { theme: overriddenTheme, children: logoText })
@@ -103,18 +109,10 @@ function HeaderWidget({
103
109
  setOpen: setMobileNavOpen,
104
110
  side: "right",
105
111
  theme: overriddenTheme,
106
- trigger: /* @__PURE__ */ jsxs(
107
- Button2,
108
- {
109
- variant: "outline",
110
- size: "sm",
111
- theme: overriddenTheme,
112
- children: [
113
- /* @__PURE__ */ jsx(MenuIcon, { className: "h-4 w-4" }),
114
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle menu" })
115
- ]
116
- }
117
- ),
112
+ trigger: /* @__PURE__ */ jsxs(Button2, { variant: "outline", size: "sm", theme: overriddenTheme, children: [
113
+ /* @__PURE__ */ jsx(MenuIcon, { className: "h-4 w-4" }),
114
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle menu" })
115
+ ] }),
118
116
  children: /* @__PURE__ */ jsxs("div", { className: "mt-6 flex flex-col gap-4", children: [
119
117
  links.map((link) => /* @__PURE__ */ jsx(
120
118
  HeaderLink,
@@ -125,21 +123,7 @@ function HeaderWidget({
125
123
  },
126
124
  link.id
127
125
  )),
128
- ctaLabel && ctaHref && /* @__PURE__ */ jsx(
129
- NavLink,
130
- {
131
- href: ctaHref,
132
- onClick: () => setMobileNavOpen(false),
133
- children: /* @__PURE__ */ jsx(
134
- Button2,
135
- {
136
- theme: overriddenTheme,
137
- className: "w-full",
138
- children: ctaLabel
139
- }
140
- )
141
- }
142
- )
126
+ ctaLabel && ctaHref && /* @__PURE__ */ jsx(NavLink, { href: ctaHref, onClick: () => setMobileNavOpen(false), children: /* @__PURE__ */ jsx(Button2, { theme: overriddenTheme, className: "w-full", children: ctaLabel }) })
143
127
  ] })
144
128
  }
145
129
  ) })
@@ -150,24 +134,10 @@ function HeaderWidget({
150
134
  const leftLinks = primaryLinks.slice(0, half);
151
135
  const rightLinks = primaryLinks.slice(half);
152
136
  mainContent = /* @__PURE__ */ jsxs("div", { className: "grid w-full grid-cols-[1fr_auto_1fr] items-center gap-4", children: [
153
- /* @__PURE__ */ jsx("div", { className: "hidden items-center justify-end gap-6 lg:!flex", children: leftLinks.map((link) => /* @__PURE__ */ jsx(
154
- HeaderLink,
155
- {
156
- link,
157
- theme: overriddenTheme
158
- },
159
- link.id
160
- )) }),
137
+ /* @__PURE__ */ jsx("div", { className: "hidden items-center justify-end gap-6 lg:!flex", children: leftLinks.map((link) => /* @__PURE__ */ jsx(HeaderLink, { link, theme: overriddenTheme }, link.id)) }),
161
138
  /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: logo }),
162
139
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-3", children: [
163
- /* @__PURE__ */ jsx("div", { className: "hidden items-center gap-6 lg:!flex", children: rightLinks.map((link) => /* @__PURE__ */ jsx(
164
- HeaderLink,
165
- {
166
- link,
167
- theme: overriddenTheme
168
- },
169
- link.id
170
- )) }),
140
+ /* @__PURE__ */ jsx("div", { className: "hidden items-center gap-6 lg:!flex", children: rightLinks.map((link) => /* @__PURE__ */ jsx(HeaderLink, { link, theme: overriddenTheme }, link.id)) }),
171
141
  ctaAndMenu
172
142
  ] })
173
143
  ] });
@@ -181,14 +151,7 @@ function HeaderWidget({
181
151
  "hidden items-center gap-6 lg:!flex lg:!grow",
182
152
  linkAlignment === "right" ? "justify-end" : linkAlignment === "center" ? "justify-center" : "justify-start"
183
153
  ),
184
- children: primaryLinks.map((link) => /* @__PURE__ */ jsx(
185
- HeaderLink,
186
- {
187
- link,
188
- theme: overriddenTheme
189
- },
190
- link.id
191
- ))
154
+ children: primaryLinks.map((link) => /* @__PURE__ */ jsx(HeaderLink, { link, theme: overriddenTheme }, link.id))
192
155
  }
193
156
  ),
194
157
  ctaAndMenu
@@ -295,6 +258,66 @@ function NumberField({
295
258
  )
296
259
  ] });
297
260
  }
261
+ function SliderField({
262
+ label,
263
+ value = 0,
264
+ onChange,
265
+ min = 0,
266
+ max = 8,
267
+ step = 1,
268
+ unit = "",
269
+ displayValue,
270
+ minLabel,
271
+ maxLabel
272
+ }) {
273
+ const generatedId = useId();
274
+ const inputId = `field-${generatedId.replace(/:/g, "")}`;
275
+ const numValue = Number.isFinite(value) ? value : min;
276
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 text-sm", children: [
277
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
278
+ /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "text-xs font-semibold text-foreground", children: label }),
279
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
280
+ displayValue && /* @__PURE__ */ jsx("span", { className: "text-[11px] font-medium text-muted-foreground", children: displayValue }),
281
+ /* @__PURE__ */ jsx(
282
+ "input",
283
+ {
284
+ id: inputId,
285
+ type: "number",
286
+ inputMode: "numeric",
287
+ min,
288
+ max,
289
+ step,
290
+ value: numValue,
291
+ onChange: (e) => {
292
+ const parsed = Number(e.currentTarget.value);
293
+ if (Number.isNaN(parsed)) return;
294
+ onChange(Math.min(Math.max(parsed, min), max));
295
+ },
296
+ className: "h-7 w-12 rounded-md border border-input bg-muted/20 px-1.5 py-1 text-center text-xs font-semibold text-foreground outline-none transition-colors focus:border-ring focus:bg-background focus:ring-2 focus:ring-ring/20"
297
+ }
298
+ ),
299
+ unit && /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-muted-foreground", children: unit })
300
+ ] })
301
+ ] }),
302
+ /* @__PURE__ */ jsx(
303
+ "input",
304
+ {
305
+ type: "range",
306
+ min,
307
+ max,
308
+ step,
309
+ value: numValue,
310
+ onChange: (e) => onChange(Number(e.currentTarget.value)),
311
+ "aria-label": label,
312
+ className: "h-1.5 w-full cursor-pointer accent-primary"
313
+ }
314
+ ),
315
+ (minLabel || maxLabel) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-[10px] font-medium text-muted-foreground", children: [
316
+ /* @__PURE__ */ jsx("span", { children: minLabel }),
317
+ /* @__PURE__ */ jsx("span", { children: maxLabel })
318
+ ] })
319
+ ] });
320
+ }
298
321
  function SelectField({
299
322
  label,
300
323
  value,
@@ -401,6 +424,120 @@ function ListField({
401
424
  )
402
425
  ] });
403
426
  }
427
+ function ImageField({
428
+ label,
429
+ value,
430
+ onChange,
431
+ placeholder = "https://..."
432
+ }) {
433
+ const imageUrl = getMediaUrl(value);
434
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 text-sm", children: [
435
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-foreground", children: label }),
436
+ imageUrl ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
437
+ /* @__PURE__ */ jsx("div", { className: "relative aspect-video w-full overflow-hidden rounded-lg border border-border bg-muted/40", children: /* @__PURE__ */ jsx(
438
+ "img",
439
+ {
440
+ src: imageUrl,
441
+ alt: "Preview",
442
+ className: "h-full w-full object-cover"
443
+ }
444
+ ) }),
445
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
446
+ /* @__PURE__ */ jsx(
447
+ ImageUploadDialog,
448
+ {
449
+ title: `Choose ${label.toLowerCase()}`,
450
+ description: "Upload an image or select one from your library.",
451
+ onSelect: (selected) => {
452
+ const selMedia = selected.media;
453
+ const mediaLitId = selMedia?.mediaLitId ?? selMedia?.mediaId ?? void 0;
454
+ onChange({
455
+ ...mediaLitId ? { mediaId: mediaLitId, mediaLitId } : {},
456
+ url: selected.src,
457
+ file: selected.src,
458
+ thumbnailUrl: selMedia?.thumbnailUrl ?? selected.src,
459
+ thumbnail: selMedia?.thumbnailUrl ?? selected.src,
460
+ alt: selected.alt
461
+ });
462
+ },
463
+ children: /* @__PURE__ */ jsxs(
464
+ "button",
465
+ {
466
+ type: "button",
467
+ className: "inline-flex h-8 items-center justify-center rounded-lg border border-input bg-background px-3 text-xs font-medium text-foreground hover:bg-muted",
468
+ children: [
469
+ /* @__PURE__ */ jsx(ImageIcon, { className: "mr-1.5 h-3.5 w-3.5" }),
470
+ "Change image"
471
+ ]
472
+ }
473
+ )
474
+ }
475
+ ),
476
+ /* @__PURE__ */ jsx(
477
+ "button",
478
+ {
479
+ type: "button",
480
+ className: "inline-flex h-8 items-center justify-center rounded-lg border border-destructive/30 bg-background px-3 text-xs font-medium text-destructive hover:bg-destructive/10",
481
+ onClick: () => onChange(void 0),
482
+ children: "Remove"
483
+ }
484
+ )
485
+ ] })
486
+ ] }) : /* @__PURE__ */ jsx(
487
+ ImageUploadDialog,
488
+ {
489
+ title: `Choose ${label.toLowerCase()}`,
490
+ description: "Upload an image or select one from your library.",
491
+ onSelect: (selected) => {
492
+ const selMedia = selected.media;
493
+ const mediaLitId = selMedia?.mediaLitId ?? selMedia?.mediaId ?? void 0;
494
+ onChange({
495
+ ...mediaLitId ? { mediaId: mediaLitId, mediaLitId } : {},
496
+ url: selected.src,
497
+ file: selected.src,
498
+ thumbnailUrl: selMedia?.thumbnailUrl ?? selected.src,
499
+ thumbnail: selMedia?.thumbnailUrl ?? selected.src,
500
+ alt: selected.alt
501
+ });
502
+ },
503
+ children: /* @__PURE__ */ jsxs(
504
+ "button",
505
+ {
506
+ type: "button",
507
+ className: "flex w-full items-center justify-center gap-2 rounded-lg border border-dashed border-border bg-muted/20 py-3 text-xs font-medium text-muted-foreground transition-colors hover:border-primary/40 hover:bg-muted/40 hover:text-foreground",
508
+ children: [
509
+ /* @__PURE__ */ jsx(ImageIcon, { className: "h-4 w-4" }),
510
+ "Upload or choose image"
511
+ ]
512
+ }
513
+ )
514
+ }
515
+ ),
516
+ /* @__PURE__ */ jsx(
517
+ "input",
518
+ {
519
+ type: "text",
520
+ className: "h-9 rounded-lg border border-input bg-muted/20 px-3 py-2 text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground/70 focus:border-ring focus:bg-background focus:ring-2 focus:ring-ring/20",
521
+ value: imageUrl ?? "",
522
+ placeholder,
523
+ onChange: (e) => onChange(
524
+ e.target.value ? { url: e.target.value, file: e.target.value } : void 0
525
+ )
526
+ }
527
+ )
528
+ ] });
529
+ }
530
+ var CORNER_LABELS = {
531
+ 0: "Square",
532
+ 1: "Small",
533
+ 2: "Default",
534
+ 3: "Medium",
535
+ 4: "Large",
536
+ 5: "XL",
537
+ 6: "2XL",
538
+ 7: "3XL",
539
+ 8: "Full"
540
+ };
404
541
  function HeaderEditor({
405
542
  settings,
406
543
  onChange
@@ -417,12 +554,11 @@ function HeaderEditor({
417
554
  }
418
555
  ),
419
556
  /* @__PURE__ */ jsx(
420
- TextField,
557
+ ImageField,
421
558
  {
422
- label: "Logo image URL",
423
- value: settings.logoImage,
424
- placeholder: "https://...",
425
- onChange: (logoImage) => update({ logoImage })
559
+ label: "Logo image",
560
+ value: settings.logoImage ? typeof settings.logoImage === "string" ? { url: settings.logoImage, file: settings.logoImage } : settings.logoImage : void 0,
561
+ onChange: (media) => update({ logoImage: getMediaUrl(media) || void 0 })
426
562
  }
427
563
  )
428
564
  ] }),
@@ -526,10 +662,32 @@ function HeaderEditor({
526
662
  ] })
527
663
  ] });
528
664
  }
665
+ function HeaderDesignEditor({
666
+ settings,
667
+ onChange
668
+ }) {
669
+ const update = (partial) => onChange({ ...settings, ...partial });
670
+ const logoCorners = settings.logoCorners ?? settings.logoRadius ?? 2;
671
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: /* @__PURE__ */ jsx(FieldGroup, { title: "Logo styling", children: /* @__PURE__ */ jsx(
672
+ SliderField,
673
+ {
674
+ label: "Logo corners",
675
+ value: logoCorners,
676
+ min: 0,
677
+ max: 8,
678
+ step: 1,
679
+ minLabel: "0 (Square)",
680
+ maxLabel: "Full",
681
+ displayValue: CORNER_LABELS[logoCorners] ?? `${logoCorners}`,
682
+ onChange: (val) => update({ logoCorners: val })
683
+ }
684
+ ) }) });
685
+ }
529
686
 
530
687
  // src/blocks/header/defaults.ts
531
688
  var headerDefaults = {
532
689
  logoText: "FrontLit",
690
+ logoCorners: 2,
533
691
  links: [
534
692
  { id: generateUniqueId(), label: "Features", href: "/#features" },
535
693
  { id: generateUniqueId(), label: "Pricing", href: "/#pricing" },
@@ -552,6 +710,7 @@ var Header = {
552
710
  metadata: headerMetadata,
553
711
  widget: HeaderWidget,
554
712
  editor: HeaderEditor,
713
+ designEditor: HeaderDesignEditor,
555
714
  getDefaultSettings: () => headerDefaults,
556
715
  layouts: [
557
716
  { id: "fixed", name: "Fixed" },
@@ -604,7 +763,8 @@ function HeroWidget({
604
763
  const overriddenTheme = JSON.parse(JSON.stringify(theme.theme));
605
764
  overriddenTheme.structure.page.width = maxWidth || theme.theme.structure.page.width;
606
765
  overriddenTheme.structure.section.padding.y = verticalPadding || theme.theme.structure.section.padding.y;
607
- const hasHeroGraphic = youtubeLink || media && media.mediaId;
766
+ const mediaUrl = getMediaUrl(media);
767
+ const hasHeroGraphic = Boolean(youtubeLink || mediaUrl);
608
768
  const direction = alignment === "right" ? "md:!flex-row-reverse" : "md:!flex-row";
609
769
  const isCentered = layout === "centered" || layout === "media-below";
610
770
  const graphic = hasHeroGraphic && /* @__PURE__ */ jsx(
@@ -614,15 +774,15 @@ function HeroWidget({
614
774
  children: isVideo(youtubeLink, media) ? /* @__PURE__ */ jsx(
615
775
  VideoWithPreview,
616
776
  {
617
- videoUrl: youtubeLink || media?.file || "",
618
- title: media?.caption || "",
619
- thumbnailUrl: media?.thumbnail || ""
777
+ videoUrl: youtubeLink || mediaUrl || "",
778
+ title: getMediaAlt(media) || media?.caption || "",
779
+ thumbnailUrl: media?.thumbnail || media?.thumbnailUrl || ""
620
780
  }
621
781
  ) : /* @__PURE__ */ jsx(
622
782
  Image,
623
783
  {
624
- src: media?.file || "",
625
- alt: media?.caption || "",
784
+ src: mediaUrl || "",
785
+ alt: getMediaAlt(media),
626
786
  borderRadius: mediaRadius
627
787
  }
628
788
  )
@@ -636,14 +796,7 @@ function HeroWidget({
636
796
  isCentered || contentAlignment === "center" ? "items-center text-center" : "items-start justify-center h-full"
637
797
  ),
638
798
  children: [
639
- preTitle && /* @__PURE__ */ jsx(
640
- Preheader,
641
- {
642
- theme: overriddenTheme,
643
- className: "text-muted-foreground",
644
- children: preTitle
645
- }
646
- ),
799
+ preTitle && /* @__PURE__ */ jsx(Preheader, { theme: overriddenTheme, className: "text-muted-foreground", children: preTitle }),
647
800
  /* @__PURE__ */ jsx(Header1, { theme: overriddenTheme, children: title }),
648
801
  description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(TextRenderer, { json: description, theme: overriddenTheme }) }),
649
802
  /* @__PURE__ */ jsxs(
@@ -654,14 +807,7 @@ function HeroWidget({
654
807
  (isCentered || contentAlignment === "center") && "md:!justify-center"
655
808
  ),
656
809
  children: [
657
- buttonAction && buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: buttonAction, children: /* @__PURE__ */ jsx(
658
- Button2,
659
- {
660
- theme: overriddenTheme,
661
- className: "w-full md:min-w-[150px]",
662
- children: buttonCaption
663
- }
664
- ) }),
810
+ buttonAction && buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: buttonAction, children: /* @__PURE__ */ jsx(Button2, { theme: overriddenTheme, className: "w-full md:min-w-[150px]", children: buttonCaption }) }),
665
811
  secondaryButtonAction && secondaryButtonCaption && /* @__PURE__ */ jsx(NavLink, { href: secondaryButtonAction, children: /* @__PURE__ */ jsx(
666
812
  Button2,
667
813
  {
@@ -702,10 +848,7 @@ function HeroWidget({
702
848
  }
703
849
  );
704
850
  }
705
- function HeroEditor({
706
- settings,
707
- onChange
708
- }) {
851
+ function HeroEditor({ settings, onChange }) {
709
852
  const update = (partial) => onChange({ ...settings, ...partial });
710
853
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
711
854
  /* @__PURE__ */ jsxs(FieldGroup, { title: "Content", children: [
@@ -741,14 +884,11 @@ function HeroEditor({
741
884
  ] }),
742
885
  /* @__PURE__ */ jsxs(FieldGroup, { title: "Media", children: [
743
886
  /* @__PURE__ */ jsx(
744
- TextField,
887
+ ImageField,
745
888
  {
746
- label: "Image URL",
747
- value: settings.media?.file,
748
- placeholder: "https://...",
749
- onChange: (file) => update({
750
- media: file ? { mediaId: file, file } : void 0
751
- })
889
+ label: "Image",
890
+ value: settings.media,
891
+ onChange: (media) => update({ media })
752
892
  }
753
893
  ),
754
894
  /* @__PURE__ */ jsx(
@@ -889,7 +1029,9 @@ function ContentWidget({
889
1029
  const overriddenTheme = JSON.parse(JSON.stringify(theme.theme));
890
1030
  overriddenTheme.structure.page.width = maxWidth || theme.theme.structure.page.width;
891
1031
  overriddenTheme.structure.section.padding.y = verticalPadding || theme.theme.structure.section.padding.y;
892
- const hasMedia = Boolean(media && media.file);
1032
+ const mediaUrl = getMediaUrl(media);
1033
+ const mediaAlt = getMediaAlt(media);
1034
+ const hasMedia = Boolean(mediaUrl);
893
1035
  const sideBySide = layout !== "stacked" && layout !== "overlay";
894
1036
  const direction = alignment === "right" ? "md:!flex-row-reverse" : "md:!flex-row";
895
1037
  if (layout === "overlay") {
@@ -905,8 +1047,8 @@ function ContentWidget({
905
1047
  hasMedia && /* @__PURE__ */ jsx(
906
1048
  Image,
907
1049
  {
908
- src: media?.file || "",
909
- alt: media?.caption || "",
1050
+ src: mediaUrl || "",
1051
+ alt: mediaAlt,
910
1052
  width: "w-full",
911
1053
  height: "h-full",
912
1054
  className: "absolute inset-0",
@@ -923,13 +1065,7 @@ function ContentWidget({
923
1065
  ),
924
1066
  children: /* @__PURE__ */ jsxs("div", { className: "max-w-lg text-white", children: [
925
1067
  title && /* @__PURE__ */ jsx(Header2, { theme: overriddenTheme, children: title }),
926
- body && /* @__PURE__ */ jsx(
927
- TextRenderer,
928
- {
929
- json: body,
930
- theme: overriddenTheme
931
- }
932
- )
1068
+ body && /* @__PURE__ */ jsx(TextRenderer, { json: body, theme: overriddenTheme })
933
1069
  ] })
934
1070
  }
935
1071
  )
@@ -944,59 +1080,35 @@ function ContentWidget({
944
1080
  id: cssId,
945
1081
  background,
946
1082
  nextTheme,
947
- children: /* @__PURE__ */ jsxs(
948
- "div",
949
- {
950
- className: clsx3("flex flex-col gap-8", sideBySide && direction),
951
- children: [
952
- hasMedia && /* @__PURE__ */ jsx(
953
- "div",
954
- {
955
- className: clsx3(
956
- "flex w-full items-center",
957
- sideBySide && "md:w-1/2"
958
- ),
959
- children: /* @__PURE__ */ jsx(
960
- "div",
961
- {
962
- className: `w-full overflow-hidden ${roundedMap2[mediaRadius] ?? "rounded-md"}`,
963
- children: /* @__PURE__ */ jsx(
964
- Image,
965
- {
966
- src: media?.file || "",
967
- alt: media?.caption || "",
968
- borderRadius: mediaRadius
969
- }
970
- )
971
- }
972
- )
973
- }
974
- ),
975
- /* @__PURE__ */ jsx(
976
- "div",
1083
+ children: /* @__PURE__ */ jsxs("div", { className: clsx3("flex flex-col gap-8", sideBySide && direction), children: [
1084
+ hasMedia && /* @__PURE__ */ jsx("div", { className: clsx3("flex w-full items-center", sideBySide && "md:w-1/2"), children: /* @__PURE__ */ jsx(
1085
+ "div",
1086
+ {
1087
+ className: `w-full overflow-hidden ${roundedMap2[mediaRadius] ?? "rounded-md"}`,
1088
+ children: /* @__PURE__ */ jsx(
1089
+ Image,
977
1090
  {
978
- className: clsx3(
979
- "w-full",
980
- hasMedia && sideBySide && "md:w-1/2"
981
- ),
982
- children: /* @__PURE__ */ jsxs(
983
- "div",
984
- {
985
- className: clsx3(
986
- "flex h-full flex-col justify-center gap-4",
987
- headerAlignment === "center" ? "items-center text-center" : "items-start"
988
- ),
989
- children: [
990
- title && /* @__PURE__ */ jsx(Header2, { theme: overriddenTheme, children: title }),
991
- body && /* @__PURE__ */ jsx(TextRenderer, { json: body, theme: overriddenTheme })
992
- ]
993
- }
994
- )
1091
+ src: mediaUrl || "",
1092
+ alt: mediaAlt,
1093
+ borderRadius: mediaRadius
995
1094
  }
996
1095
  )
997
- ]
998
- }
999
- )
1096
+ }
1097
+ ) }),
1098
+ /* @__PURE__ */ jsx("div", { className: clsx3("w-full", hasMedia && sideBySide && "md:w-1/2"), children: /* @__PURE__ */ jsxs(
1099
+ "div",
1100
+ {
1101
+ className: clsx3(
1102
+ "flex h-full flex-col justify-center gap-4",
1103
+ headerAlignment === "center" ? "items-center text-center" : "items-start"
1104
+ ),
1105
+ children: [
1106
+ title && /* @__PURE__ */ jsx(Header2, { theme: overriddenTheme, children: title }),
1107
+ body && /* @__PURE__ */ jsx(TextRenderer, { json: body, theme: overriddenTheme })
1108
+ ]
1109
+ }
1110
+ ) })
1111
+ ] })
1000
1112
  }
1001
1113
  );
1002
1114
  }
@@ -1029,14 +1141,11 @@ function ContentEditor({
1029
1141
  ] }),
1030
1142
  /* @__PURE__ */ jsxs(FieldGroup, { title: "Media", children: [
1031
1143
  /* @__PURE__ */ jsx(
1032
- TextField,
1144
+ ImageField,
1033
1145
  {
1034
- label: "Image URL",
1035
- value: settings.media?.file,
1036
- placeholder: "https://...",
1037
- onChange: (file) => update({
1038
- media: file ? { mediaId: file, file } : void 0
1039
- })
1146
+ label: "Image",
1147
+ value: settings.media,
1148
+ onChange: (media) => update({ media })
1040
1149
  }
1041
1150
  ),
1042
1151
  /* @__PURE__ */ jsx(
@@ -1161,13 +1270,7 @@ function FeaturedWidget({
1161
1270
  ),
1162
1271
  children: [
1163
1272
  /* @__PURE__ */ jsx(Header1, { theme: overriddenTheme, children: title }),
1164
- description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(
1165
- TextRenderer,
1166
- {
1167
- json: description,
1168
- theme: overriddenTheme
1169
- }
1170
- ) })
1273
+ description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(TextRenderer, { json: description, theme: overriddenTheme }) })
1171
1274
  ]
1172
1275
  }
1173
1276
  ),
@@ -1215,13 +1318,7 @@ function FeaturedWidget({
1215
1318
  ),
1216
1319
  children: [
1217
1320
  /* @__PURE__ */ jsx(Header4, { theme: overriddenTheme, children: item.title }),
1218
- item.description && layout !== "compact" && /* @__PURE__ */ jsx(
1219
- Text2,
1220
- {
1221
- theme: overriddenTheme,
1222
- children: item.description
1223
- }
1224
- )
1321
+ item.description && layout !== "compact" && /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, children: item.description })
1225
1322
  ]
1226
1323
  }
1227
1324
  )
@@ -1430,19 +1527,10 @@ function FaqWidget({
1430
1527
  {
1431
1528
  type: "button",
1432
1529
  className: "flex w-full items-center justify-between gap-4 text-left",
1433
- onClick: () => setExpandedIndex(
1434
- isOpen ? null : index
1435
- ),
1530
+ onClick: () => setExpandedIndex(isOpen ? null : index),
1436
1531
  "aria-expanded": isOpen,
1437
1532
  children: [
1438
- /* @__PURE__ */ jsx(
1439
- Text1,
1440
- {
1441
- theme: overriddenTheme,
1442
- className: "font-medium",
1443
- children: item.question
1444
- }
1445
- ),
1533
+ /* @__PURE__ */ jsx(Text1, { theme: overriddenTheme, className: "font-medium", children: item.question }),
1446
1534
  /* @__PURE__ */ jsx(
1447
1535
  ChevronDown,
1448
1536
  {
@@ -1455,14 +1543,7 @@ function FaqWidget({
1455
1543
  ]
1456
1544
  }
1457
1545
  ),
1458
- isOpen && /* @__PURE__ */ jsx("div", { className: "pt-3", children: /* @__PURE__ */ jsx(
1459
- Text1,
1460
- {
1461
- theme: overriddenTheme,
1462
- className: "text-muted-foreground",
1463
- children: item.answer
1464
- }
1465
- ) })
1546
+ isOpen && /* @__PURE__ */ jsx("div", { className: "pt-3", children: /* @__PURE__ */ jsx(Text1, { theme: overriddenTheme, className: "text-muted-foreground", children: item.answer }) })
1466
1547
  ]
1467
1548
  },
1468
1549
  item.id
@@ -1473,21 +1554,15 @@ function FaqWidget({
1473
1554
  const left = items.slice(0, half);
1474
1555
  const right = items.slice(half);
1475
1556
  return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-x-10 md:grid-cols-2", children: [
1476
- /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: left.map(
1477
- (item, i) => renderItem(item, i)
1478
- ) }),
1479
- /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: right.map(
1480
- (item, i) => renderItem(item, half + i)
1481
- ) })
1557
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: left.map((item, i) => renderItem(item, i)) }),
1558
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: right.map((item, i) => renderItem(item, half + i)) })
1482
1559
  ] });
1483
1560
  }
1484
1561
  return /* @__PURE__ */ jsx(
1485
1562
  "div",
1486
1563
  {
1487
1564
  className: layout === "cards" ? "flex flex-col gap-3" : "flex flex-col divide-y divide-border border-b border-t border-border",
1488
- children: items.map(
1489
- (item, index) => renderItem(item, index)
1490
- )
1565
+ children: items.map((item, index) => renderItem(item, index))
1491
1566
  }
1492
1567
  );
1493
1568
  })()
@@ -1495,10 +1570,7 @@ function FaqWidget({
1495
1570
  }
1496
1571
  );
1497
1572
  }
1498
- function FaqEditor({
1499
- settings,
1500
- onChange
1501
- }) {
1573
+ function FaqEditor({ settings, onChange }) {
1502
1574
  const update = (partial) => onChange({ ...settings, ...partial });
1503
1575
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
1504
1576
  /* @__PURE__ */ jsxs(FieldGroup, { title: "Header", children: [
@@ -1651,13 +1723,7 @@ function PricingWidget({
1651
1723
  ),
1652
1724
  children: [
1653
1725
  /* @__PURE__ */ jsx(Header1, { theme: overriddenTheme, children: title }),
1654
- description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(
1655
- TextRenderer,
1656
- {
1657
- json: description,
1658
- theme: overriddenTheme
1659
- }
1660
- ) })
1726
+ description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(TextRenderer, { json: description, theme: overriddenTheme }) })
1661
1727
  ]
1662
1728
  }
1663
1729
  ),
@@ -1685,32 +1751,16 @@ function PricingWidget({
1685
1751
  ] }),
1686
1752
  /* @__PURE__ */ jsx(PageCardHeader, { theme: overriddenTheme, children: tier.price }),
1687
1753
  tier.description && /* @__PURE__ */ jsx(Text1, { theme: overriddenTheme, children: tier.description }),
1688
- tier.features && tier.features.length > 0 && /* @__PURE__ */ jsx("div", { className: "grow flex flex-col gap-2", children: tier.features.map(
1689
- (feature, i) => /* @__PURE__ */ jsx(
1690
- Text2,
1691
- {
1692
- theme: overriddenTheme,
1693
- children: feature
1694
- },
1695
- i
1696
- )
1697
- ) }),
1698
- tier.buttonAction && tier.buttonCaption && /* @__PURE__ */ jsx(
1699
- NavLink,
1754
+ tier.features && tier.features.length > 0 && /* @__PURE__ */ jsx("div", { className: "grow flex flex-col gap-2", children: tier.features.map((feature, i) => /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, children: feature }, i)) }),
1755
+ tier.buttonAction && tier.buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: tier.buttonAction, className: "w-full mt-auto", children: /* @__PURE__ */ jsx(
1756
+ Button2,
1700
1757
  {
1701
- href: tier.buttonAction,
1702
- className: "w-full mt-auto",
1703
- children: /* @__PURE__ */ jsx(
1704
- Button2,
1705
- {
1706
- theme: overriddenTheme,
1707
- variant: tier.highlighted ? "default" : "secondary",
1708
- className: "w-full",
1709
- children: tier.buttonCaption
1710
- }
1711
- )
1758
+ theme: overriddenTheme,
1759
+ variant: tier.highlighted ? "default" : "secondary",
1760
+ className: "w-full",
1761
+ children: tier.buttonCaption
1712
1762
  }
1713
- )
1763
+ ) })
1714
1764
  ]
1715
1765
  }
1716
1766
  )
@@ -1873,12 +1923,7 @@ var pricingDefaults = {
1873
1923
  name: "Pro",
1874
1924
  price: "$29/mo",
1875
1925
  description: "For growing businesses that need more.",
1876
- features: [
1877
- "5 websites",
1878
- "Custom domain",
1879
- "Blog + Email",
1880
- "Priority support"
1881
- ],
1926
+ features: ["5 websites", "Custom domain", "Blog + Email", "Priority support"],
1882
1927
  buttonCaption: "Talk to us",
1883
1928
  buttonAction: "/help",
1884
1929
  highlighted: true
@@ -1956,14 +2001,7 @@ function BannerWidget({
1956
2001
  !isSplit && isCentered ? "md:!justify-center" : ""
1957
2002
  ),
1958
2003
  children: [
1959
- buttonAction && buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: buttonAction, children: /* @__PURE__ */ jsx(
1960
- Button2,
1961
- {
1962
- theme: overriddenTheme,
1963
- className: "w-full md:min-w-[150px]",
1964
- children: buttonCaption
1965
- }
1966
- ) }),
2004
+ buttonAction && buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: buttonAction, children: /* @__PURE__ */ jsx(Button2, { theme: overriddenTheme, className: "w-full md:min-w-[150px]", children: buttonCaption }) }),
1967
2005
  secondaryButtonAction && secondaryButtonCaption && /* @__PURE__ */ jsx(NavLink, { href: secondaryButtonAction, children: /* @__PURE__ */ jsx(
1968
2006
  Button2,
1969
2007
  {
@@ -2196,20 +2234,7 @@ function EmailFormWidget({
2196
2234
  children: [
2197
2235
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
2198
2236
  /* @__PURE__ */ jsx(Header1, { theme: overriddenTheme, className: "text-xl", children: title }),
2199
- description && /* @__PURE__ */ jsx(
2200
- Subheader1,
2201
- {
2202
- theme: overriddenTheme,
2203
- component: "span",
2204
- children: /* @__PURE__ */ jsx(
2205
- TextRenderer,
2206
- {
2207
- json: description,
2208
- theme: overriddenTheme
2209
- }
2210
- )
2211
- }
2212
- )
2237
+ description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(TextRenderer, { json: description, theme: overriddenTheme }) })
2213
2238
  ] }),
2214
2239
  success ? /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, children: successMessage }) : /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col gap-2 sm:!flex-row md:w-auto md:shrink-0", children: [
2215
2240
  /* @__PURE__ */ jsx(
@@ -2254,10 +2279,7 @@ function EmailFormWidget({
2254
2279
  onSubmit,
2255
2280
  className: clsx3(
2256
2281
  "flex gap-4",
2257
- layout === "split" ? "flex-col md:!flex-row md:items-center md:justify-between md:gap-10" : clsx3(
2258
- "flex-col",
2259
- isCentered ? "items-center text-center" : "items-start"
2260
- )
2282
+ layout === "split" ? "flex-col md:!flex-row md:items-center md:justify-between md:gap-10" : clsx3("flex-col", isCentered ? "items-center text-center" : "items-start")
2261
2283
  ),
2262
2284
  children: [
2263
2285
  /* @__PURE__ */ jsxs(
@@ -2269,13 +2291,7 @@ function EmailFormWidget({
2269
2291
  ),
2270
2292
  children: [
2271
2293
  /* @__PURE__ */ jsx(Header1, { theme: overriddenTheme, children: title }),
2272
- description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(
2273
- TextRenderer,
2274
- {
2275
- json: description,
2276
- theme: overriddenTheme
2277
- }
2278
- ) })
2294
+ description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(TextRenderer, { json: description, theme: overriddenTheme }) })
2279
2295
  ]
2280
2296
  }
2281
2297
  ),
@@ -2475,9 +2491,7 @@ function SupportFormWidget({
2475
2491
  const [message, setMessage] = useState("");
2476
2492
  const [email, setEmail] = useState("");
2477
2493
  const [name, setName] = useState("");
2478
- const [suggestions, setSuggestions] = useState(
2479
- []
2480
- );
2494
+ const [suggestions, setSuggestions] = useState([]);
2481
2495
  const [isSubmitting, setIsSubmitting] = useState(false);
2482
2496
  const [success, setSuccess] = useState(false);
2483
2497
  const debounceRef = useRef(null);
@@ -2533,134 +2547,121 @@ function SupportFormWidget({
2533
2547
  ),
2534
2548
  children: [
2535
2549
  /* @__PURE__ */ jsx(Header1, { theme: overriddenTheme, children: title }),
2536
- description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(
2537
- TextRenderer,
2538
- {
2539
- json: description,
2540
- theme: overriddenTheme
2541
- }
2542
- ) })
2550
+ description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(TextRenderer, { json: description, theme: overriddenTheme }) })
2543
2551
  ]
2544
2552
  }
2545
2553
  ),
2546
- success ? /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, className: "mt-4", children: successMessage }) : /* @__PURE__ */ jsxs(
2547
- "form",
2548
- {
2549
- onSubmit,
2550
- className: "mt-4 flex w-full max-w-lg flex-col gap-3",
2551
- children: [
2552
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 items-start", children: [
2553
- /* @__PURE__ */ jsx(Label, { theme: overriddenTheme, htmlFor: "subject", children: "Subject" }),
2554
- /* @__PURE__ */ jsx(
2555
- Input,
2554
+ success ? /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, className: "mt-4", children: successMessage }) : /* @__PURE__ */ jsxs("form", { onSubmit, className: "mt-4 flex w-full max-w-lg flex-col gap-3", children: [
2555
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 items-start", children: [
2556
+ /* @__PURE__ */ jsx(Label, { theme: overriddenTheme, htmlFor: "subject", children: "Subject" }),
2557
+ /* @__PURE__ */ jsx(
2558
+ Input,
2559
+ {
2560
+ theme: overriddenTheme,
2561
+ id: "subject",
2562
+ value: subject,
2563
+ onChange: (e) => setSubject(e.target.value),
2564
+ placeholder: "What do you need help with?",
2565
+ required: true,
2566
+ className: "w-full"
2567
+ }
2568
+ )
2569
+ ] }),
2570
+ suggestions.length > 0 && /* @__PURE__ */ jsxs(
2571
+ "div",
2572
+ {
2573
+ className: cn(
2574
+ "rounded-lg border border-border bg-card p-3 text-sm text-card-foreground shadow-sm",
2575
+ cardStyles.border?.width,
2576
+ cardStyles.border?.radius,
2577
+ cardStyles.border?.style,
2578
+ cardStyles.shadow
2579
+ ),
2580
+ children: [
2581
+ /* @__PURE__ */ jsx("p", { className: "mb-1 font-medium", children: "This might help:" }),
2582
+ /* @__PURE__ */ jsx("ul", { className: "list-inside list-disc", children: suggestions.map((doc) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
2583
+ "a",
2556
2584
  {
2557
- theme: overriddenTheme,
2558
- id: "subject",
2559
- value: subject,
2560
- onChange: (e) => setSubject(e.target.value),
2561
- placeholder: "What do you need help with?",
2562
- required: true,
2563
- className: "w-full"
2585
+ href: suggestionHref(doc),
2586
+ target: "_blank",
2587
+ rel: "noreferrer",
2588
+ className: "underline",
2589
+ children: doc.title ?? doc.slug
2564
2590
  }
2591
+ ) }, doc.documentId)) })
2592
+ ]
2593
+ }
2594
+ ),
2595
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 items-start", children: [
2596
+ /* @__PURE__ */ jsx(Label, { theme: overriddenTheme, htmlFor: "message", children: "Message" }),
2597
+ /* @__PURE__ */ jsx(
2598
+ "textarea",
2599
+ {
2600
+ id: "message",
2601
+ value: message,
2602
+ onChange: (e) => setMessage(e.target.value),
2603
+ placeholder: "Describe the issue\u2026",
2604
+ required: true,
2605
+ rows: 4,
2606
+ className: cn(
2607
+ "w-full border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2608
+ inputTypography.fontFamily,
2609
+ inputTypography.fontSize,
2610
+ inputTypography.fontWeight,
2611
+ inputTypography.lineHeight,
2612
+ inputTypography.letterSpacing,
2613
+ inputStyles.border?.width,
2614
+ inputStyles.border?.style,
2615
+ inputStyles.border?.radius,
2616
+ inputStyles.shadow,
2617
+ inputStyles.custom
2565
2618
  )
2566
- ] }),
2567
- suggestions.length > 0 && /* @__PURE__ */ jsxs(
2568
- "div",
2619
+ }
2620
+ )
2621
+ ] }),
2622
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 sm:!flex-row", children: [
2623
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1 items-start", children: [
2624
+ /* @__PURE__ */ jsx(Label, { theme: overriddenTheme, htmlFor: "email", children: "Email" }),
2625
+ /* @__PURE__ */ jsx(
2626
+ Input,
2569
2627
  {
2570
- className: cn(
2571
- "rounded-lg border border-border bg-card p-3 text-sm text-card-foreground shadow-sm",
2572
- cardStyles.border?.width,
2573
- cardStyles.border?.radius,
2574
- cardStyles.border?.style,
2575
- cardStyles.shadow
2576
- ),
2577
- children: [
2578
- /* @__PURE__ */ jsx("p", { className: "mb-1 font-medium", children: "This might help:" }),
2579
- /* @__PURE__ */ jsx("ul", { className: "list-inside list-disc", children: suggestions.map((doc) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
2580
- "a",
2581
- {
2582
- href: suggestionHref(doc),
2583
- target: "_blank",
2584
- rel: "noreferrer",
2585
- className: "underline",
2586
- children: doc.title ?? doc.slug
2587
- }
2588
- ) }, doc.documentId)) })
2589
- ]
2628
+ theme: overriddenTheme,
2629
+ id: "email",
2630
+ type: "email",
2631
+ value: email,
2632
+ onChange: (e) => setEmail(e.target.value),
2633
+ placeholder: "you@example.com",
2634
+ required: true,
2635
+ className: "w-full"
2590
2636
  }
2591
- ),
2592
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 items-start", children: [
2593
- /* @__PURE__ */ jsx(Label, { theme: overriddenTheme, htmlFor: "message", children: "Message" }),
2594
- /* @__PURE__ */ jsx(
2595
- "textarea",
2596
- {
2597
- id: "message",
2598
- value: message,
2599
- onChange: (e) => setMessage(e.target.value),
2600
- placeholder: "Describe the issue\u2026",
2601
- required: true,
2602
- rows: 4,
2603
- className: cn(
2604
- "w-full border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2605
- inputTypography.fontFamily,
2606
- inputTypography.fontSize,
2607
- inputTypography.fontWeight,
2608
- inputTypography.lineHeight,
2609
- inputTypography.letterSpacing,
2610
- inputStyles.border?.width,
2611
- inputStyles.border?.style,
2612
- inputStyles.border?.radius,
2613
- inputStyles.shadow,
2614
- inputStyles.custom
2615
- )
2616
- }
2617
- )
2618
- ] }),
2619
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 sm:!flex-row", children: [
2620
- /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1 items-start", children: [
2621
- /* @__PURE__ */ jsx(Label, { theme: overriddenTheme, htmlFor: "email", children: "Email" }),
2622
- /* @__PURE__ */ jsx(
2623
- Input,
2624
- {
2625
- theme: overriddenTheme,
2626
- id: "email",
2627
- type: "email",
2628
- value: email,
2629
- onChange: (e) => setEmail(e.target.value),
2630
- placeholder: "you@example.com",
2631
- required: true,
2632
- className: "w-full"
2633
- }
2634
- )
2635
- ] }),
2636
- /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1 items-start", children: [
2637
- /* @__PURE__ */ jsx(Label, { theme: overriddenTheme, htmlFor: "name", children: "Name (optional)" }),
2638
- /* @__PURE__ */ jsx(
2639
- Input,
2640
- {
2641
- theme: overriddenTheme,
2642
- id: "name",
2643
- value: name,
2644
- onChange: (e) => setName(e.target.value),
2645
- placeholder: "Your name",
2646
- className: "w-full"
2647
- }
2648
- )
2649
- ] })
2650
- ] }),
2637
+ )
2638
+ ] }),
2639
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1 items-start", children: [
2640
+ /* @__PURE__ */ jsx(Label, { theme: overriddenTheme, htmlFor: "name", children: "Name (optional)" }),
2651
2641
  /* @__PURE__ */ jsx(
2652
- Button2,
2642
+ Input,
2653
2643
  {
2654
2644
  theme: overriddenTheme,
2655
- type: "submit",
2656
- disabled: !editing && (isSubmitting || !subject || !message || !email),
2657
- className: "self-start",
2658
- children: buttonCaption
2645
+ id: "name",
2646
+ value: name,
2647
+ onChange: (e) => setName(e.target.value),
2648
+ placeholder: "Your name",
2649
+ className: "w-full"
2659
2650
  }
2660
2651
  )
2661
- ]
2662
- }
2663
- )
2652
+ ] })
2653
+ ] }),
2654
+ /* @__PURE__ */ jsx(
2655
+ Button2,
2656
+ {
2657
+ theme: overriddenTheme,
2658
+ type: "submit",
2659
+ disabled: !editing && (isSubmitting || !subject || !message || !email),
2660
+ className: "self-start",
2661
+ children: buttonCaption
2662
+ }
2663
+ )
2664
+ ] })
2664
2665
  ]
2665
2666
  }
2666
2667
  );
@@ -2787,14 +2788,7 @@ function FooterWidget({
2787
2788
  {
2788
2789
  href: link.href,
2789
2790
  className: "no-underline",
2790
- children: /* @__PURE__ */ jsx(
2791
- Link,
2792
- {
2793
- theme: overriddenTheme,
2794
- className: "text-xs",
2795
- children: link.label
2796
- }
2797
- )
2791
+ children: /* @__PURE__ */ jsx(Link, { theme: overriddenTheme, className: "text-xs", children: link.label })
2798
2792
  },
2799
2793
  `${column.id}-${link.id}`
2800
2794
  ))
@@ -2812,14 +2806,7 @@ function FooterWidget({
2812
2806
  {
2813
2807
  href: link.href,
2814
2808
  className: "no-underline",
2815
- children: /* @__PURE__ */ jsx(
2816
- Link,
2817
- {
2818
- theme: overriddenTheme,
2819
- className: "text-xs",
2820
- children: link.label
2821
- }
2822
- )
2809
+ children: /* @__PURE__ */ jsx(Link, { theme: overriddenTheme, className: "text-xs", children: link.label })
2823
2810
  },
2824
2811
  `${column.id}-${link.id}`
2825
2812
  ))
@@ -2829,39 +2816,10 @@ function FooterWidget({
2829
2816
  logoText && /* @__PURE__ */ jsx(Header3, { theme: overriddenTheme, children: logoText }),
2830
2817
  tagline && /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, children: tagline })
2831
2818
  ] }),
2832
- /* @__PURE__ */ jsx("div", { className: "flex flex-col flex-wrap gap-8 lg:!flex-row", children: columns.map((column) => /* @__PURE__ */ jsxs(
2833
- "div",
2834
- {
2835
- className: "flex flex-col gap-3 lg:min-w-[140px]",
2836
- children: [
2837
- /* @__PURE__ */ jsx(
2838
- Header4,
2839
- {
2840
- theme: overriddenTheme,
2841
- className: "text-sm",
2842
- children: column.title
2843
- }
2844
- ),
2845
- /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: column.links.map((link) => /* @__PURE__ */ jsx(
2846
- NavLink,
2847
- {
2848
- href: link.href,
2849
- className: "no-underline",
2850
- children: /* @__PURE__ */ jsx(
2851
- Link,
2852
- {
2853
- theme: overriddenTheme,
2854
- className: "text-xs",
2855
- children: link.label
2856
- }
2857
- )
2858
- },
2859
- link.id
2860
- )) })
2861
- ]
2862
- },
2863
- column.id
2864
- )) })
2819
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col flex-wrap gap-8 lg:!flex-row", children: columns.map((column) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 lg:min-w-[140px]", children: [
2820
+ /* @__PURE__ */ jsx(Header4, { theme: overriddenTheme, className: "text-sm", children: column.title }),
2821
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: column.links.map((link) => /* @__PURE__ */ jsx(NavLink, { href: link.href, className: "no-underline", children: /* @__PURE__ */ jsx(Link, { theme: overriddenTheme, className: "text-xs", children: link.label }) }, link.id)) })
2822
+ ] }, column.id)) })
2865
2823
  ] }),
2866
2824
  copyrightText && layout !== "minimal" && /* @__PURE__ */ jsx(
2867
2825
  "div",
@@ -3056,14 +3014,7 @@ var richTextMetadata = {
3056
3014
  compatibleWith: ["site", "landing", "blog", "post", "custom"]
3057
3015
  };
3058
3016
  function RichTextWidget({
3059
- settings: {
3060
- text,
3061
- alignment = "left",
3062
- cssId,
3063
- maxWidth,
3064
- verticalPadding,
3065
- background
3066
- },
3017
+ settings: { text, alignment = "left", cssId, maxWidth, verticalPadding, background },
3067
3018
  state: { theme },
3068
3019
  nextTheme
3069
3020
  }) {
@@ -3155,7 +3106,9 @@ function resolveIcon2(name) {
3155
3106
  }
3156
3107
  function GridItemCard({ item, theme }) {
3157
3108
  const Icon = resolveIcon2(item.icon);
3158
- const hasMedia = Boolean(item.media?.file);
3109
+ const mediaUrl = getMediaUrl(item.media);
3110
+ const mediaAlt = getMediaAlt(item.media);
3111
+ const hasMedia = Boolean(mediaUrl);
3159
3112
  const isOverlay = item.mediaAlignment === "overlay";
3160
3113
  const mediaFirst = item.mediaAlignment !== "bottom";
3161
3114
  if (isOverlay) {
@@ -3163,8 +3116,8 @@ function GridItemCard({ item, theme }) {
3163
3116
  hasMedia && /* @__PURE__ */ jsx(
3164
3117
  Image,
3165
3118
  {
3166
- src: item.media?.file || "",
3167
- alt: item.media?.caption || "",
3119
+ src: mediaUrl || "",
3120
+ alt: mediaAlt,
3168
3121
  className: "absolute inset-0",
3169
3122
  width: "w-full",
3170
3123
  height: "h-full",
@@ -3177,32 +3130,19 @@ function GridItemCard({ item, theme }) {
3177
3130
  ] }) });
3178
3131
  return item.buttonAction ? /* @__PURE__ */ jsx(NavLink, { href: item.buttonAction, className: "block", children: card }) : card;
3179
3132
  }
3180
- const media = hasMedia ? /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(
3181
- Image,
3182
- {
3183
- src: item.media?.file || "",
3184
- alt: item.media?.caption || ""
3185
- }
3186
- ) }) : Icon ? /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }) }) : null;
3133
+ const media = hasMedia ? /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(Image, { src: mediaUrl || "", alt: mediaAlt }) }) : Icon ? /* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-md bg-primary/10 text-primary", children: /* @__PURE__ */ jsx(Icon, { className: "h-5 w-5" }) }) : null;
3187
3134
  const text = /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
3188
3135
  /* @__PURE__ */ jsx(Header4, { theme, children: item.title }),
3189
3136
  item.description && /* @__PURE__ */ jsx(Text2, { theme, children: item.description }),
3190
3137
  item.buttonAction && item.buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: item.buttonAction, className: "mt-2", children: /* @__PURE__ */ jsx(Button2, { theme, variant: "secondary", size: "sm", children: item.buttonCaption }) })
3191
3138
  ] });
3192
- return /* @__PURE__ */ jsx(PageCard, { theme, children: /* @__PURE__ */ jsx(
3193
- PageCardContent,
3194
- {
3195
- theme,
3196
- className: "flex h-full flex-col gap-3",
3197
- children: mediaFirst ? /* @__PURE__ */ jsxs(Fragment, { children: [
3198
- media,
3199
- text
3200
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3201
- text,
3202
- media
3203
- ] })
3204
- }
3205
- ) });
3139
+ return /* @__PURE__ */ jsx(PageCard, { theme, children: /* @__PURE__ */ jsx(PageCardContent, { theme, className: "flex h-full flex-col gap-3", children: mediaFirst ? /* @__PURE__ */ jsxs(Fragment, { children: [
3140
+ media,
3141
+ text
3142
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
3143
+ text,
3144
+ media
3145
+ ] }) }) });
3206
3146
  }
3207
3147
  function GridWidget({
3208
3148
  settings: {
@@ -3241,13 +3181,7 @@ function GridWidget({
3241
3181
  ),
3242
3182
  children: [
3243
3183
  /* @__PURE__ */ jsx(Header1, { theme: overriddenTheme, children: title }),
3244
- description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(
3245
- TextRenderer,
3246
- {
3247
- json: description,
3248
- theme: overriddenTheme
3249
- }
3250
- ) }),
3184
+ description && /* @__PURE__ */ jsx(Subheader1, { theme: overriddenTheme, component: "span", children: /* @__PURE__ */ jsx(TextRenderer, { json: description, theme: overriddenTheme }) }),
3251
3185
  buttonAction && buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: buttonAction, className: "mt-2", children: /* @__PURE__ */ jsx(Button2, { theme: overriddenTheme, children: buttonCaption }) })
3252
3186
  ]
3253
3187
  }
@@ -3259,24 +3193,14 @@ function GridWidget({
3259
3193
  "grid grid-cols-1 md:grid-cols-2 gap-6 items-stretch",
3260
3194
  columns === 3 ? "lg:grid-cols-3" : "lg:grid-cols-2"
3261
3195
  ),
3262
- children: items.map((item, index) => /* @__PURE__ */ jsx(
3263
- GridItemCard,
3264
- {
3265
- item,
3266
- theme: overriddenTheme
3267
- },
3268
- index
3269
- ))
3196
+ children: items.map((item, index) => /* @__PURE__ */ jsx(GridItemCard, { item, theme: overriddenTheme }, index))
3270
3197
  }
3271
3198
  )
3272
3199
  ] })
3273
3200
  }
3274
3201
  );
3275
3202
  }
3276
- function GridEditor({
3277
- settings,
3278
- onChange
3279
- }) {
3203
+ function GridEditor({ settings, onChange }) {
3280
3204
  const update = (partial) => onChange({ ...settings, ...partial });
3281
3205
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
3282
3206
  /* @__PURE__ */ jsxs(FieldGroup, { title: "Header", children: [
@@ -3381,14 +3305,11 @@ function GridEditor({
3381
3305
  }
3382
3306
  ),
3383
3307
  /* @__PURE__ */ jsx(
3384
- TextField,
3308
+ ImageField,
3385
3309
  {
3386
- label: "Image URL (overrides icon)",
3387
- value: item.media?.file,
3388
- placeholder: "https://...",
3389
- onChange: (file) => updateItem({
3390
- media: file ? { mediaId: file, file } : void 0
3391
- })
3310
+ label: "Image (overrides icon)",
3311
+ value: item.media,
3312
+ onChange: (media) => updateItem({ media })
3392
3313
  }
3393
3314
  ),
3394
3315
  /* @__PURE__ */ jsx(
@@ -3538,17 +3459,17 @@ function MediaWidget({
3538
3459
  children: isVideoContent ? /* @__PURE__ */ jsx(
3539
3460
  VideoWithPreview,
3540
3461
  {
3541
- videoUrl: youtubeLink || media?.file || "",
3542
- title: media?.caption || "",
3543
- thumbnailUrl: media?.thumbnail || "",
3462
+ videoUrl: youtubeLink || getMediaUrl(media) || "",
3463
+ title: getMediaAlt(media) || media?.caption || "",
3464
+ thumbnailUrl: media?.thumbnail || media?.thumbnailUrl || "",
3544
3465
  aspectRatio,
3545
3466
  modal: playVideoInModal
3546
3467
  }
3547
3468
  ) : /* @__PURE__ */ jsx(
3548
3469
  Image,
3549
3470
  {
3550
- src: media?.file || "",
3551
- alt: media?.caption || "",
3471
+ src: getMediaUrl(media) || "",
3472
+ alt: getMediaAlt(media),
3552
3473
  objectFit,
3553
3474
  borderRadius: mediaRadius
3554
3475
  }
@@ -3558,23 +3479,17 @@ function MediaWidget({
3558
3479
  }
3559
3480
  );
3560
3481
  }
3561
- function MediaEditor({
3562
- settings,
3563
- onChange
3564
- }) {
3482
+ function MediaEditor({ settings, onChange }) {
3565
3483
  const update = (partial) => onChange({ ...settings, ...partial });
3566
3484
  const isVideoContent = isVideo(settings.youtubeLink, settings.media);
3567
3485
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
3568
3486
  /* @__PURE__ */ jsxs(FieldGroup, { title: "Media", children: [
3569
3487
  /* @__PURE__ */ jsx(
3570
- TextField,
3488
+ ImageField,
3571
3489
  {
3572
- label: "Image URL",
3573
- value: settings.media?.file,
3574
- placeholder: "https://...",
3575
- onChange: (file) => update({
3576
- media: file ? { mediaId: file, file } : void 0
3577
- })
3490
+ label: "Image / poster",
3491
+ value: settings.media,
3492
+ onChange: (media) => update({ media })
3578
3493
  }
3579
3494
  ),
3580
3495
  /* @__PURE__ */ jsx(
@@ -3777,15 +3692,7 @@ function MarqueeWidget({
3777
3692
  background,
3778
3693
  nextTheme,
3779
3694
  children: /* @__PURE__ */ jsxs("div", { className: "relative", "aria-hidden": "true", children: [
3780
- /* @__PURE__ */ jsx(
3781
- MarqueeTrack,
3782
- {
3783
- speed,
3784
- direction,
3785
- pauseOnHover,
3786
- children: items.map(renderItem)
3787
- }
3788
- ),
3695
+ /* @__PURE__ */ jsx(MarqueeTrack, { speed, direction, pauseOnHover, children: items.map(renderItem) }),
3789
3696
  fadeWidth > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
3790
3697
  /* @__PURE__ */ jsx(
3791
3698
  "div",
@@ -4078,10 +3985,7 @@ function EmbedWidget({
4078
3985
  }
4079
3986
  );
4080
3987
  }
4081
- function EmbedEditor({
4082
- settings,
4083
- onChange
4084
- }) {
3988
+ function EmbedEditor({ settings, onChange }) {
4085
3989
  const update = (partial) => onChange({ ...settings, ...partial });
4086
3990
  const contentType = settings.contentType ?? "url";
4087
3991
  const aspectRatio = settings.aspectRatio ?? "default";
@@ -4207,10 +4111,10 @@ function DataSlotWidget({
4207
4111
  /* @__PURE__ */ jsxs("div", { children: [
4208
4112
  /* @__PURE__ */ jsx("p", { className: "font-semibold text-foreground", children: "Data slot" }),
4209
4113
  /* @__PURE__ */ jsxs("p", { className: "mt-1 text-sm text-muted-foreground", children: [
4210
- "The embedding application resolves data for",
4211
- " ",
4114
+ "The embedding application resolves data for ",
4212
4115
  String(slot || "this slot"),
4213
- " here."
4116
+ " ",
4117
+ "here."
4214
4118
  ] })
4215
4119
  ] })
4216
4120
  ] })
@@ -4225,5 +4129,5 @@ var DataSlot = {
4225
4129
  };
4226
4130
 
4227
4131
  export { Banner, Content, DataSlot, EmailForm, Embed, Faq, Featured, FieldGroup, Footer, Grid, Header, Hero, Marquee, MediaBlock, Pricing, RichText, SupportForm, TextField, ToggleField, generateUniqueId };
4228
- //# sourceMappingURL=chunk-7KIX4WAO.js.map
4229
- //# sourceMappingURL=chunk-7KIX4WAO.js.map
4132
+ //# sourceMappingURL=chunk-UO7XGBGM.js.map
4133
+ //# sourceMappingURL=chunk-UO7XGBGM.js.map