@absolutejs/absolute 0.20.0-beta.57 → 0.20.0-beta.59
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/build.js +5 -4
- package/dist/build.js.map +3 -3
- package/dist/cli/index.js +50 -7
- package/dist/index.js +5 -4
- package/dist/index.js.map +3 -3
- package/dist/mobile/browser.js +264 -2
- package/dist/mobile/browser.js.map +5 -4
- package/dist/mobile/index.js +284 -6
- package/dist/mobile/index.js.map +9 -8
- package/dist/mobile/remoteMacAgentEntry.js +13 -3
- package/dist/mobile/shellBootstrap.js +763 -54
- package/dist/mobile/shellSync.js +18 -7
- package/dist/mobile/uiPrimitives.js +264 -0
- package/dist/src/mobile/browser.d.ts +1 -0
- package/dist/src/mobile/index.d.ts +1 -0
- package/dist/src/mobile/navigationLifecycle.d.ts +36 -0
- package/dist/src/mobile/navigationState.d.ts +53 -0
- package/dist/src/mobile/transport.d.ts +1 -0
- package/dist/src/mobile/uiPrimitives.d.ts +37 -0
- package/package.json +11 -7
|
@@ -826,6 +826,11 @@ const bridgeBootstrap = (path: string, safeAreaInsets: { bottom: number; left: n
|
|
|
826
826
|
send({ format: 3, kind: 'event', event: 'navigation', path });
|
|
827
827
|
}
|
|
828
828
|
};
|
|
829
|
+
globalThis.__absoluteRequestBack = () => {
|
|
830
|
+
const event = new CustomEvent('absolute:back-request', { cancelable: true });
|
|
831
|
+
if (!dispatchEvent(event)) return;
|
|
832
|
+
send({ format: 3, kind: 'event', event: 'back-unhandled', path: currentPath });
|
|
833
|
+
};
|
|
829
834
|
if (\${DEV_ORIGIN ? 'true' : 'false'}) {
|
|
830
835
|
const publishPath = () => {
|
|
831
836
|
const path = location.pathname + location.search + location.hash;
|
|
@@ -931,12 +936,12 @@ export function AbsoluteWebHost() {
|
|
|
931
936
|
}, [safeAreaInsets.bottom, safeAreaInsets.left, safeAreaInsets.right, safeAreaInsets.top]);
|
|
932
937
|
useEffect(() => {
|
|
933
938
|
const subscription = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
934
|
-
if (!
|
|
935
|
-
webView.current?.
|
|
939
|
+
if (!indexUri) return false;
|
|
940
|
+
webView.current?.injectJavaScript('globalThis.__absoluteRequestBack?.(); true;');
|
|
936
941
|
return true;
|
|
937
942
|
});
|
|
938
943
|
return () => subscription.remove();
|
|
939
|
-
}, [
|
|
944
|
+
}, [indexUri]);
|
|
940
945
|
|
|
941
946
|
const respond = (message: Record<string, unknown>) => {
|
|
942
947
|
const source = JSON.stringify(message).replaceAll('\\u2028', '\\\\u2028').replaceAll('\\u2029', '\\\\u2029');
|
|
@@ -976,6 +981,11 @@ export function AbsoluteWebHost() {
|
|
|
976
981
|
else activeWebPath.current = message.path;
|
|
977
982
|
return;
|
|
978
983
|
}
|
|
984
|
+
if (message.kind === 'event' && message.event === 'back-unhandled') {
|
|
985
|
+
if (canGoBack) webView.current?.goBack();
|
|
986
|
+
else BackHandler.exitApp();
|
|
987
|
+
return;
|
|
988
|
+
}
|
|
979
989
|
if (message.kind !== 'request' || typeof message.id !== 'string' || message.path !== activeWebPath.current) return;
|
|
980
990
|
try {
|
|
981
991
|
if (typeof message.params !== 'object' || message.params === null || Array.isArray(message.params)) throw new Error('Expo bridge method params are invalid.');
|