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-reactive-utils/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-reactive-utils"><img src="https://img.shields.io/npm/v/embla-carousel-reactive-utils.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-reactive-utils@latest"><img src="https://img.shields.io/bundlephobia/minzip/embla-carousel-reactive-utils?color=%238ab4f8&label=gzip%20size">
</a>
</p>
<strong>
<h2 align="center">Embla Carousel Reactive Utils</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,7 @@
import { EmblaPluginType } from 'embla-carousel';
export declare function isObject(subject: unknown): subject is Record<string, unknown>;
export declare function isRecord(subject: unknown): subject is Record<string | number, unknown>;
export declare function canUseDOM(): boolean;
export declare function areOptionsEqual(optionsA: Record<string, unknown>, optionsB: Record<string, unknown>): boolean;
export declare function sortAndMapPluginToOptions(plugins: EmblaPluginType[]): EmblaPluginType['options'][];
export declare function arePluginsEqual(pluginsA: EmblaPluginType[], pluginsB: EmblaPluginType[]): boolean;

View File

@@ -0,0 +1,44 @@
'use strict';
function isObject(subject) {
return Object.prototype.toString.call(subject) === '[object Object]';
}
function isRecord(subject) {
return isObject(subject) || Array.isArray(subject);
}
function canUseDOM() {
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
}
function areOptionsEqual(optionsA, optionsB) {
const optionsAKeys = Object.keys(optionsA);
const optionsBKeys = Object.keys(optionsB);
if (optionsAKeys.length !== optionsBKeys.length) return false;
const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}));
const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}));
if (breakpointsA !== breakpointsB) return false;
return optionsAKeys.every(key => {
const valueA = optionsA[key];
const valueB = optionsB[key];
if (typeof valueA === 'function') return `${valueA}` === `${valueB}`;
if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB;
return areOptionsEqual(valueA, valueB);
});
}
function sortAndMapPluginToOptions(plugins) {
return plugins.concat().sort((a, b) => a.name > b.name ? 1 : -1).map(plugin => plugin.options);
}
function arePluginsEqual(pluginsA, pluginsB) {
if (pluginsA.length !== pluginsB.length) return false;
const optionsA = sortAndMapPluginToOptions(pluginsA);
const optionsB = sortAndMapPluginToOptions(pluginsB);
return optionsA.every((optionA, index) => {
const optionB = optionsB[index];
return areOptionsEqual(optionA, optionB);
});
}
exports.areOptionsEqual = areOptionsEqual;
exports.arePluginsEqual = arePluginsEqual;
exports.canUseDOM = canUseDOM;
exports.sortAndMapPluginToOptions = sortAndMapPluginToOptions;
//# sourceMappingURL=embla-carousel-reactive-utils.cjs.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"embla-carousel-reactive-utils.cjs.js","sources":["../src/components/utils.ts"],"sourcesContent":["import { EmblaPluginType } from 'embla-carousel'\n\nexport function isObject(subject: unknown): subject is Record<string, unknown> {\n return Object.prototype.toString.call(subject) === '[object Object]'\n}\n\nexport function isRecord(\n subject: unknown\n): subject is Record<string | number, unknown> {\n return isObject(subject) || Array.isArray(subject)\n}\n\nexport function canUseDOM(): boolean {\n return !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n )\n}\n\nexport function areOptionsEqual(\n optionsA: Record<string, unknown>,\n optionsB: Record<string, unknown>\n): boolean {\n const optionsAKeys = Object.keys(optionsA)\n const optionsBKeys = Object.keys(optionsB)\n\n if (optionsAKeys.length !== optionsBKeys.length) return false\n\n const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}))\n const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}))\n\n if (breakpointsA !== breakpointsB) return false\n\n return optionsAKeys.every((key) => {\n const valueA = optionsA[key]\n const valueB = optionsB[key]\n if (typeof valueA === 'function') return `${valueA}` === `${valueB}`\n if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB\n return areOptionsEqual(valueA, valueB)\n })\n}\n\nexport function sortAndMapPluginToOptions(\n plugins: EmblaPluginType[]\n): EmblaPluginType['options'][] {\n return plugins\n .concat()\n .sort((a, b) => (a.name > b.name ? 1 : -1))\n .map((plugin) => plugin.options)\n}\n\nexport function arePluginsEqual(\n pluginsA: EmblaPluginType[],\n pluginsB: EmblaPluginType[]\n): boolean {\n if (pluginsA.length !== pluginsB.length) return false\n\n const optionsA = sortAndMapPluginToOptions(pluginsA)\n const optionsB = sortAndMapPluginToOptions(pluginsB)\n\n return optionsA.every((optionA, index) => {\n const optionB = optionsB[index]\n return areOptionsEqual(optionA, optionB)\n })\n}\n"],"names":["isObject","subject","Object","prototype","toString","call","isRecord","Array","isArray","canUseDOM","window","document","createElement","areOptionsEqual","optionsA","optionsB","optionsAKeys","keys","optionsBKeys","length","breakpointsA","JSON","stringify","breakpoints","breakpointsB","every","key","valueA","valueB","sortAndMapPluginToOptions","plugins","concat","sort","a","b","name","map","plugin","options","arePluginsEqual","pluginsA","pluginsB","optionA","index","optionB"],"mappings":";;AAEM,SAAUA,QAAQA,CAACC,OAAgB,EAAA;EACvC,OAAOC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACJ,OAAO,CAAC,KAAK,iBAAiB,CAAA;AACtE,CAAA;AAEM,SAAUK,QAAQA,CACtBL,OAAgB,EAAA;EAEhB,OAAOD,QAAQ,CAACC,OAAO,CAAC,IAAIM,KAAK,CAACC,OAAO,CA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,EAAE,OAAOD,MAAM,KAAKC,MAAM,CAAA;AACpE,IAAA,OAAOf,eAAe,CAACc,MAAM,EAAEC,MAAM,CAAC,CAAA;AACxC,GAAC,CAAC,CAAA;AACJ,CAAA;AAEM,SAAUC,yBAAyBA,CACvCC,OAA0B,EAAA;AAE1B,EAAA,OAAOA,OAAO,CACXC,MAAM,EAAE,CACRC,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAMD,CAAC,CAACE,IAAI,GAAGD,CAAC,CAACC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAE,CAAC,CAC1CC,GAAG,CAAEC,MAAM,IAAKA,MAAM,CAACC,OAAO,CAAC,CAAA;AACpC,CAAA;AAEgB,SAAAC,eAAeA,CAC7BC,QAA2B,EAC3BC,QAA2B,EAAA;EAE3B,IAAID,QAAQ,CAACrB,MAAM,KAAKsB,QAAQ,CAACtB,MAAM,EAAE,OAAO,KAAK,CAAA;AAErD,EAAA,MAAML,QAAQ,GAAGe,yBAAyB,CAACW,QAAQ,CAAC,CAAA;AACpD,EAAA,MAAMzB,QAAQ,GAAGc,yBAAyB,CAACY,QAAQ,CAAC,CAAA;EAEpD,OAAO3B,QAAQ,CAACW,KAAK,CAAC,CAACiB,OAAO,EAAEC,KAAK,KAAI;AACvC,IAAA,MAAMC,OAAO,GAAG7B,QAAQ,CAAC4B,KAAK,CAAC,CAAA;AAC/B,IAAA,OAAO9B,eAAe,CAAC6B,OAAO,EAAEE,OAAO,CAAC,CAAA;AAC1C,GAAC,CAAC,CAAA;AACJ;;;;;;;"}

