@mission-studio/puck 1.0.15 → 1.0.16

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.
@@ -0,0 +1,133 @@
1
+ import {
2
+ Button,
3
+ Card,
4
+ Columns,
5
+ Container,
6
+ CustomImage,
7
+ Divider,
8
+ FeatureGrid,
9
+ FeaturesList,
10
+ Footer,
11
+ Heading,
12
+ Icon,
13
+ Image,
14
+ ImageCarousel,
15
+ Paragraph,
16
+ Popup,
17
+ Section,
18
+ Spacer,
19
+ TextBlock,
20
+ Topbar,
21
+ VideoEmbed
22
+ } from "../chunk-ML3AS3AY.mjs";
23
+ import "../chunk-KV2RSRAM.mjs";
24
+ import "../chunk-QSWQDR6M.mjs";
25
+ import "../chunk-D3L26TIT.mjs";
26
+
27
+ // config/server.tsx
28
+ import { jsx } from "react/jsx-runtime";
29
+ var config = {
30
+ categories: {
31
+ typography: {
32
+ title: "Typography",
33
+ components: ["Heading", "Paragraph"]
34
+ },
35
+ actions: {
36
+ title: "Actions",
37
+ components: ["Button"]
38
+ },
39
+ media: {
40
+ title: "Media",
41
+ components: ["Image", "ImageCarousel", "VideoEmbed", "Icon"]
42
+ },
43
+ layout: {
44
+ title: "Layout",
45
+ components: [
46
+ "Section",
47
+ "Container",
48
+ "Columns",
49
+ "Card",
50
+ "Divider",
51
+ "Spacer"
52
+ ]
53
+ },
54
+ legacy: {
55
+ title: "Legacy",
56
+ components: [
57
+ "TextBlock",
58
+ "CustomImage",
59
+ "FeaturesList",
60
+ "FeatureGrid",
61
+ "Footer",
62
+ "Topbar",
63
+ "Popup"
64
+ ],
65
+ defaultExpanded: false
66
+ }
67
+ },
68
+ components: {
69
+ Heading: {
70
+ render: (props) => /* @__PURE__ */ jsx(Heading, { ...props })
71
+ },
72
+ Paragraph: {
73
+ render: (props) => /* @__PURE__ */ jsx(Paragraph, { ...props })
74
+ },
75
+ Button: {
76
+ render: (props) => /* @__PURE__ */ jsx(Button, { ...props })
77
+ },
78
+ Image: {
79
+ render: (props) => /* @__PURE__ */ jsx(Image, { ...props })
80
+ },
81
+ ImageCarousel: {
82
+ render: (props) => /* @__PURE__ */ jsx(ImageCarousel, { ...props })
83
+ },
84
+ VideoEmbed: {
85
+ render: (props) => /* @__PURE__ */ jsx(VideoEmbed, { ...props })
86
+ },
87
+ Icon: {
88
+ render: (props) => /* @__PURE__ */ jsx(Icon, { ...props })
89
+ },
90
+ Section: {
91
+ render: (props) => /* @__PURE__ */ jsx(Section, { ...props })
92
+ },
93
+ Container: {
94
+ render: (props) => /* @__PURE__ */ jsx(Container, { ...props })
95
+ },
96
+ Columns: {
97
+ render: (props) => /* @__PURE__ */ jsx(Columns, { ...props })
98
+ },
99
+ Card: {
100
+ render: (props) => /* @__PURE__ */ jsx(Card, { ...props })
101
+ },
102
+ Divider: {
103
+ render: (props) => /* @__PURE__ */ jsx(Divider, { ...props })
104
+ },
105
+ Spacer: {
106
+ render: (props) => /* @__PURE__ */ jsx(Spacer, { ...props })
107
+ },
108
+ TextBlock: {
109
+ render: (props) => /* @__PURE__ */ jsx(TextBlock, { ...props })
110
+ },
111
+ CustomImage: {
112
+ render: (props) => /* @__PURE__ */ jsx(CustomImage, { ...props })
113
+ },
114
+ FeaturesList: {
115
+ render: (props) => /* @__PURE__ */ jsx(FeaturesList, { ...props })
116
+ },
117
+ FeatureGrid: {
118
+ render: (props) => /* @__PURE__ */ jsx(FeatureGrid, { ...props })
119
+ },
120
+ Footer: {
121
+ render: (props) => /* @__PURE__ */ jsx(Footer, { ...props })
122
+ },
123
+ Topbar: {
124
+ render: (props) => /* @__PURE__ */ jsx(Topbar, { ...props })
125
+ },
126
+ Popup: {
127
+ render: (props) => /* @__PURE__ */ jsx(Popup, { ...props })
128
+ }
129
+ }
130
+ };
131
+ export {
132
+ config
133
+ };
@@ -6,7 +6,7 @@ import {
6
6
  createShadowField,
7
7
  createSpacingField,
8
8
  createThemeableColorField
9
- } from "./chunk-JD6CULMT.mjs";
9
+ } from "./chunk-SYXQQITG.mjs";
10
10
  import "./chunk-A3QDUUOF.mjs";
