@absolutejs/absolute 0.20.0-beta.54 → 0.20.0-beta.56
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/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +25 -4
- package/dist/angular/index.js.map +6 -5
- package/dist/angular/server.js +25 -4
- package/dist/angular/server.js.map +6 -5
- package/dist/build.js +66 -10
- package/dist/build.js.map +11 -10
- package/dist/cli/config/server.js +4 -1
- package/dist/cli/index.js +53 -3
- package/dist/client/index.js +126 -7
- package/dist/client/index.js.map +8 -6
- package/dist/index.js +289 -233
- package/dist/index.js.map +13 -12
- package/dist/islands/index.js +17 -2
- package/dist/islands/index.js.map +5 -4
- package/dist/mobile/index.js +1332 -64
- package/dist/mobile/index.js.map +8 -6
- package/dist/mobile/remoteMacAgentEntry.js +101 -92
- package/dist/mobile/shellBootstrap.js +258 -4
- package/dist/react/index.js +19 -3
- package/dist/react/index.js.map +6 -5
- package/dist/react/server.js +17 -2
- package/dist/react/server.js.map +5 -4
- 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/ember/browser.d.ts +0 -16
- package/dist/src/mobile/adaptiveShell.d.ts +27 -0
- package/dist/src/mobile/deviceCapabilities.d.ts +1 -0
- package/dist/src/mobile/index.d.ts +1 -0
- 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/index.js +19 -3
- package/dist/svelte/index.js.map +6 -5
- package/dist/svelte/server.js +17 -2
- package/dist/svelte/server.js.map +5 -4
- package/dist/vue/browser.js +96 -1
- package/dist/vue/browser.js.map +5 -3
- package/dist/vue/index.js +114 -3
- package/dist/vue/index.js.map +8 -5
- package/dist/vue/server.js +17 -2
- package/dist/vue/server.js.map +5 -4
- package/package.json +7 -7
package/dist/build.js
CHANGED
|
@@ -811,10 +811,14 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
811
811
|
] : [];
|
|
812
812
|
const reactImports = isDev ? [
|
|
813
813
|
`import { hydrateRoot, createRoot } from 'react-dom/client';`,
|
|
814
|
-
`import {
|
|
814
|
+
`import { flushSync } from 'react-dom';`,
|
|
815
|
+
`import { createElement, Component } from 'react';`,
|
|
816
|
+
`import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';`
|
|
815
817
|
] : [
|
|
816
818
|
`import { hydrateRoot, createRoot } from 'react-dom/client';`,
|
|
817
|
-
`import {
|
|
819
|
+
`import { flushSync } from 'react-dom';`,
|
|
820
|
+
`import { createElement } from 'react';`,
|
|
821
|
+
`import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';`
|
|
818
822
|
];
|
|
819
823
|
const errorBoundaryDef = isDev ? [
|
|
820
824
|
`
|
|
@@ -1009,8 +1013,10 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
1009
1013
|
` root.render(${isDev ? `createElement(ErrorBoundary, null, createElement(PageComponent, mergedProps))` : `createElement(PageComponent, mergedProps)`});`,
|
|
1010
1014
|
` window.__REACT_ROOT__ = root;`,
|
|
1011
1015
|
` } else {`,
|
|
1016
|
+
` const restoreTranslation = prepareBrowserTranslationHydration(container);`,
|
|
1012
1017
|
` try {`,
|
|
1013
1018
|
` // Use onRecoverableError to catch hydration errors (React 19)`,
|
|
1019
|
+
` const startHydration = () => {`,
|
|
1014
1020
|
` root = hydrateRoot(`,
|
|
1015
1021
|
` container,`,
|
|
1016
1022
|
` ${isDev ? `createElement(ErrorBoundary, null, createElement(PageComponent, mergedProps))` : `createElement(PageComponent, mergedProps)`},`,
|
|
@@ -1047,8 +1053,13 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
1047
1053
|
` }`,
|
|
1048
1054
|
` }`,
|
|
1049
1055
|
` );`,
|
|
1056
|
+
` };`,
|
|
1057
|
+
` if (restoreTranslation.hasTranslation) flushSync(startHydration);`,
|
|
1058
|
+
` else startHydration();`,
|
|
1059
|
+
` restoreTranslation();`,
|
|
1050
1060
|
` window.__REACT_ROOT__ = root;`,
|
|
1051
1061
|
` } catch (error) {`,
|
|
1062
|
+
` restoreTranslation();`,
|
|
1052
1063
|
` // Catch synchronous errors (shouldn't happen with hydrateRoot, but safety net)`,
|
|
1053
1064
|
` if (isDev && isHydrationError(error)) {`,
|
|
1054
1065
|
` handleHydrationFallback(error);`,
|
|
@@ -2180,6 +2191,20 @@ var init_registerClientScript = __esm(() => {
|
|
|
2180
2191
|
}
|
|
2181
2192
|
});
|
|
2182
2193
|
|
|
2194
|
+
// src/core/browserTranslation.ts
|
|
2195
|
+
var BASELINE_MARKER = "__ABSOLUTE_SSR_TEXT_BASELINES__", BROWSER_TRANSLATION_BASELINE_SCRIPT, browserTranslationBaselineTag = () => `<script>${BROWSER_TRANSLATION_BASELINE_SCRIPT}</script>`, injectBrowserTranslationBaseline = (html) => {
|
|
2196
|
+
if (html.includes(BASELINE_MARKER))
|
|
2197
|
+
return html;
|
|
2198
|
+
const script = browserTranslationBaselineTag();
|
|
2199
|
+
const closingBodyIndex = html.lastIndexOf("</body>");
|
|
2200
|
+
if (closingBodyIndex < 0)
|
|
2201
|
+
return `${html}${script}`;
|
|
2202
|
+
return `${html.slice(0, closingBodyIndex)}${script}${html.slice(closingBodyIndex)}`;
|
|
2203
|
+
};
|
|
2204
|
+
var init_browserTranslation = __esm(() => {
|
|
2205
|
+
BROWSER_TRANSLATION_BASELINE_SCRIPT = "window.__ABSOLUTE_SSR_TEXT_BASELINES__=new WeakMap();" + "{const r=document.body,b=window.__ABSOLUTE_SSR_TEXT_BASELINES__;" + 'if(r)for(const e of [r,...r.querySelectorAll("*")]){' + "const t=new Map();for(const [i,n]of[...e.childNodes].entries())" + 'if(n.nodeType===3)t.set(i,n.nodeValue??"");if(t.size)b.set(e,t);}}';
|
|
2206
|
+
});
|
|
2207
|
+
|
|
2183
2208
|
// src/angular/httpTransferCache.ts
|
|
2184
2209
|
var ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER = "x-skip-transfer-cache", buildAbsoluteHttpTransferCacheOptions = (options = {}) => {
|
|
2185
2210
|
const {
|
|
@@ -2232,7 +2257,7 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
|
2232
2257
|
}
|
|
2233
2258
|
return html + snippet;
|
|
2234
2259
|
}, injectSsrScripts = (html, requestId, indexPath, requestContext) => {
|
|
2235
|
-
let result = html;
|
|
2260
|
+
let result = injectBeforeClose(html, browserTranslationBaselineTag());
|
|
2236
2261
|
const registeredScripts = getAndClearClientScripts(requestId);
|
|
2237
2262
|
if (registeredScripts.length > 0) {
|
|
2238
2263
|
result = injectBeforeClose(result, generateClientScriptCode(registeredScripts));
|
|
@@ -2268,6 +2293,7 @@ var routeContextCache, cacheRouteData = (pagePath, data) => {
|
|
|
2268
2293
|
};
|
|
2269
2294
|
var init_ssrRender = __esm(() => {
|
|
2270
2295
|
init_registerClientScript();
|
|
2296
|
+
init_browserTranslation();
|
|
2271
2297
|
routeContextCache = new Map;
|
|
2272
2298
|
selectorCache = new Map;
|
|
2273
2299
|
});
|
|
@@ -12886,7 +12912,7 @@ import { existsSync as existsSync20, readFileSync as readFileSync13 } from "fs";
|
|
|
12886
12912
|
import { extname as extname7, join as join24, relative as relative11, resolve as resolve20 } from "path";
|
|
12887
12913
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
12888
12914
|
import ts8 from "typescript";
|
|
12889
|
-
var DEVICES_PACKAGE = "@absolutejs/devices", ADAPTERS, SOURCE_GLOB, IGNORED_DIRECTORIES, IDENTIFIER_PATTERN, providerModulePattern = (provider) => new RegExp(`^@absolutejs/devices-${provider}/[a-z][a-z0-9-]*$`, "u"), providerPackagePattern = (provider) => provider === "capacitor" ? /^@capacitor\/[a-z][a-z0-9-]*@\d+\.\d+\.\d+$/u : /^(?:expo-[a-z][a-z0-9-]*|@react-native-[a-z0-9-]+\/[a-z][a-z0-9-]*)@\d+\.\d+\.\d+$/u, providerLabel = (provider) => provider === "capacitor" ? "Capacitor" : "Expo", ANDROID_PERMISSION_PATTERN, IOS_USAGE_DESCRIPTIONS, IOS_PRIVACY_ACCESSED_API_REASONS, IOS_PRIVACY_ACCESSED_APIS, object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readJson = (path) => {
|
|
12915
|
+
var DEVICES_PACKAGE = "@absolutejs/devices", ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES, ADAPTERS, SOURCE_GLOB, IGNORED_DIRECTORIES, IDENTIFIER_PATTERN, providerModulePattern = (provider) => new RegExp(`^@absolutejs/devices-${provider}/[a-z][a-z0-9-]*$`, "u"), providerPackagePattern = (provider) => provider === "capacitor" ? /^@capacitor\/[a-z][a-z0-9-]*@\d+\.\d+\.\d+$/u : /^(?:expo-[a-z][a-z0-9-]*|@react-native-[a-z0-9-]+\/[a-z][a-z0-9-]*)@\d+\.\d+\.\d+$/u, providerLabel = (provider) => provider === "capacitor" ? "Capacitor" : "Expo", ANDROID_PERMISSION_PATTERN, IOS_USAGE_DESCRIPTIONS, IOS_PRIVACY_ACCESSED_API_REASONS, IOS_PRIVACY_ACCESSED_APIS, object = (value) => typeof value === "object" && value !== null && !Array.isArray(value), readJson = (path) => {
|
|
12890
12916
|
const value = JSON.parse(readFileSync13(path, "utf8"));
|
|
12891
12917
|
if (!object(value))
|
|
12892
12918
|
throw new TypeError(`${path} must contain an object.`);
|
|
@@ -13117,6 +13143,11 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ADAPTERS, SOURCE_GLOB, IGNORED_DIRE
|
|
|
13117
13143
|
}, resolveAbsoluteDeviceCapabilityPlan = (projectRoot, provider = "capacitor") => {
|
|
13118
13144
|
const allProviders = loadAbsoluteDeviceCapabilityProviders(projectRoot, provider);
|
|
13119
13145
|
const capabilities = discoverAbsoluteDeviceCapabilities(projectRoot, allProviders);
|
|
13146
|
+
for (const capability of ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES) {
|
|
13147
|
+
if (allProviders[capability] && !capabilities.includes(capability))
|
|
13148
|
+
capabilities.push(capability);
|
|
13149
|
+
}
|
|
13150
|
+
capabilities.sort();
|
|
13120
13151
|
const providers = {};
|
|
13121
13152
|
for (const name of capabilities) {
|
|
13122
13153
|
const capabilityProvider = allProviders[name];
|
|
@@ -13132,6 +13163,10 @@ var DEVICES_PACKAGE = "@absolutejs/devices", ADAPTERS, SOURCE_GLOB, IGNORED_DIRE
|
|
|
13132
13163
|
};
|
|
13133
13164
|
};
|
|
13134
13165
|
var init_deviceCapabilities = __esm(() => {
|
|
13166
|
+
ABSOLUTE_MOBILE_SHELL_DEVICE_CAPABILITIES = [
|
|
13167
|
+
"keyboard",
|
|
13168
|
+
"systemBars"
|
|
13169
|
+
];
|
|
13135
13170
|
ADAPTERS = {
|
|
13136
13171
|
capacitor: "@absolutejs/devices-capacitor",
|
|
13137
13172
|
expo: "@absolutejs/devices-expo"
|
|
@@ -14669,6 +14704,7 @@ import "${hmrClientPath3}";
|
|
|
14669
14704
|
` : "";
|
|
14670
14705
|
const bootstrap = `${hmrImports}import Component from "${importPath}";
|
|
14671
14706
|
import { hydrate, mount, unmount } from "svelte";
|
|
14707
|
+
import { prepareBrowserTranslationHydration } from "@absolutejs/absolute/client";
|
|
14672
14708
|
|
|
14673
14709
|
var initialProps = (typeof window !== "undefined" && window.__INITIAL_PROPS__) ? window.__INITIAL_PROPS__ : {};
|
|
14674
14710
|
var isHMR = typeof window !== "undefined" && window.__SVELTE_COMPONENT__ !== undefined;
|
|
@@ -14713,7 +14749,12 @@ if (isHMR) {
|
|
|
14713
14749
|
} else if (isSsrDirty || hasIslandHtml) {
|
|
14714
14750
|
component = mount(Component, { target, props: initialProps });
|
|
14715
14751
|
} else {
|
|
14716
|
-
|
|
14752
|
+
var restoreTranslation = prepareBrowserTranslationHydration(target);
|
|
14753
|
+
try {
|
|
14754
|
+
component = hydrate(Component, { target, props: initialProps });
|
|
14755
|
+
} finally {
|
|
14756
|
+
restoreTranslation();
|
|
14757
|
+
}
|
|
14717
14758
|
}
|
|
14718
14759
|
|
|
14719
14760
|
if (typeof window !== "undefined") {
|
|
@@ -15656,6 +15697,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15656
15697
|
...vueHmrImports,
|
|
15657
15698
|
`import Comp, * as PageModule from "${relative13(dirname17(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
15658
15699
|
'import { createSSRApp, createApp } from "vue";',
|
|
15700
|
+
'import { prepareBrowserTranslationHydration } from "@absolutejs/absolute/vue";',
|
|
15659
15701
|
"",
|
|
15660
15702
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
15661
15703
|
'let preservedState = (typeof window !== "undefined" && window.__HMR_PRESERVED_STATE__) ? window.__HMR_PRESERVED_STATE__ : {};',
|
|
@@ -15718,7 +15760,14 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
15718
15760
|
" url: clientUrl",
|
|
15719
15761
|
" });",
|
|
15720
15762
|
" }",
|
|
15721
|
-
|
|
15763
|
+
" const restoreBrowserTranslation = shouldHydrate",
|
|
15764
|
+
' ? prepareBrowserTranslationHydration(document.querySelector("#root"))',
|
|
15765
|
+
" : () => undefined;",
|
|
15766
|
+
" try {",
|
|
15767
|
+
' app.mount("#root");',
|
|
15768
|
+
" } finally {",
|
|
15769
|
+
" restoreBrowserTranslation();",
|
|
15770
|
+
" }",
|
|
15722
15771
|
"}",
|
|
15723
15772
|
"const absolutePageReady = bootstrapApp();",
|
|
15724
15773
|
"",
|
|
@@ -17479,6 +17528,7 @@ import { bootstrapApplication } from '@angular/platform-browser';
|
|
|
17479
17528
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
17480
17529
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
17481
17530
|
import { provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
|
|
17531
|
+
import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
|
|
17482
17532
|
import * as pageModule from '${normalizedImportPath}';
|
|
17483
17533
|
var ${componentClassName} = pageModule.default;
|
|
17484
17534
|
// REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
|
|
@@ -17542,8 +17592,10 @@ if (!document.querySelector(_sel)) {
|
|
|
17542
17592
|
}
|
|
17543
17593
|
|
|
17544
17594
|
var providers = [provideZonelessChangeDetection()];
|
|
17595
|
+
var restoreTranslation = function() {};
|
|
17545
17596
|
if (!isClientRender && !window.__HMR_SKIP_HYDRATION__ && !pageHasIslands) {
|
|
17546
17597
|
providers.push(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
17598
|
+
restoreTranslation = prepareBrowserTranslationHydration(document.querySelector(_sel));
|
|
17547
17599
|
}
|
|
17548
17600
|
delete window.__HMR_SKIP_HYDRATION__;
|
|
17549
17601
|
providers.push.apply(providers, pageProviders);
|
|
@@ -17570,7 +17622,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
17570
17622
|
});
|
|
17571
17623
|
}
|
|
17572
17624
|
return appRef;
|
|
17573
|
-
});
|
|
17625
|
+
}).finally(restoreTranslation);
|
|
17574
17626
|
}
|
|
17575
17627
|
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
17576
17628
|
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
@@ -17586,6 +17638,7 @@ import { bootstrapApplication } from '@angular/platform-browser';
|
|
|
17586
17638
|
import { provideClientHydration } from '@angular/platform-browser';
|
|
17587
17639
|
import { withHttpTransferCacheOptions } from '@angular/platform-browser';
|
|
17588
17640
|
import { enableProdMode, provideZonelessChangeDetection, REQUEST_CONTEXT } from '@angular/core';
|
|
17641
|
+
import { prepareBrowserTranslationHydration } from '@absolutejs/absolute/client';
|
|
17589
17642
|
import * as pageModule from '${normalizedImportPath}';
|
|
17590
17643
|
var ${componentClassName} = pageModule.default;
|
|
17591
17644
|
// REQUEST_CONTEXT is hydrated from the SSR-serialized payload so client-side
|
|
@@ -17628,8 +17681,10 @@ if (!document.querySelector(_sel)) {
|
|
|
17628
17681
|
}
|
|
17629
17682
|
|
|
17630
17683
|
var providers = [provideZonelessChangeDetection()].concat(pageProviders).concat(contextProviders);
|
|
17684
|
+
var restoreTranslation = function() {};
|
|
17631
17685
|
if (!isClientRender && !pageHasIslands) {
|
|
17632
17686
|
providers.unshift(provideClientHydration(withHttpTransferCacheOptions(absoluteHttpTransferCacheOptions)));
|
|
17687
|
+
restoreTranslation = prepareBrowserTranslationHydration(document.querySelector(_sel));
|
|
17633
17688
|
}
|
|
17634
17689
|
window.__ABS_SLOT_HYDRATION_PENDING__ = pageHasRawStreamingSlots;
|
|
17635
17690
|
var absolutePageReady = Promise.resolve();
|
|
@@ -17653,7 +17708,7 @@ if (pageHasRawStreamingSlots) {
|
|
|
17653
17708
|
});
|
|
17654
17709
|
}
|
|
17655
17710
|
return appRef;
|
|
17656
|
-
});
|
|
17711
|
+
}).finally(restoreTranslation);
|
|
17657
17712
|
}
|
|
17658
17713
|
window.__ABSOLUTE_PAGE_READY__ = absolutePageReady;
|
|
17659
17714
|
window.__ABSOLUTE_PAGE_DISPOSE__ = async function() {
|
|
@@ -26792,7 +26847,7 @@ var resolveRequestPathname = (request) => {
|
|
|
26792
26847
|
}, buildHtmlShell = (headTag, bodyContent, indexPath, props, hmrShim) => {
|
|
26793
26848
|
const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(props ?? {})};`;
|
|
26794
26849
|
const indexImport = indexPath ? `<script type="module" src="${indexPath}"></script>` : "";
|
|
26795
|
-
return `<!DOCTYPE html><html>${headTag}<body>` + `<div id="ember-root">${bodyContent}</div>` + `<script>${propsScript}</script>${indexImport}${hmrShim}</body></html
|
|
26850
|
+
return injectBrowserTranslationBaseline(`<!DOCTYPE html><html>${headTag}<body>` + `<div id="ember-root">${bodyContent}</div>` + `<script>${propsScript}</script>${indexImport}${hmrShim}</body></html>`);
|
|
26796
26851
|
}, cachedEmberHmrShim = null, getEmberHmrShim = () => {
|
|
26797
26852
|
if (cachedEmberHmrShim)
|
|
26798
26853
|
return cachedEmberHmrShim;
|
|
@@ -26829,6 +26884,7 @@ var resolveRequestPathname = (request) => {
|
|
|
26829
26884
|
};
|
|
26830
26885
|
var init_pageHandler = __esm(() => {
|
|
26831
26886
|
init_pageResponseCache();
|
|
26887
|
+
init_browserTranslation();
|
|
26832
26888
|
});
|
|
26833
26889
|
|
|
26834
26890
|
// src/ember/index.ts
|
|
@@ -30401,5 +30457,5 @@ export {
|
|
|
30401
30457
|
devBuild
|
|
30402
30458
|
};
|
|
30403
30459
|
|
|
30404
|
-
//# debugId=
|
|
30460
|
+
//# debugId=4EDBC695914C265064756E2164756E21
|
|
30405
30461
|
//# sourceMappingURL=build.js.map
|