react-spring-carousel 3.0.0-beta071 → 3.0.0-beta073
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/index.js +1 -1
- package/dist/index2.js +1 -1
- package/dist/types/useThumbsModule.types.d.ts +8 -0
- package/dist/useSpringCarousel.js +1 -1
- package/dist/{useThumbsModule-f5b73ecb.js → useThumbsModule-f4286033.js} +4 -4
- package/dist/useTransitionCarousel.js +1 -1
- package/package.json +1 -1
- package/dist/declarations/modules/index.d.ts +0 -1
- package/dist/declarations/modules/useEventsModule.d.ts +0 -5
- package/dist/declarations/modules/useFullscreenModule.d.ts +0 -6
- package/dist/declarations/modules/useThumbsModule.d.ts +0 -14
- package/dist/declarations/useSpringCarousel.d.ts +0 -18
- package/dist/declarations/useTransitionCarousel.d.ts +0 -5
- /package/dist/{declarations/index.d.ts → index.d.ts} +0 -0
- /package/dist/{declarations/types → types}/common.d.ts +0 -0
- /package/dist/{declarations/types → types}/index.d.ts +0 -0
- /package/dist/{declarations/types → types}/useEventsModule.types.d.ts +0 -0
- /package/dist/{declarations/types → types}/useFullscreenModule.types.d.ts +0 -0
- /package/dist/{declarations/types → types}/useSpringCarousel.types.d.ts +0 -0
- /package/dist/{declarations/types → types}/useTransitionCarousel.types.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useSpringCarousel as u, useSpringCarouselContext as a } from "./useSpringCarousel.js";
|
|
2
2
|
import { useTransitionCarousel as l, useTransitionCarouselContext as x } from "./useTransitionCarousel.js";
|
|
3
|
-
import "./useThumbsModule-
|
|
3
|
+
import "./useThumbsModule-f4286033.js";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@react-spring/web";
|
|
6
6
|
import "./useEventsModule-538b90c9.js";
|
package/dist/index2.js
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ItemWithThumb, PrepareThumbsData, RenderItemProps, SpringCarouselWithThumbs } from '../types';
|
|
2
|
+
export type UseThumbsModule<T extends 'use-spring' | 'use-transition'> = {
|
|
3
|
+
withThumbs?: boolean;
|
|
4
|
+
thumbsSlideAxis: SpringCarouselWithThumbs['thumbsSlideAxis'];
|
|
5
|
+
prepareThumbsData?: PrepareThumbsData<T>;
|
|
6
|
+
items: ItemWithThumb<T>[];
|
|
7
|
+
renderThumbFnProps: RenderItemProps<T>;
|
|
8
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as De, j as P } from "./useThumbsModule-
|
|
1
|
+
import { u as De, j as P } from "./useThumbsModule-f4286033.js";
|
|
2
2
|
import { useSpring as qe, config as X, useIsomorphicLayoutEffect as Be } from "@react-spring/web";
|
|
3
3
|
import { useRef as m, useEffect as N, createContext as He, useCallback as Oe, useContext as ze } from "react";
|
|
4
4
|
import { u as Xe } from "./useEventsModule-538b90c9.js";
|
|
@@ -652,9 +652,7 @@ function pr({
|
|
|
652
652
|
function f() {
|
|
653
653
|
var d;
|
|
654
654
|
return Math.round(
|
|
655
|
-
Number(
|
|
656
|
-
(d = g.current) == null ? void 0 : d[c === "x" ? "scrollWidth" : "scrollHeight"]
|
|
657
|
-
) - g.current.getBoundingClientRect()[c === "x" ? "width" : "height"]
|
|
655
|
+
Number((d = g.current) == null ? void 0 : d[c === "x" ? "scrollWidth" : "scrollHeight"]) - g.current.getBoundingClientRect()[c === "x" ? "width" : "height"]
|
|
658
656
|
);
|
|
659
657
|
}
|
|
660
658
|
function O(d) {
|
|
@@ -675,7 +673,9 @@ function pr({
|
|
|
675
673
|
val: P
|
|
676
674
|
},
|
|
677
675
|
onChange: ({ value: v }) => {
|
|
678
|
-
g.current && (g.current[c === "x" ? "scrollLeft" : "scrollTop"] = Math.abs(
|
|
676
|
+
g.current && (g.current[c === "x" ? "scrollLeft" : "scrollTop"] = Math.abs(
|
|
677
|
+
v.val
|
|
678
|
+
));
|
|
679
679
|
}
|
|
680
680
|
});
|
|
681
681
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as K, j as x } from "./useThumbsModule-
|
|
1
|
+
import { u as K, j as x } from "./useThumbsModule-f4286033.js";
|
|
2
2
|
import { useTransition as O, a as Q, config as U } from "@react-spring/web";
|
|
3
3
|
import { createContext as V, useRef as y, useState as X, useEffect as Y, useContext as Z } from "react";
|
|
4
4
|
import { u as P } from "./useEventsModule-538b90c9.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './useThumbsModule';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { EventHandler, Events } from '../types/useEventsModule.types';
|
|
2
|
-
export declare function useEventsModule<T extends 'use-spring' | 'use-transition'>(): {
|
|
3
|
-
useListenToCustomEvent: (eventHandler: EventHandler<T>) => void;
|
|
4
|
-
emitEvent: (event: Events<T>) => void;
|
|
5
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { FullscreenModule } from '../types/useFullscreenModule.types';
|
|
2
|
-
export declare function useFullscreenModule({ mainCarouselWrapperRef, onFullScreenChange, handleResize, }: FullscreenModule): {
|
|
3
|
-
enterFullscreen: (elementRef?: HTMLElement) => void;
|
|
4
|
-
exitFullscreen: () => void;
|
|
5
|
-
getIsFullscreen: () => boolean;
|
|
6
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ItemWithThumb, PrepareThumbsData, RenderItemProps, SpringCarouselWithThumbs } from '../types';
|
|
3
|
-
type Props<T extends 'use-spring' | 'use-transition'> = {
|
|
4
|
-
withThumbs?: boolean;
|
|
5
|
-
thumbsSlideAxis: SpringCarouselWithThumbs['thumbsSlideAxis'];
|
|
6
|
-
prepareThumbsData?: PrepareThumbsData<T>;
|
|
7
|
-
items: ItemWithThumb<T>[];
|
|
8
|
-
renderThumbFnProps: RenderItemProps<T>;
|
|
9
|
-
};
|
|
10
|
-
export declare function useThumbsModule<T extends 'use-spring' | 'use-transition'>({ thumbsSlideAxis, withThumbs, prepareThumbsData, items, renderThumbFnProps, }: Props<T>): {
|
|
11
|
-
thumbsFragment: JSX.Element | null;
|
|
12
|
-
handleScroll: (activeItem: number) => void;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { UseSpringCarouselWithFreeScroll, UseSpringCarouselWithThumbs, UseSpringCarouselWithNoThumbs, UseSpringCarouselWithNoFixedItems, UseSpringCarouselWithFixedItems, UseSpringFreeScrollReturnType, UseSpringReturnType } from './types';
|
|
2
|
-
type ReturnType<T> = T extends true ? UseSpringFreeScrollReturnType : UseSpringReturnType;
|
|
3
|
-
/**
|
|
4
|
-
* With free scroll
|
|
5
|
-
*/
|
|
6
|
-
declare function useSpringCarousel(props: UseSpringCarouselWithFreeScroll): ReturnType<true>;
|
|
7
|
-
declare function useSpringCarousel(props: UseSpringCarouselWithThumbs<true>): ReturnType<true>;
|
|
8
|
-
declare function useSpringCarousel(props: UseSpringCarouselWithNoThumbs<true>): ReturnType<true>;
|
|
9
|
-
/**
|
|
10
|
-
* No free scroll
|
|
11
|
-
*/
|
|
12
|
-
declare function useSpringCarousel(props: UseSpringCarouselWithThumbs<false>): ReturnType<false>;
|
|
13
|
-
declare function useSpringCarousel(props: UseSpringCarouselWithNoThumbs<false>): ReturnType<false>;
|
|
14
|
-
declare function useSpringCarousel(props: UseSpringCarouselWithFixedItems<false>): ReturnType<false>;
|
|
15
|
-
declare function useSpringCarousel(props: UseSpringCarouselWithNoFixedItems<false>): ReturnType<false>;
|
|
16
|
-
type ContextProps<T = undefined> = Omit<ReturnType<T extends 'free-scroll' ? true : false>, 'carouselFragment' | 'thumbsFragment'>;
|
|
17
|
-
declare function useSpringCarouselContext<T>(): ContextProps<T>;
|
|
18
|
-
export { useSpringCarousel, useSpringCarouselContext };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { UseTransitionCarouselProps, UseTransitionCarouselReturnProps } from './types';
|
|
2
|
-
declare function useTransitionCarousel({ init, disableGestures, items, springConfig, exitBeforeEnter, trail, withLoop, activeItem: externalActiveItem, toPrevItemSpringProps, toNextItemSpringProps, draggingSlideTreshold, thumbsSlideAxis, }: UseTransitionCarouselProps): UseTransitionCarouselReturnProps;
|
|
3
|
-
type ContextProps = Omit<UseTransitionCarouselReturnProps, 'carouselFragment' | 'thumbsFragment'>;
|
|
4
|
-
declare function useTransitionCarouselContext(): ContextProps;
|
|
5
|
-
export { useTransitionCarousel, useTransitionCarouselContext };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|