View File

@@ -0,0 +1 @@
export { canUseDOM, areOptionsEqual, sortAndMapPluginToOptions, arePluginsEqual } from './components/utils';

View File

@@ -0,0 +1,55 @@
{
"name": "embla-carousel-reactive-utils",
"version": "8.3.0",
"author": "David Jerleke",
"description": "Reactive utilities for Embla Carousel",
"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-reactive-utils*",
"components/**/*",
"index.d.ts"
],
"devDependencies": {
"@types/jest": "^29.5.6",
"@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"
},
"peerDependencies": {
"embla-carousel": "8.3.0"
},
"main": "embla-carousel-reactive-utils.cjs.js",
"type": "commonjs"
}

View File

@@ -0,0 +1,7 @@
import { EmblaPluginType } from 'embla-carousel';
export declare function isObject(subject: unknown): subject is Record<string, unknown>;
export declare function isRecord(subject: unknown): subject is Record<string | number, unknown>;
export declare function canUseDOM(): boolean;
export declare function areOptionsEqual(optionsA: Record<string, unknown>, optionsB: Record<string, unknown>): boolean;
export declare function sortAndMapPluginToOptions(plugins: EmblaPluginType[]): EmblaPluginType['options'][];
export declare function arePluginsEqual(pluginsA: EmblaPluginType[], pluginsB: EmblaPluginType[]): boolean;

View File

