@bagelink/blox 1.15.663 → 1.15.665

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 +1 @@
1
- {"version":3,"file":"CmsPageView.vue.d.ts","sourceRoot":"","sources":["../src/CmsPageView.vue"],"names":[],"mappings":";AA2pBA,wBAMG"}
1
+ {"version":3,"file":"CmsPageView.vue.d.ts","sourceRoot":"","sources":["../src/CmsPageView.vue"],"names":[],"mappings":";AA2rBA,wBAMG"}
@@ -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-BP6sRzCv.cjs");
3
+ const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-BnPd6x9t.cjs");
4
4
  exports.default = PreviewApp_vue_vue_type_style_index_0_lang._sfc_main;
@@ -1,4 +1,4 @@
1
- import { _ as _sfc_main } from "./PreviewApp.vue_vue_type_style_index_0_lang-D3nz9VR7.js";
1
+ import { _ as _sfc_main } from "./PreviewApp.vue_vue_type_style_index_0_lang-zAjDTnQg.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const vue = require("vue");
3
- const appRuntime = require("./appRuntime-KrtrOgvG.cjs");
3
+ const appRuntime = require("./appRuntime-DriplkOx.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 { d as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, e as BLOX_RUNTIME_KEY } from "./appRuntime-wD8N8dxg.js";
2
+ import { d as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, e as BLOX_RUNTIME_KEY } from "./appRuntime-0WTFR_UL.js";
3
3
  function sendToEditor(msg) {
4
4
  window.parent.postMessage(cloneForPostMessage(msg), "*");
5
5
  }
@@ -268,6 +268,12 @@ const PageRenderer = defineComponent({
268
268
  };
269
269
  }
270
270
  });
271
+ const NOT_FOUND_SLUG = "/404";
272
+ function isMissingPageDocument({ hydratedSlug, requestedSlug }) {
273
+ if (!hydratedSlug) return false;
274
+ if (hydratedSlug !== NOT_FOUND_SLUG) return false;
275
+ return requestedSlug !== NOT_FOUND_SLUG;
276
+ }
271
277
  const _hoisted_1$1 = {
272
278
  key: 0,
273
279
  class: "blox-initial-loading"
@@ -345,10 +351,22 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
345
351
  return true;
346
352
  }
347
353
  const routeState = (_a2 = readBloxHydration()) == null ? void 0 : _a2.route;
348
- const entry = (routeState == null ? void 0 : routeState.path) === path ? routeState.resolved : void 0;
349
- if (!entry) return false;
350
- applyResolvedState(entry);
351
- return true;
354
+ if ((routeState == null ? void 0 : routeState.path) === path) {
355
+ applyResolvedState(routeState.resolved);
356
+ return true;
357
+ }
358
+ if (isNotFoundRoute(routeState == null ? void 0 : routeState.path)) {
359
+ applyResolvedState(routeState.resolved, routeState.path);
360
+ return true;
361
+ }
362
+ return false;
363
+ }
364
+ function isNotFoundRoute(path) {
365
+ var _a2;
366
+ if (!path) return false;
367
+ const hostname = typeof window !== "undefined" ? window.location.hostname : "";
368
+ const slug = strategy ? strategy.detect(hostname, path).slug : path;
369
+ return slug === NOT_FOUND_SLUG && !!((_a2 = readBloxHydration()) == null ? void 0 : _a2.route);
352
370
  }
