@bagelink/blox 1.15.471 → 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-CeKeWiF0.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-CEh91Yrm.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-CKAgyLxC.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-CQJBBmcV.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,EAAE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15 @@
5
5
  * using `currentAlternates[targetLocale]` when set (e.g. legal pages with
6
6
  * per-locale paths). Falls back to the current URL slug, then home.
7
7
  * - `toPath(slug)` — returns the locale-aware path for any slug.
8
+ * - `localePath(locale, slug)` — builds a path for an explicit target locale.
8
9
  * - `availableLocales` — locales this page can switch to (CMS alternates when
9
10
  * set; otherwise all strategy locales).
10
11
  * - `detect(path)` — strip locale prefix from a path → `{ locale, slug }`.
11
12
  */
12
13
  export declare function useLocaleNav(): {
13
14
  switchLocale: (targetLocale: string) => void;
14
- localePath: (targetLocale: string) => string;
15
15
  toPath: (slug: string) => string;
16
+ localePath: (targetLocale: string, slug?: string) => string;
16
17
  detect: (path: string) => {
17
18
  locale: string;
18
19
  slug: string;
@@ -1 +1 @@
1
- {"version":3,"file":"useLocaleNav.d.ts","sourceRoot":"","sources":["../../src/composables/useLocaleNav.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY;iCAYS,MAAM;+BA0BR,MAAM,KAAG,MAAM;mBAR3B,MAAM,KAAG,MAAM;mBA2Bf,MAAM,KAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;;;EAa/D"}
1
+ {"version":3,"file":"useLocaleNav.d.ts","sourceRoot":"","sources":["../../src/composables/useLocaleNav.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY;iCAYS,MAAM;mBAkBpB,MAAM,KAAG,MAAM;+BAOH,MAAM,oBAAe,MAAM;mBAYvC,MAAM,KAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;;;EAa/D"}
@@ -38,11 +38,10 @@ export declare function installLocaleAwareResolve(router: Router, strategy: Loca
38
38
  /**
39
39
  * Cross-locale fallback for content detail routes.
40
40
  *
41
- * If a content URL's slug isn't available in the URL's locale but the entity
42
- * exists in another locale, REDIRECT to that locale's URL (real navigation →
43
- * correct URL, correct hreflang, no content/URL mismatch). Order: URL locale
44
- * default locale any available locale. Only runs for content routes; anything
45
- * unresolved falls through untouched (soft not-found handled by the view).
41
+ * If a content URL's slug isn't available in the URL's locale but identifies an
42
+ * entity in another locale, redirect to that same entity's translated slug.
43
+ * Unknown entities fall back to the requested locale's home instead of leaving
44
+ * a detail URL that renders an empty site shell.
46
45
  */
47
46
  export declare function installContentFallback(router: Router, supportedLocales: string[], defaultLocale: string): void;
48
47
  //# sourceMappingURL=routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/content/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAOvD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACpC,gBAAgB,EAAE,MAAM,EAAE,EAC1B,aAAa,EAAE,MAAM,GACnB,cAAc,EAAE,CA4BlB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,GACtB,IAAI,CA4BN;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EAAE,EAC1B,aAAa,EAAE,MAAM,GACnB,IAAI,CAsCN"}
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../src/content/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAOvD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACpC,gBAAgB,EAAE,MAAM,EAAE,EAC1B,aAAa,EAAE,MAAM,GACnB,cAAc,EAAE,CA4BlB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACxC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,cAAc,GACtB,IAAI,CA4BN;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,MAAM,EAAE,EAC1B,aAAa,EAAE,MAAM,GACnB,IAAI,CA8CN"}
@@ -1 +1 @@
1
- {"version":3,"file":"useContentSeo.d.ts","sourceRoot":"","sources":["../../src/content/useContentSeo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAI3C,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG7C,KAAK,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC5B,IAAI,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,EAC1C,IAAI,EAAE,MAAM,QAAQ,GAAG,IAAI,GAAG,SAAS,GACrC,IAAI,CAmDN"}
1
+ {"version":3,"file":"useContentSeo.d.ts","sourceRoot":"","sources":["../../src/content/useContentSeo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAI3C,OAAO,EAA2B,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG3E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAG7C,KAAK,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC5B,IAAI,EAAE,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,EAC1C,IAAI,EAAE,MAAM,QAAQ,GAAG,IAAI,GAAG,SAAS,GACrC,IAAI,CAqDN"}
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const routes = require("./routes-CKAgyLxC.cjs");
4
- const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-CEh91Yrm.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");
@@ -103,13 +103,10 @@ function useLocaleNav() {
103
103
  const loc = String(locale.value || "").slice(0, 2).toLowerCase();
104
104
  return strategy.toPath(normalized, loc || void 0);
105
105
  }
106
- function localePath(targetLocale) {
107
- if (!strategy) return "/";
108
- const alts = currentAlternates.value;
109
- const hostname = typeof window !== "undefined" ? window.location.hostname : "";
110
- const { slug: currentSlug } = strategy.detect(hostname, router.currentRoute.value.path);
111
- const alternateSlug = alts[targetLocale] ?? alts[strategy.defaultLocale] ?? currentSlug ?? "/";
112
- return strategy.toPath(alternateSlug, targetLocale);
106
+ function localePath(targetLocale, slug = "/") {
107
+ const normalized = routes.normalizeLink(slug) ?? slug;
108
+ if (!strategy) return normalized;
109
+ return strategy.toPath(normalized, targetLocale);
113
110
  }
114
111
  function detect(path) {
115
112
  const def = (strategy == null ? void 0 : strategy.defaultLocale) ?? String(locale.value || "en");
@@ -122,7 +119,7 @@ function useLocaleNav() {
122
119
  }
123
120
  return { locale: def, slug: path || "/" };
124
121
  }
125
- return { switchLocale, localePath, toPath, detect, availableLocales, locale };
122
+ return { switchLocale, toPath, localePath, detect, availableLocales, locale };
126
123
  }
127
124
  function usePageContext(key) {
128
125
  const contexts = vue.inject("contexts");
@@ -162,7 +159,8 @@ function useContentSeo(item, head) {
162
159
  if (!reg) return;
163
160
  const slug = String(((_a = route == null ? void 0 : route.params) == null ? void 0 : _a.slug) ?? ((_b = vue.toValue(item)) == null ? void 0 : _b.slug) ?? "");
164
161
  const activeLoc = String(locale.value || "en").slice(0, 2).toLowerCase();
165
- const entity = slug ? await routes.getItemBySlug(reg.collection, slug, activeLoc).catch(() => null) : vue.toValue(item);
162
+ const activeItem = vue.toValue(item);
163
+ const entity = activeItem ?? (slug ? await routes.getItemBySlug(reg.collection, slug, activeLoc).catch(() => null) : null);
166
164
  if (!entity) return;
167
165
  const id = String(entity.id ?? entity._id ?? "");
168
166
  const supported = (strategy == null ? void 0 : strategy.locales) ?? [locale.value];
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-CQJBBmcV.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-CQJBBmcV.js";
3
- import { _ as _2, P as P2, s as s2, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-CeKeWiF0.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";
@@ -102,13 +102,10 @@ function useLocaleNav() {
102
102
  const loc = String(locale.value || "").slice(0, 2).toLowerCase();
103
103
  return strategy.toPath(normalized, loc || void 0);
104
104
  }
105
- function localePath(targetLocale) {
106
- if (!strategy) return "/";
107
- const alts = currentAlternates.value;
108
- const hostname = typeof window !== "undefined" ? window.location.hostname : "";
109
- const { slug: currentSlug } = strategy.detect(hostname, router.currentRoute.value.path);
110
- const alternateSlug = alts[targetLocale] ?? alts[strategy.defaultLocale] ?? currentSlug ?? "/";
111
- return strategy.toPath(alternateSlug, targetLocale);
105
+ function localePath(targetLocale, slug = "/") {
106
+ const normalized = normalizeLink(slug) ?? slug;
107
+ if (!strategy) return normalized;
108
+ return strategy.toPath(normalized, targetLocale);
112
109
  }
113
110
  function detect(path) {
114
111
  const def = (strategy == null ? void 0 : strategy.defaultLocale) ?? String(locale.value || "en");
@@ -121,7 +118,7 @@ function useLocaleNav() {
121
118
  }
122
119
  return { locale: def, slug: path || "/" };
123
120
  }
124
- return { switchLocale, localePath, toPath, detect, availableLocales, locale };
121
+ return { switchLocale, toPath, localePath, detect, availableLocales, locale };
125
122
  }
126
123
  function usePageContext(key) {
127
124
  const contexts = inject("contexts");
@@ -161,7 +158,8 @@ function useContentSeo(item, head) {
161
158
  if (!reg) return;
162
159
  const slug = String(((_a = route == null ? void 0 : route.params) == null ? void 0 : _a.slug) ?? ((_b = toValue(item)) == null ? void 0 : _b.slug) ?? "");
163
160
  const activeLoc = String(locale.value || "en").slice(0, 2).toLowerCase();
164
- const entity = slug ? await getItemBySlug(reg.collection, slug, activeLoc).catch(() => null) : toValue(item);
161
+ const activeItem = toValue(item);
162
+ const entity = activeItem ?? (slug ? await getItemBySlug(reg.collection, slug, activeLoc).catch(() => null) : null);
165
163
  if (!entity) return;
166
164
  const id = String(entity.id ?? entity._id ?? "");
167
165
  const supported = (strategy == null ? void 0 : strategy.locales) ?? [locale.value];
@@ -361,7 +359,7 @@ function definitionToEntry(type, def) {
361
359
  };
362
360
  }
363
361
  function serializeRegistry(registry) {
364
- 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));
365
363
  return { version: MANIFEST_VERSION, blocks };
366
364
  }
367
365
  function buildBloxManifest(blox) {
@@ -369,62 +367,62 @@ function buildBloxManifest(blox) {
369
367
  }
370
368
  export {
371
369
  _ as AdminEditBar,
372
- w as BLOX_ADMIN_CONFIG_KEY,
373
- x as BLOX_CONFIG_KEY,
374
- y as BLOX_DATA_KEY,
370
+ x as BLOX_ADMIN_CONFIG_KEY,
371
+ y as BLOX_CONFIG_KEY,
372
+ z as BLOX_DATA_KEY,
375
373
  B as BLOX_DATA_WINDOW_KEY,
376
- z as BLOX_LAYOUT_KEY,
374
+ A as BLOX_LAYOUT_KEY,
377
375
  BLOX_LOCALE_STRATEGY_KEY,
378
376
  BLOX_RUNTIME_KEY,
379
- A as BloxInstance,
377
+ C as BloxInstance,
380
378
  _sfc_main as BloxRouterView,
381
- C as CmsPageView,
382
- D as ContentDetailView,
383
- E as ContentHost,
379
+ D as CmsPageView,
380
+ E as ContentDetailView,
381
+ F as ContentHost,
384
382
  P as PageRenderer,
385
383
  _2 as PreviewApp,
386
384
  P2 as PreviewRenderer,
387
- F as applyLayoutChrome,
385
+ G as applyLayoutChrome,
388
386
  buildBloxManifest,
389
- G as classifyLink,
387
+ H as classifyLink,
390
388
  c as collectBloxData,
391
- b as collectBloxSeo,
392
- H as configureApi,
393
- I as contentRoutes,
389
+ d as collectBloxSeo,
390
+ I as configureApi,
391
+ J as contentRoutes,
394
392
  createBlox,
395
393
  createBloxApp,
396
394
  defineBlock,
397
- J as defineContent,
395
+ K as defineContent,
398
396
  generateContentRoutes,
399
397
  getContentRoute,
400
- K as getContentRouteByCollection,
398
+ L as getContentRouteByCollection,
401
399
  getItemById,
402
400
  getItemBySlug,
403
- L as getWebsiteId,
404
- M as getWebsiteIdSync,
401
+ M as getWebsiteId,
402
+ N as getWebsiteIdSync,
405
403
  injectPlausible,
406
404
  installContentFallback,
407
405
  installSmartLinks,
408
- N as isAbsoluteExternal,
409
- O as isSoloContentPage,
410
- Q as isSpecialScheme,
411
- R as listItems,
406
+ O as isAbsoluteExternal,
407
+ Q as isSoloContentPage,
408
+ R as isSpecialScheme,
409
+ S as listItems,
412
410
  normalizeLink,
413
- S as normalizeTo,
411
+ T as normalizeTo,
414
412
  provideBloxData,
415
- T as provideContentItem,
413
+ U as provideContentItem,
416
414
  r as resolveBlockProps,
417
- U as resolvePath,
415
+ V as resolvePath,
418
416
  s2 as sendToEditor,
419
417
  a as sendToPreview,
420
418
  serializeRegistry,
421
419
  s as setApiOrigin,
422
- V as toInternalPath,
423
- W as useBloxEdit,
420
+ W as toInternalPath,
421
+ X as useBloxEdit,
424
422
  useBloxRuntime,
425
- X as useContentItem,
423
+ Y as useContentItem,
426
424
  useContentSeo,
427
- Y as useData,
425
+ Z as useData,
428
426
  useGlobalBlock,
429
427
  useLocale,
430
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,20 +72,26 @@ 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 }
74
81
  });
75
82
  }
76
83
  async function getItemBySlug(collection, slug, locale2) {
77
- const res = await listItems(collection, { locale: locale2, q: `slug eq "${slug}"`, limit: 1 });
84
+ const res = await listItems(collection, { locale: locale2, limit: 1e3 });
78
85
  const items = Array.isArray(res) ? res : (res == null ? void 0 : res.items) ?? [];
79
- return items[0] ?? null;
86
+ return items.find((item) => String((item == null ? void 0 : item.slug) ?? "") === slug) ?? null;
80
87
  }
81
88
  async function getItemById(collection, id, locale2) {
82
- const res = await listItems(collection, { locale: locale2, q: `id eq "${id}"`, limit: 1 });
89
+ const res = await listItems(collection, { locale: locale2, limit: 1e3 });
83
90
  const items = Array.isArray(res) ? res : (res == null ? void 0 : res.items) ?? [];
84
- return items[0] ?? null;
91
+ return items.find((item) => {
92
+ const record = item;
93
+ return String((record == null ? void 0 : record.id) ?? (record == null ? void 0 : record._id) ?? "") === id;
94
+ }) ?? null;
85
95
  }
86
96
  const BLOX_REGISTRY_KEY = Symbol("blox:registry");
87
97
  const BLOX_CONFIG_KEY = Symbol("blox:config");
@@ -901,7 +911,7 @@ class BloxInstance {
901
911
  }
902
912
  router.addRoute({
903
913
  path: "/_blox_preview",
904
- component: () => import("./PreviewApp-WPsOZrDv.js"),
914
+ component: () => import("./PreviewApp-CCP5TufQ.js"),
905
915
  beforeEnter: () => window.parent !== window ? true : "/"
906
916
  });
907
917
  router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$2 });
@@ -1161,70 +1171,80 @@ function installContentFallback(router, supportedLocales, defaultLocale) {
1161
1171
  const urlLocale = localeOf(to.path);
1162
1172
  const here = await getItemBySlug(registration.collection, slug, urlLocale).catch(() => null);
1163
1173
  if (here) return true;
1164
- const probe = await getItemBySlug(registration.collection, slug).catch(() => null);
1165
- const available = Array.isArray(probe == null ? void 0 : probe.available_locales) ? probe.available_locales : [];
1166
- const target = [defaultLocale, ...supportedLocales].find(
1167
- (l) => l !== urlLocale && available.includes(l)
1168
- );
1169
- if (!target || !probe) return true;
1170
- const targetItem = await getItemBySlug(registration.collection, slug, target).catch(() => null);
1171
- const targetSlug = String((targetItem == null ? void 0 : targetItem.slug) ?? slug);
1172
- const barePath = registration.route.replace(/:slug(?=\/|$)/, targetSlug);
1173
- const redirect = target === defaultLocale ? barePath : `/${target}${barePath}`;
1174
- return redirect;
1174
+ for (const sourceLocale of [defaultLocale, ...supportedLocales]) {
1175
+ if (sourceLocale === urlLocale) continue;
1176
+ const source = await getItemBySlug(
1177
+ registration.collection,
1178
+ slug,
1179
+ sourceLocale
1180
+ ).catch(() => null);
1181
+ const id = String((source == null ? void 0 : source.id) ?? (source == null ? void 0 : source._id) ?? "");
1182
+ if (!id) continue;
1183
+ const target = await getItemById(
1184
+ registration.collection,
1185
+ id,
1186
+ urlLocale
1187
+ ).catch(() => null);
1188
+ const targetSlug = String((target == null ? void 0 : target.slug) ?? "");
1189
+ if (!targetSlug) break;
1190
+ const barePath = registration.route.replace(/:slug(?=\/|$)/, targetSlug);
1191
+ return urlLocale === defaultLocale ? barePath : `/${urlLocale}${barePath}`;
1192
+ }
1193
+ return urlLocale === defaultLocale ? "/" : `/${urlLocale}`;
1175
1194
  });
1176
1195
  }
1177
1196
  export {
1178
- BloxInstance as A,
1197
+ BLOX_LAYOUT_KEY as A,
1179
1198
  BLOX_DATA_WINDOW_KEY as B,
1180
- _sfc_main$2 as C,
1181
- _sfc_main$1 as D,
1182
- _sfc_main as E,
1183
- applyLayoutChrome as F,
1184
- classifyLink as G,
1185
- configureApi as H,
1186
- contentRoutes as I,
1187
- defineContent as J,
1188
- getContentRouteByCollection as K,
1189
- getWebsiteId as L,
1190
- getWebsiteIdSync as M,
1191
- isAbsoluteExternal as N,
1192
- 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,
1193
1212
  PageRenderer as P,
1194
- isSpecialScheme as Q,
1195
- listItems as R,
1196
- normalizeTo as S,
1197
- provideContentItem as T,
1198
- resolvePath as U,
1199
- toInternalPath as V,
1200
- useBloxEdit as W,
1201
- useContentItem as X,
1202
- 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,
1203
1223
  _sfc_main$3 as _,
1204
- setActiveLocale as a,
1205
- collectBloxSeo as b,
1224
+ setCollectionResolver as a,
1225
+ setActiveLocale as b,
1206
1226
  collectBloxData as c,
1207
- createBlox as d,
1208
- BLOX_REGISTRY_KEY as e,
1209
- BLOX_RUNTIME_KEY as f,
1227
+ collectBloxSeo as d,
1228
+ createBlox as e,
1229
+ BLOX_REGISTRY_KEY as f,
1210
1230
  generateContentRoutes as g,
1211
- BLOX_LOCALE_STRATEGY_KEY as h,
1231
+ BLOX_RUNTIME_KEY as h,
1212
1232
  installLocaleAwareResolve as i,
1213
- useSeo as j,
1214
- getRegistryData as k,
1215
- getItemBySlug as l,
1216
- getItemById as m,
1233
+ BLOX_LOCALE_STRATEGY_KEY as j,
1234
+ useSeo as k,
1235
+ getRegistryData as l,
1236
+ getItemBySlug as m,
1217
1237
  normalizeLink as n,
1218
- getContentRoute as o,
1238
+ getItemById as o,
1219
1239
  provideBloxData as p,
1220
- installContentFallback as q,
1240
+ getContentRoute as q,
1221
1241
  resolveBlockProps as r,
1222
1242
  setApiOrigin as s,
1223
- installSmartLinks as t,
1243
+ installContentFallback as t,
1224
1244
  useLocale as u,
1225
- consumePendingLocaleSwitch as v,
1226
- BLOX_ADMIN_CONFIG_KEY as w,
1227
- BLOX_CONFIG_KEY as x,
1228
- BLOX_DATA_KEY as y,
1229
- 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
1230
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,20 +73,26 @@ 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 }
75
82
  });
76
83
  }