@@ -0,0 +1 @@
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).EmblaCarouselReactiveUtils={})}(this,(function(e){"use strict";function n(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function t(e,o){const i=Object.keys(e),r=Object.keys(o);if(i.length!==r.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(o.breakpoints||{}))&&i.every((i=>{const r=e[i],u=o[i];return"function"==typeof r?`${r}`==`${u}`:n(r)&&n(u)?t(r,u):r===u}))}function o(e){return e.concat().sort(((e,n)=>e.name>n.name?1:-1)).map((e=>e.options))}e.areOptionsEqual=t,e.arePluginsEqual=function(e,n){if(e.length!==n.length)return!1;const i=o(e),r=o(n);return i.every(((e,n)=>t(e,r[n])))},e.canUseDOM=function(){return!("undefined"==typeof window||!window.document||!window.document.createElement)},e.sortAndMapPluginToOptions=o}));

View File

@@ -0,0 +1,7 @@
import { EmblaPluginType } from 'embla-carousel';
export declare function isObject(subject: unknown): subject is Record<string, unknown>;
export declare function isRecord(subject: unknown): subject is Record<string | number, unknown>;
export declare function canUseDOM(): boolean;
export declare function areOptionsEqual(optionsA: Record<string, unknown>, optionsB: Record<string, unknown>): boolean;
export declare function sortAndMapPluginToOptions(plugins: EmblaPluginType[]): EmblaPluginType['options'][];
export declare function arePluginsEqual(pluginsA: EmblaPluginType[], pluginsB: EmblaPluginType[]): boolean;

View File

@@ -0,0 +1,39 @@
function isObject(subject) {
return Object.prototype.toString.call(subject) === '[object Object]';
}
function isRecord(subject) {
return isObject(subject) || Array.isArray(subject);
}
function canUseDOM() {
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
}
function areOptionsEqual(optionsA, optionsB) {
const optionsAKeys = Object.keys(optionsA);
const optionsBKeys = Object.keys(optionsB);
if (optionsAKeys.length !== optionsBKeys.length) return false;
const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}));
const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}));
if (breakpointsA !== breakpointsB) return false;
return optionsAKeys.every(key => {
const valueA = optionsA[key];
const valueB = optionsB[key];
if (typeof valueA === 'function') return `${valueA}` === `${valueB}`;
if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB;
return areOptionsEqual(valueA, valueB);
});
}
function sortAndMapPluginToOptions(plugins) {
return plugins.concat().sort((a, b) => a.name > b.name ? 1 : -1).map(plugin => plugin.options);
}
function arePluginsEqual(pluginsA, pluginsB) {
if (pluginsA.length !== pluginsB.length) return false;
const optionsA = sortAndMapPluginToOptions(pluginsA);
const optionsB = sortAndMapPluginToOptions(pluginsB);
return optionsA.every((optionA, index) => {
const optionB = optionsB[index];
return areOptionsEqual(optionA, optionB);
});
}
export { areOptionsEqual, arePluginsEqual, canUseDOM, sortAndMapPluginToOptions };
//# sourceMappingURL=embla-carousel-reactive-utils.esm.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"embla-carousel-reactive-utils.esm.js","sources":["../src/components/utils.ts"],"sourcesContent":["import { EmblaPluginType } from 'embla-carousel'\n\nexport function isObject(subject: unknown): subject is Record<string, unknown> {\n return Object.prototype.toString.call(subject) === '[object Object]'\n}\n\nexport function isRecord(\n subject: unknown\n): subject is Record<string | number, unknown> {\n return isObject(subject) || Array.isArray(subject)\n}\n\nexport function canUseDOM(): boolean {\n return !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n )\n}\n\nexport function areOptionsEqual(\n optionsA: Record<string, unknown>,\n optionsB: Record<string, unknown>\n): boolean {\n const optionsAKeys = Object.keys(optionsA)\n const optionsBKeys = Object.keys(optionsB)\n\n if (optionsAKeys.length !== optionsBKeys.length) return false\n\n const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}))\n const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}))\n\n if (breakpointsA !== breakpointsB) return false\n\n return optionsAKeys.every((key) => {\n const valueA = optionsA[key]\n const valueB = optionsB[key]\n if (typeof valueA === 'function') return `${valueA}` === `${valueB}`\n if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB\n return areOptionsEqual(valueA, valueB)\n })\n}\n\nexport function sortAndMapPluginToOptions(\n plugins: EmblaPluginType[]\n): EmblaPluginType['options'][] {\n return plugins\n .concat()\n .sort((a, b) => (a.name > b.name ? 1 : -1))\n .map((plugin) => plugin.options)\n}\n\nexport function arePluginsEqual(\n pluginsA: EmblaPluginType[],\n pluginsB: EmblaPluginType[]\n): boolean {\n if (pluginsA.length !== pluginsB.length) return false\n\n const optionsA = sortAndMapPluginToOptions(pluginsA)\n const optionsB = sortAndMapPluginToOptions(pluginsB)\n\n return optionsA.every((optionA, index) => {\n const optionB = optionsB[index]\n return areOptionsEqual(optionA, optionB)\n })\n}\n"],"names":["isObject","subject","Object","prototype","toString","call","isRecord","Array","isArray","canUseDOM","window","document","createElement","areOptionsEqual","optionsA","optionsB","optionsAKeys","keys","optionsBKeys","length","breakpointsA","JSON","stringify","breakpoints","breakpointsB","every","key","valueA","valueB","sortAndMapPluginToOptions","plugins","concat","sort","a","b","name","map","plugin","options","arePluginsEqual","pluginsA","pluginsB","optionA","index","optionB"],"mappings":"AAEM,SAAUA,QAAQA,CAACC,OAAgB,EAAA;EACvC,OAAOC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAACC,IAAI,CAACJ,OAAO,CAAC,KAAK,iBAAiB,CAAA;AACtE,CAAA;AAEM,SAAUK,QAAQA,CACtBL,OAAgB,EAAA;EAEhB,OAAOD,QAAQ,CAACC,OAAO,CAAC,IAAIM,KAAK,CAACC,OAAO,CAACP,OAAO,CAAC,CAAA;AACpD,CAAA;SAEgBQ,SAASA,GAAA;AACvB,EAAA,OAAO,CAAC,EACN,OAAOC,MAAM,KAAK,WAAW,IAC7BA,MAAM,CAACC,QAAQ,IACfD,MAAM,CAACC,QAAQ,CAACC,aAAa,CAC9B,CAAA;AACH,CAAA;AAEgB,SAAAC,eAAeA,CAC7BC,QAAiC,EACjCC,QAAiC,EAAA;AAEjC,EAAA,MAAMC,YAAY,GAAGd,MAAM,CAACe,IAAI,CAACH,QAAQ,CAAC,CAAA;AAC1C,EAAA,MAAMI,YAAY,GAAGhB,MAAM,CAACe,IAAI,CAACF,QAAQ,CAAC,CAAA;EAE1C,IAAIC,YAAY,CAACG,MAAM,KAAKD,YAAY,CAACC,MAAM,EAAE,OAAO,KAAK,CAAA;AAE7D,EAAA,MAAMC,YAAY,GAAGC,IAAI,CAACC,SA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CAACtB,MAAM,EAAE,OAAO,KAAK,CAAA;AAErD,EAAA,MAAML,QAAQ,GAAGe,yBAAyB,CAACW,QAAQ,CAAC,CAAA;AACpD,EAAA,MAAMzB,QAAQ,GAAGc,yBAAyB,CAACY,QAAQ,CAAC,CAAA;EAEpD,OAAO3B,QAAQ,CAACW,KAAK,CAAC,CAACiB,OAAO,EAAEC,KAAK,KAAI;AACvC,IAAA,MAAMC,OAAO,GAAG7B,QAAQ,CAAC4B,KAAK,CAAC,CAAA;AAC/B,IAAA,OAAO9B,eAAe,CAAC6B,OAAO,EAAEE,OAAO,CAAC,CAAA;AAC1C,GAAC,CAAC,CAAA;AACJ;;;;"}

