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

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 (98) hide show
  1. package/README.md +32 -0
  2. package/dist/blocks/index.d.ts +33 -21
  3. package/dist/blocks/index.js +3 -3
  4. package/dist/builder/index.d.ts +7 -8
  5. package/dist/builder/index.js +6 -5
  6. package/dist/{button-Bzt1GDO-.d.ts → button-OLKN3wPf.d.ts} +2 -2
  7. package/dist/{chunk-H4P5MFJI.js → chunk-36QHCIPM.js} +205 -251
  8. package/dist/chunk-36QHCIPM.js.map +1 -0
  9. package/dist/chunk-BBI7UHOA.js +56 -0
  10. package/dist/chunk-BBI7UHOA.js.map +1 -0
  11. package/dist/{chunk-KQKSLI3L.js → chunk-GIKTOAQS.js} +335 -122
  12. package/dist/chunk-GIKTOAQS.js.map +1 -0
  13. package/dist/chunk-HWOVSHIW.js +4 -0
  14. package/dist/{chunk-RUYOL7JZ.js.map → chunk-HWOVSHIW.js.map} +1 -1
  15. package/dist/{chunk-HDINUNI2.js → chunk-IU4KATI2.js} +69 -96
  16. package/dist/chunk-IU4KATI2.js.map +1 -0
  17. package/dist/{chunk-SGNRWWG3.js → chunk-J7Z4UW45.js} +530 -135
  18. package/dist/chunk-J7Z4UW45.js.map +1 -0
  19. package/dist/{chunk-UO7XGBGM.js → chunk-K4WCLHMS.js} +1182 -1033
  20. package/dist/chunk-K4WCLHMS.js.map +1 -0
  21. package/dist/components/index.d.ts +33 -8
  22. package/dist/components/index.js +42 -2
  23. package/dist/components/index.js.map +1 -1
  24. package/dist/data-slots.d.ts +3 -3
  25. package/dist/fonts/archivo/archivo-latin-variable.woff2 +0 -0
  26. package/dist/fonts/hanken-grotesk/hanken-grotesk-latin-variable.woff2 +0 -0
  27. package/dist/fonts/jetbrains-mono/jetbrains-mono-latin-variable.woff2 +0 -0
  28. package/dist/fonts/spline-sans-mono/spline-sans-mono-latin-variable.woff2 +0 -0
  29. package/dist/heading-DQCxQt38.d.ts +20 -0
  30. package/dist/image-Bk8kPXwP.d.ts +52 -0
  31. package/dist/index.d.ts +17 -10
  32. package/dist/index.js +7 -6
  33. package/dist/models/index.d.ts +5 -5
  34. package/dist/models/index.js +1 -1
  35. package/dist/{page-W3hQga4w.d.ts → page-B5Gmm-Ys.d.ts} +1 -1
  36. package/dist/primitives/index.d.ts +44 -9
  37. package/dist/primitives/index.js +1 -1
  38. package/dist/renderer/index.d.ts +12 -8
  39. package/dist/renderer/index.js +5 -4
  40. package/dist/{section-background-MsdE40Rk.d.ts → section-background-6V_LCi5e.d.ts} +1 -1
  41. package/dist/server/index.d.ts +103 -0
  42. package/dist/server/index.js +2649 -0
  43. package/dist/server/index.js.map +1 -0
  44. package/dist/server/islands/code-snippet.d.ts +17 -0
  45. package/dist/server/islands/code-snippet.js +72 -0
  46. package/dist/server/islands/code-snippet.js.map +1 -0
  47. package/dist/server/islands/email-form.d.ts +50 -0
  48. package/dist/server/islands/email-form.js +406 -0
  49. package/dist/server/islands/email-form.js.map +1 -0
  50. package/dist/server/islands/header-mobile-menu.d.ts +22 -0
  51. package/dist/server/islands/header-mobile-menu.js +422 -0
  52. package/dist/server/islands/header-mobile-menu.js.map +1 -0
  53. package/dist/server/islands/inline-embed.d.ts +28 -0
  54. package/dist/server/islands/inline-embed.js +84 -0
  55. package/dist/server/islands/inline-embed.js.map +1 -0
  56. package/dist/server/islands/marquee-track.d.ts +18 -0
  57. package/dist/server/islands/marquee-track.js +67 -0
  58. package/dist/server/islands/marquee-track.js.map +1 -0
  59. package/dist/server/islands/nav-link.d.ts +37 -0
  60. package/dist/server/islands/nav-link.js +67 -0
  61. package/dist/server/islands/nav-link.js.map +1 -0
  62. package/dist/server/islands/support-form.d.ts +17 -0
  63. package/dist/server/islands/support-form.js +469 -0
  64. package/dist/server/islands/support-form.js.map +1 -0
  65. package/dist/server/islands/theme-mode-switcher.d.ts +38 -0
  66. package/dist/server/islands/theme-mode-switcher.js +169 -0
  67. package/dist/server/islands/theme-mode-switcher.js.map +1 -0
  68. package/dist/server/islands/video-with-preview.d.ts +13 -0
  69. package/dist/server/islands/video-with-preview.js +269 -0
  70. package/dist/server/islands/video-with-preview.js.map +1 -0
  71. package/dist/server/primitives.d.ts +200 -0
  72. package/dist/server/primitives.js +888 -0
  73. package/dist/server/primitives.js.map +1 -0
  74. package/dist/server/schema.d.ts +11308 -0
  75. package/dist/server/schema.js +6179 -0
  76. package/dist/server/schema.js.map +1 -0
  77. package/dist/server/theme-CF3fIKvw.d.ts +9 -0
  78. package/dist/server/theme-style-5_AGy-4V.d.ts +183 -0
  79. package/dist/server/theme-style-BPaMwk88.d.ts +183 -0
  80. package/dist/server/theme.d.ts +28 -0
  81. package/dist/server/theme.js +1671 -0
  82. package/dist/server/theme.js.map +1 -0
  83. package/dist/server/widget-YH9BrOwY.d.ts +77 -0
  84. package/dist/styles.css +121 -15
  85. package/dist/{theme-style-Cbl7NM-T.d.ts → theme-style-BVd5tOsc.d.ts} +20 -0
  86. package/dist/theme.css +12 -0
  87. package/dist/{widget-B_RoG6se.d.ts → widget-CpE2HdgU.d.ts} +17 -14
  88. package/package.json +60 -12
  89. package/schema/page.v1.json +3855 -0
  90. package/schema/site.v1.json +3811 -0
  91. package/dist/alignment-dZDzN96G.d.ts +0 -5
  92. package/dist/chunk-H4P5MFJI.js.map +0 -1
  93. package/dist/chunk-HDINUNI2.js.map +0 -1
  94. package/dist/chunk-KQKSLI3L.js.map +0 -1
  95. package/dist/chunk-RUYOL7JZ.js +0 -4
  96. package/dist/chunk-SGNRWWG3.js.map +0 -1
  97. package/dist/chunk-UO7XGBGM.js.map +0 -1
  98. package/dist/image-DAWVx1zQ.d.ts +0 -31
