astro-swiper 2.7.0 → 2.7.1

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.
package/README.md CHANGED
@@ -200,6 +200,38 @@ Swiper types are available importing types from `astro-swiper/swiper`, such as
200
200
  import type { PaginationOptions } from 'astro-swiper/swiper';
201
201
  ```
202
202
 
203
+ ## Troubleshooting
204
+
205
+ ### Import declaration conflict
206
+
207
+ On the following code,
208
+ ```jsx
209
+ import { Swiper } from 'astro-swiper';
210
+ ```
211
+ VSCode may raise the following error:
212
+ ```jsx
213
+ Import declaration conflicts with local declaration of 'Swiper'.
214
+ (alias) function Swiper(_props: AstroSwiperType): any
215
+ import Swiper
216
+ function Swiper(_props: Record<string, any>): any
217
+ ```
218
+
219
+ This is because the astro file is named `Swiper.astro`.
220
+ Renaming it in `MySwiper.astro` solves the issue.
221
+
222
+
223
+ ### Wrong AI code
224
+
225
+ AI (chatgpt, gemini...) get confused when providing examples how to use `astro-swiper`.
226
+ Common errors are:
227
+ * missing `<SwiperWrapper>`
228
+ * `<SwiperWrapper>` wrapping `<Swiper>` instead of `<SwiperSlide>`
229
+ * options provided directly to `<Swiper>` instead of inside `options` variable, such as `<Swiper options={{...}}>`
230
+ * adding `modules` in `options`. This is wrong. Modules are automatically added
231
+ * installing `swiper` is not required
232
+ * `import 'swiper/css';` is not required as performed by `astro-swiper`
233
+
234
+
203
235
  ## Help needed?
204
236
 
205
237
  **Do you need help to integrate `astro-swiper` in your astro template / component?**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-swiper",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "Astro component for swiper, dedicated to slider / carousel / photo swiper / slide, including thumbnails",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/src/index.ts CHANGED
@@ -11,7 +11,7 @@ export type selectorStringType = `.${string}` | `#${string}`;
11
11
  * Basically the same as the original SwiperOptions, but extended
12
12
  * with new capabilities
13
13
  */
14
- export interface AstroSwiperOptions extends SwiperOptions {
14
+ export interface AstroSwiperOptions extends Omit<SwiperOptions, "modules"> {
15
15
  /** options specific to astro-swiper component */
16
16
  astro?: {
17
17
  /** intersection observer options: an observer can be added to control the swiper when it appears / disappears in the screen.
@@ -62,8 +62,7 @@ export interface AstroSwiperType extends HTMLAttributes<'div'> {
62
62
  /** add the default swiper class, true by default */
63
63
  addDefaultClass?: boolean;
64
64
 
65
- /** @deprecated is not really usefull anymore. If a specific unique class or id is needed,
66
- * add it as an id or or a class directly */
65
+ /** @deprecated is not really usefull anymore. If a specific unique class or id is needed add it as an id or or a class directly */
67
66
  uniqueClass?: string;
68
67
 
69
68
  /** @deprecated use astro.options.astro.thumbsSwiperUniqueSelector instead */