77
84
  async function getItemBySlug(collection, slug, locale2) {
78
- const res = await listItems(collection, { locale: locale2, q: `slug eq "${slug}"`, limit: 1 });
85
+ const res = await listItems(collection, { locale: locale2, limit: 1e3 });
79
86
  const items = Array.isArray(res) ? res : (res == null ? void 0 : res.items) ?? [];
80
- return items[0] ?? null;
87
+ return items.find((item) => String((item == null ? void 0 : item.slug) ?? "") === slug) ?? null;
81
88
  }
82
89
  async function getItemById(collection, id, locale2) {
83
- const res = await listItems(collection, { locale: locale2, q: `id eq "${id}"`, limit: 1 });
90
+ const res = await listItems(collection, { locale: locale2, limit: 1e3 });
84
91
  const items = Array.isArray(res) ? res : (res == null ? void 0 : res.items) ?? [];
85
- return items[0] ?? null;
92
+ return items.find((item) => {
93
+ const record = item;
94
+ return String((record == null ? void 0 : record.id) ?? (record == null ? void 0 : record._id) ?? "") === id;
95
+ }) ?? null;
86
96
  }
87
97
  const BLOX_REGISTRY_KEY = Symbol("blox:registry");
88
98
  const BLOX_CONFIG_KEY = Symbol("blox:config");