@@ -1,20 +1,45 @@
1
1
  import React__default from 'react';
2
- export { A as AspectRatio, I as Image, a as ImageObjectFit, V as VideoThumbnailProps, b as VideoWithPreview, r as roundedMap } from '../image-DAWVx1zQ.js';
2
+ export { A as AspectRatio, I as Image, a as ImageAttributesInput, b as ImageAttributesResolver, c as ImageObjectFit, V as VideoThumbnailProps, d as VideoWithPreview, r as roundedMap, s as setImageAttributesResolver } from '../image-Bk8kPXwP.js';
3
3
  export { N as NavLink, P as PageBuilderLinkComponent, a as PageBuilderLinkProps, b as PageBuilderLinkProvider, u as usePageBuilderLinkComponent } from '../nav-link-BfxvQ1s6.js';
4
- import { T as ThemeStyle } from '../theme-style-Cbl7NM-T.js';
5
- import { B as ButtonProps } from '../button-Bzt1GDO-.js';
4
+ import { T as ThemeStyle } from '../theme-style-BVd5tOsc.js';
5
+ import { B as ButtonProps } from '../button-OLKN3wPf.js';
6
6
  import { R as ResolvedColorMode } from '../color-mode-DIEEt9WP.js';
7
- export { TextRenderer, truncateTextEditorContent } from '@frontlit/text-editor';
7
+ export { TextRenderer } from '@frontlit/text-editor/renderer';
8
+ export { truncateTextEditorContent } from '@frontlit/text-editor';
8
9
  import 'class-variance-authority/types';
9
10
  import 'class-variance-authority';
10
11
 
11
- interface SandboxedEmbedProps {
12
+ interface InlineEmbedProps {
12
13
  content: string;
13
14
  className?: string;
14
15
  style?: React__default.CSSProperties;
15
- id?: string;
16
16
  }
17
- declare const SandboxedEmbed: ({ content, className, style, id, }: SandboxedEmbedProps) => React__default.JSX.Element;
17
+ /**
18
+ * Snippets are usually written as a standalone document (they used to live in
19
+ * an iframe). Recreate that inside the shadow root: the host plays `html` and
20
+ * is a size container, a wrapper plays `body`, and viewport units and width
21
+ * media queries are rewritten to measure the embed (as they measured the
22
+ * iframe) instead of the browser window. "Fill the frame" heights are dropped,
23
+ * as are scripts that only synced state with `window.parent`, which the shadow
24
+ * host handles itself.
25
+ */
26
+ declare function prepareEmbed(content: string): {
27
+ links: string;
28
+ body: string;
29
+ };
30
+ /**
31
+ * Renders a raw HTML snippet inline, inside a declarative shadow root. The
32
+ * markup is part of the server-rendered page (so crawlers index it) while its
33
+ * styles stay isolated from the site's in both directions.
34
+ */
35
+ declare const InlineEmbed: ({ content, className, style }: InlineEmbedProps) => React__default.JSX.Element;
36
+
37
+ /** The FrontLit petal mark. Header and footer fall back to it, with the
38
+ * "FrontLit" name, until a site sets its own branding. */
39
+ declare function FrontLitLogo({ className }: {
40
+ className?: string;
41
+ }): React__default.JSX.Element;
42
+ declare const FRONTLIT_NAME = "FrontLit";
18
43
 
19
44
  /**
20
45
  * Light / dark toggle. Public sites pass `theme` so the button uses
@@ -33,4 +58,4 @@ declare function ThemeModeSwitcher({ resolved, onToggle, theme, className, size,
33
58
  variant?: ButtonProps["variant"];
34
59
  }): React__default.JSX.Element;
35
60
 
36
- export { SandboxedEmbed, ThemeModeSwitcher };
61
+ export { FRONTLIT_NAME, FrontLitLogo, InlineEmbed, ThemeModeSwitcher, prepareEmbed };
@@ -1,6 +1,46 @@
1
1
  "use client";
2
- export { Image, NavLink, PageBuilderLinkProvider, SandboxedEmbed, TextRenderer, ThemeModeSwitcher, VideoWithPreview, roundedMap, truncateTextEditorContent, usePageBuilderLinkComponent } from '../chunk-H4P5MFJI.js';
3
- import '../chunk-SGNRWWG3.js';
2
+ export { ThemeModeSwitcher } from '../chunk-BBI7UHOA.js';
3
+ export { Image, InlineEmbed, NavLink, PageBuilderLinkProvider, TextRenderer, VideoWithPreview, prepareEmbed, roundedMap, setImageAttributesResolver, usePageBuilderLinkComponent } from '../chunk-36QHCIPM.js';
4
+ import '../chunk-J7Z4UW45.js';
4
5
  import '../chunk-XU7ALPGQ.js';
6
+ import { jsx } from 'react/jsx-runtime';
7
+ export { truncateTextEditorContent } from '@frontlit/text-editor';
8
+
9
+ function FrontLitLogo({ className }) {
10
+ return /* @__PURE__ */ jsx(
11
+ "svg",
12
+ {
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ viewBox: "0 0 64 64",
15
+ className,
16
+ "aria-hidden": true,
17
+ children: /* @__PURE__ */ jsx(
18
+ "g",
19
+ {
20
+ fill: "oklch(0.62 0.16 230 / 0.15)",
21
+ stroke: "oklch(0.62 0.16 230)",
22
+ strokeWidth: "2.4",
23
+ strokeLinejoin: "round",
24
+ children: [
25
+ [41.19, 22.81, 45],
26
+ [41.19, 41.19, 135],
27
+ [22.81, 41.19, 225],
28
+ [22.81, 22.81, 315]
29
+ ].map(([x, y, angle]) => /* @__PURE__ */ jsx(
30
+ "path",
31
+ {
32
+ d: "M0,-11 C5.5,-5.5 5.5,5.5 0,11 C-5.5,5.5 -5.5,-5.5 0,-11 Z",
33
+ transform: `translate(${x},${y}) rotate(${angle})`
34
+ },
35
+ angle
36
+ ))
37
+ }
38
+ )
39
+ }
40
+ );
41
+ }
42
+ var FRONTLIT_NAME = "FrontLit";
43
+
44
+ export { FRONTLIT_NAME, FrontLitLogo };
5
45
  //# sourceMappingURL=index.js.map
