@frontlit/page-builder 0.1.0-alpha.1
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.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/alignment-dZDzN96G.d.ts +5 -0
- package/dist/blocks/index.d.ts +255 -0
- package/dist/blocks/index.js +6 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/builder/index.d.ts +240 -0
- package/dist/builder/index.js +8 -0
- package/dist/builder/index.js.map +1 -0
- package/dist/button-C3VrMJkr.d.ts +20 -0
- package/dist/chunk-7KIX4WAO.js +4229 -0
- package/dist/chunk-7KIX4WAO.js.map +1 -0
- package/dist/chunk-7W6Q4WA7.js +515 -0
- package/dist/chunk-7W6Q4WA7.js.map +1 -0
- package/dist/chunk-GTY75HW2.js +22 -0
- package/dist/chunk-GTY75HW2.js.map +1 -0
- package/dist/chunk-MO76KZY2.js +3580 -0
- package/dist/chunk-MO76KZY2.js.map +1 -0
- package/dist/chunk-RBJBODQP.js +2011 -0
- package/dist/chunk-RBJBODQP.js.map +1 -0
- package/dist/chunk-RUYOL7JZ.js +4 -0
- package/dist/chunk-RUYOL7JZ.js.map +1 -0
- package/dist/chunk-SSQWYMQR.js +393 -0
- package/dist/chunk-SSQWYMQR.js.map +1 -0
- package/dist/color-mode-DIEEt9WP.d.ts +3 -0
- package/dist/components/index.d.ts +36 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -0
- package/dist/data-slots.d.ts +25 -0
- package/dist/data-slots.js +3 -0
- package/dist/data-slots.js.map +1 -0
- package/dist/fonts/alegreya/alegreya-latin-variable.woff2 +0 -0
- package/dist/fonts/bebas-neue/bebas-neue-latin-400-normal.woff2 +0 -0
- package/dist/fonts/inter/inter-latin-variable.woff2 +0 -0
- package/dist/fonts/lato/lato-latin-100-normal.woff2 +0 -0
- package/dist/fonts/lato/lato-latin-300-normal.woff2 +0 -0
- package/dist/fonts/lato/lato-latin-400-normal.woff2 +0 -0
- package/dist/fonts/lato/lato-latin-700-normal.woff2 +0 -0
- package/dist/fonts/lato/lato-latin-900-normal.woff2 +0 -0
- package/dist/fonts/merriweather/merriweather-latin-variable.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-100-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-200-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-300-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-400-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-500-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-600-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-700-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-800-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-900-normal.woff2 +0 -0
- package/dist/fonts/montserrat/montserrat-latin-variable.woff2 +0 -0
- package/dist/fonts/mulish/mulish-latin-variable.woff2 +0 -0
- package/dist/fonts/noto-sans/noto-sans-latin-variable.woff2 +0 -0
- package/dist/fonts/nunito/nunito-latin-variable.woff2 +0 -0
- package/dist/fonts/open-sans/open-sans-latin-variable.woff2 +0 -0
- package/dist/fonts/oswald/oswald-latin-variable.woff2 +0 -0
- package/dist/fonts/playfair-display/playfair-display-latin-variable.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-100-normal.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-200-normal.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-300-normal.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-400-normal.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-500-normal.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-600-normal.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-700-normal.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-800-normal.woff2 +0 -0
- package/dist/fonts/poppins/poppins-latin-900-normal.woff2 +0 -0
- package/dist/fonts/pt-sans/pt-sans-latin-400-normal.woff2 +0 -0
- package/dist/fonts/pt-sans/pt-sans-latin-700-normal.woff2 +0 -0
- package/dist/fonts/quicksand/quicksand-latin-variable.woff2 +0 -0
- package/dist/fonts/raleway/raleway-latin-variable.woff2 +0 -0
- package/dist/fonts/roboto/roboto-latin-variable.woff2 +0 -0
- package/dist/fonts/roboto-slab/roboto-slab-latin-variable.woff2 +0 -0
- package/dist/fonts/rubik/rubik-latin-variable.woff2 +0 -0
- package/dist/fonts/source-sans-3/source-sans-3-latin-400-normal.woff2 +0 -0
- package/dist/fonts/source-sans-3/source-sans-3-latin-variable.woff2 +0 -0
- package/dist/fonts/source-serif-4/source-serif-4-latin-variable.woff2 +0 -0
- package/dist/fonts/work-sans/work-sans-latin-variable.woff2 +0 -0
- package/dist/image-D7GlnOio.d.ts +30 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/media-Njv378j7.d.ts +13 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +4 -0
- package/dist/models/index.js.map +1 -0
- package/dist/nav-link-BfxvQ1s6.d.ts +37 -0
- package/dist/page-DfVl_aHX.d.ts +26 -0
- package/dist/primitives/index.d.ts +140 -0
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/renderer/index.d.ts +81 -0
- package/dist/renderer/index.js +7 -0
- package/dist/renderer/index.js.map +1 -0
- package/dist/section-background-BgOCp5l3.d.ts +50 -0
- package/dist/styles.css +15322 -0
- package/dist/theme-style-39nxXQy0.d.ts +141 -0
- package/dist/theme.css +242 -0
- package/dist/widget--uEOpdq3.d.ts +105 -0
- package/package.json +142 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
type FontWeight = "font-thin" | "font-extralight" | "font-light" | "font-normal" | "font-medium" | "font-semibold" | "font-bold" | "font-extrabold" | "font-black";
|
|
2
|
+
type FontSize = "text-xs" | "text-sm" | "text-base" | "text-lg" | "text-xl" | "text-2xl" | "text-3xl" | "text-4xl" | "text-5xl" | "text-6xl" | "text-7xl" | "text-8xl" | "text-9xl";
|
|
3
|
+
type LineHeight = "leading-none" | "leading-tight" | "leading-snug" | "leading-normal" | "leading-relaxed" | "leading-loose";
|
|
4
|
+
type LetterSpacing = "tracking-tighter" | "tracking-tight" | "tracking-normal" | "tracking-wide" | "tracking-wider" | "tracking-widest";
|
|
5
|
+
type TextTransform = "uppercase" | "lowercase" | "capitalize" | "normal-case";
|
|
6
|
+
type TextDecoration = "underline" | "line-through" | "no-underline";
|
|
7
|
+
type TextOverflow = "truncate" | "text-ellipsis" | "text-clip";
|
|
8
|
+
type BorderRadius = "rounded-none" | "rounded-sm" | "rounded" | "rounded-md" | "rounded-lg" | "rounded-xl" | "rounded-2xl" | "rounded-3xl" | "rounded-full";
|
|
9
|
+
type Shadow = "shadow-2xs" | "shadow-xs" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl" | "shadow-2xl" | "shadow-none";
|
|
10
|
+
type Cursor = "cursor-not-allowed" | "cursor-default" | "cursor-pointer";
|
|
11
|
+
interface Typography {
|
|
12
|
+
fontFamily: string;
|
|
13
|
+
fontSize: FontSize;
|
|
14
|
+
fontWeight: FontWeight;
|
|
15
|
+
lineHeight?: LineHeight;
|
|
16
|
+
letterSpacing?: LetterSpacing;
|
|
17
|
+
textTransform?: TextTransform;
|
|
18
|
+
textDecoration?: TextDecoration;
|
|
19
|
+
textOverflow?: TextOverflow;
|
|
20
|
+
}
|
|
21
|
+
interface Border {
|
|
22
|
+
width?: "border" | "border-0" | "border-2" | "border-4" | "border-8";
|
|
23
|
+
radius?: BorderRadius;
|
|
24
|
+
style?: "border-solid" | "border-dashed" | "border-dotted" | "border-double" | "border-hidden" | "border-none";
|
|
25
|
+
}
|
|
26
|
+
interface Padding {
|
|
27
|
+
x?: "px-0" | "px-1" | "px-2" | "px-3" | "px-4" | "px-5" | "px-6" | "px-8" | "px-10" | "px-12" | "px-16" | "px-20" | "px-24" | "px-32" | "px-40" | "px-48" | "px-56" | "px-64";
|
|
28
|
+
y?: "py-0" | "py-1" | "py-2" | "py-3" | "py-4" | "py-5" | "py-6" | "py-8" | "py-10" | "py-12" | "py-16" | "py-20" | "py-24" | "py-32" | "py-40" | "py-48" | "py-56" | "py-64";
|
|
29
|
+
}
|
|
30
|
+
type CustomStyle = string;
|
|
31
|
+
interface DisabledStyle {
|
|
32
|
+
color?: string;
|
|
33
|
+
background?: string;
|
|
34
|
+
border?: string;
|
|
35
|
+
opacity?: "opacity-50" | "opacity-75" | "opacity-100";
|
|
36
|
+
cursor?: Cursor;
|
|
37
|
+
}
|
|
38
|
+
interface Colors {
|
|
39
|
+
background: string;
|
|
40
|
+
foreground: string;
|
|
41
|
+
card: string;
|
|
42
|
+
cardForeground: string;
|
|
43
|
+
popover: string;
|
|
44
|
+
popoverForeground: string;
|
|
45
|
+
primary: string;
|
|
46
|
+
primaryForeground: string;
|
|
47
|
+
secondary: string;
|
|
48
|
+
secondaryForeground: string;
|
|
49
|
+
muted: string;
|
|
50
|
+
mutedForeground: string;
|
|
51
|
+
accent: string;
|
|
52
|
+
accentForeground: string;
|
|
53
|
+
destructive: string;
|
|
54
|
+
border: string;
|
|
55
|
+
input: string;
|
|
56
|
+
ring: string;
|
|
57
|
+
chart1: string;
|
|
58
|
+
chart2: string;
|
|
59
|
+
chart3: string;
|
|
60
|
+
chart4: string;
|
|
61
|
+
chart5: string;
|
|
62
|
+
sidebar: string;
|
|
63
|
+
sidebarForeground: string;
|
|
64
|
+
sidebarPrimary: string;
|
|
65
|
+
sidebarPrimaryForeground: string;
|
|
66
|
+
sidebarAccent: string;
|
|
67
|
+
sidebarAccentForeground: string;
|
|
68
|
+
sidebarBorder: string;
|
|
69
|
+
sidebarRing: string;
|
|
70
|
+
shadow2xs: string;
|
|
71
|
+
shadowXs: string;
|
|
72
|
+
shadowSm: string;
|
|
73
|
+
shadowMd: string;
|
|
74
|
+
shadowLg: string;
|
|
75
|
+
shadowXl: string;
|
|
76
|
+
shadow2xl: string;
|
|
77
|
+
}
|
|
78
|
+
interface ThemeStyle {
|
|
79
|
+
colors: {
|
|
80
|
+
light: Colors;
|
|
81
|
+
dark: Colors;
|
|
82
|
+
};
|
|
83
|
+
typography: {
|
|
84
|
+
preheader: Typography;
|
|
85
|
+
header1: Typography;
|
|
86
|
+
header2: Typography;
|
|
87
|
+
header3: Typography;
|
|
88
|
+
header4: Typography;
|
|
89
|
+
subheader1: Typography;
|
|
90
|
+
subheader2: Typography;
|
|
91
|
+
text1: Typography;
|
|
92
|
+
text2: Typography;
|
|
93
|
+
link: Typography;
|
|
94
|
+
button: Typography;
|
|
95
|
+
input: Typography;
|
|
96
|
+
caption: Typography;
|
|
97
|
+
};
|
|
98
|
+
interactives: {
|
|
99
|
+
button: {
|
|
100
|
+
padding?: Padding;
|
|
101
|
+
border?: Border;
|
|
102
|
+
shadow?: Shadow;
|
|
103
|
+
custom?: CustomStyle;
|
|
104
|
+
disabled?: DisabledStyle;
|
|
105
|
+
};
|
|
106
|
+
link: {
|
|
107
|
+
padding?: Padding;
|
|
108
|
+
border?: Border;
|
|
109
|
+
textShadow?: string;
|
|
110
|
+
custom?: CustomStyle;
|
|
111
|
+
disabled?: DisabledStyle;
|
|
112
|
+
};
|
|
113
|
+
card: {
|
|
114
|
+
padding?: Padding;
|
|
115
|
+
border?: Border;
|
|
116
|
+
shadow?: Shadow;
|
|
117
|
+
custom?: CustomStyle;
|
|
118
|
+
};
|
|
119
|
+
input: {
|
|
120
|
+
borderRadius?: BorderRadius;
|
|
121
|
+
padding?: Padding;
|
|
122
|
+
border?: Border;
|
|
123
|
+
shadow?: Shadow;
|
|
124
|
+
custom?: CustomStyle;
|
|
125
|
+
disabled?: DisabledStyle;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
structure: {
|
|
129
|
+
page: {
|
|
130
|
+
width: "max-w-2xl" | "max-w-3xl" | "max-w-4xl" | "max-w-5xl" | "max-w-6xl";
|
|
131
|
+
};
|
|
132
|
+
section: {
|
|
133
|
+
padding: {
|
|
134
|
+
x: "px-0" | "px-4" | "px-6" | "px-8" | "px-10" | "px-12" | "px-16" | "px-20" | "px-24" | "px-32" | "px-40" | "px-48" | "px-56" | "px-64";
|
|
135
|
+
y: "py-0" | "py-4" | "py-6" | "py-8" | "py-10" | "py-12" | "py-16" | "py-20" | "py-24" | "py-32" | "py-40" | "py-48" | "py-56" | "py-64";
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export type { Border as B, Colors as C, DisabledStyle as D, Padding as P, Shadow as S, ThemeStyle as T, CustomStyle as a, Typography as b };
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Shared Tailwind v4 design tokens for the FrontLit page builder.
|
|
3
|
+
* Ported from CourseLit's tailwind-config package + web globals.
|
|
4
|
+
*
|
|
5
|
+
* Import this AFTER `@import "tailwindcss"` in any stylesheet that
|
|
6
|
+
* renders page-builder content (the package's own styles.css and the
|
|
7
|
+
* consuming app's globals.css).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
@custom-variant dark (&:is(.dark *));
|
|
11
|
+
|
|
12
|
+
/* Default (shadcn slate) tokens — the fallback for `.pb-theme`-scoped
|
|
13
|
+
* page-builder content before/without a runtime-generated theme (see
|
|
14
|
+
* generate-theme-styles.ts). Scoped so it doesn't leak into a consuming
|
|
15
|
+
* app's own chrome outside the page-builder-rendered subtree. */
|
|
16
|
+
.pb-theme {
|
|
17
|
+
--background: hsl(0 0% 100%);
|
|
18
|
+
--foreground: hsl(222.2 84% 4.9%);
|
|
19
|
+
--card: hsl(0 0% 100%);
|
|
20
|
+
--card-foreground: hsl(222.2 84% 4.9%);
|
|
21
|
+
--popover: hsl(0 0% 100%);
|
|
22
|
+
--popover-foreground: hsl(222.2 84% 4.9%);
|
|
23
|
+
--primary: hsl(222.2 47.4% 11.2%);
|
|
24
|
+
--primary-foreground: hsl(210 40% 98%);
|
|
25
|
+
--secondary: hsl(210 40% 96.1%);
|
|
26
|
+
--secondary-foreground: hsl(222.2 47.4% 11.2%);
|
|
27
|
+
--muted: hsl(210 40% 96.1%);
|
|
28
|
+
--muted-foreground: hsl(215.4 16.3% 46.9%);
|
|
29
|
+
--accent: hsl(210 40% 96.1%);
|
|
30
|
+
--accent-foreground: hsl(222.2 47.4% 11.2%);
|
|
31
|
+
--destructive: hsl(0 84.2% 60.2%);
|
|
32
|
+
--destructive-foreground: hsl(210 40% 98%);
|
|
33
|
+
--border: hsl(214.3 31.8% 91.4%);
|
|
34
|
+
--input: hsl(214.3 31.8% 91.4%);
|
|
35
|
+
--ring: hsl(222.2 84% 4.9%);
|
|
36
|
+
--chart-1: hsl(12 76% 61%);
|
|
37
|
+
--chart-2: hsl(173 58% 39%);
|
|
38
|
+
--chart-3: hsl(197 37% 24%);
|
|
39
|
+
--chart-4: hsl(43 74% 66%);
|
|
40
|
+
--chart-5: hsl(27 87% 67%);
|
|
41
|
+
--radius: 0.5rem;
|
|
42
|
+
--sidebar-background: hsl(0 0% 98%);
|
|
43
|
+
--sidebar-foreground: hsl(240 5.3% 26.1%);
|
|
44
|
+
--sidebar-primary: hsl(240 5.9% 10%);
|
|
45
|
+
--sidebar-primary-foreground: hsl(0 0% 98%);
|
|
46
|
+
--sidebar-accent: hsl(240 4.8% 95.9%);
|
|
47
|
+
--sidebar-accent-foreground: hsl(240 5.9% 10%);
|
|
48
|
+
--sidebar-border: hsl(220 13% 91%);
|
|
49
|
+
--sidebar-ring: hsl(217.2 91.2% 59.8%);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pb-theme:is(.dark, .dark *) {
|
|
53
|
+
--background: hsl(222.2 84% 4.9%);
|
|
54
|
+
--foreground: hsl(210 40% 98%);
|
|
55
|
+
--card: hsl(222.2 84% 4.9%);
|
|
56
|
+
--card-foreground: hsl(210 40% 98%);
|
|
57
|
+
--popover: hsl(222.2 84% 4.9%);
|
|
58
|
+
--popover-foreground: hsl(210 40% 98%);
|
|
59
|
+
--primary: hsl(210 40% 98%);
|
|
60
|
+
--primary-foreground: hsl(222.2 47.4% 11.2%);
|
|
61
|
+
--secondary: hsl(217.2 32.6% 17.5%);
|
|
62
|
+
--secondary-foreground: hsl(210 40% 98%);
|
|
63
|
+
--muted: hsl(217.2 32.6% 17.5%);
|
|
64
|
+
--muted-foreground: hsl(215 20.2% 65.1%);
|
|
65
|
+
--accent: hsl(217.2 32.6% 17.5%);
|
|
66
|
+
--accent-foreground: hsl(210 40% 98%);
|
|
67
|
+
--destructive: hsl(0 62.8% 30.6%);
|
|
68
|
+
--destructive-foreground: hsl(210 40% 98%);
|
|
69
|
+
--border: hsl(217.2 32.6% 17.5%);
|
|
70
|
+
--input: hsl(217.2 32.6% 17.5%);
|
|
71
|
+
--ring: hsl(212.7 26.8% 83.9%);
|
|
72
|
+
--chart-1: hsl(220 70% 50%);
|
|
73
|
+
--chart-2: hsl(160 60% 45%);
|
|
74
|
+
--chart-3: hsl(30 80% 55%);
|
|
75
|
+
--chart-4: hsl(280 65% 60%);
|
|
76
|
+
--chart-5: hsl(340 75% 55%);
|
|
77
|
+
--sidebar-background: hsl(240 5.9% 10%);
|
|
78
|
+
--sidebar-foreground: hsl(240 4.8% 95.9%);
|
|
79
|
+
--sidebar-primary: hsl(224.3 76.3% 48%);
|
|
80
|
+
--sidebar-primary-foreground: hsl(0 0% 100%);
|
|
81
|
+
--sidebar-accent: hsl(240 3.7% 15.9%);
|
|
82
|
+
--sidebar-accent-foreground: hsl(240 4.8% 95.9%);
|
|
83
|
+
--sidebar-border: hsl(240 3.7% 15.9%);
|
|
84
|
+
--sidebar-ring: hsl(217.2 91.2% 59.8%);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Semantic token mapping. Runtime theme variables contain complete CSS
|
|
88
|
+
* colors, which works consistently in both the public app and the dashboard. */
|
|
89
|
+
@theme inline {
|
|
90
|
+
--color-background: var(--background);
|
|
91
|
+
--color-foreground: var(--foreground);
|
|
92
|
+
--color-card: var(--card);
|
|
93
|
+
--color-card-foreground: var(--card-foreground);
|
|
94
|
+
--color-popover: var(--popover);
|
|
95
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
96
|
+
--color-primary: var(--primary);
|
|
97
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
98
|
+
--color-secondary: var(--secondary);
|
|
99
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
100
|
+
--color-muted: var(--muted);
|
|
101
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
102
|
+
--color-accent: var(--accent);
|
|
103
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
104
|
+
--color-destructive: var(--destructive);
|
|
105
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
106
|
+
--color-border: var(--border);
|
|
107
|
+
--color-input: var(--input);
|
|
108
|
+
--color-ring: var(--ring);
|
|
109
|
+
--color-chart-1: var(--chart-1);
|
|
110
|
+
--color-chart-2: var(--chart-2);
|
|
111
|
+
--color-chart-3: var(--chart-3);
|
|
112
|
+
--color-chart-4: var(--chart-4);
|
|
113
|
+
--color-chart-5: var(--chart-5);
|
|
114
|
+
--color-sidebar: var(--sidebar-background);
|
|
115
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
116
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
117
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
118
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
119
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
120
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
121
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
122
|
+
|
|
123
|
+
--radius-lg: var(--radius);
|
|
124
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
125
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
126
|
+
|
|
127
|
+
--shadow: var(--shadow);
|
|
128
|
+
--shadow-2xs: var(--shadow-2xs);
|
|
129
|
+
--shadow-xs: var(--shadow-xs);
|
|
130
|
+
--shadow-sm: var(--shadow-sm);
|
|
131
|
+
--shadow-md: var(--shadow-md);
|
|
132
|
+
--shadow-lg: var(--shadow-lg);
|
|
133
|
+
--shadow-xl: var(--shadow-xl);
|
|
134
|
+
--shadow-2xl: var(--shadow-2xl);
|
|
135
|
+
|
|
136
|
+
--font-open-sans:
|
|
137
|
+
var(--font-open-sans, "Open Sans"), ui-sans-serif, system-ui, sans-serif,
|
|
138
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
139
|
+
"Noto Color Emoji";
|
|
140
|
+
--font-montserrat:
|
|
141
|
+
var(--font-montserrat, Montserrat), ui-sans-serif, system-ui, sans-serif,
|
|
142
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
143
|
+
"Noto Color Emoji";
|
|
144
|
+
--font-lato:
|
|
145
|
+
var(--font-lato, Lato), ui-sans-serif, system-ui, sans-serif,
|
|
146
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
147
|
+
"Noto Color Emoji";
|
|
148
|
+
--font-poppins:
|
|
149
|
+
var(--font-poppins, Poppins), ui-sans-serif, system-ui, sans-serif,
|
|
150
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
151
|
+
"Noto Color Emoji";
|
|
152
|
+
--font-source-sans-3:
|
|
153
|
+
var(--font-source-sans-3, "Source Sans 3"), ui-sans-serif, system-ui,
|
|
154
|
+
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
155
|
+
"Noto Color Emoji";
|
|
156
|
+
--font-raleway:
|
|
157
|
+
var(--font-raleway, Raleway), ui-sans-serif, system-ui, sans-serif,
|
|
158
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
159
|
+
"Noto Color Emoji";
|
|
160
|
+
--font-noto-sans:
|
|
161
|
+
var(--font-noto-sans, "Noto Sans"), ui-sans-serif, system-ui, sans-serif,
|
|
162
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
163
|
+
"Noto Color Emoji";
|
|
164
|
+
--font-merriweather:
|
|
165
|
+
var(--font-merriweather, Merriweather), ui-serif, Georgia, Cambria,
|
|
166
|
+
"Times New Roman", Times, serif;
|
|
167
|
+
--font-inter:
|
|
168
|
+
var(--font-inter, Inter), ui-sans-serif, system-ui, sans-serif,
|
|
169
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
170
|
+
"Noto Color Emoji";
|
|
171
|
+
--font-alegreya:
|
|
172
|
+
var(--font-alegreya, Alegreya), ui-serif, Georgia, Cambria,
|
|
173
|
+
"Times New Roman", Times, serif;
|
|
174
|
+
--font-roboto:
|
|
175
|
+
var(--font-roboto, Roboto), ui-sans-serif, system-ui, sans-serif,
|
|
176
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
177
|
+
"Noto Color Emoji";
|
|
178
|
+
--font-mulish:
|
|
179
|
+
var(--font-mulish, Mulish), ui-sans-serif, system-ui, sans-serif,
|
|
180
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
181
|
+
"Noto Color Emoji";
|
|
182
|
+
--font-nunito:
|
|
183
|
+
var(--font-nunito, Nunito), ui-sans-serif, system-ui, sans-serif,
|
|
184
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
185
|
+
"Noto Color Emoji";
|
|
186
|
+
--font-rubik:
|
|
187
|
+
var(--font-rubik, Rubik), ui-sans-serif, system-ui, sans-serif,
|
|
188
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
189
|
+
"Noto Color Emoji";
|
|
190
|
+
--font-playfair-display:
|
|
191
|
+
var(--font-playfair-display, "Playfair Display"), ui-serif, Georgia,
|
|
192
|
+
Cambria, "Times New Roman", Times, serif;
|
|
193
|
+
--font-oswald:
|
|
194
|
+
var(--font-oswald, Oswald), ui-sans-serif, system-ui, sans-serif,
|
|
195
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
196
|
+
"Noto Color Emoji";
|
|
197
|
+
--font-pt-sans:
|
|
198
|
+
var(--font-pt-sans, "PT Sans"), ui-sans-serif, system-ui, sans-serif,
|
|
199
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
200
|
+
"Noto Color Emoji";
|
|
201
|
+
--font-work-sans:
|
|
202
|
+
var(--font-work-sans, "Work Sans"), ui-sans-serif, system-ui, sans-serif,
|
|
203
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
204
|
+
"Noto Color Emoji";
|
|
205
|
+
--font-roboto-slab:
|
|
206
|
+
var(--font-roboto-slab, "Roboto Slab"), ui-serif, Georgia, Cambria,
|
|
207
|
+
"Times New Roman", Times, serif;
|
|
208
|
+
--font-source-serif-4:
|
|
209
|
+
var(--font-source-serif-4, "Source Serif 4"), ui-serif, Georgia, Cambria,
|
|
210
|
+
"Times New Roman", Times, serif;
|
|
211
|
+
--font-bebas-neue:
|
|
212
|
+
var(--font-bebas-neue, "Bebas Neue"), ui-sans-serif, system-ui, sans-serif,
|
|
213
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
214
|
+
"Noto Color Emoji";
|
|
215
|
+
--font-quicksand:
|
|
216
|
+
var(--font-quicksand, Quicksand), ui-sans-serif, system-ui, sans-serif,
|
|
217
|
+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
|
|
218
|
+
"Noto Color Emoji";
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* Safelist for classes the theme system composes at runtime.
|
|
222
|
+
* Ported from CourseLit's tailwind.config.ts `safelist`. */
|
|
223
|
+
@source inline("{lg:,}text-{sm,base,lg,xl,2xl,3xl,4xl,5xl,6xl,7xl,8xl,9xl}");
|
|
224
|
+
@source inline("{p,px,py}-{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,24,32,40,48,56,64}");
|
|
225
|
+
@source inline("rounded-{none,sm,md,lg,xl,2xl,3xl,full}");
|
|
226
|
+
@source inline("{lg:,}max-w-{2xl,3xl,4xl,5xl,6xl}");
|
|
227
|
+
@source inline("{hover:,dark:,}shadow-{2xs,xs,sm,md,lg,xl,2xl,inner,none}");
|
|
228
|
+
@source inline("{hover:,disabled:,dark:,}bg-{slate,gray,zinc,neutral,stone,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{50,{100..900..100},950}");
|
|
229
|
+
@source inline("{hover:,disabled:,dark:,}text-{slate,gray,zinc,neutral,stone,red,orange,amber,yellow,lime,green,emerald,teal,cyan,sky,blue,indigo,violet,purple,fuchsia,pink,rose}-{50,{100..900..100},950}");
|
|
230
|
+
@source inline("bg-transparent");
|
|
231
|
+
@source inline("transparent");
|
|
232
|
+
@source inline("transition");
|
|
233
|
+
@source inline("transition-{all,colors,opacity,shadow,transform,none}");
|
|
234
|
+
@source inline("duration-{0,75,100,150,200,300,500,700,1000}");
|
|
235
|
+
@source inline("{hover:,}ease-{in,out,in-out,linear}");
|
|
236
|
+
@source inline("{hover:,}{,-}translate-{x,y}-{1,2,3,4,5,6,7,8,9,10}");
|
|
237
|
+
@source inline("{hover:,}scale-{0,50,75,90,95,100,105,110,125,150}");
|
|
238
|
+
@source inline("{hover:,}underline");
|
|
239
|
+
@source inline("{hover:,}border-{solid,dashed,dotted,double,none}");
|
|
240
|
+
@source inline("backdrop-blur-2xl");
|
|
241
|
+
@source inline("border-b");
|
|
242
|
+
@source inline("border-b-{0,2,4,8}");
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { S as SectionBackground, T as Theme } from './section-background-BgOCp5l3.js';
|
|
3
|
+
import { T as ThemeStyle } from './theme-style-39nxXQy0.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The kind of page a widget/block can be placed on. Kept intentionally
|
|
7
|
+
* generic (unlike CourseLit's LMS-specific page types) since FrontLit pages
|
|
8
|
+
* can be a marketing site, a blog post, a changelog entry, etc.
|
|
9
|
+
*/
|
|
10
|
+
type PageType = "site" | "blog" | "landing" | "post" | "custom";
|
|
11
|
+
interface WidgetMetadata {
|
|
12
|
+
name: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
compatibleWith: PageType[];
|
|
16
|
+
icon?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A single block placed on a page, as persisted in a page's layout.
|
|
20
|
+
*/
|
|
21
|
+
interface WidgetInstance {
|
|
22
|
+
widgetId: string;
|
|
23
|
+
name: string;
|
|
24
|
+
/** Whether the instance can be removed from its page. */
|
|
25
|
+
deletable: boolean;
|
|
26
|
+
/** Whether the instance can be repositioned within its page. */
|
|
27
|
+
moveable: boolean;
|
|
28
|
+
shared: boolean;
|
|
29
|
+
settings?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* One of the alternate visual arrangements a block can render its data in.
|
|
33
|
+
* Declared per block via `Widget.layouts`; the user's pick is stored in the
|
|
34
|
+
* instance's `settings.layout` and chosen from the panel's Design tab.
|
|
35
|
+
*/
|
|
36
|
+
interface BlockLayout {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Settings shared by every block, mirroring the common layout controls
|
|
42
|
+
* (max width / vertical padding / background) that CourseLit's theme system
|
|
43
|
+
* exposes to each section.
|
|
44
|
+
*/
|
|
45
|
+
interface WidgetDefaultSettings {
|
|
46
|
+
cssId?: string;
|
|
47
|
+
verticalPadding?: ThemeStyle["structure"]["section"]["padding"]["y"];
|
|
48
|
+
maxWidth?: ThemeStyle["structure"]["page"]["width"];
|
|
49
|
+
background?: SectionBackground;
|
|
50
|
+
/** Selected layout id from the block's `layouts`; first layout when unset. */
|
|
51
|
+
layout?: string;
|
|
52
|
+
}
|
|
53
|
+
interface PageData extends Record<string, unknown> {
|
|
54
|
+
pageType: PageType;
|
|
55
|
+
/** Tenant branding supplied by the host application. Layout blocks use
|
|
56
|
+
* this on published sites, while the builder can continue to use its
|
|
57
|
+
* own local block settings. */
|
|
58
|
+
siteLogoUrl?: string;
|
|
59
|
+
siteLogoAlt?: string;
|
|
60
|
+
/** The page's team (public id) and slug, plus the base URL of FrontLit's
|
|
61
|
+
* public API — threaded through so blocks that make unauthenticated
|
|
62
|
+
* public calls (e.g. the email-form block's lead capture, architecture.md
|
|
63
|
+
* §10.2) know where to send them. Left unset in contexts with no live
|
|
64
|
+
* backend (e.g. a bare component-library preview), in which case those
|
|
65
|
+
* blocks degrade to a local-only success state. */
|
|
66
|
+
teamId?: string;
|
|
67
|
+
pageSlug?: string;
|
|
68
|
+
publicApiBaseUrl?: string;
|
|
69
|
+
}
|
|
70
|
+
interface WidgetProps<T extends WidgetDefaultSettings = WidgetDefaultSettings> {
|
|
71
|
+
settings: T;
|
|
72
|
+
state: {
|
|
73
|
+
theme: Theme;
|
|
74
|
+
};
|
|
75
|
+
pageData: PageData;
|
|
76
|
+
/** Host-resolved data rendered by a generic `data-slot` block. */
|
|
77
|
+
data?: ReactNode;
|
|
78
|
+
editing?: boolean;
|
|
79
|
+
/** Resolved palette currently painted (`system` is already applied). */
|
|
80
|
+
nextTheme?: "light" | "dark";
|
|
81
|
+
/** Visitor or preview preference, including follow-the-OS. */
|
|
82
|
+
themeMode?: "light" | "dark" | "system";
|
|
83
|
+
setThemeMode?: (mode: "light" | "dark" | "system") => void;
|
|
84
|
+
/** Flips the resolved palette. Used by compact header controls. */
|
|
85
|
+
toggleTheme?: () => void;
|
|
86
|
+
}
|
|
87
|
+
interface WidgetEditorProps<T extends WidgetDefaultSettings = WidgetDefaultSettings> {
|
|
88
|
+
settings: T;
|
|
89
|
+
theme: Theme;
|
|
90
|
+
onChange: (settings: T) => void;
|
|
91
|
+
}
|
|
92
|
+
interface Widget<T extends WidgetDefaultSettings = WidgetDefaultSettings> {
|
|
93
|
+
metadata: WidgetMetadata;
|
|
94
|
+
widget: ComponentType<WidgetProps<T>>;
|
|
95
|
+
editor?: ComponentType<WidgetEditorProps<T>>;
|
|
96
|
+
getDefaultSettings?: () => Partial<T>;
|
|
97
|
+
/**
|
|
98
|
+
* Alternate layouts this block can render its data in, selectable from
|
|
99
|
+
* the Design tab. The widget reads `settings.layout` while rendering
|
|
100
|
+
* and should treat the first entry as the default.
|
|
101
|
+
*/
|
|
102
|
+
layouts?: BlockLayout[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export type { BlockLayout as B, PageData as P, Widget as W, PageType as a, WidgetDefaultSettings as b, WidgetEditorProps as c, WidgetInstance as d, WidgetMetadata as e, WidgetProps as f };
|
package/package.json
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@frontlit/page-builder",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "Block-based WYSIWYG page builder and renderer for React",
|
|
5
|
+
"author": "FrontLit",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./models": {
|
|
23
|
+
"types": "./dist/models/index.d.ts",
|
|
24
|
+
"import": "./dist/models/index.js",
|
|
25
|
+
"default": "./dist/models/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./primitives": {
|
|
28
|
+
"types": "./dist/primitives/index.d.ts",
|
|
29
|
+
"import": "./dist/primitives/index.js",
|
|
30
|
+
"default": "./dist/primitives/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./components": {
|
|
33
|
+
"types": "./dist/components/index.d.ts",
|
|
34
|
+
"import": "./dist/components/index.js",
|
|
35
|
+
"default": "./dist/components/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./blocks": {
|
|
38
|
+
"types": "./dist/blocks/index.d.ts",
|
|
39
|
+
"import": "./dist/blocks/index.js",
|
|
40
|
+
"default": "./dist/blocks/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./renderer": {
|
|
43
|
+
"types": "./dist/renderer/index.d.ts",
|
|
44
|
+
"import": "./dist/renderer/index.js",
|
|
45
|
+
"default": "./dist/renderer/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./builder": {
|
|
48
|
+
"types": "./dist/builder/index.d.ts",
|
|
49
|
+
"import": "./dist/builder/index.js",
|
|
50
|
+
"default": "./dist/builder/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./data-slots": {
|
|
53
|
+
"types": "./dist/data-slots.d.ts",
|
|
54
|
+
"import": "./dist/data-slots.js",
|
|
55
|
+
"default": "./dist/data-slots.js"
|
|
56
|
+
},
|
|
57
|
+
"./styles.css": "./dist/styles.css",
|
|
58
|
+
"./theme.css": "./dist/theme.css"
|
|
59
|
+
},
|
|
60
|
+
"typesVersions": {
|
|
61
|
+
"*": {
|
|
62
|
+
"models": [
|
|
63
|
+
"dist/models/index.d.ts"
|
|
64
|
+
],
|
|
65
|
+
"primitives": [
|
|
66
|
+
"dist/primitives/index.d.ts"
|
|
67
|
+
],
|
|
68
|
+
"components": [
|
|
69
|
+
"dist/components/index.d.ts"
|
|
70
|
+
],
|
|
71
|
+
"blocks": [
|
|
72
|
+
"dist/blocks/index.d.ts"
|
|
73
|
+
],
|
|
74
|
+
"renderer": [
|
|
75
|
+
"dist/renderer/index.d.ts"
|
|
76
|
+
],
|
|
77
|
+
"builder": [
|
|
78
|
+
"dist/builder/index.d.ts"
|
|
79
|
+
],
|
|
80
|
+
"data-slots": [
|
|
81
|
+
"dist/data-slots.d.ts"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"sideEffects": [
|
|
86
|
+
"**/*.css"
|
|
87
|
+
],
|
|
88
|
+
"publishConfig": {
|
|
89
|
+
"access": "public"
|
|
90
|
+
},
|
|
91
|
+
"repository": {
|
|
92
|
+
"type": "git",
|
|
93
|
+
"url": "git+https://github.com/codelitdev/frontlit.git",
|
|
94
|
+
"directory": "packages/page-builder"
|
|
95
|
+
},
|
|
96
|
+
"homepage": "https://github.com/codelitdev/frontlit/tree/main/packages/page-builder",
|
|
97
|
+
"bugs": {
|
|
98
|
+
"url": "https://github.com/codelitdev/frontlit/issues"
|
|
99
|
+
},
|
|
100
|
+
"keywords": [
|
|
101
|
+
"react",
|
|
102
|
+
"page-builder",
|
|
103
|
+
"wysiwyg",
|
|
104
|
+
"blocks",
|
|
105
|
+
"landing-page",
|
|
106
|
+
"frontlit"
|
|
107
|
+
],
|
|
108
|
+
"peerDependencies": {
|
|
109
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
110
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
111
|
+
},
|
|
112
|
+
"dependencies": {
|
|
113
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
114
|
+
"@radix-ui/react-label": "^2.1.8",
|
|
115
|
+
"@radix-ui/react-slot": "^1.2.4",
|
|
116
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
117
|
+
"class-variance-authority": "^0.7.1",
|
|
118
|
+
"clsx": "^2.1.1",
|
|
119
|
+
"color-convert": "^3.1.0",
|
|
120
|
+
"lucide-react": "^0.553.0",
|
|
121
|
+
"tailwind-merge": "^3.4.0",
|
|
122
|
+
"tw-animate-css": "^1.4.0",
|
|
123
|
+
"@frontlit/text-editor": "0.1.0-alpha.1"
|
|
124
|
+
},
|
|
125
|
+
"devDependencies": {
|
|
126
|
+
"@types/color-convert": "^2.0.4",
|
|
127
|
+
"@types/node": "^20.0.0",
|
|
128
|
+
"@types/react": "^19.0.0",
|
|
129
|
+
"@types/react-dom": "^19.0.0",
|
|
130
|
+
"@tailwindcss/cli": "^4.1.0",
|
|
131
|
+
"rimraf": "^5.0.0",
|
|
132
|
+
"tailwindcss": "^4.1.0",
|
|
133
|
+
"tsup": "^8.3.0",
|
|
134
|
+
"typescript": "^5.6.2"
|
|
135
|
+
},
|
|
136
|
+
"scripts": {
|
|
137
|
+
"build": "tsup && node scripts/add-use-client.mjs && tailwindcss -i src/styles.css -o dist/styles.css && cp src/theme.css dist/theme.css && rm -rf dist/fonts && cp -a fonts dist/fonts && node scripts/rewrite-font-urls.mjs",
|
|
138
|
+
"dev": "tsup --watch",
|
|
139
|
+
"clean": "rimraf dist",
|
|
140
|
+
"check-types": "tsc --noEmit"
|
|
141
|
+
}
|
|
142
|
+
}
|