@buoy-gg/shared-ui 2.1.4-beta.3 → 2.1.4

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.
@@ -28,12 +28,12 @@ exports.isClipboardAvailable = exports.clipboardType = exports.clipboardFunction
28
28
  let _expoClipboard = null;
29
29
  try {
30
30
  _expoClipboard = require("expo-clipboard");
31
- } catch {}
31
+ } catch {/* not installed */}
32
32
  let _rnClipboard = null;
33
33
  try {
34
34
  const mod = require("@react-native-clipboard/clipboard");
35
35
  _rnClipboard = mod.default || mod;
36
- } catch {}
36
+ } catch {/* not installed */}
37
37
 
38
38
  // Lazy detection: resolved on first clipboardFunction() call
39
39
  let _detectedType = null;
@@ -51,7 +51,7 @@ async function detect(text) {
51
51
  };
52
52
  _detected = true;
53
53
  return true;
54
- } catch {}
54
+ } catch {/* expo-clipboard not functional */}
55
55
  }
56
56
 
57
57
  // 2. Try @react-native-clipboard/clipboard
@@ -65,7 +65,7 @@ async function detect(text) {
65
65
  };
66
66
  _detected = true;
67
67
  return true;
68
- } catch {}
68
+ } catch {/* rn-clipboard not functional */}
69
69
  }
70
70
  _detected = true;
71
71
  return false;
@@ -7,7 +7,7 @@ exports.useNativeSafeAreaInsets = exports.safeAreaType = exports.hasSafeAreaPack
7
7
  /**
8
8
  * Auto-generated safe area implementation
9
9
  * Detected: none
10
- * Generated at: 2026-02-10T20:29:38.101Z
10
+ * Generated at: 2026-02-12T09:56:31.164Z
11
11
  *
12
12
  * DO NOT EDIT - This file is generated by scripts/detect-safe-area.js
13
13
  *
@@ -16,26 +16,55 @@ var _reactNative = require("react-native");
16
16
  * Provides optional imports for expo-router hooks and utilities.
17
17
  * Falls back to no-op implementations when expo-router is not installed.
18
18
  *
19
- * On RN CLI (without Expo native modules), expo-router's JS is bundled but
20
- * its hooks crash at runtime because the ExpoLinking native module is missing.
21
- * We check for the native module BEFORE attempting to use any expo-router hooks.
19
+ * On RN CLI (without Expo native modules), expo-router's JS may be bundled but
20
+ * its hooks crash at runtime because native Expo modules are missing.
21
+ * We detect the Expo native runtime before attempting to use expo-router hooks.
22
22
  */
23
23
 
24
24
  let expoRouter = null;
25
25
  let isAvailable = false;
26
26
  let checkedAvailability = false;
27
+
28
+ /**
29
+ * Check if the Expo native runtime is available.
30
+ * Handles both old SDKs (NativeModules.ExpoLinking) and new SDKs (54+)
31
+ * where native modules moved to the Expo Modules API.
32
+ */
33
+ function hasExpoNativeRuntime() {
34
+ // Check legacy NativeModules bridge (Expo SDK < 54)
35
+ if (_reactNative.NativeModules.ExpoLinking) {
36
+ return true;
37
+ }
38
+
39
+ // Check for Expo Modules Core native bridge (Expo SDK 51+)
40
+ // NativeUnimoduleProxy is registered by expo-modules-core on both old and new arch
41
+ if (_reactNative.NativeModules.NativeUnimoduleProxy) {
42
+ return true;
43
+ }
44
+
45
+ // Check for Expo Go app
46
+ if (_reactNative.NativeModules.ExpoGoModule || _reactNative.NativeModules.ExpoUpdates) {
47
+ return true;
48
+ }
49
+
50
+ // No Expo native runtime detected.
51
+ // NOTE: We intentionally do NOT try require("expo-modules-core") here because
52
+ // on RN CLI it may be bundled as a transitive dep but the native modules
53
+ // (requireOptionalNativeModule etc.) are undefined, causing crashes.
54
+ return false;
55
+ }
27
56
  function checkExpoRouterAvailability() {
28
57
  if (checkedAvailability) return isAvailable;
29
58
  try {
30
- // expo-router depends on ExpoLinking native module.
31
- // On RN CLI the JS is bundled but the native module isn't registered,
32
- // so require() succeeds but hooks crash at runtime. Check native side first.
33
- if (!_reactNative.NativeModules.ExpoLinking) {
59
+ // Verify the Expo native runtime is available.
60
+ // On RN CLI, expo-router JS may be bundled but native modules aren't registered,
61
+ // so require() succeeds but hooks crash at runtime.
62
+ if (!hasExpoNativeRuntime()) {
34
63
  checkedAvailability = true;
35
64
  return false;
36
65
  }
37
66
  expoRouter = require("expo-router");
38
- isAvailable = expoRouter != null;
67
+ isAvailable = expoRouter != null && typeof expoRouter.usePathname === "function" && typeof expoRouter.useSegments === "function";
39
68
  } catch (error) {
40
69
  isAvailable = false;
41
70
  expoRouter = null;
@@ -24,12 +24,12 @@
24
24
  let _expoClipboard = null;
25
25
  try {
26
26
  _expoClipboard = require("expo-clipboard");
27
- } catch {}
27
+ } catch {/* not installed */}
28
28
  let _rnClipboard = null;
29
29
  try {
30
30
  const mod = require("@react-native-clipboard/clipboard");
31
31
  _rnClipboard = mod.default || mod;
32
- } catch {}
32
+ } catch {/* not installed */}
33
33
 
34
34
  // Lazy detection: resolved on first clipboardFunction() call
35
35
  let _detectedType = null;
@@ -47,7 +47,7 @@ async function detect(text) {
47
47
  };
48
48
  _detected = true;
49
49
  return true;
50
- } catch {}
50
+ } catch {/* expo-clipboard not functional */}
51
51
  }
