@car-cutter/vue-webplayer 0.10.0 → 0.12.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.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),e=require("./utils-CbTbWQZC.cjs"),O=require("@car-cutter/wc-webplayer"),C=t.defineComponent({__name:"WebPlayer",props:{compositionUrl:{},hideCategories:{type:Boolean},infiniteCarrousel:{type:Boolean},permanentGallery:{type:Boolean},mediaLoadStrategy:{},minMediaWidth:{},maxMediaWidth:{},preloadRange:{},preventFullScreen:{type:Boolean},eventPrefix:{},reverse360:{type:Boolean},class:{},style:{}},emits:["compositionLoading","compositionLoaded","compositionLoadError","itemChange","extendModeOn","extendModeOff","hotspotsOn","hotspotsOff","galleryOpen","galleryClose"],setup(_,{emit:s}){O.ensureCustomElementsDefinition();const r=_,{class:a,style:i,...c}=r,l={display:"block",...i??{}},N=O.webPlayerPropsToAttributes(c),E=s,p=r.eventPrefix??e.DEFAULT_EVENT_PREFIX,d=o=>`${p}${o}`,m={[e.EVENT_COMPOSITION_LOADING]:o=>E("compositionLoading",o),[e.EVENT_COMPOSITION_LOADED]:o=>E("compositionLoaded",o),[e.EVENT_COMPOSITION_LOAD_ERROR]:o=>E("compositionLoadError",o),[e.EVENT_ITEM_CHANGE]:o=>E("itemChange",o),[e.EVENT_EXTEND_MODE_ON]:()=>E("extendModeOn"),[e.EVENT_EXTEND_MODE_OFF]:()=>E("extendModeOff"),[e.EVENT_HOTSPOTS_ON]:()=>E("hotspotsOn"),[e.EVENT_HOTSPOTS_OFF]:()=>E("hotspotsOff"),[e.EVENT_GALLERY_OPEN]:()=>E("galleryOpen"),[e.EVENT_GALLERY_CLOSE]:()=>E("galleryClose")},T=new Map;return Object.entries(m).forEach(([o,n])=>{if(!n)return;const P=d(o),u=L=>n(L.detail);T.set(P,u)}),t.onMounted(()=>{T.forEach((o,n)=>{document.addEventListener(n,o)})}),t.onUnmounted(()=>{T.forEach((o,n)=>{document.removeEventListener(n,o)})}),(o,n)=>(t.openBlock(),t.createElementBlock("cc-webplayer",t.mergeProps(t.unref(N),{class:t.unref(a),style:l}),[t.renderSlot(o.$slots,"default")],16))}}),A=t.defineComponent({__name:"WebPlayerCustomMedia",props:{index:{},thumbnailSrc:{}},setup(_){const s=_,r=O.webPlayerCustomMediaPropsToAttributes(s);return(a,i)=>(t.openBlock(),t.createElementBlock("cc-webplayer-custom-media",t.normalizeProps(t.guardReactiveProps(t.unref(r))),[t.renderSlot(a.$slots,"default")],16))}}),M=t.defineComponent({__name:"WebPlayerIcon",props:{name:{}},setup(_){const s=_,r=O.webPlayerIconPropsToAttributes(s);return(a,i)=>(t.openBlock(),t.createElementBlock("cc-webplayer-icon",t.normalizeProps(t.guardReactiveProps(t.unref(r))),[t.renderSlot(a.$slots,"default")],16))}});exports.DEFAULT_EVENT_PREFIX=e.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=e.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=e.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=e.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=e.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=e.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=e.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=e.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=e.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=e.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=e.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG;exports.WEB_PLAYER_ICON_WC_TAG=e.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=e.WEB_PLAYER_WC_TAG;exports.generateCompositionUrl=e.generateCompositionUrl;exports.WebPlayer=C;exports.WebPlayerCustomMedia=A;exports.WebPlayerIcon=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),e=require("./utils-CbTbWQZC.cjs"),O=require("@car-cutter/wc-webplayer"),C=o.defineComponent({__name:"WebPlayer",props:{compositionUrl:{},hideCategoriesNav:{type:Boolean},infiniteCarrousel:{type:Boolean},permanentGallery:{type:Boolean},mediaLoadStrategy:{},minMediaWidth:{},maxMediaWidth:{},preloadRange:{},autoLoad360:{type:Boolean},autoLoadInterior360:{type:Boolean},categoriesFilter:{},extendBehavior:{},eventPrefix:{},demoSpin:{type:Boolean},reverse360:{type:Boolean},class:{},style:{}},emits:["compositionLoading","compositionLoaded","compositionLoadError","itemChange","extendModeOn","extendModeOff","hotspotsOn","hotspotsOff","galleryOpen","galleryClose"],setup(_,{emit:s}){O.ensureCustomElementsDefinition();const r=_,{class:a,style:i,...c}=r,l={display:"block",...i??{}},N=O.webPlayerPropsToAttributes(c),E=s,p=r.eventPrefix??e.DEFAULT_EVENT_PREFIX,d=t=>`${p}${t}`,m={[e.EVENT_COMPOSITION_LOADING]:t=>E("compositionLoading",t),[e.EVENT_COMPOSITION_LOADED]:t=>E("compositionLoaded",t),[e.EVENT_COMPOSITION_LOAD_ERROR]:t=>E("compositionLoadError",t),[e.EVENT_ITEM_CHANGE]:t=>E("itemChange",t),[e.EVENT_EXTEND_MODE_ON]:()=>E("extendModeOn"),[e.EVENT_EXTEND_MODE_OFF]:()=>E("extendModeOff"),[e.EVENT_HOTSPOTS_ON]:()=>E("hotspotsOn"),[e.EVENT_HOTSPOTS_OFF]:()=>E("hotspotsOff"),[e.EVENT_GALLERY_OPEN]:()=>E("galleryOpen"),[e.EVENT_GALLERY_CLOSE]:()=>E("galleryClose")},T=new Map;return Object.entries(m).forEach(([t,n])=>{if(!n)return;const P=d(t),u=L=>n(L.detail);T.set(P,u)}),o.onMounted(()=>{T.forEach((t,n)=>{document.addEventListener(n,t)})}),o.onUnmounted(()=>{T.forEach((t,n)=>{document.removeEventListener(n,t)})}),(t,n)=>(o.openBlock(),o.createElementBlock("cc-webplayer",o.mergeProps(o.unref(N),{class:o.unref(a),style:l}),[o.renderSlot(t.$slots,"default")],16))}}),A=o.defineComponent({__name:"WebPlayerCustomMedia",props:{index:{},thumbnailSrc:{}},setup(_){const s=_,r=O.webPlayerCustomMediaPropsToAttributes(s);return(a,i)=>(o.openBlock(),o.createElementBlock("cc-webplayer-custom-media",o.normalizeProps(o.guardReactiveProps(o.unref(r))),[o.renderSlot(a.$slots,"default")],16))}}),M=o.defineComponent({__name:"WebPlayerIcon",props:{name:{}},setup(_){const s=_,r=O.webPlayerIconPropsToAttributes(s);return(a,i)=>(o.openBlock(),o.createElementBlock("cc-webplayer-icon",o.normalizeProps(o.guardReactiveProps(o.unref(r))),[o.renderSlot(a.$slots,"default")],16))}});exports.DEFAULT_EVENT_PREFIX=e.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=e.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=e.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=e.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=e.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=e.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=e.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=e.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=e.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=e.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=e.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG;exports.WEB_PLAYER_ICON_WC_TAG=e.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=e.WEB_PLAYER_WC_TAG;exports.generateCompositionUrl=e.generateCompositionUrl;exports.WebPlayer=C;exports.WebPlayerCustomMedia=A;exports.WebPlayerIcon=M;
package/dist/index.d.ts CHANGED
@@ -122,18 +122,20 @@ export declare const EVENT_HOTSPOTS_ON = "hotspots-on";
122
122
 
