davidjerleke / embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.
https://www.embla-carousel.com
MIT License
5.37k stars 164 forks source link

[Bug]: no specific name for plugin import, have to use "index" instead #798

Closed NicoPom closed 3 months ago

NicoPom commented 3 months ago

Which variants of Embla Carousel are you using?

Steps to reproduce

I might be wrong, but I can't find the plugin name when trying to import it. Instead I import the index file ti make it work.

Expected Behavior

Should be specific name like the Wheel Gesture Plugin

Additional Context

I have also tried...

What browsers are you seeing the problem on?

No response

Version

No response

CodeSandbox

No response

Before submitting

sarussss commented 3 months ago

Hi @NicoPom, Is it what you are talking about? https://www.embla-carousel.com/plugins/wheel-gestures/

davidjerleke commented 3 months ago

@NicoPom thanks for your bug report.

Please read the bug reports section in the contributing guidelines. Your bug report is missing crucial details and a CodeSandbox. This issue will be closed otherwise.

Thanks for cooperating.

Best David

zaaakher commented 3 months ago

Hey @NicoPom,

embla-carousel plugins are stand-alone packages that you have to install separately. For example:

embla-carousel-class-names

if you want to use the embla-carousel-class-names plugin (developed by @davidjerleke), you'll have to install it (see docs) And since the plugin component is exported by default, you simply import it like this:

import ClassNames from 'embla-carousel-class-names'

If you want to import the types as well:

import ClassNames, {
  ClassNamesOptionsType,
  ClassNamesType
} from 'embla-carousel-class-names'

embla-carousel-wheel-gestures

This plugin is developed by @xiel and the source-code can be found here. There are no default exports, so you'll have to import it like so:

import {
  WheelGesturesPlugin, //The main plugin component
  WheelGesturesPluginOptions, //The options type
} from "embla-carousel-wheel-gestures";
NicoPom commented 3 months ago

Hey @NicoPom,

embla-carousel plugins are stand-alone packages that you have to install separately. For example:

embla-carousel-class-names

if you want to use the embla-carousel-class-names plugin (developed by @davidjerleke), you'll have to install it (see docs) And since the plugin component is exported by default, you simply import it like this:

import ClassNames from 'embla-carousel-class-names'

If you want to import the types as well:

import ClassNames, {
  ClassNamesOptionsType,
  ClassNamesType
} from 'embla-carousel-class-names'

embla-carousel-wheel-gestures

This plugin is developed by @xiel and the source-code can be found here. There are no default exports, so you'll have to import it like so:

import {
  WheelGesturesPlugin, //The main plugin component
  WheelGesturesPluginOptions, //The options type
} from "embla-carousel-wheel-gestures";

Oh that's what I was talking about ! Sorry I wasn't very clear. That's the solution I was looking for : thank you :) So it was more of a lack of knowledge of Javascript from my part.