52
52
 
53
53
  // 2. Try @react-native-clipboard/clipboard
@@ -61,7 +61,7 @@ async function detect(text) {
61
61
  };
62
62
  _detected = true;
63
63
  return true;
64
- } catch {}
64
+ } catch {/* rn-clipboard not functional */}
65
65
  }
66
66
  _detected = true;
67
67
  return false;
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Auto-generated safe area implementation
5
5
  * Detected: none
6
- * Generated at: 2026-02-10T20:29:38.101Z
6
+ * Generated at: 2026-02-12T09:56:31.164Z
7
7
  *
8
8
  * DO NOT EDIT - This file is generated by scripts/detect-safe-area.js
9
9
  *
@@ -6,27 +6,56 @@
6
6
  * Provides optional imports for expo-router hooks and utilities.
7
7
  * Falls back to no-op implementations when expo-router is not installed.
8
8
  *
9
- * On RN CLI (without Expo native modules), expo-router's JS is bundled but
10
- * its hooks crash at runtime because the ExpoLinking native module is missing.
11
- * We check for the native module BEFORE attempting to use any expo-router hooks.
9
+ * On RN CLI (without Expo native modules), expo-router's JS may be bundled but
10
+ * its hooks crash at runtime because native Expo modules are missing.
11
+ * We detect the Expo native runtime before attempting to use expo-router hooks.
12
12
  */
13
13
 
14
14
  import { NativeModules } from "react-native";
15
15
  let expoRouter = null;
16
16
  let isAvailable = false;
17
17
  let checkedAvailability = false;
