@sprintup-cms/sdk 1.8.29 → 1.8.32
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 +82 -27
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +82 -26
- package/dist/next/index.js.map +1 -1
- package/dist/react/index.cjs +29 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +29 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +9 -14
- package/dist/next/product-list-client.cjs +0 -187
- package/dist/next/product-list-client.cjs.map +0 -1
- package/dist/next/product-list-client.d.cts +0 -28
- package/dist/next/product-list-client.d.ts +0 -28
- package/dist/next/product-list-client.js +0 -185
- package/dist/next/product-list-client.js.map +0 -1
- package/dist/react/index.d.cts +0 -92
- package/dist/react/index.d.ts +0 -92
package/dist/next/index.js
CHANGED
|
@@ -4,7 +4,6 @@ import { draftMode, cookies } from 'next/headers';
|
|
|
4
4
|
import { notFound } from 'next/navigation';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
|
-
import dynamic from 'next/dynamic';
|
|
8
7
|
|
|
9
8
|
/* @sprintup-cms/sdk — https://forgecms.io */
|
|
10
9
|
|
|
@@ -587,6 +586,34 @@ function SectionBlock({ block, pageType }) {
|
|
|
587
586
|
([key, value]) => isHtml(value) ? /* @__PURE__ */ jsx("div", { className: "prose prose-neutral dark:prose-invert max-w-none", dangerouslySetInnerHTML: { __html: String(value) } }, key) : /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: String(value) }, key)
|
|
588
587
|
) });
|
|
589
588
|
}
|
|
589
|
+
function TwoColumnBlock({ block }) {
|
|
590
|
+
const d = getData(block);
|
|
591
|
+
const imagePos = d.imagePosition === "left" ? "flex-row-reverse" : "flex-row";
|
|
592
|
+
const hasImage = Boolean(d.image);
|
|
593
|
+
return /* @__PURE__ */ jsx("section", { className: "py-10", children: /* @__PURE__ */ jsxs("div", { className: `flex flex-col md:${imagePos} gap-8 md:gap-12 items-center`, children: [
|
|
594
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-4", children: [
|
|
595
|
+
d.title && /* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-bold tracking-tight text-balance", children: d.title }),
|
|
596
|
+
d.text && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground leading-relaxed text-pretty", children: d.text }),
|
|
597
|
+
d.button && /* @__PURE__ */ jsx(
|
|
598
|
+
"a",
|
|
599
|
+
{
|
|
600
|
+
href: d.buttonUrl || "#",
|
|
601
|
+
className: "inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity",
|
|
602
|
+
children: d.button
|
|
603
|
+
}
|
|
604
|
+
)
|
|
605
|
+
] }),
|
|
606
|
+
hasImage && /* @__PURE__ */ jsx("div", { className: "flex-1 w-full", children: /* @__PURE__ */ jsx(
|
|
607
|
+
"img",
|
|
608
|
+
{
|
|
609
|
+
src: d.image,
|
|
610
|
+
alt: d.title || "",
|
|
611
|
+
className: "w-full rounded-xl object-cover border border-border shadow-sm"
|
|
612
|
+
}
|
|
613
|
+
) }),
|
|
614
|
+
!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" }) })
|
|
615
|
+
] }) });
|
|
616
|
+
}
|
|
590
617
|
var BUILT_IN = {
|
|
591
618
|
// Structured page type — content is nested { sectionName: { fieldName: value } }
|
|
592
619
|
"__structured__": (b, pt) => /* @__PURE__ */ jsx(StructuredBlock, { block: b, pageType: pt }),
|
|
@@ -605,6 +632,7 @@ var BUILT_IN = {
|
|
|
605
632
|
divider: () => /* @__PURE__ */ jsx(DividerBlock, {}),
|
|
606
633
|
spacer: (b) => /* @__PURE__ */ jsx(SpacerBlock, { block: b }),
|
|
607
634
|
video: (b) => /* @__PURE__ */ jsx(VideoBlock, { block: b }),
|
|
635
|
+
"two-column": (b) => /* @__PURE__ */ jsx(TwoColumnBlock, { block: b }),
|
|
608
636
|
"product-list": (b) => /* @__PURE__ */ jsx(ProductListBlock, { block: b })
|
|
609
637
|
};
|
|
610
638
|
function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
|
|
@@ -615,14 +643,6 @@ function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
|
|
|
615
643
|
return /* @__PURE__ */ jsx(SectionBlock, { block, pageType }, block.id);
|
|
616
644
|
}) });
|
|
617
645
|
}
|
|
618
|
-
var clientModulePath = "./product-list-client";
|
|
619
|
-
var ProductListClient = dynamic(
|
|
620
|
-
() => import(
|
|
621
|
-
/* webpackIgnore: true */
|
|
622
|
-
clientModulePath
|
|
623
|
-
).then((m) => m.ProductListClient),
|
|
624
|
-
{ ssr: false }
|
|
625
|
-
);
|
|
626
646
|
function resolvePath(obj, path) {
|
|
627
647
|
if (!path) return void 0;
|
|
628
648
|
return path.split(/[\.\[\]]+/).filter(Boolean).reduce((acc, key) => acc?.[key], obj);
|
|
@@ -663,8 +683,6 @@ function ServerProductListBlock({ block }) {
|
|
|
663
683
|
cardStyle = "color-band",
|
|
664
684
|
ctaLabel = "",
|
|
665
685
|
ctaUrl: staticCtaUrl = "",
|
|
666
|
-
defaultLayout = "grid",
|
|
667
|
-
allowToggle = true,
|
|
668
686
|
fieldTitle,
|
|
669
687
|
fieldPrice,
|
|
670
688
|
fieldColor,
|
|
@@ -686,21 +704,59 @@ function ServerProductListBlock({ block }) {
|
|
|
686
704
|
title && /* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-semibold tracking-tight text-balance", children: title }),
|
|
687
705
|
subtitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-2 text-pretty", children: subtitle })
|
|
688
706
|
] }),
|
|
689
|
-
/* @__PURE__ */ jsx(
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
707
|
+
/* @__PURE__ */ jsx("div", { className: `grid gap-6 grid-cols-1 ${gridCols}`, children: products.map((product) => {
|
|
708
|
+
const accentColor = product.color ?? "#6366f1";
|
|
709
|
+
const href = staticCtaUrl || product.ctaUrl;
|
|
710
|
+
return /* @__PURE__ */ jsxs(
|
|
711
|
+
"div",
|
|
712
|
+
{
|
|
713
|
+
className: `overflow-hidden group transition-shadow flex flex-col ${cardStyle === "minimal" ? "border-0 shadow-none bg-transparent" : "border rounded-xl hover:shadow-lg bg-card"}`,
|
|
714
|
+
children: [
|
|
715
|
+
cardStyle === "color-band" && /* @__PURE__ */ jsx("div", { className: "h-2 w-full flex-shrink-0", style: { backgroundColor: accentColor } }),
|
|
716
|
+
cardStyle === "filled-header" && /* @__PURE__ */ jsx("div", { className: "h-20 w-full flex-shrink-0 flex items-end px-5 pb-3", style: { backgroundColor: accentColor }, children: product.category && /* @__PURE__ */ jsx("span", { className: "text-xs font-semibold text-white/80 uppercase tracking-wider", children: product.category }) }),
|
|
717
|
+
/* @__PURE__ */ jsxs("div", { className: "p-5 flex flex-col gap-3 flex-1", children: [
|
|
718
|
+
cardStyle !== "filled-header" && (product.category || product.badge) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
719
|
+
product.category && /* @__PURE__ */ jsx(
|
|
720
|
+
"span",
|
|
721
|
+
{
|
|
722
|
+
className: "text-xs px-2 py-0.5 rounded-full font-medium text-white",
|
|
723
|
+
style: { backgroundColor: accentColor },
|
|
724
|
+
children: product.category
|
|
725
|
+
}
|
|
726
|
+
),
|
|
727
|
+
product.badge && /* @__PURE__ */ jsx("span", { className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground", children: product.badge })
|
|
728
|
+
] }),
|
|
729
|
+
cardStyle === "filled-header" && product.badge && /* @__PURE__ */ jsx("span", { className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground self-start", children: product.badge }),
|
|
730
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold text-base line-clamp-2", children: product.name }),
|
|
731
|
+
product.description && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground line-clamp-2", children: product.description }),
|
|
732
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-auto pt-3 border-t border-border flex items-center justify-between gap-3", children: [
|
|
733
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
734
|
+
showPrice && product.price > 0 && /* @__PURE__ */ jsxs("span", { className: "font-bold text-lg", children: [
|
|
735
|
+
product.price.toFixed(2),
|
|
736
|
+
" ",
|
|
737
|
+
currency
|
|
738
|
+
] }),
|
|
739
|
+
showRating && product.rating && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
740
|
+
/* @__PURE__ */ jsx("svg", { className: "w-3.5 h-3.5 fill-yellow-400 text-yellow-400", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { d: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" }) }),
|
|
741
|
+
/* @__PURE__ */ jsx("span", { children: product.rating })
|
|
742
|
+
] })
|
|
743
|
+
] }),
|
|
744
|
+
ctaLabel && /* @__PURE__ */ jsx(
|
|
745
|
+
"a",
|
|
746
|
+
{
|
|
747
|
+
href: href || "#",
|
|
748
|
+
className: "text-xs font-semibold px-3 py-1.5 rounded-lg text-white transition-opacity hover:opacity-90 flex-shrink-0",
|
|
749
|
+
style: { backgroundColor: accentColor },
|
|
750
|
+
children: ctaLabel
|
|
751
|
+
}
|
|
752
|
+
)
|
|
753
|
+
] })
|
|
754
|
+
] })
|
|
755
|
+
]
|
|
756
|
+
},
|
|
757
|
+
product.id
|
|
758
|
+
);
|
|
759
|
+
}) })
|
|
704
760
|
] }) });
|
|
705
761
|
}
|
|
706
762
|
var client = createCMSClient();
|