@sprintup-cms/sdk 1.8.71 → 1.8.75
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/CHANGELOG.md +70 -0
- package/README.md +10 -5
- package/dist/catch-all-CTLOY9lm.d.cts +38 -0
- package/dist/catch-all-CTLOY9lm.d.ts +38 -0
- package/dist/client.cjs +3 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +17 -1
- package/dist/client.d.ts +17 -1
- package/dist/client.js +3 -0
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/next/index.cjs +19 -10
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +5 -13
- package/dist/next/index.d.ts +5 -13
- package/dist/next/index.js +19 -10
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.cjs +7 -7
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +7 -7
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/next/index.d.cts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
|
|
3
|
-
import
|
|
2
|
+
export { b as CMSCatchAllPage, C as CMSCatchAllParams, g as generateMetadata } from '../catch-all-CTLOY9lm.cjs';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'next';
|
|
4
6
|
|
|
5
7
|
interface RevalidateHandlerOptions {
|
|
6
8
|
/**
|
|
@@ -81,16 +83,6 @@ declare const GET: (request: Request) => Promise<NextResponse>;
|
|
|
81
83
|
*/
|
|
82
84
|
declare function previewEntryGET(request: NextRequest): Promise<NextResponse>;
|
|
83
85
|
|
|
84
|
-
interface CMSCatchAllParams {
|
|
85
|
-
slug: string[];
|
|
86
|
-
}
|
|
87
|
-
declare function generateMetadata({ params }: {
|
|
88
|
-
params: Promise<CMSCatchAllParams>;
|
|
89
|
-
}): Promise<Metadata>;
|
|
90
|
-
declare function CMSCatchAllPage({ params }: {
|
|
91
|
-
params: Promise<CMSCatchAllParams>;
|
|
92
|
-
}): Promise<react_jsx_runtime.JSX.Element>;
|
|
93
|
-
|
|
94
86
|
/**
|
|
95
87
|
* dynamicProxyGET — server-side proxy for dynamic block API calls.
|
|
96
88
|
*
|
|
@@ -105,4 +97,4 @@ declare function CMSCatchAllPage({ params }: {
|
|
|
105
97
|
*/
|
|
106
98
|
declare function dynamicProxyGET(req: NextRequest): Promise<NextResponse>;
|
|
107
99
|
|
|
108
|
-
export {
|
|
100
|
+
export { GET, POST, createPreviewExitHandler, createRevalidateHandler, dynamicProxyGET, previewEntryGET, GET as previewExitGET };
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
|
|
3
|
-
import
|
|
2
|
+
export { b as CMSCatchAllPage, C as CMSCatchAllParams, g as generateMetadata } from '../catch-all-CTLOY9lm.js';
|
|
3
|
+
import 'react/jsx-runtime';
|
|
4
|
+
import 'react';
|
|
5
|
+
import 'next';
|
|
4
6
|
|
|
5
7
|
interface RevalidateHandlerOptions {
|
|
6
8
|
/**
|
|
@@ -81,16 +83,6 @@ declare const GET: (request: Request) => Promise<NextResponse>;
|
|
|
81
83
|
*/
|
|
82
84
|
declare function previewEntryGET(request: NextRequest): Promise<NextResponse>;
|
|
83
85
|
|
|
84
|
-
interface CMSCatchAllParams {
|
|
85
|
-
slug: string[];
|
|
86
|
-
}
|
|
87
|
-
declare function generateMetadata({ params }: {
|
|
88
|
-
params: Promise<CMSCatchAllParams>;
|
|
89
|
-
}): Promise<Metadata>;
|
|
90
|
-
declare function CMSCatchAllPage({ params }: {
|
|
91
|
-
params: Promise<CMSCatchAllParams>;
|
|
92
|
-
}): Promise<react_jsx_runtime.JSX.Element>;
|
|
93
|
-
|
|
94
86
|
/**
|
|
95
87
|
* dynamicProxyGET — server-side proxy for dynamic block API calls.
|
|
96
88
|
*
|
|
@@ -105,4 +97,4 @@ declare function CMSCatchAllPage({ params }: {
|
|
|
105
97
|
*/
|
|
106
98
|
declare function dynamicProxyGET(req: NextRequest): Promise<NextResponse>;
|
|
107
99
|
|
|
108
|
-
export {
|
|
100
|
+
export { GET, POST, createPreviewExitHandler, createRevalidateHandler, dynamicProxyGET, previewEntryGET, GET as previewExitGET };
|
package/dist/next/index.js
CHANGED
|
@@ -169,13 +169,16 @@ function createCMSClient(options) {
|
|
|
169
169
|
}
|
|
170
170
|
async function getPreviewPage(token) {
|
|
171
171
|
const { baseUrl, appId } = cfg();
|
|
172
|
+
console.log("[sprintup-cms] getPreviewPage called: baseUrl=", baseUrl, "appId=", appId, "tokenLength=", token?.length);
|
|
172
173
|
if (!baseUrl || !appId) {
|
|
173
174
|
console.warn("[sprintup-cms] getPreviewPage: Missing baseUrl or appId \u2014 returning null");
|
|
174
175
|
return null;
|
|
175
176
|
}
|
|
176
177
|
try {
|
|
177
178
|
const url = `${baseUrl}/api/v1/${appId}/preview?token=${encodeURIComponent(token)}`;
|
|
179
|
+
console.log("[sprintup-cms] getPreviewPage fetching:", url);
|
|
178
180
|
const res = await fetch(url, { cache: "no-store" });
|
|
181
|
+
console.log("[sprintup-cms] getPreviewPage response:", res.status);
|
|
179
182
|
if (!res.ok) {
|
|
180
183
|
const errorText = await res.text().catch(() => "");
|
|
181
184
|
console.error(`[sprintup-cms] getPreviewPage failed (${res.status}): ${errorText}`);
|
|
@@ -353,7 +356,7 @@ function HeroBlock({ block }) {
|
|
|
353
356
|
d.badge && /* @__PURE__ */ jsx("span", { className: `inline-block px-3 py-1 text-xs font-semibold rounded-full bg-secondary text-secondary-foreground mb-4`, children: d.badge }),
|
|
354
357
|
/* @__PURE__ */ jsx("h1", { className: `text-4xl md:text-5xl font-bold tracking-tight mb-4 text-balance ${textAlign}`, children: d.title }),
|
|
355
358
|
d.subtitle && /* @__PURE__ */ jsx("p", { className: `text-xl text-muted-foreground mb-8 ${textAlign}`, children: d.subtitle }),
|
|
356
|
-
(d.primaryButton || d.cta) && /* @__PURE__ */ jsxs("div", { className: `flex
|
|
359
|
+
(d.primaryButton || d.cta) && /* @__PURE__ */ jsxs("div", { className: `flex flex-wrap ${itemsAlign}`, style: { gap: "1rem" }, children: [
|
|
357
360
|
(d.primaryButton || d.cta) && /* @__PURE__ */ jsx(
|
|
358
361
|
"a",
|
|
359
362
|
{
|
|
@@ -378,7 +381,7 @@ function CTABlock({ block }) {
|
|
|
378
381
|
return /* @__PURE__ */ jsxs("section", { className: "py-12 px-8 rounded-xl bg-primary text-primary-foreground text-center", children: [
|
|
379
382
|
/* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-bold mb-4", children: d.title }),
|
|
380
383
|
d.subtitle && /* @__PURE__ */ jsx("p", { className: "text-primary-foreground/80 mb-6 max-w-2xl mx-auto", children: d.subtitle }),
|
|
381
|
-
/* @__PURE__ */ jsxs("div", { className: "flex
|
|
384
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-center flex-wrap", style: { gap: "1rem" }, children: [
|
|
382
385
|
d.primaryButton && /* @__PURE__ */ jsx(
|
|
383
386
|
"a",
|
|
384
387
|
{
|
|
@@ -765,7 +768,7 @@ function CenteredHeroBlock({ block }) {
|
|
|
765
768
|
children: d.subtitle
|
|
766
769
|
}
|
|
767
770
|
),
|
|
768
|
-
(d.primaryButton || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: "flex
|
|
771
|
+
(d.primaryButton || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: "flex justify-center flex-wrap", style: { gap: "1rem" }, children: [
|
|
769
772
|
d.primaryButton && /* @__PURE__ */ jsx(
|
|
770
773
|
"a",
|
|
771
774
|
{
|
|
@@ -801,7 +804,7 @@ function ProductHeroBlock({ block }) {
|
|
|
801
804
|
d.badge && /* @__PURE__ */ jsx("span", { className: `inline-flex items-center gap-1.5 px-3 py-1 text-xs font-semibold rounded-full bg-primary/10 text-primary mb-5`, children: d.badge }),
|
|
802
805
|
/* @__PURE__ */ jsx("h1", { className: `text-4xl md:text-5xl font-extrabold tracking-tight mb-5 text-balance leading-tight ${textAlign}`, children: d.title }),
|
|
803
806
|
d.subtitle && /* @__PURE__ */ jsx("p", { className: `text-lg text-muted-foreground leading-relaxed text-pretty mb-8 ${textAlign}`, children: d.subtitle }),
|
|
804
|
-
(d.primaryButton || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: `flex
|
|
807
|
+
(d.primaryButton || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: `flex flex-wrap ${itemsAlign}`, style: { gap: "0.75rem" }, children: [
|
|
805
808
|
d.primaryButton && /* @__PURE__ */ jsx(
|
|
806
809
|
"a",
|
|
807
810
|
{
|
|
@@ -847,7 +850,7 @@ function BentoHeroBlock({ block }) {
|
|
|
847
850
|
d.badge && /* @__PURE__ */ jsx("span", { className: "inline-block px-3 py-1 text-xs font-semibold rounded-full bg-secondary text-secondary-foreground mb-5", children: d.badge }),
|
|
848
851
|
/* @__PURE__ */ jsx("h1", { className: `text-4xl md:text-5xl font-extrabold tracking-tight mb-4 text-balance ${textAlign}`, children: d.title }),
|
|
849
852
|
d.subtitle && /* @__PURE__ */ jsx("p", { className: `text-lg text-muted-foreground leading-relaxed text-pretty ${textAlign}`, children: d.subtitle }),
|
|
850
|
-
(d.primaryButton || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: `flex
|
|
853
|
+
(d.primaryButton || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: `flex flex-wrap ${itemsAlign}`, style: { gap: "0.75rem", marginTop: "1.75rem" }, children: [
|
|
851
854
|
d.primaryButton && /* @__PURE__ */ jsx(
|
|
852
855
|
"a",
|
|
853
856
|
{
|
|
@@ -892,7 +895,7 @@ function MinimalHeroBlock({ block }) {
|
|
|
892
895
|
d.eyebrow && /* @__PURE__ */ jsx("p", { className: `text-xs uppercase tracking-[0.2em] font-semibold text-muted-foreground mb-5 ${textAlign}`, children: d.eyebrow }),
|
|
893
896
|
/* @__PURE__ */ jsx("h1", { className: `text-5xl md:text-7xl font-black tracking-tight mb-6 text-balance leading-none whitespace-pre-line ${textAlign}`, children: d.title }),
|
|
894
897
|
d.subtitle && /* @__PURE__ */ jsx("p", { className: `text-lg md:text-xl text-muted-foreground leading-relaxed text-pretty max-w-2xl mb-9 ${textAlign} ${mx}`, children: d.subtitle }),
|
|
895
|
-
(d.primaryButton || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: `flex
|
|
898
|
+
(d.primaryButton || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: `flex flex-wrap items-center ${itemsAlign}`, style: { gap: "1rem" }, children: [
|
|
896
899
|
d.primaryButton && /* @__PURE__ */ jsxs(
|
|
897
900
|
"a",
|
|
898
901
|
{
|
|
@@ -925,7 +928,7 @@ function SplitHeroBlock({ block }) {
|
|
|
925
928
|
/* @__PURE__ */ jsxs("div", { className: `flex-1 space-y-5 ${itemsAlign} flex flex-col`, children: [
|
|
926
929
|
d.title && /* @__PURE__ */ jsx("h1", { className: `text-3xl md:text-5xl font-extrabold tracking-tight text-balance leading-tight ${textAlign}`, children: d.title }),
|
|
927
930
|
d.subtitle && /* @__PURE__ */ jsx("p", { className: `text-lg text-muted-foreground leading-relaxed text-pretty ${textAlign}`, children: d.subtitle }),
|
|
928
|
-
(d.button || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: `flex flex-wrap
|
|
931
|
+
(d.button || d.secondaryButton) && /* @__PURE__ */ jsxs("div", { className: `flex flex-wrap ${align === "center" ? "justify-center" : "justify-start"}`, style: { gap: "0.75rem", paddingTop: "0.5rem" }, children: [
|
|
929
932
|
d.button && /* @__PURE__ */ jsx("a", { href: d.buttonUrl || "#", className: "inline-flex items-center px-6 py-3 rounded-lg bg-primary text-primary-foreground font-semibold text-sm hover:opacity-90 transition-opacity", children: d.button }),
|
|
930
933
|
d.secondaryButton && /* @__PURE__ */ jsx("a", { href: d.secondaryUrl || "#", className: "inline-flex items-center px-6 py-3 rounded-lg border border-border text-foreground font-semibold text-sm hover:bg-muted transition-colors", children: d.secondaryButton })
|
|
931
934
|
] })
|
|
@@ -1520,7 +1523,7 @@ async function resolveProductListBlocks(blocks) {
|
|
|
1520
1523
|
}
|
|
1521
1524
|
}));
|
|
1522
1525
|
}
|
|
1523
|
-
async function CMSCatchAllPage({ params }) {
|
|
1526
|
+
async function CMSCatchAllPage({ params, layout = true }) {
|
|
1524
1527
|
const { slug } = await params;
|
|
1525
1528
|
const slugStr = slug.join("/");
|
|
1526
1529
|
const draft = await draftMode();
|
|
@@ -1543,8 +1546,13 @@ async function CMSCatchAllPage({ params }) {
|
|
|
1543
1546
|
client.getGlobals().catch(() => ({ navigation: null, footer: null }))
|
|
1544
1547
|
]);
|
|
1545
1548
|
const resolvedBlocks = await resolveProductListBlocks(page.blocks ?? []);
|
|
1549
|
+
const showDefaultLayout = layout === true;
|
|
1550
|
+
const showCustomLayout = typeof layout === "object" && layout !== null;
|
|
1551
|
+
const CustomHeader = showCustomLayout ? layout.Header : null;
|
|
1552
|
+
const CustomFooter = showCustomLayout ? layout.Footer : null;
|
|
1546
1553
|
return /* @__PURE__ */ jsxs("div", { className: "min-h-screen bg-background flex flex-col", children: [
|
|
1547
|
-
/* @__PURE__ */ jsx(CMSHeader, { nav: globals?.navigation }),
|
|
1554
|
+
showDefaultLayout && /* @__PURE__ */ jsx(CMSHeader, { nav: globals?.navigation }),
|
|
1555
|
+
CustomHeader && /* @__PURE__ */ jsx(CustomHeader, { nav: globals?.navigation, globals }),
|
|
1548
1556
|
isPreview && /* @__PURE__ */ jsxs("div", { className: "sticky top-0 z-50 flex items-center justify-between px-4 py-2.5 bg-amber-500 text-white text-sm font-medium shadow", children: [
|
|
1549
1557
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1550
1558
|
/* @__PURE__ */ jsx("span", { children: "Draft Preview" }),
|
|
@@ -1574,7 +1582,8 @@ async function CMSCatchAllPage({ params }) {
|
|
|
1574
1582
|
/* @__PURE__ */ jsx("p", { className: "text-sm", children: "No content added yet." }),
|
|
1575
1583
|
isPreview && /* @__PURE__ */ jsx("p", { className: "text-xs mt-1 opacity-60", children: "Add blocks in the CMS editor to see them here." })
|
|
1576
1584
|
] }) }),
|
|
1577
|
-
/* @__PURE__ */ jsx(CMSFooter, { footer: globals?.footer })
|
|
1585
|
+
showDefaultLayout && /* @__PURE__ */ jsx(CMSFooter, { footer: globals?.footer }),
|
|
1586
|
+
CustomFooter && /* @__PURE__ */ jsx(CustomFooter, { footer: globals?.footer, globals })
|
|
1578
1587
|
] });
|
|
1579
1588
|
}
|
|
1580
1589
|
async function dynamicProxyGET(req) {
|