@qwanyx/carousel 0.1.0 → 0.1.2
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/dist/index.d.mts +37 -3
- package/dist/index.d.ts +37 -3
- package/dist/index.js +710 -316
- package/dist/index.mjs +692 -308
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -237,6 +237,14 @@ interface AutoplayOptions {
|
|
|
237
237
|
pauseOnHover?: boolean;
|
|
238
238
|
pauseOnInteraction?: boolean;
|
|
239
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Carousel/Asset bank identification for copy functionality
|
|
242
|
+
*/
|
|
243
|
+
interface CarouselInfo {
|
|
244
|
+
systemId: string;
|
|
245
|
+
nodeId: string;
|
|
246
|
+
title: string;
|
|
247
|
+
}
|
|
240
248
|
/**
|
|
241
249
|
* Main carousel/presentation props
|
|
242
250
|
*/
|
|
@@ -251,11 +259,19 @@ interface CarouselProps {
|
|
|
251
259
|
aspectRatio?: string;
|
|
252
260
|
allowFullscreen?: boolean;
|
|
253
261
|
theme?: 'light' | 'dark' | 'auto';
|
|
262
|
+
carouselInfo?: CarouselInfo;
|
|
263
|
+
getSlideUrl?: (slide: Slide) => string | undefined;
|
|
264
|
+
onCopyCarousel?: (info: CarouselInfo) => void;
|
|
265
|
+
onCopySlide?: (slide: Slide, url: string) => void;
|
|
254
266
|
className?: string;
|
|
255
267
|
style?: CSSProperties;
|
|
256
268
|
onSlideChange?: (index: number, slide: Slide) => void;
|
|
257
269
|
onFullscreenChange?: (isFullscreen: boolean) => void;
|
|
258
270
|
onObjectClick?: (object: SlideObject, slide: Slide) => void;
|
|
271
|
+
/** Called when thumbnails are reordered via drag&drop */
|
|
272
|
+
onThumbnailReorder?: (fromIndex: number, toIndex: number) => void;
|
|
273
|
+
/** Called when delete button is clicked on a thumbnail */
|
|
274
|
+
onThumbnailDelete?: (index: number) => void;
|
|
259
275
|
}
|
|
260
276
|
/**
|
|
261
277
|
* Carousel ref methods
|
|
@@ -305,14 +321,18 @@ interface ThumbnailsProps {
|
|
|
305
321
|
slides: Slide[];
|
|
306
322
|
currentIndex: number;
|
|
307
323
|
onSelect: (index: number) => void;
|
|
324
|
+
/** Called when slides are reordered via drag&drop. Returns new order of slide indices. */
|
|
325
|
+
onReorder?: (fromIndex: number, toIndex: number) => void;
|
|
326
|
+
/** Called when delete button is clicked on a thumbnail */
|
|
327
|
+
onDelete?: (index: number) => void;
|
|
308
328
|
position?: 'bottom' | 'left' | 'right';
|
|
309
329
|
size?: 'small' | 'medium' | 'large';
|
|
310
330
|
theme?: 'light' | 'dark';
|
|
311
331
|
}
|
|
312
332
|
/**
|
|
313
|
-
* Thumbnails navigation component
|
|
333
|
+
* Thumbnails navigation component with optional drag&drop reordering
|
|
314
334
|
*/
|
|
315
|
-
declare function Thumbnails({ slides, currentIndex, onSelect, position, size, theme, }: ThumbnailsProps): react_jsx_runtime.JSX.Element;
|
|
335
|
+
declare function Thumbnails({ slides, currentIndex, onSelect, onReorder, onDelete, position, size, theme, }: ThumbnailsProps): react_jsx_runtime.JSX.Element;
|
|
316
336
|
|
|
317
337
|
interface UseCarouselOptions {
|
|
318
338
|
slides: Slide[];
|
|
@@ -367,6 +387,20 @@ declare const createSlide: {
|
|
|
367
387
|
isActive: boolean;
|
|
368
388
|
slideIndex: number;
|
|
369
389
|
}) => React.ReactNode, options?: Partial<Omit<Slide, "id" | "layers">>) => Slide;
|
|
390
|
+
/**
|
|
391
|
+
* Create a slide to display a markdown file
|
|
392
|
+
*/
|
|
393
|
+
markdown: (id: string, url: string, options?: {
|
|
394
|
+
filename?: string;
|
|
395
|
+
thumbnail?: string;
|
|
396
|
+
}) => Slide;
|
|
397
|
+
/**
|
|
398
|
+
* Create a slide to display an audio file
|
|
399
|
+
*/
|
|
400
|
+
audio: (id: string, url: string, options?: {
|
|
401
|
+
filename?: string;
|
|
402
|
+
thumbnail?: string;
|
|
403
|
+
}) => Slide;
|
|
370
404
|
};
|
|
371
405
|
|
|
372
|
-
export { type Animation, type AnimationKeyframe, type AudioObject, type AutoplayOptions, type BaseObject, Carousel, type CarouselProps, type CarouselRef, type ComponentObject, type GroupObject, type ImageObject, type Layer, type NavigationOptions, type ObjectType, type Position, type ShapeObject, type Size, type Slide, type SlideBackground, type SlideObject, SlideRenderer, type SlideTransition, type TextObject, Thumbnails, type Transform, type TransitionType, type VideoObject, createImageSlide, createSimpleSlide, createSlide, useCarousel };
|
|
406
|
+
export { type Animation, type AnimationKeyframe, type AudioObject, type AutoplayOptions, type BaseObject, Carousel, type CarouselInfo, type CarouselProps, type CarouselRef, type ComponentObject, type GroupObject, type ImageObject, type Layer, type NavigationOptions, type ObjectType, type Position, type ShapeObject, type Size, type Slide, type SlideBackground, type SlideObject, SlideRenderer, type SlideTransition, type TextObject, Thumbnails, type Transform, type TransitionType, type VideoObject, createImageSlide, createSimpleSlide, createSlide, useCarousel };
|
package/dist/index.d.ts
CHANGED
|
@@ -237,6 +237,14 @@ interface AutoplayOptions {
|
|
|
237
237
|
pauseOnHover?: boolean;
|
|
238
238
|
pauseOnInteraction?: boolean;
|
|
239
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Carousel/Asset bank identification for copy functionality
|
|
242
|
+
*/
|
|
243
|
+
interface CarouselInfo {
|
|
244
|
+
systemId: string;
|
|
245
|
+
nodeId: string;
|
|
246
|
+
title: string;
|
|
247
|
+
}
|
|
240
248
|
/**
|
|
241
249
|
* Main carousel/presentation props
|
|
242
250
|
*/
|
|
@@ -251,11 +259,19 @@ interface CarouselProps {
|
|
|
251
259
|
aspectRatio?: string;
|
|
252
260
|
allowFullscreen?: boolean;
|
|
253
261
|
theme?: 'light' | 'dark' | 'auto';
|
|
262
|
+
carouselInfo?: CarouselInfo;
|
|
263
|
+
getSlideUrl?: (slide: Slide) => string | undefined;
|
|
264
|
+
onCopyCarousel?: (info: CarouselInfo) => void;
|
|
265
|
+
onCopySlide?: (slide: Slide, url: string) => void;
|
|
254
266
|
className?: string;
|
|
255
267
|
style?: CSSProperties;
|
|
256
268
|
onSlideChange?: (index: number, slide: Slide) => void;
|
|
257
269
|
onFullscreenChange?: (isFullscreen: boolean) => void;
|
|
258
270
|
onObjectClick?: (object: SlideObject, slide: Slide) => void;
|
|
271
|
+
/** Called when thumbnails are reordered via drag&drop */
|
|
272
|
+
onThumbnailReorder?: (fromIndex: number, toIndex: number) => void;
|
|
273
|
+
/** Called when delete button is clicked on a thumbnail */
|
|
274
|
+
onThumbnailDelete?: (index: number) => void;
|
|
259
275
|
}
|
|
260
276
|
/**
|
|
261
277
|
* Carousel ref methods
|
|
@@ -305,14 +321,18 @@ interface ThumbnailsProps {
|
|
|
305
321
|
slides: Slide[];
|
|
306
322
|
currentIndex: number;
|
|
307
323
|
onSelect: (index: number) => void;
|
|
324
|
+
/** Called when slides are reordered via drag&drop. Returns new order of slide indices. */
|
|
325
|
+
onReorder?: (fromIndex: number, toIndex: number) => void;
|
|
326
|
+
/** Called when delete button is clicked on a thumbnail */
|
|
327
|
+
onDelete?: (index: number) => void;
|
|
308
328
|
position?: 'bottom' | 'left' | 'right';
|
|
309
329
|
size?: 'small' | 'medium' | 'large';
|
|
310
330
|
theme?: 'light' | 'dark';
|
|
311
331
|
}
|
|
312
332
|
/**
|
|
313
|
-
* Thumbnails navigation component
|
|
333
|
+
* Thumbnails navigation component with optional drag&drop reordering
|
|
314
334
|
*/
|
|
315
|
-
declare function Thumbnails({ slides, currentIndex, onSelect, position, size, theme, }: ThumbnailsProps): react_jsx_runtime.JSX.Element;
|
|
335
|
+
declare function Thumbnails({ slides, currentIndex, onSelect, onReorder, onDelete, position, size, theme, }: ThumbnailsProps): react_jsx_runtime.JSX.Element;
|
|
316
336
|
|
|
317
337
|
interface UseCarouselOptions {
|
|
318
338
|
slides: Slide[];
|
|
@@ -367,6 +387,20 @@ declare const createSlide: {
|
|
|
367
387
|
isActive: boolean;
|
|
368
388
|
slideIndex: number;
|
|
369
389
|
}) => React.ReactNode, options?: Partial<Omit<Slide, "id" | "layers">>) => Slide;
|
|
390
|
+
/**
|
|
391
|
+
* Create a slide to display a markdown file
|
|
392
|
+
*/
|
|
393
|
+
markdown: (id: string, url: string, options?: {
|
|
394
|
+
filename?: string;
|
|
395
|
+
thumbnail?: string;
|
|
396
|
+
}) => Slide;
|
|
397
|
+
/**
|
|
398
|
+
* Create a slide to display an audio file
|
|
399
|
+
*/
|
|
400
|
+
audio: (id: string, url: string, options?: {
|
|
401
|
+
filename?: string;
|
|
402
|
+
thumbnail?: string;
|
|
403
|
+
}) => Slide;
|
|
370
404
|
};
|
|
371
405
|
|
|
372
|
-
export { type Animation, type AnimationKeyframe, type AudioObject, type AutoplayOptions, type BaseObject, Carousel, type CarouselProps, type CarouselRef, type ComponentObject, type GroupObject, type ImageObject, type Layer, type NavigationOptions, type ObjectType, type Position, type ShapeObject, type Size, type Slide, type SlideBackground, type SlideObject, SlideRenderer, type SlideTransition, type TextObject, Thumbnails, type Transform, type TransitionType, type VideoObject, createImageSlide, createSimpleSlide, createSlide, useCarousel };
|
|
406
|
+
export { type Animation, type AnimationKeyframe, type AudioObject, type AutoplayOptions, type BaseObject, Carousel, type CarouselInfo, type CarouselProps, type CarouselRef, type ComponentObject, type GroupObject, type ImageObject, type Layer, type NavigationOptions, type ObjectType, type Position, type ShapeObject, type Size, type Slide, type SlideBackground, type SlideObject, SlideRenderer, type SlideTransition, type TextObject, Thumbnails, type Transform, type TransitionType, type VideoObject, createImageSlide, createSimpleSlide, createSlide, useCarousel };
|