6
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
1
+ {"version":3,"sources":["../../src/components/frontlit-logo.tsx"],"names":[],"mappings":";;;;;;;AAIO,SAAS,YAAA,CAAa,EAAE,SAAA,EAAU,EAA2B;AAClE,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAM,4BAAA;AAAA,MACN,OAAA,EAAQ,WAAA;AAAA,MACR,SAAA;AAAA,MACA,aAAA,EAAW,IAAA;AAAA,MAEX,QAAA,kBAAA,GAAA;AAAA,QAAC,GAAA;AAAA,QAAA;AAAA,UACC,IAAA,EAAK,6BAAA;AAAA,UACL,MAAA,EAAO,sBAAA;AAAA,UACP,WAAA,EAAY,KAAA;AAAA,UACZ,cAAA,EAAe,OAAA;AAAA,UAEd,QAAA,EAAA;AAAA,YACC,CAAC,KAAA,EAAO,KAAA,EAAO,EAAE,CAAA;AAAA,YACjB,CAAC,KAAA,EAAO,KAAA,EAAO,GAAG,CAAA;AAAA,YAClB,CAAC,KAAA,EAAO,KAAA,EAAO,GAAG,CAAA;AAAA,YAClB,CAAC,KAAA,EAAO,KAAA,EAAO,GAAG;AAAA,YAClB,GAAA,CAAI,CAAC,CAAC,CAAA,EAAG,CAAA,EAAG,KAAK,CAAA,qBACjB,GAAA;AAAA,YAAC,MAAA;AAAA,YAAA;AAAA,cAEC,CAAA,EAAE,2DAAA;AAAA,cACF,WAAW,CAAA,UAAA,EAAa,CAAC,CAAA,CAAA,EAAI,CAAC,YAAY,KAAK,CAAA,CAAA;AAAA,aAAA;AAAA,YAF1C;AAAA,WAIR;AAAA;AAAA;AACH;AAAA,GACF;AAEJ;AAEO,IAAM,aAAA,GAAgB","file":"index.js","sourcesContent":["import React from \"react\";\n\n/** The FrontLit petal mark. Header and footer fall back to it, with the\n * \"FrontLit\" name, until a site sets its own branding. */\nexport function FrontLitLogo({ className }: { className?: string }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 64 64\"\n className={className}\n aria-hidden\n >\n <g\n fill=\"oklch(0.62 0.16 230 / 0.15)\"\n stroke=\"oklch(0.62 0.16 230)\"\n strokeWidth=\"2.4\"\n strokeLinejoin=\"round\"\n >\n {[\n [41.19, 22.81, 45],\n [41.19, 41.19, 135],\n [22.81, 41.19, 225],\n [22.81, 22.81, 315],\n ].map(([x, y, angle]) => (\n <path\n key={angle}\n d=\"M0,-11 C5.5,-5.5 5.5,5.5 0,11 C-5.5,5.5 -5.5,-5.5 0,-11 Z\"\n transform={`translate(${x},${y}) rotate(${angle})`}\n />\n ))}\n </g>\n </svg>\n );\n}\n\nexport const FRONTLIT_NAME = \"FrontLit\";\n"]}
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
- import { c as WidgetInstance, P as PageData } from './widget-B_RoG6se.js';
3
- import './section-background-MsdE40Rk.js';
4
- import './theme-style-Cbl7NM-T.js';
2
+ import { c as WidgetInstance, P as PageData } from './widget-CpE2HdgU.js';
3
+ import './section-background-6V_LCi5e.js';
4
+ import './theme-style-BVd5tOsc.js';
5
5
 
6
6
  /** Context supplied to a host application's data-slot loader. */
