@bagelink/blox 1.15.474 → 1.15.476

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.
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "./PreviewApp.vue_vue_type_style_index_0_lang-BWIYB9Ha.js";
1
+ import { _ as _sfc_main } from "./PreviewApp.vue_vue_type_style_index_0_lang-DrO2PTcS.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-tpv-FEao.cjs");
3
+ const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-DihIptYr.cjs");
4
4
  exports.default = PreviewApp_vue_vue_type_style_index_0_lang._sfc_main;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const routes = require("./routes-DAqHLDK2.cjs");
3
+ const routes = require("./routes-y2qluUdf.cjs");
4
4
  function sendToEditor(msg) {
5
5
  window.parent.postMessage(cloneForPostMessage(msg), "*");
6
6
  }
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, inject, ref, h, provide, onMounted, onUnmounted, openBlock, createElementBlock, createVNode, unref, nextTick } from "vue";
2
- import { e as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, f as BLOX_RUNTIME_KEY } from "./routes-Bs6eosZ6.js";
2
+ import { f as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, h as BLOX_RUNTIME_KEY } from "./routes-BLdP650Z.js";
3
3
  function sendToEditor(msg) {
4
4
  window.parent.postMessage(cloneForPostMessage(msg), "*");
5
5
  }
@@ -1,4 +1,5 @@
1
1
  import { CollectionItemsPage, PageResolveRead } from './types';
2
+ type CollectionResolver = (collection: string, options: ListItemsOptions) => Promise<Array<Record<string, unknown>>>;
2
3
  export declare function configureApi(websiteName: string, store: string): void;
3
4
  /**
4
5
  * Point blox's datastore client at an absolute API base (SSG/Node, where
@@ -6,6 +7,8 @@ export declare function configureApi(websiteName: string, store: string): void;
6
7
  * path prefix (e.g. `https://host` or `https://host/api`).
7
8
  */
8
9
  export declare function setApiOrigin(base: string): void;
10
+ /** Use an immutable build-time collection source instead of HTTP during SSR. */
11
+ export declare function setCollectionResolver(resolver: CollectionResolver | null): void;
9
12
  /** Synchronously read the resolved website id if already known (SSG-embedded or cached). */
10
13
  export declare function getWebsiteIdSync(): string | null;
11
14
  export declare function getWebsiteId(): Promise<string>;
