@bagelink/blox 1.15.629 → 1.15.633

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 (31) hide show
  1. package/dist/{PreviewApp-5XGQVrnd.cjs → PreviewApp-BtQBgxxJ.cjs} +1 -1
  2. package/dist/{PreviewApp-DcD_Cjzn.js → PreviewApp-D7nTn843.js} +1 -1
  3. package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-OZtgkMXq.cjs → PreviewApp.vue_vue_type_style_index_0_lang-BGQBi7kZ.cjs} +1 -1
  4. package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-m2TIr6Wk.js → PreviewApp.vue_vue_type_style_index_0_lang-DDqfNEdN.js} +1 -1
  5. package/dist/api/index.d.ts +3 -1
  6. package/dist/api/index.d.ts.map +1 -1
  7. package/dist/{appRuntime-FphnGcV2.js → appRuntime-MDr0X5u0.js} +38 -235
  8. package/dist/{appRuntime-BqvP0NaP.cjs → appRuntime-Zt_fH0wN.cjs} +13 -210
  9. package/dist/{client-XQnL-B6N.js → client-Ce9fRCGH.js} +2 -2
  10. package/dist/index.cjs +23 -19
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.mjs +52 -47
  14. package/dist/pageTitle-BUVrac-4.js +272 -0
  15. package/dist/pageTitle-Dh_UoICu.cjs +271 -0
  16. package/dist/{shard-runner-C7_xAkA1.js → shard-runner-Cv5Cjm1f.js} +2 -2
  17. package/dist/{shard-runner-CinJMC5z.cjs → shard-runner-JbXPS_Dl.cjs} +2 -2
  18. package/dist/ssg/cli.cjs +8 -2
  19. package/dist/ssg/cli.mjs +8 -2
  20. package/dist/ssg/client.mjs +2 -2
  21. package/dist/ssg/cms-routes.d.ts +23 -0
  22. package/dist/ssg/cms-routes.d.ts.map +1 -1
  23. package/dist/ssg/createSSREntry.d.ts +1 -1
  24. package/dist/ssg/createSSREntry.d.ts.map +1 -1
  25. package/dist/ssg/index.cjs +9 -7
  26. package/dist/ssg/index.mjs +24 -22
  27. package/dist/{validate-output-DQTw64Rc.cjs → validate-output-CgOarPEF.cjs} +25 -4
  28. package/dist/{validate-output-e0E998g_.js → validate-output-ClPMepYU.js} +45 -24
  29. package/package.json +1 -1
  30. package/dist/pageTitle-BOTMH-D8.js +0 -56
  31. package/dist/pageTitle-nIl1cDfD.cjs +0 -55
@@ -15,6 +15,13 @@ export interface CmsSiteData {
15
15
  redirects: RedirectEntry[];
16
16
  /** Datastore collections referenced by any page's data_bindings. */
17
17
  collections: CollectionRef[];
18
+ /**
19
+ * Full datastore items per collection, bulk-loaded during route expansion.
20
+ * Lets the render resolve data-bound detail pages (and block list fetches)
21
+ * from memory instead of one network round-trip per page — the dominant
22
+ * cost on large sites. Keyed by collection name (JSON-serializable).
23
+ */
24
+ collectionItems?: Record<string, Record<string, unknown>[]>;
18
25
  }
19
26
  /**
20
27
  * Expand a list of default-locale paths into every supported locale.
@@ -26,4 +33,20 @@ export declare function expandLocalePaths(paths: string[], defaultLocale: string
26
33
  * website settings, page routes, and redirects.
27
34
  */
28
35
  export declare function fetchCmsSiteData(apiBase: string, websiteName: string, requestOptions?: BloxBuildRequestOptions): Promise<CmsSiteData>;