353
371
  function applyResolvedState(entry, path) {
354
372
  var _a2, _b, _c;
@@ -408,7 +426,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
408
426
  } catch (e) {
409
427
  const msg = e instanceof Error ? e.message : String(e);
410
428
  if (msg.includes("404")) {
411
- await router.replace(homePath(urlLocale));
429
+ notFound.value = true;
412
430
  } else {
413
431
  error.value = msg;
414
432
  }
@@ -898,7 +916,7 @@ class BloxInstance {
898
916
  router.addRoute({
899
917
  path: "/_blox_preview",
900
918
  name: BLOX_PREVIEW_ROUTE_NAME,
901
- component: () => import("./PreviewApp-6imffI4L.js"),
919
+ component: () => import("./PreviewApp-Djh38Iw-.js"),
902
920
  beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
903
921
  });
904
922
  }
@@ -1288,24 +1306,26 @@ function installBloxRuntime(options) {
1288
1306
  return blox;
1289
1307
  }
1290
1308
  export {
1291
- classifyLink as A,
1309
+ _sfc_main as A,
1292
1310
  BLOX_SSR_ROUTE_STATE_KEY as B,
1293
- contentRoutes as C,
1294
- createBlox as D,
1295
- defineContent as E,
1296
- generateContentRoutes as F,
1297
- getContentRouteByCollection as G,
1298
- installContentFallback as H,
1299
- isAbsoluteExternal as I,
1300
- isSoloContentPage as J,
1301
- isSpecialScheme as K,
1302
- normalizeTo as L,
1303
- provideContentItem as M,
1304
- toInternalPath as N,
1305
- useBloxEdit as O,
1311
+ applyLayoutChrome as C,
1312
+ classifyLink as D,
1313
+ contentRoutes as E,
1314
+ createBlox as F,
1315
+ defineContent as G,
1316
+ generateContentRoutes as H,
1317
+ getContentRouteByCollection as I,
1318
+ installContentFallback as J,
1319
+ isAbsoluteExternal as K,
1320
+ isSoloContentPage as L,
1321
+ isSpecialScheme as M,
1322
+ normalizeTo as N,
1323
+ provideContentItem as O,
1306
1324
  PageRenderer as P,
1307
- useContentItem as Q,
1308
- useData as R,
1325
+ toInternalPath as Q,
1326
+ useBloxEdit as R,
1327
+ useContentItem as S,
1328
+ useData as T,
1309
1329
  _sfc_main$3 as _,
1310
1330
  collectBloxSeo as a,
1311
1331
  provideBloxLocale as b,
@@ -1317,20 +1337,20 @@ export {
1317
1337
  getRegistryData as h,
1318
1338
  installBloxRuntime as i,
1319
1339
  getContentRoute as j,
1320
- installSmartLinks as k,
1321
- consumePendingLocaleSwitch as l,
1322
- BLOX_ADMIN_CONFIG_KEY as m,
1340
+ isMissingPageDocument as k,
1341
+ installSmartLinks as l,
1342
+ consumePendingLocaleSwitch as m,
1323
1343
  normalizeLink as n,
1324
- BLOX_CONFIG_KEY as o,
1344
+ BLOX_CMS_ROUTE_NAME as o,
1325
1345
  provideBloxData as p,
1326
- BLOX_DATA_KEY as q,
1346
+ BLOX_ADMIN_CONFIG_KEY as q,
1327
1347
  resolveBlockProps as r,
1328
1348
  setActiveLocale as s,
1329
- BLOX_LAYOUT_KEY as t,
1349
+ BLOX_CONFIG_KEY as t,
1330
1350
  useLocale as u,
1331
- BloxInstance as v,
1332
- _sfc_main$2 as w,
1333
- _sfc_main$1 as x,
1334
- _sfc_main as y,
1335
- applyLayoutChrome as z
1351
+ BLOX_DATA_KEY as v,
1352
+ BLOX_LAYOUT_KEY as w,
1353
+ BloxInstance as x,
1354
+ _sfc_main$2 as y,
1355
+ _sfc_main$1 as z
1336
1356
  };
@@ -269,6 +269,12 @@ const PageRenderer = vue.defineComponent({
269
269
  };
270
270
  }
271
271
  });
272
+ const NOT_FOUND_SLUG = "/404";
273
+ function isMissingPageDocument({ hydratedSlug, requestedSlug }) {
274
+ if (!hydratedSlug) return false;
275
+ if (hydratedSlug !== NOT_FOUND_SLUG) return false;
276
+ return requestedSlug !== NOT_FOUND_SLUG;
277
+ }
272
278
  const _hoisted_1$1 = {
273
279
  key: 0,
274
280
  class: "blox-initial-loading"
@@ -346,10 +352,22 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
346
352
  return true;
347
353
  }
