@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.
@@ -6,12 +6,10 @@ 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');
10
9
 
11
10
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
11
 
13
12
  var React__default = /*#__PURE__*/_interopDefault(React);
14
- var dynamic__default = /*#__PURE__*/_interopDefault(dynamic);
15
13
 
16
14
  /* @sprintup-cms/sdk — https://forgecms.io */
17
15
 
@@ -594,6 +592,34 @@ function SectionBlock({ block, pageType }) {
594
592
  ([key, value]) => isHtml(value) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-neutral dark:prose-invert max-w-none", dangerouslySetInnerHTML: { __html: String(value) } }, key) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: String(value) }, key)
595
593
  ) });
596
594
  }
595
+ function TwoColumnBlock({ block }) {
596
+ const d = getData(block);
597
+ const imagePos = d.imagePosition === "left" ? "flex-row-reverse" : "flex-row";
598
+ const hasImage = Boolean(d.image);
599
+ return /* @__PURE__ */ jsxRuntime.jsx("section", { className: "py-10", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex flex-col md:${imagePos} gap-8 md:gap-12 items-center`, children: [
600
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 space-y-4", children: [
601
+ d.title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl md:text-3xl font-bold tracking-tight text-balance", children: d.title }),
602
+ d.text && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground leading-relaxed text-pretty", children: d.text }),
603
+ d.button && /* @__PURE__ */ jsxRuntime.jsx(
604
+ "a",
605
+ {
606
+ href: d.buttonUrl || "#",
607
+ 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",
608
+ children: d.button
609
+ }
610
+ )
611
+ ] }),
612
+ hasImage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 w-full", children: /* @__PURE__ */ jsxRuntime.jsx(
613
+ "img",
614
+ {
615
+ src: d.image,
616
+ alt: d.title || "",
617
+ className: "w-full rounded-xl object-cover border border-border shadow-sm"
618
+ }
619
+ ) }),
620
+ !hasImage && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 w-full rounded-xl bg-muted border border-border aspect-video flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: "No image set" }) })
621
+ ] }) });
622
+ }
597
623
  var BUILT_IN = {
598
624
  // Structured page type — content is nested { sectionName: { fieldName: value } }
599
625
  "__structured__": (b, pt) => /* @__PURE__ */ jsxRuntime.jsx(StructuredBlock, { block: b, pageType: pt }),
@@ -612,6 +638,7 @@ var BUILT_IN = {
612
638
  divider: () => /* @__PURE__ */ jsxRuntime.jsx(DividerBlock, {}),
613
639
  spacer: (b) => /* @__PURE__ */ jsxRuntime.jsx(SpacerBlock, { block: b }),
614
640
  video: (b) => /* @__PURE__ */ jsxRuntime.jsx(VideoBlock, { block: b }),
641
+ "two-column": (b) => /* @__PURE__ */ jsxRuntime.jsx(TwoColumnBlock, { block: b }),
615
642
  "product-list": (b) => /* @__PURE__ */ jsxRuntime.jsx(ProductListBlock, { block: b })
616
643
  };
617
644
  function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
@@ -622,14 +649,6 @@ function CMSBlocks({ blocks, pageType, className = "", custom = {} }) {
622
649
  return /* @__PURE__ */ jsxRuntime.jsx(SectionBlock, { block, pageType }, block.id);
623
650
  }) });
624
651
  }
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
- );
633
652
  function resolvePath(obj, path) {
634
653
  if (!path) return void 0;
635
654
  return path.split(/[\.\[\]]+/).filter(Boolean).reduce((acc, key) => acc?.[key], obj);
@@ -670,8 +689,6 @@ function ServerProductListBlock({ block }) {
670
689
  cardStyle = "color-band",
671
690
  ctaLabel = "",
672
691
  ctaUrl: staticCtaUrl = "",
673
- defaultLayout = "grid",
674
- allowToggle = true,
675
692
  fieldTitle,
676
693
  fieldPrice,
677
694
  fieldColor,
@@ -693,21 +710,59 @@ function ServerProductListBlock({ block }) {
693
710
  title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl md:text-3xl font-semibold tracking-tight text-balance", children: title }),
694
711
  subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-2 text-pretty", children: subtitle })
695
712
  ] }),
696
- /* @__PURE__ */ jsxRuntime.jsx(
697
- ProductListClient,
698
- {
699
- products,
700
- defaultLayout,
701
- allowToggle,
702
- gridCols,
703
- cardStyle,
704
- showPrice,
705
- showRating,
706
- currency,
707
- ctaLabel,
708
- staticCtaUrl
709
- }
710
- )
713
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `grid gap-6 grid-cols-1 ${gridCols}`, children: products.map((product) => {
714
+ const accentColor = product.color ?? "#6366f1";
715
+ const href = staticCtaUrl || product.ctaUrl;
716
+ return /* @__PURE__ */ jsxRuntime.jsxs(
717
+ "div",
718
+ {
719
+ 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"}`,
720
+ children: [
721
+ cardStyle === "color-band" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-2 w-full flex-shrink-0", style: { backgroundColor: accentColor } }),
722
+ 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 }) }),
723
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-5 flex flex-col gap-3 flex-1", children: [
724
+ cardStyle !== "filled-header" && (product.category || product.badge) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
725
+ product.category && /* @__PURE__ */ jsxRuntime.jsx(
726
+ "span",
727
+ {
728
+ className: "text-xs px-2 py-0.5 rounded-full font-medium text-white",
729
+ style: { backgroundColor: accentColor },
730
+ children: product.category
731
+ }
732
+ ),
733
+ product.badge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground", children: product.badge })
734
+ ] }),
735
+ 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 }),
736
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-base line-clamp-2", children: product.name }),
737
+ product.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground line-clamp-2", children: product.description }),
738
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-auto pt-3 border-t border-border flex items-center justify-between gap-3", children: [
739
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
740
+ showPrice && product.price > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-bold text-lg", children: [
741
+ product.price.toFixed(2),
742
+ " ",
743
+ currency
744
+ ] }),
745
+ showRating && product.rating && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-sm text-muted-foreground", children: [
746
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3.5 h-3.5 fill-yellow-400 text-yellow-400", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsxRuntime.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" }) }),
747
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: product.rating })
748
+ ] })
749
+ ] }),
750
+ ctaLabel && /* @__PURE__ */ jsxRuntime.jsx(
751
+ "a",
752
+ {
753
+ href: href || "#",
754
+ className: "text-xs font-semibold px-3 py-1.5 rounded-lg text-white transition-opacity hover:opacity-90 flex-shrink-0",
755
+ style: { backgroundColor: accentColor },
756
+ children: ctaLabel
757
+ }
758
+ )
759
+ ] })
760
+ ] })
761
+ ]
762
+ },
763
+ product.id
764
+ );
765
+ }) })
711
766
  ] }) });
712
767
  }
713
768
  var client = createCMSClient();