36
+ export type CollectionResolver = (collection: string, options: {
37
+ locale?: string;
38
+ q?: string;
39
+ offset?: number;
40
+ limit?: number;
41
+ }) => Promise<Record<string, unknown>[] | null>;
42
+ /**
43
+ * Build an in-memory resolver over the bulk-loaded collection items, so data-bound
44
+ * detail pages resolve from memory during SSR instead of one network round-trip
45
+ * per page. Supports the SCIM `q` subset the renderer emits: `field eq "value"`.
46
+ *
47
+ * Returns `null` for collections that were NOT bulk-loaded during route expansion
48
+ * (i.e. not referenced by any dynamic template), so the caller can fall back to a
49
+ * live HTTP fetch instead of silently returning an empty list.
50
+ */
51
+ export declare function buildCollectionResolver(collectionItems: Record<string, Record<string, unknown>[]>): CollectionResolver;
29
52
  //# sourceMappingURL=cms-routes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cms-routes.d.ts","sourceRoot":"","sources":["../../src/ssg/cms-routes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAoB9D,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,WAAW,CAAA;IACpB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,8EAA8E;IAC9E,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,EAAE,aAAa,EAAE,CAAA;IAC1B,oEAAoE;IACpE,WAAW,EAAE,aAAa,EAAE,CAAA;CAC5B;AAYD;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,EAAE,GACxB,MAAM,EAAE,CASV;AAMD;;;GAGG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,cAAc,GAAE,uBAA4B,GAC1C,OAAO,CAAC,WAAW,CAAC,CAiItB"}
