@riverbankcms/sdk 0.4.0 → 0.4.2

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.
Files changed (124) hide show
  1. package/README.md +73 -0
  2. package/dist/cli/index.js +46 -5
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/client/client.d.mts +3 -3
  5. package/dist/client/client.d.ts +3 -3
  6. package/dist/client/client.js +80 -170
  7. package/dist/client/client.js.map +1 -1
  8. package/dist/client/client.mjs +80 -170
  9. package/dist/client/client.mjs.map +1 -1
  10. package/dist/client/hooks.d.mts +3 -3
  11. package/dist/client/hooks.d.ts +3 -3
  12. package/dist/client/rendering/client.d.mts +1 -1
  13. package/dist/client/rendering/client.d.ts +1 -1
  14. package/dist/client/rendering/client.js +80 -142
  15. package/dist/client/rendering/client.js.map +1 -1
  16. package/dist/client/rendering/client.mjs +80 -142
  17. package/dist/client/rendering/client.mjs.map +1 -1
  18. package/dist/client/resolver-CYyfzTQ9.d.mts +61 -0
  19. package/dist/client/resolver-CYyfzTQ9.d.ts +61 -0
  20. package/dist/client/usePage-BC8Q2E3t.d.mts +6431 -0
  21. package/dist/client/usePage-CHEybPMD.d.ts +6429 -0
  22. package/dist/client/usePage-D4fxZbRR.d.mts +6429 -0
  23. package/dist/client/usePage-DpRNZUtP.d.ts +6431 -0
  24. package/dist/server/{Layout-B_zUr9ci.d.mts → Layout-ByUnm35V.d.mts} +1 -1
  25. package/dist/server/{Layout-CHG77dhK.d.ts → Layout-kRv5sU81.d.ts} +1 -1
  26. package/dist/server/{chunk-ZIM53VP6.js → chunk-6JBKKV3G.js} +27 -4
  27. package/dist/server/chunk-6JBKKV3G.js.map +1 -0
  28. package/dist/server/{chunk-SFQ7VF3G.mjs → chunk-7BOIO2S7.mjs} +7 -5
  29. package/dist/server/{chunk-SFQ7VF3G.mjs.map → chunk-7BOIO2S7.mjs.map} +1 -1
  30. package/dist/server/{chunk-M5KTLZTD.mjs → chunk-A2FZMRDW.mjs} +3 -2
  31. package/dist/server/chunk-A2FZMRDW.mjs.map +1 -0
  32. package/dist/server/{chunk-P6CDRJN3.js → chunk-BLKVTULP.js} +13 -11
  33. package/dist/server/chunk-BLKVTULP.js.map +1 -0
  34. package/dist/server/{chunk-BOHTTHY5.mjs → chunk-I6K5REFT.mjs} +27 -4
  35. package/dist/server/chunk-I6K5REFT.mjs.map +1 -0
  36. package/dist/server/{chunk-BUCJWG6G.js → chunk-NW5KHH4A.js} +5 -5
  37. package/dist/server/{chunk-BUCJWG6G.js.map → chunk-NW5KHH4A.js.map} +1 -1
  38. package/dist/server/{chunk-XK2YIISA.mjs → chunk-SPXMMX3C.mjs} +2 -2
  39. package/dist/server/{chunk-FPYK6527.js → chunk-SWPHIUVE.js} +7 -6
  40. package/dist/server/chunk-SWPHIUVE.js.map +1 -0
  41. package/dist/server/{chunk-IT5ICP43.js → chunk-TKMA6D6U.js} +139 -229
  42. package/dist/server/chunk-TKMA6D6U.js.map +1 -0
  43. package/dist/server/{chunk-NKXS4TBK.mjs → chunk-TNRADRPH.mjs} +79 -169
  44. package/dist/server/chunk-TNRADRPH.mjs.map +1 -0
  45. package/dist/server/{chunk-G4CKM4EN.js → chunk-Y7347JMZ.js} +3 -2
  46. package/dist/server/chunk-Y7347JMZ.js.map +1 -0
  47. package/dist/server/{chunk-VVFYHAUD.mjs → chunk-ZEAJW6T3.mjs} +5 -4
  48. package/dist/server/chunk-ZEAJW6T3.mjs.map +1 -0
  49. package/dist/server/{components-Ci5nlyUj.d.mts → components-CY8jDQjv.d.mts} +20 -12
  50. package/dist/server/{components-BYxloYJm.d.ts → components-D1Z2mSDr.d.ts} +20 -12
  51. package/dist/server/components.d.mts +6 -6
  52. package/dist/server/components.d.ts +6 -6
  53. package/dist/server/components.js +3 -3
  54. package/dist/server/components.mjs +2 -2
  55. package/dist/server/config-validation.d.mts +2 -2
  56. package/dist/server/config-validation.d.ts +2 -2
  57. package/dist/server/config-validation.js +3 -3
  58. package/dist/server/config-validation.mjs +2 -2
  59. package/dist/server/config.d.mts +3 -3
  60. package/dist/server/config.d.ts +3 -3
  61. package/dist/server/config.js +3 -3
  62. package/dist/server/config.mjs +2 -2
  63. package/dist/server/data.d.mts +7 -5
  64. package/dist/server/data.d.ts +7 -5
  65. package/dist/server/data.js +2 -2
  66. package/dist/server/data.mjs +1 -1
  67. package/dist/server/{index-DbSfrRA0.d.ts → index-DCIz9Ptv.d.ts} +1 -1
  68. package/dist/server/{index-Dj7VKH34.d.mts → index-DFQwtj3J.d.mts} +1 -1
  69. package/dist/server/index.d.mts +4 -4
  70. package/dist/server/index.d.ts +4 -4
  71. package/dist/server/{loadContent-Czu7xTOU.d.mts → loadContent-CWuE8FCx.d.mts} +4 -4
  72. package/dist/server/{loadContent-BqQ-VPMW.d.ts → loadContent-DynBuR5f.d.ts} +4 -4
  73. package/dist/server/{loadPage-Dw57_n5N.d.mts → loadPage-B8RmlYgV.d.mts} +80 -28
  74. package/dist/server/{loadPage-BElEkA_J.d.ts → loadPage-BTkKpizX.d.ts} +80 -28
  75. package/dist/server/loadPage-DUHBXDEW.js +11 -0
  76. package/dist/server/{loadPage-E3ZC6NHB.js.map → loadPage-DUHBXDEW.js.map} +1 -1
  77. package/dist/server/{loadPage-E7L7NMR3.mjs → loadPage-LYVKY3WZ.mjs} +3 -3
  78. package/dist/server/metadata.d.mts +4 -4
  79. package/dist/server/metadata.d.ts +4 -4
  80. package/dist/server/navigation.d.mts +2 -2
  81. package/dist/server/navigation.d.ts +2 -2
  82. package/dist/server/rendering/server.d.mts +5 -5
  83. package/dist/server/rendering/server.d.ts +5 -5
  84. package/dist/server/rendering/server.js +4 -4
  85. package/dist/server/rendering/server.mjs +3 -3
  86. package/dist/server/rendering.d.mts +8 -8
  87. package/dist/server/rendering.d.ts +8 -8
  88. package/dist/server/rendering.js +6 -6
  89. package/dist/server/rendering.mjs +5 -5
  90. package/dist/server/routing.d.mts +79 -6
  91. package/dist/server/routing.d.ts +79 -6
  92. package/dist/server/routing.js +57 -3
  93. package/dist/server/routing.js.map +1 -1
  94. package/dist/server/routing.mjs +55 -1
  95. package/dist/server/routing.mjs.map +1 -1
  96. package/dist/server/server.d.mts +6 -6
  97. package/dist/server/server.d.ts +6 -6
  98. package/dist/server/server.js +3 -3
  99. package/dist/server/server.mjs +2 -2
  100. package/dist/server/theme-bridge.js +7 -7
  101. package/dist/server/theme-bridge.mjs +1 -1
  102. package/dist/server/{types-5XdVD2J1.d.ts → types-BiRZnxDx.d.ts} +17 -6
  103. package/dist/server/{types-CMqVHYLG.d.ts → types-CL916r6x.d.ts} +23 -1
  104. package/dist/server/{types-BuZJWVmj.d.mts → types-CbagRQ_7.d.mts} +15 -0
  105. package/dist/server/{types-BA-J9K8r.d.mts → types-CdrJqlKx.d.mts} +17 -6
  106. package/dist/server/{types-BC9eB2KH.d.mts → types-DkKEctWn.d.mts} +1 -1
  107. package/dist/server/{types-DSFvXKhO.d.ts → types-DuQCNVV0.d.ts} +15 -0
  108. package/dist/server/{types-CAnC529E.d.ts → types-oCM-fw4O.d.ts} +1 -1
  109. package/dist/server/{types-CYfHxUhe.d.mts → types-txWsSxN7.d.mts} +23 -1
  110. package/dist/server/{validation-C7W2Fe0i.d.ts → validation-CoU8uAiu.d.ts} +1 -1
  111. package/dist/server/{validation-hg1sqhrt.d.mts → validation-DzvDwwRo.d.mts} +1 -1
  112. package/package.json +1 -1
  113. package/dist/server/chunk-BOHTTHY5.mjs.map +0 -1
  114. package/dist/server/chunk-FPYK6527.js.map +0 -1
  115. package/dist/server/chunk-G4CKM4EN.js.map +0 -1
  116. package/dist/server/chunk-IT5ICP43.js.map +0 -1
  117. package/dist/server/chunk-M5KTLZTD.mjs.map +0 -1
  118. package/dist/server/chunk-NKXS4TBK.mjs.map +0 -1
  119. package/dist/server/chunk-P6CDRJN3.js.map +0 -1
  120. package/dist/server/chunk-VVFYHAUD.mjs.map +0 -1
  121. package/dist/server/chunk-ZIM53VP6.js.map +0 -1
  122. package/dist/server/loadPage-E3ZC6NHB.js +0 -11
  123. /package/dist/server/{chunk-XK2YIISA.mjs.map → chunk-SPXMMX3C.mjs.map} +0 -0
  124. /package/dist/server/{loadPage-E7L7NMR3.mjs.map → loadPage-LYVKY3WZ.mjs.map} +0 -0
