@car-cutter/react-webplayer 3.0.3 → 3.1.1

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