@bagelink/blox 1.15.474 → 1.15.476
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/{PreviewApp-CTq4OGBA.js → PreviewApp-CCP5TufQ.js} +1 -1
- package/dist/{PreviewApp-C3lNxUYR.cjs → PreviewApp-DdTJYLaU.cjs} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-tpv-FEao.cjs → PreviewApp.vue_vue_type_style_index_0_lang-DihIptYr.cjs} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-BWIYB9Ha.js → PreviewApp.vue_vue_type_style_index_0_lang-DrO2PTcS.js} +1 -1
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +32 -32
- package/dist/{routes-Bs6eosZ6.js → routes-BLdP650Z.js} +50 -42
- package/dist/{routes-DAqHLDK2.cjs → routes-y2qluUdf.cjs} +9 -1
- package/dist/ssg/createSSREntry.d.ts +3 -0
- package/dist/ssg/createSSREntry.d.ts.map +1 -1
- package/dist/ssg/index.cjs +2 -1
- package/dist/ssg/index.mjs +2 -1
- package/package.json +1 -1
|
@@ -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-DihIptYr.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 {
|
|
2
|
+
import { f as BLOX_REGISTRY_KEY, r as resolveBlockProps, u as useLocale, h as BLOX_RUNTIME_KEY } from "./routes-BLdP650Z.js";
|
|
3
3
|
function sendToEditor(msg) {
|
|
4
4
|
window.parent.postMessage(cloneForPostMessage(msg), "*");
|
|
5
5
|
}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CollectionItemsPage, PageResolveRead } from './types';
|
|
2
|
+
type CollectionResolver = (collection: string, options: ListItemsOptions) => Promise<Array<Record<string, unknown>>>;
|
|
2
3
|
export declare function configureApi(websiteName: string, store: string): void;
|
|
3
4
|
/**
|
|
4
5
|
* Point blox's datastore client at an absolute API base (SSG/Node, where
|
|
@@ -6,6 +7,8 @@ export declare function configureApi(websiteName: string, store: string): void;
|
|
|
6
7
|
* path prefix (e.g. `https://host` or `https://host/api`).
|
|
7
8
|
*/
|
|
8
9
|
export declare function setApiOrigin(base: string): void;
|
|
10
|
+
/** Use an immutable build-time collection source instead of HTTP during SSR. */
|
|
11
|
+
export declare function setCollectionResolver(resolver: CollectionResolver | null): void;
|
|
9
12
|
/** Synchronously read the resolved website id if already known (SSG-embedded or cached). */
|
|
10
13
|
export declare function getWebsiteIdSync(): string | null;
|
|
11
14
|
export declare function getWebsiteId(): Promise<string>;
|
|
@@ -35,4 +38,5 @@ export declare function getItemBySlug<T = Record<string, unknown>>(collection: s
|
|
|
35
38
|
* Returns null if the item isn't available in that locale (datastore 406/404).
|
|
36
39
|
*/
|
|
37
40
|
export declare function getItemById<T = Record<string, unknown>>(collection: string, id: string, locale?: string): Promise<T | null>;
|
|
41
|
+
export {};
|
|
38
42
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAe,MAAM,SAAS,CAAA;
|
|
1
|
+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;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9D,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAMnB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5D,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAOnB"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const routes = require("./routes-
|
|
4
|
-
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
3
|
+
const routes = require("./routes-y2qluUdf.cjs");
|
|
4
|
+
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-DihIptYr.cjs");
|
|
5
5
|
const vue = require("vue");
|
|
6
6
|
const vueRouter = require("vue-router");
|
|
7
7
|
const pinia = require("pinia");
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _,
|
|
3
|
-
import { _ as _2, P as P2, s as s2, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { j as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, n as normalizeLink, h as BLOX_RUNTIME_KEY, k as useSeo, l as getRegistryData, m as getItemBySlug, o as getItemById, q as getContentRoute, p as provideBloxData, e as createBlox, g as generateContentRoutes, t as installContentFallback, i as installLocaleAwareResolve, b as setActiveLocale, v as installSmartLinks, w as consumePendingLocaleSwitch } from "./routes-BLdP650Z.js";
|
|
2
|
+
import { _, x, y, z, B, A, C, D, E, F, P, G, H, c, d, I, J, K, L, M, N, O, Q, R, S, T, U, r, V, s, W, X, Y, Z } from "./routes-BLdP650Z.js";
|
|
3
|
+
import { _ as _2, P as P2, s as s2, a } from "./PreviewApp.vue_vue_type_style_index_0_lang-DrO2PTcS.js";
|
|
4
4
|
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, Transition, resolveDynamicComponent, inject, ref, watch, onMounted, onUnmounted, computed, onServerPrefetch, toValue, createApp, h, Suspense, markRaw } from "vue";
|
|
5
5
|
import { useRouter, useRoute } from "vue-router";
|
|
6
6
|
import { createPinia } from "pinia";
|
|
@@ -359,7 +359,7 @@ function definitionToEntry(type, def) {
|
|
|
359
359
|
};
|
|
360
360
|
}
|
|
361
361
|
function serializeRegistry(registry) {
|
|
362
|
-
const blocks = Object.entries(registry).map(([type, def]) => definitionToEntry(type, def)).sort((a2,
|
|
362
|
+
const blocks = Object.entries(registry).map(([type, def]) => definitionToEntry(type, def)).sort((a2, b) => (a2.order ?? 100) - (b.order ?? 100) || a2.label.localeCompare(b.label));
|
|
363
363
|
return { version: MANIFEST_VERSION, blocks };
|
|
364
364
|
}
|
|
365
365
|
function buildBloxManifest(blox) {
|
|
@@ -367,62 +367,62 @@ function buildBloxManifest(blox) {
|
|
|
367
367
|
}
|
|
368
368
|
export {
|
|
369
369
|
_ as AdminEditBar,
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
370
|
+
x as BLOX_ADMIN_CONFIG_KEY,
|
|
371
|
+
y as BLOX_CONFIG_KEY,
|
|
372
|
+
z as BLOX_DATA_KEY,
|
|
373
373
|
B as BLOX_DATA_WINDOW_KEY,
|
|
374
|
-
|
|
374
|
+
A as BLOX_LAYOUT_KEY,
|
|
375
375
|
BLOX_LOCALE_STRATEGY_KEY,
|
|
376
376
|
BLOX_RUNTIME_KEY,
|
|
377
|
-
|
|
377
|
+
C as BloxInstance,
|
|
378
378
|
_sfc_main as BloxRouterView,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
379
|
+
D as CmsPageView,
|
|
380
|
+
E as ContentDetailView,
|
|
381
|
+
F as ContentHost,
|
|
382
382
|
P as PageRenderer,
|
|
383
383
|
_2 as PreviewApp,
|
|
384
384
|
P2 as PreviewRenderer,
|
|
385
|
-
|
|
385
|
+
G as applyLayoutChrome,
|
|
386
386
|
buildBloxManifest,
|
|
387
|
-
|
|
387
|
+
H as classifyLink,
|
|
388
388
|
c as collectBloxData,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
389
|
+
d as collectBloxSeo,
|
|
390
|
+
I as configureApi,
|
|
391
|
+
J as contentRoutes,
|
|
392
392
|
createBlox,
|
|
393
393
|
createBloxApp,
|
|
394
394
|
defineBlock,
|
|
395
|
-
|
|
395
|
+
K as defineContent,
|
|
396
396
|
generateContentRoutes,
|
|
397
397
|
getContentRoute,
|
|
398
|
-
|
|
398
|
+
L as getContentRouteByCollection,
|
|
399
399
|
getItemById,
|
|
400
400
|
getItemBySlug,
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
M as getWebsiteId,
|
|
402
|
+
N as getWebsiteIdSync,
|
|
403
403
|
injectPlausible,
|
|
404
404
|
installContentFallback,
|
|
405
405
|
installSmartLinks,
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
406
|
+
O as isAbsoluteExternal,
|
|
407
|
+
Q as isSoloContentPage,
|
|
408
|
+
R as isSpecialScheme,
|
|
409
|
+
S as listItems,
|
|
410
410
|
normalizeLink,
|
|
411
|
-
|
|
411
|
+
T as normalizeTo,
|
|
412
412
|
provideBloxData,
|
|
413
|
-
|
|
413
|
+
U as provideContentItem,
|
|
414
414
|
r as resolveBlockProps,
|
|
415
|
-
|
|
415
|
+
V as resolvePath,
|
|
416
416
|
s2 as sendToEditor,
|
|
417
417
|
a as sendToPreview,
|
|
418
418
|
serializeRegistry,
|
|
419
419
|
s as setApiOrigin,
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
W as toInternalPath,
|
|
421
|
+
X as useBloxEdit,
|
|
422
422
|
useBloxRuntime,
|
|
423
|
-
|
|
423
|
+
Y as useContentItem,
|
|
424
424
|
useContentSeo,
|
|
425
|
-
|
|
425
|
+
Z as useData,
|
|
426
426
|
useGlobalBlock,
|
|
427
427
|
useLocale,
|
|
428
428
|
useLocaleNav,
|
|
@@ -11,6 +11,7 @@ let _websiteName = "";
|
|
|
11
11
|
let _store = "";
|
|
12
12
|
let _websiteId = null;
|
|
13
13
|
let _origin = "";
|
|
14
|
+
let _collectionResolver = null;
|
|
14
15
|
function configureApi(websiteName, store) {
|
|
15
16
|
_websiteName = websiteName;
|
|
16
17
|
_store = store;
|
|
@@ -25,6 +26,9 @@ function setApiOrigin(base) {
|
|
|
25
26
|
} catch {
|
|
26
27
|
}
|
|
27
28
|
}
|
|
29
|
+
function setCollectionResolver(resolver) {
|
|
30
|
+
_collectionResolver = resolver;
|
|
31
|
+
}
|
|
28
32
|
async function request(path, { locale: locale2, params, ...opts } = {}) {
|
|
29
33
|
const origin = _origin || (typeof window !== "undefined" ? window.location.origin : "");
|
|
30
34
|
const url = new URL(`${BASE}${path}`, origin || void 0);
|
|
@@ -68,6 +72,9 @@ async function resolvePath(path, locale2) {
|
|
|
68
72
|
});
|
|
69
73
|
}
|
|
70
74
|
async function listItems(collection, { locale: locale2, q, offset = 0, limit = 100 } = {}) {
|
|
75
|
+
if (_collectionResolver) {
|
|
76
|
+
return await _collectionResolver(collection, { locale: locale2, q, offset, limit });
|
|
77
|
+
}
|
|
71
78
|
return request(`/datastore/${_store}/collections/${collection}`, {
|
|
72
79
|
locale: locale2,
|
|
73
80
|
params: { ...q ? { q } : {}, offset, limit }
|
|
@@ -904,7 +911,7 @@ class BloxInstance {
|
|
|
904
911
|
}
|
|
905
912
|
router.addRoute({
|
|
906
913
|
path: "/_blox_preview",
|
|
907
|
-
component: () => import("./PreviewApp-
|
|
914
|
+
component: () => import("./PreviewApp-CCP5TufQ.js"),
|
|
908
915
|
beforeEnter: () => window.parent !== window ? true : "/"
|
|
909
916
|
});
|
|
910
917
|
router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$2 });
|
|
@@ -1187,56 +1194,57 @@ function installContentFallback(router, supportedLocales, defaultLocale) {
|
|
|
1187
1194
|
});
|
|
1188
1195
|
}
|
|
1189
1196
|
export {
|
|
1190
|
-
|
|
1197
|
+
BLOX_LAYOUT_KEY as A,
|
|
1191
1198
|
BLOX_DATA_WINDOW_KEY as B,
|
|
1192
|
-
|
|
1193
|
-
_sfc_main$
|
|
1194
|
-
_sfc_main as E,
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1199
|
+
BloxInstance as C,
|
|
1200
|
+
_sfc_main$2 as D,
|
|
1201
|
+
_sfc_main$1 as E,
|
|
1202
|
+
_sfc_main as F,
|
|
1203
|
+
applyLayoutChrome as G,
|
|
1204
|
+
classifyLink as H,
|
|
1205
|
+
configureApi as I,
|
|
1206
|
+
contentRoutes as J,
|
|
1207
|
+
defineContent as K,
|
|
1208
|
+
getContentRouteByCollection as L,
|
|
1209
|
+
getWebsiteId as M,
|
|
1210
|
+
getWebsiteIdSync as N,
|
|
1211
|
+
isAbsoluteExternal as O,
|
|
1205
1212
|
PageRenderer as P,
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1213
|
+
isSoloContentPage as Q,
|
|
1214
|
+
isSpecialScheme as R,
|
|
1215
|
+
listItems as S,
|
|
1216
|
+
normalizeTo as T,
|
|
1217
|
+
provideContentItem as U,
|
|
1218
|
+
resolvePath as V,
|
|
1219
|
+
toInternalPath as W,
|
|
1220
|
+
useBloxEdit as X,
|
|
1221
|
+
useContentItem as Y,
|
|
1222
|
+
useData as Z,
|
|
1215
1223
|
_sfc_main$3 as _,
|
|
1216
|
-
|
|
1217
|
-
|
|
1224
|
+
setCollectionResolver as a,
|
|
1225
|
+
setActiveLocale as b,
|
|
1218
1226
|
collectBloxData as c,
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1227
|
+
collectBloxSeo as d,
|
|
1228
|
+
createBlox as e,
|
|
1229
|
+
BLOX_REGISTRY_KEY as f,
|
|
1222
1230
|
generateContentRoutes as g,
|
|
1223
|
-
|
|
1231
|
+
BLOX_RUNTIME_KEY as h,
|
|
1224
1232
|
installLocaleAwareResolve as i,
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1233
|
+
BLOX_LOCALE_STRATEGY_KEY as j,
|
|
1234
|
+
useSeo as k,
|
|
1235
|
+
getRegistryData as l,
|
|
1236
|
+
getItemBySlug as m,
|
|
1229
1237
|
normalizeLink as n,
|
|
1230
|
-
|
|
1238
|
+
getItemById as o,
|
|
1231
1239
|
provideBloxData as p,
|
|
1232
|
-
|
|
1240
|
+
getContentRoute as q,
|
|
1233
1241
|
resolveBlockProps as r,
|
|
1234
1242
|
setApiOrigin as s,
|
|
1235
|
-
|
|
1243
|
+
installContentFallback as t,
|
|
1236
1244
|
useLocale as u,
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1245
|
+
installSmartLinks as v,
|
|
1246
|
+
consumePendingLocaleSwitch as w,
|
|
1247
|
+
BLOX_ADMIN_CONFIG_KEY as x,
|
|
1248
|
+
BLOX_CONFIG_KEY as y,
|
|
1249
|
+
BLOX_DATA_KEY as z
|
|
1242
1250
|
};
|
|
@@ -12,6 +12,7 @@ let _websiteName = "";
|
|
|
12
12
|
let _store = "";
|
|
13
13
|
let _websiteId = null;
|
|
14
14
|
let _origin = "";
|
|
15
|
+
let _collectionResolver = null;
|
|
15
16
|
function configureApi(websiteName, store) {
|
|
16
17
|
_websiteName = websiteName;
|
|
17
18
|
_store = store;
|
|
@@ -26,6 +27,9 @@ function setApiOrigin(base) {
|
|
|
26
27
|
} catch {
|
|
27
28
|
}
|
|
28
29
|
}
|
|
30
|
+
function setCollectionResolver(resolver) {
|
|
31
|
+
_collectionResolver = resolver;
|
|
32
|
+
}
|
|
29
33
|
async function request(path, { locale: locale2, params, ...opts } = {}) {
|
|
30
34
|
const origin = _origin || (typeof window !== "undefined" ? window.location.origin : "");
|
|
31
35
|
const url = new URL(`${BASE}${path}`, origin || void 0);
|
|
@@ -69,6 +73,9 @@ async function resolvePath(path, locale2) {
|
|
|
69
73
|
});
|
|
70
74
|
}
|
|
71
75
|
async function listItems(collection, { locale: locale2, q, offset = 0, limit = 100 } = {}) {
|
|
76
|
+
if (_collectionResolver) {
|
|
77
|
+
return await _collectionResolver(collection, { locale: locale2, q, offset, limit });
|
|
78
|
+
}
|
|
72
79
|
return request(`/datastore/${_store}/collections/${collection}`, {
|
|
73
80
|
locale: locale2,
|
|
74
81
|
params: { ...q ? { q } : {}, offset, limit }
|
|
@@ -905,7 +912,7 @@ class BloxInstance {
|
|
|
905
912
|
}
|
|
906
913
|
router.addRoute({
|
|
907
914
|
path: "/_blox_preview",
|
|
908
|
-
component: () => Promise.resolve().then(() => require("./PreviewApp-
|
|
915
|
+
component: () => Promise.resolve().then(() => require("./PreviewApp-DdTJYLaU.cjs")),
|
|
909
916
|
beforeEnter: () => window.parent !== window ? true : "/"
|
|
910
917
|
});
|
|
911
918
|
router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$2 });
|
|
@@ -1233,6 +1240,7 @@ exports.resolveBlockProps = resolveBlockProps;
|
|
|
1233
1240
|
exports.resolvePath = resolvePath;
|
|
1234
1241
|
exports.setActiveLocale = setActiveLocale;
|
|
1235
1242
|
exports.setApiOrigin = setApiOrigin;
|
|
1243
|
+
exports.setCollectionResolver = setCollectionResolver;
|
|
1236
1244
|
exports.toInternalPath = toInternalPath;
|
|
1237
1245
|
exports.useBloxEdit = useBloxEdit;
|
|
1238
1246
|
exports.useContentItem = useContentItem;
|
|
@@ -3,6 +3,7 @@ import { Router } from 'vue-router';
|
|
|
3
3
|
import { BlockModule } from '../defineBlock';
|
|
4
4
|
import { RenderContext, RenderResult } from './prerender';
|
|
5
5
|
import { BloxBuildRequestOptions } from './build-request';
|
|
6
|
+
import { ListItemsOptions } from '../api';
|
|
6
7
|
export interface CreateBloxSSREntryOptions {
|
|
7
8
|
/** Root Vue component (App.vue). */
|
|
8
9
|
rootComponent: Component;
|
|
@@ -25,6 +26,8 @@ export interface CreateBloxSSREntryOptions {
|
|
|
25
26
|
apiBase?: string;
|
|
26
27
|
/** Build-only authentication/headers. Defaults to BLOX_BUILD_TOKEN env. */
|
|
27
28
|
buildRequest?: BloxBuildRequestOptions;
|
|
29
|
+
/** Immutable build-time datastore resolver used by content routes and SEO. */
|
|
30
|
+
collectionResolver?: (collection: string, options: ListItemsOptions) => Promise<Array<Record<string, unknown>>>;
|
|
28
31
|
/** Default locale. @default 'en' */
|
|
29
32
|
locale?: string;
|
|
30
33
|
/** Supported locales. @default [locale] */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSSREntry.d.ts","sourceRoot":"","sources":["../../src/ssg/createSSREntry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAG9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"createSSREntry.d.ts","sourceRoot":"","sources":["../../src/ssg/createSSREntry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AAO,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAA;IAC5E;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAC5C,kDAAkD;IAClD,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,YAAY;IAC5B,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;IAClE,0EAA0E;IAC1E,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CAyLnF"}
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ const llmArtifacts = require("../prerender-JdRKimQ5.cjs");
|
|
|
26
26
|
const ssg_client = require("./client.cjs");
|
|
27
27
|
const pinia = require("pinia");
|
|
28
28
|
const vue = require("vue");
|
|
29
|
-
const routes = require("../routes-
|
|
29
|
+
const routes = require("../routes-y2qluUdf.cjs");
|
|
30
30
|
async function renderBloxSsgPage(options) {
|
|
31
31
|
var _a, _b, _c;
|
|
32
32
|
const {
|
|
@@ -128,6 +128,7 @@ function createBloxSSREntry(options) {
|
|
|
128
128
|
const apiBase = options.apiBase ?? (typeof process !== "undefined" ? (_a = process.env) == null ? void 0 : _a.BAGELINK_API_URL : void 0) ?? "https://api.bagel.to";
|
|
129
129
|
let websiteIdCache = null;
|
|
130
130
|
routes.setApiOrigin(apiBase);
|
|
131
|
+
routes.setCollectionResolver(options.collectionResolver ?? null);
|
|
131
132
|
async function getWebsiteId() {
|
|
132
133
|
if (websiteIdCache) return websiteIdCache;
|
|
133
134
|
const data = await llmArtifacts.bloxBuildJson(`${apiBase}/blox/websites`, {}, options.buildRequest);
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { BLOX_STATE_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs"
|
|
|
4
4
|
import { BLOX_COLLECTIONS_WINDOW_KEY, BLOX_DATA_WINDOW_KEY, BLOX_PAGE_SEO_WINDOW_KEY, getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
|
|
5
5
|
import { createPinia } from "pinia";
|
|
6
6
|
import { createSSRApp, h, Suspense, markRaw } from "vue";
|
|
7
|
-
import { B as BLOX_DATA_WINDOW_KEY2, s as setApiOrigin, a as setActiveLocale, c as collectBloxData,
|
|
7
|
+
import { B as BLOX_DATA_WINDOW_KEY2, s as setApiOrigin, a as setCollectionResolver, b as setActiveLocale, c as collectBloxData, d as collectBloxSeo, p as provideBloxData, e as createBlox, g as generateContentRoutes, i as installLocaleAwareResolve } from "../routes-BLdP650Z.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
var _a, _b, _c;
|
|
10
10
|
const {
|
|
@@ -106,6 +106,7 @@ function createBloxSSREntry(options) {
|
|
|
106
106
|
const apiBase = options.apiBase ?? (typeof process !== "undefined" ? (_a = process.env) == null ? void 0 : _a.BAGELINK_API_URL : void 0) ?? "https://api.bagel.to";
|
|
107
107
|
let websiteIdCache = null;
|
|
108
108
|
setApiOrigin(apiBase);
|
|
109
|
+
setCollectionResolver(options.collectionResolver ?? null);
|
|
109
110
|
async function getWebsiteId() {
|
|
110
111
|
if (websiteIdCache) return websiteIdCache;
|
|
111
112
|
const data = await bloxBuildJson(`${apiBase}/blox/websites`, {}, options.buildRequest);
|
package/package.json
CHANGED