@sprintup-cms/sdk 1.8.62 → 1.8.63
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 +10 -9
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +10 -9
- package/dist/next/index.js.map +1 -1
- package/package.json +1 -1
package/dist/next/index.cjs
CHANGED
|
@@ -1264,23 +1264,24 @@ function CMSFooter({ footer }) {
|
|
|
1264
1264
|
const sd = getSD(footer);
|
|
1265
1265
|
if (!sd) return null;
|
|
1266
1266
|
const sections = Array.isArray(sd.sections) ? sd.sections : [];
|
|
1267
|
+
const isLegacy = sections.length === 0 && ("brand" in sd || "columns" in sd || "contact" in sd || "social" in sd || "legal" in sd);
|
|
1267
1268
|
let renderSections = sections;
|
|
1268
|
-
if (
|
|
1269
|
+
if (isLegacy) {
|
|
1269
1270
|
renderSections = [];
|
|
1270
1271
|
if (sd.brand?.logo_url || sd.brand?.tagline) renderSections.push({ id: "b", type: "brand", ...sd.brand });
|
|
1271
|
-
(sd.columns
|
|
1272
|
-
if (sd.contact?.email || sd.contact?.phone) renderSections.push({ id: "c", type: "contact", ...sd.contact });
|
|
1273
|
-
if (Object.values(sd.social
|
|
1272
|
+
(Array.isArray(sd.columns) ? sd.columns : []).forEach((col) => renderSections.push({ id: col.id || col.title || Math.random(), type: "links", title: col.title, links: col.links || [] }));
|
|
1273
|
+
if (sd.contact?.email || sd.contact?.phone || sd.contact?.address) renderSections.push({ id: "c", type: "contact", ...sd.contact });
|
|
1274
|
+
if (sd.social && Object.values(sd.social).some(Boolean)) renderSections.push({ id: "s", type: "social", ...sd.social });
|
|
1274
1275
|
}
|
|
1275
|
-
const legalSec =
|
|
1276
|
+
const legalSec = sections.find((s) => s.type === "legal") ?? (isLegacy ? sd.legal ?? null : null);
|
|
1276
1277
|
const mainSections = renderSections.filter((s) => s.type !== "legal");
|
|
1277
|
-
|
|
1278
|
+
const copyright = legalSec?.copyright || "";
|
|
1279
|
+
const legalLinks = Array.isArray(legalSec?.legal_links) ? legalSec.legal_links : Array.isArray(legalSec?.links) ? legalSec.links : [];
|
|
1280
|
+
const hasBottom = !!(copyright || legalLinks.filter((l) => l.label).length);
|
|
1281
|
+
if (mainSections.length === 0 && !hasBottom) return null;
|
|
1278
1282
|
const gridCount = mainSections.length;
|
|
1279
1283
|
const gridCols = gridCount <= 1 ? "1fr" : gridCount === 2 ? "repeat(2,1fr)" : gridCount === 3 ? "repeat(3,1fr)" : "repeat(4,1fr)";
|
|
1280
1284
|
const mutedLink = { fontSize: "0.875rem", color: "var(--muted-foreground, #6b7280)", textDecoration: "none" };
|
|
1281
|
-
const copyright = legalSec?.copyright || "";
|
|
1282
|
-
const legalLinks = legalSec?.legal_links || legalSec?.links || [];
|
|
1283
|
-
const hasBottom = copyright || legalLinks.filter((l) => l.label).length > 0;
|
|
1284
1285
|
return /* @__PURE__ */ jsxRuntime.jsx("footer", { style: { borderTop: "1px solid var(--border, #e5e7eb)", background: "var(--muted, #f9fafb)", marginTop: "4rem" }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { maxWidth: "1200px", margin: "0 auto", padding: "3rem 1.5rem 1.5rem" }, children: [
|
|
1285
1286
|
mainSections.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "grid", gridTemplateColumns: gridCols, gap: "2.5rem", marginBottom: hasBottom ? "2.5rem" : 0 }, children: mainSections.map((sec) => {
|
|
1286
1287
|
const rendered = renderFooterSection(sec, mutedLink);
|