@sprintup-cms/sdk 1.8.20 → 1.8.29
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 -178
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +10 -179
- package/dist/next/index.js.map +1 -1
- package/dist/next/product-list-client.cjs +187 -0
- package/dist/next/product-list-client.cjs.map +1 -0
- package/dist/next/product-list-client.d.cts +28 -0
- package/dist/next/product-list-client.d.ts +28 -0
- package/dist/next/product-list-client.js +185 -0
- package/dist/next/product-list-client.js.map +1 -0
- package/dist/react/index.d.cts +92 -0
- package/dist/react/index.d.ts +92 -0
- package/package.json +14 -9
package/dist/next/index.cjs
CHANGED
|
@@ -6,10 +6,12 @@ var headers = require('next/headers');
|
|
|
6
6
|
var navigation = require('next/navigation');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
+
var dynamic = require('next/dynamic');
|
|
9
10
|
|
|
10
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
|
|
12
13
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
14
|
+
var dynamic__default = /*#__PURE__*/_interopDefault(dynamic);
|
|
13
15
|
|
|
14
16
|
/* @sprintup-cms/sdk — https://forgecms.io */
|
|
15
17
|
|
|
@@ -620,184 +622,14 @@ function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
|
|
|
620
622
|
return /* @__PURE__ */ jsxRuntime.jsx(SectionBlock, { block, pageType }, block.id);
|
|
621
623
|
}) });
|
|
622
624
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
className: `w-4 h-4 ${active ? "text-foreground" : "text-muted-foreground"}`,
|
|
632
|
-
fill: "currentColor",
|
|
633
|
-
children: [
|
|
634
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1", y: "1", width: "6", height: "6", rx: "1" }),
|
|
635
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "1", width: "6", height: "6", rx: "1" }),
|
|
636
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1", y: "9", width: "6", height: "6", rx: "1" }),
|
|
637
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "9", width: "6", height: "6", rx: "1" })
|
|
638
|
-
]
|
|
639
|
-
}
|
|
640
|
-
);
|
|
641
|
-
}
|
|
642
|
-
function ListIcon({ active }) {
|
|
643
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
644
|
-
"svg",
|
|
645
|
-
{
|
|
646
|
-
viewBox: "0 0 16 16",
|
|
647
|
-
className: `w-4 h-4 ${active ? "text-foreground" : "text-muted-foreground"}`,
|
|
648
|
-
fill: "currentColor",
|
|
649
|
-
children: [
|
|
650
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1", y: "2", width: "14", height: "3", rx: "1" }),
|
|
651
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1", y: "7", width: "14", height: "3", rx: "1" }),
|
|
652
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "1", y: "12", width: "14", height: "3", rx: "1" })
|
|
653
|
-
]
|
|
654
|
-
}
|
|
655
|
-
);
|
|
656
|
-
}
|
|
657
|
-
function ProductCard({ product, cardStyle, showPrice, showRating, currency, ctaLabel, staticCtaUrl }) {
|
|
658
|
-
const accentColor = product.color ?? "#6366f1";
|
|
659
|
-
const href = staticCtaUrl || product.ctaUrl;
|
|
660
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
661
|
-
"div",
|
|
662
|
-
{
|
|
663
|
-
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"}`,
|
|
664
|
-
children: [
|
|
665
|
-
cardStyle === "color-band" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-2 w-full flex-shrink-0", style: { backgroundColor: accentColor } }),
|
|
666
|
-
cardStyle === "filled-header" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-20 w-full flex-shrink-0 flex items-end px-5 pb-3", style: { backgroundColor: accentColor }, children: product.category && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-white/80 uppercase tracking-wider", children: product.category }) }),
|
|
667
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-5 flex flex-col gap-3 flex-1", children: [
|
|
668
|
-
cardStyle !== "filled-header" && (product.category || product.badge) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
669
|
-
product.category && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium text-white", style: { backgroundColor: accentColor }, children: product.category }),
|
|
670
|
-
product.badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground", children: product.badge })
|
|
671
|
-
] }),
|
|
672
|
-
cardStyle === "filled-header" && product.badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground self-start", children: product.badge }),
|
|
673
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-base line-clamp-2", children: product.name }),
|
|
674
|
-
product.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground line-clamp-2", children: product.description }),
|
|
675
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-auto pt-3 border-t border-border flex items-center justify-between gap-3", children: [
|
|
676
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
677
|
-
showPrice && product.price > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-bold text-lg", children: [
|
|
678
|
-
product.price.toFixed(2),
|
|
679
|
-
" ",
|
|
680
|
-
currency
|
|
681
|
-
] }),
|
|
682
|
-
showRating && product.rating && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
683
|
-
/* @__PURE__ */ jsxRuntime.jsx(StarIcon, {}),
|
|
684
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: product.rating })
|
|
685
|
-
] })
|
|
686
|
-
] }),
|
|
687
|
-
ctaLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
688
|
-
"a",
|
|
689
|
-
{
|
|
690
|
-
href: href || "#",
|
|
691
|
-
className: "text-xs font-semibold px-3 py-1.5 rounded-lg text-white transition-opacity hover:opacity-90 flex-shrink-0",
|
|
692
|
-
style: { backgroundColor: accentColor },
|
|
693
|
-
children: ctaLabel
|
|
694
|
-
}
|
|
695
|
-
)
|
|
696
|
-
] })
|
|
697
|
-
] })
|
|
698
|
-
]
|
|
699
|
-
}
|
|
700
|
-
);
|
|
701
|
-
}
|
|
702
|
-
function ProductRow({ product, showPrice, showRating, currency, ctaLabel, staticCtaUrl }) {
|
|
703
|
-
const accentColor = product.color ?? "#6366f1";
|
|
704
|
-
const href = staticCtaUrl || product.ctaUrl;
|
|
705
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 border rounded-xl bg-card px-5 py-4 hover:shadow-md transition-shadow group", children: [
|
|
706
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-1 self-stretch rounded-full flex-shrink-0", style: { backgroundColor: accentColor } }),
|
|
707
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
708
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [
|
|
709
|
-
product.category && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium text-white", style: { backgroundColor: accentColor }, children: product.category }),
|
|
710
|
-
product.badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground", children: product.badge })
|
|
711
|
-
] }),
|
|
712
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-sm truncate", children: product.name }),
|
|
713
|
-
product.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground truncate mt-0.5", children: product.description })
|
|
714
|
-
] }),
|
|
715
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 flex-shrink-0", children: [
|
|
716
|
-
showRating && product.rating && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
|
|
717
|
-
/* @__PURE__ */ jsxRuntime.jsx(StarIcon, {}),
|
|
718
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: product.rating })
|
|
719
|
-
] }),
|
|
720
|
-
showPrice && product.price > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-bold text-base", children: [
|
|
721
|
-
product.price.toFixed(2),
|
|
722
|
-
" ",
|
|
723
|
-
currency
|
|
724
|
-
] }),
|
|
725
|
-
ctaLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
726
|
-
"a",
|
|
727
|
-
{
|
|
728
|
-
href: href || "#",
|
|
729
|
-
className: "text-xs font-semibold px-3 py-1.5 rounded-lg text-white transition-opacity hover:opacity-90",
|
|
730
|
-
style: { backgroundColor: accentColor },
|
|
731
|
-
children: ctaLabel
|
|
732
|
-
}
|
|
733
|
-
)
|
|
734
|
-
] })
|
|
735
|
-
] });
|
|
736
|
-
}
|
|
737
|
-
function ProductListClient({
|
|
738
|
-
products,
|
|
739
|
-
defaultLayout,
|
|
740
|
-
allowToggle,
|
|
741
|
-
gridCols,
|
|
742
|
-
cardStyle,
|
|
743
|
-
showPrice,
|
|
744
|
-
showRating,
|
|
745
|
-
currency,
|
|
746
|
-
ctaLabel,
|
|
747
|
-
staticCtaUrl
|
|
748
|
-
}) {
|
|
749
|
-
const [layout, setLayout] = React.useState(defaultLayout);
|
|
750
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
751
|
-
allowToggle && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end mb-4", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 border border-border rounded-lg p-1 bg-muted/30", children: [
|
|
752
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
753
|
-
"button",
|
|
754
|
-
{
|
|
755
|
-
type: "button",
|
|
756
|
-
onClick: () => setLayout("grid"),
|
|
757
|
-
className: `p-1.5 rounded-md transition-colors ${layout === "grid" ? "bg-background shadow-sm" : "hover:bg-muted"}`,
|
|
758
|
-
"aria-label": "Grid view",
|
|
759
|
-
"aria-pressed": layout === "grid",
|
|
760
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(GridIcon, { active: layout === "grid" })
|
|
761
|
-
}
|
|
762
|
-
),
|
|
763
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
764
|
-
"button",
|
|
765
|
-
{
|
|
766
|
-
type: "button",
|
|
767
|
-
onClick: () => setLayout("list"),
|
|
768
|
-
className: `p-1.5 rounded-md transition-colors ${layout === "list" ? "bg-background shadow-sm" : "hover:bg-muted"}`,
|
|
769
|
-
"aria-label": "List view",
|
|
770
|
-
"aria-pressed": layout === "list",
|
|
771
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ListIcon, { active: layout === "list" })
|
|
772
|
-
}
|
|
773
|
-
)
|
|
774
|
-
] }) }),
|
|
775
|
-
layout === "grid" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid gap-6 grid-cols-1 ${gridCols}`, children: products.map((product) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
776
|
-
ProductCard,
|
|
777
|
-
{
|
|
778
|
-
product,
|
|
779
|
-
cardStyle,
|
|
780
|
-
showPrice,
|
|
781
|
-
showRating,
|
|
782
|
-
currency,
|
|
783
|
-
ctaLabel,
|
|
784
|
-
staticCtaUrl
|
|
785
|
-
},
|
|
786
|
-
product.id
|
|
787
|
-
)) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3", children: products.map((product) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
788
|
-
ProductRow,
|
|
789
|
-
{
|
|
790
|
-
product,
|
|
791
|
-
showPrice,
|
|
792
|
-
showRating,
|
|
793
|
-
currency,
|
|
794
|
-
ctaLabel,
|
|
795
|
-
staticCtaUrl
|
|
796
|
-
},
|
|
797
|
-
product.id
|
|
798
|
-
)) })
|
|
799
|
-
] });
|
|
800
|
-
}
|
|
625
|
+
var clientModulePath = "./product-list-client";
|
|
626
|
+
var ProductListClient = dynamic__default.default(
|
|
627
|
+
() => import(
|
|
628
|
+
/* webpackIgnore: true */
|
|
629
|
+
clientModulePath
|
|
630
|
+
).then((m) => m.ProductListClient),
|
|
631
|
+
{ ssr: false }
|
|
632
|
+
);
|
|
801
633
|
function resolvePath(obj, path) {
|
|
802
634
|
if (!path) return void 0;
|
|
803
635
|
return path.split(/[\.\[\]]+/).filter(Boolean).reduce((acc, key) => acc?.[key], obj);
|