@absolutejs/absolute 0.20.0-beta.6 → 0.20.0-beta.61
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/README.md +205 -0
- package/dist/angular/browser.js +392 -405
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +7 -7
- package/dist/angular/components/core/streamingSlotRegistry.js +4 -4
- package/dist/angular/index.js +379 -321
- package/dist/angular/index.js.map +8 -7
- package/dist/angular/server.js +133 -61
- package/dist/angular/server.js.map +8 -7
- package/dist/build.js +2336 -1347
- package/dist/build.js.map +22 -17
- package/dist/cli/config/client.js +12 -12
- package/dist/cli/config/server.js +1140 -1091
- package/dist/cli/index.js +10107 -2126
- package/dist/client/chunks/angularPatch-arh4sr68.js +157 -0
- package/dist/client/chunks/angularPatch-arh4sr68.js.map +10 -0
- package/dist/client/chunks/index-5py90ctf.js +87 -0
- package/dist/client/chunks/index-5py90ctf.js.map +10 -0
- package/dist/client/chunks/index-m35nbkdp.js +374 -0
- package/dist/client/chunks/index-m35nbkdp.js.map +12 -0
- package/dist/client/chunks/index-qxjc7kc5.js +12 -0
- package/dist/client/chunks/index-qxjc7kc5.js.map +9 -0
- package/dist/client/chunks/islands-xj2n8nwf.js +281 -0
- package/dist/client/chunks/islands-xj2n8nwf.js.map +14 -0
- package/dist/client/chunks/react-pdg4325x.js +65 -0
- package/dist/client/chunks/react-pdg4325x.js.map +10 -0
- package/dist/client/chunks/svelte-s0c964kb.js +19 -0
- package/dist/client/chunks/svelte-s0c964kb.js.map +10 -0
- package/dist/client/chunks/vue-rdskrnyg.js +24 -0
- package/dist/client/chunks/vue-rdskrnyg.js.map +10 -0
- package/dist/client/index.js +73 -841
- package/dist/client/index.js.map +7 -20
- package/dist/core/streamingSlotRegistrar.js +15 -13
- package/dist/core/streamingSlotRegistrar.js.map +2 -2
- package/dist/core/streamingSlotRegistry.js +11 -9
- package/dist/core/streamingSlotRegistry.js.map +2 -2
- package/dist/dev/client/hmrClient.ts +35 -3
- package/dist/dev/client/hmrTiming.ts +6 -0
- package/dist/dev/client/syncDevtools.ts +237 -0
- package/dist/dev/serverBootstrap.js +28 -0
- package/dist/image-client/imageClient.js +7 -7
- package/dist/index.js +3756 -2361
- package/dist/index.js.map +38 -30
- package/dist/islands/browser.js +11 -25
- package/dist/islands/browser.js.map +2 -2
- package/dist/islands/index.js +55 -52
- package/dist/islands/index.js.map +5 -4
- package/dist/mobile/browser.js +429 -20
- package/dist/mobile/browser.js.map +8 -5
- package/dist/mobile/index.js +11287 -3348
- package/dist/mobile/index.js.map +47 -18
- package/dist/mobile/remoteMacAgentEntry.js +1374 -14
- package/dist/mobile/shellAuth.js +36 -0
- package/dist/mobile/shellBootstrap.js +1800 -0
- package/dist/mobile/shellExpoAuth.js +163 -0
- package/dist/mobile/shellExpoDevices.js +77 -0
- package/dist/mobile/shellExpoSync.js +104 -0
- package/dist/mobile/shellSync.js +184 -0
- package/dist/mobile/shellUpdate.js +532 -0
- package/dist/mobile/uiPrimitives.js +264 -0
- package/dist/react/browser.js +17 -59
- package/dist/react/browser.js.map +2 -2
- package/dist/react/components/browser/index.js +107 -107
- package/dist/react/components/index.js +118 -116
- package/dist/react/components/index.js.map +2 -2
- package/dist/react/hooks/index.js +11 -25
- package/dist/react/hooks/index.js.map +2 -2
- package/dist/react/index.js +110 -67
- package/dist/react/index.js.map +8 -7
- package/dist/react/jsxDevRuntimeCompat.js +11 -9
- package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
- package/dist/react/jsxRuntimeCompat.js +11 -9
- package/dist/react/jsxRuntimeCompat.js.map +2 -2
- package/dist/react/router/browser.js +9 -7
- package/dist/react/router/browser.js.map +2 -2
- package/dist/react/router/index.js +9 -7
- package/dist/react/router/index.js.map +2 -2
- package/dist/react/server.js +67 -11
- package/dist/react/server.js.map +7 -6
- package/dist/src/build/pwa.d.ts +16 -0
- package/dist/src/cli/config/server.d.ts +1 -1
- package/dist/src/cli/instanceStatus.d.ts +1 -0
- package/dist/src/cli/scripts/dev.d.ts +2 -0
- package/dist/src/client/browserTranslation.d.ts +19 -0
- package/dist/src/client/index.d.ts +1 -0
- package/dist/src/core/browserTranslation.d.ts +6 -0
- package/dist/src/core/devBuild.d.ts +1 -0
- package/dist/src/core/prepare.d.ts +376 -0
- package/dist/src/dev/clientManager.d.ts +1 -0
- package/dist/src/dev/devCert.d.ts +6 -4
- package/dist/src/dev/serverEntryCopies.d.ts +3 -0
- package/dist/src/ember/browser.d.ts +0 -16
- package/dist/src/mobile/adaptiveShell.d.ts +27 -0
- package/dist/src/mobile/androidEmulatorController.d.ts +8 -1
- package/dist/src/mobile/androidRelease.d.ts +9 -2
- package/dist/src/mobile/androidTestReport.d.ts +14 -0
- package/dist/src/mobile/androidUpgradeConformance.d.ts +47 -0
- package/dist/src/mobile/androidWebView.d.ts +1 -0
- package/dist/src/mobile/browser.d.ts +2 -0
- package/dist/src/mobile/capacitorBundle.d.ts +19 -0
- package/dist/src/mobile/ciWorkflow.d.ts +26 -0
- package/dist/src/mobile/config.d.ts +10 -1
- package/dist/src/mobile/devDeviceAdapter.d.ts +3 -0
- package/dist/src/mobile/deviceCapabilities.d.ts +49 -0
- package/dist/src/mobile/expoBridge.d.ts +91 -0
- package/dist/src/mobile/expoDevController.d.ts +56 -0
- package/dist/src/mobile/expoProject.d.ts +16 -0
- package/dist/src/mobile/index.d.ts +23 -0
- package/dist/src/mobile/iosDeviceAcceptance.d.ts +32 -0
- package/dist/src/mobile/iosPhysicalDeviceTransport.d.ts +16 -0
- package/dist/src/mobile/iosRelease.d.ts +63 -3
- package/dist/src/mobile/iosSimulatorController.d.ts +20 -2
- package/dist/src/mobile/iosTestReport.d.ts +24 -0
- package/dist/src/mobile/mobileBundleInspection.d.ts +63 -0
- package/dist/src/mobile/mobileInspect.d.ts +142 -0
- package/dist/src/mobile/mobilePreview.d.ts +174 -0
- package/dist/src/mobile/mobilePreviewClient.d.ts +1 -0
- package/dist/src/mobile/nativeAuth.d.ts +6 -0
- package/dist/src/mobile/nativeBackgroundSync.d.ts +4 -0
- package/dist/src/mobile/nativeDeviceCapabilities.d.ts +6 -0
- package/dist/src/mobile/nativeRoute.d.ts +13 -0
- package/dist/src/mobile/nativeTestReport.d.ts +91 -0
- package/dist/src/mobile/nativeUpdates.d.ts +4 -0
- package/dist/src/mobile/navigationLifecycle.d.ts +36 -0
- package/dist/src/mobile/navigationState.d.ts +53 -0
- package/dist/src/mobile/pageProtocol.d.ts +2 -0
- package/dist/src/mobile/releaseDoctor.d.ts +23 -1
- package/dist/src/mobile/remoteMacProtocol.d.ts +134 -1
- package/dist/src/mobile/remoteMacWire.d.ts +1 -1
- package/dist/src/mobile/shellAuth.d.ts +8 -1
- package/dist/src/mobile/shellBootstrap.d.ts +15 -2
- package/dist/src/mobile/shellExpoAuth.d.ts +12 -0
- package/dist/src/mobile/shellExpoDevices.d.ts +3 -0
- package/dist/src/mobile/shellExpoSync.d.ts +18 -0
- package/dist/src/mobile/shellHttp.d.ts +2 -0
- package/dist/src/mobile/shellPush.d.ts +11 -0
- package/dist/src/mobile/shellSync.d.ts +46 -1
- package/dist/src/mobile/shellUpdate.d.ts +2 -0
- package/dist/src/mobile/syncRemediation.d.ts +10 -0
- package/dist/src/mobile/syncSchema.d.ts +9 -0
- package/dist/src/mobile/transport.d.ts +15 -0
- package/dist/src/mobile/uiPrimitives.d.ts +37 -0
- package/dist/src/mobile/updateClient.d.ts +44 -0
- package/dist/src/mobile/updateProtocol.d.ts +51 -0
- package/dist/src/mobile/updatePublisher.d.ts +66 -0
- package/dist/src/mobile/updateRollout.d.ts +16 -0
- package/dist/src/mobile/updateRuntime.d.ts +27 -0
- package/dist/src/mobile/updateSigning.d.ts +20 -0
- package/dist/src/plugins/hmr.d.ts +3 -0
- package/dist/src/plugins/imageOptimizer.d.ts +1 -1
- package/dist/src/react/hooks/useMediaQuery.d.ts +1 -1
- package/dist/src/utils/imageProcessing.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/src/utils/logger.d.ts +1 -0
- package/dist/src/utils/startupBanner.d.ts +1 -0
- package/dist/src/utils/userAgentFunctions.d.ts +1 -1
- package/dist/src/vue/browser.d.ts +1 -0
- package/dist/src/vue/browserTranslation.d.ts +5 -0
- package/dist/src/vue/index.d.ts +1 -0
- package/dist/svelte/browser.js +12 -26
- package/dist/svelte/browser.js.map +2 -2
- package/dist/svelte/index.js +104 -61
- package/dist/svelte/index.js.map +8 -7
- package/dist/svelte/server.js +84 -28
- package/dist/svelte/server.js.map +7 -6
- package/dist/types/build.d.ts +64 -3
- package/dist/types/cli.d.ts +1 -0
- package/dist/types/messages.d.ts +1 -1
- package/dist/vue/browser.js +116 -56
- package/dist/vue/browser.js.map +5 -3
- package/dist/vue/components/Image.js +9 -7
- package/dist/vue/components/Image.js.map +2 -2
- package/dist/vue/components/index.js +11 -9
- package/dist/vue/components/index.js.map +2 -2
- package/dist/vue/index.js +211 -94
- package/dist/vue/index.js.map +10 -7
- package/dist/vue/server.js +69 -13
- package/dist/vue/server.js.map +7 -6
- package/package.json +40 -14
package/dist/client/index.js
CHANGED
|
@@ -1,67 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return this[key];
|
|
9
|
-
}
|
|
10
|
-
var __toESMCache_node;
|
|
11
|
-
var __toESMCache_esm;
|
|
12
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
13
|
-
var canCache = mod != null && typeof mod === "object";
|
|
14
|
-
if (canCache) {
|
|
15
|
-
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
16
|
-
var cached = cache.get(mod);
|
|
17
|
-
if (cached)
|
|
18
|
-
return cached;
|
|
19
|
-
}
|
|
20
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
|
-
for (let key of __getOwnPropNames(mod))
|
|
23
|
-
if (!__hasOwnProp.call(to, key))
|
|
24
|
-
__defProp(to, key, {
|
|
25
|
-
get: __accessProp.bind(mod, key),
|
|
26
|
-
enumerable: true
|
|
27
|
-
});
|
|
28
|
-
if (canCache)
|
|
29
|
-
cache.set(mod, to);
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
33
|
-
var __returnValue = (v) => v;
|
|
34
|
-
function __exportSetter(name, newValue) {
|
|
35
|
-
this[name] = __returnValue.bind(null, newValue);
|
|
36
|
-
}
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, {
|
|
40
|
-
get: all[name],
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
set: __exportSetter.bind(all, name)
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
47
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
48
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
49
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
|
50
|
-
else
|
|
51
|
-
for (var i = decorators.length - 1;i >= 0; i--)
|
|
52
|
-
if (d = decorators[i])
|
|
53
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
54
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
55
|
-
};
|
|
56
|
-
var __legacyMetadataTS = (k, v) => {
|
|
57
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
58
|
-
return Reflect.metadata(k, v);
|
|
59
|
-
};
|
|
60
|
-
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
61
|
-
var __require = import.meta.require;
|
|
1
|
+
import {
|
|
2
|
+
captureSsrTextBaselines,
|
|
3
|
+
prepareBrowserTranslationHydration
|
|
4
|
+
} from "./chunks/index-5py90ctf.js";
|
|
5
|
+
import {
|
|
6
|
+
__require
|
|
7
|
+
} from "./chunks/index-qxjc7kc5.js";
|
|
62
8
|
|
|
63
9
|
// src/core/islandManifest.ts
|
|
64
|
-
var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1)
|
|
10
|
+
var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + framework.slice(1);
|
|
11
|
+
var collectFrameworkIslands = (manifest, prefix) => {
|
|
65
12
|
const entries = {};
|
|
66
13
|
let found = false;
|
|
67
14
|
for (const [key, value] of Object.entries(manifest)) {
|
|
@@ -74,7 +21,8 @@ var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + fram
|
|
|
74
21
|
found = true;
|
|
75
22
|
}
|
|
76
23
|
return found ? entries : undefined;
|
|
77
|
-
}
|
|
24
|
+
};
|
|
25
|
+
var getIslandManifestEntries = (manifest) => {
|
|
78
26
|
const islands = {};
|
|
79
27
|
const frameworks = ["react", "svelte", "vue", "angular"];
|
|
80
28
|
for (const framework of frameworks) {
|
|
@@ -84,8 +32,20 @@ var toIslandFrameworkSegment = (framework) => framework[0]?.toUpperCase() + fram
|
|
|
84
32
|
islands[framework] = entries;
|
|
85
33
|
}
|
|
86
34
|
return islands;
|
|
87
|
-
}
|
|
35
|
+
};
|
|
36
|
+
var getIslandManifestKey = (framework, component) => `Island${toIslandFrameworkSegment(framework)}${component}`;
|
|
88
37
|
|
|
38
|
+
// src/client/islandResolver.ts
|
|
39
|
+
var createIslandManifestResolver = (manifest) => {
|
|
40
|
+
const islandManifest = getIslandManifestEntries(manifest);
|
|
41
|
+
return async (framework, component) => {
|
|
42
|
+
const modulePath = islandManifest[framework]?.[component] ?? manifest[getIslandManifestKey(framework, component)];
|
|
43
|
+
if (!modulePath)
|
|
44
|
+
return;
|
|
45
|
+
const loadedModule = await import(modulePath);
|
|
46
|
+
return loadedModule.default;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
89
49
|
// src/client/streamSwap.ts
|
|
90
50
|
var streamSwapRuntime = () => {
|
|
91
51
|
const absoluteWindow = window;
|
|
@@ -187,723 +147,15 @@ var streamSwapRuntime = () => {
|
|
|
187
147
|
document.addEventListener("DOMContentLoaded", flush, { once: true });
|
|
188
148
|
}
|
|
189
149
|
flush();
|
|
190
|
-
}
|
|
150
|
+
};
|
|
151
|
+
var stripFunctionWrapper = (value) => {
|
|
191
152
|
const start = value.indexOf("{");
|
|
192
153
|
const end = value.lastIndexOf("}");
|
|
193
154
|
if (start < 0 || end <= start)
|
|
194
155
|
return "";
|
|
195
156
|
return value.slice(start + 1, end);
|
|
196
|
-
}, getStreamSwapRuntimeScript = () => `(function(){${stripFunctionWrapper(streamSwapRuntime.toString())}})();`;
|
|
197
|
-
|
|
198
|
-
// src/core/islands.ts
|
|
199
|
-
function getIslandComponent(component) {
|
|
200
|
-
if (isIslandComponentDefinition(component)) {
|
|
201
|
-
return component.component;
|
|
202
|
-
}
|
|
203
|
-
return component;
|
|
204
|
-
}
|
|
205
|
-
var defineIslandComponent = (component, options) => ({
|
|
206
|
-
component,
|
|
207
|
-
export: options.export,
|
|
208
|
-
source: options.source
|
|
209
|
-
}), defineIslandRegistry = (registry) => registry, isRecord = (value) => typeof value === "object" && value !== null, getIslandBuildReference = (component) => {
|
|
210
|
-
if (!isIslandComponentDefinition(component))
|
|
211
|
-
return null;
|
|
212
|
-
return {
|
|
213
|
-
export: component.export,
|
|
214
|
-
source: component.source
|
|
215
|
-
};
|
|
216
|
-
}, isIslandComponentDefinition = (value) => isRecord(value) && ("component" in value) && ("source" in value) && typeof value.source === "string", parseIslandProps = (rawProps) => {
|
|
217
|
-
if (!rawProps)
|
|
218
|
-
return {};
|
|
219
|
-
return JSON.parse(rawProps);
|
|
220
|
-
}, serializeIslandProps = (props) => JSON.stringify(props ?? {});
|
|
221
|
-
var init_islands = () => {};
|
|
222
|
-
|
|
223
|
-
// src/core/islandMarkupAttributes.ts
|
|
224
|
-
var getIslandMarkerAttributes = (props, islandId) => ({
|
|
225
|
-
"data-component": props.component,
|
|
226
|
-
"data-framework": props.framework,
|
|
227
|
-
"data-hydrate": props.hydrate ?? "load",
|
|
228
|
-
"data-island": "true",
|
|
229
|
-
...islandId ? { "data-island-id": islandId } : {},
|
|
230
|
-
"data-props": serializeIslandProps(props.props)
|
|
231
|
-
}), escapeHtmlAttribute = (value) => value.replaceAll("&", "&").replaceAll('"', """).replaceAll("<", "<").replaceAll(">", ">"), serializeIslandAttributes = (attributes) => Object.entries(attributes).map(([key, value]) => `${key}="${escapeHtmlAttribute(value)}"`).join(" ");
|
|
232
|
-
var init_islandMarkupAttributes = __esm(() => {
|
|
233
|
-
init_islands();
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
// src/client/hydrators/react.ts
|
|
237
|
-
var exports_react = {};
|
|
238
|
-
__export(exports_react, {
|
|
239
|
-
isReactComponent: () => isReactComponent,
|
|
240
|
-
hydrateReactIsland: () => hydrateReactIsland
|
|
241
|
-
});
|
|
242
|
-
import { createElement } from "react";
|
|
243
|
-
import { hydrateRoot } from "react-dom/client";
|
|
244
|
-
var reactIslandRoots, isPropsRecord = (value) => typeof value === "object" && value !== null, HOST_REACT_EXPANDO_PREFIXES, detachFromHostReactRoot = (element) => {
|
|
245
|
-
for (const key of Object.keys(element)) {
|
|
246
|
-
const isHostExpando = HOST_REACT_EXPANDO_PREFIXES.some((prefix) => key.startsWith(prefix));
|
|
247
|
-
if (!isHostExpando)
|
|
248
|
-
continue;
|
|
249
|
-
Reflect.deleteProperty(element, key);
|
|
250
|
-
}
|
|
251
|
-
}, hydrateReactIsland = (component, element, props) => {
|
|
252
|
-
const existingRoot = reactIslandRoots.get(element);
|
|
253
|
-
if (existingRoot) {
|
|
254
|
-
existingRoot.render(isPropsRecord(props) ? createElement(component, props) : createElement(component));
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
detachFromHostReactRoot(element);
|
|
258
|
-
if (!isPropsRecord(props)) {
|
|
259
|
-
reactIslandRoots.set(element, hydrateRoot(element, createElement(component)));
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
reactIslandRoots.set(element, hydrateRoot(element, createElement(component, props)));
|
|
263
|
-
}, isReactComponent = (value) => typeof value === "function";
|
|
264
|
-
var init_react = __esm(() => {
|
|
265
|
-
reactIslandRoots = new WeakMap;
|
|
266
|
-
HOST_REACT_EXPANDO_PREFIXES = [
|
|
267
|
-
"__reactFiber$",
|
|
268
|
-
"__reactProps$",
|
|
269
|
-
"__reactContainer$",
|
|
270
|
-
"__reactEvents$",
|
|
271
|
-
"__reactListeners$",
|
|
272
|
-
"__reactHandles$"
|
|
273
|
-
];
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
// src/client/hydrators/svelte.ts
|
|
277
|
-
var exports_svelte = {};
|
|
278
|
-
__export(exports_svelte, {
|
|
279
|
-
isSvelteComponent: () => isSvelteComponent,
|
|
280
|
-
hydrateSvelteIsland: () => hydrateSvelteIsland
|
|
281
|
-
});
|
|
282
|
-
import { hydrate as hydrateSvelte } from "svelte";
|
|
283
|
-
var isPropsRecord2 = (value) => typeof value === "object" && value !== null, hydrateSvelteIsland = (component, element, props) => {
|
|
284
|
-
hydrateSvelte(component, {
|
|
285
|
-
props: isPropsRecord2(props) ? props : undefined,
|
|
286
|
-
target: element
|
|
287
|
-
});
|
|
288
|
-
}, isSvelteComponent = (value) => typeof value === "function";
|
|
289
|
-
var init_svelte = () => {};
|
|
290
|
-
|
|
291
|
-
// src/client/hydrators/vue.ts
|
|
292
|
-
var exports_vue = {};
|
|
293
|
-
__export(exports_vue, {
|
|
294
|
-
isVueComponent: () => isVueComponent,
|
|
295
|
-
hydrateVueIsland: () => hydrateVueIsland
|
|
296
|
-
});
|
|
297
|
-
import { createSSRApp, h } from "vue";
|
|
298
|
-
var vueIslandApps, isPropsRecord3 = (value) => typeof value === "object" && value !== null, hydrateVueIsland = (component, element, props) => {
|
|
299
|
-
if (vueIslandApps.has(element)) {
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
const app = createSSRApp({
|
|
303
|
-
render: () => h(component, isPropsRecord3(props) ? props : undefined)
|
|
304
|
-
});
|
|
305
|
-
app.mount(element);
|
|
306
|
-
vueIslandApps.set(element, app);
|
|
307
|
-
}, isVueComponent = (value) => typeof value === "function" || isPropsRecord3(value);
|
|
308
|
-
var init_vue = __esm(() => {
|
|
309
|
-
vueIslandApps = new WeakMap;
|
|
310
|
-
});
|
|
311
|
-
|
|
312
|
-
// src/angular/resolveAngularPackage.ts
|
|
313
|
-
import { existsSync, readFileSync } from "fs";
|
|
314
|
-
import { join, resolve } from "path";
|
|
315
|
-
var resolveAngularPackageDir = (specifier) => {
|
|
316
|
-
const fromCompiledRuntime = process.env.ABSOLUTE_BUILD_DIR ? resolve(process.env.ABSOLUTE_BUILD_DIR, "node_modules", specifier) : null;
|
|
317
|
-
if (fromCompiledRuntime && existsSync(fromCompiledRuntime)) {
|
|
318
|
-
return fromCompiledRuntime;
|
|
319
|
-
}
|
|
320
|
-
const fromProject = resolve(process.cwd(), "node_modules", specifier);
|
|
321
|
-
if (existsSync(fromProject)) {
|
|
322
|
-
return fromProject;
|
|
323
|
-
}
|
|
324
|
-
return null;
|
|
325
|
-
}, resolvePackageEntry = (packageDir) => {
|
|
326
|
-
try {
|
|
327
|
-
const pkg = JSON.parse(readFileSync(join(packageDir, "package.json"), "utf-8"));
|
|
328
|
-
const rootExport = pkg.exports?.["."];
|
|
329
|
-
const entry = (typeof rootExport === "string" ? rootExport : rootExport?.default) ?? pkg.module ?? pkg.main ?? "index.js";
|
|
330
|
-
return join(packageDir, entry);
|
|
331
|
-
} catch {
|
|
332
|
-
return packageDir;
|
|
333
|
-
}
|
|
334
|
-
}, resolveAngularPackage = (specifier) => {
|
|
335
|
-
const packageDir = resolveAngularPackageDir(specifier);
|
|
336
|
-
if (packageDir)
|
|
337
|
-
return resolvePackageEntry(packageDir);
|
|
338
|
-
return specifier;
|
|
339
|
-
}, toSafeVendorName = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), resolveAngularRuntimePath = (specifier) => {
|
|
340
|
-
const buildDirs = [
|
|
341
|
-
process.env.ABSOLUTE_BUILD_DIR,
|
|
342
|
-
resolve(process.cwd(), "build")
|
|
343
|
-
].filter((value) => Boolean(value));
|
|
344
|
-
for (const buildDir of buildDirs) {
|
|
345
|
-
const vendorPath = join(buildDir, "angular", "vendor", "server", `${toSafeVendorName(specifier)}.js`);
|
|
346
|
-
if (existsSync(vendorPath))
|
|
347
|
-
return vendorPath;
|
|
348
|
-
}
|
|
349
|
-
return resolveAngularPackage(specifier);
|
|
350
|
-
};
|
|
351
|
-
var init_resolveAngularPackage = () => {};
|
|
352
|
-
|
|
353
|
-
// src/utils/runtimeMode.ts
|
|
354
|
-
var ENV_VAR = "NODE_ENV", isDevelopmentRuntime = () => process.env[ENV_VAR] === "development", isProductionRuntime = () => process.env[ENV_VAR] === "production";
|
|
355
|
-
|
|
356
|
-
// src/angular/angularPatch.ts
|
|
357
|
-
var exports_angularPatch = {};
|
|
358
|
-
__export(exports_angularPatch, {
|
|
359
|
-
applyPatches: () => applyPatches
|
|
360
|
-
});
|
|
361
|
-
var ensureHead = (doc) => {
|
|
362
|
-
if (!doc || doc.head || !doc.documentElement) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
const head = doc.createElement("head");
|
|
366
|
-
doc.documentElement.insertBefore(head, doc.documentElement.firstChild);
|
|
367
|
-
}, SSR_LAYOUT_RECT, layoutPatchApplied = false, collectPrototypeChain = (instance) => {
|
|
368
|
-
const protos = [];
|
|
369
|
-
let current = instance ? Object.getPrototypeOf(instance) : null;
|
|
370
|
-
while (current && current !== Object.prototype) {
|
|
371
|
-
protos.push(current);
|
|
372
|
-
current = Object.getPrototypeOf(current);
|
|
373
|
-
}
|
|
374
|
-
return protos;
|
|
375
|
-
}, patchElementLayout = (doc) => {
|
|
376
|
-
if (layoutPatchApplied || !doc) {
|
|
377
|
-
return;
|
|
378
|
-
}
|
|
379
|
-
let element;
|
|
380
|
-
try {
|
|
381
|
-
element = doc.createElement("div");
|
|
382
|
-
} catch {
|
|
383
|
-
return;
|
|
384
|
-
}
|
|
385
|
-
const protos = collectPrototypeChain(element);
|
|
386
|
-
if (protos.length === 0)
|
|
387
|
-
return;
|
|
388
|
-
const copyLayoutRect = (rect) => ({ ...rect });
|
|
389
|
-
const createLayoutRect = () => copyLayoutRect(SSR_LAYOUT_RECT);
|
|
390
|
-
const getClientRects = () => [];
|
|
391
|
-
const noop = () => {
|
|
392
|
-
return;
|
|
393
|
-
};
|
|
394
|
-
const numericProps = [
|
|
395
|
-
"clientWidth",
|
|
396
|
-
"clientHeight",
|
|
397
|
-
"clientLeft",
|
|
398
|
-
"clientTop",
|
|
399
|
-
"offsetWidth",
|
|
400
|
-
"offsetHeight",
|
|
401
|
-
"offsetLeft",
|
|
402
|
-
"offsetTop",
|
|
403
|
-
"scrollWidth",
|
|
404
|
-
"scrollHeight",
|
|
405
|
-
"scrollLeft",
|
|
406
|
-
"scrollTop"
|
|
407
|
-
];
|
|
408
|
-
for (const proto of protos) {
|
|
409
|
-
const define = (name, value) => {
|
|
410
|
-
const descriptor = Object.getOwnPropertyDescriptor(proto, name);
|
|
411
|
-
if (typeof descriptor?.value === "function")
|
|
412
|
-
return;
|
|
413
|
-
Object.defineProperty(proto, name, {
|
|
414
|
-
configurable: true,
|
|
415
|
-
value,
|
|
416
|
-
writable: true
|
|
417
|
-
});
|
|
418
|
-
};
|
|
419
|
-
define("getBoundingClientRect", createLayoutRect);
|
|
420
|
-
define("getClientRects", getClientRects);
|
|
421
|
-
define("scrollTo", noop);
|
|
422
|
-
define("scrollBy", noop);
|
|
423
|
-
define("scrollIntoView", noop);
|
|
424
|
-
define("focus", noop);
|
|
425
|
-
define("blur", noop);
|
|
426
|
-
for (const prop of numericProps) {
|
|
427
|
-
const desc = Object.getOwnPropertyDescriptor(proto, prop);
|
|
428
|
-
if (desc)
|
|
429
|
-
continue;
|
|
430
|
-
Object.defineProperty(proto, prop, {
|
|
431
|
-
configurable: true,
|
|
432
|
-
get: () => 0
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
layoutPatchApplied = true;
|
|
437
|
-
}, applyPatches = async () => {
|
|
438
|
-
const spec = isProductionRuntime() ? resolveAngularRuntimePath("@angular/platform-server") : "@angular/platform-server";
|
|
439
|
-
const { \u{275}DominoAdapter } = await import(spec);
|
|
440
|
-
if (!\u{275}DominoAdapter?.prototype) {
|
|
441
|
-
console.warn("[Angular Patch] \u0275DominoAdapter not found, skipping patches");
|
|
442
|
-
return false;
|
|
443
|
-
}
|
|
444
|
-
try {
|
|
445
|
-
const adapter = new \u{275}DominoAdapter;
|
|
446
|
-
const resolveSeedDoc = () => {
|
|
447
|
-
if (typeof adapter.createHtmlDocument === "function")
|
|
448
|
-
return adapter.createHtmlDocument();
|
|
449
|
-
if (typeof adapter.getDefaultDocument === "function")
|
|
450
|
-
return adapter.getDefaultDocument();
|
|
451
|
-
return null;
|
|
452
|
-
};
|
|
453
|
-
const seedDoc = resolveSeedDoc();
|
|
454
|
-
if (seedDoc) {
|
|
455
|
-
patchElementLayout(seedDoc);
|
|
456
|
-
const probe = seedDoc.createElement("div");
|
|
457
|
-
if (typeof probe.getBoundingClientRect !== "function") {
|
|
458
|
-
console.warn("[Angular Patch] Layout shim did not stick on probe element prototype chain");
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
} catch (error) {
|
|
462
|
-
console.warn("[Angular Patch] Could not eagerly patch Element prototypes:", error);
|
|
463
|
-
}
|
|
464
|
-
const proto = \u{275}DominoAdapter.prototype;
|
|
465
|
-
const origGetBaseHref = proto.getBaseHref;
|
|
466
|
-
proto.getBaseHref = function(doc) {
|
|
467
|
-
if (!doc || !doc.head || typeof doc.head.children === "undefined") {
|
|
468
|
-
return "";
|
|
469
|
-
}
|
|
470
|
-
return origGetBaseHref.call(this, doc);
|
|
471
|
-
};
|
|
472
|
-
const origCreateHtmlDocument = proto.createHtmlDocument;
|
|
473
|
-
proto.createHtmlDocument = function() {
|
|
474
|
-
const doc = origCreateHtmlDocument.call(this);
|
|
475
|
-
ensureHead(doc);
|
|
476
|
-
patchElementLayout(doc);
|
|
477
|
-
return doc;
|
|
478
|
-
};
|
|
479
|
-
const origGetDefaultDocument = proto.getDefaultDocument;
|
|
480
|
-
proto.getDefaultDocument = function() {
|
|
481
|
-
const doc = origGetDefaultDocument.call(this);
|
|
482
|
-
ensureHead(doc);
|
|
483
|
-
patchElementLayout(doc);
|
|
484
|
-
return doc;
|
|
485
|
-
};
|
|
486
|
-
return true;
|
|
487
|
-
};
|
|
488
|
-
var init_angularPatch = __esm(() => {
|
|
489
|
-
init_resolveAngularPackage();
|
|
490
|
-
SSR_LAYOUT_RECT = Object.freeze({
|
|
491
|
-
bottom: 0,
|
|
492
|
-
height: 0,
|
|
493
|
-
left: 0,
|
|
494
|
-
right: 0,
|
|
495
|
-
top: 0,
|
|
496
|
-
width: 0,
|
|
497
|
-
x: 0,
|
|
498
|
-
y: 0,
|
|
499
|
-
toJSON() {
|
|
500
|
-
return this;
|
|
501
|
-
}
|
|
502
|
-
});
|
|
503
|
-
});
|
|
504
|
-
|
|
505
|
-
// src/angular/angularDeps.ts
|
|
506
|
-
var initDominoAdapter = (platformServer) => {
|
|
507
|
-
try {
|
|
508
|
-
platformServer.\u{275}DominoAdapter?.makeCurrent?.();
|
|
509
|
-
} catch (err) {
|
|
510
|
-
console.error("Failed to initialize DominoAdapter:", err);
|
|
511
|
-
}
|
|
512
|
-
}, loadAngularDeps = async () => {
|
|
513
|
-
if (!isProductionRuntime()) {
|
|
514
|
-
await import("@angular/compiler");
|
|
515
|
-
}
|
|
516
|
-
const { applyPatches: applyPatches2 } = await Promise.resolve().then(() => (init_angularPatch(), exports_angularPatch));
|
|
517
|
-
await applyPatches2();
|
|
518
|
-
const useBareSpecifiers = !isProductionRuntime();
|
|
519
|
-
const [platformBrowser, platformServer, common, core] = await Promise.all([
|
|
520
|
-
useBareSpecifiers ? import("@angular/platform-browser") : import(resolveAngularRuntimePath("@angular/platform-browser")),
|
|
521
|
-
useBareSpecifiers ? import("@angular/platform-server") : import(resolveAngularRuntimePath("@angular/platform-server")),
|
|
522
|
-
useBareSpecifiers ? import("@angular/common") : import(resolveAngularRuntimePath("@angular/common")),
|
|
523
|
-
useBareSpecifiers ? import("@angular/core") : import(resolveAngularRuntimePath("@angular/core"))
|
|
524
|
-
]);
|
|
525
|
-
if (!isDevelopmentRuntime()) {
|
|
526
|
-
core.enableProdMode();
|
|
527
|
-
}
|
|
528
|
-
initDominoAdapter(platformServer);
|
|
529
|
-
return {
|
|
530
|
-
APP_BASE_HREF: common.APP_BASE_HREF,
|
|
531
|
-
bootstrapApplication: platformBrowser.bootstrapApplication,
|
|
532
|
-
Component: core.Component,
|
|
533
|
-
DomSanitizer: platformBrowser.DomSanitizer,
|
|
534
|
-
ENVIRONMENT_INITIALIZER: core.ENVIRONMENT_INITIALIZER,
|
|
535
|
-
inject: core.inject,
|
|
536
|
-
InjectionToken: core.InjectionToken,
|
|
537
|
-
NgComponentOutlet: common.NgComponentOutlet,
|
|
538
|
-
provideClientHydration: platformBrowser.provideClientHydration,
|
|
539
|
-
provideServerRendering: platformServer.provideServerRendering,
|
|
540
|
-
provideZonelessChangeDetection: core.provideZonelessChangeDetection,
|
|
541
|
-
reflectComponentType: core.reflectComponentType,
|
|
542
|
-
renderApplication: platformServer.renderApplication,
|
|
543
|
-
REQUEST: core.REQUEST,
|
|
544
|
-
REQUEST_CONTEXT: core.REQUEST_CONTEXT,
|
|
545
|
-
RESPONSE_INIT: core.RESPONSE_INIT,
|
|
546
|
-
Sanitizer: core.Sanitizer,
|
|
547
|
-
SecurityContext: core.SecurityContext,
|
|
548
|
-
withHttpTransferCacheOptions: platformBrowser.withHttpTransferCacheOptions
|
|
549
|
-
};
|
|
550
|
-
}, angularDeps = null, getAngularDeps = () => {
|
|
551
|
-
if (!angularDeps) {
|
|
552
|
-
angularDeps = loadAngularDeps();
|
|
553
|
-
}
|
|
554
|
-
return angularDeps;
|
|
555
|
-
};
|
|
556
|
-
var init_angularDeps = __esm(() => {
|
|
557
|
-
init_resolveAngularPackage();
|
|
558
|
-
});
|
|
559
|
-
|
|
560
|
-
// src/utils/registerClientScript.ts
|
|
561
|
-
var scriptRegistry, requestCounter = 0, getRequestId = () => `req_${Date.now()}_${++requestCounter}`, ssrContextGetter = null, getSsrContextId = () => ssrContextGetter?.() || Object.getOwnPropertyDescriptor(globalThis, "__absolutejs_requestId")?.value, registerClientScript = (script, requestId) => {
|
|
562
|
-
const id = requestId || getSsrContextId() || getRequestId();
|
|
563
|
-
if (!scriptRegistry.has(id)) {
|
|
564
|
-
scriptRegistry.set(id, new Set);
|
|
565
|
-
}
|
|
566
|
-
scriptRegistry.get(id)?.add(script);
|
|
567
|
-
return id;
|
|
568
|
-
}, setSsrContextGetter = (getter) => {
|
|
569
|
-
ssrContextGetter = getter;
|
|
570
|
-
}, clearAllClientScripts = () => {
|
|
571
|
-
scriptRegistry.clear();
|
|
572
|
-
}, generateClientScriptCode = (scripts) => {
|
|
573
|
-
if (scripts.length === 0) {
|
|
574
|
-
return "";
|
|
575
|
-
}
|
|
576
|
-
const scriptCode = scripts.map((script, index) => {
|
|
577
|
-
const funcString = script.toString();
|
|
578
|
-
const bodyMatch = funcString.match(/\{([\s\S]*)\}/);
|
|
579
|
-
if (!bodyMatch || !bodyMatch[1]) {
|
|
580
|
-
return "";
|
|
581
|
-
}
|
|
582
|
-
const body = bodyMatch[1].trim();
|
|
583
|
-
return `
|
|
584
|
-
(function() {
|
|
585
|
-
var executed = false;
|
|
586
|
-
function executeScript_${index}() {
|
|
587
|
-
if (executed) return;
|
|
588
|
-
executed = true;
|
|
589
|
-
${body}
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
|
593
|
-
executeScript_${index}();
|
|
594
|
-
} else {
|
|
595
|
-
document.addEventListener('DOMContentLoaded', executeScript_${index});
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
// Watch for hydration-added elements
|
|
599
|
-
var observer = new MutationObserver(function() {
|
|
600
|
-
executeScript_${index}();
|
|
601
|
-
if (executed) observer.disconnect();
|
|
602
|
-
});
|
|
603
|
-
if (!executed) {
|
|
604
|
-
observer.observe(document.body || document.documentElement, { childList: true, subtree: true });
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
// Single fallback timeout
|
|
608
|
-
setTimeout(function() {
|
|
609
|
-
executeScript_${index}();
|
|
610
|
-
observer.disconnect();
|
|
611
|
-
}, 1000);
|
|
612
|
-
})();`;
|
|
613
|
-
}).join(`
|
|
614
|
-
`);
|
|
615
|
-
return `<script>
|
|
616
|
-
(function() {
|
|
617
|
-
${scriptCode}
|
|
618
|
-
})();
|
|
619
|
-
</script>`;
|
|
620
|
-
}, getAndClearClientScripts = (requestId) => {
|
|
621
|
-
const id = requestId || ssrContextGetter?.();
|
|
622
|
-
if (!id)
|
|
623
|
-
return [];
|
|
624
|
-
const scripts = scriptRegistry.get(id);
|
|
625
|
-
if (!scripts) {
|
|
626
|
-
return [];
|
|
627
|
-
}
|
|
628
|
-
const scriptArray = Array.from(scripts);
|
|
629
|
-
scriptRegistry.delete(id);
|
|
630
|
-
return scriptArray;
|
|
631
|
-
};
|
|
632
|
-
var init_registerClientScript = __esm(() => {
|
|
633
|
-
scriptRegistry = new Map;
|
|
634
|
-
if (typeof globalThis !== "undefined") {
|
|
635
|
-
Object.assign(globalThis, { registerClientScript });
|
|
636
|
-
}
|
|
637
|
-
});
|
|
638
|
-
|
|
639
|
-
// src/angular/httpTransferCache.ts
|
|
640
|
-
var ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER = "x-skip-transfer-cache", buildAbsoluteHttpTransferCacheOptions = (options = {}) => {
|
|
641
|
-
const {
|
|
642
|
-
filter: userFilter,
|
|
643
|
-
skipHeader = ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER,
|
|
644
|
-
...angularOptions
|
|
645
|
-
} = options;
|
|
646
|
-
return {
|
|
647
|
-
includePostRequests: false,
|
|
648
|
-
includeRequestsWithAuthHeaders: false,
|
|
649
|
-
...angularOptions,
|
|
650
|
-
filter: (request) => !request.headers.has(skipHeader) && (userFilter?.(request) ?? true)
|
|
651
|
-
};
|
|
652
|
-
};
|
|
653
|
-
|
|
654
|
-
// src/angular/requestProviders.ts
|
|
655
|
-
var buildRequestProviders = (deps, request, requestContext, responseInit) => [
|
|
656
|
-
{ provide: deps.REQUEST, useValue: request ?? null },
|
|
657
|
-
{ provide: deps.REQUEST_CONTEXT, useValue: requestContext ?? null },
|
|
658
|
-
{ provide: deps.RESPONSE_INIT, useValue: responseInit ?? null }
|
|
659
|
-
];
|
|
660
|
-
|
|
661
|
-
// src/angular/ssrRender.ts
|
|
662
|
-
var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
663
|
-
const cacheKey = pagePath.split("?")[0] ?? pagePath;
|
|
664
|
-
routeContextCache.set(cacheKey, data);
|
|
665
|
-
}, getCachedRouteData = (pagePath) => routeContextCache.get(pagePath), selectorCache, buildProviders = (deps, sanitizer, request, requestContext, responseInit, userProviders = []) => [
|
|
666
|
-
deps.provideServerRendering(),
|
|
667
|
-
deps.provideClientHydration(deps.withHttpTransferCacheOptions(buildAbsoluteHttpTransferCacheOptions())),
|
|
668
|
-
deps.provideZonelessChangeDetection(),
|
|
669
|
-
{ provide: deps.APP_BASE_HREF, useValue: "/" },
|
|
670
|
-
{ provide: deps.DomSanitizer, useValue: sanitizer },
|
|
671
|
-
{ provide: deps.Sanitizer, useValue: sanitizer },
|
|
672
|
-
...buildRequestProviders(deps, request, requestContext, responseInit),
|
|
673
|
-
...userProviders
|
|
674
|
-
], resolveSelector = (deps, pagePath, PageComponent) => {
|
|
675
|
-
const cached = selectorCache.get(pagePath);
|
|
676
|
-
if (cached) {
|
|
677
|
-
return cached;
|
|
678
|
-
}
|
|
679
|
-
const selector = deps.reflectComponentType(PageComponent)?.selector ?? "ng-app";
|
|
680
|
-
selectorCache.set(pagePath, selector);
|
|
681
|
-
return selector;
|
|
682
|
-
}, injectBeforeClose = (html, snippet) => {
|
|
683
|
-
if (html.includes("</body>")) {
|
|
684
|
-
return html.replace("</body>", `${snippet}</body>`);
|
|
685
|
-
}
|
|
686
|
-
if (html.includes("</html>")) {
|
|
687
|
-
return html.replace("</html>", `${snippet}</html>`);
|
|
688
|
-
}
|
|
689
|
-
return html + snippet;
|
|
690
|
-
}, injectSsrScripts = (html, requestId, indexPath, requestContext) => {
|
|
691
|
-
let result = html;
|
|
692
|
-
const registeredScripts = getAndClearClientScripts(requestId);
|
|
693
|
-
if (registeredScripts.length > 0) {
|
|
694
|
-
result = injectBeforeClose(result, generateClientScriptCode(registeredScripts));
|
|
695
|
-
}
|
|
696
|
-
if (requestContext !== undefined) {
|
|
697
|
-
result = injectBeforeClose(result, `<script>window.__ABS_ANGULAR_REQUEST_CONTEXT__ = ${JSON.stringify(requestContext)};</script>`);
|
|
698
|
-
}
|
|
699
|
-
if (indexPath) {
|
|
700
|
-
const escapedIndexPath = JSON.stringify(indexPath);
|
|
701
|
-
result = injectBeforeClose(result, `<script>import(${escapedIndexPath});</script>`);
|
|
702
|
-
}
|
|
703
|
-
return result;
|
|
704
|
-
}, renderAngularApp = async (deps, PageComponent, providers, document2, url = "/") => {
|
|
705
|
-
const bootstrap = (context) => deps.bootstrapApplication(PageComponent, { providers }, context);
|
|
706
|
-
return withSuppressedAngularDevLogs(() => deps.renderApplication(bootstrap, {
|
|
707
|
-
document: document2,
|
|
708
|
-
platformProviders: [],
|
|
709
|
-
url
|
|
710
|
-
}));
|
|
711
|
-
}, withSuppressedAngularDevLogs = async (render) => {
|
|
712
|
-
const origLog = console.log;
|
|
713
|
-
console.log = (...args) => {
|
|
714
|
-
if (typeof args[0] === "string" && args[0].includes("development mode")) {
|
|
715
|
-
return;
|
|
716
|
-
}
|
|
717
|
-
origLog.apply(console, args);
|
|
718
|
-
};
|
|
719
|
-
try {
|
|
720
|
-
return await render();
|
|
721
|
-
} finally {
|
|
722
|
-
console.log = origLog;
|
|
723
|
-
}
|
|
724
|
-
};
|
|
725
|
-
var init_ssrRender = __esm(() => {
|
|
726
|
-
init_registerClientScript();
|
|
727
|
-
routeContextCache = new Map;
|
|
728
|
-
selectorCache = new Map;
|
|
729
|
-
});
|
|
730
|
-
|
|
731
|
-
// src/angular/islands.ts
|
|
732
|
-
var exports_islands = {};
|
|
733
|
-
__export(exports_islands, {
|
|
734
|
-
renderAngularIslandToHtml: () => renderAngularIslandToHtml,
|
|
735
|
-
mountAngularIsland: () => mountAngularIsland,
|
|
736
|
-
isAngularComponent: () => isAngularComponent,
|
|
737
|
-
getAngularIslandSelector: () => getAngularIslandSelector
|
|
738
|
-
});
|
|
739
|
-
var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, isAngularComponent = (value) => typeof value === "function", getSelectorFromRenderedIsland = (rootElement) => {
|
|
740
|
-
const firstChild = rootElement.firstElementChild;
|
|
741
|
-
if (!(firstChild instanceof HTMLElement)) {
|
|
742
|
-
return null;
|
|
743
|
-
}
|
|
744
|
-
const selector = firstChild.tagName.toLowerCase();
|
|
745
|
-
return selector.length > 0 ? selector : null;
|
|
746
|
-
}, getClientAngularComponentSelector = (component) => {
|
|
747
|
-
const maybeDef = Reflect.get(component, "\u0275cmp");
|
|
748
|
-
if (typeof maybeDef !== "object" || maybeDef === null) {
|
|
749
|
-
return null;
|
|
750
|
-
}
|
|
751
|
-
const maybeSelectors = Reflect.get(maybeDef, "selectors");
|
|
752
|
-
if (!Array.isArray(maybeSelectors)) {
|
|
753
|
-
return null;
|
|
754
|
-
}
|
|
755
|
-
const [firstSelectorGroup] = maybeSelectors;
|
|
756
|
-
if (!Array.isArray(firstSelectorGroup)) {
|
|
757
|
-
return null;
|
|
758
|
-
}
|
|
759
|
-
const [selector] = firstSelectorGroup;
|
|
760
|
-
return typeof selector === "string" && selector.length > 0 ? selector : null;
|
|
761
|
-
}, createAngularIslandApp = async () => {
|
|
762
|
-
const { EnvironmentInjector, provideZonelessChangeDetection } = await import("@angular/core");
|
|
763
|
-
const { createApplication } = await import("@angular/platform-browser");
|
|
764
|
-
const app = await createApplication({
|
|
765
|
-
providers: [provideZonelessChangeDetection()]
|
|
766
|
-
});
|
|
767
|
-
const environmentInjector = app.injector.get(EnvironmentInjector);
|
|
768
|
-
return { app, environmentInjector };
|
|
769
|
-
}, angularIslandAppPromise = null, getAngularIslandApp = async () => {
|
|
770
|
-
if (!angularIslandAppPromise) {
|
|
771
|
-
angularIslandAppPromise = createAngularIslandApp();
|
|
772
|
-
}
|
|
773
|
-
return angularIslandAppPromise;
|
|
774
|
-
}, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
|
|
775
|
-
const requestId = getSsrContextId();
|
|
776
|
-
if (!requestId) {
|
|
777
|
-
return null;
|
|
778
|
-
}
|
|
779
|
-
const cached = requestRenderCache.get(requestId);
|
|
780
|
-
if (cached) {
|
|
781
|
-
return cached;
|
|
782
|
-
}
|
|
783
|
-
const renderCache = new Map;
|
|
784
|
-
requestRenderCache.set(requestId, renderCache);
|
|
785
|
-
return renderCache;
|
|
786
|
-
}, getAngularIslandWrapperKey = (component, _islandId) => {
|
|
787
|
-
const componentName = typeof component.name === "string" && component.name.length > 0 ? component.name : "AngularIsland";
|
|
788
|
-
return `${componentName}:${angularIslandSelector}`;
|
|
789
|
-
}, getIslandRenderCacheKey = (component, props) => {
|
|
790
|
-
const componentName = typeof component.name === "string" && component.name.length > 0 ? component.name : "AngularIsland";
|
|
791
|
-
return `${componentName}:${JSON.stringify(props)}`;
|
|
792
|
-
}, buildAngularIslandWrapperMetadata = async (component, islandId, wrapperKey) => {
|
|
793
|
-
const deps = await getAngularDeps();
|
|
794
|
-
const { Component, InjectionToken, NgComponentOutlet, inject } = deps;
|
|
795
|
-
const selector = getAngularIslandSelector(islandId);
|
|
796
|
-
const propsToken = new InjectionToken(`${wrapperKey}:props`);
|
|
797
|
-
|
|
798
|
-
class AngularIslandWrapperComponent {
|
|
799
|
-
component = component;
|
|
800
|
-
props = inject(propsToken);
|
|
801
|
-
}
|
|
802
|
-
return {
|
|
803
|
-
deps,
|
|
804
|
-
propsToken,
|
|
805
|
-
selector,
|
|
806
|
-
WrapperComponent: Component({
|
|
807
|
-
imports: [NgComponentOutlet, component],
|
|
808
|
-
selector,
|
|
809
|
-
standalone: true,
|
|
810
|
-
template: '<ng-container *ngComponentOutlet="component; inputs: props"></ng-container>'
|
|
811
|
-
})(AngularIslandWrapperComponent)
|
|
812
|
-
};
|
|
813
|
-
}, createAngularIslandWrapper = async (component, islandId) => {
|
|
814
|
-
const wrapperKey = getAngularIslandWrapperKey(component, islandId);
|
|
815
|
-
const cached = wrapperMetadataCache.get(wrapperKey);
|
|
816
|
-
if (cached) {
|
|
817
|
-
return cached;
|
|
818
|
-
}
|
|
819
|
-
const metadataPromise = buildAngularIslandWrapperMetadata(component, islandId, wrapperKey);
|
|
820
|
-
wrapperMetadataCache.set(wrapperKey, metadataPromise);
|
|
821
|
-
return metadataPromise;
|
|
822
|
-
}, extractAngularIslandRoot = (html, selector) => {
|
|
823
|
-
const openTag = `<${selector}`;
|
|
824
|
-
const start = html.indexOf(openTag);
|
|
825
|
-
if (start < 0) {
|
|
826
|
-
throw new Error(`Could not find Angular island root "${selector}".`);
|
|
827
|
-
}
|
|
828
|
-
const endTag = `</${selector}>`;
|
|
829
|
-
const end = html.indexOf(endTag, start);
|
|
830
|
-
if (end < 0) {
|
|
831
|
-
throw new Error(`Could not close Angular island root "${selector}".`);
|
|
832
|
-
}
|
|
833
|
-
return html.slice(start, end + endTag.length);
|
|
834
|
-
}, mountAngularIsland = async (component, element, props, islandId) => {
|
|
835
|
-
await import("@angular/compiler");
|
|
836
|
-
const { createComponent, inputBinding } = await import("@angular/core");
|
|
837
|
-
const selector = getAngularIslandSelector(islandId);
|
|
838
|
-
const { app, environmentInjector } = await getAngularIslandApp();
|
|
839
|
-
let rootElement = element.querySelector(selector);
|
|
840
|
-
if (!(rootElement instanceof HTMLElement)) {
|
|
841
|
-
element.innerHTML = `<${selector}></${selector}>`;
|
|
842
|
-
rootElement = element.querySelector(selector);
|
|
843
|
-
}
|
|
844
|
-
if (!(rootElement instanceof HTMLElement))
|
|
845
|
-
return app;
|
|
846
|
-
const componentSelector = getClientAngularComponentSelector(component) ?? getSelectorFromRenderedIsland(rootElement);
|
|
847
|
-
if (!componentSelector)
|
|
848
|
-
return app;
|
|
849
|
-
rootElement.innerHTML = `<${componentSelector}></${componentSelector}>`;
|
|
850
|
-
const hostElement = rootElement.querySelector(componentSelector);
|
|
851
|
-
if (!(hostElement instanceof HTMLElement))
|
|
852
|
-
return app;
|
|
853
|
-
const bindings = Object.entries(props).map(([key, value]) => inputBinding(key, () => value));
|
|
854
|
-
const componentRef = createComponent(component, {
|
|
855
|
-
bindings,
|
|
856
|
-
environmentInjector,
|
|
857
|
-
hostElement
|
|
858
|
-
});
|
|
859
|
-
app.attachView(componentRef.hostView);
|
|
860
|
-
componentRef.changeDetectorRef.detectChanges();
|
|
861
|
-
window.__ABS_ANGULAR_ISLAND_APPS__ ??= [];
|
|
862
|
-
window.__ABS_ANGULAR_ISLAND_APPS__.push(app);
|
|
863
|
-
return app;
|
|
864
|
-
}, renderAngularIslandToHtml = async (component, props, islandId) => {
|
|
865
|
-
const requestCache = getRequestRenderCache();
|
|
866
|
-
const renderCacheKey = getIslandRenderCacheKey(component, props);
|
|
867
|
-
const cachedHtml = requestCache?.get(renderCacheKey);
|
|
868
|
-
if (cachedHtml) {
|
|
869
|
-
return cachedHtml;
|
|
870
|
-
}
|
|
871
|
-
const { deps, propsToken, selector, WrapperComponent } = await createAngularIslandWrapper(component, islandId);
|
|
872
|
-
const providers = [
|
|
873
|
-
deps.provideServerRendering(),
|
|
874
|
-
deps.provideZonelessChangeDetection(),
|
|
875
|
-
{ provide: deps.APP_BASE_HREF, useValue: "/" },
|
|
876
|
-
{ provide: propsToken, useValue: props }
|
|
877
|
-
];
|
|
878
|
-
const document2 = `<!DOCTYPE html><html><body><${selector}></${selector}></body></html>`;
|
|
879
|
-
const html = await withSuppressedAngularDevLogs(() => deps.renderApplication((context) => deps.bootstrapApplication(WrapperComponent, { providers }, context), {
|
|
880
|
-
document: document2,
|
|
881
|
-
platformProviders: [],
|
|
882
|
-
url: "/"
|
|
883
|
-
}));
|
|
884
|
-
const islandHtml = extractAngularIslandRoot(html, selector);
|
|
885
|
-
requestCache?.set(renderCacheKey, islandHtml);
|
|
886
|
-
return islandHtml;
|
|
887
|
-
};
|
|
888
|
-
var init_islands2 = __esm(() => {
|
|
889
|
-
init_angularDeps();
|
|
890
|
-
init_ssrRender();
|
|
891
|
-
init_registerClientScript();
|
|
892
|
-
wrapperMetadataCache = new Map;
|
|
893
|
-
requestRenderCache = new Map;
|
|
894
|
-
});
|
|
895
|
-
|
|
896
|
-
// src/client/islandResolver.ts
|
|
897
|
-
var createIslandManifestResolver = (manifest) => {
|
|
898
|
-
const islandManifest = getIslandManifestEntries(manifest);
|
|
899
|
-
return async (framework, component) => {
|
|
900
|
-
const modulePath = islandManifest[framework]?.[component] ?? manifest[getIslandManifestKey(framework, component)];
|
|
901
|
-
if (!modulePath)
|
|
902
|
-
return;
|
|
903
|
-
const loadedModule = await import(modulePath);
|
|
904
|
-
return loadedModule.default;
|
|
905
|
-
};
|
|
906
157
|
};
|
|
158
|
+
var getStreamSwapRuntimeScript = () => `(function(){${stripFunctionWrapper(streamSwapRuntime.toString())}})();`;
|
|
907
159
|
// node_modules/zustand/esm/vanilla.mjs
|
|
908
160
|
var createStoreImpl = (createState) => {
|
|
909
161
|
let state;
|
|
@@ -1016,11 +268,22 @@ var subscribeIslandStore = (store, selector, listener) => {
|
|
|
1016
268
|
listener(nextSelection);
|
|
1017
269
|
});
|
|
1018
270
|
};
|
|
1019
|
-
// src/
|
|
1020
|
-
|
|
271
|
+
// src/core/islands.ts
|
|
272
|
+
var isRecord = (value) => typeof value === "object" && value !== null;
|
|
273
|
+
var isIslandComponentDefinition = (value) => isRecord(value) && ("component" in value) && ("source" in value) && typeof value.source === "string";
|
|
274
|
+
function getIslandComponent(component) {
|
|
275
|
+
if (isIslandComponentDefinition(component)) {
|
|
276
|
+
return component.component;
|
|
277
|
+
}
|
|
278
|
+
return component;
|
|
279
|
+
}
|
|
280
|
+
var parseIslandProps = (rawProps) => {
|
|
281
|
+
if (!rawProps)
|
|
282
|
+
return {};
|
|
283
|
+
return JSON.parse(rawProps);
|
|
284
|
+
};
|
|
1021
285
|
|
|
1022
286
|
// src/client/preserveIslandMarkup.ts
|
|
1023
|
-
init_islandMarkupAttributes();
|
|
1024
287
|
var getSnapshotMap = () => {
|
|
1025
288
|
if (typeof window === "undefined") {
|
|
1026
289
|
return null;
|
|
@@ -1028,22 +291,6 @@ var getSnapshotMap = () => {
|
|
|
1028
291
|
window.__ABS_SERVER_ISLAND_HTML__ ??= new Map;
|
|
1029
292
|
return window.__ABS_SERVER_ISLAND_HTML__;
|
|
1030
293
|
};
|
|
1031
|
-
var getIslandSignature = (props) => {
|
|
1032
|
-
const attributes = getIslandMarkerAttributes(props);
|
|
1033
|
-
return [
|
|
1034
|
-
attributes["data-component"],
|
|
1035
|
-
attributes["data-framework"],
|
|
1036
|
-
attributes["data-hydrate"],
|
|
1037
|
-
attributes["data-props"]
|
|
1038
|
-
].join("::");
|
|
1039
|
-
};
|
|
1040
|
-
var isMatchingIslandElement = (element, props) => {
|
|
1041
|
-
if (!(element instanceof HTMLElement)) {
|
|
1042
|
-
return false;
|
|
1043
|
-
}
|
|
1044
|
-
const attributes = getIslandMarkerAttributes(props);
|
|
1045
|
-
return element.dataset.island === "true" && element.dataset.component === attributes["data-component"] && element.dataset.framework === attributes["data-framework"] && (element.dataset.hydrate ?? "load") === attributes["data-hydrate"] && (element.dataset.props ?? "{}") === attributes["data-props"];
|
|
1046
|
-
};
|
|
1047
294
|
var snapshotIslandElement = (element, snapshotMap) => {
|
|
1048
295
|
const signature = [
|
|
1049
296
|
element.dataset.component,
|
|
@@ -1072,31 +319,6 @@ var initializeIslandMarkupSnapshot = () => {
|
|
|
1072
319
|
snapshotIslandElement(element, snapshotMap);
|
|
1073
320
|
}
|
|
1074
321
|
};
|
|
1075
|
-
var preserveIslandMarkup = (props) => {
|
|
1076
|
-
if (typeof document === "undefined") {
|
|
1077
|
-
return {
|
|
1078
|
-
attributes: getIslandMarkerAttributes(props),
|
|
1079
|
-
innerHTML: ""
|
|
1080
|
-
};
|
|
1081
|
-
}
|
|
1082
|
-
const snapshotMap = getSnapshotMap();
|
|
1083
|
-
const signature = getIslandSignature(props);
|
|
1084
|
-
const snapshotCandidate = snapshotMap?.get(signature)?.[0];
|
|
1085
|
-
if (snapshotCandidate) {
|
|
1086
|
-
return snapshotCandidate;
|
|
1087
|
-
}
|
|
1088
|
-
const liveCandidate = Array.from(document.querySelectorAll('[data-island="true"]')).find((element) => isMatchingIslandElement(element, props));
|
|
1089
|
-
if (!liveCandidate) {
|
|
1090
|
-
return {
|
|
1091
|
-
attributes: getIslandMarkerAttributes(props),
|
|
1092
|
-
innerHTML: ""
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
return {
|
|
1096
|
-
attributes: Object.fromEntries(liveCandidate.getAttributeNames().map((name) => [name, liveCandidate.getAttribute(name) ?? ""])),
|
|
1097
|
-
innerHTML: liveCandidate.innerHTML
|
|
1098
|
-
};
|
|
1099
|
-
};
|
|
1100
322
|
|
|
1101
323
|
// src/client/islandRuntime.ts
|
|
1102
324
|
initializeIslandMarkupSnapshot();
|
|
@@ -1105,46 +327,54 @@ var idleDeadline = {
|
|
|
1105
327
|
timeRemaining: () => 0
|
|
1106
328
|
};
|
|
1107
329
|
var requestIdle = typeof window !== "undefined" && "requestIdleCallback" in window ? window.requestIdleCallback.bind(window) : (callback) => window.setTimeout(() => callback(idleDeadline), 1);
|
|
1108
|
-
var
|
|
330
|
+
var isPropsRecord = (value) => typeof value === "object" && value !== null;
|
|
1109
331
|
var isIslandElement = (value) => value instanceof HTMLElement && value.dataset.island === "true";
|
|
1110
332
|
var observedRoots = new WeakSet;
|
|
1111
333
|
var hydratingIslands = new WeakSet;
|
|
334
|
+
var hydratePreservingBrowserTranslation = async (element, hydrate) => {
|
|
335
|
+
const restoreTranslation = prepareBrowserTranslationHydration(element);
|
|
336
|
+
try {
|
|
337
|
+
await hydrate();
|
|
338
|
+
} finally {
|
|
339
|
+
restoreTranslation();
|
|
340
|
+
}
|
|
341
|
+
};
|
|
1112
342
|
var hydrateByFramework = async (registry, framework, componentName, element, props, resolveComponent) => {
|
|
1113
|
-
const propsRecord =
|
|
343
|
+
const propsRecord = isPropsRecord(props) ? props : undefined;
|
|
1114
344
|
if (framework === "react") {
|
|
1115
|
-
const { hydrateReactIsland
|
|
345
|
+
const { hydrateReactIsland, isReactComponent } = await import("./chunks/react-pdg4325x.js");
|
|
1116
346
|
const resolvedComponent = await resolveComponent?.(framework, componentName) ?? getIslandComponent(registry.react?.[componentName]);
|
|
1117
|
-
if (!
|
|
347
|
+
if (!isReactComponent(resolvedComponent))
|
|
1118
348
|
return;
|
|
1119
|
-
|
|
349
|
+
hydrateReactIsland(resolvedComponent, element, propsRecord);
|
|
1120
350
|
element.dataset.hydrated = "true";
|
|
1121
351
|
return;
|
|
1122
352
|
}
|
|
1123
353
|
if (framework === "svelte") {
|
|
1124
|
-
const { hydrateSvelteIsland
|
|
354
|
+
const { hydrateSvelteIsland, isSvelteComponent } = await import("./chunks/svelte-s0c964kb.js");
|
|
1125
355
|
const resolvedComponent = await resolveComponent?.(framework, componentName) ?? getIslandComponent(registry.svelte?.[componentName]);
|
|
1126
|
-
if (!
|
|
356
|
+
if (!isSvelteComponent(resolvedComponent))
|
|
1127
357
|
return;
|
|
1128
|
-
|
|
358
|
+
await hydratePreservingBrowserTranslation(element, () => hydrateSvelteIsland(resolvedComponent, element, propsRecord));
|
|
1129
359
|
element.dataset.hydrated = "true";
|
|
1130
360
|
return;
|
|
1131
361
|
}
|
|
1132
362
|
if (framework === "vue") {
|
|
1133
|
-
const { hydrateVueIsland
|
|
363
|
+
const { hydrateVueIsland, isVueComponent } = await import("./chunks/vue-rdskrnyg.js");
|
|
1134
364
|
const resolvedComponent = await resolveComponent?.(framework, componentName) ?? getIslandComponent(registry.vue?.[componentName]);
|
|
1135
|
-
if (!
|
|
365
|
+
if (!isVueComponent(resolvedComponent))
|
|
1136
366
|
return;
|
|
1137
|
-
|
|
367
|
+
await hydratePreservingBrowserTranslation(element, () => hydrateVueIsland(resolvedComponent, element, propsRecord));
|
|
1138
368
|
element.dataset.hydrated = "true";
|
|
1139
369
|
return;
|
|
1140
370
|
}
|
|
1141
371
|
if (framework === "angular") {
|
|
1142
|
-
const { mountAngularIsland
|
|
372
|
+
const { mountAngularIsland, isAngularComponent } = await import("./chunks/islands-xj2n8nwf.js");
|
|
1143
373
|
const resolvedComponent = await resolveComponent?.(framework, componentName) ?? getIslandComponent(registry.angular?.[componentName]);
|
|
1144
374
|
const { islandId } = element.dataset;
|
|
1145
|
-
if (!
|
|
375
|
+
if (!isAngularComponent(resolvedComponent) || !islandId)
|
|
1146
376
|
return;
|
|
1147
|
-
await
|
|
377
|
+
await hydratePreservingBrowserTranslation(element, () => mountAngularIsland(resolvedComponent, element, propsRecord ?? {}, islandId));
|
|
1148
378
|
element.dataset.hydrated = "true";
|
|
1149
379
|
}
|
|
1150
380
|
};
|
|
@@ -1235,15 +465,17 @@ var startIslands = ({
|
|
|
1235
465
|
});
|
|
1236
466
|
};
|
|
1237
467
|
export {
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
readIslandStore,
|
|
1241
|
-
initializeIslandStores,
|
|
1242
|
-
getStreamSwapRuntimeScript,
|
|
1243
|
-
getIslandStoreServerSnapshot,
|
|
468
|
+
captureSsrTextBaselines,
|
|
469
|
+
createIslandManifestResolver,
|
|
1244
470
|
createIslandStore,
|
|
1245
|
-
|
|
471
|
+
getIslandStoreServerSnapshot,
|
|
472
|
+
getStreamSwapRuntimeScript,
|
|
473
|
+
initializeIslandStores,
|
|
474
|
+
prepareBrowserTranslationHydration,
|
|
475
|
+
readIslandStore,
|
|
476
|
+
startIslands,
|
|
477
|
+
subscribeIslandStore
|
|
1246
478
|
};
|
|
1247
479
|
|
|
1248
|
-
//# debugId=
|
|
480
|
+
//# debugId=24D0394AB472467064756E2164756E21
|
|
1249
481
|
//# sourceMappingURL=index.js.map
|