@qwanyx/carousel 0.1.0 → 0.1.3

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 CHANGED
@@ -1,4 +1,4 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
1
+ import React$1, { CSSProperties, ReactNode } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  /**
@@ -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,31 @@ 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;
275
+ /** Called when an image is edited and saved (enables editing on double-click) */
276
+ onImageEdit?: (index: number, blob: Blob) => void;
277
+ /** Default aspect ratio for the image editor */
278
+ editorAspectRatio?: '4/3' | '16/9' | '1/1' | '3/4' | '9/16' | 'free';
279
+ /** ImageEditor component from @qwanyx/stack (pass it to enable editing) */
280
+ ImageEditor?: React.ComponentType<{
281
+ src: string;
282
+ onSave: (blob: Blob) => void;
283
+ onCancel?: () => void;
284
+ aspectRatio?: '4/3' | '16/9' | '1/1' | '3/4' | '9/16' | 'free';
285
+ theme?: 'light' | 'dark';
286
+ }>;
259
287
  }
260
288
  /**
261
289
  * Carousel ref methods
@@ -289,7 +317,7 @@ declare function createImageSlide(id: string, src: string, options?: {
289
317
  /**
290
318
  * Qwanyx Carousel - Universal slide/presentation engine
291
319
  */
292
- declare const Carousel: React.ForwardRefExoticComponent<CarouselProps & React.RefAttributes<CarouselRef>>;
320
+ declare const Carousel: React$1.ForwardRefExoticComponent<CarouselProps & React$1.RefAttributes<CarouselRef>>;
293
321
 
294
322
  interface SlideRendererProps {
295
323
  slide: Slide;
@@ -305,14 +333,18 @@ interface ThumbnailsProps {
305
333
  slides: Slide[];
306
334
  currentIndex: number;
307
335
  onSelect: (index: number) => void;
336
+ /** Called when slides are reordered via drag&drop. Returns new order of slide indices. */
337
+ onReorder?: (fromIndex: number, toIndex: number) => void;
338
+ /** Called when delete button is clicked on a thumbnail */
339
+ onDelete?: (index: number) => void;
308
340
  position?: 'bottom' | 'left' | 'right';
309
341
  size?: 'small' | 'medium' | 'large';
310
342
  theme?: 'light' | 'dark';
311
343
  }
312
344
  /**
313
- * Thumbnails navigation component
345
+ * Thumbnails navigation component with optional drag&drop reordering
314
346
  */
315
- declare function Thumbnails({ slides, currentIndex, onSelect, position, size, theme, }: ThumbnailsProps): react_jsx_runtime.JSX.Element;
347
+ declare function Thumbnails({ slides, currentIndex, onSelect, onReorder, onDelete, position, size, theme, }: ThumbnailsProps): react_jsx_runtime.JSX.Element;
316
348
 
317
349
  interface UseCarouselOptions {
318
350
  slides: Slide[];
@@ -366,7 +398,21 @@ declare const createSlide: {
366
398
  component: (id: string, render: (props: {
367
399
  isActive: boolean;
368
400
  slideIndex: number;
369
- }) => React.ReactNode, options?: Partial<Omit<Slide, "id" | "layers">>) => Slide;
401
+ }) => React$1.ReactNode, options?: Partial<Omit<Slide, "id" | "layers">>) => Slide;
402
+ /**
403
+ * Create a slide to display a markdown file
404
+ */
405
+ markdown: (id: string, url: string, options?: {
406
+ filename?: string;
407
+ thumbnail?: string;
408
+ }) => Slide;
409
+ /**
410
+ * Create a slide to display an audio file
411
+ */
412
+ audio: (id: string, url: string, options?: {
413
+ filename?: string;
414
+ thumbnail?: string;
415
+ }) => Slide;
370
416
  };
371
417
 
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 };
418
+ 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
@@ -1,4 +1,4 @@
1
- import React, { CSSProperties, ReactNode } from 'react';
1
+ import React$1, { CSSProperties, ReactNode } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
 
4
4
  /**
@@ -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,31 @@ 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;
275
+ /** Called when an image is edited and saved (enables editing on double-click) */
276
+ onImageEdit?: (index: number, blob: Blob) => void;
277
+ /** Default aspect ratio for the image editor */
278
+ editorAspectRatio?: '4/3' | '16/9' | '1/1' | '3/4' | '9/16' | 'free';
279
+ /** ImageEditor component from @qwanyx/stack (pass it to enable editing) */
280
+ ImageEditor?: React.ComponentType<{
281
+ src: string;
282
+ onSave: (blob: Blob) => void;
283
+ onCancel?: () => void;
284
+ aspectRatio?: '4/3' | '16/9' | '1/1' | '3/4' | '9/16' | 'free';
285
+ theme?: 'light' | 'dark';
286
+ }>;
259
287
  }
260
288
  /**
261
289
  * Carousel ref methods
@@ -289,7 +317,7 @@ declare function createImageSlide(id: string, src: string, options?: {
289
317
  /**
290
318
  * Qwanyx Carousel - Universal slide/presentation engine
291
319
  */
292
- declare const Carousel: React.ForwardRefExoticComponent<CarouselProps & React.RefAttributes<CarouselRef>>;
320
+ declare const Carousel: React$1.ForwardRefExoticComponent<CarouselProps & React$1.RefAttributes<CarouselRef>>;
293
321
 
294
322
  interface SlideRendererProps {
295
323
  slide: Slide;
@@ -305,14 +333,18 @@ interface ThumbnailsProps {
305
333
  slides: Slide[];
306
334
  currentIndex: number;
307
335
  onSelect: (index: number) => void;
336
+ /** Called when slides are reordered via drag&drop. Returns new order of slide indices. */
337
+ onReorder?: (fromIndex: number, toIndex: number) => void;
338
+ /** Called when delete button is clicked on a thumbnail */
339
+ onDelete?: (index: number) => void;
308
340
  position?: 'bottom' | 'left' | 'right';
309
341
  size?: 'small' | 'medium' | 'large';
310
342
  theme?: 'light' | 'dark';
311
343
  }
312
344
  /**
313
- * Thumbnails navigation component
345
+ * Thumbnails navigation component with optional drag&drop reordering
314
346
  */
315
- declare function Thumbnails({ slides, currentIndex, onSelect, position, size, theme, }: ThumbnailsProps): react_jsx_runtime.JSX.Element;
347
+ declare function Thumbnails({ slides, currentIndex, onSelect, onReorder, onDelete, position, size, theme, }: ThumbnailsProps): react_jsx_runtime.JSX.Element;
316
348
 
317
349
  interface UseCarouselOptions {
318
350
  slides: Slide[];
@@ -366,7 +398,21 @@ declare const createSlide: {
366
398
  component: (id: string, render: (props: {
367
399
  isActive: boolean;
368
400
  slideIndex: number;
369
- }) => React.ReactNode, options?: Partial<Omit<Slide, "id" | "layers">>) => Slide;
401
+ }) => React$1.ReactNode, options?: Partial<Omit<Slide, "id" | "layers">>) => Slide;
402
+ /**
403
+ * Create a slide to display a markdown file
404
+ */
405
+ markdown: (id: string, url: string, options?: {
406
+ filename?: string;
407
+ thumbnail?: string;
408
+ }) => Slide;
409
+ /**
410
+ * Create a slide to display an audio file
411
+ */
412
+ audio: (id: string, url: string, options?: {
413
+ filename?: string;
414
+ thumbnail?: string;
415
+ }) => Slide;
370
416
  };
371
417
 
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 };
418
+ 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 };