@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/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-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 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-nW6KBfyK.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-D7cc889c.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 _e, p as ge, q as Ae, r as Ce, s as Oe, t as Te, u as Ne } from "./shared-D7cc889c.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 C 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
+ }, A = {
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
+ _[o] = r, g[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 = _[r], a = this.getAttribute(l), c = E[r], u = c ? A[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(g);
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 = g[r], u = E[c], p = u ? A[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 = _[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 ? A[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 C.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
+ C.render(s, e);
115
151
  }
116
- function U({ container: e }) {
117
- T.unmountComponentAtNode(e);
152
+ function q({ container: e }) {
153
+ C.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",
@@ -148,47 +184,47 @@ const H = O(S, {
148
184
  analyticsDryRun: "boolean",
149
185
  analyticsDebug: "boolean"
150
186
  }
151
- }), J = O(W, {
187
+ }), Z = O(I, {
152
188
  shadow: "closed",
153
189
  props: {
154
190
  index: "number",
155
191
  thumbnailSrc: "string"
156
192
  }
157
- }), X = O(I, {
193
+ }), Q = O(D, {
158
194
  shadow: "closed",
159
195
  props: {
160
196
  name: "string"
161
197
  }
162
198
  });
163
- function q() {
164
- customElements.define(w, H), customElements.define(
165
- D,
166
- J
167
- ), customElements.define(R, X);
199
+ function ee() {
200
+ customElements.define(V, K), customElements.define(
201
+ M,
202
+ Z
203
+ ), customElements.define(j, Q);
168
204
  }
169
- function z() {
170
- L() || q();
205
+ function te() {
206
+ R() || ee();
171
207
  }
172
- z();
208
+ te();
173
209
  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
210
+ ce as ANALYTICS_EVENT_IDENTIFY,
211
+ le as ANALYTICS_EVENT_PAGE,
212
+ ue as ANALYTICS_EVENT_TRACK,
213
+ pe as DEFAULT_EVENT_PREFIX,
214
+ fe as EVENT_COMPOSITION_LOADED,
215
+ me as EVENT_COMPOSITION_LOADING,
216
+ Ee as EVENT_COMPOSITION_LOAD_ERROR,
217
+ be as EVENT_EXTEND_MODE_OFF,
218
+ he as EVENT_EXTEND_MODE_ON,
219
+ de as EVENT_GALLERY_CLOSE,
220
+ ye as EVENT_GALLERY_OPEN,
221
+ _e as EVENT_HOTSPOTS_OFF,
222
+ ge as EVENT_HOTSPOTS_ON,
223
+ Ae as EVENT_ITEM_CHANGE,
224
+ j as WEB_PLAYER_ICON_WC_TAG,
225
+ V as WEB_PLAYER_WC_TAG,
226
+ Ce as WebPlayer,
227
+ Oe as WebPlayerCustomMedia,
228
+ Te as WebPlayerIcon,
229
+ Ne as generateCompositionUrl
194
230
  };