@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.
Files changed (240) hide show
  1. package/README.md +66 -0
  2. package/dist/button/Button.d.ts +1 -1
  3. package/dist/chrome/AppShellLayout.d.ts +14 -0
  4. package/dist/chrome/AppShellLayout.d.ts.map +1 -1
  5. package/dist/chrome/AppShellLayout.js +13 -10
  6. package/dist/chrome/DynamicFooter.d.ts +6 -1
  7. package/dist/chrome/DynamicFooter.d.ts.map +1 -1
  8. package/dist/chrome/DynamicFooter.js +21 -20
  9. package/dist/chrome/Footer.d.ts +6 -0
  10. package/dist/chrome/Footer.d.ts.map +1 -1
  11. package/dist/chrome/Footer.js +46 -45
  12. package/dist/chrome/FooterBar.d.ts +6 -1
  13. package/dist/chrome/FooterBar.d.ts.map +1 -1
  14. package/dist/chrome/FooterBar.js +28 -26
  15. package/dist/chrome/HeaderBar.d.ts.map +1 -1
  16. package/dist/chrome/HeaderBar.js +3 -0
  17. package/dist/chrome/MobileTabBar.d.ts +26 -0
  18. package/dist/chrome/MobileTabBar.d.ts.map +1 -0
  19. package/dist/chrome/MobileTabBar.js +194 -0
  20. package/dist/chrome/NativePageTransition.d.ts +10 -0
  21. package/dist/chrome/NativePageTransition.d.ts.map +1 -0
  22. package/dist/chrome/NativePageTransition.js +19 -0
  23. package/dist/chrome/NativeTopBar.d.ts +21 -0
  24. package/dist/chrome/NativeTopBar.d.ts.map +1 -0
  25. package/dist/chrome/NativeTopBar.js +72 -0
  26. package/dist/chrome/NotificationCenter.d.ts.map +1 -1
  27. package/dist/chrome/NotificationCenter.js +70 -65
  28. package/dist/chrome/ProductSideNav.d.ts.map +1 -1
  29. package/dist/chrome/ProductSideNav.js +44 -74
  30. package/dist/chrome/SwipeNavigation.d.ts +36 -0
  31. package/dist/chrome/SwipeNavigation.d.ts.map +1 -0
  32. package/dist/chrome/SwipeNavigation.js +111 -0
  33. package/dist/chrome/index.d.ts +14 -7
  34. package/dist/chrome/index.d.ts.map +1 -1
  35. package/dist/chrome/mobileTabBar/selectTabs.d.ts +45 -0
  36. package/dist/chrome/mobileTabBar/selectTabs.d.ts.map +1 -0
  37. package/dist/chrome/mobileTabBar/selectTabs.js +28 -0
  38. package/dist/chrome/mobileTabBar/useMobileTabBarVisible.d.ts +18 -0
  39. package/dist/chrome/mobileTabBar/useMobileTabBarVisible.d.ts.map +1 -0
  40. package/dist/chrome/mobileTabBar/useMobileTabBarVisible.js +16 -0
  41. package/dist/chrome/mobileTabBar/useVisibleNavItems.d.ts +18 -0
  42. package/dist/chrome/mobileTabBar/useVisibleNavItems.d.ts.map +1 -0
  43. package/dist/chrome/mobileTabBar/useVisibleNavItems.js +41 -0
  44. package/dist/chrome/nativeTopBarTitle.d.ts +15 -0
  45. package/dist/chrome/nativeTopBarTitle.d.ts.map +1 -0
  46. package/dist/chrome/nativeTopBarTitle.js +22 -0
  47. package/dist/chrome/swipe/swipeMath.d.ts +25 -0
  48. package/dist/chrome/swipe/swipeMath.d.ts.map +1 -0
  49. package/dist/chrome/swipe/swipeMath.js +14 -0
  50. package/dist/chrome/swipe/swipeState.d.ts +10 -0
  51. package/dist/chrome/swipe/swipeState.d.ts.map +1 -0
  52. package/dist/chrome/swipe/swipeState.js +11 -0
  53. package/dist/chrome.js +8 -1
  54. package/dist/shared/components/DesktopUpdateToast.d.ts +9 -0
  55. package/dist/shared/components/DesktopUpdateToast.d.ts.map +1 -0
  56. package/dist/shared/components/DesktopUpdateToast.js +39 -0
  57. package/dist/shared/components/PWAInstallBanner.js +1 -1
  58. package/dist/shared/components/SSORedirectGuard.d.ts.map +1 -1
  59. package/dist/shared/components/SSORedirectGuard.js +41 -45
  60. package/dist/shared/components/index.d.ts +2 -0
  61. package/dist/shared/components/index.d.ts.map +1 -1
  62. package/dist/shared/config/authBridgeUrls.d.ts +10 -0
  63. package/dist/shared/config/authBridgeUrls.d.ts.map +1 -1
  64. package/dist/shared/config/authBridgeUrls.js +16 -12
  65. package/dist/shared/config/gatewayUrls.d.ts.map +1 -1
  66. package/dist/shared/config/gatewayUrls.js +22 -19
  67. package/dist/shared/config/index.d.ts +1 -1
  68. package/dist/shared/config/index.d.ts.map +1 -1
  69. package/dist/shared/hooks/shell/useNavRegistry.d.ts +7 -0
  70. package/dist/shared/hooks/shell/useNavRegistry.d.ts.map +1 -1
  71. package/dist/shared/hooks/usePWA.d.ts.map +1 -1
  72. package/dist/shared/hooks/usePWA.js +34 -30
  73. package/dist/shared/native/consumers.d.ts +15 -1
  74. package/dist/shared/native/consumers.d.ts.map +1 -1
  75. package/dist/shared/native/consumers.js +26 -7
  76. package/dist/shared/native/desktop.d.ts +123 -0
  77. package/dist/shared/native/desktop.d.ts.map +1 -0
  78. package/dist/shared/native/desktop.js +280 -0
  79. package/dist/shared/native/entry.d.ts +39 -0
  80. package/dist/shared/native/entry.d.ts.map +1 -0
  81. package/dist/shared/native/entry.js +13 -0
  82. package/dist/shared/native/hooks/index.d.ts +10 -0
  83. package/dist/shared/native/hooks/index.d.ts.map +1 -1
  84. package/dist/shared/native/hooks/index.js +6 -0
  85. package/dist/shared/native/hooks/useActionSheet.d.ts +63 -0
  86. package/dist/shared/native/hooks/useActionSheet.d.ts.map +1 -0
  87. package/dist/shared/native/hooks/useActionSheet.js +45 -0
  88. package/dist/shared/native/hooks/useDesktop.d.ts +15 -0
  89. package/dist/shared/native/hooks/useDesktop.d.ts.map +1 -0
  90. package/dist/shared/native/hooks/useDesktop.js +18 -0
  91. package/dist/shared/native/hooks/useDesktopUpdateState.d.ts +7 -0
  92. package/dist/shared/native/hooks/useDesktopUpdateState.d.ts.map +1 -0
  93. package/dist/shared/native/hooks/useDesktopUpdateState.js +20 -0
  94. package/dist/shared/native/hooks/useDesktopWindowState.d.ts +7 -0
  95. package/dist/shared/native/hooks/useDesktopWindowState.d.ts.map +1 -0
  96. package/dist/shared/native/hooks/useDesktopWindowState.js +9 -0
  97. package/dist/shared/native/hooks/useHaptics.d.ts +1 -0
  98. package/dist/shared/native/hooks/useHaptics.d.ts.map +1 -1
  99. package/dist/shared/native/hooks/useHaptics.js +6 -6
  100. package/dist/shared/native/hooks/useNetworkStatus.d.ts +23 -0
  101. package/dist/shared/native/hooks/useNetworkStatus.d.ts.map +1 -0
  102. package/dist/shared/native/hooks/useNetworkStatus.js +29 -0
  103. package/dist/shared/native/hooks/usePullToRefresh.d.ts +62 -0
  104. package/dist/shared/native/hooks/usePullToRefresh.d.ts.map +1 -0
  105. package/dist/shared/native/hooks/usePullToRefresh.js +84 -0
  106. package/dist/shared/native/index.d.ts +6 -1
  107. package/dist/shared/native/index.d.ts.map +1 -1
  108. package/dist/shared/native/platform.d.ts.map +1 -1
  109. package/dist/shared/native/platform.js +2 -1
  110. package/dist/shared/native/purchases.d.ts +7 -1
  111. package/dist/shared/native/purchases.d.ts.map +1 -1
  112. package/dist/shared/native/purchases.js +3 -3
  113. package/dist/shared/native/types.d.ts +136 -0
  114. package/dist/shared/native/types.d.ts.map +1 -1
  115. package/dist/shared/providers/AppShellProvider.d.ts.map +1 -1
  116. package/dist/shared/providers/AppShellProvider.js +117 -115
  117. package/dist/shared/providers/shell/ThemeProvider.d.ts.map +1 -1
  118. package/dist/shared/providers/shell/ThemeProvider.js +64 -51
  119. package/dist/shared/providers/shell/authProvider/useSsoDepositBootGuard.d.ts.map +1 -1
  120. package/dist/shared/providers/shell/authProvider/useSsoDepositBootGuard.js +25 -29
  121. package/dist/shared/utils/gatewayFetchRewrite.d.ts.map +1 -1
  122. package/dist/shared/utils/gatewayFetchRewrite.js +87 -84
  123. package/dist/shared-components.js +2 -1
  124. package/dist/shared-config.js +10 -10
  125. package/dist/shared-native.js +21 -13
  126. package/dist/shared.js +120 -111
  127. package/dist/shell-native/actionSheet.d.ts +7 -0
  128. package/dist/shell-native/actionSheet.d.ts.map +1 -0
  129. package/dist/shell-native/actionSheet.js +26 -0
  130. package/dist/shell-native/app-lifecycle.d.ts +4 -0
  131. package/dist/shell-native/app-lifecycle.d.ts.map +1 -0
  132. package/dist/shell-native/app-lifecycle.js +12 -0
  133. package/dist/shell-native/auth-navigation.d.ts +4 -0
  134. package/dist/shell-native/auth-navigation.d.ts.map +1 -0
  135. package/dist/shell-native/auth-navigation.js +95 -0
  136. package/dist/shell-native/back-button.d.ts +8 -0
  137. package/dist/shell-native/back-button.d.ts.map +1 -0
  138. package/dist/shell-native/back-button.js +49 -0
  139. package/dist/shell-native/boot.d.ts +10 -0
  140. package/dist/shell-native/boot.d.ts.map +1 -0
  141. package/dist/shell-native/boot.js +65 -0
  142. package/dist/shell-native/bridge.d.ts +7 -0
  143. package/dist/shell-native/bridge.d.ts.map +1 -0
  144. package/dist/shell-native/bridge.js +30 -0
  145. package/dist/shell-native/browser.d.ts +12 -0
  146. package/dist/shell-native/browser.d.ts.map +1 -0
  147. package/dist/shell-native/browser.js +45 -0
  148. package/dist/shell-native/capacitor-config.d.ts +21 -0
  149. package/dist/shell-native/capacitor-config.d.ts.map +1 -0
  150. package/dist/shell-native/capacitor-config.js +102 -0
  151. package/dist/shell-native/clipboard.d.ts +3 -0
  152. package/dist/shell-native/clipboard.d.ts.map +1 -0
  153. package/dist/shell-native/clipboard.js +26 -0
  154. package/dist/shell-native/deep-link.d.ts +19 -0
  155. package/dist/shell-native/deep-link.d.ts.map +1 -0
  156. package/dist/shell-native/deep-link.js +53 -0
  157. package/dist/shell-native/desktop-bridge.d.ts +14 -0
  158. package/dist/shell-native/desktop-bridge.d.ts.map +1 -0
  159. package/dist/shell-native/desktop-bridge.js +17 -0
  160. package/dist/shell-native/device.d.ts +4 -0
  161. package/dist/shell-native/device.d.ts.map +1 -0
  162. package/dist/shell-native/device.js +27 -0
  163. package/dist/shell-native/dialog.d.ts +4 -0
  164. package/dist/shell-native/dialog.d.ts.map +1 -0
  165. package/dist/shell-native/dialog.js +13 -0
  166. package/dist/shell-native/feedback.d.ts +6 -0
  167. package/dist/shell-native/feedback.d.ts.map +1 -0
  168. package/dist/shell-native/feedback.js +29 -0
  169. package/dist/shell-native/index.d.ts +54 -0
  170. package/dist/shell-native/index.d.ts.map +1 -0
  171. package/dist/shell-native/keyboard.d.ts +15 -0
  172. package/dist/shell-native/keyboard.d.ts.map +1 -0
  173. package/dist/shell-native/keyboard.js +42 -0
  174. package/dist/shell-native/network.d.ts +9 -0
  175. package/dist/shell-native/network.d.ts.map +1 -0
  176. package/dist/shell-native/network.js +40 -0
  177. package/dist/shell-native/ota.d.ts +3 -0
  178. package/dist/shell-native/ota.d.ts.map +1 -0
  179. package/dist/shell-native/ota.js +21 -0
  180. package/dist/shell-native/platform.d.ts +21 -0
  181. package/dist/shell-native/platform.d.ts.map +1 -0
  182. package/dist/shell-native/platform.js +51 -0
  183. package/dist/shell-native/preview.d.ts +18 -0
  184. package/dist/shell-native/preview.d.ts.map +1 -0
  185. package/dist/shell-native/preview.js +124 -0
  186. package/dist/shell-native/push.d.ts +14 -0
  187. package/dist/shell-native/push.d.ts.map +1 -0
  188. package/dist/shell-native/push.js +62 -0
  189. package/dist/shell-native/pwa.d.ts +14 -0
  190. package/dist/shell-native/pwa.d.ts.map +1 -0
  191. package/dist/shell-native/pwa.js +49 -0
  192. package/dist/shell-native/service-worker.d.ts +5 -0
  193. package/dist/shell-native/service-worker.d.ts.map +1 -0
  194. package/dist/shell-native/service-worker.js +144 -0
  195. package/dist/shell-native/share.d.ts +4 -0
  196. package/dist/shell-native/share.d.ts.map +1 -0
  197. package/dist/shell-native/share.js +19 -0
  198. package/dist/shell-native/splash.d.ts +16 -0
  199. package/dist/shell-native/splash.d.ts.map +1 -0
  200. package/dist/shell-native/splash.js +25 -0
  201. package/dist/shell-native/system-bars.d.ts +24 -0
  202. package/dist/shell-native/system-bars.d.ts.map +1 -0
  203. package/dist/shell-native/system-bars.js +49 -0
  204. package/dist/shell-native/toast.d.ts +4 -0
  205. package/dist/shell-native/toast.d.ts.map +1 -0
  206. package/dist/shell-native/toast.js +16 -0
  207. package/dist/shell-native/types.d.ts +292 -0
  208. package/dist/shell-native/types.d.ts.map +1 -0
  209. package/dist/shell-native/web-manifest.d.ts +36 -0
  210. package/dist/shell-native/web-manifest.d.ts.map +1 -0
  211. package/dist/shell-native/web-manifest.js +55 -0
  212. package/dist/shell-native.d.ts +2 -0
  213. package/dist/shell-native.js +29 -0
  214. package/dist/ui/action-sheet.d.ts +29 -0
  215. package/dist/ui/action-sheet.d.ts.map +1 -0
  216. package/dist/ui/action-sheet.js +53 -0
  217. package/dist/ui/badge.d.ts +1 -1
  218. package/dist/ui/button.d.ts +1 -1
  219. package/dist/ui/index.d.ts +6 -0
  220. package/dist/ui/index.d.ts.map +1 -1
  221. package/dist/ui/native-welcome.d.ts +61 -0
  222. package/dist/ui/native-welcome.d.ts.map +1 -0
  223. package/dist/ui/native-welcome.js +152 -0
  224. package/dist/ui/offline-banner.d.ts +22 -0
  225. package/dist/ui/offline-banner.d.ts.map +1 -0
  226. package/dist/ui/offline-banner.js +34 -0
  227. package/dist/ui/pull-to-refresh.d.ts +29 -0
  228. package/dist/ui/pull-to-refresh.d.ts.map +1 -0
  229. package/dist/ui/pull-to-refresh.js +44 -0
  230. package/dist/ui/pwa-update-toast.d.ts +34 -0
  231. package/dist/ui/pwa-update-toast.d.ts.map +1 -0
  232. package/dist/ui/pwa-update-toast.js +43 -0
  233. package/dist/ui/select.d.ts +38 -0
  234. package/dist/ui/select.d.ts.map +1 -1
  235. package/dist/ui/select.js +162 -61
  236. package/dist/ui.js +40 -35
  237. package/package.json +93 -4
  238. package/src/shared/styles/app-shell.css +3 -0
  239. package/src/shared/styles/native.css +577 -0
  240. package/dist/node_modules/@capacitor/core/dist/index.js +0 -268
