react-native-hold-menu-actions 0.1.17 → 0.1.20

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 (40) hide show
  1. package/lib/commonjs/components/backdrop/Backdrop.js +0 -1
  2. package/lib/commonjs/components/backdrop/Backdrop.js.map +1 -1
  3. package/lib/commonjs/components/customView/CustomView.js +52 -54
  4. package/lib/commonjs/components/customView/CustomView.js.map +1 -1
  5. package/lib/commonjs/components/holdItem/HoldItem.js +11 -5
  6. package/lib/commonjs/components/holdItem/HoldItem.js.map +1 -1
  7. package/lib/commonjs/components/menu/Menu.js +8 -6
  8. package/lib/commonjs/components/menu/Menu.js.map +1 -1
  9. package/lib/commonjs/components/menu/calculations.js +12 -0
  10. package/lib/commonjs/components/menu/calculations.js.map +1 -1
  11. package/lib/commonjs/components/provider/Provider.js +0 -1
  12. package/lib/commonjs/components/provider/Provider.js.map +1 -1
  13. package/lib/commonjs/utils/calculations.js +1 -48
  14. package/lib/commonjs/utils/calculations.js.map +1 -1
  15. package/lib/module/components/backdrop/Backdrop.js +0 -1
  16. package/lib/module/components/backdrop/Backdrop.js.map +1 -1
  17. package/lib/module/components/customView/CustomView.js +54 -54
  18. package/lib/module/components/customView/CustomView.js.map +1 -1
  19. package/lib/module/components/holdItem/HoldItem.js +12 -6
  20. package/lib/module/components/holdItem/HoldItem.js.map +1 -1
  21. package/lib/module/components/menu/Menu.js +10 -7
  22. package/lib/module/components/menu/Menu.js.map +1 -1
  23. package/lib/module/components/menu/calculations.js +13 -1
  24. package/lib/module/components/menu/calculations.js.map +1 -1
  25. package/lib/module/components/provider/Provider.js +0 -1
  26. package/lib/module/components/provider/Provider.js.map +1 -1
  27. package/lib/module/utils/calculations.js +0 -44
  28. package/lib/module/utils/calculations.js.map +1 -1
  29. package/lib/typescript/components/customView/CustomView.d.ts +1 -1
  30. package/lib/typescript/components/menu/types.d.ts +0 -1
  31. package/lib/typescript/utils/calculations.d.ts +0 -1
  32. package/package.json +1 -1
  33. package/src/components/backdrop/Backdrop.tsx +0 -1
  34. package/src/components/customView/CustomView.tsx +69 -64
  35. package/src/components/holdItem/HoldItem.tsx +12 -16
  36. package/src/components/menu/Menu.tsx +12 -14
  37. package/src/components/menu/calculations.ts +12 -1
  38. package/src/components/menu/types.d.ts +0 -1
  39. package/src/components/provider/Provider.tsx +7 -10
  40. package/src/utils/calculations.ts +0 -53
@@ -84,59 +84,6 @@ export const menuAnimationAnchor = (
84
84
  };
85
85
  };
86
86
 
87
- export const calculateDynamicTransformValue = (
88
- itemY: number,
89
- itemHeight: number,
90
- menuHeight: number,
91
- customViewHeight: number,
92
- anchorPosition: TransformOriginAnchorPosition,
93
- screenHeight: number,
94
- safeAreaTop: number,
95
- safeAreaBottom: number
96
- ): number => {
97
- 'worklet';
98
- const GAP = styleGuide.spacing;
99
- const isAnchorTop = anchorPosition.includes('top');
100
-
101
- if (isAnchorTop) {
102
- // Menu below item, custom view above item
103
- // Total space needed below item: itemHeight + gap + menuHeight + safeAreaBottom
104
- // Total space needed above item: customViewHeight + gap + safeAreaTop
105
- const bottomEdge = itemY + itemHeight + GAP + menuHeight + safeAreaBottom;
106
- const topEdge = itemY - GAP - customViewHeight - safeAreaTop;
107
-
108
- let tY = 0;
109
-
110
- // If bottom overflows screen
111
- if (bottomEdge > screenHeight) {
112
- tY = screenHeight - bottomEdge;
113
- }
114
- // After shifting, check if custom view goes above safe area
115
- if (topEdge + tY < 0) {
116
- tY = -topEdge;
117
- }
118
- return tY;
119
- } else {
120
- // Menu above item, custom view below item
121
- // Total space needed above item: menuHeight + gap + safeAreaTop
122
- // Total space needed below item: itemHeight + gap + customViewHeight + safeAreaBottom
123
- const topEdge = itemY - GAP - menuHeight - safeAreaTop;
124
- const bottomEdge =
125
- itemY + itemHeight + GAP + customViewHeight + safeAreaBottom;
126
-
127
- let tY = 0;
128
- // If top overflows screen (goes above safe area)
129
- if (topEdge < 0) {
130
- tY = -topEdge;
131
- }
132
- // After shifting, check if custom view goes below screen
133
- if (bottomEdge + tY > screenHeight) {
134
- tY = screenHeight - bottomEdge;
135
- }
136
- return tY;
137
- }
138
- };
139
-
140
87
  export const getTransformOrigin = (
141
88
  posX: number,
142
89
  itemWidth: number,