@absolutejs/absolute 0.19.0-beta.315 → 0.19.0-beta.317
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/{Island-p1b3nrte.svelte → Island-c38gqq3d.svelte} +3 -3
- package/dist/angular/browser.js +909 -40
- package/dist/angular/browser.js.map +19 -5
- package/dist/angular/index.js +10 -1
- package/dist/angular/index.js.map +6 -5
- package/dist/react/browser.js +30107 -8
- package/dist/react/browser.js.map +18 -3
- package/dist/react/index.js +22 -1
- package/dist/react/index.js.map +6 -5
- package/dist/src/angular/Island.browser.d.ts +4 -4
- package/dist/src/angular/Island.d.ts +4 -4
- package/dist/src/angular/browser.d.ts +1 -0
- package/dist/src/angular/createIsland.d.ts +1 -1
- package/dist/src/angular/index.d.ts +1 -0
- package/dist/src/react/Island.d.ts +2 -2
- package/dist/src/react/browser.d.ts +1 -0
- package/dist/src/react/createIsland.d.ts +1 -1
- package/dist/src/react/index.d.ts +1 -0
- package/dist/src/svelte/browser.d.ts +1 -0
- package/dist/src/svelte/createIsland.d.ts +1 -1
- package/dist/src/svelte/index.d.ts +1 -0
- package/dist/src/vue/browser.d.ts +1 -0
- package/dist/src/vue/createIsland.d.ts +1 -1
- package/dist/src/vue/index.d.ts +1 -0
- package/dist/svelte/browser.js +30096 -12
- package/dist/svelte/browser.js.map +19 -4
- package/dist/svelte/components/Island.svelte +3 -3
- package/dist/svelte/components/Island.svelte.d.ts +2 -2
- package/dist/svelte/index.js +28 -22
- package/dist/svelte/index.js.map +6 -5
- package/dist/vue/browser.js +30127 -7
- package/dist/vue/browser.js.map +19 -4
- package/dist/vue/index.js +43 -1
- package/dist/vue/index.js.map +6 -5
- package/package.json +1 -1
package/dist/angular/browser.js
CHANGED
|
@@ -29356,6 +29356,869 @@ var init_islandMarkupAttributes = __esm(() => {
|
|
|
29356
29356
|
init_islands();
|
|
29357
29357
|
});
|
|
29358
29358
|
|
|
29359
|
+
// src/angular/injectorPatch.ts
|
|
29360
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
29361
|
+
import { dirname, join, resolve } from "path";
|
|
29362
|
+
var applyInjectorPatch = (chunkPath, content) => {
|
|
29363
|
+
if (content.includes('Symbol.for("angular.currentInjector")')) {
|
|
29364
|
+
return;
|
|
29365
|
+
}
|
|
29366
|
+
const original = [
|
|
29367
|
+
"let _currentInjector = undefined;",
|
|
29368
|
+
"function getCurrentInjector() {",
|
|
29369
|
+
" return _currentInjector;",
|
|
29370
|
+
"}",
|
|
29371
|
+
"function setCurrentInjector(injector) {",
|
|
29372
|
+
" const former = _currentInjector;",
|
|
29373
|
+
" _currentInjector = injector;",
|
|
29374
|
+
" return former;",
|
|
29375
|
+
"}"
|
|
29376
|
+
].join(`
|
|
29377
|
+
`);
|
|
29378
|
+
const replacement = [
|
|
29379
|
+
'const _injSym = Symbol.for("angular.currentInjector");',
|
|
29380
|
+
"if (!globalThis[_injSym]) globalThis[_injSym] = { v: undefined };",
|
|
29381
|
+
"function getCurrentInjector() {",
|
|
29382
|
+
" return globalThis[_injSym].v;",
|
|
29383
|
+
"}",
|
|
29384
|
+
"function setCurrentInjector(injector) {",
|
|
29385
|
+
" const former = globalThis[_injSym].v;",
|
|
29386
|
+
" globalThis[_injSym].v = injector;",
|
|
29387
|
+
" return former;",
|
|
29388
|
+
"}"
|
|
29389
|
+
].join(`
|
|
29390
|
+
`);
|
|
29391
|
+
const patched = content.replace(original, replacement);
|
|
29392
|
+
if (patched === content) {
|
|
29393
|
+
return;
|
|
29394
|
+
}
|
|
29395
|
+
writeFileSync(chunkPath, patched, "utf-8");
|
|
29396
|
+
}, resolveAngularCoreDir = () => {
|
|
29397
|
+
const fromProject = resolve(process.cwd(), "node_modules/@angular/core");
|
|
29398
|
+
if (existsSync(join(fromProject, "package.json"))) {
|
|
29399
|
+
return fromProject;
|
|
29400
|
+
}
|
|
29401
|
+
return dirname(__require.resolve("@angular/core/package.json"));
|
|
29402
|
+
}, patchAngularInjectorSingleton = () => {
|
|
29403
|
+
try {
|
|
29404
|
+
const coreDir = resolveAngularCoreDir();
|
|
29405
|
+
const chunkPath = join(coreDir, "fesm2022", "_not_found-chunk.mjs");
|
|
29406
|
+
const content = readFileSync(chunkPath, "utf-8");
|
|
29407
|
+
applyInjectorPatch(chunkPath, content);
|
|
29408
|
+
} catch {}
|
|
29409
|
+
};
|
|
29410
|
+
var init_injectorPatch = __esm(() => {
|
|
29411
|
+
patchAngularInjectorSingleton();
|
|
29412
|
+
});
|
|
29413
|
+
|
|
29414
|
+
// src/angular/resolveAngularPackage.ts
|
|
29415
|
+
import { existsSync as existsSync2 } from "fs";
|
|
29416
|
+
import { resolve as resolve2 } from "path";
|
|
29417
|
+
var resolveAngularPackage = (specifier) => {
|
|
29418
|
+
const fromProject = resolve2(process.cwd(), "node_modules", specifier);
|
|
29419
|
+
if (existsSync2(fromProject)) {
|
|
29420
|
+
return fromProject;
|
|
29421
|
+
}
|
|
29422
|
+
return specifier;
|
|
29423
|
+
};
|
|
29424
|
+
var init_resolveAngularPackage = () => {};
|
|
29425
|
+
|
|
29426
|
+
// src/angular/angularPatch.ts
|
|
29427
|
+
var exports_angularPatch = {};
|
|
29428
|
+
__export(exports_angularPatch, {
|
|
29429
|
+
applyPatches: () => applyPatches
|
|
29430
|
+
});
|
|
29431
|
+
var ensureHead = (doc) => {
|
|
29432
|
+
if (!doc || doc.head || !doc.documentElement) {
|
|
29433
|
+
return;
|
|
29434
|
+
}
|
|
29435
|
+
const head = doc.createElement("head");
|
|
29436
|
+
doc.documentElement.insertBefore(head, doc.documentElement.firstChild);
|
|
29437
|
+
}, applyPatches = async () => {
|
|
29438
|
+
const { \u{275}DominoAdapter } = await import(resolveAngularPackage("@angular/platform-server"));
|
|
29439
|
+
if (!\u{275}DominoAdapter?.prototype) {
|
|
29440
|
+
console.warn("[Angular Patch] \u0275DominoAdapter not found, skipping patches");
|
|
29441
|
+
return false;
|
|
29442
|
+
}
|
|
29443
|
+
const proto = \u{275}DominoAdapter.prototype;
|
|
29444
|
+
const origGetBaseHref = proto.getBaseHref;
|
|
29445
|
+
proto.getBaseHref = function(doc) {
|
|
29446
|
+
if (!doc || !doc.head || typeof doc.head.children === "undefined") {
|
|
29447
|
+
return "";
|
|
29448
|
+
}
|
|
29449
|
+
return origGetBaseHref.call(this, doc);
|
|
29450
|
+
};
|
|
29451
|
+
const origCreateHtmlDocument = proto.createHtmlDocument;
|
|
29452
|
+
proto.createHtmlDocument = function() {
|
|
29453
|
+
const doc = origCreateHtmlDocument.call(this);
|
|
29454
|
+
ensureHead(doc);
|
|
29455
|
+
return doc;
|
|
29456
|
+
};
|
|
29457
|
+
const origGetDefaultDocument = proto.getDefaultDocument;
|
|
29458
|
+
proto.getDefaultDocument = function() {
|
|
29459
|
+
const doc = origGetDefaultDocument.call(this);
|
|
29460
|
+
ensureHead(doc);
|
|
29461
|
+
return doc;
|
|
29462
|
+
};
|
|
29463
|
+
return true;
|
|
29464
|
+
};
|
|
29465
|
+
var init_angularPatch = __esm(() => {
|
|
29466
|
+
init_resolveAngularPackage();
|
|
29467
|
+
});
|
|
29468
|
+
|
|
29469
|
+
// src/angular/angularDeps.ts
|
|
29470
|
+
var initDominoAdapter = (platformServer) => {
|
|
29471
|
+
try {
|
|
29472
|
+
const DominoAdapter = platformServer.\u{275}DominoAdapter;
|
|
29473
|
+
DominoAdapter?.makeCurrent?.();
|
|
29474
|
+
} catch (err) {
|
|
29475
|
+
console.error("Failed to initialize DominoAdapter:", err);
|
|
29476
|
+
}
|
|
29477
|
+
}, loadAngularDeps = async () => {
|
|
29478
|
+
patchAngularInjectorSingleton();
|
|
29479
|
+
await import(resolveAngularPackage("@angular/compiler"));
|
|
29480
|
+
const { applyPatches: applyPatches2 } = await Promise.resolve().then(() => (init_angularPatch(), exports_angularPatch));
|
|
29481
|
+
await applyPatches2();
|
|
29482
|
+
const [platformBrowser, platformServer, common, core2] = await Promise.all([
|
|
29483
|
+
import(resolveAngularPackage("@angular/platform-browser")),
|
|
29484
|
+
import(resolveAngularPackage("@angular/platform-server")),
|
|
29485
|
+
import(resolveAngularPackage("@angular/common")),
|
|
29486
|
+
import(resolveAngularPackage("@angular/core"))
|
|
29487
|
+
]);
|
|
29488
|
+
if (false) {}
|
|
29489
|
+
initDominoAdapter(platformServer);
|
|
29490
|
+
return {
|
|
29491
|
+
APP_BASE_HREF: common.APP_BASE_HREF,
|
|
29492
|
+
bootstrapApplication: platformBrowser.bootstrapApplication,
|
|
29493
|
+
DomSanitizer: platformBrowser.DomSanitizer,
|
|
29494
|
+
provideClientHydration: platformBrowser.provideClientHydration,
|
|
29495
|
+
provideServerRendering: platformServer.provideServerRendering,
|
|
29496
|
+
provideZonelessChangeDetection: core2.provideZonelessChangeDetection,
|
|
29497
|
+
reflectComponentType: core2.reflectComponentType,
|
|
29498
|
+
renderApplication: platformServer.renderApplication,
|
|
29499
|
+
Sanitizer: core2.Sanitizer,
|
|
29500
|
+
SecurityContext: core2.SecurityContext
|
|
29501
|
+
};
|
|
29502
|
+
}, angularDeps = null, getAngularDeps = () => {
|
|
29503
|
+
if (!angularDeps) {
|
|
29504
|
+
angularDeps = loadAngularDeps();
|
|
29505
|
+
}
|
|
29506
|
+
return angularDeps;
|
|
29507
|
+
};
|
|
29508
|
+
var init_angularDeps = __esm(() => {
|
|
29509
|
+
init_injectorPatch();
|
|
29510
|
+
init_resolveAngularPackage();
|
|
29511
|
+
});
|
|
29512
|
+
|
|
29513
|
+
// src/utils/stringModifiers.ts
|
|
29514
|
+
var normalizeSlug = (str) => str.trim().replace(/\s+/g, "-").replace(/[^A-Za-z0-9\-_]+/g, "").replace(/[-_]{2,}/g, "-"), toKebab = (str) => normalizeSlug(str).replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), toPascal = (str) => {
|
|
29515
|
+
if (!str.includes("-") && !str.includes("_")) {
|
|
29516
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
29517
|
+
}
|
|
29518
|
+
return normalizeSlug(str).split(/[-_]/).filter(Boolean).map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()).join("");
|
|
29519
|
+
}, toScreamingSnake = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toUpperCase();
|
|
29520
|
+
|
|
29521
|
+
// src/utils/registerClientScript.ts
|
|
29522
|
+
var scriptRegistry, requestCounter = 0, getRequestId = () => `req_${Date.now()}_${++requestCounter}`, ssrContextGetter = null, getSsrContextId = () => ssrContextGetter?.() || Object.getOwnPropertyDescriptor(globalThis, "__absolutejs_requestId")?.value, registerClientScript = (script, requestId) => {
|
|
29523
|
+
const id = requestId || getSsrContextId() || getRequestId();
|
|
29524
|
+
if (!scriptRegistry.has(id)) {
|
|
29525
|
+
scriptRegistry.set(id, new Set);
|
|
29526
|
+
}
|
|
29527
|
+
scriptRegistry.get(id)?.add(script);
|
|
29528
|
+
return id;
|
|
29529
|
+
}, setSsrContextGetter = (getter) => {
|
|
29530
|
+
ssrContextGetter = getter;
|
|
29531
|
+
}, clearAllClientScripts = () => {
|
|
29532
|
+
scriptRegistry.clear();
|
|
29533
|
+
}, generateClientScriptCode = (scripts) => {
|
|
29534
|
+
if (scripts.length === 0) {
|
|
29535
|
+
return "";
|
|
29536
|
+
}
|
|
29537
|
+
const scriptCode = scripts.map((script, index) => {
|
|
29538
|
+
const funcString = script.toString();
|
|
29539
|
+
const bodyMatch = funcString.match(/\{([\s\S]*)\}/);
|
|
29540
|
+
if (!bodyMatch || !bodyMatch[1]) {
|
|
29541
|
+
return "";
|
|
29542
|
+
}
|
|
29543
|
+
const body = bodyMatch[1].trim();
|
|
29544
|
+
return `
|
|
29545
|
+
(function() {
|
|
29546
|
+
var executed = false;
|
|
29547
|
+
function executeScript_${index}() {
|
|
29548
|
+
if (executed) return;
|
|
29549
|
+
executed = true;
|
|
29550
|
+
${body}
|
|
29551
|
+
}
|
|
29552
|
+
|
|
29553
|
+
if (document.readyState === 'complete' || document.readyState === 'interactive') {
|
|
29554
|
+
executeScript_${index}();
|
|
29555
|
+
} else {
|
|
29556
|
+
document.addEventListener('DOMContentLoaded', executeScript_${index});
|
|
29557
|
+
}
|
|
29558
|
+
|
|
29559
|
+
// Watch for hydration-added elements
|
|
29560
|
+
var observer = new MutationObserver(function() {
|
|
29561
|
+
executeScript_${index}();
|
|
29562
|
+
if (executed) observer.disconnect();
|
|
29563
|
+
});
|
|
29564
|
+
if (!executed) {
|
|
29565
|
+
observer.observe(document.body || document.documentElement, { childList: true, subtree: true });
|
|
29566
|
+
}
|
|
29567
|
+
|
|
29568
|
+
// Single fallback timeout
|
|
29569
|
+
setTimeout(function() {
|
|
29570
|
+
executeScript_${index}();
|
|
29571
|
+
observer.disconnect();
|
|
29572
|
+
}, 1000);
|
|
29573
|
+
})();`;
|
|
29574
|
+
}).join(`
|
|
29575
|
+
`);
|
|
29576
|
+
return `<script>
|
|
29577
|
+
(function() {
|
|
29578
|
+
${scriptCode}
|
|
29579
|
+
})();
|
|
29580
|
+
</script>`;
|
|
29581
|
+
}, getAndClearClientScripts = (requestId) => {
|
|
29582
|
+
const id = requestId || ssrContextGetter?.();
|
|
29583
|
+
if (!id)
|
|
29584
|
+
return [];
|
|
29585
|
+
const scripts = scriptRegistry.get(id);
|
|
29586
|
+
if (!scripts) {
|
|
29587
|
+
return [];
|
|
29588
|
+
}
|
|
29589
|
+
const scriptArray = Array.from(scripts);
|
|
29590
|
+
scriptRegistry.delete(id);
|
|
29591
|
+
return scriptArray;
|
|
29592
|
+
};
|
|
29593
|
+
var init_registerClientScript = __esm(() => {
|
|
29594
|
+
scriptRegistry = new Map;
|
|
29595
|
+
if (typeof globalThis !== "undefined") {
|
|
29596
|
+
Object.assign(globalThis, { registerClientScript });
|
|
29597
|
+
}
|
|
29598
|
+
});
|
|
29599
|
+
|
|
29600
|
+
// src/angular/ssrRender.ts
|
|
29601
|
+
var routePropsCache, cacheRouteData = (pagePath, data) => {
|
|
29602
|
+
const cacheKey = pagePath.split("?")[0] ?? pagePath;
|
|
29603
|
+
routePropsCache.set(cacheKey, data);
|
|
29604
|
+
}, getCachedRouteData = (pagePath) => routePropsCache.get(pagePath), selectorCache, buildDeps = (ssrResult, baseDeps) => {
|
|
29605
|
+
if (!ssrResult?.core) {
|
|
29606
|
+
return baseDeps;
|
|
29607
|
+
}
|
|
29608
|
+
const { common, core: core2, platformBrowser, platformServer } = ssrResult;
|
|
29609
|
+
return {
|
|
29610
|
+
APP_BASE_HREF: common?.APP_BASE_HREF ?? baseDeps.APP_BASE_HREF,
|
|
29611
|
+
bootstrapApplication: platformBrowser?.bootstrapApplication ?? baseDeps.bootstrapApplication,
|
|
29612
|
+
DomSanitizer: platformBrowser?.DomSanitizer ?? baseDeps.DomSanitizer,
|
|
29613
|
+
provideClientHydration: platformBrowser?.provideClientHydration ?? baseDeps.provideClientHydration,
|
|
29614
|
+
provideServerRendering: platformServer?.provideServerRendering ?? baseDeps.provideServerRendering,
|
|
29615
|
+
provideZonelessChangeDetection: core2.provideZonelessChangeDetection,
|
|
29616
|
+
reflectComponentType: core2.reflectComponentType,
|
|
29617
|
+
renderApplication: platformServer?.renderApplication ?? baseDeps.renderApplication,
|
|
29618
|
+
Sanitizer: core2.Sanitizer,
|
|
29619
|
+
SecurityContext: core2.SecurityContext
|
|
29620
|
+
};
|
|
29621
|
+
}, buildProviders = (deps, sanitizer, maybeProps, tokenMap) => {
|
|
29622
|
+
const providers = [
|
|
29623
|
+
deps.provideServerRendering(),
|
|
29624
|
+
deps.provideClientHydration(),
|
|
29625
|
+
deps.provideZonelessChangeDetection(),
|
|
29626
|
+
{ provide: deps.APP_BASE_HREF, useValue: "/" },
|
|
29627
|
+
{
|
|
29628
|
+
provide: deps.DomSanitizer,
|
|
29629
|
+
useValue: sanitizer
|
|
29630
|
+
},
|
|
29631
|
+
{ provide: deps.Sanitizer, useValue: sanitizer }
|
|
29632
|
+
];
|
|
29633
|
+
if (!maybeProps) {
|
|
29634
|
+
return providers;
|
|
29635
|
+
}
|
|
29636
|
+
const propProviders = Object.entries(maybeProps).map(([propName, propValue]) => ({
|
|
29637
|
+
token: tokenMap.get(toScreamingSnake(propName)),
|
|
29638
|
+
value: propValue
|
|
29639
|
+
})).filter((entry) => entry.token).map((entry) => ({ provide: entry.token, useValue: entry.value }));
|
|
29640
|
+
return [...providers, ...propProviders];
|
|
29641
|
+
}, clearSelectorCache = () => selectorCache.clear(), isInjectionToken = (value) => {
|
|
29642
|
+
if (!value || typeof value !== "object") {
|
|
29643
|
+
return false;
|
|
29644
|
+
}
|
|
29645
|
+
return "ngMetadataName" in value && value.ngMetadataName === "InjectionToken";
|
|
29646
|
+
}, discoverTokens = (pageModule) => new Map(Object.entries(pageModule).filter(([, value]) => isInjectionToken(value))), loadSsrDeps = async (pagePath) => {
|
|
29647
|
+
const ssrDepsPath = (pagePath.split("?")[0] ?? pagePath).replace(/\.js$/, ".ssr-deps.js");
|
|
29648
|
+
try {
|
|
29649
|
+
const ssrDeps = await import(ssrDepsPath);
|
|
29650
|
+
const result = {
|
|
29651
|
+
common: ssrDeps.__angularCommon,
|
|
29652
|
+
core: ssrDeps.__angularCore,
|
|
29653
|
+
platformBrowser: ssrDeps.__angularPlatformBrowser,
|
|
29654
|
+
platformServer: ssrDeps.__angularPlatformServer
|
|
29655
|
+
};
|
|
29656
|
+
return result;
|
|
29657
|
+
} catch {
|
|
29658
|
+
return null;
|
|
29659
|
+
}
|
|
29660
|
+
}, resolveSelector = (deps, pagePath, PageComponent) => {
|
|
29661
|
+
const cached = selectorCache.get(pagePath);
|
|
29662
|
+
if (cached) {
|
|
29663
|
+
return cached;
|
|
29664
|
+
}
|
|
29665
|
+
const selector = deps.reflectComponentType(PageComponent)?.selector ?? "ng-app";
|
|
29666
|
+
selectorCache.set(pagePath, selector);
|
|
29667
|
+
return selector;
|
|
29668
|
+
}, injectBeforeClose = (html, snippet) => {
|
|
29669
|
+
if (html.includes("</body>")) {
|
|
29670
|
+
return html.replace("</body>", `${snippet}</body>`);
|
|
29671
|
+
}
|
|
29672
|
+
if (html.includes("</html>")) {
|
|
29673
|
+
return html.replace("</html>", `${snippet}</html>`);
|
|
29674
|
+
}
|
|
29675
|
+
return html + snippet;
|
|
29676
|
+
}, injectSsrScripts = (html, requestId, indexPath, props) => {
|
|
29677
|
+
let result = html;
|
|
29678
|
+
const registeredScripts = getAndClearClientScripts(requestId);
|
|
29679
|
+
if (registeredScripts.length > 0) {
|
|
29680
|
+
result = injectBeforeClose(result, generateClientScriptCode(registeredScripts));
|
|
29681
|
+
}
|
|
29682
|
+
if (props) {
|
|
29683
|
+
result = injectBeforeClose(result, `<script>window.__ABS_ANGULAR_PAGE_PROPS__ = ${JSON.stringify(props)};</script>`);
|
|
29684
|
+
}
|
|
29685
|
+
if (indexPath) {
|
|
29686
|
+
result = injectBeforeClose(result, `<script type="module" src="${indexPath}"></script>`);
|
|
29687
|
+
}
|
|
29688
|
+
return result;
|
|
29689
|
+
}, withSuppressedAngularDevLogs = async (render) => {
|
|
29690
|
+
const origLog = console.log;
|
|
29691
|
+
console.log = (...args) => {
|
|
29692
|
+
if (typeof args[0] === "string" && args[0].includes("development mode")) {
|
|
29693
|
+
return;
|
|
29694
|
+
}
|
|
29695
|
+
origLog.apply(console, args);
|
|
29696
|
+
};
|
|
29697
|
+
try {
|
|
29698
|
+
return await render();
|
|
29699
|
+
} finally {
|
|
29700
|
+
console.log = origLog;
|
|
29701
|
+
}
|
|
29702
|
+
}, renderAngularApp = async (deps, PageComponent, providers, document) => {
|
|
29703
|
+
const bootstrap = (context) => deps.bootstrapApplication(PageComponent, { providers }, context);
|
|
29704
|
+
return withSuppressedAngularDevLogs(() => deps.renderApplication(bootstrap, {
|
|
29705
|
+
document,
|
|
29706
|
+
platformProviders: [],
|
|
29707
|
+
url: "/"
|
|
29708
|
+
}));
|
|
29709
|
+
};
|
|
29710
|
+
var init_ssrRender = __esm(() => {
|
|
29711
|
+
init_registerClientScript();
|
|
29712
|
+
routePropsCache = new Map;
|
|
29713
|
+
selectorCache = new Map;
|
|
29714
|
+
});
|
|
29715
|
+
|
|
29716
|
+
// src/angular/islands.ts
|
|
29717
|
+
var angularIslandSelector = "abs-angular-island", getAngularIslandSelector = (_islandId) => angularIslandSelector, getSelectorFromRenderedIsland = (rootElement) => {
|
|
29718
|
+
const firstChild = rootElement.firstElementChild;
|
|
29719
|
+
if (!(firstChild instanceof HTMLElement)) {
|
|
29720
|
+
return null;
|
|
29721
|
+
}
|
|
29722
|
+
const selector = firstChild.tagName.toLowerCase();
|
|
29723
|
+
return selector.length > 0 ? selector : null;
|
|
29724
|
+
}, getClientAngularComponentSelector = (component) => {
|
|
29725
|
+
const maybeDef = Reflect.get(component, "\u0275cmp");
|
|
29726
|
+
if (typeof maybeDef !== "object" || maybeDef === null) {
|
|
29727
|
+
return null;
|
|
29728
|
+
}
|
|
29729
|
+
const maybeSelectors = Reflect.get(maybeDef, "selectors");
|
|
29730
|
+
if (!Array.isArray(maybeSelectors)) {
|
|
29731
|
+
return null;
|
|
29732
|
+
}
|
|
29733
|
+
const firstSelectorGroup = maybeSelectors[0];
|
|
29734
|
+
if (!Array.isArray(firstSelectorGroup)) {
|
|
29735
|
+
return null;
|
|
29736
|
+
}
|
|
29737
|
+
const selector = firstSelectorGroup[0];
|
|
29738
|
+
return typeof selector === "string" && selector.length > 0 ? selector : null;
|
|
29739
|
+
}, angularIslandAppPromise = null, getAngularIslandApp = async () => {
|
|
29740
|
+
if (!angularIslandAppPromise) {
|
|
29741
|
+
angularIslandAppPromise = (async () => {
|
|
29742
|
+
const { EnvironmentInjector, provideZonelessChangeDetection } = await import("@angular/core");
|
|
29743
|
+
const { createApplication } = await import("@angular/platform-browser");
|
|
29744
|
+
const app = await createApplication({
|
|
29745
|
+
providers: [provideZonelessChangeDetection()]
|
|
29746
|
+
});
|
|
29747
|
+
const environmentInjector = app.injector.get(EnvironmentInjector);
|
|
29748
|
+
return {
|
|
29749
|
+
app,
|
|
29750
|
+
environmentInjector
|
|
29751
|
+
};
|
|
29752
|
+
})();
|
|
29753
|
+
}
|
|
29754
|
+
return angularIslandAppPromise;
|
|
29755
|
+
}, wrapperMetadataCache, requestRenderCache, getRequestRenderCache = () => {
|
|
29756
|
+
const requestId = getSsrContextId();
|
|
29757
|
+
if (!requestId) {
|
|
29758
|
+
return null;
|
|
29759
|
+
}
|
|
29760
|
+
const cached = requestRenderCache.get(requestId);
|
|
29761
|
+
if (cached) {
|
|
29762
|
+
return cached;
|
|
29763
|
+
}
|
|
29764
|
+
const renderCache = new Map;
|
|
29765
|
+
requestRenderCache.set(requestId, renderCache);
|
|
29766
|
+
return renderCache;
|
|
29767
|
+
}, getAngularIslandWrapperKey = (component, _islandId) => {
|
|
29768
|
+
const componentName = typeof component.name === "string" && component.name.length > 0 ? component.name : "AngularIsland";
|
|
29769
|
+
return `${componentName}:${angularIslandSelector}`;
|
|
29770
|
+
}, getIslandRenderCacheKey = (component, props) => {
|
|
29771
|
+
const componentName = typeof component.name === "string" && component.name.length > 0 ? component.name : "AngularIsland";
|
|
29772
|
+
return `${componentName}:${JSON.stringify(props)}`;
|
|
29773
|
+
}, createAngularIslandWrapper = async (component, islandId) => {
|
|
29774
|
+
const wrapperKey = getAngularIslandWrapperKey(component, islandId);
|
|
29775
|
+
const cached = wrapperMetadataCache.get(wrapperKey);
|
|
29776
|
+
if (cached) {
|
|
29777
|
+
return cached;
|
|
29778
|
+
}
|
|
29779
|
+
const metadataPromise = (async () => {
|
|
29780
|
+
const { Component: Component4, InjectionToken, inject } = await import("@angular/core");
|
|
29781
|
+
const { NgComponentOutlet } = await import("@angular/common");
|
|
29782
|
+
const deps = await getAngularDeps();
|
|
29783
|
+
const selector = getAngularIslandSelector(islandId);
|
|
29784
|
+
const propsToken = new InjectionToken(`${wrapperKey}:props`);
|
|
29785
|
+
|
|
29786
|
+
class AngularIslandWrapperComponent {
|
|
29787
|
+
component = component;
|
|
29788
|
+
props = inject(propsToken);
|
|
29789
|
+
}
|
|
29790
|
+
return {
|
|
29791
|
+
deps,
|
|
29792
|
+
propsToken,
|
|
29793
|
+
selector,
|
|
29794
|
+
WrapperComponent: Component4({
|
|
29795
|
+
imports: [NgComponentOutlet, component],
|
|
29796
|
+
selector,
|
|
29797
|
+
standalone: true,
|
|
29798
|
+
template: '<ng-container *ngComponentOutlet="component; inputs: props"></ng-container>'
|
|
29799
|
+
})(AngularIslandWrapperComponent)
|
|
29800
|
+
};
|
|
29801
|
+
})();
|
|
29802
|
+
wrapperMetadataCache.set(wrapperKey, metadataPromise);
|
|
29803
|
+
return metadataPromise;
|
|
29804
|
+
}, extractAngularIslandRoot = (html, selector) => {
|
|
29805
|
+
const openTag = `<${selector}`;
|
|
29806
|
+
const start = html.indexOf(openTag);
|
|
29807
|
+
if (start < 0) {
|
|
29808
|
+
throw new Error(`Could not find Angular island root "${selector}".`);
|
|
29809
|
+
}
|
|
29810
|
+
const endTag = `</${selector}>`;
|
|
29811
|
+
const end = html.indexOf(endTag, start);
|
|
29812
|
+
if (end < 0) {
|
|
29813
|
+
throw new Error(`Could not close Angular island root "${selector}".`);
|
|
29814
|
+
}
|
|
29815
|
+
return html.slice(start, end + endTag.length);
|
|
29816
|
+
}, renderAngularIslandToHtml = async (component, props, islandId) => {
|
|
29817
|
+
const requestCache = getRequestRenderCache();
|
|
29818
|
+
const renderCacheKey = getIslandRenderCacheKey(component, props);
|
|
29819
|
+
const cachedHtml = requestCache?.get(renderCacheKey);
|
|
29820
|
+
if (cachedHtml) {
|
|
29821
|
+
return cachedHtml;
|
|
29822
|
+
}
|
|
29823
|
+
const { deps, propsToken, selector, WrapperComponent } = await createAngularIslandWrapper(component, islandId);
|
|
29824
|
+
const providers = [
|
|
29825
|
+
deps.provideServerRendering(),
|
|
29826
|
+
deps.provideZonelessChangeDetection(),
|
|
29827
|
+
{ provide: deps.APP_BASE_HREF, useValue: "/" },
|
|
29828
|
+
{ provide: propsToken, useValue: props }
|
|
29829
|
+
];
|
|
29830
|
+
const document = `<!DOCTYPE html><html><body><${selector}></${selector}></body></html>`;
|
|
29831
|
+
const html = await withSuppressedAngularDevLogs(() => deps.renderApplication((context) => deps.bootstrapApplication(WrapperComponent, { providers }, context), {
|
|
29832
|
+
document,
|
|
29833
|
+
platformProviders: [],
|
|
29834
|
+
url: "/"
|
|
29835
|
+
}));
|
|
29836
|
+
const islandHtml = extractAngularIslandRoot(html, selector);
|
|
29837
|
+
requestCache?.set(renderCacheKey, islandHtml);
|
|
29838
|
+
return islandHtml;
|
|
29839
|
+
}, mountAngularIsland = async (component, element2, props, islandId) => {
|
|
29840
|
+
await Promise.resolve().then(() => (init_compiler(), exports_compiler));
|
|
29841
|
+
const { createComponent, inputBinding } = await import("@angular/core");
|
|
29842
|
+
const selector = getAngularIslandSelector(islandId);
|
|
29843
|
+
const { app, environmentInjector } = await getAngularIslandApp();
|
|
29844
|
+
let rootElement = element2.querySelector(selector);
|
|
29845
|
+
if (!(rootElement instanceof HTMLElement)) {
|
|
29846
|
+
element2.innerHTML = `<${selector}></${selector}>`;
|
|
29847
|
+
rootElement = element2.querySelector(selector);
|
|
29848
|
+
}
|
|
29849
|
+
if (!(rootElement instanceof HTMLElement))
|
|
29850
|
+
return app;
|
|
29851
|
+
const componentSelector = getClientAngularComponentSelector(component) ?? getSelectorFromRenderedIsland(rootElement);
|
|
29852
|
+
if (!componentSelector)
|
|
29853
|
+
return app;
|
|
29854
|
+
let hostElement = rootElement.querySelector(componentSelector);
|
|
29855
|
+
if (!(hostElement instanceof HTMLElement)) {
|
|
29856
|
+
rootElement.innerHTML = `<${componentSelector}></${componentSelector}>`;
|
|
29857
|
+
hostElement = rootElement.querySelector(componentSelector);
|
|
29858
|
+
}
|
|
29859
|
+
if (!(hostElement instanceof HTMLElement))
|
|
29860
|
+
return app;
|
|
29861
|
+
hostElement.innerHTML = "";
|
|
29862
|
+
const bindings = Object.entries(props).map(([key, value]) => inputBinding(key, () => value));
|
|
29863
|
+
const componentRef = createComponent(component, {
|
|
29864
|
+
bindings,
|
|
29865
|
+
environmentInjector,
|
|
29866
|
+
hostElement
|
|
29867
|
+
});
|
|
29868
|
+
app.attachView(componentRef.hostView);
|
|
29869
|
+
componentRef.changeDetectorRef.detectChanges();
|
|
29870
|
+
window.__ABS_ANGULAR_ISLAND_APPS__ ??= [];
|
|
29871
|
+
window.__ABS_ANGULAR_ISLAND_APPS__.push(app);
|
|
29872
|
+
return app;
|
|
29873
|
+
};
|
|
29874
|
+
var init_islands2 = __esm(() => {
|
|
29875
|
+
init_angularDeps();
|
|
29876
|
+
init_ssrRender();
|
|
29877
|
+
init_registerClientScript();
|
|
29878
|
+
wrapperMetadataCache = new Map;
|
|
29879
|
+
requestRenderCache = new Map;
|
|
29880
|
+
});
|
|
29881
|
+
|
|
29882
|
+
// src/core/islandSsr.ts
|
|
29883
|
+
import { createElement } from "react";
|
|
29884
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
29885
|
+
import { render as renderSvelte } from "svelte/server";
|
|
29886
|
+
import { createSSRApp, h } from "vue";
|
|
29887
|
+
import { renderToString as renderVueToString } from "vue/server-renderer";
|
|
29888
|
+
var renderReactIslandToHtml = (component, props) => renderToStaticMarkup(createElement(component, props)), renderSvelteIslandToHtml = (component, props) => {
|
|
29889
|
+
const { body } = renderSvelte(component, { props });
|
|
29890
|
+
return body;
|
|
29891
|
+
}, renderVueIslandToHtml = (component, props) => {
|
|
29892
|
+
const app = createSSRApp({
|
|
29893
|
+
render: () => h(component, props)
|
|
29894
|
+
});
|
|
29895
|
+
return renderVueToString(app);
|
|
29896
|
+
};
|
|
29897
|
+
var init_islandSsr = __esm(() => {
|
|
29898
|
+
init_islands2();
|
|
29899
|
+
});
|
|
29900
|
+
|
|
29901
|
+
// src/constants.ts
|
|
29902
|
+
var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000;
|
|
29903
|
+
var init_constants = __esm(() => {
|
|
29904
|
+
MILLISECONDS_IN_A_MINUTE = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;
|
|
29905
|
+
MILLISECONDS_IN_A_DAY = MILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE * MINUTES_IN_AN_HOUR * HOURS_IN_DAY;
|
|
29906
|
+
TWO_THIRDS = 2 / 3;
|
|
29907
|
+
});
|
|
29908
|
+
|
|
29909
|
+
// src/svelte/lowerIslandSyntax.ts
|
|
29910
|
+
var ISLAND_TAG_RE, extractIslandAttribute = (attributeString, name) => {
|
|
29911
|
+
const quotedMatch = attributeString.match(new RegExp(`\\b${name}\\s*=\\s*["']([^"']+)["']`));
|
|
29912
|
+
if (quotedMatch?.[1]) {
|
|
29913
|
+
return { expression: JSON.stringify(quotedMatch[1]), found: true };
|
|
29914
|
+
}
|
|
29915
|
+
const attributeIndex = attributeString.search(new RegExp(`\\b${name}\\s*=\\s*\\{`));
|
|
29916
|
+
if (attributeIndex >= 0) {
|
|
29917
|
+
const braceStart = attributeString.indexOf("{", attributeIndex);
|
|
29918
|
+
if (braceStart >= 0) {
|
|
29919
|
+
let depth = 0;
|
|
29920
|
+
for (let index = braceStart;index < attributeString.length; index += 1) {
|
|
29921
|
+
const char = attributeString[index];
|
|
29922
|
+
if (char === "{") {
|
|
29923
|
+
depth += 1;
|
|
29924
|
+
}
|
|
29925
|
+
if (char === "}") {
|
|
29926
|
+
depth -= 1;
|
|
29927
|
+
if (depth === 0) {
|
|
29928
|
+
return {
|
|
29929
|
+
expression: attributeString.slice(braceStart + 1, index).trim(),
|
|
29930
|
+
found: true
|
|
29931
|
+
};
|
|
29932
|
+
}
|
|
29933
|
+
}
|
|
29934
|
+
}
|
|
29935
|
+
}
|
|
29936
|
+
}
|
|
29937
|
+
return { expression: "", found: false };
|
|
29938
|
+
}, lowerSvelteIslandSyntax = (source, mode = "server") => {
|
|
29939
|
+
if (!source.includes("<Island")) {
|
|
29940
|
+
return { code: source, transformed: false };
|
|
29941
|
+
}
|
|
29942
|
+
let islandIndex = 0;
|
|
29943
|
+
const transformedMarkup = source.replace(ISLAND_TAG_RE, (fullMatch, attributeString) => {
|
|
29944
|
+
const framework = extractIslandAttribute(attributeString, "framework");
|
|
29945
|
+
const component = extractIslandAttribute(attributeString, "component");
|
|
29946
|
+
if (!framework.found || !component.found) {
|
|
29947
|
+
return fullMatch;
|
|
29948
|
+
}
|
|
29949
|
+
const hydrate = extractIslandAttribute(attributeString, "hydrate");
|
|
29950
|
+
const props = extractIslandAttribute(attributeString, "props");
|
|
29951
|
+
const slotId = `absolute-svelte-island-${islandIndex.toString(BASE_36_RADIX)}`;
|
|
29952
|
+
islandIndex += 1;
|
|
29953
|
+
const resolveExpression = `await __absoluteResolveIslandHtml(${JSON.stringify(slotId)}, { component: ${component.expression}, framework: ${framework.expression}, hydrate: ${hydrate.found ? hydrate.expression : JSON.stringify("load")}, props: ${props.found ? props.expression : "{}"} })`;
|
|
29954
|
+
return `<div data-absolute-island-slot="${slotId}" style="display: contents">{@html ${resolveExpression}}</div>`;
|
|
29955
|
+
});
|
|
29956
|
+
const importLine = 'import { resolveIslandHtml as __absoluteResolveIslandHtml } from "@absolutejs/absolute/svelte";';
|
|
29957
|
+
if (transformedMarkup.includes("<script")) {
|
|
29958
|
+
return {
|
|
29959
|
+
code: transformedMarkup.replace(/<script(\s[^>]*)?>/, (match) => `${match}
|
|
29960
|
+
${importLine}
|
|
29961
|
+
`),
|
|
29962
|
+
transformed: true
|
|
29963
|
+
};
|
|
29964
|
+
}
|
|
29965
|
+
return {
|
|
29966
|
+
code: `<script lang="ts">
|
|
29967
|
+
${importLine}
|
|
29968
|
+
</script>
|
|
29969
|
+
${transformedMarkup}`,
|
|
29970
|
+
transformed: true
|
|
29971
|
+
};
|
|
29972
|
+
};
|
|
29973
|
+
var init_lowerIslandSyntax = __esm(() => {
|
|
29974
|
+
init_constants();
|
|
29975
|
+
ISLAND_TAG_RE = /<Island\b([\s\S]*?)\/>/g;
|
|
29976
|
+
});
|
|
29977
|
+
|
|
29978
|
+
// src/core/svelteServerModule.ts
|
|
29979
|
+
import { mkdir } from "fs/promises";
|
|
29980
|
+
import { dirname as dirname2, extname, join as join2, relative, resolve as resolve3 } from "path";
|
|
29981
|
+
var serverCacheRoot, compiledModuleCache, transpiler, ensureRelativeImportPath = (from, to) => {
|
|
29982
|
+
const importPath = relative(dirname2(from), to).replace(/\\/g, "/");
|
|
29983
|
+
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
29984
|
+
}, resolveRelativeModule = async (spec, from) => {
|
|
29985
|
+
if (!spec.startsWith(".")) {
|
|
29986
|
+
return null;
|
|
29987
|
+
}
|
|
29988
|
+
const basePath = resolve3(dirname2(from), spec);
|
|
29989
|
+
const candidates = [
|
|
29990
|
+
basePath,
|
|
29991
|
+
`${basePath}.ts`,
|
|
29992
|
+
`${basePath}.js`,
|
|
29993
|
+
`${basePath}.mjs`,
|
|
29994
|
+
`${basePath}.cjs`,
|
|
29995
|
+
`${basePath}.json`,
|
|
29996
|
+
join2(basePath, "index.ts"),
|
|
29997
|
+
join2(basePath, "index.js"),
|
|
29998
|
+
join2(basePath, "index.mjs"),
|
|
29999
|
+
join2(basePath, "index.cjs"),
|
|
30000
|
+
join2(basePath, "index.json")
|
|
30001
|
+
];
|
|
30002
|
+
for (const candidate of candidates) {
|
|
30003
|
+
if (await Bun.file(candidate).exists() === true) {
|
|
30004
|
+
return candidate;
|
|
30005
|
+
}
|
|
30006
|
+
}
|
|
30007
|
+
return null;
|
|
30008
|
+
}, getCachedModulePath = (sourcePath) => {
|
|
30009
|
+
const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
30010
|
+
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
30011
|
+
return join2(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
30012
|
+
}, resolveSvelteImport = async (spec, from) => {
|
|
30013
|
+
if (spec.startsWith("/")) {
|
|
30014
|
+
return spec;
|
|
30015
|
+
}
|
|
30016
|
+
if (!spec.startsWith(".")) {
|
|
30017
|
+
return null;
|
|
30018
|
+
}
|
|
30019
|
+
const explicitPath = resolve3(dirname2(from), spec);
|
|
30020
|
+
if (extname(explicitPath) === ".svelte") {
|
|
30021
|
+
return explicitPath;
|
|
30022
|
+
}
|
|
30023
|
+
const candidate = `${explicitPath}.svelte`;
|
|
30024
|
+
if (await Bun.file(candidate).exists() === true) {
|
|
30025
|
+
return candidate;
|
|
30026
|
+
}
|
|
30027
|
+
return null;
|
|
30028
|
+
}, writeIfChanged = async (path, content) => {
|
|
30029
|
+
const targetFile = Bun.file(path);
|
|
30030
|
+
const exists = await targetFile.exists();
|
|
30031
|
+
if (exists) {
|
|
30032
|
+
const currentContent = await targetFile.text();
|
|
30033
|
+
if (currentContent === content) {
|
|
30034
|
+
return;
|
|
30035
|
+
}
|
|
30036
|
+
}
|
|
30037
|
+
await Bun.write(path, content);
|
|
30038
|
+
}, compileSvelteServerModule = async (sourcePath) => {
|
|
30039
|
+
const cachedModulePath = compiledModuleCache.get(sourcePath);
|
|
30040
|
+
if (cachedModulePath) {
|
|
30041
|
+
return cachedModulePath;
|
|
30042
|
+
}
|
|
30043
|
+
const source = await Bun.file(sourcePath).text();
|
|
30044
|
+
const { compile, preprocess } = await import("svelte/compiler");
|
|
30045
|
+
const loweredSource = lowerSvelteIslandSyntax(source, "server");
|
|
30046
|
+
const preprocessed = await preprocess(loweredSource.code, {});
|
|
30047
|
+
const transpiled = sourcePath.endsWith(".ts") || sourcePath.endsWith(".svelte.ts") ? transpiler.transformSync(preprocessed.code) : preprocessed.code;
|
|
30048
|
+
const childImportSpecs = Array.from(transpiled.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((value) => value !== undefined);
|
|
30049
|
+
const resolvedChildModules = await Promise.all(childImportSpecs.map((spec) => resolveSvelteImport(spec, sourcePath)));
|
|
30050
|
+
const resolvedModuleImports = await Promise.all(childImportSpecs.map((spec) => resolveRelativeModule(spec, sourcePath)));
|
|
30051
|
+
const childModulePaths = new Map;
|
|
30052
|
+
const rewrittenModulePaths = new Map;
|
|
30053
|
+
for (let index = 0;index < childImportSpecs.length; index += 1) {
|
|
30054
|
+
const spec = childImportSpecs[index];
|
|
30055
|
+
const resolvedChild = resolvedChildModules[index];
|
|
30056
|
+
if (!spec || !resolvedChild)
|
|
30057
|
+
continue;
|
|
30058
|
+
const compiledChildPath = await compileSvelteServerModule(resolvedChild);
|
|
30059
|
+
childModulePaths.set(spec, compiledChildPath);
|
|
30060
|
+
}
|
|
30061
|
+
for (let index = 0;index < childImportSpecs.length; index += 1) {
|
|
30062
|
+
const spec = childImportSpecs[index];
|
|
30063
|
+
const resolvedModuleImport = resolvedModuleImports[index];
|
|
30064
|
+
if (!spec || !resolvedModuleImport)
|
|
30065
|
+
continue;
|
|
30066
|
+
if (resolvedChildModules[index])
|
|
30067
|
+
continue;
|
|
30068
|
+
rewrittenModulePaths.set(spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), resolvedModuleImport));
|
|
30069
|
+
}
|
|
30070
|
+
let compiledCode = compile(transpiled, {
|
|
30071
|
+
css: "injected",
|
|
30072
|
+
experimental: {
|
|
30073
|
+
async: loweredSource.transformed
|
|
30074
|
+
},
|
|
30075
|
+
filename: sourcePath,
|
|
30076
|
+
generate: "server"
|
|
30077
|
+
}).js.code;
|
|
30078
|
+
for (const [spec, compiledChildPath] of childModulePaths) {
|
|
30079
|
+
compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), compiledChildPath));
|
|
30080
|
+
}
|
|
30081
|
+
for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
|
|
30082
|
+
compiledCode = compiledCode.replaceAll(spec, resolvedModuleImport);
|
|
30083
|
+
}
|
|
30084
|
+
const compiledModulePath = getCachedModulePath(sourcePath);
|
|
30085
|
+
await mkdir(dirname2(compiledModulePath), { recursive: true });
|
|
30086
|
+
await writeIfChanged(compiledModulePath, compiledCode);
|
|
30087
|
+
compiledModuleCache.set(sourcePath, compiledModulePath);
|
|
30088
|
+
return compiledModulePath;
|
|
30089
|
+
};
|
|
30090
|
+
var init_svelteServerModule = __esm(() => {
|
|
30091
|
+
init_lowerIslandSyntax();
|
|
30092
|
+
serverCacheRoot = join2(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
30093
|
+
compiledModuleCache = new Map;
|
|
30094
|
+
transpiler = new Bun.Transpiler({
|
|
30095
|
+
loader: "ts",
|
|
30096
|
+
target: "browser"
|
|
30097
|
+
});
|
|
30098
|
+
});
|
|
30099
|
+
|
|
30100
|
+
// src/core/renderIslandMarkup.ts
|
|
30101
|
+
var islandSequence = 0, resolvedServerComponentCache, resolvedServerBuildComponentCache, nextIslandId = () => {
|
|
30102
|
+
islandSequence += 1;
|
|
30103
|
+
return `island-${islandSequence}`;
|
|
30104
|
+
}, isRecord2 = (value) => typeof value === "object" && value !== null, isReactServerIslandComponent = (value) => typeof value === "function", isSvelteServerIslandComponent = (value) => typeof value === "function", isVueServerIslandComponent = (value) => typeof value === "function" || isRecord2(value), isAngularServerIslandComponent = (value) => typeof value === "function", resolveBuildReferencePath = (source, registryPath) => source.startsWith("file://") ? new URL(source).pathname : source.startsWith(".") ? new URL(source, registryPath).pathname : source, loadServerBuildComponent = async (buildReferencePath) => {
|
|
30105
|
+
const cachedBuildComponent = resolvedServerBuildComponentCache.get(buildReferencePath);
|
|
30106
|
+
if (cachedBuildComponent) {
|
|
30107
|
+
return cachedBuildComponent;
|
|
30108
|
+
}
|
|
30109
|
+
const loadPromise = (async () => {
|
|
30110
|
+
const compiledModulePath = await compileSvelteServerModule(buildReferencePath);
|
|
30111
|
+
const loadedModule = await import(compiledModulePath);
|
|
30112
|
+
return "default" in loadedModule ? loadedModule.default : loadedModule;
|
|
30113
|
+
})();
|
|
30114
|
+
resolvedServerBuildComponentCache.set(buildReferencePath, loadPromise);
|
|
30115
|
+
return loadPromise;
|
|
30116
|
+
}, loadServerImportComponent = async (resolvedComponent) => {
|
|
30117
|
+
const resolvedModulePath = resolvedComponent.startsWith(".") ? new URL(resolvedComponent, import.meta.url).pathname : resolvedComponent;
|
|
30118
|
+
const importTarget = resolvedModulePath.endsWith(".svelte") ? await compileSvelteServerModule(resolvedModulePath) : resolvedModulePath;
|
|
30119
|
+
const loadedModule = await import(importTarget);
|
|
30120
|
+
return "default" in loadedModule ? loadedModule.default : loadedModule;
|
|
30121
|
+
}, resolveServerIslandComponent = async (component) => {
|
|
30122
|
+
const cachedResolvedComponent = resolvedServerComponentCache.get(component);
|
|
30123
|
+
if (cachedResolvedComponent) {
|
|
30124
|
+
return cachedResolvedComponent;
|
|
30125
|
+
}
|
|
30126
|
+
const resolutionPromise = (async () => {
|
|
30127
|
+
const buildReference = getIslandBuildReference(component);
|
|
30128
|
+
const buildReferencePath = buildReference?.source ? resolveBuildReferencePath(buildReference.source, import.meta.url) : null;
|
|
30129
|
+
if (buildReferencePath?.endsWith(".svelte")) {
|
|
30130
|
+
return loadServerBuildComponent(buildReferencePath);
|
|
30131
|
+
}
|
|
30132
|
+
const resolvedComponent = getIslandComponent(component);
|
|
30133
|
+
if (typeof resolvedComponent !== "string") {
|
|
30134
|
+
return resolvedComponent;
|
|
30135
|
+
}
|
|
30136
|
+
return loadServerImportComponent(resolvedComponent);
|
|
30137
|
+
})();
|
|
30138
|
+
resolvedServerComponentCache.set(component, resolutionPromise);
|
|
30139
|
+
return resolutionPromise;
|
|
30140
|
+
}, resolveReactServerIslandComponent = async (component) => {
|
|
30141
|
+
const resolvedComponent = await resolveServerIslandComponent(component);
|
|
30142
|
+
if (!isReactServerIslandComponent(resolvedComponent)) {
|
|
30143
|
+
throw new Error("Resolved React island is not a valid React component.");
|
|
30144
|
+
}
|
|
30145
|
+
return resolvedComponent;
|
|
30146
|
+
}, resolveSvelteServerIslandComponent = async (component) => {
|
|
30147
|
+
const resolvedComponent = await resolveServerIslandComponent(component);
|
|
30148
|
+
if (!isSvelteServerIslandComponent(resolvedComponent)) {
|
|
30149
|
+
throw new Error("Resolved Svelte island is not a valid Svelte component.");
|
|
30150
|
+
}
|
|
30151
|
+
return resolvedComponent;
|
|
30152
|
+
}, resolveVueServerIslandComponent = async (component) => {
|
|
30153
|
+
const resolvedComponent = await resolveServerIslandComponent(component);
|
|
30154
|
+
if (!isVueServerIslandComponent(resolvedComponent)) {
|
|
30155
|
+
throw new Error("Resolved Vue island is not a valid Vue component.");
|
|
30156
|
+
}
|
|
30157
|
+
return resolvedComponent;
|
|
30158
|
+
}, resolveAngularServerIslandComponent = async (component) => {
|
|
30159
|
+
const resolvedComponent = await resolveServerIslandComponent(component);
|
|
30160
|
+
if (!isAngularServerIslandComponent(resolvedComponent)) {
|
|
30161
|
+
throw new Error("Resolved Angular island is not a valid Angular component.");
|
|
30162
|
+
}
|
|
30163
|
+
return resolvedComponent;
|
|
30164
|
+
}, renderIslandResult = async (registry, props) => {
|
|
30165
|
+
const islandId = nextIslandId();
|
|
30166
|
+
const attributes = getIslandMarkerAttributes(props);
|
|
30167
|
+
if (props.framework === "react") {
|
|
30168
|
+
const entry = registry.react?.[props.component];
|
|
30169
|
+
if (!entry) {
|
|
30170
|
+
throw new Error(`Island component "${props.component}" is not registered for framework "react".`);
|
|
30171
|
+
}
|
|
30172
|
+
const component = await resolveReactServerIslandComponent(entry);
|
|
30173
|
+
const html = renderReactIslandToHtml(component, props.props);
|
|
30174
|
+
return { attributes, html };
|
|
30175
|
+
}
|
|
30176
|
+
if (props.framework === "svelte") {
|
|
30177
|
+
const entry = registry.svelte?.[props.component];
|
|
30178
|
+
if (!entry) {
|
|
30179
|
+
throw new Error(`Island component "${props.component}" is not registered for framework "svelte".`);
|
|
30180
|
+
}
|
|
30181
|
+
const component = await resolveSvelteServerIslandComponent(entry);
|
|
30182
|
+
const html = renderSvelteIslandToHtml(component, props.props);
|
|
30183
|
+
return { attributes, html };
|
|
30184
|
+
}
|
|
30185
|
+
if (props.framework === "vue") {
|
|
30186
|
+
const entry = registry.vue?.[props.component];
|
|
30187
|
+
if (!entry) {
|
|
30188
|
+
throw new Error(`Island component "${props.component}" is not registered for framework "vue".`);
|
|
30189
|
+
}
|
|
30190
|
+
const component = await resolveVueServerIslandComponent(entry);
|
|
30191
|
+
const html = await renderVueIslandToHtml(component, props.props);
|
|
30192
|
+
return { attributes, html };
|
|
30193
|
+
}
|
|
30194
|
+
if (props.framework === "angular") {
|
|
30195
|
+
const entry = registry.angular?.[props.component];
|
|
30196
|
+
if (!entry) {
|
|
30197
|
+
throw new Error(`Island component "${props.component}" is not registered for framework "angular".`);
|
|
30198
|
+
}
|
|
30199
|
+
const component = await resolveAngularServerIslandComponent(entry);
|
|
30200
|
+
const html = await renderAngularIslandToHtml(component, props.props, islandId);
|
|
30201
|
+
return {
|
|
30202
|
+
attributes: {
|
|
30203
|
+
...getIslandMarkerAttributes(props, islandId)
|
|
30204
|
+
},
|
|
30205
|
+
html
|
|
30206
|
+
};
|
|
30207
|
+
}
|
|
30208
|
+
throw new Error(`Framework "${props.framework}" is not implemented in this prototype.`);
|
|
30209
|
+
}, renderIslandMarkup = async (registry, props) => {
|
|
30210
|
+
const result = await renderIslandResult(registry, props);
|
|
30211
|
+
return `<div ${serializeIslandAttributes(result.attributes)}>${result.html}</div>`;
|
|
30212
|
+
};
|
|
30213
|
+
var init_renderIslandMarkup = __esm(() => {
|
|
30214
|
+
init_islandSsr();
|
|
30215
|
+
init_svelteServerModule();
|
|
30216
|
+
init_islandMarkupAttributes();
|
|
30217
|
+
init_islands();
|
|
30218
|
+
resolvedServerComponentCache = new Map;
|
|
30219
|
+
resolvedServerBuildComponentCache = new Map;
|
|
30220
|
+
});
|
|
30221
|
+
|
|
29359
30222
|
// node_modules/rxjs/dist/cjs/internal/util/isFunction.js
|
|
29360
30223
|
var require_isFunction = __commonJS((exports) => {
|
|
29361
30224
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -30040,7 +30903,7 @@ var require_Observable = __commonJS((exports) => {
|
|
|
30040
30903
|
Observable2.prototype.forEach = function(next, promiseCtor) {
|
|
30041
30904
|
var _this = this;
|
|
30042
30905
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
30043
|
-
return new promiseCtor(function(
|
|
30906
|
+
return new promiseCtor(function(resolve4, reject) {
|
|
30044
30907
|
var subscriber = new Subscriber_1.SafeSubscriber({
|
|
30045
30908
|
next: function(value) {
|
|
30046
30909
|
try {
|
|
@@ -30051,7 +30914,7 @@ var require_Observable = __commonJS((exports) => {
|
|
|
30051
30914
|
}
|
|
30052
30915
|
},
|
|
30053
30916
|
error: reject,
|
|
30054
|
-
complete:
|
|
30917
|
+
complete: resolve4
|
|
30055
30918
|
});
|
|
30056
30919
|
_this.subscribe(subscriber);
|
|
30057
30920
|
});
|
|
@@ -30073,14 +30936,14 @@ var require_Observable = __commonJS((exports) => {
|
|
|
30073
30936
|
Observable2.prototype.toPromise = function(promiseCtor) {
|
|
30074
30937
|
var _this = this;
|
|
30075
30938
|
promiseCtor = getPromiseCtor(promiseCtor);
|
|
30076
|
-
return new promiseCtor(function(
|
|
30939
|
+
return new promiseCtor(function(resolve4, reject) {
|
|
30077
30940
|
var value;
|
|
30078
30941
|
_this.subscribe(function(x) {
|
|
30079
30942
|
return value = x;
|
|
30080
30943
|
}, function(err) {
|
|
30081
30944
|
return reject(err);
|
|
30082
30945
|
}, function() {
|
|
30083
|
-
return
|
|
30946
|
+
return resolve4(value);
|
|
30084
30947
|
});
|
|
30085
30948
|
});
|
|
30086
30949
|
};
|
|
@@ -32108,11 +32971,11 @@ var require_isReadableStreamLike = __commonJS((exports) => {
|
|
|
32108
32971
|
var require_innerFrom = __commonJS((exports) => {
|
|
32109
32972
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
32110
32973
|
function adopt(value) {
|
|
32111
|
-
return value instanceof P ? value : new P(function(
|
|
32112
|
-
|
|
32974
|
+
return value instanceof P ? value : new P(function(resolve4) {
|
|
32975
|
+
resolve4(value);
|
|
32113
32976
|
});
|
|
32114
32977
|
}
|
|
32115
|
-
return new (P || (P = Promise))(function(
|
|
32978
|
+
return new (P || (P = Promise))(function(resolve4, reject) {
|
|
32116
32979
|
function fulfilled(value) {
|
|
32117
32980
|
try {
|
|
32118
32981
|
step(generator.next(value));
|
|
@@ -32128,7 +32991,7 @@ var require_innerFrom = __commonJS((exports) => {
|
|
|
32128
32991
|
}
|
|
32129
32992
|
}
|
|
32130
32993
|
function step(result) {
|
|
32131
|
-
result.done ?
|
|
32994
|
+
result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
32132
32995
|
}
|
|
32133
32996
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32134
32997
|
});
|
|
@@ -32218,14 +33081,14 @@ var require_innerFrom = __commonJS((exports) => {
|
|
|
32218
33081
|
}, i);
|
|
32219
33082
|
function verb(n) {
|
|
32220
33083
|
i[n] = o[n] && function(v) {
|
|
32221
|
-
return new Promise(function(
|
|
32222
|
-
v = o[n](v), settle(
|
|
33084
|
+
return new Promise(function(resolve4, reject) {
|
|
33085
|
+
v = o[n](v), settle(resolve4, reject, v.done, v.value);
|
|
32223
33086
|
});
|
|
32224
33087
|
};
|
|
32225
33088
|
}
|
|
32226
|
-
function settle(
|
|
33089
|
+
function settle(resolve4, reject, d, v) {
|
|
32227
33090
|
Promise.resolve(v).then(function(v2) {
|
|
32228
|
-
|
|
33091
|
+
resolve4({ value: v2, done: d });
|
|
32229
33092
|
}, reject);
|
|
32230
33093
|
}
|
|
32231
33094
|
};
|
|
@@ -32343,7 +33206,7 @@ var require_innerFrom = __commonJS((exports) => {
|
|
|
32343
33206
|
exports.fromIterable = fromIterable;
|
|
32344
33207
|
function fromAsyncIterable(asyncIterable) {
|
|
32345
33208
|
return new Observable_1.Observable(function(subscriber) {
|
|
32346
|
-
|
|
33209
|
+
process2(asyncIterable, subscriber).catch(function(err) {
|
|
32347
33210
|
return subscriber.error(err);
|
|
32348
33211
|
});
|
|
32349
33212
|
});
|
|
@@ -32353,7 +33216,7 @@ var require_innerFrom = __commonJS((exports) => {
|
|
|
32353
33216
|
return fromAsyncIterable(isReadableStreamLike_1.readableStreamLikeToAsyncGenerator(readableStream));
|
|
32354
33217
|
}
|
|
32355
33218
|
exports.fromReadableStreamLike = fromReadableStreamLike;
|
|
32356
|
-
function
|
|
33219
|
+
function process2(asyncIterable, subscriber) {
|
|
32357
33220
|
var asyncIterable_1, asyncIterable_1_1;
|
|
32358
33221
|
var e_2, _a;
|
|
32359
33222
|
return __awaiter(this, undefined, undefined, function() {
|
|
@@ -32801,7 +33664,7 @@ var require_lastValueFrom = __commonJS((exports) => {
|
|
|
32801
33664
|
var EmptyError_1 = require_EmptyError();
|
|
32802
33665
|
function lastValueFrom(source, config) {
|
|
32803
33666
|
var hasConfig = typeof config === "object";
|
|
32804
|
-
return new Promise(function(
|
|
33667
|
+
return new Promise(function(resolve4, reject) {
|
|
32805
33668
|
var _hasValue = false;
|
|
32806
33669
|
var _value;
|
|
32807
33670
|
source.subscribe({
|
|
@@ -32812,9 +33675,9 @@ var require_lastValueFrom = __commonJS((exports) => {
|
|
|
32812
33675
|
error: reject,
|
|
32813
33676
|
complete: function() {
|
|
32814
33677
|
if (_hasValue) {
|
|
32815
|
-
|
|
33678
|
+
resolve4(_value);
|
|
32816
33679
|
} else if (hasConfig) {
|
|
32817
|
-
|
|
33680
|
+
resolve4(config.defaultValue);
|
|
32818
33681
|
} else {
|
|
32819
33682
|
reject(new EmptyError_1.EmptyError);
|
|
32820
33683
|
}
|
|
@@ -32833,16 +33696,16 @@ var require_firstValueFrom = __commonJS((exports) => {
|
|
|
32833
33696
|
var Subscriber_1 = require_Subscriber();
|
|
32834
33697
|
function firstValueFrom(source, config) {
|
|
32835
33698
|
var hasConfig = typeof config === "object";
|
|
32836
|
-
return new Promise(function(
|
|
33699
|
+
return new Promise(function(resolve4, reject) {
|
|
32837
33700
|
var subscriber = new Subscriber_1.SafeSubscriber({
|
|
32838
33701
|
next: function(value) {
|
|
32839
|
-
|
|
33702
|
+
resolve4(value);
|
|
32840
33703
|
subscriber.unsubscribe();
|
|
32841
33704
|
},
|
|
32842
33705
|
error: reject,
|
|
32843
33706
|
complete: function() {
|
|
32844
33707
|
if (hasConfig) {
|
|
32845
|
-
|
|
33708
|
+
resolve4(config.defaultValue);
|
|
32846
33709
|
} else {
|
|
32847
33710
|
reject(new EmptyError_1.EmptyError);
|
|
32848
33711
|
}
|
|
@@ -37089,7 +37952,7 @@ var require_window = __commonJS((exports) => {
|
|
|
37089
37952
|
var OperatorSubscriber_1 = require_OperatorSubscriber();
|
|
37090
37953
|
var noop_1 = require_noop();
|
|
37091
37954
|
var innerFrom_1 = require_innerFrom();
|
|
37092
|
-
function
|
|
37955
|
+
function window2(windowBoundaries) {
|
|
37093
37956
|
return lift_1.operate(function(source, subscriber) {
|
|
37094
37957
|
var windowSubject = new Subject_1.Subject;
|
|
37095
37958
|
subscriber.next(windowSubject.asObservable());
|
|
@@ -37113,7 +37976,7 @@ var require_window = __commonJS((exports) => {
|
|
|
37113
37976
|
};
|
|
37114
37977
|
});
|
|
37115
37978
|
}
|
|
37116
|
-
exports.window =
|
|
37979
|
+
exports.window = window2;
|
|
37117
37980
|
});
|
|
37118
37981
|
|
|
37119
37982
|
// node_modules/rxjs/dist/cjs/internal/operators/windowCount.js
|
|
@@ -37218,8 +38081,8 @@ var require_windowTime = __commonJS((exports) => {
|
|
|
37218
38081
|
var windowRecords = [];
|
|
37219
38082
|
var restartOnClose = false;
|
|
37220
38083
|
var closeWindow = function(record) {
|
|
37221
|
-
var { window, subs } = record;
|
|
37222
|
-
|
|
38084
|
+
var { window: window2, subs } = record;
|
|
38085
|
+
window2.complete();
|
|
37223
38086
|
subs.unsubscribe();
|
|
37224
38087
|
arrRemove_1.arrRemove(windowRecords, record);
|
|
37225
38088
|
restartOnClose && startWindow();
|
|
@@ -37252,8 +38115,8 @@ var require_windowTime = __commonJS((exports) => {
|
|
|
37252
38115
|
};
|
|
37253
38116
|
var terminate = function(cb) {
|
|
37254
38117
|
loop(function(_a2) {
|
|
37255
|
-
var
|
|
37256
|
-
return cb(
|
|
38118
|
+
var window2 = _a2.window;
|
|
38119
|
+
return cb(window2);
|
|
37257
38120
|
});
|
|
37258
38121
|
cb(subscriber);
|
|
37259
38122
|
subscriber.unsubscribe();
|
|
@@ -37315,12 +38178,12 @@ var require_windowToggle = __commonJS((exports) => {
|
|
|
37315
38178
|
subscriber.error(err);
|
|
37316
38179
|
};
|
|
37317
38180
|
innerFrom_1.innerFrom(openings).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(openValue) {
|
|
37318
|
-
var
|
|
37319
|
-
windows.push(
|
|
38181
|
+
var window2 = new Subject_1.Subject;
|
|
38182
|
+
windows.push(window2);
|
|
37320
38183
|
var closingSubscription = new Subscription_1.Subscription;
|
|
37321
38184
|
var closeWindow = function() {
|
|
37322
|
-
arrRemove_1.arrRemove(windows,
|
|
37323
|
-
|
|
38185
|
+
arrRemove_1.arrRemove(windows, window2);
|
|
38186
|
+
window2.complete();
|
|
37324
38187
|
closingSubscription.unsubscribe();
|
|
37325
38188
|
};
|
|
37326
38189
|
var closingNotifier;
|
|
@@ -37330,7 +38193,7 @@ var require_windowToggle = __commonJS((exports) => {
|
|
|
37330
38193
|
handleError(err);
|
|
37331
38194
|
return;
|
|
37332
38195
|
}
|
|
37333
|
-
subscriber.next(
|
|
38196
|
+
subscriber.next(window2.asObservable());
|
|
37334
38197
|
closingSubscription.add(closingNotifier.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, closeWindow, noop_1.noop, handleError)));
|
|
37335
38198
|
}, noop_1.noop));
|
|
37336
38199
|
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
|
|
@@ -37377,17 +38240,17 @@ var require_windowWhen = __commonJS((exports) => {
|
|
|
37377
38240
|
var innerFrom_1 = require_innerFrom();
|
|
37378
38241
|
function windowWhen(closingSelector) {
|
|
37379
38242
|
return lift_1.operate(function(source, subscriber) {
|
|
37380
|
-
var
|
|
38243
|
+
var window2;
|
|
37381
38244
|
var closingSubscriber;
|
|
37382
38245
|
var handleError = function(err) {
|
|
37383
|
-
|
|
38246
|
+
window2.error(err);
|
|
37384
38247
|
subscriber.error(err);
|
|
37385
38248
|
};
|
|
37386
38249
|
var openWindow = function() {
|
|
37387
38250
|
closingSubscriber === null || closingSubscriber === undefined || closingSubscriber.unsubscribe();
|
|
37388
|
-
|
|
37389
|
-
|
|
37390
|
-
subscriber.next(
|
|
38251
|
+
window2 === null || window2 === undefined || window2.complete();
|
|
38252
|
+
window2 = new Subject_1.Subject;
|
|
38253
|
+
subscriber.next(window2.asObservable());
|
|
37391
38254
|
var closingNotifier;
|
|
37392
38255
|
try {
|
|
37393
38256
|
closingNotifier = innerFrom_1.innerFrom(closingSelector());
|
|
@@ -37399,13 +38262,13 @@ var require_windowWhen = __commonJS((exports) => {
|
|
|
37399
38262
|
};
|
|
37400
38263
|
openWindow();
|
|
37401
38264
|
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) {
|
|
37402
|
-
return
|
|
38265
|
+
return window2.next(value);
|
|
37403
38266
|
}, function() {
|
|
37404
|
-
|
|
38267
|
+
window2.complete();
|
|
37405
38268
|
subscriber.complete();
|
|
37406
38269
|
}, handleError, function() {
|
|
37407
38270
|
closingSubscriber === null || closingSubscriber === undefined || closingSubscriber.unsubscribe();
|
|
37408
|
-
|
|
38271
|
+
window2 = null;
|
|
37409
38272
|
}));
|
|
37410
38273
|
});
|
|
37411
38274
|
}
|
|
@@ -38340,6 +39203,11 @@ IslandComponent = __legacyDecorateClassTS([
|
|
|
38340
39203
|
})
|
|
38341
39204
|
], IslandComponent);
|
|
38342
39205
|
var Island = IslandComponent;
|
|
39206
|
+
// src/angular/createIsland.ts
|
|
39207
|
+
init_renderIslandMarkup();
|
|
39208
|
+
var createTypedIsland = (registry) => {
|
|
39209
|
+
return (props) => renderIslandMarkup(registry, props);
|
|
39210
|
+
};
|
|
38343
39211
|
// src/angular/island-state.service.ts
|
|
38344
39212
|
var import_rxjs = __toESM(require_cjs(), 1);
|
|
38345
39213
|
import { Injectable } from "@angular/core";
|
|
@@ -38450,9 +39318,10 @@ var renderIsland = async () => {
|
|
|
38450
39318
|
};
|
|
38451
39319
|
export {
|
|
38452
39320
|
renderIsland,
|
|
39321
|
+
createTypedIsland,
|
|
38453
39322
|
IslandState,
|
|
38454
39323
|
Island
|
|
38455
39324
|
};
|
|
38456
39325
|
|
|
38457
|
-
//# debugId=
|
|
39326
|
+
//# debugId=E514B079E0178E1464756E2164756E21
|
|
38458
39327
|
//# sourceMappingURL=browser.js.map
|