@bagelink/blox 1.15.601 → 1.15.609
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-HVipxMQ3.cjs → PreviewApp-BRrYLB8D.cjs} +1 -1
- package/dist/{PreviewApp-BagepqPk.js → PreviewApp-CIyd-N0N.js} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-Dl3bKQTA.js → PreviewApp.vue_vue_type_style_index_0_lang-DO-6pJux.js} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-C6e-tDzD.cjs → PreviewApp.vue_vue_type_style_index_0_lang-DeDQpkll.cjs} +1 -1
- package/dist/{appRuntime-B6yWkH3M.js → appRuntime-CMgL56OK.js} +4 -4
- package/dist/{appRuntime-D1Z3fX-G.cjs → appRuntime-DScwVn-L.cjs} +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/ssg/createSSREntry.d.ts.map +1 -1
- package/dist/ssg/index.cjs +9 -3
- package/dist/ssg/index.mjs +9 -3
- 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-DeDQpkll.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-CMgL56OK.js";
|
|
3
3
|
function sendToEditor(msg) {
|
|
4
4
|
window.parent.postMessage(cloneForPostMessage(msg), "*");
|
|
5
5
|
}
|
|
@@ -507,7 +507,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
507
507
|
}
|
|
508
508
|
function tryHydrateFromState(path) {
|
|
509
509
|
if ((ssrRouteState == null ? void 0 : ssrRouteState.path) === path && ssrRouteState.resolved) {
|
|
510
|
-
applyResolvedState(ssrRouteState.resolved
|
|
510
|
+
applyResolvedState(ssrRouteState.resolved);
|
|
511
511
|
return true;
|
|
512
512
|
}
|
|
513
513
|
const win = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : void 0;
|
|
@@ -516,7 +516,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
516
516
|
if (!state || typeof state !== "object") return false;
|
|
517
517
|
const entry = state[path];
|
|
518
518
|
if (!entry) return false;
|
|
519
|
-
applyResolvedState(entry
|
|
519
|
+
applyResolvedState(entry);
|
|
520
520
|
return true;
|
|
521
521
|
}
|
|
522
522
|
function applyResolvedState(entry, path) {
|
|
@@ -524,7 +524,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
524
524
|
blocks.value = ((_b = (_a = entry.page) == null ? void 0 : _a.content) == null ? void 0 : _b.blocks) ?? [];
|
|
525
525
|
contexts.value = entry.contexts ?? {};
|
|
526
526
|
currentPageId.value = ((_c = entry.page) == null ? void 0 : _c.id) ?? null;
|
|
527
|
-
setAlternates(entry.alternates && Object.keys(entry.alternates).length ? entry.alternates : {
|
|
527
|
+
setAlternates(entry.alternates && Object.keys(entry.alternates).length ? entry.alternates : {});
|
|
528
528
|
updateDocumentTitle(entry);
|
|
529
529
|
}
|
|
530
530
|
function hasEmbeddedState() {
|
|
@@ -1068,7 +1068,7 @@ class BloxInstance {
|
|
|
1068
1068
|
router.addRoute({
|
|
1069
1069
|
path: "/_blox_preview",
|
|
1070
1070
|
name: BLOX_PREVIEW_ROUTE_NAME,
|
|
1071
|
-
component: () => import("./PreviewApp-
|
|
1071
|
+
component: () => import("./PreviewApp-CIyd-N0N.js"),
|
|
1072
1072
|
beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
|
|
1073
1073
|
});
|
|
1074
1074
|
}
|
|
@@ -508,7 +508,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
508
508
|
}
|
|
509
509
|
function tryHydrateFromState(path) {
|
|
510
510
|
if ((ssrRouteState == null ? void 0 : ssrRouteState.path) === path && ssrRouteState.resolved) {
|
|
511
|
-
applyResolvedState(ssrRouteState.resolved
|
|
511
|
+
applyResolvedState(ssrRouteState.resolved);
|
|
512
512
|
return true;
|
|
513
513
|
}
|
|
514
514
|
const win = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : void 0;
|
|
@@ -517,7 +517,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
517
517
|
if (!state || typeof state !== "object") return false;
|
|
518
518
|
const entry = state[path];
|
|
519
519
|
if (!entry) return false;
|
|
520
|
-
applyResolvedState(entry
|
|
520
|
+
applyResolvedState(entry);
|
|
521
521
|
return true;
|
|
522
522
|
}
|
|
523
523
|
function applyResolvedState(entry, path) {
|
|
@@ -525,7 +525,7 @@ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
|
|
|
525
525
|
blocks.value = ((_b = (_a = entry.page) == null ? void 0 : _a.content) == null ? void 0 : _b.blocks) ?? [];
|
|
526
526
|
contexts.value = entry.contexts ?? {};
|
|
527
527
|
currentPageId.value = ((_c = entry.page) == null ? void 0 : _c.id) ?? null;
|
|
528
|
-
setAlternates(entry.alternates && Object.keys(entry.alternates).length ? entry.alternates : {
|
|
528
|
+
setAlternates(entry.alternates && Object.keys(entry.alternates).length ? entry.alternates : {});
|
|
529
529
|
updateDocumentTitle(entry);
|
|
530
530
|
}
|
|
531
531
|
function hasEmbeddedState() {
|
|
@@ -1069,7 +1069,7 @@ class BloxInstance {
|
|
|
1069
1069
|
router.addRoute({
|
|
1070
1070
|
path: "/_blox_preview",
|
|
1071
1071
|
name: BLOX_PREVIEW_ROUTE_NAME,
|
|
1072
|
-
component: () => Promise.resolve().then(() => require("./PreviewApp-
|
|
1072
|
+
component: () => Promise.resolve().then(() => require("./PreviewApp-BRrYLB8D.cjs")),
|
|
1073
1073
|
beforeEnter: () => typeof window === "undefined" || window.parent !== window ? true : "/"
|
|
1074
1074
|
});
|
|
1075
1075
|
}
|
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-DScwVn-L.cjs");
|
|
4
|
+
const PreviewApp_vue_vue_type_style_index_0_lang = require("./PreviewApp.vue_vue_type_style_index_0_lang-DeDQpkll.cjs");
|
|
5
5
|
const vue = require("vue");
|
|
6
6
|
const vueRouter = require("vue-router");
|
|
7
7
|
const ssg_client = require("./ssg/client.cjs");
|
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-CMgL56OK.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-CMgL56OK.js";
|
|
3
|
+
import { _ as _2, P as P2, s, a as a3 } from "./PreviewApp.vue_vue_type_style_index_0_lang-DO-6pJux.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";
|
|
@@ -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,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AAI,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;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;CAAE,GAAG,IAAI,CAAC,CAqBnG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,YAAY,CA8LnF"}
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -26,7 +26,7 @@ const llmArtifacts = require("../validate-output-KdMpE6Uz.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-DScwVn-L.cjs");
|
|
30
30
|
async function renderBloxSsgPage(options) {
|
|
31
31
|
var _a, _b, _c, _d;
|
|
32
32
|
const {
|
|
@@ -133,6 +133,11 @@ function templateParams(template, slug) {
|
|
|
133
133
|
if (!match) return null;
|
|
134
134
|
return Object.fromEntries(names.map((name, index) => [name, match[index + 1]]));
|
|
135
135
|
}
|
|
136
|
+
function bindingParam(params, bindBy) {
|
|
137
|
+
if (params[bindBy]) return { name: bindBy, value: params[bindBy] };
|
|
138
|
+
const aliases = Object.entries(params).filter(([name, value]) => !!value && name.endsWith(`_${bindBy}`));
|
|
139
|
+
return aliases.length === 1 ? { name: aliases[0][0], value: aliases[0][1] } : null;
|
|
140
|
+
}
|
|
136
141
|
async function resolvePublishedPage(pages, slug, locale, resolver) {
|
|
137
142
|
var _a;
|
|
138
143
|
const page = matchPublishedPage(pages, slug, true);
|
|
@@ -142,8 +147,9 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
|
|
|
142
147
|
if (params && resolver) {
|
|
143
148
|
for (const [name, binding] of Object.entries(page.data_bindings ?? {})) {
|
|
144
149
|
if (binding.adapter !== "datastore" || !binding.collection || !binding.bind_by) continue;
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
150
|
+
const param = bindingParam(params, binding.bind_by);
|
|
151
|
+
if (!param) continue;
|
|
152
|
+
const value = param.value;
|
|
147
153
|
const escaped = value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
148
154
|
const items = await resolver(binding.collection, {
|
|
149
155
|
locale,
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { parseBloxBuildGrantBody, resolveBloxBuildGrant } from "./build-grant.mj
|
|
|
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-CMgL56OK.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
var _a, _b, _c, _d;
|
|
10
10
|
const {
|
|
@@ -111,6 +111,11 @@ function templateParams(template, slug) {
|
|
|
111
111
|
if (!match) return null;
|
|
112
112
|
return Object.fromEntries(names.map((name, index) => [name, match[index + 1]]));
|
|
113
113
|
}
|
|
114
|
+
function bindingParam(params, bindBy) {
|
|
115
|
+
if (params[bindBy]) return { name: bindBy, value: params[bindBy] };
|
|
116
|
+
const aliases = Object.entries(params).filter(([name, value]) => !!value && name.endsWith(`_${bindBy}`));
|
|
117
|
+
return aliases.length === 1 ? { name: aliases[0][0], value: aliases[0][1] } : null;
|
|
118
|
+
}
|
|
114
119
|
async function resolvePublishedPage(pages, slug, locale, resolver) {
|
|
115
120
|
var _a;
|
|
116
121
|
const page = matchPublishedPage(pages, slug, true);
|
|
@@ -120,8 +125,9 @@ async function resolvePublishedPage(pages, slug, locale, resolver) {
|
|
|
120
125
|
if (params && resolver) {
|
|
121
126
|
for (const [name, binding] of Object.entries(page.data_bindings ?? {})) {
|
|
122
127
|
if (binding.adapter !== "datastore" || !binding.collection || !binding.bind_by) continue;
|
|
123
|
-
const
|
|
124
|
-
if (!
|
|
128
|
+
const param = bindingParam(params, binding.bind_by);
|
|
129
|
+
if (!param) continue;
|
|
130
|
+
const value = param.value;
|
|
125
131
|
const escaped = value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
126
132
|
const items = await resolver(binding.collection, {
|
|
127
133
|
locale,
|
package/package.json
CHANGED