@car-cutter/vue-webplayer 0.10.0 → 0.11.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},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 = {
@@ -241,7 +243,7 @@ declare type WebPlayerProps_2 = {
241
243
  compositionUrl: string;
242
244
 
243
245
  // Layout
244
- hideCategories?: boolean;
246
+ hideCategoriesNav?: boolean;
245
247
  infiniteCarrousel?: boolean;
246
248
  permanentGallery?: boolean;
247
249
 
@@ -250,10 +252,13 @@ declare type WebPlayerProps_2 = {
250
252
  minMediaWidth?: MediaWidth;
251
253
  maxMediaWidth?: MediaWidth;
252
254
  preloadRange?: number;
255
+ autoLoad360?: boolean;
253
256
 
254
257
  // Miscelaneous
255
- preventFullScreen?: boolean;
258
+ categoriesFilter?: string;
259
+ extendBehavior?: ExtendBehavior;
256
260
  eventPrefix?: string;
261
+ demoSpin?: boolean;
257
262
  reverse360?: boolean;
258
263
  };
259
264
 
package/dist/index.js CHANGED
@@ -1,20 +1,23 @@
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";
1
+ import { defineComponent as l, onMounted as M, onUnmounted as h, openBlock as E, createElementBlock 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 W, b as I, c as S, d as x, e as B, f as D, g as R, h as V, i as w } from "./utils-_R5huBBV.js";
3
3
  import { j as K, k as Q, W as Z, l as ee } from "./utils-_R5huBBV.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
+ categoriesFilter: {},
18
+ extendBehavior: {},
17
19
  eventPrefix: {},
20
+ demoSpin: { type: Boolean },
18
21
  reverse360: { type: Boolean },
19
22
  class: {},
20
23
  style: {}
@@ -22,23 +25,23 @@ const X = /* @__PURE__ */ l({
22
25
  emits: ["compositionLoading", "compositionLoaded", "compositionLoadError", "itemChange", "extendModeOn", "extendModeOff", "hotspotsOn", "hotspotsOff", "galleryOpen", "galleryClose"],
23
26
  setup(n, { emit: i }) {
24
27
  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
+ 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}`, N = {
29
+ [v]: (e) => o("compositionLoading", e),
30
+ [W]: (e) => o("compositionLoaded", e),
28
31
  [I]: (e) => o("compositionLoadError", e),
29
32
  [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"),
33
+ [x]: () => o("extendModeOn"),
34
+ [B]: () => o("extendModeOff"),
35
+ [D]: () => o("hotspotsOn"),
36
+ [R]: () => o("hotspotsOff"),
37
+ [V]: () => o("galleryOpen"),
35
38
  [w]: () => o("galleryClose")
36
39
  }, p = /* @__PURE__ */ new Map();
37
40
  return Object.entries(N).forEach(([e, t]) => {
38
41
  if (!t)
39
42
  return;
40
- const b = y(e), C = (L) => t(L.detail);
41
- p.set(b, C);
43
+ const L = T(e), b = (C) => t(C.detail);
44
+ p.set(L, b);
42
45
  }), M(() => {
43
46
  p.forEach((e, t) => {
44
47
  document.addEventListener(t, e);
@@ -47,7 +50,7 @@ const X = /* @__PURE__ */ l({
47
50
  p.forEach((e, t) => {
48
51
  document.removeEventListener(t, e);
49
52
  });
50
- }), (e, t) => (E(), _("cc-webplayer", A(r(P), {
53
+ }), (e, t) => (E(), _("cc-webplayer", g(r(y), {
51
54
  class: r(a),
52
55
  style: f
53
56
  }), [
@@ -79,16 +82,16 @@ const X = /* @__PURE__ */ l({
79
82
  }
80
83
  });
81
84
  export {
82
- g as DEFAULT_EVENT_PREFIX,
83
- v as EVENT_COMPOSITION_LOADED,
84
- W as EVENT_COMPOSITION_LOADING,
85
+ A as DEFAULT_EVENT_PREFIX,
86
+ W as EVENT_COMPOSITION_LOADED,
87
+ v as EVENT_COMPOSITION_LOADING,
85
88
  I as EVENT_COMPOSITION_LOAD_ERROR,
86
- x as EVENT_EXTEND_MODE_OFF,
87
- D as EVENT_EXTEND_MODE_ON,
89
+ B as EVENT_EXTEND_MODE_OFF,
90
+ x as EVENT_EXTEND_MODE_ON,
88
91
  w as EVENT_GALLERY_CLOSE,
89
- B as EVENT_GALLERY_OPEN,
90
- V as EVENT_HOTSPOTS_OFF,
91
- R as EVENT_HOTSPOTS_ON,
92
+ V as EVENT_GALLERY_OPEN,
93
+ R as EVENT_HOTSPOTS_OFF,
94
+ D as EVENT_HOTSPOTS_ON,
92
95
  S as EVENT_ITEM_CHANGE,
93
96
  K as WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,
94
97
  Q as WEB_PLAYER_ICON_WC_TAG,
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,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 = {
@@ -116,15 +118,18 @@ compositionUrl: {
116
118
  type: StringConstructor;
117
119
  required: true;
118
120
  };
119
- hideCategories: BooleanConstructor;
121
+ hideCategoriesNav: BooleanConstructor;
120
122
  infiniteCarrousel: BooleanConstructor;
121
123
  permanentGallery: BooleanConstructor;
122
124
  mediaLoadStrategy: StringConstructor;
123
125
  minMediaWidth: NumberConstructor;
124
126
  maxMediaWidth: NumberConstructor;
125
127
  preloadRange: NumberConstructor;
126
- preventFullScreen: BooleanConstructor;
128
+ autoLoad360: BooleanConstructor;
129
+ categoriesFilter: StringConstructor;
130
+ extendBehavior: StringConstructor;
127
131
  eventPrefix: StringConstructor;
132
+ demoSpin: BooleanConstructor;
128
133
  reverse360: BooleanConstructor;
129
134
  }>, {}, {
130
135
  eventCbMap: Map<string, EventListener>;
@@ -138,21 +143,25 @@ compositionUrl: {
138
143
  type: StringConstructor;
139
144
  required: true;
140
145
  };
141
- hideCategories: BooleanConstructor;
146
+ hideCategoriesNav: BooleanConstructor;
142
147
  infiniteCarrousel: BooleanConstructor;
143
148
  permanentGallery: BooleanConstructor;
144
149
  mediaLoadStrategy: StringConstructor;
145
150
  minMediaWidth: NumberConstructor;
146
151
  maxMediaWidth: NumberConstructor;
147
152
  preloadRange: NumberConstructor;
148
- preventFullScreen: BooleanConstructor;
153
+ autoLoad360: BooleanConstructor;
154
+ categoriesFilter: StringConstructor;
155
+ extendBehavior: StringConstructor;
149
156
  eventPrefix: StringConstructor;
157
+ demoSpin: BooleanConstructor;
150
158
  reverse360: BooleanConstructor;
151
159
  }>> & Readonly<{}>, {
152
- hideCategories: boolean;
160
+ hideCategoriesNav: boolean;
153
161
  infiniteCarrousel: boolean;
154
162
  permanentGallery: boolean;
155
- preventFullScreen: boolean;
163
+ autoLoad360: boolean;
164
+ demoSpin: boolean;
156
165
  reverse360: boolean;
157
166
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
158
167
 
@@ -220,7 +229,7 @@ export declare type WebPlayerProps = {
220
229
  compositionUrl: string;
221
230
 
222
231
  // Layout
223
- hideCategories?: boolean;
232
+ hideCategoriesNav?: boolean;
224
233
  infiniteCarrousel?: boolean;
225
234
  permanentGallery?: boolean;
226
235
 
@@ -229,10 +238,13 @@ export declare type WebPlayerProps = {
229
238
  minMediaWidth?: MediaWidth;
230
239
  maxMediaWidth?: MediaWidth;
231
240
  preloadRange?: number;
241
+ autoLoad360?: boolean;
232
242
 
233
243
  // Miscelaneous
234
- preventFullScreen?: boolean;
244
+ categoriesFilter?: string;
245
+ extendBehavior?: ExtendBehavior;
235
246
  eventPrefix?: string;
247
+ demoSpin?: boolean;
236
248
  reverse360?: boolean;
237
249
  };
238
250
 
package/dist/vue2.js CHANGED
@@ -1,20 +1,23 @@
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";
1
+ import { defineComponent as i, openBlock as a, createElementBlock 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-_R5huBBV.js";
3
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";
4
+ import { ensureCustomElementsDefinition as v, webPlayerPropsToAttributes as L, webPlayerCustomMediaPropsToAttributes as C, webPlayerIconPropsToAttributes as g } from "@car-cutter/wc-webplayer";
5
5
  v();
6
- const g = i({
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
+ categoriesFilter: String,
18
+ extendBehavior: String,
17
19
  eventPrefix: String,
20
+ demoSpin: Boolean,
18
21
  reverse360: Boolean
19
22
  },
20
23
  data() {
@@ -24,23 +27,23 @@ const g = i({
24
27
  },
25
28
  computed: {
26
29
  attributes() {
27
- return C(this.$props);
30
+ return L(this.$props);
28
31
  }
29
32
  },
30
33
  methods: {
31
34
  generateEventName(e) {
32
- return `${this.eventPrefix || _}${e}`;
35
+ return `${this.eventPrefix || d}${e}`;
33
36
  },
34
37
  setupEventListeners() {
35
38
  const e = {
36
- [d]: (t) => this.$emit("compositionLoading", t),
39
+ [_]: (t) => this.$emit("compositionLoading", t),
37
40
  [l]: (t) => this.$emit("compositionLoaded", t),
38
41
  [f]: (t) => this.$emit("compositionLoadError", t),
39
42
  [O]: (t) => this.$emit("itemChange", t),
40
43
  [$]: () => this.$emit("extendModeOn"),
41
44
  [h]: () => this.$emit("extendModeOff"),
42
- [b]: () => this.$emit("hotspotsOn"),
43
- [N]: () => this.$emit("hotspotsOff"),
45
+ [N]: () => this.$emit("hotspotsOn"),
46
+ [b]: () => this.$emit("hotspotsOff"),
44
47
  [T]: () => this.$emit("galleryOpen"),
45
48
  [P]: () => this.$emit("galleryClose")
46
49
  };
@@ -65,59 +68,59 @@ const g = i({
65
68
  r[o] = s;
66
69
  return r;
67
70
  };
68
- function y(e, t, r, o, s, n) {
69
- return a(), p("cc-webplayer", E(c(e.attributes)), [
70
- m(e.$slots, "default")
71
+ function M(e, t, r, o, s, n) {
72
+ return a(), p("cc-webplayer", m(E(e.attributes)), [
73
+ c(e.$slots, "default")
71
74
  ], 16);
72
75
  }
73
- const B = /* @__PURE__ */ u(g, [["render", y]]), S = i({
76
+ const V = /* @__PURE__ */ u(S, [["render", M]]), y = i({
74
77
  props: {
75
78
  index: { type: Number, required: !0 },
76
79
  thumbnailSrc: String
77
80
  },
78
81
  computed: {
79
82
  attributes() {
80
- return L(this.$props);
83
+ return C(this.$props);
81
84
  }
82
85
  }
83
86
  });
84
87
  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
+ return a(), p("cc-webplayer-custom-media", m(E(e.attributes)), [
89
+ c(e.$slots, "default")
87
90
  ], 16);
88
91
  }
89
- const x = /* @__PURE__ */ u(S, [["render", A]]), D = i({
92
+ const x = /* @__PURE__ */ u(y, [["render", A]]), D = i({
90
93
  props: {
91
94
  name: { type: String, required: !0 }
92
95
  },
93
96
  computed: {
94
97
  attributes() {
95
- return M(this.$props);
98
+ return g(this.$props);
96
99
  }
97
100
  }
98
101
  });
99
102
  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
+ return a(), p("cc-webplayer-icon", m(E(e.attributes)), [
104
+ c(e.$slots, "default")
102
105
  ], 16);
103
106
  }
104
107
  const G = /* @__PURE__ */ u(D, [["render", I]]);
105
108
  export {
106
- _ as DEFAULT_EVENT_PREFIX,
109
+ d as DEFAULT_EVENT_PREFIX,
107
110
  l as EVENT_COMPOSITION_LOADED,
108
- d as EVENT_COMPOSITION_LOADING,
111
+ _ as EVENT_COMPOSITION_LOADING,
109
112
  f as EVENT_COMPOSITION_LOAD_ERROR,
110
113
  h as EVENT_EXTEND_MODE_OFF,
111
114
  $ as EVENT_EXTEND_MODE_ON,
112
115
  P as EVENT_GALLERY_CLOSE,
113
116
  T as EVENT_GALLERY_OPEN,
114
- N as EVENT_HOTSPOTS_OFF,
115
- b as EVENT_HOTSPOTS_ON,
117
+ b as EVENT_HOTSPOTS_OFF,
118
+ N as EVENT_HOTSPOTS_ON,
116
119
  O as EVENT_ITEM_CHANGE,
117
120
  Y as WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,
118
121
  k as WEB_PLAYER_ICON_WC_TAG,
119
122
  U as WEB_PLAYER_WC_TAG,
120
- B as WebPlayer,
123
+ V as WebPlayer,
121
124
  x as WebPlayerCustomMedia,
122
125
  G as WebPlayerIcon,
123
126
  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.11.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.11.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "vue": ">=2"