@@ -35,4 +38,5 @@ export declare function getItemBySlug<T = Record<string, unknown>>(collection: s
35
38
  * Returns null if the item isn't available in that locale (datastore 406/404).
36
39
  */
37
40
  export declare function getItemById<T = Record<string, unknown>>(collection: string, id: string, locale?: string): Promise<T | null>;
41
+ export {};
38
42
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA;AAahF,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAIrE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAU/C;AAuBD,4FAA4F;AAC5F,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAOhD;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAiBpD;AAED,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAMxF;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,CAAC,CAAC,EAA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s CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const routes = require("./routes-DAqHLDK2.cjs");
4
- const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-tpv-FEao.cjs");
3
+ const routes = require("./routes-y2qluUdf.cjs");
4
+ const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-DihIptYr.cjs");
5
5
  const vue = require("vue");
6
6
  const vueRouter = require("vue-router");
7
7
  const pinia = require("pinia");
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { h as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, n as normalizeLink, f as BLOX_RUNTIME_KEY, j as useSeo, k as getRegistryData, l as getItemBySlug, m as getItemById, o as getContentRoute, p as provideBloxData, d as createBlox, g as generateContentRoutes, q as installContentFallback, i as installLocaleAwareResolve, a as setActiveLocale, t as installSmartLinks, v as consumePendingLocaleSwitch } from "./routes-Bs6eosZ6.js";
2
- import { _, w, x, y, B, z, A, C, D, E, P, F, G, c, b, H, I, J, K, L, M, N, O, Q, R, S, T, r, U, s, V, W, X, Y } from "./routes-Bs6eosZ6.js";
3
- import { _ as _2, P as P2, s as s2, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-BWIYB9Ha.js";
1
+ import { j as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, n as normalizeLink, h as BLOX_RUNTIME_KEY, k as useSeo, l as getRegistryData, m as getItemBySlug, o as getItemById, q as getContentRoute, p as provideBloxData, e as createBlox, g as generateContentRoutes, t as installContentFallback, i as installLocaleAwareResolve, b as setActiveLocale, v as installSmartLinks, w as consumePendingLocaleSwitch } from "./routes-BLdP650Z.js";
2
+ import { _, x, y, z, B, A, C, D, E, F, P, G, H, c, d, I, J, K, L, M, N, O, Q, R, S, T, U, r, V, s, W, X, Y, Z } from "./routes-BLdP650Z.js";
3
+ import { _ as _2, P as P2, s as s2, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-DrO2PTcS.js";
4
4
  import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, Transition, resolveDynamicComponent, inject, ref, watch, onMounted, onUnmounted, computed, onServerPrefetch, toValue, createApp, h, Suspense, markRaw } from "vue";
5
5
  import { useRouter, useRoute } from "vue-router";
6
6
  import { createPinia } from "pinia";
@@ -359,7 +359,7 @@ function definitionToEntry(type, def) {
359
359
  };
360
360
  }
361
361
  function serializeRegistry(registry) {
362
- const blocks = Object.entries(registry).map(([type, def]) => definitionToEntry(type, def)).sort((a2, b2) => (a2.order ?? 100) - (b2.order ?? 100) || a2.label.localeCompare(b2.label));
362
+ const blocks = Object.entries(registry).map(([type, def]) => definitionToEntry(type, def)).sort((a2, b) => (a2.order ?? 100) - (b.order ?? 100) || a2.label.localeCompare(b.label));
363
363
  return { version: MANIFEST_VERSION, blocks };
364
364
  }
365
365
  function buildBloxManifest(blox) {
@@ -367,62 +367,62 @@ function buildBloxManifest(blox) {
367
367
  }
368
368
  export {
369
369
  _ as AdminEditBar,
370
- w as BLOX_ADMIN_CONFIG_KEY,
371
- x as BLOX_CONFIG_KEY,
372
- y as BLOX_DATA_KEY,
370
+ x as BLOX_ADMIN_CONFIG_KEY,
371
+ y as BLOX_CONFIG_KEY,
372
+ z as BLOX_DATA_KEY,
373
373
  B as BLOX_DATA_WINDOW_KEY,
374
- z as BLOX_LAYOUT_KEY,
374
+ A as BLOX_LAYOUT_KEY,
375
375
  BLOX_LOCALE_STRATEGY_KEY,
376
376
  BLOX_RUNTIME_KEY,
377
- A as BloxInstance,
377
+ C as BloxInstance,
378
378
  _sfc_main as BloxRouterView,
379
- C as CmsPageView,
380
- D as ContentDetailView,
381
- E as ContentHost,
379
+ D as CmsPageView,
380
+ E as ContentDetailView,
381
+ F as ContentHost,
382
382
  P as PageRenderer,
383
383
  _2 as PreviewApp,
384
384
  P2 as PreviewRenderer,
385
- F as applyLayoutChrome,
385
+ G as applyLayoutChrome,
386
386
  buildBloxManifest,
387
- G as classifyLink,
387
+ H as classifyLink,
388
388
  c as collectBloxData,
389
- b as collectBloxSeo,
390
- H as configureApi,
391
- I as contentRoutes,
389
+ d as collectBloxSeo,
390
+ I as configureApi,
391
+ J as contentRoutes,
392
392
  createBlox,
393
393
  createBloxApp,
394
394
  defineBlock,
395
- J as defineContent,
395
+ K as defineContent,
396
396
  generateContentRoutes,
397
397
  getContentRoute,
398
- K as getContentRouteByCollection,
398
+ L as getContentRouteByCollection,
399
399
  getItemById,
400
400
  getItemBySlug,
401
- L as getWebsiteId,
402
- M as getWebsiteIdSync,
401
+ M as getWebsiteId,
402
+ N as getWebsiteIdSync,
403
403
  injectPlausible,
404
404
  installContentFallback,
405
405
  installSmartLinks,
406
- N as isAbsoluteExternal,
407
- O as isSoloContentPage,
408
- Q as isSpecialScheme,
409
- R as listItems,
406
+ O as isAbsoluteExternal,
407
+ Q as isSoloContentPage,
408
+ R as isSpecialScheme,
409
+ S as listItems,
410
410
  normalizeLink,
411
- S as normalizeTo,
411
+ T as normalizeTo,
412
412
  provideBloxData,
413
- T as provideContentItem,
413
+ U as provideContentItem,
414
414
  r as resolveBlockProps,
415
- U as resolvePath,
415
+ V as resolvePath,
416
416
  s2 as sendToEditor,
417
417
  a as sendToPreview,
418
418
  serializeRegistry,
419
419
  s as setApiOrigin,
420
- V as toInternalPath,
421
- W as useBloxEdit,
420
+ W as toInternalPath,
421
+ X as useBloxEdit,
422
422
  useBloxRuntime,
423
- X as useContentItem,
423
+ Y as useContentItem,
424
424
  useContentSeo,
425
- Y as useData,
425
+ Z as useData,
426
426
  useGlobalBlock,
427
427
  useLocale,
428
428
  useLocaleNav,
@@ -11,6 +11,7 @@ let _websiteName = "";
11
11
  let _store = "";
12
12
  let _websiteId = null;
13
13
  let _origin = "";
14
+ let _collectionResolver = null;
14
15
  function configureApi(websiteName, store) {
15
16
  _websiteName = websiteName;
16
17
  _store = store;
@@ -25,6 +26,9 @@ function setApiOrigin(base) {
25
26
  } catch {
26
27
  }
27
28
  }
29
+ function setCollectionResolver(resolver) {
30
+ _collectionResolver = resolver;
31
+ }
28
32
  async function request(path, { locale: locale2, params, ...opts } = {}) {
29
33
  const origin = _origin || (typeof window !== "undefined" ? window.location.origin : "");
30
34
  const url = new URL(`${BASE}${path}`, origin || void 0);
@@ -68,6 +72,9 @@ async function resolvePath(path, locale2) {
68
72
  });
69
73
  }
70
74
  async function listItems(collection, { locale: locale2, q, offset = 0, limit = 100 } = {}) {
75
+ if (_collectionResolver) {
76
+ return await _collectionResolver(collection, { locale: locale2, q, offset, limit });
77
+ }
71
78
  return request(`/datastore/${_store}/collections/${collection}`, {
72
79
  locale: locale2,
73
80
  params: { ...q ? { q } : {}, offset, limit }
@@ -904,7 +911,7 @@ class BloxInstance {
904
911
  }
905
912
  router.addRoute({
906
913
  path: "/_blox_preview",
907
- component: () => import("./PreviewApp-CTq4OGBA.js"),
914
+ component: () => import("./PreviewApp-CCP5TufQ.js"),
908
915
  beforeEnter: () => window.parent !== window ? true : "/"
909
916
  });
910
917
  router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$2 });
@@ -1187,56 +1194,57 @@ function installContentFallback(router, supportedLocales, defaultLocale) {
1187
1194
  });
1188
1195
  }
1189
1196
  export {
1190
- BloxInstance as A,
1197
+ BLOX_LAYOUT_KEY as A,
1191
1198
  BLOX_DATA_WINDOW_KEY as B,
1192
- _sfc_main$2 as C,
1193
- _sfc_main$1 as D,
1194
- _sfc_main as E,
1195
- applyLayoutChrome as F,
1196
- classifyLink as G,
1197
- configureApi as H,
1198
- contentRoutes as I,
1199
- defineContent as J,
1200
- getContentRouteByCollection as K,
1201
- getWebsiteId as L,
1202
- getWebsiteIdSync as M,
1203
- isAbsoluteExternal as N,
1204
- isSoloContentPage as O,
1199
+ BloxInstance as C,
1200
+ _sfc_main$2 as D,
1201
+ _sfc_main$1 as E,
1202
+ _sfc_main as F,
1203
+ applyLayoutChrome as G,
1204
+ classifyLink as H,
1205
+ configureApi as I,
1206
+ contentRoutes as J,
1207
+ defineContent as K,
1208
+ getContentRouteByCollection as L,
1209
+ getWebsiteId as M,
1210
+ getWebsiteIdSync as N,
1211
+ isAbsoluteExternal as O,
1205
1212
  PageRenderer as P,
1206
- isSpecialScheme as Q,
1207
- listItems as R,
1208
- normalizeTo as S,
1209
- provideContentItem as T,
1210
- resolvePath as U,
1211
- toInternalPath as V,
1212
- useBloxEdit as W,
1213
- useContentItem as X,
1214
- useData as Y,
1213
+ isSoloContentPage as Q,
1214
+ isSpecialScheme as R,
1215
+ listItems as S,
1216
+ normalizeTo as T,
1217
+ provideContentItem as U,
1218
+ resolvePath as V,
1219
+ toInternalPath as W,
1220
+ useBloxEdit as X,
1221
+ useContentItem as Y,
1222
+ useData as Z,
1215
1223
  _sfc_main$3 as _,
1216
- setActiveLocale as a,
1217
- collectBloxSeo as b,
1224
+ setCollectionResolver as a,
1225
+ setActiveLocale as b,
1218
1226
  collectBloxData as c,
1219
- createBlox as d,
1220
- BLOX_REGISTRY_KEY as e,
1221
- BLOX_RUNTIME_KEY as f,
1227
+ collectBloxSeo as d,
1228
+ createBlox as e,
1229
+ BLOX_REGISTRY_KEY as f,
1222
1230
  generateContentRoutes as g,
1223
- BLOX_LOCALE_STRATEGY_KEY as h,
1231
+ BLOX_RUNTIME_KEY as h,
1224
1232
  installLocaleAwareResolve as i,
1225
- useSeo as j,
1226
- getRegistryData as k,
1227
- getItemBySlug as l,
1228
- getItemById as m,
1233
+ BLOX_LOCALE_STRATEGY_KEY as j,
1234
+ useSeo as k,
1235
+ getRegistryData as l,
1236
+ getItemBySlug as m,
1229
1237
  normalizeLink as n,
1230
- getContentRoute as o,
1238
+ getItemById as o,
1231
1239
  provideBloxData as p,
1232
- installContentFallback as q,
1240
+ getContentRoute as q,
1233
1241
  resolveBlockProps as r,
1234
1242
  setApiOrigin as s,
1235
- installSmartLinks as t,
1243
+ installContentFallback as t,
1236
1244
  useLocale as u,
1237
- consumePendingLocaleSwitch as v,
1238
- BLOX_ADMIN_CONFIG_KEY as w,
1239
- BLOX_CONFIG_KEY as x,
1240
- BLOX_DATA_KEY as y,
1241
- BLOX_LAYOUT_KEY as z
1245
+ installSmartLinks as v,
1246
+ consumePendingLocaleSwitch as w,
1247
+ BLOX_ADMIN_CONFIG_KEY as x,
1248
+ BLOX_CONFIG_KEY as y,
1249
+ BLOX_DATA_KEY as z
1242
1250
  };
@@ -12,6 +12,7 @@ let _websiteName = "";
12
12
  let _store = "";
13
13
  let _websiteId = null;
14
14
  let _origin = "";
15
+ let _collectionResolver = null;
15
16
  function configureApi(websiteName, store) {
16
17
  _websiteName = websiteName;
17
18
  _store = store;
@@ -26,6 +27,9 @@ function setApiOrigin(base) {
26
27
  } catch {
27
28
  }
28
29
  }
30
+ function setCollectionResolver(resolver) {
31
+ _collectionResolver = resolver;
32
+ }
29
33
  async function request(path, { locale: locale2, params, ...opts } = {}) {
30
34
  const origin = _origin || (typeof window !== "undefined" ? window.location.origin : "");
31
35
  const url = new URL(`${BASE}${path}`, origin || void 0);
@@ -69,6 +73,9 @@ async function resolvePath(path, locale2) {
69
73
  });
70
74
  }
