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