@jamadd/react-native-template-ui 0.8.6 → 0.8.7

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 (118) hide show
  1. package/lib/module/components/button/AnimatedThemedPressable.js +13 -3
  2. package/lib/module/components/button/AnimatedThemedPressable.js.map +1 -1
  3. package/lib/module/components/button/ThemedButton.js +84 -23
  4. package/lib/module/components/button/ThemedButton.js.map +1 -1
  5. package/lib/module/components/button/ThemedIconButton.js +62 -16
  6. package/lib/module/components/button/ThemedIconButton.js.map +1 -1
  7. package/lib/module/components/button/ThemedIconTextButton.js +118 -29
  8. package/lib/module/components/button/ThemedIconTextButton.js.map +1 -1
  9. package/lib/module/components/button/ThemedPressable.js +13 -3
  10. package/lib/module/components/button/ThemedPressable.js.map +1 -1
  11. package/lib/module/components/icon/ThemedIcon.js +56 -15
  12. package/lib/module/components/icon/ThemedIcon.js.map +1 -1
  13. package/lib/module/components/list/List.js +131 -39
  14. package/lib/module/components/list/List.js.map +1 -1
  15. package/lib/module/components/loading/ThemedLoading.js +50 -13
  16. package/lib/module/components/loading/ThemedLoading.js.map +1 -1
  17. package/lib/module/components/overlay/actionSheet/ActionSheet.js +64 -19
  18. package/lib/module/components/overlay/actionSheet/ActionSheet.js.map +1 -1
  19. package/lib/module/components/overlay/actionSheet/ActionSheet.web.js +64 -19
  20. package/lib/module/components/overlay/actionSheet/ActionSheet.web.js.map +1 -1
  21. package/lib/module/components/overlay/actionSheet/ActionSheetContentGesture.js +19 -8
  22. package/lib/module/components/overlay/actionSheet/ActionSheetContentGesture.js.map +1 -1
  23. package/lib/module/components/overlay/actionSheet/ActionSheetHeader.js +87 -31
  24. package/lib/module/components/overlay/actionSheet/ActionSheetHeader.js.map +1 -1
  25. package/lib/module/components/overlay/actionSheet/ActionSheetHeader.web.js +87 -31
  26. package/lib/module/components/overlay/actionSheet/ActionSheetHeader.web.js.map +1 -1
  27. package/lib/module/components/overlay/actionSheet/ActionSheetListView.js +68 -27
  28. package/lib/module/components/overlay/actionSheet/ActionSheetListView.js.map +1 -1
  29. package/lib/module/components/overlay/actionSheet/ActionSheetListViewContent.js +39 -14
  30. package/lib/module/components/overlay/actionSheet/ActionSheetListViewContent.js.map +1 -1
  31. package/lib/module/components/overlay/actionSheet/ActionSheetOptionList.js +58 -25
  32. package/lib/module/components/overlay/actionSheet/ActionSheetOptionList.js.map +1 -1
  33. package/lib/module/components/overlay/actionSheet/ActionSheetOptionListItem.js +45 -21
  34. package/lib/module/components/overlay/actionSheet/ActionSheetOptionListItem.js.map +1 -1
  35. package/lib/module/components/overlay/actionSheet/ActionSheetOptions.js +74 -31
  36. package/lib/module/components/overlay/actionSheet/ActionSheetOptions.js.map +1 -1
  37. package/lib/module/components/overlay/actionSheet/ActionSheetScrollView.js +71 -29
  38. package/lib/module/components/overlay/actionSheet/ActionSheetScrollView.js.map +1 -1
  39. package/lib/module/components/overlay/actionSheet/ActionSheetScrollViewContent.js +45 -18
  40. package/lib/module/components/overlay/actionSheet/ActionSheetScrollViewContent.js.map +1 -1
  41. package/lib/module/components/overlay/actionSheet/ActionSheetWrap.js +152 -36
  42. package/lib/module/components/overlay/actionSheet/ActionSheetWrap.js.map +1 -1
  43. package/lib/module/components/overlay/alert/Alert.js +142 -51
  44. package/lib/module/components/overlay/alert/Alert.js.map +1 -1
  45. package/lib/module/components/overlay/alert/AlertButton.js +62 -26
  46. package/lib/module/components/overlay/alert/AlertButton.js.map +1 -1
  47. package/lib/module/components/overlay/alert/AlertButtons.js +58 -23
  48. package/lib/module/components/overlay/alert/AlertButtons.js.map +1 -1
  49. package/lib/module/components/overlay/alert/AlertContent.js +76 -17
  50. package/lib/module/components/overlay/alert/AlertContent.js.map +1 -1
  51. package/lib/module/components/overlay/alert/AlertWrap.js +125 -43
  52. package/lib/module/components/overlay/alert/AlertWrap.js.map +1 -1
  53. package/lib/module/components/overlay/modal/ThemedLoadingModal.js +96 -21
  54. package/lib/module/components/overlay/modal/ThemedLoadingModal.js.map +1 -1
  55. package/lib/module/components/overlay/modal/ThemedModal.js +76 -23
  56. package/lib/module/components/overlay/modal/ThemedModal.js.map +1 -1
  57. package/lib/module/components/overlay/toast/ThemedToast.js +339 -90
  58. package/lib/module/components/overlay/toast/ThemedToast.js.map +1 -1
  59. package/lib/module/components/provider/GestureProvider.js +15 -3
  60. package/lib/module/components/provider/GestureProvider.js.map +1 -1
  61. package/lib/module/components/provider/InsetsProvider.js +15 -3
  62. package/lib/module/components/provider/InsetsProvider.js.map +1 -1
  63. package/lib/module/components/provider/ReactNativeTemplateProviders.js +23 -11
  64. package/lib/module/components/provider/ReactNativeTemplateProviders.js.map +1 -1
  65. package/lib/module/components/provider/ThemeProvider.js +15 -3
  66. package/lib/module/components/provider/ThemeProvider.js.map +1 -1
  67. package/lib/module/components/separator/ThemedSeparator.js +53 -14
  68. package/lib/module/components/separator/ThemedSeparator.js.map +1 -1
  69. package/lib/module/components/slider/Slider.js +625 -137
  70. package/lib/module/components/slider/Slider.js.map +1 -1
  71. package/lib/module/components/slider/ThemedSlider.js +178 -54
  72. package/lib/module/components/slider/ThemedSlider.js.map +1 -1
  73. package/lib/module/components/slider/ThemedSlider.web.js +178 -54
  74. package/lib/module/components/slider/ThemedSlider.web.js.map +1 -1
  75. package/lib/module/components/slider/ThemedSliderStepIndicator.js +40 -15
  76. package/lib/module/components/slider/ThemedSliderStepIndicator.js.map +1 -1
  77. package/lib/module/components/switch/ThemedSwitch.js +81 -21
  78. package/lib/module/components/switch/ThemedSwitch.js.map +1 -1
  79. package/lib/module/components/text/ThemedIconText.js +124 -35
  80. package/lib/module/components/text/ThemedIconText.js.map +1 -1
  81. package/lib/module/components/text/ThemedText.js +15 -3
  82. package/lib/module/components/text/ThemedText.js.map +1 -1
  83. package/lib/module/components/view/AnimatedThemedView.js +42 -11
  84. package/lib/module/components/view/AnimatedThemedView.js.map +1 -1
  85. package/lib/module/components/view/ThemedScreenWrap.js +144 -39
  86. package/lib/module/components/view/ThemedScreenWrap.js.map +1 -1
  87. package/lib/module/components/view/ThemedScreenWrap.web.js +111 -32
  88. package/lib/module/components/view/ThemedScreenWrap.web.js.map +1 -1
  89. package/lib/module/components/view/ThemedScrollView.js +126 -38
  90. package/lib/module/components/view/ThemedScrollView.js.map +1 -1
  91. package/lib/module/components/view/ThemedView.js +33 -10
  92. package/lib/module/components/view/ThemedView.js.map +1 -1
  93. package/lib/module/hooks/button.js +263 -84
  94. package/lib/module/hooks/button.js.map +1 -1
  95. package/lib/module/hooks/list.js +50 -10
  96. package/lib/module/hooks/list.js.map +1 -1
  97. package/lib/module/hooks/overlay.js +575 -187
  98. package/lib/module/hooks/overlay.js.map +1 -1
  99. package/lib/module/hooks/react.js +90 -27
  100. package/lib/module/hooks/react.js.map +1 -1
  101. package/lib/module/hooks/reanimated.js.map +1 -1
  102. package/lib/module/hooks/style.js +43 -18
  103. package/lib/module/hooks/style.js.map +1 -1
  104. package/lib/module/hooks/switch.js +182 -43
  105. package/lib/module/hooks/switch.js.map +1 -1
  106. package/lib/module/hooks/theme.js +17 -8
  107. package/lib/module/hooks/theme.js.map +1 -1
  108. package/lib/module/hooks/view.js +56 -14
  109. package/lib/module/hooks/view.js.map +1 -1
  110. package/lib/module/utils/reanimated/func.js +60 -10
  111. package/lib/module/utils/reanimated/func.js.map +1 -1
  112. package/lib/typescript/src/components/slider/Slider.d.ts +3 -2
  113. package/lib/typescript/src/components/slider/Slider.d.ts.map +1 -1
  114. package/lib/typescript/src/components/slider/ThemedSlider.d.ts.map +1 -1
  115. package/lib/typescript/src/components/slider/ThemedSlider.web.d.ts.map +1 -1
  116. package/lib/typescript/src/components/slider/ThemedSliderStepIndicator.d.ts +3 -2
  117. package/lib/typescript/src/components/slider/ThemedSliderStepIndicator.d.ts.map +1 -1
  118. package/package.json +14 -14
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ import { c as _c } from "react/compiler-runtime";
3
4
  import { useContext, useEffect, useLayoutEffect, useState } from 'react';