1
+ {"version":3,"file":"cms-routes.d.ts","sourceRoot":"","sources":["../../src/ssg/cms-routes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAoB9D,2EAA2E;AAC3E,MA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7 +32,7 @@ export interface CreateBloxSSREntryOptions {
32
32
  */
33
33
  resolvePublishedPaths?: boolean;
34
34
  /** Immutable build-time datastore resolver used by content routes and SEO. */
35
- collectionResolver?: (collection: string, options: ListItemsOptions) => Promise<Array<Record<string, unknown>>>;
35
+ collectionResolver?: (collection: string, options: ListItemsOptions) => Promise<Array<Record<string, unknown>> | null>;
36
36
  /** Default locale. @default 'en' */
37
37
  locale?: string;
38
38
  /** 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;AAK9D,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AAM9D,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,CAAA;IACb,oGAAoG;IACpG,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,uBAAuB,CAAA;IACt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a;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;KAChB,CAAC,CAAA;IACF,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACnC;AAED,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,aAAa,EAAE,EACtB,IAAI,EAAE,MAAM,EACZ,cAAc,UAAQ,GACpB,aAAa,GAAG,IAAI,CAUtB;AAuBD,wBAAsB,oBAAoB,CACzC,KAAK,EAAE,aAAa,EAAE,EACtB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,yBAAyB,CAAC,oBAAoB,CAAC,GACxD,OAAO,CAAC;IACV,IAAI,EAAE,aAAa,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACnC,GAAG,IAAI,CAAC,CA4DR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CAkMnF"}
@@ -22,11 +22,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
22
  mod
23
23
  ));
24
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
- const llmArtifacts = require("../validate-output-DQTw64Rc.cjs");
25
+ const llmArtifacts = require("../validate-output-CgOarPEF.cjs");
26
26
  const ssg_buildGrant = require("./build-grant.cjs");
27
27
  const ssg_client = require("../client-AoDTJJXJ.cjs");
28
28
  const vue = require("vue");
29
- const appRuntime = require("../appRuntime-BqvP0NaP.cjs");
29
+ const appRuntime = require("../appRuntime-Zt_fH0wN.cjs");
30
+ const pageTitle = require("../pageTitle-Dh_UoICu.cjs");
30
31
  async function renderBloxSsgPage(options) {
31
32
  var _a, _b, _c, _d;
32
33
  const {
@@ -161,7 +162,7 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
161
162
  locale,
162
163
  q: `${binding.bind_by} eq "${escaped}"`,
163
164
  limit: 1
164
- });
165
+ }) ?? [];
165
166
  const item = items[0] ?? null;
166
167
  contexts[name] = item;
167
168
  if (item && page.slug) {
@@ -174,7 +175,7 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
174
175
  locale: targetLocale,
175
176
  q: `id eq "${escapedId}"`,
176
177
  limit: 1
177
- });
178
+ }) ?? [];
178
179
  const localizedItem = localizedItems[0];
179
180
  const localizedValue = localizedItem == null ? void 0 : localizedItem[binding.bind_by];
180
181
  if (typeof localizedValue !== "string" || !localizedValue) return null;
@@ -253,11 +254,12 @@ function createBloxSSREntry(options) {
253
254
  publishedBundleCache.set(cacheKey, pending);
254
255
  }
255
256
  const bundle = await pending;
257
+ const activeResolver = options.collectionResolver ?? pageTitle.getCollectionResolver() ?? void 0;
256
258
  const resolved = await resolvePublishedPage(
257
259
  bundle.pages,
258
260
  slug,
259
261
  pageLocale,
260
- options.resolvePublishedPaths ?? !!options.collectionResolver ? options.collectionResolver : void 0
262
+ options.resolvePublishedPaths ?? !!activeResolver ? activeResolver : void 0
261
263
  );
262
264
  return resolved ? { ...resolved, warnings: [] } : null;
263
265
  }
@@ -280,11 +282,11 @@ function createBloxSSREntry(options) {
280
282
  render: () => vue.h(vue.Suspense, null, { default: () => vue.h(rootComponent) })
281
283
  });
282
284
  const dataRegistry = appRuntime.provideBloxData(app, { server: true });
283
- const api = appRuntime.provideBloxApi(app, {
285
+ const api = pageTitle.provideBloxApi(app, {
284
286
  websiteName,
285
287
  store,
286
288
  origin: apiBase,
287
- collectionResolver: options.collectionResolver
289
+ collectionResolver: options.collectionResolver ?? pageTitle.getCollectionResolver()
288
290
  });
289
291
  const localeState = appRuntime.provideBloxLocale(app, pageLocale);
290
292
  app.provide(appRuntime.BLOX_SSR_ROUTE_STATE_KEY, {
@@ -1,9 +1,10 @@
1
- import { b as buildPageHead, c as primaryContextEntry, d as buildJsonLd, e as extractPageText, B as BloxBuildResponseError, h as bloxBuildJson } from "../validate-output-e0E998g_.js";
2
- import { i, j, f, k, l, m, n, g, o, q, r, s, t, w, p, a, x, y, u, v } from "../validate-output-e0E998g_.js";
1
+ import { c as buildPageHead, d as primaryContextEntry, e as buildJsonLd, h as extractPageText, B as BloxBuildResponseError, i as bloxBuildJson } from "../validate-output-ClPMepYU.js";
2
+ import { j, k, f, l, m, n, o, g, q, r, s, t, w, x, p, a, y, z, u, v } from "../validate-output-ClPMepYU.js";
3
3
  import { parseBloxBuildGrantBody, resolveBloxBuildGrant } from "./build-grant.mjs";
4
- import { B as BLOX_HYDRATION_WINDOW_KEY } from "../client-XQnL-B6N.js";
4
+ import { a as BLOX_HYDRATION_WINDOW_KEY } from "../client-Ce9fRCGH.js";
5
5
  import { createSSRApp, h, Suspense } from "vue";
6
- import { c as collectBloxData, a as collectBloxSeo, p as provideBloxData, b as provideBloxApi, d as provideBloxLocale, B as BLOX_SSR_ROUTE_STATE_KEY, i as installBloxRuntime, s as setActiveLocale } from "../appRuntime-FphnGcV2.js";
6
+ import { c as collectBloxData, a as collectBloxSeo, p as provideBloxData, b as provideBloxLocale, B as BLOX_SSR_ROUTE_STATE_KEY, i as installBloxRuntime, s as setActiveLocale } from "../appRuntime-MDr0X5u0.js";
7
+ import { p as provideBloxApi, g as getCollectionResolver } from "../pageTitle-BUVrac-4.js";
7
8
  async function renderBloxSsgPage(options) {
8
9
  var _a, _b, _c, _d;
9
10
  const {
@@ -138,7 +139,7 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
138
139
  locale,
139
140
  q: `${binding.bind_by} eq "${escaped}"`,
140
141
  limit: 1
141
- });
142
+ }) ?? [];
142
143
  const item = items[0] ?? null;
143
144
  contexts[name] = item;
144
145
  if (item && page.slug) {
@@ -151,7 +152,7 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
151
152
  locale: targetLocale,
152
153
  q: `id eq "${escapedId}"`,
153
154
  limit: 1
154
- });
155
+ }) ?? [];
155
156
  const localizedItem = localizedItems[0];
156
157
  const localizedValue = localizedItem == null ? void 0 : localizedItem[binding.bind_by];
157
158
  if (typeof localizedValue !== "string" || !localizedValue) return null;
@@ -230,11 +231,12 @@ function createBloxSSREntry(options) {
230
231
  publishedBundleCache.set(cacheKey, pending);
231
232
  }
232
233
  const bundle = await pending;
234
+ const activeResolver = options.collectionResolver ?? getCollectionResolver() ?? void 0;
233
235
  const resolved = await resolvePublishedPage(
234
236
  bundle.pages,
235
237
  slug,
236
238
  pageLocale,
237
- options.resolvePublishedPaths ?? !!options.collectionResolver ? options.collectionResolver : void 0
239
+ options.resolvePublishedPaths ?? !!activeResolver ? activeResolver : void 0
238
240
  );
239
241
  return resolved ? { ...resolved, warnings: [] } : null;
240
242
  }
@@ -261,7 +263,7 @@ function createBloxSSREntry(options) {
261
263
  websiteName,
262
264
  store,
263
265
  origin: apiBase,
264
- collectionResolver: options.collectionResolver
266
+ collectionResolver: options.collectionResolver ?? getCollectionResolver()
265
267
  });
266
268
  const localeState = provideBloxLocale(app, pageLocale);
267
269
  app.provide(BLOX_SSR_ROUTE_STATE_KEY, {
@@ -392,34 +394,34 @@ export {
392
394
  BLOX_HYDRATION_WINDOW_KEY,
393
395
  BloxBuildResponseError,
394
396
  bloxBuildJson,
395
- i as bloxBuildRequest,
397
+ j as bloxBuildRequest,
396
398
  buildJsonLd,
397
399
  buildPageHead,
398
- j as buildSiteHead,
400
+ k as buildSiteHead,
399
401
  createBloxSSREntry,
400
402
  extractPageText,
401
403
  f as fetchCmsSiteData,
402
404
  fetchDatastoreSnapshot,
403
- k as generateLlmsFullTxt,
404
- l as generateLlmsTxt,
405
- m as generateNetlifyRedirects,
406
- n as generateRobotsTxt,
405
+ l as generateLlmsFullTxt,
406
+ m as generateLlmsTxt,
407
+ n as generateNetlifyRedirects,
408
+ o as generateRobotsTxt,
407
409
  g as generateSitemapArtifacts,
408
- o as generateSitemapIndexXml,
409
- q as generateSitemapXml,
410
- r as getBloxBuildRequestOptions,
411
- s as getSiteIconFlags,
412
- t as localeSitemapPath,
413
- w as mergeLlmParts,
410
+ q as generateSitemapIndexXml,
411
+ r as generateSitemapXml,
412
+ s as getBloxBuildRequestOptions,
413
+ t as getSiteIconFlags,
414
+ w as localeSitemapPath,
415
+ x as mergeLlmParts,
414
416
  parseBloxBuildGrantBody,
415
417
  p as polyfillBloxSsgGlobals,
416
418
  a as prerender,
417
419
  querySnapshotRows,
418
420
  renderBloxSsgPage,
419
421
  resolveBloxBuildGrant,
420
- x as resolveManifestProvenance,
422
+ y as resolveManifestProvenance,
421
423
  snapshotRows,
422
- y as splitSitemapPathsByLocale,
424
+ z as splitSitemapPathsByLocale,
423
425
  u as uploadBloxManifest,
424
426
  v as validateSsgOutput
425
427
  };
@@ -26,7 +26,7 @@ const fs = require("node:fs/promises");
26
26
  const path = require("node:path");
27
27
  const process$1 = require("node:process");
28
28
  const node_url = require("node:url");
29
- const pageTitle = require("./pageTitle-nIl1cDfD.cjs");
29
+ const pageTitle = require("./pageTitle-Dh_UoICu.cjs");
30
30
  class BloxBuildResponseError extends Error {
31
31
  constructor(status, url, statusText) {
32
32
  super(`Build API ${status} ${statusText}: ${url}`);
@@ -112,13 +112,14 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
112
112
  const website2 = baseBundle.website;
113
113
  const defaultLocale2 = website2.default_locale || "en";
114
114
  const supportedLocales2 = Array.isArray(website2.supported_locales) && website2.supported_locales.length > 0 ? website2.supported_locales : [defaultLocale2];
115
+ const collectionItems = {};
115
116
  const localizedBundles = await Promise.all(supportedLocales2.map(async (locale) => {
116
117
  const bundle = locale === defaultLocale2 ? baseBundle : await bloxBuildJson(
117
118
  `${apiBase}/blox-build/websites/${websiteId}/published?locale=${encodeURIComponent(locale)}`,
118
119
  {},
119
120
  requestOptions
120
121
  );
121
- const localePaths = await expandRoutes(apiBase, bundle.pages, requestOptions, locale);
122
+ const localePaths = await expandRoutes(apiBase, bundle.pages, requestOptions, locale, collectionItems);
122
123
  return {
123
124
  locale,
124
125
  bundle,
@@ -131,7 +132,8 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
131
132
  paths: [...new Set(localizedBundles.flatMap((result) => result.paths))],
132
133
  pageSlugs: [...new Set(localizedBundles.flatMap((result) => result.bundle.pages.flatMap((page) => page.slug ? [localizePath(page.slug, result.locale, defaultLocale2)] : [])))],
133
134
  redirects: baseBundle.redirects.filter((redirect) => redirect.from_path && redirect.to_path),
134
- collections: extractCollectionRefs(localizedBundles.flatMap((result) => result.bundle.pages))
135
+ collections: extractCollectionRefs(localizedBundles.flatMap((result) => result.bundle.pages)),
136
+ collectionItems
135
137
  };
136
138
  }
137
139
  const site = await bloxBuildJson(
@@ -190,7 +192,7 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
190
192
  const pageSlugs = [...new Set(localizedPages.flatMap((result) => result.pages.flatMap((page) => page.slug ? [localizePath(page.slug, result.locale, defaultLocale)] : [])))];
191
193
  return { websiteId: site.id, website, paths, pageSlugs, redirects, collections };
192
194
  }
193
- async function expandRoutes(apiBase, pages, requestOptions, locale) {
195
+ async function expandRoutes(apiBase, pages, requestOptions, locale, collectItems) {
194
196
  const routes = [];
195
197
  const grantedWebsiteId = requestOptions.websiteId;
196
198
  for (const page of pages) {
@@ -218,6 +220,10 @@ async function expandRoutes(apiBase, pages, requestOptions, locale) {
218
220
  items.push(...pageItems);
219
221
  if (pageItems.length < pageSize) break;
220
222
  }
223
+ if (collectItems && b.collection) {
224
+ const existing = collectItems[b.collection] ?? [];
225
+ collectItems[b.collection] = [...existing, ...items];
226
+ }
221
227
  for (const item of items) {
222
228
  const bindValue = item[b.bind_by];
223
229
  if (typeof bindValue !== "string" || bindValue === "") continue;
@@ -257,6 +263,20 @@ function extractCollectionRefs(pages) {
257
263
  }
258
264
  return refs;
259
265
  }
266
+ function buildCollectionResolver(collectionItems) {
267
+ return async (collection, { q, offset = 0, limit = 100 } = {}) => {
268
+ if (!(collection in collectionItems)) return null;
269
+ let items = collectionItems[collection] ?? [];
270
+ if (q) {
271
+ const match = /^\s*(\w+)\s+eq\s+"([^"]*)"\s*$/.exec(q);
272
+ if (match) {
273
+ const [, field, value] = match;
274
+ items = items.filter((item) => String(item[field] ?? "") === value);
275
+ }
276
+ }
277
+ return items.slice(offset, offset + limit);
278
+ };
279
+ }
260
280
  function environment(name) {
261
281
  var _a;
262
282
  return ((_a = process$1.env[name]) == null ? void 0 : _a.trim()) || void 0;
@@ -1364,6 +1384,7 @@ async function validateSitemap(outDir, content) {
1364
1384
  exports.BloxBuildResponseError = BloxBuildResponseError;
1365
1385
  exports.bloxBuildJson = bloxBuildJson;
1366
1386
  exports.bloxBuildRequest = bloxBuildRequest;
1387
+ exports.buildCollectionResolver = buildCollectionResolver;
1367
1388
  exports.buildJsonLd = buildJsonLd;
1368
1389
  exports.buildPageHead = buildPageHead;
1369
1390
  exports.buildSiteHead = buildSiteHead;
@@ -3,7 +3,7 @@ import fs, { readFile } from "node:fs/promises";
3
3
  import path, { resolve } from "node:path";
4
4
  import process$1 from "node:process";
5
5
  import { pathToFileURL } from "node:url";
6
- import { r as resolvePageTitle, p as primaryPageContext, c as contextPageTitle } from "./pageTitle-BOTMH-D8.js";
6
+ import { r as resolvePageTitle, a as primaryPageContext, c as contextPageTitle } from "./pageTitle-BUVrac-4.js";
7
7
  class BloxBuildResponseError extends Error {
8
8
  constructor(status, url, statusText) {
9
9
  super(`Build API ${status} ${statusText}: ${url}`);
@@ -89,13 +89,14 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
89
89
  const website2 = baseBundle.website;
90
90
  const defaultLocale2 = website2.default_locale || "en";
91
91
  const supportedLocales2 = Array.isArray(website2.supported_locales) && website2.supported_locales.length > 0 ? website2.supported_locales : [defaultLocale2];
92
+ const collectionItems = {};
92
93
  const localizedBundles = await Promise.all(supportedLocales2.map(async (locale) => {
93
94
  const bundle = locale === defaultLocale2 ? baseBundle : await bloxBuildJson(
94
95
  `${apiBase}/blox-build/websites/${websiteId}/published?locale=${encodeURIComponent(locale)}`,
95
96
  {},
96
97
  requestOptions
97
98
  );
98
- const localePaths = await expandRoutes(apiBase, bundle.pages, requestOptions, locale);
99
+ const localePaths = await expandRoutes(apiBase, bundle.pages, requestOptions, locale, collectionItems);
99
100
  return {
100
101
  locale,
101
102
  bundle,
@@ -108,7 +109,8 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
108
109
  paths: [...new Set(localizedBundles.flatMap((result) => result.paths))],
109
110
  pageSlugs: [...new Set(localizedBundles.flatMap((result) => result.bundle.pages.flatMap((page) => page.slug ? [localizePath(page.slug, result.locale, defaultLocale2)] : [])))],
110
111
  redirects: baseBundle.redirects.filter((redirect) => redirect.from_path && redirect.to_path),
111
- collections: extractCollectionRefs(localizedBundles.flatMap((result) => result.bundle.pages))
112
+ collections: extractCollectionRefs(localizedBundles.flatMap((result) => result.bundle.pages)),
113
+ collectionItems
112
114
  };
113
115
  }
114
116
  const site = await bloxBuildJson(
@@ -167,7 +169,7 @@ async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
167
169
  const pageSlugs = [...new Set(localizedPages.flatMap((result) => result.pages.flatMap((page) => page.slug ? [localizePath(page.slug, result.locale, defaultLocale)] : [])))];
168
170
  return { websiteId: site.id, website, paths, pageSlugs, redirects, collections };
169
171
  }
170
- async function expandRoutes(apiBase, pages, requestOptions, locale) {
172
+ async function expandRoutes(apiBase, pages, requestOptions, locale, collectItems) {
171
173
  const routes = [];
172
174
  const grantedWebsiteId = requestOptions.websiteId;
173
175
  for (const page of pages) {
@@ -195,6 +197,10 @@ async function expandRoutes(apiBase, pages, requestOptions, locale) {
195
197
  items.push(...pageItems);
196
198
  if (pageItems.length < pageSize) break;
197
199
  }
200
+ if (collectItems && b.collection) {
201
+ const existing = collectItems[b.collection] ?? [];
202
+ collectItems[b.collection] = [...existing, ...items];
203
+ }
198
204
  for (const item of items) {
199
205
  const bindValue = item[b.bind_by];
200
206
  if (typeof bindValue !== "string" || bindValue === "") continue;
@@ -234,6 +240,20 @@ function extractCollectionRefs(pages) {
234
240
  }
235
241
  return refs;
236
242
  }
243
+ function buildCollectionResolver(collectionItems) {
244
+ return async (collection, { q, offset = 0, limit = 100 } = {}) => {
245
+ if (!(collection in collectionItems)) return null;
246
+ let items = collectionItems[collection] ?? [];
247
+ if (q) {
248
+ const match = /^\s*(\w+)\s+eq\s+"([^"]*)"\s*$/.exec(q);
249
+ if (match) {
250
+ const [, field, value] = match;
251
+ items = items.filter((item) => String(item[field] ?? "") === value);
252
+ }
253
+ }
254
+ return items.slice(offset, offset + limit);
255
+ };
256
+ }
237
257
  function environment(name) {
238
258
  var _a;
239
259
  return ((_a = process$1.env[name]) == null ? void 0 : _a.trim()) || void 0;
@@ -1339,31 +1359,32 @@ async function validateSitemap(outDir, content) {
1339
1359
  return failures;
1340
1360
  }
1341
1361
  export {
1362
+ llmArtifacts as A,
1342
1363
  BloxBuildResponseError as B,
1343
1364
  prerender as a,
1344
- buildPageHead as b,
1345
- primaryContextEntry as c,
1346
- buildJsonLd as d,
1347
- extractPageText as e,
1365
+ buildCollectionResolver as b,
1366
+ buildPageHead as c,
1367
+ primaryContextEntry as d,
1368
+ buildJsonLd as e,
1348
1369
  fetchCmsSiteData as f,
1349
1370
  generateSitemapArtifacts as g,
1350
- bloxBuildJson as h,
1351
- bloxBuildRequest as i,
1352
- buildSiteHead as j,
1353
- generateLlmsFullTxt as k,
1354
- generateLlmsTxt as l,
1355
- generateNetlifyRedirects as m,
1356
- generateRobotsTxt as n,
1357
- generateSitemapIndexXml as o,
1371
+ extractPageText as h,
1372
+ bloxBuildJson as i,
1373
+ bloxBuildRequest as j,
1374
+ buildSiteHead as k,
1375
+ generateLlmsFullTxt as l,
1376
+ generateLlmsTxt as m,
1377
+ generateNetlifyRedirects as n,
1378
+ generateRobotsTxt as o,
1358
1379
  polyfillBloxSsgGlobals as p,
1359
- generateSitemapXml as q,
1360
- getBloxBuildRequestOptions as r,
1361
- getSiteIconFlags as s,
1362
- localeSitemapPath as t,
1380
+ generateSitemapIndexXml as q,
1381
+ generateSitemapXml as r,
1382
+ getBloxBuildRequestOptions as s,
1383
+ getSiteIconFlags as t,
1363
1384
  uploadBloxManifest as u,
1364
1385
  validateSsgOutput as v,
1365
- mergeLlmParts as w,
1366
- resolveManifestProvenance as x,
1367
- splitSitemapPathsByLocale as y,
1368
- llmArtifacts as z
1386
+ localeSitemapPath as w,
1387
+ mergeLlmParts as x,
1388
+ resolveManifestProvenance as y,
1389
+ splitSitemapPathsByLocale as z
1369
1390
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.15.629",
4
+ "version": "1.15.633",
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",
@@ -1,56 +0,0 @@
1
- const PREFERRED_CONTEXT_KEYS = ["$page", "$post", "$item", "$article", "$product", "$event", "$author"];
2
- const TITLE_FIELDS = ["meta_title", "metaTitle", "title", "name", "productName", "displayName"];
3
- function primaryPageContext(contexts) {
4
- if (!contexts) return null;
5
- const keys = [
6
- ...PREFERRED_CONTEXT_KEYS.filter((key) => key in contexts),
7
- ...Object.keys(contexts).filter((key) => key !== "$website" && !PREFERRED_CONTEXT_KEYS.includes(key)).sort()
8
- ];
9
- for (const key of keys) {
10
- const ctx = contexts[key];
11
- if (ctx != null && typeof ctx === "object") return { key, ctx };
12
- }
13
- return null;
14
- }
15
- function contextPageTitle(context) {
16
- if (!context) return null;
17
- for (const field of TITLE_FIELDS) {
18
- const value = context[field];
19
- if (typeof value === "string" && value.trim()) return value.trim();
20
- }
21
- return null;
22
- }
23
- function siteNameFromContexts(contexts) {
24
- const website = contexts == null ? void 0 : contexts.$website;
25
- const seo = website == null ? void 0 : website.seo;
26
- const siteName = seo && typeof seo === "object" ? seo.site_name : website == null ? void 0 : website.site_name;
27
- return typeof siteName === "string" && siteName.trim() ? siteName.trim() : null;
28
- }
29
- function withSiteName(title, siteName) {
30
- if (!siteName || title.includes(siteName)) return title;
31
- return `${title} · ${siteName}`;
32
- }
33
- function resolvePageTitle(resolved, options = {}) {
34
- var _a, _b, _c, _d, _e, _f, _g;
35
- const hasBinding = !!((_a = resolved.page) == null ? void 0 : _a.data_bindings) && Object.keys(resolved.page.data_bindings).length > 0;
36
- const contextTitle = hasBinding ? contextPageTitle((_b = primaryPageContext(resolved.contexts)) == null ? void 0 : _b.ctx) : null;
37
- const dynamicTitle = ((_c = options.override) == null ? void 0 : _c.trim()) || contextTitle;
38
- if (dynamicTitle) return withSiteName(dynamicTitle, options.siteName);
39
- if ((_e = (_d = resolved.page) == null ? void 0 : _d.meta_title) == null ? void 0 : _e.trim()) return resolved.page.meta_title.trim();
40
- if ((_g = (_f = resolved.page) == null ? void 0 : _f.title) == null ? void 0 : _g.trim()) return withSiteName(resolved.page.title.trim(), options.siteName);
41
- return null;
42
- }
43
- function preserveCurrentSiteSuffix(title, currentTitle) {
44
- const separator = " · ";
45
- const suffixIndex = currentTitle.lastIndexOf(separator);
46
- if (suffixIndex < 0) return title;
47
- const siteName = currentTitle.slice(suffixIndex + separator.length).trim();
48
- return withSiteName(title, siteName);
49
- }
50
- export {
51
- preserveCurrentSiteSuffix as a,
52
- contextPageTitle as c,
53
- primaryPageContext as p,
54
- resolvePageTitle as r,
55
- siteNameFromContexts as s
56
- };
@@ -1,55 +0,0 @@
1
- "use strict";
2
- const PREFERRED_CONTEXT_KEYS = ["$page", "$post", "$item", "$article", "$product", "$event", "$author"];
3
- const TITLE_FIELDS = ["meta_title", "metaTitle", "title", "name", "productName", "displayName"];
4
- function primaryPageContext(contexts) {
5
- if (!contexts) return null;
6
- const keys = [
7
- ...PREFERRED_CONTEXT_KEYS.filter((key) => key in contexts),
8
- ...Object.keys(contexts).filter((key) => key !== "$website" && !PREFERRED_CONTEXT_KEYS.includes(key)).sort()
9
- ];
10
- for (const key of keys) {
11
- const ctx = contexts[key];
12
- if (ctx != null && typeof ctx === "object") return { key, ctx };
13
- }
14
- return null;
15
- }
16
- function contextPageTitle(context) {
17
- if (!context) return null;
18
- for (const field of TITLE_FIELDS) {
19
- const value = context[field];
20
- if (typeof value === "string" && value.trim()) return value.trim();
21
- }
22
- return null;
23
- }
24
- function siteNameFromContexts(contexts) {
25
- const website = contexts == null ? void 0 : contexts.$website;
26
- const seo = website == null ? void 0 : website.seo;
27
- const siteName = seo && typeof seo === "object" ? seo.site_name : website == null ? void 0 : website.site_name;
28
- return typeof siteName === "string" && siteName.trim() ? siteName.trim() : null;
29
- }
30
- function withSiteName(title, siteName) {
31
- if (!siteName || title.includes(siteName)) return title;
32
- return `${title} · ${siteName}`;
33
- }
34
- function resolvePageTitle(resolved, options = {}) {
35
- var _a, _b, _c, _d, _e, _f, _g;
36
- const hasBinding = !!((_a = resolved.page) == null ? void 0 : _a.data_bindings) && Object.keys(resolved.page.data_bindings).length > 0;
37
- const contextTitle = hasBinding ? contextPageTitle((_b = primaryPageContext(resolved.contexts)) == null ? void 0 : _b.ctx) : null;
38
- const dynamicTitle = ((_c = options.override) == null ? void 0 : _c.trim()) || contextTitle;
39
- if (dynamicTitle) return withSiteName(dynamicTitle, options.siteName);
40
- if ((_e = (_d = resolved.page) == null ? void 0 : _d.meta_title) == null ? void 0 : _e.trim()) return resolved.page.meta_title.trim();
41
- if ((_g = (_f = resolved.page) == null ? void 0 : _f.title) == null ? void 0 : _g.trim()) return withSiteName(resolved.page.title.trim(), options.siteName);
42
- return null;
43
- }
44
- function preserveCurrentSiteSuffix(title, currentTitle) {
45
- const separator = " · ";
46
- const suffixIndex = currentTitle.lastIndexOf(separator);
47
- if (suffixIndex < 0) return title;
48
- const siteName = currentTitle.slice(suffixIndex + separator.length).trim();
49
- return withSiteName(title, siteName);
50
- }
51
- exports.contextPageTitle = contextPageTitle;
52
- exports.preserveCurrentSiteSuffix = preserveCurrentSiteSuffix;
53
- exports.primaryPageContext = primaryPageContext;
54
- exports.resolvePageTitle = resolvePageTitle;
55
- exports.siteNameFromContexts = siteNameFromContexts;