@sprintup-cms/sdk 1.8.48 → 1.8.49
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/client.cjs +0 -30
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -7
- package/dist/client.d.ts +1 -7
- package/dist/client.js +0 -30
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +0 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -30
- package/dist/index.js.map +1 -1
- package/dist/next/index.cjs +0 -43
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +0 -43
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.cjs +0 -13
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +0 -13
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/next/index.js
CHANGED
|
@@ -195,35 +195,6 @@ function createCMSClient(options) {
|
|
|
195
195
|
}
|
|
196
196
|
return getPage(slug);
|
|
197
197
|
}
|
|
198
|
-
async function getGlobals() {
|
|
199
|
-
const { baseUrl, apiKey, appId } = cfg();
|
|
200
|
-
if (!baseUrl || !apiKey || !appId) {
|
|
201
|
-
return { navigation: null, footer: null };
|
|
202
|
-
}
|
|
203
|
-
try {
|
|
204
|
-
const res = await fetch(`${baseUrl}/api/v1/${appId}/globals`, {
|
|
205
|
-
headers: headers(),
|
|
206
|
-
next: { revalidate: 300, tags: [`cms-globals-${appId}`] }
|
|
207
|
-
});
|
|
208
|
-
if (!res.ok) {
|
|
209
|
-
const [navPages, footerPages] = await Promise.all([
|
|
210
|
-
getPages({ type: "navigation" }),
|
|
211
|
-
getPages({ type: "footer" })
|
|
212
|
-
]);
|
|
213
|
-
return {
|
|
214
|
-
navigation: navPages[0] ?? null,
|
|
215
|
-
footer: footerPages[0] ?? null
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
const json = await res.json();
|
|
219
|
-
return {
|
|
220
|
-
navigation: json.data?.navigation ?? null,
|
|
221
|
-
footer: json.data?.footer ?? null
|
|
222
|
-
};
|
|
223
|
-
} catch {
|
|
224
|
-
return { navigation: null, footer: null };
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
198
|
async function getPageType(pageTypeId) {
|
|
228
199
|
const { baseUrl, apiKey, appId } = cfg();
|
|
229
200
|
if (!baseUrl || !apiKey || !appId || !pageTypeId) return null;
|
|
@@ -289,7 +260,6 @@ function createCMSClient(options) {
|
|
|
289
260
|
return {
|
|
290
261
|
getPages,
|
|
291
262
|
getPage,
|
|
292
|
-
getGlobals,
|
|
293
263
|
getBlogPosts,
|
|
294
264
|
getEvents,
|
|
295
265
|
getAnnouncements,
|
|
@@ -757,18 +727,6 @@ function SplitHeroBlock({ block }) {
|
|
|
757
727
|
/* @__PURE__ */ jsx("div", { className: "flex-1 w-full", children: d.image ? /* @__PURE__ */ jsx("img", { src: d.image, alt: d.title || "", className: "w-full rounded-2xl object-cover shadow-lg border border-border" }) : /* @__PURE__ */ jsx("div", { className: "w-full rounded-2xl 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" }) }) })
|
|
758
728
|
] }) });
|
|
759
729
|
}
|
|
760
|
-
function NavbarBlock({ block }) {
|
|
761
|
-
const d = getData(block);
|
|
762
|
-
const links = Array.isArray(d.links) ? d.links : [];
|
|
763
|
-
return /* @__PURE__ */ jsx("header", { className: `w-full border-b border-border bg-background/95 backdrop-blur ${d.sticky ? "sticky top-0 z-50" : ""}`, children: /* @__PURE__ */ jsxs("div", { className: "max-w-6xl mx-auto px-4 h-16 flex items-center justify-between gap-4", children: [
|
|
764
|
-
/* @__PURE__ */ jsxs("a", { href: "/", className: "flex items-center gap-2", children: [
|
|
765
|
-
d.logo && /* @__PURE__ */ jsx("img", { src: d.logo, alt: d.logoText || "Logo", className: "h-8 w-auto" }),
|
|
766
|
-
d.logoText && /* @__PURE__ */ jsx("span", { className: "font-bold text-base", children: d.logoText })
|
|
767
|
-
] }),
|
|
768
|
-
/* @__PURE__ */ jsx("nav", { className: "hidden md:flex items-center gap-6", children: links.map((link, i) => /* @__PURE__ */ jsx("a", { href: link.url || "#", className: "text-sm text-muted-foreground hover:text-foreground transition-colors", children: link.label }, i)) }),
|
|
769
|
-
d.ctaLabel && /* @__PURE__ */ jsx("a", { href: d.ctaUrl || "#", className: "inline-flex items-center px-4 py-2 rounded-lg bg-primary text-primary-foreground text-sm font-semibold hover:opacity-90 transition-opacity", children: d.ctaLabel })
|
|
770
|
-
] }) });
|
|
771
|
-
}
|
|
772
730
|
function AccordionBlock({ block }) {
|
|
773
731
|
const d = getData(block);
|
|
774
732
|
const items = Array.isArray(d.items) ? d.items : [];
|
|
@@ -1031,7 +989,6 @@ var BUILT_IN = {
|
|
|
1031
989
|
"feature-grid": (b) => /* @__PURE__ */ jsx(FeatureGridBlock, { block: b }),
|
|
1032
990
|
"two-column": (b) => /* @__PURE__ */ jsx(TwoColumnBlock, { block: b }),
|
|
1033
991
|
"split-hero": (b) => /* @__PURE__ */ jsx(SplitHeroBlock, { block: b }),
|
|
1034
|
-
navbar: (b) => /* @__PURE__ */ jsx(NavbarBlock, { block: b }),
|
|
1035
992
|
accordion: (b) => /* @__PURE__ */ jsx(AccordionBlock, { block: b }),
|
|
1036
993
|
tabs: (b) => /* @__PURE__ */ jsx(TabsBlock, { block: b }),
|
|
1037
994
|
columns: (b) => /* @__PURE__ */ jsx(ColumnsBlock, { block: b }),
|