@bagelink/blox 1.14.7 → 1.14.10
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-MdZQEVkN.js → PreviewApp-DIAL1c7e.js} +1 -1
- package/dist/{PreviewApp.vue_vue_type_style_index_0_lang-Bc4Ac4WN.js → PreviewApp.vue_vue_type_style_index_0_lang-i3XlO5iQ.js} +2 -2
- package/dist/{core-CgtYpQbn.js → core-CDeCe4VJ.js} +4 -4
- package/dist/index.mjs +5 -5
- package/dist/{prerender-CJ22vZ1T.js → prerender-BZzd5T7y.js} +46 -46
- package/dist/ssg/cli.cjs +1 -1
- package/dist/ssg/cli.mjs +1 -1
- package/dist/ssg/index.cjs +1 -1
- package/dist/ssg/index.mjs +5 -5
- package/dist/vite-plugin.cjs +12 -4
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.mjs +12 -4
- package/package.json +1 -1
- package/dist/{prerender-LqPEzho3.cjs → prerender-ZBDFjWPT.cjs} +44 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, inject, ref, h, provide, onMounted, onUnmounted,
|
|
2
|
-
import { e as BLOX_REGISTRY_KEY, u as useLocale } from "./core-
|
|
1
|
+
import { defineComponent, inject, ref, h, provide, onMounted, onUnmounted, createElementBlock, openBlock, createVNode, unref, nextTick } from "vue";
|
|
2
|
+
import { e as BLOX_REGISTRY_KEY, u as useLocale } from "./core-CDeCe4VJ.js";
|
|
3
3
|
function sendToEditor(msg) {
|
|
4
4
|
window.parent.postMessage(msg, "*");
|
|
5
5
|
}
|
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { BLOX_WEBSITE_ID_WINDOW_KEY, BLOX_STATE_WINDOW_KEY } from "./ssg/client.mjs";
|
|
5
|
-
import { computed, ref, defineComponent, inject, h, provide, watch, resolveComponent,
|
|
5
|
+
import { computed, ref, defineComponent, inject, h, provide, watch, resolveComponent, createElementBlock, openBlock, createVNode, unref, createElementVNode, toDisplayString, withCtx, createTextVNode, Fragment, createCommentVNode, createBlock, normalizeProps, guardReactiveProps, renderSlot } from "vue";
|
|
6
6
|
import { useRoute, useRouter, RouterLink } from "vue-router";
|
|
7
7
|
import { getI18n, Loading } from "@bagelink/vue";
|
|
8
8
|
const BASE = "/api";
|
|
@@ -403,7 +403,7 @@ class BloxInstance {
|
|
|
403
403
|
}
|
|
404
404
|
router.addRoute({
|
|
405
405
|
path: "/_blox_preview",
|
|
406
|
-
component: () => import("./PreviewApp-
|
|
406
|
+
component: () => import("./PreviewApp-DIAL1c7e.js"),
|
|
407
407
|
beforeEnter: () => window.parent !== window ? true : "/"
|
|
408
408
|
});
|
|
409
409
|
router.addRoute({ path: "/:pathMatch(.*)*", component: _sfc_main$1 });
|
|
@@ -455,10 +455,10 @@ export {
|
|
|
455
455
|
BLOX_LOCALE_STRATEGY_KEY as B,
|
|
456
456
|
PageRenderer as P,
|
|
457
457
|
_sfc_main$1 as _,
|
|
458
|
-
|
|
458
|
+
configureApi as a,
|
|
459
459
|
BloxInstance as b,
|
|
460
460
|
createBlox as c,
|
|
461
|
-
|
|
461
|
+
BLOX_CONFIG_KEY as d,
|
|
462
462
|
BLOX_REGISTRY_KEY as e,
|
|
463
463
|
listItems as l,
|
|
464
464
|
resolvePath as r,
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, c as createBlox } from "./core-
|
|
2
|
-
import {
|
|
3
|
-
import { _ as _2, P as P2, s, a as a2 } from "./PreviewApp.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { B as BLOX_LOCALE_STRATEGY_KEY, u as useLocale, c as createBlox } from "./core-CDeCe4VJ.js";
|
|
2
|
+
import { d, b, _, P, a, l, r } from "./core-CDeCe4VJ.js";
|
|
3
|
+
import { _ as _2, P as P2, s, a as a2 } from "./PreviewApp.vue_vue_type_style_index_0_lang-i3XlO5iQ.js";
|
|
4
4
|
import { inject, computed, createApp, markRaw } from "vue";
|
|
5
5
|
import { useRouter } from "vue-router";
|
|
6
6
|
import { createPinia } from "pinia";
|
|
@@ -101,14 +101,14 @@ function defineBlock(meta) {
|
|
|
101
101
|
return meta;
|
|
102
102
|
}
|
|
103
103
|
export {
|
|
104
|
-
|
|
104
|
+
d as BLOX_CONFIG_KEY,
|
|
105
105
|
BLOX_LOCALE_STRATEGY_KEY,
|
|
106
106
|
b as BloxInstance,
|
|
107
107
|
_ as CmsPageView,
|
|
108
108
|
P as PageRenderer,
|
|
109
109
|
_2 as PreviewApp,
|
|
110
110
|
P2 as PreviewRenderer,
|
|
111
|
-
|
|
111
|
+
a as configureApi,
|
|
112
112
|
createBlox,
|
|
113
113
|
createBloxApp,
|
|
114
114
|
defineBlock,
|
|
@@ -89,50 +89,6 @@ function extractCollectionRefs(pages) {
|
|
|
89
89
|
}
|
|
90
90
|
return refs;
|
|
91
91
|
}
|
|
92
|
-
async function polyfillBloxSsgGlobals(options) {
|
|
93
|
-
const { env } = await import("node:process");
|
|
94
|
-
const pageUrl = (options == null ? void 0 : options.pageUrl) ?? env.BAGELINK_API_URL ?? "https://example.com/";
|
|
95
|
-
const { Window: HappyWindow } = await import("happy-dom");
|
|
96
|
-
const _win = new HappyWindow({ url: pageUrl });
|
|
97
|
-
const g = globalThis;
|
|
98
|
-
if (g.window == null) g.window = g;
|
|
99
|
-
for (const key of Object.getOwnPropertyNames(_win)) {
|
|
100
|
-
if (key === "window" || key === "global" || key === "globalThis") continue;
|
|
101
|
-
try {
|
|
102
|
-
if (!(key in g)) g[key] = _win[key];
|
|
103
|
-
} catch {
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
for (const key of [
|
|
107
|
-
"document",
|
|
108
|
-
"location",
|
|
109
|
-
"localStorage",
|
|
110
|
-
"sessionStorage",
|
|
111
|
-
"navigator",
|
|
112
|
-
"Element",
|
|
113
|
-
"Document",
|
|
114
|
-
"HTMLElement",
|
|
115
|
-
"Event",
|
|
116
|
-
"CustomEvent",
|
|
117
|
-
"MouseEvent",
|
|
118
|
-
"KeyboardEvent",
|
|
119
|
-
"MutationObserver",
|
|
120
|
-
"IntersectionObserver",
|
|
121
|
-
"ResizeObserver",
|
|
122
|
-
"getComputedStyle",
|
|
123
|
-
"matchMedia",
|
|
124
|
-
"requestAnimationFrame",
|
|
125
|
-
"cancelAnimationFrame"
|
|
126
|
-
]) {
|
|
127
|
-
try {
|
|
128
|
-
g[key] = _win[key];
|
|
129
|
-
} catch {
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
g.window = g;
|
|
133
|
-
g.window.location = _win.location;
|
|
134
|
-
g.window.document = _win.document;
|
|
135
|
-
}
|
|
136
92
|
function buildPageHead(options) {
|
|
137
93
|
const { url, resolvedData, website, stateScript } = options;
|
|
138
94
|
const parts = [];
|
|
@@ -279,6 +235,50 @@ function extractPrimaryContext(contexts) {
|
|
|
279
235
|
function esc(s) {
|
|
280
236
|
return s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
281
237
|
}
|
|
238
|
+
async function polyfillBloxSsgGlobals(options) {
|
|
239
|
+
const { env } = await import("node:process");
|
|
240
|
+
const pageUrl = (options == null ? void 0 : options.pageUrl) ?? env.BAGELINK_API_URL ?? "https://example.com/";
|
|
241
|
+
const { Window: HappyWindow } = await import("happy-dom");
|
|
242
|
+
const _win = new HappyWindow({ url: pageUrl });
|
|
243
|
+
const g = globalThis;
|
|
244
|
+
if (g.window == null) g.window = g;
|
|
245
|
+
for (const key of Object.getOwnPropertyNames(_win)) {
|
|
246
|
+
if (key === "window" || key === "global" || key === "globalThis") continue;
|
|
247
|
+
try {
|
|
248
|
+
if (!(key in g)) g[key] = _win[key];
|
|
249
|
+
} catch {
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
for (const key of [
|
|
253
|
+
"document",
|
|
254
|
+
"location",
|
|
255
|
+
"localStorage",
|
|
256
|
+
"sessionStorage",
|
|
257
|
+
"navigator",
|
|
258
|
+
"Element",
|
|
259
|
+
"Document",
|
|
260
|
+
"HTMLElement",
|
|
261
|
+
"Event",
|
|
262
|
+
"CustomEvent",
|
|
263
|
+
"MouseEvent",
|
|
264
|
+
"KeyboardEvent",
|
|
265
|
+
"MutationObserver",
|
|
266
|
+
"IntersectionObserver",
|
|
267
|
+
"ResizeObserver",
|
|
268
|
+
"getComputedStyle",
|
|
269
|
+
"matchMedia",
|
|
270
|
+
"requestAnimationFrame",
|
|
271
|
+
"cancelAnimationFrame"
|
|
272
|
+
]) {
|
|
273
|
+
try {
|
|
274
|
+
g[key] = _win[key];
|
|
275
|
+
} catch {
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
g.window = g;
|
|
279
|
+
g.window.location = _win.location;
|
|
280
|
+
g.window.document = _win.document;
|
|
281
|
+
}
|
|
282
282
|
async function prerender({
|
|
283
283
|
root = process.cwd(),
|
|
284
284
|
clientOutDir = "dist/client",
|
|
@@ -512,8 +512,8 @@ function discoverInternalLinks(html) {
|
|
|
512
512
|
export {
|
|
513
513
|
prerender as a,
|
|
514
514
|
buildPageHead as b,
|
|
515
|
-
|
|
516
|
-
|
|
515
|
+
fetchCmsPrerenderPaths as c,
|
|
516
|
+
buildSiteHead as d,
|
|
517
517
|
generateRobotsTxt as e,
|
|
518
518
|
fetchCmsSiteData as f,
|
|
519
519
|
generateNetlifyRedirects as g,
|
package/dist/ssg/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
"use strict";
|
|
3
3
|
const process = require("node:process");
|
|
4
|
-
const prerender = require("../prerender-
|
|
4
|
+
const prerender = require("../prerender-ZBDFjWPT.cjs");
|
|
5
5
|
async function resolveApiBase(mode) {
|
|
6
6
|
if (process.env.BAGELINK_API_URL != null && process.env.BAGELINK_API_URL !== "") {
|
|
7
7
|
return { apiBase: process.env.BAGELINK_API_URL };
|
package/dist/ssg/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
import { p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../prerender-
|
|
3
|
+
import { p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../prerender-BZzd5T7y.js";
|
|
4
4
|
async function resolveApiBase(mode) {
|
|
5
5
|
if (process.env.BAGELINK_API_URL != null && process.env.BAGELINK_API_URL !== "") {
|
|
6
6
|
return { apiBase: process.env.BAGELINK_API_URL };
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -22,7 +22,7 @@ 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 prerender = require("../prerender-
|
|
25
|
+
const prerender = require("../prerender-ZBDFjWPT.cjs");
|
|
26
26
|
const ssg_client = require("./client.cjs");
|
|
27
27
|
const pinia = require("pinia");
|
|
28
28
|
const vue = require("vue");
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { b as buildPageHead } from "../prerender-
|
|
2
|
-
import {
|
|
1
|
+
import { b as buildPageHead } from "../prerender-BZzd5T7y.js";
|
|
2
|
+
import { d, c, f, g, e, h, p, a } from "../prerender-BZzd5T7y.js";
|
|
3
3
|
import { BLOX_STATE_WINDOW_KEY, BLOX_COLLECTIONS_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs";
|
|
4
4
|
import { getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
|
|
5
5
|
import { createPinia } from "pinia";
|
|
6
6
|
import { createSSRApp, markRaw } from "vue";
|
|
7
|
-
import { c as createBlox } from "../core-
|
|
7
|
+
import { c as createBlox } from "../core-CDeCe4VJ.js";
|
|
8
8
|
async function renderBloxSsgPage(options) {
|
|
9
9
|
const {
|
|
10
10
|
url,
|
|
@@ -134,9 +134,9 @@ export {
|
|
|
134
134
|
BLOX_STATE_WINDOW_KEY,
|
|
135
135
|
BLOX_WEBSITE_ID_WINDOW_KEY,
|
|
136
136
|
buildPageHead,
|
|
137
|
-
|
|
137
|
+
d as buildSiteHead,
|
|
138
138
|
createBloxSSREntry,
|
|
139
|
-
|
|
139
|
+
c as fetchCmsPrerenderPaths,
|
|
140
140
|
f as fetchCmsSiteData,
|
|
141
141
|
g as generateNetlifyRedirects,
|
|
142
142
|
e as generateRobotsTxt,
|
package/dist/vite-plugin.cjs
CHANGED
|
@@ -1277,10 +1277,18 @@ function bloxPlugin(options = {}) {
|
|
|
1277
1277
|
remaining = remaining.slice(0, declStart) + remaining.slice(j);
|
|
1278
1278
|
}
|
|
1279
1279
|
const hoistedImports = [];
|
|
1280
|
-
const importRe = /^[ \t]*import\s[
|
|
1281
|
-
remaining = remaining.replace(importRe, (match) => {
|
|
1282
|
-
|
|
1283
|
-
|
|
1280
|
+
const importRe = /^[ \t]*import\s+(\{[^}]*\})\s+from\s+(['"](?:@bagelink\/blox|@bagelink\/vue)['"])\s*;?[ \t]*$/gm;
|
|
1281
|
+
remaining = remaining.replace(importRe, (match, namedGroup, source) => {
|
|
1282
|
+
const names = namedGroup.replace(/[{}]/g, "").split(",").map((n2) => n2.trim()).filter(Boolean);
|
|
1283
|
+
const hoist = [];
|
|
1284
|
+
const keep = [];
|
|
1285
|
+
for (const name of names) {
|
|
1286
|
+
const local = name.split(/\s+as\s+/).pop().trim();
|
|
1287
|
+
if (identifiers.has(local)) hoist.push(name);
|
|
1288
|
+
else keep.push(name);
|
|
1289
|
+
}
|
|
1290
|
+
if (hoist.length) hoistedImports.push(`import { ${hoist.join(", ")} } from ${source}`);
|
|
1291
|
+
return keep.length ? `import { ${keep.join(", ")} } from ${source}` : "";
|
|
1284
1292
|
});
|
|
1285
1293
|
const langMatch = attrs.match(/lang="([^"]+)"/);
|
|
1286
1294
|
const lang = langMatch ? ` lang="${langMatch[1]}"` : "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAA;AAM9C,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAA;AAM9C,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,EAAE,CAsUpE"}
|
package/dist/vite-plugin.mjs
CHANGED
|
@@ -1275,10 +1275,18 @@ function bloxPlugin(options = {}) {
|
|
|
1275
1275
|
remaining = remaining.slice(0, declStart) + remaining.slice(j);
|
|
1276
1276
|
}
|
|
1277
1277
|
const hoistedImports = [];
|
|
1278
|
-
const importRe = /^[ \t]*import\s[
|
|
1279
|
-
remaining = remaining.replace(importRe, (match) => {
|
|
1280
|
-
|
|
1281
|
-
|
|
1278
|
+
const importRe = /^[ \t]*import\s+(\{[^}]*\})\s+from\s+(['"](?:@bagelink\/blox|@bagelink\/vue)['"])\s*;?[ \t]*$/gm;
|
|
1279
|
+
remaining = remaining.replace(importRe, (match, namedGroup, source) => {
|
|
1280
|
+
const names = namedGroup.replace(/[{}]/g, "").split(",").map((n2) => n2.trim()).filter(Boolean);
|
|
1281
|
+
const hoist = [];
|
|
1282
|
+
const keep = [];
|
|
1283
|
+
for (const name of names) {
|
|
1284
|
+
const local = name.split(/\s+as\s+/).pop().trim();
|
|
1285
|
+
if (identifiers.has(local)) hoist.push(name);
|
|
1286
|
+
else keep.push(name);
|
|
1287
|
+
}
|
|
1288
|
+
if (hoist.length) hoistedImports.push(`import { ${hoist.join(", ")} } from ${source}`);
|
|
1289
|
+
return keep.length ? `import { ${keep.join(", ")} } from ${source}` : "";
|
|
1282
1290
|
});
|
|
1283
1291
|
const langMatch = attrs.match(/lang="([^"]+)"/);
|
|
1284
1292
|
const lang = langMatch ? ` lang="${langMatch[1]}"` : "";
|
package/package.json
CHANGED
|
@@ -112,50 +112,6 @@ function extractCollectionRefs(pages) {
|
|
|
112
112
|
}
|
|
113
113
|
return refs;
|
|
114
114
|
}
|
|
115
|
-
async function polyfillBloxSsgGlobals(options) {
|
|
116
|
-
const { env } = await import("node:process");
|
|
117
|
-
const pageUrl = (options == null ? void 0 : options.pageUrl) ?? env.BAGELINK_API_URL ?? "https://example.com/";
|
|
118
|
-
const { Window: HappyWindow } = await import("happy-dom");
|
|
119
|
-
const _win = new HappyWindow({ url: pageUrl });
|
|
120
|
-
const g = globalThis;
|
|
121
|
-
if (g.window == null) g.window = g;
|
|
122
|
-
for (const key of Object.getOwnPropertyNames(_win)) {
|
|
123
|
-
if (key === "window" || key === "global" || key === "globalThis") continue;
|
|
124
|
-
try {
|
|
125
|
-
if (!(key in g)) g[key] = _win[key];
|
|
126
|
-
} catch {
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
for (const key of [
|
|
130
|
-
"document",
|
|
131
|
-
"location",
|
|
132
|
-
"localStorage",
|
|
133
|
-
"sessionStorage",
|
|
134
|
-
"navigator",
|
|
135
|
-
"Element",
|
|
136
|
-
"Document",
|
|
137
|
-
"HTMLElement",
|
|
138
|
-
"Event",
|
|
139
|
-
"CustomEvent",
|
|
140
|
-
"MouseEvent",
|
|
141
|
-
"KeyboardEvent",
|
|
142
|
-
"MutationObserver",
|
|
143
|
-
"IntersectionObserver",
|
|
144
|
-
"ResizeObserver",
|
|
145
|
-
"getComputedStyle",
|
|
146
|
-
"matchMedia",
|
|
147
|
-
"requestAnimationFrame",
|
|
148
|
-
"cancelAnimationFrame"
|
|
149
|
-
]) {
|
|
150
|
-
try {
|
|
151
|
-
g[key] = _win[key];
|
|
152
|
-
} catch {
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
g.window = g;
|
|
156
|
-
g.window.location = _win.location;
|
|
157
|
-
g.window.document = _win.document;
|
|
158
|
-
}
|
|
159
115
|
function buildPageHead(options) {
|
|
160
116
|
const { url, resolvedData, website, stateScript } = options;
|
|
161
117
|
const parts = [];
|
|
@@ -302,6 +258,50 @@ function extractPrimaryContext(contexts) {
|
|
|
302
258
|
function esc(s) {
|
|
303
259
|
return s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
304
260
|
}
|
|
261
|
+
async function polyfillBloxSsgGlobals(options) {
|
|
262
|
+
const { env } = await import("node:process");
|
|
263
|
+
const pageUrl = (options == null ? void 0 : options.pageUrl) ?? env.BAGELINK_API_URL ?? "https://example.com/";
|
|
264
|
+
const { Window: HappyWindow } = await import("happy-dom");
|
|
265
|
+
const _win = new HappyWindow({ url: pageUrl });
|
|
266
|
+
const g = globalThis;
|
|
267
|
+
if (g.window == null) g.window = g;
|
|
268
|
+
for (const key of Object.getOwnPropertyNames(_win)) {
|
|
269
|
+
if (key === "window" || key === "global" || key === "globalThis") continue;
|
|
270
|
+
try {
|
|
271
|
+
if (!(key in g)) g[key] = _win[key];
|
|
272
|
+
} catch {
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
for (const key of [
|
|
276
|
+
"document",
|
|
277
|
+
"location",
|
|
278
|
+
"localStorage",
|
|
279
|
+
"sessionStorage",
|
|
280
|
+
"navigator",
|
|
281
|
+
"Element",
|
|
282
|
+
"Document",
|
|
283
|
+
"HTMLElement",
|
|
284
|
+
"Event",
|
|
285
|
+
"CustomEvent",
|
|
286
|
+
"MouseEvent",
|
|
287
|
+
"KeyboardEvent",
|
|
288
|
+
"MutationObserver",
|
|
289
|
+
"IntersectionObserver",
|
|
290
|
+
"ResizeObserver",
|
|
291
|
+
"getComputedStyle",
|
|
292
|
+
"matchMedia",
|
|
293
|
+
"requestAnimationFrame",
|
|
294
|
+
"cancelAnimationFrame"
|
|
295
|
+
]) {
|
|
296
|
+
try {
|
|
297
|
+
g[key] = _win[key];
|
|
298
|
+
} catch {
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
g.window = g;
|
|
302
|
+
g.window.location = _win.location;
|
|
303
|
+
g.window.document = _win.document;
|
|
304
|
+
}
|
|
305
305
|
async function prerender({
|
|
306
306
|
root = process.cwd(),
|
|
307
307
|
clientOutDir = "dist/client",
|