@buoy-gg/core 7.0.35 → 7.0.38

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 (111) hide show
  1. package/README.md +57 -66
  2. package/bin/buoy.js +71 -20
  3. package/lib/commonjs/Buoy.js +3 -16
  4. package/lib/commonjs/floatingMenu/AppHost.js +1 -1
  5. package/lib/commonjs/floatingMenu/AppHost.web.js +1 -1
  6. package/lib/commonjs/floatingMenu/AppIcon.web.js +53 -0
  7. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.js +12 -5
  8. package/lib/commonjs/floatingMenu/DevToolsSettingsModal.web.js +14 -34
  9. package/lib/commonjs/floatingMenu/FloatingDevTools.js +32 -48
  10. package/lib/commonjs/floatingMenu/FloatingDevTools.web.js +24 -4
  11. package/lib/commonjs/floatingMenu/FloatingMenu.js +1 -1
  12. package/lib/commonjs/floatingMenu/MinimizedToolsStack.js +83 -4
  13. package/lib/commonjs/floatingMenu/MinimizedToolsStack.web.js +90 -6
  14. package/lib/commonjs/floatingMenu/ToolHost.js +1 -0
  15. package/lib/commonjs/floatingMenu/autoExternalSync.js +3 -2
  16. package/lib/commonjs/floatingMenu/dial/DialDevTools.js +43 -10
  17. package/lib/commonjs/floatingMenu/dial/DialDevTools.web.js +18 -5
  18. package/lib/commonjs/floatingMenu/dial/dialUsageStore.js +13 -17
  19. package/lib/commonjs/floatingMenu/dial/onboardingConstants.js +37 -65
  20. package/lib/commonjs/floatingMenu/dial/onboardingConstants.web.js +37 -29
  21. package/lib/commonjs/floatingMenu/floatingTools.js +23 -889
  22. package/lib/commonjs/floatingMenu/floatingTools.web.js +24 -514
  23. package/lib/commonjs/floatingMenu/optionalRequire.js +4 -0
  24. package/lib/commonjs/telemetry/installPing.js +7 -0
  25. package/lib/commonjs/version.js +1 -1
  26. package/lib/module/Buoy.js +3 -16
  27. package/lib/module/floatingMenu/AppHost.js +1 -1
  28. package/lib/module/floatingMenu/AppHost.web.js +1 -1
  29. package/lib/module/floatingMenu/AppIcon.web.js +47 -0
  30. package/lib/module/floatingMenu/DevToolsSettingsModal.js +13 -6
  31. package/lib/module/floatingMenu/DevToolsSettingsModal.web.js +15 -35
  32. package/lib/module/floatingMenu/FloatingDevTools.js +35 -49
  33. package/lib/module/floatingMenu/FloatingDevTools.web.js +24 -3
  34. package/lib/module/floatingMenu/FloatingMenu.js +1 -1
  35. package/lib/module/floatingMenu/MinimizedToolsStack.js +88 -8
  36. package/lib/module/floatingMenu/MinimizedToolsStack.web.js +92 -8
  37. package/lib/module/floatingMenu/ToolHost.js +1 -0
  38. package/lib/module/floatingMenu/autoExternalSync.js +3 -2
  39. package/lib/module/floatingMenu/dial/DialDevTools.js +43 -10
  40. package/lib/module/floatingMenu/dial/DialDevTools.web.js +18 -5
  41. package/lib/module/floatingMenu/dial/dialUsageStore.js +14 -18
  42. package/lib/module/floatingMenu/dial/onboardingConstants.js +1 -62
  43. package/lib/module/floatingMenu/dial/onboardingConstants.web.js +1 -25
  44. package/lib/module/floatingMenu/floatingTools.js +15 -890
  45. package/lib/module/floatingMenu/floatingTools.web.js +1 -517
  46. package/lib/module/floatingMenu/optionalRequire.js +4 -0
  47. package/lib/module/telemetry/installPing.js +7 -0
  48. package/lib/module/version.js +1 -1
  49. package/lib/typescript/commonjs/Buoy.d.ts +14 -3
  50. package/lib/typescript/commonjs/Buoy.d.ts.map +1 -1
  51. package/lib/typescript/commonjs/floatingMenu/AppIcon.web.d.ts +14 -0
  52. package/lib/typescript/commonjs/floatingMenu/AppIcon.web.d.ts.map +1 -0
  53. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -1
  55. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts +4 -14
  56. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.d.ts.map +1 -1
  57. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts +4 -19
  58. package/lib/typescript/commonjs/floatingMenu/FloatingDevTools.web.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/floatingMenu/MinimizedToolsStack.web.d.ts.map +1 -1
  61. package/lib/typescript/commonjs/floatingMenu/ToolHost.d.ts.map +1 -1
  62. package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts +3 -4
  63. package/lib/typescript/commonjs/floatingMenu/autoExternalSync.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.d.ts.map +1 -1
  65. package/lib/typescript/commonjs/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/floatingMenu/dial/dialUsageStore.d.ts +3 -15
  67. package/lib/typescript/commonjs/floatingMenu/dial/dialUsageStore.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts +1 -29
  69. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.web.d.ts +1 -12
  71. package/lib/typescript/commonjs/floatingMenu/dial/onboardingConstants.web.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts +6 -55
  73. package/lib/typescript/commonjs/floatingMenu/floatingTools.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts +3 -53
  75. package/lib/typescript/commonjs/floatingMenu/floatingTools.web.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/floatingMenu/optionalRequire.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/telemetry/installPing.d.ts +8 -1
  78. package/lib/typescript/commonjs/telemetry/installPing.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/version.d.ts +1 -1
  80. package/lib/typescript/module/Buoy.d.ts +14 -3
  81. package/lib/typescript/module/Buoy.d.ts.map +1 -1
  82. package/lib/typescript/module/floatingMenu/AppIcon.web.d.ts +14 -0
  83. package/lib/typescript/module/floatingMenu/AppIcon.web.d.ts.map +1 -0
  84. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.d.ts.map +1 -1
  85. package/lib/typescript/module/floatingMenu/DevToolsSettingsModal.web.d.ts.map +1 -1
  86. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts +4 -14
  87. package/lib/typescript/module/floatingMenu/FloatingDevTools.d.ts.map +1 -1
  88. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts +4 -19
  89. package/lib/typescript/module/floatingMenu/FloatingDevTools.web.d.ts.map +1 -1
  90. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.d.ts.map +1 -1
  91. package/lib/typescript/module/floatingMenu/MinimizedToolsStack.web.d.ts.map +1 -1
  92. package/lib/typescript/module/floatingMenu/ToolHost.d.ts.map +1 -1
  93. package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts +3 -4
  94. package/lib/typescript/module/floatingMenu/autoExternalSync.d.ts.map +1 -1
  95. package/lib/typescript/module/floatingMenu/dial/DialDevTools.d.ts.map +1 -1
  96. package/lib/typescript/module/floatingMenu/dial/DialDevTools.web.d.ts.map +1 -1
  97. package/lib/typescript/module/floatingMenu/dial/dialUsageStore.d.ts +3 -15
  98. package/lib/typescript/module/floatingMenu/dial/dialUsageStore.d.ts.map +1 -1
  99. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts +1 -29
  100. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.d.ts.map +1 -1
  101. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.web.d.ts +1 -12
  102. package/lib/typescript/module/floatingMenu/dial/onboardingConstants.web.d.ts.map +1 -1
  103. package/lib/typescript/module/floatingMenu/floatingTools.d.ts +6 -55
  104. package/lib/typescript/module/floatingMenu/floatingTools.d.ts.map +1 -1
  105. package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts +3 -53
  106. package/lib/typescript/module/floatingMenu/floatingTools.web.d.ts.map +1 -1
  107. package/lib/typescript/module/floatingMenu/optionalRequire.d.ts.map +1 -1
  108. package/lib/typescript/module/telemetry/installPing.d.ts +8 -1
  109. package/lib/typescript/module/telemetry/installPing.d.ts.map +1 -1
  110. package/lib/typescript/module/version.d.ts +1 -1
  111. package/package.json +6 -6
