@bagelink/blox 1.15.611 → 1.15.613
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.
- package/dist/CmsPageView.vue.d.ts.map +1 -1
- package/dist/{PreviewApp-BRrYLB8D.cjs → PreviewApp-iqvIddLt.cjs} +1 -1
- package/dist/{PreviewApp-CIyd-N0N.js → PreviewApp-vChcurYp.js} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-DeDQpkll.cjs → PreviewApp.vue_vue_type_style_index_0_lang-BP5U8DSp.cjs} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-DO-6pJux.js → PreviewApp.vue_vue_type_style_index_0_lang-y4CzCB8Y.js} +1 -1
- package/dist/{appRuntime-DScwVn-L.cjs → appRuntime-B5XKqx70.cjs} +2 -7
- package/dist/{appRuntime-CMgL56OK.js → appRuntime-Gzs_4KuX.js} +2 -7
- package/dist/composables/usePageContext.d.ts +1 -1
- package/dist/composables/usePageContext.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +4 -4
- package/dist/{shard-runner-BJ5GOYAH.cjs → shard-runner-BloAN-jq.cjs} +2 -2
- package/dist/{shard-runner-AhSQzGqP.js → shard-runner-CzerD_rM.js} +2 -2
- package/dist/ssg/cli.cjs +2 -2
- package/dist/ssg/cli.mjs +2 -2
- package/dist/ssg/createSSREntry.d.ts +1 -0
- package/dist/ssg/createSSREntry.d.ts.map +1 -1
- package/dist/ssg/index.cjs +32 -4
- package/dist/ssg/index.mjs +33 -5
- package/dist/{validate-output-CVjmUmiV.js → validate-output-BeslczYg.js} +4 -1
- package/dist/{validate-output-BTTHpr9g.cjs → validate-output-DK0uHrG6.cjs} +4 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CmsPageView.vue.d.ts","sourceRoot":"","sources":["../src/CmsPageView.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CmsPageView.vue.d.ts","sourceRoot":"","sources":["../src/CmsPageView.vue"],"names":[],"mappings":";AA2iBA,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-
|
|
3
|
+
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-BP5U8DSp.cjs");
|
|
4
4
|
exports.default = PreviewApp_vue_vue_type_style_index_0_lang._sfc_main;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, inject, ref, h, provide, onMounted, onUnmounted, openBlock, createElementBlock, createVNode, unref, nextTick } from "vue";
|
|
2
|
-
import { f as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, g as BLOX_RUNTIME_KEY } from "./appRuntime-
|
|
2
|
+
import { f as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, g as BLOX_RUNTIME_KEY } from "./appRuntime-Gzs_4KuX.js";
|
|
3
3
|
function sendToEditor(msg) {
|
|
4
4
|
window.parent.postMessage(cloneForPostMessage(msg), "*");
|
|
5
5
|
}
|
|
@@ -501,11 +501,6 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
501
501
|
function currentRouteTarget(fallback) {
|
|
502
502
|
return typeof (route == null ? void 0 : route.fullPath) === "string" && route.fullPath ? route.fullPath : currentRoutePath() || fallback;
|
|
503
503
|
}
|
|
504
|
-
function navigableAlternates(alternates, resolvedSlug) {
|
|
505
|
-
const keys = Object.keys(alternates ?? {});
|
|
506
|
-
if (!keys.length) return { [locale2.value]: resolvedSlug };
|
|
507
|
-
return Object.fromEntries(keys.map((l) => [l, resolvedSlug]));
|
|
508
|
-
}
|
|
509
504
|
function tryHydrateFromState(path) {
|
|
510
505
|
if ((ssrRouteState == null ? void 0 : ssrRouteState.path) === path && ssrRouteState.resolved) {
|
|
511
506
|
applyResolvedState(ssrRouteState.resolved);
|
|
@@ -570,7 +565,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
570
565
|
blocks.value = ((_a = resolved.page.content) == null ? void 0 : _a.blocks) ?? [];
|
|
571
566
|
contexts.value = resolved.contexts ?? {};
|
|
572
567
|
currentPageId.value = resolved.page.id ?? null;
|
|
573
|
-
setAlternates(
|
|
568
|
+
setAlternates(resolved.alternates ?? {});
|
|
574
569
|
updateDocumentTitle(resolved);
|
|
575
570
|
} catch (e) {
|
|
576
571
|
const msg = e instanceof Error ? e.message : String(e);
|
|
@@ -1069,7 +1064,7 @@ class BloxInstance {
|
|
|
1069
1064
|
router.addRoute({
|
|
1070
1065
|
path: "/_blox_preview",
|
|
1071
1066
|
name: BLOX_PREVIEW_ROUTE_NAME,
|
|
1072
|
-
component: () => Promise.resolve().then(() => require("./PreviewApp-
|
|
1067
|
+
component: () => Promise.resolve().then(() => require("./PreviewApp-iqvIddLt.cjs")),
|
|
1073
1068
|
beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
|
|
1074
1069
|
});
|
|
1075
1070
|
}
|
|
@@ -500,11 +500,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
500
500
|
function currentRouteTarget(fallback) {
|
|
501
501
|
return typeof (route == null ? void 0 : route.fullPath) === "string" && route.fullPath ? route.fullPath : currentRoutePath() || fallback;
|
|
502
502
|
}
|
|
503
|
-
function navigableAlternates(alternates, resolvedSlug) {
|
|
504
|
-
const keys = Object.keys(alternates ?? {});
|
|
505
|
-
if (!keys.length) return { [locale2.value]: resolvedSlug };
|
|
506
|
-
return Object.fromEntries(keys.map((l) => [l, resolvedSlug]));
|
|
507
|
-
}
|
|
508
503
|
function tryHydrateFromState(path) {
|
|
509
504
|
if ((ssrRouteState == null ? void 0 : ssrRouteState.path) === path && ssrRouteState.resolved) {
|
|
510
505
|
applyResolvedState(ssrRouteState.resolved);
|
|
@@ -569,7 +564,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
569
564
|
blocks.value = ((_a = resolved.page.content) == null ? void 0 : _a.blocks) ?? [];
|
|
570
565
|
contexts.value = resolved.contexts ?? {};
|
|
571
566
|
currentPageId.value = resolved.page.id ?? null;
|
|
572
|
-
setAlternates(
|
|
567
|
+
setAlternates(resolved.alternates ?? {});
|
|
573
568
|
updateDocumentTitle(resolved);
|
|
574
569
|
} catch (e) {
|
|
575
570
|
const msg = e instanceof Error ? e.message : String(e);
|
|
@@ -1068,7 +1063,7 @@ class BloxInstance {
|
|
|
1068
1063
|
router.addRoute({
|
|
1069
1064
|
path: "/_blox_preview",
|
|
1070
1065
|
name: BLOX_PREVIEW_ROUTE_NAME,
|
|
1071
|
-
component: () => import("./PreviewApp-
|
|
1066
|
+
component: () => import("./PreviewApp-vChcurYp.js"),
|
|
1072
1067
|
beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
|
|
1073
1068
|
});
|
|
1074
1069
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function usePageContext<T extends Record<string, unknown> = Record<string, unknown>>(key
|
|
1
|
+
export declare function usePageContext<T extends Record<string, unknown> = Record<string, unknown>>(key?: string): import('vue').ComputedRef<T | null>;
|
|
2
2
|
//# sourceMappingURL=usePageContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePageContext.d.ts","sourceRoot":"","sources":["../../src/composables/usePageContext.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzF,GAAG,
|
|
1
|
+
{"version":3,"file":"usePageContext.d.ts","sourceRoot":"","sources":["../../src/composables/usePageContext.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzF,GAAG,SAAU,uCAuBb"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const appRuntime = require("./appRuntime-
|
|
4
|
-
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
3
|
+
const appRuntime = require("./appRuntime-B5XKqx70.cjs");
|
|
4
|
+
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-BP5U8DSp.cjs");
|
|
5
5
|
const vue = require("vue");
|
|
6
6
|
const vueRouter = require("vue-router");
|
|
7
7
|
const ssg_client = require("./ssg/client.cjs");
|
|
@@ -167,7 +167,7 @@ function useLocaleNav() {
|
|
|
167
167
|
}
|
|
168
168
|
return { switchLocale, toPath, localePath, detect, availableLocales, locale };
|
|
169
169
|
}
|
|
170
|
-
function usePageContext(key) {
|
|
170
|
+
function usePageContext(key = "$page") {
|
|
171
171
|
const contexts = vue.inject("contexts");
|
|
172
172
|
return vue.computed(() => {
|
|
173
173
|
var _a;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, n as normalizeLink, g as BLOX_RUNTIME_KEY, j as useBloxApi, k as useSeo, l as getRegistryData, m as getItemBySlug, o as getItemById, q as getContentRoute, p as provideBloxData, b as provideBloxApi, d as provideBloxLocale, i as installBloxRuntime, s as setActiveLocale, t as installSmartLinks, v as consumePendingLocaleSwitch, B as BLOX_DATA_WINDOW_KEY } from "./appRuntime-
|
|
2
|
-
import { _, w, x, y, z, A, C, D, E, P, F, G, c, a, H, I, J, K, L, M, N, O, Q, R, S, T, U, V, W, X, r, Y, Z, $, a0, a1, a2 } from "./appRuntime-
|
|
3
|
-
import { _ as _2, P as P2, s, a as a3 } from "./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { h as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, n as normalizeLink, g as BLOX_RUNTIME_KEY, j as useBloxApi, k as useSeo, l as getRegistryData, m as getItemBySlug, o as getItemById, q as getContentRoute, p as provideBloxData, b as provideBloxApi, d as provideBloxLocale, i as installBloxRuntime, s as setActiveLocale, t as installSmartLinks, v as consumePendingLocaleSwitch, B as BLOX_DATA_WINDOW_KEY } from "./appRuntime-Gzs_4KuX.js";
|
|
2
|
+
import { _, w, x, y, z, A, C, D, E, P, F, G, c, a, H, I, J, K, L, M, N, O, Q, R, S, T, U, V, W, X, r, Y, Z, $, a0, a1, a2 } from "./appRuntime-Gzs_4KuX.js";
|
|
3
|
+
import { _ as _2, P as P2, s, a as a3 } from "./PreviewApp.vue_vue_type_style_index_0_lang-y4CzCB8Y.js";
|
|
4
4
|
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, Transition, resolveDynamicComponent, inject, ref, watch, onMounted, onUnmounted, computed, onServerPrefetch, toValue, h, Suspense, createSSRApp, createApp } from "vue";
|
|
5
5
|
import { useRouter, useRoute } from "vue-router";
|
|
6
6
|
import { BLOX_STATE_WINDOW_KEY } from "./ssg/client.mjs";
|
|
@@ -166,7 +166,7 @@ function useLocaleNav() {
|
|
|
166
166
|
}
|
|
167
167
|
return { switchLocale, toPath, localePath, detect, availableLocales, locale };
|
|
168
168
|
}
|
|
169
|
-
function usePageContext(key) {
|
|
169
|
+
function usePageContext(key = "$page") {
|
|
170
170
|
const contexts = inject("contexts");
|
|
171
171
|
return computed(() => {
|
|
172
172
|
var _a;
|
|
@@ -26,7 +26,7 @@ const node_child_process = require("node:child_process");
|
|
|
26
26
|
const os = require("node:os");
|
|
27
27
|
const path = require("node:path");
|
|
28
28
|
const process = require("node:process");
|
|
29
|
-
const llmArtifacts = require("./validate-output-
|
|
29
|
+
const llmArtifacts = require("./validate-output-DK0uHrG6.cjs");
|
|
30
30
|
const AUTO_SHARD_CAP = Number(process.env.BLOX_SSG_SHARD_CAP) || 6;
|
|
31
31
|
const PREFETCH_BUDGET = Number(process.env.BLOX_SSG_PREFETCH_BUDGET) || 24;
|
|
32
32
|
const SEQUENTIAL_SHARDS = process.env.BLOX_SSG_SEQUENTIAL === "1";
|
|
@@ -166,7 +166,7 @@ async function runSharded(opts) {
|
|
|
166
166
|
}
|
|
167
167
|
if (process.env.BLOX_SSG_LLM !== "0") {
|
|
168
168
|
try {
|
|
169
|
-
const { mergeLlmParts } = await Promise.resolve().then(() => require("./validate-output-
|
|
169
|
+
const { mergeLlmParts } = await Promise.resolve().then(() => require("./validate-output-DK0uHrG6.cjs")).then((n) => n.llmArtifacts);
|
|
170
170
|
const mergeWebsite = website;
|
|
171
171
|
const partFiles = Array.from({ length: total }, (_, i) => path.join(llmPartsDir, `part.${i}.json`));
|
|
172
172
|
const { pages } = await mergeLlmParts({
|
|
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
5
|
-
import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-
|
|
5
|
+
import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-BeslczYg.js";
|
|
6
6
|
const AUTO_SHARD_CAP = Number(process.env.BLOX_SSG_SHARD_CAP) || 6;
|
|
7
7
|
const PREFETCH_BUDGET = Number(process.env.BLOX_SSG_PREFETCH_BUDGET) || 24;
|
|
8
8
|
const SEQUENTIAL_SHARDS = process.env.BLOX_SSG_SEQUENTIAL === "1";
|
|
@@ -142,7 +142,7 @@ async function runSharded(opts) {
|
|
|
142
142
|
}
|
|
143
143
|
if (process.env.BLOX_SSG_LLM !== "0") {
|
|
144
144
|
try {
|
|
145
|
-
const { mergeLlmParts } = await import("./validate-output-
|
|
145
|
+
const { mergeLlmParts } = await import("./validate-output-BeslczYg.js").then((n) => n.A);
|
|
146
146
|
const mergeWebsite = website;
|
|
147
147
|
const partFiles = Array.from({ length: total }, (_, i) => path.join(llmPartsDir, `part.${i}.json`));
|
|
148
148
|
const { pages } = await mergeLlmParts({
|
package/dist/ssg/cli.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const process = require("node:process");
|
|
4
4
|
const fs = require("node:fs/promises");
|
|
5
5
|
const ssg_buildGrant = require("./build-grant.cjs");
|
|
6
|
-
const llmArtifacts = require("../validate-output-
|
|
6
|
+
const llmArtifacts = require("../validate-output-DK0uHrG6.cjs");
|
|
7
7
|
function installFetchTimeout() {
|
|
8
8
|
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
9
9
|
const original = globalThis.fetch;
|
|
@@ -141,7 +141,7 @@ Environment:
|
|
|
141
141
|
if (shardsOpt !== null || routesCmd) {
|
|
142
142
|
const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
|
|
143
143
|
const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
|
|
144
|
-
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-
|
|
144
|
+
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-BloAN-jq.cjs"));
|
|
145
145
|
const code = await runSharded({
|
|
146
146
|
shards: shardsOpt ?? "auto",
|
|
147
147
|
mode,
|
package/dist/ssg/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { resolveBloxBuildGrant } from "./build-grant.mjs";
|
|
5
|
-
import { v as validateSsgOutput, u as uploadBloxManifest, p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../validate-output-
|
|
5
|
+
import { v as validateSsgOutput, u as uploadBloxManifest, p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../validate-output-BeslczYg.js";
|
|
6
6
|
function installFetchTimeout() {
|
|
7
7
|
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
8
8
|
const original = globalThis.fetch;
|
|
@@ -140,7 +140,7 @@ Environment:
|
|
|
140
140
|
if (shardsOpt !== null || routesCmd) {
|
|
141
141
|
const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
|
|
142
142
|
const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
|
|
143
|
-
const { runSharded } = await import("../shard-runner-
|
|
143
|
+
const { runSharded } = await import("../shard-runner-CzerD_rM.js");
|
|
144
144
|
const code = await runSharded({
|
|
145
145
|
shards: shardsOpt ?? "auto",
|
|
146
146
|
mode,
|
|
@@ -67,6 +67,7 @@ export declare function matchPublishedPage(pages: PublishedPage[], slug: string,
|
|
|
67
67
|
export declare function resolvePublishedPage(pages: PublishedPage[], slug: string, locale: string, resolver?: CreateBloxSSREntryOptions['collectionResolver']): Promise<{
|
|
68
68
|
page: PublishedPage;
|
|
69
69
|
contexts: Record<string, Record<string, unknown> | null>;
|
|
70
|
+
alternates?: Record<string, string>;
|
|
70
71
|
} | null>;
|
|
71
72
|
/**
|
|
72
73
|
* Factory that produces the `{ render }` export for `main.server.ts`.
|
|
@@ -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;A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0E;IAC1E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACnD;AAED,UAAU,aAAa;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;CACF;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,CAqDR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CA8LnF"}
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -22,11 +22,11 @@ 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-
|
|
25
|
+
const llmArtifacts = require("../validate-output-DK0uHrG6.cjs");
|
|
26
26
|
const ssg_buildGrant = require("./build-grant.cjs");
|
|
27
27
|
const ssg_client = require("./client.cjs");
|
|
28
28
|
const vue = require("vue");
|
|
29
|
-
const appRuntime = require("../appRuntime-
|
|
29
|
+
const appRuntime = require("../appRuntime-B5XKqx70.cjs");
|
|
30
30
|
async function renderBloxSsgPage(options) {
|
|
31
31
|
var _a, _b, _c, _d;
|
|
32
32
|
const {
|
|
@@ -144,6 +144,7 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
|
|
|
144
144
|
if (!page) return null;
|
|
145
145
|
const params = ((_a = page.slug) == null ? void 0 : _a.includes(":")) ? templateParams(page.slug, slug) : {};
|
|
146
146
|
const contexts = {};
|
|
147
|
+
let alternates;
|
|
147
148
|
if (params && resolver) {
|
|
148
149
|
for (const [name, binding] of Object.entries(page.data_bindings ?? {})) {
|
|
149
150
|
if (binding.adapter !== "datastore" || !binding.collection || !binding.bind_by) continue;
|
|
@@ -156,10 +157,37 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
|
|
|
156
157
|
q: `${binding.bind_by} eq "${escaped}"`,
|
|
157
158
|
limit: 1
|
|
158
159
|
});
|
|
159
|
-
|
|
160
|
+
const item = items[0] ?? null;
|
|
161
|
+
contexts[name] = item;
|
|
162
|
+
if (item && page.slug) {
|
|
163
|
+
const availableLocales = Array.isArray(item.available_locales) ? item.available_locales.filter((value2) => typeof value2 === "string") : [];
|
|
164
|
+
const stableId = item.id ?? item._id ?? item.legacyId;
|
|
165
|
+
if (availableLocales.length && stableId != null) {
|
|
166
|
+
const escapedId = String(stableId).replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
167
|
+
const localized = await Promise.all(availableLocales.map(async (targetLocale) => {
|
|
168
|
+
const localizedItems = targetLocale === locale ? [item] : await resolver(binding.collection, {
|
|
169
|
+
locale: targetLocale,
|
|
170
|
+
q: `id eq "${escapedId}"`,
|
|
171
|
+
limit: 1
|
|
172
|
+
});
|
|
173
|
+
const localizedItem = localizedItems[0];
|
|
174
|
+
const localizedValue = localizedItem == null ? void 0 : localizedItem[binding.bind_by];
|
|
175
|
+
if (typeof localizedValue !== "string" || !localizedValue) return null;
|
|
176
|
+
return [
|
|
177
|
+
targetLocale,
|
|
178
|
+
page.slug.replace(`:${param.name}`, localizedValue)
|
|
179
|
+
];
|
|
180
|
+
}));
|
|
181
|
+
alternates = Object.fromEntries(localized.filter((value2) => value2 != null));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
160
184
|
}
|
|
161
185
|
}
|
|
162
|
-
return {
|
|
186
|
+
return {
|
|
187
|
+
page,
|
|
188
|
+
contexts,
|
|
189
|
+
...alternates && Object.keys(alternates).length ? { alternates } : {}
|
|
190
|
+
};
|
|
163
191
|
}
|
|
164
192
|
function createBloxSSREntry(options) {
|
|
165
193
|
var _a;
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,10 +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-
|
|
2
|
-
import { i, j, k, f, l, m, n, o, g, q, r, s, t, w, x, p, a, y, z, u, v } from "../validate-output-
|
|
1
|
+
import { b as buildPageHead, c as primaryContextEntry, d as buildJsonLd, e as extractPageText, B as BloxBuildResponseError, h as bloxBuildJson } from "../validate-output-BeslczYg.js";
|
|
2
|
+
import { i, j, k, f, l, m, n, o, g, q, r, s, t, w, x, p, a, y, z, u, v } from "../validate-output-BeslczYg.js";
|
|
3
3
|
import { parseBloxBuildGrantBody, resolveBloxBuildGrant } from "./build-grant.mjs";
|
|
4
4
|
import { BLOX_STATE_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs";
|
|
5
5
|
import { BLOX_DATA_WINDOW_KEY } from "./client.mjs";
|
|
6
6
|
import { createSSRApp, h, Suspense } from "vue";
|
|
7
|
-
import { B as BLOX_DATA_WINDOW_KEY2, c as collectBloxData, a as collectBloxSeo, p as provideBloxData, b as provideBloxApi, d as provideBloxLocale, e as BLOX_SSR_ROUTE_STATE_KEY, i as installBloxRuntime, s as setActiveLocale } from "../appRuntime-
|
|
7
|
+
import { B as BLOX_DATA_WINDOW_KEY2, c as collectBloxData, a as collectBloxSeo, p as provideBloxData, b as provideBloxApi, d as provideBloxLocale, e as BLOX_SSR_ROUTE_STATE_KEY, i as installBloxRuntime, s as setActiveLocale } from "../appRuntime-Gzs_4KuX.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
var _a, _b, _c, _d;
|
|
10
10
|
const {
|
|
@@ -122,6 +122,7 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
|
|
|
122
122
|
if (!page) return null;
|
|
123
123
|
const params = ((_a = page.slug) == null ? void 0 : _a.includes(":")) ? templateParams(page.slug, slug) : {};
|
|
124
124
|
const contexts = {};
|
|
125
|
+
let alternates;
|
|
125
126
|
if (params && resolver) {
|
|
126
127
|
for (const [name, binding] of Object.entries(page.data_bindings ?? {})) {
|
|
127
128
|
if (binding.adapter !== "datastore" || !binding.collection || !binding.bind_by) continue;
|
|
@@ -134,10 +135,37 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
|
|
|
134
135
|
q: `${binding.bind_by} eq "${escaped}"`,
|
|
135
136
|
limit: 1
|
|
136
137
|
});
|
|
137
|
-
|
|
138
|
+
const item = items[0] ?? null;
|
|
139
|
+
contexts[name] = item;
|
|
140
|
+
if (item && page.slug) {
|
|
141
|
+
const availableLocales = Array.isArray(item.available_locales) ? item.available_locales.filter((value2) => typeof value2 === "string") : [];
|
|
142
|
+
const stableId = item.id ?? item._id ?? item.legacyId;
|
|
143
|
+
if (availableLocales.length && stableId != null) {
|
|
144
|
+
const escapedId = String(stableId).replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
145
|
+
const localized = await Promise.all(availableLocales.map(async (targetLocale) => {
|
|
146
|
+
const localizedItems = targetLocale === locale ? [item] : await resolver(binding.collection, {
|
|
147
|
+
locale: targetLocale,
|
|
148
|
+
q: `id eq "${escapedId}"`,
|
|
149
|
+
limit: 1
|
|
150
|
+
});
|
|
151
|
+
const localizedItem = localizedItems[0];
|
|
152
|
+
const localizedValue = localizedItem == null ? void 0 : localizedItem[binding.bind_by];
|
|
153
|
+
if (typeof localizedValue !== "string" || !localizedValue) return null;
|
|
154
|
+
return [
|
|
155
|
+
targetLocale,
|
|
156
|
+
page.slug.replace(`:${param.name}`, localizedValue)
|
|
157
|
+
];
|
|
158
|
+
}));
|
|
159
|
+
alternates = Object.fromEntries(localized.filter((value2) => value2 != null));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
138
162
|
}
|
|
139
163
|
}
|
|
140
|
-
return {
|
|
164
|
+
return {
|
|
165
|
+
page,
|
|
166
|
+
contexts,
|
|
167
|
+
...alternates && Object.keys(alternates).length ? { alternates } : {}
|
|
168
|
+
};
|
|
141
169
|
}
|
|
142
170
|
function createBloxSSREntry(options) {
|
|
143
171
|
var _a;
|
|
@@ -192,7 +192,10 @@ async function expandRoutes(apiBase, pages, requestOptions, locale) {
|
|
|
192
192
|
{},
|
|
193
193
|
requestOptions
|
|
194
194
|
);
|
|
195
|
-
const pageItems =
|
|
195
|
+
const pageItems = grantedWebsiteId ? itemsData.items : itemsData;
|
|
196
|
+
if (!Array.isArray(pageItems)) {
|
|
197
|
+
throw new TypeError(`Blox collection response is invalid: ${b.store}/${b.collection}`);
|
|
198
|
+
}
|
|
196
199
|
items.push(...pageItems);
|
|
197
200
|
if (pageItems.length < pageSize) break;
|
|
198
201
|
}
|
|
@@ -215,7 +215,10 @@ async function expandRoutes(apiBase, pages, requestOptions, locale) {
|
|
|
215
215
|
{},
|
|
216
216
|
requestOptions
|
|
217
217
|
);
|
|
218
|
-
const pageItems =
|
|
218
|
+
const pageItems = grantedWebsiteId ? itemsData.items : itemsData;
|
|
219
|
+
if (!Array.isArray(pageItems)) {
|
|
220
|
+
throw new TypeError(`Blox collection response is invalid: ${b.store}/${b.collection}`);
|
|
221
|
+
}
|
|
219
222
|
items.push(...pageItems);
|
|
220
223
|
if (pageItems.length < pageSize) break;
|
|
221
224
|
}
|
package/package.json
CHANGED