react-spring-carousel 3.0.0-beta071 → 3.0.0-beta072

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.
@@ -1,3 +1,3 @@
1
- export * from './useSpringCarousel';
2
- export * from './useTransitionCarousel';
3
- export * from './types';
1
+ export * from './common';
2
+ export * from './useSpringCarousel.types';
3
+ export * from './useTransitionCarousel.types';
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-f5b73ecb.js";
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
@@ -1,4 +1,4 @@
1
- import { u as e } from "./useThumbsModule-f5b73ecb.js";
1
+ import { u as e } from "./useThumbsModule-f4286033.js";
2
2
  import "react";
3
3
  import "@react-spring/web";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { u as De, j as P } from "./useThumbsModule-f5b73ecb.js";
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(v.val));
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-f5b73ecb.js";
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,6 +1,6 @@
1
1
  {
2
2
  "name": "react-spring-carousel",
3
- "version": "3.0.0-beta071",
3
+ "version": "3.0.0-beta072",
4
4
  "type": "module",
5
5
  "description": "A new <Carousel /> experience for the web",
6
6
  "homepage": "https://react-spring-carousel.emilianobucci.com",
@@ -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,3 +0,0 @@
1
- export * from './common';
2
- export * from './useSpringCarousel.types';
3
- export * from './useTransitionCarousel.types';
@@ -1,6 +0,0 @@
1
- import { MutableRefObject } from 'react';
2
- export type FullscreenModule = {
3
- mainCarouselWrapperRef: MutableRefObject<HTMLDivElement | null>;
4
- handleResize?(): void;
5
- onFullScreenChange(isFullscreen: boolean): void;
6
- };
@@ -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 };