@bagelink/blox 1.15.635 → 1.15.641
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-BtQBgxxJ.cjs → PreviewApp-BD5RzRZO.cjs} +1 -1
- package/dist/{PreviewApp-D7nTn843.js → PreviewApp-C-0zfTwq.js} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-DDqfNEdN.js → PreviewApp.vue_vue_type_style_index_0_lang-0cUPU_L_.js} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-BGQBi7kZ.cjs → PreviewApp.vue_vue_type_style_index_0_lang-DuF7jSt7.cjs} +1 -1
- package/dist/{appRuntime-Zt_fH0wN.cjs → appRuntime-Bh3LdYXU.cjs} +25 -21
- package/dist/{appRuntime-MDr0X5u0.js → appRuntime-Sl40toxn.js} +15 -11
- package/dist/data/useData.d.ts +7 -0
- package/dist/data/useData.d.ts.map +1 -1
- package/dist/{pageTitle-Dh_UoICu.cjs → index-DUjEj7ts.cjs} +2 -54
- package/dist/{pageTitle-BUVrac-4.js → index-I81QTzv-.js} +15 -68
- package/dist/index.cjs +19 -19
- package/dist/index.mjs +19 -19
- package/dist/pageTitle-B1mtDJKn.js +59 -0
- package/dist/pageTitle-wobGhtiZ.cjs +58 -0
- package/dist/pageTitle.d.ts +16 -1
- package/dist/pageTitle.d.ts.map +1 -1
- package/dist/{shard-runner-Cv5Cjm1f.js → shard-runner-Dpy8KM8K.js} +2 -2
- package/dist/{shard-runner-JbXPS_Dl.cjs → shard-runner-kul5GCkF.cjs} +2 -2
- package/dist/ssg/cli.cjs +4 -4
- package/dist/ssg/cli.mjs +3 -3
- package/dist/ssg/index.cjs +7 -7
- package/dist/ssg/index.mjs +4 -4
- package/dist/ssg/seo.d.ts +1 -0
- package/dist/ssg/seo.d.ts.map +1 -1
- package/dist/{validate-output-ClPMepYU.js → validate-output-Bece4IcI.js} +7 -8
- package/dist/{validate-output-CgOarPEF.cjs → validate-output-uWZ9-FOM.cjs} +7 -8
- 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":";AA6hBA,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-DuF7jSt7.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 { d as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, e as BLOX_RUNTIME_KEY } from "./appRuntime-
|
|
2
|
+
import { d as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, e as BLOX_RUNTIME_KEY } from "./appRuntime-Sl40toxn.js";
|
|
3
3
|
function sendToEditor(msg) {
|
|
4
4
|
window.parent.postMessage(cloneForPostMessage(msg), "*");
|
|
5
5
|
}
|
|
@@ -4,9 +4,10 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
const pinia = require("pinia");
|
|
6
6
|
const vue = require("vue");
|
|
7
|
-
const
|
|
7
|
+
const index = require("./index-DUjEj7ts.cjs");
|
|
8
8
|
const vueRouter = require("vue-router");
|
|
9
9
|
const vue$1 = require("@bagelink/vue");
|
|
10
|
+
const pageTitle = require("./pageTitle-wobGhtiZ.cjs");
|
|
10
11
|
const ssg_client = require("./client-AoDTJJXJ.cjs");
|
|
11
12
|
const BLOX_REGISTRY_KEY = Symbol("blox:registry");
|
|
12
13
|
const BLOX_CONFIG_KEY = Symbol("blox:config");
|
|
@@ -287,19 +288,20 @@ const _hoisted_4$1 = {
|
|
|
287
288
|
const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
288
289
|
__name: "CmsPageView",
|
|
289
290
|
setup(__props) {
|
|
291
|
+
var _a;
|
|
290
292
|
const route = vueRouter.useRoute();
|
|
291
293
|
const router = vueRouter.useRouter();
|
|
292
294
|
const { locale: locale2, setLocale, setAlternates } = useLocale();
|
|
293
295
|
const strategy = vue.inject(BLOX_LOCALE_STRATEGY_KEY, null);
|
|
294
296
|
const config = vue.inject(BLOX_CONFIG_KEY, null);
|
|
295
297
|
const ssrRouteState = vue.inject(BLOX_SSR_ROUTE_STATE_KEY, null);
|
|
296
|
-
const api =
|
|
298
|
+
const api = index.useBloxApi();
|
|
297
299
|
const blocks = vue.ref([]);
|
|
298
300
|
const contexts = vue.ref({});
|
|
299
301
|
vue.provide("contexts", contexts);
|
|
300
302
|
const adminConfig = vue.inject(BLOX_ADMIN_CONFIG_KEY, null);
|
|
301
303
|
const currentPageId = vue.ref(null);
|
|
302
|
-
const websiteId = vue.ref((api == null ? void 0 : api.getWebsiteIdSync()) ??
|
|
304
|
+
const websiteId = vue.ref((api == null ? void 0 : api.getWebsiteIdSync()) ?? index.getWebsiteIdSync());
|
|
303
305
|
const notFound = vue.ref(false);
|
|
304
306
|
const error = vue.ref(null);
|
|
305
307
|
const initialLoading = vue.ref(true);
|
|
@@ -315,20 +317,20 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
315
317
|
return typeof (route == null ? void 0 : route.fullPath) === "string" && route.fullPath ? route.fullPath : currentRoutePath() || fallback;
|
|
316
318
|
}
|
|
317
319
|
function tryHydrateFromState(path) {
|
|
318
|
-
var
|
|
320
|
+
var _a2;
|
|
319
321
|
if ((ssrRouteState == null ? void 0 : ssrRouteState.path) === path && ssrRouteState.resolved) {
|
|
320
322
|
applyResolvedState(ssrRouteState.resolved);
|
|
321
323
|
return true;
|
|
322
324
|
}
|
|
323
|
-
const routeState = (
|
|
325
|
+
const routeState = (_a2 = ssg_client.readBloxHydration()) == null ? void 0 : _a2.route;
|
|
324
326
|
const entry = (routeState == null ? void 0 : routeState.path) === path ? routeState.resolved : void 0;
|
|
325
327
|
if (!entry) return false;
|
|
326
328
|
applyResolvedState(entry);
|
|
327
329
|
return true;
|
|
328
330
|
}
|
|
329
331
|
function applyResolvedState(entry, path) {
|
|
330
|
-
var
|
|
331
|
-
blocks.value = ((_b = (
|
|
332
|
+
var _a2, _b, _c;
|
|
333
|
+
blocks.value = ((_b = (_a2 = entry.page) == null ? void 0 : _a2.content) == null ? void 0 : _b.blocks) ?? [];
|
|
332
334
|
contexts.value = entry.contexts ?? {};
|
|
333
335
|
currentPageId.value = ((_c = entry.page) == null ? void 0 : _c.id) ?? null;
|
|
334
336
|
setAlternates(entry.alternates && Object.keys(entry.alternates).length ? entry.alternates : {});
|
|
@@ -342,17 +344,18 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
342
344
|
if (title) document.title = title;
|
|
343
345
|
}
|
|
344
346
|
const initialSlug = (() => {
|
|
345
|
-
var
|
|
347
|
+
var _a2;
|
|
346
348
|
if (strategy) {
|
|
347
|
-
const hostname = typeof window !== "undefined" ? ((
|
|
349
|
+
const hostname = typeof window !== "undefined" ? ((_a2 = window.location) == null ? void 0 : _a2.hostname) ?? "" : "";
|
|
348
350
|
return strategy.detect(hostname, currentRoutePath()).slug;
|
|
349
351
|
}
|
|
350
352
|
return currentRoutePath();
|
|
351
353
|
})();
|
|
352
354
|
const ssrHydrated = tryHydrateFromState(initialSlug);
|
|
355
|
+
const hasPrerenderedRouteState = ((_a = ssg_client.readBloxHydration()) == null ? void 0 : _a.route) != null;
|
|
353
356
|
if (ssrHydrated) initialLoading.value = false;
|
|
354
357
|
async function load() {
|
|
355
|
-
var
|
|
358
|
+
var _a2;
|
|
356
359
|
notFound.value = false;
|
|
357
360
|
error.value = null;
|
|
358
361
|
const { locale: urlLocale, slug } = strategy ? strategy.detect(typeof window !== "undefined" ? window.location.hostname : "", currentRoutePath()) : { locale: locale2.value, slug: currentRoutePath() };
|
|
@@ -361,14 +364,14 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
361
364
|
initialLoading.value = false;
|
|
362
365
|
return;
|
|
363
366
|
}
|
|
364
|
-
if ((config == null ? void 0 : config.navigation) === "document" && typeof window !== "undefined") {
|
|
367
|
+
if ((config == null ? void 0 : config.navigation) === "document" && hasPrerenderedRouteState && typeof window !== "undefined") {
|
|
365
368
|
window.location.assign(currentRouteTarget(slug));
|
|
366
369
|
return;
|
|
367
370
|
}
|
|
368
371
|
navigating.value = true;
|
|
369
372
|
try {
|
|
370
|
-
const resolved = await ((api == null ? void 0 : api.resolvePath(slug, urlLocale)) ??
|
|
371
|
-
blocks.value = ((
|
|
373
|
+
const resolved = await ((api == null ? void 0 : api.resolvePath(slug, urlLocale)) ?? index.resolvePath(slug, urlLocale));
|
|
374
|
+
blocks.value = ((_a2 = resolved.page.content) == null ? void 0 : _a2.blocks) ?? [];
|
|
372
375
|
contexts.value = resolved.contexts ?? {};
|
|
373
376
|
currentPageId.value = resolved.page.id ?? null;
|
|
374
377
|
setAlternates(resolved.alternates ?? {});
|
|
@@ -392,7 +395,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
392
395
|
vue.watch(currentRoutePath, load);
|
|
393
396
|
vue.onMounted(() => {
|
|
394
397
|
if (adminConfig && !websiteId.value) {
|
|
395
|
-
((api == null ? void 0 : api.getWebsiteId()) ??
|
|
398
|
+
((api == null ? void 0 : api.getWebsiteId()) ?? index.getWebsiteId()).then((id) => {
|
|
396
399
|
websiteId.value = id;
|
|
397
400
|
}).catch(() => {
|
|
398
401
|
});
|
|
@@ -481,6 +484,7 @@ function collectBloxSeo(registry2) {
|
|
|
481
484
|
if (v.publishedTime) registry2.seo.publishedTime = v.publishedTime;
|
|
482
485
|
if (v.modifiedTime) registry2.seo.modifiedTime = v.modifiedTime;
|
|
483
486
|
if (v.author) registry2.seo.author = v.author;
|
|
487
|
+
if (v.ogType) registry2.seo.ogType = v.ogType;
|
|
484
488
|
if (v.noindex !== void 0) registry2.seo.noindex = v.noindex;
|
|
485
489
|
if (v.alternates !== void 0) registry2.seo.alternates = v.alternates;
|
|
486
490
|
}
|
|
@@ -866,7 +870,7 @@ class BloxInstance {
|
|
|
866
870
|
router.addRoute({
|
|
867
871
|
path: "/_blox_preview",
|
|
868
872
|
name: BLOX_PREVIEW_ROUTE_NAME,
|
|
869
|
-
component: () => Promise.resolve().then(() => require("./PreviewApp-
|
|
873
|
+
component: () => Promise.resolve().then(() => require("./PreviewApp-BD5RzRZO.cjs")),
|
|
870
874
|
beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
|
|
871
875
|
});
|
|
872
876
|
}
|
|
@@ -899,7 +903,7 @@ class BloxInstance {
|
|
|
899
903
|
if (options == null ? void 0 : options.router) this.registerRoutes(options.router);
|
|
900
904
|
if (options == null ? void 0 : options.adminEdit) this._adminEdit = options.adminEdit;
|
|
901
905
|
if ((options == null ? void 0 : options.websiteName) || (options == null ? void 0 : options.store)) {
|
|
902
|
-
|
|
906
|
+
index.configureApi(options.websiteName ?? "", options.store ?? "");
|
|
903
907
|
}
|
|
904
908
|
if (options == null ? void 0 : options.defaultLocale) {
|
|
905
909
|
const { setLocale } = useLocale();
|
|
@@ -917,7 +921,7 @@ function isBlockDefinition(value) {
|
|
|
917
921
|
function createBlox(options) {
|
|
918
922
|
const instance = new BloxInstance(options);
|
|
919
923
|
if ((options == null ? void 0 : options.websiteName) || (options == null ? void 0 : options.store)) {
|
|
920
|
-
|
|
924
|
+
index.configureApi(options.websiteName ?? "", options.store ?? "");
|
|
921
925
|
}
|
|
922
926
|
if (options == null ? void 0 : options.modules) instance.registerModules(options.modules);
|
|
923
927
|
if (options == null ? void 0 : options.components) instance.registerComponents(options.components);
|
|
@@ -979,7 +983,7 @@ function useContentItem(collectionArg, slugArg) {
|
|
|
979
983
|
const c = coll();
|
|
980
984
|
const s = slg();
|
|
981
985
|
if (!c || !s) return null;
|
|
982
|
-
const res = await
|
|
986
|
+
const res = await index.listItemsFromActiveApi(c, { locale: loc(), limit: 1e3 });
|
|
983
987
|
const items = Array.isArray(res) ? res : (res == null ? void 0 : res.items) ?? [];
|
|
984
988
|
return items.find((it) => String((it == null ? void 0 : it.slug) ?? "") === s) ?? null;
|
|
985
989
|
},
|
|
@@ -1145,7 +1149,7 @@ function installContentFallback(router, supportedLocales, defaultLocale, api) {
|
|
|
1145
1149
|
registration.collection,
|
|
1146
1150
|
slug,
|
|
1147
1151
|
urlLocale
|
|
1148
|
-
)) ??
|
|
1152
|
+
)) ?? index.getItemBySlug(
|
|
1149
1153
|
registration.collection,
|
|
1150
1154
|
slug,
|
|
1151
1155
|
urlLocale
|
|
@@ -1162,7 +1166,7 @@ function installContentFallback(router, supportedLocales, defaultLocale, api) {
|
|
|
1162
1166
|
registration.collection,
|
|
1163
1167
|
slug,
|
|
1164
1168
|
sourceLocale
|
|
1165
|
-
)) ??
|
|
1169
|
+
)) ?? index.getItemBySlug(
|
|
1166
1170
|
registration.collection,
|
|
1167
1171
|
slug,
|
|
1168
1172
|
sourceLocale
|
|
@@ -1178,7 +1182,7 @@ function installContentFallback(router, supportedLocales, defaultLocale, api) {
|
|
|
1178
1182
|
registration.collection,
|
|
1179
1183
|
id,
|
|
1180
1184
|
urlLocale
|
|
1181
|
-
)) ??
|
|
1185
|
+
)) ?? index.getItemById(
|
|
1182
1186
|
registration.collection,
|
|
1183
1187
|
id,
|
|
1184
1188
|
urlLocale
|
|
@@ -3,9 +3,10 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { createPinia } from "pinia";
|
|
5
5
|
import { inject, computed, ref, defineComponent, onMounted, unref, openBlock, createElementBlock, createElementVNode, createCommentVNode, getCurrentInstance, h, provide, watch, resolveComponent, toDisplayString, createVNode, withCtx, createTextVNode, Fragment, createBlock, shallowRef, onServerPrefetch, toValue, markRaw, resolveDynamicComponent } from "vue";
|
|
6
|
-
import {
|
|
6
|
+
import { useBloxApi, getWebsiteIdSync, getWebsiteId, resolvePath, configureApi, listItemsFromActiveApi, getItemBySlug, getItemById } from "./index-I81QTzv-.js";
|
|
7
7
|
import { useRoute, useRouter } from "vue-router";
|
|
8
8
|
import { getI18n } from "@bagelink/vue";
|
|
9
|
+
import { r as resolvePageTitle, s as siteNameFromContexts, a as preserveCurrentSiteSuffix } from "./pageTitle-B1mtDJKn.js";
|
|
9
10
|
import { r as readBloxHydration } from "./client-Ce9fRCGH.js";
|
|
10
11
|
const BLOX_REGISTRY_KEY = Symbol("blox:registry");
|
|
11
12
|
const BLOX_CONFIG_KEY = Symbol("blox:config");
|
|
@@ -286,6 +287,7 @@ const _hoisted_4$1 = {
|
|
|
286
287
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
287
288
|
__name: "CmsPageView",
|
|
288
289
|
setup(__props) {
|
|
290
|
+
var _a;
|
|
289
291
|
const route = useRoute();
|
|
290
292
|
const router = useRouter();
|
|
291
293
|
const { locale: locale2, setLocale, setAlternates } = useLocale();
|
|
@@ -314,20 +316,20 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
314
316
|
return typeof (route == null ? void 0 : route.fullPath) === "string" && route.fullPath ? route.fullPath : currentRoutePath() || fallback;
|
|
315
317
|
}
|
|
316
318
|
function tryHydrateFromState(path) {
|
|
317
|
-
var
|
|
319
|
+
var _a2;
|
|
318
320
|
if ((ssrRouteState == null ? void 0 : ssrRouteState.path) === path && ssrRouteState.resolved) {
|
|
319
321
|
applyResolvedState(ssrRouteState.resolved);
|
|
320
322
|
return true;
|
|
321
323
|
}
|
|
322
|
-
const routeState = (
|
|
324
|
+
const routeState = (_a2 = readBloxHydration()) == null ? void 0 : _a2.route;
|
|
323
325
|
const entry = (routeState == null ? void 0 : routeState.path) === path ? routeState.resolved : void 0;
|
|
324
326
|
if (!entry) return false;
|
|
325
327
|
applyResolvedState(entry);
|
|
326
328
|
return true;
|
|
327
329
|
}
|
|
328
330
|
function applyResolvedState(entry, path) {
|
|
329
|
-
var
|
|
330
|
-
blocks.value = ((_b = (
|
|
331
|
+
var _a2, _b, _c;
|
|
332
|
+
blocks.value = ((_b = (_a2 = entry.page) == null ? void 0 : _a2.content) == null ? void 0 : _b.blocks) ?? [];
|
|
331
333
|
contexts.value = entry.contexts ?? {};
|
|
332
334
|
currentPageId.value = ((_c = entry.page) == null ? void 0 : _c.id) ?? null;
|
|
333
335
|
setAlternates(entry.alternates && Object.keys(entry.alternates).length ? entry.alternates : {});
|
|
@@ -341,17 +343,18 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
341
343
|
if (title) document.title = title;
|
|
342
344
|
}
|
|
343
345
|
const initialSlug = (() => {
|
|
344
|
-
var
|
|
346
|
+
var _a2;
|
|
345
347
|
if (strategy) {
|
|
346
|
-
const hostname = typeof window !== "undefined" ? ((
|
|
348
|
+
const hostname = typeof window !== "undefined" ? ((_a2 = window.location) == null ? void 0 : _a2.hostname) ?? "" : "";
|
|
347
349
|
return strategy.detect(hostname, currentRoutePath()).slug;
|
|
348
350
|
}
|
|
349
351
|
return currentRoutePath();
|
|
350
352
|
})();
|
|
351
353
|
const ssrHydrated = tryHydrateFromState(initialSlug);
|
|
354
|
+
const hasPrerenderedRouteState = ((_a = readBloxHydration()) == null ? void 0 : _a.route) != null;
|
|
352
355
|
if (ssrHydrated) initialLoading.value = false;
|
|
353
356
|
async function load() {
|
|
354
|
-
var
|
|
357
|
+
var _a2;
|
|
355
358
|
notFound.value = false;
|
|
356
359
|
error.value = null;
|
|
357
360
|
const { locale: urlLocale, slug } = strategy ? strategy.detect(typeof window !== "undefined" ? window.location.hostname : "", currentRoutePath()) : { locale: locale2.value, slug: currentRoutePath() };
|
|
@@ -360,14 +363,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
360
363
|
initialLoading.value = false;
|
|
361
364
|
return;
|
|
362
365
|
}
|
|
363
|
-
if ((config == null ? void 0 : config.navigation) === "document" && typeof window !== "undefined") {
|
|
366
|
+
if ((config == null ? void 0 : config.navigation) === "document" && hasPrerenderedRouteState && typeof window !== "undefined") {
|
|
364
367
|
window.location.assign(currentRouteTarget(slug));
|
|
365
368
|
return;
|
|
366
369
|
}
|
|
367
370
|
navigating.value = true;
|
|
368
371
|
try {
|
|
369
372
|
const resolved = await ((api == null ? void 0 : api.resolvePath(slug, urlLocale)) ?? resolvePath(slug, urlLocale));
|
|
370
|
-
blocks.value = ((
|
|
373
|
+
blocks.value = ((_a2 = resolved.page.content) == null ? void 0 : _a2.blocks) ?? [];
|
|
371
374
|
contexts.value = resolved.contexts ?? {};
|
|
372
375
|
currentPageId.value = resolved.page.id ?? null;
|
|
373
376
|
setAlternates(resolved.alternates ?? {});
|
|
@@ -480,6 +483,7 @@ function collectBloxSeo(registry2) {
|
|
|
480
483
|
if (v.publishedTime) registry2.seo.publishedTime = v.publishedTime;
|
|
481
484
|
if (v.modifiedTime) registry2.seo.modifiedTime = v.modifiedTime;
|
|
482
485
|
if (v.author) registry2.seo.author = v.author;
|
|
486
|
+
if (v.ogType) registry2.seo.ogType = v.ogType;
|
|
483
487
|
if (v.noindex !== void 0) registry2.seo.noindex = v.noindex;
|
|
484
488
|
if (v.alternates !== void 0) registry2.seo.alternates = v.alternates;
|
|
485
489
|
}
|
|
@@ -865,7 +869,7 @@ class BloxInstance {
|
|
|
865
869
|
router.addRoute({
|
|
866
870
|
path: "/_blox_preview",
|
|
867
871
|
name: BLOX_PREVIEW_ROUTE_NAME,
|
|
868
|
-
component: () => import("./PreviewApp-
|
|
872
|
+
component: () => import("./PreviewApp-C-0zfTwq.js"),
|
|
869
873
|
beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
|
|
870
874
|
});
|
|
871
875
|
}
|
package/dist/data/useData.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ export interface BloxSeoHead {
|
|
|
11
11
|
modifiedTime?: string;
|
|
12
12
|
/** Article author name or profile URL. */
|
|
13
13
|
author?: string;
|
|
14
|
+
/**
|
|
15
|
+
* OpenGraph object type. The block declares what the page *is* — `article`
|
|
16
|
+
* for blog posts, `website` for most others (services, events, sold items,
|
|
17
|
+
* legal pages). Defaults to `website` when omitted; the old heuristic of
|
|
18
|
+
* "bound context ⇒ article" wrongly labelled events/products as articles.
|
|
19
|
+
*/
|
|
20
|
+
ogType?: string;
|
|
14
21
|
/** Prevent indexing this resolved content page and omit it from SSG indexes. */
|
|
15
22
|
noindex?: boolean;
|
|
16
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useData.d.ts","sourceRoot":"","sources":["../../src/data/useData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAKrD,eAAO,MAAM,aAAa,eAAsB,CAAA;AAEhD,wEAAwE;AACxE,MAAM,WAAW,WAAW;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,+CAA+C;IAC/C,YAAY,CAAC,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zE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,gBAAgB,GAAG,WAAW,CAetE;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACxB,GAAG,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAC7B,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACzB,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,GACxB,aAAa,CAAC,CAAC,CAAC,CAqFlB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
3
|
const vue = require("vue");
|
|
3
4
|
const ssg_client = require("./client-AoDTJJXJ.cjs");
|
|
4
5
|
let BASE = "/api";
|
|
@@ -201,57 +202,8 @@ function listItemsFromActiveApi(collection, options = {}) {
|
|
|
201
202
|
var _a;
|
|
202
203
|
return ((_a = useBloxApi()) == null ? void 0 : _a.listItems(collection, options)) ?? listItems(collection, options);
|
|
203
204
|
}
|
|
204
|
-
|
|
205
|
-
const TITLE_FIELDS = ["meta_title", "metaTitle", "title", "name", "productName", "displayName"];
|
|
206
|
-
function primaryPageContext(contexts) {
|
|
207
|
-
if (!contexts) return null;
|
|
208
|
-
const keys = [
|
|
209
|
-
...PREFERRED_CONTEXT_KEYS.filter((key) => key in contexts),
|
|
210
|
-
...Object.keys(contexts).filter((key) => key !== "$website" && !PREFERRED_CONTEXT_KEYS.includes(key)).sort()
|
|
211
|
-
];
|
|
212
|
-
for (const key of keys) {
|
|
213
|
-
const ctx = contexts[key];
|
|
214
|
-
if (ctx != null && typeof ctx === "object") return { key, ctx };
|
|
215
|
-
}
|
|
216
|
-
return null;
|
|
217
|
-
}
|
|
218
|
-
function contextPageTitle(context) {
|
|
219
|
-
if (!context) return null;
|
|
220
|
-
for (const field of TITLE_FIELDS) {
|
|
221
|
-
const value = context[field];
|
|
222
|
-
if (typeof value === "string" && value.trim()) return value.trim();
|
|
223
|
-
}
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
function siteNameFromContexts(contexts) {
|
|
227
|
-
const website = contexts == null ? void 0 : contexts.$website;
|
|
228
|
-
const seo = website == null ? void 0 : website.seo;
|
|
229
|
-
const siteName = seo && typeof seo === "object" ? seo.site_name : website == null ? void 0 : website.site_name;
|
|
230
|
-
return typeof siteName === "string" && siteName.trim() ? siteName.trim() : null;
|
|
231
|
-
}
|
|
232
|
-
function withSiteName(title, siteName) {
|
|
233
|
-
if (!siteName || title.includes(siteName)) return title;
|
|
234
|
-
return `${title} · ${siteName}`;
|
|
235
|
-
}
|
|
236
|
-
function resolvePageTitle(resolved, options = {}) {
|
|
237
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
238
|
-
const hasBinding = !!((_a = resolved.page) == null ? void 0 : _a.data_bindings) && Object.keys(resolved.page.data_bindings).length > 0;
|
|
239
|
-
const contextTitle = hasBinding ? contextPageTitle((_b = primaryPageContext(resolved.contexts)) == null ? void 0 : _b.ctx) : null;
|
|
240
|
-
const dynamicTitle = ((_c = options.override) == null ? void 0 : _c.trim()) || contextTitle;
|
|
241
|
-
if (dynamicTitle) return withSiteName(dynamicTitle, options.siteName);
|
|
242
|
-
if ((_e = (_d = resolved.page) == null ? void 0 : _d.meta_title) == null ? void 0 : _e.trim()) return resolved.page.meta_title.trim();
|
|
243
|
-
if ((_g = (_f = resolved.page) == null ? void 0 : _f.title) == null ? void 0 : _g.trim()) return withSiteName(resolved.page.title.trim(), options.siteName);
|
|
244
|
-
return null;
|
|
245
|
-
}
|
|
246
|
-
function preserveCurrentSiteSuffix(title, currentTitle) {
|
|
247
|
-
const separator = " · ";
|
|
248
|
-
const suffixIndex = currentTitle.lastIndexOf(separator);
|
|
249
|
-
if (suffixIndex < 0) return title;
|
|
250
|
-
const siteName = currentTitle.slice(suffixIndex + separator.length).trim();
|
|
251
|
-
return withSiteName(title, siteName);
|
|
252
|
-
}
|
|
205
|
+
exports.BLOX_API_KEY = BLOX_API_KEY;
|
|
253
206
|
exports.configureApi = configureApi;
|
|
254
|
-
exports.contextPageTitle = contextPageTitle;
|
|
255
207
|
exports.createBloxApi = createBloxApi;
|
|
256
208
|
exports.getCollectionResolver = getCollectionResolver;
|
|
257
209
|
exports.getItemById = getItemById;
|
|
@@ -260,12 +212,8 @@ exports.getWebsiteId = getWebsiteId;
|
|
|
260
212
|
exports.getWebsiteIdSync = getWebsiteIdSync;
|
|
261
213
|
exports.listItems = listItems;
|
|
262
214
|
exports.listItemsFromActiveApi = listItemsFromActiveApi;
|
|
263
|
-
exports.preserveCurrentSiteSuffix = preserveCurrentSiteSuffix;
|
|
264
|
-
exports.primaryPageContext = primaryPageContext;
|
|
265
215
|
exports.provideBloxApi = provideBloxApi;
|
|
266
|
-
exports.resolvePageTitle = resolvePageTitle;
|
|
267
216
|
exports.resolvePath = resolvePath;
|
|
268
217
|
exports.setApiOrigin = setApiOrigin;
|
|
269
218
|
exports.setCollectionResolver = setCollectionResolver;
|
|
270
|
-
exports.siteNameFromContexts = siteNameFromContexts;
|
|
271
219
|
exports.useBloxApi = useBloxApi;
|
|
@@ -200,73 +200,20 @@ function listItemsFromActiveApi(collection, options = {}) {
|
|
|
200
200
|
var _a;
|
|
201
201
|
return ((_a = useBloxApi()) == null ? void 0 : _a.listItems(collection, options)) ?? listItems(collection, options);
|
|
202
202
|
}
|
|
203
|
-
const PREFERRED_CONTEXT_KEYS = ["$page", "$post", "$item", "$article", "$product", "$event", "$author"];
|
|
204
|
-
const TITLE_FIELDS = ["meta_title", "metaTitle", "title", "name", "productName", "displayName"];
|
|
205
|
-
function primaryPageContext(contexts) {
|
|
206
|
-
if (!contexts) return null;
|
|
207
|
-
const keys = [
|
|
208
|
-
...PREFERRED_CONTEXT_KEYS.filter((key) => key in contexts),
|
|
209
|
-
...Object.keys(contexts).filter((key) => key !== "$website" && !PREFERRED_CONTEXT_KEYS.includes(key)).sort()
|
|
210
|
-
];
|
|
211
|
-
for (const key of keys) {
|
|
212
|
-
const ctx = contexts[key];
|
|
213
|
-
if (ctx != null && typeof ctx === "object") return { key, ctx };
|
|
214
|
-
}
|
|
215
|
-
return null;
|
|
216
|
-
}
|
|
217
|
-
function contextPageTitle(context) {
|
|
218
|
-
if (!context) return null;
|
|
219
|
-
for (const field of TITLE_FIELDS) {
|
|
220
|
-
const value = context[field];
|
|
221
|
-
if (typeof value === "string" && value.trim()) return value.trim();
|
|
222
|
-
}
|
|
223
|
-
return null;
|
|
224
|
-
}
|
|
225
|
-
function siteNameFromContexts(contexts) {
|
|
226
|
-
const website = contexts == null ? void 0 : contexts.$website;
|
|
227
|
-
const seo = website == null ? void 0 : website.seo;
|
|
228
|
-
const siteName = seo && typeof seo === "object" ? seo.site_name : website == null ? void 0 : website.site_name;
|
|
229
|
-
return typeof siteName === "string" && siteName.trim() ? siteName.trim() : null;
|
|
230
|
-
}
|
|
231
|
-
function withSiteName(title, siteName) {
|
|
232
|
-
if (!siteName || title.includes(siteName)) return title;
|
|
233
|
-
return `${title} · ${siteName}`;
|
|
234
|
-
}
|
|
235
|
-
function resolvePageTitle(resolved, options = {}) {
|
|
236
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
237
|
-
const hasBinding = !!((_a = resolved.page) == null ? void 0 : _a.data_bindings) && Object.keys(resolved.page.data_bindings).length > 0;
|
|
238
|
-
const contextTitle = hasBinding ? contextPageTitle((_b = primaryPageContext(resolved.contexts)) == null ? void 0 : _b.ctx) : null;
|
|
239
|
-
const dynamicTitle = ((_c = options.override) == null ? void 0 : _c.trim()) || contextTitle;
|
|
240
|
-
if (dynamicTitle) return withSiteName(dynamicTitle, options.siteName);
|
|
241
|
-
if ((_e = (_d = resolved.page) == null ? void 0 : _d.meta_title) == null ? void 0 : _e.trim()) return resolved.page.meta_title.trim();
|
|
242
|
-
if ((_g = (_f = resolved.page) == null ? void 0 : _f.title) == null ? void 0 : _g.trim()) return withSiteName(resolved.page.title.trim(), options.siteName);
|
|
243
|
-
return null;
|
|
244
|
-
}
|
|
245
|
-
function preserveCurrentSiteSuffix(title, currentTitle) {
|
|
246
|
-
const separator = " · ";
|
|
247
|
-
const suffixIndex = currentTitle.lastIndexOf(separator);
|
|
248
|
-
if (suffixIndex < 0) return title;
|
|
249
|
-
const siteName = currentTitle.slice(suffixIndex + separator.length).trim();
|
|
250
|
-
return withSiteName(title, siteName);
|
|
251
|
-
}
|
|
252
203
|
export {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
provideBloxApi as p,
|
|
269
|
-
resolvePageTitle as r,
|
|
270
|
-
setCollectionResolver as s,
|
|
271
|
-
useBloxApi as u
|
|
204
|
+
BLOX_API_KEY,
|
|
205
|
+
configureApi,
|
|
206
|
+
createBloxApi,
|
|
207
|
+
getCollectionResolver,
|
|
208
|
+
getItemById,
|
|
209
|
+
getItemBySlug,
|
|
210
|
+
getWebsiteId,
|
|
211
|
+
getWebsiteIdSync,
|
|
212
|
+
listItems,
|
|
213
|
+
listItemsFromActiveApi,
|
|
214
|
+
provideBloxApi,
|
|
215
|
+
resolvePath,
|
|
216
|
+
setApiOrigin,
|
|
217
|
+
setCollectionResolver,
|
|
218
|
+
useBloxApi
|
|
272
219
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
5
|
-
const appRuntime = require("./appRuntime-
|
|
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-DuF7jSt7.cjs");
|
|
5
|
+
const appRuntime = require("./appRuntime-Bh3LdYXU.cjs");
|
|
6
6
|
const vue = require("vue");
|
|
7
7
|
const ssg_client = require("./client-AoDTJJXJ.cjs");
|
|
8
8
|
const vueRouter = require("vue-router");
|
|
@@ -186,7 +186,7 @@ function useBloxRuntime() {
|
|
|
186
186
|
function useContentSeo(item, head) {
|
|
187
187
|
const route = safeRoute();
|
|
188
188
|
const { locale } = appRuntime.useLocale();
|
|
189
|
-
const api =
|
|
189
|
+
const api = index.useBloxApi();
|
|
190
190
|
const strategy = vue.inject(appRuntime.BLOX_LOCALE_STRATEGY_KEY, null);
|
|
191
191
|
const registration = () => {
|
|
192
192
|
var _a;
|
|
@@ -208,7 +208,7 @@ function useContentSeo(item, head) {
|
|
|
208
208
|
const slug = String(((_a = route == null ? void 0 : route.params) == null ? void 0 : _a.slug) ?? ((_b = vue.toValue(item)) == null ? void 0 : _b.slug) ?? "");
|
|
209
209
|
const activeLoc = String(locale.value || "en").slice(0, 2).toLowerCase();
|
|
210
210
|
const activeItem = vue.toValue(item);
|
|
211
|
-
const entity = activeItem ?? (slug ? await ((api == null ? void 0 : api.getItemBySlug(reg.collection, slug, activeLoc)) ??
|
|
211
|
+
const entity = activeItem ?? (slug ? await ((api == null ? void 0 : api.getItemBySlug(reg.collection, slug, activeLoc)) ?? index.getItemBySlug(reg.collection, slug, activeLoc)).catch(() => null) : null);
|
|
212
212
|
if (!entity) return;
|
|
213
213
|
const id = String(entity.id ?? entity._id ?? "");
|
|
214
214
|
const supported = (strategy == null ? void 0 : strategy.locales) ?? [locale.value];
|
|
@@ -217,7 +217,7 @@ function useContentSeo(item, head) {
|
|
|
217
217
|
const built = {};
|
|
218
218
|
await Promise.all(locales.map(async (loc) => {
|
|
219
219
|
var _a2;
|
|
220
|
-
const locSlug = loc === activeLoc ? String(entity.slug ?? "") : String(((_a2 = await ((api == null ? void 0 : api.getItemById(reg.collection, id, loc)) ??
|
|
220
|
+
const locSlug = loc === activeLoc ? String(entity.slug ?? "") : String(((_a2 = await ((api == null ? void 0 : api.getItemById(reg.collection, id, loc)) ?? index.getItemById(reg.collection, id, loc)).catch(() => null)) == null ? void 0 : _a2.slug) ?? "");
|
|
221
221
|
if (locSlug) built[loc] = reg.route.replace(/:slug(?=\/|$)/, locSlug);
|
|
222
222
|
}));
|
|
223
223
|
if (Object.keys(built).length > 1) alternates = built;
|
|
@@ -287,7 +287,7 @@ function createBloxApp(options) {
|
|
|
287
287
|
render: () => vue.h(vue.Suspense, null, { default: () => vue.h(rootComponent) })
|
|
288
288
|
});
|
|
289
289
|
const dataRegistry = appRuntime.provideBloxData(app);
|
|
290
|
-
const api =
|
|
290
|
+
const api = index.provideBloxApi(app, { websiteName, store });
|
|
291
291
|
const localeState = appRuntime.provideBloxLocale(app, locale);
|
|
292
292
|
const blox = appRuntime.installBloxRuntime({
|
|
293
293
|
app,
|
|
@@ -413,18 +413,18 @@ function serializeRegistry(registry) {
|
|
|
413
413
|
function buildBloxManifest(blox) {
|
|
414
414
|
return serializeRegistry(blox.getRegistry());
|
|
415
415
|
}
|
|
416
|
-
exports.configureApi =
|
|
417
|
-
exports.createBloxApi =
|
|
418
|
-
exports.getCollectionResolver =
|
|
419
|
-
exports.getItemById =
|
|
420
|
-
exports.getItemBySlug =
|
|
421
|
-
exports.getWebsiteId =
|
|
422
|
-
exports.getWebsiteIdSync =
|
|
423
|
-
exports.listItems =
|
|
424
|
-
exports.resolvePath =
|
|
425
|
-
exports.setApiOrigin =
|
|
426
|
-
exports.setCollectionResolver =
|
|
427
|
-
exports.useBloxApi =
|
|
416
|
+
exports.configureApi = index.configureApi;
|
|
417
|
+
exports.createBloxApi = index.createBloxApi;
|
|
418
|
+
exports.getCollectionResolver = index.getCollectionResolver;
|
|
419
|
+
exports.getItemById = index.getItemById;
|
|
420
|
+
exports.getItemBySlug = index.getItemBySlug;
|
|
421
|
+
exports.getWebsiteId = index.getWebsiteId;
|
|
422
|
+
exports.getWebsiteIdSync = index.getWebsiteIdSync;
|
|
423
|
+
exports.listItems = index.listItems;
|
|
424
|
+
exports.resolvePath = index.resolvePath;
|
|
425
|
+
exports.setApiOrigin = index.setApiOrigin;
|
|
426
|
+
exports.setCollectionResolver = index.setCollectionResolver;
|
|
427
|
+
exports.useBloxApi = index.useBloxApi;
|
|
428
428
|
exports.PreviewApp = PreviewApp_vue_vue_type_style_index_0_lang._sfc_main;
|
|
429
429
|
exports.PreviewRenderer = PreviewApp_vue_vue_type_style_index_0_lang.PreviewRenderer;
|
|
430
430
|
exports.sendToEditor = PreviewApp_vue_vue_type_style_index_0_lang.sendToEditor;
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { _, P, s
|
|
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-
|
|
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-
|
|
6
|
-
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, Transition, resolveDynamicComponent, inject, ref, watch, onMounted, onUnmounted, computed, onServerPrefetch, toValue, h
|
|
1
|
+
import { useBloxApi, getItemBySlug, getItemById, provideBloxApi } from "./index-I81QTzv-.js";
|
|
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-0cUPU_L_.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-Sl40toxn.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-Sl40toxn.js";
|
|
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";
|
|
@@ -212,7 +212,7 @@ function useContentSeo(item, head) {
|
|
|
212
212
|
if (!entity) return;
|
|
213
213
|
const id = String(entity.id ?? entity._id ?? "");
|
|
214
214
|
const supported = (strategy == null ? void 0 : strategy.locales) ?? [locale.value];
|
|
215
|
-
const locales = (Array.isArray(entity.available_locales) ? entity.available_locales : []).filter((
|
|
215
|
+
const locales = (Array.isArray(entity.available_locales) ? entity.available_locales : []).filter((l) => supported.includes(l));
|
|
216
216
|
if (!id || !locales.length) return;
|
|
217
217
|
const built = {};
|
|
218
218
|
await Promise.all(locales.map(async (loc) => {
|
|
@@ -284,7 +284,7 @@ function createBloxApp(options) {
|
|
|
284
284
|
const createVueApp = hasSsgState ? createSSRApp : createApp;
|
|
285
285
|
const app = createVueApp({
|
|
286
286
|
name: "BloxRoot",
|
|
287
|
-
render: () =>
|
|
287
|
+
render: () => h(Suspense, null, { default: () => h(rootComponent) })
|
|
288
288
|
});
|
|
289
289
|
const dataRegistry = provideBloxData(app);
|
|
290
290
|
const api = provideBloxApi(app, { websiteName, store });
|
|
@@ -370,7 +370,7 @@ function defineBlock(meta) {
|
|
|
370
370
|
}
|
|
371
371
|
function withLocaleRoutes(path, component, supportedLocales, defaultLocale = "en") {
|
|
372
372
|
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
373
|
-
const prefixed = supportedLocales.filter((
|
|
373
|
+
const prefixed = supportedLocales.filter((l) => l !== defaultLocale);
|
|
374
374
|
const make = (p) => ({ path: p, component });
|
|
375
375
|
const routes = [make(normalized)];
|
|
376
376
|
if (prefixed.length) {
|
|
@@ -434,22 +434,22 @@ export {
|
|
|
434
434
|
A as classifyLink,
|
|
435
435
|
c as collectBloxData,
|
|
436
436
|
a2 as collectBloxSeo,
|
|
437
|
-
|
|
437
|
+
configureApi,
|
|
438
438
|
C as contentRoutes,
|
|
439
439
|
D as createBlox,
|
|
440
|
-
|
|
440
|
+
createBloxApi,
|
|
441
441
|
createBloxApp,
|
|
442
442
|
defineBlock,
|
|
443
443
|
defineBloxSite,
|
|
444
444
|
E as defineContent,
|
|
445
445
|
F as generateContentRoutes,
|
|
446
|
-
|
|
446
|
+
getCollectionResolver,
|
|
447
447
|
getContentRoute,
|
|
448
448
|
G as getContentRouteByCollection,
|
|
449
449
|
getItemById,
|
|
450
450
|
getItemBySlug,
|
|
451
|
-
|
|
452
|
-
|
|
451
|
+
getWebsiteId,
|
|
452
|
+
getWebsiteIdSync,
|
|
453
453
|
injectPlausible,
|
|
454
454
|
H as installContentFallback,
|
|
455
455
|
installDocumentNavigation,
|
|
@@ -457,19 +457,19 @@ export {
|
|
|
457
457
|
I as isAbsoluteExternal,
|
|
458
458
|
J as isSoloContentPage,
|
|
459
459
|
K as isSpecialScheme,
|
|
460
|
-
|
|
460
|
+
listItems,
|
|
461
461
|
normalizeLink,
|
|
462
462
|
L as normalizeTo,
|
|
463
463
|
provideBloxData,
|
|
464
464
|
M as provideContentItem,
|
|
465
465
|
readBloxHydration,
|
|
466
466
|
r as resolveBlockProps,
|
|
467
|
-
|
|
468
|
-
|
|
467
|
+
resolvePath,
|
|
468
|
+
s as sendToEditor,
|
|
469
469
|
a as sendToPreview,
|
|
470
470
|
serializeRegistry,
|
|
471
|
-
|
|
472
|
-
|
|
471
|
+
setApiOrigin,
|
|
472
|
+
setCollectionResolver,
|
|
473
473
|
N as toInternalPath,
|
|
474
474
|
useBloxApi,
|
|
475
475
|
O as useBloxEdit,
|
|
@@ -0,0 +1,59 @@
|
|
|
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, _h;
|
|
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 overrideTitle = (_c = options.override) == null ? void 0 : _c.trim();
|
|
38
|
+
if (overrideTitle) return overrideTitle;
|
|
39
|
+
if (contextTitle) return withSiteName(contextTitle, 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
|
+
if ((_h = options.defaultTitle) == null ? void 0 : _h.trim()) return options.defaultTitle.trim();
|
|
43
|
+
if (options.siteName) return options.siteName;
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
function preserveCurrentSiteSuffix(title, currentTitle) {
|
|
47
|
+
const separator = " · ";
|
|
48
|
+
const suffixIndex = currentTitle.lastIndexOf(separator);
|
|
49
|
+
if (suffixIndex < 0) return title;
|
|
50
|
+
const siteName = currentTitle.slice(suffixIndex + separator.length).trim();
|
|
51
|
+
return withSiteName(title, siteName);
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
preserveCurrentSiteSuffix as a,
|
|
55
|
+
contextPageTitle as c,
|
|
56
|
+
primaryPageContext as p,
|
|
57
|
+
resolvePageTitle as r,
|
|
58
|
+
siteNameFromContexts as s
|
|
59
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
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, _h;
|
|
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 overrideTitle = (_c = options.override) == null ? void 0 : _c.trim();
|
|
39
|
+
if (overrideTitle) return overrideTitle;
|
|
40
|
+
if (contextTitle) return withSiteName(contextTitle, options.siteName);
|
|
41
|
+
if ((_e = (_d = resolved.page) == null ? void 0 : _d.meta_title) == null ? void 0 : _e.trim()) return resolved.page.meta_title.trim();
|
|
42
|
+
if ((_g = (_f = resolved.page) == null ? void 0 : _f.title) == null ? void 0 : _g.trim()) return withSiteName(resolved.page.title.trim(), options.siteName);
|
|
43
|
+
if ((_h = options.defaultTitle) == null ? void 0 : _h.trim()) return options.defaultTitle.trim();
|
|
44
|
+
if (options.siteName) return options.siteName;
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
function preserveCurrentSiteSuffix(title, currentTitle) {
|
|
48
|
+
const separator = " · ";
|
|
49
|
+
const suffixIndex = currentTitle.lastIndexOf(separator);
|
|
50
|
+
if (suffixIndex < 0) return title;
|
|
51
|
+
const siteName = currentTitle.slice(suffixIndex + separator.length).trim();
|
|
52
|
+
return withSiteName(title, siteName);
|
|
53
|
+
}
|
|
54
|
+
exports.contextPageTitle = contextPageTitle;
|
|
55
|
+
exports.preserveCurrentSiteSuffix = preserveCurrentSiteSuffix;
|
|
56
|
+
exports.primaryPageContext = primaryPageContext;
|
|
57
|
+
exports.resolvePageTitle = resolvePageTitle;
|
|
58
|
+
exports.siteNameFromContexts = siteNameFromContexts;
|
package/dist/pageTitle.d.ts
CHANGED
|
@@ -14,10 +14,25 @@ export declare function primaryPageContext(contexts: Record<string, Record<strin
|
|
|
14
14
|
export declare function contextPageTitle(context: Record<string, unknown> | null | undefined): string | null;
|
|
15
15
|
export declare function siteNameFromContexts(contexts: Record<string, Record<string, unknown> | null> | undefined): string | null;
|
|
16
16
|
export declare function withSiteName(title: string, siteName: string | null | undefined): string;
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Single source of truth for the page title — used by `<title>`, `og:title`,
|
|
19
|
+
* `twitter:title`, and the client `document.title`.
|
|
20
|
+
*
|
|
21
|
+
* One precedence list, one suffix rule:
|
|
22
|
+
* 1. `useSeo` override — authoritative, emitted verbatim (no suffix)
|
|
23
|
+
* 2. bound-context title — derived, suffixed with the site name
|
|
24
|
+
* 3. `page.meta_title` — authored SEO field, verbatim
|
|
25
|
+
* 4. `page.title` — human display name, suffixed
|
|
26
|
+
* 5. `defaultTitle` — site-wide authored fallback (seo.default_meta_title)
|
|
27
|
+
* 6. `siteName` — last resort so a title is never empty
|
|
28
|
+
*
|
|
29
|
+
* Only *derived* titles (context + bare `page.title`) get the branding suffix;
|
|
30
|
+
* explicitly-authored ones are used exactly as written.
|
|
31
|
+
*/
|
|
18
32
|
export declare function resolvePageTitle(resolved: PageTitleData, options?: {
|
|
19
33
|
override?: string | null;
|
|
20
34
|
siteName?: string | null;
|
|
35
|
+
defaultTitle?: string | null;
|
|
21
36
|
}): string | null;
|
|
22
37
|
/** Keep the server-rendered site suffix when useSeo hydrates with a bare title. */
|
|
23
38
|
export declare function preserveCurrentSiteSuffix(title: string, currentTitle: string): string;
|
package/dist/pageTitle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pageTitle.d.ts","sourceRoot":"","sources":["../src/pageTitle.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,aAAa;IAC7B,IAAI,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC1B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;KAC9C,CAAA;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;CACzD;AAED,mEAAmE;AACnE,wBAAgB,kBAAkB,CACjC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AE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,IAAI,CActD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAOnG;AAED,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS,GAClE,MAAM,GAAG,IAAI,CAOf;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGvF;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,aAAa,EACvB,OAAO,GAAE;IACR,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB,GACJ,MAAM,GAAG,IAAI,CAef;AAED,mFAAmF;AACnF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAMrF"}
|
|
@@ -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-Bece4IcI.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-Bece4IcI.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({
|
|
@@ -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-uWZ9-FOM.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-uWZ9-FOM.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({
|
package/dist/ssg/cli.cjs
CHANGED
|
@@ -3,8 +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-
|
|
7
|
-
const pageTitle = require("../pageTitle-Dh_UoICu.cjs");
|
|
6
|
+
const llmArtifacts = require("../validate-output-uWZ9-FOM.cjs");
|
|
8
7
|
function installFetchTimeout() {
|
|
9
8
|
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
10
9
|
const original = globalThis.fetch;
|
|
@@ -142,7 +141,7 @@ Environment:
|
|
|
142
141
|
if (shardsOpt !== null || routesCmd) {
|
|
143
142
|
const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
|
|
144
143
|
const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
|
|
145
|
-
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-
|
|
144
|
+
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-kul5GCkF.cjs"));
|
|
146
145
|
const code = await runSharded({
|
|
147
146
|
shards: shardsOpt ?? "auto",
|
|
148
147
|
mode,
|
|
@@ -168,6 +167,7 @@ Environment:
|
|
|
168
167
|
}
|
|
169
168
|
const { apiBase, websiteName: configWebsiteName } = await resolveApiBase(mode);
|
|
170
169
|
await llmArtifacts.polyfillBloxSsgGlobals({ pageUrl: apiBase });
|
|
170
|
+
const { setCollectionResolver } = await Promise.resolve().then(() => require("../index-DUjEj7ts.cjs"));
|
|
171
171
|
const websiteName = process.env.WEBSITE_NAME ?? configWebsiteName ?? "default";
|
|
172
172
|
console.log(siteDataFile ? `Loading cached site routes (mode: ${mode}, site: ${websiteName})…` : `Fetching routes from ${apiBase} (mode: ${mode}, site: ${websiteName})…`);
|
|
173
173
|
let paths = [];
|
|
@@ -197,7 +197,7 @@ Environment:
|
|
|
197
197
|
paths = ["/"];
|
|
198
198
|
}
|
|
199
199
|
if (collectionItems && Object.keys(collectionItems).length > 0) {
|
|
200
|
-
|
|
200
|
+
setCollectionResolver(llmArtifacts.buildCollectionResolver(collectionItems));
|
|
201
201
|
}
|
|
202
202
|
for (const p of extraPaths) {
|
|
203
203
|
if (!paths.includes(p)) paths.push(p);
|
package/dist/ssg/cli.mjs
CHANGED
|
@@ -2,8 +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,
|
|
6
|
-
import { s as setCollectionResolver } from "../pageTitle-BUVrac-4.js";
|
|
5
|
+
import { v as validateSsgOutput, u as uploadBloxManifest, p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, b as buildCollectionResolver, a as prerender } from "../validate-output-Bece4IcI.js";
|
|
7
6
|
function installFetchTimeout() {
|
|
8
7
|
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
9
8
|
const original = globalThis.fetch;
|
|
@@ -141,7 +140,7 @@ Environment:
|
|
|
141
140
|
if (shardsOpt !== null || routesCmd) {
|
|
142
141
|
const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
|
|
143
142
|
const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
|
|
144
|
-
const { runSharded } = await import("../shard-runner-
|
|
143
|
+
const { runSharded } = await import("../shard-runner-Dpy8KM8K.js");
|
|
145
144
|
const code = await runSharded({
|
|
146
145
|
shards: shardsOpt ?? "auto",
|
|
147
146
|
mode,
|
|
@@ -167,6 +166,7 @@ Environment:
|
|
|
167
166
|
}
|
|
168
167
|
const { apiBase, websiteName: configWebsiteName } = await resolveApiBase(mode);
|
|
169
168
|
await polyfillBloxSsgGlobals({ pageUrl: apiBase });
|
|
169
|
+
const { setCollectionResolver } = await import("../index-I81QTzv-.js");
|
|
170
170
|
const websiteName = process.env.WEBSITE_NAME ?? configWebsiteName ?? "default";
|
|
171
171
|
console.log(siteDataFile ? `Loading cached site routes (mode: ${mode}, site: ${websiteName})…` : `Fetching routes from ${apiBase} (mode: ${mode}, site: ${websiteName})…`);
|
|
172
172
|
let paths = [];
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -22,12 +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-
|
|
25
|
+
const llmArtifacts = require("../validate-output-uWZ9-FOM.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-
|
|
30
|
-
const
|
|
29
|
+
const appRuntime = require("../appRuntime-Bh3LdYXU.cjs");
|
|
30
|
+
const index = require("../index-DUjEj7ts.cjs");
|
|
31
31
|
async function renderBloxSsgPage(options) {
|
|
32
32
|
var _a, _b, _c, _d;
|
|
33
33
|
const {
|
|
@@ -134,7 +134,7 @@ function templateParams(template, slug) {
|
|
|
134
134
|
});
|
|
135
135
|
const match = slug.match(new RegExp(`^${pattern}$`));
|
|
136
136
|
if (!match) return null;
|
|
137
|
-
return Object.fromEntries(names.map((name,
|
|
137
|
+
return Object.fromEntries(names.map((name, index2) => [name, match[index2 + 1]]));
|
|
138
138
|
}
|
|
139
139
|
function bindingParam(params, bindBy) {
|
|
140
140
|
if (params[bindBy]) return { name: bindBy, value: params[bindBy] };
|
|
@@ -254,7 +254,7 @@ function createBloxSSREntry(options) {
|
|
|
254
254
|
publishedBundleCache.set(cacheKey, pending);
|
|
255
255
|
}
|
|
256
256
|
const bundle = await pending;
|
|
257
|
-
const activeResolver = options.collectionResolver ??
|
|
257
|
+
const activeResolver = options.collectionResolver ?? index.getCollectionResolver() ?? void 0;
|
|
258
258
|
const resolved = await resolvePublishedPage(
|
|
259
259
|
bundle.pages,
|
|
260
260
|
slug,
|
|
@@ -282,11 +282,11 @@ function createBloxSSREntry(options) {
|
|
|
282
282
|
render: () => vue.h(vue.Suspense, null, { default: () => vue.h(rootComponent) })
|
|
283
283
|
});
|
|
284
284
|
const dataRegistry = appRuntime.provideBloxData(app, { server: true });
|
|
285
|
-
const api =
|
|
285
|
+
const api = index.provideBloxApi(app, {
|
|
286
286
|
websiteName,
|
|
287
287
|
store,
|
|
288
288
|
origin: apiBase,
|
|
289
|
-
collectionResolver: options.collectionResolver ??
|
|
289
|
+
collectionResolver: options.collectionResolver ?? index.getCollectionResolver()
|
|
290
290
|
});
|
|
291
291
|
const localeState = appRuntime.provideBloxLocale(app, pageLocale);
|
|
292
292
|
app.provide(appRuntime.BLOX_SSR_ROUTE_STATE_KEY, {
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as buildPageHead, d as primaryContextEntry, e as buildJsonLd, h as extractPageText, B as BloxBuildResponseError, i as bloxBuildJson } from "../validate-output-
|
|
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-
|
|
1
|
+
import { c as buildPageHead, d as primaryContextEntry, e as buildJsonLd, h as extractPageText, B as BloxBuildResponseError, i as bloxBuildJson } from "../validate-output-Bece4IcI.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-Bece4IcI.js";
|
|
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-
|
|
7
|
-
import {
|
|
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-Sl40toxn.js";
|
|
7
|
+
import { provideBloxApi, getCollectionResolver } from "../index-I81QTzv-.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
var _a, _b, _c, _d;
|
|
10
10
|
const {
|
package/dist/ssg/seo.d.ts
CHANGED
package/dist/ssg/seo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seo.d.ts","sourceRoot":"","sources":["../../src/ssg/seo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAOzE,4DAA4D;AAC5D,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,QAAQ,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;CACzD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,EAAE,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EAC/D,MAAM,CAAC,EAAE,MAAM,GACb,MAAM,CAcR;AAED,MAAM,WAAW,aAAa;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACnB;AAMD;;;;;GAKG;AACH,wBAAgB,aAAa,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AAgB,oBAAoB,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1D,MAAM,CA8BR;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG;IAC9D,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;CACnB,CAMA;AAMD,UAAU,gBAAgB;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACpC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS,GAClE,gBAAgB,CAgBlB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS,GAClE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAAG,IAAI,CAEtD"}
|
|
@@ -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,
|
|
6
|
+
import { r as resolvePageTitle, p as primaryPageContext, c as contextPageTitle } from "./pageTitle-B1mtDJKn.js";
|
|
7
7
|
class BloxBuildResponseError extends Error {
|
|
8
8
|
constructor(status, url, statusText) {
|
|
9
9
|
super(`Build API ${status} ${statusText}: ${url}`);
|
|
@@ -369,8 +369,9 @@ function buildPageHead(options) {
|
|
|
369
369
|
const siteName = seo.site_name || void 0;
|
|
370
370
|
const title = resolvePageTitle(resolvedData ?? {}, {
|
|
371
371
|
override: override == null ? void 0 : override.title,
|
|
372
|
-
siteName
|
|
373
|
-
|
|
372
|
+
siteName,
|
|
373
|
+
defaultTitle: seo.default_meta_title
|
|
374
|
+
});
|
|
374
375
|
if (title) {
|
|
375
376
|
parts.push(`<title>${esc(title)}</title>`);
|
|
376
377
|
}
|
|
@@ -385,12 +386,10 @@ function buildPageHead(options) {
|
|
|
385
386
|
} else if (canonicalBase) {
|
|
386
387
|
parts.push(`<link rel="canonical" href="${esc(canonicalBase + url)}">`);
|
|
387
388
|
}
|
|
388
|
-
const ogTitle = (override == null ? void 0 : override.title) || ctx.title || (page == null ? void 0 : page.meta_title) || (page == null ? void 0 : page.title) || siteName || seo.default_meta_title;
|
|
389
389
|
const ogDesc = (override == null ? void 0 : override.description) || (page == null ? void 0 : page.meta_description) || ctx.description || seo.default_meta_description;
|
|
390
390
|
const ogImage = absUrl((override == null ? void 0 : override.image) || (page == null ? void 0 : page.og_image) || ctx.image || seo.default_og_image);
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
if (ogTitle) parts.push(`<meta property="og:title" content="${esc(ogTitle)}">`);
|
|
391
|
+
const ogType = (override == null ? void 0 : override.ogType) ?? "website";
|
|
392
|
+
if (title) parts.push(`<meta property="og:title" content="${esc(title)}">`);
|
|
394
393
|
if (ogDesc) parts.push(`<meta property="og:description" content="${esc(ogDesc)}">`);
|
|
395
394
|
if (ogImage) parts.push(`<meta name="image" property="og:image" content="${esc(ogImage)}">`);
|
|
396
395
|
parts.push(`<meta property="og:type" content="${esc(ogType)}">`);
|
|
@@ -407,7 +406,7 @@ function buildPageHead(options) {
|
|
|
407
406
|
}
|
|
408
407
|
const twitterCard = ogImage ? "summary_large_image" : "summary";
|
|
409
408
|
parts.push(`<meta name="twitter:card" content="${esc(twitterCard)}">`);
|
|
410
|
-
if (
|
|
409
|
+
if (title) parts.push(`<meta name="twitter:title" content="${esc(title)}">`);
|
|
411
410
|
if (ogDesc) parts.push(`<meta name="twitter:description" content="${esc(ogDesc)}">`);
|
|
412
411
|
if (ogImage) parts.push(`<meta name="twitter:image" content="${esc(ogImage)}">`);
|
|
413
412
|
if (seo.twitter_site) parts.push(`<meta name="twitter:site" content="${esc(seo.twitter_site)}">`);
|
|
@@ -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-
|
|
29
|
+
const pageTitle = require("./pageTitle-wobGhtiZ.cjs");
|
|
30
30
|
class BloxBuildResponseError extends Error {
|
|
31
31
|
constructor(status, url, statusText) {
|
|
32
32
|
super(`Build API ${status} ${statusText}: ${url}`);
|
|
@@ -392,8 +392,9 @@ function buildPageHead(options) {
|
|
|
392
392
|
const siteName = seo.site_name || void 0;
|
|
393
393
|
const title = pageTitle.resolvePageTitle(resolvedData ?? {}, {
|
|
394
394
|
override: override == null ? void 0 : override.title,
|
|
395
|
-
siteName
|
|
396
|
-
|
|
395
|
+
siteName,
|
|
396
|
+
defaultTitle: seo.default_meta_title
|
|
397
|
+
});
|
|
397
398
|
if (title) {
|
|
398
399
|
parts.push(`<title>${esc(title)}</title>`);
|
|
399
400
|
}
|
|
@@ -408,12 +409,10 @@ function buildPageHead(options) {
|
|
|
408
409
|
} else if (canonicalBase) {
|
|
409
410
|
parts.push(`<link rel="canonical" href="${esc(canonicalBase + url)}">`);
|
|
410
411
|
}
|
|
411
|
-
const ogTitle = (override == null ? void 0 : override.title) || ctx.title || (page == null ? void 0 : page.meta_title) || (page == null ? void 0 : page.title) || siteName || seo.default_meta_title;
|
|
412
412
|
const ogDesc = (override == null ? void 0 : override.description) || (page == null ? void 0 : page.meta_description) || ctx.description || seo.default_meta_description;
|
|
413
413
|
const ogImage = absUrl((override == null ? void 0 : override.image) || (page == null ? void 0 : page.og_image) || ctx.image || seo.default_og_image);
|
|
414
|
-
const
|
|
415
|
-
|
|
416
|
-
if (ogTitle) parts.push(`<meta property="og:title" content="${esc(ogTitle)}">`);
|
|
414
|
+
const ogType = (override == null ? void 0 : override.ogType) ?? "website";
|
|
415
|
+
if (title) parts.push(`<meta property="og:title" content="${esc(title)}">`);
|
|
417
416
|
if (ogDesc) parts.push(`<meta property="og:description" content="${esc(ogDesc)}">`);
|
|
418
417
|
if (ogImage) parts.push(`<meta name="image" property="og:image" content="${esc(ogImage)}">`);
|
|
419
418
|
parts.push(`<meta property="og:type" content="${esc(ogType)}">`);
|
|
@@ -430,7 +429,7 @@ function buildPageHead(options) {
|
|
|
430
429
|
}
|
|
431
430
|
const twitterCard = ogImage ? "summary_large_image" : "summary";
|
|
432
431
|
parts.push(`<meta name="twitter:card" content="${esc(twitterCard)}">`);
|
|
433
|
-
if (
|
|
432
|
+
if (title) parts.push(`<meta name="twitter:title" content="${esc(title)}">`);
|
|
434
433
|
if (ogDesc) parts.push(`<meta name="twitter:description" content="${esc(ogDesc)}">`);
|
|
435
434
|
if (ogImage) parts.push(`<meta name="twitter:image" content="${esc(ogImage)}">`);
|
|
436
435
|
if (seo.twitter_site) parts.push(`<meta name="twitter:site" content="${esc(seo.twitter_site)}">`);
|
package/package.json
CHANGED