@sprintup-cms/sdk 1.8.38 → 1.8.41
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/next/index.cjs +79 -3
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +79 -3
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.cjs +79 -3
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +79 -3
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/next/index.cjs
CHANGED
|
@@ -644,6 +644,80 @@ var FEATURE_ICONS = {
|
|
|
644
644
|
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "17 6 23 6 23 12" })
|
|
645
645
|
] })
|
|
646
646
|
};
|
|
647
|
+
function ButtonBlock({ block }) {
|
|
648
|
+
const d = getData(block);
|
|
649
|
+
const label = d.label || d.text || "Button";
|
|
650
|
+
const url = d.url || "#";
|
|
651
|
+
const variant = d.variant || "default";
|
|
652
|
+
const base = "inline-flex items-center justify-center px-5 py-2.5 rounded-lg text-sm font-medium transition-opacity hover:opacity-90";
|
|
653
|
+
const cls = variant === "outline" ? `${base} border border-primary text-primary bg-transparent` : variant === "ghost" ? `${base} text-primary hover:bg-primary/10` : `${base} bg-primary text-primary-foreground`;
|
|
654
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: url, className: cls, children: label }) });
|
|
655
|
+
}
|
|
656
|
+
function ListBlock({ block }) {
|
|
657
|
+
const d = getData(block);
|
|
658
|
+
const items = Array.isArray(d.items) ? d.items : [];
|
|
659
|
+
const ordered = Boolean(d.ordered);
|
|
660
|
+
const Tag = ordered ? "ol" : "ul";
|
|
661
|
+
const listCls = ordered ? "list-decimal" : "list-disc";
|
|
662
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag, { className: `${listCls} pl-6 space-y-1.5 text-base text-foreground leading-relaxed`, children: items.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: item }, i)) });
|
|
663
|
+
}
|
|
664
|
+
function GalleryBlock({ block }) {
|
|
665
|
+
const d = getData(block);
|
|
666
|
+
const images = Array.isArray(d.images) ? d.images : [];
|
|
667
|
+
const cols = Number(d.columns) || 3;
|
|
668
|
+
const gridCols = cols === 2 ? "grid-cols-2" : cols === 4 ? "grid-cols-2 md:grid-cols-4" : "grid-cols-2 md:grid-cols-3";
|
|
669
|
+
if (!images.length) return null;
|
|
670
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid gap-3 ${gridCols}`, children: images.filter((img) => img.src).map((img, i) => /* @__PURE__ */ jsxRuntime.jsxs("figure", { className: "overflow-hidden rounded-lg border border-border", children: [
|
|
671
|
+
/* @__PURE__ */ jsxRuntime.jsx("img", { src: img.src, alt: img.alt || "", className: "w-full h-48 object-cover" }),
|
|
672
|
+
img.caption && /* @__PURE__ */ jsxRuntime.jsx("figcaption", { className: "px-2 py-1 text-xs text-muted-foreground text-center", children: img.caption })
|
|
673
|
+
] }, i)) });
|
|
674
|
+
}
|
|
675
|
+
function PricingTableBlock({ block }) {
|
|
676
|
+
const d = getData(block);
|
|
677
|
+
const tiers = Array.isArray(d.tiers) ? d.tiers : [];
|
|
678
|
+
const [yearly, setYearly] = React__default.default.useState(false);
|
|
679
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "py-12", children: [
|
|
680
|
+
(d.title || d.subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-8", children: [
|
|
681
|
+
d.title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl md:text-3xl font-bold tracking-tight", children: d.title }),
|
|
682
|
+
d.subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-muted-foreground", children: d.subtitle })
|
|
683
|
+
] }),
|
|
684
|
+
d.billingToggle && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center gap-3 mb-8", children: [
|
|
685
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-sm ${!yearly ? "font-semibold" : "text-muted-foreground"}`, children: "Monthly" }),
|
|
686
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
687
|
+
"button",
|
|
688
|
+
{
|
|
689
|
+
onClick: () => setYearly((v) => !v),
|
|
690
|
+
className: `relative w-10 h-6 rounded-full transition-colors ${yearly ? "bg-primary" : "bg-muted"}`,
|
|
691
|
+
"aria-label": "Toggle billing period",
|
|
692
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: `absolute top-1 w-4 h-4 rounded-full bg-white shadow transition-all ${yearly ? "left-5" : "left-1"}` })
|
|
693
|
+
}
|
|
694
|
+
),
|
|
695
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-sm ${yearly ? "font-semibold" : "text-muted-foreground"}`, children: "Yearly" })
|
|
696
|
+
] }),
|
|
697
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid gap-6 ${tiers.length === 2 ? "md:grid-cols-2" : tiers.length >= 3 ? "md:grid-cols-3" : ""}`, children: tiers.map((tier, i) => {
|
|
698
|
+
const price = yearly ? tier.yearlyPrice ?? tier.monthlyPrice : tier.monthlyPrice;
|
|
699
|
+
const featured = Boolean(tier.featured);
|
|
700
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex flex-col rounded-2xl border p-8 ${featured ? "border-primary bg-primary text-primary-foreground shadow-xl" : "border-border bg-card"}`, children: [
|
|
701
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6", children: [
|
|
702
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: `text-xl font-bold ${featured ? "text-primary-foreground" : ""}`, children: tier.name }),
|
|
703
|
+
tier.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: `text-sm mt-1 ${featured ? "text-primary-foreground/70" : "text-muted-foreground"}`, children: tier.description }),
|
|
704
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-4 flex items-end gap-1", children: [
|
|
705
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `text-4xl font-extrabold ${featured ? "text-primary-foreground" : ""}`, children: [
|
|
706
|
+
d.currency ?? "$",
|
|
707
|
+
price ?? 0
|
|
708
|
+
] }),
|
|
709
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `text-sm mb-1 ${featured ? "text-primary-foreground/70" : "text-muted-foreground"}`, children: "/mo" })
|
|
710
|
+
] })
|
|
711
|
+
] }),
|
|
712
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "space-y-2 flex-1 mb-8", children: (tier.features ?? []).map((f, j) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2 text-sm", children: [
|
|
713
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: `w-4 h-4 flex-shrink-0 ${f.included ? featured ? "text-primary-foreground" : "text-primary" : "text-muted-foreground opacity-40"}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: f.included ? /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" }) : /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }) }),
|
|
714
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: !f.included ? "opacity-50" : "", children: f.text })
|
|
715
|
+
] }, j)) }),
|
|
716
|
+
tier.cta && /* @__PURE__ */ jsxRuntime.jsx("a", { href: tier.ctaUrl || "#", className: `block text-center py-2.5 px-6 rounded-lg font-semibold text-sm transition-opacity hover:opacity-90 ${featured ? "bg-primary-foreground text-primary" : "bg-primary text-primary-foreground"}`, children: tier.cta })
|
|
717
|
+
] }, tier.id || i);
|
|
718
|
+
}) })
|
|
719
|
+
] });
|
|
720
|
+
}
|
|
647
721
|
function CardGridBlock({ block }) {
|
|
648
722
|
const d = getData(block);
|
|
649
723
|
const cards = Array.isArray(d.cards) ? d.cards : [];
|
|
@@ -746,7 +820,7 @@ function FeatureGridBlock({ block }) {
|
|
|
746
820
|
feat.icon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-10 h-10 rounded-lg bg-primary/10 text-primary flex items-center justify-center flex-shrink-0", children: FEATURE_ICONS[feat.icon] ?? /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "w-5 h-5", children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }),
|
|
747
821
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
748
822
|
feat.title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-base", children: feat.title }),
|
|
749
|
-
feat.description && /* @__PURE__ */ jsxRuntime.jsx("
|
|
823
|
+
feat.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground mt-1 leading-relaxed prose prose-sm max-w-none", dangerouslySetInnerHTML: { __html: feat.description } })
|
|
750
824
|
] })
|
|
751
825
|
] }, i)) })
|
|
752
826
|
] }) });
|
|
@@ -786,6 +860,10 @@ var BUILT_IN = {
|
|
|
786
860
|
text: (b) => /* @__PURE__ */ jsxRuntime.jsx(TextBlock, { block: b }),
|
|
787
861
|
richtext: (b) => /* @__PURE__ */ jsxRuntime.jsx(RichTextBlock, { block: b }),
|
|
788
862
|
image: (b) => /* @__PURE__ */ jsxRuntime.jsx(ImageBlock, { block: b }),
|
|
863
|
+
button: (b) => /* @__PURE__ */ jsxRuntime.jsx(ButtonBlock, { block: b }),
|
|
864
|
+
list: (b) => /* @__PURE__ */ jsxRuntime.jsx(ListBlock, { block: b }),
|
|
865
|
+
gallery: (b) => /* @__PURE__ */ jsxRuntime.jsx(GalleryBlock, { block: b }),
|
|
866
|
+
"pricing-table": (b) => /* @__PURE__ */ jsxRuntime.jsx(PricingTableBlock, { block: b }),
|
|
789
867
|
hero: (b) => /* @__PURE__ */ jsxRuntime.jsx(HeroBlock, { block: b }),
|
|
790
868
|
"hero-section": (b) => /* @__PURE__ */ jsxRuntime.jsx(HeroBlock, { block: b }),
|
|
791
869
|
cta: (b) => /* @__PURE__ */ jsxRuntime.jsx(CTABlock, { block: b }),
|
|
@@ -808,9 +886,7 @@ var BUILT_IN = {
|
|
|
808
886
|
};
|
|
809
887
|
function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
|
|
810
888
|
if (!blocks?.length) return null;
|
|
811
|
-
console.log("[v0] CMSBlocks received blocks:", blocks.map((b) => ({ id: b.id, type: b.type, hasData: !!b.data, hasContent: !!b.content, dataKeys: Object.keys(b.data ?? b.content ?? {}) })));
|
|
812
889
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `space-y-8 ${className}`, children: blocks.map((block) => {
|
|
813
|
-
console.log("[v0] rendering block type:", block.type, "inBuiltIn:", !!BUILT_IN[block.type]);
|
|
814
890
|
if (custom[block.type]) return /* @__PURE__ */ jsxRuntime.jsx(React__default.default.Fragment, { children: custom[block.type](block) }, block.id);
|
|
815
891
|
if (BUILT_IN[block.type]) return /* @__PURE__ */ jsxRuntime.jsx(React__default.default.Fragment, { children: BUILT_IN[block.type](block, pageType) }, block.id);
|
|
816
892
|
return /* @__PURE__ */ jsxRuntime.jsx(SectionBlock, { block, pageType }, block.id);
|