@car-cutter/vanilla-webplayer 0.5.0 → 0.6.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 +67 -2
- package/dist/index.js +2812 -2778
- package/dist/index.umd.cjs +11 -11
- package/package.json +9 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
export declare function appendWebPlayerElement(parentElement: HTMLElement, props: WebPlayerProps): void;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
declare type AspectRatio = `${number}:${number}`;
|
|
4
|
+
|
|
5
|
+
declare type Category = {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
items: Item[];
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export declare type Composition = {
|
|
12
|
+
aspectRatio: AspectRatio;
|
|
13
|
+
imageHdWidth: ImageWidth;
|
|
14
|
+
imageSubWidths: ImageWidth[];
|
|
15
|
+
categories: Category[];
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export declare const DEFAULT_EVENT_PREFIX: string = "cc-webplayer:";
|
|
4
19
|
|
|
5
20
|
export declare const EVENT_COMPOSITION_LOAD_ERROR = "composition-load-error";
|
|
6
21
|
|
|
@@ -20,15 +35,65 @@ export declare const EVENT_HOTSPOTS_OFF = "hotspots-off";
|
|
|
20
35
|
|
|
21
36
|
export declare const EVENT_HOTSPOTS_ON = "hotspots-on";
|
|
22
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Generates a URL for fetching the composition JSON for a given customer and vehicle.
|
|
40
|
+
*
|
|
41
|
+
* @param {string} customerId - The ID of the customer.
|
|
42
|
+
* @param {string} vin - The Vehicle Identification Number.
|
|
43
|
+
* @returns {string} The URL to fetch the composition JSON.
|
|
44
|
+
*/
|
|
45
|
+
export declare function generateCompositionUrl(
|
|
46
|
+
customerId: string,
|
|
47
|
+
vin: string
|
|
48
|
+
): string {
|
|
49
|
+
return `https://cdn.car-cutter.com/gallery/${customerId}/${vin}/composition_v3.json`;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare type Hotspot = {
|
|
53
|
+
title: string;
|
|
54
|
+
icon?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
position: {
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
};
|
|
60
|
+
detail?: {
|
|
61
|
+
type: "image" | "link" | "pdf";
|
|
62
|
+
src: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
declare type ImageItem = { type: "image" } & ImageWithHotspots;
|
|
67
|
+
|
|
23
68
|
declare type ImageLoadStrategy = "quality" | "speed";
|
|
24
69
|
|
|
70
|
+
declare type ImageWidth = number;
|
|
71
|
+
|
|
72
|
+
declare type ImageWithHotspots = {
|
|
73
|
+
src: string;
|
|
74
|
+
hotspots?: Hotspot[];
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
declare type Item = ImageItem | VideoItem | ThreeSixtyItem;
|
|
78
|
+
|
|
79
|
+
declare type ThreeSixtyItem = {
|
|
80
|
+
type: "360";
|
|
81
|
+
images: ImageWithHotspots[];
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
declare type VideoItem = {
|
|
85
|
+
type: "video";
|
|
86
|
+
src: string;
|
|
87
|
+
poster: string;
|
|
88
|
+
};
|
|
89
|
+
|
|
25
90
|
export declare const WEB_PLAYER_ICON_WC_TAG = "cc-webplayer-icon";
|
|
26
91
|
|
|
27
92
|
export declare const WEB_PLAYER_WC_TAG = "cc-webplayer";
|
|
28
93
|
|
|
29
94
|
export declare type WebPlayerProps = {
|
|
30
95
|
compositionUrl: string;
|
|
31
|
-
|
|
96
|
+
hideCategories?: boolean;
|
|
32
97
|
infiniteCarrousel?: boolean;
|
|
33
98
|
permanentGallery?: boolean;
|
|
34
99
|
imageLoadStrategy?: ImageLoadStrategy;
|