348
354
  const routeState = (_a2 = ssg_client.readBloxHydration()) == null ? void 0 : _a2.route;
349
- const entry = (routeState == null ? void 0 : routeState.path) === path ? routeState.resolved : void 0;
350
- if (!entry) return false;
351
- applyResolvedState(entry);
352
- return true;
355
+ if ((routeState == null ? void 0 : routeState.path) === path) {
356
+ applyResolvedState(routeState.resolved);
357
+ return true;
358
+ }
359
+ if (isNotFoundRoute(routeState == null ? void 0 : routeState.path)) {
360
+ applyResolvedState(routeState.resolved, routeState.path);
361
+ return true;
362
+ }
363
+ return false;
364
+ }
365
+ function isNotFoundRoute(path) {
366
+ var _a2;
367
+ if (!path) return false;
368
+ const hostname = typeof window !== "undefined" ? window.location.hostname : "";
369
+ const slug = strategy ? strategy.detect(hostname, path).slug : path;
370
+ return slug === NOT_FOUND_SLUG && !!((_a2 = ssg_client.readBloxHydration()) == null ? void 0 : _a2.route);
353
371
  }
354
372
  function applyResolvedState(entry, path) {
355
373
  var _a2, _b, _c;
@@ -409,7 +427,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
409
427
  } catch (e) {
410
428
  const msg = e instanceof Error ? e.message : String(e);
411
429
  if (msg.includes("404")) {
412
- await router.replace(homePath(urlLocale));
430
+ notFound.value = true;
413
431
  } else {
414
432
  error.value = msg;
415
433
  }
@@ -899,7 +917,7 @@ class BloxInstance {
899
917
  router.addRoute({
900
918
  path: "/_blox_preview",
901
919
  name: BLOX_PREVIEW_ROUTE_NAME,
902
- component: () => Promise.resolve().then(() => require("./PreviewApp-_sBftiOk.cjs")),
920
+ component: () => Promise.resolve().then(() => require("./PreviewApp-8TIZXoXH.cjs")),
903
921
  beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
904
922
  });
905
923
  }
@@ -1289,6 +1307,7 @@ function installBloxRuntime(options) {
1289
1307
  return blox;
1290
1308
  }
1291
1309
  exports.BLOX_ADMIN_CONFIG_KEY = BLOX_ADMIN_CONFIG_KEY;
1310
+ exports.BLOX_CMS_ROUTE_NAME = BLOX_CMS_ROUTE_NAME;
1292
1311
  exports.BLOX_CONFIG_KEY = BLOX_CONFIG_KEY;
1293
1312
  exports.BLOX_DATA_KEY = BLOX_DATA_KEY;
1294
1313
  exports.BLOX_LAYOUT_KEY = BLOX_LAYOUT_KEY;
@@ -1318,6 +1337,7 @@ exports.installBloxRuntime = installBloxRuntime;
1318
1337
  exports.installContentFallback = installContentFallback;
1319
1338
  exports.installSmartLinks = installSmartLinks;
1320
1339
  exports.isAbsoluteExternal = isAbsoluteExternal;
1340
+ exports.isMissingPageDocument = isMissingPageDocument;
1321
1341
  exports.isSoloContentPage = isSoloContentPage;
1322
1342
  exports.isSpecialScheme = isSpecialScheme;
1323
1343
  exports.normalizeLink = normalizeLink;
@@ -92,6 +92,12 @@ export interface PlausibleOptions {
92
92
  /** Self-hosted Plausible host. @default 'https://analytics.bagel.to' */
93
93
  apiHost?: string;
94
94
  }
95
+ /**
96
+ * True when `slug` matches a registered route other than the CMS catch-all —
97
+ * i.e. the URL belongs to a real section whose resource may simply be missing
98
+ * in this language. Paths that only match the catch-all do not exist at all.
99
+ */
100
+ export declare function matchesRealRoute(router: Router, slug: string): boolean;
95
101
  /**
96
102
  * Inject the Plausible tracking script into `<head>` (client-only, idempotent).
97
103
  * No-ops during SSR or if a script for the same domain already exists.
@@ -1 +1 @@
1
- {"version":3,"file":"createBloxApp.d.ts","sourceRoot":"","sources":["../src/createBloxApp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAYhD,MAAM,WAAW,oBAAoB;IACpC,oCAAoC;IACpC,aAAa,EAAE,SAAS,CAAA;IACxB,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,OAAO,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACpD,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAA;IACnB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,CAA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gB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAC5C;;;OAGG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;IAC1B;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAA;IACrC;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,UAAU,GAAG,KAAK,CAAA;IAC/B,0DAA0D;IAC1D,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,CAAA;IACpC,iFAAiF;IACjF,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAChC,gGAAgG;IAChG,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAID;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQtE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAoCvE;AAED,MAAM,WAAW,aAAa;IAC7B,GAAG,EAAE,GAAG,CAAA;IACR,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,YAAY,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAyK1E"}
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const index = require("./index-DUjEj7ts.cjs");
4
- const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-BP6sRzCv.cjs");
5
- const appRuntime = require("./appRuntime-KrtrOgvG.cjs");
4
+ const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-BnPd6x9t.cjs");
5
+ const appRuntime = require("./appRuntime-DriplkOx.cjs");
6
6
  const vue = require("vue");
7
7
  const ssg_client = require("./client-AoDTJJXJ.cjs");
8
8
  const vueRouter = require("vue-router");
@@ -231,13 +231,17 @@ function safeRoute() {
231
231
  return null;
232
232
  }
233
233
  }
234
- const NOT_FOUND_SLUG = "/404";
235
- function isMissingPageDocument({ hydratedSlug, requestedSlug }) {
236
- if (!hydratedSlug) return false;
237
- if (hydratedSlug !== NOT_FOUND_SLUG) return false;
238
- return requestedSlug !== NOT_FOUND_SLUG;
239
- }
240
234
  const DEFAULT_PLAUSIBLE_HOST = "https://analytics.bagel.to";
235
+ function matchesRealRoute(router, slug) {
236
+ var _a;
237
+ try {
238
+ const resolved = router.resolve(slug || "/");
239
+ if (!((_a = resolved == null ? void 0 : resolved.matched) == null ? void 0 : _a.length)) return false;
240
+ return resolved.name !== appRuntime.BLOX_CMS_ROUTE_NAME;
241
+ } catch {
242
+ return false;
243
+ }
244
+ }
241
245
  function injectPlausible(config) {
242
246
  var _a, _b;
243
247
  if (typeof document === "undefined") return;
@@ -348,10 +352,11 @@ function createBloxApp(options) {
348
352
  if (hasSsgState && strategy && typeof window !== "undefined") {
349
353
  const hostname = window.location.hostname;
350
354
  const hydratedPath = (_c = (_b = ssg_client.readBloxHydration()) == null ? void 0 : _b.route) == null ? void 0 : _c.path;
351
- if (isMissingPageDocument({
355
+ const requestedSlug = strategy.detect(hostname, initialPath).slug;
356
+ if (appRuntime.isMissingPageDocument({
352
357
  hydratedSlug: hydratedPath ? strategy.detect(hostname, hydratedPath).slug : "",
353
- requestedSlug: strategy.detect(hostname, initialPath).slug
354
- })) {
358
+ requestedSlug
359
+ }) && matchesRealRoute(router, requestedSlug)) {
355
360
  window.location.replace(strategy.toPath("/", localeOf(initialPath)));
356
361
  return { app, router, blox };
357
362
  }
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { useBloxApi, getItemBySlug, getItemById, provideBloxApi } from "./index-I81QTzv-.js";
2
2
  import { configureApi, createBloxApi, getCollectionResolver, getWebsiteId, getWebsiteIdSync, listItems, resolvePath, setApiOrigin, setCollectionResolver } from "./index-I81QTzv-.js";
3
- import { _, P, s, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-D3nz9VR7.js";
4
- import { f as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, n as normalizeLink, e as BLOX_RUNTIME_KEY, g as useSeo, h as getRegistryData, j as getContentRoute, p as provideBloxData, b as provideBloxLocale, i as installBloxRuntime, s as setActiveLocale, k as installSmartLinks, l as consumePendingLocaleSwitch } from "./appRuntime-wD8N8dxg.js";
5
- import { _ as _2, m, o, q, t, v, w, x, y, P as P2, z, A, c, a as a2, C, D, E, F, G, H, I, J, K, L, M, r, N, O, Q, R } from "./appRuntime-wD8N8dxg.js";
3
+ import { _, P, s, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-zAjDTnQg.js";
4
+ import { f as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, n as normalizeLink, e as BLOX_RUNTIME_KEY, g as useSeo, h as getRegistryData, j as getContentRoute, p as provideBloxData, b as provideBloxLocale, i as installBloxRuntime, s as setActiveLocale, k as isMissingPageDocument, l as installSmartLinks, m as consumePendingLocaleSwitch, o as BLOX_CMS_ROUTE_NAME } from "./appRuntime-0WTFR_UL.js";
5
+ import { _ as _2, q, t, v, w, x, y, z, A, P as P2, C, D, c, a as a2, E, F, G, H, I, J, K, L, M, N, O, r, Q, R, S, T } from "./appRuntime-0WTFR_UL.js";
6
6
  import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, Transition, resolveDynamicComponent, inject, ref, watch, onMounted, onUnmounted, computed, onServerPrefetch, toValue, h, Suspense, createSSRApp, createApp } from "vue";
7
7
  import { r as readBloxHydration } from "./client-Ce9fRCGH.js";
8
8
  import { useRouter, useRoute } from "vue-router";
@@ -231,13 +231,17 @@ function safeRoute() {
231
231
  return null;
232
232
  }
233
233
  }
234
- const NOT_FOUND_SLUG = "/404";
235
- function isMissingPageDocument({ hydratedSlug, requestedSlug }) {
236
- if (!hydratedSlug) return false;
237
- if (hydratedSlug !== NOT_FOUND_SLUG) return false;
238
- return requestedSlug !== NOT_FOUND_SLUG;
239
- }
240
234
  const DEFAULT_PLAUSIBLE_HOST = "https://analytics.bagel.to";
235
+ function matchesRealRoute(router, slug) {
236
+ var _a;
237
+ try {
238
+ const resolved = router.resolve(slug || "/");
239
+ if (!((_a = resolved == null ? void 0 : resolved.matched) == null ? void 0 : _a.length)) return false;
240
+ return resolved.name !== BLOX_CMS_ROUTE_NAME;
241
+ } catch {
242
+ return false;
243
+ }
244
+ }
241
245
  function injectPlausible(config) {
242
246
  var _a, _b;
243
247
  if (typeof document === "undefined") return;
@@ -348,10 +352,11 @@ function createBloxApp(options) {
348
352
  if (hasSsgState && strategy && typeof window !== "undefined") {
349
353
  const hostname = window.location.hostname;
350
354
  const hydratedPath = (_c = (_b = readBloxHydration()) == null ? void 0 : _b.route) == null ? void 0 : _c.path;
355
+ const requestedSlug = strategy.detect(hostname, initialPath).slug;
351
356
  if (isMissingPageDocument({
352
357
  hydratedSlug: hydratedPath ? strategy.detect(hostname, hydratedPath).slug : "",
353
- requestedSlug: strategy.detect(hostname, initialPath).slug
354
- })) {
358
+ requestedSlug
359
+ }) && matchesRealRoute(router, requestedSlug)) {
355
360
  window.location.replace(strategy.toPath("/", localeOf(initialPath)));
356
361
  return { app, router, blox };
357
362
  }
@@ -432,53 +437,53 @@ function buildBloxManifest(blox) {
432
437
  }
433
438
  export {
434
439
  _2 as AdminEditBar,
435
- m as BLOX_ADMIN_CONFIG_KEY,
436
- o as BLOX_CONFIG_KEY,
437
- q as BLOX_DATA_KEY,
438
- t as BLOX_LAYOUT_KEY,
440
+ q as BLOX_ADMIN_CONFIG_KEY,
441
+ t as BLOX_CONFIG_KEY,
442
+ v as BLOX_DATA_KEY,
443
+ w as BLOX_LAYOUT_KEY,
439
444
  BLOX_LOCALE_STRATEGY_KEY,
440
445
  BLOX_RUNTIME_KEY,
441
- v as BloxInstance,
446
+ x as BloxInstance,
442
447
  _sfc_main as BloxRouterView,
443
- w as CmsPageView,
444
- x as ContentDetailView,
445
- y as ContentHost,
448
+ y as CmsPageView,
449
+ z as ContentDetailView,
450
+ A as ContentHost,
446
451
  P2 as PageRenderer,
447
452
  _ as PreviewApp,
448
453
  P as PreviewRenderer,
449
- z as applyLayoutChrome,
454
+ C as applyLayoutChrome,
450
455
  buildBloxManifest,
451
- A as classifyLink,
456
+ D as classifyLink,
452
457
  c as collectBloxData,
453
458
  a2 as collectBloxSeo,
454
459
  configureApi,
455
- C as contentRoutes,
456
- D as createBlox,
460
+ E as contentRoutes,
461
+ F as createBlox,
457
462
  createBloxApi,
458
463
  createBloxApp,
459
464
  defineBlock,
460
465
  defineBloxSite,
461
- E as defineContent,
462
- F as generateContentRoutes,
466
+ G as defineContent,
467
+ H as generateContentRoutes,
463
468
  getCollectionResolver,
464
469
  getContentRoute,
465
- G as getContentRouteByCollection,
470
+ I as getContentRouteByCollection,
466
471
  getItemById,
467
472
  getItemBySlug,
468
473
  getWebsiteId,
469
474
  getWebsiteIdSync,
470
475
  injectPlausible,
471
- H as installContentFallback,
476
+ J as installContentFallback,
472
477
  installDocumentNavigation,
473
478
  installSmartLinks,
474
- I as isAbsoluteExternal,
475
- J as isSoloContentPage,
476
- K as isSpecialScheme,
479
+ K as isAbsoluteExternal,
480
+ L as isSoloContentPage,
481
+ M as isSpecialScheme,
477
482
  listItems,
478
483
  normalizeLink,
479
- L as normalizeTo,
484
+ N as normalizeTo,
480
485
  provideBloxData,
481
- M as provideContentItem,
486
+ O as provideContentItem,
482
487
  readBloxHydration,
483
488
  r as resolveBlockProps,
484
489
  resolvePath,
@@ -487,13 +492,13 @@ export {
487
492
  serializeRegistry,
488
493
  setApiOrigin,
489
494
  setCollectionResolver,
490
- N as toInternalPath,
495
+ Q as toInternalPath,
491
496
  useBloxApi,
492
- O as useBloxEdit,
497
+ R as useBloxEdit,
493
498
  useBloxRuntime,
494
- Q as useContentItem,
499
+ S as useContentItem,
495
500
  useContentSeo,
496
- R as useData,
501
+ T as useData,
497
502
  useGlobalBlock,
498
503
  useLocale,
499
504
  useLocaleNav,
@@ -26,7 +26,7 @@ const llmArtifacts = require("../validate-output-BdzD7fIN.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-KrtrOgvG.cjs");
29
+ const appRuntime = require("../appRuntime-DriplkOx.cjs");
30
30
  const index = require("../index-DUjEj7ts.cjs");
31
31
  async function renderBloxSsgPage(options) {
32
32
  var _a, _b, _c, _d;
@@ -3,7 +3,7 @@ import { k, l, f, m, n, o, q, g, r, s, t, w, x, y, p, a, z, A, u, c, v } from ".
3
3
  import { parseBloxBuildGrantBody, resolveBloxBuildGrant } from "./build-grant.mjs";
4
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 provideBloxLocale, B as BLOX_SSR_ROUTE_STATE_KEY, i as installBloxRuntime, s as setActiveLocale } from "../appRuntime-wD8N8dxg.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-0WTFR_UL.js";
7
7
  import { provideBloxApi, getCollectionResolver } from "../index-I81QTzv-.js";
8
8
  async function renderBloxSsgPage(options) {
9
9
  var _a, _b, _c, _d;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.15.663",
4
+ "version": "1.15.665",
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",