@car-cutter/react-webplayer 0.9.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 n=require("./shared-Df-jUuiC.cjs");require("react/jsx-runtime");const g=require("react"),W=require("react-dom/client");var S=Object.defineProperty,L=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,T=(e,t,o)=>(L(e,typeof t!="symbol"?t+"":t,o),o);const I={stringify:e=>e,parse:e=>e},V={stringify:e=>`${e}`,parse:e=>parseFloat(e)},M={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},R={stringify:e=>e.name,parse:(e,t,o)=>{const i=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof i=="function"?i.bind(o):void 0}},D={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},N={string:I,number:V,boolean:M,function:R,json:D};function w(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,o,i)=>`${o}-${i.toLowerCase()}`)}const b=Symbol.for("r2wc.render"),m=Symbol.for("r2wc.connected"),u=Symbol.for("r2wc.context"),l=Symbol.for("r2wc.props");function G(e,t,o){var i,O,A;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const f=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),p={},h={},d={};for(const s of f){p[s]=Array.isArray(t.props)?"string":t.props[s];const r=w(s);h[s]=r,d[r]=s}class P extends HTMLElement{constructor(){super(),T(this,i,!0),T(this,O),T(this,A,{}),T(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[l].container=this.container;for(const r of f){const _=h[r],c=this.getAttribute(_),a=p[r],E=a?N[a]:null;E!=null&&E.parse&&c&&(this[l][r]=E.parse(c,_,this))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[m]=!0,this[b]()}disconnectedCallback(){this[m]=!1,this[u]&&o.unmount(this[u]),delete this[u]}attributeChangedCallback(r,_,c){const a=d[r],E=p[a],y=E?N[E]:null;a in p&&y!=null&&y.parse&&c&&(this[l][a]=y.parse(c,r,this),this[b]())}[(i=m,O=u,A=l,b)](){this[m]&&(this[u]?o.update(this[u],this[l]):this[u]=o.mount(this.container,e,this[l]))}}for(const s of f){const r=h[s],_=p[s];Object.defineProperty(P.prototype,s,{enumerable:!0,configurable:!0,get(){return this[l][s]},set(c){this[l][s]=c;const a=_?N[_]:null;if(a!=null&&a.stringify){const E=a.stringify(c,r,this);this.getAttribute(r)!==E&&this.setAttribute(r,E)}else this[b]()}})}return P}function F(e,t,o){const i=W.createRoot(e),O=g.createElement(t,o);return i.render(O),{root:i,ReactComponent:t}}function v({root:e,ReactComponent:t},o){const i=g.createElement(t,o);e.render(i)}function Y({root:e}){setTimeout(()=>{e.unmount()},0)}function C(e,t={}){return G(e,t,{mount:F,update:v,unmount:Y})}const j=C(n.WebPlayerWithInjectedStyles,{shadow:"open",props:{compositionUrl:"string",hideCategories:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preventFullScreen:"boolean",eventPrefix:"string",reverse360:"boolean"}}),k=C(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),B=C(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function H(){customElements.define(n.WEB_PLAYER_WC_TAG,j),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,k),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,B)}function x(){n.checkCustomElementsDefinition()||H()}x();exports.DEFAULT_EVENT_PREFIX=n.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=n.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=n.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=n.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=n.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=n.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=n.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=n.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=n.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=n.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=n.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=n.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=n.WEB_PLAYER_WC_TAG;exports.WebPlayer=n.WebPlayer;exports.WebPlayerCustomMedia=n.WebPlayerCustomMedia$1;exports.WebPlayerIcon=n.WebPlayerIcon$1;exports.generateCompositionUrl=n.generateCompositionUrl;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-DURk-_r6.cjs");require("react/jsx-runtime");const g=require("react"),W=require("react-dom/client");var S=Object.defineProperty,L=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,b=(e,t,o)=>(L(e,typeof t!="symbol"?t+"":t,o),o);const I={stringify:e=>e,parse:e=>e},R={stringify:e=>`${e}`,parse:e=>parseFloat(e)},V={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},M={stringify:e=>e.name,parse:(e,t,o)=>{const i=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof i=="function"?i.bind(o):void 0}},D={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},y={string:I,number:R,boolean:V,function:M,json:D};function w(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,o,i)=>`${o}-${i.toLowerCase()}`)}const T=Symbol.for("r2wc.render"),m=Symbol.for("r2wc.connected"),u=Symbol.for("r2wc.context"),l=Symbol.for("r2wc.props");function G(e,t,o){var i,O,A;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const d=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),p={},f={},h={};for(const s of d){p[s]=Array.isArray(t.props)?"string":t.props[s];const r=w(s);f[s]=r,h[r]=s}class P extends HTMLElement{constructor(){super(),b(this,i,!0),b(this,O),b(this,A,{}),b(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[l].container=this.container;for(const r of d){const _=f[r],c=this.getAttribute(_),a=p[r],E=a?y[a]:null;E!=null&&E.parse&&c&&(this[l][r]=E.parse(c,_,this))}}static get observedAttributes(){return Object.keys(h)}connectedCallback(){this[m]=!0,this[T]()}disconnectedCallback(){this[m]=!1,this[u]&&o.unmount(this[u]),delete this[u]}attributeChangedCallback(r,_,c){const a=h[r],E=p[a],N=E?y[E]:null;a in p&&N!=null&&N.parse&&c&&(this[l][a]=N.parse(c,r,this),this[T]())}[(i=m,O=u,A=l,T)](){this[m]&&(this[u]?o.update(this[u],this[l]):this[u]=o.mount(this.container,e,this[l]))}}for(const s of d){const r=f[s],_=p[s];Object.defineProperty(P.prototype,s,{enumerable:!0,configurable:!0,get(){return this[l][s]},set(c){this[l][s]=c;const a=_?y[_]:null;if(a!=null&&a.stringify){const E=a.stringify(c,r,this);this.getAttribute(r)!==E&&this.setAttribute(r,E)}else this[T]()}})}return P}function F(e,t,o){const i=W.createRoot(e),O=g.createElement(t,o);return i.render(O),{root:i,ReactComponent:t}}function v({root:e,ReactComponent:t},o){const i=g.createElement(t,o);e.render(i)}function Y({root:e}){setTimeout(()=>{e.unmount()},0)}function C(e,t={}){return G(e,t,{mount:F,update:v,unmount:Y})}const j=C(n.WebPlayerWithInjectedStyles,{shadow:"open",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean"}}),k=C(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),B=C(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function x(){customElements.define(n.WEB_PLAYER_WC_TAG,j),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,k),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,B)}function H(){n.checkCustomElementsDefinition()||x()}H();exports.DEFAULT_EVENT_PREFIX=n.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=n.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=n.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=n.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=n.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=n.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=n.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=n.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=n.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=n.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=n.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=n.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=n.WEB_PLAYER_WC_TAG;exports.WebPlayer=n.WebPlayer;exports.WebPlayerCustomMedia=n.WebPlayerCustomMedia$1;exports.WebPlayerIcon=n.WebPlayerIcon$1;exports.generateCompositionUrl=n.generateCompositionUrl;
package/dist/index.d.ts CHANGED
@@ -38,18 +38,20 @@ export declare const EVENT_HOTSPOTS_ON = "hotspots-on";
38
38
 
