Initial commit
This commit is contained in:
11
node_modules/embla-carousel-react/cjs/components/useEmblaCarousel.d.ts
generated
vendored
Normal file
11
node_modules/embla-carousel-react/cjs/components/useEmblaCarousel.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
import { EmblaCarouselType, EmblaOptionsType, EmblaPluginType } from 'embla-carousel';
|
||||
export type EmblaViewportRefType = <ViewportElement extends HTMLElement>(instance: ViewportElement | null) => void;
|
||||
export type UseEmblaCarouselType = [
|
||||
EmblaViewportRefType,
|
||||
EmblaCarouselType | undefined
|
||||
];
|
||||
declare function useEmblaCarousel(options?: EmblaOptionsType, plugins?: EmblaPluginType[]): UseEmblaCarouselType;
|
||||
declare namespace useEmblaCarousel {
|
||||
let globalOptions: EmblaOptionsType | undefined;
|
||||
}
|
||||
export default useEmblaCarousel;
|
||||
40
node_modules/embla-carousel-react/cjs/embla-carousel-react.cjs.js
generated
vendored
Normal file
40
node_modules/embla-carousel-react/cjs/embla-carousel-react.cjs.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
|
||||
var react = require('react');
|
||||
var emblaCarouselReactiveUtils = require('embla-carousel-reactive-utils');
|
||||
var EmblaCarousel = require('embla-carousel');
|
||||
|
||||
function useEmblaCarousel(options = {}, plugins = []) {
|
||||
const storedOptions = react.useRef(options);
|
||||
const storedPlugins = react.useRef(plugins);
|
||||
const [emblaApi, setEmblaApi] = react.useState();
|
||||
const [viewport, setViewport] = react.useState();
|
||||
const reInit = react.useCallback(() => {
|
||||
if (emblaApi) emblaApi.reInit(storedOptions.current, storedPlugins.current);
|
||||
}, [emblaApi]);
|
||||
react.useEffect(() => {
|
||||
if (emblaCarouselReactiveUtils.areOptionsEqual(storedOptions.current, options)) return;
|
||||
storedOptions.current = options;
|
||||
reInit();
|
||||
}, [options, reInit]);
|
||||
react.useEffect(() => {
|
||||
if (emblaCarouselReactiveUtils.arePluginsEqual(storedPlugins.current, plugins)) return;
|
||||
storedPlugins.current = plugins;
|
||||
reInit();
|
||||
}, [plugins, reInit]);
|
||||
react.useEffect(() => {
|
||||
if (emblaCarouselReactiveUtils.canUseDOM() && viewport) {
|
||||
EmblaCarousel.globalOptions = useEmblaCarousel.globalOptions;
|
||||
const newEmblaApi = EmblaCarousel(viewport, storedOptions.current, storedPlugins.current);
|
||||
setEmblaApi(newEmblaApi);
|
||||
return () => newEmblaApi.destroy();
|
||||
} else {
|
||||
setEmblaApi(undefined);
|
||||
}
|
||||
}, [viewport, setEmblaApi]);
|
||||
return [setViewport, emblaApi];
|
||||
}
|
||||
useEmblaCarousel.globalOptions = undefined;
|
||||
|
||||
module.exports = useEmblaCarousel;
|
||||
//# sourceMappingURL=embla-carousel-react.cjs.js.map
|
||||
1
node_modules/embla-carousel-react/cjs/embla-carousel-react.cjs.js.map
generated
vendored
Normal file
1
node_modules/embla-carousel-react/cjs/embla-carousel-react.cjs.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"embla-carousel-react.cjs.js","sources":["../src/components/useEmblaCarousel.ts"],"sourcesContent":["import { useRef, useEffect, useState, useCallback } from 'react'\nimport {\n areOptionsEqual,\n arePluginsEqual,\n canUseDOM\n} from 'embla-carousel-reactive-utils'\nimport EmblaCarousel, {\n EmblaCarouselType,\n EmblaOptionsType,\n EmblaPluginType\n} from 'embla-carousel'\n\nexport type EmblaViewportRefType = <ViewportElement extends HTMLElement>(\n instance: ViewportElement | null\n) => void\n\nexport type UseEmblaCarouselType = [\n EmblaViewportRefType,\n EmblaCarouselType | undefined\n]\n\nfunction useEmblaCarousel(\n options: EmblaOptionsType = {},\n plugins: EmblaPluginType[] = []\n): UseEmblaCarouselType {\n const storedOptions = useRef(options)\n const storedPlugins = useRef(plugins)\n const [emblaApi, setEmblaApi] = useState<EmblaCarouselType>()\n const [viewport, setViewport] = useState<HTMLElement>()\n\n const reInit = useCallback(() => {\n if (emblaApi) emblaApi.reInit(storedOptions.current, storedPlugins.current)\n }, [emblaApi])\n\n useEffect(() => {\n if (areOptionsEqual(storedOptions.current, options)) return\n storedOptions.current = options\n reInit()\n }, [options, reInit])\n\n useEffect(() => {\n if (arePluginsEqual(storedPlugins.current, plugins)) return\n storedPlugins.current = plugins\n reInit()\n }, [plugins, reInit])\n\n useEffect(() => {\n if (canUseDOM() && viewport) {\n EmblaCarousel.globalOptions = useEmblaCarousel.globalOptions\n const newEmblaApi = EmblaCarousel(\n viewport,\n storedOptions.current,\n storedPlugins.current\n )\n setEmblaApi(newEmblaApi)\n return () => newEmblaApi.destroy()\n } else {\n setEmblaApi(undefined)\n }\n }, [viewport, setEmblaApi])\n\n return [<EmblaViewportRefType>setViewport, emblaApi]\n}\n\ndeclare namespace useEmblaCarousel {\n let globalOptions: EmblaOptionsType | undefined\n}\n\nuseEmblaCarousel.globalOptions = undefined\n\nexport default useEmblaCarousel\n"],"names":["useEmblaCarousel","options","plugins","storedOptions","useRef","storedPlugins","emblaApi","setEmblaApi","useState","viewport","setViewport","reInit","useCallback","current","useEffect","areOptionsEqual","arePluginsEqual","canUseDOM","EmblaCarousel","globalOptions","newEmblaApi","destroy","undefined"],"mappings":";;;;;;AAqBA,SAASA,gBAAgBA,CACvBC,OAAA,GAA4B,EAAE,EAC9BC,UAA6B,EAAE,EAAA;AAE/B,EAAA,MAAMC,aAAa,GAAGC,YAAM,CAACH,OAAO,CAAC;AACrC,EAAA,MAAMI,aAAa,GAAGD,YAAM,CAACF,OAAO,CAAC;EACrC,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGC,cAAQ,EAAqB;EAC7D,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGF,cAAQ,EAAe;AAEvD,EAAA,MAAMG,MAAM,GAAGC,iBAAW,CAAC,MAAK;AAC9B,IAAA,IAAIN,QAAQ,EAAEA,QAAQ,CAACK,MAAM,CAACR,aAAa,CAACU,OAAO,EAAER,aAAa,CAACQ,OAAO,CAAC;AAC7E,GAAC,EAAE,CAACP,QAAQ,CAAC,CAAC;AAEdQ,EAAAA,eAAS,CAAC,MAAK;IACb,IAAIC,0CAAe,CAACZ,aAAa,CAACU,OAAO,EAAEZ,OAAO,CAAC,EAAE;IACrDE,aAAa,CAACU,OAAO,GAAGZ,OAAO;AAC/BU,IAAAA,MAAM,EAAE;AACV,GAAC,EAAE,CAACV,OAAO,EAAEU,MAAM,CAAC,CAAC;AAErBG,EAAAA,eAAS,CAAC,MAAK;IACb,IAAIE,0CAAe,CAACX,aAAa,CAACQ,OAAO,EAAEX,OAAO,CAAC,EAAE;IACrDG,aAAa,CAACQ,OAAO,GAAGX,OAAO;AAC/BS,IAAAA,MAAM,EAAE;AACV,GAAC,EAAE,CAACT,OAAO,EAAES,MAAM,CAAC,CAAC;AAErBG,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIG,oCAAS,EAAE,IAAIR,QAAQ,EAAE;AAC3BS,MAAAA,aAAa,CAACC,aAAa,GAAGnB,gBAAgB,CAACmB,aAAa;AAC5D,MAAA,MAAMC,WAAW,GAAGF,aAAa,CAC/BT,QAAQ,EACRN,aAAa,CAACU,OAAO,EACrBR,aAAa,CAACQ,OAAO,CACtB;MACDN,WAAW,CAACa,WAAW,CAAC;AACxB,MAAA,OAAO,MAAMA,WAAW,CAACC,OAAO,EAAE;AACpC,KAAC,MAAM;MACLd,WAAW,CAACe,SAAS,CAAC;AACxB;AACF,GAAC,EAAE,CAACb,QAAQ,EAAEF,WAAW,CAAC,CAAC;AAE3B,EAAA,OAAO,CAAuBG,WAAW,EAAEJ,QAAQ,CAAC;AACtD;AAMAN,gBAAgB,CAACmB,aAAa,GAAGG,SAAS;;;;"}
|
||||
2
node_modules/embla-carousel-react/cjs/index.d.ts
generated
vendored
Normal file
2
node_modules/embla-carousel-react/cjs/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export { UseEmblaCarouselType, EmblaViewportRefType } from './components/useEmblaCarousel';
|
||||
export { default } from './components/useEmblaCarousel';
|
||||
60
node_modules/embla-carousel-react/cjs/package.json
generated
vendored
Normal file
60
node_modules/embla-carousel-react/cjs/package.json
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "embla-carousel-react",
|
||||
"version": "8.3.1",
|
||||
"author": "David Jerleke",
|
||||
"description": "A lightweight carousel library with fluid motion and great swipe precision",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/davidjerleke/embla-carousel"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/davidjerleke/embla-carousel/issues"
|
||||
},
|
||||
"homepage": "https://www.embla-carousel.com",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"slider",
|
||||
"carousel",
|
||||
"slideshow",
|
||||
"gallery",
|
||||
"lightweight",
|
||||
"touch",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"react",
|
||||
"vue",
|
||||
"svelte",
|
||||
"solid"
|
||||
],
|
||||
"types": "index.d.ts",
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"embla-carousel-react*",
|
||||
"components/**/*",
|
||||
"index.d.ts"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.6",
|
||||
"@types/react": "^18.0.8",
|
||||
"@typescript-eslint/eslint-plugin": "^6.9.0",
|
||||
"@typescript-eslint/parser": "^6.9.0",
|
||||
"eslint": "^8.52.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"jest": "^29.5.0",
|
||||
"jest-environment-jsdom": "^29.5.0",
|
||||
"prettier": "2.8.8",
|
||||
"rollup": "^4.22.4",
|
||||
"ts-jest": "^29.1.1",
|
||||
"typescript": "^5.2.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"embla-carousel": "8.3.1",
|
||||
"embla-carousel-reactive-utils": "8.3.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.1 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
|
||||
},
|
||||
"main": "embla-carousel-react.cjs.js",
|
||||
"type": "commonjs"
|
||||
}
|
||||
Reference in New Issue
Block a user