@@ -57,121 +57,46 @@ function clsx() {
57
57
  }
58
58
  var clsx_default = clsx;
59
59
 
60
- // ../media-core/dist/chunk-JAKU4BKA.mjs
61
- var DEFAULT_BASE_PATH = "/api/img";
62
- var formatNumber = (value) => Number.isInteger(value) ? value.toString() : value.toFixed(6).replace(/0+$/, "").replace(/\.$/, "");
63
- var addParam = (search, key, value) => {
64
- if (value === void 0) return;
65
- switch (key) {
66
- case "fpX":
67
- search.set("fp-x", formatNumber(value));
68
- break;
69
- case "fpY":
70
- search.set("fp-y", formatNumber(value));
71
- break;
72
- case "rect": {
73
- const rect = value;
74
- if (!rect) break;
75
- search.set("rect", rect.map(formatNumber).join(","));
76
- break;
77
- }
78
- case "autoFormat":
79
- if (value) {
80
- search.append("auto", "format");
81
- }
82
- break;
83
- case "invert":
84
- search.set("invert", value ? "true" : "false");
85
- break;
86
- default:
87
- search.set(
88
- key,
89
- typeof value === "number" ? formatNumber(value) : String(value)
90
- );
91
- }
92
- };
93
- var ORDER = [
94
- "w",
95
- "h",
96
- "dpr",
97
- "fit",
98
- "crop",
99
- "fpX",
100
- "fpY",
101
- "rect",
102
- "q",
103
- "fm",
104
- "autoFormat",
105
- "bg",
106
- "flip",
107
- "or",
108
- "pad",
109
- "blur",
110
- "sharp",
111
- "invert",
112
- "sat",
113
- "cs"
114
- ];
115
- var getImageUrl = (asset, params = {}, basePath = DEFAULT_BASE_PATH) => {
116
- const trimmedBase = basePath.endsWith("/") ? basePath.slice(0, Math.max(basePath.length - 1, 0)) : basePath;
117
- const path = `${trimmedBase}/${encodeURIComponent(asset.id)}`;
118
- const searchParams = new URLSearchParams();
119
- ORDER.forEach((key) => {
120
- addParam(searchParams, key, params[key]);
121
- });
122
- const query = searchParams.toString();
123
- return query ? `${path}?${query}` : path;
124
- };
125
-
126
- // ../blocks/src/system/runtime/utils/api-url.ts
127
- function resolveMultiEnvDashboardUrl() {
128
- const env = process.env.RIVERBANK_ENV;
129
- if (!env) return null;
130
- const envKey = `RIVERBANK_${env.toUpperCase()}_DASHBOARD_URL`;
131
- const dashboardUrl = process.env[envKey];
132
- if (dashboardUrl) {
133
- return dashboardUrl.replace(/\/$/, "");
134
- }
135
- return null;
136
- }
137
- function getCmsApiUrl() {
138
- const multiEnvDashboard = resolveMultiEnvDashboardUrl();
139
- if (multiEnvDashboard) {
140
- return `${multiEnvDashboard}/api`;
141
- }
142
- const builderApiUrl = process.env.NEXT_PUBLIC_BUILDER_API_URL;
143
- if (builderApiUrl) {
144
- return builderApiUrl.replace(/\/$/, "");
145
- }
146
- const dashboardUrl = process.env.NEXT_PUBLIC_DASHBOARD_URL;
147
- if (dashboardUrl) {
148
- const base = dashboardUrl.replace(/\/$/, "");
149
- return `${base}/api`;
150
- }
151
- const legacyApiUrl = process.env.NEXT_PUBLIC_CMS_API_URL;
152
- if (legacyApiUrl) {
153
- return legacyApiUrl.replace(/\/$/, "");
154
- }
155
- throw new Error(
156
- "Dashboard URL not configured. Either:\n 1. Set RIVERBANK_ENV with RIVERBANK_LOCAL_DASHBOARD_URL / RIVERBANK_REMOTE_DASHBOARD_URL\n 2. Set NEXT_PUBLIC_BUILDER_API_URL (SDK sites)\n 3. Set NEXT_PUBLIC_DASHBOARD_URL (frontend app)"
157
- );
60
+ // ../media-core/dist/chunk-ZBK775TB.mjs
61
+ function getDirectImageUrl(supabaseUrl, storagePath, storageBucket = "media", options) {
62
+ const baseUrl = supabaseUrl.replace(/\/$/, "");
63
+ const encodedPath = storagePath.split("/").map((segment) => encodeURIComponent(segment)).join("/");
64
+ const isSvg = storagePath.toLowerCase().endsWith(".svg");
65
+ if (options && !isSvg && (options.width || options.height)) {
66
+ const params = new URLSearchParams();
67
+ if (options.width) params.set("width", String(options.width));
68
+ if (options.height) params.set("height", String(options.height));
69
+ if (options.quality) params.set("quality", String(options.quality));
70
+ if (options.resize) params.set("resize", options.resize);
71
+ return `${baseUrl}/storage/v1/render/image/public/${storageBucket}/${encodedPath}?${params.toString()}`;
72
+ }
73
+ return `${baseUrl}/storage/v1/object/public/${storageBucket}/${encodedPath}`;
158
74
  }
159
75
 
160
76
  // ../blocks/src/system/runtime/nodes/media.tsx
161
77
  var _jsxruntime = require('react/jsx-runtime');
78
+ function getSupabaseUrl() {
79
+ const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
80
+ if (!url) {
81
+ throw new Error(
82
+ "NEXT_PUBLIC_SUPABASE_URL is not configured. Set it to your Supabase project URL (e.g., https://xxx.supabase.co)"
83
+ );
84
+ }
85
+ return url.replace(/\/$/, "");
86
+ }
162
87
  var debugMediaNodeLog = (...args) => {
163
88
  if (typeof window !== "undefined" && window.__DEBUG_MEDIA_NODE__) {
164
89
  console.log("[MediaNode]", ...args);
165
90
  }
166
91
  };
167
- var MediaNode = ({ value, className, style, previewKey }) => {
92
+ var MediaNode = ({ value, className, style }) => {
168
93
  if (!value) return null;
169
94
  if (value.type === "video") {
170
95
  const src = value.src;
171
96
  if (!src) return null;
172
97
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "video", { className, style, src, autoPlay: true, muted: true, loop: true, playsInline: true, "aria-label": _nullishCoalesce(value.alt, () => ( "")) });
173
98
  }
174
- const imageUrl = resolveImageUrl(value, { previewKey });
99
+ const imageUrl = resolveImageUrl(value);
175
100
  if (!imageUrl) {
176
101
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
177
102
  "div",
@@ -182,56 +107,36 @@ var MediaNode = ({ value, className, style, previewKey }) => {
182
107
  }
183
108
  );
184
109
  }
185
- const isCrossOrigin = typeof window !== "undefined" && imageUrl.startsWith("http") && !imageUrl.startsWith(window.location.origin);
186
- const isApiRoute = imageUrl.includes("/api/img") || imageUrl.includes("/api/public/img");
187
- const crossOriginMode = isCrossOrigin && isApiRoute ? "use-credentials" : isCrossOrigin ? "anonymous" : void 0;
110
+ const hotspotStyle = _optionalChain([value, 'access', _2 => _2.transform, 'optionalAccess', _3 => _3.hotspot]) ? { objectPosition: `${value.transform.hotspot.x * 100}% ${value.transform.hotspot.y * 100}%` } : void 0;
188
111
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
189
112
  "img",
190
113
  {
191
114
  src: imageUrl,
192
115
  alt: _nullishCoalesce(value.alt, () => ( "")),
193
116
  className,
194
- style,
195
- loading: "lazy",
196
- crossOrigin: crossOriginMode
117
+ style: _chunkEGTDJ4PLjs.mergeStyles.call(void 0, style, hotspotStyle),
118
+ loading: "lazy"
197
119
  }
198
120
  );