@@ -902,7 +912,7 @@ class BloxInstance {
902
912
  }
903
913
  router.addRoute({
904
914
  path: "/_blox_preview",
905
- component: () => Promise.resolve().then(() => require("./PreviewApp-C9oZu-7e.cjs")),
915
+ component: () => Promise.resolve().then(() => require("./PreviewApp-DdTJYLaU.cjs")),
906
916
  beforeEnter: () => window.parent !== window ? true : "/"
907
917
  });
908
918
  router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$2 });
@@ -1162,17 +1172,26 @@ function installContentFallback(router, supportedLocales, defaultLocale) {
1162
1172
  const urlLocale = localeOf(to.path);
1163
1173
  const here = await getItemBySlug(registration.collection, slug, urlLocale).catch(() => null);
1164
1174
  if (here) return true;
1165
- const probe = await getItemBySlug(registration.collection, slug).catch(() => null);
1166
- const available = Array.isArray(probe == null ? void 0 : probe.available_locales) ? probe.available_locales : [];
1167
- const target = [defaultLocale, ...supportedLocales].find(
1168
- (l) => l !== urlLocale && available.includes(l)
1169
- );
1170
- if (!target || !probe) return true;
1171
- const targetItem = await getItemBySlug(registration.collection, slug, target).catch(() => null);
1172
- const targetSlug = String((targetItem == null ? void 0 : targetItem.slug) ?? slug);
1173
- const barePath = registration.route.replace(/:slug(?=\/|$)/, targetSlug);
1174
- const redirect = target === defaultLocale ? barePath : `/${target}${barePath}`;
1175
- return redirect;
1175
+ for (const sourceLocale of [defaultLocale, ...supportedLocales]) {
1176
+ if (sourceLocale === urlLocale) continue;
1177
+ const source = await getItemBySlug(
1178
+ registration.collection,
1179
+ slug,
1180
+ sourceLocale
1181
+ ).catch(() => null);
1182
+ const id = String((source == null ? void 0 : source.id) ?? (source == null ? void 0 : source._id) ?? "");
1183
+ if (!id) continue;
1184
+ const target = await getItemById(
1185
+ registration.collection,
1186
+ id,
1187
+ urlLocale
1188
+ ).catch(() => null);
1189
+ const targetSlug = String((target == null ? void 0 : target.slug) ?? "");
1190
+ if (!targetSlug) break;
1191
+ const barePath = registration.route.replace(/:slug(?=\/|$)/, targetSlug);
1192
+ return urlLocale === defaultLocale ? barePath : `/${urlLocale}${barePath}`;
1193
+ }
1194
+ return urlLocale === defaultLocale ? "/" : `/${urlLocale}`;
1176
1195
  });
1177
1196
  }
1178
1197
  exports.BLOX_ADMIN_CONFIG_KEY = BLOX_ADMIN_CONFIG_KEY;
@@ -1221,6 +1240,7 @@ exports.resolveBlockProps = resolveBlockProps;
1221
1240
  exports.resolvePath = resolvePath;
1222
1241
  exports.setActiveLocale = setActiveLocale;
1223
1242
  exports.setApiOrigin = setApiOrigin;
1243
+ exports.setCollectionResolver = setCollectionResolver;
1224
1244
  exports.toInternalPath = toInternalPath;
1225
1245
  exports.useBloxEdit = useBloxEdit;
1226
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;;;;OAIG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;IAC9D;;;OAGG;IACH,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACpD,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,kCAAkC;IAClC,KAAK,EAAE,MAAM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AE,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-CKAgyLxC.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-CQJBBmcV.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.471",
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",