39
39
  export declare const EVENT_ITEM_CHANGE = "item-change";
40
40
 
41
+ declare type ExtendBehavior = "full_screen" | "event" | "none";
42
+
41
43
  /**
42
44
  * Generates a URL for fetching the composition JSON for a given customer and vehicle.
43
45
  *
44
- * @param {string} hashedCustomerId - The ID of the customer (hashed with SHA-256).
46
+ * @param {string} customerToken - The CarCutter Customer Token (computed by hasing the Customer ID with SHA-256).
45
47
  * @param {string} vin - The Vehicle Identification Number.
46
48
  * @returns {string} The URL to fetch the composition JSON.
47
49
  */
48
50
  export declare function generateCompositionUrl(
49
- hashedCustomerId: string,
51
+ customerToken: string,
50
52
  vin: string
51
53
  ): string {
52
- return `https://cdn.car-cutter.com/gallery/${hashedCustomerId}/${vin}/composition_v3.json`;
54
+ return `https://cdn.car-cutter.com/gallery/${customerToken}/${vin}/composition_v3.json`;
53
55
  }
54
56
 
55
57
  declare type Hotspot = {
@@ -150,7 +152,7 @@ declare type WebPlayerProps_2 = {
150
152
  compositionUrl: string;
151
153
 
152
154
  // Layout
153
- hideCategories?: boolean;
155
+ hideCategoriesNav?: boolean;
154
156
  infiniteCarrousel?: boolean;
155
157
  permanentGallery?: boolean;
156
158
 
@@ -159,10 +161,13 @@ declare type WebPlayerProps_2 = {
159
161
  minMediaWidth?: MediaWidth;
160
162
  maxMediaWidth?: MediaWidth;
161
163
  preloadRange?: number;
164
+ autoLoad360?: boolean;
162
165
 
163
166
  // Miscelaneous
164
- preventFullScreen?: boolean;
167
+ categoriesFilter?: string;
168
+ extendBehavior?: ExtendBehavior;
165
169
  eventPrefix?: string;
170
+ demoSpin?: boolean;
166
171
  reverse360?: boolean;
167
172
  };
168
173
 
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { W as P, a as W, b as S, c as w, d as I, e as L, f as M } from "./shared-Bn2By-os.js";
2
- import { D as oe, j as se, E as re, k as ie, n as ae, m as ce, r as le, q as ue, p as pe, o as me, l as fe, g as Ee, h as be, i as he, s as de } from "./shared-Bn2By-os.js";
1
+ import { W as P, a as W, b as S, c as w, d as L, e as I, f as M } from "./shared-B4kKjNn6.js";
2
+ import { D as oe, j as re, E as se, k as ie, n as ae, m as ce, r as le, q as ue, p as pe, o as me, l as fe, g as be, h as Ee, i as he, s as de } from "./shared-B4kKjNn6.js";
3
3
  import "react/jsx-runtime";
4
4
  import A from "react";
5
5
  import { createRoot as D } from "react-dom/client";
6
- var R = Object.defineProperty, V = (e, t, n) => t in e ? R(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, E = (e, t, n) => (V(e, typeof t != "symbol" ? t + "" : t, n), n);
6
+ var R = Object.defineProperty, V = (e, t, n) => t in e ? R(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, b = (e, t, n) => (V(e, typeof t != "symbol" ? t + "" : t, n), n);
7
7
  const v = {
8
8
  stringify: (e) => e,
9
9
  parse: (e) => e
@@ -16,18 +16,18 @@ const v = {
16
16
  }, x = {
17
17
  stringify: (e) => e.name,
18
18
  parse: (e, t, n) => {
19
- const s = (() => {
19
+ const r = (() => {
20
20
  if (typeof window < "u" && e in window)
21
21
  return window[e];
22
22
  if (typeof global < "u" && e in global)
23
23
  return global[e];
24
24
  })();
25
- return typeof s == "function" ? s.bind(n) : void 0;
25
+ return typeof r == "function" ? r.bind(n) : void 0;
26
26
  }
27
27
  }, F = {
28
28
  stringify: (e) => JSON.stringify(e),
29
29
  parse: (e) => JSON.parse(e)
30
- }, g = {
30
+ }, O = {
31
31
  string: v,
32
32
  number: j,
33
33
  boolean: k,
@@ -37,26 +37,26 @@ const v = {
37
37
  function G(e) {
38
38
  return e.replace(
39
39
  /([a-z0-9])([A-Z])/g,
40
- (t, n, s) => `${n}-${s.toLowerCase()}`
40
+ (t, n, r) => `${n}-${r.toLowerCase()}`
41
41
  );
42
42
  }
43
- const b = Symbol.for("r2wc.render"), h = Symbol.for("r2wc.connected"), u = Symbol.for("r2wc.context"), l = Symbol.for("r2wc.props");
43
+ const E = Symbol.for("r2wc.render"), h = Symbol.for("r2wc.connected"), u = Symbol.for("r2wc.context"), l = Symbol.for("r2wc.props");
44
44
  function Y(e, t, n) {
45
- var s, f, C;
45
+ var r, f, C;
46
46
  t.props || (t.props = e.propTypes ? Object.keys(e.propTypes) : []);
47
47
  const d = Array.isArray(t.props) ? t.props.slice() : Object.keys(t.props), m = {}, y = {}, _ = {};
48
- for (const r of d) {
49
- m[r] = Array.isArray(t.props) ? "string" : t.props[r];
50
- const o = G(r);
51
- y[r] = o, _[o] = r;
48
+ for (const s of d) {
49
+ m[s] = Array.isArray(t.props) ? "string" : t.props[s];
50
+ const o = G(s);
51
+ y[s] = o, _[o] = s;
52
52
  }
53
53
  class N extends HTMLElement {
54
54
  constructor() {
55
- super(), E(this, s, !0), E(this, f), E(this, C, {}), E(this, "container"), t.shadow ? this.container = this.attachShadow({
55
+ super(), b(this, r, !0), b(this, f), b(this, C, {}), b(this, "container"), t.shadow ? this.container = this.attachShadow({
56
56
  mode: t.shadow
57
57
  }) : this.container = this, this[l].container = this.container;
58
58
  for (const o of d) {
59
- const p = y[o], c = this.getAttribute(p), i = m[o], a = i ? g[i] : null;
59
+ const p = y[o], c = this.getAttribute(p), i = m[o], a = i ? O[i] : null;
60
60
  a != null && a.parse && c && (this[l][o] = a.parse(c, p, this));
61
61
  }
62
62
  }
@@ -64,16 +64,16 @@ function Y(e, t, n) {
64
64
  return Object.keys(_);
65
65
  }
66
66
  connectedCallback() {
67
- this[h] = !0, this[b]();
67
+ this[h] = !0, this[E]();
68
68
  }
69
69
  disconnectedCallback() {
70
70
  this[h] = !1, this[u] && n.unmount(this[u]), delete this[u];
71
71
  }
72
72
  attributeChangedCallback(o, p, c) {
73
- const i = _[o], a = m[i], O = a ? g[a] : null;
74
- i in m && O != null && O.parse && c && (this[l][i] = O.parse(c, o, this), this[b]());
73
+ const i = _[o], a = m[i], g = a ? O[a] : null;
74
+ i in m && g != null && g.parse && c && (this[l][i] = g.parse(c, o, this), this[E]());
75
75
  }
76
- [(s = h, f = u, C = l, b)]() {
76
+ [(r = h, f = u, C = l, E)]() {
77
77
  this[h] && (this[u] ? n.update(this[u], this[l]) : this[u] = n.mount(
78
78
  this.container,
79
79
  e,
@@ -81,58 +81,65 @@ function Y(e, t, n) {
81
81
  ));
82
82
  }
83
83
  }
84
- for (const r of d) {
85
- const o = y[r], p = m[r];
86
- Object.defineProperty(N.prototype, r, {
84
+ for (const s of d) {
85
+ const o = y[s], p = m[s];
86
+ Object.defineProperty(N.prototype, s, {
87
87
  enumerable: !0,
88
88
  configurable: !0,
89
89
  get() {
90
- return this[l][r];
90
+ return this[l][s];
91
91
  },
92
92
  set(c) {
93
- this[l][r] = c;
94
- const i = p ? g[p] : null;
93
+ this[l][s] = c;
94
+ const i = p ? O[p] : null;
95
95
  if (i != null && i.stringify) {
96
96
  const a = i.stringify(c, o, this);
97
97
  this.getAttribute(o) !== a && this.setAttribute(o, a);
98
98
  } else
99
- this[b]();
99
+ this[E]();
100
100
  }
101
101
  });
102
102
  }
103
103
  return N;
104
104
  }
105
- function H(e, t, n) {
106
- const s = D(e), f = A.createElement(t, n);
107
- return s.render(f), {
108
- root: s,
105
+ function B(e, t, n) {
106
+ const r = D(e), f = A.createElement(t, n);
107
+ return r.render(f), {
108
+ root: r,
109
109
  ReactComponent: t
110
110
  };
111
111
  }
112
- function U({ root: e, ReactComponent: t }, n) {
113
- const s = A.createElement(t, n);
114
- e.render(s);
112
+ function H({ root: e, ReactComponent: t }, n) {
113
+ const r = A.createElement(t, n);
114
+ e.render(r);
115
115
  }
116
- function $({ root: e }) {
116
+ function U({ root: e }) {
117
117
  setTimeout(() => {
118
118
  e.unmount();
119
119
  }, 0);
120
120
  }
121
121
  function T(e, t = {}) {
122
- return Y(e, t, { mount: H, update: U, unmount: $ });
122
+ return Y(e, t, { mount: B, update: H, unmount: U });
123
123
  }
124
- const B = T(P, {
124
+ const $ = T(P, {
125
125
  shadow: "open",
126
126
  props: {
127
127
  compositionUrl: "string",
128
- hideCategories: "boolean",
128
+ // Layout
129
+ hideCategoriesNav: "boolean",
129
130
  infiniteCarrousel: "boolean",
130
131
  permanentGallery: "boolean",
132
+ // Medias loading
131
133
  minMediaWidth: "number",
132
134
  maxMediaWidth: "number",
133
135
  mediaLoadStrategy: "string",
134
- preventFullScreen: "boolean",
136
+ preloadRange: "number",
137
+ autoLoad360: "boolean",
138
+ // Miscelaneous
139
+ categoriesFilter: "string",
140
+ extendBehavior: "string",
135
141
  eventPrefix: "string",
142
+ demoSpin: "boolean",
136
143
  reverse360: "boolean"
137
144
  }
138
145
  }), J = T(W, {
@@ -148,8 +155,8 @@ const B = T(P, {
148
155
  }
149
156
  });
150
157
  function q() {
151
- customElements.define(I, B), customElements.define(
152
- L,
158
+ customElements.define(L, $), customElements.define(
159
+ I,
153
160
  J
154
161
  ), customElements.define(M, X);
155
162
  }
@@ -159,8 +166,8 @@ function z() {
159
166
  z();
160
167
  export {
161
168
  oe as DEFAULT_EVENT_PREFIX,
162
- se as EVENT_COMPOSITION_LOADED,
163
- re as EVENT_COMPOSITION_LOADING,
169
+ re as EVENT_COMPOSITION_LOADED,
170
+ se as EVENT_COMPOSITION_LOADING,
164
171
  ie as EVENT_COMPOSITION_LOAD_ERROR,
165
172
  ae as EVENT_EXTEND_MODE_OFF,
166
173
  ce as EVENT_EXTEND_MODE_ON,
@@ -170,9 +177,9 @@ export {
170
177
  me as EVENT_HOTSPOTS_ON,
171
178
  fe as EVENT_ITEM_CHANGE,
172
179
  M as WEB_PLAYER_ICON_WC_TAG,
173
- I as WEB_PLAYER_WC_TAG,
174
- Ee as WebPlayer,
175
- be as WebPlayerCustomMedia,
180
+ L as WEB_PLAYER_WC_TAG,
181
+ be as WebPlayer,
182
+ Ee as WebPlayerCustomMedia,
176
183
  he as WebPlayerIcon,
177
184
  de as generateCompositionUrl
178
185
  };
package/dist/legacy.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-Df-jUuiC.cjs");require("react/jsx-runtime");const W=require("react"),y=require("react-dom");var S=Object.defineProperty,L=(e,t,r)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O=(e,t,r)=>(L(e,typeof t!="symbol"?t+"":t,r),r);const I={stringify:e=>e,parse:e=>e},V={stringify:e=>`${e}`,parse:e=>parseFloat(e)},M={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},D={stringify:e=>e.name,parse:(e,t,r)=>{const s=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof s=="function"?s.bind(r):void 0}},R={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},N={string:I,number:V,boolean:M,function:D,json:R};function w(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,r,s)=>`${r}-${s.toLowerCase()}`)}const b=Symbol.for("r2wc.render"),T=Symbol.for("r2wc.connected"),u=Symbol.for("r2wc.context"),l=Symbol.for("r2wc.props");function G(e,t,r){var s,A,P;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const m=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),p={},f={},d={};for(const i of m){p[i]=Array.isArray(t.props)?"string":t.props[i];const o=w(i);f[i]=o,d[o]=i}class g extends HTMLElement{constructor(){super(),O(this,s,!0),O(this,A),O(this,P,{}),O(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[l].container=this.container;for(const o of m){const _=f[o],c=this.getAttribute(_),a=p[o],E=a?N[a]:null;E!=null&&E.parse&&c&&(this[l][o]=E.parse(c,_,this))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[T]=!0,this[b]()}disconnectedCallback(){this[T]=!1,this[u]&&r.unmount(this[u]),delete this[u]}attributeChangedCallback(o,_,c){const a=d[o],E=p[a],h=E?N[E]:null;a in p&&h!=null&&h.parse&&c&&(this[l][a]=h.parse(c,o,this),this[b]())}[(s=T,A=u,P=l,b)](){this[T]&&(this[u]?r.update(this[u],this[l]):this[u]=r.mount(this.container,e,this[l]))}}for(const i of m){const o=f[i],_=p[i];Object.defineProperty(g.prototype,i,{enumerable:!0,configurable:!0,get(){return this[l][i]},set(c){this[l][i]=c;const a=_?N[_]:null;if(a!=null&&a.stringify){const E=a.stringify(c,o,this);this.getAttribute(o)!==E&&this.setAttribute(o,E)}else this[b]()}})}return g}function F(e,t,r){const s=W.createElement(t,r);return y.render(s,e),{container:e,ReactComponent:t}}function v({container:e,ReactComponent:t},r){const s=W.createElement(t,r);y.render(s,e)}function Y({container:e}){y.unmountComponentAtNode(e)}function C(e,t={}){return G(e,t,{mount:F,update:v,unmount:Y})}const j=C(n.WebPlayerWithInjectedStyles,{shadow:"open",props:{compositionUrl:"string",hideCategories:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preventFullScreen:"boolean",eventPrefix:"string",reverse360:"boolean"}}),k=C(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),$=C(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function B(){customElements.define(n.WEB_PLAYER_WC_TAG,j),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,k),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,$)}function H(){n.checkCustomElementsDefinition()||B()}H();exports.DEFAULT_EVENT_PREFIX=n.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=n.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=n.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=n.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=n.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=n.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=n.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=n.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=n.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=n.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=n.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=n.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=n.WEB_PLAYER_WC_TAG;exports.WebPlayer=n.WebPlayer;exports.WebPlayerCustomMedia=n.WebPlayerCustomMedia$1;exports.WebPlayerIcon=n.WebPlayerIcon$1;exports.generateCompositionUrl=n.generateCompositionUrl;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-DURk-_r6.cjs");require("react/jsx-runtime");const W=require("react"),y=require("react-dom");var S=Object.defineProperty,L=(e,t,o)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,O=(e,t,o)=>(L(e,typeof t!="symbol"?t+"":t,o),o);const I={stringify:e=>e,parse:e=>e},V={stringify:e=>`${e}`,parse:e=>parseFloat(e)},M={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},R={stringify:e=>e.name,parse:(e,t,o)=>{const s=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof s=="function"?s.bind(o):void 0}},D={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},N={string:I,number:V,boolean:M,function:R,json:D};function w(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,o,s)=>`${o}-${s.toLowerCase()}`)}const b=Symbol.for("r2wc.render"),T=Symbol.for("r2wc.connected"),u=Symbol.for("r2wc.context"),l=Symbol.for("r2wc.props");function G(e,t,o){var s,A,P;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const m=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),p={},d={},f={};for(const i of m){p[i]=Array.isArray(t.props)?"string":t.props[i];const r=w(i);d[i]=r,f[r]=i}class g extends HTMLElement{constructor(){super(),O(this,s,!0),O(this,A),O(this,P,{}),O(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[l].container=this.container;for(const r of m){const _=d[r],c=this.getAttribute(_),a=p[r],E=a?N[a]:null;E!=null&&E.parse&&c&&(this[l][r]=E.parse(c,_,this))}}static get observedAttributes(){return Object.keys(f)}connectedCallback(){this[T]=!0,this[b]()}disconnectedCallback(){this[T]=!1,this[u]&&o.unmount(this[u]),delete this[u]}attributeChangedCallback(r,_,c){const a=f[r],E=p[a],h=E?N[E]:null;a in p&&h!=null&&h.parse&&c&&(this[l][a]=h.parse(c,r,this),this[b]())}[(s=T,A=u,P=l,b)](){this[T]&&(this[u]?o.update(this[u],this[l]):this[u]=o.mount(this.container,e,this[l]))}}for(const i of m){const r=d[i],_=p[i];Object.defineProperty(g.prototype,i,{enumerable:!0,configurable:!0,get(){return this[l][i]},set(c){this[l][i]=c;const a=_?N[_]:null;if(a!=null&&a.stringify){const E=a.stringify(c,r,this);this.getAttribute(r)!==E&&this.setAttribute(r,E)}else this[b]()}})}return g}function F(e,t,o){const s=W.createElement(t,o);return y.render(s,e),{container:e,ReactComponent:t}}function v({container:e,ReactComponent:t},o){const s=W.createElement(t,o);y.render(s,e)}function Y({container:e}){y.unmountComponentAtNode(e)}function C(e,t={}){return G(e,t,{mount:F,update:v,unmount:Y})}const j=C(n.WebPlayerWithInjectedStyles,{shadow:"open",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean"}}),k=C(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),B=C(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function $(){customElements.define(n.WEB_PLAYER_WC_TAG,j),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,k),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,B)}function x(){n.checkCustomElementsDefinition()||$()}x();exports.DEFAULT_EVENT_PREFIX=n.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=n.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=n.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=n.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=n.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=n.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=n.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=n.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=n.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=n.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=n.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=n.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=n.WEB_PLAYER_WC_TAG;exports.WebPlayer=n.WebPlayer;exports.WebPlayerCustomMedia=n.WebPlayerCustomMedia$1;exports.WebPlayerIcon=n.WebPlayerIcon$1;exports.generateCompositionUrl=n.generateCompositionUrl;
package/dist/legacy.d.ts CHANGED
@@ -38,18 +38,20 @@ export declare const EVENT_HOTSPOTS_ON = "hotspots-on";
38
38
 
39
39
  export declare const EVENT_ITEM_CHANGE = "item-change";
40
40
 
41
+ declare type ExtendBehavior = "full_screen" | "event" | "none";
42
+
41
43
  /**
42
44
  * Generates a URL for fetching the composition JSON for a given customer and vehicle.
43
45
  *
44
- * @param {string} hashedCustomerId - The ID of the customer (hashed with SHA-256).
46
+ * @param {string} customerToken - The CarCutter Customer Token (computed by hasing the Customer ID with SHA-256).
45
47
  * @param {string} vin - The Vehicle Identification Number.
46
48
  * @returns {string} The URL to fetch the composition JSON.
47
49
  */
48
50
  export declare function generateCompositionUrl(
49
- hashedCustomerId: string,
51
+ customerToken: string,
50
52
  vin: string
51
53
  ): string {
52
- return `https://cdn.car-cutter.com/gallery/${hashedCustomerId}/${vin}/composition_v3.json`;
54
+ return `https://cdn.car-cutter.com/gallery/${customerToken}/${vin}/composition_v3.json`;
53
55
  }
54
56
 
55
57
  declare type Hotspot = {
@@ -150,7 +152,7 @@ declare type WebPlayerProps_2 = {
150
152
  compositionUrl: string;
151
153
 
152
154
  // Layout
153
- hideCategories?: boolean;
155
+ hideCategoriesNav?: boolean;
154
156
  infiniteCarrousel?: boolean;
155
157
  permanentGallery?: boolean;
156
158
 
@@ -159,10 +161,13 @@ declare type WebPlayerProps_2 = {
159
161
  minMediaWidth?: MediaWidth;
160
162
  maxMediaWidth?: MediaWidth;
161
163
  preloadRange?: number;
164
+ autoLoad360?: boolean;
162
165
 
163
166
  // Miscelaneous
164
- preventFullScreen?: boolean;
167
+ categoriesFilter?: string;
168
+ extendBehavior?: ExtendBehavior;
165
169
  eventPrefix?: string;
170
+ demoSpin?: boolean;
166
171
  reverse360?: boolean;
167
172
  };
168
173
 
package/dist/legacy.js CHANGED
@@ -1,9 +1,9 @@
1
- import { W, a as S, b as w, c as I, d as L, e as M, f as D } from "./shared-Bn2By-os.js";
2
- import { D as oe, j as re, E as se, k as ie, n as ae, m as ce, r as le, q as pe, p as ue, o as me, l as fe, g as Ee, h as be, i as he, s as de } from "./shared-Bn2By-os.js";
1
+ import { W, a as S, b as w, c as L, d as I, e as M, f as D } from "./shared-B4kKjNn6.js";
2
+ import { D as oe, j as re, E as se, k as ie, n as ae, m as ce, r as le, q as pe, p as ue, o as me, l as fe, g as be, h as Ee, i as de, s as he } from "./shared-B4kKjNn6.js";
3
3
  import "react/jsx-runtime";
4
4
  import P from "react";
5
- import g from "react-dom";
6
- var V = Object.defineProperty, R = (e, t, n) => t in e ? V(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t, n) => (R(e, typeof t != "symbol" ? t + "" : t, n), n);
5
+ import O from "react-dom";
6
+ var R = Object.defineProperty, V = (e, t, n) => t in e ? R(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, f = (e, t, n) => (V(e, typeof t != "symbol" ? t + "" : t, n), n);
7
7
  const v = {
8
8
  stringify: (e) => e,
9
9
  parse: (e) => e
@@ -27,7 +27,7 @@ const v = {
27
27
  }, F = {
28
28
  stringify: (e) => JSON.stringify(e),
29
29
  parse: (e) => JSON.parse(e)
30
- }, O = {
30
+ }, g = {
31
31
  string: v,
32
32
  number: j,
33
33
  boolean: k,
@@ -40,23 +40,23 @@ function G(e) {
40
40
  (t, n, s) => `${n}-${s.toLowerCase()}`
41
41
  );
42
42
  }
43
- const E = Symbol.for("r2wc.render"), b = Symbol.for("r2wc.connected"), p = Symbol.for("r2wc.context"), l = Symbol.for("r2wc.props");
43
+ const b = Symbol.for("r2wc.render"), E = Symbol.for("r2wc.connected"), p = Symbol.for("r2wc.context"), l = Symbol.for("r2wc.props");
44
44
  function $(e, t, n) {
45
45
  var s, T, N;
46
46
  t.props || (t.props = e.propTypes ? Object.keys(e.propTypes) : []);
47
- const h = Array.isArray(t.props) ? t.props.slice() : Object.keys(t.props), m = {}, d = {}, y = {};
48
- for (const r of h) {
47
+ const d = Array.isArray(t.props) ? t.props.slice() : Object.keys(t.props), m = {}, h = {}, y = {};
48
+ for (const r of d) {
49
49
  m[r] = Array.isArray(t.props) ? "string" : t.props[r];
50
50
  const o = G(r);
51
- d[r] = o, y[o] = r;
51
+ h[r] = o, y[o] = r;
52
52
  }
53
53
  class A extends HTMLElement {
54
54
  constructor() {
55
55
  super(), f(this, s, !0), f(this, T), f(this, N, {}), f(this, "container"), t.shadow ? this.container = this.attachShadow({
56
56
  mode: t.shadow
57
57
  }) : this.container = this, this[l].container = this.container;
58
- for (const o of h) {
59
- const u = d[o], c = this.getAttribute(u), i = m[o], a = i ? O[i] : null;
58
+ for (const o of d) {
59
+ const u = h[o], c = this.getAttribute(u), i = m[o], a = i ? g[i] : null;
60
60
  a != null && a.parse && c && (this[l][o] = a.parse(c, u, this));
61
61
  }
62
62
  }
@@ -64,25 +64,25 @@ function $(e, t, n) {
64
64
  return Object.keys(y);
65
65
  }
66
66
  connectedCallback() {
67
- this[b] = !0, this[E]();
67
+ this[E] = !0, this[b]();
68
68
  }
69
69
  disconnectedCallback() {
70
- this[b] = !1, this[p] && n.unmount(this[p]), delete this[p];
70
+ this[E] = !1, this[p] && n.unmount(this[p]), delete this[p];
71
71
  }
72
72
  attributeChangedCallback(o, u, c) {
73
- const i = y[o], a = m[i], _ = a ? O[a] : null;
74
- i in m && _ != null && _.parse && c && (this[l][i] = _.parse(c, o, this), this[E]());
73
+ const i = y[o], a = m[i], _ = a ? g[a] : null;
74
+ i in m && _ != null && _.parse && c && (this[l][i] = _.parse(c, o, this), this[b]());
75
75
  }
76
- [(s = b, T = p, N = l, E)]() {
77
- this[b] && (this[p] ? n.update(this[p], this[l]) : this[p] = n.mount(
76
+ [(s = E, T = p, N = l, b)]() {
77
+ this[E] && (this[p] ? n.update(this[p], this[l]) : this[p] = n.mount(
78
78
  this.container,
79
79
  e,
80
80
  this[l]
81
81
  ));
82
82
  }
83
83
  }
84
- for (const r of h) {
85
- const o = d[r], u = m[r];
84
+ for (const r of d) {
85
+ const o = h[r], u = m[r];
86
86
  Object.defineProperty(A.prototype, r, {
87
87
  enumerable: !0,
88
88
  configurable: !0,
@@ -91,12 +91,12 @@ function $(e, t, n) {
91
91
  },
92
92
  set(c) {
93
93
  this[l][r] = c;
94
- const i = u ? O[u] : null;
94
+ const i = u ? g[u] : null;
95
95
  if (i != null && i.stringify) {
96
96
  const a = i.stringify(c, o, this);
97
97
  this.getAttribute(o) !== a && this.setAttribute(o, a);
98
98
  } else
99
- this[E]();
99
+ this[b]();
100
100
  }
101
101
  });
102
102
  }
@@ -104,33 +104,40 @@ function $(e, t, n) {
104
104
  }
105
105
  function Y(e, t, n) {
106
106
  const s = P.createElement(t, n);
107
- return g.render(s, e), {
107
+ return O.render(s, e), {
108
108
  container: e,
109
109
  ReactComponent: t
110
110
  };
111
111
  }
112
- function H({ container: e, ReactComponent: t }, n) {
112
+ function B({ container: e, ReactComponent: t }, n) {
113
113
  const s = P.createElement(t, n);
114
- g.render(s, e);
114
+ O.render(s, e);
115
115
  }
116
- function U({ container: e }) {
117
- g.unmountComponentAtNode(e);
116
+ function H({ container: e }) {
117
+ O.unmountComponentAtNode(e);
118
118
  }
119
119
  function C(e, t = {}) {
120
- return $(e, t, { mount: Y, update: H, unmount: U });
120
+ return $(e, t, { mount: Y, update: B, unmount: H });
121
121
  }
122
- const B = C(W, {
122
+ const U = C(W, {
123
123
  shadow: "open",
124
124
  props: {
125
125
  compositionUrl: "string",
126
- hideCategories: "boolean",
126
+ // Layout
127
+ hideCategoriesNav: "boolean",
127
128
  infiniteCarrousel: "boolean",
128
129
  permanentGallery: "boolean",
130
+ // Medias loading
129
131
  minMediaWidth: "number",
130
132
  maxMediaWidth: "number",
131
133
  mediaLoadStrategy: "string",
132
- preventFullScreen: "boolean",
134
+ preloadRange: "number",
135
+ autoLoad360: "boolean",
136
+ // Miscelaneous
137
+ categoriesFilter: "string",
138
+ extendBehavior: "string",
133
139
  eventPrefix: "string",
140
+ demoSpin: "boolean",
134
141
  reverse360: "boolean"
135
142
  }
136
143
  }), J = C(S, {
@@ -146,13 +153,13 @@ const B = C(W, {
146
153
  }
147
154
  });
148
155
  function q() {
149
- customElements.define(L, B), customElements.define(
156
+ customElements.define(I, U), customElements.define(
150
157
  M,
151
158
  J
152
159
  ), customElements.define(D, X);
153
160
  }
154
161
  function z() {
155
- I() || q();
162
+ L() || q();
156
163
  }
157
164
  z();
158
165
  export {
@@ -168,9 +175,9 @@ export {
168
175
  me as EVENT_HOTSPOTS_ON,
169
176
  fe as EVENT_ITEM_CHANGE,
170
177
  D as WEB_PLAYER_ICON_WC_TAG,
171
- L as WEB_PLAYER_WC_TAG,
172
- Ee as WebPlayer,
173
- be as WebPlayerCustomMedia,
174
- he as WebPlayerIcon,
175
- de as generateCompositionUrl
178
+ I as WEB_PLAYER_WC_TAG,
179
+ be as WebPlayer,
180
+ Ee as WebPlayerCustomMedia,
181
+ de as WebPlayerIcon,
182
+ he as generateCompositionUrl
176
183
  };