@buoy-gg/core 1.7.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 (132) hide show
  1. package/README.md +43 -0
  2. package/lib/commonjs/floatingMenu/AppHost.js +410 -0
  3. package/lib/commonjs/floatingMenu/AppHostLogic.js +44 -0
  4. package/lib/commonjs/floatingMenu/DefaultConfigContext.js +45 -0
  5. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +2274 -0
  6. package/lib/commonjs/floatingMenu/DevToolsVisibilityContext.js +49 -0
  7. package/lib/commonjs/floatingMenu/DraggableHeader.js +114 -0
  8. package/lib/commonjs/floatingMenu/FloatingDevTools.js +254 -0
  9. package/lib/commonjs/floatingMenu/FloatingMenu.js +364 -0
  10. package/lib/commonjs/floatingMenu/MinimizedToolsContext.js +247 -0
  11. package/lib/commonjs/floatingMenu/MinimizedToolsStack.js +206 -0
  12. package/lib/commonjs/floatingMenu/ToggleStateManager.js +36 -0
  13. package/lib/commonjs/floatingMenu/autoDiscoverPresets.js +241 -0
  14. package/lib/commonjs/floatingMenu/defaultConfig.js +160 -0
  15. package/lib/commonjs/floatingMenu/dial/DialDevTools.js +835 -0
  16. package/lib/commonjs/floatingMenu/dial/DialIcon.js +246 -0
  17. package/lib/commonjs/floatingMenu/dial/OnboardingTooltip.js +249 -0
  18. package/lib/commonjs/floatingMenu/dial/onboardingConstants.js +70 -0
  19. package/lib/commonjs/floatingMenu/floatingTools.js +771 -0
  20. package/lib/commonjs/floatingMenu/settingsBus.js +23 -0
  21. package/lib/commonjs/floatingMenu/types.js +5 -0
  22. package/lib/commonjs/index.js +240 -0
  23. package/lib/commonjs/package.json +1 -0
  24. package/lib/module/floatingMenu/AppHost.js +402 -0
  25. package/lib/module/floatingMenu/AppHostLogic.js +39 -0
  26. package/lib/module/floatingMenu/DefaultConfigContext.js +39 -0
  27. package/lib/module/floatingMenu/DevToolsSettingsModal.js +2273 -0
  28. package/lib/module/floatingMenu/DevToolsVisibilityContext.js +44 -0
  29. package/lib/module/floatingMenu/DraggableHeader.js +110 -0
  30. package/lib/module/floatingMenu/FloatingDevTools.js +249 -0
  31. package/lib/module/floatingMenu/FloatingMenu.js +358 -0
  32. package/lib/module/floatingMenu/MinimizedToolsContext.js +239 -0
  33. package/lib/module/floatingMenu/MinimizedToolsStack.js +202 -0
  34. package/lib/module/floatingMenu/ToggleStateManager.js +32 -0
  35. package/lib/module/floatingMenu/autoDiscoverPresets.js +236 -0
  36. package/lib/module/floatingMenu/defaultConfig.js +151 -0
  37. package/lib/module/floatingMenu/dial/DialDevTools.js +829 -0
  38. package/lib/module/floatingMenu/dial/DialIcon.js +241 -0
  39. package/lib/module/floatingMenu/dial/OnboardingTooltip.js +244 -0
  40. package/lib/module/floatingMenu/dial/onboardingConstants.js +64 -0
  41. package/lib/module/floatingMenu/floatingTools.js +767 -0
  42. package/lib/module/floatingMenu/settingsBus.js +19 -0
  43. package/lib/module/floatingMenu/types.js +3 -0
  44. package/lib/module/index.js +29 -0
  45. package/lib/module/package.json +1 -0
  46. package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts +39 -0
  47. package/lib/typescript/commonjs/floatingMenu/AppHost.d.ts.map +1 -0
  48. package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts +37 -0
  49. package/lib/typescript/commonjs/floatingMenu/AppHostLogic.d.ts.map +1 -0
  50. package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts +27 -0
  51. package/lib/typescript/commonjs/floatingMenu/DefaultConfigContext.d.ts.map +1 -0
  52. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts +57 -0
  53. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts +25 -0
  55. package/lib/typescript/commonjs/floatingMenu/DevToolsVisibilityContext.d.ts.map +1 -0
  56. package/lib/typescript/commonjs/floatingMenu/DraggableHeader.d.ts +30 -0
  57. package/lib/typescript/commonjs/floatingMenu/DraggableHeader.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts +226 -0
  59. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +1 -0
  60. package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts +39 -0
  61. package/lib/typescript/commonjs/floatingMenu/FloatingMenu.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts +95 -0
  63. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsContext.d.ts.map +1 -0
  64. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts +10 -0
  65. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts.map +1 -0
  66. package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts +21 -0
  67. package/lib/typescript/commonjs/floatingMenu/ToggleStateManager.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts +75 -0
  69. package/lib/typescript/commonjs/floatingMenu/autoDiscoverPresets.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts +120 -0
  71. package/lib/typescript/commonjs/floatingMenu/defaultConfig.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts +35 -0
  73. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts +14 -0
  75. package/lib/typescript/commonjs/floatingMenu/dial/DialIcon.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts +12 -0
  77. package/lib/typescript/commonjs/floatingMenu/dial/OnboardingTooltip.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts +30 -0
  79. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts +56 -0
  81. package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts +10 -0
  83. package/lib/typescript/commonjs/floatingMenu/settingsBus.d.ts.map +1 -0
  84. package/lib/typescript/commonjs/floatingMenu/types.d.ts +56 -0
  85. package/lib/typescript/commonjs/floatingMenu/types.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/index.d.ts +18 -0
  87. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/package.json +1 -0
  89. package/lib/typescript/module/floatingMenu/AppHost.d.ts +39 -0
  90. package/lib/typescript/module/floatingMenu/AppHost.d.ts.map +1 -0
  91. package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts +37 -0
  92. package/lib/typescript/module/floatingMenu/AppHostLogic.d.ts.map +1 -0
  93. package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts +27 -0
  94. package/lib/typescript/module/floatingMenu/DefaultConfigContext.d.ts.map +1 -0
  95. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts +57 -0
  96. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -0
  97. package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts +25 -0
  98. package/lib/typescript/module/floatingMenu/DevToolsVisibilityContext.d.ts.map +1 -0
  99. package/lib/typescript/module/floatingMenu/DraggableHeader.d.ts +30 -0
  100. package/lib/typescript/module/floatingMenu/DraggableHeader.d.ts.map +1 -0
  101. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts +226 -0
  102. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +1 -0
  103. package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts +39 -0
  104. package/lib/typescript/module/floatingMenu/FloatingMenu.d.ts.map +1 -0
  105. package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts +95 -0
  106. package/lib/typescript/module/floatingMenu/MinimizedToolsContext.d.ts.map +1 -0
  107. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts +10 -0
  108. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts.map +1 -0
  109. package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts +21 -0
  110. package/lib/typescript/module/floatingMenu/ToggleStateManager.d.ts.map +1 -0
  111. package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts +75 -0
  112. package/lib/typescript/module/floatingMenu/autoDiscoverPresets.d.ts.map +1 -0
  113. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts +120 -0
  114. package/lib/typescript/module/floatingMenu/defaultConfig.d.ts.map +1 -0
  115. package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts +35 -0
  116. package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +1 -0
  117. package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts +14 -0
  118. package/lib/typescript/module/floatingMenu/dial/DialIcon.d.ts.map +1 -0
  119. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts +12 -0
  120. package/lib/typescript/module/floatingMenu/dial/OnboardingTooltip.d.ts.map +1 -0
  121. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts +30 -0
  122. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts.map +1 -0
  123. package/lib/typescript/module/floatingMenu/floatingTools.d.ts +56 -0
  124. package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +1 -0
  125. package/lib/typescript/module/floatingMenu/settingsBus.d.ts +10 -0
  126. package/lib/typescript/module/floatingMenu/settingsBus.d.ts.map +1 -0
  127. package/lib/typescript/module/floatingMenu/types.d.ts +56 -0
  128. package/lib/typescript/module/floatingMenu/types.d.ts.map +1 -0
  129. package/lib/typescript/module/index.d.ts +18 -0
  130. package/lib/typescript/module/index.d.ts.map +1 -0
  131. package/lib/typescript/module/package.json +1 -0
  132. package/package.json +79 -0
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DevToolsVisibilityProvider = DevToolsVisibilityProvider;
7
+ exports.useDevToolsVisibility = useDevToolsVisibility;
8
+ var _react = require("react");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /**
11
+ * DevToolsVisibilityContext
12
+ *
13
+ * Tracks when DevTools UI is visible (dial menu, modals, etc.)
14
+ * Used by other tools (like debug borders) to hide when DevTools are active
15
+ */
16
+
17
+ const DevToolsVisibilityContext = /*#__PURE__*/(0, _react.createContext)(null);
18
+ function DevToolsVisibilityProvider({
19
+ children
20
+ }) {
21
+ const [isDialOpen, setDialOpen] = (0, _react.useState)(false);
22
+ const [isToolOpen, setToolOpen] = (0, _react.useState)(false);
23
+ const isDevToolsActive = (0, _react.useMemo)(() => isDialOpen || isToolOpen, [isDialOpen, isToolOpen]);
24
+ const value = (0, _react.useMemo)(() => ({
25
+ isDialOpen,
26
+ isToolOpen,
27
+ isDevToolsActive,
28
+ setDialOpen,
29
+ setToolOpen
30
+ }), [isDialOpen, isToolOpen, isDevToolsActive]);
31
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(DevToolsVisibilityContext.Provider, {
32
+ value: value,
33
+ children: children
34
+ });
35
+ }
36
+ function useDevToolsVisibility() {
37
+ const context = (0, _react.useContext)(DevToolsVisibilityContext);
38
+ if (!context) {
39
+ // Return safe defaults if not within provider
40
+ return {
41
+ isDialOpen: false,
42
+ isToolOpen: false,
43
+ isDevToolsActive: false,
44
+ setDialOpen: () => {},
45
+ setToolOpen: () => {}
46
+ };
47
+ }
48
+ return context;
49
+ }
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DraggableHeader = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ const DraggableHeader = exports.DraggableHeader = /*#__PURE__*/(0, _react.memo)(function DraggableHeader({
11
+ children,
12
+ position,
13
+ onDragStart,
14
+ onDragEnd,
15
+ onTap,
16
+ containerBounds = _reactNative.Dimensions.get('window'),
17
+ elementSize = {
18
+ width: 100,
19
+ height: 50
20
+ },
21
+ minPosition = {
22
+ x: 0,
23
+ y: 0
24
+ },
25
+ style,
26
+ enabled = true,
27
+ maxOverflowX = 0
28
+ }) {
29
+ const isDraggingRef = (0, _react.useRef)(false);
30
+ const dragDistanceRef = (0, _react.useRef)(0);
31
+ const touchOffsetRef = (0, _react.useRef)({
32
+ x: 0,
33
+ y: 0
34
+ });
35
+ const startPositionRef = (0, _react.useRef)({
36
+ x: 0,
37
+ y: 0
38
+ });
39
+ const panResponder = (0, _react.useMemo)(() => _reactNative.PanResponder.create({
40
+ onStartShouldSetPanResponder: () => enabled,
41
+ onMoveShouldSetPanResponder: (_, g) => enabled && (Math.abs(g.dx) > 1 || Math.abs(g.dy) > 1),
42
+ onPanResponderTerminationRequest: () => false,
43
+ onPanResponderGrant: evt => {
44
+ isDraggingRef.current = false;
45
+ dragDistanceRef.current = 0;
46
+ touchOffsetRef.current = {
47
+ x: evt.nativeEvent.locationX,
48
+ y: evt.nativeEvent.locationY
49
+ };
50
+ // Capture starting position in parent coords; avoid relying on window pageX/pageY
51
+ position.stopAnimation(({
52
+ x,
53
+ y
54
+ }) => {
55
+ startPositionRef.current = {
56
+ x,
57
+ y
58
+ };
59
+ });
60
+ },
61
+ onPanResponderMove: (_evt, gestureState) => {
62
+ const totalDistance = Math.abs(gestureState.dx) + Math.abs(gestureState.dy);
63
+ dragDistanceRef.current = totalDistance;
64
+ if (totalDistance > 5 && !isDraggingRef.current) {
65
+ isDraggingRef.current = true;
66
+ onDragStart?.();
67
+ }
68
+ // Use dx/dy relative movement so parent padding/margins don't affect dragging
69
+ const x = startPositionRef.current.x + gestureState.dx;
70
+ const y = startPositionRef.current.y + gestureState.dy;
71
+ position.setValue({
72
+ x,
73
+ y
74
+ });
75
+ },
76
+ onPanResponderRelease: () => {
77
+ // Check if this was a tap (minimal movement) before doing anything else
78
+ const wasTap = dragDistanceRef.current <= 5 && !isDraggingRef.current;
79
+ if (wasTap) {
80
+ // For taps, just call the tap handler immediately - no position manipulation needed
81
+ onTap?.();
82
+ isDraggingRef.current = false;
83
+ return;
84
+ }
85
+
86
+ // For drags, get the final position and clamp it
87
+ position.stopAnimation(({
88
+ x: currentX,
89
+ y: currentY
90
+ }) => {
91
+ const maxX = containerBounds.width - elementSize.width + maxOverflowX;
92
+ const clampedX = Math.max(minPosition.x, Math.min(currentX, maxX));
93
+ const clampedY = Math.max(minPosition.y, Math.min(currentY, containerBounds.height - elementSize.height));
94
+ position.setValue({
95
+ x: clampedX,
96
+ y: clampedY
97
+ });
98
+ onDragEnd?.({
99
+ x: clampedX,
100
+ y: clampedY
101
+ });
102
+ isDraggingRef.current = false;
103
+ });
104
+ },
105
+ onPanResponderTerminate: () => {
106
+ isDraggingRef.current = false;
107
+ }
108
+ }), [enabled, position, onDragStart, onDragEnd, onTap, containerBounds, elementSize, minPosition, maxOverflowX]);
109
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
110
+ style: style,
111
+ ...panResponder.panHandlers,
112
+ children: children
113
+ });
114
+ });
@@ -0,0 +1,254 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FloatingDevTools = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _AppHost = require("./AppHost.js");
10
+ var _FloatingMenu = require("./FloatingMenu.js");
11
+ var _autoDiscoverPresets = require("./autoDiscoverPresets.js");
12
+ var _DevToolsVisibilityContext = require("./DevToolsVisibilityContext.js");
13
+ var _sharedUi = require("@buoy-gg/shared-ui");
14
+ var _MinimizedToolsContext = require("./MinimizedToolsContext.js");
15
+ var _defaultConfig = require("./defaultConfig.js");
16
+ var _DefaultConfigContext = require("./DefaultConfigContext.js");
17
+ var _license = require("@buoy-gg/license");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20
+ /**
21
+ * Environment variable configuration
22
+ *
23
+ * This type is compatible with RequiredEnvVar from @buoy-gg/env
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * // Simple string (just check existence)
28
+ * "API_URL"
29
+ *
30
+ * // Check for specific type
31
+ * { key: "DEBUG_MODE", expectedType: "boolean" }
32
+ *
33
+ * // Check for specific value
34
+ * { key: "ENVIRONMENT", expectedValue: "development" }
35
+ * ```
36
+ */
37
+
38
+ /**
39
+ * Storage key configuration for monitoring
40
+ */
41
+
42
+ /**
43
+ * Props for FloatingDevTools component.
44
+ * Apps prop is optional - if not provided, all installed dev tools are auto-discovered.
45
+ */
46
+
47
+ /**
48
+ * Unified floating development tools component with automatic preset discovery.
49
+ *
50
+ * This component combines AppHostProvider, FloatingMenu, and AppOverlay
51
+ * into a single component for simplified setup and better developer experience.
52
+ *
53
+ * **Zero-Config Usage:**
54
+ * ```tsx
55
+ * <FloatingDevTools environment="local" userRole="admin" />
56
+ * // All installed dev tools automatically appear!
57
+ * ```
58
+ *
59
+ * **With Team Default Configuration (Type-Safe!):**
60
+ * ```tsx
61
+ * // Set which tools are enabled by default for your team
62
+ * <FloatingDevTools
63
+ * // Floating bubble: ENV badge + WiFi toggle
64
+ * defaultFloatingTools={['env', 'environment', 'query-wifi-toggle']}
65
+ * // Dial menu: your team's 6 favorite tools (max 6!)
66
+ * defaultDialTools={['env', 'network', 'storage', 'query', 'route-events', 'debug-borders']}
67
+ * environment="local"
68
+ * userRole="admin"
69
+ * />
70
+ * ```
71
+ *
72
+ * **With Validation (Super Simple!):**
73
+ * ```tsx
74
+ * <FloatingDevTools
75
+ * requiredEnvVars={[
76
+ * "API_URL", // Just check existence
77
+ * { key: "DEBUG_MODE", expectedType: "boolean" },
78
+ * ]}
79
+ * requiredStorageKeys={[
80
+ * { key: "@app/session", storageType: "async" },
81
+ * ]}
82
+ * environment="local"
83
+ * userRole="admin"
84
+ * />
85
+ * ```
86
+ *
87
+ * **With Custom Tools:**
88
+ * ```tsx
89
+ * <FloatingDevTools
90
+ * apps={[myCustomTool]}
91
+ * environment="local"
92
+ * userRole="admin"
93
+ * />
94
+ * ```
95
+ *
96
+ * The component is absolutely positioned to float on top of your application
97
+ * regardless of where it's placed in the component tree.
98
+ *
99
+ * @param props - FloatingDevTools props
100
+ */
101
+ const FloatingDevTools = ({
102
+ apps,
103
+ requiredEnvVars,
104
+ requiredStorageKeys,
105
+ children,
106
+ disableHints = false,
107
+ defaultFloatingTools,
108
+ defaultDialTools,
109
+ ...props
110
+ }) => {
111
+ // Initialize license manager on mount
112
+ (0, _react.useEffect)(() => {
113
+ _license.LicenseManager.initialize();
114
+ }, []);
115
+
116
+ // Validate dial tools configuration on mount (development-time check)
117
+ (0, _react.useEffect)(() => {
118
+ if (defaultDialTools) {
119
+ (0, _defaultConfig.validateDialConfig)(defaultDialTools);
120
+ }
121
+ }, [defaultDialTools]);
122
+
123
+ // Build config overrides if requiredEnvVars or requiredStorageKeys are provided
124
+ const configOverrides = (0, _react.useMemo)(() => {
125
+ const overrides = [];
126
+
127
+ // If requiredEnvVars provided, create ENV tool config
128
+ if (requiredEnvVars && requiredEnvVars.length > 0) {
129
+ try {
130
+ const {
131
+ createEnvTool,
132
+ createEnvVarConfig
133
+ } = require("@buoy-gg/env");
134
+ // Convert simple format to the internal format
135
+ overrides.push(createEnvTool({
136
+ requiredEnvVars: createEnvVarConfig(requiredEnvVars)
137
+ }));
138
+ } catch (error) {
139
+ // Package not installed, skip
140
+ }
141
+ }
142
+
143
+ // If requiredStorageKeys provided, create Storage tool config
144
+ if (requiredStorageKeys && requiredStorageKeys.length > 0) {
145
+ try {
146
+ const {
147
+ createStorageTool
148
+ } = require("@buoy-gg/storage");
149
+ overrides.push(createStorageTool({
150
+ requiredStorageKeys
151
+ }));
152
+ } catch (error) {
153
+ // Package not installed, skip
154
+ }
155
+ }
156
+ return overrides;
157
+ }, [requiredEnvVars, requiredStorageKeys]);
158
+
159
+ // Combine user apps with config overrides
160
+ const userApps = (0, _react.useMemo)(() => {
161
+ if (!apps && configOverrides.length === 0) return undefined;
162
+ return [...(apps || []), ...configOverrides];
163
+ }, [apps, configOverrides]);
164
+
165
+ // Always auto-discover, then merge with any user-provided apps or config overrides
166
+ // User-provided apps and config overrides take precedence (by ID)
167
+ const finalApps = userApps ? (0, _autoDiscoverPresets.autoDiscoverPresetsWithCustom)(userApps) : (0, _autoDiscoverPresets.autoDiscoverPresets)();
168
+
169
+ // Check if debug-borders is installed and auto-render the overlay
170
+ const DebugBordersOverlay = (0, _react.useMemo)(() => {
171
+ try {
172
+ // @ts-ignore - Dynamic import that may not exist
173
+ const {
174
+ DebugBordersStandaloneOverlay
175
+ } = require("@buoy-gg/debug-borders");
176
+ return DebugBordersStandaloneOverlay;
177
+ } catch {
178
+ return null;
179
+ }
180
+ }, []);
181
+
182
+ // Check if highlight-updates is installed and auto-render the overlay
183
+ const HighlightUpdatesOverlay = (0, _react.useMemo)(() => {
184
+ try {
185
+ // @ts-ignore - Dynamic import that may not exist
186
+ const {
187
+ HighlightUpdatesOverlay: Overlay
188
+ } = require("@buoy-gg/highlight-updates");
189
+ return Overlay;
190
+ } catch {
191
+ return null;
192
+ }
193
+ }, []);
194
+
195
+ // Check if route-events is installed and auto-render the RouteTracker
196
+ // This enables automatic route tracking without requiring users to add <RouteTracker /> manually
197
+ const RouteTracker = (0, _react.useMemo)(() => {
198
+ try {
199
+ // @ts-ignore - Dynamic import that may not exist
200
+ const {
201
+ RouteTracker: Tracker
202
+ } = require("@buoy-gg/route-events");
203
+ return Tracker;
204
+ } catch {
205
+ return null;
206
+ }
207
+ }, []);
208
+
209
+ // Get tool icon helper for the MinimizedToolsProvider
210
+ const getToolIcon = (0, _react.useCallback)(id => {
211
+ const tool = finalApps.find(app => app.id === id);
212
+ if (!tool) return null;
213
+ if (typeof tool.icon === "function") {
214
+ return tool.icon({
215
+ slot: "dial",
216
+ size: 20
217
+ });
218
+ }
219
+ return tool.icon;
220
+ }, [finalApps]);
221
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DefaultConfigContext.DefaultConfigProvider, {
222
+ defaultFloatingTools: defaultFloatingTools,
223
+ defaultDialTools: defaultDialTools,
224
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.HintsProvider, {
225
+ disableHints: disableHints,
226
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
227
+ style: styles.container,
228
+ pointerEvents: "box-none",
229
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_DevToolsVisibilityContext.DevToolsVisibilityProvider, {
230
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AppHost.AppHostProvider, {
231
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_MinimizedToolsContext.MinimizedToolsProvider, {
232
+ getToolIcon: getToolIcon,
233
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingMenu.FloatingMenu, {
234
+ ...props,
235
+ apps: finalApps
236
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_AppHost.AppOverlay, {})]
237
+ })
238
+ }), children, DebugBordersOverlay && /*#__PURE__*/(0, _jsxRuntime.jsx)(DebugBordersOverlay, {}), HighlightUpdatesOverlay && /*#__PURE__*/(0, _jsxRuntime.jsx)(HighlightUpdatesOverlay, {}), RouteTracker && /*#__PURE__*/(0, _jsxRuntime.jsx)(RouteTracker, {})]
239
+ })
240
+ })
241
+ })
242
+ });
243
+ };
244
+ exports.FloatingDevTools = FloatingDevTools;
245
+ const styles = _reactNative.StyleSheet.create({
246
+ container: {
247
+ position: "absolute",
248
+ top: 0,
249
+ left: 0,
250
+ right: 0,
251
+ bottom: 0,
252
+ zIndex: 9999
253
+ }
254
+ });