@frontlit/page-builder 0.1.0-alpha.3 → 0.1.0-alpha.5
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/dist/blocks/index.d.ts +17 -2
- package/dist/blocks/index.js +1 -1
- package/dist/builder/index.d.ts +4 -1
- package/dist/builder/index.js +3 -3
- package/dist/{chunk-K4WCLHMS.js → chunk-5J6TLS5U.js} +316 -65
- package/dist/chunk-5J6TLS5U.js.map +1 -0
- package/dist/{chunk-GIKTOAQS.js → chunk-LMCEOWQG.js} +7 -7
- package/dist/chunk-LMCEOWQG.js.map +1 -0
- package/dist/{chunk-IU4KATI2.js → chunk-USPQ3AOW.js} +3 -3
- package/dist/{chunk-IU4KATI2.js.map → chunk-USPQ3AOW.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/renderer/index.js +2 -2
- package/dist/server/index.js +145 -50
- package/dist/server/index.js.map +1 -1
- package/dist/server/islands/header-github-stars.d.ts +12 -0
- package/dist/server/islands/header-github-stars.js +31 -0
- package/dist/server/islands/header-github-stars.js.map +1 -0
- package/dist/server/islands/pricing-period-switch.d.ts +20 -0
- package/dist/server/islands/pricing-period-switch.js +151 -0
- package/dist/server/islands/pricing-period-switch.js.map +1 -0
- package/dist/server/islands/theme-mode-switcher.d.ts +1 -1
- package/dist/server/schema.d.ts +38 -0
- package/dist/server/schema.js +17 -2
- package/dist/server/schema.js.map +1 -1
- package/dist/styles.css +12 -0
- package/package.json +3 -4
- package/schema/page.v1.json +29 -1
- package/schema/site.v1.json +8 -0
- package/dist/chunk-GIKTOAQS.js.map +0 -1
- package/dist/chunk-K4WCLHMS.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { NavLink, VideoWithPreview, Image, TextRenderer, InlineEmbed } from './chunk-36QHCIPM.js';
|
|
3
|
-
import { Button2, Section, cn, Preheader, Display, Subheader1, CodeSnippet, Caption, PageCard, PageCardContent, Header2, Header1, Header4, Text2, Badge, PageCardHeader, Text1, Link, Header3, Drawer,
|
|
3
|
+
import { Button2, Section, cn, Preheader, Display, Subheader1, CodeSnippet, Caption, PageCard, PageCardContent, Header2, Header1, Header4, Text2, Badge, PageCardHeader, Text1, Link, Header3, Drawer, Label, Switch2, Input } from './chunk-J7Z4UW45.js';
|
|
4
4
|
import { getMediaUrl, getMediaAlt } from './chunk-XU7ALPGQ.js';
|
|
5
5
|
import clsx3 from 'clsx';
|
|
6
|
-
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import React2, { useId, useState, useRef, useEffect } from 'react';
|
|
8
6
|
import * as Icons from 'lucide-react';
|
|
9
|
-
import { Code2, LockKeyhole, ChevronDown, MenuIcon, Plus, ImageIcon } from 'lucide-react';
|
|
7
|
+
import { Github, Code2, LockKeyhole, ChevronDown, MenuIcon, Plus, ImageIcon } from 'lucide-react';
|
|
8
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
import React2, { useId, useState, useEffect, useRef } from 'react';
|
|
10
10
|
import { ImageUploadDialog } from '@frontlit/media-uploader';
|
|
11
11
|
import { Editor, emptyDoc } from '@frontlit/text-editor';
|
|
12
12
|
|
|
@@ -15,7 +15,8 @@ var headerMetadata = {
|
|
|
15
15
|
name: "header",
|
|
16
16
|
displayName: "Header",
|
|
17
17
|
description: "The site navigation bar, pinned to the top of every page.",
|
|
18
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
18
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
19
|
+
icon: "PanelTop"
|
|
19
20
|
};
|
|
20
21
|
function HeaderLink({
|
|
21
22
|
link,
|
|
@@ -70,6 +71,29 @@ function HeaderMobileMenu({
|
|
|
70
71
|
}
|
|
71
72
|
);
|
|
72
73
|
}
|
|
74
|
+
|
|
75
|
+
// src/blocks/header/github.ts
|
|
76
|
+
function parseGithubRepo(value) {
|
|
77
|
+
const match = value?.trim().match(/^(?:https?:\/\/(?:www\.)?github\.com\/)?([\w.-]+\/[\w.-]+?)(?:\.git)?\/?$/);
|
|
78
|
+
return match?.[1];
|
|
79
|
+
}
|
|
80
|
+
function formatStars(count) {
|
|
81
|
+
return new Intl.NumberFormat("en", {
|
|
82
|
+
notation: "compact",
|
|
83
|
+
maximumFractionDigits: 1
|
|
84
|
+
}).format(count).toLowerCase();
|
|
85
|
+
}
|
|
86
|
+
function GithubStars({ repo }) {
|
|
87
|
+
const [stars, setStars] = useState();
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
const controller = new AbortController();
|
|
90
|
+
fetch(`https://api.github.com/repos/${repo}`, { signal: controller.signal }).then((response) => response.ok ? response.json() : void 0).then((data) => setStars(data?.stargazers_count)).catch(() => {
|
|
91
|
+
});
|
|
92
|
+
return () => controller.abort();
|
|
93
|
+
}, [repo]);
|
|
94
|
+
if (!stars) return null;
|
|
95
|
+
return /* @__PURE__ */ jsx("span", { children: formatStars(stars) });
|
|
96
|
+
}
|
|
73
97
|
function HeaderWidget({
|
|
74
98
|
settings: {
|
|
75
99
|
logoCorners,
|
|
@@ -79,6 +103,8 @@ function HeaderWidget({
|
|
|
79
103
|
linkAlignment = "left",
|
|
80
104
|
layout = "fixed",
|
|
81
105
|
backdropBlur = false,
|
|
106
|
+
githubRepo,
|
|
107
|
+
showGithubStars,
|
|
82
108
|
cssId,
|
|
83
109
|
maxWidth,
|
|
84
110
|
verticalPadding,
|
|
@@ -99,6 +125,8 @@ function HeaderWidget({
|
|
|
99
125
|
const resolvedLogoText = pageData.siteTitle;
|
|
100
126
|
const resolvedLogoAlt = pageData.siteLogoAlt || resolvedLogoText || "";
|
|
101
127
|
const effectiveLogoCorners = logoCorners ?? 2;
|
|
128
|
+
const hasCta = Boolean(ctaLabel && ctaHref);
|
|
129
|
+
const repo = parseGithubRepo(githubRepo);
|
|
102
130
|
const logo = /* @__PURE__ */ jsx(NavLink, { href: "/", className: "no-underline", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
103
131
|
resolvedLogoImage && /* @__PURE__ */ jsx(
|
|
104
132
|
Image,
|
|
@@ -115,9 +143,22 @@ function HeaderWidget({
|
|
|
115
143
|
resolvedLogoText && /* @__PURE__ */ jsx(Header4, { theme: overriddenTheme, as: "span", children: resolvedLogoText })
|
|
116
144
|
] }) });
|
|
117
145
|
const ctaAndMenu = /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
146
|
+
repo && /* @__PURE__ */ jsx(
|
|
147
|
+
"a",
|
|
148
|
+
{
|
|
149
|
+
href: `https://github.com/${repo}`,
|
|
150
|
+
target: "_blank",
|
|
151
|
+
rel: "noopener noreferrer",
|
|
152
|
+
children: /* @__PURE__ */ jsxs(Button2, { theme: overriddenTheme, variant: "ghost", size: "sm", className: "gap-1.5", children: [
|
|
153
|
+
/* @__PURE__ */ jsx(Github, { className: "h-4 w-4", "aria-hidden": true }),
|
|
154
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "GitHub repository" }),
|
|
155
|
+
showGithubStars && /* @__PURE__ */ jsx(GithubStars, { repo })
|
|
156
|
+
] })
|
|
157
|
+
}
|
|
158
|
+
),
|
|
118
159
|
buttonLinks.map((link) => /* @__PURE__ */ jsx("div", { className: "hidden lg:!block", children: /* @__PURE__ */ jsx(HeaderLink, { link, theme: overriddenTheme }) }, link.id)),
|
|
119
|
-
|
|
120
|
-
/* @__PURE__ */ jsx("div", { className: "lg:hidden", children: /* @__PURE__ */ jsx(
|
|
160
|
+
hasCta && /* @__PURE__ */ jsx("div", { className: "hidden lg:!block", children: /* @__PURE__ */ jsx(NavLink, { href: ctaHref, children: /* @__PURE__ */ jsx(Button2, { theme: overriddenTheme, size: "sm", children: ctaLabel }) }) }),
|
|
161
|
+
(links.length > 0 || hasCta) && /* @__PURE__ */ jsx("div", { className: "lg:hidden", children: /* @__PURE__ */ jsx(
|
|
121
162
|
HeaderMobileMenu,
|
|
122
163
|
{
|
|
123
164
|
links,
|
|
@@ -701,6 +742,26 @@ function HeaderEditor({
|
|
|
701
742
|
}
|
|
702
743
|
)
|
|
703
744
|
] }),
|
|
745
|
+
/* @__PURE__ */ jsxs(FieldGroup, { title: "GitHub", children: [
|
|
746
|
+
/* @__PURE__ */ jsx(
|
|
747
|
+
TextField,
|
|
748
|
+
{
|
|
749
|
+
label: "Repository",
|
|
750
|
+
value: settings.githubRepo,
|
|
751
|
+
placeholder: "owner/repo",
|
|
752
|
+
hint: "Shows a GitHub icon linking to the repository.",
|
|
753
|
+
onChange: (githubRepo) => update({ githubRepo })
|
|
754
|
+
}
|
|
755
|
+
),
|
|
756
|
+
settings.githubRepo && /* @__PURE__ */ jsx(
|
|
757
|
+
ToggleField,
|
|
758
|
+
{
|
|
759
|
+
label: "Show star count",
|
|
760
|
+
value: settings.showGithubStars,
|
|
761
|
+
onChange: (showGithubStars) => update({ showGithubStars })
|
|
762
|
+
}
|
|
763
|
+
)
|
|
764
|
+
] }),
|
|
704
765
|
/* @__PURE__ */ jsxs(FieldGroup, { title: "Layout", children: [
|
|
705
766
|
/* @__PURE__ */ jsx(
|
|
706
767
|
SelectField,
|
|
@@ -786,7 +847,8 @@ var heroMetadata = {
|
|
|
786
847
|
name: "hero",
|
|
787
848
|
displayName: "Hero",
|
|
788
849
|
description: "A large introductory section with a title, copy and CTAs.",
|
|
789
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
850
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
851
|
+
icon: "Sparkles"
|
|
790
852
|
};
|
|
791
853
|
function titleProps({
|
|
792
854
|
titleLevel,
|
|
@@ -1114,7 +1176,8 @@ var contentMetadata = {
|
|
|
1114
1176
|
name: "content",
|
|
1115
1177
|
displayName: "Content",
|
|
1116
1178
|
description: "A rich-text section with an optional image, for things like an about-us or feature explainer.",
|
|
1117
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
1179
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
1180
|
+
icon: "Newspaper"
|
|
1118
1181
|
};
|
|
1119
1182
|
var roundedMap2 = {
|
|
1120
1183
|
0: "rounded-none",
|
|
@@ -1337,7 +1400,8 @@ var featuredMetadata = {
|
|
|
1337
1400
|
name: "featured",
|
|
1338
1401
|
displayName: "Feature grid",
|
|
1339
1402
|
description: "A grid of feature highlights, each with an icon, title and description.",
|
|
1340
|
-
compatibleWith: ["site", "landing", "custom"]
|
|
1403
|
+
compatibleWith: ["site", "landing", "custom"],
|
|
1404
|
+
icon: "LayoutGrid"
|
|
1341
1405
|
};
|
|
1342
1406
|
function resolveIcon(name) {
|
|
1343
1407
|
if (!name) return Icons.Sparkles;
|
|
@@ -1576,7 +1640,8 @@ var faqMetadata = {
|
|
|
1576
1640
|
name: "faq",
|
|
1577
1641
|
displayName: "FAQs",
|
|
1578
1642
|
description: "A list of frequently asked questions, rendered as an accordion.",
|
|
1579
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
1643
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
1644
|
+
icon: "CircleHelp"
|
|
1580
1645
|
};
|
|
1581
1646
|
function FaqWidget({
|
|
1582
1647
|
settings: {
|
|
@@ -1766,8 +1831,64 @@ var pricingMetadata = {
|
|
|
1766
1831
|
name: "pricing",
|
|
1767
1832
|
displayName: "Pricing",
|
|
1768
1833
|
description: "A grid of pricing tiers with features and calls to action.",
|
|
1769
|
-
compatibleWith: ["site", "landing", "custom"]
|
|
1834
|
+
compatibleWith: ["site", "landing", "custom"],
|
|
1835
|
+
icon: "BadgeDollarSign"
|
|
1770
1836
|
};
|
|
1837
|
+
function PricingPeriodSwitch({
|
|
1838
|
+
defaultPeriod,
|
|
1839
|
+
monthlyCaption,
|
|
1840
|
+
yearlyCaption,
|
|
1841
|
+
theme,
|
|
1842
|
+
children
|
|
1843
|
+
}) {
|
|
1844
|
+
const [period, setPeriod] = useState(defaultPeriod);
|
|
1845
|
+
const id = useId();
|
|
1846
|
+
const monthlyId = `${id}-monthly`;
|
|
1847
|
+
const yearlyId = `${id}-yearly`;
|
|
1848
|
+
return /* @__PURE__ */ jsxs("div", { "data-period": period, className: "group/pricing flex flex-col gap-8", children: [
|
|
1849
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-3", children: [
|
|
1850
|
+
/* @__PURE__ */ jsx(
|
|
1851
|
+
Label,
|
|
1852
|
+
{
|
|
1853
|
+
id: monthlyId,
|
|
1854
|
+
theme,
|
|
1855
|
+
className: "cursor-pointer",
|
|
1856
|
+
onClick: () => setPeriod("monthly"),
|
|
1857
|
+
children: monthlyCaption
|
|
1858
|
+
}
|
|
1859
|
+
),
|
|
1860
|
+
/* @__PURE__ */ jsx(
|
|
1861
|
+
Switch2,
|
|
1862
|
+
{
|
|
1863
|
+
theme,
|
|
1864
|
+
checked: period === "yearly",
|
|
1865
|
+
onCheckedChange: (checked) => setPeriod(checked ? "yearly" : "monthly"),
|
|
1866
|
+
"aria-labelledby": yearlyId,
|
|
1867
|
+
"aria-describedby": monthlyId
|
|
1868
|
+
}
|
|
1869
|
+
),
|
|
1870
|
+
/* @__PURE__ */ jsx(
|
|
1871
|
+
Label,
|
|
1872
|
+
{
|
|
1873
|
+
id: yearlyId,
|
|
1874
|
+
theme,
|
|
1875
|
+
className: "cursor-pointer",
|
|
1876
|
+
onClick: () => setPeriod("yearly"),
|
|
1877
|
+
children: yearlyCaption
|
|
1878
|
+
}
|
|
1879
|
+
)
|
|
1880
|
+
] }),
|
|
1881
|
+
children
|
|
1882
|
+
] });
|
|
1883
|
+
}
|
|
1884
|
+
var lgColumns = {
|
|
1885
|
+
1: "lg:grid-cols-1",
|
|
1886
|
+
2: "lg:grid-cols-2",
|
|
1887
|
+
3: "lg:grid-cols-3",
|
|
1888
|
+
4: "lg:grid-cols-4"
|
|
1889
|
+
};
|
|
1890
|
+
var monthlyOnly = "group-data-[period=yearly]/pricing:hidden";
|
|
1891
|
+
var yearlyOnly = "hidden group-data-[period=yearly]/pricing:block";
|
|
1771
1892
|
function PricingWidget({
|
|
1772
1893
|
settings: {
|
|
1773
1894
|
title,
|
|
@@ -1777,6 +1898,10 @@ function PricingWidget({
|
|
|
1777
1898
|
headerAlignment = "center",
|
|
1778
1899
|
tiers,
|
|
1779
1900
|
layout = "grid",
|
|
1901
|
+
pricingSwitcher,
|
|
1902
|
+
monthlyPriceCaption,
|
|
1903
|
+
yearlyPriceCaption,
|
|
1904
|
+
defaultPeriod = "yearly",
|
|
1780
1905
|
cssId,
|
|
1781
1906
|
maxWidth,
|
|
1782
1907
|
verticalPadding,
|
|
@@ -1787,6 +1912,76 @@ function PricingWidget({
|
|
|
1787
1912
|
const overriddenTheme = JSON.parse(JSON.stringify(theme.theme));
|
|
1788
1913
|
overriddenTheme.structure.page.width = maxWidth || theme.theme.structure.page.width;
|
|
1789
1914
|
overriddenTheme.structure.section.padding.y = verticalPadding || theme.theme.structure.section.padding.y;
|
|
1915
|
+
const plans = tiers && tiers.length > 0 && /* @__PURE__ */ jsx(
|
|
1916
|
+
"div",
|
|
1917
|
+
{
|
|
1918
|
+
className: clsx3(
|
|
1919
|
+
layout === "stacked" ? "mx-auto flex w-full max-w-xl flex-col gap-6" : [
|
|
1920
|
+
"grid grid-cols-1 gap-6 items-stretch",
|
|
1921
|
+
tiers.length === 1 && "mx-auto w-full max-w-xl",
|
|
1922
|
+
tiers.length >= 2 && "md:grid-cols-2",
|
|
1923
|
+
lgColumns[Math.min(tiers.length, 4)]
|
|
1924
|
+
]
|
|
1925
|
+
),
|
|
1926
|
+
children: tiers.map((tier, index) => /* @__PURE__ */ jsx(
|
|
1927
|
+
PageCard,
|
|
1928
|
+
{
|
|
1929
|
+
theme: overriddenTheme,
|
|
1930
|
+
className: clsx3(
|
|
1931
|
+
tier.highlighted && "ring-2 ring-primary",
|
|
1932
|
+
layout === "highlight" && tier.highlighted && "relative z-10 shadow-xl md:-translate-y-3"
|
|
1933
|
+
),
|
|
1934
|
+
children: /* @__PURE__ */ jsxs(
|
|
1935
|
+
PageCardContent,
|
|
1936
|
+
{
|
|
1937
|
+
theme: overriddenTheme,
|
|
1938
|
+
className: "h-full flex flex-col gap-4",
|
|
1939
|
+
children: [
|
|
1940
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1941
|
+
/* @__PURE__ */ jsx(Preheader, { theme: overriddenTheme, children: tier.name }),
|
|
1942
|
+
tier.highlighted && /* @__PURE__ */ jsx(Badge, { theme: overriddenTheme, children: "Most popular" })
|
|
1943
|
+
] }),
|
|
1944
|
+
/* @__PURE__ */ jsx(PageCardHeader, { theme: overriddenTheme, children: pricingSwitcher ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1945
|
+
/* @__PURE__ */ jsx("span", { className: monthlyOnly, children: tier.price }),
|
|
1946
|
+
/* @__PURE__ */ jsx("span", { className: yearlyOnly, children: tier.priceYearly || tier.price })
|
|
1947
|
+
] }) : tier.price }),
|
|
1948
|
+
tier.description && /* @__PURE__ */ jsx(Text1, { theme: overriddenTheme, children: tier.description }),
|
|
1949
|
+
tier.features && tier.features.length > 0 && /* @__PURE__ */ jsx("div", { className: "grow flex flex-col gap-2", children: tier.features.map((feature, i) => /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, children: feature }, i)) }),
|
|
1950
|
+
pricingSwitcher && tier.buttonActionYearly && tier.buttonActionYearly !== tier.buttonAction ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1951
|
+
/* @__PURE__ */ jsx(
|
|
1952
|
+
TierButton,
|
|
1953
|
+
{
|
|
1954
|
+
tier,
|
|
1955
|
+
href: tier.buttonAction,
|
|
1956
|
+
className: monthlyOnly,
|
|
1957
|
+
theme: overriddenTheme
|
|
1958
|
+
}
|
|
1959
|
+
),
|
|
1960
|
+
/* @__PURE__ */ jsx(
|
|
1961
|
+
TierButton,
|
|
1962
|
+
{
|
|
1963
|
+
tier,
|
|
1964
|
+
href: tier.buttonActionYearly,
|
|
1965
|
+
className: yearlyOnly,
|
|
1966
|
+
theme: overriddenTheme
|
|
1967
|
+
}
|
|
1968
|
+
)
|
|
1969
|
+
] }) : /* @__PURE__ */ jsx(
|
|
1970
|
+
TierButton,
|
|
1971
|
+
{
|
|
1972
|
+
tier,
|
|
1973
|
+
href: tier.buttonAction,
|
|
1974
|
+
theme: overriddenTheme
|
|
1975
|
+
}
|
|
1976
|
+
)
|
|
1977
|
+
]
|
|
1978
|
+
}
|
|
1979
|
+
)
|
|
1980
|
+
},
|
|
1981
|
+
index
|
|
1982
|
+
))
|
|
1983
|
+
}
|
|
1984
|
+
);
|
|
1790
1985
|
return /* @__PURE__ */ jsx(Section, { theme: overriddenTheme, id: cssId, background, children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-8", children: [
|
|
1791
1986
|
/* @__PURE__ */ jsxs(
|
|
1792
1987
|
"div",
|
|
@@ -1801,50 +1996,35 @@ function PricingWidget({
|
|
|
1801
1996
|
]
|
|
1802
1997
|
}
|
|
1803
1998
|
),
|
|
1804
|
-
tiers && tiers.length > 0 && /* @__PURE__ */ jsx(
|
|
1805
|
-
|
|
1999
|
+
tiers && tiers.length > 0 && (pricingSwitcher ? /* @__PURE__ */ jsx(
|
|
2000
|
+
PricingPeriodSwitch,
|
|
1806
2001
|
{
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
className: clsx3(
|
|
1813
|
-
tier.highlighted && "ring-2 ring-primary",
|
|
1814
|
-
layout === "highlight" && tier.highlighted && "relative z-10 shadow-xl md:-translate-y-3"
|
|
1815
|
-
),
|
|
1816
|
-
children: /* @__PURE__ */ jsxs(
|
|
1817
|
-
PageCardContent,
|
|
1818
|
-
{
|
|
1819
|
-
theme: overriddenTheme,
|
|
1820
|
-
className: "h-full flex flex-col gap-4",
|
|
1821
|
-
children: [
|
|
1822
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1823
|
-
/* @__PURE__ */ jsx(Preheader, { theme: overriddenTheme, children: tier.name }),
|
|
1824
|
-
tier.highlighted && /* @__PURE__ */ jsx(Badge, { theme: overriddenTheme, children: "Most popular" })
|
|
1825
|
-
] }),
|
|
1826
|
-
/* @__PURE__ */ jsx(PageCardHeader, { theme: overriddenTheme, children: tier.price }),
|
|
1827
|
-
tier.description && /* @__PURE__ */ jsx(Text1, { theme: overriddenTheme, children: tier.description }),
|
|
1828
|
-
tier.features && tier.features.length > 0 && /* @__PURE__ */ jsx("div", { className: "grow flex flex-col gap-2", children: tier.features.map((feature, i) => /* @__PURE__ */ jsx(Text2, { theme: overriddenTheme, children: feature }, i)) }),
|
|
1829
|
-
tier.buttonAction && tier.buttonCaption && /* @__PURE__ */ jsx(NavLink, { href: tier.buttonAction, className: "w-full mt-auto", children: /* @__PURE__ */ jsx(
|
|
1830
|
-
Button2,
|
|
1831
|
-
{
|
|
1832
|
-
theme: overriddenTheme,
|
|
1833
|
-
variant: tier.highlighted ? "default" : "secondary",
|
|
1834
|
-
className: "w-full",
|
|
1835
|
-
children: tier.buttonCaption
|
|
1836
|
-
}
|
|
1837
|
-
) })
|
|
1838
|
-
]
|
|
1839
|
-
}
|
|
1840
|
-
)
|
|
1841
|
-
},
|
|
1842
|
-
index
|
|
1843
|
-
))
|
|
2002
|
+
defaultPeriod,
|
|
2003
|
+
monthlyCaption: monthlyPriceCaption || "Monthly",
|
|
2004
|
+
yearlyCaption: yearlyPriceCaption || "Yearly",
|
|
2005
|
+
theme: overriddenTheme,
|
|
2006
|
+
children: plans
|
|
1844
2007
|
}
|
|
1845
|
-
)
|
|
2008
|
+
) : plans)
|
|
1846
2009
|
] }) });
|
|
1847
2010
|
}
|
|
2011
|
+
function TierButton({
|
|
2012
|
+
tier,
|
|
2013
|
+
href,
|
|
2014
|
+
className,
|
|
2015
|
+
theme
|
|
2016
|
+
}) {
|
|
2017
|
+
if (!href || !tier.buttonCaption) return null;
|
|
2018
|
+
return /* @__PURE__ */ jsx(NavLink, { href, className: clsx3("w-full mt-auto", className), children: /* @__PURE__ */ jsx(
|
|
2019
|
+
Button2,
|
|
2020
|
+
{
|
|
2021
|
+
theme,
|
|
2022
|
+
variant: tier.highlighted ? "default" : "secondary",
|
|
2023
|
+
className: "w-full",
|
|
2024
|
+
children: tier.buttonCaption
|
|
2025
|
+
}
|
|
2026
|
+
) });
|
|
2027
|
+
}
|
|
1848
2028
|
var createTier = () => ({
|
|
1849
2029
|
name: "New plan",
|
|
1850
2030
|
price: "$0/mo",
|
|
@@ -1893,6 +2073,48 @@ function PricingEditor({
|
|
|
1893
2073
|
}
|
|
1894
2074
|
)
|
|
1895
2075
|
] }),
|
|
2076
|
+
/* @__PURE__ */ jsxs(FieldGroup, { title: "Billing period", children: [
|
|
2077
|
+
/* @__PURE__ */ jsx(
|
|
2078
|
+
ToggleField,
|
|
2079
|
+
{
|
|
2080
|
+
label: "Monthly/Yearly switch",
|
|
2081
|
+
value: settings.pricingSwitcher,
|
|
2082
|
+
onChange: (pricingSwitcher) => update({ pricingSwitcher })
|
|
2083
|
+
}
|
|
2084
|
+
),
|
|
2085
|
+
settings.pricingSwitcher && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2086
|
+
/* @__PURE__ */ jsx(
|
|
2087
|
+
TextField,
|
|
2088
|
+
{
|
|
2089
|
+
label: "Monthly caption",
|
|
2090
|
+
value: settings.monthlyPriceCaption,
|
|
2091
|
+
placeholder: "Monthly",
|
|
2092
|
+
onChange: (monthlyPriceCaption) => update({ monthlyPriceCaption })
|
|
2093
|
+
}
|
|
2094
|
+
),
|
|
2095
|
+
/* @__PURE__ */ jsx(
|
|
2096
|
+
TextField,
|
|
2097
|
+
{
|
|
2098
|
+
label: "Yearly caption",
|
|
2099
|
+
value: settings.yearlyPriceCaption,
|
|
2100
|
+
placeholder: "Yearly (2 months free)",
|
|
2101
|
+
onChange: (yearlyPriceCaption) => update({ yearlyPriceCaption })
|
|
2102
|
+
}
|
|
2103
|
+
),
|
|
2104
|
+
/* @__PURE__ */ jsx(
|
|
2105
|
+
SelectField,
|
|
2106
|
+
{
|
|
2107
|
+
label: "Selected by default",
|
|
2108
|
+
value: settings.defaultPeriod ?? "yearly",
|
|
2109
|
+
onChange: (defaultPeriod) => update({ defaultPeriod }),
|
|
2110
|
+
options: [
|
|
2111
|
+
{ label: "Monthly", value: "monthly" },
|
|
2112
|
+
{ label: "Yearly", value: "yearly" }
|
|
2113
|
+
]
|
|
2114
|
+
}
|
|
2115
|
+
)
|
|
2116
|
+
] })
|
|
2117
|
+
] }),
|
|
1896
2118
|
/* @__PURE__ */ jsx(FieldGroup, { title: "Pricing tiers", children: /* @__PURE__ */ jsx(
|
|
1897
2119
|
ListField,
|
|
1898
2120
|
{
|
|
@@ -1913,12 +2135,22 @@ function PricingEditor({
|
|
|
1913
2135
|
/* @__PURE__ */ jsx(
|
|
1914
2136
|
TextField,
|
|
1915
2137
|
{
|
|
1916
|
-
label: "Price",
|
|
2138
|
+
label: settings.pricingSwitcher ? "Monthly price" : "Price",
|
|
1917
2139
|
value: tier.price,
|
|
1918
2140
|
placeholder: "$29/mo",
|
|
1919
2141
|
onChange: (price) => updateTier({ price })
|
|
1920
2142
|
}
|
|
1921
2143
|
),
|
|
2144
|
+
settings.pricingSwitcher && /* @__PURE__ */ jsx(
|
|
2145
|
+
TextField,
|
|
2146
|
+
{
|
|
2147
|
+
label: "Yearly price",
|
|
2148
|
+
value: tier.priceYearly,
|
|
2149
|
+
placeholder: "$290/year",
|
|
2150
|
+
hint: "Leave empty to show the monthly price.",
|
|
2151
|
+
onChange: (priceYearly) => updateTier({ priceYearly })
|
|
2152
|
+
}
|
|
2153
|
+
),
|
|
1922
2154
|
/* @__PURE__ */ jsx(
|
|
1923
2155
|
TextField,
|
|
1924
2156
|
{
|
|
@@ -1955,6 +2187,15 @@ function PricingEditor({
|
|
|
1955
2187
|
onChange: (buttonAction) => updateTier({ buttonAction })
|
|
1956
2188
|
}
|
|
1957
2189
|
),
|
|
2190
|
+
settings.pricingSwitcher && /* @__PURE__ */ jsx(
|
|
2191
|
+
TextField,
|
|
2192
|
+
{
|
|
2193
|
+
label: "Yearly button link",
|
|
2194
|
+
value: tier.buttonActionYearly,
|
|
2195
|
+
hint: "Leave empty to use the button link.",
|
|
2196
|
+
onChange: (buttonActionYearly) => updateTier({ buttonActionYearly })
|
|
2197
|
+
}
|
|
2198
|
+
),
|
|
1958
2199
|
/* @__PURE__ */ jsx(
|
|
1959
2200
|
ToggleField,
|
|
1960
2201
|
{
|
|
@@ -2035,7 +2276,8 @@ var bannerMetadata = {
|
|
|
2035
2276
|
name: "banner",
|
|
2036
2277
|
displayName: "Banner",
|
|
2037
2278
|
description: "A strong, punchy call-to-action strip.",
|
|
2038
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
2279
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
2280
|
+
icon: "Megaphone"
|
|
2039
2281
|
};
|
|
2040
2282
|
function BannerWidget({
|
|
2041
2283
|
settings: {
|
|
@@ -2219,7 +2461,8 @@ var emailFormMetadata = {
|
|
|
2219
2461
|
name: "email-form",
|
|
2220
2462
|
displayName: "Email signup",
|
|
2221
2463
|
description: "An email signup form with a title, description and email input.",
|
|
2222
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
2464
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
2465
|
+
icon: "Mail"
|
|
2223
2466
|
};
|
|
2224
2467
|
async function subscribeEmail(email, pageData) {
|
|
2225
2468
|
if (!pageData.teamId || !pageData.publicApiBaseUrl) {
|
|
@@ -2507,7 +2750,8 @@ var supportFormMetadata = {
|
|
|
2507
2750
|
name: "support-form",
|
|
2508
2751
|
displayName: "Support form",
|
|
2509
2752
|
description: "Raises a support ticket, suggesting matching help articles before the visitor submits.",
|
|
2510
|
-
compatibleWith: ["site", "landing", "custom"]
|
|
2753
|
+
compatibleWith: ["site", "landing", "custom"],
|
|
2754
|
+
icon: "LifeBuoy"
|
|
2511
2755
|
};
|
|
2512
2756
|
function suggestionHref(item) {
|
|
2513
2757
|
if (item.kind === "blog") return `/blog/${item.slug}`;
|
|
@@ -2843,7 +3087,8 @@ var footerMetadata = {
|
|
|
2843
3087
|
name: "footer",
|
|
2844
3088
|
displayName: "Footer",
|
|
2845
3089
|
description: "The site footer, pinned to the bottom of every page.",
|
|
2846
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
3090
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
3091
|
+
icon: "PanelBottom"
|
|
2847
3092
|
};
|
|
2848
3093
|
function FooterWidget({
|
|
2849
3094
|
settings: {
|
|
@@ -3112,7 +3357,8 @@ var richTextMetadata = {
|
|
|
3112
3357
|
name: "rich-text",
|
|
3113
3358
|
displayName: "Rich text",
|
|
3114
3359
|
description: "A block of formatted text \u2014 paragraphs, headings, lists and links \u2014 with no title or media.",
|
|
3115
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
3360
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
3361
|
+
icon: "Type"
|
|
3116
3362
|
};
|
|
3117
3363
|
function RichTextWidget({
|
|
3118
3364
|
settings: { text, alignment = "left", cssId, maxWidth, verticalPadding, background },
|
|
@@ -3187,7 +3433,8 @@ var gridMetadata = {
|
|
|
3187
3433
|
name: "grid",
|
|
3188
3434
|
displayName: "Grid",
|
|
3189
3435
|
description: "A header with a page-level call to action, plus a responsive grid of cards \u2014 each with its own icon or image, title, description and link.",
|
|
3190
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
3436
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
3437
|
+
icon: "Grid2x2"
|
|
3191
3438
|
};
|
|
3192
3439
|
function resolveIcon2(name) {
|
|
3193
3440
|
if (!name) return null;
|
|
@@ -3489,7 +3736,8 @@ var mediaMetadata = {
|
|
|
3489
3736
|
name: "media",
|
|
3490
3737
|
displayName: "Media",
|
|
3491
3738
|
description: "A single image or video \u2014 YouTube, Vimeo or self-hosted \u2014 with an optional click-to-play preview.",
|
|
3492
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
3739
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
3740
|
+
icon: "Image"
|
|
3493
3741
|
};
|
|
3494
3742
|
var roundedMap3 = {
|
|
3495
3743
|
0: "rounded-none",
|
|
@@ -3657,7 +3905,8 @@ var marqueeMetadata = {
|
|
|
3657
3905
|
name: "marquee",
|
|
3658
3906
|
displayName: "Marquee",
|
|
3659
3907
|
description: "An infinite horizontally-scrolling row of text or icons \u2014 useful for logo clouds or highlight tickers.",
|
|
3660
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
3908
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
3909
|
+
icon: "GalleryHorizontalEnd"
|
|
3661
3910
|
};
|
|
3662
3911
|
function MarqueeTrack({
|
|
3663
3912
|
children,
|
|
@@ -3979,7 +4228,8 @@ var embedMetadata = {
|
|
|
3979
4228
|
name: "embed",
|
|
3980
4229
|
displayName: "Embed",
|
|
3981
4230
|
description: "Embed a URL in an iframe, or paste a script/iframe snippet from a third-party tool.",
|
|
3982
|
-
compatibleWith: ["site", "landing", "blog", "post", "custom"]
|
|
4231
|
+
compatibleWith: ["site", "landing", "blog", "post", "custom"],
|
|
4232
|
+
icon: "AppWindow"
|
|
3983
4233
|
};
|
|
3984
4234
|
var aspectRatioMap = {
|
|
3985
4235
|
"16:9": 16 / 9,
|
|
@@ -4233,7 +4483,8 @@ var dataSlotMetadata = {
|
|
|
4233
4483
|
name: "data-slot",
|
|
4234
4484
|
displayName: "Data slot",
|
|
4235
4485
|
description: "A host-resolved data region. Its data source and presentation belong to the embedding application.",
|
|
4236
|
-
compatibleWith: ["site", "blog", "landing", "post", "custom"]
|
|
4486
|
+
compatibleWith: ["site", "blog", "landing", "post", "custom"],
|
|
4487
|
+
icon: "Database"
|
|
4237
4488
|
};
|
|
4238
4489
|
function DataSlotWidget({
|
|
4239
4490
|
data,
|
|
@@ -4278,5 +4529,5 @@ var DataSlot = {
|
|
|
4278
4529
|
};
|
|
4279
4530
|
|
|
4280
4531
|
export { Banner, CodeSnippetBlock, Content, DataSlot, EmailForm2 as EmailForm, Embed, Faq, Featured, FieldGroup, Footer, Grid, Header, Hero, Marquee, MediaBlock, Pricing, RichText, SupportForm2 as SupportForm, TextField, TitleSizeField, ToggleField, generateUniqueId };
|
|
4281
|
-
//# sourceMappingURL=chunk-
|
|
4282
|
-
//# sourceMappingURL=chunk-
|
|
4532
|
+
//# sourceMappingURL=chunk-5J6TLS5U.js.map
|
|
4533
|
+
//# sourceMappingURL=chunk-5J6TLS5U.js.map
|