@xaui/native 0.9.1-alpha.92 → 0.9.1-alpha.93
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.
- package/dist/{chunk-KPKEZWZM.js → chunk-2SHWOFQV.js} +188 -210
- package/dist/chunk-OPLPLFGK.cjs +493 -0
- package/dist/components/pager/index.cjs +4 -2
- package/dist/components/pager/index.d.cts +2 -2
- package/dist/components/pager/index.d.ts +2 -2
- package/dist/components/pager/index.js +3 -1
- package/dist/components/pager/pager.d.cts +3 -4
- package/dist/components/pager/pager.d.ts +3 -4
- package/dist/components/pager/pager.recipe.d.cts +19 -1
- package/dist/components/pager/pager.recipe.d.ts +19 -1
- package/dist/components/pager/pager.type.d.cts +5 -6
- package/dist/components/pager/pager.type.d.ts +5 -6
- package/dist/index.cjs +4 -2
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/dist/chunk-UR37LVPU.cjs +0 -382
|
@@ -15,10 +15,10 @@ var [PagerProvider, usePager] = createSlotContext("Pager");
|
|
|
15
15
|
|
|
16
16
|
// src/components/pager/pager-content.tsx
|
|
17
17
|
import { jsx } from "react/jsx-runtime";
|
|
18
|
-
const
|
|
19
|
-
code: "function
|
|
20
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-
|
|
21
|
-
sourceMap: "{\"version\":3,\"names\":[\"
|
|
18
|
+
const _worklet_10605200666301_init_data = {
|
|
19
|
+
code: "function chunk2SHWOFQVJs1(event){const{isHorizontal,offset,indexFromOffset,step,count,settled,runOnJS,onSettle}=this.__closure;const travelled=isHorizontal?event.contentOffset.x:event.contentOffset.y;offset.set(travelled);const next=indexFromOffset(travelled,step,count);if(next!==settled.get()){settled.set(next);runOnJS(onSettle)(next);}}",
|
|
20
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-2SHWOFQV.js",
|
|
21
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunk2SHWOFQVJs1\",\"event\",\"isHorizontal\",\"offset\",\"indexFromOffset\",\"step\",\"count\",\"settled\",\"runOnJS\",\"onSettle\",\"__closure\",\"travelled\",\"contentOffset\",\"x\",\"y\",\"set\",\"next\",\"get\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-2SHWOFQV.js\"],\"mappings\":\"AAiE6C,SAAAA,gBAAUA,CAAAC,KAAA,QAAAC,YAAA,CAAAC,MAAA,CAAAC,eAAA,CAAAC,IAAA,CAAAC,KAAA,CAAAC,OAAA,CAAAC,OAAA,CAAAC,QAAA,OAAAC,SAAA,CACjD,KAAM,CAAAC,SAAS,CAAGT,YAAY,CAAGD,KAAK,CAACW,aAAa,CAACC,CAAC,CAAGZ,KAAK,CAACW,aAAa,CAACE,CAAC,CAC9EX,MAAM,CAACY,GAAG,CAACJ,SAAS,CAAC,CACrB,KAAM,CAAAK,IAAI,CAAGZ,eAAe,CAACO,SAAS,CAAEN,IAAI,CAAEC,KAAK,CAAC,CACpD,GAAIU,IAAI,GAAKT,OAAO,CAACU,GAAG,CAAC,CAAC,CAAE,CAC1BV,OAAO,CAACQ,GAAG,CAACC,IAAI,CAAC,CACjBR,OAAO,CAACC,QAAQ,CAAC,CAACO,IAAI,CAAC,CACzB,CACF\",\"ignoreList\":[]}"
|
|
22
22
|
};
|
|
23
23
|
var PagerContent = forwardRef(function PagerContent2({
|
|
24
24
|
children,
|
|
@@ -58,8 +58,8 @@ var PagerContent = forwardRef(function PagerContent2({
|
|
|
58
58
|
};
|
|
59
59
|
const settled = useSharedValue(0);
|
|
60
60
|
const isHorizontal = orientation === "horizontal";
|
|
61
|
-
const scroll = useAnimatedScrollHandler(function
|
|
62
|
-
|
|
61
|
+
const scroll = useAnimatedScrollHandler(function chunk2SHWOFQVJs1Factory({
|
|
62
|
+
_worklet_10605200666301_init_data,
|
|
63
63
|
isHorizontal,
|
|
64
64
|
offset,
|
|
65
65
|
indexFromOffset,
|
|
@@ -70,7 +70,7 @@ var PagerContent = forwardRef(function PagerContent2({
|
|
|
70
70
|
onSettle
|
|
71
71
|
}) {
|
|
72
72
|
const _e = [new global.Error(), -9, -27];
|
|
73
|
-
const
|
|
73
|
+
const chunk2SHWOFQVJs1 = function (event) {
|
|
74
74
|
const travelled = isHorizontal ? event.contentOffset.x : event.contentOffset.y;
|
|
75
75
|
offset.set(travelled);
|
|
76
76
|
const next = indexFromOffset(travelled, step, count);
|
|
@@ -79,7 +79,7 @@ var PagerContent = forwardRef(function PagerContent2({
|
|
|
79
79
|
runOnJS(onSettle)(next);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
chunk2SHWOFQVJs1.__closure = {
|
|
83
83
|
isHorizontal,
|
|
84
84
|
offset,
|
|
85
85
|
indexFromOffset,
|
|
@@ -89,13 +89,13 @@ var PagerContent = forwardRef(function PagerContent2({
|
|
|
89
89
|
runOnJS,
|
|
90
90
|
onSettle
|
|
91
91
|
};
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return
|
|
92
|
+
chunk2SHWOFQVJs1.__workletHash = 10605200666301;
|
|
93
|
+
chunk2SHWOFQVJs1.__pluginVersion = "0.7.4";
|
|
94
|
+
chunk2SHWOFQVJs1.__initData = _worklet_10605200666301_init_data;
|
|
95
|
+
chunk2SHWOFQVJs1.__stackDetails = _e;
|
|
96
|
+
return chunk2SHWOFQVJs1;
|
|
97
97
|
}({
|
|
98
|
-
|
|
98
|
+
_worklet_10605200666301_init_data,
|
|
99
99
|
isHorizontal,
|
|
100
100
|
offset,
|
|
101
101
|
indexFromOffset,
|
|
@@ -126,171 +126,26 @@ PagerContent.displayName = "XAUI.Pager.Content";
|
|
|
126
126
|
// src/components/pager/pager-indicator.tsx
|
|
127
127
|
import { forwardRef as forwardRef2 } from "react";
|
|
128
128
|
import { Pressable, View } from "react-native";
|
|
129
|
-
import Animated2, {
|
|
130
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
131
|
-
var HIT_SLOP = 8;
|
|
132
|
-
var AnimatedPressable = Animated2.createAnimatedComponent(Pressable);
|
|
133
|
-
var PagerIndicator = forwardRef2(function PagerIndicator2({
|
|
134
|
-
children,
|
|
135
|
-
style,
|
|
136
|
-
...props
|
|
137
|
-
}, ref) {
|
|
138
|
-
const {
|
|
139
|
-
indicatorStyle,
|
|
140
|
-
count
|
|
141
|
-
} = usePager();
|
|
142
|
-
const [styleProps, rest] = useStyleProps(props);
|
|
143
|
-
return /* @__PURE__ */jsx2(View, {
|
|
144
|
-
ref,
|
|
145
|
-
...rest,
|
|
146
|
-
style: [indicatorStyle, styleProps, style],
|
|
147
|
-
children: children ?? Array.from({
|
|
148
|
-
length: count
|
|
149
|
-
}, (_, index) => /* @__PURE__ */jsx2(PagerDot, {
|
|
150
|
-
index
|
|
151
|
-
}, index))
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
PagerIndicator.displayName = "XAUI.Pager.Indicator";
|
|
155
|
-
const _worklet_3999860474786_init_data = {
|
|
156
|
-
code: "function chunkKPKEZWZMJs2(){const{progressFromOffset,offset,step,count,index,interpolateColor,restColor,active}=this.__closure;const distance=Math.abs(progressFromOffset(offset.get(),step,count)-index);const nearness=Math.max(0,1-distance);return{backgroundColor:interpolateColor(nearness,[0,1],[restColor,active])};}",
|
|
157
|
-
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-KPKEZWZM.js",
|
|
158
|
-
sourceMap: "{\"version\":3,\"names\":[\"chunkKPKEZWZMJs2\",\"progressFromOffset\",\"offset\",\"step\",\"count\",\"index\",\"interpolateColor\",\"restColor\",\"active\",\"__closure\",\"distance\",\"Math\",\"abs\",\"get\",\"nearness\",\"max\",\"backgroundColor\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-KPKEZWZM.js\"],\"mappings\":\"AA+HkC,SAAAA,gBAAMA,CAAA,QAAAC,kBAAA,CAAAC,MAAA,CAAAC,IAAA,CAAAC,KAAA,CAAAC,KAAA,CAAAC,gBAAA,CAAAC,SAAA,CAAAC,MAAA,OAAAC,SAAA,CACpC,KAAM,CAAAC,QAAQ,CAAGC,IAAI,CAACC,GAAG,CAACX,kBAAkB,CAACC,MAAM,CAACW,GAAG,CAAC,CAAC,CAAEV,IAAI,CAAEC,KAAK,CAAC,CAAGC,KAAK,CAAC,CAChF,KAAM,CAAAS,QAAQ,CAAGH,IAAI,CAACI,GAAG,CAAC,CAAC,CAAE,CAAC,CAAGL,QAAQ,CAAC,CAC1C,MAAO,CACLM,eAAe,CAAEV,gBAAgB,CAACQ,QAAQ,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAACP,SAAS,CAAEC,MAAM,CAAC,CACzE,CAAC,CACH\",\"ignoreList\":[]}"
|
|
159
|
-
};
|
|
160
|
-
var PagerDot = forwardRef2(function PagerDot2({
|
|
161
|
-
index,
|
|
162
|
-
children,
|
|
163
|
-
style,
|
|
164
|
-
...props
|
|
165
|
-
}, ref) {
|
|
166
|
-
const {
|
|
167
|
-
dotStyle,
|
|
168
|
-
dotInk,
|
|
169
|
-
offset,
|
|
170
|
-
step,
|
|
171
|
-
count,
|
|
172
|
-
index: current,
|
|
173
|
-
isDisabled,
|
|
174
|
-
goTo
|
|
175
|
-
} = usePager();
|
|
176
|
-
const [styleProps, rest] = useStyleProps(props);
|
|
177
|
-
const {
|
|
178
|
-
rest: restColor,
|
|
179
|
-
active
|
|
180
|
-
} = dotInk;
|
|
181
|
-
const travel = useAnimatedStyle(function chunkKPKEZWZMJs2Factory({
|
|
182
|
-
_worklet_3999860474786_init_data,
|
|
183
|
-
progressFromOffset,
|
|
184
|
-
offset,
|
|
185
|
-
step,
|
|
186
|
-
count,
|
|
187
|
-
index,
|
|
188
|
-
interpolateColor,
|
|
189
|
-
restColor,
|
|
190
|
-
active
|
|
191
|
-
}) {
|
|
192
|
-
const _e = [new global.Error(), -9, -27];
|
|
193
|
-
const chunkKPKEZWZMJs2 = function () {
|
|
194
|
-
const distance = Math.abs(progressFromOffset(offset.get(), step, count) - index);
|
|
195
|
-
const nearness = Math.max(0, 1 - distance);
|
|
196
|
-
return {
|
|
197
|
-
backgroundColor: interpolateColor(nearness, [0, 1], [restColor, active])
|
|
198
|
-
};
|
|
199
|
-
};
|
|
200
|
-
chunkKPKEZWZMJs2.__closure = {
|
|
201
|
-
progressFromOffset,
|
|
202
|
-
offset,
|
|
203
|
-
step,
|
|
204
|
-
count,
|
|
205
|
-
index,
|
|
206
|
-
interpolateColor,
|
|
207
|
-
restColor,
|
|
208
|
-
active
|
|
209
|
-
};
|
|
210
|
-
chunkKPKEZWZMJs2.__workletHash = 3999860474786;
|
|
211
|
-
chunkKPKEZWZMJs2.__pluginVersion = "0.7.4";
|
|
212
|
-
chunkKPKEZWZMJs2.__initData = _worklet_3999860474786_init_data;
|
|
213
|
-
chunkKPKEZWZMJs2.__stackDetails = _e;
|
|
214
|
-
return chunkKPKEZWZMJs2;
|
|
215
|
-
}({
|
|
216
|
-
_worklet_3999860474786_init_data,
|
|
217
|
-
progressFromOffset,
|
|
218
|
-
offset,
|
|
219
|
-
step,
|
|
220
|
-
count,
|
|
221
|
-
index,
|
|
222
|
-
interpolateColor,
|
|
223
|
-
restColor,
|
|
224
|
-
active
|
|
225
|
-
}));
|
|
226
|
-
return /* @__PURE__ */jsx2(AnimatedPressable, {
|
|
227
|
-
ref,
|
|
228
|
-
accessibilityRole: "button",
|
|
229
|
-
accessibilityState: {
|
|
230
|
-
selected: index === current,
|
|
231
|
-
disabled: isDisabled
|
|
232
|
-
},
|
|
233
|
-
accessibilityValue: {
|
|
234
|
-
now: index + 1,
|
|
235
|
-
min: 1,
|
|
236
|
-
max: count
|
|
237
|
-
},
|
|
238
|
-
disabled: isDisabled,
|
|
239
|
-
hitSlop: HIT_SLOP,
|
|
240
|
-
...rest,
|
|
241
|
-
style: [dotStyle, travel, styleProps, style],
|
|
242
|
-
onPress: () => goTo(index),
|
|
243
|
-
children
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
PagerDot.displayName = "XAUI.Pager.Dot";
|
|
247
|
-
|
|
248
|
-
// src/components/pager/pager-page.tsx
|
|
249
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
250
|
-
import { View as View2 } from "react-native";
|
|
251
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
252
|
-
var PagerPage = forwardRef3(function PagerPage2({
|
|
253
|
-
children,
|
|
254
|
-
style,
|
|
255
|
-
...props
|
|
256
|
-
}, ref) {
|
|
257
|
-
const {
|
|
258
|
-
pageStyle,
|
|
259
|
-
track
|
|
260
|
-
} = usePager();
|
|
261
|
-
const [styleProps, rest] = useStyleProps(props);
|
|
262
|
-
return /* @__PURE__ */jsx3(View2, {
|
|
263
|
-
ref,
|
|
264
|
-
...rest,
|
|
265
|
-
style: [pageStyle, {
|
|
266
|
-
width: track.width,
|
|
267
|
-
height: track.height
|
|
268
|
-
}, styleProps, style],
|
|
269
|
-
children
|
|
270
|
-
});
|
|
271
|
-
});
|
|
272
|
-
PagerPage.displayName = "XAUI.Pager.Page";
|
|
273
|
-
|
|
274
|
-
// src/components/pager/pager.tsx
|
|
275
|
-
import { forwardRef as forwardRef4, useCallback, useMemo, useState } from "react";
|
|
276
|
-
import { StyleSheet, View as View3 } from "react-native";
|
|
277
|
-
import { useAnimatedRef, useSharedValue as useSharedValue2 } from "react-native-reanimated";
|
|
129
|
+
import Animated2, { interpolate, useAnimatedStyle } from "react-native-reanimated";
|
|
278
130
|
|
|
279
131
|
// src/components/pager/pager.recipe.ts
|
|
280
|
-
var SLOTS = ["root", "content", "page", "indicator", "dot"
|
|
132
|
+
var SLOTS = ["root", "content", "page", "indicator", "dot"];
|
|
281
133
|
var VARIANT_TOKENS = {
|
|
282
134
|
primary: {
|
|
283
135
|
bgSelected: "accent"
|
|
284
136
|
},
|
|
137
|
+
// The page's own ink, for an indicator that has to read as chrome rather than as accent.
|
|
285
138
|
secondary: {
|
|
286
|
-
bgSelected: "
|
|
139
|
+
bgSelected: "foreground"
|
|
287
140
|
},
|
|
288
|
-
// The raised ground
|
|
289
|
-
//
|
|
141
|
+
// The raised ground — white on a light theme. A pager over a *photograph* wants
|
|
142
|
+
// `color="#ffffff"` instead: a photograph is a photograph in both colour modes, and this
|
|
143
|
+
// token flips with the theme.
|
|
290
144
|
tertiary: {
|
|
291
145
|
bgSelected: "surface"
|
|
292
146
|
}
|
|
293
147
|
};
|
|
148
|
+
var DOT_REST_OPACITY = 0.3;
|
|
294
149
|
var SIZES = {
|
|
295
150
|
xs: {
|
|
296
151
|
dot: 5,
|
|
@@ -334,7 +189,7 @@ function orientationAxis(direction) {
|
|
|
334
189
|
}
|
|
335
190
|
var pagerRecipe = createRecipe({
|
|
336
191
|
slots: SLOTS,
|
|
337
|
-
base:
|
|
192
|
+
base: () => ({
|
|
338
193
|
/**
|
|
339
194
|
* **The root has no size of its own**, and that is deliberate rather than missing.
|
|
340
195
|
*
|
|
@@ -360,24 +215,16 @@ var pagerRecipe = createRecipe({
|
|
|
360
215
|
indicator: {
|
|
361
216
|
alignItems: "center",
|
|
362
217
|
justifyContent: "center"
|
|
363
|
-
},
|
|
364
|
-
/**
|
|
365
|
-
* A neutral fill rather than a faint version of the current one: a pale tint of the
|
|
366
|
-
* accent under the pages reads as a control that has half failed to load. A raw `color`
|
|
367
|
-
* reaches the current dot, which is the one it should move.
|
|
368
|
-
*/
|
|
369
|
-
dot: {
|
|
370
|
-
backgroundColor: theme.colors.default
|
|
371
218
|
}
|
|
372
219
|
}),
|
|
373
220
|
variantTokens: VARIANT_TOKENS,
|
|
374
221
|
/**
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
222
|
+
* Every dot takes the same colour. What separates the current one from the rest is its
|
|
223
|
+
* opacity, animated on the UI thread — so this is a plain style rather than a value the
|
|
224
|
+
* root has to flatten and hand to a worklet.
|
|
378
225
|
*/
|
|
379
226
|
paint: (_theme, colors) => ({
|
|
380
|
-
|
|
227
|
+
dot: {
|
|
381
228
|
backgroundColor: colors.bgSelected
|
|
382
229
|
}
|
|
383
230
|
}),
|
|
@@ -407,7 +254,147 @@ var pagerRecipe = createRecipe({
|
|
|
407
254
|
}
|
|
408
255
|
});
|
|
409
256
|
|
|
257
|
+
// src/components/pager/pager-indicator.tsx
|
|
258
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
259
|
+
var HIT_SLOP = 8;
|
|
260
|
+
var AnimatedPressable = Animated2.createAnimatedComponent(Pressable);
|
|
261
|
+
var PagerIndicator = forwardRef2(function PagerIndicator2({
|
|
262
|
+
children,
|
|
263
|
+
style,
|
|
264
|
+
...props
|
|
265
|
+
}, ref) {
|
|
266
|
+
const {
|
|
267
|
+
indicatorStyle,
|
|
268
|
+
count
|
|
269
|
+
} = usePager();
|
|
270
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
271
|
+
return /* @__PURE__ */jsx2(View, {
|
|
272
|
+
ref,
|
|
273
|
+
...rest,
|
|
274
|
+
style: [indicatorStyle, styleProps, style],
|
|
275
|
+
children: children ?? Array.from({
|
|
276
|
+
length: count
|
|
277
|
+
}, (_, index) => /* @__PURE__ */jsx2(PagerDot, {
|
|
278
|
+
index
|
|
279
|
+
}, index))
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
PagerIndicator.displayName = "XAUI.Pager.Indicator";
|
|
283
|
+
const _worklet_15861153305546_init_data = {
|
|
284
|
+
code: "function chunk2SHWOFQVJs2(){const{progressFromOffset,offset,step,count,index,interpolate,DOT_REST_OPACITY}=this.__closure;const distance=Math.abs(progressFromOffset(offset.get(),step,count)-index);const nearness=Math.max(0,1-distance);return{opacity:interpolate(nearness,[0,1],[DOT_REST_OPACITY,1])};}",
|
|
285
|
+
location: "/home/runner/work/xaui/xaui/packages/native/dist/chunk-2SHWOFQV.js",
|
|
286
|
+
sourceMap: "{\"version\":3,\"names\":[\"chunk2SHWOFQVJs2\",\"progressFromOffset\",\"offset\",\"step\",\"count\",\"index\",\"interpolate\",\"DOT_REST_OPACITY\",\"__closure\",\"distance\",\"Math\",\"abs\",\"get\",\"nearness\",\"max\",\"opacity\"],\"sources\":[\"/home/runner/work/xaui/xaui/packages/native/dist/chunk-2SHWOFQV.js\"],\"mappings\":\"AA4MkC,SAAAA,gBAAMA,CAAA,QAAAC,kBAAA,CAAAC,MAAA,CAAAC,IAAA,CAAAC,KAAA,CAAAC,KAAA,CAAAC,WAAA,CAAAC,gBAAA,OAAAC,SAAA,CAEpC,KAAM,CAAAC,QAAQ,CAAGC,IAAI,CAACC,GAAG,CAACV,kBAAkB,CAACC,MAAM,CAACU,GAAG,CAAC,CAAC,CAAET,IAAI,CAAEC,KAAK,CAAC,CAAGC,KAAK,CAAC,CAChF,KAAM,CAAAQ,QAAQ,CAAGH,IAAI,CAACI,GAAG,CAAC,CAAC,CAAE,CAAC,CAAGL,QAAQ,CAAC,CAC1C,MAAO,CAAEM,OAAO,CAAET,WAAW,CAACO,QAAQ,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAACN,gBAAgB,CAAE,CAAC,CAAC,CAAE,CAAC,CAC1E\",\"ignoreList\":[]}"
|
|
287
|
+
};
|
|
288
|
+
var PagerDot = forwardRef2(function PagerDot2({
|
|
289
|
+
index,
|
|
290
|
+
children,
|
|
291
|
+
style,
|
|
292
|
+
...props
|
|
293
|
+
}, ref) {
|
|
294
|
+
const {
|
|
295
|
+
dotStyle,
|
|
296
|
+
offset,
|
|
297
|
+
step,
|
|
298
|
+
count,
|
|
299
|
+
index: current,
|
|
300
|
+
isDisabled,
|
|
301
|
+
goTo
|
|
302
|
+
} = usePager();
|
|
303
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
304
|
+
const travel = useAnimatedStyle(function chunk2SHWOFQVJs2Factory({
|
|
305
|
+
_worklet_15861153305546_init_data,
|
|
306
|
+
progressFromOffset,
|
|
307
|
+
offset,
|
|
308
|
+
step,
|
|
309
|
+
count,
|
|
310
|
+
index,
|
|
311
|
+
interpolate,
|
|
312
|
+
DOT_REST_OPACITY
|
|
313
|
+
}) {
|
|
314
|
+
const _e = [new global.Error(), -8, -27];
|
|
315
|
+
const chunk2SHWOFQVJs2 = function () {
|
|
316
|
+
const distance = Math.abs(progressFromOffset(offset.get(), step, count) - index);
|
|
317
|
+
const nearness = Math.max(0, 1 - distance);
|
|
318
|
+
return {
|
|
319
|
+
opacity: interpolate(nearness, [0, 1], [DOT_REST_OPACITY, 1])
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
chunk2SHWOFQVJs2.__closure = {
|
|
323
|
+
progressFromOffset,
|
|
324
|
+
offset,
|
|
325
|
+
step,
|
|
326
|
+
count,
|
|
327
|
+
index,
|
|
328
|
+
interpolate,
|
|
329
|
+
DOT_REST_OPACITY
|
|
330
|
+
};
|
|
331
|
+
chunk2SHWOFQVJs2.__workletHash = 15861153305546;
|
|
332
|
+
chunk2SHWOFQVJs2.__pluginVersion = "0.7.4";
|
|
333
|
+
chunk2SHWOFQVJs2.__initData = _worklet_15861153305546_init_data;
|
|
334
|
+
chunk2SHWOFQVJs2.__stackDetails = _e;
|
|
335
|
+
return chunk2SHWOFQVJs2;
|
|
336
|
+
}({
|
|
337
|
+
_worklet_15861153305546_init_data,
|
|
338
|
+
progressFromOffset,
|
|
339
|
+
offset,
|
|
340
|
+
step,
|
|
341
|
+
count,
|
|
342
|
+
index,
|
|
343
|
+
interpolate,
|
|
344
|
+
DOT_REST_OPACITY
|
|
345
|
+
}), [offset, step, count, index]);
|
|
346
|
+
return /* @__PURE__ */jsx2(AnimatedPressable, {
|
|
347
|
+
ref,
|
|
348
|
+
accessibilityRole: "button",
|
|
349
|
+
accessibilityState: {
|
|
350
|
+
selected: index === current,
|
|
351
|
+
disabled: isDisabled
|
|
352
|
+
},
|
|
353
|
+
accessibilityValue: {
|
|
354
|
+
now: index + 1,
|
|
355
|
+
min: 1,
|
|
356
|
+
max: count
|
|
357
|
+
},
|
|
358
|
+
disabled: isDisabled,
|
|
359
|
+
hitSlop: HIT_SLOP,
|
|
360
|
+
...rest,
|
|
361
|
+
style: [dotStyle, travel, styleProps, style],
|
|
362
|
+
onPress: () => goTo(index),
|
|
363
|
+
children
|
|
364
|
+
});
|
|
365
|
+
});
|
|
366
|
+
PagerDot.displayName = "XAUI.Pager.Dot";
|
|
367
|
+
|
|
368
|
+
// src/components/pager/pager-page.tsx
|
|
369
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
370
|
+
import { View as View2 } from "react-native";
|
|
371
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
372
|
+
var PagerPage = forwardRef3(function PagerPage2({
|
|
373
|
+
children,
|
|
374
|
+
style,
|
|
375
|
+
...props
|
|
376
|
+
}, ref) {
|
|
377
|
+
const {
|
|
378
|
+
pageStyle,
|
|
379
|
+
track
|
|
380
|
+
} = usePager();
|
|
381
|
+
const [styleProps, rest] = useStyleProps(props);
|
|
382
|
+
return /* @__PURE__ */jsx3(View2, {
|
|
383
|
+
ref,
|
|
384
|
+
...rest,
|
|
385
|
+
style: [pageStyle, {
|
|
386
|
+
width: track.width,
|
|
387
|
+
height: track.height
|
|
388
|
+
}, styleProps, style],
|
|
389
|
+
children
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
PagerPage.displayName = "XAUI.Pager.Page";
|
|
393
|
+
|
|
410
394
|
// src/components/pager/pager.tsx
|
|
395
|
+
import { forwardRef as forwardRef4, useCallback, useMemo, useState } from "react";
|
|
396
|
+
import { View as View3 } from "react-native";
|
|
397
|
+
import { useAnimatedRef, useSharedValue as useSharedValue2 } from "react-native-reanimated";
|
|
411
398
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
412
399
|
var PagerRoot = forwardRef4(function Pager({
|
|
413
400
|
children,
|
|
@@ -465,35 +452,26 @@ var PagerRoot = forwardRef4(function Pager({
|
|
|
465
452
|
});
|
|
466
453
|
setIndex(next);
|
|
467
454
|
}, [orientation, setIndex, step, trackRef]);
|
|
468
|
-
const context = useMemo(() => {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
setTrack,
|
|
489
|
-
step,
|
|
490
|
-
offset,
|
|
491
|
-
goTo,
|
|
492
|
-
onSettle: setIndex,
|
|
493
|
-
trackRef,
|
|
494
|
-
isDisabled
|
|
495
|
-
};
|
|
496
|
-
}, [styles, tint, theme, orientation, index, count, track, setTrack, step, offset, goTo, setIndex, trackRef, isDisabled]);
|
|
455
|
+
const context = useMemo(() => ({
|
|
456
|
+
contentStyle: styles.content,
|
|
457
|
+
pageStyle: styles.page,
|
|
458
|
+
indicatorStyle: styles.indicator,
|
|
459
|
+
// One colour for every dot; the current one is told apart by its opacity, which the dot
|
|
460
|
+
// animates itself. Nothing here has to be flattened into a value for a worklet.
|
|
461
|
+
dotStyle: tint ? [styles.dot, tint.dot] : styles.dot,
|
|
462
|
+
orientation,
|
|
463
|
+
index,
|
|
464
|
+
count,
|
|
465
|
+
setCount,
|
|
466
|
+
track,
|
|
467
|
+
setTrack,
|
|
468
|
+
step,
|
|
469
|
+
offset,
|
|
470
|
+
goTo,
|
|
471
|
+
onSettle: setIndex,
|
|
472
|
+
trackRef,
|
|
473
|
+
isDisabled
|
|
474
|
+
}), [styles, tint, orientation, index, count, track, setTrack, step, offset, goTo, setIndex, trackRef, isDisabled]);
|
|
497
475
|
const rootStyle = [styles.root, tint?.root, styleProps, style];
|
|
498
476
|
return /* @__PURE__ */jsx4(PagerProvider, {
|
|
499
477
|
value: context,
|
|
@@ -514,4 +492,4 @@ var Pager2 = Object.assign(PagerRoot, {
|
|
|
514
492
|
Indicator: PagerIndicator,
|
|
515
493
|
Dot: PagerDot
|
|
516
494
|
});
|
|
517
|
-
export { usePager, PagerContent, PagerIndicator, PagerDot, PagerPage,
|
|
495
|
+
export { usePager, PagerContent, DOT_REST_OPACITY, pagerRecipe, PagerIndicator, PagerDot, PagerPage, PagerRoot, Pager2 as Pager };
|