main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

225
node_modules/embla-carousel-react/README.md generated vendored Normal file
View File

@@ -0,0 +1,225 @@
<br />
<div align="center">
<p align="center">
<a href="https://www.embla-carousel.com/"><img width="100" height="100" src="https://www.embla-carousel.com/embla-logo.svg" alt="Embla Carousel">
</a>
</p>
<p align="center">
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/npm/l/embla-carousel?color=%238ab4f8"></a>
<a href="https://www.npmjs.com/package/embla-carousel-react"><img src="https://img.shields.io/npm/v/embla-carousel-react.svg?color=%23c1a8e2"></a>
<a href="https://github.com/davidjerleke/embla-carousel/actions?query=workflow%3A%22Continuous+Integration%22"><img src="https://img.shields.io/github/actions/workflow/status/davidjerleke/embla-carousel/cd.yml?color=%238ab4f8"></a>
<a href="https://prettier.io"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?color=%23c1a8e2"></a>
<a href="https://bundlephobia.com/result?p=embla-carousel-react@latest"><img src="https://img.shields.io/bundlephobia/minzip/embla-carousel-react?color=%238ab4f8&label=gzip%20size">
</a>
</p>
<strong>
<h2 align="center">Embla Carousel React</h2>
</strong>
<p align="center">
<strong>Embla Carousel</strong> is a bare bones carousel library with great fluid motion and awesome swipe precision. It's library agnostic, dependency free and 100% open source.
</p>
<br>
<p align="center">
<strong>
<code>&nbsp;<a href="https://www.embla-carousel.com/examples/predefined/">Examples</a>&nbsp;</code>
</strong>
</p>
<p align="center">
<strong>
<code>&nbsp;<a href="https://www.embla-carousel.com/examples/generator/">Generator</a>&nbsp;</code>
</strong>
</p>
<p align="center">
<strong>
<code>&nbsp;<a href="https://www.embla-carousel.com/get-started/#choose-installation-type">Installation</a>&nbsp;</code>
</strong>
</p>
</div>
<br>
<div align="center">
<strong>
<h2 align="center">Ready for</h2>
</strong>
<p align="center">
<a href="https://www.embla-carousel.com/get-started/module/">
<img src="https://www.embla-carousel.com/javascript-logo.svg" width="40" height="40" />
</a>
<a href="https://www.embla-carousel.com/get-started/module/">
<img src="https://www.embla-carousel.com/typescript-logo.svg" width="40" height="40" />
</a>
<a href="https://www.embla-carousel.com/get-started/react/">
<img src="https://www.embla-carousel.com/react-logo.svg" width="40" height="40" />
</a>
<a href="https://www.embla-carousel.com/get-started/vue/">
<img src="https://www.embla-carousel.com/vue-logo.svg" width="40" height="40" />
</a>
<a href="https://www.embla-carousel.com/get-started/svelte/">
<img src="https://www.embla-carousel.com/svelte-logo.svg" width="40" height="40" />
</a>
<a href="https://www.embla-carousel.com/get-started/solid/">
<img src="https://www.embla-carousel.com/solid-logo.svg" width="40" height="40" />
</a>
<a href="https://github.com/donaldxdonald/embla-carousel-angular">
<img src="https://www.embla-carousel.com/angular-logo.svg" width="40" height="40" />
</a>
</p>
</div>
<br>
<div align="center">
<strong>
<h2 align="center">Contributors</h2>
</strong>
<p align="center">
Thank you to all contributors for making <a href="https://www.embla-carousel.com/">Embla Carousel</a> awesome! <a href="https://github.com/davidjerleke/embla-carousel/blob/master/CONTRIBUTING.md">Contributions</a> are welcome.
</p>
<p align="center">
<a href="https://github.com/davidjerleke">
<img src="https://avatars2.githubusercontent.com/u/11529148?s=120&v=4" title="davidjerleke" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/Ronit-gurjar">
<img src="https://avatars2.githubusercontent.com/u/92150685?s=120&v=4" title="Ronit-gurjar" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/zaaakher">
<img src="https://avatars2.githubusercontent.com/u/46135573?s=120&v=4" title="zaaakher" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/xiel">
<img src="https://avatars2.githubusercontent.com/u/615522?s=120&v=4" title="xiel" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/javiergonzalezGenially">
<img src="https://avatars2.githubusercontent.com/u/78730098?s=120&v=4" title="javiergonzalezGenially" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/meirroth">
<img src="https://avatars2.githubusercontent.com/u/12494197?s=120&v=4" title="meirroth" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/hamidrezahanafi">
<img src="https://avatars2.githubusercontent.com/u/91487491?s=120&v=4" title="hamidrezahanafi" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/negezor">
<img src="https://avatars2.githubusercontent.com/u/9392723?s=120&v=4" title="negezor" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/th-km">
<img src="https://avatars2.githubusercontent.com/u/35410212?s=120&v=4" title="th-km" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/openscript">
<img src="https://avatars2.githubusercontent.com/u/1105080?s=120&v=4" title="openscript" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/nwidynski">
<img src="https://avatars2.githubusercontent.com/u/25958801?s=120&v=4" title="nwidynski" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/wopian">
<img src="https://avatars2.githubusercontent.com/u/3440094?s=120&v=4" title="wopian" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/mujahidfa">
<img src="https://avatars2.githubusercontent.com/u/17759705?s=120&v=4" title="mujahidfa" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/nikrowell">
<img src="https://avatars2.githubusercontent.com/u/260039?s=120&v=4" title="nikrowell" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/horseeyephil">
<img src="https://avatars2.githubusercontent.com/u/32337092?s=120&v=4" title="horseeyephil" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/pipisasa">
<img src="https://avatars2.githubusercontent.com/u/54534600?s=120&v=4" title="pipisasa" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/ranno-lauri">
<img src="https://avatars2.githubusercontent.com/u/87007115?s=120&v=4" title="ranno-lauri" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/ruijdacd">
<img src="https://avatars2.githubusercontent.com/u/9107610?s=120&v=4" title="ruijdacd" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/rojadesign">
<img src="https://avatars2.githubusercontent.com/u/35687281?s=120&v=4" title="rojadesign" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/sadeghbarati">
<img src="https://avatars2.githubusercontent.com/u/17789047?s=120&v=4" title="sadeghbarati" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/S-Shingler">
<img src="https://avatars2.githubusercontent.com/u/48463809?s=120&v=4" title="S-Shingler" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/smultar">
<img src="https://avatars2.githubusercontent.com/u/6223536?s=120&v=4" title="smultar" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/tlo-johnson">
<img src="https://avatars2.githubusercontent.com/u/8763144?s=120&v=4" title="tlo-johnson" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/anzbert">
<img src="https://avatars2.githubusercontent.com/u/38823700?s=120&v=4" title="anzbert" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/sarussss">
<img src="https://avatars2.githubusercontent.com/u/15656996?s=120&v=4" title="sarussss" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/silllli">
<img src="https://avatars2.githubusercontent.com/u/9334305?s=120&v=4" title="silllli" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/romellem">
<img src="https://avatars2.githubusercontent.com/u/8504000?s=120&v=4" title="romellem" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/junlarsen">
<img src="https://avatars2.githubusercontent.com/u/42585241?s=120&v=4" title="junlarsen" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/LucasMariniFalbo">
<img src="https://avatars2.githubusercontent.com/u/9245477?s=120&v=4" title="LucasMariniFalbo" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/LiamMartens">
<img src="https://avatars2.githubusercontent.com/u/5265324?s=120&v=4" title="LiamMartens" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/JoshuaCrewe">
<img src="https://avatars2.githubusercontent.com/u/12238901?s=120&v=4" title="JoshuaCrewe" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/S1r-Lanzelot">
<img src="https://avatars2.githubusercontent.com/u/4487160?s=120&v=4" title="S1r-Lanzelot" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/ishaqibrahimbot">
<img src="https://avatars2.githubusercontent.com/u/74908398?s=120&v=4" title="ishaqibrahimbot" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/fcasibu">
<img src="https://avatars2.githubusercontent.com/u/75290989?s=120&v=4" title="fcasibu" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/cundd">
<img src="https://avatars2.githubusercontent.com/u/743122?s=120&v=4" title="cundd" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/sedlukha">
<img src="https://avatars2.githubusercontent.com/u/14075940?s=120&v=4" title="sedlukha" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/allen-garvey">
<img src="https://avatars2.githubusercontent.com/u/9314727?s=120&v=4" title="allen-garvey" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/lesha1201">
<img src="https://avatars2.githubusercontent.com/u/10157660?s=120&v=4" title="lesha1201" width="50" height="50" style="max-width: 100%" />
</a><a href="https://github.com/SaizFerri">
<img src="https://avatars2.githubusercontent.com/u/19834971?s=120&v=4" title="SaizFerri" width="50" height="50" style="max-width: 100%" />
</a>
</p>
</div>
<br>
<div align="center">
<strong>
<h2 align="center">Special Thanks</h2>
</strong>
<p align="center">
<sup>
<a href="https://github.com/gunnarx2">gunnarx2</a> - React wrapper <a href="https://www.embla-carousel.com/get-started/react/">useEmblaCarousel</a>.
</sup>
<br>
<sup>
<a href="https://github.com/LiamMartens">LiamMartens</a> - Solid wrapper <a href="https://www.embla-carousel.com/get-started/solid/">createEmblaCarousel</a>.
</sup>
<br>
<sup>
<a href="https://github.com/donaldxdonald">donaldxdonald</a>, <a href="https://github.com/zip-fa">zip-fa</a>, <a href="https://github.com/JeanMeche">JeanMeche</a> - Angular wrapper <a href="https://github.com/donaldxdonald/embla-carousel-angular?tab=readme-ov-file#installation">EmblaCarouselDirective</a>.
</sup>
<br>
<sup>
<a href="https://github.com/xiel">xiel</a> - Plugin <a href="https://github.com/xiel/embla-carousel-wheel-gestures">Embla Carousel Wheel Gestures</a>.
</sup>
<br>
<sup>
<a href="https://github.com/zaaakher">zaaakher</a> - Contributing <a href="https://github.com/davidjerleke/embla-carousel/blob/master/CONTRIBUTING.md">guidelines</a>.
</sup>
<br>
<sup>
<a href="https://github.com/sarussss">sarussss</a> - Answering questions.
</sup>
</p>
</div>
<br>
<h2 align="center">Open Source</h2>
<p align="center">
Embla is <a href="https://github.com/davidjerleke/embla-carousel/blob/master/LICENSE">MIT licensed</a> 💖.<br><br>
<sup>Embla Carousel - Copyright © 2019-present.</sup><br />
<sup>Package created by David Jerleke.</sup>
</p>
<p align="center">
<strong>· · ·</strong>
</p>
<p align="center">
Thanks <a href="https://www.browserstack.com">BrowserStack</a>.
</p>
<p align="center">
<a href="https://www.browserstack.com">
<img src="https://www.embla-carousel.com/browserstack-logo.svg" width="45" height="45" />
</a>
</p>