199
121
  };
200
- function resolveImageUrl(value, options = {}) {
122
+ function resolveImageUrl(value) {
201
123
  if (value.type !== "image") return void 0;
202
- const params = {};
203
- const rect = _optionalChain([value, 'access', _2 => _2.transform, 'optionalAccess', _3 => _3.rect]);
204
- const hotspot = _optionalChain([value, 'access', _4 => _4.transform, 'optionalAccess', _5 => _5.hotspot]);
205
- if (rect && Array.isArray(rect) && rect.length === 4) {
206
- params.rect = rect.join(",");
207
- }
208
- if (hotspot && typeof hotspot.x === "number" && typeof hotspot.y === "number") {
209
- const x = clamp(hotspot.x);
210
- const y = clamp(hotspot.y);
211
- params.hotspot = `${x.toFixed(4)},${y.toFixed(4)}`;
212
- }
213
124
  debugMediaNodeLog("resolveImageUrl input", {
214
125
  assetId: value.assetId,
126
+ storagePath: value.storagePath,
215
127
  src: value.src,
216
- type: value.type,
217
- hasPreviewKey: !!options.previewKey
128
+ type: value.type
218
129
  });
219
- if (value.assetId) {
220
- const cmsApiBase = getCmsApiUrl();
221
- const basePath = `${cmsApiBase}/public/img`;
222
- let resolved = getImageUrl({ id: value.assetId }, params, basePath);
223
- if (options.previewKey) {
224
- const separator = resolved.includes("?") ? "&" : "?";
225
- resolved = `${resolved}${separator}preview_key=${encodeURIComponent(options.previewKey)}`;
226
- }
227
- debugMediaNodeLog("resolve:asset-id", {
228
- assetId: value.assetId,
229
- cmsApiBase,
230
- basePath,
231
- resolvedUrl: resolved,
232
- hasPreviewKey: !!options.previewKey
130
+ if (value.storagePath && value.storagePath.length > 0) {
131
+ const supabaseUrl = getSupabaseUrl();
132
+ const bucket = _nullishCoalesce(value.storageBucket, () => ( "media"));
133
+ const directUrl = getDirectImageUrl(supabaseUrl, value.storagePath, bucket);
134
+ debugMediaNodeLog("resolve:direct-supabase", {
135
+ storagePath: value.storagePath,
136
+ bucket,
137
+ directUrl
233
138
  });
234
- return resolved;
139
+ return directUrl;
235
140
  }
236
141
  if (typeof value.src === "string" && value.src.length > 0) {
237
142
  debugMediaNodeLog("resolve:explicit-src", { src: value.src });
@@ -240,9 +145,6 @@ function resolveImageUrl(value, options = {}) {
240
145
  debugMediaNodeLog("resolve:fallback-url", { fallbackUrl: _nullishCoalesce(value.url, () => ( null)) });
241
146
  return _nullishCoalesce(value.url, () => ( void 0));
242
147
  }
243
- function clamp(v, min6 = 0, max6 = 1) {
244
- return Math.min(Math.max(v, min6), max6);
245
- }
246
148
 
247
149
  // ../../node_modules/.pnpm/chroma-js@3.1.2/node_modules/chroma-js/src/utils/limit.js
248
150
  var { min, max } = Math;
@@ -3239,7 +3141,7 @@ function expandPalette(palette) {
3239
3141
  }
3240
3142
  if (base.text) expanded.body = base.text;
3241
3143
  const isDark = base.background ? isBackgroundDark(base.background) : false;
3242
- const isDarkMode = _optionalChain([palette, 'access', _6 => _6.meta, 'optionalAccess', _7 => _7.mode]) === "dark" || isDark;
3144
+ const isDarkMode = _optionalChain([palette, 'access', _4 => _4.meta, 'optionalAccess', _5 => _5.mode]) === "dark" || isDark;
3243
3145
  expanded.mutedText = isDarkMode ? expanded["neutral-600"] : expanded["neutral-500"];
3244
3146
  return expanded;
3245
3147
  }
@@ -3634,7 +3536,7 @@ var outerGlowEffect = {
3634
3536
  let glowColor;
3635
3537
  if (options.glowColorToken && typeof options.glowColorToken === "string") {
3636
3538
  glowColor = tokens.getColor(options.glowColorToken);
3637
- } else if (_optionalChain([buttonConfig, 'access', _8 => _8.border, 'optionalAccess', _9 => _9.colorToken])) {
3539
+ } else if (_optionalChain([buttonConfig, 'access', _6 => _6.border, 'optionalAccess', _7 => _7.colorToken])) {
3638
3540
  glowColor = tokens.getColor(buttonConfig.border.colorToken);
3639
3541
  } else if (buttonConfig.background.type === "solid") {
3640
3542
  glowColor = tokens.getColor(buttonConfig.background.colorToken);
@@ -5157,8 +5059,8 @@ function generateAccordionCss({
5157
5059
  if (accordionSystem.hover.shadowElevation) {
5158
5060
  const hoverShadowValue = generateShadowValue(
5159
5061
  accordionSystem.hover.shadowElevation,
5160
- _nullishCoalesce(_optionalChain([accordionSystem, 'access', _10 => _10.shadow, 'optionalAccess', _11 => _11.softness]), () => ( "soft")),
5161
- _nullishCoalesce(_optionalChain([accordionSystem, 'access', _12 => _12.shadow, 'optionalAccess', _13 => _13.position]), () => ( "bottom"))
5062
+ _nullishCoalesce(_optionalChain([accordionSystem, 'access', _8 => _8.shadow, 'optionalAccess', _9 => _9.softness]), () => ( "soft")),
5063
+ _nullishCoalesce(_optionalChain([accordionSystem, 'access', _10 => _10.shadow, 'optionalAccess', _11 => _11.position]), () => ( "bottom"))
5162
5064
  );
5163
5065
  triggerHoverRules.push(`box-shadow: ${hoverShadowValue}`);
5164
5066
  }
@@ -5677,7 +5579,7 @@ function generateHeaderCss(options) {
5677
5579
  function generateHeaderRootStyles(header, themeId, tokens, _theme) {
5678
5580
  const selector = `:where([data-theme-scope="${themeId}"]) .header-root`;
5679
5581
  const rules = [];
5680
- const navContainerType = _nullishCoalesce(_optionalChain([header, 'access', _14 => _14.navContainer, 'optionalAccess', _15 => _15.type]), () => ( "none"));
5582
+ const navContainerType = _nullishCoalesce(_optionalChain([header, 'access', _12 => _12.navContainer, 'optionalAccess', _13 => _13.type]), () => ( "none"));
5681
5583
  const isContainedNav = navContainerType === "pill" || navContainerType === "glass";
5682
5584
  if (isContainedNav) {
5683
5585
  } else {
@@ -5700,7 +5602,7 @@ function generateHeaderRootStyles(header, themeId, tokens, _theme) {
5700
5602
  "thick": "4px"
5701
5603
  }[header.border.width];
5702
5604
  if (borderWidth !== "0") {
5703
- const borderToken = _optionalChain([header, 'access', _16 => _16.border, 'optionalAccess', _17 => _17.color, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()]) || "border";
5605
+ const borderToken = _optionalChain([header, 'access', _14 => _14.border, 'optionalAccess', _15 => _15.color, 'optionalAccess', _16 => _16.trim, 'call', _17 => _17()]) || "border";
5704
5606
  const borderColor = tokens.getColor(borderToken);
5705
5607
  const borderStyle = header.border.style === "dashed" ? "dashed" : "solid";
5706
5608
  if (header.border.position === "bottom") {
@@ -5765,9 +5667,9 @@ function generateNavLinkStyles(header, themeId, tokens) {
5765
5667
  const baseRules = [];
5766
5668
  const hoverRules = [];
5767
5669
  const activeRules = [];
5768
- const navContainerType = _nullishCoalesce(_optionalChain([header, 'access', _20 => _20.navContainer, 'optionalAccess', _21 => _21.type]), () => ( "none"));
5670
+ const navContainerType = _nullishCoalesce(_optionalChain([header, 'access', _18 => _18.navContainer, 'optionalAccess', _19 => _19.type]), () => ( "none"));
5769
5671
  const usesGlassNavContainer = navContainerType === "glass";
5770
- const navColorToken = _optionalChain([header, 'access', _22 => _22.navColor, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()]);
5672
+ const navColorToken = _optionalChain([header, 'access', _20 => _20.navColor, 'optionalAccess', _21 => _21.trim, 'call', _22 => _22()]);
5771
5673
  const primaryColor = tokens.getColor("primary");
5772
5674
  const navWeight = _nullishCoalesce(header.navWeight, () => ( "medium"));
5773
5675
  const navWeightMap = {
@@ -5883,7 +5785,7 @@ ${activeSelector} {
5883
5785
  }
5884
5786
  function generateNavContainerStyles(header, themeId, tokens) {
5885
5787
  const navContainer = header.navContainer;
5886
- const navContainerType = _nullishCoalesce(_optionalChain([navContainer, 'optionalAccess', _25 => _25.type]), () => ( "none"));
5788
+ const navContainerType = _nullishCoalesce(_optionalChain([navContainer, 'optionalAccess', _23 => _23.type]), () => ( "none"));
5887
5789
  if (!navContainer || navContainerType === "none") return "";
5888
5790
  const selector = `:where([data-theme-scope="${themeId}"]) .header-nav-row`;
5889
5791
  const rules = [];
@@ -6251,7 +6153,7 @@ var defaultThemeTokens = {
6251
6153
  function buildThemeRuntime(theme, options) {
6252
6154
  const hydrated = hydrateTheme(theme);
6253
6155
  const cssVars = buildThemeCssVars(hydrated);
6254
- const themeId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _26 => _26.themeId]), () => ( "theme-default"));
6156
+ const themeId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _24 => _24.themeId]), () => ( "theme-default"));
6255
6157
  const buttonCss = generateButtonCss({
6256
6158
  themeId,
6257
6159
  theme,
@@ -6313,9 +6215,9 @@ function buildThemeCssVars(theme) {
6313
6215
  ...typography.headings.h1.weight ? { ["--fw-h1"]: mapWeight(typography.headings.h1.weight) } : {},
6314
6216
  ...typography.headings.h2.weight ? { ["--fw-h2"]: mapWeight(typography.headings.h2.weight) } : {},
6315
6217
  ...typography.headings.h3.weight ? { ["--fw-h3"]: mapWeight(typography.headings.h3.weight) } : {},
6316
- ..._optionalChain([typography, 'access', _27 => _27.headings, 'access', _28 => _28.h4, 'optionalAccess', _29 => _29.weight]) ? { ["--fw-h4"]: mapWeight(typography.headings.h4.weight) } : {},
6317
- ..._optionalChain([typography, 'access', _30 => _30.headings, 'access', _31 => _31.h5, 'optionalAccess', _32 => _32.weight]) ? { ["--fw-h5"]: mapWeight(typography.headings.h5.weight) } : {},
6318
- ..._optionalChain([typography, 'access', _33 => _33.headings, 'access', _34 => _34.h6, 'optionalAccess', _35 => _35.weight]) ? { ["--fw-h6"]: mapWeight(typography.headings.h6.weight) } : {},
6218
+ ..._optionalChain([typography, 'access', _25 => _25.headings, 'access', _26 => _26.h4, 'optionalAccess', _27 => _27.weight]) ? { ["--fw-h4"]: mapWeight(typography.headings.h4.weight) } : {},
6219
+ ..._optionalChain([typography, 'access', _28 => _28.headings, 'access', _29 => _29.h5, 'optionalAccess', _30 => _30.weight]) ? { ["--fw-h5"]: mapWeight(typography.headings.h5.weight) } : {},
6220
+ ..._optionalChain([typography, 'access', _31 => _31.headings, 'access', _32 => _32.h6, 'optionalAccess', _33 => _33.weight]) ? { ["--fw-h6"]: mapWeight(typography.headings.h6.weight) } : {},
6319
6221
  ["--ls-heading"]: mapLetterSpacing(typography.headings.default.letterSpacing),
6320
6222
  ["--ls-body"]: mapLetterSpacing(typography.body.letterSpacing),
6321
6223
  ...typography.headings.h1.letterSpacing ? { ["--ls-h1"]: mapLetterSpacing(typography.headings.h1.letterSpacing) } : {},
@@ -6508,12 +6410,12 @@ var RichTextValueSchema = _zod.z.union([
6508
6410
  ]);
6509
6411
  function buildRichTextSchema(options) {
6510
6412
  let schema = RichTextValueSchema;
6511
- if (_optionalChain([options, 'optionalAccess', _36 => _36.required])) {
6413
+ if (_optionalChain([options, 'optionalAccess', _34 => _34.required])) {
6512
6414
  const label = _nullishCoalesce(options.label, () => ( "This field"));
6513
6415
  schema = schema.refine(
6514
6416
  (val) => {
6515
6417
  const doc = _nullishCoalesce(val.doc, () => ( val));
6516
- const content = _optionalChain([doc, 'optionalAccess', _37 => _37.content]);
6418
+ const content = _optionalChain([doc, 'optionalAccess', _35 => _35.content]);
6517
6419
  if (!content || content.length === 0) return false;
6518
6420
  if (content.length === 1 && content[0].type === "paragraph" && !content[0].content) {
6519
6421
  return false;
@@ -6586,13 +6488,13 @@ function buildFieldSchema(field, allowNull, allowIncomplete = false) {
6586
6488
  return finalizeSchema(schema, required, allowNull, allowIncomplete);
6587
6489
  }
6588
6490
  function buildTextSchema(field) {
6589
- const ui = _nullishCoalesce(_optionalChain([field, 'optionalAccess', _38 => _38.ui]), () => ( {}));
6590
- const inputType = _optionalChain([ui, 'optionalAccess', _39 => _39.inputType]);
6491
+ const ui = _nullishCoalesce(_optionalChain([field, 'optionalAccess', _36 => _36.ui]), () => ( {}));
6492
+ const inputType = _optionalChain([ui, 'optionalAccess', _37 => _37.inputType]);
6591
6493
  let schema;
6592
6494
  if (inputType === "number") {
6593
6495
  schema = _zod.z.coerce.number();
6594
- if (typeof _optionalChain([ui, 'optionalAccess', _40 => _40.min]) === "number") schema = schema.min(ui.min);
6595
- if (typeof _optionalChain([ui, 'optionalAccess', _41 => _41.max]) === "number") schema = schema.max(ui.max);
6496
+ if (typeof _optionalChain([ui, 'optionalAccess', _38 => _38.min]) === "number") schema = schema.min(ui.min);
6497
+ if (typeof _optionalChain([ui, 'optionalAccess', _39 => _39.max]) === "number") schema = schema.max(ui.max);
6596
6498
  } else {
6597
6499
  schema = _zod.z.string();
6598
6500
  if (inputType === "email") {
@@ -6602,7 +6504,7 @@ function buildTextSchema(field) {
6602
6504
  const TEL_RE = /^[+()0-9\s\-]{3,}$/;
6603
6505
  schema = schema.regex(TEL_RE, `${field.label} must be a valid phone number`);
6604
6506
  }
6605
- if (_optionalChain([ui, 'optionalAccess', _42 => _42.pattern])) {
6507
+ if (_optionalChain([ui, 'optionalAccess', _40 => _40.pattern])) {
6606
6508
  try {
6607
6509
  const re = new RegExp(ui.pattern);
6608
6510
  schema = schema.regex(re, `${field.label} is not in the correct format`);
@@ -6682,7 +6584,7 @@ function buildLinkSchema() {
6682
6584
  }
6683
6585
  function buildSelectSchema(field) {
6684
6586
  const ui = field.ui;
6685
- if (_optionalChain([ui, 'optionalAccess', _43 => _43.widget]) === "sdkSelect") {
6587
+ if (_optionalChain([ui, 'optionalAccess', _41 => _41.widget]) === "sdkSelect") {
6686
6588
  const anyStringSchema = _zod.z.string();
6687
6589
  if (field.multiple) {
6688
6590
  const arraySchema = _zod.z.array(anyStringSchema);
@@ -6706,11 +6608,11 @@ function buildReferenceSchema(field) {
6706
6608
  return schema;
6707
6609
  }
6708
6610
  function buildRepeaterSchema(field, allowNull, allowIncomplete) {
6709
- const parsed = _chunkEGTDJ4PLjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([field, 'access', _44 => _44.schema, 'optionalAccess', _45 => _45.fields]), () => ( [])));
6611
+ const parsed = _chunkEGTDJ4PLjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([field, 'access', _42 => _42.schema, 'optionalAccess', _43 => _43.fields]), () => ( [])));
6710
6612
  const childShape = {};
6711
6613
  for (const child of parsed) {
6712
- if (child.type === "group" && _optionalChain([child, 'access', _46 => _46.ui, 'optionalAccess', _47 => _47.flattenInRepeater])) {
6713
- const groupParsed = _chunkEGTDJ4PLjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([child, 'access', _48 => _48.schema, 'optionalAccess', _49 => _49.fields]), () => ( [])));
6614
+ if (child.type === "group" && _optionalChain([child, 'access', _44 => _44.ui, 'optionalAccess', _45 => _45.flattenInRepeater])) {
6615
+ const groupParsed = _chunkEGTDJ4PLjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([child, 'access', _46 => _46.schema, 'optionalAccess', _47 => _47.fields]), () => ( [])));
6714
6616
  for (const gc of groupParsed) {
6715
6617
  childShape[gc.id] = buildFieldSchema(gc, allowNull, allowIncomplete);
6716
6618
  }
@@ -6729,7 +6631,7 @@ function buildRepeaterSchema(field, allowNull, allowIncomplete) {
6729
6631
  return arraySchema;
6730
6632
  }
6731
6633
  function buildGroupSchema(field, allowNull, allowIncomplete) {
6732
- const parsed = _chunkEGTDJ4PLjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([field, 'access', _50 => _50.schema, 'optionalAccess', _51 => _51.fields]), () => ( [])));
6634
+ const parsed = _chunkEGTDJ4PLjs.fieldSchema.array().parse(_nullishCoalesce(_optionalChain([field, 'access', _48 => _48.schema, 'optionalAccess', _49 => _49.fields]), () => ( [])));
6733
6635
  const childShape = {};
6734
6636
  for (const child of parsed) {
6735
6637
  childShape[child.id] = buildFieldSchema(child, allowNull, allowIncomplete);
@@ -6870,7 +6772,7 @@ function getFragmentRegistry() {
6870
6772
 
6871
6773
  // ../blocks/src/system/transforms/registry/core.ts
6872
6774
  function runTransforms(value, transforms, context, registry) {
6873
- if (!_optionalChain([transforms, 'optionalAccess', _52 => _52.length])) return value;
6775
+ if (!_optionalChain([transforms, 'optionalAccess', _50 => _50.length])) return value;
6874
6776
  return transforms.reduce((acc, step) => {
6875
6777
  const transform = registry.get(step.id);
6876
6778
  if (!transform) {
@@ -6953,7 +6855,7 @@ var resolveImageClassNameTransform = {
6953
6855
  kind: "string",
6954
6856
  summary: "Resolve className for background image based on objectFit, scale and position",
6955
6857
  run: (value, options, _context) => {
6956
- const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _53 => _53.baseClass]), () => ( "absolute -z-10"));
6858
+ const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _51 => _51.baseClass]), () => ( "absolute -z-10"));
6957
6859
  if (!value || typeof value !== "object") return `${baseClass} inset-0 h-full w-full`;
6958
6860
  const input = value;
6959
6861
  const objectFit = isString(input.objectFit) ? input.objectFit.trim() : null;
@@ -6995,7 +6897,7 @@ var backgroundTransforms = [
6995
6897
  const opacity = isNumber(input.opacity) ? input.opacity : isString(input.opacity) ? parseFloat(input.opacity) : null;
6996
6898
  const style = {};
6997
6899
  if (color) {
6998
- const isToken = Boolean(_optionalChain([context, 'optionalAccess', _54 => _54.theme, 'optionalAccess', _55 => _55.palette, 'optionalAccess', _56 => _56[color]]) || color === "transparent" || color === "surface");
6900
+ const isToken = Boolean(_optionalChain([context, 'optionalAccess', _52 => _52.theme, 'optionalAccess', _53 => _53.palette, 'optionalAccess', _54 => _54[color]]) || color === "transparent" || color === "surface");
6999
6901
  if (!isToken) {
7000
6902
  style.backgroundColor = color;
7001
6903
  }
@@ -7014,7 +6916,7 @@ var backgroundTransforms = [
7014
6916
  kind: "string",
7015
6917
  summary: "Map background color token to Tailwind class with auto-overflow for custom sizing",
7016
6918
  run: (value, options, context) => {
7017
- const baseClass = _optionalChain([options, 'optionalAccess', _57 => _57.baseClass]);
6919
+ const baseClass = _optionalChain([options, 'optionalAccess', _55 => _55.baseClass]);
7018
6920
  const base = typeof baseClass === "string" && baseClass.trim().length > 0 ? baseClass.trim() : "";
7019
6921
  if (!value || typeof value !== "object") return base;
7020
6922
  const input = value;
@@ -7023,7 +6925,7 @@ var backgroundTransforms = [
7023
6925
  const classes = [];
7024
6926
  if (base) classes.push(base);
7025
6927
  if (color) {
7026
- const isToken = Boolean(_optionalChain([context, 'optionalAccess', _58 => _58.theme, 'optionalAccess', _59 => _59.palette, 'optionalAccess', _60 => _60[color]]) || color === "transparent" || color === "surface");
6928
+ const isToken = Boolean(_optionalChain([context, 'optionalAccess', _56 => _56.theme, 'optionalAccess', _57 => _57.palette, 'optionalAccess', _58 => _58[color]]) || color === "transparent" || color === "surface");
7027
6929
  if (isToken) {
7028
6930
  classes.push(`bg-${color}`);
7029
6931
  }
@@ -7096,8 +6998,8 @@ var spacingTransform = {
7096
6998
  kind: "string",
7097
6999
  summary: "Map semantic spacing value to Tailwind padding classes",
7098
7000
  run: (value, options, _context) => {
7099
- const axis = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _61 => _61.axis]), () => ( "all"));
7100
- const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _62 => _62.baseClass]), () => ( ""));
7001
+ const axis = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _59 => _59.axis]), () => ( "all"));
7002
+ const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _60 => _60.baseClass]), () => ( ""));
7101
7003
  if (!value || typeof value !== "string") {
7102
7004
  return baseClass.trim() || "";
7103
7005
  }
@@ -7121,7 +7023,7 @@ var raisedTransform = {
7121
7023
  if (value !== true) {
7122
7024
  return baseClass.trim() || "";
7123
7025
  }
7124
- const shadowValue = _optionalChain([context, 'access', _63 => _63.theme, 'optionalAccess', _64 => _64.shadow, 'optionalAccess', _65 => _65.medium]);
7026
+ const shadowValue = _optionalChain([context, 'access', _61 => _61.theme, 'optionalAccess', _62 => _62.shadow, 'optionalAccess', _63 => _63.medium]);
7125
7027
  if (!shadowValue || shadowValue === "none") {
7126
7028
  return baseClass.trim() || "";
7127
7029
  }
@@ -7163,7 +7065,7 @@ var boxStylesCompositeTransform = {
7163
7065
  summary: "Composite transform for all box style properties",
7164
7066
  run: (value, options, context) => {
7165
7067
  if (!value || typeof value !== "object") {
7166
- return _optionalChain([options, 'access', _66 => _66.baseClass, 'optionalAccess', _67 => _67.trim, 'call', _68 => _68()]) || "";
7068
+ return _optionalChain([options, 'access', _64 => _64.baseClass, 'optionalAccess', _65 => _65.trim, 'call', _66 => _66()]) || "";
7167
7069
  }
7168
7070
  const input = value;
7169
7071
  const axis = _nullishCoalesce(options.axis, () => ( "all"));
@@ -7198,12 +7100,12 @@ var sectionClassNameTransform = {
7198
7100
  kind: "string",
7199
7101
  summary: "Resolve section className from spacing and fullWidth setting",
7200
7102
  run: (value, options, context) => {
7201
- const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _69 => _69.baseClass]), () => ( ""));
7202
- const containerStylesPath = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _70 => _70.containerStylesPath]), () => ( "_containerStyles"));
7203
- const defaultSpacing = _optionalChain([options, 'optionalAccess', _71 => _71.defaultSpacing]);
7103
+ const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _67 => _67.baseClass]), () => ( ""));
7104
+ const containerStylesPath = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _68 => _68.containerStylesPath]), () => ( "_containerStyles"));
7105
+ const defaultSpacing = _optionalChain([options, 'optionalAccess', _69 => _69.defaultSpacing]);
7204
7106
  const contextData = context.data;
7205
- const containerStyles = _optionalChain([contextData, 'optionalAccess', _72 => _72[containerStylesPath]]);
7206
- const fullWidth = _optionalChain([containerStyles, 'optionalAccess', _73 => _73.fullWidth]) === true;
7107
+ const containerStyles = _optionalChain([contextData, 'optionalAccess', _70 => _70[containerStylesPath]]);
7108
+ const fullWidth = _optionalChain([containerStyles, 'optionalAccess', _71 => _71.fullWidth]) === true;
7207
7109
  let adjustedBaseClass = baseClass;
7208
7110
  if (fullWidth && baseClass) {
7209
7111
  adjustedBaseClass = baseClass.split(" ").filter((cls) => !cls.startsWith("px-")).join(" ").trim();
@@ -7234,7 +7136,7 @@ var containerStylesResolveClassName = {
7234
7136
  kind: "string",
7235
7137
  summary: "Resolve container className based on fullWidth setting",
7236
7138
  run: (value, options, _context) => {
7237
- const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _74 => _74.baseClass]), () => ( ""));
7139
+ const baseClass = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _72 => _72.baseClass]), () => ( ""));
7238
7140
  if (!value || typeof value !== "object") {
7239
7141
  const defaultClass = "container mx-auto";
7240
7142
  return baseClass ? `${baseClass} ${defaultClass}`.trim() : defaultClass;
@@ -7440,7 +7342,7 @@ function renderMarks(text, marks, key) {
7440
7342
  }
7441
7343
  function renderDoc(node, key) {
7442
7344
  if (!node || !node.type) return null;
7443
- const children = _optionalChain([node, 'access', _75 => _75.content, 'optionalAccess', _76 => _76.map, 'call', _77 => _77((child, index) => renderDoc(child, `${key}-${index}`))]);
7345
+ const children = _optionalChain([node, 'access', _73 => _73.content, 'optionalAccess', _74 => _74.map, 'call', _75 => _75((child, index) => renderDoc(child, `${key}-${index}`))]);
7444
7346
  switch (node.type) {
7445
7347
  case "doc":
7446
7348
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children });
@@ -7448,7 +7350,7 @@ function renderDoc(node, key) {
7448
7350
  if (!children && !node.text) return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", {}, key);
7449
7351
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { children: _nullishCoalesce(children, () => ( renderMarks(_nullishCoalesce(node.text, () => ( "")), node.marks, key))) }, key);
7450
7352
  case "heading": {
7451
- const level = Math.min(Math.max(_nullishCoalesce(_optionalChain([node, 'access', _78 => _78.attrs, 'optionalAccess', _79 => _79.level]), () => ( 2)), 1), 6);
7353
+ const level = Math.min(Math.max(_nullishCoalesce(_optionalChain([node, 'access', _76 => _76.attrs, 'optionalAccess', _77 => _77.level]), () => ( 2)), 1), 6);
7452
7354
  const headingTag = `h${level}`;
7453
7355
  return React5.default.createElement(headingTag, { key }, children);
7454
7356
  }
@@ -7487,7 +7389,7 @@ var TextNode = ({ value, children, blockId: _blockId, blockKind: _blockKind, blo
7487
7389
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Text, { ...rest, children: _nullishCoalesce(value, () => ( children)) });
7488
7390
  };
7489
7391
  var RichTextNode = ({ value, blockId: _blockId, blockKind: _blockKind, blockContent: _blockContent, fragmentRegistry: _fragmentRegistry, pathBase: _pathBase, ...rest }) => {
7490
- const doc = _nullishCoalesce(_optionalChain([value, 'optionalAccess', _80 => _80.doc]), () => ( value));
7392
+ const doc = _nullishCoalesce(_optionalChain([value, 'optionalAccess', _78 => _78.doc]), () => ( value));
7491
7393
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, RichText, { doc, ...rest });
7492
7394
  };
7493
7395
  var ButtonNode = ({
@@ -7565,7 +7467,7 @@ var FormNodeSSR = ({ value, submitLabel, successMessage: _successMessage, classN
7565
7467
  }
7566
7468
  );
7567
7469
  }
7568
- const fields = _optionalChain([form, 'optionalAccess', _81 => _81.schemaJson, 'optionalAccess', _82 => _82.fields]);
7470
+ const fields = _optionalChain([form, 'optionalAccess', _79 => _79.schemaJson, 'optionalAccess', _80 => _80.fields]);
7569
7471
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { method: "POST", action: "/api/forms/submit", className: clsx_default("space-y-4", className), children: [
7570
7472
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "hidden", name: "form_id", value: form.id }),
7571
7473
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "input", { type: "text", name: "company", className: "hidden", tabIndex: -1, autoComplete: "off" }),
@@ -8204,7 +8106,7 @@ function extractSegmentsFromPart(part) {
8204
8106
  segments.push(baseMatch[1]);
8205
8107
  }
8206
8108
  const bracketMatches = Array.from(part.matchAll(BRACKET_ACCESS_REGEX));
8207
- const bracketSegments = bracketMatches.map((match) => _nullishCoalesce(_optionalChain([match, 'access', _83 => _83.groups, 'optionalAccess', _84 => _84.token]), () => ( ""))).filter((token) => token.length > 0).map(parseBracketToken);
8109
+ const bracketSegments = bracketMatches.map((match) => _nullishCoalesce(_optionalChain([match, 'access', _81 => _81.groups, 'optionalAccess', _82 => _82.token]), () => ( ""))).filter((token) => token.length > 0).map(parseBracketToken);
8208
8110
  segments.push(...bracketSegments);
8209
8111
  if (!baseMatch && !part.includes("[")) {
8210
8112
  return [part];
@@ -8227,7 +8129,7 @@ function getAbsoluteSegments(fromPath, context) {
8227
8129
  return [first === "$root" ? "$root" : "content", ...rest];
8228
8130
  }
8229
8131
  const scoped = context.scopes.find((entry) => entry.name === first);
8230
- if (_optionalChain([scoped, 'optionalAccess', _85 => _85.basePathSegments]) && scoped.basePathSegments.length > 0) {
8132
+ if (_optionalChain([scoped, 'optionalAccess', _83 => _83.basePathSegments]) && scoped.basePathSegments.length > 0) {
8231
8133
  return [...scoped.basePathSegments, ...rest];
8232
8134
  }
8233
8135
  return void 0;
@@ -8282,7 +8184,7 @@ function applyTransformsAndFallback(value, binding, context) {
8282
8184
  const routeMap = _nullishCoalesce(context.routes, () => ( extractRouteMapFromViewModel(context.viewModel)));
8283
8185
  const transformed = runTransforms(
8284
8186
  value,
8285
- _nullishCoalesce(_optionalChain([binding, 'access', _86 => _86.transforms, 'optionalAccess', _87 => _87.map, 'call', _88 => _88((step) => ({ id: step.id, options: step.options }))]), () => ( [])),
8187
+ _nullishCoalesce(_optionalChain([binding, 'access', _84 => _84.transforms, 'optionalAccess', _85 => _85.map, 'call', _86 => _86((step) => ({ id: step.id, options: step.options }))]), () => ( [])),
8286
8188
  { theme: _nullishCoalesce(context.theme, () => ( defaultThemeTokens)), routes: routeMap },
8287
8189
  transforms
8288
8190
  );
@@ -8466,7 +8368,7 @@ function injectEditorPath(props, node, parsedBinding, context) {
8466
8368
  };
8467
8369
  }
8468
8370
  function resolveChildren(nodes, context) {
8469
- if (!_optionalChain([nodes, 'optionalAccess', _89 => _89.length])) return [];
8371
+ if (!_optionalChain([nodes, 'optionalAccess', _87 => _87.length])) return [];
8470
8372
  return nodes.flatMap((child, index) => {
8471
8373
  const childContext = { ...context, scopes: [...context.scopes] };
8472
8374
  const resolved = resolveNode2(child, childContext, index);
@@ -8488,7 +8390,7 @@ function resolveNode2(node, context, indexFallback) {
8488
8390
  const normalizedType = node.type.toLowerCase();
8489
8391
  const component = _nullishCoalesce(_nullishCoalesce(registry[node.type], () => ( registry[normalizedType])), () => ( (normalizedType === "section" ? SectionNode : void 0)));
8490
8392
  if (!component) {
8491
- if (_optionalChain([globalThis, 'optionalAccess', _90 => _90.process, 'optionalAccess', _91 => _91.env, 'optionalAccess', _92 => _92.NODE_ENV]) !== "production") {
8393
+ if (_optionalChain([globalThis, 'optionalAccess', _88 => _88.process, 'optionalAccess', _89 => _89.env, 'optionalAccess', _90 => _90.NODE_ENV]) !== "production") {
8492
8394
  console.warn(`[block-system] Missing renderer for node type: ${node.type}`);
8493
8395
  }
8494
8396
  return null;
@@ -8587,11 +8489,11 @@ function resolveBlockLayout(manifest, content) {
8587
8489
  if (!manifest.variants) {
8588
8490
  return _nullishCoalesce(manifest.layout, () => ( null));
8589
8491
  }
8590
- const contentVariant = _optionalChain([content, 'optionalAccess', _93 => _93.variant]);
8492
+ const contentVariant = _optionalChain([content, 'optionalAccess', _91 => _91.variant]);
8591
8493
  if (typeof contentVariant === "string" && manifest.variants[contentVariant]) {
8592
8494
  return manifest.variants[contentVariant];
8593
8495
  }
8594
- const contentLayout = _optionalChain([content, 'optionalAccess', _94 => _94.layout]);
8496
+ const contentLayout = _optionalChain([content, 'optionalAccess', _92 => _92.layout]);
8595
8497
  if (typeof contentLayout === "string" && manifest.variants[contentLayout]) {
8596
8498
  return manifest.variants[contentLayout];
8597
8499
  }
@@ -8648,7 +8550,7 @@ function makeDefaultBlockComponent(args) {
8648
8550
  ...typeof themeConfig !== "undefined" ? { theme: themeConfig } : {}
8649
8551
  }
8650
8552
  };
8651
- const themeForTransforms = _optionalChain([themeConfig, 'optionalAccess', _95 => _95.buttons]) ? { ...theme, buttons: themeConfig.buttons } : theme;
8553
+ const themeForTransforms = _optionalChain([themeConfig, 'optionalAccess', _93 => _93.buttons]) ? { ...theme, buttons: themeConfig.buttons } : theme;
8652
8554
  return resolveTree(layout, {
8653
8555
  registry,
8654
8556
  viewModel,
@@ -8687,7 +8589,7 @@ function renderBlock(manifest, content, options = {}) {
8687
8589
 
8688
8590
  // ../blocks/src/system/manifest/hydrateLinks.ts
8689
8591
  function hydrateManifestLinks(manifest, content, routes) {
8690
- if (!routes || !_optionalChain([manifest, 'optionalAccess', _96 => _96.fields, 'optionalAccess', _97 => _97.length])) {
8592
+ if (!routes || !_optionalChain([manifest, 'optionalAccess', _94 => _94.fields, 'optionalAccess', _95 => _95.length])) {
8691
8593
  return content;
8692
8594
  }
8693
8595
  const hydrated = hydrateValue(content, routes);
@@ -8900,7 +8802,7 @@ var MemoBlockSection = React5.memo(function MemoBlockSection2({
8900
8802
  }) {
8901
8803
  const OverrideComponent = getBlockOverride(block.kind, blockOverrides);
8902
8804
  let definition = _chunkEGTDJ4PLjs.getBlockDefinition.call(void 0, block.kind);
8903
- if (!definition && block.kind.startsWith("custom.") && _optionalChain([sdkConfig, 'optionalAccess', _98 => _98.customBlocks])) {
8805
+ if (!definition && block.kind.startsWith("custom.") && _optionalChain([sdkConfig, 'optionalAccess', _96 => _96.customBlocks])) {
8904
8806
  const sdkBlock = sdkConfig.customBlocks.find((b) => b.id === block.kind);
8905
8807
  if (sdkBlock) {
8906
8808
  definition = transformSdkBlockToDefinition(sdkBlock);
@@ -8914,14 +8816,14 @@ var MemoBlockSection = React5.memo(function MemoBlockSection2({
8914
8816
  const validator = createManifestValidator(definition.manifest, { allowNull: false });
8915
8817
  const parsed = validator.safeParse(content);
8916
8818
  try {
8917
- const env = _optionalChain([globalThis, 'access', _99 => _99.process, 'optionalAccess', _100 => _100.env, 'optionalAccess', _101 => _101.NODE_ENV]);
8819
+ const env = _optionalChain([globalThis, 'access', _97 => _97.process, 'optionalAccess', _98 => _98.env, 'optionalAccess', _99 => _99.NODE_ENV]);
8918
8820
  if (env !== "production" && !parsed.success && !usePlaceholders) {
8919
8821
  console.warn("[blocks:PageRenderer] manifest validation failed", {
8920
8822
  blockId: _nullishCoalesce(block.id, () => ( null)),
8921
8823
  blockKind: block.kind,
8922
8824
  content: summarizeValue(content),
8923
8825
  expectedFields: (_nullishCoalesce(definition.manifest.fields, () => ( []))).map((f) => ({ id: f.id, type: f.type, required: !!f.required })),
8924
- issues: _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _102 => _102.error, 'optionalAccess', _103 => _103.issues]), () => ( null))
8826
+ issues: _nullishCoalesce(_optionalChain([parsed, 'optionalAccess', _100 => _100.error, 'optionalAccess', _101 => _101.issues]), () => ( null))
8925
8827
  });
8926
8828
  }
8927
8829
  } catch (e6) {
@@ -8942,44 +8844,52 @@ var MemoBlockSection = React5.memo(function MemoBlockSection2({
8942
8844
  return wrapBlock && block.id ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: wrapBlock(block.id, rendered) }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: rendered });
8943
8845
  }
8944
8846
  try {
8945
- const BlockComponent = _nullishCoalesce(OverrideComponent, () => ( getCachedBlockComponent(definition.manifest)));
8946
- const pathBase = typeof block.id === "string" && block.id.length > 0 ? `blocks.${block.id}.` : void 0;
8947
- const routes = _nullishCoalesce(routeMap, () => ( _optionalChain([dataContext, 'optionalAccess', _104 => _104.routes])));
8847
+ const routes = _nullishCoalesce(routeMap, () => ( _optionalChain([dataContext, 'optionalAccess', _102 => _102.routes])));
8948
8848
  const hydratedContent = routes ? hydrateManifestLinks(definition.manifest, data, routes) : data;
8949
8849
  const resolved = resolveBlockData({
8950
8850
  block,
8951
8851
  definition,
8952
8852
  dataContext
8953
8853
  });
8954
- const rootContext = {
8955
- $root: {
8956
- siteId: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _105 => _105.siteId]), () => ( null)),
8957
- pageId: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _106 => _106.pageId]), () => ( null)),
8958
- previewStage: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _107 => _107.previewStage]), () => ( "published")),
8959
- ...routes ? { routes } : {},
8960
- // Occurrence and content entry context for template pages
8961
- occurrenceContext: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _108 => _108.occurrenceContext]), () => ( null)),
8962
- contentEntry: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _109 => _109.contentEntry]), () => ( null))
8963
- }
8854
+ const baseProps = {
8855
+ content: hydratedContent,
8856
+ theme: themeTokens,
8857
+ themeConfig,
8858
+ data: resolved,
8859
+ blockId: _nullishCoalesce(block.id, () => ( null)),
8860
+ blockKind: block.kind
8964
8861
  };
8965
- const blockBindings = _nullishCoalesce(block.bindings, () => ( void 0));
8966
- const fragmentRegistry2 = getFragmentRegistry();
8967
- const rendered = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8968
- BlockComponent,
8969
- {
8970
- content: hydratedContent,
8971
- theme: themeTokens,
8972
- themeConfig,
8973
- registry,
8974
- pathBase,
8975
- data: resolved,
8976
- blockId: _nullishCoalesce(block.id, () => ( null)),
8977
- blockKind: block.kind,
8978
- blockBindings,
8979
- viewModelOverrides: rootContext,
8980
- fragmentRegistry: fragmentRegistry2
8981
- }
8982
- );
8862
+ let rendered;
8863
+ if (OverrideComponent) {
8864
+ rendered = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, OverrideComponent, { ...baseProps });
8865
+ } else {
8866
+ const BlockComponent = getCachedBlockComponent(definition.manifest);
8867
+ const pathBase = typeof block.id === "string" && block.id.length > 0 ? `blocks.${block.id}.` : void 0;
8868
+ const rootContext = {
8869
+ $root: {
8870
+ siteId: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _103 => _103.siteId]), () => ( null)),
8871
+ pageId: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _104 => _104.pageId]), () => ( null)),
8872
+ previewStage: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _105 => _105.previewStage]), () => ( "published")),
8873
+ ...routes ? { routes } : {},
8874
+ // Occurrence and content entry context for template pages
8875
+ occurrenceContext: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _106 => _106.occurrenceContext]), () => ( null)),
8876
+ contentEntry: _nullishCoalesce(_optionalChain([dataContext, 'optionalAccess', _107 => _107.contentEntry]), () => ( null))
8877
+ }
8878
+ };
8879
+ const blockBindings = _nullishCoalesce(block.bindings, () => ( void 0));
8880
+ const fragmentRegistry2 = getFragmentRegistry();
8881
+ rendered = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8882
+ BlockComponent,
8883
+ {
8884
+ ...baseProps,
8885
+ registry,
8886
+ pathBase,
8887
+ blockBindings,
8888
+ viewModelOverrides: rootContext,
8889
+ fragmentRegistry: fragmentRegistry2
8890
+ }
8891
+ );
8892
+ }
8983
8893
  if (wrapBlock && block.id) {
8984
8894
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: wrapBlock(block.id, rendered) });
8985
8895
  }
@@ -9000,7 +8910,7 @@ function resolveBlockData({ block, definition, dataContext }) {
9000
8910
  }
9001
8911
  const blockId = _nullishCoalesce(block.id, () => ( null));
9002
8912
  if (!blockId) return void 0;
9003
- const raw = _optionalChain([dataContext, 'optionalAccess', _110 => _110.resolvedData, 'optionalAccess', _111 => _111[blockId]]);
8913
+ const raw = _optionalChain([dataContext, 'optionalAccess', _108 => _108.resolvedData, 'optionalAccess', _109 => _109[blockId]]);
9004
8914
  if (!raw || typeof raw !== "object") {
9005
8915
  return {};
9006
8916
  }
@@ -9054,11 +8964,11 @@ var isNumber2 = (value) => typeof value === "number" && !isNaN(value);
9054
8964
  function resolveColor(color, theme) {
9055
8965
  if (!color || !isString2(color)) return null;
9056
8966
  const trimmed = color.trim();
9057
- if (_optionalChain([theme, 'optionalAccess', _112 => _112.palette, 'optionalAccess', _113 => _113[trimmed]])) {
8967
+ if (_optionalChain([theme, 'optionalAccess', _110 => _110.palette, 'optionalAccess', _111 => _111[trimmed]])) {
9058
8968
  return theme.palette[trimmed];
9059
8969
  }
9060
8970
  if (trimmed === "transparent") return "transparent";
9061
- if (trimmed === "surface" && _optionalChain([theme, 'optionalAccess', _114 => _114.palette, 'optionalAccess', _115 => _115.surface])) {
8971
+ if (trimmed === "surface" && _optionalChain([theme, 'optionalAccess', _112 => _112.palette, 'optionalAccess', _113 => _113.surface])) {
9062
8972
  return theme.palette.surface;
9063
8973
  }
9064
8974
  return trimmed;
@@ -9623,4 +9533,4 @@ chroma-js/src/utils/contrastAPCA.js:
9623
9533
  * https://readtech.org/ARC/
9624
9534
  *)
9625
9535
  */
9626
- //# sourceMappingURL=chunk-IT5ICP43.js.map
9536
+ //# sourceMappingURL=chunk-TKMA6D6U.js.map