@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
@@ -1,5 +1,19 @@
1
- import { ConfirmOptions, HapticImpactStyle, HapticNotificationType, ShareOptions, ToastDuration } from './types';
1
+ import { ActionSheetOptions, ConfirmOptions, HapticImpactStyle, HapticNotificationType, ShareOptions, ToastDuration } from './types';
2
2
  export declare function nativeImpact(style?: HapticImpactStyle): void;
3
+ /**
4
+ * Haptic selection tick (tab switch, picker/segment change). Uses the bridge's
5
+ * dedicated `selection()` when the shell provides it, degrading to a light
6
+ * impact on older shells. Web is a no-op.
7
+ */
8
+ export declare function nativeSelection(): void;
9
+ /**
10
+ * Present the OS-native action sheet. Resolves the chosen option index, or
11
+ * `null` when the native sheet is unavailable (no bridge, an older shell
12
+ * without `actionSheet`, or a native failure) — callers must then render the
13
+ * web fallback (`ActionSheet` from `@burdenoff/fe-libs/ui`, usually via
14
+ * `useActionSheet()` which handles the fallback automatically).
15
+ */
16
+ export declare function nativeActionSheet(options: ActionSheetOptions): Promise<number | null>;
3
17
  export declare function nativeNotify(type: HapticNotificationType): void;
4
18
  export declare function nativeToast(message: string, duration?: ToastDuration): Promise<boolean>;
5
19
  export declare function nativeConfirm(options: ConfirmOptions): Promise<boolean | null>;