@@ -13,7 +13,7 @@ var _DialPagination = require("./DialPagination.js");
13
13
  var _dialUsageStore = require("./dialUsageStore.js");
14
14
  var _DevToolsSettingsModal = require("../DevToolsSettingsModal");
15
15
  var _license = require("@buoy-gg/license");
16
- var _AppIcon = require("../AppIcon.js");
16
+ var _AppIcon = require("../AppIcon");
17
17
  var _AppHost = require("../AppHost");
18
18
  var _OnboardingTooltip = require("./OnboardingTooltip");
19
19
  var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
@@ -24,6 +24,14 @@ var _jsxRuntime = require("react/jsx-runtime");
24
24
  // the component via useWindowDimensions — a module-scope Dimensions.get
25
25
  // snapshot goes stale when the window resizes after load (web/desktop).
26
26
  const BUTTON_SIZE = _floatingToolsCore.DIAL_BUTTON_SIZE;
27
+ /** The dial face is a circle, so its centre is the middle of the measured square. */
28
+ const DIAL_BACKGROUND_FOCUS = {
29
+ x: 0.5,
30
+ y: 0.5
31
+ };
32
+ // Radius kept clear of grid spokes around the glass hub (its outer disc is
33
+ // 0.75 × BUTTON_SIZE, plus a breath).
34
+ const HUB_CLEARANCE = BUTTON_SIZE * 0.75 + 6;
27
35
 