7
7
  interface DataSlotLoadRequest {
@@ -0,0 +1,20 @@
1
+ type HorizontalAlignment = "center" | "left" | "right";
2
+ type VerticalAlignment = "top" | "bottom";
3
+ type Alignment = HorizontalAlignment | VerticalAlignment;
4
+
5
+ /** Heading element a block renders its title as. */
6
+ type HeadingLevel = "h1" | "h2" | "h3";
7
+ /** Per-breakpoint text size in px; unset breakpoints keep the theme size. */
8
+ interface ResponsiveTextSize {
9
+ mobile?: number;
10
+ tablet?: number;
11
+ desktop?: number;
12
+ }
13
+ /** Title options shared by every block with a title. */
14
+ interface TitleSettings {
15
+ /** Defaults to H1 for the Hero and H2 everywhere else. */
16
+ titleLevel?: HeadingLevel;
17
+ titleSize?: ResponsiveTextSize;
18
+ }
19
+
20
+ export type { Alignment as A, HeadingLevel as H, ResponsiveTextSize as R, TitleSettings as T, VerticalAlignment as V, HorizontalAlignment as a };
@@ -0,0 +1,52 @@
1
+ import * as React from 'react';
2
+ import React__default from 'react';
3
+
4
+ type AspectRatio = "16/9" | "4/3" | "1/1" | "21/9" | "9/16" | "2/1" | "3/2" | string;
5
+ interface VideoThumbnailProps {
6
+ title?: string;
7
+ thumbnailUrl?: string;
8
+ videoUrl: string;
9
+ aspectRatio?: AspectRatio;
10
+ modal?: boolean;
11
+ }
12
+ declare function VideoWithPreview({ title, thumbnailUrl, videoUrl, aspectRatio, modal, }: VideoThumbnailProps): React.JSX.Element;
13
+
14
+ interface ImageAttributesInput {
15
+ src: string;
16
+ alt: string;
17
+ sizes?: string;
18
+ /** Above-the-fold image (e.g. LCP): fetched eagerly at high priority. */
19
+ priority: boolean;
20
+ }
21
+ /**
22
+ * Lets a host swap an image's `src`/`srcSet` for its own optimizer's URLs
23
+ * (e.g. Next.js's `getImageProps`) without this package depending on the
24
+ * host framework. Return `null` to keep the original URL.
25
+ */
26
+ type ImageAttributesResolver = (input: ImageAttributesInput) => React__default.ImgHTMLAttributes<HTMLImageElement> | null;
27
+ /**
28
+ * Registers the host's resolver. Call once at server start-up; renders that
29
+ * run without one emit the original URL.
30
+ */
31
+ declare function setImageAttributesResolver(resolver: ImageAttributesResolver | null): void;
32
+ type ImageObjectFit = "cover" | "contain" | "fill" | "none" | "scale-down";
33
+ declare const roundedMap: Record<number, string>;
34
+ interface ImgProps {
35
+ src: string;
36
+ classes?: string;
37
+ alt?: string;
38
+ defaultImage?: string;
39
+ loading?: "eager" | "lazy";
40
+ /** Marks the image as likely LCP: eager load with high fetch priority. */
41
+ priority?: boolean;
42
+ height?: string;
43
+ sizes?: string;
44
+ width?: string;
45
+ borderRadius?: number | string;
46
+ noDefaultImage?: boolean;
47
+ className?: string;
48
+ objectFit?: ImageObjectFit;
49
+ }
50
+ declare const Image: (props: ImgProps) => React__default.JSX.Element;
51
+
52
+ export { type AspectRatio as A, Image as I, type VideoThumbnailProps as V, type ImageAttributesInput as a, type ImageAttributesResolver as b, type ImageObjectFit as c, VideoWithPreview as d, roundedMap as r, setImageAttributesResolver as s };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { T as Theme } from './section-background-MsdE40Rk.js';
2
- export { B as BackgroundAttachment, a as BackgroundRepeat, b as BlendMode, S as SectionBackground, c as SectionBackgroundOverlay } from './section-background-MsdE40Rk.js';
3
- export { B as Border, C as Colors, a as CustomStyle, D as DisabledStyle, M as MenuItemStyle, b as MenuStyle, P as Padding, S as Shadow, c as SurfaceStyle, T as ThemeStyle, d as Typography } from './theme-style-Cbl7NM-T.js';
4
- import { W as Widget, c as WidgetInstance } from './widget-B_RoG6se.js';
5
- export { B as BlockLayout, P as PageData, a as WidgetDefaultSettings, b as WidgetEditorProps, d as WidgetMetadata, e as WidgetProps } from './widget-B_RoG6se.js';
1
+ import { T as Theme } from './section-background-6V_LCi5e.js';
2
+ export { B as BackgroundAttachment, a as BackgroundRepeat, b as BlendMode, S as SectionBackground, c as SectionBackgroundOverlay } from './section-background-6V_LCi5e.js';
3
+ export { B as Border, C as Colors, a as CustomStyle, D as DisabledStyle, M as MenuItemStyle, b as MenuStyle, P as Padding, S as Shadow, c as SurfaceStyle, T as ThemeStyle, d as Typography } from './theme-style-BVd5tOsc.js';
4
+ import { W as Widget, c as WidgetInstance } from './widget-CpE2HdgU.js';
5
+ export { B as BlockLayout, P as PageData, a as WidgetDefaultSettings, b as WidgetEditorProps, d as WidgetMetadata, e as WidgetProps } from './widget-CpE2HdgU.js';
6
6
  export { M as Media, g as getMediaAlt, a as getMediaUrl } from './media-CnLImjVC.js';
7
- export { P as Page, a as PageSeo } from './page-W3hQga4w.js';
8
- export { A as Alignment, H as HorizontalAlignment, V as VerticalAlignment } from './alignment-dZDzN96G.js';
7
+ export { P as Page, a as PageSeo } from './page-B5Gmm-Ys.js';
8
+ export { A as Alignment, H as HeadingLevel, a as HorizontalAlignment, R as ResponsiveTextSize, T as TitleSettings, V as VerticalAlignment } from './heading-DQCxQt38.js';
9
9
  export { TextEditorContent } from '@frontlit/text-editor';
10
- export { EditableBlock, EditableBlockProps, PageRenderer, PageRendererProps, generateThemeStyles } from './renderer/index.js';
10
+ export { EditableBlock, EditableBlockProps, PageRenderer, PageRendererProps, generateThemeStyles, resolveThemeColor } from './renderer/index.js';
11
11
  export { P as PageBuilderLinkComponent, a as PageBuilderLinkProps, b as PageBuilderLinkProvider } from './nav-link-BfxvQ1s6.js';
12
12
  export { BlockPicker, BuilderTopBar, ColorSelector, ContentPaddingSelector, MaxWidthSelector, PATTERN_PRESETS, PageBuilder, PageBuilderPropertyHeader, PageBuilderProps, PageBuilderSlider, PageBuilderState, PatternPreset, PatternPresetCategory, PreviewDevice, SectionBackgroundPanel, SeoEditor, SettingsPanel, ThemeEditor, ThemeEditorProps, VerticalPaddingSelector, getMaxWidthTWClass, getVerticalPaddingTWClass } from './builder/index.js';
13
13
  export { DataSlotLoadRequest, DataSlotLoader, DataSlotLoaders, loadDataSlots } from './data-slots.js';
@@ -15,13 +15,16 @@ import 'react';
15
15
  import 'lucide-react';
16
16
  import './color-mode-DIEEt9WP.js';
17
17
 
18
+ /** Blocks placed outside the normal flow by the renderer. */
19
+ declare const LAYOUT_BLOCK_NAMES: string[];
20
+
18
21
  /**
19
22
  * Every block available to the page builder, keyed by its
20
23
  * `metadata.name`. `header` and `footer` are singleton, layout-level
21
24
  * blocks placed outside the normal flow by the renderer.
22
25
  */
23
26
  declare const blockRegistry: Record<string, Widget<any>>;
24
- declare const LAYOUT_BLOCK_NAMES: string[];
27
+
25
28
  declare const NON_ADDABLE_BLOCK_NAMES: string[];
26
29
  /**
27
30
  * Adds a host application's block to the shared renderer and builder
@@ -42,6 +45,10 @@ declare function getAddableBlocks(): Widget<any>[];
42
45
  * block's default settings.
43
46
  */
44
47
  declare function createWidgetInstance(name: string, overrides?: Record<string, unknown>): WidgetInstance;
48
+ /** Fills each block's unset settings with its defaults. Saved layouts omit
49
+ * settings equal to a default (the renderer merges them back), so the
50
+ * builder's panels need them filled in to show what's on the canvas. */
51
+ declare function withDefaultSettings(layout: WidgetInstance[]): WidgetInstance[];
45
52
  /** Ensures a builder layout always has one locked header and footer.
46
53
  * API validation remains the hard boundary; this repair keeps legacy/empty
47
54
  * initial layouts usable and prevents the UI from ever presenting a page
@@ -56,4 +63,4 @@ declare function getDefaultTheme(): Theme;
56
63
  */
57
64
  declare function createDefaultLayout(): WidgetInstance[];
58
65
 
59
- export { LAYOUT_BLOCK_NAMES, NON_ADDABLE_BLOCK_NAMES, Theme, Widget, WidgetInstance, blockRegistry, createDefaultLayout, createWidgetInstance, ensureRequiredSharedWidgets, getAddableBlocks, getDefaultTheme, getWidget, registerBlock };
66
+ export { LAYOUT_BLOCK_NAMES, NON_ADDABLE_BLOCK_NAMES, Theme, Widget, WidgetInstance, blockRegistry, createDefaultLayout, createWidgetInstance, ensureRequiredSharedWidgets, getAddableBlocks, getDefaultTheme, getWidget, registerBlock, withDefaultSettings };
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  "use client";
2
- import './chunk-RUYOL7JZ.js';
3
- export { BlockPicker, BuilderTopBar, ColorSelector, ContentPaddingSelector, MaxWidthSelector, PATTERN_PRESETS, PageBuilder, PageBuilderPropertyHeader, PageBuilderSlider, SectionBackgroundPanel, SeoEditor, SettingsPanel, ThemeEditor, VerticalPaddingSelector, createDefaultLayout, createWidgetInstance, ensureRequiredSharedWidgets, getDefaultTheme, getMaxWidthTWClass, getVerticalPaddingTWClass } from './chunk-KQKSLI3L.js';
4
- export { EditableBlock, LAYOUT_BLOCK_NAMES, NON_ADDABLE_BLOCK_NAMES, PageRenderer, blockRegistry, generateThemeStyles, getAddableBlocks, getWidget, registerBlock } from './chunk-HDINUNI2.js';
5
- import './chunk-UO7XGBGM.js';
6
- export { PageBuilderLinkProvider } from './chunk-H4P5MFJI.js';
7
- import './chunk-SGNRWWG3.js';
2
+ import './chunk-HWOVSHIW.js';
3
+ export { BlockPicker, BuilderTopBar, ColorSelector, ContentPaddingSelector, MaxWidthSelector, PATTERN_PRESETS, PageBuilder, PageBuilderPropertyHeader, PageBuilderSlider, SectionBackgroundPanel, SeoEditor, SettingsPanel, ThemeEditor, VerticalPaddingSelector, createDefaultLayout, createWidgetInstance, ensureRequiredSharedWidgets, getDefaultTheme, getMaxWidthTWClass, getVerticalPaddingTWClass, withDefaultSettings } from './chunk-GIKTOAQS.js';
4
+ export { EditableBlock, LAYOUT_BLOCK_NAMES, NON_ADDABLE_BLOCK_NAMES, PageRenderer, blockRegistry, generateThemeStyles, getAddableBlocks, getWidget, registerBlock, resolveThemeColor } from './chunk-IU4KATI2.js';
5
+ import './chunk-BBI7UHOA.js';
6
+ import './chunk-K4WCLHMS.js';
7
+ export { PageBuilderLinkProvider } from './chunk-36QHCIPM.js';
8
+ import './chunk-J7Z4UW45.js';
8
9
  export { getMediaAlt, getMediaUrl } from './chunk-XU7ALPGQ.js';
9
10
  export { loadDataSlots } from './chunk-ATNM5JHI.js';
10
11
  //# sourceMappingURL=index.js.map
@@ -1,8 +1,8 @@
1
- export { B as BackgroundAttachment, a as BackgroundRepeat, b as BlendMode, S as SectionBackground, c as SectionBackgroundOverlay, T as Theme } from '../section-background-MsdE40Rk.js';
2
- export { B as Border, C as Colors, a as CustomStyle, D as DisabledStyle, M as MenuItemStyle, b as MenuStyle, P as Padding, S as Shadow, c as SurfaceStyle, T as ThemeStyle, d as Typography } from '../theme-style-Cbl7NM-T.js';
3
- export { B as BlockLayout, P as PageData, W as Widget, a as WidgetDefaultSettings, b as WidgetEditorProps, c as WidgetInstance, d as WidgetMetadata, e as WidgetProps } from '../widget-B_RoG6se.js';
1
+ export { B as BackgroundAttachment, a as BackgroundRepeat, b as BlendMode, S as SectionBackground, c as SectionBackgroundOverlay, T as Theme } from '../section-background-6V_LCi5e.js';
2
+ export { B as Border, C as Colors, a as CustomStyle, D as DisabledStyle, M as MenuItemStyle, b as MenuStyle, P as Padding, S as Shadow, c as SurfaceStyle, T as ThemeStyle, d as Typography } from '../theme-style-BVd5tOsc.js';
3
+ export { B as BlockLayout, P as PageData, W as Widget, a as WidgetDefaultSettings, b as WidgetEditorProps, c as WidgetInstance, d as WidgetMetadata, e as WidgetProps } from '../widget-CpE2HdgU.js';
4
4
  export { M as Media, g as getMediaAlt, a as getMediaUrl } from '../media-CnLImjVC.js';
5
- export { P as Page, a as PageSeo } from '../page-W3hQga4w.js';
6
- export { A as Alignment, H as HorizontalAlignment, V as VerticalAlignment } from '../alignment-dZDzN96G.js';
5
+ export { P as Page, a as PageSeo } from '../page-B5Gmm-Ys.js';
6
+ export { A as Alignment, H as HeadingLevel, a as HorizontalAlignment, R as ResponsiveTextSize, T as TitleSettings, V as VerticalAlignment } from '../heading-DQCxQt38.js';
7
7
  export { TextEditorContent } from '@frontlit/text-editor';
8
8
  import 'react';
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import '../chunk-RUYOL7JZ.js';
2
+ import '../chunk-HWOVSHIW.js';
3
3
  export { getMediaAlt, getMediaUrl } from '../chunk-XU7ALPGQ.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { c as WidgetInstance } from './widget-B_RoG6se.js';
1
+ import { c as WidgetInstance } from './widget-CpE2HdgU.js';
2
2
  import { M as Media } from './media-CnLImjVC.js';
3
3
 
4
4
  /** Page-level SEO settings, editable from the builder's SEO panel. */
@@ -1,17 +1,17 @@
1
1
  import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
2
2
  import * as React$1 from 'react';
3
3
  import React__default, { ReactNode } from 'react';
4
- import { T as ThemeStyle } from '../theme-style-Cbl7NM-T.js';
4
+ import { T as ThemeStyle, d as Typography } from '../theme-style-BVd5tOsc.js';
5
5
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
6
6
  import * as class_variance_authority_types from 'class-variance-authority/types';
7
7
  import { VariantProps } from 'class-variance-authority';
8
- export { a as Button, B as ButtonProps } from '../button-Bzt1GDO-.js';
8
+ export { a as Button, B as ButtonProps } from '../button-OLKN3wPf.js';
9
9
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
10
10
  import * as DialogPrimitive from '@radix-ui/react-dialog';
11
11
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
12
12
  import * as PopoverPrimitive from '@radix-ui/react-popover';
13
13
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
14
- import { S as SectionBackground, T as Theme } from '../section-background-MsdE40Rk.js';
14
+ import { S as SectionBackground, T as Theme } from '../section-background-6V_LCi5e.js';
15
15
  import * as SelectPrimitive from '@radix-ui/react-select';
16
16
  import * as SeparatorPrimitive from '@radix-ui/react-separator';
17
17
  import * as SwitchPrimitives from '@radix-ui/react-switch';
@@ -185,13 +185,49 @@ interface DropdownMenuSubContentProps extends React$1.ComponentPropsWithoutRef<t
185
185
  declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<DropdownMenuSubContentProps & React$1.RefAttributes<HTMLDivElement>>;
186
186
  declare const DropdownMenuArrow: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuArrowProps & React$1.RefAttributes<SVGSVGElement>>;
187
187
 
188
- declare const Header1: React__default.FC<TypographyProps>;
188
+ interface CodeSnippetProps {
189
+ code: string;
190
+ /** Prefix shown before the first line, e.g. "$". Not copied. */
191
+ prompt?: string;
192
+ theme?: ThemeStyle;
193
+ className?: string;
194
+ }
195
+ /**
196
+ * A command or short code sample in a bordered monospace box with a copy
197
+ * button — the `curl … | sh` install box of developer-tool landing pages.
198
+ */
199
+ declare function CodeSnippet({ code, prompt, theme, className }: CodeSnippetProps): React__default.JSX.Element;
200
+
201
+ type HeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "div";
202
+ interface HeadingProps extends TypographyProps {
203
+ /** Element to render. Lets a block pick its heading level independently of its look. */
204
+ as?: HeadingTag;
205
+ /**
206
+ * Font-size classes that override the theme size. Kept apart from
207
+ * `className` so they are merged before the theme's line-height, which
208
+ * tailwind-merge would otherwise drop.
209
+ */
210
+ sizeClassName?: string;
211
+ }
212
+ /** px size of each Tailwind text size class. */
213
+ declare const TAILWIND_TEXT_PX: Record<string, number>;
214
+ /** CSS `clamp()` growing from `min` px on a phone to `max` px on a desktop. */
215
+ declare function fluidFontSize({ min, max }: {
216
+ min: number;
217
+ max: number;
218
+ }): string;
219
+ declare function createHeading(displayName: string, defaultTag: HeadingTag, baseClasses: string, getTypography: (theme?: ThemeStyle) => Typography | undefined): React__default.FC<HeadingProps>;
220
+
221
+ /** Hero-sized headline, styled separately from section H1s. */
222
+ declare const Display: React$1.FC<HeadingProps>;
223
+
224
+ declare const Header1: React$1.FC<HeadingProps>;
189
225
 
190
- declare const Header2: React__default.FC<TypographyProps>;
226
+ declare const Header2: React$1.FC<HeadingProps>;
191
227
 
192
- declare const Header3: React__default.FC<TypographyProps>;
228
+ declare const Header3: React$1.FC<HeadingProps>;
193
229
 
194
- declare const Header4: React__default.FC<TypographyProps>;
230
+ declare const Header4: React$1.FC<HeadingProps>;
195
231
 
196
232
  interface ImageProps extends React__default.ImgHTMLAttributes<HTMLImageElement> {
197
233
  src: string;
@@ -252,7 +288,6 @@ interface SectionProps extends React__default.HTMLAttributes<HTMLElement> {
252
288
  theme?: ThemeStyle;
253
289
  component?: "header" | "footer" | "section";
254
290
  background?: SectionBackground;
255
- nextTheme?: "dark" | "light";
256
291
  }
257
292
  declare const Section: React__default.FC<SectionProps>;
258
293
 
@@ -328,4 +363,4 @@ interface TooltipContentProps extends React$1.ComponentPropsWithoutRef<typeof To
328
363
  }
329
364
  declare const TooltipContent: React$1.ForwardRefExoticComponent<TooltipContentProps & React$1.RefAttributes<HTMLDivElement>>;
330
365
 
331
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, Caption, Checkbox, type CheckboxProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, Drawer, DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, DropdownMenuSubTrigger, DropdownMenuTrigger, Header1, Header2, Header3, Header4, Image, type ImageProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, PageCard, PageCardContent, type PageCardContentProps, PageCardHeader, type PageCardHeaderProps, PageCardImage, type PageCardImageProps, type PageCardProps, Popover, PopoverAnchor, PopoverClose, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverProps, PopoverTrigger, Preheader, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, Section, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectProps, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, type SeparatorProps, Subheader1, Subheader2, Switch, type SwitchProps, Text1, Text2, Textarea, type TextareaProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, themes };
366
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, type AlertDialogProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, Caption, Checkbox, type CheckboxProps, CodeSnippet, type CodeSnippetProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, Display, Drawer, DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, type DropdownMenuProps, DropdownMenuRadioGroup, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, type DropdownMenuSubContentProps, DropdownMenuSubTrigger, DropdownMenuTrigger, Header1, Header2, Header3, Header4, type HeadingProps, type HeadingTag, Image, type ImageProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, PageCard, PageCardContent, type PageCardContentProps, PageCardHeader, type PageCardHeaderProps, PageCardImage, type PageCardImageProps, type PageCardProps, Popover, PopoverAnchor, PopoverClose, PopoverContent, type PopoverContentProps, PopoverPortal, type PopoverProps, PopoverTrigger, Preheader, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, Section, Select, SelectContent, type SelectContentProps, SelectGroup, SelectItem, type SelectItemProps, SelectLabel, type SelectProps, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, type SelectTriggerProps, SelectValue, Separator, type SeparatorProps, Subheader1, Subheader2, Switch, type SwitchProps, TAILWIND_TEXT_PX, Text1, Text2, Textarea, type TextareaProps, Tooltip, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, createHeading, fluidFontSize, themes };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Button2 as Button, Caption, Checkbox, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Header1, Header2, Header3, Header4, Image, Input, Label, Link, PageCard, PageCardContent, PageCardHeader, PageCardImage, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Preheader, RadioGroup, RadioGroupItem, Section, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Subheader1, Subheader2, Switch2 as Switch, Text1, Text2, Textarea, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, themes } from '../chunk-SGNRWWG3.js';
2
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, Button2 as Button, Caption, Checkbox, CodeSnippet, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Display, Drawer, DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Header1, Header2, Header3, Header4, Image, Input, Label, Link, PageCard, PageCardContent, PageCardHeader, PageCardImage, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Preheader, RadioGroup, RadioGroupItem, Section, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Subheader1, Subheader2, Switch2 as Switch, TAILWIND_TEXT_PX, Text1, Text2, Textarea, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger, createHeading, fluidFontSize, themes } from '../chunk-J7Z4UW45.js';
3
3
  import '../chunk-XU7ALPGQ.js';