71
75
  async function listItems(collection, { locale: locale2, q, offset = 0, limit = 100 } = {}) {
76
+ if (_collectionResolver) {
77
+ return await _collectionResolver(collection, { locale: locale2, q, offset, limit });
78
+ }
72
79
  return request(`/datastore/${_store}/collections/${collection}`, {
73
80
  locale: locale2,
74
81
  params: { ...q ? { q } : {}, offset, limit }
@@ -905,7 +912,7 @@ class BloxInstance {
905
912
  }
906
913
  router.addRoute({
907
914
  path: "/_blox_preview",
908
- component: () => Promise.resolve().then(() => require("./PreviewApp-C3lNxUYR.cjs")),
915
+ component: () => Promise.resolve().then(() => require("./PreviewApp-DdTJYLaU.cjs")),
909
916
  beforeEnter: () => window.parent !== window ? true : "/"
910
917
  });
911
918
  router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$2 });
@@ -1233,6 +1240,7 @@ exports.resolveBlockProps = resolveBlockProps;
1233
1240
  exports.resolvePath = resolvePath;
1234
1241
  exports.setActiveLocale = setActiveLocale;
1235
1242
  exports.setApiOrigin = setApiOrigin;
1243
+ exports.setCollectionResolver = setCollectionResolver;
1236
1244
  exports.toInternalPath = toInternalPath;
1237
1245
  exports.useBloxEdit = useBloxEdit;
1238
1246
  exports.useContentItem = useContentItem;
@@ -3,6 +3,7 @@ import { Router } from 'vue-router';
3
3
  import { BlockModule } from '../defineBlock';
4
4
  import { RenderContext, RenderResult } from './prerender';
5
5
  import { BloxBuildRequestOptions } from './build-request';
6
+ import { ListItemsOptions } from '../api';
6
7
  export interface CreateBloxSSREntryOptions {
7
8
  /** Root Vue component (App.vue). */
8
9
  rootComponent: Component;
@@ -25,6 +26,8 @@ export interface CreateBloxSSREntryOptions {
25
26
  apiBase?: string;
26
27
  /** Build-only authentication/headers. Defaults to BLOX_BUILD_TOKEN env. */
27
28
  buildRequest?: BloxBuildRequestOptions;
29
+ /** Immutable build-time datastore resolver used by content routes and SEO. */
30
+ collectionResolver?: (collection: string, options: ListItemsOptions) => Promise<Array<Record<string, unknown>>>;
28
31
  /** Default locale. @default 'en' */
29
32
  locale?: string;
30
33
  /** Supported locales. @default [locale] */
@@ -1 +1 @@
1
- {"version":3,"file":"createSSREntry.d.ts","sourceRoot":"","sources":["../../src/ssg/createSSREntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAW9D,MAAM,WAAW,yBAAyB;IACzC,oCAAoC;IACpC,aAAa,EAAE,SAAS,CAAA;IACxB;;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G,CAAC,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAA;IAC5E;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAC5C,kDAAkD;IAClD,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,YAAY;IAC5B,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IAClE,0EAA0E;IAC1E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CAyLnF"}
@@ -26,7 +26,7 @@ const llmArtifacts = require("../prerender-JdRKimQ5.cjs");
26
26
  const ssg_client = require("./client.cjs");
27
27
  const pinia = require("pinia");
28
28
  const vue = require("vue");
29
- const routes = require("../routes-DAqHLDK2.cjs");
29
+ const routes = require("../routes-y2qluUdf.cjs");
30
30
  async function renderBloxSsgPage(options) {
31
31
  var _a, _b, _c;
32
32
  const {
@@ -128,6 +128,7 @@ function createBloxSSREntry(options) {
128
128
  const apiBase = options.apiBase ?? (typeof process !== "undefined" ? (_a = process.env) == null ? void 0 : _a.BAGELINK_API_URL : void 0) ?? "https://api.bagel.to";
129
129
  let websiteIdCache = null;
130
130
  routes.setApiOrigin(apiBase);
131
+ routes.setCollectionResolver(options.collectionResolver ?? null);
131
132
  async function getWebsiteId() {
132
133
  if (websiteIdCache) return websiteIdCache;
133
134
  const data = await llmArtifacts.bloxBuildJson(`${apiBase}/blox/websites`, {}, options.buildRequest);
@@ -4,7 +4,7 @@ import { BLOX_STATE_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs"
4
4
  import { BLOX_COLLECTIONS_WINDOW_KEY, BLOX_DATA_WINDOW_KEY, BLOX_PAGE_SEO_WINDOW_KEY, getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
5
5
  import { createPinia } from "pinia";
6
6
  import { createSSRApp, h, Suspense, markRaw } from "vue";
7
- import { B as BLOX_DATA_WINDOW_KEY2, s as setApiOrigin, a as setActiveLocale, c as collectBloxData, b as collectBloxSeo, p as provideBloxData, d as createBlox, g as generateContentRoutes, i as installLocaleAwareResolve } from "../routes-Bs6eosZ6.js";
7
+ import { B as BLOX_DATA_WINDOW_KEY2, s as setApiOrigin, a as setCollectionResolver, b as setActiveLocale, c as collectBloxData, d as collectBloxSeo, p as provideBloxData, e as createBlox, g as generateContentRoutes, i as installLocaleAwareResolve } from "../routes-BLdP650Z.js";
8
8
  async function renderBloxSsgPage(options) {
9
9
  var _a, _b, _c;
10
10
  const {
@@ -106,6 +106,7 @@ function createBloxSSREntry(options) {
106
106
  const apiBase = options.apiBase ?? (typeof process !== "undefined" ? (_a = process.env) == null ? void 0 : _a.BAGELINK_API_URL : void 0) ?? "https://api.bagel.to";
107
107
  let websiteIdCache = null;
108
108
  setApiOrigin(apiBase);
109
+ setCollectionResolver(options.collectionResolver ?? null);
109
110
  async function getWebsiteId() {
110
111
  if (websiteIdCache) return websiteIdCache;
111
112
  const data = await bloxBuildJson(`${apiBase}/blox/websites`, {}, options.buildRequest);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.15.474",
4
+ "version": "1.15.476",
5
5
  "description": "Blox page builder library for drag-and-drop page building and static data management",
6
6
  "author": {
7
7
  "name": "Bagel Studio",