28
36
  /**
29
37
  * The centre button's idle pulse, off by design.
@@ -100,6 +108,11 @@ const DialDevTools = ({
100
108
  },
101
109
  gridLine: {
102
110
  width: circleSize
111
+ },
112
+ // Each spoke is two segments that stop short of the glass hub, so the
113
+ // six lines never meet in the middle where the background shows through.
114
+ spoke: {
115
+ width: circleSize / 2 - HUB_CLEARANCE
103
116
  }
104
117
  }), [circleSize]);
105
118
 
@@ -225,7 +238,7 @@ const DialDevTools = ({
225
238
  iconComponent: typeof app.icon === "function" ? app.icon : undefined,
226
239
  color: app.color ?? _sharedUi.buoyColors.primary,
227
240
  onPress: () => {
228
- // Record usage so frequently/recently used tools rank toward page 1.
241
+ // Put this tool first the next time the dial opens.
229
242
  void (0, _dialUsageStore.recordToolUsage)(app.id);
230
243
 
231
244
  // Call the app's onPress callback if provided, passing actions for
@@ -589,16 +602,23 @@ const DialDevTools = ({
589
602
  style: styles.gridPattern,
590
603
  children: Array.from({
591
604
  length: 6
592
- }).map((_, i) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
605
+ }).map((_, i) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
593
606
  style: [styles.gridLine, sizeStyles.gridLine, {
594
607
  transform: [{
595
608
  rotate: `${i * 60}deg`
596
609
  }]
597
- }]
610
+ }],
611
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
612
+ style: [styles.spoke, sizeStyles.spoke, styles.spokeLeft]
613
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
614
+ style: [styles.spoke, sizeStyles.spoke, styles.spokeRight]
615
+ })]
598
616
  }, i))
599
617
  }), backgroundId === "hyperspace" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_DialHyperspace.DialHyperspace, {
600
618
  size: circleSize
601
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolBackground, {})]
619
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_sharedUi.ToolBackground, {
620
+ focus: DIAL_BACKGROUND_FOCUS
621
+ })]
602
622
  }), allDialIcons.filter(({
603
623
  page
604
624
  }) => page === safePage).map(({
@@ -757,9 +777,20 @@ const styles = _reactNative.StyleSheet.create({
757
777
  },
758
778
  gridLine: {
759
779
  position: "absolute",
780
+ height: 1
781
+ },
782
+ spoke: {
783
+ position: "absolute",
784
+ top: 0,
760
785
  height: 1,
761
786
  backgroundColor: _floatingToolsCore.dialColors.dialGridLine
762
787
  },
788
+ spokeLeft: {
789
+ left: 0
790
+ },
791
+ spokeRight: {
792
+ right: 0
793
+ },
763
794
  buttonContainer: {
764
795
  zIndex: 1,
765
796
  backgroundColor: "transparent",
@@ -770,6 +801,10 @@ const styles = _reactNative.StyleSheet.create({
770
801
  height: BUTTON_SIZE * 1.5,
771
802
  borderRadius: BUTTON_SIZE
772
803
  },
804
+ // The hub is glass: no rings, no opaque fill. The outer disc is a barely-
805
+ // there shade and the inner button a soft puck, so the tool background runs
806
+ // through the middle of the dial while BUOY / PRO stay legible. The spokes
807
+ // stop at HUB_CLEARANCE so nothing draws under it.
773
808
  buttonGradient: {
774
809
  width: "100%",
775
810
  height: "100%",
@@ -777,7 +812,7 @@ const styles = _reactNative.StyleSheet.create({
777
812
  alignItems: "center",
778
813
  justifyContent: "center",
779
814
  padding: 4,
780
- backgroundColor: _floatingToolsCore.dialColors.dialBackground,
815
+ backgroundColor: _floatingToolsCore.dialColors.hubHalo,
781
816
  position: "relative",
782
817
  overflow: "hidden"
783
818
  },
@@ -804,14 +839,12 @@ const styles = _reactNative.StyleSheet.create({
804
839
  borderRadius: BUTTON_SIZE
805
840
  },
806
841
  buttonBorder: {
807
- backgroundColor: _floatingToolsCore.dialColors.dialGridLine,
842
+ backgroundColor: _floatingToolsCore.dialColors.hubFill,
808
843
  alignItems: "center",
809
844
  justifyContent: "center",
810
845
  width: BUTTON_SIZE * 1.2,
811
846
  height: BUTTON_SIZE * 1.2,
812
- borderRadius: BUTTON_SIZE * 0.6,
813
- borderWidth: 2,
814
- borderColor: _floatingToolsCore.dialColors.dialBorder
847
+ borderRadius: BUTTON_SIZE * 0.6
815
848
  },
816
849
  button: {
817
850
  width: BUTTON_SIZE,
@@ -551,6 +551,8 @@ function DialMenu({
551
551
  // Computed values
552
552
  const buttonContainerSize = layout.buttonSize * _floatingToolsReact.dialStyles.centerButton.containerRatio;
553
553
  const buttonBorderSize = layout.buttonSize * _floatingToolsReact.dialStyles.centerButton.borderRatio;
554
+ // Grid spokes stop this far from the centre: the hub's outer disc plus a breath.
555
+ const hubClearance = layout.buttonSize * _floatingToolsReact.dialStyles.centerButton.containerRatio / 2 + 6;
554
556
  const isAnimating = entranceComplete && !isExiting;
555
557
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
556
558
  role: "dialog",
@@ -626,10 +628,19 @@ function DialMenu({
626
628
  left: 0,
627
629
  right: 0,
628
630
  height: _floatingToolsReact.dialStyles.grid.lineHeight,
629
- backgroundColor: _floatingToolsReact.dialColors.dialGridLine,
630
631
  transform: `rotate(${deg}deg)`,
631
632
  transformOrigin: 'center'
632
- }
633
+ },
634
+ children: ['left', 'right'].map(side => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
635
+ style: {
636
+ position: 'absolute',
637
+ top: 0,
638
+ [side]: 0,
639
+ width: `calc(50% - ${hubClearance}px)`,
640
+ height: _floatingToolsReact.dialStyles.grid.lineHeight,
641
+ backgroundColor: _floatingToolsReact.dialColors.dialGridLine
642
+ }
643
+ }, side))
633
644
  }, deg)), paddedIcons.map((icon, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(DialIconItem, {
634
645
  icon: icon,
635
646
  index: index,
@@ -649,7 +660,10 @@ function DialMenu({
649
660
  display: 'flex',
650
661
  alignItems: 'center',
651
662
  justifyContent: 'center',
652
- backgroundColor: _floatingToolsReact.dialColors.dialBackground,
663
+ // Glass hub — see the native twin: a barely-there shade on the outer
664
+ // disc, a soft puck inside, no rings, so the tool background runs
665
+ // through the middle of the dial.
666
+ backgroundColor: _floatingToolsReact.dialColors.hubHalo,
653
667
  borderRadius: layout.buttonSize,
654
668
  overflow: 'hidden',
655
669
  transform: `scale(${centerButtonScale * centerPulseScale})`,
@@ -688,8 +702,7 @@ function DialMenu({
688
702
  width: buttonBorderSize,
689
703
  height: buttonBorderSize,
690
704
  borderRadius: layout.buttonSize * _floatingToolsReact.dialStyles.centerButton.borderRadiusRatio,
691
- backgroundColor: _floatingToolsReact.dialColors.dialGridLine,
692
- border: `${_floatingToolsReact.dialStyles.centerButton.borderWidth}px solid ${_floatingToolsReact.dialColors.dialBorder}`,
705
+ backgroundColor: _floatingToolsReact.dialColors.hubFill,
693
706
  display: 'flex',
694
707
  alignItems: 'center',
695
708
  justifyContent: 'center'
@@ -11,14 +11,8 @@ exports.resetDialUsage = resetDialUsage;
11
11
  var _sharedUi = require("@buoy-gg/shared-ui");
12
12
  var _floatingToolsCore = require("@buoy-gg/floating-tools-core");
13
13
  /**
14
- * Dial Usage Store - persists and ranks dial tool usage.
15
- *
16
- * Wraps the pure scoring logic from `@buoy-gg/floating-tools-core` with a
17
- * persisted, in-memory cache. The dial menu uses this to order tools by how
18
- * recently/frequently they are used, so the most-used tools land on page 1.
19
- *
20
- * The cache is loaded eagerly on import so `getRankedToolIds` can run
21
- * synchronously by the time the dial opens.
14
+ * Persists dial usage and orders tools by their last launch.
15
+ * The cache loads on import so opening the dial can rank tools synchronously.
22
16
  */