View 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;

View 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

View 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,CAAA;AACrC,EAAA,MAAMI,aAAa,GAAGD,YAAM,CAACF,OAAO,CAAC,CAAA;EACrC,MAAM,CAACI,QAAQ,EAAEC,WAAW,CAAC,GAAGC,cAAQ,EAAqB,CAAA;EAC7D,MAAM,CAACC,QAAQ,EAAEC,WAAW,CAAC,GAAGF,cAAQ,EAAe,CAAA;AAEvD,EAAA,MAAMG,MAAM,GAAGC,iBAAW,CAAC,MAAK;AAC9B,IAAA,IAAIN,QAAQ,EAAEA,QAAQ,CAACK,MAAM,CAACR,aAAa,CAACU,OAAO,EAAER,aAAa,CAACQ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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
View File

@@ -0,0 +1,60 @@
{
"name": "embla-carousel-react",
"version": "8.3.0",
"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.1.5",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"dependencies": {
"embla-carousel": "8.3.0",
"embla-carousel-reactive-utils": "8.3.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.1 || ^18.0.0"
},
"main": "embla-carousel-react.cjs.js",
"type": "commonjs"
}

View 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;

File diff suppressed because one or more lines are too long

View 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;

View File

@@ -0,0 +1,38 @@
import { useRef, useState, useCallback, useEffect } from 'react';
import { areOptionsEqual, arePluginsEqual, canUseDOM } from 'embla-carousel-reactive-utils';
import EmblaCarousel from 'embla-carousel';
function useEmblaCarousel(options = {}, plugins = []) {
const storedOptions = useRef(options);
const storedPlugins = useRef(plugins);
const [emblaApi, setEmblaApi] = useState();
const [viewport, setViewport] = useState();
const reInit = useCallback(() => {
if (emblaApi) emblaApi.reInit(storedOptions.current, storedPlugins.current);
}, [emblaApi]);
useEffect(() => {
if (areOptionsEqual(storedOptions.current, options)) return;
storedOptions.current = options;
reInit();
}, [options, reInit]);
useEffect(() => {
if (arePluginsEqual(storedPlugins.current, plugins)) return;
storedPlugins.current = plugins;
reInit();
}, [plugins, reInit]);
useEffect(() => {
if (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;
export { useEmblaCarousel as default };
//# sourceMappingURL=embla-carousel-react.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"embla-carousel-react.esm.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","newEmbl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,CAAA;AAC5D,MAAA,MAAMC,WAAW,GAAGF,aAAa,CAC/BT,QAAQ,EACRN,aAAa,CAACU,OAAO,EACrBR,aAAa,CAACQ,OAAO,CACtB,CAAA;MACDN,WAAW,CAACa,WAAW,CAAC,CAAA;AACxB,MAAA,OAAO,MAAMA,WAAW,CAACC,OAAO,EAAE,CAAA;AACpC,KAAC,MAAM;MACLd,WAAW,CAACe,SAAS,CAAC,CAAA;AACxB,KAAA;AACF,GAAC,EAAE,CAACb,QAAQ,EAAEF,WAAW,CAAC,CAAC,CAAA;AAE3B,EAAA,OAAO,CAAuBG,WAAW,EAAEJ,QAAQ,CAAC,CAAA;AACtD,CAAA;AAMAN,gBAAgB,CAACmB,aAAa,GAAGG,SAAS;;;;"}

2
node_modules/embla-carousel-react/esm/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export { UseEmblaCarouselType, EmblaViewportRefType } from './components/useEmblaCarousel.js';
export { default } from './components/useEmblaCarousel.js';

60
node_modules/embla-carousel-react/esm/package.json generated vendored Normal file
View File

@@ -0,0 +1,60 @@
{
"name": "embla-carousel-react",
"version": "8.3.0",
"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.1.5",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"dependencies": {
"embla-carousel": "8.3.0",
"embla-carousel-reactive-utils": "8.3.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.1 || ^18.0.0"
},
"module": "embla-carousel-react.esm.js",
"type": "module"
}

2
node_modules/embla-carousel-react/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export { UseEmblaCarouselType, EmblaViewportRefType } from './components/useEmblaCarousel';
export { default } from './components/useEmblaCarousel';

82
node_modules/embla-carousel-react/package.json generated vendored Normal file
View File

@@ -0,0 +1,82 @@
{
"name": "embla-carousel-react",
"version": "8.3.0",
"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"
],
"main": "embla-carousel-react.umd.js",
"unpkg": "embla-carousel-react.umd.js",
"module": "./esm/embla-carousel-react.esm.js",
"types": "index.d.ts",
"sideEffects": false,
"files": [
"embla-carousel-react*",
"components/**/*",
"index.d.ts",
"esm/**/*",
"cjs/**/*"
],
"scripts": {
"test": "echo \"Info: no tests specified\" && exit 0",
"build": "rollup --bundleConfigAsCjs -c",
"start": "rollup --bundleConfigAsCjs -c --watch --environment BUILD:development",
"eslint:report": "eslint \"src/**/*.{js,tsx,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.1.5",
"ts-jest": "^29.1.1",
"typescript": "^5.2.2"
},
"dependencies": {
"embla-carousel": "8.3.0",
"embla-carousel-reactive-utils": "8.3.0"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.1 || ^18.0.0"
},
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./esm/index.d.ts",
"default": "./esm/embla-carousel-react.esm.js"
},
"require": {
"types": "./cjs/index.d.ts",
"default": "./cjs/embla-carousel-react.cjs.js"
}
}
}
}