View File

@@ -0,0 +1 @@
export { canUseDOM, areOptionsEqual, sortAndMapPluginToOptions, arePluginsEqual } from './components/utils.js';

View File

@@ -0,0 +1,55 @@
{
"name": "embla-carousel-reactive-utils",
"version": "8.3.0",
"author": "David Jerleke",
"description": "Reactive utilities for Embla Carousel",
"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-reactive-utils*",
"components/**/*",
"index.d.ts"
],
"devDependencies": {
"@types/jest": "^29.5.6",
"@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"
},
"peerDependencies": {
"embla-carousel": "8.3.0"
},
"module": "embla-carousel-reactive-utils.esm.js",
"type": "module"
}

View File

@@ -0,0 +1 @@
export { canUseDOM, areOptionsEqual, sortAndMapPluginToOptions, arePluginsEqual } from './components/utils';

View File

@@ -0,0 +1,77 @@
{
"name": "embla-carousel-reactive-utils",
"version": "8.3.0",
"author": "David Jerleke",
"description": "Reactive utilities for Embla Carousel",
"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-reactive-utils.umd.js",
"unpkg": "embla-carousel-reactive-utils.umd.js",
"module": "./esm/embla-carousel-reactive-utils.esm.js",
"types": "index.d.ts",
"sideEffects": false,
"files": [
"embla-carousel-reactive-utils*",
"components/**/*",
"index.d.ts",
"esm/**/*",
"cjs/**/*"
],
"scripts": {
"test": "jest --config jest.config.js",
"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",
"@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"
},
"peerDependencies": {
"embla-carousel": "8.3.0"
},
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./esm/index.d.ts",
"default": "./esm/embla-carousel-reactive-utils.esm.js"
},
"require": {
"types": "./cjs/index.d.ts",
"default": "./cjs/embla-carousel-reactive-utils.cjs.js"
}
}
}
}