@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,246 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DialIcon = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ const {
12
+ width: SCREEN_WIDTH
13
+ } = _reactNative.Dimensions.get("window");
14
+
15
+ // Use shared layout calculation
16
+ const layout = (0, _floatingToolsCore.getDialLayout)({
17
+ screenWidth: SCREEN_WIDTH
18
+ });
19
+ const VIEW_SIZE = layout.iconSize;
20
+ const CIRCLE_SIZE = layout.circleSize;
21
+ const CIRCLE_RADIUS = layout.circleRadius;
22
+ const DialIcon = ({
23
+ index,
24
+ icon,
25
+ iconsProgress,
26
+ onPress,
27
+ selectedIcon,
28
+ totalIcons
29
+ }) => {
30
+ // Use shared position calculation from core
31
+ const iconPosition = (0, _floatingToolsCore.getIconPosition)(index, totalIcons, layout.iconRadius, _floatingToolsCore.DIAL_START_ANGLE);
32
+ const {
33
+ x: finalX,
34
+ y: finalY,
35
+ angle
36
+ } = iconPosition;
37
+ const radius = layout.iconRadius;
38
+
39
+ // Animation values - using interpolation for better performance
40
+ const scale = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
41
+
42
+ // Hover animation on press in/out - using shared config
43
+ // Fallback values in case dialAnimationConfig hasn't loaded yet
44
+ const iconAnimConfig = _floatingToolsCore.dialAnimationConfig?.icons ?? {
45
+ pressIn: {
46
+ scale: 0.95,
47
+ damping: 15,
48
+ stiffness: 400
49
+ },
50
+ pressOut: {
51
+ scale: 1,
52
+ damping: 15,
53
+ stiffness: 400
54
+ }
55
+ };
56
+ const {
57
+ pressIn,
58
+ pressOut
59
+ } = iconAnimConfig;
60
+ const handlePressIn = () => {
61
+ _reactNative.Animated.spring(scale, {
62
+ toValue: pressIn.scale,
63
+ damping: pressIn.damping,
64
+ stiffness: pressIn.stiffness,
65
+ useNativeDriver: true
66
+ }).start();
67
+ };
68
+ const handlePressOut = () => {
69
+ _reactNative.Animated.spring(scale, {
70
+ toValue: pressOut.scale,
71
+ damping: pressOut.damping,
72
+ stiffness: pressOut.stiffness,
73
+ useNativeDriver: true
74
+ }).start();
75
+ };
76
+
77
+ // Use shared stagger calculation from core
78
+ const staggerInputRange = (0, _floatingToolsCore.getIconStaggerInputRange)(index, totalIcons);
79
+
80
+ // Use interpolation for smooth animation that works both directions
81
+ const staggeredProgress = iconsProgress.interpolate({
82
+ inputRange: staggerInputRange,
83
+ outputRange: [0, 0, 1, 1],
84
+ extrapolate: "clamp"
85
+ });
86
+
87
+ // Spiral animation with interpolation
88
+ const spiralRotation = staggeredProgress.interpolate({
89
+ inputRange: [0, 1],
90
+ outputRange: [Math.PI * 2, 0] // Spiral from 2π to 0
91
+ });
92
+
93
+ // Distance from center
94
+ const distance = staggeredProgress.interpolate({
95
+ inputRange: [0, 1],
96
+ outputRange: [0, radius]
97
+ });
98
+
99
+ // Calculate X and Y positions using Animated operations
100
+ const translateX = _reactNative.Animated.add(_reactNative.Animated.multiply(distance, spiralRotation.interpolate({
101
+ inputRange: [0, Math.PI * 2],
102
+ outputRange: [Math.cos(angle), Math.cos(angle + Math.PI * 2)]
103
+ })), staggeredProgress.interpolate({
104
+ inputRange: [0, 1],
105
+ outputRange: [0, finalX - radius * Math.cos(angle + Math.PI * 2)]
106
+ }));
107
+ const translateY = _reactNative.Animated.add(_reactNative.Animated.multiply(distance, spiralRotation.interpolate({
108
+ inputRange: [0, Math.PI * 2],
109
+ outputRange: [Math.sin(angle), Math.sin(angle + Math.PI * 2)]
110
+ })), staggeredProgress.interpolate({
111
+ inputRange: [0, 1],
112
+ outputRange: [0, finalY - radius * Math.sin(angle + Math.PI * 2)]
113
+ }));
114
+
115
+ // Opacity animation
116
+ const itemOpacity = staggeredProgress.interpolate({
117
+ inputRange: [0, 0.3, 1],
118
+ outputRange: [0, 0.3, 1]
119
+ });
120
+
121
+ // Scale based on progress
122
+ const progressScale = staggeredProgress;
123
+
124
+ // Main animated style for position and appearance
125
+ const animatedStyle = {
126
+ position: "absolute",
127
+ left: CIRCLE_RADIUS - VIEW_SIZE / 2,
128
+ // Center position
129
+ top: CIRCLE_RADIUS - VIEW_SIZE / 2,
130
+ // Center position
131
+ opacity: itemOpacity,
132
+ transform: [{
133
+ translateX
134
+ },
135
+ // Apply translation from center
136
+ {
137
+ translateY
138
+ },
139
+ // Apply translation from center
140
+ {
141
+ scale: _reactNative.Animated.multiply(scale, progressScale)
142
+ }]
143
+ };
144
+
145
+ // Check if this is an empty spot (no icon and no iconComponent)
146
+ const isEmpty = icon.icon === null && !icon.iconComponent;
147
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
148
+ style: [styles.view, animatedStyle],
149
+ children: isEmpty ?
150
+ /*#__PURE__*/
151
+ // Empty spot - just show a subtle circle
152
+ (0, _jsxRuntime.jsx)(_reactNative.View, {
153
+ style: styles.emptySpot,
154
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
155
+ style: styles.emptyDot
156
+ })
157
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
158
+ onPress: () => onPress(index),
159
+ onPressIn: handlePressIn,
160
+ onPressOut: handlePressOut,
161
+ style: styles.pressable,
162
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
163
+ style: [styles.iconGradientBg, {
164
+ backgroundColor: "rgba(0, 0, 0, 0.2)"
165
+ }]
166
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
167
+ style: [styles.iconInnerGlow, {
168
+ backgroundColor: "rgba(255, 255, 255, 0.02)"
169
+ }]
170
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
171
+ style: styles.iconWrapper,
172
+ children: icon.iconComponent ? (() => {
173
+ const IconComp = icon.iconComponent;
174
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComp, {
175
+ slot: "dial",
176
+ size: 32
177
+ });
178
+ })() : icon.icon
179
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
180
+ style: styles.label,
181
+ numberOfLines: 1,
182
+ adjustsFontSizeToFit: true,
183
+ minimumFontScale: 0.7,
184
+ children: icon.name.toUpperCase()
185
+ })]
186
+ })
187
+ });
188
+ };
189
+ exports.DialIcon = DialIcon;
190
+ const styles = _reactNative.StyleSheet.create({
191
+ view: {
192
+ width: VIEW_SIZE,
193
+ height: VIEW_SIZE,
194
+ justifyContent: "center",
195
+ alignItems: "center"
196
+ },
197
+ pressable: {
198
+ width: "100%",
199
+ height: "100%",
200
+ justifyContent: "center",
201
+ alignItems: "center",
202
+ padding: 4,
203
+ backgroundColor: "transparent"
204
+ },
205
+ iconGradientBg: {
206
+ position: "absolute",
207
+ width: "85%",
208
+ height: "85%",
209
+ borderRadius: 12,
210
+ opacity: 0.3
211
+ },
212
+ iconInnerGlow: {
213
+ position: "absolute",
214
+ width: "70%",
215
+ height: "70%",
216
+ borderRadius: 10,
217
+ opacity: 0.5
218
+ },
219
+ iconWrapper: {
220
+ marginBottom: 4,
221
+ alignItems: "center",
222
+ justifyContent: "center"
223
+ },
224
+ label: {
225
+ fontSize: _floatingToolsCore.dialStyles.icon.label.fontSize,
226
+ fontWeight: _floatingToolsCore.dialStyles.icon.label.fontWeight,
227
+ letterSpacing: _floatingToolsCore.dialStyles.icon.label.letterSpacing,
228
+ fontFamily: _floatingToolsCore.dialStyles.icon.label.fontFamily,
229
+ marginTop: _floatingToolsCore.dialStyles.icon.label.marginTop,
230
+ color: _floatingToolsCore.dialColors.iconLabel
231
+ },
232
+ emptySpot: {
233
+ width: "100%",
234
+ height: "100%",
235
+ justifyContent: "center",
236
+ alignItems: "center"
237
+ },
238
+ emptyDot: {
239
+ width: _floatingToolsCore.dialStyles.emptySlot.dotSize,
240
+ height: _floatingToolsCore.dialStyles.emptySlot.dotSize,
241
+ borderRadius: _floatingToolsCore.dialStyles.emptySlot.dotSize / 2,
242
+ backgroundColor: _floatingToolsCore.dialColors.emptyDotBackground,
243
+ borderWidth: _floatingToolsCore.dialStyles.emptySlot.borderWidth,
244
+ borderColor: _floatingToolsCore.dialColors.emptyDotBorder
245
+ }
246
+ });
@@ -0,0 +1,249 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.OnboardingTooltip = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _sharedUi = require("@buoy-gg/shared-ui");
10
+ var _onboardingConstants = require("./onboardingConstants.js");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ const OnboardingTooltip = ({
13
+ visible,
14
+ onDismiss,
15
+ title = "Welcome to Buoy Tools!",
16
+ message = "Tap the center button to configure and add developer tools to your dial menu."
17
+ }) => {
18
+ const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
19
+ const scaleAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0.8)).current;
20
+ const pulseAnim = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
21
+ const arrowBounceAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
22
+ (0, _react.useEffect)(() => {
23
+ if (visible) {
24
+ // Entrance animation
25
+ _reactNative.Animated.parallel([_reactNative.Animated.timing(fadeAnim, {
26
+ toValue: 1,
27
+ duration: 300,
28
+ easing: _reactNative.Easing.out(_reactNative.Easing.ease),
29
+ useNativeDriver: true
30
+ }), _reactNative.Animated.spring(scaleAnim, {
31
+ toValue: 1,
32
+ damping: 12,
33
+ stiffness: 150,
34
+ useNativeDriver: true
35
+ })]).start();
36
+
37
+ // Continuous pulse animation for the tooltip
38
+ _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(pulseAnim, {
39
+ toValue: 1.02,
40
+ duration: 1500,
41
+ easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
42
+ useNativeDriver: true
43
+ }), _reactNative.Animated.timing(pulseAnim, {
44
+ toValue: 1,
45
+ duration: 1500,
46
+ easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
47
+ useNativeDriver: true
48
+ })])).start();
49
+
50
+ // Bouncing arrow animation
51
+ _reactNative.Animated.loop(_reactNative.Animated.sequence([_reactNative.Animated.timing(arrowBounceAnim, {
52
+ toValue: -8,
53
+ duration: 800,
54
+ easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
55
+ useNativeDriver: true
56
+ }), _reactNative.Animated.timing(arrowBounceAnim, {
57
+ toValue: 0,
58
+ duration: 800,
59
+ easing: _reactNative.Easing.inOut(_reactNative.Easing.ease),
60
+ useNativeDriver: true
61
+ })])).start();
62
+ } else {
63
+ // Exit animation
64
+ _reactNative.Animated.parallel([_reactNative.Animated.timing(fadeAnim, {
65
+ toValue: 0,
66
+ duration: 200,
67
+ easing: _reactNative.Easing.in(_reactNative.Easing.ease),
68
+ useNativeDriver: true
69
+ }), _reactNative.Animated.timing(scaleAnim, {
70
+ toValue: 0.8,
71
+ duration: 200,
72
+ easing: _reactNative.Easing.in(_reactNative.Easing.ease),
73
+ useNativeDriver: true
74
+ })]).start();
75
+ }
76
+ }, [visible]);
77
+ if (!visible) {
78
+ return null;
79
+ }
80
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
81
+ style: [styles.container, {
82
+ opacity: fadeAnim,
83
+ transform: [{
84
+ scale: scaleAnim
85
+ }]
86
+ }],
87
+ pointerEvents: "box-none",
88
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
89
+ style: [styles.tooltipContainer, {
90
+ transform: [{
91
+ scale: pulseAnim
92
+ }]
93
+ }],
94
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
95
+ style: styles.tooltip,
96
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
97
+ style: styles.glowEffect
98
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
99
+ style: styles.content,
100
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
101
+ style: styles.title,
102
+ children: title
103
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
104
+ style: styles.message,
105
+ children: message
106
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
107
+ onPress: onDismiss,
108
+ style: ({
109
+ pressed
110
+ }) => [styles.button, pressed && styles.buttonPressed],
111
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
112
+ style: styles.buttonGradient,
113
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
114
+ style: styles.buttonText,
115
+ children: "Got it!"
116
+ })
117
+ })
118
+ })]
119
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
120
+ style: [styles.arrowContainer, {
121
+ transform: [{
122
+ translateY: arrowBounceAnim
123
+ }]
124
+ }],
125
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
126
+ style: styles.arrow
127
+ })
128
+ })]
129
+ })
130
+ })
131
+ });
132
+ };
133
+ exports.OnboardingTooltip = OnboardingTooltip;
134
+ const styles = _reactNative.StyleSheet.create({
135
+ container: {
136
+ ..._reactNative.StyleSheet.absoluteFillObject,
137
+ alignItems: "center",
138
+ justifyContent: "center",
139
+ pointerEvents: "box-none"
140
+ },
141
+ tooltipContainer: {
142
+ position: "absolute",
143
+ bottom: (0, _onboardingConstants.calculateTooltipPosition)(),
144
+ alignItems: "center",
145
+ maxWidth: 280
146
+ },
147
+ tooltip: {
148
+ backgroundColor: _sharedUi.dialColors.dialBackground,
149
+ borderRadius: 16,
150
+ borderWidth: 2,
151
+ borderColor: _sharedUi.dialColors.dialBorder,
152
+ padding: 20,
153
+ shadowColor: _sharedUi.buoyColors.primary,
154
+ shadowOffset: {
155
+ width: 0,
156
+ height: 0
157
+ },
158
+ shadowOpacity: 0.6,
159
+ shadowRadius: 20,
160
+ elevation: 10
161
+ },
162
+ glowEffect: {
163
+ position: "absolute",
164
+ top: -4,
165
+ left: -4,
166
+ right: -4,
167
+ bottom: -4,
168
+ borderRadius: 18,
169
+ backgroundColor: "#FFFFFF",
170
+ opacity: 0.15
171
+ },
172
+ content: {
173
+ alignItems: "center",
174
+ gap: 12
175
+ },
176
+ title: {
177
+ color: _sharedUi.buoyColors.primary,
178
+ fontSize: 16,
179
+ fontWeight: "900",
180
+ fontFamily: "monospace",
181
+ letterSpacing: 1,
182
+ textAlign: "center",
183
+ textTransform: "uppercase",
184
+ textShadowColor: _sharedUi.buoyColors.primary,
185
+ textShadowOffset: {
186
+ width: 0,
187
+ height: 0
188
+ },
189
+ textShadowRadius: 4
190
+ },
191
+ message: {
192
+ color: "#FFFFFF",
193
+ fontSize: 13,
194
+ lineHeight: 20,
195
+ textAlign: "center",
196
+ fontFamily: "monospace"
197
+ },
198
+ button: {
199
+ marginTop: 8,
200
+ borderRadius: 8,
201
+ overflow: "hidden",
202
+ borderWidth: 2,
203
+ borderColor: "#FFFFFF"
204
+ },
205
+ buttonPressed: {
206
+ opacity: 0.7,
207
+ transform: [{
208
+ scale: 0.96
209
+ }]
210
+ },
211
+ buttonGradient: {
212
+ backgroundColor: "rgba(255, 255, 255, 0.1)",
213
+ paddingHorizontal: 24,
214
+ paddingVertical: 10,
215
+ alignItems: "center"
216
+ },
217
+ buttonText: {
218
+ color: "#FFFFFF",
219
+ fontSize: 14,
220
+ fontWeight: "900",
221
+ fontFamily: "monospace",
222
+ letterSpacing: 1.5,
223
+ textTransform: "uppercase"
224
+ },
225
+ arrowContainer: {
226
+ position: "absolute",
227
+ bottom: _onboardingConstants.ARROW_BOTTOM_OFFSET,
228
+ left: 0,
229
+ right: 0,
230
+ alignItems: "center"
231
+ },
232
+ arrow: {
233
+ width: 0,
234
+ height: 0,
235
+ borderLeftWidth: 12,
236
+ borderRightWidth: 12,
237
+ borderTopWidth: _onboardingConstants.ARROW_HEIGHT,
238
+ borderLeftColor: "transparent",
239
+ borderRightColor: "transparent",
240
+ borderTopColor: _sharedUi.buoyColors.primary,
241
+ shadowColor: _sharedUi.buoyColors.primary,
242
+ shadowOffset: {
243
+ width: 0,
244
+ height: 0
245
+ },
246
+ shadowOpacity: 0.8,
247
+ shadowRadius: 10
248
+ }
249
+ });
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SPACING_GAP = exports.ARROW_HEIGHT = exports.ARROW_BOTTOM_OFFSET = void 0;
7
+ exports.calculateTargetPosition = calculateTargetPosition;
8
+ exports.calculateTooltipPosition = calculateTooltipPosition;
9
+ exports.getScreenCenterY = getScreenCenterY;
10
+ var _reactNative = require("react-native");
11
+ /**
12
+ * Shared constants for onboarding tooltip positioning
13
+ * These ensure the floating menu aligns perfectly under the tooltip arrow
14
+ * All positions are calculated dynamically based on screen size
15
+ */
16
+
17
+ // Arrow dimensions (relative positioning)
18
+ const ARROW_BOTTOM_OFFSET = exports.ARROW_BOTTOM_OFFSET = -40; // Arrow extends below tooltip
19
+ const ARROW_HEIGHT = exports.ARROW_HEIGHT = 20; // borderTopWidth of arrow
20
+ const SPACING_GAP = exports.SPACING_GAP = 10; // Gap between arrow tip and target element
21
+
22
+ /**
23
+ * Calculate the center Y position of the screen
24
+ * This is used to vertically center the onboarding UI
25
+ *
26
+ * @returns Y coordinate at the center of the screen
27
+ */
28
+ function getScreenCenterY() {
29
+ const {
30
+ height: screenHeight
31
+ } = _reactNative.Dimensions.get("window");
32
+ return screenHeight / 2;
33
+ }
34
+
35
+ /**
36
+ * Calculate the tooltip position to center it vertically on screen
37
+ * Uses flexbox-style centering - tooltip will center itself with its actual size
38
+ *
39
+ * @returns Distance from screen bottom for tooltip positioning
40
+ */
41
+ function calculateTooltipPosition() {
42
+ // Position from center - tooltip will be centered with transform or flex
43
+ // We return a value that's slightly above center to account for the arrow below
44
+ const centerY = getScreenCenterY();
45
+
46
+ // Approximate offset to center the tooltip+arrow combo
47
+ // This is a reasonable estimate that works for most tooltip sizes
48
+ const estimatedHalfHeight = 130; // ~half of (tooltip + arrow)
49
+
50
+ return centerY - estimatedHalfHeight;
51
+ }
52
+
53
+ /**
54
+ * Calculate the position where a target element should be placed
55
+ * to align directly under the tooltip arrow
56
+ *
57
+ * @returns Distance from screen bottom where element should be positioned
58
+ */
59
+ function calculateTargetPosition() {
60
+ const tooltipBottom = calculateTooltipPosition();
61
+
62
+ // Arrow tip position = tooltip bottom + arrow offset (arrow extends below, so negative)
63
+ const arrowTipFromBottom = tooltipBottom + ARROW_BOTTOM_OFFSET;
64
+
65
+ // Subtract arrow height to get to the actual tip
66
+ const actualArrowTip = arrowTipFromBottom - ARROW_HEIGHT;
67
+
68
+ // Subtract spacing gap to position element below arrow
69
+ return actualArrowTip - SPACING_GAP;
70
+ }