123
123
  export declare const EVENT_ITEM_CHANGE = "item-change";
124
124
 
125
+ declare type ExtendBehavior = "full_screen" | "event" | "none";
126
+
125
127
  /**
126
128
  * Generates a URL for fetching the composition JSON for a given customer and vehicle.
127
129
  *
128
- * @param {string} hashedCustomerId - The ID of the customer (hashed with SHA-256).
130
+ * @param {string} customerToken - The CarCutter Customer Token (computed by hasing the Customer ID with SHA-256).
129
131
  * @param {string} vin - The Vehicle Identification Number.
130
132
  * @returns {string} The URL to fetch the composition JSON.
131
133
  */
132
134
  export declare function generateCompositionUrl(
133
- hashedCustomerId: string,
135
+ customerToken: string,
134
136
  vin: string
135
137
  ): string {
136
- return `https://cdn.car-cutter.com/gallery/${hashedCustomerId}/${vin}/composition_v3.json`;
138
+ return `https://cdn.car-cutter.com/gallery/${customerToken}/${vin}/composition_v3.json`;
137
139
  }
138
140
 
139
141
  declare type Hotspot = {
@@ -157,7 +159,16 @@ declare type ImageWithHotspots = {
157
159
  hotspots?: Hotspot[];
158
160
  };
159
161
 
160
- export declare type Item = ImageItem | VideoItem | ThreeSixtyItem;
162
+ declare type InteriorThreeSixtyItem = {
163
+ type: "interior-360";
164
+ poster?: string;
165
+ } & ImageWithHotspots;
166
+
167
+ export declare type Item =
168
+ | ImageItem
169
+ | VideoItem
170
+ | ThreeSixtyItem
171
+ | InteriorThreeSixtyItem;
161
172
 
162
173
  export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
163
174
 
@@ -221,6 +232,7 @@ declare type WebPlayerIconName =
221
232
  | "UI_PLUS" // Increase zoom
222
233
  | "UI_REDUCE" // Reducing an extended view
223
234
  | "UI_360" // 360-degree view
235
+ | "UI_INTERIOR_360" // interior 360 view
224
236
  | "UI_VOLUME" // Video volume
225
237
  | "UI_VOLUME_OFF" // Muted video
226
238
  | "CONTROLS_PREV" // Go to previous media
@@ -241,7 +253,7 @@ declare type WebPlayerProps_2 = {
241
253
  compositionUrl: string;
242
254
 
243
255
  // Layout
244
- hideCategories?: boolean;
256
+ hideCategoriesNav?: boolean;
245
257
  infiniteCarrousel?: boolean;
246
258
  permanentGallery?: boolean;
247
259
 
@@ -250,10 +262,14 @@ declare type WebPlayerProps_2 = {
250
262
  minMediaWidth?: MediaWidth;
251
263
  maxMediaWidth?: MediaWidth;
252
264
  preloadRange?: number;
265
+ autoLoad360?: boolean;
266
+ autoLoadInterior360?: boolean;
253
267
 
254
- // Miscelaneous
255
- preventFullScreen?: boolean;
268
+ // Miscellaneous
269
+ categoriesFilter?: string;
270
+ extendBehavior?: ExtendBehavior;
256
271
  eventPrefix?: string;
272
+ demoSpin?: boolean;
257
273
  reverse360?: boolean;
258
274
  };
259
275
 
package/dist/index.js CHANGED
@@ -1,20 +1,24 @@
1
- import { defineComponent as l, onMounted as M, onUnmounted as h, openBlock as E, createElementBlock as _, mergeProps as A, unref as r, renderSlot as m, normalizeProps as d, guardReactiveProps as O } from "vue";
2
- import { D as g, E as W, a as v, b as I, c as S, d as D, e as x, f as R, g as V, h as B, i as w } from "./utils-_R5huBBV.js";
3
- import { j as K, k as Q, W as Z, l as ee } from "./utils-_R5huBBV.js";
1
+ import { defineComponent as l, onMounted as M, onUnmounted as h, createElementBlock as E, openBlock as _, mergeProps as g, unref as r, renderSlot as m, normalizeProps as d, guardReactiveProps as O } from "vue";
2
+ import { D as A, E as v, a as I, b as W, c as B, d as S, e as x, f as D, g as R, h as V, i as w } from "./utils-TWVtfImY.js";
3
+ import { j as K, k as Q, W as Z, l as ee } from "./utils-TWVtfImY.js";
4
4
  import { ensureCustomElementsDefinition as G, webPlayerPropsToAttributes as F, webPlayerCustomMediaPropsToAttributes as $, webPlayerIconPropsToAttributes as U } from "@car-cutter/wc-webplayer";
5
5
  const X = /* @__PURE__ */ l({
6
6
  __name: "WebPlayer",
7
7
  props: {
8
8
  compositionUrl: {},
9
- hideCategories: { type: Boolean },
9
+ hideCategoriesNav: { type: Boolean },
10
10
  infiniteCarrousel: { type: Boolean },
11
11
  permanentGallery: { type: Boolean },
12
12
  mediaLoadStrategy: {},
13
13
  minMediaWidth: {},
14
14
  maxMediaWidth: {},
15
15
  preloadRange: {},
16
- preventFullScreen: { type: Boolean },
16
+ autoLoad360: { type: Boolean },
17
+ autoLoadInterior360: { type: Boolean },
18
+ categoriesFilter: {},
19
+ extendBehavior: {},
17
20
  eventPrefix: {},
21
+ demoSpin: { type: Boolean },
18
22
  reverse360: { type: Boolean },
19
23
  class: {},
20
24
  style: {}
@@ -22,23 +26,23 @@ const X = /* @__PURE__ */ l({
22
26
  emits: ["compositionLoading", "compositionLoaded", "compositionLoadError", "itemChange", "extendModeOn", "extendModeOff", "hotspotsOn", "hotspotsOff", "galleryOpen", "galleryClose"],
23
27
  setup(n, { emit: i }) {
24
28
  G();
25
- const s = n, { class: a, style: c, ...u } = s, f = { display: "block", ...c ?? {} }, P = F(u), o = i, T = s.eventPrefix ?? g, y = (e) => `${T}${e}`, N = {
26
- [W]: (e) => o("compositionLoading", e),
27
- [v]: (e) => o("compositionLoaded", e),
28
- [I]: (e) => o("compositionLoadError", e),
29
- [S]: (e) => o("itemChange", e),
30
- [D]: () => o("extendModeOn"),
31
- [x]: () => o("extendModeOff"),
32
- [R]: () => o("hotspotsOn"),
33
- [V]: () => o("hotspotsOff"),
34
- [B]: () => o("galleryOpen"),
35
- [w]: () => o("galleryClose")
29
+ const s = n, { class: a, style: c, ...u } = s, f = { display: "block", ...c ?? {} }, y = F(u), o = i, P = s.eventPrefix ?? A, T = (e) => `${P}${e}`, L = {
30
+ [w]: (e) => o("compositionLoading", e),
31
+ [V]: (e) => o("compositionLoaded", e),
32
+ [R]: (e) => o("compositionLoadError", e),
33
+ [D]: (e) => o("itemChange", e),
34
+ [x]: () => o("extendModeOn"),
35
+ [S]: () => o("extendModeOff"),
36
+ [B]: () => o("hotspotsOn"),
37
+ [W]: () => o("hotspotsOff"),
38
+ [I]: () => o("galleryOpen"),
39
+ [v]: () => o("galleryClose")
36
40
  }, p = /* @__PURE__ */ new Map();
37
- return Object.entries(N).forEach(([e, t]) => {
41
+ return Object.entries(L).forEach(([e, t]) => {
38
42
  if (!t)
39
43
  return;
40
- const b = y(e), C = (L) => t(L.detail);
41
- p.set(b, C);
44
+ const N = T(e), b = (C) => t(C.detail);
45
+ p.set(N, b);
42
46
  }), M(() => {
43
47
  p.forEach((e, t) => {
44
48
  document.addEventListener(t, e);
@@ -47,7 +51,7 @@ const X = /* @__PURE__ */ l({
47
51
  p.forEach((e, t) => {
48
52
  document.removeEventListener(t, e);
49
53
  });
50
- }), (e, t) => (E(), _("cc-webplayer", A(r(P), {
54
+ }), (e, t) => (_(), E("cc-webplayer", g(r(y), {
51
55
  class: r(a),
52
56
  style: f
53
57
  }), [
@@ -62,7 +66,7 @@ const X = /* @__PURE__ */ l({
62
66
  },
63
67
  setup(n) {
64
68
  const s = $(n);
65
- return (a, c) => (E(), _("cc-webplayer-custom-media", d(O(r(s))), [
69
+ return (a, c) => (_(), E("cc-webplayer-custom-media", d(O(r(s))), [
66
70
  m(a.$slots, "default")
67
71
  ], 16));
68
72
  }
@@ -73,23 +77,23 @@ const X = /* @__PURE__ */ l({
73
77
  },
74
78
  setup(n) {
75
79
  const s = U(n);
76
- return (a, c) => (E(), _("cc-webplayer-icon", d(O(r(s))), [
80
+ return (a, c) => (_(), E("cc-webplayer-icon", d(O(r(s))), [
77
81
  m(a.$slots, "default")
78
82
  ], 16));
79
83
  }
80
84
  });
81
85
  export {
82
- g as DEFAULT_EVENT_PREFIX,
83
- v as EVENT_COMPOSITION_LOADED,
84
- W as EVENT_COMPOSITION_LOADING,
85
- I as EVENT_COMPOSITION_LOAD_ERROR,
86
- x as EVENT_EXTEND_MODE_OFF,
87
- D as EVENT_EXTEND_MODE_ON,
88
- w as EVENT_GALLERY_CLOSE,
89
- B as EVENT_GALLERY_OPEN,
90
- V as EVENT_HOTSPOTS_OFF,
91
- R as EVENT_HOTSPOTS_ON,
92
- S as EVENT_ITEM_CHANGE,
86
+ A as DEFAULT_EVENT_PREFIX,
87
+ V as EVENT_COMPOSITION_LOADED,
88
+ w as EVENT_COMPOSITION_LOADING,
89
+ R as EVENT_COMPOSITION_LOAD_ERROR,
90
+ S as EVENT_EXTEND_MODE_OFF,
91
+ x as EVENT_EXTEND_MODE_ON,
92
+ v as EVENT_GALLERY_CLOSE,
93
+ I as EVENT_GALLERY_OPEN,
94
+ W as EVENT_HOTSPOTS_OFF,
95
+ B as EVENT_HOTSPOTS_ON,
96
+ D as EVENT_ITEM_CHANGE,
93
97
  K as WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,
94
98
  Q as WEB_PLAYER_ICON_WC_TAG,
95
99
  Z as WEB_PLAYER_WC_TAG,
@@ -4,17 +4,17 @@ function A(o, E) {
4
4
  }
5
5
  export {
6
6
  p as D,
7
- t as E,
7
+ l as E,
8
8
  s as W,
9
- n as a,
10
- e as b,
11
- a as c,
12
- O as d,
13
- T as e,
14
- N as f,
15
- r as g,
16
- i as h,
17
- l as i,
9
+ i as a,
10
+ r as b,
11
+ N as c,
12
+ T as d,
13
+ O as e,
14
+ a as f,
15
+ e as g,
16
+ n as h,
17
+ t as i,
18
18
  _ as j,
19
19
  c as k,
20
20
  A as l
package/dist/vue2.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),e=require("./utils-CbTbWQZC.cjs"),_=require("@car-cutter/wc-webplayer");_.ensureCustomElementsDefinition();const O=t.defineComponent({props:{compositionUrl:{type:String,required:!0},hideCategories:Boolean,infiniteCarrousel:Boolean,permanentGallery:Boolean,mediaLoadStrategy:String,minMediaWidth:Number,maxMediaWidth:Number,preloadRange:Number,preventFullScreen:Boolean,eventPrefix:String,reverse360:Boolean},data(){return{eventCbMap:new Map}},computed:{attributes(){return _.webPlayerPropsToAttributes(this.$props)}},methods:{generateEventName(r){return`${this.eventPrefix||e.DEFAULT_EVENT_PREFIX}${r}`},setupEventListeners(){const r={[e.EVENT_COMPOSITION_LOADING]:o=>this.$emit("compositionLoading",o),[e.EVENT_COMPOSITION_LOADED]:o=>this.$emit("compositionLoaded",o),[e.EVENT_COMPOSITION_LOAD_ERROR]:o=>this.$emit("compositionLoadError",o),[e.EVENT_ITEM_CHANGE]:o=>this.$emit("itemChange",o),[e.EVENT_EXTEND_MODE_ON]:()=>this.$emit("extendModeOn"),[e.EVENT_EXTEND_MODE_OFF]:()=>this.$emit("extendModeOff"),[e.EVENT_HOTSPOTS_ON]:()=>this.$emit("hotspotsOn"),[e.EVENT_HOTSPOTS_OFF]:()=>this.$emit("hotspotsOff"),[e.EVENT_GALLERY_OPEN]:()=>this.$emit("galleryOpen"),[e.EVENT_GALLERY_CLOSE]:()=>this.$emit("galleryClose")};Object.entries(r).forEach(([o,E])=>{if(!E)return;const n=this.generateEventName(o),i=s=>E(s.detail);this.eventCbMap.set(n,i),document.addEventListener(n,i)})}},mounted(){this.setupEventListeners()},beforeDestroy(){this.eventCbMap.forEach((r,o)=>{document.removeEventListener(o,r)})}}),a=(r,o)=>{const E=r.__vccOpts||r;for(const[n,i]of o)E[n]=i;return E};function T(r,o,E,n,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const N=a(O,[["render",T]]),p=t.defineComponent({props:{index:{type:Number,required:!0},thumbnailSrc:String},computed:{attributes(){return _.webPlayerCustomMediaPropsToAttributes(this.$props)}}});function c(r,o,E,n,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer-custom-media",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const u=a(p,[["render",c]]),l=t.defineComponent({props:{name:{type:String,required:!0}},computed:{attributes(){return _.webPlayerIconPropsToAttributes(this.$props)}}});function d(r,o,E,n,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer-icon",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const m=a(l,[["render",d]]);exports.DEFAULT_EVENT_PREFIX=e.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=e.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=e.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=e.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=e.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=e.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=e.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=e.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=e.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=e.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=e.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG;exports.WEB_PLAYER_ICON_WC_TAG=e.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=e.WEB_PLAYER_WC_TAG;exports.generateCompositionUrl=e.generateCompositionUrl;exports.WebPlayer=N;exports.WebPlayerCustomMedia=u;exports.WebPlayerIcon=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),e=require("./utils-CbTbWQZC.cjs"),_=require("@car-cutter/wc-webplayer");_.ensureCustomElementsDefinition();const O=t.defineComponent({props:{compositionUrl:{type:String,required:!0},hideCategoriesNav:Boolean,infiniteCarrousel:Boolean,permanentGallery:Boolean,mediaLoadStrategy:String,minMediaWidth:Number,maxMediaWidth:Number,preloadRange:Number,autoLoad360:Boolean,autoLoadInterior360:Boolean,categoriesFilter:String,extendBehavior:String,eventPrefix:String,demoSpin:Boolean,reverse360:Boolean},data(){return{eventCbMap:new Map}},computed:{attributes(){return _.webPlayerPropsToAttributes(this.$props)}},methods:{generateEventName(r){return`${this.eventPrefix||e.DEFAULT_EVENT_PREFIX}${r}`},setupEventListeners(){const r={[e.EVENT_COMPOSITION_LOADING]:o=>this.$emit("compositionLoading",o),[e.EVENT_COMPOSITION_LOADED]:o=>this.$emit("compositionLoaded",o),[e.EVENT_COMPOSITION_LOAD_ERROR]:o=>this.$emit("compositionLoadError",o),[e.EVENT_ITEM_CHANGE]:o=>this.$emit("itemChange",o),[e.EVENT_EXTEND_MODE_ON]:()=>this.$emit("extendModeOn"),[e.EVENT_EXTEND_MODE_OFF]:()=>this.$emit("extendModeOff"),[e.EVENT_HOTSPOTS_ON]:()=>this.$emit("hotspotsOn"),[e.EVENT_HOTSPOTS_OFF]:()=>this.$emit("hotspotsOff"),[e.EVENT_GALLERY_OPEN]:()=>this.$emit("galleryOpen"),[e.EVENT_GALLERY_CLOSE]:()=>this.$emit("galleryClose")};Object.entries(r).forEach(([o,n])=>{if(!n)return;const E=this.generateEventName(o),i=s=>n(s.detail);this.eventCbMap.set(E,i),document.addEventListener(E,i)})}},mounted(){this.setupEventListeners()},beforeDestroy(){this.eventCbMap.forEach((r,o)=>{document.removeEventListener(o,r)})}}),a=(r,o)=>{const n=r.__vccOpts||r;for(const[E,i]of o)n[E]=i;return n};function T(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const N=a(O,[["render",T]]),p=t.defineComponent({props:{index:{type:Number,required:!0},thumbnailSrc:String},computed:{attributes(){return _.webPlayerCustomMediaPropsToAttributes(this.$props)}}});function c(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer-custom-media",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const u=a(p,[["render",c]]),d=t.defineComponent({props:{name:{type:String,required:!0}},computed:{attributes(){return _.webPlayerIconPropsToAttributes(this.$props)}}});function l(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer-icon",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const m=a(d,[["render",l]]);exports.DEFAULT_EVENT_PREFIX=e.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=e.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=e.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=e.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=e.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=e.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=e.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=e.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=e.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=e.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=e.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG;exports.WEB_PLAYER_ICON_WC_TAG=e.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=e.WEB_PLAYER_WC_TAG;exports.generateCompositionUrl=e.generateCompositionUrl;exports.WebPlayer=N;exports.WebPlayerCustomMedia=u;exports.WebPlayerIcon=m;
package/dist/vue2.d.ts CHANGED
@@ -45,18 +45,20 @@ export declare const EVENT_HOTSPOTS_ON = "hotspots-on";
45
45
 
46
46
  export declare const EVENT_ITEM_CHANGE = "item-change";
47
47
 
48
+ declare type ExtendBehavior = "full_screen" | "event" | "none";
49
+
48
50
  /**
49
51
  * Generates a URL for fetching the composition JSON for a given customer and vehicle.
50
52
  *
51
- * @param {string} hashedCustomerId - The ID of the customer (hashed with SHA-256).
53
+ * @param {string} customerToken - The CarCutter Customer Token (computed by hasing the Customer ID with SHA-256).
52
54
  * @param {string} vin - The Vehicle Identification Number.
53
55
  * @returns {string} The URL to fetch the composition JSON.
54
56
  */
55
57
  export declare function generateCompositionUrl(
56
- hashedCustomerId: string,
58
+ customerToken: string,
57
59
  vin: string
58
60
  ): string {
59
- return `https://cdn.car-cutter.com/gallery/${hashedCustomerId}/${vin}/composition_v3.json`;
61
+ return `https://cdn.car-cutter.com/gallery/${customerToken}/${vin}/composition_v3.json`;
60
62
  }
61
63
 
62
64
  declare type Hotspot = {
@@ -80,7 +82,16 @@ declare type ImageWithHotspots = {
80
82
  hotspots?: Hotspot[];
81
83
  };
82
84
 
83
- export declare type Item = ImageItem | VideoItem | ThreeSixtyItem;
85
+ declare type InteriorThreeSixtyItem = {
86
+ type: "interior-360";
87
+ poster?: string;
88
+ } & ImageWithHotspots;
89
+
90
+ export declare type Item =
91
+ | ImageItem
92
+ | VideoItem
93
+ | ThreeSixtyItem
94
+ | InteriorThreeSixtyItem;
84
95
 
85
96
  export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
86
97
 
@@ -116,15 +127,19 @@ compositionUrl: {
116
127
  type: StringConstructor;
117
128
  required: true;
118
129
  };
119
- hideCategories: BooleanConstructor;
130
+ hideCategoriesNav: BooleanConstructor;
120
131
  infiniteCarrousel: BooleanConstructor;
121
132
  permanentGallery: BooleanConstructor;
122
133
  mediaLoadStrategy: StringConstructor;
123
134
  minMediaWidth: NumberConstructor;
124
135
  maxMediaWidth: NumberConstructor;
125
136
  preloadRange: NumberConstructor;
126
- preventFullScreen: BooleanConstructor;
137
+ autoLoad360: BooleanConstructor;
138
+ autoLoadInterior360: BooleanConstructor;
139
+ categoriesFilter: StringConstructor;
140
+ extendBehavior: StringConstructor;
127
141
  eventPrefix: StringConstructor;
142
+ demoSpin: BooleanConstructor;
128
143
  reverse360: BooleanConstructor;
129
144
  }>, {}, {
130
145
  eventCbMap: Map<string, EventListener>;
@@ -138,21 +153,27 @@ compositionUrl: {
138
153
  type: StringConstructor;
139
154
  required: true;
140
155
  };
141
- hideCategories: BooleanConstructor;
156
+ hideCategoriesNav: BooleanConstructor;
142
157
  infiniteCarrousel: BooleanConstructor;
143
158
  permanentGallery: BooleanConstructor;
144
159
  mediaLoadStrategy: StringConstructor;
145
160
  minMediaWidth: NumberConstructor;
146
161
  maxMediaWidth: NumberConstructor;
147
162
  preloadRange: NumberConstructor;
148
- preventFullScreen: BooleanConstructor;
163
+ autoLoad360: BooleanConstructor;
164
+ autoLoadInterior360: BooleanConstructor;
165
+ categoriesFilter: StringConstructor;
166
+ extendBehavior: StringConstructor;
149
167
  eventPrefix: StringConstructor;
168
+ demoSpin: BooleanConstructor;
150
169
  reverse360: BooleanConstructor;
151
170
  }>> & Readonly<{}>, {
152
- hideCategories: boolean;
171
+ hideCategoriesNav: boolean;
153
172
  infiniteCarrousel: boolean;
154
173
  permanentGallery: boolean;
155
- preventFullScreen: boolean;
174
+ autoLoad360: boolean;
175
+ autoLoadInterior360: boolean;
176
+ demoSpin: boolean;
156
177
  reverse360: boolean;
157
178
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
158
179
 
@@ -205,6 +226,7 @@ declare type WebPlayerIconName =
205
226
  | "UI_PLUS" // Increase zoom
206
227
  | "UI_REDUCE" // Reducing an extended view
207
228
  | "UI_360" // 360-degree view
229
+ | "UI_INTERIOR_360" // interior 360 view
208
230
  | "UI_VOLUME" // Video volume
209
231
  | "UI_VOLUME_OFF" // Muted video
210
232
  | "CONTROLS_PREV" // Go to previous media
@@ -220,7 +242,7 @@ export declare type WebPlayerProps = {
220
242
  compositionUrl: string;
221
243
 
222
244
  // Layout
223
- hideCategories?: boolean;
245
+ hideCategoriesNav?: boolean;
224
246
  infiniteCarrousel?: boolean;
225
247
  permanentGallery?: boolean;
226
248
 
@@ -229,10 +251,14 @@ export declare type WebPlayerProps = {
229
251
  minMediaWidth?: MediaWidth;
230
252
  maxMediaWidth?: MediaWidth;
231
253
  preloadRange?: number;
254
+ autoLoad360?: boolean;
255
+ autoLoadInterior360?: boolean;
232
256
 
233
- // Miscelaneous
234
- preventFullScreen?: boolean;
257
+ // Miscellaneous
258
+ categoriesFilter?: string;
259
+ extendBehavior?: ExtendBehavior;
235
260
  eventPrefix?: string;
261
+ demoSpin?: boolean;
236
262
  reverse360?: boolean;
237
263
  };
238
264
 
package/dist/vue2.js CHANGED
@@ -1,20 +1,24 @@
1
- import { defineComponent as i, openBlock as a, createElementBlock as p, normalizeProps as E, guardReactiveProps as c, renderSlot as m } from "vue";
2
- import { D as _, E as d, a as l, b as f, c as O, d as $, e as h, f as b, g as N, h as T, i as P } from "./utils-_R5huBBV.js";
3
- import { j as Y, k, W as U, l as q } from "./utils-_R5huBBV.js";
4
- import { ensureCustomElementsDefinition as v, webPlayerPropsToAttributes as C, webPlayerCustomMediaPropsToAttributes as L, webPlayerIconPropsToAttributes as M } from "@car-cutter/wc-webplayer";
5
- v();
6
- const g = i({
1
+ import { defineComponent as i, createElementBlock as a, openBlock as p, normalizeProps as m, guardReactiveProps as E, renderSlot as c } from "vue";
2
+ import { D as d, E as _, a as l, b as f, c as O, d as $, e as h, f as N, g as b, h as T, i as P } from "./utils-TWVtfImY.js";
3
+ import { j as Y, k, W as U, l as q } from "./utils-TWVtfImY.js";
4
+ import { ensureCustomElementsDefinition as L, webPlayerPropsToAttributes as v, webPlayerCustomMediaPropsToAttributes as C, webPlayerIconPropsToAttributes as g } from "@car-cutter/wc-webplayer";
5
+ L();
6
+ const S = i({
7
7
  props: {
8
8
  compositionUrl: { type: String, required: !0 },
9
- hideCategories: Boolean,
9
+ hideCategoriesNav: Boolean,
10
10
  infiniteCarrousel: Boolean,
11
11
  permanentGallery: Boolean,
12
12
  mediaLoadStrategy: String,
13
13
  minMediaWidth: Number,
14
14
  maxMediaWidth: Number,
15
15
  preloadRange: Number,
16
- preventFullScreen: Boolean,
16
+ autoLoad360: Boolean,
17
+ autoLoadInterior360: Boolean,
18
+ categoriesFilter: String,
19
+ extendBehavior: String,
17
20
  eventPrefix: String,
21
+ demoSpin: Boolean,
18
22
  reverse360: Boolean
19
23
  },
20
24
  data() {
@@ -24,30 +28,30 @@ const g = i({
24
28
  },
25
29
  computed: {
26
30
  attributes() {
27
- return C(this.$props);
31
+ return v(this.$props);
28
32
  }
29
33
  },
30
34
  methods: {
31
35
  generateEventName(e) {
32
- return `${this.eventPrefix || _}${e}`;
36
+ return `${this.eventPrefix || d}${e}`;
33
37
  },
34
38
  setupEventListeners() {
35
39
  const e = {
36
- [d]: (t) => this.$emit("compositionLoading", t),
37
- [l]: (t) => this.$emit("compositionLoaded", t),
38
- [f]: (t) => this.$emit("compositionLoadError", t),
39
- [O]: (t) => this.$emit("itemChange", t),
40
- [$]: () => this.$emit("extendModeOn"),
41
- [h]: () => this.$emit("extendModeOff"),
42
- [b]: () => this.$emit("hotspotsOn"),
43
- [N]: () => this.$emit("hotspotsOff"),
44
- [T]: () => this.$emit("galleryOpen"),
45
- [P]: () => this.$emit("galleryClose")
40
+ [P]: (t) => this.$emit("compositionLoading", t),
41
+ [T]: (t) => this.$emit("compositionLoaded", t),
42
+ [b]: (t) => this.$emit("compositionLoadError", t),
43
+ [N]: (t) => this.$emit("itemChange", t),
44
+ [h]: () => this.$emit("extendModeOn"),
45
+ [$]: () => this.$emit("extendModeOff"),
46
+ [O]: () => this.$emit("hotspotsOn"),
47
+ [f]: () => this.$emit("hotspotsOff"),
48
+ [l]: () => this.$emit("galleryOpen"),
49
+ [_]: () => this.$emit("galleryClose")
46
50
  };
47
51
  Object.entries(e).forEach(([t, r]) => {
48
52
  if (!r) return;
49
- const o = this.generateEventName(t), s = (n) => r(n.detail);
50
- this.eventCbMap.set(o, s), document.addEventListener(o, s);
53
+ const o = this.generateEventName(t), n = (s) => r(s.detail);
54
+ this.eventCbMap.set(o, n), document.addEventListener(o, n);
51
55
  });
52
56
  }
53
57
  },
@@ -61,63 +65,63 @@ const g = i({
61
65
  }
62
66
  }), u = (e, t) => {
63
67
  const r = e.__vccOpts || e;
64
- for (const [o, s] of t)
65
- r[o] = s;
68
+ for (const [o, n] of t)
69
+ r[o] = n;
66
70
  return r;
67
71
  };
68
- function y(e, t, r, o, s, n) {
69
- return a(), p("cc-webplayer", E(c(e.attributes)), [
70
- m(e.$slots, "default")
72
+ function M(e, t, r, o, n, s) {
73
+ return p(), a("cc-webplayer", m(E(e.attributes)), [
74
+ c(e.$slots, "default")
71
75
  ], 16);
72
76
  }
73
- const B = /* @__PURE__ */ u(g, [["render", y]]), S = i({
77
+ const V = /* @__PURE__ */ u(S, [["render", M]]), y = i({
74
78
  props: {
75
79
  index: { type: Number, required: !0 },
76
80
  thumbnailSrc: String
77
81
  },
78
82
  computed: {
79
83
  attributes() {
80
- return L(this.$props);
84
+ return C(this.$props);
81
85
  }
82
86
  }
83
87
  });
84
- function A(e, t, r, o, s, n) {
85
- return a(), p("cc-webplayer-custom-media", E(c(e.attributes)), [
86
- m(e.$slots, "default")
88
+ function A(e, t, r, o, n, s) {
89
+ return p(), a("cc-webplayer-custom-media", m(E(e.attributes)), [
90
+ c(e.$slots, "default")
87
91
  ], 16);
88
92
  }
89
- const x = /* @__PURE__ */ u(S, [["render", A]]), D = i({
93
+ const x = /* @__PURE__ */ u(y, [["render", A]]), I = i({
90
94
  props: {
91
95
  name: { type: String, required: !0 }
92
96
  },
93
97
  computed: {
94
98
  attributes() {
95
- return M(this.$props);
99
+ return g(this.$props);
96
100
  }
97
101
  }
98
102
  });
99
- function I(e, t, r, o, s, n) {
100
- return a(), p("cc-webplayer-icon", E(c(e.attributes)), [
101
- m(e.$slots, "default")
103
+ function B(e, t, r, o, n, s) {
104
+ return p(), a("cc-webplayer-icon", m(E(e.attributes)), [
105
+ c(e.$slots, "default")
102
106
  ], 16);
103
107
  }
104
- const G = /* @__PURE__ */ u(D, [["render", I]]);
108
+ const G = /* @__PURE__ */ u(I, [["render", B]]);
105
109
  export {
106
- _ as DEFAULT_EVENT_PREFIX,
107
- l as EVENT_COMPOSITION_LOADED,
108
- d as EVENT_COMPOSITION_LOADING,
109
- f as EVENT_COMPOSITION_LOAD_ERROR,
110
- h as EVENT_EXTEND_MODE_OFF,
111
- $ as EVENT_EXTEND_MODE_ON,
112
- P as EVENT_GALLERY_CLOSE,
113
- T as EVENT_GALLERY_OPEN,
114
- N as EVENT_HOTSPOTS_OFF,
115
- b as EVENT_HOTSPOTS_ON,
116
- O as EVENT_ITEM_CHANGE,
110
+ d as DEFAULT_EVENT_PREFIX,
111
+ T as EVENT_COMPOSITION_LOADED,
112
+ P as EVENT_COMPOSITION_LOADING,
113
+ b as EVENT_COMPOSITION_LOAD_ERROR,
114
+ $ as EVENT_EXTEND_MODE_OFF,
115
+ h as EVENT_EXTEND_MODE_ON,
116
+ _ as EVENT_GALLERY_CLOSE,
117
+ l as EVENT_GALLERY_OPEN,
118
+ f as EVENT_HOTSPOTS_OFF,
119
+ O as EVENT_HOTSPOTS_ON,
120
+ N as EVENT_ITEM_CHANGE,
117
121
  Y as WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,
118
122
  k as WEB_PLAYER_ICON_WC_TAG,
119
123
  U as WEB_PLAYER_WC_TAG,
120
- B as WebPlayer,
124
+ V as WebPlayer,
121
125
  x as WebPlayerCustomMedia,
122
126
  G as WebPlayerIcon,
123
127
  q as generateCompositionUrl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@car-cutter/vue-webplayer",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "license": "Apache-2.0",
5
5
  "author": {
6
6
  "name": "CarCutter",
@@ -41,7 +41,7 @@
41
41
  "analyze": "vite-bundle-visualizer"
42
42
  },
43
43
  "dependencies": {
44
- "@car-cutter/wc-webplayer": "0.10.0"
44
+ "@car-cutter/wc-webplayer": "0.12.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "vue": ">=2"
@@ -54,7 +54,7 @@
54
54
  "browserslist-to-esbuild": "^2.1.1",
55
55
  "eslint": "^8.57.0",
56
56
  "typescript": "^5.5.4",
57
- "vite": "^5.4.1",
57
+ "vite": "^5.4.18",
58
58
  "vite-bundle-visualizer": "^1.2.1",
59
59
  "vite-plugin-dts": "^4.2.1",
60
60
  "vue": "^3.5.6",