11
11
  import {
12
12
  Button,
@@ -30,9 +30,10 @@ import {
30
30
  Topbar,
31
31
  VideoEmbed,
32
32
  availableIcons
33
- } from "./chunk-HHHD5TX2.mjs";
34
- import "./chunk-XRKFMCSS.mjs";
33
+ } from "./chunk-ML3AS3AY.mjs";
34
+ import "./chunk-KV2RSRAM.mjs";
35
35
  import "./chunk-QSWQDR6M.mjs";
36
+ import "./chunk-D3L26TIT.mjs";
36
37
 
37
38
  // config.tsx
38
39
  import { jsx } from "react/jsx-runtime";
package/dist/editor.d.mts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { E as Entry, n as EntryBoundValue, k as ThemeableColorValue, C as ColorValue, b as ThemeColorKey, o as CustomFieldProps, R as ResponsiveVisibility } from './ResponsiveToggleField-BGofgB3u.mjs';
3
- export { D as DEFAULT_THEME, p as EntryContent, P as PageTheme, q as ResponsiveToggleField, T as ThemeBorderKey, a as ThemeBorders, c as ThemeColors, d as ThemeProvider, e as ThemeShadowKey, f as ThemeShadows, g as ThemeSpacing, h as ThemeSpacingKey, i as ThemeTypography, j as ThemeableBorderRadiusValue, l as ThemeableShadowValue, m as ThemeableSpacingValue, u as useTheme } from './ResponsiveToggleField-BGofgB3u.mjs';
2
+ import { R as ResponsiveVisibility } from './ResponsiveToggleField-BihXsGIJ.mjs';
3
+ export { D as DEFAULT_THEME, a as ResponsiveToggleField, T as ThemeProvider, u as useTheme } from './ResponsiveToggleField-BihXsGIJ.mjs';
4
+ import { E as Entry, n as EntryBoundValue, j as ThemeableColorValue, C as ColorValue, b as ThemeColorKey, m as CustomFieldProps } from './types-D-CIduaE.mjs';
5
+ export { o as EntryContent, P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, c as ThemeColors, d as ThemeShadowKey, e as ThemeShadows, f as ThemeSpacing, g as ThemeSpacingKey, h as ThemeTypography, i as ThemeableBorderRadiusValue, k as ThemeableShadowValue, l as ThemeableSpacingValue } from './types-D-CIduaE.mjs';
4
6
  export { B as BorderRadiusPreset, C as ColorPreset, F as FontFamilyPreset, a as FontSizePreset, b as FontWeightPreset, S as ShadowPreset, c as SpacingPreset, d as allColorPresets, e as borderRadiusScale, f as fontFamilies, g as fontSizes, h as fontWeights, i as getBorderRadiusCSS, j as getClosestBorderRadiusValue, k as getClosestSpacingValue, l as getFontSizeCSS, m as getShadowCSS, n as neutralColors, s as shadowPresets, o as spacingScale } from './typography-DwjKOx3F.mjs';
5
7
  import { ReactNode } from 'react';
6
8
  import { Data } from '@measured/puck';