@@ -0,0 +1,45 @@
1
+ import { nativeActionSheet as e } from "../consumers.js";
2
+ import { useCallback as t, useMemo as n, useRef as r, useState as i } from "react";
3
+ //#region src/shared/native/hooks/useActionSheet.ts
4
+ function a(e, t) {
5
+ return e === null ? { source: "fallback" } : !Number.isInteger(e) || e < 0 || e >= t ? {
6
+ source: "native",
7
+ index: null
8
+ } : {
9
+ source: "native",
10
+ index: e
11
+ };
12
+ }
13
+ var o = [];
14
+ function s() {
15
+ let [s, c] = i(null), l = r(null), u = t((e) => {
16
+ let t = l.current;
17
+ l.current = null, c(null), t?.(e);
18
+ }, []);
19
+ return {
20
+ show: t(async (t) => {
21
+ if (t.options.length === 0) return null;
22
+ let n = a(await e({
23
+ title: t.title,
24
+ message: t.message,
25
+ options: t.options
26
+ }), t.options.length);
27
+ return n.source === "native" ? n.index : (l.current?.(null), new Promise((e) => {
28
+ l.current = e, c(t);
29
+ }));
30
+ }, []),
31
+ sheetProps: n(() => ({
32
+ open: s !== null,
33
+ onOpenChange: (e) => {
34
+ e || u(null);
35
+ },
36
+ title: s?.title,
37
+ message: s?.message,
38
+ options: s?.options ?? o,
39
+ cancelLabel: s?.cancelLabel,
40
+ onSelect: (e) => u(e)
41
+ }), [s, u])
42
+ };
43
+ }
44
+ //#endregion
45
+ export { a as resolveActionSheetOutcome, s as useActionSheet };
@@ -0,0 +1,15 @@
1
+ import { BurdenoffDesktopBridge, DesktopPlatform, DesktopTitlebarMode } from '../types';
2
+ export interface UseDesktopResult {
3
+ isDesktop: boolean;
4
+ platform?: DesktopPlatform;
5
+ titlebar?: DesktopTitlebarMode;
6
+ versions?: BurdenoffDesktopBridge['versions'];
7
+ product?: BurdenoffDesktopBridge['product'];
8
+ bridge: BurdenoffDesktopBridge | null;
9
+ }
10
+ /**
11
+ * Desktop shell identity. `isDesktop` is true for the legacy per-product
12
+ * preload too, in which case only `bridge`-derived fields are undefined.
13
+ */
14
+ export declare function useDesktop(): UseDesktopResult;
15
+ //# sourceMappingURL=useDesktop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDesktop.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/useDesktop.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE7F,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAC9C,OAAO,CAAC,EAAE,sBAAsB,CAAC,SAAS,CAAC,CAAC;IAC5C,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACvC;AAED;;;GAGG;AACH,wBAAgB,UAAU,IAAI,gBAAgB,CAY7C"}
@@ -0,0 +1,18 @@
1
+ import { getDesktopBridge as e, isDesktop as t } from "../desktop.js";
2
+ import { useMemo as n } from "react";
3
+ //#region src/shared/native/hooks/useDesktop.ts
4
+ function r() {
5
+ return n(() => {
6
+ let n = e();
7
+ return {
8
+ isDesktop: t(),
9
+ platform: n?.platform,
10
+ titlebar: n?.titlebar,
11
+ versions: n?.versions,
12
+ product: n?.product,
13
+ bridge: n
14
+ };
15
+ }, []);
16
+ }
17
+ //#endregion
18
+ export { r as useDesktop };
@@ -0,0 +1,7 @@
1
+ import { DesktopUpdateState } from '../types';
2
+ /**
3
+ * Live auto-update state from the desktop shell. Always
4
+ * `{ status: 'unsupported' }` on web.
5
+ */
6
+ export declare function useDesktopUpdateState(): DesktopUpdateState;
7
+ //# sourceMappingURL=useDesktopUpdateState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDesktopUpdateState.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/useDesktopUpdateState.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAqB1D"}
@@ -0,0 +1,20 @@
1
+ import { DESKTOP_UPDATE_UNSUPPORTED as e, getDesktopUpdateState as t, onDesktopUpdateState as n } from "../desktop.js";
2
+ import { useEffect as r, useState as i } from "react";
3
+ //#region src/shared/native/hooks/useDesktopUpdateState.ts
4
+ function a() {
5
+ let [a, o] = i(e);
6
+ return r(() => {
7
+ let e = !1;
8
+ t().then((t) => {
9
+ e || o(t);
10
+ });
11
+ let r = n((t) => {
12
+ e || o(t);
13
+ });
14
+ return () => {
15
+ e = !0, r();
16
+ };
17
+ }, []), a;
18
+ }
19
+ //#endregion
20
+ export { a as useDesktopUpdateState };
@@ -0,0 +1,7 @@
1
+ import { DesktopWindowState } from '../types';
2
+ /**
3
+ * Window focus / fullscreen / maximize state, kept in sync by
4
+ * `bootDesktopShell()`. Returns the neutral default on web.
5
+ */
6
+ export declare function useDesktopWindowState(): DesktopWindowState;
7
+ //# sourceMappingURL=useDesktopWindowState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDesktopWindowState.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/useDesktopWindowState.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAM1D"}
@@ -0,0 +1,9 @@
1
+ import { getDesktopWindowState as e, onDesktopWindowState as t } from "../desktop.js";
2
+ import { useEffect as n, useState as r } from "react";
3
+ //#region src/shared/native/hooks/useDesktopWindowState.ts
4
+ function i() {
5
+ let [i, a] = r(() => e());
6
+ return n(() => t(a), []), i;
7
+ }
8
+ //#endregion
9
+ export { i as useDesktopWindowState };
@@ -2,6 +2,7 @@ import { HapticImpactStyle, HapticNotificationType } from '../types';
2
2
  export interface UseHapticsResult {
3
3
  impact: (style?: HapticImpactStyle) => void;
4
4
  notify: (type: HapticNotificationType) => void;
5
+ /** Lightest tap — toggles, segments, picker/tab changes (spec §5.4). */
5
6
  selection: () => void;
6
7
  }