18
+
19
+ /**
20
+ * Check if the Expo native runtime is available.
21
+ * Handles both old SDKs (NativeModules.ExpoLinking) and new SDKs (54+)
22
+ * where native modules moved to the Expo Modules API.
23
+ */
24
+ function hasExpoNativeRuntime() {
25
+ // Check legacy NativeModules bridge (Expo SDK < 54)
26
+ if (NativeModules.ExpoLinking) {
27
+ return true;
28
+ }
29
+
30
+ // Check for Expo Modules Core native bridge (Expo SDK 51+)
31
+ // NativeUnimoduleProxy is registered by expo-modules-core on both old and new arch
32
+ if (NativeModules.NativeUnimoduleProxy) {
33
+ return true;
34
+ }
35
+
36
+ // Check for Expo Go app
37
+ if (NativeModules.ExpoGoModule || NativeModules.ExpoUpdates) {
38
+ return true;
39
+ }
40
+
41
+ // No Expo native runtime detected.
42
+ // NOTE: We intentionally do NOT try require("expo-modules-core") here because
43
+ // on RN CLI it may be bundled as a transitive dep but the native modules
44
+ // (requireOptionalNativeModule etc.) are undefined, causing crashes.
45
+ return false;
46
+ }
18
47
  function checkExpoRouterAvailability() {
19
48
  if (checkedAvailability) return isAvailable;
20
49
  try {
21
- // expo-router depends on ExpoLinking native module.
22
- // On RN CLI the JS is bundled but the native module isn't registered,
23
- // so require() succeeds but hooks crash at runtime. Check native side first.
24
- if (!NativeModules.ExpoLinking) {
50
+ // Verify the Expo native runtime is available.
51
+ // On RN CLI, expo-router JS may be bundled but native modules aren't registered,
52
+ // so require() succeeds but hooks crash at runtime.
53
+ if (!hasExpoNativeRuntime()) {
25
54
  checkedAvailability = true;
26
55
  return false;
27
56
  }
28
57
  expoRouter = require("expo-router");
29
- isAvailable = expoRouter != null;
58
+ isAvailable = expoRouter != null && typeof expoRouter.usePathname === "function" && typeof expoRouter.useSegments === "function";
30
59
  } catch (error) {
31
60
  isAvailable = false;
32
61
  expoRouter = null;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Auto-generated safe area implementation
3
3
  * Detected: none
4
- * Generated at: 2026-02-10T20:29:38.101Z
4
+ * Generated at: 2026-02-12T09:56:31.164Z
5
5
  *
6
6
  * DO NOT EDIT - This file is generated by scripts/detect-safe-area.js
7
7
  *
@@ -4,9 +4,9 @@
4
4
  * Provides optional imports for expo-router hooks and utilities.
5
5
  * Falls back to no-op implementations when expo-router is not installed.
6
6
  *
7
- * On RN CLI (without Expo native modules), expo-router's JS is bundled but
8
- * its hooks crash at runtime because the ExpoLinking native module is missing.
9
- * We check for the native module BEFORE attempting to use any expo-router hooks.
7
+ * On RN CLI (without Expo native modules), expo-router's JS may be bundled but
8
+ * its hooks crash at runtime because native Expo modules are missing.
9
+ * We detect the Expo native runtime before attempting to use expo-router hooks.
10
10
  */
11
11
  export declare function useSafeRouter(): any;
12
12
  export declare function useSafePathname(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"safeExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/utils/safeExpoRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA8DH,wBAAgB,aAAa,QAW5B;AAED,wBAAgB,eAAe,IAAI,MAAM,CAWxC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAW1C;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAW7E;AAMD,wBAAgB,aAAa,QAU5B;AAMD,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
1
+ {"version":3,"file":"safeExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/utils/safeExpoRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA8FH,wBAAgB,aAAa,QAW5B;AAED,wBAAgB,eAAe,IAAI,MAAM,CAWxC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAW1C;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAW7E;AAMD,wBAAgB,aAAa,QAU5B;AAMD,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Auto-generated safe area implementation
3
3
  * Detected: none
4
- * Generated at: 2026-02-10T20:29:38.101Z
4
+ * Generated at: 2026-02-12T09:56:31.164Z
5
5
  *
6
6
  * DO NOT EDIT - This file is generated by scripts/detect-safe-area.js
7
7
  *
@@ -4,9 +4,9 @@
4
4
  * Provides optional imports for expo-router hooks and utilities.
5
5
  * Falls back to no-op implementations when expo-router is not installed.
6
6
  *
7
- * On RN CLI (without Expo native modules), expo-router's JS is bundled but
8
- * its hooks crash at runtime because the ExpoLinking native module is missing.
9
- * We check for the native module BEFORE attempting to use any expo-router hooks.
7
+ * On RN CLI (without Expo native modules), expo-router's JS may be bundled but
8
+ * its hooks crash at runtime because native Expo modules are missing.
9
+ * We detect the Expo native runtime before attempting to use expo-router hooks.
10
10
  */
11
11
  export declare function useSafeRouter(): any;
12
12
  export declare function useSafePathname(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"safeExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/utils/safeExpoRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA8DH,wBAAgB,aAAa,QAW5B;AAED,wBAAgB,eAAe,IAAI,MAAM,CAWxC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAW1C;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAW7E;AAMD,wBAAgB,aAAa,QAU5B;AAMD,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
1
+ {"version":3,"file":"safeExpoRouter.d.ts","sourceRoot":"","sources":["../../../../src/utils/safeExpoRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA8FH,wBAAgB,aAAa,QAW5B;AAED,wBAAgB,eAAe,IAAI,MAAM,CAWxC;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAW1C;AAED,wBAAgB,yBAAyB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAW7E;AAMD,wBAAgB,aAAa,QAU5B;AAMD,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/shared-ui",
3
- "version": "2.1.4-beta.3",
3
+ "version": "2.1.4",
4
4
  "description": "Shared UI components, hooks, and utilities",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -115,10 +115,10 @@
115
115
  ],
116
116
  "sideEffects": false,
117
117
  "dependencies": {
118
- "@buoy-gg/floating-tools-core": "2.1.4-beta.3"
118
+ "@buoy-gg/floating-tools-core": "2.1.4"
119
119
  },
120
120
  "peerDependencies": {
121
- "@buoy-gg/license": "2.1.4-beta.3",
121
+ "@buoy-gg/license": "2.1.4",
122
122
  "@react-native-clipboard/clipboard": "*",
123
123
  "expo-clipboard": "*",
124
124
  "expo-file-system": "*",
@@ -146,7 +146,7 @@
146
146
  "expo-clipboard": "~7.1.5",
147
147
  "react-native-safe-area-context": "^5.6.2",
148
148
  "typescript": "~5.8.3",
149
- "@buoy-gg/license": "2.1.4-beta.3"
149
+ "@buoy-gg/license": "2.1.4"
150
150
  },
151
151
  "react-native-builder-bob": {
152
152
  "source": "src",
@@ -67,13 +67,13 @@ function moduleExists(name) {
67
67
  try {
68
68
  require.resolve(name);
69
69
  return true;
70
- } catch {}
70
+ } catch { /* not installed */ }
71
71
  const additionalPaths = getAdditionalSearchPaths();
72
72
  if (additionalPaths.length > 0) {
73
73
  try {
74
74
  require.resolve(name, { paths: additionalPaths });
75
75
  return true;
76
- } catch {}
76
+ } catch { /* not installed */ }
77
77
  }
78
78
  return false;
79
79
  }