package/dist/editor.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { E as Entry, n as EntryBoundValue, k as ThemeableColorValue, C as ColorValue, b as ThemeColorKey, o as CustomFieldProps, R as ResponsiveVisibility } from './ResponsiveToggleField-BGofgB3u.js';
3
- export { D as DEFAULT_THEME, p as EntryContent, P as PageTheme, q as ResponsiveToggleField, T as ThemeBorderKey, a as ThemeBorders, c as ThemeColors, d as ThemeProvider, e as ThemeShadowKey, f as ThemeShadows, g as ThemeSpacing, h as ThemeSpacingKey, i as ThemeTypography, j as ThemeableBorderRadiusValue, l as ThemeableShadowValue, m as ThemeableSpacingValue, u as useTheme } from './ResponsiveToggleField-BGofgB3u.js';
2
+ import { R as ResponsiveVisibility } from './ResponsiveToggleField-CfBKL5oY.js';
3
+ export { D as DEFAULT_THEME, a as ResponsiveToggleField, T as ThemeProvider, u as useTheme } from './ResponsiveToggleField-CfBKL5oY.js';
4
+ import { E as Entry, n as EntryBoundValue, j as ThemeableColorValue, C as ColorValue, b as ThemeColorKey, m as CustomFieldProps } from './types-D-CIduaE.js';
5
+ export { o as EntryContent, P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, c as ThemeColors, d as ThemeShadowKey, e as ThemeShadows, f as ThemeSpacing, g as ThemeSpacingKey, h as ThemeTypography, i as ThemeableBorderRadiusValue, k as ThemeableShadowValue, l as ThemeableSpacingValue } from './types-D-CIduaE.js';
4
6
  export { B as BorderRadiusPreset, C as ColorPreset, F as FontFamilyPreset, a as FontSizePreset, b as FontWeightPreset, S as ShadowPreset, c as SpacingPreset, d as allColorPresets, e as borderRadiusScale, f as fontFamilies, g as fontSizes, h as fontWeights, i as getBorderRadiusCSS, j as getClosestBorderRadiusValue, k as getClosestSpacingValue, l as getFontSizeCSS, m as getShadowCSS, n as neutralColors, s as shadowPresets, o as spacingScale } from './typography-DwjKOx3F.js';
5
7
  import { ReactNode } from 'react';
6
8
  import { Data } from '@measured/puck';
package/dist/editor.mjs CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  createSpacingField,
17
17
  createThemeableColorField,
18
18
  createTypographyField
19
- } from "./chunk-JD6CULMT.mjs";
19
+ } from "./chunk-SYXQQITG.mjs";
20
20
  import {
21
21
  allColorPresets,
22
22
  neutralColors
@@ -33,14 +33,16 @@ import {
33
33
  spacingScale
34
34
  } from "./chunk-A3QDUUOF.mjs";
35
35
  import {
36
- DEFAULT_THEME,
37
36
  EntriesProvider,
38
37
  ThemeProvider,
39
38
  getShadowCSS,
40
39
  shadowPresets,
41
40
  useEntries,
42
41
  useTheme
43
- } from "./chunk-XRKFMCSS.mjs";
42
+ } from "./chunk-KV2RSRAM.mjs";
43
+ import {
44
+ DEFAULT_THEME
45
+ } from "./chunk-D3L26TIT.mjs";
44
46
 
45
47
  // components/editor/TemplatesList.tsx
46
48
  import { usePuck } from "@measured/puck";