4
5
  import { Gesture } from 'react-native-gesture-handler';
5
6
  import { makeMutable, useAnimatedRef, useScrollOffset, useSharedValue } from 'react-native-reanimated';
@@ -18,42 +19,93 @@ export function useActionSheetContext() {
18
19
 
19
20
  /** @internal */
20
21
  function useActionSheet(actionSheetVisible) {
22
+ const $ = _c(18);
21
23
  const windowHeight = useWindowDimensionsHeight();
22
24
  const headerViewRef = useViewRef();
23
25
  const [height, setHeight] = useState(0);
24
26
  const translateYSharedVal = useSharedValue(windowHeight);
25
27
  const heightSharedVal = useSharedValue(0);
26
28
  const expandableHeightSharedVal = useSharedValue(0);
29
+ let t0;
30
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
31
+ t0 = getActionSheetContext();
32
+ $[0] = t0;
33
+ } else {
34
+ t0 = $[0];
35
+ }
27
36
  const {
28
37
  expandable
29
- } = getActionSheetContext();
30
- useEffect(() => {
31
- if (actionSheetVisible && height && translateYSharedVal.get() === windowHeight) {
32
- const tempHeight = expandable ? getActionSheetExpandableInitHeight() : height;
33
- heightSharedVal.set(tempHeight);
34
- expandableHeightSharedVal.set(tempHeight);
35
- translateYSharedVal.set(height);
36
- updateSharedValWithTiming(translateYSharedVal, 0, {
37
- duration: actionSheetOpenDuration
38
- });
39
- }
40
- }, [actionSheetVisible, height]);
41
- const updateHeight = tempHeight => {
42
- setHeight(expandable ? getActionSheetExpandableHeight() : getActionSheetHeight(tempHeight));
43
- };
44
- const actionSheet = {
45
- headerViewRef,
46
- height,
47
- translateYSharedVal,
48
- heightSharedVal,
49
- expandableHeightSharedVal,
50
- updateHeight
51
- };
38
+ } = t0;
39
+ let t1;
40
+ if ($[1] !== actionSheetVisible || $[2] !== expandableHeightSharedVal || $[3] !== height || $[4] !== heightSharedVal || $[5] !== translateYSharedVal || $[6] !== windowHeight) {
41
+ t1 = () => {
42
+ if (actionSheetVisible && height && translateYSharedVal.get() === windowHeight) {
43
+ const tempHeight = expandable ? getActionSheetExpandableInitHeight() : height;
44
+ heightSharedVal.set(tempHeight);
45
+ expandableHeightSharedVal.set(tempHeight);
46
+ translateYSharedVal.set(height);
47
+ updateSharedValWithTiming(translateYSharedVal, 0, {
48
+ duration: actionSheetOpenDuration
49
+ });
50
+ }
51
+ };
52
+ $[1] = actionSheetVisible;
53
+ $[2] = expandableHeightSharedVal;
54
+ $[3] = height;
55
+ $[4] = heightSharedVal;
56
+ $[5] = translateYSharedVal;
57
+ $[6] = windowHeight;
58
+ $[7] = t1;
59
+ } else {
60
+ t1 = $[7];
61
+ }
62
+ let t2;
63
+ if ($[8] !== actionSheetVisible || $[9] !== height) {
64
+ t2 = [actionSheetVisible, height];
65
+ $[8] = actionSheetVisible;
66
+ $[9] = height;
67
+ $[10] = t2;
68
+ } else {
69
+ t2 = $[10];
70
+ }
71
+ useEffect(t1, t2);
72
+ let t3;
73
+ if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
74
+ t3 = tempHeight_0 => {
75
+ setHeight(expandable ? getActionSheetExpandableHeight() : getActionSheetHeight(tempHeight_0));
76
+ };
77
+ $[11] = t3;
78
+ } else {
79
+ t3 = $[11];
80
+ }
81
+ const updateHeight = t3;
82
+ let t4;
83
+ if ($[12] !== expandableHeightSharedVal || $[13] !== headerViewRef || $[14] !== height || $[15] !== heightSharedVal || $[16] !== translateYSharedVal) {
84
+ t4 = {
85
+ headerViewRef,
86
+ height,
87
+ translateYSharedVal,
88
+ heightSharedVal,
89
+ expandableHeightSharedVal,
90
+ updateHeight
91
+ };
92
+ $[12] = expandableHeightSharedVal;
93
+ $[13] = headerViewRef;
94
+ $[14] = height;
95
+ $[15] = heightSharedVal;
96
+ $[16] = translateYSharedVal;
97
+ $[17] = t4;
98
+ } else {
99
+ t4 = $[17];
100
+ }
101
+ const actionSheet = t4;
52
102
  return actionSheet;
