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