react-spring-carousel 1.9.29-beta70 → 1.9.29-beta73
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/modules/useThumbsModule.d.ts +6 -5
- package/dist/types/types/index.d.ts +48 -0
- package/dist/types/types/useSpringCarousel.d.ts +109 -0
- package/dist/types/types/useTransitionCarousel.d.ts +36 -0
- package/dist/types/useSpringCarousel/index.d.ts +21 -4
- package/dist/types/useTransitionCarousel/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types/types.d.ts +0 -175
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { UseSpringDafaultTypeReturnProps } from '../types';
|
|
3
|
+
import { UseSpringCarouselProps } from '../types/useSpringCarousel';
|
|
4
|
+
import { UseSpringFluidTypeReturnProps } from 'react-spring-carousel';
|
|
5
|
+
declare function useSpringCarousel({ items, withLoop, draggingSlideTreshold, springConfig, shouldResizeOnWindowResize, withThumbs, enableThumbsWrapperScroll, carouselSlideAxis, thumbsSlideAxis, prepareThumbsData, initialActiveItem, initialStartingPosition, disableGestures, gutter, startEndGutter, touchAction, slideAmount, freeScroll, CustomThumbsWrapperComponent, enableFreeScrollDrag, itemsPerSlide, slideType, }: UseSpringCarouselProps): {
|
|
5
6
|
carouselFragment: JSX.Element;
|
|
6
7
|
thumbsFragment: JSX.Element;
|
|
8
|
+
slideToItem?: ((item: string | number) => void) | undefined;
|
|
9
|
+
getIsActiveItem?: ((id: string) => boolean) | undefined;
|
|
10
|
+
getCurrentActiveItem?: (() => {
|
|
11
|
+
id: string;
|
|
12
|
+
index: number;
|
|
13
|
+
}) | undefined;
|
|
14
|
+
useListenToCustomEvent: (fn: import("../types").ObservableCallbackFn) => void;
|
|
15
|
+
getIsFullscreen: () => boolean;
|
|
16
|
+
enterFullscreen: (elementRef?: HTMLElement | undefined) => void;
|
|
17
|
+
exitFullscreen: () => void;
|
|
18
|
+
getIsAnimating: () => boolean;
|
|
19
|
+
getIsDragging: () => boolean;
|
|
20
|
+
getIsNextItem: (id: string) => boolean;
|
|
21
|
+
getIsPrevItem: (id: string) => boolean;
|
|
22
|
+
slideToPrevItem: () => void;
|
|
23
|
+
slideToNextItem: () => void;
|
|
7
24
|
};
|
|
8
|
-
declare function useSpringCarouselContext
|
|
25
|
+
declare function useSpringCarouselContext(): UseSpringFluidTypeReturnProps | UseSpringDafaultTypeReturnProps;
|
|
9
26
|
export { useSpringCarousel, useSpringCarouselContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { UseTransitionCarouselContextProps, UseTransitionCarouselProps } from '../types';
|
|
2
|
+
import { UseTransitionCarouselContextProps, UseTransitionCarouselProps } from '../types/useTransitionCarousel';
|
|
3
3
|
declare function useTransitionCarouselContext(): UseTransitionCarouselContextProps;
|
|
4
4
|
declare function useTransitionCarousel({ items, withLoop, withThumbs, springConfig, thumbsSlideAxis, enableThumbsWrapperScroll, draggingSlideTreshold, prepareThumbsData, toPrevItemSpringProps, toNextItemSpringProps, disableGestures, CustomThumbsWrapperComponent, springAnimationProps, }: UseTransitionCarouselProps): {
|
|
5
5
|
useListenToCustomEvent: import("../types").UseListenToCustomEvent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-spring-carousel",
|
|
3
|
-
"version": "1.9.29-
|
|
3
|
+
"version": "1.9.29-beta73",
|
|
4
4
|
"description": "A new Carousel experience for the web",
|
|
5
5
|
"homepage": "https://react-spring-carousel-js.emilianobucci.com",
|
|
6
6
|
"repository": "https://github.com/Emiliano-Bucci/react-spring-carousel",
|
package/dist/types/types.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import { SpringConfig, TransitionFrom, TransitionTo } from 'react-spring';
|
|
2
|
-
import { FullGestureState } from '@use-gesture/react';
|
|
3
|
-
import { HTMLAttributes } from 'react';
|
|
4
|
-
export declare type ReactSpringThumbItem = {
|
|
5
|
-
id: string;
|
|
6
|
-
renderThumb: React.ReactNode;
|
|
7
|
-
};
|
|
8
|
-
export declare type ReactSpringCarouselItem = {
|
|
9
|
-
id: string;
|
|
10
|
-
renderItem: React.ReactNode;
|
|
11
|
-
renderThumb: React.ReactNode;
|
|
12
|
-
};
|
|
13
|
-
declare type ItemWithThumb = {
|
|
14
|
-
withThumbs: true;
|
|
15
|
-
items: ReactSpringCarouselItem[];
|
|
16
|
-
enableThumbsWrapperScroll?: boolean;
|
|
17
|
-
prepareThumbsData?: PrepareThumbsData;
|
|
18
|
-
};
|
|
19
|
-
declare type ItemWithNoThumb = {
|
|
20
|
-
withThumbs?: false;
|
|
21
|
-
enableThumbsWrapperScroll?: never;
|
|
22
|
-
prepareThumbsData?: never;
|
|
23
|
-
items: {
|
|
24
|
-
id: string;
|
|
25
|
-
renderItem: React.ReactNode;
|
|
26
|
-
renderThumb?: never;
|
|
27
|
-
}[];
|
|
28
|
-
};
|
|
29
|
-
export declare type UseSpringCarouselItems = ItemWithThumb | ItemWithNoThumb;
|
|
30
|
-
export declare type BaseCarouselSharedProps = {
|
|
31
|
-
withLoop?: boolean;
|
|
32
|
-
disableGestures?: boolean;
|
|
33
|
-
draggingSlideTreshold?: number;
|
|
34
|
-
springConfig?: SpringConfig;
|
|
35
|
-
thumbsSlideAxis?: 'x' | 'y';
|
|
36
|
-
CustomThumbsWrapperComponent?: React.FC<HTMLAttributes<HTMLElement>>;
|
|
37
|
-
};
|
|
38
|
-
declare type UseSpringCarouselLoopProps = {
|
|
39
|
-
withLoop: true;
|
|
40
|
-
startEndGutter?: number;
|
|
41
|
-
freeScroll?: never;
|
|
42
|
-
enableFreeScrollDrag?: never;
|
|
43
|
-
};
|
|
44
|
-
declare type UseSpringCarouselNoLoopProps = {
|
|
45
|
-
withLoop?: false;
|
|
46
|
-
startEndGutter?: never;
|
|
47
|
-
freeScroll?: boolean;
|
|
48
|
-
enableFreeScrollDrag?: boolean | (() => boolean);
|
|
49
|
-
};
|
|
50
|
-
export declare type UseSpringCarouselFluidType = {
|
|
51
|
-
itemsPerSlide: 'fluid';
|
|
52
|
-
slideAmount?: number;
|
|
53
|
-
initialStartingPosition?: never;
|
|
54
|
-
initialActiveItem?: never;
|
|
55
|
-
freeScroll?: boolean;
|
|
56
|
-
enableFreeScrollDrag?: boolean | (() => boolean);
|
|
57
|
-
};
|
|
58
|
-
declare type UseSpringCarouselNumericSlideType = {
|
|
59
|
-
itemsPerSlide?: number;
|
|
60
|
-
slideAmount?: never;
|
|
61
|
-
initialStartingPosition?: 'start' | 'center' | 'end';
|
|
62
|
-
initialActiveItem?: number;
|
|
63
|
-
freeScroll?: never;
|
|
64
|
-
enableFreeScrollDrag?: never;
|
|
65
|
-
};
|
|
66
|
-
export declare type UseSpringCarouselProps = Omit<BaseCarouselSharedProps, 'withLoop'> & {
|
|
67
|
-
shouldResizeOnWindowResize?: boolean;
|
|
68
|
-
carouselSlideAxis?: 'x' | 'y';
|
|
69
|
-
gutter?: number;
|
|
70
|
-
touchAction?: 'none' | 'pan-x' | 'pan-y';
|
|
71
|
-
} & (UseSpringCarouselLoopProps | UseSpringCarouselNoLoopProps) & (UseSpringCarouselFluidType | UseSpringCarouselNumericSlideType) & UseSpringCarouselItems;
|
|
72
|
-
export declare type PrepareThumbsData = (items: ReactSpringThumbItem[]) => ReactSpringThumbItem[];
|
|
73
|
-
export declare type SlideToItemFnProps = {
|
|
74
|
-
from?: number;
|
|
75
|
-
to?: number;
|
|
76
|
-
newIndex?: number;
|
|
77
|
-
immediate?: boolean;
|
|
78
|
-
customTo?: number;
|
|
79
|
-
onRest?(): void;
|
|
80
|
-
};
|
|
81
|
-
export declare type SpringAnimationProps = {
|
|
82
|
-
initial: TransitionFrom<ReactSpringCarouselItem>;
|
|
83
|
-
from: TransitionFrom<ReactSpringCarouselItem>;
|
|
84
|
-
enter: TransitionTo<ReactSpringCarouselItem>;
|
|
85
|
-
leave: TransitionTo<ReactSpringCarouselItem>;
|
|
86
|
-
};
|
|
87
|
-
export declare type UseTransitionCarouselProps = BaseCarouselSharedProps & UseSpringCarouselItems & {
|
|
88
|
-
toPrevItemSpringProps?: SpringAnimationProps;
|
|
89
|
-
toNextItemSpringProps?: SpringAnimationProps;
|
|
90
|
-
springAnimationProps?: SpringAnimationProps;
|
|
91
|
-
};
|
|
92
|
-
export declare type UseSpringFluidTypeReturnProps = {
|
|
93
|
-
useListenToCustomEvent: UseListenToCustomEvent;
|
|
94
|
-
getIsFullscreen(): boolean;
|
|
95
|
-
getIsPrevItem(id: string): boolean;
|
|
96
|
-
getIsNextItem(id: string): boolean;
|
|
97
|
-
enterFullscreen(elementRef?: HTMLElement): void;
|
|
98
|
-
exitFullscreen(): void;
|
|
99
|
-
slideToNextItem(): void;
|
|
100
|
-
slideToPrevItem(): void;
|
|
101
|
-
getIsAnimating(): boolean;
|
|
102
|
-
getIsDragging(): boolean;
|
|
103
|
-
};
|
|
104
|
-
export declare type UseSpringDafaultTypeReturnProps = {
|
|
105
|
-
useListenToCustomEvent: UseListenToCustomEvent;
|
|
106
|
-
getIsFullscreen(): boolean;
|
|
107
|
-
getIsPrevItem(id: string): boolean;
|
|
108
|
-
getIsNextItem(id: string): boolean;
|
|
109
|
-
enterFullscreen(elementRef?: HTMLElement): void;
|
|
110
|
-
exitFullscreen(): void;
|
|
111
|
-
slideToNextItem(): void;
|
|
112
|
-
slideToPrevItem(): void;
|
|
113
|
-
getIsAnimating(): boolean;
|
|
114
|
-
slideToItem(item: string | number): void;
|
|
115
|
-
getIsActiveItem(id: string): boolean;
|
|
116
|
-
getIsDragging(): boolean;
|
|
117
|
-
getCurrentActiveItem(): {
|
|
118
|
-
id: string;
|
|
119
|
-
index: number;
|
|
120
|
-
};
|
|
121
|
-
};
|
|
122
|
-
export declare type UseTransitionCarouselContextProps = {
|
|
123
|
-
useListenToCustomEvent: UseListenToCustomEvent;
|
|
124
|
-
getIsFullscreen(): boolean;
|
|
125
|
-
getIsPrevItem(id: string): boolean;
|
|
126
|
-
getIsNextItem(id: string): boolean;
|
|
127
|
-
enterFullscreen(elementRef?: HTMLElement): void;
|
|
128
|
-
exitFullscreen(): void;
|
|
129
|
-
slideToNextItem(): void;
|
|
130
|
-
slideToPrevItem(): void;
|
|
131
|
-
getIsAnimating(): boolean;
|
|
132
|
-
slideToItem(item: string | number): void;
|
|
133
|
-
getIsActiveItem(id: string): boolean;
|
|
134
|
-
getCurrentActiveItem(): {
|
|
135
|
-
id: string;
|
|
136
|
-
index: number;
|
|
137
|
-
};
|
|
138
|
-
activeItem: number;
|
|
139
|
-
};
|
|
140
|
-
export declare type SlideActionType = 'initial' | 'prev' | 'next';
|
|
141
|
-
declare type OnSlideStartChange = {
|
|
142
|
-
eventName: 'onSlideStartChange';
|
|
143
|
-
slideActionType: SlideActionType;
|
|
144
|
-
nextItem: {
|
|
145
|
-
index: number;
|
|
146
|
-
id: string;
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
declare type OnSlideChange = {
|
|
150
|
-
eventName: 'onSlideChange';
|
|
151
|
-
slideActionType: SlideActionType;
|
|
152
|
-
currentItem: {
|
|
153
|
-
index: number;
|
|
154
|
-
id: string;
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
declare type OnDrag = Omit<FullGestureState<'drag'>, 'event'> & {
|
|
158
|
-
eventName: 'onDrag';
|
|
159
|
-
slideActionType: SlideActionType;
|
|
160
|
-
};
|
|
161
|
-
declare type OnFullscreenChange = {
|
|
162
|
-
eventName: 'onFullscreenChange';
|
|
163
|
-
isFullscreen: boolean;
|
|
164
|
-
};
|
|
165
|
-
declare type OnLeftSwipe = {
|
|
166
|
-
eventName: 'onLeftSwipe';
|
|
167
|
-
};
|
|
168
|
-
declare type OnRightSwipe = {
|
|
169
|
-
eventName: 'onRightSwipe';
|
|
170
|
-
};
|
|
171
|
-
export declare type EmitObservableFn = (data: OnSlideStartChange | OnSlideChange | OnDrag | OnFullscreenChange | OnLeftSwipe | OnRightSwipe) => void;
|
|
172
|
-
export declare type EventsObservableProps = OnSlideStartChange | OnSlideChange | OnDrag | OnFullscreenChange | OnLeftSwipe | OnRightSwipe;
|
|
173
|
-
export declare type ObservableCallbackFn = (data: EventsObservableProps) => void;
|
|
174
|
-
export declare type UseListenToCustomEvent = (fn: ObservableCallbackFn) => void;
|
|
175
|
-
export {};
|