7
8
  export declare function useHaptics(): UseHapticsResult;
@@ -1 +1 @@
1
- {"version":3,"file":"useHaptics.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/useHaptics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC/C,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,UAAU,IAAI,gBAAgB,CAS7C"}
1
+ {"version":3,"file":"useHaptics.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/useHaptics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC/C,wEAAwE;IACxE,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,UAAU,IAAI,gBAAgB,CAS7C"}
@@ -1,12 +1,12 @@
1
- import { nativeImpact as e, nativeNotify as t } from "../consumers.js";
2
- import { useMemo as n } from "react";
1
+ import { nativeImpact as e, nativeNotify as t, nativeSelection as n } from "../consumers.js";
2
+ import { useMemo as r } from "react";
3
3
  //#region src/shared/native/hooks/useHaptics.ts
4
- function r() {
5
- return n(() => ({
4
+ function i() {
5
+ return r(() => ({
6
6
  impact: (t) => e(t),
7
7
  notify: (e) => t(e),
8
- selection: () => e("light")
8
+ selection: () => n()
9
9
  }), []);
10
10
  }
11
11
  //#endregion
12
- export { r as useHaptics };
12
+ export { i as useHaptics };
@@ -0,0 +1,23 @@
1
+ import { NetworkStatusEventDetail } from '../types';
2
+ export interface NetworkStatus {
3
+ connected: boolean;
4
+ /** Capacitor connection type when known (`wifi`, `cellular`, `none`, `unknown`). */
5
+ connectionType?: string;
6
+ }
7
+ /**
8
+ * Pure reducer for connectivity updates. Returns `prev` (referentially) when
9
+ * nothing changed so React state updates are skipped for repeat events.
10
+ */
11
+ export declare function reduceNetworkStatus(prev: NetworkStatus, next: NetworkStatusEventDetail): NetworkStatus;
12
+ /** Initial connectivity snapshot from `navigator.onLine` (optimistic on SSR). */
13
+ export declare function readInitialNetworkStatus(nav?: {
14
+ onLine?: boolean;
15
+ } | undefined): NetworkStatus;
16
+ /**
17
+ * Live connectivity for offline UI. Seeded from `navigator.onLine`, then
18
+ * updated by the shell-native `burdenoff:networkStatusChange` event (Capacitor
19
+ * Network plugin on native) and the browser `online`/`offline` events, so it
20
+ * is correct on web even when `bootNativeShell` was never called.
21
+ */
22
+ export declare function useNetworkStatus(): NetworkStatus;
23
+ //# sourceMappingURL=useNetworkStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNetworkStatus.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/useNetworkStatus.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAKzD,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,aAAa,EACnB,IAAI,EAAE,wBAAwB,GAC7B,aAAa,CAMf;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CACtC,GAAG,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAoE,GAC/F,aAAa,CAKf;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CA0BhD"}
@@ -0,0 +1,29 @@
1
+ import { useEffect as e, useState as t } from "react";
2
+ //#region src/shared/native/hooks/useNetworkStatus.ts
3
+ var n = "burdenoff:networkStatusChange";
4
+ function r(e, t) {
5
+ let n = t.connectionType ?? e.connectionType;
6
+ return e.connected === t.connected && e.connectionType === n ? e : {
7
+ connected: t.connected,
8
+ connectionType: n
9
+ };
10
+ }
11
+ function i(e = typeof navigator > "u" ? void 0 : navigator) {
12
+ return e && typeof e.onLine == "boolean" ? { connected: e.onLine } : { connected: !0 };
13
+ }
14
+ function a() {
15
+ let [a, o] = t(() => i());
16
+ return e(() => {
17
+ let e = (e) => {
18
+ o((t) => r(t, e));
19
+ }, t = (t) => {
20
+ let n = t.detail;
21
+ n && typeof n.connected == "boolean" && e(n);
22
+ }, i = () => e({ connected: !0 }), a = () => e({ connected: !1 });
23
+ return window.addEventListener(n, t), window.addEventListener("online", i), window.addEventListener("offline", a), () => {
24
+ window.removeEventListener(n, t), window.removeEventListener("online", i), window.removeEventListener("offline", a);
25
+ };
26
+ }, []), a;
27
+ }
28
+ //#endregion
29
+ export { i as readInitialNetworkStatus, r as reduceNetworkStatus, a as useNetworkStatus };
@@ -0,0 +1,62 @@
1
+ import { TouchEvent as ReactTouchEvent } from 'react';
2
+ /** Default pull distance (px of finger travel) required to trigger a refresh. */
3
+ export declare const PULL_TO_REFRESH_THRESHOLD = 72;
4
+ /**
5
+ * Refresh progress for a downward pull: 0 at rest, 1 once the finger has
6
+ * travelled `threshold` px. Clamped; negative/zero pulls and invalid
7
+ * thresholds yield 0.
8
+ */
9
+ export declare function computePullProgress(dy: number, threshold: number): number;
10
+ /**
11
+ * Rubber-banded indicator offset (px) for a pull of `dy` px. Approaches
12
+ * `threshold * 1.5` asymptotically so long pulls feel damped like the native
13
+ * gesture instead of tracking the finger 1:1.
14
+ */
15
+ export declare function computePullOffset(dy: number, threshold: number): number;
16
+ export interface UsePullToRefreshOptions {
17
+ /** Called when the gesture completes past the threshold. */
18
+ onRefresh: () => Promise<void> | void;
19
+ /** Finger travel (px) required to arm the refresh. Default 72. */
20
+ threshold?: number;
21
+ /** Hard-disable the gesture (e.g. while a form blocks navigation). */
22
+ disabled?: boolean;
23
+ /**
24
+ * Whether the gesture is active at all. Defaults to `isNative()` — web
25
+ * browsers already have reload affordances; pass `true` to enable it for
26
+ * installed PWAs too.
27
+ */
28
+ enabled?: boolean;
29
+ }
30
+ export interface PullToRefreshBind {
31
+ /** Attach to the scrollable container. */
32
+ ref: (node: HTMLElement | null) => void;
33
+ onTouchStart: (event: ReactTouchEvent<HTMLElement>) => void;
34
+ onTouchMove: (event: ReactTouchEvent<HTMLElement>) => void;
35
+ onTouchEnd: () => void;
36
+ onTouchCancel: () => void;
37
+ }
38
+ export interface UsePullToRefreshResult {
39
+ /** Spread onto the scroll container (`<div {...bind}>`). */
40
+ bind: PullToRefreshBind;
41
+ /** True while the finger is down and pulling past the top. */
42
+ pulling: boolean;
43
+ /** 0..1 — fraction of the threshold reached. */
44
+ progress: number;
45
+ /** Damped indicator offset in px. */
46
+ offset: number;
47
+ /** True while `onRefresh` is running. */
48
+ refreshing: boolean;
49
+ /** Resolved enablement (native detection + `disabled`). */
50
+ enabled: boolean;
51
+ }
52
+ /**
53
+ * Touch pull-to-refresh for scrollable lists (spec §5.7): only engages when
54
+ * the container is scrolled to the top, fires `impact('medium')` once when the
55
+ * pull crosses the threshold, and `notify('success')` after `onRefresh`
56
+ * resolves. Pair with the `PullToRefresh` wrapper from
57
+ * `@burdenoff/fe-libs/ui`, or spread `bind` onto your own container (give it
58
+ * `overscroll-behavior-y: contain` — the `[data-pull-to-refresh]` CSS does
59
+ * this — so the browser's own overscroll doesn't fight the gesture).
60
+ */
61
+ export declare function usePullToRefresh(options: UsePullToRefreshOptions): UsePullToRefreshResult;
62
+ //# sourceMappingURL=usePullToRefresh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePullToRefresh.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/usePullToRefresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,UAAU,IAAI,eAAe,EAAE,MAAM,OAAO,CAAC;AAKnG,iFAAiF;AACjF,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAIvE;AAED,MAAM,WAAW,uBAAuB;IACtC,4DAA4D;IAC5D,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACtC,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC5D,WAAW,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC3D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,IAAI,EAAE,iBAAiB,CAAC;IACxB,8DAA8D;IAC9D,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,2DAA2D;IAC3D,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,sBAAsB,CA0GzF"}
@@ -0,0 +1,84 @@
1
+ import { isNative as e } from "../platform.js";
2
+ import { nativeImpact as t, nativeNotify as n } from "../consumers.js";
3
+ import { useCallback as r, useMemo as i, useRef as a, useState as o } from "react";
4
+ //#region src/shared/native/hooks/usePullToRefresh.ts
5
+ var s = 72;
6
+ function c(e, t) {
7
+ return !(t > 0) || !(e > 0) ? 0 : Math.min(e / t, 1);
8
+ }
9
+ function l(e, t) {
10
+ if (!(t > 0) || !(e > 0)) return 0;
11
+ let n = t * 1.5;
12
+ return Math.round(n * (1 - Math.exp(-e / n)));
13
+ }
14
+ function u(s) {
15
+ let { onRefresh: u, threshold: d = 72, disabled: f = !1 } = s, p = !f && (s.enabled ?? e()), m = a(null), h = a(null), g = a(!1), _ = a(0), v = a(u);
16
+ v.current = u;
17
+ let [y, b] = o(!1), [x, S] = o(0), [C, w] = o(0), [T, E] = o(!1), D = r(() => {
18
+ h.current = null, g.current = !1, _.current = 0, b(!1), S(0), w(0);
19
+ }, []), O = r((e) => {
20
+ m.current = e;
21
+ }, []), k = r((e) => {
22
+ if (!p || T) return;
23
+ let t = m.current;
24
+ if (t && t.scrollTop > 0) return;
25
+ let n = e.touches[0];
26
+ n && (h.current = n.clientY, g.current = !1);
27
+ }, [p, T]), A = r((e) => {
28
+ if (!p || T || h.current === null) return;
29
+ let n = m.current;
30
+ if (n && n.scrollTop > 0) {
31
+ D();
32
+ return;
33
+ }
34
+ let r = e.touches[0];
35
+ if (!r) return;
36
+ let i = r.clientY - h.current, a = c(i, d);
37
+ if (a <= 0) {
38
+ _.current > 0 && D();
39
+ return;
40
+ }
41
+ a >= 1 && !g.current && (g.current = !0, t("medium")), _.current = a, b(!0), S(a), w(l(i, d));
42
+ }, [
43
+ p,
44
+ T,
45
+ D,
46
+ d
47
+ ]), j = r(() => {
48
+ if (!p || h.current === null) return;
49
+ let e = _.current >= 1 && !T;
50
+ D(), e && (E(!0), Promise.resolve().then(() => v.current()).then(() => {
51
+ n("success");
52
+ }).catch(() => {}).finally(() => {
53
+ E(!1);
54
+ }));
55
+ }, [
56
+ p,
57
+ T,
58
+ D
59
+ ]), M = r(() => {
60
+ D();
61
+ }, [D]);
62
+ return {
63
+ bind: i(() => ({
64
+ ref: O,
65
+ onTouchStart: k,
66
+ onTouchMove: A,
67
+ onTouchEnd: j,
68
+ onTouchCancel: M
69
+ }), [
70
+ O,
71
+ k,
72
+ A,
73
+ j,
74
+ M
75
+ ]),
76
+ pulling: y,
77
+ progress: x,
78
+ offset: C,
79
+ refreshing: T,
80
+ enabled: p
81
+ };
82
+ }
83
+ //#endregion
84
+ export { s as PULL_TO_REFRESH_THRESHOLD, l as computePullOffset, c as computePullProgress, u as usePullToRefresh };
@@ -1,8 +1,13 @@
1
- export type { AppState, AppStateEventDetail, BurdenoffNativeBridge, BurdenoffNativePlatform, ConfirmOptions, DeviceInfo, HapticImpactStyle, HapticNotificationType, KeyboardEventDetail, NetworkStatusEventDetail, SafeAreaInsets, ShareOptions, StatusBarTheme, StatusBarThemeEventDetail, ToastDuration, } from './types';
1
+ export type { ActionSheetButton, ActionSheetButtonStyle, ActionSheetOptions, AppState, AppStateEventDetail, BurdenoffDesktopBridge, BurdenoffNativeBridge, BurdenoffNativePlatform, ConfirmOptions, DesktopEnvironment, DesktopNotification, DesktopPlatform, DesktopQuickAction, DesktopRuntimeConfig, DesktopThemeOptions, DesktopTitlebarMode, DesktopUpdateState, DesktopUpdateStatus, DesktopWindowState, DeviceInfo, HapticImpactStyle, HapticNotificationType, KeyboardEventDetail, NativePreviewMode, NetworkStatusEventDetail, PushTokenEventDetail, SafeAreaInsets, ShareOptions, StatusBarTheme, StatusBarThemeEventDetail, ToastDuration, } from './types';
2
2
  export { getNativeBridge } from './bridge';
3
3
  export { getPlatform, isAndroid, isIOS, isNative, isWeb, isElectron, isStandalonePWA, isInstalledApp, isWebBrowser, } from './platform';
4
4
  export { nativeConfirm, nativeCopyText, nativeImpact, nativeNotify, nativeOpenUrl, nativeShare, nativeToast, } from './consumers';
5
5
  export { SafeAreaView, type SafeAreaViewProps } from './SafeAreaView';
6
6
  export * from './hooks';
7
7
  export { isNativeIAPAvailable, getNativeProducts, purchaseNativeProduct, acknowledgeNativePurchase, restoreNativePurchases, getNativePurchases, installNativeIAP, type NativeProduct, type NativeTransaction, type NativePurchaseType, } from './purchases';
8
+ export { shouldShowNativeWelcome, getNativeEntryRoutes } from './entry';
9
+ export type { NativeEntryRoutes } from './entry';
10
+ export { nativeSelection, nativeActionSheet } from './consumers';
11
+ export { getDesktopBridge, getLegacyDesktopRuntime, isDesktop, getDesktopRuntimeConfig, getDesktopGatewayBases, getDesktopGatewayUrls, getDesktopAuthBridgeConfig, desktopOpenExternal, desktopNotify, desktopSetBadgeCount, desktopSetTheme, desktopSetTrayQuickActions, desktopSetLocale, desktopDeepLinkToPath, installDesktopDeepLinkHandler, installDesktopNavigateHandler, registerDesktopNavigator, bootDesktopShell, onDesktopUpdateState, onDesktopWindowState, getDesktopWindowState, desktopCheckForUpdates, desktopInstallUpdate, getDesktopUpdateState, DESKTOP_UPDATE_UNSUPPORTED, DESKTOP_WINDOW_STATE_DEFAULT, } from './desktop';
12
+ export type { BootDesktopShellOptions, DesktopShellHandle, LegacyDesktopRuntime } from './desktop';
8
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/native/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,QAAQ,EACR,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/native/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AACxE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,SAAS,EACT,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,0BAA0B,EAC1B,gBAAgB,EAChB,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../src/shared/native/platform.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,wBAAgB,WAAW,IAAI,uBAAuB,CAIrD;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED,gDAAgD;AAChD,wBAAgB,UAAU,IAAI,OAAO,CASpC;AAED,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,OAAO,CAMzC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,IAAI,OAAO,CAEtC"}
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../src/shared/native/platform.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,wBAAgB,WAAW,IAAI,uBAAuB,CAIrD;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED,wBAAgB,KAAK,IAAI,OAAO,CAE/B;AAED,gDAAgD;AAChD,wBAAgB,UAAU,IAAI,OAAO,CAapC;AAED,mFAAmF;AACnF,wBAAgB,eAAe,IAAI,OAAO,CAQzC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,IAAI,OAAO,CAEtC"}
@@ -17,10 +17,11 @@ function a() {
17
17
  return t() === "web";
18
18
  }
19
19
  function o() {
20
- return !!(typeof navigator < "u" && /electron/i.test(navigator.userAgent) || typeof window < "u" && window.process?.type === "renderer");
20
+ return typeof window > "u" ? !1 : !!(window.__burdenoffDesktop?.isElectron || typeof navigator < "u" && /electron/i.test(navigator.userAgent) || typeof window < "u" && window.process?.type === "renderer");
21
21
  }
22
22
  function s() {
23
23
  if (typeof window > "u") return !1;
24
+ if (document?.documentElement?.dataset?.nativePreview === "pwa") return !0;
24
25
  let e = window.matchMedia?.("(display-mode: standalone)")?.matches ?? !1, t = window.navigator.standalone === !0;
25
26
  return e || t;
26
27
  }
@@ -1,7 +1,13 @@
1
1
  import { PURCHASE_TYPE, Product, Transaction } from '@capgo/native-purchases';
2
2
  export type { Product as NativeProduct, Transaction as NativeTransaction, } from '@capgo/native-purchases';
3
3
  export type { PURCHASE_TYPE as NativePurchaseType } from '@capgo/native-purchases';
4
- /** True when running inside a Capacitor iOS or Android app. */
4
+ /**
5
+ * True when running inside a Capacitor iOS or Android app.
6
+ *
7
+ * Resolved through the shell-installed native bridge (`shared/native/platform`)
8
+ * instead of a static Capacitor import, so this module stays loadable in
9
+ * web-only bundles where Capacitor is never installed.
10
+ */
5
11
  export declare function isNativeIAPAvailable(): boolean;
6
12
  /**
7
13
  * Fetch product info from the App Store / Play Store for the given identifiers.
@@ -1 +1 @@
1
- {"version":3,"file":"purchases.d.ts","sourceRoot":"","sources":["../../../src/shared/native/purchases.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGnF,YAAY,EACV,OAAO,IAAI,aAAa,EACxB,WAAW,IAAI,iBAAiB,GACjC,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEnF,+DAA+D;AAC/D,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAmBD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,kBAAkB,EAAE,MAAM,EAAE,EAC5B,WAAW,CAAC,EAAE,aAAa,GAC1B,OAAO,CAAC,OAAO,EAAE,CAAC,CAKpB;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,iBAAiB,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE;IACR,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,GACA,OAAO,CAAC,WAAW,CAAC,CAItB;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpF;AAED,gGAAgG;AAChG,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAI5D;AAED,yEAAyE;AACzE,wBAAsB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IACjD,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAKzB;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,GACjD,OAAO,CAAC,IAAI,CAAC,CAUf"}
1
+ {"version":3,"file":"purchases.d.ts","sourceRoot":"","sources":["../../../src/shared/native/purchases.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAKnF,YAAY,EACV,OAAO,IAAI,aAAa,EACxB,WAAW,IAAI,iBAAiB,GACjC,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAEnF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAmBD;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,kBAAkB,EAAE,MAAM,EAAE,EAC5B,WAAW,CAAC,EAAE,aAAa,GAC1B,OAAO,CAAC,OAAO,EAAE,CAAC,CAKpB;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,iBAAiB,EAAE,MAAM,EACzB,OAAO,CAAC,EAAE;IACR,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,GACA,OAAO,CAAC,WAAW,CAAC,CAItB;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpF;AAED,gGAAgG;AAChG,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAI5D;AAED,yEAAyE;AACzE,wBAAsB,kBAAkB,CAAC,OAAO,CAAC,EAAE;IACjD,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAKzB;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,GACjD,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -1,10 +1,10 @@
1
- import { Capacitor as e } from "../../node_modules/@capacitor/core/dist/index.js";
1
+ import { isNative as e } from "./platform.js";
2
2
  //#region src/shared/native/purchases.ts
3
3
  function t() {
4
- return e.isNativePlatform();
4
+ return e();
5
5
  }
6
6
  async function n() {
7
- if (!e.isNativePlatform()) return null;
7
+ if (!t()) return null;
8
8
  try {
9
9
  return (await import(
10
10
  /* @vite-ignore */
@@ -1,3 +1,6 @@
1
+ import { GatewayBases } from '../utils/gatewayFetchRewrite';
2
+ import { RuntimeGatewayUrls } from '../config/gatewayUrls';
3
+ import { RuntimeAuthBridgeConfig } from '../config/authBridgeUrls';
1
4
  export type BurdenoffNativePlatform = 'ios' | 'android' | 'web';
2
5
  export type HapticImpactStyle = 'light' | 'medium' | 'heavy';
3
6
  export type HapticNotificationType = 'success' | 'warning' | 'error';
@@ -29,21 +32,154 @@ export interface DeviceInfo {
29
32
  manufacturer?: string;
30
33
  isVirtual?: boolean;
31
34
  }
35
+ export type ActionSheetButtonStyle = 'default' | 'destructive' | 'cancel';
36
+ export interface ActionSheetButton {
37
+ title: string;
38
+ style?: ActionSheetButtonStyle;
39
+ /** Optional icon name (lucide) — used by the web fallback sheet only. */
40
+ icon?: string;
41
+ }
42
+ export interface ActionSheetOptions {
43
+ title?: string;
44
+ message?: string;
45
+ options: ActionSheetButton[];
46
+ }
47
+ /**
48
+ * Presentation-only native preview, armed by `?__nativePreview=ios|android|pwa|desktop|off`
49
+ * (persisted in sessionStorage). Lets Playwright/humans see the installed-app UI in a
50
+ * plain browser. Plugin calls stay guarded by the REAL Capacitor availability, so this
51
+ * never triggers native side effects.
52
+ */
53
+ export type NativePreviewMode = 'ios' | 'android' | 'pwa' | 'desktop';
32
54
  export interface BurdenoffNativeBridge {
33
55
  getPlatform(): BurdenoffNativePlatform;
34
56
  isNativePlatform(): boolean;
35
57
  impact(style?: HapticImpactStyle): Promise<void>;
36
58
  notify(type: HapticNotificationType): Promise<void>;
59
+ /** Haptic selection tick (tab switch, picker change). Optional for older shells. */
60
+ selection?(): Promise<void>;
37
61
  toast(message: string, duration?: ToastDuration): Promise<boolean>;
38
62
  confirm(options: ConfirmOptions): Promise<boolean | null>;
63
+ /**
64
+ * Native action sheet. Resolves the chosen option index, or `null` when the
65
+ * native sheet is unavailable (caller must render its web fallback). Optional
66
+ * for older shells.
67
+ */
68
+ actionSheet?(options: ActionSheetOptions): Promise<number | null>;
39
69
  copyText(text: string): Promise<boolean>;
40
70
  share(options: ShareOptions): Promise<boolean>;
41
71
  openExternalUrl(url: string): Promise<void>;
72
+ /** True when the platform is a presentation-only preview (see NativePreviewMode). */
73
+ isPreview?(): boolean;
74
+ }
75
+ export type DesktopPlatform = 'darwin' | 'win32' | 'linux';
76
+ export type DesktopTitlebarMode = 'hidden-inset' | 'native';
77
+ export type DesktopEnvironment = 'local' | 'alpha' | 'prod';
78
+ /**
79
+ * Runtime config baked into the desktop build and exposed on the bridge.
80
+ *
81
+ * Byte-compatible with the legacy `window.<product>Electron.runtimeConfig`
82
+ * shape (see `@burdenoff/desktop-shell` `src/shared/types.ts` — the authoritative
83
+ * contract), so it reuses the existing fe-libs runtime types rather than
84
+ * redefining them.
85
+ */
86
+ export interface DesktopRuntimeConfig {
87
+ environment: DesktopEnvironment;
88
+ gatewayBases: GatewayBases;
89
+ gatewayUrls: RuntimeGatewayUrls;
90
+ authBridge?: RuntimeAuthBridgeConfig;
91
+ /** Origin the desktop window loads (custom scheme in packaged builds). */
92
+ appOrigin?: string;
93
+ /** electron-updater generic feed root for this channel. */
94
+ updateFeedUrl?: string;
95
+ }
96
+ export type DesktopUpdateStatus = 'unsupported' | 'idle' | 'checking' | 'available' | 'downloading' | 'downloaded' | 'up-to-date' | 'error';
97
+ export interface DesktopUpdateState {
98
+ status: DesktopUpdateStatus;
99
+ version?: string;
100
+ percent?: number;
101
+ error?: string;
102
+ checkedAt?: string;
103
+ }
104
+ export interface DesktopNotification {
105
+ id?: string;
106
+ title: string;
107
+ body?: string;
108
+ /** In-app route to navigate to when the notification is clicked. */
109
+ route?: string;
110
+ silent?: boolean;
111
+ }
112
+ export interface DesktopQuickAction {
113
+ id: string;
114
+ label: string;
115
+ route?: string;
116
+ accelerator?: string;
117
+ /** Also expose on the Windows jump list / macOS dock menu. */
118
+ jumpList?: boolean;
119
+ }
120
+ export interface DesktopWindowState {
121
+ focused: boolean;
122
+ fullScreen: boolean;
123
+ maximized: boolean;
124
+ }
125
+ export interface DesktopThemeOptions {
126
+ scheme: 'light' | 'dark' | 'system';
127
+ backgroundColor?: string;
128
+ }
129
+ export interface BurdenoffDesktopBridge {
130
+ readonly isElectron: true;
131
+ readonly platform: DesktopPlatform;
132
+ readonly arch: string;
133
+ readonly versions: {
134
+ app: string;
135
+ electron: string;
136
+ chrome: string;
137
+ };
138
+ readonly product: {
139
+ id: string;
140
+ name: string;
141
+ scheme: string;
142
+ appId: string;
143
+ };
144
+ readonly runtimeConfig: DesktopRuntimeConfig;
145
+ readonly titlebar: DesktopTitlebarMode;
146
+ onDeepLink(cb: (url: string) => void): () => void;
147
+ onNavigate(cb: (route: string) => void): () => void;
148
+ onUpdateState(cb: (state: DesktopUpdateState) => void): () => void;
149
+ onWindowState(cb: (state: DesktopWindowState) => void): () => void;
150
+ openExternal(url: string): Promise<boolean>;
151
+ notify(notification: DesktopNotification): Promise<boolean>;
152
+ setBadgeCount(count: number): Promise<void>;
153
+ setTheme(theme: DesktopThemeOptions): void;
154
+ setTrayQuickActions(actions: DesktopQuickAction[]): void;
155
+ setLocale(locale: string): void;
156
+ getUpdateState(): Promise<DesktopUpdateState>;
157
+ checkForUpdates(): Promise<DesktopUpdateState>;
158
+ installUpdate(): Promise<void>;
159
+ notifyAppReady(): Promise<void>;
160
+ window: {
161
+ minimize(): void;
162
+ toggleMaximize(): void;
163
+ close(): void;
164
+ hide(): void;
165
+ focus(): void;
166
+ setTitle(title: string): void;
167
+ };
168
+ }
169
+ export interface PushTokenEventDetail {
170
+ value: string;
171
+ platform: 'ios' | 'android';
42
172
  }
43
173
  declare global {
44
174
  interface Window {
45
175
  __burdenoffNativeBridge?: BurdenoffNativeBridge;
46
176
  __burdenoffDeviceInfo?: DeviceInfo;
177
+ __burdenoffDesktop?: BurdenoffDesktopBridge;
178
+ __burdenoffOpenExternal?: (url: string) => Promise<void> | void;
179
+ __burdenoffPushToken?: PushTokenEventDetail;
180
+ electronUpdater?: {
181
+ notifyAppReady(): Promise<unknown>;
182
+ };
47
183
  }
48
184
  }
49
185
  export interface KeyboardEventDetail {