@burdenoff/fe-libs 2026.819.5 → 2026.823.2
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 +66 -0
- package/dist/button/Button.d.ts +1 -1
- package/dist/chrome/AppShellLayout.d.ts +14 -0
- package/dist/chrome/AppShellLayout.d.ts.map +1 -1
- package/dist/chrome/AppShellLayout.js +13 -10
- package/dist/chrome/DynamicFooter.d.ts +6 -1
- package/dist/chrome/DynamicFooter.d.ts.map +1 -1
- package/dist/chrome/DynamicFooter.js +21 -20
- package/dist/chrome/Footer.d.ts +6 -0
- package/dist/chrome/Footer.d.ts.map +1 -1
- package/dist/chrome/Footer.js +46 -45
- package/dist/chrome/FooterBar.d.ts +6 -1
- package/dist/chrome/FooterBar.d.ts.map +1 -1
- package/dist/chrome/FooterBar.js +28 -26
- package/dist/chrome/HeaderBar.d.ts.map +1 -1
- package/dist/chrome/HeaderBar.js +3 -0
- package/dist/chrome/MobileTabBar.d.ts +26 -0
- package/dist/chrome/MobileTabBar.d.ts.map +1 -0
- package/dist/chrome/MobileTabBar.js +194 -0
- package/dist/chrome/NativePageTransition.d.ts +10 -0
- package/dist/chrome/NativePageTransition.d.ts.map +1 -0
- package/dist/chrome/NativePageTransition.js +19 -0
- package/dist/chrome/NativeTopBar.d.ts +21 -0
- package/dist/chrome/NativeTopBar.d.ts.map +1 -0
- package/dist/chrome/NativeTopBar.js +72 -0
- package/dist/chrome/NotificationCenter.d.ts.map +1 -1
- package/dist/chrome/NotificationCenter.js +70 -65
- package/dist/chrome/ProductSideNav.d.ts.map +1 -1
- package/dist/chrome/ProductSideNav.js +44 -74
- package/dist/chrome/SwipeNavigation.d.ts +36 -0
- package/dist/chrome/SwipeNavigation.d.ts.map +1 -0
- package/dist/chrome/SwipeNavigation.js +111 -0
- package/dist/chrome/index.d.ts +14 -7
- package/dist/chrome/index.d.ts.map +1 -1
- package/dist/chrome/mobileTabBar/selectTabs.d.ts +45 -0
- package/dist/chrome/mobileTabBar/selectTabs.d.ts.map +1 -0
- package/dist/chrome/mobileTabBar/selectTabs.js +28 -0
- package/dist/chrome/mobileTabBar/useMobileTabBarVisible.d.ts +18 -0
- package/dist/chrome/mobileTabBar/useMobileTabBarVisible.d.ts.map +1 -0
- package/dist/chrome/mobileTabBar/useMobileTabBarVisible.js +16 -0
- package/dist/chrome/mobileTabBar/useVisibleNavItems.d.ts +18 -0
- package/dist/chrome/mobileTabBar/useVisibleNavItems.d.ts.map +1 -0
- package/dist/chrome/mobileTabBar/useVisibleNavItems.js +41 -0
- package/dist/chrome/nativeTopBarTitle.d.ts +15 -0
- package/dist/chrome/nativeTopBarTitle.d.ts.map +1 -0
- package/dist/chrome/nativeTopBarTitle.js +22 -0
- package/dist/chrome/swipe/swipeMath.d.ts +25 -0
- package/dist/chrome/swipe/swipeMath.d.ts.map +1 -0
- package/dist/chrome/swipe/swipeMath.js +14 -0
- package/dist/chrome/swipe/swipeState.d.ts +10 -0
- package/dist/chrome/swipe/swipeState.d.ts.map +1 -0
- package/dist/chrome/swipe/swipeState.js +11 -0
- package/dist/chrome.js +8 -1
- package/dist/shared/components/DesktopUpdateToast.d.ts +9 -0
- package/dist/shared/components/DesktopUpdateToast.d.ts.map +1 -0
- package/dist/shared/components/DesktopUpdateToast.js +39 -0
- package/dist/shared/components/PWAInstallBanner.js +1 -1
- package/dist/shared/components/SSORedirectGuard.d.ts.map +1 -1
- package/dist/shared/components/SSORedirectGuard.js +41 -45
- package/dist/shared/components/index.d.ts +2 -0
- package/dist/shared/components/index.d.ts.map +1 -1
- package/dist/shared/config/authBridgeUrls.d.ts +10 -0
- package/dist/shared/config/authBridgeUrls.d.ts.map +1 -1
- package/dist/shared/config/authBridgeUrls.js +16 -12
- package/dist/shared/config/gatewayUrls.d.ts.map +1 -1
- package/dist/shared/config/gatewayUrls.js +22 -19
- package/dist/shared/config/index.d.ts +1 -1
- package/dist/shared/config/index.d.ts.map +1 -1
- package/dist/shared/hooks/shell/useNavRegistry.d.ts +7 -0
- package/dist/shared/hooks/shell/useNavRegistry.d.ts.map +1 -1
- package/dist/shared/hooks/usePWA.d.ts.map +1 -1
- package/dist/shared/hooks/usePWA.js +34 -30
- package/dist/shared/native/consumers.d.ts +15 -1
- package/dist/shared/native/consumers.d.ts.map +1 -1
- package/dist/shared/native/consumers.js +26 -7
- package/dist/shared/native/desktop.d.ts +123 -0
- package/dist/shared/native/desktop.d.ts.map +1 -0
- package/dist/shared/native/desktop.js +280 -0
- package/dist/shared/native/entry.d.ts +39 -0
- package/dist/shared/native/entry.d.ts.map +1 -0
- package/dist/shared/native/entry.js +13 -0
- package/dist/shared/native/hooks/index.d.ts +10 -0
- package/dist/shared/native/hooks/index.d.ts.map +1 -1
- package/dist/shared/native/hooks/index.js +6 -0
- package/dist/shared/native/hooks/useActionSheet.d.ts +63 -0
- package/dist/shared/native/hooks/useActionSheet.d.ts.map +1 -0
- package/dist/shared/native/hooks/useActionSheet.js +45 -0
- package/dist/shared/native/hooks/useDesktop.d.ts +15 -0
- package/dist/shared/native/hooks/useDesktop.d.ts.map +1 -0
- package/dist/shared/native/hooks/useDesktop.js +18 -0
- package/dist/shared/native/hooks/useDesktopUpdateState.d.ts +7 -0
- package/dist/shared/native/hooks/useDesktopUpdateState.d.ts.map +1 -0
- package/dist/shared/native/hooks/useDesktopUpdateState.js +20 -0
- package/dist/shared/native/hooks/useDesktopWindowState.d.ts +7 -0
- package/dist/shared/native/hooks/useDesktopWindowState.d.ts.map +1 -0
- package/dist/shared/native/hooks/useDesktopWindowState.js +9 -0
- package/dist/shared/native/hooks/useHaptics.d.ts +1 -0
- package/dist/shared/native/hooks/useHaptics.d.ts.map +1 -1
- package/dist/shared/native/hooks/useHaptics.js +6 -6
- package/dist/shared/native/hooks/useNetworkStatus.d.ts +23 -0
- package/dist/shared/native/hooks/useNetworkStatus.d.ts.map +1 -0
- package/dist/shared/native/hooks/useNetworkStatus.js +29 -0
- package/dist/shared/native/hooks/usePullToRefresh.d.ts +62 -0
- package/dist/shared/native/hooks/usePullToRefresh.d.ts.map +1 -0
- package/dist/shared/native/hooks/usePullToRefresh.js +84 -0
- package/dist/shared/native/index.d.ts +6 -1
- package/dist/shared/native/index.d.ts.map +1 -1
- package/dist/shared/native/platform.d.ts.map +1 -1
- package/dist/shared/native/platform.js +2 -1
- package/dist/shared/native/purchases.d.ts +7 -1
- package/dist/shared/native/purchases.d.ts.map +1 -1
- package/dist/shared/native/purchases.js +3 -3
- package/dist/shared/native/types.d.ts +136 -0
- package/dist/shared/native/types.d.ts.map +1 -1
- package/dist/shared/providers/AppShellProvider.d.ts.map +1 -1
- package/dist/shared/providers/AppShellProvider.js +117 -115
- package/dist/shared/providers/shell/ThemeProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/ThemeProvider.js +64 -51
- package/dist/shared/providers/shell/authProvider/useSsoDepositBootGuard.d.ts.map +1 -1
- package/dist/shared/providers/shell/authProvider/useSsoDepositBootGuard.js +25 -29
- package/dist/shared/utils/gatewayFetchRewrite.d.ts.map +1 -1
- package/dist/shared/utils/gatewayFetchRewrite.js +87 -84
- package/dist/shared-components.js +2 -1
- package/dist/shared-config.js +10 -10
- package/dist/shared-native.js +21 -13
- package/dist/shared.js +120 -111
- package/dist/shell-native/actionSheet.d.ts +7 -0
- package/dist/shell-native/actionSheet.d.ts.map +1 -0
- package/dist/shell-native/actionSheet.js +26 -0
- package/dist/shell-native/app-lifecycle.d.ts +4 -0
- package/dist/shell-native/app-lifecycle.d.ts.map +1 -0
- package/dist/shell-native/app-lifecycle.js +12 -0
- package/dist/shell-native/auth-navigation.d.ts +4 -0
- package/dist/shell-native/auth-navigation.d.ts.map +1 -0
- package/dist/shell-native/auth-navigation.js +95 -0
- package/dist/shell-native/back-button.d.ts +8 -0
- package/dist/shell-native/back-button.d.ts.map +1 -0
- package/dist/shell-native/back-button.js +49 -0
- package/dist/shell-native/boot.d.ts +10 -0
- package/dist/shell-native/boot.d.ts.map +1 -0
- package/dist/shell-native/boot.js +65 -0
- package/dist/shell-native/bridge.d.ts +7 -0
- package/dist/shell-native/bridge.d.ts.map +1 -0
- package/dist/shell-native/bridge.js +30 -0
- package/dist/shell-native/browser.d.ts +12 -0
- package/dist/shell-native/browser.d.ts.map +1 -0
- package/dist/shell-native/browser.js +45 -0
- package/dist/shell-native/capacitor-config.d.ts +21 -0
- package/dist/shell-native/capacitor-config.d.ts.map +1 -0
- package/dist/shell-native/capacitor-config.js +102 -0
- package/dist/shell-native/clipboard.d.ts +3 -0
- package/dist/shell-native/clipboard.d.ts.map +1 -0
- package/dist/shell-native/clipboard.js +26 -0
- package/dist/shell-native/deep-link.d.ts +19 -0
- package/dist/shell-native/deep-link.d.ts.map +1 -0
- package/dist/shell-native/deep-link.js +53 -0
- package/dist/shell-native/desktop-bridge.d.ts +14 -0
- package/dist/shell-native/desktop-bridge.d.ts.map +1 -0
- package/dist/shell-native/desktop-bridge.js +17 -0
- package/dist/shell-native/device.d.ts +4 -0
- package/dist/shell-native/device.d.ts.map +1 -0
- package/dist/shell-native/device.js +27 -0
- package/dist/shell-native/dialog.d.ts +4 -0
- package/dist/shell-native/dialog.d.ts.map +1 -0
- package/dist/shell-native/dialog.js +13 -0
- package/dist/shell-native/feedback.d.ts +6 -0
- package/dist/shell-native/feedback.d.ts.map +1 -0
- package/dist/shell-native/feedback.js +29 -0
- package/dist/shell-native/index.d.ts +54 -0
- package/dist/shell-native/index.d.ts.map +1 -0
- package/dist/shell-native/keyboard.d.ts +15 -0
- package/dist/shell-native/keyboard.d.ts.map +1 -0
- package/dist/shell-native/keyboard.js +42 -0
- package/dist/shell-native/network.d.ts +9 -0
- package/dist/shell-native/network.d.ts.map +1 -0
- package/dist/shell-native/network.js +40 -0
- package/dist/shell-native/ota.d.ts +3 -0
- package/dist/shell-native/ota.d.ts.map +1 -0
- package/dist/shell-native/ota.js +21 -0
- package/dist/shell-native/platform.d.ts +21 -0
- package/dist/shell-native/platform.d.ts.map +1 -0
- package/dist/shell-native/platform.js +51 -0
- package/dist/shell-native/preview.d.ts +18 -0
- package/dist/shell-native/preview.d.ts.map +1 -0
- package/dist/shell-native/preview.js +124 -0
- package/dist/shell-native/push.d.ts +14 -0
- package/dist/shell-native/push.d.ts.map +1 -0
- package/dist/shell-native/push.js +62 -0
- package/dist/shell-native/pwa.d.ts +14 -0
- package/dist/shell-native/pwa.d.ts.map +1 -0
- package/dist/shell-native/pwa.js +49 -0
- package/dist/shell-native/service-worker.d.ts +5 -0
- package/dist/shell-native/service-worker.d.ts.map +1 -0
- package/dist/shell-native/service-worker.js +144 -0
- package/dist/shell-native/share.d.ts +4 -0
- package/dist/shell-native/share.d.ts.map +1 -0
- package/dist/shell-native/share.js +19 -0
- package/dist/shell-native/splash.d.ts +16 -0
- package/dist/shell-native/splash.d.ts.map +1 -0
- package/dist/shell-native/splash.js +25 -0
- package/dist/shell-native/system-bars.d.ts +24 -0
- package/dist/shell-native/system-bars.d.ts.map +1 -0
- package/dist/shell-native/system-bars.js +49 -0
- package/dist/shell-native/toast.d.ts +4 -0
- package/dist/shell-native/toast.d.ts.map +1 -0
- package/dist/shell-native/toast.js +16 -0
- package/dist/shell-native/types.d.ts +292 -0
- package/dist/shell-native/types.d.ts.map +1 -0
- package/dist/shell-native/web-manifest.d.ts +36 -0
- package/dist/shell-native/web-manifest.d.ts.map +1 -0
- package/dist/shell-native/web-manifest.js +55 -0
- package/dist/shell-native.d.ts +2 -0
- package/dist/shell-native.js +29 -0
- package/dist/ui/action-sheet.d.ts +29 -0
- package/dist/ui/action-sheet.d.ts.map +1 -0
- package/dist/ui/action-sheet.js +53 -0
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/index.d.ts +6 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/native-welcome.d.ts +61 -0
- package/dist/ui/native-welcome.d.ts.map +1 -0
- package/dist/ui/native-welcome.js +152 -0
- package/dist/ui/offline-banner.d.ts +22 -0
- package/dist/ui/offline-banner.d.ts.map +1 -0
- package/dist/ui/offline-banner.js +34 -0
- package/dist/ui/pull-to-refresh.d.ts +29 -0
- package/dist/ui/pull-to-refresh.d.ts.map +1 -0
- package/dist/ui/pull-to-refresh.js +44 -0
- package/dist/ui/pwa-update-toast.d.ts +34 -0
- package/dist/ui/pwa-update-toast.d.ts.map +1 -0
- package/dist/ui/pwa-update-toast.js +43 -0
- package/dist/ui/select.d.ts +38 -0
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +162 -61
- package/dist/ui.js +40 -35
- package/package.json +93 -4
- package/src/shared/styles/app-shell.css +3 -0
- package/src/shared/styles/native.css +577 -0
- package/dist/node_modules/@capacitor/core/dist/index.js +0 -268
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@burdenoff/fe-libs/shell-native` — the shell-side native runtime.
|
|
3
|
+
*
|
|
4
|
+
* APP SHELLS ONLY. Microfrontends must never import this entry point: they talk
|
|
5
|
+
* to the shell through `window.__burdenoffNativeBridge`
|
|
6
|
+
* (`@burdenoff/fe-libs/shared/native`). Nothing here is re-exported from the
|
|
7
|
+
* `shared/native` barrel by design.
|
|
8
|
+
*
|
|
9
|
+
* Typical wiring (`main.tsx`, before React mounts):
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { bootNativeShell } from '@burdenoff/fe-libs/shell-native';
|
|
12
|
+
*
|
|
13
|
+
* const shell = bootNativeShell({
|
|
14
|
+
* product: 'vibecontrols',
|
|
15
|
+
* appName: 'VibeControls',
|
|
16
|
+
* plugins: {
|
|
17
|
+
* updater: () => import('@capgo/capacitor-updater'),
|
|
18
|
+
* pushNotifications: () => import('@capacitor/push-notifications'),
|
|
19
|
+
* },
|
|
20
|
+
* push: { enabled: true },
|
|
21
|
+
* });
|
|
22
|
+
* // …after the first meaningful paint:
|
|
23
|
+
* void shell.markAppReady();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export { bootNativeShell, resetNativeShellBootForTests } from './boot';
|
|
27
|
+
export { APP_READY_EVENT, armSplashSafetyTimer, isAppReady, markAppReady, resetAppReadyForTests, } from './splash';
|
|
28
|
+
export { clearDeepLinkNavigator, deepLinkUrlToPath, installDeepLinkHandler, navigateDeepLinkPath, registerDeepLinkNavigator, } from './deep-link';
|
|
29
|
+
export { installNativeBridge } from './bridge';
|
|
30
|
+
export { applyNativePlatformClass, getNativePlatform, isNativePlatform, isNativePluginAvailable, isNativePreview, isRealNativePlatform, } from './platform';
|
|
31
|
+
export { applyNativePreview, getActiveNativePreview, resolveNativePreview, NATIVE_PREVIEW_QUERY_PARAM, NATIVE_PREVIEW_STORAGE_KEY, } from './preview';
|
|
32
|
+
export { showNativeActionSheet } from './actionSheet';
|
|
33
|
+
export { installExternalUrlOpener, openExternalUrl } from './browser';
|
|
34
|
+
export { writeClipboardText } from './clipboard';
|
|
35
|
+
export { showNativeConfirm } from './dialog';
|
|
36
|
+
export { impactFeedback, notificationFeedback, selectionFeedback } from './feedback';
|
|
37
|
+
export { shareContent } from './share';
|
|
38
|
+
export { showNativeToast } from './toast';
|
|
39
|
+
export { populateDeviceInfo } from './device';
|
|
40
|
+
export { installMobileRuntimeHooks } from './app-lifecycle';
|
|
41
|
+
export { DEFAULT_AUTH_INTERCEPT_PREFIXES, installNativeAuthNavigationIntercept, } from './auth-navigation';
|
|
42
|
+
export { createDefaultBackButtonHandlers, installBackButtonHandler, runBackButtonPrecedence, } from './back-button';
|
|
43
|
+
export { configureKeyboard, keyboardHandlers, KEYBOARD_HEIGHT_CSS_VAR, KEYBOARD_OPEN_CLASS, } from './keyboard';
|
|
44
|
+
export { getLastNetworkStatus, installNetworkListener, NETWORK_STATUS_EVENT } from './network';
|
|
45
|
+
export { applyStatusBarTheme, DARK_FAMILY_THEMES, installStatusBarThemeListener, isDarkThemeName, resolveDocumentIsDark, statusBarDetailIsDark, type StatusBarThemeDetail, } from './system-bars';
|
|
46
|
+
export { notifyOtaReady } from './ota';
|
|
47
|
+
export { installPushNotifications, requestPushPermission, PUSH_TOKEN_EVENT } from './push';
|
|
48
|
+
export { installPwa, installPwaPrompt, isPwaEligibleHost, resetPwaForTests, PWA_INSTALLED_EVENT, PWA_INSTALL_AVAILABLE_EVENT, PWA_UPDATE_READY_EVENT, } from './pwa';
|
|
49
|
+
export { configureElectronGlobalKey, getDesktopBridge, getElectronGlobalKey, getLegacyElectronBridge, isDesktopShell, } from './desktop-bridge';
|
|
50
|
+
export { defineCapacitorConfig, type CapacitorConfigLike } from './capacitor-config';
|
|
51
|
+
export { defineWebManifest, type WebManifestIcon, type WebManifestLike, type WebManifestShortcut, } from './web-manifest';
|
|
52
|
+
export { renderServiceWorker, SERVICE_WORKER_TEMPLATE } from './service-worker';
|
|
53
|
+
export type { AuthInterceptOptions, BackButtonHandlers, BeforeInstallPromptEventLike, BootNativeShellOptions, CapacitorListenerHandleLike, CapacitorUpdaterLike, DeepLinkDetail, LegacyElectronBridge, MobileRuntimeHooks, NativeConfig, NativePreviewMode, NativeShellHandle, NativeShellPlatform, NetworkHooks, NetworkStatusDetail, OptionalPluginLoaders, PushActionPerformedLike, PushNotificationSchemaLike, PushNotificationsLike, PushNotificationsLoader, PushOptions, PushPermissionStateLike, PushTokenLike, PwaOptions, SplashOptions, UpdaterLoader, } from './types';
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/shell-native/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const KEYBOARD_HEIGHT_CSS_VAR = "--keyboard-height";
|
|
2
|
+
export declare const KEYBOARD_OPEN_CLASS = "keyboard-open";
|
|
3
|
+
/** Handlers are exported for unit tests; the installer wires them to the plugin. */
|
|
4
|
+
export declare const keyboardHandlers: {
|
|
5
|
+
willShow(keyboardHeight: number): void;
|
|
6
|
+
didShow(keyboardHeight: number): void;
|
|
7
|
+
willHide(): void;
|
|
8
|
+
didHide(): void;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Body resize mode, accessory bar off, `--keyboard-height` + `body.keyboard-open`,
|
|
12
|
+
* and `burdenoff:keyboardWillShow/DidShow/WillHide/DidHide` window events.
|
|
13
|
+
*/
|
|
14
|
+
export declare function configureKeyboard(): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/shell-native/keyboard.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAC3D,eAAO,MAAM,mBAAmB,kBAAkB,CAAC;AAcnD,oFAAoF;AACpF,eAAO,MAAM,gBAAgB;6BACF,MAAM,GAAG,IAAI;4BAId,MAAM,GAAG,IAAI;gBAIzB,IAAI;eAIL,IAAI;CAIhB,CAAC;AAIF;;;GAGG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuBvD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isNativePluginAvailable as e } from "./platform.js";
|
|
2
|
+
import { Keyboard as t, KeyboardResize as n } from "@capacitor/keyboard";
|
|
3
|
+
//#region src/shell-native/keyboard.ts
|
|
4
|
+
var r = "--keyboard-height", i = "keyboard-open";
|
|
5
|
+
function a(e) {
|
|
6
|
+
typeof document > "u" || (document.documentElement.style.setProperty(r, `${e}px`), e > 0 ? document.body?.classList.add(i) : document.body?.classList.remove(i));
|
|
7
|
+
}
|
|
8
|
+
function o(e, t) {
|
|
9
|
+
typeof window > "u" || window.dispatchEvent(new CustomEvent(e, { detail: { keyboardHeight: t } }));
|
|
10
|
+
}
|
|
11
|
+
var s = {
|
|
12
|
+
willShow(e) {
|
|
13
|
+
a(e), o("burdenoff:keyboardWillShow", e);
|
|
14
|
+
},
|
|
15
|
+
didShow(e) {
|
|
16
|
+
a(e), o("burdenoff:keyboardDidShow", e);
|
|
17
|
+
},
|
|
18
|
+
willHide() {
|
|
19
|
+
a(0), o("burdenoff:keyboardWillHide", 0);
|
|
20
|
+
},
|
|
21
|
+
didHide() {
|
|
22
|
+
a(0), o("burdenoff:keyboardDidHide", 0);
|
|
23
|
+
}
|
|
24
|
+
}, c = !1;
|
|
25
|
+
async function l() {
|
|
26
|
+
if (!c && e("Keyboard")) {
|
|
27
|
+
c = !0, typeof document < "u" && a(0);
|
|
28
|
+
try {
|
|
29
|
+
await Promise.all([
|
|
30
|
+
t.setResizeMode({ mode: n.Body }).catch(() => void 0),
|
|
31
|
+
t.setAccessoryBarVisible({ isVisible: !1 }).catch(() => void 0),
|
|
32
|
+
t.setScroll({ isDisabled: !1 }).catch(() => void 0),
|
|
33
|
+
t.addListener("keyboardWillShow", (e) => s.willShow(e.keyboardHeight)),
|
|
34
|
+
t.addListener("keyboardDidShow", (e) => s.didShow(e.keyboardHeight)),
|
|
35
|
+
t.addListener("keyboardWillHide", () => s.willHide()),
|
|
36
|
+
t.addListener("keyboardDidHide", () => s.didHide())
|
|
37
|
+
]);
|
|
38
|
+
} catch {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { r as KEYBOARD_HEIGHT_CSS_VAR, i as KEYBOARD_OPEN_CLASS, l as configureKeyboard, s as keyboardHandlers };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NetworkHooks, NetworkStatusDetail } from './types';
|
|
2
|
+
export declare const NETWORK_STATUS_EVENT = "burdenoff:networkStatusChange";
|
|
3
|
+
export declare function getLastNetworkStatus(): NetworkStatusDetail | null;
|
|
4
|
+
/**
|
|
5
|
+
* Dispatches `burdenoff:networkStatusChange` `{ connected, connectionType }`.
|
|
6
|
+
* Native: Capacitor Network plugin. Web: `navigator.onLine` + online/offline events.
|
|
7
|
+
*/
|
|
8
|
+
export declare function installNetworkListener(hooks?: NetworkHooks): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/shell-native/network.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEjE,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;AAKpE,wBAAgB,oBAAoB,IAAI,mBAAmB,GAAG,IAAI,CAEjE;AAaD;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BpF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { isNativePluginAvailable as e } from "./platform.js";
|
|
2
|
+
import { Network as t } from "@capacitor/network";
|
|
3
|
+
//#region src/shell-native/network.ts
|
|
4
|
+
var n = "burdenoff:networkStatusChange", r = null, i = !1;
|
|
5
|
+
function a() {
|
|
6
|
+
return r;
|
|
7
|
+
}
|
|
8
|
+
function o(e, t) {
|
|
9
|
+
let i = r?.connected;
|
|
10
|
+
r = e, typeof window < "u" && window.dispatchEvent(new CustomEvent(n, { detail: e })), i !== e.connected && (e.connected ? t.onReconnect?.() : t.onDisconnect?.());
|
|
11
|
+
}
|
|
12
|
+
async function s(n = {}) {
|
|
13
|
+
if (!i) {
|
|
14
|
+
if (i = !0, typeof navigator < "u" && typeof navigator.onLine == "boolean" && (r = {
|
|
15
|
+
connected: navigator.onLine,
|
|
16
|
+
connectionType: "unknown"
|
|
17
|
+
}), e("Network")) try {
|
|
18
|
+
let e = await t.getStatus();
|
|
19
|
+
r = {
|
|
20
|
+
connected: e.connected,
|
|
21
|
+
connectionType: e.connectionType
|
|
22
|
+
}, await t.addListener("networkStatusChange", (e) => {
|
|
23
|
+
o({
|
|
24
|
+
connected: e.connected,
|
|
25
|
+
connectionType: e.connectionType
|
|
26
|
+
}, n);
|
|
27
|
+
});
|
|
28
|
+
return;
|
|
29
|
+
} catch {}
|
|
30
|
+
typeof window > "u" || (window.addEventListener("online", () => o({
|
|
31
|
+
connected: !0,
|
|
32
|
+
connectionType: "unknown"
|
|
33
|
+
}, n)), window.addEventListener("offline", () => o({
|
|
34
|
+
connected: !1,
|
|
35
|
+
connectionType: "none"
|
|
36
|
+
}, n)));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { n as NETWORK_STATUS_EVENT, a as getLastNetworkStatus, s as installNetworkListener };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ota.d.ts","sourceRoot":"","sources":["../../src/shell-native/ota.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,wBAAsB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBvF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getDesktopBridge as e } from "../shared/native/desktop.js";
|
|
2
|
+
import { isRealNativePlatform as t } from "./platform.js";
|
|
3
|
+
//#region src/shell-native/ota.ts
|
|
4
|
+
async function n(n = {}) {
|
|
5
|
+
try {
|
|
6
|
+
if (t()) {
|
|
7
|
+
if (!n.updater) return;
|
|
8
|
+
let { CapacitorUpdater: e } = await n.updater();
|
|
9
|
+
await e.notifyAppReady();
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
let r = e();
|
|
13
|
+
if (r) {
|
|
14
|
+
await r.notifyAppReady();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
typeof window < "u" && await window.electronUpdater?.notifyAppReady?.();
|
|
18
|
+
} catch {}
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { n as notifyOtaReady };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NativeShellPlatform } from './types';
|
|
2
|
+
/** Real Capacitor platform, or the presentation preview override. */
|
|
3
|
+
export declare function getNativePlatform(): NativeShellPlatform;
|
|
4
|
+
/** True on a real Capacitor native platform OR an ios/android presentation preview. */
|
|
5
|
+
export declare function isNativePlatform(): boolean;
|
|
6
|
+
/** True only for a presentation preview (never inside a real native app). */
|
|
7
|
+
export declare function isNativePreview(): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* REAL plugin availability — never influenced by previews. Every native plugin
|
|
10
|
+
* call in shell-native is guarded by this so previews are side-effect free.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isNativePluginAvailable(pluginName: string): boolean;
|
|
13
|
+
/** Really running inside Capacitor (no preview override). */
|
|
14
|
+
export declare function isRealNativePlatform(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Writes `data-platform` on `<html>` and `platform-ios|android|web`,
|
|
17
|
+
* `platform-native` (ios/android incl. preview) and `platform-preview` (when
|
|
18
|
+
* previewing) on `<body>`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function applyNativePlatformClass(): void;
|
|
21
|
+
//# sourceMappingURL=platform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/shell-native/platform.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAmBnD,qEAAqE;AACrE,wBAAgB,iBAAiB,IAAI,mBAAmB,CAKvD;AAED,uFAAuF;AACvF,wBAAgB,gBAAgB,IAAI,OAAO,CAI1C;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAOnE;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAiB/C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getActiveNativePreview as e } from "./preview.js";
|
|
2
|
+
import { Capacitor as t } from "@capacitor/core";
|
|
3
|
+
//#region src/shell-native/platform.ts
|
|
4
|
+
function n() {
|
|
5
|
+
try {
|
|
6
|
+
let e = t.getPlatform();
|
|
7
|
+
return e === "ios" || e === "android" ? e : "web";
|
|
8
|
+
} catch {
|
|
9
|
+
return "web";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function r() {
|
|
13
|
+
try {
|
|
14
|
+
return t.isNativePlatform();
|
|
15
|
+
} catch {
|
|
16
|
+
return !1;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function i() {
|
|
20
|
+
if (r()) return n();
|
|
21
|
+
let t = e();
|
|
22
|
+
return t === "ios" || t === "android" ? t : "web";
|
|
23
|
+
}
|
|
24
|
+
function a() {
|
|
25
|
+
if (r()) return !0;
|
|
26
|
+
let t = e();
|
|
27
|
+
return t === "ios" || t === "android";
|
|
28
|
+
}
|
|
29
|
+
function o() {
|
|
30
|
+
return !r() && e() !== null;
|
|
31
|
+
}
|
|
32
|
+
function s(e) {
|
|
33
|
+
if (!r()) return !1;
|
|
34
|
+
try {
|
|
35
|
+
return t.isPluginAvailable(e);
|
|
36
|
+
} catch {
|
|
37
|
+
return !1;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function c() {
|
|
41
|
+
return r();
|
|
42
|
+
}
|
|
43
|
+
function l() {
|
|
44
|
+
if (typeof document > "u") return;
|
|
45
|
+
let e = i();
|
|
46
|
+
document.documentElement.dataset.platform = e;
|
|
47
|
+
let t = document.body;
|
|
48
|
+
t && (t.classList.remove("platform-ios", "platform-android", "platform-web", "platform-native", "platform-preview"), t.classList.add(`platform-${e}`), a() && t.classList.add("platform-native"), o() && t.classList.add("platform-preview"));
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { l as applyNativePlatformClass, i as getNativePlatform, a as isNativePlatform, s as isNativePluginAvailable, o as isNativePreview, c as isRealNativePlatform };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NativePreviewMode } from '../shared/native/types';
|
|
2
|
+
export declare const NATIVE_PREVIEW_QUERY_PARAM = "__nativePreview";
|
|
3
|
+
export declare const NATIVE_PREVIEW_STORAGE_KEY = "burdenoff.nativePreview";
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the preview mode for this page load: the query param wins and is
|
|
6
|
+
* persisted to sessionStorage (`off` clears it); otherwise the persisted value
|
|
7
|
+
* is reused. Never active inside a real Capacitor native app.
|
|
8
|
+
*/
|
|
9
|
+
export declare function resolveNativePreview(): NativePreviewMode | null;
|
|
10
|
+
/** Preview mode resolved by the last `resolveNativePreview()` / `applyNativePreview()`. */
|
|
11
|
+
export declare function getActiveNativePreview(): NativePreviewMode | null;
|
|
12
|
+
/**
|
|
13
|
+
* Apply a preview mode to the document: `data-native-preview` on `<html>` and, for
|
|
14
|
+
* `desktop`, a minimal fake `window.__burdenoffDesktop` (only when no real bridge
|
|
15
|
+
* exists) plus `data-desktop-platform` / `data-desktop-titlebar`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function applyNativePreview(mode: NativePreviewMode | null): void;
|
|
18
|
+
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/shell-native/preview.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAA0B,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAExF,eAAO,MAAM,0BAA0B,oBAAoB,CAAC;AAC5D,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AAsCpE;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CA4B/D;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,IAAI,iBAAiB,GAAG,IAAI,CAEjE;AA+DD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAgBvE"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Capacitor as e } from "@capacitor/core";
|
|
2
|
+
//#region src/shell-native/preview.ts
|
|
3
|
+
var t = "__nativePreview", n = "burdenoff.nativePreview", r = new Set([
|
|
4
|
+
"ios",
|
|
5
|
+
"android",
|
|
6
|
+
"pwa",
|
|
7
|
+
"desktop"
|
|
8
|
+
]), i = null;
|
|
9
|
+
function a(e) {
|
|
10
|
+
return !!e && r.has(e);
|
|
11
|
+
}
|
|
12
|
+
function o() {
|
|
13
|
+
try {
|
|
14
|
+
return typeof sessionStorage < "u" ? sessionStorage.getItem(n) : null;
|
|
15
|
+
} catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function s(e) {
|
|
20
|
+
try {
|
|
21
|
+
if (typeof sessionStorage > "u") return;
|
|
22
|
+
e ? sessionStorage.setItem(n, e) : sessionStorage.removeItem(n);
|
|
23
|
+
} catch {}
|
|
24
|
+
}
|
|
25
|
+
function c() {
|
|
26
|
+
try {
|
|
27
|
+
return e.isNativePlatform();
|
|
28
|
+
} catch {
|
|
29
|
+
return !1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function l() {
|
|
33
|
+
if (typeof window > "u") return null;
|
|
34
|
+
if (c()) return i = null, null;
|
|
35
|
+
let e;
|
|
36
|
+
try {
|
|
37
|
+
e = new URLSearchParams(window.location.search).get(t);
|
|
38
|
+
} catch {
|
|
39
|
+
e = null;
|
|
40
|
+
}
|
|
41
|
+
if (e === "off") return s(null), i = null, null;
|
|
42
|
+
if (a(e)) return s(e), i = e, e;
|
|
43
|
+
let n = o();
|
|
44
|
+
return i = a(n) ? n : null, i;
|
|
45
|
+
}
|
|
46
|
+
function u() {
|
|
47
|
+
return i;
|
|
48
|
+
}
|
|
49
|
+
function d() {}
|
|
50
|
+
async function f() {}
|
|
51
|
+
function p() {
|
|
52
|
+
return d;
|
|
53
|
+
}
|
|
54
|
+
function m() {
|
|
55
|
+
let e = window.location.origin;
|
|
56
|
+
return {
|
|
57
|
+
isElectron: !0,
|
|
58
|
+
platform: "darwin",
|
|
59
|
+
arch: "preview",
|
|
60
|
+
versions: {
|
|
61
|
+
app: "preview",
|
|
62
|
+
electron: "preview",
|
|
63
|
+
chrome: "preview"
|
|
64
|
+
},
|
|
65
|
+
product: {
|
|
66
|
+
id: "preview",
|
|
67
|
+
name: "Preview",
|
|
68
|
+
scheme: "preview",
|
|
69
|
+
appId: "preview"
|
|
70
|
+
},
|
|
71
|
+
runtimeConfig: {
|
|
72
|
+
environment: "prod",
|
|
73
|
+
appOrigin: e,
|
|
74
|
+
gatewayBases: {
|
|
75
|
+
globalBase: e,
|
|
76
|
+
workspaceBase: e
|
|
77
|
+
},
|
|
78
|
+
gatewayUrls: {
|
|
79
|
+
globalBaseUrl: e,
|
|
80
|
+
workspaceBaseUrl: e,
|
|
81
|
+
publicStoreBaseUrl: e
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
titlebar: "hidden-inset",
|
|
85
|
+
onDeepLink: p,
|
|
86
|
+
onNavigate: p,
|
|
87
|
+
onUpdateState: p,
|
|
88
|
+
onWindowState: p,
|
|
89
|
+
openExternal: async (e) => {
|
|
90
|
+
try {
|
|
91
|
+
window.open(e, "_blank", "noopener,noreferrer");
|
|
92
|
+
} catch {}
|
|
93
|
+
return !0;
|
|
94
|
+
},
|
|
95
|
+
notify: async () => !1,
|
|
96
|
+
setBadgeCount: f,
|
|
97
|
+
setTheme: d,
|
|
98
|
+
setTrayQuickActions: d,
|
|
99
|
+
setLocale: d,
|
|
100
|
+
getUpdateState: async () => ({ status: "unsupported" }),
|
|
101
|
+
checkForUpdates: async () => ({ status: "unsupported" }),
|
|
102
|
+
installUpdate: f,
|
|
103
|
+
notifyAppReady: f,
|
|
104
|
+
window: {
|
|
105
|
+
minimize: d,
|
|
106
|
+
toggleMaximize: d,
|
|
107
|
+
close: d,
|
|
108
|
+
hide: d,
|
|
109
|
+
focus: d,
|
|
110
|
+
setTitle: d
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function h(e) {
|
|
115
|
+
if (i = e, typeof document > "u") return;
|
|
116
|
+
let t = document.documentElement;
|
|
117
|
+
if (!e) {
|
|
118
|
+
delete t.dataset.nativePreview;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
t.dataset.nativePreview = e, e === "desktop" && typeof window < "u" && (window.__burdenoffDesktop || (window.__burdenoffDesktop = m()), t.dataset.desktopPlatform = window.__burdenoffDesktop.platform, t.dataset.desktopTitlebar = window.__burdenoffDesktop.titlebar);
|
|
122
|
+
}
|
|
123
|
+
//#endregion
|
|
124
|
+
export { t as NATIVE_PREVIEW_QUERY_PARAM, n as NATIVE_PREVIEW_STORAGE_KEY, h as applyNativePreview, u as getActiveNativePreview, l as resolveNativePreview };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PushNotificationsLoader, PushOptions } from './types';
|
|
2
|
+
export declare const PUSH_TOKEN_EVENT = "burdenoff:pushToken";
|
|
3
|
+
/**
|
|
4
|
+
* Install push listeners (registration → dispatch `burdenoff:pushToken` + set
|
|
5
|
+
* `window.__burdenoffPushToken`; notification tap → deep-link navigator).
|
|
6
|
+
* Does NOT prompt for permission — call `requestPushPermission()` for that.
|
|
7
|
+
*/
|
|
8
|
+
export declare function installPushNotifications(loader: PushNotificationsLoader, options?: Pick<PushOptions, 'onToken' | 'onNotificationAction' | 'onNotificationReceived'>): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Ask the user for push permission (call from an in-context UI affordance,
|
|
11
|
+
* never at boot) and register for a token on grant.
|
|
12
|
+
*/
|
|
13
|
+
export declare function requestPushPermission(): Promise<boolean>;
|
|
14
|
+
//# sourceMappingURL=push.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/shell-native/push.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAGV,uBAAuB,EACvB,WAAW,EACZ,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAkCtD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,uBAAuB,EAC/B,OAAO,GAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,sBAAsB,GAAG,wBAAwB,CAAM,GAC7F,OAAO,CAAC,IAAI,CAAC,CAsCf;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAc9D"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { getNativePlatform as e, isRealNativePlatform as t } from "./platform.js";
|
|
2
|
+
import { navigateDeepLinkPath as n } from "./deep-link.js";
|
|
3
|
+
//#region src/shell-native/push.ts
|
|
4
|
+
var r = "burdenoff:pushToken", i = null, a = null;
|
|
5
|
+
async function o() {
|
|
6
|
+
if (i) return i;
|
|
7
|
+
if (!a || !t()) return null;
|
|
8
|
+
try {
|
|
9
|
+
i = (await a()).PushNotifications ?? null;
|
|
10
|
+
} catch {
|
|
11
|
+
i = null;
|
|
12
|
+
}
|
|
13
|
+
return i;
|
|
14
|
+
}
|
|
15
|
+
function s(e) {
|
|
16
|
+
let t = e.notification.data;
|
|
17
|
+
if (!t || typeof t != "object") return null;
|
|
18
|
+
let n = t.route;
|
|
19
|
+
if (typeof n == "string" && n.startsWith("/")) return n;
|
|
20
|
+
let r = t.url;
|
|
21
|
+
if (typeof r == "string") try {
|
|
22
|
+
let e = new URL(r);
|
|
23
|
+
return `${e.pathname || "/"}${e.search}${e.hash}`;
|
|
24
|
+
} catch {
|
|
25
|
+
if (r.startsWith("/")) return r;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
async function c(t, c = {}) {
|
|
30
|
+
a !== t && (i = null, a = t);
|
|
31
|
+
let l = await o();
|
|
32
|
+
if (!l) return;
|
|
33
|
+
let u = e();
|
|
34
|
+
if (u !== "web") try {
|
|
35
|
+
await l.addListener("registration", (e) => {
|
|
36
|
+
let t = {
|
|
37
|
+
value: e.value,
|
|
38
|
+
platform: u
|
|
39
|
+
};
|
|
40
|
+
window.__burdenoffPushToken = t, window.dispatchEvent(new CustomEvent(r, { detail: t })), c.onToken?.(e.value, u);
|
|
41
|
+
}), await l.addListener("registrationError", (e) => {
|
|
42
|
+
console.debug("[shell-native] Push registration error:", e.error);
|
|
43
|
+
}), await l.addListener("pushNotificationReceived", (e) => {
|
|
44
|
+
c.onNotificationReceived?.(e);
|
|
45
|
+
}), await l.addListener("pushNotificationActionPerformed", (e) => {
|
|
46
|
+
let t = s(e);
|
|
47
|
+
t && n(t), c.onNotificationAction?.(e);
|
|
48
|
+
}), (await l.checkPermissions()).receive === "granted" && await l.register();
|
|
49
|
+
} catch {}
|
|
50
|
+
}
|
|
51
|
+
async function l() {
|
|
52
|
+
let e = await o();
|
|
53
|
+
if (!e) return !1;
|
|
54
|
+
try {
|
|
55
|
+
let t = await e.checkPermissions();
|
|
56
|
+
return (t.receive === "prompt" || t.receive === "prompt-with-rationale") && (t = await e.requestPermissions()), t.receive === "granted" ? (await e.register(), !0) : !1;
|
|
57
|
+
} catch {
|
|
58
|
+
return !1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { r as PUSH_TOKEN_EVENT, c as installPushNotifications, l as requestPushPermission };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PwaOptions } from './types';
|
|
2
|
+
export declare const PWA_UPDATE_READY_EVENT = "burdenoff:pwaUpdateReady";
|
|
3
|
+
export declare const PWA_INSTALLED_EVENT = "burdenoff:pwaInstalled";
|
|
4
|
+
export declare const PWA_INSTALL_AVAILABLE_EVENT = "burdenoff:pwaInstallAvailable";
|
|
5
|
+
export declare function isPwaEligibleHost(hostname: string): boolean;
|
|
6
|
+
/** Test-only reset. */
|
|
7
|
+
export declare function resetPwaForTests(): void;
|
|
8
|
+
export declare function installPwa(options?: PwaOptions): void;
|
|
9
|
+
/**
|
|
10
|
+
* Trigger the captured install prompt. Resolves true when the user accepted.
|
|
11
|
+
* (The fe-libs `usePWA` hook is the richer, stateful alternative.)
|
|
12
|
+
*/
|
|
13
|
+
export declare function installPwaPrompt(): Promise<boolean>;
|
|
14
|
+
//# sourceMappingURL=pwa.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pwa.d.ts","sourceRoot":"","sources":["../../src/shell-native/pwa.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAgC,UAAU,EAAE,MAAM,SAAS,CAAC;AAExE,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;AACjE,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAC5D,eAAO,MAAM,2BAA2B,kCAAkC,CAAC;AAI3E,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAI3D;AAID,uBAAuB;AACvB,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED,wBAAgB,UAAU,CAAC,OAAO,GAAE,UAAe,GAAG,IAAI,CAgEzD;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAczD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { isNativePlatform as e, isRealNativePlatform as t } from "./platform.js";
|
|
2
|
+
import { isDesktopShell as n } from "./desktop-bridge.js";
|
|
3
|
+
//#region src/shell-native/pwa.ts
|
|
4
|
+
var r = "burdenoff:pwaUpdateReady", i = "burdenoff:pwaInstalled", a = "burdenoff:pwaInstallAvailable", o = ["localhost", "127.0.0.1"];
|
|
5
|
+
function s(e) {
|
|
6
|
+
return !(o.includes(e) || e.endsWith(".local.burdenoff.com"));
|
|
7
|
+
}
|
|
8
|
+
var c = !1;
|
|
9
|
+
function l() {
|
|
10
|
+
c = !1;
|
|
11
|
+
}
|
|
12
|
+
function u(o = {}) {
|
|
13
|
+
if (c || o.enabled === !1 || typeof window > "u" || typeof navigator > "u" || t() || e() || n() || !s(window.location.hostname) || (c = !0, window.addEventListener("beforeinstallprompt", (e) => {
|
|
14
|
+
window.__burdenoffPwaInstallPrompt = e, window.dispatchEvent(new CustomEvent(a));
|
|
15
|
+
}), window.addEventListener("appinstalled", () => {
|
|
16
|
+
window.__burdenoffPwaInstallPrompt = null, window.dispatchEvent(new CustomEvent(i));
|
|
17
|
+
}), !("serviceWorker" in navigator))) return;
|
|
18
|
+
let l = o.swUrl ?? "/sw.js", u = o.updateCheckIntervalMs ?? 6e4, d = !1, f = (e) => {
|
|
19
|
+
let t = e.waiting;
|
|
20
|
+
!t || !navigator.serviceWorker.controller || (window.dispatchEvent(new CustomEvent(r)), navigator.serviceWorker.addEventListener("controllerchange", () => {
|
|
21
|
+
d || (d = !0, window.location.reload());
|
|
22
|
+
}), t.postMessage({ type: "SKIP_WAITING" }));
|
|
23
|
+
}, p = () => {
|
|
24
|
+
navigator.serviceWorker.register(l).then((e) => {
|
|
25
|
+
f(e), e.addEventListener("updatefound", () => {
|
|
26
|
+
let t = e.installing;
|
|
27
|
+
t && t.addEventListener("statechange", () => {
|
|
28
|
+
t.state === "installed" && f(e);
|
|
29
|
+
});
|
|
30
|
+
}), u > 0 && setInterval(() => {
|
|
31
|
+
e.update().catch(() => void 0);
|
|
32
|
+
}, u);
|
|
33
|
+
}).catch((e) => {
|
|
34
|
+
console.debug("[shell-native] Service worker registration failed:", e);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
document.readyState === "complete" ? p() : window.addEventListener("load", p, { once: !0 });
|
|
38
|
+
}
|
|
39
|
+
async function d() {
|
|
40
|
+
let e = typeof window < "u" ? window.__burdenoffPwaInstallPrompt : null;
|
|
41
|
+
if (!e) return !1;
|
|
42
|
+
try {
|
|
43
|
+
return await e.prompt(), (await e.userChoice)?.outcome === "accepted" ? (window.__burdenoffPwaInstallPrompt = null, !0) : !1;
|
|
44
|
+
} catch {
|
|
45
|
+
return !1;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { i as PWA_INSTALLED_EVENT, a as PWA_INSTALL_AVAILABLE_EVENT, r as PWA_UPDATE_READY_EVENT, u as installPwa, d as installPwaPrompt, s as isPwaEligibleHost, l as resetPwaForTests };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { NativeConfig } from './types';
|
|
2
|
+
export declare const SERVICE_WORKER_TEMPLATE: string;
|
|
3
|
+
/** Render the canonical sw.js for a product (`version` defaults to `v1`). */
|
|
4
|
+
export declare function renderServiceWorker(cfg: NativeConfig, version?: string): string;
|
|
5
|
+
//# sourceMappingURL=service-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-worker.d.ts","sourceRoot":"","sources":["../../src/shell-native/service-worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,eAAO,MAAM,uBAAuB,QAyInC,CAAC;AAEF,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,YAAY,EAAE,OAAO,SAAO,GAAG,MAAM,CAK7E"}
|