53
103
  }
54
104
 
55
105
  /** @internal */
56
- export function useActionSheetOnDismiss(force = true) {
106
+ export function useActionSheetOnDismiss(t0) {
107
+ const $ = _c(10);
108
+ const force = t0 === undefined ? true : t0;
57
109
  const windowHeight = useWindowDimensionsHeight();
58
110
  const {
59
111
  title,
@@ -64,58 +116,154 @@ export function useActionSheetOnDismiss(force = true) {
64
116
  heightSharedVal,
65
117
  expandableHeightSharedVal
66
118
  } = useActionSheetContext();
67
- const actionSheetOnDismiss = (text = overlayDismissResultDefaultText) => {
68
- if (!height || !heightSharedVal || !translateYSharedVal) {
69
- return;
70
- }
71
- const tempTranslateYSharedVal = translateYSharedVal ?? makeMutable(windowHeight);
72
- const toVal = expandable ? getActionSheetExpandableSnapHeight(heightSharedVal.get(), force) : getActionSheetSnapHeight(height, translateYSharedVal?.get() ?? windowHeight, force);
73
- const dismissActionSheet = toVal === (expandable ? 0 : height);
74
- const animationConfig = {
75
- duration: dismissActionSheet ? actionSheetDismissDuration : actionSheetSnapDuration
76
- };
77
- const cb = () => {
78
- if (!dismissActionSheet) {
79
- expandableHeightSharedVal?.set(toVal);
119
+ let t1;
120
+ if ($[0] !== expandable || $[1] !== expandableHeightSharedVal || $[2] !== force || $[3] !== height || $[4] !== heightSharedVal || $[5] !== onDismiss || $[6] !== title || $[7] !== translateYSharedVal || $[8] !== windowHeight) {
121
+ t1 = t2 => {
122
+ const text = t2 === undefined ? overlayDismissResultDefaultText : t2;
123
+ if (!height || !heightSharedVal || !translateYSharedVal) {
80
124
  return;
81
125
  }
82
- onDismiss?.({
83
- resultType: OverlayDismissResultType.ActionSheet,
84
- title,
85
- text
86
- });
126
+ const tempTranslateYSharedVal = translateYSharedVal ?? makeMutable(windowHeight);
127
+ const toVal = expandable ? getActionSheetExpandableSnapHeight(heightSharedVal.get(), force) : getActionSheetSnapHeight(height, translateYSharedVal?.get() ?? windowHeight, force);
128
+ const dismissActionSheet = toVal === (expandable ? 0 : height);
129
+ const animationConfig = {
130
+ duration: dismissActionSheet ? actionSheetDismissDuration : actionSheetSnapDuration
131
+ };
132
+ const cb = () => {
133
+ if (!dismissActionSheet) {
134
+ expandableHeightSharedVal?.set(toVal);
135
+ return;
136
+ }
137
+ onDismiss?.({
138
+ resultType: OverlayDismissResultType.ActionSheet,
139
+ title,
140
+ text
141
+ });
142
+ };
143
+ if (expandable && !dismissActionSheet) {
144
+ updateSharedValWithTiming(heightSharedVal, toVal, animationConfig, cb);
145
+ } else {
146
+ updateSharedValWithTiming(tempTranslateYSharedVal, dismissActionSheet ? windowHeight : toVal, animationConfig, cb);
147
+ }
87
148
  };
88
- if (expandable && !dismissActionSheet) {
89
- updateSharedValWithTiming(heightSharedVal, toVal, animationConfig, cb);
90
- } else {
91
- updateSharedValWithTiming(tempTranslateYSharedVal, dismissActionSheet ? windowHeight : toVal, animationConfig, cb);
92
- }
93
- };
149
+ $[0] = expandable;
150
+ $[1] = expandableHeightSharedVal;
151
+ $[2] = force;
152
+ $[3] = height;
153
+ $[4] = heightSharedVal;
154
+ $[5] = onDismiss;
155
+ $[6] = title;
156
+ $[7] = translateYSharedVal;
157
+ $[8] = windowHeight;
158
+ $[9] = t1;
159
+ } else {
160
+ t1 = $[9];
161
+ }
162
+ const actionSheetOnDismiss = t1;
94
163
  return actionSheetOnDismiss;
95
164
  }
96
165
 
97
166
  /** @internal */
98
- export function useActionSheetGesture(contentGesture = false) {
167
+ const _worklet_14062660967716_init_data = {
168
+ code: "function overlayTs1(){const{scheduleOnRN,onDismiss}=this.__closure;scheduleOnRN(onDismiss);}",
169
+ location: "/home/runner/work/react-native-template-ui/react-native-template-ui/src/hooks/overlay.ts",
170
+ sourceMap: "{\"version\":3,\"names\":[\"overlayTs1\",\"scheduleOnRN\",\"onDismiss\",\"__closure\"],\"sources\":[\"/home/runner/work/react-native-template-ui/react-native-template-ui/src/hooks/overlay.ts\"],\"mappings\":\"AAsLW,SAAAA,WAAA,QAAAC,YAAA,CAAAC,SAAA,OAAAC,SAAA,CACLF,YAAY,CAACC,SAAS,CAAC\",\"ignoreList\":[]}"
171
+ };
172
+ const _worklet_6867469910819_init_data = {
173
+ code: "function overlayTs2(t2){const{contentGesture,contentOffsetSharedVal,expandable,heightSharedVal,translateYSharedVal}=this.__closure;var _contentOffsetSharedV;const{changeY:changeY}=t2;if(!contentGesture||!((_contentOffsetSharedV=contentOffsetSharedVal)!==null&&_contentOffsetSharedV!==void 0&&_contentOffsetSharedV.get())){if(expandable){var _heightSharedVal;(_heightSharedVal=heightSharedVal)===null||_heightSharedVal===void 0||_heightSharedVal.set(heightSharedVal.get()-changeY);}else{var _translateYSharedVal;(_translateYSharedVal=translateYSharedVal)===null||_translateYSharedVal===void 0||_translateYSharedVal.set(Math.max(translateYSharedVal.get()+changeY,0));}}}",
174
+ location: "/home/runner/work/react-native-template-ui/react-native-template-ui/src/hooks/overlay.ts",
175
+ sourceMap: "{\"version\":3,\"names\":[\"overlayTs2\",\"t2\",\"contentGesture\",\"contentOffsetSharedVal\",\"expandable\",\"heightSharedVal\",\"translateYSharedVal\",\"__closure\",\"_contentOffsetSharedV\",\"changeY\",\"get\",\"_heightSharedVal\",\"set\",\"_translateYSharedVal\",\"Math\",\"max\"],\"sources\":[\"/home/runner/work/react-native-template-ui/react-native-template-ui/src/hooks/overlay.ts\"],\"mappings\":\"AA2Kc,SAAAA,WAAAC,EAAA,QAAAC,cAAA,CAAAC,sBAAA,CAAAC,UAAA,CAAAC,eAAA,CAAAC,mBAAA,OAAAC,SAAA,KAAAC,qBAAA,CAAC,MAAAC,OAAA,CAAAA,OAAA,EAAAR,EAAW,CACpB,GAAI,CAACC,cAAgD,EAAjD,GAAAM,qBAAA,CAAoBL,sBAAsB,UAAAK,qBAAA,WAAtBA,qBAAA,CAAsBE,GAAO,CAAD,CAAC,GACnD,GAAIN,UAAU,MAAAO,gBAAA,CACZ,CAAAA,gBAAA,CAAAN,eAAe,UAAAM,gBAAA,WAAfA,gBAAA,CAAeC,GAAsC,CAAhCP,eAAe,CAAAK,GAAI,CAAC,CAAC,CAAGD,OAAO,CAAC,WAAAI,oBAAA,CAErD,CAAAA,oBAAA,CAAAP,mBAAmB,UAAAO,oBAAA,WAAnBA,oBAAA,CAAmBD,GAElB,CADCE,IAAI,CAAAC,GAAI,CAACT,mBAAmB,CAAAI,GAAK,CAAC,CAAC,CAAGD,OAAO,CAAE,CAAC,CAClD,CAAC,EACF,CACF\",\"ignoreList\":[]}"
176
+ };
177
+ export function useActionSheetGesture(t0) {
178
+ const $ = _c(5);
179
+ const contentGesture = t0 === undefined ? false : t0;
99
180
  const onDismiss = useActionSheetOnDismiss(false);
100
- const {
101
- expandable,
102
- translateYSharedVal,
103
- heightSharedVal,
104
- contentOffsetSharedVal
105
- } = getActionSheetContext();
106
- const actionSheetGesture = Gesture.Pan().onChange(({
107
- changeY
108
- }) => {
109
- if (!contentGesture || !contentOffsetSharedVal?.get()) {
110
- if (expandable) {
111
- heightSharedVal?.set(heightSharedVal.get() - changeY);
112
- } else {
113
- translateYSharedVal?.set(Math.max(translateYSharedVal.get() + changeY, 0));
114
- }
181
+ let t1;
182
+ if ($[0] !== contentGesture || $[1] !== onDismiss) {
183
+ const {
184
+ expandable,
185
+ translateYSharedVal,
186
+ heightSharedVal,
187
+ contentOffsetSharedVal
188
+ } = getActionSheetContext();
189
+ let t3;
190
+ if ($[3] !== onDismiss) {
191
+ t3 = function overlayTs1Factory({
192
+ _worklet_14062660967716_init_data,
193
+ scheduleOnRN,
194
+ onDismiss
195
+ }) {
196
+ const _e = [new global.Error(), -3, -27];
197
+ const overlayTs1 = function () {
198
+ scheduleOnRN(onDismiss);
199
+ };
200
+ overlayTs1.__closure = {
201
+ scheduleOnRN,
202
+ onDismiss
203
+ };
204
+ overlayTs1.__workletHash = 14062660967716;
205
+ overlayTs1.__pluginVersion = "0.8.3";
206
+ overlayTs1.__initData = _worklet_14062660967716_init_data;
207
+ overlayTs1.__stackDetails = _e;
208
+ return overlayTs1;
209
+ }({
210
+ _worklet_14062660967716_init_data,
211
+ scheduleOnRN,
212
+ onDismiss
213
+ });
214
+ $[3] = onDismiss;
215
+ $[4] = t3;
216
+ } else {
217
+ t3 = $[4];
115
218
  }
116
- }).onEnd(() => {
117
- scheduleOnRN(onDismiss);
118
- });
219
+ t1 = Gesture.Pan().onChange(function overlayTs2Factory({
220
+ _worklet_6867469910819_init_data,
221
+ contentGesture,
222
+ contentOffsetSharedVal,
223
+ expandable,
224
+ heightSharedVal,
225
+ translateYSharedVal
226
+ }) {
227
+ const _e = [new global.Error(), -6, -27];
228
+ const overlayTs2 = function (t2) {
229
+ const {
230
+ changeY
231
+ } = t2;
232
+ if (!contentGesture || !contentOffsetSharedVal?.get()) {
233
+ if (expandable) {
234
+ heightSharedVal?.set(heightSharedVal.get() - changeY);
235
+ } else {
236
+ translateYSharedVal?.set(Math.max(translateYSharedVal.get() + changeY, 0));
237
+ }
238
+ }
239
+ };
240
+ overlayTs2.__closure = {
241
+ contentGesture,
242
+ contentOffsetSharedVal,
243
+ expandable,
244
+ heightSharedVal,
245
+ translateYSharedVal
246
+ };
247
+ overlayTs2.__workletHash = 6867469910819;
248
+ overlayTs2.__pluginVersion = "0.8.3";
249
+ overlayTs2.__initData = _worklet_6867469910819_init_data;
250
+ overlayTs2.__stackDetails = _e;
251
+ return overlayTs2;
252
+ }({
253
+ _worklet_6867469910819_init_data,
254
+ contentGesture,
255
+ contentOffsetSharedVal,
256
+ expandable,
257
+ heightSharedVal,
258
+ translateYSharedVal
259
+ })).onEnd(t3);
260
+ $[0] = contentGesture;
261
+ $[1] = onDismiss;
262
+ $[2] = t1;
263
+ } else {
264
+ t1 = $[2];
265
+ }
266
+ const actionSheetGesture = t1;
119
267
  return actionSheetGesture;
120
268
  }
121
269
 
@@ -128,12 +276,21 @@ export function useActionSheetHeaderMinHeight() {
128
276
 
129
277
  /** @internal */
130
278
  export function useActionSheetContentGesture() {
279
+ const $ = _c(2);
131
280
  const gesture = useActionSheetGesture(true);
132
- const scrollGesture = Gesture.Native().shouldActivateOnStart(true);
133
- const {
134
- contentOffsetSharedVal
135
- } = getActionSheetContext();
136
- const actionSheetContentGesture = Gesture.Simultaneous(scrollGesture, gesture.activeOffsetY(contentOffsetSharedVal?.get() ?? 0));
281
+ let t0;
282
+ if ($[0] !== gesture) {
283
+ const scrollGesture = Gesture.Native().shouldActivateOnStart(true);
284
+ const {
285
+ contentOffsetSharedVal
286
+ } = getActionSheetContext();
287
+ t0 = Gesture.Simultaneous(scrollGesture, gesture.activeOffsetY(contentOffsetSharedVal?.get() ?? 0));
288
+ $[0] = gesture;
289
+ $[1] = t0;
290
+ } else {
291
+ t0 = $[1];
292
+ }
293
+ const actionSheetContentGesture = t0;
137
294
  return actionSheetContentGesture;
138
295
  }
139
296
  export function useActionSheetListViewAnimatedRef() {
@@ -145,40 +302,85 @@ export function useActionSheetScrollViewAnimatedRef() {
145
302
 
146
303
  /** @interal */
147
304
  export function useActionSheetListViewRefAndOffset(refObj) {
305
+ const $ = _c(3);
148
306
  const listViewListAnimatedRefObj = useActionSheetListViewAnimatedRef();
149
307
  const contentOffsetSharedVal = useScrollOffset(refObj ?? listViewListAnimatedRefObj);
150
- const actionSheetListViewAnimatedRef = {
151
- listViewListAnimatedRefObj: refObj ?? listViewListAnimatedRefObj,
152
- contentOffsetSharedVal
153
- };
308
+ const t0 = refObj ?? listViewListAnimatedRefObj;
309
+ let t1;
310
+ if ($[0] !== contentOffsetSharedVal || $[1] !== t0) {
311
+ t1 = {
312
+ listViewListAnimatedRefObj: t0,
313
+ contentOffsetSharedVal
314
+ };
315
+ $[0] = contentOffsetSharedVal;
316
+ $[1] = t0;
317
+ $[2] = t1;
318
+ } else {
319
+ t1 = $[2];
320
+ }
321
+ const actionSheetListViewAnimatedRef = t1;
154
322
  return actionSheetListViewAnimatedRef;
155
323
  }
156
324
 
157
325
  /** @interal */
158
326
  export function useActionSheetScrollViewRefAndOffset(refObj) {
327
+ const $ = _c(3);
159
328
  const scrollViewAnimatedRefObj = useActionSheetScrollViewAnimatedRef();
160
329
  const contentOffsetSharedVal = useScrollOffset(refObj ?? scrollViewAnimatedRefObj);
161
- const actionSheetScrollViewAnimatedRef = {
162
- scrollViewAnimatedRefObj: refObj ?? scrollViewAnimatedRefObj,
163
- contentOffsetSharedVal
164
- };
330
+ const t0 = refObj ?? scrollViewAnimatedRefObj;
331
+ let t1;
332
+ if ($[0] !== contentOffsetSharedVal || $[1] !== t0) {
333
+ t1 = {
334
+ scrollViewAnimatedRefObj: t0,
335
+ contentOffsetSharedVal
336
+ };
337
+ $[0] = contentOffsetSharedVal;
338
+ $[1] = t0;
339
+ $[2] = t1;
340
+ } else {
341
+ t1 = $[2];
342
+ }
343
+ const actionSheetScrollViewAnimatedRef = t1;
165
344
  return actionSheetScrollViewAnimatedRef;
166
345
  }
167
346
 
168
347
  /** @internal */
169
- export function useActionSheetVisible(visible = true) {
348
+ export function useActionSheetVisible(t0) {
349
+ const $ = _c(5);
350
+ const visible = t0 === undefined ? true : t0;
170
351
  const [actionSheetVisible, setActionSheetVisible] = useState(visible);
171
- useLayoutEffect(() => {
172
- setActionSheetVisible(visible);
173
- }, [visible]);
174
- return {
175
- actionSheetVisible,
176
- setActionSheetVisible
177
- };
352
+ let t1;
353
+ let t2;
354
+ if ($[0] !== visible) {
355
+ t1 = () => {
356
+ setActionSheetVisible(visible);
357
+ };
358
+ t2 = [visible];
359
+ $[0] = visible;
360
+ $[1] = t1;
361
+ $[2] = t2;
362
+ } else {
363
+ t1 = $[1];
364
+ t2 = $[2];
365
+ }
366
+ useLayoutEffect(t1, t2);
367
+ let t3;
368
+ if ($[3] !== actionSheetVisible) {
369
+ t3 = {
370
+ actionSheetVisible,
371
+ setActionSheetVisible
372
+ };
373
+ $[3] = actionSheetVisible;
374
+ $[4] = t3;
375
+ } else {
376
+ t3 = $[4];
377
+ }
378
+ return t3;
178
379
  }
179
380
 
180
381
  /** @internal */
181
382
  export function useActionSheetOpts(title, expandable, options, optionListProps, onDismiss, dismissable, actionSheetVisible) {
383
+ const $ = _c(21);
182
384
  const {
183
385
  headerViewRef,
184
386
  height,
@@ -195,50 +397,85 @@ export function useActionSheetOpts(title, expandable, options, optionListProps,
195
397
  itemSize,
196
398
  insetsStyle
197
399
  } = useActionSheetOptItemSize(optionListProps);
198
- useLayoutEffect(() => {
199
- if (!actionSheetVisible) {
200
- return;
201
- }
202
- headerViewRef.current?.measureInWindow((_x, _y, _width, headerHeight) => {
203
- const contentHeight = options.length * itemSize + (insetsStyle.paddingBottom ?? 0);
204
- updateHeight(headerHeight + contentHeight);
205
- });
206
- }, [actionSheetVisible]);
207
- const actionSheetContextVal = {
208
- title,
209
- expandable,
210
- onDismiss,
211
- dismissable,
212
- headerViewRef,
213
- contentAnimatedRefObj: listViewListAnimatedRefObj,
214
- height,
215
- translateYSharedVal,
216
- heightSharedVal,
217
- expandableHeightSharedVal,
218
- contentOffsetSharedVal
219
- };
400
+ let t0;
401
+ if ($[0] !== actionSheetVisible || $[1] !== headerViewRef || $[2] !== insetsStyle || $[3] !== itemSize || $[4] !== options || $[5] !== updateHeight) {
402
+ t0 = () => {
403
+ if (!actionSheetVisible) {
404
+ return;
405
+ }
406
+ headerViewRef.current?.measureInWindow((_x, _y, _width, headerHeight) => {
407
+ const contentHeight = options.length * itemSize + (insetsStyle.paddingBottom ?? 0);
408
+ updateHeight(headerHeight + contentHeight);
409
+ });
410
+ };
411
+ $[0] = actionSheetVisible;
412
+ $[1] = headerViewRef;
413
+ $[2] = insetsStyle;
414
+ $[3] = itemSize;
415
+ $[4] = options;
416
+ $[5] = updateHeight;
417
+ $[6] = t0;
418
+ } else {
419
+ t0 = $[6];
420
+ }
421
+ let t1;
422
+ if ($[7] !== actionSheetVisible) {
423
+ t1 = [actionSheetVisible];
424
+ $[7] = actionSheetVisible;
425
+ $[8] = t1;
426
+ } else {
427
+ t1 = $[8];
428
+ }
429
+ useLayoutEffect(t0, t1);
430
+ let t2;
431
+ if ($[9] !== contentOffsetSharedVal || $[10] !== dismissable || $[11] !== expandable || $[12] !== expandableHeightSharedVal || $[13] !== headerViewRef || $[14] !== height || $[15] !== heightSharedVal || $[16] !== listViewListAnimatedRefObj || $[17] !== onDismiss || $[18] !== title || $[19] !== translateYSharedVal) {
432
+ t2 = {
433
+ title,
434
+ expandable,
435
+ onDismiss,
436
+ dismissable,
437
+ headerViewRef,
438
+ contentAnimatedRefObj: listViewListAnimatedRefObj,
439
+ height,
440
+ translateYSharedVal,
441
+ heightSharedVal,
442
+ expandableHeightSharedVal,
443
+ contentOffsetSharedVal
444
+ };
445
+ $[9] = contentOffsetSharedVal;
446
+ $[10] = dismissable;
447
+ $[11] = expandable;
448
+ $[12] = expandableHeightSharedVal;
449
+ $[13] = headerViewRef;
450
+ $[14] = height;
451
+ $[15] = heightSharedVal;
452
+ $[16] = listViewListAnimatedRefObj;
453
+ $[17] = onDismiss;
454
+ $[18] = title;
455
+ $[19] = translateYSharedVal;
456
+ $[20] = t2;
457
+ } else {
458
+ t2 = $[20];
459
+ }
460
+ const actionSheetContextVal = t2;
220
461
  return actionSheetContextVal;
221
462
  }
222
463
 
223
464
  /** @internal */
224
- export function useActionSheetOptItemSize({
225
- insets,
226
- insetTop,
227
- insetBottom,
228
- insetLeft,
229
- insetRight,
230
- insetsPadding,
231
- insetPaddingTop,
232
- insetPaddingBottom,
233
- insetPaddingLeft,
234
- insetPaddingRight
235
- } = {
236
- insetBottom: true,
237
- insetPaddingBottom: 'm'
238
- }) {
239
- const themeSpacing = useThemeSpacing();
240
- const themeTextVariants = useThemeTextVariants();
241
- const insetsStyle = useInsetsStyle({
465
+ export function useActionSheetOptItemSize(t0) {
466
+ const $ = _c(16);
467
+ let t1;
468
+ if ($[0] !== t0) {
469
+ t1 = t0 === undefined ? {
470
+ insetBottom: true,
471
+ insetPaddingBottom: "m"
472
+ } : t0;
473
+ $[0] = t0;
474
+ $[1] = t1;
475
+ } else {
476
+ t1 = $[1];
477
+ }
478
+ const {
242
479
  insets,
243
480
  insetTop,
244
481
  insetBottom,
@@ -249,16 +486,58 @@ export function useActionSheetOptItemSize({
249
486
  insetPaddingBottom,
250
487
  insetPaddingLeft,
251
488
  insetPaddingRight
252
- });
253
- const actionSheetOptionItemSize = {
254
- itemSize: themeSpacing[actionSheetOptionListItemPadding] * 2 + themeTextVariants[actionSheetOptionListItemTextVariant].lineHeight,
255
- insetsStyle
256
- };
489
+ } = t1;
490
+ const themeSpacing = useThemeSpacing();
491
+ const themeTextVariants = useThemeTextVariants();
492
+ let t2;
493
+ if ($[2] !== insetBottom || $[3] !== insetLeft || $[4] !== insetPaddingBottom || $[5] !== insetPaddingLeft || $[6] !== insetPaddingRight || $[7] !== insetPaddingTop || $[8] !== insetRight || $[9] !== insetTop || $[10] !== insets || $[11] !== insetsPadding) {
494
+ t2 = {
495
+ insets,
496
+ insetTop,
497
+ insetBottom,
498
+ insetLeft,
499
+ insetRight,
500
+ insetsPadding,
501
+ insetPaddingTop,
502
+ insetPaddingBottom,
503
+ insetPaddingLeft,
504
+ insetPaddingRight
505
+ };
506
+ $[2] = insetBottom;
507
+ $[3] = insetLeft;
508
+ $[4] = insetPaddingBottom;
509
+ $[5] = insetPaddingLeft;
510
+ $[6] = insetPaddingRight;
511
+ $[7] = insetPaddingTop;
512
+ $[8] = insetRight;
513
+ $[9] = insetTop;
514
+ $[10] = insets;
515
+ $[11] = insetsPadding;
516
+ $[12] = t2;
517
+ } else {
518
+ t2 = $[12];
519
+ }
520
+ const insetsStyle = useInsetsStyle(t2);
521
+ const t3 = themeSpacing[actionSheetOptionListItemPadding] * 2 + themeTextVariants[actionSheetOptionListItemTextVariant].lineHeight;
522
+ let t4;
523
+ if ($[13] !== insetsStyle || $[14] !== t3) {
524
+ t4 = {
525
+ itemSize: t3,
526
+ insetsStyle
527
+ };
528
+ $[13] = insetsStyle;
529
+ $[14] = t3;
530
+ $[15] = t4;
531
+ } else {
532
+ t4 = $[15];
533
+ }
534
+ const actionSheetOptionItemSize = t4;
257
535
  return actionSheetOptionItemSize;
258
536
  }
259
537
 
260
538
  /** @internal */
261
539
  export function useActionSheetScrollView(title, expandable, scrollViewProps, onDismiss, dismissable, actionSheetVisible) {
540
+ const $ = _c(24);
262
541
  const {
263
542
  headerViewRef,
264
543
  height,
@@ -273,38 +552,93 @@ export function useActionSheetScrollView(title, expandable, scrollViewProps, onD
273
552
  } = useActionSheetScrollViewRefAndOffset(scrollViewProps?.ref);
274
553
  const [headerHeight, setHeaderHeight] = useState(0);
275
554
  const [contentHeight, setContentHeight] = useState(0);
276
- useLayoutEffect(() => {
277
- if (!actionSheetVisible) {
278
- return;
279
- }
280
- headerViewRef.current?.measureInWindow((_x, _y, _width, headerViewHeight) => {
281
- setHeaderHeight(headerViewHeight);
282
- });
283
- }, [actionSheetVisible]);
284
- useEffect(() => {
285
- if (headerHeight && contentHeight) {
286
- updateHeight(headerHeight + contentHeight);
287
- }
288
- }, [headerHeight, contentHeight]);
289
- const actionSheetContextVal = {
290
- title,
291
- expandable,
292
- onDismiss,
293
- dismissable,
294
- headerViewRef,
295
- contentAnimatedRefObj: scrollViewAnimatedRefObj,
296
- height,
297
- setContentHeight,
298
- translateYSharedVal,
299
- heightSharedVal,
300
- expandableHeightSharedVal,
301
- contentOffsetSharedVal
302
- };
555
+ let t0;
556
+ if ($[0] !== actionSheetVisible || $[1] !== headerViewRef) {
557
+ t0 = () => {
558
+ if (!actionSheetVisible) {
559
+ return;
560
+ }
561
+ headerViewRef.current?.measureInWindow((_x, _y, _width, headerViewHeight) => {
562
+ setHeaderHeight(headerViewHeight);
563
+ });
564
+ };
565
+ $[0] = actionSheetVisible;
566
+ $[1] = headerViewRef;
567
+ $[2] = t0;
568
+ } else {
569
+ t0 = $[2];
570
+ }
571
+ let t1;
572
+ if ($[3] !== actionSheetVisible) {
573
+ t1 = [actionSheetVisible];
574
+ $[3] = actionSheetVisible;
575
+ $[4] = t1;
576
+ } else {
577
+ t1 = $[4];
578
+ }
579
+ useLayoutEffect(t0, t1);
580
+ let t2;
581
+ if ($[5] !== contentHeight || $[6] !== headerHeight || $[7] !== updateHeight) {
582
+ t2 = () => {
583
+ if (headerHeight && contentHeight) {
584
+ updateHeight(headerHeight + contentHeight);
585
+ }
586
+ };
587
+ $[5] = contentHeight;
588
+ $[6] = headerHeight;
589
+ $[7] = updateHeight;
590
+ $[8] = t2;
591
+ } else {
592
+ t2 = $[8];
593
+ }
594
+ let t3;
595
+ if ($[9] !== contentHeight || $[10] !== headerHeight) {
596
+ t3 = [headerHeight, contentHeight];
597
+ $[9] = contentHeight;
598
+ $[10] = headerHeight;
599
+ $[11] = t3;
600
+ } else {
601
+ t3 = $[11];
602
+ }
603
+ useEffect(t2, t3);
604
+ let t4;
605
+ if ($[12] !== contentOffsetSharedVal || $[13] !== dismissable || $[14] !== expandable || $[15] !== expandableHeightSharedVal || $[16] !== headerViewRef || $[17] !== height || $[18] !== heightSharedVal || $[19] !== onDismiss || $[20] !== scrollViewAnimatedRefObj || $[21] !== title || $[22] !== translateYSharedVal) {
606
+ t4 = {
607
+ title,
608
+ expandable,
609
+ onDismiss,
610
+ dismissable,
611
+ headerViewRef,
612
+ contentAnimatedRefObj: scrollViewAnimatedRefObj,
613
+ height,
614
+ setContentHeight,
615
+ translateYSharedVal,
616
+ heightSharedVal,
617
+ expandableHeightSharedVal,
618
+ contentOffsetSharedVal
619
+ };
620
+ $[12] = contentOffsetSharedVal;
621
+ $[13] = dismissable;
622
+ $[14] = expandable;
623
+ $[15] = expandableHeightSharedVal;
624
+ $[16] = headerViewRef;
625
+ $[17] = height;
626
+ $[18] = heightSharedVal;
627
+ $[19] = onDismiss;
628
+ $[20] = scrollViewAnimatedRefObj;
629
+ $[21] = title;
630
+ $[22] = translateYSharedVal;
631
+ $[23] = t4;
632
+ } else {
633
+ t4 = $[23];
634
+ }
635
+ const actionSheetContextVal = t4;
303
636
  return actionSheetContextVal;
304
637
  }
305
638
 
306
639
  /** @internal */
307
640
  export function useActionSheetListView(title, expandable, listProps, onDismiss, dismissable, actionSheetVisible) {
641
+ const $ = _c(24);
308
642
  const {
309
643
  headerViewRef,
310
644
  height,
@@ -319,33 +653,87 @@ export function useActionSheetListView(title, expandable, listProps, onDismiss,
319
653
  } = useActionSheetListViewRefAndOffset(listProps?.ref);
320
654
  const [headerHeight, setHeaderHeight] = useState(0);
321
655
  const [contentHeight, setContentHeight] = useState(0);
322
- useLayoutEffect(() => {
323
- if (!actionSheetVisible) {
324
- return;
325
- }
326
- headerViewRef.current?.measureInWindow((_x, _y, _width, headerViewHeight) => {
327
- setHeaderHeight(headerViewHeight);
328
- });
329
- }, [actionSheetVisible]);
330
- useEffect(() => {
331
- if (headerHeight && contentHeight) {
332
- updateHeight(headerHeight + contentHeight);
333
- }
334
- }, [headerHeight, contentHeight]);
335
- const actionSheetContextVal = {
336
- title,
337
- expandable,
338
- onDismiss,
339
- dismissable,
340
- headerViewRef,
341
- contentAnimatedRefObj: listViewListAnimatedRefObj,
342
- height,
343
- setContentHeight,
344
- translateYSharedVal,
345
- heightSharedVal,
346
- expandableHeightSharedVal,
347
- contentOffsetSharedVal
348
- };
656
+ let t0;
657
+ if ($[0] !== actionSheetVisible || $[1] !== headerViewRef) {
658
+ t0 = () => {
659
+ if (!actionSheetVisible) {
660
+ return;
661
+ }
662
+ headerViewRef.current?.measureInWindow((_x, _y, _width, headerViewHeight) => {
663
+ setHeaderHeight(headerViewHeight);
664
+ });
665
+ };
666
+ $[0] = actionSheetVisible;
667
+ $[1] = headerViewRef;
668
+ $[2] = t0;
669
+ } else {
670
+ t0 = $[2];
671
+ }
672
+ let t1;
673
+ if ($[3] !== actionSheetVisible) {
674
+ t1 = [actionSheetVisible];
675
+ $[3] = actionSheetVisible;
676
+ $[4] = t1;
677
+ } else {
678
+ t1 = $[4];
679
+ }
680
+ useLayoutEffect(t0, t1);
681
+ let t2;
682
+ if ($[5] !== contentHeight || $[6] !== headerHeight || $[7] !== updateHeight) {
683
+ t2 = () => {
684
+ if (headerHeight && contentHeight) {
685
+ updateHeight(headerHeight + contentHeight);
686
+ }
687
+ };
688
+ $[5] = contentHeight;
689
+ $[6] = headerHeight;
690
+ $[7] = updateHeight;
691
+ $[8] = t2;
692
+ } else {
693
+ t2 = $[8];
694
+ }
695
+ let t3;
696
+ if ($[9] !== contentHeight || $[10] !== headerHeight) {
697
+ t3 = [headerHeight, contentHeight];
698
+ $[9] = contentHeight;
699
+ $[10] = headerHeight;
700
+ $[11] = t3;
701
+ } else {
702
+ t3 = $[11];
703
+ }
704
+ useEffect(t2, t3);
705
+ let t4;
706
+ if ($[12] !== contentOffsetSharedVal || $[13] !== dismissable || $[14] !== expandable || $[15] !== expandableHeightSharedVal || $[16] !== headerViewRef || $[17] !== height || $[18] !== heightSharedVal || $[19] !== listViewListAnimatedRefObj || $[20] !== onDismiss || $[21] !== title || $[22] !== translateYSharedVal) {
707
+ t4 = {
708
+ title,
709
+ expandable,
710
+ onDismiss,
711
+ dismissable,
712
+ headerViewRef,
713
+ contentAnimatedRefObj: listViewListAnimatedRefObj,
714
+ height,
715
+ setContentHeight,
716
+ translateYSharedVal,
717
+ heightSharedVal,
718
+ expandableHeightSharedVal,
719
+ contentOffsetSharedVal
720
+ };
721
+ $[12] = contentOffsetSharedVal;
722
+ $[13] = dismissable;
723
+ $[14] = expandable;
724
+ $[15] = expandableHeightSharedVal;
725
+ $[16] = headerViewRef;
726
+ $[17] = height;
727
+ $[18] = heightSharedVal;
728
+ $[19] = listViewListAnimatedRefObj;
729
+ $[20] = onDismiss;
730
+ $[21] = title;
731
+ $[22] = translateYSharedVal;
732
+ $[23] = t4;
733
+ } else {
734
+ t4 = $[23];
735
+ }
736
+ const actionSheetContextVal = t4;
349
737
  return actionSheetContextVal;
350
738
  }
351
739
  //# sourceMappingURL=overlay.js.map