package/dist/index.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Button, ButtonProps, Card, CardProps, CarouselImage, Columns, ColumnsProps, Container, ContainerProps, CustomImage, CustomImageProps, Divider, DividerProps, FeatureGrid, FeatureGridProps, FeaturesList, FeaturesListProps, Footer, FooterProps, Heading, HeadingProps, Icon, IconProps, Image, ImageCarousel, ImageCarouselProps, ImageProps, Paragraph, ParagraphProps, Popup, PopupProps, Section, SectionProps, Spacer, SpacerProps, TextBlock, TextBlockProps, Topbar, TopbarProps, VideoEmbed, VideoEmbedProps, availableIcons } from './renderer.mjs';
2
- export { D as DEFAULT_THEME, P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, b as ThemeColorKey, c as ThemeColors, d as ThemeProvider, e as ThemeShadowKey, f as ThemeShadows, g as ThemeSpacing, h as ThemeSpacingKey, i as ThemeTypography, j as ThemeableBorderRadiusValue, k as ThemeableColorValue, l as ThemeableShadowValue, m as ThemeableSpacingValue, u as useTheme } from './ResponsiveToggleField-BGofgB3u.mjs';
2
+ export { D as DEFAULT_THEME, T as ThemeProvider, u as useTheme } from './ResponsiveToggleField-BihXsGIJ.mjs';
3
+ export { P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, b as ThemeColorKey, c as ThemeColors, d as ThemeShadowKey, e as ThemeShadows, f as ThemeSpacing, g as ThemeSpacingKey, h as ThemeTypography, i as ThemeableBorderRadiusValue, j as ThemeableColorValue, k as ThemeableShadowValue, l as ThemeableSpacingValue } from './types-D-CIduaE.mjs';
3
4
  export { B as BorderRadiusPreset, C as ColorPreset, F as FontFamilyPreset, a as FontSizePreset, b as FontWeightPreset, S as ShadowPreset, c as SpacingPreset, d as allColorPresets, e as borderRadiusScale, f as fontFamilies, g as fontSizes, h as fontWeights, i as getBorderRadiusCSS, j as getClosestBorderRadiusValue, k as getClosestSpacingValue, l as getFontSizeCSS, m as getShadowCSS, n as neutralColors, s as shadowPresets, o as spacingScale } from './typography-DwjKOx3F.mjs';
4
5
  import 'react/jsx-runtime';
5
6
  import 'react';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Button, ButtonProps, Card, CardProps, CarouselImage, Columns, ColumnsProps, Container, ContainerProps, CustomImage, CustomImageProps, Divider, DividerProps, FeatureGrid, FeatureGridProps, FeaturesList, FeaturesListProps, Footer, FooterProps, Heading, HeadingProps, Icon, IconProps, Image, ImageCarousel, ImageCarouselProps, ImageProps, Paragraph, ParagraphProps, Popup, PopupProps, Section, SectionProps, Spacer, SpacerProps, TextBlock, TextBlockProps, Topbar, TopbarProps, VideoEmbed, VideoEmbedProps, availableIcons } from './renderer.js';
2
- export { D as DEFAULT_THEME, P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, b as ThemeColorKey, c as ThemeColors, d as ThemeProvider, e as ThemeShadowKey, f as ThemeShadows, g as ThemeSpacing, h as ThemeSpacingKey, i as ThemeTypography, j as ThemeableBorderRadiusValue, k as ThemeableColorValue, l as ThemeableShadowValue, m as ThemeableSpacingValue, u as useTheme } from './ResponsiveToggleField-BGofgB3u.js';
2
+ export { D as DEFAULT_THEME, T as ThemeProvider, u as useTheme } from './ResponsiveToggleField-CfBKL5oY.js';
3
+ export { P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, b as ThemeColorKey, c as ThemeColors, d as ThemeShadowKey, e as ThemeShadows, f as ThemeSpacing, g as ThemeSpacingKey, h as ThemeTypography, i as ThemeableBorderRadiusValue, j as ThemeableColorValue, k as ThemeableShadowValue, l as ThemeableSpacingValue } from './types-D-CIduaE.js';
3
4
  export { B as BorderRadiusPreset, C as ColorPreset, F as FontFamilyPreset, a as FontSizePreset, b as FontWeightPreset, S as ShadowPreset, c as SpacingPreset, d as allColorPresets, e as borderRadiusScale, f as fontFamilies, g as fontSizes, h as fontWeights, i as getBorderRadiusCSS, j as getClosestBorderRadiusValue, k as getClosestSpacingValue, l as getFontSizeCSS, m as getShadowCSS, n as neutralColors, s as shadowPresets, o as spacingScale } from './typography-DwjKOx3F.js';
4
5
  import 'react/jsx-runtime';
5
6
  import 'react';
package/dist/index.mjs CHANGED
@@ -35,15 +35,17 @@ import {
35
35
  Topbar,
36
36
  VideoEmbed,
37
37
  availableIcons
38
- } from "./chunk-HHHD5TX2.mjs";
38
+ } from "./chunk-ML3AS3AY.mjs";
39
39
  import {
40
- DEFAULT_THEME,
41
40
  ThemeProvider,
42
41
  getShadowCSS,
43
42
  shadowPresets,
44
43
  useTheme
45
- } from "./chunk-XRKFMCSS.mjs";
44
+ } from "./chunk-KV2RSRAM.mjs";
46
45
  import "./chunk-QSWQDR6M.mjs";
