@bagelink/blox 1.15.663 → 1.15.666

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-DyqW-xf-.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-DXGJTQpf.js";
2
2
  export {
3
3
  _sfc_main as default
4
4
  };
@@ -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-CYiKSBIq.js";
3
3
  function sendToEditor(msg) {
4
4
  window.parent.postMessage(cloneForPostMessage(msg), "*");
5
5
  }
@@ -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-BotwL3aS.cjs");
4
4
  function sendToEditor(msg) {
5
5
  window.parent.postMessage(cloneForPostMessage(msg), "*");
6
6
  }
@@ -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-BNUe-6Nm.cjs")),
903
921
  beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
904
922
  });
905
923
  }
@@ -1289,10 +1307,12 @@ 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;
1295
1314
  exports.BLOX_LOCALE_STRATEGY_KEY = BLOX_LOCALE_STRATEGY_KEY;
1315
+ exports.BLOX_PREVIEW_ROUTE_NAME = BLOX_PREVIEW_ROUTE_NAME;
1296
1316
  exports.BLOX_REGISTRY_KEY = BLOX_REGISTRY_KEY;
1297
1317
  exports.BLOX_RUNTIME_KEY = BLOX_RUNTIME_KEY;
1298
1318
  exports.BLOX_SSR_ROUTE_STATE_KEY = BLOX_SSR_ROUTE_STATE_KEY;
@@ -1318,6 +1338,7 @@ exports.installBloxRuntime = installBloxRuntime;
1318
1338
  exports.installContentFallback = installContentFallback;
1319
1339
  exports.installSmartLinks = installSmartLinks;
1320
1340
  exports.isAbsoluteExternal = isAbsoluteExternal;
1341
+ exports.isMissingPageDocument = isMissingPageDocument;
1321
1342
  exports.isSoloContentPage = isSoloContentPage;
1322
1343
  exports.isSpecialScheme = isSpecialScheme;
1323
1344
  exports.normalizeLink = normalizeLink;
@@ -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-tGABBSYV.js"),
902
920
  beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
903
921
  });
904
922
  }
@@ -1288,24 +1306,27 @@ function installBloxRuntime(options) {
1288
1306
  return blox;
1289
1307
  }