4
4
  //# sourceMappingURL=index.js.map
5
5
  //# sourceMappingURL=index.js.map
@@ -1,22 +1,20 @@
1
1
  import React__default from 'react';
2
- import { T as Theme } from '../section-background-MsdE40Rk.js';
3
- import { c as WidgetInstance, P as PageData } from '../widget-B_RoG6se.js';
2
+ import { T as Theme } from '../section-background-6V_LCi5e.js';
3
+ import { c as WidgetInstance, P as PageData } from '../widget-CpE2HdgU.js';
4
4
  import { P as PageBuilderLinkComponent } from '../nav-link-BfxvQ1s6.js';
5
5
  export { a as PageBuilderLinkProps, b as PageBuilderLinkProvider } from '../nav-link-BfxvQ1s6.js';
6
- import '../theme-style-Cbl7NM-T.js';
6
+ import '../theme-style-BVd5tOsc.js';
7
7
 
8
8
  interface PageRendererProps {
9
9
  layout: WidgetInstance[];
10
10
  theme: Theme;
11
- pageData?: PageData;
11
+ pageData: PageData;
12
12
  /** Optional content rendered between the shared header and footer. */
13
13
  children?: React__default.ReactNode;
14
14
  /** Host-resolved data keyed by a generic data-slot's configured name. */
15
15
  dataSlots?: Record<string, React__default.ReactNode>;
16
16
  /** Resolved palette currently painted (`system` is already applied). */
17
17
  nextTheme?: "light" | "dark";
18
- /** Visitor or preview preference, including follow-the-OS. */
19
- themeMode?: "light" | "dark" | "system";
20
18
  onThemeModeChange?: (mode: "light" | "dark" | "system") => void;
21
19
  /** When true, renders hover controls (edit/move/delete/add) for use inside the builder canvas. */
22
20
  editing?: boolean;
@@ -43,7 +41,7 @@ interface PageRendererProps {
43
41
  * plain (non-editable) display and, with `editing`, as the live canvas
44
42
  * inside the page builder.
45
43
  */
46
- declare function PageRenderer({ layout, theme, pageData, children, dataSlots, nextTheme, themeMode, onThemeModeChange, editing, selectedWidgetId, highlightedWidgetId, onSelectWidget, onMoveWidgetUp, onMoveWidgetDown, onDeleteWidget, onAddWidgetBelow, injectThemeStyles, linkComponent, className, }: PageRendererProps): React__default.JSX.Element;
44
+ declare function PageRenderer({ layout, theme, pageData, children, dataSlots, nextTheme, onThemeModeChange, editing, selectedWidgetId, highlightedWidgetId, onSelectWidget, onMoveWidgetUp, onMoveWidgetDown, onDeleteWidget, onAddWidgetBelow, injectThemeStyles, linkComponent, className, }: PageRendererProps): React__default.JSX.Element;
47
45
 
48
46
  interface EditableBlockProps {
49
47
  children: React__default.ReactNode;
@@ -67,6 +65,12 @@ interface EditableBlockProps {
67
65
  */
68
66
  declare function EditableBlock({ children, editing, containerRef, selected, highlighted, label, onSelect, onMoveUp, onMoveDown, onDelete, onAddBelow, }: EditableBlockProps): React__default.JSX.Element;
69
67
 
68
+ /**
69
+ * Turns a theme colour into a CSS colour value, or "" when it isn't a
70
+ * colour we can use. Hex (the stored format) is converted to hsl();
71
+ * modern CSS colour functions such as `oklch(...)` are passed through.
72
+ */
73
+ declare function resolveThemeColor(value?: string): string;
70
74
  /**
71
75
  * Generates full CSS color values for the custom properties every primitive
72
76
  * reads. Full colors (rather than bare HSL channels) let the renderer coexist
@@ -78,4 +82,4 @@ declare function EditableBlock({ children, editing, containerRef, selected, high
78
82
  */
79
83
  declare function generateThemeStyles(theme: Theme, selector?: string): string;
80
84
 
81
- export { EditableBlock, type EditableBlockProps, PageBuilderLinkComponent, PageRenderer, type PageRendererProps, generateThemeStyles };
85
+ export { EditableBlock, type EditableBlockProps, PageBuilderLinkComponent, PageRenderer, type PageRendererProps, generateThemeStyles, resolveThemeColor };
@@ -1,8 +1,9 @@
1
1
  "use client";
2
- export { EditableBlock, PageRenderer, generateThemeStyles } from '../chunk-HDINUNI2.js';
3
- import '../chunk-UO7XGBGM.js';
4
- export { PageBuilderLinkProvider } from '../chunk-H4P5MFJI.js';
5
- import '../chunk-SGNRWWG3.js';
2
+ export { EditableBlock, PageRenderer, generateThemeStyles, resolveThemeColor } from '../chunk-IU4KATI2.js';
3
+ import '../chunk-BBI7UHOA.js';
4
+ import '../chunk-K4WCLHMS.js';
5
+ export { PageBuilderLinkProvider } from '../chunk-36QHCIPM.js';
6
+ import '../chunk-J7Z4UW45.js';
6
7
  import '../chunk-XU7ALPGQ.js';
7
8
  //# sourceMappingURL=index.js.map
8
9
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import { T as ThemeStyle } from './theme-style-Cbl7NM-T.js';
1
+ import { T as ThemeStyle } from './theme-style-BVd5tOsc.js';
2
2
 
3
3
  interface Theme {
4
4
  id: string;
@@ -0,0 +1,103 @@
1
+ import * as React from 'react';
2
+ import React__default, { ReactNode } from 'react';
3
+ import { T as Theme } from './theme-CF3fIKvw.js';
4
+ import './theme-style-BPaMwk88.js';
5
+
6
+ /**
7
+ * A single block placed on a page, as persisted in a page's layout.
8
+ */
9
+ interface WidgetInstance {
10
+ widgetId: string;
11
+ name: string;
12
+ /** Whether the instance can be removed from its page. */
13
+ deletable: boolean;
14
+ /** Whether the instance can be repositioned within its page. */
15
+ moveable: boolean;
16
+ shared: boolean;
17
+ settings?: Record<string, unknown>;
18
+ }
19
+ interface PageData extends Record<string, unknown> {
20
+ pageType?: string;
21
+ /** Branding from site settings. Required so a host can't silently drop
22
+ * it; pass `null` for an unset one. Hosts build these with
23
+ * `toSiteBranding` from `@frontlit/api-contract`. */
24
+ siteTitle: string | null;
25
+ siteSubtitle: string | null;
26
+ siteLogoUrl: string | null;
27
+ siteLogoAlt: string | null;
28
+ /** The page's team (public id) and slug, plus the base URL of FrontLit's
29
+ * public API — threaded through so blocks that make unauthenticated
30
+ * public calls (e.g. the email-form block's lead capture, architecture.md
31
+ * §10.2) know where to send them. Left unset in contexts with no live
32
+ * backend (e.g. a bare component-library preview), in which case those
33
+ * blocks degrade to a local-only success state. */
34
+ teamId?: string;
35
+ pageSlug?: string;
36
+ publicApiBaseUrl?: string;
37
+ }
38
+
39
+ interface ServerPageRendererProps {
40
+ layout: WidgetInstance[];
41
+ theme: Theme;
42
+ pageData: PageData;
43
+ /** Content rendered between the shared header and footer. */
44
+ children?: ReactNode;
45
+ /** Host-resolved data keyed by a generic data-slot's configured name. */
46
+ dataSlots?: Record<string, ReactNode>;
47
+ /** Light/dark control for the footer; a client component owned by the host. */
48
+ themeSwitcher?: ReactNode;
49
+ /** Extra content inside the themed root (e.g. a fixed "Preview" badge),
50
+ * so it can use the theme's colours. */
51
+ overlay?: ReactNode;
52
+ className?: string;
53
+ }
54
+ /**
55
+ * Server-component counterpart of `PageRenderer`. Static blocks render on
56
+ * the server and ship no JavaScript; only the interactive parts (mobile menu,
57
+ * marquee, forms, copy buttons, links) are client islands.
58
+ *
59
+ * Everything crossing into an island must be serialisable, so unlike
60
+ * `PageRenderer` this takes no callbacks. Dark-mode styling is CSS-driven
61
+ * (the `dark` class on an ancestor), so no resolved colour mode is needed.
62
+ */
63
+ declare function ServerPageRenderer({ layout, theme, pageData, children, dataSlots, themeSwitcher, overlay, className, }: ServerPageRendererProps): React.JSX.Element;
64
+
65
+ interface ImageAttributesInput {
66
+ src: string;
67
+ alt: string;
68
+ sizes?: string;
69
+ /** Above-the-fold image (e.g. LCP): fetched eagerly at high priority. */
70
+ priority: boolean;
71
+ }
72
+ /**
73
+ * Lets a host swap an image's `src`/`srcSet` for its own optimizer's URLs
74
+ * (e.g. Next.js's `getImageProps`) without this package depending on the
75
+ * host framework. Return `null` to keep the original URL.
76
+ */
77
+ type ImageAttributesResolver = (input: ImageAttributesInput) => React__default.ImgHTMLAttributes<HTMLImageElement> | null;
78
+ /**
79
+ * Registers the host's resolver. Call once at server start-up; renders that
80
+ * run without one emit the original URL.
81
+ */
82
+ declare function setImageAttributesResolver(resolver: ImageAttributesResolver | null): void;
83
+
84
+ /** Context supplied to a host application's data-slot loader. */
85
+ interface DataSlotLoadRequest {
86
+ /** The slot identifier declared in `instance.settings.slot`. */
87
+ slot: string;
88
+ /** The full persisted block configuration. */
89
+ instance: WidgetInstance;
90
+ /** Page context supplied by the host renderer. */
91
+ pageData: PageData;
92
+ }
93
+ /** A host-owned resolver for one named data slot. */
94
+ type DataSlotLoader = (request: DataSlotLoadRequest) => ReactNode | Promise<ReactNode>;
95
+ type DataSlotLoaders = Readonly<Record<string, DataSlotLoader>>;
96
+ /**
97
+ * Resolves generic data-slot blocks before passing their output to
98
+ * `PageRenderer`. The page-builder package deliberately does not fetch data
99
+ * or understand a host application's domain model.
100
+ */
101
+ declare function loadDataSlots(layout: readonly WidgetInstance[], loaders: DataSlotLoaders, pageData: PageData): Promise<Record<string, ReactNode>>;
102
+
103
+ export { type DataSlotLoadRequest, type DataSlotLoader, type DataSlotLoaders, type ImageAttributesInput, type ImageAttributesResolver, ServerPageRenderer, type ServerPageRendererProps, loadDataSlots, setImageAttributesResolver };