@juniorxsound/react-three-components 0.1.1 → 0.1.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.
- package/dist/components/CircularCarousel/CircularCarousel.d.ts +1 -4
- package/dist/components/CircularCarousel/context.d.ts +4 -3
- package/dist/components/CircularCarousel/types.d.ts +2 -23
- package/dist/components/CircularCarousel/utils.d.ts +0 -1
- package/dist/components/LinearCarousel/LinearCarousel.d.ts +1 -4
- package/dist/components/LinearCarousel/context.d.ts +3 -3
- package/dist/components/LinearCarousel/types.d.ts +5 -23
- package/dist/components/LinearCarousel/utils.d.ts +0 -1
- package/dist/components/StorybookUtils/index.d.ts +9 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useCarouselContext.d.ts +20 -0
- package/dist/hooks/useCarouselDrag.d.ts +85 -0
- package/dist/react-three-components.js +494 -375
- package/dist/utils/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { type ForwardRefExoticComponent, type RefAttributes } from "react";
|
|
2
1
|
import { CircularCarouselNextTrigger, CircularCarouselPrevTrigger } from "./CircularCarouselTriggers";
|
|
3
2
|
import type { CircularCarouselProps, CircularCarouselRef } from "./types";
|
|
4
|
-
|
|
3
|
+
export declare const CircularCarousel: import("react").ForwardRefExoticComponent<CircularCarouselProps & import("react").RefAttributes<CircularCarouselRef>> & {
|
|
5
4
|
NextTrigger: typeof CircularCarouselNextTrigger;
|
|
6
5
|
PrevTrigger: typeof CircularCarouselPrevTrigger;
|
|
7
6
|
};
|
|
8
|
-
export declare const CircularCarousel: CircularCarouselComponent;
|
|
9
|
-
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
export declare function
|
|
1
|
+
import { CarouselContext } from "../../hooks";
|
|
2
|
+
export { CarouselContext };
|
|
3
|
+
export declare function useCircularCarouselContext(): import("./types").CarouselContextValue;
|
|
4
|
+
export { useCircularCarouselContext as useCarouselContext };
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
axis?: "x" | "y";
|
|
5
|
-
/** Pointer options for drag gesture */
|
|
6
|
-
pointer?: {
|
|
7
|
-
touch?: boolean;
|
|
8
|
-
capture?: boolean;
|
|
9
|
-
keys?: boolean;
|
|
10
|
-
};
|
|
11
|
-
/** Touch action CSS property. Default: "none" */
|
|
12
|
-
touchAction?: string;
|
|
13
|
-
/** Threshold in pixels before drag starts */
|
|
14
|
-
threshold?: number;
|
|
15
|
-
/** Rubberband effect when dragging past bounds (0-1) */
|
|
16
|
-
rubberband?: boolean | number;
|
|
17
|
-
};
|
|
2
|
+
import type { DragConfig, CarouselContextValue } from "../../hooks";
|
|
3
|
+
export type { DragConfig, CarouselContextValue };
|
|
18
4
|
export type CircularCarouselProps = {
|
|
19
5
|
children: ReactNode;
|
|
20
6
|
radius?: number;
|
|
@@ -34,10 +20,3 @@ export type CircularCarouselRef = {
|
|
|
34
20
|
prev(): void;
|
|
35
21
|
goTo(index: number): void;
|
|
36
22
|
};
|
|
37
|
-
export type CarouselContextValue = {
|
|
38
|
-
activeIndex: number;
|
|
39
|
-
count: number;
|
|
40
|
-
next: () => void;
|
|
41
|
-
prev: () => void;
|
|
42
|
-
goTo: (index: number) => void;
|
|
43
|
-
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare function clamp(value: number, min: number, max: number): number;
|
|
2
1
|
export declare function getItemTransform(index: number, count: number, radius: number, axis: "x" | "y" | "z"): {
|
|
3
2
|
position: readonly [number, 0, number] | readonly [0, number, number] | readonly [number, number, 0];
|
|
4
3
|
rotation: readonly [0, number, 0] | readonly [number, 0, 0] | readonly [0, 0, number];
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { type ForwardRefExoticComponent, type RefAttributes } from "react";
|
|
2
1
|
import { LinearCarouselNextTrigger, LinearCarouselPrevTrigger } from "./LinearCarouselTriggers";
|
|
3
2
|
import type { LinearCarouselProps, LinearCarouselRef } from "./types";
|
|
4
|
-
|
|
3
|
+
export declare const LinearCarousel: import("react").ForwardRefExoticComponent<LinearCarouselProps & import("react").RefAttributes<LinearCarouselRef>> & {
|
|
5
4
|
NextTrigger: typeof LinearCarouselNextTrigger;
|
|
6
5
|
PrevTrigger: typeof LinearCarouselPrevTrigger;
|
|
7
6
|
};
|
|
8
|
-
export declare const LinearCarousel: LinearCarouselComponent;
|
|
9
|
-
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
3
|
-
export declare function useLinearCarouselContext(): LinearCarouselContextValue;
|
|
1
|
+
import { CarouselContext } from "../../hooks";
|
|
2
|
+
export { CarouselContext as LinearCarouselContext };
|
|
3
|
+
export declare function useLinearCarouselContext(): import("./types").LinearCarouselContextValue;
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** Pointer options for drag gesture */
|
|
6
|
-
pointer?: {
|
|
7
|
-
touch?: boolean;
|
|
8
|
-
capture?: boolean;
|
|
9
|
-
keys?: boolean;
|
|
10
|
-
};
|
|
11
|
-
/** Touch action CSS property. Default: "none" */
|
|
12
|
-
touchAction?: string;
|
|
13
|
-
/** Threshold in pixels before drag starts */
|
|
14
|
-
threshold?: number;
|
|
15
|
-
/** Rubberband effect when dragging past bounds (0-1) */
|
|
16
|
-
rubberband?: boolean | number;
|
|
17
|
-
};
|
|
2
|
+
import type { DragConfig, CarouselContextValue } from "../../hooks";
|
|
3
|
+
export type { DragConfig };
|
|
4
|
+
export type { CarouselContextValue as LinearCarouselContextValue };
|
|
18
5
|
export type LinearCarouselProps = {
|
|
19
6
|
children: ReactNode;
|
|
20
7
|
gap?: number;
|
|
@@ -28,16 +15,11 @@ export type LinearCarouselProps = {
|
|
|
28
15
|
dragAxis?: "x" | "y";
|
|
29
16
|
/** Additional drag gesture configuration */
|
|
30
17
|
dragConfig?: DragConfig;
|
|
18
|
+
/** When true, navigation wraps from last item to first and vice versa. Default: false */
|
|
19
|
+
infinite?: boolean;
|
|
31
20
|
};
|
|
32
21
|
export type LinearCarouselRef = {
|
|
33
22
|
next(): void;
|
|
34
23
|
prev(): void;
|
|
35
24
|
goTo(index: number): void;
|
|
36
25
|
};
|
|
37
|
-
export type LinearCarouselContextValue = {
|
|
38
|
-
activeIndex: number;
|
|
39
|
-
count: number;
|
|
40
|
-
next: () => void;
|
|
41
|
-
prev: () => void;
|
|
42
|
-
goTo: (index: number) => void;
|
|
43
|
-
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A floating 3D shape for use in carousel stories.
|
|
4
|
+
* Pass `isActive` to control the float animation.
|
|
5
|
+
*/
|
|
6
|
+
export declare function FloatingShape({ type, isActive, }: {
|
|
7
|
+
type: "box" | "sphere" | "cone" | "plane";
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
}): React.ReactNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type CarouselContextValue = {
|
|
2
|
+
/** Currently active item index */
|
|
3
|
+
activeIndex: number;
|
|
4
|
+
/** Total number of items */
|
|
5
|
+
count: number;
|
|
6
|
+
/** Navigate to the next item */
|
|
7
|
+
next: () => void;
|
|
8
|
+
/** Navigate to the previous item */
|
|
9
|
+
prev: () => void;
|
|
10
|
+
/** Navigate to a specific item by index */
|
|
11
|
+
goTo: (index: number) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare const CarouselContext: import("react").Context<CarouselContextValue | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Hook to access carousel context from within a carousel component.
|
|
16
|
+
* @param componentName - Name of the carousel component for error messages
|
|
17
|
+
* @returns The carousel context value
|
|
18
|
+
* @throws If used outside of a carousel component
|
|
19
|
+
*/
|
|
20
|
+
export declare function useCarouselContext(componentName: string): CarouselContextValue;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type SpringRef } from "@react-spring/web";
|
|
2
|
+
export type DragConfig = {
|
|
3
|
+
/** Axis to constrain drag movement */
|
|
4
|
+
axis?: "x" | "y";
|
|
5
|
+
/** Pointer options for drag gesture */
|
|
6
|
+
pointer?: {
|
|
7
|
+
touch?: boolean;
|
|
8
|
+
capture?: boolean;
|
|
9
|
+
keys?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** Touch action CSS property. Default: "none" */
|
|
12
|
+
touchAction?: string;
|
|
13
|
+
/** Threshold in pixels before drag starts. Default: 5 */
|
|
14
|
+
threshold?: number;
|
|
15
|
+
/** Rubberband effect when dragging past bounds (0-1) */
|
|
16
|
+
rubberband?: boolean | number;
|
|
17
|
+
/** Filter out taps (clicks) from drags. Default: true */
|
|
18
|
+
filterTaps?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type SpringConfig = {
|
|
21
|
+
tension: number;
|
|
22
|
+
friction: number;
|
|
23
|
+
};
|
|
24
|
+
export type UseCarouselDragOptions = {
|
|
25
|
+
/** Number of items in the carousel */
|
|
26
|
+
count: number;
|
|
27
|
+
/** Whether drag is enabled */
|
|
28
|
+
dragEnabled: boolean;
|
|
29
|
+
/** Axis for drag gesture ("x" or "y") */
|
|
30
|
+
dragAxis: "x" | "y";
|
|
31
|
+
/** Sensitivity for drag movement (pixels per unit) */
|
|
32
|
+
dragSensitivity: number;
|
|
33
|
+
/** Maximum drag amount per gesture (e.g., itemSpacing or anglePerItem) */
|
|
34
|
+
maxDragAmount: number;
|
|
35
|
+
/** Additional drag configuration */
|
|
36
|
+
dragConfig?: DragConfig;
|
|
37
|
+
/** Spring configuration for settling animations */
|
|
38
|
+
springConfig: SpringConfig;
|
|
39
|
+
/** Spring configuration for drag animations */
|
|
40
|
+
dragSpringConfig: SpringConfig;
|
|
41
|
+
/**
|
|
42
|
+
* Calculate the nearest index from an offset value.
|
|
43
|
+
* @param offset - The current offset value
|
|
44
|
+
* @returns The nearest index
|
|
45
|
+
*/
|
|
46
|
+
calculateIndexFromOffset: (offset: number) => number;
|
|
47
|
+
/**
|
|
48
|
+
* Calculate the final target index after drag ends.
|
|
49
|
+
* @param currentOffset - The offset at drag end
|
|
50
|
+
* @param startIndex - The index when drag started
|
|
51
|
+
* @param dragAmount - The clamped drag amount
|
|
52
|
+
* @returns The target index to navigate to
|
|
53
|
+
*/
|
|
54
|
+
calculateTargetIndex: (currentOffset: number, startIndex: number, dragAmount: number) => number;
|
|
55
|
+
/**
|
|
56
|
+
* Calculate the target offset for an index.
|
|
57
|
+
* @param index - The target index
|
|
58
|
+
* @param currentOffset - The current offset (useful for shortest path calculations)
|
|
59
|
+
* @returns The target offset value
|
|
60
|
+
*/
|
|
61
|
+
calculateTargetOffset: (index: number, currentOffset: number) => number;
|
|
62
|
+
/**
|
|
63
|
+
* Called when navigation completes with the final index.
|
|
64
|
+
*/
|
|
65
|
+
onNavigate: (index: number) => void;
|
|
66
|
+
};
|
|
67
|
+
export type UseCarouselDragReturn = {
|
|
68
|
+
/** Spring offset value */
|
|
69
|
+
offset: {
|
|
70
|
+
get: () => number;
|
|
71
|
+
};
|
|
72
|
+
/** Spring API for manual control */
|
|
73
|
+
springApi: SpringRef<{
|
|
74
|
+
offset: number;
|
|
75
|
+
}>;
|
|
76
|
+
/** Ref tracking if currently dragging */
|
|
77
|
+
isDraggingRef: React.MutableRefObject<boolean>;
|
|
78
|
+
/** Ref tracking current offset value (updated each frame) */
|
|
79
|
+
currentOffsetRef: React.MutableRefObject<number>;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Shared hook for carousel drag behavior.
|
|
83
|
+
* Handles spring animation, gesture recognition, and cursor management.
|
|
84
|
+
*/
|
|
85
|
+
export declare function useCarouselDrag(options: UseCarouselDragOptions): UseCarouselDragReturn;
|
|
@@ -1,37 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useThree as
|
|
4
|
-
import { useSpring as
|
|
5
|
-
import { useDrag as
|
|
6
|
-
|
|
7
|
-
tension: 200,
|
|
8
|
-
friction: 25
|
|
9
|
-
}, Wt = {
|
|
10
|
-
tension: 400,
|
|
11
|
-
friction: 50
|
|
12
|
-
};
|
|
13
|
-
function mt(c, t, u) {
|
|
14
|
-
return Math.max(t, Math.min(u, c));
|
|
15
|
-
}
|
|
16
|
-
function Xt(c, t, u, r) {
|
|
17
|
-
const o = c / t * S, l = Math.cos(o) * u, s = Math.sin(o) * u, I = r === "y" ? [s, 0, l] : r === "x" ? [0, l, s] : [l, s, 0], $ = r === "y" ? [0, Math.PI + o, 0] : r === "x" ? [Math.PI + o, 0, 0] : [0, 0, Math.PI + o];
|
|
18
|
-
return {
|
|
19
|
-
position: I,
|
|
20
|
-
rotation: $
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function pt(c, t) {
|
|
24
|
-
const u = Math.round((c - t) / S);
|
|
25
|
-
return t + u * S;
|
|
26
|
-
}
|
|
27
|
-
const wt = dt(null);
|
|
28
|
-
function $t() {
|
|
29
|
-
const c = St(wt);
|
|
30
|
-
if (!c)
|
|
31
|
-
throw new Error("CircularCarousel compound components must be used within CircularCarousel");
|
|
32
|
-
return c;
|
|
33
|
-
}
|
|
34
|
-
var C = { exports: {} }, ht = {};
|
|
1
|
+
import { jsx as dt, jsxs as Yt } from "react/jsx-runtime";
|
|
2
|
+
import Vt, { useRef as nt, useEffect as St, createContext as te, useContext as ee, forwardRef as jt, useState as zt, Children as Wt, useImperativeHandle as Xt, isValidElement as yt } from "react";
|
|
3
|
+
import { useThree as re, useFrame as Bt } from "@react-three/fiber";
|
|
4
|
+
import { useSpring as ne } from "@react-spring/web";
|
|
5
|
+
import { useDrag as oe } from "@use-gesture/react";
|
|
6
|
+
var Ot = { exports: {} }, bt = {};
|
|
35
7
|
/**
|
|
36
8
|
* @license React
|
|
37
9
|
* react-compiler-runtime.production.js
|
|
@@ -41,16 +13,16 @@ var C = { exports: {} }, ht = {};
|
|
|
41
13
|
* This source code is licensed under the MIT license found in the
|
|
42
14
|
* LICENSE file in the root directory of this source tree.
|
|
43
15
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
var
|
|
49
|
-
return
|
|
50
|
-
return
|
|
51
|
-
},
|
|
16
|
+
var qt;
|
|
17
|
+
function se() {
|
|
18
|
+
if (qt) return bt;
|
|
19
|
+
qt = 1;
|
|
20
|
+
var n = Vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
21
|
+
return bt.c = function(e) {
|
|
22
|
+
return n.H.useMemoCache(e);
|
|
23
|
+
}, bt;
|
|
52
24
|
}
|
|
53
|
-
var
|
|
25
|
+
var Pt = {};
|
|
54
26
|
/**
|
|
55
27
|
* @license React
|
|
56
28
|
* react-compiler-runtime.development.js
|
|
@@ -60,379 +32,526 @@ var Rt = {};
|
|
|
60
32
|
* This source code is licensed under the MIT license found in the
|
|
61
33
|
* LICENSE file in the root directory of this source tree.
|
|
62
34
|
*/
|
|
63
|
-
var
|
|
64
|
-
function
|
|
65
|
-
return
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
var u =
|
|
35
|
+
var wt;
|
|
36
|
+
function ie() {
|
|
37
|
+
return wt || (wt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
38
|
+
var n = Vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
39
|
+
Pt.c = function(e) {
|
|
40
|
+
var u = n.H;
|
|
69
41
|
return u === null && console.error(
|
|
70
42
|
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
71
43
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
72
44
|
2. You might be breaking the Rules of Hooks
|
|
73
45
|
3. You might have more than one copy of React in the same app
|
|
74
46
|
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
75
|
-
), u.useMemoCache(
|
|
47
|
+
), u.useMemoCache(e);
|
|
76
48
|
};
|
|
77
|
-
})()),
|
|
49
|
+
})()), Pt;
|
|
78
50
|
}
|
|
79
|
-
var
|
|
80
|
-
function
|
|
81
|
-
return
|
|
51
|
+
var Ht;
|
|
52
|
+
function ce() {
|
|
53
|
+
return Ht || (Ht = 1, process.env.NODE_ENV === "production" ? Ot.exports = se() : Ot.exports = ie()), Ot.exports;
|
|
82
54
|
}
|
|
83
|
-
var
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
let l;
|
|
94
|
-
t[3] !== u ? (l = () => u(), t[3] = u, t[4] = l) : l = t[4];
|
|
95
|
-
let s;
|
|
96
|
-
return t[5] !== r || t[6] !== o || t[7] !== l ? (s = /* @__PURE__ */ D("group", { onClick: l, ...o, children: r }), t[5] = r, t[6] = o, t[7] = l, t[8] = s) : s = t[8], s;
|
|
55
|
+
var _t = ce();
|
|
56
|
+
const w = 2 * Math.PI, le = 3, ue = "y", ae = 280, Dt = {
|
|
57
|
+
tension: 200,
|
|
58
|
+
friction: 25
|
|
59
|
+
}, fe = {
|
|
60
|
+
tension: 400,
|
|
61
|
+
friction: 50
|
|
62
|
+
};
|
|
63
|
+
function Et(n, e, u) {
|
|
64
|
+
return Math.max(e, Math.min(u, n));
|
|
97
65
|
}
|
|
98
|
-
function
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
children: r,
|
|
105
|
-
...o
|
|
106
|
-
} = c, t[0] = c, t[1] = r, t[2] = o) : (r = t[1], o = t[2]);
|
|
107
|
-
let l;
|
|
108
|
-
t[3] !== u ? (l = () => u(), t[3] = u, t[4] = l) : l = t[4];
|
|
109
|
-
let s;
|
|
110
|
-
return t[5] !== r || t[6] !== o || t[7] !== l ? (s = /* @__PURE__ */ D("group", { onClick: l, ...o, children: r }), t[5] = r, t[6] = o, t[7] = l, t[8] = s) : s = t[8], s;
|
|
66
|
+
function de(n, e, u, t) {
|
|
67
|
+
const s = n / e * w, c = Math.cos(s) * u, o = Math.sin(s) * u, k = t === "y" ? [o, 0, c] : t === "x" ? [0, c, o] : [c, o, 0], H = t === "y" ? [0, Math.PI + s, 0] : t === "x" ? [Math.PI + s, 0, 0] : [0, 0, Math.PI + s];
|
|
68
|
+
return {
|
|
69
|
+
position: k,
|
|
70
|
+
rotation: H
|
|
71
|
+
};
|
|
111
72
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
defaultIndex: l = 0,
|
|
118
|
-
onIndexChange: s,
|
|
119
|
-
dragEnabled: I = !0,
|
|
120
|
-
dragSensitivity: $,
|
|
121
|
-
dragAxis: X = "x",
|
|
122
|
-
dragConfig: a
|
|
123
|
-
}, st) {
|
|
124
|
-
const [ct, q] = Dt(l), x = o !== void 0, R = x ? o : ct, p = N(R);
|
|
125
|
-
p.current = R;
|
|
126
|
-
const H = et(() => Lt.toArray(t), [t]), Y = H.filter((i) => rt(i) && i.type !== vt && i.type !== _t), ut = H.filter((i) => rt(i) && (i.type === vt || i.type === _t)), n = Y.length, P = N(null), y = n > 0 ? S / n : S, it = $ ?? Bt / y, [{
|
|
127
|
-
offset: lt
|
|
128
|
-
}, V] = Ut(() => ({
|
|
129
|
-
offset: 0
|
|
130
|
-
})), v = N(V);
|
|
131
|
-
v.current = V;
|
|
132
|
-
const z = N(!1), A = N(0), j = N(0), _ = E((i) => {
|
|
133
|
-
const e = mt(i, 0, n - 1);
|
|
134
|
-
if (e === p.current) return;
|
|
135
|
-
p.current = e, x || q(e), s == null || s(e);
|
|
136
|
-
const f = -(e / n) * S, m = pt(A.current, f);
|
|
137
|
-
v.current.start({
|
|
138
|
-
offset: m,
|
|
139
|
-
config: Z
|
|
140
|
-
});
|
|
141
|
-
}, [n, x, s]), b = E(() => {
|
|
142
|
-
n !== 0 && _((p.current + 1) % n);
|
|
143
|
-
}, [n, _]), O = E(() => {
|
|
144
|
-
n !== 0 && _((p.current - 1 + n) % n);
|
|
145
|
-
}, [n, _]), d = E((i) => _(i), [_]);
|
|
146
|
-
Mt(st, () => ({
|
|
147
|
-
next: b,
|
|
148
|
-
prev: O,
|
|
149
|
-
goTo: d
|
|
150
|
-
}), [b, O, d]), nt(() => {
|
|
151
|
-
if (!z.current && n > 0) {
|
|
152
|
-
const i = -(R / n) * S, e = A.current, m = e === 0 && R !== 0 ? i : pt(e, i);
|
|
153
|
-
v.current.start({
|
|
154
|
-
offset: m,
|
|
155
|
-
config: Z
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}, [R, n]);
|
|
73
|
+
function Lt(n, e) {
|
|
74
|
+
const u = Math.round((n - e) / w);
|
|
75
|
+
return e + u * w;
|
|
76
|
+
}
|
|
77
|
+
function Jt(n) {
|
|
159
78
|
const {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
79
|
+
count: e,
|
|
80
|
+
dragEnabled: u,
|
|
81
|
+
dragAxis: t,
|
|
82
|
+
dragSensitivity: s,
|
|
83
|
+
maxDragAmount: c,
|
|
84
|
+
dragConfig: o,
|
|
85
|
+
springConfig: k,
|
|
86
|
+
dragSpringConfig: H,
|
|
87
|
+
calculateIndexFromOffset: d,
|
|
88
|
+
calculateTargetIndex: gt,
|
|
89
|
+
calculateTargetOffset: At,
|
|
90
|
+
onNavigate: Tt
|
|
91
|
+
} = n, {
|
|
92
|
+
gl: E
|
|
93
|
+
} = re(), [{
|
|
94
|
+
offset: ot
|
|
95
|
+
}, T] = ne(() => ({
|
|
96
|
+
offset: 0
|
|
97
|
+
})), N = nt(T);
|
|
98
|
+
N.current = T;
|
|
99
|
+
const st = nt(!1), L = nt(0), R = nt(0), mt = nt(0);
|
|
100
|
+
return oe(({
|
|
101
|
+
active: h,
|
|
102
|
+
movement: [f, g],
|
|
103
|
+
first: C,
|
|
104
|
+
last: M
|
|
168
105
|
}) => {
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
106
|
+
st.current = h;
|
|
107
|
+
const F = t === "x" ? f : g;
|
|
108
|
+
C && (R.current = L.current, mt.current = d(L.current)), h && C && (E.domElement.style.cursor = "grabbing"), !h && M && (E.domElement.style.cursor = "grab");
|
|
109
|
+
const S = R.current, q = Number(F);
|
|
110
|
+
let y = 0;
|
|
111
|
+
if (Number.isFinite(q)) {
|
|
112
|
+
const b = q / s;
|
|
113
|
+
y = Et(b, -c, c);
|
|
177
114
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
config: Wt
|
|
115
|
+
if (h)
|
|
116
|
+
N.current.start({
|
|
117
|
+
offset: S + y,
|
|
118
|
+
config: H
|
|
183
119
|
});
|
|
184
120
|
else {
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
v.current.start({
|
|
191
|
-
offset: B,
|
|
192
|
-
config: Z
|
|
121
|
+
const b = mt.current, r = S + y, i = gt(r, b, y);
|
|
122
|
+
if (e === 0 || !Number.isFinite(i)) {
|
|
123
|
+
N.current.start({
|
|
124
|
+
offset: S,
|
|
125
|
+
config: k
|
|
193
126
|
});
|
|
194
127
|
return;
|
|
195
128
|
}
|
|
196
|
-
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
offset:
|
|
200
|
-
config:
|
|
129
|
+
Tt(i);
|
|
130
|
+
const G = At(i, r);
|
|
131
|
+
N.current.start({
|
|
132
|
+
offset: G,
|
|
133
|
+
config: k
|
|
201
134
|
});
|
|
202
135
|
}
|
|
203
136
|
}, {
|
|
204
|
-
target:
|
|
205
|
-
enabled:
|
|
206
|
-
|
|
137
|
+
target: E.domElement,
|
|
138
|
+
enabled: u,
|
|
139
|
+
from: () => [0, 0],
|
|
140
|
+
filterTaps: (o == null ? void 0 : o.filterTaps) ?? !0,
|
|
141
|
+
threshold: (o == null ? void 0 : o.threshold) ?? 5,
|
|
142
|
+
pointer: (o == null ? void 0 : o.pointer) ?? {
|
|
207
143
|
touch: !0,
|
|
208
144
|
capture: !0
|
|
209
145
|
},
|
|
210
|
-
axis: (
|
|
211
|
-
touchAction: (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
i.style.touchAction = e, i.style.cursor = f;
|
|
146
|
+
axis: (o == null ? void 0 : o.axis) ?? t,
|
|
147
|
+
touchAction: (o == null ? void 0 : o.touchAction) ?? "none",
|
|
148
|
+
rubberband: o == null ? void 0 : o.rubberband
|
|
149
|
+
}), St(() => {
|
|
150
|
+
if (!u) return;
|
|
151
|
+
const h = E.domElement, f = h.style.touchAction, g = h.style.cursor;
|
|
152
|
+
return h.style.touchAction = "none", h.style.cursor = "grab", () => {
|
|
153
|
+
h.style.touchAction = f, h.style.cursor = g;
|
|
219
154
|
};
|
|
220
|
-
}, [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
return
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
155
|
+
}, [u, E.domElement]), {
|
|
156
|
+
offset: ot,
|
|
157
|
+
springApi: T,
|
|
158
|
+
isDraggingRef: st,
|
|
159
|
+
currentOffsetRef: L
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
const Ft = te(null);
|
|
163
|
+
function Kt(n) {
|
|
164
|
+
const e = ee(Ft);
|
|
165
|
+
if (!e)
|
|
166
|
+
throw new Error(`${n} compound components must be used within ${n}`);
|
|
167
|
+
return e;
|
|
168
|
+
}
|
|
169
|
+
function Qt() {
|
|
170
|
+
return Kt("CircularCarousel");
|
|
171
|
+
}
|
|
172
|
+
function Gt(n) {
|
|
173
|
+
const e = _t.c(9), {
|
|
174
|
+
next: u
|
|
175
|
+
} = Qt();
|
|
176
|
+
let t, s;
|
|
177
|
+
e[0] !== n ? ({
|
|
178
|
+
children: t,
|
|
179
|
+
...s
|
|
180
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
181
|
+
let c;
|
|
182
|
+
e[3] !== u ? (c = () => u(), e[3] = u, e[4] = c) : c = e[4];
|
|
183
|
+
let o;
|
|
184
|
+
return e[5] !== t || e[6] !== s || e[7] !== c ? (o = /* @__PURE__ */ dt("group", { onClick: c, ...s, children: t }), e[5] = t, e[6] = s, e[7] = c, e[8] = o) : o = e[8], o;
|
|
185
|
+
}
|
|
186
|
+
function Ut(n) {
|
|
187
|
+
const e = _t.c(9), {
|
|
188
|
+
prev: u
|
|
189
|
+
} = Qt();
|
|
190
|
+
let t, s;
|
|
191
|
+
e[0] !== n ? ({
|
|
192
|
+
children: t,
|
|
193
|
+
...s
|
|
194
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
195
|
+
let c;
|
|
196
|
+
e[3] !== u ? (c = () => u(), e[3] = u, e[4] = c) : c = e[4];
|
|
197
|
+
let o;
|
|
198
|
+
return e[5] !== t || e[6] !== s || e[7] !== c ? (o = /* @__PURE__ */ dt("group", { onClick: c, ...s, children: t }), e[5] = t, e[6] = s, e[7] = c, e[8] = o) : o = e[8], o;
|
|
199
|
+
}
|
|
200
|
+
const Se = Object.assign(jt(function(e, u) {
|
|
201
|
+
const t = _t.c(76), {
|
|
202
|
+
children: s,
|
|
203
|
+
radius: c,
|
|
204
|
+
axis: o,
|
|
205
|
+
index: k,
|
|
206
|
+
defaultIndex: H,
|
|
207
|
+
onIndexChange: d,
|
|
208
|
+
dragEnabled: gt,
|
|
209
|
+
dragSensitivity: At,
|
|
210
|
+
dragAxis: Tt,
|
|
211
|
+
dragConfig: E
|
|
212
|
+
} = e, ot = c === void 0 ? le : c, T = o === void 0 ? ue : o, N = H === void 0 ? 0 : H, st = gt === void 0 ? !0 : gt, L = Tt === void 0 ? "x" : Tt, [R, mt] = zt(N), h = k !== void 0, f = h ? k : R, g = nt(f);
|
|
213
|
+
let C, M;
|
|
214
|
+
t[0] !== f ? (C = () => {
|
|
215
|
+
g.current = f;
|
|
216
|
+
}, M = [f], t[0] = f, t[1] = C, t[2] = M) : (C = t[1], M = t[2]), St(C, M);
|
|
217
|
+
let F;
|
|
218
|
+
t[3] !== s ? (F = Wt.toArray(s), t[3] = s, t[4] = F) : F = t[4];
|
|
219
|
+
const S = F, q = S.filter(ge);
|
|
220
|
+
let y;
|
|
221
|
+
t[5] !== S ? (y = S.filter(me), t[5] = S, t[6] = y) : y = t[6];
|
|
222
|
+
const b = y, r = q.length, i = nt(null), G = r > 0 ? w / r : w, m = At ?? ae / G;
|
|
223
|
+
let it;
|
|
224
|
+
t[7] !== r ? (it = (a) => (Math.round(-a / w * r) % r + r) % r, t[7] = r, t[8] = it) : it = t[8];
|
|
225
|
+
const pt = it;
|
|
226
|
+
let Y;
|
|
227
|
+
t[9] !== r ? (Y = (a, p, l) => {
|
|
228
|
+
const v = (p - 1 + r) % r, $ = (p + 1) % r;
|
|
229
|
+
let Nt = (Math.round(-a / w * r) % r + r) % r;
|
|
230
|
+
return Nt !== v && Nt !== p && Nt !== $ && (Nt = l > 0 ? $ : l < 0 ? v : p), Nt;
|
|
231
|
+
}, t[9] = r, t[10] = Y) : Y = t[10];
|
|
232
|
+
const ht = Y;
|
|
233
|
+
let V;
|
|
234
|
+
t[11] !== r ? (V = (a, p) => {
|
|
235
|
+
const l = -(a / r) * w;
|
|
236
|
+
return Lt(p, l);
|
|
237
|
+
}, t[11] = r, t[12] = V) : V = t[12];
|
|
238
|
+
const vt = V;
|
|
239
|
+
let j;
|
|
240
|
+
t[13] !== h || t[14] !== d ? (j = (a) => {
|
|
241
|
+
g.current = a, h || mt(a), d == null || d(a);
|
|
242
|
+
}, t[13] = h, t[14] = d, t[15] = j) : j = t[15];
|
|
243
|
+
const xt = j;
|
|
244
|
+
let z;
|
|
245
|
+
t[16] !== G || t[17] !== pt || t[18] !== ht || t[19] !== vt || t[20] !== r || t[21] !== L || t[22] !== E || t[23] !== st || t[24] !== m || t[25] !== xt ? (z = {
|
|
246
|
+
count: r,
|
|
247
|
+
dragEnabled: st,
|
|
248
|
+
dragAxis: L,
|
|
249
|
+
dragSensitivity: m,
|
|
250
|
+
maxDragAmount: G,
|
|
251
|
+
dragConfig: E,
|
|
252
|
+
springConfig: Dt,
|
|
253
|
+
dragSpringConfig: fe,
|
|
254
|
+
calculateIndexFromOffset: pt,
|
|
255
|
+
calculateTargetIndex: ht,
|
|
256
|
+
calculateTargetOffset: vt,
|
|
257
|
+
onNavigate: xt
|
|
258
|
+
}, t[16] = G, t[17] = pt, t[18] = ht, t[19] = vt, t[20] = r, t[21] = L, t[22] = E, t[23] = st, t[24] = m, t[25] = xt, t[26] = z) : z = t[26];
|
|
259
|
+
const {
|
|
260
|
+
offset: Rt,
|
|
261
|
+
springApi: P,
|
|
262
|
+
isDraggingRef: ct,
|
|
263
|
+
currentOffsetRef: x
|
|
264
|
+
} = Jt(z);
|
|
265
|
+
let W;
|
|
266
|
+
t[27] !== r || t[28] !== x || t[29] !== h || t[30] !== d || t[31] !== P ? (W = (a) => {
|
|
267
|
+
const p = Et(a, 0, r - 1);
|
|
268
|
+
if (p === g.current)
|
|
269
|
+
return;
|
|
270
|
+
g.current = p, h || mt(p), d == null || d(p);
|
|
271
|
+
const l = -(p / r) * w, v = Lt(x.current, l);
|
|
272
|
+
P.start({
|
|
273
|
+
offset: v,
|
|
274
|
+
config: Dt
|
|
275
|
+
});
|
|
276
|
+
}, t[27] = r, t[28] = x, t[29] = h, t[30] = d, t[31] = P, t[32] = W) : W = t[32];
|
|
277
|
+
const O = W;
|
|
278
|
+
let X;
|
|
279
|
+
t[33] !== r || t[34] !== O ? (X = () => {
|
|
280
|
+
r !== 0 && O((g.current + 1) % r);
|
|
281
|
+
}, t[33] = r, t[34] = O, t[35] = X) : X = t[35];
|
|
282
|
+
const I = X;
|
|
283
|
+
let B;
|
|
284
|
+
t[36] !== r || t[37] !== O ? (B = () => {
|
|
285
|
+
r !== 0 && O((g.current - 1 + r) % r);
|
|
286
|
+
}, t[36] = r, t[37] = O, t[38] = B) : B = t[38];
|
|
287
|
+
const _ = B;
|
|
288
|
+
let J;
|
|
289
|
+
t[39] !== O ? (J = (a) => O(a), t[39] = O, t[40] = J) : J = t[40];
|
|
290
|
+
const A = J;
|
|
291
|
+
let K, D;
|
|
292
|
+
t[41] !== A || t[42] !== I || t[43] !== _ ? (K = () => ({
|
|
293
|
+
next: I,
|
|
294
|
+
prev: _,
|
|
295
|
+
goTo: A
|
|
296
|
+
}), D = [I, _, A], t[41] = A, t[42] = I, t[43] = _, t[44] = K, t[45] = D) : (K = t[44], D = t[45]), Xt(u, K, D);
|
|
297
|
+
let Q, Z;
|
|
298
|
+
t[46] !== f || t[47] !== r || t[48] !== x || t[49] !== ct || t[50] !== P ? (Q = () => {
|
|
299
|
+
if (!ct.current && r > 0) {
|
|
300
|
+
const a = -(f / r) * w, p = x.current, v = p === 0 && f !== 0 ? a : Lt(p, a);
|
|
301
|
+
P.start({
|
|
302
|
+
offset: v,
|
|
303
|
+
config: Dt
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}, Z = [f, r, P, ct, x], t[46] = f, t[47] = r, t[48] = x, t[49] = ct, t[50] = P, t[51] = Q, t[52] = Z) : (Q = t[51], Z = t[52]), St(Q, Z);
|
|
307
|
+
let tt;
|
|
308
|
+
t[53] !== T || t[54] !== x || t[55] !== Rt ? (tt = () => {
|
|
309
|
+
if (!i.current)
|
|
310
|
+
return;
|
|
311
|
+
const a = Rt.get();
|
|
312
|
+
x.current = a, i.current.rotation[T] = a;
|
|
313
|
+
}, t[53] = T, t[54] = x, t[55] = Rt, t[56] = tt) : tt = t[56], Bt(tt);
|
|
314
|
+
let et;
|
|
315
|
+
t[57] !== T || t[58] !== r || t[59] !== ot ? (et = (a) => de(a, r, ot, T), t[57] = T, t[58] = r, t[59] = ot, t[60] = et) : et = t[60];
|
|
316
|
+
const lt = et;
|
|
317
|
+
let rt;
|
|
318
|
+
t[61] !== f || t[62] !== r || t[63] !== A || t[64] !== I || t[65] !== _ ? (rt = {
|
|
319
|
+
activeIndex: f,
|
|
320
|
+
count: r,
|
|
321
|
+
next: I,
|
|
322
|
+
prev: _,
|
|
323
|
+
goTo: A
|
|
324
|
+
}, t[61] = f, t[62] = r, t[63] = A, t[64] = I, t[65] = _, t[66] = rt) : rt = t[66];
|
|
325
|
+
const It = rt, ut = Ft;
|
|
326
|
+
let at;
|
|
327
|
+
t[67] !== lt ? (at = (a, p) => {
|
|
328
|
+
const {
|
|
329
|
+
position: l,
|
|
330
|
+
rotation: v
|
|
331
|
+
} = lt(p);
|
|
332
|
+
return /* @__PURE__ */ dt("group", { position: l, rotation: v, children: a }, a.key ?? p);
|
|
333
|
+
}, t[67] = lt, t[68] = at) : at = t[68];
|
|
334
|
+
const Ct = q.map(at);
|
|
335
|
+
let U;
|
|
336
|
+
t[69] !== Ct ? (U = /* @__PURE__ */ dt("group", { ref: i, children: Ct }), t[69] = Ct, t[70] = U) : U = t[70];
|
|
337
|
+
let ft;
|
|
338
|
+
return t[71] !== It || t[72] !== ut.Provider || t[73] !== U || t[74] !== b ? (ft = /* @__PURE__ */ Yt(ut.Provider, { value: It, children: [
|
|
339
|
+
U,
|
|
340
|
+
b
|
|
341
|
+
] }), t[71] = It, t[72] = ut.Provider, t[73] = U, t[74] = b, t[75] = ft) : ft = t[75], ft;
|
|
342
|
+
}), {
|
|
343
|
+
NextTrigger: Gt,
|
|
344
|
+
PrevTrigger: Ut
|
|
242
345
|
});
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
346
|
+
function ge(n) {
|
|
347
|
+
return yt(n) && n.type !== Gt && n.type !== Ut;
|
|
348
|
+
}
|
|
349
|
+
function me(n) {
|
|
350
|
+
return yt(n) && (n.type === Gt || n.type === Ut);
|
|
351
|
+
}
|
|
352
|
+
const pe = 0.5, he = "horizontal", ve = 150, Mt = {
|
|
246
353
|
tension: 200,
|
|
247
354
|
friction: 25
|
|
248
|
-
},
|
|
355
|
+
}, xe = {
|
|
249
356
|
tension: 400,
|
|
250
357
|
friction: 50
|
|
251
358
|
};
|
|
252
|
-
function
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
function ee(c, t, u) {
|
|
256
|
-
const r = c * (1 + t);
|
|
257
|
-
return u === "horizontal" ? [r, 0, 0] : [0, r, 0];
|
|
359
|
+
function Re(n, e, u) {
|
|
360
|
+
const t = n * (1 + e);
|
|
361
|
+
return u === "horizontal" ? [t, 0, 0] : [0, t, 0];
|
|
258
362
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
const c = St(qt);
|
|
262
|
-
if (!c)
|
|
263
|
-
throw new Error("LinearCarousel compound components must be used within LinearCarousel");
|
|
264
|
-
return c;
|
|
363
|
+
function Zt() {
|
|
364
|
+
return Kt("LinearCarousel");
|
|
265
365
|
}
|
|
266
|
-
function
|
|
267
|
-
const
|
|
366
|
+
function $t(n) {
|
|
367
|
+
const e = _t.c(9), {
|
|
268
368
|
next: u
|
|
269
|
-
} =
|
|
270
|
-
let
|
|
271
|
-
|
|
272
|
-
children:
|
|
273
|
-
...
|
|
274
|
-
} =
|
|
275
|
-
let
|
|
276
|
-
|
|
277
|
-
let
|
|
278
|
-
return
|
|
369
|
+
} = Zt();
|
|
370
|
+
let t, s;
|
|
371
|
+
e[0] !== n ? ({
|
|
372
|
+
children: t,
|
|
373
|
+
...s
|
|
374
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
375
|
+
let c;
|
|
376
|
+
e[3] !== u ? (c = () => u(), e[3] = u, e[4] = c) : c = e[4];
|
|
377
|
+
let o;
|
|
378
|
+
return e[5] !== t || e[6] !== s || e[7] !== c ? (o = /* @__PURE__ */ dt("group", { onClick: c, ...s, children: t }), e[5] = t, e[6] = s, e[7] = c, e[8] = o) : o = e[8], o;
|
|
279
379
|
}
|
|
280
|
-
function
|
|
281
|
-
const
|
|
380
|
+
function kt(n) {
|
|
381
|
+
const e = _t.c(9), {
|
|
282
382
|
prev: u
|
|
283
|
-
} =
|
|
284
|
-
let
|
|
285
|
-
|
|
286
|
-
children:
|
|
287
|
-
...
|
|
288
|
-
} =
|
|
289
|
-
let
|
|
290
|
-
|
|
291
|
-
let
|
|
292
|
-
return
|
|
383
|
+
} = Zt();
|
|
384
|
+
let t, s;
|
|
385
|
+
e[0] !== n ? ({
|
|
386
|
+
children: t,
|
|
387
|
+
...s
|
|
388
|
+
} = n, e[0] = n, e[1] = t, e[2] = s) : (t = e[1], s = e[2]);
|
|
389
|
+
let c;
|
|
390
|
+
e[3] !== u ? (c = () => u(), e[3] = u, e[4] = c) : c = e[4];
|
|
391
|
+
let o;
|
|
392
|
+
return e[5] !== t || e[6] !== s || e[7] !== c ? (o = /* @__PURE__ */ dt("group", { onClick: c, ...s, children: t }), e[5] = t, e[6] = s, e[7] = c, e[8] = o) : o = e[8], o;
|
|
293
393
|
}
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
394
|
+
const Oe = Object.assign(jt(function(e, u) {
|
|
395
|
+
const t = _t.c(80), {
|
|
396
|
+
children: s,
|
|
397
|
+
gap: c,
|
|
398
|
+
direction: o,
|
|
399
|
+
index: k,
|
|
400
|
+
defaultIndex: H,
|
|
401
|
+
onIndexChange: d,
|
|
402
|
+
dragEnabled: gt,
|
|
403
|
+
dragSensitivity: At,
|
|
404
|
+
dragAxis: Tt,
|
|
405
|
+
dragConfig: E,
|
|
406
|
+
infinite: ot
|
|
407
|
+
} = e, T = c === void 0 ? pe : c, N = o === void 0 ? he : o, st = H === void 0 ? 0 : H, L = gt === void 0 ? !0 : gt, R = ot === void 0 ? !1 : ot, [mt, h] = zt(st), f = k !== void 0, g = f ? k : mt, C = nt(g);
|
|
408
|
+
let M, F;
|
|
409
|
+
t[0] !== g ? (M = () => {
|
|
410
|
+
C.current = g;
|
|
411
|
+
}, F = [g], t[0] = g, t[1] = M, t[2] = F) : (M = t[1], F = t[2]), St(M, F);
|
|
412
|
+
let S;
|
|
413
|
+
t[3] !== s ? (S = Wt.toArray(s), t[3] = s, t[4] = S) : S = t[4];
|
|
414
|
+
const q = S, y = q.filter(Ie);
|
|
415
|
+
let b;
|
|
416
|
+
t[5] !== q ? (b = q.filter(Ce), t[5] = q, t[6] = b) : b = t[6];
|
|
417
|
+
const r = b, i = y.length, G = nt(null), m = 1 + T, it = At ?? ve, pt = Tt ?? (N === "horizontal" ? "x" : "y");
|
|
418
|
+
let Y;
|
|
419
|
+
t[7] !== m ? (Y = (l) => Math.round(-l / m), t[7] = m, t[8] = Y) : Y = t[8];
|
|
420
|
+
const ht = Y;
|
|
421
|
+
let V;
|
|
422
|
+
t[9] !== i || t[10] !== R || t[11] !== m ? (V = (l, v) => {
|
|
423
|
+
let $ = Math.round(-l / m);
|
|
424
|
+
return $ = Et($, v - 1, v + 1), R ? ($ % i + i) % i : Et($, 0, i - 1);
|
|
425
|
+
}, t[9] = i, t[10] = R, t[11] = m, t[12] = V) : V = t[12];
|
|
426
|
+
const vt = V;
|
|
427
|
+
let j;
|
|
428
|
+
t[13] !== m ? (j = (l) => -l * m, t[13] = m, t[14] = j) : j = t[14];
|
|
429
|
+
const xt = j;
|
|
430
|
+
let z;
|
|
431
|
+
t[15] !== f || t[16] !== d ? (z = (l) => {
|
|
432
|
+
C.current = l, f || h(l), d == null || d(l);
|
|
433
|
+
}, t[15] = f, t[16] = d, t[17] = z) : z = t[17];
|
|
434
|
+
const Rt = z;
|
|
435
|
+
let P;
|
|
436
|
+
t[18] !== ht || t[19] !== vt || t[20] !== xt || t[21] !== i || t[22] !== pt || t[23] !== E || t[24] !== L || t[25] !== it || t[26] !== Rt || t[27] !== m ? (P = {
|
|
437
|
+
count: i,
|
|
438
|
+
dragEnabled: L,
|
|
439
|
+
dragAxis: pt,
|
|
440
|
+
dragSensitivity: it,
|
|
441
|
+
maxDragAmount: m,
|
|
442
|
+
dragConfig: E,
|
|
443
|
+
springConfig: Mt,
|
|
444
|
+
dragSpringConfig: xe,
|
|
445
|
+
calculateIndexFromOffset: ht,
|
|
446
|
+
calculateTargetIndex: vt,
|
|
447
|
+
calculateTargetOffset: xt,
|
|
448
|
+
onNavigate: Rt
|
|
449
|
+
}, t[18] = ht, t[19] = vt, t[20] = xt, t[21] = i, t[22] = pt, t[23] = E, t[24] = L, t[25] = it, t[26] = Rt, t[27] = m, t[28] = P) : P = t[28];
|
|
345
450
|
const {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
451
|
+
offset: ct,
|
|
452
|
+
springApi: x,
|
|
453
|
+
isDraggingRef: W,
|
|
454
|
+
currentOffsetRef: O
|
|
455
|
+
} = Jt(P);
|
|
456
|
+
let X;
|
|
457
|
+
t[29] !== i || t[30] !== R || t[31] !== f || t[32] !== m || t[33] !== d || t[34] !== x ? (X = (l) => {
|
|
458
|
+
if (i === 0)
|
|
459
|
+
return;
|
|
460
|
+
let v;
|
|
461
|
+
if (R ? v = (l % i + i) % i : v = Et(l, 0, i - 1), v === C.current)
|
|
462
|
+
return;
|
|
463
|
+
C.current = v, f || h(v), d == null || d(v);
|
|
464
|
+
const $ = -v * m;
|
|
465
|
+
x.start({
|
|
466
|
+
offset: $,
|
|
467
|
+
config: Mt
|
|
468
|
+
});
|
|
469
|
+
}, t[29] = i, t[30] = R, t[31] = f, t[32] = m, t[33] = d, t[34] = x, t[35] = X) : X = t[35];
|
|
470
|
+
const I = X;
|
|
471
|
+
let B;
|
|
472
|
+
t[36] !== i || t[37] !== I || t[38] !== R ? (B = () => {
|
|
473
|
+
if (i === 0)
|
|
474
|
+
return;
|
|
475
|
+
const l = R ? (C.current + 1) % i : Math.min(C.current + 1, i - 1);
|
|
476
|
+
I(l);
|
|
477
|
+
}, t[36] = i, t[37] = I, t[38] = R, t[39] = B) : B = t[39];
|
|
478
|
+
const _ = B;
|
|
479
|
+
let J;
|
|
480
|
+
t[40] !== i || t[41] !== I || t[42] !== R ? (J = () => {
|
|
481
|
+
if (i === 0)
|
|
482
|
+
return;
|
|
483
|
+
const l = R ? (C.current - 1 + i) % i : Math.max(C.current - 1, 0);
|
|
484
|
+
I(l);
|
|
485
|
+
}, t[40] = i, t[41] = I, t[42] = R, t[43] = J) : J = t[43];
|
|
486
|
+
const A = J;
|
|
487
|
+
let K;
|
|
488
|
+
t[44] !== I ? (K = (l) => I(l), t[44] = I, t[45] = K) : K = t[45];
|
|
489
|
+
const D = K;
|
|
490
|
+
let Q, Z;
|
|
491
|
+
t[46] !== D || t[47] !== _ || t[48] !== A ? (Q = () => ({
|
|
492
|
+
next: _,
|
|
493
|
+
prev: A,
|
|
494
|
+
goTo: D
|
|
495
|
+
}), Z = [_, A, D], t[46] = D, t[47] = _, t[48] = A, t[49] = Q, t[50] = Z) : (Q = t[49], Z = t[50]), Xt(u, Q, Z);
|
|
496
|
+
let tt, et;
|
|
497
|
+
t[51] !== g || t[52] !== i || t[53] !== W || t[54] !== m || t[55] !== x ? (tt = () => {
|
|
498
|
+
if (!W.current && i > 0) {
|
|
499
|
+
const l = -g * m;
|
|
500
|
+
x.start({
|
|
501
|
+
offset: l,
|
|
502
|
+
config: Mt
|
|
387
503
|
});
|
|
388
504
|
}
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
return /* @__PURE__ */
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
505
|
+
}, et = [g, i, m, x, W], t[51] = g, t[52] = i, t[53] = W, t[54] = m, t[55] = x, t[56] = tt, t[57] = et) : (tt = t[56], et = t[57]), St(tt, et);
|
|
506
|
+
let lt;
|
|
507
|
+
t[58] !== O || t[59] !== N || t[60] !== ct ? (lt = () => {
|
|
508
|
+
if (!G.current)
|
|
509
|
+
return;
|
|
510
|
+
const l = ct.get();
|
|
511
|
+
O.current = l, N === "horizontal" ? G.current.position.x = l : G.current.position.y = l;
|
|
512
|
+
}, t[58] = O, t[59] = N, t[60] = ct, t[61] = lt) : lt = t[61], Bt(lt);
|
|
513
|
+
let rt;
|
|
514
|
+
t[62] !== N || t[63] !== T ? (rt = (l) => Re(l, T, N), t[62] = N, t[63] = T, t[64] = rt) : rt = t[64];
|
|
515
|
+
const It = rt;
|
|
516
|
+
let ut;
|
|
517
|
+
t[65] !== g || t[66] !== i || t[67] !== D || t[68] !== _ || t[69] !== A ? (ut = {
|
|
518
|
+
activeIndex: g,
|
|
519
|
+
count: i,
|
|
520
|
+
next: _,
|
|
521
|
+
prev: A,
|
|
522
|
+
goTo: D
|
|
523
|
+
}, t[65] = g, t[66] = i, t[67] = D, t[68] = _, t[69] = A, t[70] = ut) : ut = t[70];
|
|
524
|
+
const at = ut, Ct = Ft;
|
|
525
|
+
let U;
|
|
526
|
+
t[71] !== It ? (U = (l, v) => {
|
|
527
|
+
const $ = It(v);
|
|
528
|
+
return /* @__PURE__ */ dt("group", { position: [...$], children: l }, l.key ?? v);
|
|
529
|
+
}, t[71] = It, t[72] = U) : U = t[72];
|
|
530
|
+
const ft = y.map(U);
|
|
531
|
+
let a;
|
|
532
|
+
t[73] !== ft ? (a = /* @__PURE__ */ dt("group", { ref: G, children: ft }), t[73] = ft, t[74] = a) : a = t[74];
|
|
533
|
+
let p;
|
|
534
|
+
return t[75] !== at || t[76] !== Ct.Provider || t[77] !== a || t[78] !== r ? (p = /* @__PURE__ */ Yt(Ct.Provider, { value: at, children: [
|
|
535
|
+
a,
|
|
536
|
+
r
|
|
537
|
+
] }), t[75] = at, t[76] = Ct.Provider, t[77] = a, t[78] = r, t[79] = p) : p = t[79], p;
|
|
538
|
+
}), {
|
|
539
|
+
NextTrigger: $t,
|
|
540
|
+
PrevTrigger: kt
|
|
425
541
|
});
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
542
|
+
function Ie(n) {
|
|
543
|
+
return yt(n) && n.type !== $t && n.type !== kt;
|
|
544
|
+
}
|
|
545
|
+
function Ce(n) {
|
|
546
|
+
return yt(n) && (n.type === $t || n.type === kt);
|
|
547
|
+
}
|
|
429
548
|
export {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
549
|
+
Se as CircularCarousel,
|
|
550
|
+
Gt as CircularCarouselNextTrigger,
|
|
551
|
+
Ut as CircularCarouselPrevTrigger,
|
|
552
|
+
Oe as LinearCarousel,
|
|
553
|
+
$t as LinearCarouselNextTrigger,
|
|
554
|
+
kt as LinearCarouselPrevTrigger,
|
|
555
|
+
Qt as useCarouselContext,
|
|
556
|
+
Zt as useLinearCarouselContext
|
|
438
557
|
};
|