23
17
 
24
18
  const STORAGE_KEY = _sharedUi.devToolsStorageKeys.dial.usage();
@@ -58,15 +52,15 @@ function isDialUsageLoaded() {
58
52
  return loaded;
59
53
  }
60
54
 
61
- /**
62
- * Rank tool ids by recency-weighted usage, highest first. Synchronous —
63
- * operates against the in-memory cache. Never-used tools keep their original
64
- * order as a tie-breaker.
65
- *
66
- * @param orderedIds - Tool ids in their default/registration order
67
- */
55
+ /** Most recently opened first; unused tools keep registration order. */
68
56
  function getRankedToolIds(orderedIds) {
69
- return (0, _floatingToolsCore.rankToolIds)(orderedIds, cache, Date.now());
57
+ return orderedIds.map((id, index) => ({
58
+ id,
59
+ index,
60
+ lastUsed: cache[id]?.lastUsed ?? 0
61
+ })).sort((a, b) => b.lastUsed - a.lastUsed || a.index - b.index).map(({
62
+ id
63
+ }) => id);
70
64
  }
71
65
 
72
66
  /**
@@ -77,7 +71,9 @@ function getRankedToolIds(orderedIds) {
77
71
  async function recordToolUsage(id) {
78
72
  if (!id) return;
79
73
  if (!loaded) await loadDialUsage();
80
- const now = Date.now();
74
+
75
+ // Preserve launch order even when presses share a timestamp or the clock moves back.
76
+ const now = Math.max(Date.now(), ...Object.values(cache).map(entry => entry.lastUsed + 1));
81
77
  cache = (0, _floatingToolsCore.pruneUsage)((0, _floatingToolsCore.recordUsage)(cache, id, now), now);
82
78
  try {
83
79
  await _sharedUi.persistentStorage.setItem(STORAGE_KEY, JSON.stringify(cache));
@@ -3,68 +3,40 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
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
- }
6
+ Object.defineProperty(exports, "ARROW_BOTTOM_OFFSET", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _sharedUi.ARROW_BOTTOM_OFFSET;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ARROW_HEIGHT", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _sharedUi.ARROW_HEIGHT;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "SPACING_GAP", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _sharedUi.SPACING_GAP;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "calculateTargetPosition", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _sharedUi.calculateTargetPosition;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "calculateTooltipPosition", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _sharedUi.calculateTooltipPosition;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "getScreenCenterY", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _sharedUi.getScreenCenterY;
40
+ }
41
+ });
42
+ var _sharedUi = require("@buoy-gg/shared-ui");
@@ -3,32 +3,40 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
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
- /**
11
- * Web twin of onboardingConstants.ts — same math, window.innerHeight instead
12
- * of RN Dimensions.
13
- */
14
- const ARROW_BOTTOM_OFFSET = exports.ARROW_BOTTOM_OFFSET = -40; // Arrow extends below tooltip
15
- const ARROW_HEIGHT = exports.ARROW_HEIGHT = 20; // borderTopWidth of arrow
16
- const SPACING_GAP = exports.SPACING_GAP = 10; // Gap between arrow tip and target element
17
-
18
- function getScreenCenterY() {
19
- return window.innerHeight / 2;
20
- }
21
-
22
- /** Distance from screen bottom for tooltip positioning (centered-ish). */
23
- function calculateTooltipPosition() {
24
- const estimatedHalfHeight = 130; // ~half of (tooltip + arrow)
25
- return getScreenCenterY() - estimatedHalfHeight;
26
- }
27
-
28
- /** Distance from screen bottom where the bubble should sit (under the arrow). */
29
- function calculateTargetPosition() {
30
- const tooltipBottom = calculateTooltipPosition();
31
- const arrowTipFromBottom = tooltipBottom + ARROW_BOTTOM_OFFSET;
32
- const actualArrowTip = arrowTipFromBottom - ARROW_HEIGHT;
33
- return actualArrowTip - SPACING_GAP;
34
- }
6
+ Object.defineProperty(exports, "ARROW_BOTTOM_OFFSET", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _floating.ARROW_BOTTOM_OFFSET;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "ARROW_HEIGHT", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _floating.ARROW_HEIGHT;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "SPACING_GAP", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _floating.SPACING_GAP;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "calculateTargetPosition", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _floating.calculateTargetPosition;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "calculateTooltipPosition", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _floating.calculateTooltipPosition;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "getScreenCenterY", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _floating.getScreenCenterY;
40
+ }
41
+ });
42
+ var _floating = require("@buoy-gg/shared-ui/floating");