1290
1308
  export {
1291
- classifyLink as A,
1309
+ _sfc_main$1 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
+ _sfc_main as C,
1312
+ applyLayoutChrome as D,
1313
+ classifyLink as E,
1314
+ contentRoutes as F,
1315
+ createBlox as G,
1316
+ defineContent as H,
1317
+ generateContentRoutes as I,
1318
+ getContentRouteByCollection as J,
1319
+ installContentFallback as K,
1320
+ isAbsoluteExternal as L,
1321
+ isSoloContentPage as M,
1322
+ isSpecialScheme as N,
1323
+ normalizeTo as O,
1306
1324
  PageRenderer as P,
1307
- useContentItem as Q,
1308
- useData as R,
1325
+ provideContentItem as Q,
1326
+ toInternalPath as R,
1327
+ useBloxEdit as S,
1328
+ useContentItem as T,
1329
+ useData as U,
1309
1330
  _sfc_main$3 as _,
1310
1331
  collectBloxSeo as a,
1311
1332
  provideBloxLocale as b,
@@ -1317,20 +1338,20 @@ export {
1317
1338
  getRegistryData as h,
1318
1339
  installBloxRuntime as i,
1319
1340
  getContentRoute as j,
1320
- installSmartLinks as k,
1321
- consumePendingLocaleSwitch as l,
1322
- BLOX_ADMIN_CONFIG_KEY as m,
1341
+ isMissingPageDocument as k,
1342
+ installSmartLinks as l,
1343
+ consumePendingLocaleSwitch as m,
1323
1344
  normalizeLink as n,
1324
- BLOX_CONFIG_KEY as o,
1345
+ BLOX_CMS_ROUTE_NAME as o,
1325
1346
  provideBloxData as p,
1326
- BLOX_DATA_KEY as q,
1347
+ BLOX_PREVIEW_ROUTE_NAME as q,
1327
1348
  resolveBlockProps as r,
1328
1349
  setActiveLocale as s,
1329
- BLOX_LAYOUT_KEY as t,
1350
+ BLOX_ADMIN_CONFIG_KEY as t,
1330
1351
  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
1352
+ BLOX_CONFIG_KEY as v,
1353
+ BLOX_DATA_KEY as w,
1354
+ BLOX_LAYOUT_KEY as x,
1355
+ BloxInstance as y,
1356
+ _sfc_main$2 as z
1336
1357
  };
@@ -92,6 +92,17 @@ 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
+ * The editor preview route is excluded: the designer iframe deliberately loads
101
+ * `/_blox_preview`, which is never prerendered, so the host serves the 404
102
+ * document for it. Treating that as a "missing page" would navigate the iframe
103
+ * away and leave the designer with a non-editable preview.
104
+ */
105
+ export declare function matchesRealRoute(router: Router, slug: string): boolean;
95
106
  /**
96
107
  * Inject the Plausible tracking script into `<head>` (client-only, idempotent).
97
108
  * 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,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AAM,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,13 +1,13 @@
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-DyqW-xf-.cjs");
5
+ const appRuntime = require("./appRuntime-BotwL3aS.cjs");
6
6
  const vue = require("vue");
7
7
  const ssg_client = require("./client-AoDTJJXJ.cjs");
8
8
  const vueRouter = require("vue-router");
9
9
  const FORM_CONTROL_SELECTOR = "button, input, select, textarea, label, option";
10
- function isEditorPreview() {
10
+ function isEditorPreview$1() {
11
11
  try {
12
12
  return window.self !== window.top || window.location.pathname.startsWith("/_blox_preview");
13
13
  } catch {
@@ -15,7 +15,7 @@ function isEditorPreview() {
15
15
  }
16
16
  }
17
17
  function installDocumentNavigation(router) {
18
- if (typeof window === "undefined" || typeof document === "undefined" || isEditorPreview()) {
18
+ if (typeof window === "undefined" || typeof document === "undefined" || isEditorPreview$1()) {
19
19
  return () => {
20
20
  };
21
21
  }
@@ -231,13 +231,26 @@ 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
+ if (resolved.name === appRuntime.BLOX_CMS_ROUTE_NAME) return false;
241
+ if (resolved.name === appRuntime.BLOX_PREVIEW_ROUTE_NAME) return false;
242
+ return true;
243
+ } catch {
244
+ return false;
245
+ }
246
+ }
247
+ function isEditorPreview() {
248
+ try {
249
+ return typeof window !== "undefined" && window.self !== window.top;
250
+ } catch {
251
+ return true;
252
+ }
253
+ }
241
254
  function injectPlausible(config) {
242
255
  var _a, _b;
243
256
  if (typeof document === "undefined") return;
@@ -345,13 +358,14 @@ function createBloxApp(options) {
345
358
  const initialPath = typeof window !== "undefined" && ((_a = window.location) == null ? void 0 : _a.pathname) ? window.location.pathname : router.currentRoute.value.path;
346
359
  appRuntime.setActiveLocale(localeOf(initialPath), localeState);
347
360
  appRuntime.setActiveLocale(localeOf(initialPath), localeState);
348
- if (hasSsgState && strategy && typeof window !== "undefined") {
361
+ if (hasSsgState && strategy && typeof window !== "undefined" && !isEditorPreview()) {
349
362
  const hostname = window.location.hostname;
350
363
  const hydratedPath = (_c = (_b = ssg_client.readBloxHydration()) == null ? void 0 : _b.route) == null ? void 0 : _c.path;
351
- if (isMissingPageDocument({
364
+ const requestedSlug = strategy.detect(hostname, initialPath).slug;
365
+ if (appRuntime.isMissingPageDocument({
352
366
  hydratedSlug: hydratedPath ? strategy.detect(hostname, hydratedPath).slug : "",
353
- requestedSlug: strategy.detect(hostname, initialPath).slug
354
- })) {
367
+ requestedSlug
368
+ }) && matchesRealRoute(router, requestedSlug)) {
355
369
  window.location.replace(strategy.toPath("/", localeOf(initialPath)));
356
370
  return { app, router, blox };
357
371
  }
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
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-DXGJTQpf.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, q as BLOX_PREVIEW_ROUTE_NAME } from "./appRuntime-CYiKSBIq.js";
5
+ import { _ as _2, t, v, w, x, y, z, A, C, P as P2, D, E, c, a as a2, F, G, H, I, J, K, L, M, N, O, Q, r, R, S, T, U } from "./appRuntime-CYiKSBIq.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";
9
9
  const FORM_CONTROL_SELECTOR = "button, input, select, textarea, label, option";
10
- function isEditorPreview() {
10
+ function isEditorPreview$1() {
11
11
  try {
12
12
  return window.self !== window.top || window.location.pathname.startsWith("/_blox_preview");
13
13
  } catch {
@@ -15,7 +15,7 @@ function isEditorPreview() {
15
15
  }
16
16
  }
17
17
  function installDocumentNavigation(router) {
18
- if (typeof window === "undefined" || typeof document === "undefined" || isEditorPreview()) {
18
+ if (typeof window === "undefined" || typeof document === "undefined" || isEditorPreview$1()) {
19
19
  return () => {
20
20
  };
21
21
  }
@@ -231,13 +231,26 @@ 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
+ if (resolved.name === BLOX_CMS_ROUTE_NAME) return false;
241
+ if (resolved.name === BLOX_PREVIEW_ROUTE_NAME) return false;
242
+ return true;
243
+ } catch {
244
+ return false;
245
+ }
246
+ }
247
+ function isEditorPreview() {
248
+ try {
249
+ return typeof window !== "undefined" && window.self !== window.top;
250
+ } catch {
251
+ return true;
252
+ }
253
+ }
241
254
  function injectPlausible(config) {
242
255
  var _a, _b;
243
256
  if (typeof document === "undefined") return;
@@ -345,13 +358,14 @@ function createBloxApp(options) {
345
358
  const initialPath = typeof window !== "undefined" && ((_a = window.location) == null ? void 0 : _a.pathname) ? window.location.pathname : router.currentRoute.value.path;
346
359
  setActiveLocale(localeOf(initialPath), localeState);
347
360
  setActiveLocale(localeOf(initialPath), localeState);
348
- if (hasSsgState && strategy && typeof window !== "undefined") {
361
+ if (hasSsgState && strategy && typeof window !== "undefined" && !isEditorPreview()) {
349
362
  const hostname = window.location.hostname;
350
363
  const hydratedPath = (_c = (_b = readBloxHydration()) == null ? void 0 : _b.route) == null ? void 0 : _c.path;
364
+ const requestedSlug = strategy.detect(hostname, initialPath).slug;
351
365
  if (isMissingPageDocument({
352
366
  hydratedSlug: hydratedPath ? strategy.detect(hostname, hydratedPath).slug : "",
353
- requestedSlug: strategy.detect(hostname, initialPath).slug
354
- })) {
367
+ requestedSlug
368
+ }) && matchesRealRoute(router, requestedSlug)) {
355
369
  window.location.replace(strategy.toPath("/", localeOf(initialPath)));
356
370
  return { app, router, blox };
357
371
  }
@@ -432,53 +446,53 @@ function buildBloxManifest(blox) {
432
446
  }
433
447
  export {
434
448
  _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,
449
+ t as BLOX_ADMIN_CONFIG_KEY,
450
+ v as BLOX_CONFIG_KEY,
451
+ w as BLOX_DATA_KEY,
452
+ x as BLOX_LAYOUT_KEY,
439
453
  BLOX_LOCALE_STRATEGY_KEY,
440
454
  BLOX_RUNTIME_KEY,
441
- v as BloxInstance,
455
+ y as BloxInstance,
442
456
  _sfc_main as BloxRouterView,
443
- w as CmsPageView,
444
- x as ContentDetailView,
445
- y as ContentHost,
457
+ z as CmsPageView,
458
+ A as ContentDetailView,
459
+ C as ContentHost,
446
460
  P2 as PageRenderer,
447
461
  _ as PreviewApp,
448
462
  P as PreviewRenderer,
449
- z as applyLayoutChrome,
463
+ D as applyLayoutChrome,
450
464
  buildBloxManifest,
451
- A as classifyLink,
465
+ E as classifyLink,
452
466
  c as collectBloxData,
453
467
  a2 as collectBloxSeo,
454
468
  configureApi,
455
- C as contentRoutes,
456
- D as createBlox,
469
+ F as contentRoutes,
470
+ G as createBlox,
457
471
  createBloxApi,
458
472
  createBloxApp,
459
473
  defineBlock,
460
474
  defineBloxSite,
461
- E as defineContent,
462
- F as generateContentRoutes,
475
+ H as defineContent,
476
+ I as generateContentRoutes,
463
477
  getCollectionResolver,
464
478
  getContentRoute,
465
- G as getContentRouteByCollection,
479
+ J as getContentRouteByCollection,
466
480
  getItemById,
467
481
  getItemBySlug,
468
482
  getWebsiteId,
469
483
  getWebsiteIdSync,
470
484
  injectPlausible,
471
- H as installContentFallback,
485
+ K as installContentFallback,
472
486
  installDocumentNavigation,
473
487
  installSmartLinks,
474
- I as isAbsoluteExternal,
475
- J as isSoloContentPage,
476
- K as isSpecialScheme,
488
+ L as isAbsoluteExternal,
489
+ M as isSoloContentPage,
490
+ N as isSpecialScheme,
477
491
  listItems,
478
492
  normalizeLink,
479
- L as normalizeTo,
493
+ O as normalizeTo,
480
494
  provideBloxData,
481
- M as provideContentItem,
495
+ Q as provideContentItem,
482
496
  readBloxHydration,
483
497
  r as resolveBlockProps,
484
498
  resolvePath,
@@ -487,13 +501,13 @@ export {
487
501
  serializeRegistry,
488
502
  setApiOrigin,
489
503
  setCollectionResolver,
490
- N as toInternalPath,
504
+ R as toInternalPath,
491
505
  useBloxApi,
492
- O as useBloxEdit,
506
+ S as useBloxEdit,
493
507
  useBloxRuntime,
494
- Q as useContentItem,
508
+ T as useContentItem,
495
509
  useContentSeo,
496
- R as useData,
510
+ U as useData,
497
511
  useGlobalBlock,
498
512
  useLocale,
499
513
  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-BotwL3aS.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-CYiKSBIq.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.666",
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",