46
+ import {
47
+ DEFAULT_THEME
48
+ } from "./chunk-D3L26TIT.mjs";
47
49
  export {
48
50
  Button,
49
51
  Card,
@@ -1,7 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { n as EntryBoundValue, k as ThemeableColorValue, C as ColorValue, R as ResponsiveVisibility } from './ResponsiveToggleField-BGofgB3u.mjs';
3
- export { D as DEFAULT_THEME, P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, b as ThemeColorKey, c as ThemeColors, d as ThemeProvider, e as ThemeShadowKey, f as ThemeShadows, g as ThemeSpacing, h as ThemeSpacingKey, i as ThemeTypography, j as ThemeableBorderRadiusValue, l as ThemeableShadowValue, m as ThemeableSpacingValue, u as useTheme } from './ResponsiveToggleField-BGofgB3u.mjs';
2
+ import { n as EntryBoundValue, j as ThemeableColorValue, C as ColorValue } from './types-D-CIduaE.mjs';
3
+ export { P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, b as ThemeColorKey, c as ThemeColors, d as ThemeShadowKey, e as ThemeShadows, f as ThemeSpacing, g as ThemeSpacingKey, h as ThemeTypography, i as ThemeableBorderRadiusValue, k as ThemeableShadowValue, l as ThemeableSpacingValue } from './types-D-CIduaE.mjs';
4
4
  import { ReactNode } from 'react';
5
+ import { R as ResponsiveVisibility } from './ResponsiveToggleField-BihXsGIJ.mjs';
6
+ export { D as DEFAULT_THEME, T as ThemeProvider, u as useTheme } from './ResponsiveToggleField-BihXsGIJ.mjs';
5
7
  import { PuckContext } from '@measured/puck';
6
8
 
7
9
  type HeadingProps = {
@@ -1,7 +1,9 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { n as EntryBoundValue, k as ThemeableColorValue, C as ColorValue, R as ResponsiveVisibility } from './ResponsiveToggleField-BGofgB3u.js';
3
- export { D as DEFAULT_THEME, P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, b as ThemeColorKey, c as ThemeColors, d as ThemeProvider, e as ThemeShadowKey, f as ThemeShadows, g as ThemeSpacing, h as ThemeSpacingKey, i as ThemeTypography, j as ThemeableBorderRadiusValue, l as ThemeableShadowValue, m as ThemeableSpacingValue, u as useTheme } from './ResponsiveToggleField-BGofgB3u.js';
2
+ import { n as EntryBoundValue, j as ThemeableColorValue, C as ColorValue } from './types-D-CIduaE.js';
3
+ export { P as PageTheme, T as ThemeBorderKey, a as ThemeBorders, b as ThemeColorKey, c as ThemeColors, d as ThemeShadowKey, e as ThemeShadows, f as ThemeSpacing, g as ThemeSpacingKey, h as ThemeTypography, i as ThemeableBorderRadiusValue, k as ThemeableShadowValue, l as ThemeableSpacingValue } from './types-D-CIduaE.js';
4
4
  import { ReactNode } from 'react';
5
+ import { R as ResponsiveVisibility } from './ResponsiveToggleField-CfBKL5oY.js';
6
+ export { D as DEFAULT_THEME, T as ThemeProvider, u as useTheme } from './ResponsiveToggleField-CfBKL5oY.js';
5
7
  import { PuckContext } from '@measured/puck';
6
8
 
7
9
  type HeadingProps = {
package/dist/renderer.mjs CHANGED
@@ -20,13 +20,15 @@ import {
20
20
  Topbar,
21
21
  VideoEmbed,
22
22
  availableIcons
23
- } from "./chunk-HHHD5TX2.mjs";
23
+ } from "./chunk-ML3AS3AY.mjs";
24
24
  import {
25
- DEFAULT_THEME,
26
25
  ThemeProvider,
27
26
  useTheme
28
- } from "./chunk-XRKFMCSS.mjs";
27
+ } from "./chunk-KV2RSRAM.mjs";
29
28
  import "./chunk-QSWQDR6M.mjs";
29
+ import {
30
+ DEFAULT_THEME
31
+ } from "./chunk-D3L26TIT.mjs";
30
32
  export {
31
33
  Button,
32
34
  Card,
@@ -0,0 +1,10 @@
1
+ import { Data } from '@measured/puck';
2
+ import { P as PageTheme, E as Entry } from '../types-D-CIduaE.mjs';
3
+
4
+ interface ResolvePageDataOptions {
5
+ theme: PageTheme | null;
6
+ entries?: Entry[];
7
+ }
8
+ declare function resolvePageData(data: Data, options: ResolvePageDataOptions): Data;
9
+
10
+ export { type ResolvePageDataOptions, resolvePageData };
@@ -0,0 +1,10 @@
1
+ import { Data } from '@measured/puck';
2
+ import { P as PageTheme, E as Entry } from '../types-D-CIduaE.js';
3
+
4
+ interface ResolvePageDataOptions {
5
+ theme: PageTheme | null;
6
+ entries?: Entry[];
7
+ }
8
+ declare function resolvePageData(data: Data, options: ResolvePageDataOptions): Data;
9
+
10
+ export { type ResolvePageDataOptions, resolvePageData };
@@ -0,0 +1,202 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // resolve/index.ts
21
+ var resolve_exports = {};
22
+ __export(resolve_exports, {
23
+ resolvePageData: () => resolvePageData
24
+ });
25
+ module.exports = __toCommonJS(resolve_exports);
26
+
27
+ // theme/defaults.ts
28
+ var DEFAULT_THEME = {
29
+ id: "default",
30
+ name: "Default Theme",
31
+ colors: {
32
+ primary: { color: "#3B82F6", opacity: 100 },
33
+ secondary: { color: "#8B5CF6", opacity: 100 },
34
+ accent: { color: "#10B981", opacity: 100 },
35
+ background: { color: "#FFFFFF", opacity: 100 },
36
+ foreground: { color: "#111827", opacity: 100 },
37
+ muted: { color: "#F3F4F6", opacity: 100 }
38
+ },
39
+ typography: {
40
+ fontFamily: {
41
+ heading: "system-ui, sans-serif",
42
+ body: "system-ui, sans-serif"
43
+ },
44
+ fontSize: {
45
+ base: "base",
46
+ heading: "4xl"
47
+ },
48
+ fontWeight: {
49
+ normal: 400,
50
+ heading: 700
51
+ }
52
+ },
53
+ spacing: {
54
+ xs: 8,
55
+ sm: 12,
56
+ md: 16,
57
+ lg: 24,
58
+ xl: 32
59
+ },
60
+ borders: {
61
+ radiusSmall: 4,
62
+ radiusMedium: 8,
63
+ radiusLarge: 16
64
+ },
65
+ shadows: {
66
+ small: "sm",
67
+ medium: "md",
68
+ large: "lg"
69
+ }
70
+ };
71
+
72
+ // utils/index.ts
73
+ var import_tailwind_merge = require("tailwind-merge");
74
+ var import_clsx = require("clsx");
75
+ function hexToRgba(hex, opacity) {
76
+ const sanitized = hex.replace("#", "");
77
+ const r = parseInt(sanitized.slice(0, 2), 16);
78
+ const g = parseInt(sanitized.slice(2, 4), 16);
79
+ const b = parseInt(sanitized.slice(4, 6), 16);
80
+ return `rgba(${r}, ${g}, ${b}, ${opacity / 100})`;
81
+ }
82
+
83
+ // resolve/theme.ts
84
+ function resolveThemeColor(theme, themeKey) {
85
+ const activeTheme = theme ?? DEFAULT_THEME;
86
+ return activeTheme.colors[themeKey];
87
+ }
88
+ function resolveThemeableColor(theme, value) {
89
+ if (!value) {
90
+ return hexToRgba(
91
+ resolveThemeColor(theme, "foreground").color,
92
+ resolveThemeColor(theme, "foreground").opacity
93
+ );
94
+ }
95
+ if (typeof value === "string") {
96
+ return hexToRgba(value, 100);
97
+ }
98
+ if ("useTheme" in value) {
99
+ if (value.useTheme) {
100
+ const resolved = resolveThemeColor(theme, value.themeKey);
101
+ return hexToRgba(resolved.color, resolved.opacity);
102
+ }
103
+ return hexToRgba(value.value.color, value.value.opacity);
104
+ }
105
+ if ("color" in value) {
106
+ return hexToRgba(value.color, value.opacity);
107
+ }
108
+ const defaultColor = resolveThemeColor(theme, "foreground");
109
+ return hexToRgba(defaultColor.color, defaultColor.opacity);
110
+ }
111
+
112
+ // resolve/entries.ts
113
+ function getEntryValue(entries, entryName, fieldKey) {
114
+ const entry = entries.find((e) => e.name === entryName);
115
+ if (!entry) return void 0;
116
+ return entry.content[fieldKey];
117
+ }
118
+ function resolveEntryValue(entries, value) {
119
+ if (!value) return void 0;
120
+ if (typeof value !== "object") {
121
+ return value;
122
+ }
123
+ if ("useEntry" in value) {
124
+ if (value.useEntry) {
125
+ const resolved = getEntryValue(entries, value.entryName, value.fieldKey);
126
+ return resolved ?? "";
127
+ }
128
+ return value.value;
129
+ }
130
+ return value;
131
+ }
132
+
133
+ // resolve/index.ts
134
+ function isThemeableColorValue(value) {
135
+ return typeof value === "object" && value !== null && "useTheme" in value;
136
+ }
137
+ function isColorValue(value) {
138
+ return typeof value === "object" && value !== null && "color" in value && "opacity" in value;
139
+ }
140
+ function resolveProp(theme, entries, value) {
141
+ if (value === void 0 || value === null) {
142
+ return value;
143
+ }
144
+ if (isThemeableColorValue(value)) {
145
+ return resolveThemeableColor(theme, value);
146
+ }
147
+ if (isColorValue(value)) {
148
+ return value;
149
+ }
150
+ if (typeof value === "object" && value !== null && "useEntry" in value) {
151
+ return resolveEntryValue(entries, value);
152
+ }
153
+ if (typeof value === "object") {
154
+ const resolved = {};
155
+ for (const [key, val] of Object.entries(value)) {
156
+ resolved[key] = resolveProp(theme, entries, val);
157
+ }
158
+ return resolved;
159
+ }
160
+ if (Array.isArray(value)) {
161
+ return value.map((item) => resolveProp(theme, entries, item));
162
+ }
163
+ return value;
164
+ }
165
+ function resolveComponentProps(theme, entries, component) {
166
+ const resolvedProps = {};
167
+ for (const [key, value] of Object.entries(component.props)) {
168
+ resolvedProps[key] = resolveProp(theme, entries, value);
169
+ }
170
+ return {
171
+ ...component,
172
+ props: resolvedProps
173
+ };
174
+ }
175
+ function resolveContent(theme, entries, content) {
176
+ return content.map(
177
+ (component) => resolveComponentProps(theme, entries, component)
178
+ );
179
+ }
180
+ function resolveZones(theme, entries, zones) {
181
+ const resolvedZones = {};
182
+ for (const [zoneKey, zoneContent] of Object.entries(zones)) {
183
+ resolvedZones[zoneKey] = resolveContent(theme, entries, zoneContent);
184
+ }
185
+ return resolvedZones;
186
+ }
187
+ function resolvePageData(data, options) {
188
+ const { theme, entries = [] } = options;
189
+ return {
190
+ ...data,
191
+ content: resolveContent(theme, entries, data.content),
192
+ zones: resolveZones(
193
+ theme,
194
+ entries,
195
+ data.zones
196
+ )
197
+ };
198
+ }
199
+ // Annotate the CommonJS export names for ESM import in node:
200
+ 0 && (module.exports = {
201
+ resolvePageData
202
+ });
@@ -0,0 +1,124 @@
1
+ import {
2
+ DEFAULT_THEME,
3
+ hexToRgba
4
+ } from "../chunk-D3L26TIT.mjs";
5
+
6
+ // resolve/theme.ts
7
+ function resolveThemeColor(theme, themeKey) {
8
+ const activeTheme = theme ?? DEFAULT_THEME;
9
+ return activeTheme.colors[themeKey];
10
+ }
11
+ function resolveThemeableColor(theme, value) {
12
+ if (!value) {
13
+ return hexToRgba(
14
+ resolveThemeColor(theme, "foreground").color,
15
+ resolveThemeColor(theme, "foreground").opacity
16
+ );
17
+ }
18
+ if (typeof value === "string") {
19
+ return hexToRgba(value, 100);
20
+ }
21
+ if ("useTheme" in value) {
22
+ if (value.useTheme) {
23
+ const resolved = resolveThemeColor(theme, value.themeKey);
24
+ return hexToRgba(resolved.color, resolved.opacity);
25
+ }
26
+ return hexToRgba(value.value.color, value.value.opacity);
27
+ }
28
+ if ("color" in value) {
29
+ return hexToRgba(value.color, value.opacity);
30
+ }
31
+ const defaultColor = resolveThemeColor(theme, "foreground");
32
+ return hexToRgba(defaultColor.color, defaultColor.opacity);
33
+ }
34
+
35
+ // resolve/entries.ts
36
+ function getEntryValue(entries, entryName, fieldKey) {
37
+ const entry = entries.find((e) => e.name === entryName);
38
+ if (!entry) return void 0;
39
+ return entry.content[fieldKey];
40
+ }
41
+ function resolveEntryValue(entries, value) {
42
+ if (!value) return void 0;
43
+ if (typeof value !== "object") {
44
+ return value;
45
+ }
46
+ if ("useEntry" in value) {
47
+ if (value.useEntry) {
48
+ const resolved = getEntryValue(entries, value.entryName, value.fieldKey);
49
+ return resolved ?? "";
50
+ }
51
+ return value.value;
52
+ }
53
+ return value;
54
+ }
55
+
56
+ // resolve/index.ts
57
+ function isThemeableColorValue(value) {
58
+ return typeof value === "object" && value !== null && "useTheme" in value;
59
+ }
60
+ function isColorValue(value) {
61
+ return typeof value === "object" && value !== null && "color" in value && "opacity" in value;
62
+ }
63
+ function resolveProp(theme, entries, value) {
64
+ if (value === void 0 || value === null) {
65
+ return value;
66
+ }
67
+ if (isThemeableColorValue(value)) {
68
+ return resolveThemeableColor(theme, value);
69
+ }
70
+ if (isColorValue(value)) {
71
+ return value;
72
+ }
73
+ if (typeof value === "object" && value !== null && "useEntry" in value) {
74
+ return resolveEntryValue(entries, value);
75
+ }
76
+ if (typeof value === "object") {
77
+ const resolved = {};
78
+ for (const [key, val] of Object.entries(value)) {
79
+ resolved[key] = resolveProp(theme, entries, val);
80
+ }
81
+ return resolved;
82
+ }
83
+ if (Array.isArray(value)) {
84
+ return value.map((item) => resolveProp(theme, entries, item));
85
+ }
86
+ return value;
87
+ }
88
+ function resolveComponentProps(theme, entries, component) {
89
+ const resolvedProps = {};
90
+ for (const [key, value] of Object.entries(component.props)) {
91
+ resolvedProps[key] = resolveProp(theme, entries, value);
92
+ }
93
+ return {
94
+ ...component,
95
+ props: resolvedProps
96
+ };
97
+ }
98
+ function resolveContent(theme, entries, content) {
99
+ return content.map(
100
+ (component) => resolveComponentProps(theme, entries, component)
101
+ );
102
+ }
103
+ function resolveZones(theme, entries, zones) {
104
+ const resolvedZones = {};
105
+ for (const [zoneKey, zoneContent] of Object.entries(zones)) {
106
+ resolvedZones[zoneKey] = resolveContent(theme, entries, zoneContent);
107
+ }
108
+ return resolvedZones;
109
+ }
110
+ function resolvePageData(data, options) {
111
+ const { theme, entries = [] } = options;
112
+ return {
113
+ ...data,
114
+ content: resolveContent(theme, entries, data.content),
115
+ zones: resolveZones(
116
+ theme,
117
+ entries,
118
+ data.zones
119
+ )
120
+ };
121
+ }
122
+ export {
123
+ resolvePageData
124
+ };