@car-cutter/react-webplayer 3.0.2 → 3.1.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("./shared-BWLUv51h.cjs");require("react/jsx-runtime");const P=require("react"),I=require("react-dom/client");var S=Object.defineProperty,L=(e,n,o)=>n in e?S(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,p=(e,n,o)=>(L(e,typeof n!="symbol"?n+"":n,o),o);const W={stringify:e=>e,parse:e=>e},V={stringify:e=>`${e}`,parse:e=>parseFloat(e)},R={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},D={stringify:e=>e.name,parse:(e,n,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}},M={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},f={string:W,number:V,boolean:R,function:D,json:M};function w(e){return e.replace(/([a-z0-9])([A-Z])/g,(n,o,i)=>`${o}-${i.toLowerCase()}`)}const O=Symbol.for("r2wc.render"),N=Symbol.for("r2wc.connected"),u=Symbol.for("r2wc.context"),c=Symbol.for("r2wc.props");function Y(e,n,o){var i,b,C;n.props||(n.props=e.propTypes?Object.keys(e.propTypes):[]);const m=Array.isArray(n.props)?n.props.slice():Object.keys(n.props),T={},d={},y={};for(const s of m){T[s]=Array.isArray(n.props)?"string":n.props[s];const r=w(s);d[s]=r,y[r]=s}class g extends HTMLElement{constructor(){super(),p(this,i,!0),p(this,b),p(this,C,{}),p(this,"container"),n.shadow?this.container=this.attachShadow({mode:n.shadow}):this.container=this,this[c].container=this.container;for(const r of m){const _=d[r],l=this.getAttribute(_),a=T[r],E=a?f[a]:null;E!=null&&E.parse&&l&&(this[c][r]=E.parse(l,_,this))}}static get observedAttributes(){return Object.keys(y)}connectedCallback(){this[N]=!0,this[O]()}disconnectedCallback(){this[N]=!1,this[u]&&o.unmount(this[u]),delete this[u]}attributeChangedCallback(r,_,l){const a=y[r],E=T[a],A=E?f[E]:null;a in T&&A!=null&&A.parse&&l&&(this[c][a]=A.parse(l,r,this),this[O]())}[(i=N,b=u,C=c,O)](){this[N]&&(this[u]?o.update(this[u],this[c]):this[u]=o.mount(this.container,e,this[c]))}}for(const s of m){const r=d[s],_=T[s];Object.defineProperty(g.prototype,s,{enumerable:!0,configurable:!0,get(){return this[c][s]},set(l){this[c][s]=l;const a=_?f[_]:null;if(a!=null&&a.stringify){const E=a.stringify(l,r,this);this.getAttribute(r)!==E&&this.setAttribute(r,E)}else this[O]()}})}return g}function G(e,n,o){const i=I.createRoot(e),b=P.createElement(n,o);return i.render(b),{root:i,ReactComponent:n}}function F({root:e,ReactComponent:n},o){const i=P.createElement(n,o);e.render(i)}function v({root:e}){setTimeout(()=>{e.unmount()},0)}function h(e,n={}){return Y(e,n,{mount:G,update:F,unmount:v})}const j=h(t.WebPlayerWithInjectedStyles,{shadow:"closed",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",integration:"boolean",maxItemsShown:"number",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",autoLoadInterior360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean",analyticsEventPrefix:"string",analyticsUrl:"string",analyticsBearer:"string",analyticsSimpleRequestsOnly:"boolean",analyticsDryRun:"boolean",analyticsDebug:"boolean"}}),x=h(t.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),B=h(t.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function k(){customElements.define(t.WEB_PLAYER_WC_TAG,j),customElements.define(t.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,x),customElements.define(t.WEB_PLAYER_ICON_WC_TAG,B)}function H(){t.checkCustomElementsDefinition()||k()}H();exports.ANALYTICS_EVENT_IDENTIFY=t.ANALYTICS_EVENT_IDENTIFY;exports.ANALYTICS_EVENT_PAGE=t.ANALYTICS_EVENT_PAGE;exports.ANALYTICS_EVENT_TRACK=t.ANALYTICS_EVENT_TRACK;exports.DEFAULT_EVENT_PREFIX=t.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=t.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=t.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=t.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=t.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=t.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=t.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=t.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=t.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=t.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=t.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=t.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=t.WEB_PLAYER_WC_TAG;exports.WebPlayer=t.WebPlayer;exports.WebPlayerCustomMedia=t.WebPlayerCustomMedia$1;exports.WebPlayerIcon=t.WebPlayerIcon$1;exports.generateCompositionUrl=t.generateCompositionUrl;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-Dj9ilM-O.cjs");require("react/jsx-runtime");const S=require("react"),V=require("react-dom/client");var R=Object.defineProperty,D=(e,t,r)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t,r)=>D(e,typeof t!="symbol"?t+"":t,r);const v={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},w={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}},M={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)};function Y(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,r,s)=>`${r}-${s.toLowerCase()}`)}function L(e){return e.replace(/[-:]([a-z])/g,(t,r)=>`${r.toUpperCase()}`)}const G={stringify:e=>e.name,parse:(e,t,r)=>{const s=(()=>{const _=L(t);if(typeof r<"u"&&_ in r.container)return r.container[_]})();return typeof s=="function"?s.bind(r):void 0}},F={stringify:e=>`${e}`,parse:e=>parseFloat(e)},j={stringify:e=>e,parse:e=>e},N={string:j,number:F,boolean:v,function:w,method:G,json:M},f=Symbol.for("r2wc.render"),O=Symbol.for("r2wc.connected"),T=Symbol.for("r2wc.context"),a=Symbol.for("r2wc.props");function k(e,t,r){var s,_,C;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const h=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),g=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),b={},P={},m={},d={};for(const i of h){b[i]=Array.isArray(t.props)?"string":t.props[i];const o=Y(i);m[i]=o,d[o]=i}for(const i of g)P[i]=Array.isArray(t.events)?{}:t.events[i];class I extends HTMLElement{constructor(){super(),y(this,C,!0),y(this,_),y(this,s,{}),y(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[a].container=this.container;for(const o of h){const l=m[o],E=this.getAttribute(l),c=b[o],u=c?N[c]:null;if(c==="method"){const p=L(l);Object.defineProperty(this[a].container,p,{enumerable:!0,configurable:!0,get(){return this[a][p]},set(W){this[a][p]=W,this[f]()}}),this[a][o]=u.parse(E,l,this)}u!=null&&u.parse&&E&&(this[a][o]=u.parse(E,l,this))}for(const o of g)this[a][o]=l=>{const E=o.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(E,{detail:l,...P[o]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[O]=!0,this[f]()}disconnectedCallback(){this[O]=!1,this[T]&&r.unmount(this[T]),delete this[T]}attributeChangedCallback(o,l,E){const c=d[o],u=b[c],p=u?N[u]:null;c in b&&p!=null&&p.parse&&E&&(this[a][c]=p.parse(E,o,this),this[f]())}[(C=O,_=T,s=a,f)](){this[O]&&(this[T]?r.update(this[T],this[a]):this[T]=r.mount(this.container,e,this[a]))}}for(const i of h){const o=m[i],l=b[i];Object.defineProperty(I.prototype,i,{enumerable:!0,configurable:!0,get(){return this[a][i]},set(E){this[a][i]=E;const c=l?N[l]:null;if(c!=null&&c.stringify){const u=c.stringify(E,o,this);this.getAttribute(o)!==u&&this.setAttribute(o,u)}else this[f]()}})}return I}function x(e,t,r){const s=V.createRoot(e),_=S.createElement(t,r);return s.render(_),{root:s,ReactComponent:t}}function B({root:e,ReactComponent:t},r){const s=S.createElement(t,r);e.render(s)}function U({root:e}){setTimeout(()=>{e.unmount()},0)}function A(e,t={}){return k(e,t,{mount:x,update:B,unmount:U})}const $=A(n.WebPlayerWithInjectedStyles,{shadow:"closed",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",integration:"boolean",maxItemsShown:"number",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",autoLoadInterior360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean",analyticsEventPrefix:"string",analyticsUrl:"string",analyticsBearer:"string",analyticsSimpleRequestsOnly:"boolean",analyticsDryRun:"boolean",analyticsDebug:"boolean"}}),H=A(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),X=A(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function q(){customElements.define(n.WEB_PLAYER_WC_TAG,$),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,H),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,X)}function z(){n.checkCustomElementsDefinition()||q()}z();exports.ANALYTICS_EVENT_IDENTIFY=n.ANALYTICS_EVENT_IDENTIFY;exports.ANALYTICS_EVENT_PAGE=n.ANALYTICS_EVENT_PAGE;exports.ANALYTICS_EVENT_TRACK=n.ANALYTICS_EVENT_TRACK;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
@@ -186,12 +186,18 @@ export declare type Item =
186
186
  | ImageItem
187
187
  | VideoItem
188
188
  | ThreeSixtyItem
189
+ | NextGenThreeSixtyItem
189
190
  | InteriorThreeSixtyItem;
190
191
 
191
192
  export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
192
193
 
193
194
  declare type MediaWidth = number;
194
195
 
196
+ declare type NextGenThreeSixtyItem = {
197
+ type: "next360";
198
+ images: ImageWithHotspots[];
199
+ };
200
+
195
201
  declare type ThreeSixtyItem = {
196
202
  type: "360";
197
203
  images: ImageWithHotspots[];
package/dist/index.js CHANGED
@@ -1,19 +1,13 @@
1
- import { W as S, a as P, b as I, c as W, d as w, e as L, f as D } from "./shared-nW6KBfyK.js";
2
- import { A as oe, s as re, t as se, D as ie, j as ae, E as le, k as ce, n as ue, m as pe, r as me, q as Ee, p as be, o as fe, l as de, g as he, h as ye, i as _e, u as ge } from "./shared-nW6KBfyK.js";
1
+ import { W as I, a as L, b as W, c as D, d as R, e as V, f as M } from "./shared-D7cc889c.js";
2
+ import { A as ce, g as le, h as ue, D as pe, E as fe, i as me, j as be, k as Ee, l as he, m as ye, n as de, o as ge, p as _e, q as Te, r as Oe, s as Ae, t as Ce, u as Ne } from "./shared-D7cc889c.js";
3
3
  import "react/jsx-runtime";
4
- import N from "react";
5
- import { createRoot as R } from "react-dom/client";
6
- var V = Object.defineProperty, M = (e, t, n) => t in e ? V(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, b = (e, t, n) => (M(e, typeof t != "symbol" ? t + "" : t, n), n);
7
- const v = {
8
- stringify: (e) => e,
9
- parse: (e) => e
10
- }, x = {
11
- stringify: (e) => `${e}`,
12
- parse: (e) => parseFloat(e)
13
- }, j = {
4
+ import P from "react";
5
+ import { createRoot as j } from "react-dom/client";
6
+ var x = Object.defineProperty, k = (e, t, n) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, h = (e, t, n) => k(e, typeof t != "symbol" ? t + "" : t, n);
7
+ const F = {
14
8
  stringify: (e) => e ? "true" : "false",
15
9
  parse: (e) => /^[ty1-9]/i.test(e)
16
- }, k = {
10
+ }, G = {
17
11
  stringify: (e) => e.name,
18
12
  parse: (e, t, n) => {
19
13
  const r = (() => {
@@ -24,104 +18,146 @@ const v = {
24
18
  })();
25
19
  return typeof r == "function" ? r.bind(n) : void 0;
26
20
  }
27
- }, F = {
21
+ }, Y = {
28
22
  stringify: (e) => JSON.stringify(e),
29
23
  parse: (e) => JSON.parse(e)
30
- }, T = {
31
- string: v,
32
- number: x,
33
- boolean: j,
34
- function: k,
35
- json: F
36
24
  };
37
- function G(e) {
25
+ function U(e) {
38
26
  return e.replace(
39
27
  /([a-z0-9])([A-Z])/g,
40
28
  (t, n, r) => `${n}-${r.toLowerCase()}`
41
29
  );
42
30
  }
43
- const f = Symbol.for("r2wc.render"), d = Symbol.for("r2wc.connected"), u = Symbol.for("r2wc.context"), c = Symbol.for("r2wc.props");
44
- function Y(e, t, n) {
45
- var r, E, C;
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 = {}, y = {}, _ = {};
48
- for (const s of h) {
49
- m[s] = Array.isArray(t.props) ? "string" : t.props[s];
50
- const o = G(s);
51
- y[s] = o, _[o] = s;
31
+ function v(e) {
32
+ return e.replace(/[-:]([a-z])/g, (t, n) => `${n.toUpperCase()}`);
33
+ }
34
+ const $ = {
35
+ stringify: (e) => e.name,
36
+ parse: (e, t, n) => {
37
+ const r = (() => {
38
+ const p = v(t);
39
+ if (typeof n < "u" && p in n.container)
40
+ return n.container[p];
41
+ })();
42
+ return typeof r == "function" ? r.bind(n) : void 0;
43
+ }
44
+ }, B = {
45
+ stringify: (e) => `${e}`,
46
+ parse: (e) => parseFloat(e)
47
+ }, H = {
48
+ stringify: (e) => e,
49
+ parse: (e) => e
50
+ }, T = {
51
+ string: H,
52
+ number: B,
53
+ boolean: F,
54
+ function: G,
55
+ method: $,
56
+ json: Y
57
+ }, E = Symbol.for("r2wc.render"), y = Symbol.for("r2wc.connected"), m = Symbol.for("r2wc.context"), i = Symbol.for("r2wc.props");
58
+ function z(e, t, n) {
59
+ var r, p, A;
60
+ t.props || (t.props = e.propTypes ? Object.keys(e.propTypes) : []), t.events || (t.events = []);
61
+ const d = Array.isArray(t.props) ? t.props.slice() : Object.keys(t.props), C = Array.isArray(t.events) ? t.events.slice() : Object.keys(t.events), b = {}, N = {}, g = {}, _ = {};
62
+ for (const s of d) {
63
+ b[s] = Array.isArray(t.props) ? "string" : t.props[s];
64
+ const o = U(s);
65
+ g[s] = o, _[o] = s;
52
66
  }
53
- class A extends HTMLElement {
67
+ for (const s of C)
68
+ N[s] = Array.isArray(t.events) ? {} : t.events[s];
69
+ class S extends HTMLElement {
54
70
  constructor() {
55
- super(), b(this, r, !0), b(this, E), b(this, C, {}), b(this, "container"), t.shadow ? this.container = this.attachShadow({
71
+ super(), h(this, A, !0), h(this, p), h(this, r, {}), h(this, "container"), t.shadow ? this.container = this.attachShadow({
56
72
  mode: t.shadow
57
- }) : this.container = this, this[c].container = this.container;
58
- for (const o of h) {
59
- const p = y[o], l = this.getAttribute(p), i = m[o], a = i ? T[i] : null;
60
- a != null && a.parse && l && (this[c][o] = a.parse(l, p, this));
73
+ }) : this.container = this, this[i].container = this.container;
74
+ for (const o of d) {
75
+ const l = g[o], a = this.getAttribute(l), c = b[o], u = c ? T[c] : null;
76
+ if (c === "method") {
77
+ const f = v(l);
78
+ Object.defineProperty(this[i].container, f, {
79
+ enumerable: !0,
80
+ configurable: !0,
81
+ get() {
82
+ return this[i][f];
83
+ },
84
+ set(w) {
85
+ this[i][f] = w, this[E]();
86
+ }
87
+ }), this[i][o] = u.parse(a, l, this);
88
+ }
89
+ u != null && u.parse && a && (this[i][o] = u.parse(a, l, this));
61
90
  }
91
+ for (const o of C)
92
+ this[i][o] = (l) => {
93
+ const a = o.replace(/^on/, "").toLowerCase();
94
+ this.dispatchEvent(
95
+ new CustomEvent(a, { detail: l, ...N[o] })
96
+ );
97
+ };
62
98
  }
63
99
  static get observedAttributes() {
64
100
  return Object.keys(_);
65
101
  }
66
102
  connectedCallback() {
67
- this[d] = !0, this[f]();
103
+ this[y] = !0, this[E]();
68
104
  }
69
105
  disconnectedCallback() {
70
- this[d] = !1, this[u] && n.unmount(this[u]), delete this[u];
106
+ this[y] = !1, this[m] && n.unmount(this[m]), delete this[m];
71
107
  }
72
- attributeChangedCallback(o, p, l) {
73
- const i = _[o], a = m[i], g = a ? T[a] : null;
74
- i in m && g != null && g.parse && l && (this[c][i] = g.parse(l, o, this), this[f]());
108
+ attributeChangedCallback(o, l, a) {
109
+ const c = _[o], u = b[c], f = u ? T[u] : null;
110
+ c in b && f != null && f.parse && a && (this[i][c] = f.parse(a, o, this), this[E]());
75
111
  }
76
- [(r = d, E = u, C = c, f)]() {
77
- this[d] && (this[u] ? n.update(this[u], this[c]) : this[u] = n.mount(
112
+ [(A = y, p = m, r = i, E)]() {
113
+ this[y] && (this[m] ? n.update(this[m], this[i]) : this[m] = n.mount(
78
114
  this.container,
79
115
  e,
80
- this[c]
116
+ this[i]
81
117
  ));
82
118
  }
83
119
  }
84
- for (const s of h) {
85
- const o = y[s], p = m[s];
86
- Object.defineProperty(A.prototype, s, {
120
+ for (const s of d) {
121
+ const o = g[s], l = b[s];
122
+ Object.defineProperty(S.prototype, s, {
87
123
  enumerable: !0,
88
124
  configurable: !0,
89
125
  get() {
90
- return this[c][s];
126
+ return this[i][s];
91
127
  },
92
- set(l) {
93
- this[c][s] = l;
94
- const i = p ? T[p] : null;
95
- if (i != null && i.stringify) {
96
- const a = i.stringify(l, o, this);
97
- this.getAttribute(o) !== a && this.setAttribute(o, a);
128
+ set(a) {
129
+ this[i][s] = a;
130
+ const c = l ? T[l] : null;
131
+ if (c != null && c.stringify) {
132
+ const u = c.stringify(a, o, this);
133
+ this.getAttribute(o) !== u && this.setAttribute(o, u);
98
134
  } else
99
- this[f]();
135
+ this[E]();
100
136
  }
101
137
  });
102
138
  }
103
- return A;
139
+ return S;
104
140
  }
105
- function B(e, t, n) {
106
- const r = R(e), E = N.createElement(t, n);
107
- return r.render(E), {
141
+ function J(e, t, n) {
142
+ const r = j(e), p = P.createElement(t, n);
143
+ return r.render(p), {
108
144
  root: r,
109
145
  ReactComponent: t
110
146
  };
111
147
  }
112
- function U({ root: e, ReactComponent: t }, n) {
113
- const r = N.createElement(t, n);
148
+ function X({ root: e, ReactComponent: t }, n) {
149
+ const r = P.createElement(t, n);
114
150
  e.render(r);
115
151
  }
116
- function H({ root: e }) {
152
+ function q({ root: e }) {
117
153
  setTimeout(() => {
118
154
  e.unmount();
119
155
  }, 0);
120
156
  }
121
157
  function O(e, t = {}) {
122
- return Y(e, t, { mount: B, update: U, unmount: H });
158
+ return z(e, t, { mount: J, update: X, unmount: q });
123
159
  }
124
- const $ = O(S, {
160
+ const K = O(I, {
125
161
  shadow: "closed",
126
162
  props: {
127
163
  compositionUrl: "string",
@@ -152,47 +188,47 @@ const $ = O(S, {
152
188
  analyticsDryRun: "boolean",
153
189
  analyticsDebug: "boolean"
154
190
  }
155
- }), J = O(P, {
191
+ }), Z = O(L, {
156
192
  shadow: "closed",
157
193
  props: {
158
194
  index: "number",
159
195
  thumbnailSrc: "string"
160
196
  }
161
- }), X = O(I, {
197
+ }), Q = O(W, {
162
198
  shadow: "closed",
163
199
  props: {
164
200
  name: "string"
165
201
  }
166
202
  });
167
- function q() {
168
- customElements.define(w, $), customElements.define(
169
- L,
170
- J
171
- ), customElements.define(D, X);
203
+ function ee() {
204
+ customElements.define(R, K), customElements.define(
205
+ V,
206
+ Z
207
+ ), customElements.define(M, Q);
172
208
  }
173
- function z() {
174
- W() || q();
209
+ function te() {
210
+ D() || ee();
175
211
  }
176
- z();
212
+ te();
177
213
  export {
178
- oe as ANALYTICS_EVENT_IDENTIFY,
179
- re as ANALYTICS_EVENT_PAGE,
180
- se as ANALYTICS_EVENT_TRACK,
181
- ie as DEFAULT_EVENT_PREFIX,
182
- ae as EVENT_COMPOSITION_LOADED,
183
- le as EVENT_COMPOSITION_LOADING,
184
- ce as EVENT_COMPOSITION_LOAD_ERROR,
185
- ue as EVENT_EXTEND_MODE_OFF,
186
- pe as EVENT_EXTEND_MODE_ON,
187
- me as EVENT_GALLERY_CLOSE,
188
- Ee as EVENT_GALLERY_OPEN,
189
- be as EVENT_HOTSPOTS_OFF,
190
- fe as EVENT_HOTSPOTS_ON,
191
- de as EVENT_ITEM_CHANGE,
192
- D as WEB_PLAYER_ICON_WC_TAG,
193
- w as WEB_PLAYER_WC_TAG,
194
- he as WebPlayer,
195
- ye as WebPlayerCustomMedia,
196
- _e as WebPlayerIcon,
197
- ge as generateCompositionUrl
214
+ ce as ANALYTICS_EVENT_IDENTIFY,
215
+ le as ANALYTICS_EVENT_PAGE,
216
+ ue as ANALYTICS_EVENT_TRACK,
217
+ pe as DEFAULT_EVENT_PREFIX,
218
+ fe as EVENT_COMPOSITION_LOADED,
219
+ me as EVENT_COMPOSITION_LOADING,
220
+ be as EVENT_COMPOSITION_LOAD_ERROR,
221
+ Ee as EVENT_EXTEND_MODE_OFF,
222
+ he as EVENT_EXTEND_MODE_ON,
223
+ ye as EVENT_GALLERY_CLOSE,
224
+ de as EVENT_GALLERY_OPEN,
225
+ ge as EVENT_HOTSPOTS_OFF,
226
+ _e as EVENT_HOTSPOTS_ON,
227
+ Te as EVENT_ITEM_CHANGE,
228
+ M as WEB_PLAYER_ICON_WC_TAG,
229
+ R as WEB_PLAYER_WC_TAG,
230
+ Oe as WebPlayer,
231
+ Ae as WebPlayerCustomMedia,
232
+ Ce as WebPlayerIcon,
233
+ Ne as generateCompositionUrl
198
234
  };
package/dist/legacy.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./shared-BWLUv51h.cjs");require("react/jsx-runtime");const I=require("react"),f=require("react-dom");var S=Object.defineProperty,L=(e,n,r)=>n in e?S(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,p=(e,n,r)=>(L(e,typeof n!="symbol"?n+"":n,r),r);const W={stringify:e=>e,parse:e=>e},V={stringify:e=>`${e}`,parse:e=>parseFloat(e)},R={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},D={stringify:e=>e.name,parse:(e,n,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}},M={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},A={string:W,number:V,boolean:R,function:D,json:M};function w(e){return e.replace(/([a-z0-9])([A-Z])/g,(n,r,s)=>`${r}-${s.toLowerCase()}`)}const b=Symbol.for("r2wc.render"),N=Symbol.for("r2wc.connected"),u=Symbol.for("r2wc.context"),c=Symbol.for("r2wc.props");function Y(e,n,r){var s,C,g;n.props||(n.props=e.propTypes?Object.keys(e.propTypes):[]);const O=Array.isArray(n.props)?n.props.slice():Object.keys(n.props),T={},d={},m={};for(const i of O){T[i]=Array.isArray(n.props)?"string":n.props[i];const o=w(i);d[i]=o,m[o]=i}class P extends HTMLElement{constructor(){super(),p(this,s,!0),p(this,C),p(this,g,{}),p(this,"container"),n.shadow?this.container=this.attachShadow({mode:n.shadow}):this.container=this,this[c].container=this.container;for(const o of O){const _=d[o],l=this.getAttribute(_),a=T[o],E=a?A[a]:null;E!=null&&E.parse&&l&&(this[c][o]=E.parse(l,_,this))}}static get observedAttributes(){return Object.keys(m)}connectedCallback(){this[N]=!0,this[b]()}disconnectedCallback(){this[N]=!1,this[u]&&r.unmount(this[u]),delete this[u]}attributeChangedCallback(o,_,l){const a=m[o],E=T[a],y=E?A[E]:null;a in T&&y!=null&&y.parse&&l&&(this[c][a]=y.parse(l,o,this),this[b]())}[(s=N,C=u,g=c,b)](){this[N]&&(this[u]?r.update(this[u],this[c]):this[u]=r.mount(this.container,e,this[c]))}}for(const i of O){const o=d[i],_=T[i];Object.defineProperty(P.prototype,i,{enumerable:!0,configurable:!0,get(){return this[c][i]},set(l){this[c][i]=l;const a=_?A[_]:null;if(a!=null&&a.stringify){const E=a.stringify(l,o,this);this.getAttribute(o)!==E&&this.setAttribute(o,E)}else this[b]()}})}return P}function G(e,n,r){const s=I.createElement(n,r);return f.render(s,e),{container:e,ReactComponent:n}}function F({container:e,ReactComponent:n},r){const s=I.createElement(n,r);f.render(s,e)}function v({container:e}){f.unmountComponentAtNode(e)}function h(e,n={}){return Y(e,n,{mount:G,update:F,unmount:v})}const j=h(t.WebPlayerWithInjectedStyles,{shadow:"closed",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",autoLoadInterior360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean",analyticsEventPrefix:"string",analyticsUrl:"string",analyticsBearer:"string",analyticsSimpleRequestsOnly:"boolean",analyticsDryRun:"boolean",analyticsDebug:"boolean"}}),B=h(t.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),k=h(t.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function x(){customElements.define(t.WEB_PLAYER_WC_TAG,j),customElements.define(t.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,B),customElements.define(t.WEB_PLAYER_ICON_WC_TAG,k)}function $(){t.checkCustomElementsDefinition()||x()}$();exports.ANALYTICS_EVENT_IDENTIFY=t.ANALYTICS_EVENT_IDENTIFY;exports.ANALYTICS_EVENT_PAGE=t.ANALYTICS_EVENT_PAGE;exports.ANALYTICS_EVENT_TRACK=t.ANALYTICS_EVENT_TRACK;exports.DEFAULT_EVENT_PREFIX=t.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=t.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=t.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=t.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=t.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=t.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=t.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=t.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=t.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=t.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=t.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=t.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=t.WEB_PLAYER_WC_TAG;exports.WebPlayer=t.WebPlayer;exports.WebPlayerCustomMedia=t.WebPlayerCustomMedia$1;exports.WebPlayerIcon=t.WebPlayerIcon$1;exports.generateCompositionUrl=t.generateCompositionUrl;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-Dj9ilM-O.cjs");require("react/jsx-runtime");const S=require("react"),A=require("react-dom");var R=Object.defineProperty,D=(e,t,r)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y=(e,t,r)=>D(e,typeof t!="symbol"?t+"":t,r);const v={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},M={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}},w={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)};function Y(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,r,s)=>`${r}-${s.toLowerCase()}`)}function W(e){return e.replace(/[-:]([a-z])/g,(t,r)=>`${r.toUpperCase()}`)}const G={stringify:e=>e.name,parse:(e,t,r)=>{const s=(()=>{const T=W(t);if(typeof r<"u"&&T in r.container)return r.container[T]})();return typeof s=="function"?s.bind(r):void 0}},F={stringify:e=>`${e}`,parse:e=>parseFloat(e)},j={stringify:e=>e,parse:e=>e},m={string:j,number:F,boolean:v,function:M,method:G,json:w},f=Symbol.for("r2wc.render"),O=Symbol.for("r2wc.connected"),p=Symbol.for("r2wc.context"),a=Symbol.for("r2wc.props");function k(e,t,r){var s,T,g;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const d=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),P=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),b={},I={},h={},N={};for(const i of d){b[i]=Array.isArray(t.props)?"string":t.props[i];const o=Y(i);h[i]=o,N[o]=i}for(const i of P)I[i]=Array.isArray(t.events)?{}:t.events[i];class L extends HTMLElement{constructor(){super(),y(this,g,!0),y(this,T),y(this,s,{}),y(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[a].container=this.container;for(const o of d){const l=h[o],E=this.getAttribute(l),c=b[o],u=c?m[c]:null;if(c==="method"){const _=W(l);Object.defineProperty(this[a].container,_,{enumerable:!0,configurable:!0,get(){return this[a][_]},set(V){this[a][_]=V,this[f]()}}),this[a][o]=u.parse(E,l,this)}u!=null&&u.parse&&E&&(this[a][o]=u.parse(E,l,this))}for(const o of P)this[a][o]=l=>{const E=o.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(E,{detail:l,...I[o]}))}}static get observedAttributes(){return Object.keys(N)}connectedCallback(){this[O]=!0,this[f]()}disconnectedCallback(){this[O]=!1,this[p]&&r.unmount(this[p]),delete this[p]}attributeChangedCallback(o,l,E){const c=N[o],u=b[c],_=u?m[u]:null;c in b&&_!=null&&_.parse&&E&&(this[a][c]=_.parse(E,o,this),this[f]())}[(g=O,T=p,s=a,f)](){this[O]&&(this[p]?r.update(this[p],this[a]):this[p]=r.mount(this.container,e,this[a]))}}for(const i of d){const o=h[i],l=b[i];Object.defineProperty(L.prototype,i,{enumerable:!0,configurable:!0,get(){return this[a][i]},set(E){this[a][i]=E;const c=l?m[l]:null;if(c!=null&&c.stringify){const u=c.stringify(E,o,this);this.getAttribute(o)!==u&&this.setAttribute(o,u)}else this[f]()}})}return L}function B(e,t,r){const s=S.createElement(t,r);return A.render(s,e),{container:e,ReactComponent:t}}function $({container:e,ReactComponent:t},r){const s=S.createElement(t,r);A.render(s,e)}function x({container:e}){A.unmountComponentAtNode(e)}function C(e,t={}){return k(e,t,{mount:B,update:$,unmount:x})}const U=C(n.WebPlayerWithInjectedStyles,{shadow:"closed",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",autoLoadInterior360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean",analyticsEventPrefix:"string",analyticsUrl:"string",analyticsBearer:"string",analyticsSimpleRequestsOnly:"boolean",analyticsDryRun:"boolean",analyticsDebug:"boolean"}}),H=C(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),X=C(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function q(){customElements.define(n.WEB_PLAYER_WC_TAG,U),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,H),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,X)}function z(){n.checkCustomElementsDefinition()||q()}z();exports.ANALYTICS_EVENT_IDENTIFY=n.ANALYTICS_EVENT_IDENTIFY;exports.ANALYTICS_EVENT_PAGE=n.ANALYTICS_EVENT_PAGE;exports.ANALYTICS_EVENT_TRACK=n.ANALYTICS_EVENT_TRACK;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
@@ -186,12 +186,18 @@ export declare type Item =
186
186
  | ImageItem
187
187
  | VideoItem
188
188
  | ThreeSixtyItem
189
+ | NextGenThreeSixtyItem
189
190
  | InteriorThreeSixtyItem;
190
191
 
191
192
  export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
192
193
 
193
194
  declare type MediaWidth = number;
194
195
 
196
+ declare type NextGenThreeSixtyItem = {
197
+ type: "next360";
198
+ images: ImageWithHotspots[];
199
+ };
200
+
195
201
  declare type ThreeSixtyItem = {
196
202
  type: "360";
197
203
  images: ImageWithHotspots[];