@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/next/index.js
CHANGED
|
@@ -1197,6 +1197,50 @@ function TwoColumnBlock({ block }) {
|
|
|
1197
1197
|
!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" }) })
|
|
1198
1198
|
] }) });
|
|
1199
1199
|
}
|
|
1200
|
+
function BentoGridBlock({ block }) {
|
|
1201
|
+
const d = getData(block);
|
|
1202
|
+
const items = Array.isArray(d.items) ? d.items : [];
|
|
1203
|
+
const sizeClass = {
|
|
1204
|
+
small: "col-span-1 row-span-1",
|
|
1205
|
+
wide: "col-span-2 row-span-1",
|
|
1206
|
+
tall: "col-span-1 row-span-2",
|
|
1207
|
+
large: "col-span-2 row-span-2"
|
|
1208
|
+
};
|
|
1209
|
+
return /* @__PURE__ */ jsxs("section", { className: "py-12", children: [
|
|
1210
|
+
(d.title || d.subtitle) && /* @__PURE__ */ jsxs("div", { className: "mb-8", children: [
|
|
1211
|
+
d.title && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-semibold tracking-tight", children: d.title }),
|
|
1212
|
+
d.subtitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1", children: d.subtitle })
|
|
1213
|
+
] }),
|
|
1214
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 auto-rows-[180px] gap-3", children: items.map((item, i) => /* @__PURE__ */ jsxs(
|
|
1215
|
+
"div",
|
|
1216
|
+
{
|
|
1217
|
+
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}`,
|
|
1218
|
+
children: [
|
|
1219
|
+
/* @__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" }) }) }),
|
|
1220
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
1221
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-sm", children: item.title }),
|
|
1222
|
+
item.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mt-0.5 leading-relaxed", children: item.description })
|
|
1223
|
+
] })
|
|
1224
|
+
]
|
|
1225
|
+
},
|
|
1226
|
+
i
|
|
1227
|
+
)) })
|
|
1228
|
+
] });
|
|
1229
|
+
}
|
|
1230
|
+
function GridLayoutBlock({ block }) {
|
|
1231
|
+
const d = getData(block);
|
|
1232
|
+
const cols = Number(d.columns) || 3;
|
|
1233
|
+
const gap = String(d.gap ?? "md");
|
|
1234
|
+
const children = Array.isArray(d.children) ? d.children : [];
|
|
1235
|
+
const gapMap = { none: "gap-0", sm: "gap-2", md: "gap-4", lg: "gap-6", xl: "gap-8" };
|
|
1236
|
+
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" };
|
|
1237
|
+
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)) });
|
|
1238
|
+
}
|
|
1239
|
+
function GridLayoutChildBlock({ block }) {
|
|
1240
|
+
const renderer = BUILT_IN[block.type];
|
|
1241
|
+
if (renderer) return /* @__PURE__ */ jsx(Fragment, { children: renderer(block, null) });
|
|
1242
|
+
return /* @__PURE__ */ jsx(SectionBlock, { block, pageType: null });
|
|
1243
|
+
}
|
|
1200
1244
|
var BUILT_IN = {
|
|
1201
1245
|
// Structured page type — content is nested { sectionName: { fieldName: value } }
|
|
1202
1246
|
"__structured__": (b, pt) => /* @__PURE__ */ jsx(StructuredBlock, { block: b, pageType: pt }),
|
|
@@ -1236,7 +1280,9 @@ var BUILT_IN = {
|
|
|
1236
1280
|
columns: (b) => /* @__PURE__ */ jsx(ColumnsBlock, { block: b }),
|
|
1237
1281
|
container: (b) => /* @__PURE__ */ jsx(ContainerBlock, { block: b }),
|
|
1238
1282
|
carousel: (b) => /* @__PURE__ */ jsx(CarouselBlock, { block: b }),
|
|
1239
|
-
"product-list": (b) => /* @__PURE__ */ jsx(ProductListBlock, { block: b })
|
|
1283
|
+
"product-list": (b) => /* @__PURE__ */ jsx(ProductListBlock, { block: b }),
|
|
1284
|
+
"bento-grid": (b) => /* @__PURE__ */ jsx(BentoGridBlock, { block: b }),
|
|
1285
|
+
"grid-layout": (b) => /* @__PURE__ */ jsx(GridLayoutBlock, { block: b })
|
|
1240
1286
|
};
|
|
1241
1287
|
function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
|
|
1242
1288
|
if (!blocks?.length) return null;
|