@car-cutter/react-webplayer 0.6.1 → 0.7.0

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.ts CHANGED
@@ -10,12 +10,12 @@ declare type Category = {
10
10
 
11
11
  export declare type Composition = {
12
12
  aspectRatio: AspectRatio;
13
- imageHdWidth: ImageWidth;
14
- imageSubWidths: ImageWidth[];
13
+ imageHdWidth: MediaWidth_2;
14
+ imageSubWidths: MediaWidth_2[];
15
15
  categories: Category[];
16
16
  };
17
17
 
18
- export declare const DEFAULT_EVENT_PREFIX: string = "cc-webplayer:";
18
+ export declare const DEFAULT_EVENT_PREFIX = "cc-webplayer:" satisfies string;
19
19
 
20
20
  export declare const EVENT_COMPOSITION_LOAD_ERROR = "composition-load-error";
21
21
 
@@ -35,6 +35,8 @@ export declare const EVENT_HOTSPOTS_OFF = "hotspots-off";
35
35
 
36
36
  export declare const EVENT_HOTSPOTS_ON = "hotspots-on";
37
37
 
38
+ export declare const EVENT_ITEM_CHANGE = "item-change";
39
+
38
40
  /**
39
41
  * Generates a URL for fetching the composition JSON for a given customer and vehicle.
40
42
  *
@@ -65,16 +67,20 @@ declare type Hotspot = {
65
67
 
66
68
  declare type ImageItem = { type: "image" } & ImageWithHotspots;
67
69
 
68
- declare type ImageLoadStrategy = "quality" | "speed";
69
-
70
- declare type ImageWidth = number;
71
-
72
70
  declare type ImageWithHotspots = {
73
71
  src: string;
74
72
  hotspots?: Hotspot[];
75
73
  };
76
74
 
77
- declare type Item = ImageItem | VideoItem | ThreeSixtyItem;
75
+ export declare type Item = ImageItem | VideoItem | ThreeSixtyItem;
76
+
77
+ export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
78
+
79
+ declare type MediaLoadStrategy_2 = "quality" | "balanced" | "speed";
80
+
81
+ declare type MediaWidth = number;
82
+
83
+ declare type MediaWidth_2 = number;
78
84
 
79
85
  declare type ThreeSixtyItem = {
80
86
  type: "360";
@@ -104,6 +110,10 @@ export declare type WebPlayerProps = WebPlayerProps_2 & {
104
110
  onCompositionLoading?: (url: string) => void;
105
111
  onCompositionLoaded?: (composition: Composition) => void;
106
112
  onCompositionLoadError?: (error: unknown) => void;
113
+ onItemChange?: (props: {
114
+ index: number;
115
+ item: Item;
116
+ }) => void;
107
117
  onExtendModeOn?: () => void;
108
118
  onExtendModeOff?: () => void;
109
119
  onHotspotsOn?: () => void;
@@ -117,9 +127,10 @@ declare type WebPlayerProps_2 = {
117
127
  hideCategories?: boolean;
118
128
  infiniteCarrousel?: boolean;
119
129
  permanentGallery?: boolean;
120
- imageLoadStrategy?: ImageLoadStrategy;
121
- minImageWidth?: number;
122
- maxImageWidth?: number;
130
+ mediaLoadStrategy?: MediaLoadStrategy_2;
131
+ minMediaWidth?: MediaWidth;
132
+ maxMediaWidth?: MediaWidth;
133
+ preloadRange?: number;
123
134
  preventFullScreen?: boolean;
124
135
  eventPrefix?: string;
125
136
  reverse360?: boolean;