@sprintup-cms/sdk 1.9.5 → 1.9.6
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 +47 -1
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +47 -1
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.cjs +47 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +47 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -874,6 +874,50 @@ function TwoColumnBlock({ block }) {
|
|
|
874
874
|
!hasImage && /* @__PURE__ */ jsx("div", { className: "flex-1 w-full rounded-xl bg-muted border border-border aspect-video flex items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "No image set" }) })
|
|
875
875
|
] }) });
|
|
876
876
|
}
|
|
877
|
+
function BentoGridBlock({ block }) {
|
|
878
|
+
const d = getData(block);
|
|
879
|
+
const items = Array.isArray(d.items) ? d.items : [];
|
|
880
|
+
const sizeClass = {
|
|
881
|
+
small: "col-span-1 row-span-1",
|
|
882
|
+
wide: "col-span-2 row-span-1",
|
|
883
|
+
tall: "col-span-1 row-span-2",
|
|
884
|
+
large: "col-span-2 row-span-2"
|
|
885
|
+
};
|
|
886
|
+
return /* @__PURE__ */ jsxs("section", { className: "py-12", children: [
|
|
887
|
+
(d.title || d.subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-8", children: [
|
|
888
|
+
d.title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-semibold tracking-tight", children: d.title }),
|
|
889
|
+
d.subtitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1", children: d.subtitle })
|
|
890
|
+
] }),
|
|
891
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 auto-rows-[180px] gap-3", children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
892
|
+
"div",
|
|
893
|
+
{
|
|
894
|
+
className: `rounded-xl border border-border bg-card p-5 flex flex-col justify-between hover:bg-muted/40 transition-colors ${sizeClass[item.size] ?? sizeClass.small}`,
|
|
895
|
+
children: [
|
|
896
|
+
/* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-lg bg-muted flex items-center justify-center mb-3", children: FEATURE_ICONS[item.icon] ?? /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "w-4 h-4", children: /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }),
|
|
897
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
898
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm", children: item.title }),
|
|
899
|
+
item.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mt-0.5 leading-relaxed", children: item.description })
|
|
900
|
+
] })
|
|
901
|
+
]
|
|
902
|
+
},
|
|
903
|
+
i
|
|
904
|
+
)) })
|
|
905
|
+
] });
|
|
906
|
+
}
|
|
907
|
+
function GridLayoutBlock({ block }) {
|
|
908
|
+
const d = getData(block);
|
|
909
|
+
const cols = Number(d.columns) || 3;
|
|
910
|
+
const gap = String(d.gap ?? "md");
|
|
911
|
+
const children = Array.isArray(d.children) ? d.children : [];
|
|
912
|
+
const gapMap = { none: "gap-0", sm: "gap-2", md: "gap-4", lg: "gap-6", xl: "gap-8" };
|
|
913
|
+
const colsMap = { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4", 5: "grid-cols-5", 6: "grid-cols-6" };
|
|
914
|
+
return /* @__PURE__ */ jsx("div", { className: `grid ${colsMap[cols] ?? "grid-cols-3"} ${gapMap[gap] ?? "gap-4"}`, children: children.map((child) => /* @__PURE__ */ jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsx(GridLayoutChildBlock, { block: child }) }, child.id)) });
|
|
915
|
+
}
|
|
916
|
+
function GridLayoutChildBlock({ block }) {
|
|
917
|
+
const renderer = BUILT_IN[block.type];
|
|
918
|
+
if (renderer) return /* @__PURE__ */ jsx(Fragment, { children: renderer(block, null) });
|
|
919
|
+
return /* @__PURE__ */ jsx(SectionBlock, { block, pageType: null });
|
|
920
|
+
}
|
|
877
921
|
var BUILT_IN = {
|
|
878
922
|
// Structured page type — content is nested { sectionName: { fieldName: value } }
|
|
879
923
|
"__structured__": (b, pt) => /* @__PURE__ */ jsx(StructuredBlock, { block: b, pageType: pt }),
|
|
@@ -913,7 +957,9 @@ var BUILT_IN = {
|
|
|
913
957
|
columns: (b) => /* @__PURE__ */ jsx(ColumnsBlock, { block: b }),
|
|
914
958
|
container: (b) => /* @__PURE__ */ jsx(ContainerBlock, { block: b }),
|
|
915
959
|
carousel: (b) => /* @__PURE__ */ jsx(CarouselBlock, { block: b }),
|
|
916
|
-
"product-list": (b) => /* @__PURE__ */ jsx(ProductListBlock, { block: b })
|
|
960
|
+
"product-list": (b) => /* @__PURE__ */ jsx(ProductListBlock, { block: b }),
|
|
961
|
+
"bento-grid": (b) => /* @__PURE__ */ jsx(BentoGridBlock, { block: b }),
|
|
962
|
+
"grid-layout": (b) => /* @__PURE__ */ jsx(GridLayoutBlock, { block: b })
|
|
917
963
|
};
|
|
918
964
|
function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
|
|
919
965
|
if (!blocks?.length) return null;
|