@@ -1 +1 @@
1
- {"version":3,"file":"consumers.d.ts","sourceRoot":"","sources":["../../../src/shared/native/consumers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,wBAAgB,YAAY,CAAC,KAAK,GAAE,iBAA2B,GAAG,IAAI,CAErE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI,CAE/D;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,aAAuB,GAChC,OAAO,CAAC,OAAO,CAAC,CAIlB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAIpF;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0BnE;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAazE;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9D"}
1
+ {"version":3,"file":"consumers.d.ts","sourceRoot":"","sources":["../../../src/shared/native/consumers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACd,MAAM,SAAS,CAAC;AAEjB,wBAAgB,YAAY,CAAC,KAAK,GAAE,iBAA2B,GAAG,IAAI,CAErE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAQtC;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQ3F;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI,CAE/D;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,aAAuB,GAChC,OAAO,CAAC,OAAO,CAAC,CAIlB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAIpF;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA0BnE;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAazE;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ9D"}
@@ -3,18 +3,37 @@ import { getNativeBridge as e } from "./bridge.js";
3
3
  function t(t = "light") {
4
4
  e()?.impact(t);
5
5
  }
6
- function n(t) {
6
+ function n() {
7
+ let t = e();
8
+ if (t) {
9
+ if (typeof t.selection == "function") {
10
+ t.selection();
11
+ return;
12
+ }
13
+ t.impact("light");
14
+ }
15
+ }
16
+ async function r(t) {
17
+ let n = e();
18
+ if (!n || typeof n.actionSheet != "function") return null;
19
+ try {
20
+ return await n.actionSheet(t);
21
+ } catch {
22
+ return null;
23
+ }
24
+ }
25
+ function i(t) {
7
26
  e()?.notify(t);
8
27
  }
9
- async function r(t, n = "short") {
28
+ async function a(t, n = "short") {
10
29
  let r = e();
11
30
  return r ? r.toast(t, n) : !1;
12
31
  }
13
- async function i(t) {
32
+ async function o(t) {
14
33
  let n = e();
15
34
  return n ? n.confirm(t) : null;
16
35
  }
17
- async function a(t) {
36
+ async function s(t) {
18
37
  let n = e();
19
38
  if (n) return n.copyText(t);
20
39
  try {
@@ -29,7 +48,7 @@ async function a(t) {
29
48
  document.body.removeChild(r);
30
49
  }
31
50
  }
32
- async function o(t) {
51
+ async function c(t) {
33
52
  let n = e();
34
53
  if (n) return n.share(t);
35
54
  if (typeof navigator < "u" && typeof navigator.share == "function") try {
@@ -39,11 +58,11 @@ async function o(t) {
39
58
  }
40
59
  return !1;
41
60
  }
42
- async function s(t) {
61
+ async function l(t) {
43
62
  if (!t.startsWith("https:") && !t.startsWith("http:")) return;
44
63
  let n = e();
45
64
  if (n) return n.openExternalUrl(t);
46
65
  typeof window < "u" && window.open(t, "_blank", "noopener,noreferrer");
47
66
  }
48
67
  //#endregion
49
- export { i as nativeConfirm, a as nativeCopyText, t as nativeImpact, n as nativeNotify, s as nativeOpenUrl, o as nativeShare, r as nativeToast };
68
+ export { r as nativeActionSheet, o as nativeConfirm, s as nativeCopyText, t as nativeImpact, i as nativeNotify, l as nativeOpenUrl, n as nativeSelection, c as nativeShare, a as nativeToast };
@@ -0,0 +1,123 @@
1
+ import { BurdenoffDesktopBridge, DesktopNotification, DesktopPlatform, DesktopQuickAction, DesktopRuntimeConfig, DesktopThemeOptions, DesktopTitlebarMode, DesktopUpdateState, DesktopWindowState } from './types';
2
+ import { GatewayBases } from '../utils/gatewayFetchRewrite';
3
+ import { RuntimeGatewayUrls } from '../config/gatewayUrls';
4
+ import { RuntimeAuthBridgeConfig } from '../config/authBridgeUrls';
5
+ /** Legacy per-product preload global (`window.<product>Electron`). */
6
+ export interface LegacyDesktopRuntime {
7
+ isElectron?: boolean;
8
+ platform?: string;
9
+ versions?: {
10
+ electron?: string;
11
+ chrome?: string;
12
+ };
13
+ runtimeConfig?: DesktopRuntimeConfig;
14
+ onDeepLink?: (callback: (url: string) => void) => unknown;
15
+ openExternal?: (url: string) => Promise<boolean> | boolean;
16
+ }
17
+ export interface BootDesktopShellOptions {
18
+ /** Router navigate used for deep links + tray/menu navigation. */
19
+ navigate?: (path: string) => void;
20
+ /** Tray / dock quick actions to publish once the bridge is up. */
21
+ quickActions?: DesktopQuickAction[];
22
+ /** Explicit legacy preload key (defaults to auto-discovery). */
23
+ electronGlobalKey?: string;
24
+ }
25
+ export interface DesktopShellHandle {
26
+ isDesktop: boolean;
27
+ platform?: DesktopPlatform;
28
+ titlebar?: DesktopTitlebarMode;
29
+ }
30
+ /** The `@burdenoff/desktop-shell` preload bridge, or null on web. */
31
+ export declare function getDesktopBridge(): BurdenoffDesktopBridge | null;
32
+ /**
33
+ * Legacy `window.<product>Electron` runtime. The product key is unknown to
34
+ * fe-libs, so `window` is scanned ONCE for a `*Electron` global and the result
35
+ * cached (a full scan on every call would be wasteful in hot paths such as
36
+ * `resolveGatewayUrls()`).
37
+ */
38
+ export declare function getLegacyDesktopRuntime(globalKey?: string): LegacyDesktopRuntime | null;
39
+ /** Reset the cached legacy-global lookup (tests / late preload injection). */
40
+ export declare function resetDesktopBridgeCache(): void;
41
+ /** True when running inside a desktop shell (new bridge or legacy preload). */
42
+ export declare function isDesktop(): boolean;
43
+ /** Baked desktop runtime config (bridge first, then the legacy preload). */
44
+ export declare function getDesktopRuntimeConfig(): DesktopRuntimeConfig | null;
45
+ /** Gateway bases from the desktop runtime config, or null on web. */
46
+ export declare function getDesktopGatewayBases(): GatewayBases | null;
47
+ /** Gateway URLs from the desktop runtime config, or null on web. */
48
+ export declare function getDesktopGatewayUrls(): RuntimeGatewayUrls | null;
49
+ /**
50
+ * Auth bridge config baked into the desktop build, if any.
51
+ *
52
+ * NOTE: shells must NOT initialise the cross-TLD iframe bridge in Electron —
53
+ * see `resolveShellAuthBridgeConfig()` in `shared/config/authBridgeUrls.ts`,
54
+ * which returns `undefined` on desktop. This accessor exists for tooling and
55
+ * diagnostics that want to see the baked value.
56
+ */
57
+ export declare function getDesktopAuthBridgeConfig(): RuntimeAuthBridgeConfig | null;
58
+ /**
59
+ * Open an http/https/mailto URL in the user's default browser. Falls back to
60
+ * `window.open` on web so callers never need to branch.
61
+ */
62
+ export declare function desktopOpenExternal(url: string): Promise<boolean>;
63
+ /**
64
+ * Show an OS notification. On desktop this goes through the shell (so clicks
65
+ * can focus the window / route). On web it uses the browser Notification API
66
+ * ONLY when permission was already granted — it never prompts.
67
+ */
68
+ export declare function desktopNotify(notification: DesktopNotification): Promise<boolean>;
69
+ /** Dock / taskbar badge count. Uses the PWA badging API when not on desktop. */
70
+ export declare function desktopSetBadgeCount(count: number): Promise<void>;
71
+ /** Tell the desktop shell which color scheme + background the UI is using. */
72
+ export declare function desktopSetTheme(theme: DesktopThemeOptions): void;
73
+ /** Publish tray / dock quick actions. */
74
+ export declare function desktopSetTrayQuickActions(actions: DesktopQuickAction[]): void;
75
+ /** Tell the desktop shell which locale the UI switched to (menus, tray). */
76
+ export declare function desktopSetLocale(locale: string): void;
77
+ export declare const DESKTOP_UPDATE_UNSUPPORTED: DesktopUpdateState;
78
+ /** Subscribe to auto-update state changes. Returns an unsubscribe fn. */
79
+ export declare function onDesktopUpdateState(cb: (state: DesktopUpdateState) => void): () => void;
80
+ export declare function getDesktopUpdateState(): Promise<DesktopUpdateState>;
81
+ export declare function desktopCheckForUpdates(): Promise<DesktopUpdateState>;
82
+ /** Quit and install a downloaded update. No-op on web. */
83
+ export declare function desktopInstallUpdate(): Promise<void>;
84
+ type DesktopNavigator = (path: string) => void;
85
+ /**
86
+ * Register the router navigate fn. Routes that arrived before the router
87
+ * mounted (cold-start deep links) are flushed immediately.
88
+ */
89
+ export declare function registerDesktopNavigator(navigate: DesktopNavigator): () => void;
90
+ /**
91
+ * Convert a deep-link URL to an in-app path.
92
+ *
93
+ * `vibecontrols://app/agents?tab=logs` → `/agents?tab=logs`
94
+ * `https://app.vibecontrols.com/agents` → `/agents`
95
+ * Already-relative values pass through unchanged.
96
+ */
97
+ export declare function desktopDeepLinkToPath(rawUrl: string): string | null;
98
+ /**
99
+ * Subscribe to OS deep links (`<scheme>://app/...` and universal links).
100
+ * Returns an unsubscribe fn.
101
+ */
102
+ export declare function installDesktopDeepLinkHandler(onPath: (path: string) => void): () => void;
103
+ /** Subscribe to in-app routes pushed by the shell (tray, menu, jump list). */
104
+ export declare function installDesktopNavigateHandler(onRoute: (route: string) => void): () => void;
105
+ export declare const DESKTOP_WINDOW_STATE_DEFAULT: DesktopWindowState;
106
+ export declare function getDesktopWindowState(): DesktopWindowState;
107
+ /** Subscribe to window focus / fullscreen / maximize changes. */
108
+ export declare function onDesktopWindowState(cb: (state: DesktopWindowState) => void): () => void;
109
+ /**
110
+ * Boot the desktop renderer integration. Idempotent — repeat calls only merge
111
+ * newly supplied options (navigate / quick actions).
112
+ *
113
+ * DOM contract (see `shared/styles/native.css` section 6):
114
+ * `html[data-desktop-platform="darwin|win32|linux"]`
115
+ * `html[data-desktop-titlebar="hidden-inset|native"]`
116
+ * `html[data-desktop-fullscreen|data-desktop-focused|data-desktop-maximized]`
117
+ * `body.platform-desktop`
118
+ */
119
+ export declare function bootDesktopShell(opts?: BootDesktopShellOptions): DesktopShellHandle;
120
+ /** Reset boot state (tests only). */
121
+ export declare function resetDesktopShellBootState(): void;
122
+ export {};
123
+ //# sourceMappingURL=desktop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desktop.d.ts","sourceRoot":"","sources":["../../../src/shared/native/desktop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,mBAAmB,EACnB,eAAe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wBAAsB,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAQ1E;AAED,0DAA0D;AAC1D,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAQ1D;AAMD,KAAK,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;AAqB/C;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,IAAI,CAM/E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAanE;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAoCxF;AAED,8EAA8E;AAC9E,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAW1F;AAMD,eAAO,MAAM,4BAA4B,EAAE,kBAI1C,CAAC;AAKF,wBAAgB,qBAAqB,IAAI,kBAAkB,CAE1D;AAED,iEAAiE;AACjE,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAAG,MAAM,IAAI,CAKxF;AAyBD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,uBAA4B,GAAG,kBAAkB,CA6DvF;AAED,qCAAqC;AACrC,wBAAgB,0BAA0B,IAAI,IAAI,CAOjD"}
@@ -0,0 +1,280 @@
1
+ //#region src/shared/native/desktop.ts
2
+ function e() {
3
+ if (typeof window > "u") return null;
4
+ let e = window.__burdenoffDesktop;
5
+ return e?.isElectron ? e : null;
6
+ }
7
+ var t = !1, n = null;
8
+ function r(e) {
9
+ return typeof e == "object" && !!e && "isElectron" in e;
10
+ }
11
+ function i(e) {
12
+ if (typeof window > "u") return null;
13
+ let i = window;
14
+ if (e) {
15
+ let t = i[e];
16
+ return r(t) && t.isElectron === !0 ? t : null;
17
+ }
18
+ if (t || (t = !0, n = Object.keys(i).find((e) => {
19
+ if (!e.endsWith("Electron") || e === "Electron") return !1;
20
+ let t = i[e];
21
+ return r(t) && t.isElectron === !0;
22
+ }) ?? null), !n) return null;
23
+ let a = i[n];
24
+ return r(a) && a.isElectron === !0 ? a : null;
25
+ }
26
+ function a() {
27
+ return e() !== null || i() !== null;
28
+ }
29
+ function o() {
30
+ let t = e();
31
+ return t?.runtimeConfig ? t.runtimeConfig : i()?.runtimeConfig ?? null;
32
+ }
33
+ function s(e) {
34
+ return typeof e == "string" && e.trim().length > 0;
35
+ }
36
+ function c() {
37
+ let e = o()?.gatewayBases;
38
+ return !e || !s(e.globalBase) || !s(e.workspaceBase) ? null : e;
39
+ }
40
+ function l() {
41
+ let e = o()?.gatewayUrls;
42
+ return !e || !s(e.globalBaseUrl) || !s(e.workspaceBaseUrl) ? null : {
43
+ globalBaseUrl: e.globalBaseUrl,
44
+ workspaceBaseUrl: e.workspaceBaseUrl,
45
+ publicStoreBaseUrl: s(e.publicStoreBaseUrl) ? e.publicStoreBaseUrl : e.globalBaseUrl
46
+ };
47
+ }
48
+ function u() {
49
+ return o()?.authBridge ?? null;
50
+ }
51
+ var d = new Set([
52
+ "http:",
53
+ "https:",
54
+ "mailto:"
55
+ ]);
56
+ function f(e) {
57
+ try {
58
+ return d.has(new URL(e).protocol);
59
+ } catch {
60
+ return !1;
61
+ }
62
+ }
63
+ async function p(t) {
64
+ if (!f(t)) return !1;
65
+ let n = e();
66
+ if (n) try {
67
+ return await n.openExternal(t);
68
+ } catch {
69
+ return !1;
70
+ }
71
+ let r = i();
72
+ if (typeof r?.openExternal == "function") try {
73
+ return await r.openExternal(t);
74
+ } catch {
75
+ return !1;
76
+ }
77
+ return typeof window > "u" ? !1 : window.open(t, "_blank", "noopener,noreferrer") !== null;
78
+ }
79
+ async function m(t) {
80
+ let n = e();
81
+ if (n) try {
82
+ return await n.notify(t);
83
+ } catch {
84
+ return !1;
85
+ }
86
+ if (typeof window > "u") return !1;
87
+ let r = window.Notification;
88
+ if (typeof r != "function" || r.permission !== "granted") return !1;
89
+ try {
90
+ return new r(t.title, {
91
+ body: t.body,
92
+ silent: t.silent,
93
+ tag: t.id
94
+ }), !0;
95
+ } catch {
96
+ return !1;
97
+ }
98
+ }
99
+ async function h(t) {
100
+ let n = Number.isFinite(t) && t > 0 ? Math.floor(t) : 0, r = e();
101
+ if (r) {
102
+ try {
103
+ await r.setBadgeCount(n);
104
+ } catch {}
105
+ return;
106
+ }
107
+ if (typeof navigator > "u") return;
108
+ let i = navigator;
109
+ try {
110
+ n > 0 ? await i.setAppBadge?.(n) : await i.clearAppBadge?.();
111
+ } catch {}
112
+ }
113
+ function g(t) {
114
+ let n = e();
115
+ if (n) try {
116
+ n.setTheme(t);
117
+ } catch {}
118
+ }
119
+ function _(t) {
120
+ let n = e();
121
+ if (n) try {
122
+ n.setTrayQuickActions(t);
123
+ } catch {}
124
+ }
125
+ function v(t) {
126
+ let n = e();
127
+ if (!(!n || !s(t))) try {
128
+ n.setLocale(t);
129
+ } catch {}
130
+ }
131
+ var y = { status: "unsupported" };
132
+ function b(t) {
133
+ let n = e();
134
+ if (!n) return () => {};
135
+ try {
136
+ return n.onUpdateState(t);
137
+ } catch {
138
+ return () => {};
139
+ }
140
+ }
141
+ async function x() {
142
+ let t = e();
143
+ if (!t) return y;
144
+ try {
145
+ return await t.getUpdateState();
146
+ } catch {
147
+ return y;
148
+ }
149
+ }
150
+ async function S() {
151
+ let t = e();
152
+ if (!t) return y;
153
+ try {
154
+ return await t.checkForUpdates();
155
+ } catch (e) {
156
+ return {
157
+ status: "error",
158
+ error: e instanceof Error ? e.message : String(e)
159
+ };
160
+ }
161
+ }
162
+ async function C() {
163
+ let t = e();
164
+ if (t) try {
165
+ await t.installUpdate();
166
+ } catch {}
167
+ }
168
+ var w = null, T = [];
169
+ function E() {
170
+ if (!w || T.length === 0) return;
171
+ let e = T;
172
+ T = [];
173
+ for (let t of e) w(t);
174
+ }
175
+ function D(e) {
176
+ if (e) {
177
+ if (w) {
178
+ w(e);
179
+ return;
180
+ }
181
+ T.push(e);
182
+ }
183
+ }
184
+ function O(e) {
185
+ return w = e, E(), () => {
186
+ w === e && (w = null);
187
+ };
188
+ }
189
+ function k(e) {
190
+ if (!s(e)) return null;
191
+ let t = e.trim();
192
+ if (t.startsWith("/")) return t;
193
+ try {
194
+ let e = new URL(t), n = e.pathname && e.pathname !== "" ? e.pathname : "/";
195
+ return `${n.startsWith("/") ? n : `/${n}`}${e.search}${e.hash}`;
196
+ } catch {
197
+ return null;
198
+ }
199
+ }
200
+ function A(t) {
201
+ let n = (e) => {
202
+ let n = k(e);
203
+ n && t(n);
204
+ }, r = [], a = e();
205
+ if (a) try {
206
+ r.push(a.onDeepLink(n));
207
+ } catch {}
208
+ let o = i();
209
+ if (o && typeof o.onDeepLink == "function") try {
210
+ let e = o.onDeepLink(n);
211
+ typeof e == "function" && r.push(e);
212
+ } catch {}
213
+ return () => {
214
+ for (let e of r) try {
215
+ e();
216
+ } catch {}
217
+ };
218
+ }
219
+ function j(t) {
220
+ let n = e();
221
+ if (!n) return () => {};
222
+ try {
223
+ return n.onNavigate((e) => {
224
+ let n = k(e) ?? (e.startsWith("/") ? e : null);
225
+ n && t(n);
226
+ });
227
+ } catch {
228
+ return () => {};
229
+ }
230
+ }
231
+ var M = {
232
+ focused: !0,
233
+ fullScreen: !1,
234
+ maximized: !1
235
+ }, N = M, P = /* @__PURE__ */ new Set();
236
+ function F() {
237
+ return N;
238
+ }
239
+ function I(e) {
240
+ return P.add(e), () => {
241
+ P.delete(e);
242
+ };
243
+ }
244
+ function L(e) {
245
+ N = e;
246
+ let t = typeof document > "u" ? null : document.documentElement;
247
+ t && (t.dataset.desktopFullscreen = e.fullScreen ? "true" : "false", t.dataset.desktopFocused = e.focused ? "true" : "false", t.dataset.desktopMaximized = e.maximized ? "true" : "false");
248
+ for (let t of P) try {
249
+ t(e);
250
+ } catch {}
251
+ }
252
+ var R = null;
253
+ function z(t = {}) {
254
+ if (t.navigate && O(t.navigate), R) return t.quickActions?.length && _(t.quickActions), R;
255
+ let n = e(), r = n ? null : i(t.electronGlobalKey);
256
+ if (!n && !r) return { isDesktop: !1 };
257
+ let a = n?.platform, o = n?.titlebar;
258
+ if (R = {
259
+ isDesktop: !0,
260
+ platform: a,
261
+ titlebar: o
262
+ }, typeof document < "u") {
263
+ let e = document.documentElement;
264
+ e.dataset.desktopPlatform = a ?? (r?.platform || "linux"), e.dataset.desktopTitlebar = o ?? "native", document.body?.classList.add("platform-desktop");
265
+ }
266
+ if (n) try {
267
+ n.onWindowState(L);
268
+ } catch {}
269
+ if (L(N), A(D), j(D), t.quickActions?.length && _(t.quickActions), typeof window < "u" && !window.__burdenoffOpenExternal && (window.__burdenoffOpenExternal = (e) => {
270
+ p(e);
271
+ }), n) {
272
+ let e = () => {
273
+ n.notifyAppReady().catch(() => void 0);
274
+ };
275
+ typeof requestAnimationFrame == "function" ? requestAnimationFrame(e) : e();
276
+ }
277
+ return R;
278
+ }
279
+ //#endregion
280
+ export { y as DESKTOP_UPDATE_UNSUPPORTED, M as DESKTOP_WINDOW_STATE_DEFAULT, z as bootDesktopShell, S as desktopCheckForUpdates, k as desktopDeepLinkToPath, C as desktopInstallUpdate, m as desktopNotify, p as desktopOpenExternal, h as desktopSetBadgeCount, v as desktopSetLocale, g as desktopSetTheme, _ as desktopSetTrayQuickActions, u as getDesktopAuthBridgeConfig, e as getDesktopBridge, c as getDesktopGatewayBases, l as getDesktopGatewayUrls, o as getDesktopRuntimeConfig, x as getDesktopUpdateState, F as getDesktopWindowState, i as getLegacyDesktopRuntime, A as installDesktopDeepLinkHandler, j as installDesktopNavigateHandler, a as isDesktop, b as onDesktopUpdateState, I as onDesktopWindowState, O as registerDesktopNavigator };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Native entry — the installed-app equivalent of the web marketing landing.
3
+ *
4
+ * Installed apps (Capacitor native, installed/standalone PWA, Electron
5
+ * desktop) must never show the logged-out web marketing landing: app stores
6
+ * reject marketing walls, and an installed app should open straight into a
7
+ * focused sign-in surface. Shells branch their logged-out route on
8
+ * `shouldShowNativeWelcome()` and render `<NativeWelcome/>`
9
+ * (`@burdenoff/fe-libs/ui`) instead of `ModernLanding`.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * // AppRoutes.tsx (logged-out landing route)
14
+ * if (shouldShowNativeWelcome()) {
15
+ * const routes = getNativeEntryRoutes();
16
+ * return (
17
+ * <NativeWelcome
18
+ * onSignIn={() => navigate(routes.signIn)}
19
+ * onCreateAccount={() => navigate(routes.createAccount)}
20
+ * />
21
+ * );
22
+ * }
23
+ * return <ModernLanding ... />;
24
+ * ```
25
+ */
26
+ export declare function shouldShowNativeWelcome(): boolean;
27
+ export interface NativeEntryRoutes {
28
+ /** In-app route for the primary "Sign in" CTA. */
29
+ signIn: string;
30
+ /** In-app route for the secondary "Create account" CTA. */
31
+ createAccount: string;
32
+ }
33
+ /**
34
+ * Canonical in-app auth routes for the native welcome CTAs. Every product
35
+ * shell hosts microfe-auth on these paths, so the welcome screen can navigate
36
+ * without per-shell wiring.
37
+ */
38
+ export declare function getNativeEntryRoutes(): NativeEntryRoutes;
39
+ //# sourceMappingURL=entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry.d.ts","sourceRoot":"","sources":["../../../src/shared/native/entry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAED,MAAM,WAAW,iBAAiB;IAChC,kDAAkD;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,iBAAiB,CAExD"}
@@ -0,0 +1,13 @@
1
+ import { isInstalledApp as e } from "./platform.js";
2
+ //#region src/shared/native/entry.ts
3
+ function t() {
4
+ return e();
5
+ }
6
+ function n() {
7
+ return {
8
+ signIn: "/auth/login",
9
+ createAccount: "/auth/register"
10
+ };
11
+ }
12
+ //#endregion
13
+ export { n as getNativeEntryRoutes, t as shouldShowNativeWelcome };
@@ -9,4 +9,14 @@ export { useHaptics } from './useHaptics';
9
9
  export type { UseHapticsResult } from './useHaptics';
10
10
  export { useStatusBar } from './useStatusBar';
11
11
  export type { UseStatusBarResult } from './useStatusBar';
12
+ export { useNetworkStatus, reduceNetworkStatus, readInitialNetworkStatus, } from './useNetworkStatus';
13
+ export type { NetworkStatus } from './useNetworkStatus';
14
+ export { usePullToRefresh, computePullProgress, computePullOffset, PULL_TO_REFRESH_THRESHOLD, } from './usePullToRefresh';
15
+ export type { UsePullToRefreshOptions, UsePullToRefreshResult, PullToRefreshBind, } from './usePullToRefresh';
16
+ export { useActionSheet, resolveActionSheetOutcome } from './useActionSheet';
17
+ export type { UseActionSheetResult, ShowActionSheetOptions, ActionSheetHostProps, ActionSheetOutcome, } from './useActionSheet';
18
+ export { useDesktop } from './useDesktop';
19
+ export type { UseDesktopResult } from './useDesktop';
20
+ export { useDesktopUpdateState } from './useDesktopUpdateState';
21
+ export { useDesktopWindowState } from './useDesktopWindowState';
12
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5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E,cAAc,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,3 +1,5 @@
1
+ import "./useNetworkStatus.js";
2
+ import "./usePullToRefresh.js";
1
3
  import "./useNativePlatform.js";
2
4
  import "./useSafeArea.js";
3
5
  import "./useNativeKeyboard.js";
@@ -5,3 +7,7 @@ import "./useAppState.js";
5
7
  import "./useDeviceInfo.js";
6
8
  import "./useHaptics.js";
7
9
  import "./useStatusBar.js";
10
+ import "./useActionSheet.js";
11
+ import "./useDesktop.js";
12
+ import "./useDesktopUpdateState.js";
13
+ import "./useDesktopWindowState.js";
@@ -0,0 +1,63 @@
1
+ import { ActionSheetButton, ActionSheetOptions } from '../types';
2
+ /**
3
+ * Where a `useActionSheet().show()` call must be answered from.
4
+ *
5
+ * `native` — the OS sheet handled it; `index` is the (validated) chosen option
6
+ * or `null` when the native layer returned something unusable.
7
+ * `fallback` — no native sheet is available; render the web `ActionSheet`.
8
+ */
9
+ export type ActionSheetOutcome = {
10
+ source: 'native';
11
+ index: number | null;
12
+ } | {
13
+ source: 'fallback';
14
+ };
15
+ /**
16
+ * Pure resolution of a bridge `actionSheet()` result. Kept separate from the
17
+ * hook so the native/web decision is unit-testable without a DOM.
18
+ */
19
+ export declare function resolveActionSheetOutcome(nativeIndex: number | null, optionCount: number): ActionSheetOutcome;
20
+ export interface ShowActionSheetOptions extends ActionSheetOptions {
21
+ /** Cancel row label for the web fallback sheet. Default "Cancel". */
22
+ cancelLabel?: string;
23
+ }
24
+ /** Props to spread onto the web `<ActionSheet />` fallback. */
25
+ export interface ActionSheetHostProps {
26
+ open: boolean;
27
+ onOpenChange: (open: boolean) => void;
28
+ title?: string;
29
+ message?: string;
30
+ options: ActionSheetButton[];
31
+ cancelLabel?: string;
32
+ onSelect: (index: number) => void;
33
+ }
34
+ export interface UseActionSheetResult {
35
+ /**
36
+ * Present the sheet. Resolves the chosen option index, or `null` when the
37
+ * user dismissed/cancelled it.
38
+ */
39
+ show: (options: ShowActionSheetOptions) => Promise<number | null>;
40
+ /** Spread onto `<ActionSheet {...sheetProps} />` inside the calling component. */
41
+ sheetProps: ActionSheetHostProps;
42
+ }
43
+ /**
44
+ * Native-first action sheet. On Capacitor shells the OS sheet is used; on web
45
+ * (and on older shells without `bridge.actionSheet`) it falls back to the
46
+ * token-styled `ActionSheet` bottom sheet, which the caller renders:
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * const { show, sheetProps } = useActionSheet();
51
+ * const onMore = async () => {
52
+ * const index = await show({
53
+ * title: 'Agent',
54
+ * options: [{ title: 'Rename' }, { title: 'Delete', style: 'destructive' }],
55
+ * });
56
+ * if (index === 0) rename();
57
+ * if (index === 1) remove();
58
+ * };
59
+ * return <><Button onClick={onMore}>More</Button><ActionSheet {...sheetProps} /></>;
60
+ * ```
61
+ */
62
+ export declare function useActionSheet(): UseActionSheetResult;
63
+ //# sourceMappingURL=useActionSheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActionSheet.d.ts","sourceRoot":"","sources":["../../../../src/shared/native/hooks/useActionSheet.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEtE;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAC1B;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC1C;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3B;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,WAAW,EAAE,MAAM,GAClB,kBAAkB,CAMpB;AAED,MAAM,WAAW,sBAAuB,SAAQ,kBAAkB;IAChE,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAClE,kFAAkF;IAClF,UAAU,EAAE,oBAAoB,CAAC;CAClC;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CA8CrD"}