@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,144 @@
|
|
|
1
|
+
//#region src/shell-native/service-worker.ts
|
|
2
|
+
var e = String.raw`/**
|
|
3
|
+
* {{SLUG}} service worker (generated from @burdenoff/fe-libs shell-native).
|
|
4
|
+
* Navigations: network-first. Hashed assets + icons: cache-first.
|
|
5
|
+
* Bump the cache version to invalidate ALL prior caches on activate.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Development guard: never cache on local dev hosts.
|
|
9
|
+
const IS_DEV = self.location.hostname === 'localhost' ||
|
|
10
|
+
self.location.hostname === '127.0.0.1' ||
|
|
11
|
+
self.location.hostname.endsWith('.local.burdenoff.com');
|
|
12
|
+
|
|
13
|
+
const CACHE_VERSION = '{{CACHE_VERSION}}';
|
|
14
|
+
const STATIC_CACHE = '{{SLUG}}-static-' + CACHE_VERSION;
|
|
15
|
+
const RUNTIME_CACHE = '{{SLUG}}-runtime-' + CACHE_VERSION;
|
|
16
|
+
const EXPECTED_CACHES = new Set([STATIC_CACHE, RUNTIME_CACHE]);
|
|
17
|
+
|
|
18
|
+
// Minimal precache — DO NOT precache index.html, it must be network-first.
|
|
19
|
+
const PRECACHE_ASSETS = [
|
|
20
|
+
'/manifest.json',
|
|
21
|
+
'/offline.html',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
const CACHE_FIRST_RE = /^\/(assets|chunks|icons)\//;
|
|
25
|
+
|
|
26
|
+
const OFFLINE_FALLBACK_HTML = '<!doctype html><html lang="en"><head><meta charset="utf-8">' +
|
|
27
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">' +
|
|
28
|
+
'<title>Offline</title></head><body style="font-family:system-ui,sans-serif;' +
|
|
29
|
+
'display:flex;min-height:100vh;align-items:center;justify-content:center;margin:0">' +
|
|
30
|
+
'<div style="text-align:center"><h1>You are offline</h1>' +
|
|
31
|
+
'<p>Check your connection and try again.</p></div></body></html>';
|
|
32
|
+
|
|
33
|
+
self.addEventListener('install', (event) => {
|
|
34
|
+
if (IS_DEV) {
|
|
35
|
+
self.skipWaiting();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
event.waitUntil(
|
|
39
|
+
caches.open(STATIC_CACHE)
|
|
40
|
+
.then((cache) =>
|
|
41
|
+
Promise.all(
|
|
42
|
+
PRECACHE_ASSETS.map((asset) => cache.add(asset).catch(() => undefined))
|
|
43
|
+
)
|
|
44
|
+
)
|
|
45
|
+
.then(() => self.skipWaiting())
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
self.addEventListener('activate', (event) => {
|
|
50
|
+
event.waitUntil(
|
|
51
|
+
caches.keys()
|
|
52
|
+
.then((names) => {
|
|
53
|
+
const deletions = [];
|
|
54
|
+
for (const name of names) {
|
|
55
|
+
if (!EXPECTED_CACHES.has(name)) deletions.push(caches.delete(name));
|
|
56
|
+
}
|
|
57
|
+
return Promise.all(deletions);
|
|
58
|
+
})
|
|
59
|
+
.then(() => self.clients.claim())
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
self.addEventListener('fetch', (event) => {
|
|
64
|
+
if (IS_DEV) return;
|
|
65
|
+
|
|
66
|
+
const { request } = event;
|
|
67
|
+
if (request.method !== 'GET') return;
|
|
68
|
+
|
|
69
|
+
const url = new URL(request.url);
|
|
70
|
+
if (!url.protocol.startsWith('http')) return;
|
|
71
|
+
if (url.origin !== self.location.origin) return;
|
|
72
|
+
|
|
73
|
+
// Skip Vite dev artefacts defensively.
|
|
74
|
+
if (url.pathname.includes('/.vite/') ||
|
|
75
|
+
url.pathname.includes('/@vite/') ||
|
|
76
|
+
url.pathname.includes('/@react-refresh') ||
|
|
77
|
+
url.pathname.includes('/@fs/') ||
|
|
78
|
+
url.pathname.includes('/node_modules/')) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Navigation / HTML: always go to network first so deploys are picked up.
|
|
83
|
+
const isNavigation = request.mode === 'navigate' ||
|
|
84
|
+
(request.headers.get('accept') || '').includes('text/html');
|
|
85
|
+
if (isNavigation) {
|
|
86
|
+
event.respondWith(networkFirstHTML(request));
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Content-hashed build outputs + icons: safe to cache.
|
|
91
|
+
if (CACHE_FIRST_RE.test(url.pathname)) {
|
|
92
|
+
event.respondWith(cacheFirstImmutable(request));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Everything else: passthrough (browser + HTTP cache decide).
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
async function networkFirstHTML(request) {
|
|
100
|
+
try {
|
|
101
|
+
const fresh = await fetch(request, { cache: 'no-store' });
|
|
102
|
+
if (fresh.ok) {
|
|
103
|
+
const cache = await caches.open(RUNTIME_CACHE);
|
|
104
|
+
cache.put('/index.html', fresh.clone()).catch(() => undefined);
|
|
105
|
+
}
|
|
106
|
+
return fresh;
|
|
107
|
+
} catch (_err) {
|
|
108
|
+
const runtime = await caches.open(RUNTIME_CACHE);
|
|
109
|
+
const cachedIndex = await runtime.match('/index.html');
|
|
110
|
+
if (cachedIndex) return cachedIndex;
|
|
111
|
+
const statics = await caches.open(STATIC_CACHE);
|
|
112
|
+
const offlinePage = await statics.match('/offline.html');
|
|
113
|
+
if (offlinePage) return offlinePage;
|
|
114
|
+
return new Response(OFFLINE_FALLBACK_HTML, {
|
|
115
|
+
status: 503,
|
|
116
|
+
headers: { 'Content-Type': 'text/html; charset=utf-8' },
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function cacheFirstImmutable(request) {
|
|
122
|
+
const cache = await caches.open(STATIC_CACHE);
|
|
123
|
+
const cached = await cache.match(request);
|
|
124
|
+
if (cached) return cached;
|
|
125
|
+
try {
|
|
126
|
+
const fresh = await fetch(request);
|
|
127
|
+
if (fresh.ok) cache.put(request, fresh.clone()).catch(() => undefined);
|
|
128
|
+
return fresh;
|
|
129
|
+
} catch (_err) {
|
|
130
|
+
return new Response('Asset unavailable offline', { status: 503 });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
self.addEventListener('message', (event) => {
|
|
135
|
+
if (event.data === 'skipWaiting' || (event.data && event.data.type === 'SKIP_WAITING')) {
|
|
136
|
+
self.skipWaiting();
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
`;
|
|
140
|
+
function t(t, n = "v1") {
|
|
141
|
+
return e.replaceAll("{{SLUG}}", t.slug).replaceAll("{{CACHE_VERSION}}", n);
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
export { e as SERVICE_WORKER_TEMPLATE, t as renderServiceWorker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../src/shell-native/share.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAK3D,wEAAwE;AACxE,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAyB1E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { isNativePluginAvailable as e } from "./platform.js";
|
|
2
|
+
import { writeClipboardText as t } from "./clipboard.js";
|
|
3
|
+
import { showNativeToast as n } from "./toast.js";
|
|
4
|
+
import { Share as r } from "@capacitor/share";
|
|
5
|
+
//#region src/shell-native/share.ts
|
|
6
|
+
async function i(i) {
|
|
7
|
+
if (e("Share")) try {
|
|
8
|
+
return await r.share(i), !0;
|
|
9
|
+
} catch {}
|
|
10
|
+
if (typeof navigator < "u" && typeof navigator.share == "function") try {
|
|
11
|
+
return await navigator.share(i), !0;
|
|
12
|
+
} catch {}
|
|
13
|
+
let a = i.url ?? i.text;
|
|
14
|
+
if (!a) return !1;
|
|
15
|
+
let o = await t(a);
|
|
16
|
+
return o && await n("Copied to clipboard"), o;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { i as shareContent };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const APP_READY_EVENT = "burdenoff:appReady";
|
|
2
|
+
/** Test-only reset. */
|
|
3
|
+
export declare function resetAppReadyForTests(): void;
|
|
4
|
+
export declare function isAppReady(): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Idempotent "first meaningful paint" signal: hides the native splash screen
|
|
7
|
+
* (when available) and dispatches `burdenoff:appReady`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function markAppReady(): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Safety net: hide the splash after `ms` even if the shell never calls
|
|
12
|
+
* `markAppReady()` (e.g. a crashed lazy chunk) so the app can never stick on
|
|
13
|
+
* the splash forever.
|
|
14
|
+
*/
|
|
15
|
+
export declare function armSplashSafetyTimer(ms?: number): void;
|
|
16
|
+
//# sourceMappingURL=splash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splash.d.ts","sourceRoot":"","sources":["../../src/shell-native/splash.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAKpD,uBAAuB;AACvB,wBAAgB,qBAAqB,IAAI,IAAI,CAI5C;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAiBlD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,SAAO,GAAG,IAAI,CASpD"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isNativePluginAvailable as e } from "./platform.js";
|
|
2
|
+
import { SplashScreen as t } from "@capacitor/splash-screen";
|
|
3
|
+
//#region src/shell-native/splash.ts
|
|
4
|
+
var n = "burdenoff:appReady", r = !1, i = null;
|
|
5
|
+
function a() {
|
|
6
|
+
r = !1, i && clearTimeout(i), i = null;
|
|
7
|
+
}
|
|
8
|
+
function o() {
|
|
9
|
+
return r;
|
|
10
|
+
}
|
|
11
|
+
async function s() {
|
|
12
|
+
if (!r) {
|
|
13
|
+
if (r = !0, i &&= (clearTimeout(i), null), e("SplashScreen")) try {
|
|
14
|
+
await t.hide({ fadeOutDuration: 200 });
|
|
15
|
+
} catch {}
|
|
16
|
+
typeof window < "u" && window.dispatchEvent(new CustomEvent(n));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function c(e = 8e3) {
|
|
20
|
+
r || i || (i = setTimeout(() => {
|
|
21
|
+
i = null, r || (console.debug("[shell-native] Splash safety timer fired — forcing markAppReady"), s());
|
|
22
|
+
}, e));
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as APP_READY_EVENT, c as armSplashSafetyTimer, o as isAppReady, s as markAppReady, a as resetAppReadyForTests };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Themes that render on a dark canvas. Any of these drives the native status bar
|
|
3
|
+
* to its Dark style (light glyphs). `light` is the only light-family theme.
|
|
4
|
+
* Mirrors the dark-family set in the fe-libs ThemeProvider.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DARK_FAMILY_THEMES: ReadonlySet<string>;
|
|
7
|
+
export declare function isDarkThemeName(theme: string | null | undefined): boolean;
|
|
8
|
+
/** Resolve the dark flag from the `<html>` element (`data-theme` or `.dark` class). */
|
|
9
|
+
export declare function resolveDocumentIsDark(): boolean | null;
|
|
10
|
+
export declare function applyStatusBarTheme(isDark: boolean): Promise<void>;
|
|
11
|
+
export interface StatusBarThemeDetail {
|
|
12
|
+
isDark?: boolean;
|
|
13
|
+
/** Concrete theme name (light|dark|forest|ocean|sunset|high-contrast); preferred. */
|
|
14
|
+
theme?: string;
|
|
15
|
+
resolvedTheme?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Map a `burdenoff:statusBarTheme` detail to the dark flag. */
|
|
18
|
+
export declare function statusBarDetailIsDark(detail: StatusBarThemeDetail | null | undefined): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Seeds the status bar from the current `<html>` theme, then follows the
|
|
21
|
+
* `burdenoff:statusBarTheme` event and `class` / `data-theme` mutations on `<html>`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function installStatusBarThemeListener(): void;
|
|
24
|
+
//# sourceMappingURL=system-bars.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system-bars.d.ts","sourceRoot":"","sources":["../../src/shell-native/system-bars.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAMjD,CAAC;AAEH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEzE;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,IAAI,OAAO,GAAG,IAAI,CAQtD;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxE;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,gEAAgE;AAChE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAI9F;AAID;;;GAGG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CA0BpD"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { isNativePluginAvailable as e } from "./platform.js";
|
|
2
|
+
import { StatusBar as t, Style as n } from "@capacitor/status-bar";
|
|
3
|
+
//#region src/shell-native/system-bars.ts
|
|
4
|
+
var r = new Set([
|
|
5
|
+
"dark",
|
|
6
|
+
"forest",
|
|
7
|
+
"ocean",
|
|
8
|
+
"sunset",
|
|
9
|
+
"high-contrast"
|
|
10
|
+
]);
|
|
11
|
+
function i(e) {
|
|
12
|
+
return !!e && r.has(e);
|
|
13
|
+
}
|
|
14
|
+
function a() {
|
|
15
|
+
if (typeof document > "u") return null;
|
|
16
|
+
let e = document.documentElement, t = e.getAttribute("data-theme");
|
|
17
|
+
return t ? i(t) : e.classList.contains("dark") ? !0 : e.classList.contains("light") ? !1 : null;
|
|
18
|
+
}
|
|
19
|
+
async function o(r) {
|
|
20
|
+
if (e("StatusBar")) try {
|
|
21
|
+
await t.setStyle({ style: r ? n.Dark : n.Light });
|
|
22
|
+
} catch {}
|
|
23
|
+
}
|
|
24
|
+
function s(e) {
|
|
25
|
+
if (!e) return !1;
|
|
26
|
+
let t = e.theme ?? e.resolvedTheme;
|
|
27
|
+
return t == null ? !!e.isDark : i(t);
|
|
28
|
+
}
|
|
29
|
+
var c = !1;
|
|
30
|
+
function l() {
|
|
31
|
+
if (c || typeof window > "u") return;
|
|
32
|
+
c = !0;
|
|
33
|
+
let e = a();
|
|
34
|
+
if (e !== null && o(e), window.addEventListener("burdenoff:statusBarTheme", (e) => {
|
|
35
|
+
let t = e.detail;
|
|
36
|
+
t && o(s(t));
|
|
37
|
+
}), typeof MutationObserver < "u" && typeof document < "u") {
|
|
38
|
+
let t = e;
|
|
39
|
+
new MutationObserver(() => {
|
|
40
|
+
let e = a();
|
|
41
|
+
e === null || e === t || (t = e, o(e));
|
|
42
|
+
}).observe(document.documentElement, {
|
|
43
|
+
attributes: !0,
|
|
44
|
+
attributeFilter: ["class", "data-theme"]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { r as DARK_FAMILY_THEMES, o as applyStatusBarTheme, l as installStatusBarThemeListener, i as isDarkThemeName, a as resolveDocumentIsDark, s as statusBarDetailIsDark };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ToastDuration } from '../shared/native/types';
|
|
2
|
+
/** Native toast. Resolves `false` when unavailable so the caller renders its web toast. */
|
|
3
|
+
export declare function showNativeToast(message: string, duration?: ToastDuration): Promise<boolean>;
|
|
4
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../src/shell-native/toast.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG5D,2FAA2F;AAC3F,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,aAAuB,GAChC,OAAO,CAAC,OAAO,CAAC,CAQlB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isNativePluginAvailable as e } from "./platform.js";
|
|
2
|
+
import { Toast as t } from "@capacitor/toast";
|
|
3
|
+
//#region src/shell-native/toast.ts
|
|
4
|
+
async function n(n, r = "short") {
|
|
5
|
+
if (!e("Toast")) return !1;
|
|
6
|
+
try {
|
|
7
|
+
return await t.show({
|
|
8
|
+
text: n,
|
|
9
|
+
duration: r
|
|
10
|
+
}), !0;
|
|
11
|
+
} catch {
|
|
12
|
+
return !1;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as showNativeToast };
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import { NativePreviewMode } from '../shared/native/types';
|
|
2
|
+
export type { NativePreviewMode } from '../shared/native/types';
|
|
3
|
+
/** Capacitor platform string, possibly overridden by a presentation preview. */
|
|
4
|
+
export type NativeShellPlatform = "ios" | "android" | "web";
|
|
5
|
+
/**
|
|
6
|
+
* Per-shell native configuration — the shape of each product's `native.config.json`.
|
|
7
|
+
*
|
|
8
|
+
* JSON-schema sketch:
|
|
9
|
+
* ```json
|
|
10
|
+
* {
|
|
11
|
+
* "slug": "vibecontrols", // product slug (kebab), used for cache names etc.
|
|
12
|
+
* "displayName": "VibeControls", // human app name (store listing / manifest name)
|
|
13
|
+
* "appId": "com.vibecontrols.www", // iOS bundle id / Android applicationId
|
|
14
|
+
* "electronAppId": "com.vibecontrols.desktop", // optional Electron appId (defaults to appId)
|
|
15
|
+
* "desktopCapgoId": "...", // optional CapGo app id for the desktop updater
|
|
16
|
+
* "envPrefix": "VIBECONTROLS", // optional env-var prefix for CI scripts
|
|
17
|
+
* "scheme": "vibecontrols", // custom URL scheme for deep links
|
|
18
|
+
* "brandColor": "#0c243c", // splash/manifest theme color (build-time config, not UI code)
|
|
19
|
+
* "description": "…",
|
|
20
|
+
* "domains": { "prodApp": "app.vibecontrols.com", "alphaApp": "alphaapp.vibecontrols.com",
|
|
21
|
+
* "website": "vibecontrols.com", "docs": "docs.vibecontrols.com" },
|
|
22
|
+
* "buckets": { "prodWebsite": "…", "alphaDownloads": "…" },
|
|
23
|
+
* "platforms": { "capacitor": true, "electron": true, "pwa": true },
|
|
24
|
+
* "electronCategory": { "mac": "public.app-category.productivity", "linux": "Office" },
|
|
25
|
+
* "links": { "docs": "https://…", "support": "https://…", "status": "https://status.burdenoff.com" },
|
|
26
|
+
* "push": true,
|
|
27
|
+
* "ota": { "channel": "production" },
|
|
28
|
+
* "orientation": "portrait",
|
|
29
|
+
* "devServerPort": 5173
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export interface NativeConfig {
|
|
34
|
+
slug: string;
|
|
35
|
+
displayName: string;
|
|
36
|
+
appId: string;
|
|
37
|
+
electronAppId?: string;
|
|
38
|
+
desktopCapgoId?: string;
|
|
39
|
+
envPrefix?: string;
|
|
40
|
+
scheme: string;
|
|
41
|
+
brandColor: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
domains: {
|
|
44
|
+
prodApp: string;
|
|
45
|
+
alphaApp: string;
|
|
46
|
+
website: string;
|
|
47
|
+
docs?: string;
|
|
48
|
+
};
|
|
49
|
+
buckets?: {
|
|
50
|
+
prodWebsite?: string;
|
|
51
|
+
alphaDownloads?: string;
|
|
52
|
+
};
|
|
53
|
+
platforms: {
|
|
54
|
+
capacitor: boolean;
|
|
55
|
+
electron: boolean;
|
|
56
|
+
pwa?: boolean;
|
|
57
|
+
};
|
|
58
|
+
electronCategory?: {
|
|
59
|
+
mac?: string;
|
|
60
|
+
linux?: string;
|
|
61
|
+
};
|
|
62
|
+
links?: {
|
|
63
|
+
docs?: string;
|
|
64
|
+
support?: string;
|
|
65
|
+
status?: string;
|
|
66
|
+
};
|
|
67
|
+
push?: boolean;
|
|
68
|
+
ota?: {
|
|
69
|
+
/** CapGo mobile app id (usually the Capacitor appId). */
|
|
70
|
+
mobileAppId?: string;
|
|
71
|
+
channel?: string;
|
|
72
|
+
};
|
|
73
|
+
orientation?: "portrait" | "any";
|
|
74
|
+
devServerPort?: number;
|
|
75
|
+
/** Manifest `background_color` (splash + PWA). Falls back to `brandColor`. */
|
|
76
|
+
backgroundColor?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Desktop slice, consumed verbatim as `DesktopProductConfig` by
|
|
79
|
+
* `@burdenoff/desktop-shell`. Present in every generated
|
|
80
|
+
* `native.config.json`; the flat `electronAppId` / `desktopCapgoId` /
|
|
81
|
+
* `envPrefix` / `electronCategory` / `links` fields above are the legacy
|
|
82
|
+
* spelling kept for older callers.
|
|
83
|
+
*/
|
|
84
|
+
desktop?: {
|
|
85
|
+
product: string;
|
|
86
|
+
productName: string;
|
|
87
|
+
appId: string;
|
|
88
|
+
capgoAppId?: string;
|
|
89
|
+
scheme: string;
|
|
90
|
+
domain: string;
|
|
91
|
+
devServerPort?: number;
|
|
92
|
+
envPrefix?: string;
|
|
93
|
+
appOrigins?: {
|
|
94
|
+
prod?: string;
|
|
95
|
+
alpha?: string;
|
|
96
|
+
local?: string;
|
|
97
|
+
};
|
|
98
|
+
category?: {
|
|
99
|
+
mac?: string;
|
|
100
|
+
linux?: string;
|
|
101
|
+
};
|
|
102
|
+
links?: {
|
|
103
|
+
docs?: string;
|
|
104
|
+
support?: string;
|
|
105
|
+
status?: string;
|
|
106
|
+
};
|
|
107
|
+
window?: {
|
|
108
|
+
width?: number;
|
|
109
|
+
height?: number;
|
|
110
|
+
minWidth?: number;
|
|
111
|
+
minHeight?: number;
|
|
112
|
+
};
|
|
113
|
+
closeToTray?: {
|
|
114
|
+
darwin?: boolean;
|
|
115
|
+
win32?: boolean;
|
|
116
|
+
linux?: boolean;
|
|
117
|
+
};
|
|
118
|
+
iconSource?: string;
|
|
119
|
+
legacyGlobal?: boolean;
|
|
120
|
+
maintainer?: string;
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/** Android hardware back-button precedence: overlay → history → exit. */
|
|
124
|
+
export interface BackButtonHandlers {
|
|
125
|
+
/** Close the top-most open overlay (dialog/sheet). Return true when one was closed. */
|
|
126
|
+
closeTopOverlay(): boolean;
|
|
127
|
+
/** True when there is in-app history to pop. */
|
|
128
|
+
canNavigateBack(): boolean;
|
|
129
|
+
navigateBack(): void;
|
|
130
|
+
/** Last resort: ask the user and exit the app. */
|
|
131
|
+
confirmExit(): void;
|
|
132
|
+
}
|
|
133
|
+
/** App foreground/background hooks (Capacitor `appStateChange`). */
|
|
134
|
+
export interface MobileRuntimeHooks {
|
|
135
|
+
/** Called when the app returns to the foreground (refetch, resume sockets…). */
|
|
136
|
+
syncPendingOperations(): Promise<void>;
|
|
137
|
+
/** Called when the app goes to the background (flush drafts/state). */
|
|
138
|
+
saveState(): void;
|
|
139
|
+
}
|
|
140
|
+
export interface NetworkHooks {
|
|
141
|
+
onReconnect?(): void;
|
|
142
|
+
onDisconnect?(): void;
|
|
143
|
+
}
|
|
144
|
+
export interface CapacitorListenerHandleLike {
|
|
145
|
+
remove(): Promise<void> | void;
|
|
146
|
+
}
|
|
147
|
+
/** Structural subset of `@capgo/capacitor-updater`'s `CapacitorUpdater`. */
|
|
148
|
+
export interface CapacitorUpdaterLike {
|
|
149
|
+
notifyAppReady(): Promise<unknown>;
|
|
150
|
+
}
|
|
151
|
+
export interface PushTokenLike {
|
|
152
|
+
value: string;
|
|
153
|
+
}
|
|
154
|
+
export interface PushNotificationSchemaLike {
|
|
155
|
+
id?: string;
|
|
156
|
+
title?: string;
|
|
157
|
+
body?: string;
|
|
158
|
+
data?: Record<string, unknown> | null;
|
|
159
|
+
}
|
|
160
|
+
export interface PushActionPerformedLike {
|
|
161
|
+
actionId?: string;
|
|
162
|
+
notification: PushNotificationSchemaLike;
|
|
163
|
+
}
|
|
164
|
+
export type PushPermissionStateLike = "prompt" | "prompt-with-rationale" | "granted" | "denied";
|
|
165
|
+
/** Structural subset of `@capacitor/push-notifications`' `PushNotifications`. */
|
|
166
|
+
export interface PushNotificationsLike {
|
|
167
|
+
checkPermissions(): Promise<{
|
|
168
|
+
receive: PushPermissionStateLike;
|
|
169
|
+
}>;
|
|
170
|
+
requestPermissions(): Promise<{
|
|
171
|
+
receive: PushPermissionStateLike;
|
|
172
|
+
}>;
|
|
173
|
+
register(): Promise<void>;
|
|
174
|
+
addListener(eventName: "registration", listener: (token: PushTokenLike) => void): Promise<CapacitorListenerHandleLike>;
|
|
175
|
+
addListener(eventName: "registrationError", listener: (error: {
|
|
176
|
+
error: string;
|
|
177
|
+
}) => void): Promise<CapacitorListenerHandleLike>;
|
|
178
|
+
addListener(eventName: "pushNotificationReceived", listener: (notification: PushNotificationSchemaLike) => void): Promise<CapacitorListenerHandleLike>;
|
|
179
|
+
addListener(eventName: "pushNotificationActionPerformed", listener: (action: PushActionPerformedLike) => void): Promise<CapacitorListenerHandleLike>;
|
|
180
|
+
}
|
|
181
|
+
export type UpdaterLoader = () => Promise<{
|
|
182
|
+
CapacitorUpdater: CapacitorUpdaterLike;
|
|
183
|
+
}>;
|
|
184
|
+
export type PushNotificationsLoader = () => Promise<{
|
|
185
|
+
PushNotifications: PushNotificationsLike;
|
|
186
|
+
}>;
|
|
187
|
+
export interface OptionalPluginLoaders {
|
|
188
|
+
/** `() => import('@capgo/capacitor-updater')` */
|
|
189
|
+
updater?: UpdaterLoader;
|
|
190
|
+
/** `() => import('@capacitor/push-notifications')` */
|
|
191
|
+
pushNotifications?: PushNotificationsLoader;
|
|
192
|
+
}
|
|
193
|
+
export interface PushOptions {
|
|
194
|
+
enabled: boolean;
|
|
195
|
+
/** Called with the APNs/FCM token once registration succeeds. */
|
|
196
|
+
onToken?(token: string, platform: "ios" | "android"): void;
|
|
197
|
+
/** Called when the user taps a notification (after the deep-link navigator ran). */
|
|
198
|
+
onNotificationAction?(action: PushActionPerformedLike): void;
|
|
199
|
+
/** Called when a notification is received in the foreground. */
|
|
200
|
+
onNotificationReceived?(notification: PushNotificationSchemaLike): void;
|
|
201
|
+
}
|
|
202
|
+
export interface PwaOptions {
|
|
203
|
+
/** Default true. Registers the service worker on web builds. */
|
|
204
|
+
enabled?: boolean;
|
|
205
|
+
/** Default `/sw.js`. */
|
|
206
|
+
swUrl?: string;
|
|
207
|
+
/** Default 60_000 ms. */
|
|
208
|
+
updateCheckIntervalMs?: number;
|
|
209
|
+
}
|
|
210
|
+
export interface SplashOptions {
|
|
211
|
+
/**
|
|
212
|
+
* When true (default), `markAppReady()` is still the shell's responsibility —
|
|
213
|
+
* this only arms a safety timer so the splash can never stick forever.
|
|
214
|
+
*/
|
|
215
|
+
autoHide?: boolean;
|
|
216
|
+
/** Default 8000 ms — safety timer that hides the splash even if the shell forgets. */
|
|
217
|
+
maxWaitMs?: number;
|
|
218
|
+
}
|
|
219
|
+
export interface AuthInterceptOptions {
|
|
220
|
+
enabled?: boolean;
|
|
221
|
+
/** Defaults to `['/auth/sso-deposit', '/auth/sso-relay', '/auth/sso-clear']`. */
|
|
222
|
+
pathPrefixes?: string[];
|
|
223
|
+
}
|
|
224
|
+
export interface BootNativeShellOptions {
|
|
225
|
+
/** Product slug, e.g. `vibecontrols`. Used for the legacy Electron global key. */
|
|
226
|
+
product: string;
|
|
227
|
+
/** Human name used in dialogs (e.g. "Exit VibeControls"). */
|
|
228
|
+
appName: string;
|
|
229
|
+
/**
|
|
230
|
+
* Legacy Electron preload global (`window.<key>`). Defaults to
|
|
231
|
+
* `${product}Electron`. `window.__burdenoffDesktop` is always checked first.
|
|
232
|
+
*/
|
|
233
|
+
electronGlobalKey?: string;
|
|
234
|
+
plugins?: OptionalPluginLoaders;
|
|
235
|
+
push?: PushOptions;
|
|
236
|
+
backButton?: Partial<BackButtonHandlers>;
|
|
237
|
+
runtimeHooks?: Partial<MobileRuntimeHooks>;
|
|
238
|
+
network?: NetworkHooks;
|
|
239
|
+
authIntercept?: AuthInterceptOptions;
|
|
240
|
+
splash?: SplashOptions;
|
|
241
|
+
/** Allow `?__nativePreview=` presentation previews. Default true. */
|
|
242
|
+
preview?: {
|
|
243
|
+
allow?: boolean;
|
|
244
|
+
};
|
|
245
|
+
pwa?: PwaOptions;
|
|
246
|
+
/** Desktop (Electron) shell boot — forwarded to `bootDesktopShell`. */
|
|
247
|
+
desktop?: {
|
|
248
|
+
navigate?: (path: string) => void;
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
export interface NativeShellHandle {
|
|
252
|
+
platform: NativeShellPlatform;
|
|
253
|
+
/** Real Capacitor native OR an ios/android presentation preview. */
|
|
254
|
+
isNative: boolean;
|
|
255
|
+
isPreview: boolean;
|
|
256
|
+
previewMode: NativePreviewMode | null;
|
|
257
|
+
/** Hide the splash screen (idempotent) and dispatch `burdenoff:appReady`. */
|
|
258
|
+
markAppReady(): Promise<void>;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Legacy per-product Electron preload bridge (`window.<product>Electron`). New
|
|
262
|
+
* desktop shells expose `window.__burdenoffDesktop` instead; both are honoured.
|
|
263
|
+
*/
|
|
264
|
+
export interface LegacyElectronBridge {
|
|
265
|
+
isElectron?: boolean;
|
|
266
|
+
openExternal?(url: string): Promise<boolean> | boolean;
|
|
267
|
+
onDeepLink?(cb: (url: string) => void): unknown;
|
|
268
|
+
}
|
|
269
|
+
export interface DeepLinkDetail {
|
|
270
|
+
path: string;
|
|
271
|
+
url: string;
|
|
272
|
+
}
|
|
273
|
+
export interface NetworkStatusDetail {
|
|
274
|
+
connected: boolean;
|
|
275
|
+
connectionType?: string;
|
|
276
|
+
}
|
|
277
|
+
/** `beforeinstallprompt` event (not in lib.dom). */
|
|
278
|
+
export interface BeforeInstallPromptEventLike extends Event {
|
|
279
|
+
readonly platforms?: string[];
|
|
280
|
+
readonly userChoice?: Promise<{
|
|
281
|
+
outcome: "accepted" | "dismissed";
|
|
282
|
+
platform: string;
|
|
283
|
+
}>;
|
|
284
|
+
prompt(): Promise<void>;
|
|
285
|
+
}
|
|
286
|
+
declare global {
|
|
287
|
+
interface Window {
|
|
288
|
+
/** Deferred `beforeinstallprompt` captured by `installPwa()` for install banners. */
|
|
289
|
+
__burdenoffPwaInstallPrompt?: BeforeInstallPromptEventLike | null;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/shell-native/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,SAAS,GAAG,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'./types';
|
|
2
|
+
export interface WebManifestIcon {
|
|
3
|
+
src: string;
|
|
4
|
+
sizes: string;
|
|
5
|
+
type: string;
|
|
6
|
+
purpose?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface WebManifestShortcut {
|
|
9
|
+
name: string;
|
|
10
|
+
url: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface WebManifestLike {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
short_name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
start_url: string;
|
|
19
|
+
scope: string;
|
|
20
|
+
display: string;
|
|
21
|
+
display_override: string[];
|
|
22
|
+
orientation: string;
|
|
23
|
+
theme_color: string;
|
|
24
|
+
background_color: string;
|
|
25
|
+
icons: WebManifestIcon[];
|
|
26
|
+
shortcuts?: WebManifestShortcut[];
|
|
27
|
+
categories: string[];
|
|
28
|
+
lang: string;
|
|
29
|
+
related_applications: unknown[];
|
|
30
|
+
prefer_related_applications: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare function defineWebManifest(cfg: NativeConfig, extra?: {
|
|
33
|
+
shortcuts?: WebManifestShortcut[];
|
|
34
|
+
categories?: string[];
|
|
35
|
+
}): WebManifestLike;
|
|
36
|
+
//# sourceMappingURL=web-manifest.d.ts.map
|