@car-cutter/vanilla-webplayer 3.1.0 → 3.1.2

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.d.ts CHANGED
@@ -1,8 +1,10 @@
1
- export declare const ANALYTICS_EVENT_IDENTIFY = "analytics-identify";
1
+ export declare const ANALYTICS_EVENT_DISPLAY = "analytics-display";
2
2
 
3
- export declare const ANALYTICS_EVENT_PAGE = "analytics-page";
3
+ export declare const ANALYTICS_EVENT_ERROR = "analytics-error";
4
4
 
5
- export declare const ANALYTICS_EVENT_TRACK = "analytics-track";
5
+ export declare const ANALYTICS_EVENT_INTERACTION = "analytics-interaction";
6
+
7
+ export declare const ANALYTICS_EVENT_LOAD = "analytics-load";
6
8
 
7
9
  export declare function appendWebPlayer(parentElement: HTMLElement, webPlayerProps: WebPlayerProps, customization?: {
8
10
  customMedias?: (WebPlayerCustomMediaProps & {
@@ -185,14 +187,21 @@ declare type WebPlayerProps = {
185
187
  eventPrefix?: string;
186
188
  demoSpin?: boolean;
187
189
  reverse360?: boolean;
190
+ spinCursor?: string;
188
191
 
189
192
  // Analytics
190
193
  analyticsEventPrefix?: string;
194
+ /** @deprecated Prefer monitoring (enabled by default). When set, disables monitoring and sends analytics to this URL instead. */
191
195
  analyticsUrl?: string;
196
+ /** @deprecated Only used with analyticsUrl. Sets the Authorization bearer token for analytics requests. Ignored when analyticsSimpleRequestsOnly is true. */
192
197
  analyticsBearer?: string;
198
+ /** @deprecated Only used with analyticsUrl. When true, sends CORS simple requests only (disables custom headers including analyticsBearer). */
193
199
  analyticsSimpleRequestsOnly?: boolean;
194
200
  analyticsDryRun?: boolean;
195
201
  analyticsDebug?: boolean;
202
+
203
+ // Monitoring
204
+ monitoring?: boolean;
196
205
  };
197
206
 
198
207
  export { }
package/dist/index.js CHANGED
@@ -1,48 +1,49 @@
1
- import { ensureCustomElementsDefinition as i, WEB_PLAYER_WC_TAG as A, webPlayerPropsToAttributes as l, WEB_PLAYER_CUSTOM_MEDIA_WC_TAG as p, webPlayerCustomMediaPropsToAttributes as C, WEB_PLAYER_ICON_WC_TAG as O, webPlayerIconPropsToAttributes as N } from "@car-cutter/wc-webplayer";
2
- function m(_, c, a) {
3
- const s = (e, t) => {
1
+ import { ensureCustomElementsDefinition as T, WEB_PLAYER_WC_TAG as i, webPlayerPropsToAttributes as l, WEB_PLAYER_CUSTOM_MEDIA_WC_TAG as p, webPlayerCustomMediaPropsToAttributes as O, WEB_PLAYER_ICON_WC_TAG as N, webPlayerIconPropsToAttributes as C } from "@car-cutter/wc-webplayer";
2
+ function m(s, _, a) {
3
+ const c = (e, t) => {
4
4
  Object.entries(t).forEach(
5
- ([o, E]) => e.setAttribute(o, E)
5
+ ([o, n]) => e.setAttribute(o, n)
6
6
  );
7
7
  };
8
- i();
9
- const n = document.createElement(A), T = l(c);
10
- s(n, T), a?.customMedias?.forEach((e) => {
8
+ T();
9
+ const E = document.createElement(i), A = l(_);
10
+ c(E, A), a?.customMedias?.forEach((e) => {
11
11
  const t = document.createElement(
12
12
  p
13
- ), { element: o, ...E } = e;
13
+ ), { element: o, ...n } = e;
14
14
  t.appendChild(o);
15
- const r = C(E);
16
- s(t, r), n.appendChild(t);
15
+ const r = O(n);
16
+ c(t, r), E.appendChild(t);
17
17
  }), a?.icons?.forEach((e) => {
18
- const t = document.createElement(O), { element: o, ...E } = e;
18
+ const t = document.createElement(N), { element: o, ...n } = e;
19
19
  t.appendChild(o);
20
- const r = N(E);
21
- s(t, r), n.appendChild(t);
22
- }), _.appendChild(n);
20
+ const r = C(n);
21
+ c(t, r), E.appendChild(t);
22
+ }), s.appendChild(E);
23
23
  }
24
- const P = "cc-webplayer", I = "cc-webplayer-custom-media", L = "cc-webplayer-icon", u = "composition-loading", b = "composition-loaded", W = "composition-load-error", y = "item-change", R = "extend-mode-on", M = "extend-mode-off", Y = "hotspots-on", D = "hotspots-off", G = "gallery-open", S = "gallery-close", V = "analytics-identify", f = "analytics-page", h = "analytics-track", w = "cc-webplayer:";
25
- function B(_, c) {
26
- return `https://cdn.car-cutter.com/gallery/${_}/${c}/composition_v3.json`;
24
+ const P = "cc-webplayer", L = "cc-webplayer-custom-media", I = "cc-webplayer-icon", u = "composition-loading", b = "composition-loaded", R = "composition-load-error", W = "item-change", y = "extend-mode-on", S = "extend-mode-off", Y = "hotspots-on", D = "hotspots-off", M = "gallery-open", V = "gallery-close", G = "analytics-load", h = "analytics-display", f = "analytics-interaction", w = "analytics-error", B = "cc-webplayer:";
25
+ function g(s, _) {
26
+ return `https://cdn.car-cutter.com/gallery/${s}/${_}/composition_v3.json`;
27
27
  }
28
28
  export {
29
- V as ANALYTICS_EVENT_IDENTIFY,
30
- f as ANALYTICS_EVENT_PAGE,
31
- h as ANALYTICS_EVENT_TRACK,
32
- w as DEFAULT_EVENT_PREFIX,
29
+ h as ANALYTICS_EVENT_DISPLAY,
30
+ w as ANALYTICS_EVENT_ERROR,
31
+ f as ANALYTICS_EVENT_INTERACTION,
32
+ G as ANALYTICS_EVENT_LOAD,
33
+ B as DEFAULT_EVENT_PREFIX,
33
34
  b as EVENT_COMPOSITION_LOADED,
34
35
  u as EVENT_COMPOSITION_LOADING,
35
- W as EVENT_COMPOSITION_LOAD_ERROR,
36
- M as EVENT_EXTEND_MODE_OFF,
37
- R as EVENT_EXTEND_MODE_ON,
38
- S as EVENT_GALLERY_CLOSE,
39
- G as EVENT_GALLERY_OPEN,
36
+ R as EVENT_COMPOSITION_LOAD_ERROR,
37
+ S as EVENT_EXTEND_MODE_OFF,
38
+ y as EVENT_EXTEND_MODE_ON,
39
+ V as EVENT_GALLERY_CLOSE,
40
+ M as EVENT_GALLERY_OPEN,
40
41
  D as EVENT_HOTSPOTS_OFF,
41
42
  Y as EVENT_HOTSPOTS_ON,
42
- y as EVENT_ITEM_CHANGE,
43
- I as WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,
44
- L as WEB_PLAYER_ICON_WC_TAG,
43
+ W as EVENT_ITEM_CHANGE,
44
+ L as WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,
45
+ I as WEB_PLAYER_ICON_WC_TAG,
45
46
  P as WEB_PLAYER_WC_TAG,
46
47
  m as appendWebPlayer,
47
- B as generateCompositionUrl
48
+ g as generateCompositionUrl
48
49
  };
@@ -1 +1 @@
1
- (function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@car-cutter/wc-webplayer")):typeof define=="function"&&define.amd?define(["exports","@car-cutter/wc-webplayer"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E.CarCutterWebplayerVanilla={},E.CarCutterWebplayerWC))})(this,function(E,e){"use strict";function s(c,i,O){const A=(_,t)=>{Object.entries(t).forEach(([n,o])=>_.setAttribute(n,o))};e.ensureCustomElementsDefinition();const T=document.createElement(e.WEB_PLAYER_WC_TAG),b=e.webPlayerPropsToAttributes(i);A(T,b),O?.customMedias?.forEach(_=>{const t=document.createElement(e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG),{element:n,...o}=_;t.appendChild(n);const N=e.webPlayerCustomMediaPropsToAttributes(o);A(t,N),T.appendChild(t)}),O?.icons?.forEach(_=>{const t=document.createElement(e.WEB_PLAYER_ICON_WC_TAG),{element:n,...o}=_;t.appendChild(n);const N=e.webPlayerIconPropsToAttributes(o);A(t,N),T.appendChild(t)}),c.appendChild(T)}const a="cc-webplayer",C="cc-webplayer-custom-media",l="cc-webplayer-icon",d="composition-loading",r="composition-loaded",P="composition-load-error",I="item-change",u="extend-mode-on",L="extend-mode-off",m="hotspots-on",V="hotspots-off",S="gallery-open",D="gallery-close",f="analytics-identify",p="analytics-page",R="analytics-track",M="cc-webplayer:";function Y(c,i){return`https://cdn.car-cutter.com/gallery/${c}/${i}/composition_v3.json`}E.ANALYTICS_EVENT_IDENTIFY=f,E.ANALYTICS_EVENT_PAGE=p,E.ANALYTICS_EVENT_TRACK=R,E.DEFAULT_EVENT_PREFIX=M,E.EVENT_COMPOSITION_LOADED=r,E.EVENT_COMPOSITION_LOADING=d,E.EVENT_COMPOSITION_LOAD_ERROR=P,E.EVENT_EXTEND_MODE_OFF=L,E.EVENT_EXTEND_MODE_ON=u,E.EVENT_GALLERY_CLOSE=D,E.EVENT_GALLERY_OPEN=S,E.EVENT_HOTSPOTS_OFF=V,E.EVENT_HOTSPOTS_ON=m,E.EVENT_ITEM_CHANGE=I,E.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=C,E.WEB_PLAYER_ICON_WC_TAG=l,E.WEB_PLAYER_WC_TAG=a,E.appendWebPlayer=s,E.generateCompositionUrl=Y,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
1
+ (function(E,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("@car-cutter/wc-webplayer")):typeof define=="function"&&define.amd?define(["exports","@car-cutter/wc-webplayer"],e):(E=typeof globalThis<"u"?globalThis:E||self,e(E.CarCutterWebplayerVanilla={},E.CarCutterWebplayerWC))})(this,(function(E,e){"use strict";function s(c,A,i){const N=(_,t)=>{Object.entries(t).forEach(([n,o])=>_.setAttribute(n,o))};e.ensureCustomElementsDefinition();const T=document.createElement(e.WEB_PLAYER_WC_TAG),b=e.webPlayerPropsToAttributes(A);N(T,b),i?.customMedias?.forEach(_=>{const t=document.createElement(e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG),{element:n,...o}=_;t.appendChild(n);const O=e.webPlayerCustomMediaPropsToAttributes(o);N(t,O),T.appendChild(t)}),i?.icons?.forEach(_=>{const t=document.createElement(e.WEB_PLAYER_ICON_WC_TAG),{element:n,...o}=_;t.appendChild(n);const O=e.webPlayerIconPropsToAttributes(o);N(t,O),T.appendChild(t)}),c.appendChild(T)}const a="cc-webplayer",C="cc-webplayer-custom-media",l="cc-webplayer-icon",r="composition-loading",d="composition-loaded",I="composition-load-error",L="item-change",P="extend-mode-on",u="extend-mode-off",m="hotspots-on",S="hotspots-off",V="gallery-open",R="gallery-close",D="analytics-load",Y="analytics-display",f="analytics-interaction",p="analytics-error",M="cc-webplayer:";function y(c,A){return`https://cdn.car-cutter.com/gallery/${c}/${A}/composition_v3.json`}E.ANALYTICS_EVENT_DISPLAY=Y,E.ANALYTICS_EVENT_ERROR=p,E.ANALYTICS_EVENT_INTERACTION=f,E.ANALYTICS_EVENT_LOAD=D,E.DEFAULT_EVENT_PREFIX=M,E.EVENT_COMPOSITION_LOADED=d,E.EVENT_COMPOSITION_LOADING=r,E.EVENT_COMPOSITION_LOAD_ERROR=I,E.EVENT_EXTEND_MODE_OFF=u,E.EVENT_EXTEND_MODE_ON=P,E.EVENT_GALLERY_CLOSE=R,E.EVENT_GALLERY_OPEN=V,E.EVENT_HOTSPOTS_OFF=S,E.EVENT_HOTSPOTS_ON=m,E.EVENT_ITEM_CHANGE=L,E.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=C,E.WEB_PLAYER_ICON_WC_TAG=l,E.WEB_PLAYER_WC_TAG=a,E.appendWebPlayer=s,E.generateCompositionUrl=y,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@car-cutter/vanilla-webplayer",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "license": "Apache-2.0",
5
5
  "author": {
6
6
  "name": "CarCutter",
@@ -35,7 +35,7 @@
35
35
  "analyze": "vite-bundle-visualizer"
36
36
  },
37
37
  "dependencies": {
38
- "@car-cutter/wc-webplayer": "3.1.0"
38
+ "@car-cutter/wc-webplayer": "3.1.2"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@car-cutter/eslint-config": "*",
@@ -44,7 +44,7 @@
44
44
  "browserslist-to-esbuild": "^2.1.1",
45
45
  "eslint": "^8.57.0",
46
46
  "typescript": "^5.5.4",
47
- "vite": "^5.4.21",
47
+ "vite": "^6.2.0",
48
48
  "vite-bundle-visualizer": "^1.2.1",
49
49
  "vite-plugin-dts": "^4.2.1"
50
50
  },