@car-cutter/vanilla-webplayer 3.1.1 → 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 +11 -3
- package/dist/index.js +31 -30
- package/dist/index.umd.cjs +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const ANALYTICS_EVENT_DISPLAY = "analytics-display";
|
|
2
2
|
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const ANALYTICS_EVENT_ERROR = "analytics-error";
|
|
4
4
|
|
|
5
|
-
export declare const
|
|
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 & {
|
|
@@ -189,11 +191,17 @@ declare type WebPlayerProps = {
|
|
|
189
191
|
|
|
190
192
|
// Analytics
|
|
191
193
|
analyticsEventPrefix?: string;
|
|
194
|
+
/** @deprecated Prefer monitoring (enabled by default). When set, disables monitoring and sends analytics to this URL instead. */
|
|
192
195
|
analyticsUrl?: string;
|
|
196
|
+
/** @deprecated Only used with analyticsUrl. Sets the Authorization bearer token for analytics requests. Ignored when analyticsSimpleRequestsOnly is true. */
|
|
193
197
|
analyticsBearer?: string;
|
|
198
|
+
/** @deprecated Only used with analyticsUrl. When true, sends CORS simple requests only (disables custom headers including analyticsBearer). */
|
|
194
199
|
analyticsSimpleRequestsOnly?: boolean;
|
|
195
200
|
analyticsDryRun?: boolean;
|
|
196
201
|
analyticsDebug?: boolean;
|
|
202
|
+
|
|
203
|
+
// Monitoring
|
|
204
|
+
monitoring?: boolean;
|
|
197
205
|
};
|
|
198
206
|
|
|
199
207
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { ensureCustomElementsDefinition as
|
|
2
|
-
function m(
|
|
3
|
-
const
|
|
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,
|
|
5
|
+
([o, n]) => e.setAttribute(o, n)
|
|
6
6
|
);
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
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, ...
|
|
13
|
+
), { element: o, ...n } = e;
|
|
14
14
|
t.appendChild(o);
|
|
15
|
-
const r =
|
|
16
|
-
|
|
15
|
+
const r = O(n);
|
|
16
|
+
c(t, r), E.appendChild(t);
|
|
17
17
|
}), a?.icons?.forEach((e) => {
|
|
18
|
-
const t = document.createElement(
|
|
18
|
+
const t = document.createElement(N), { element: o, ...n } = e;
|
|
19
19
|
t.appendChild(o);
|
|
20
|
-
const r =
|
|
21
|
-
|
|
22
|
-
}),
|
|
20
|
+
const r = C(n);
|
|
21
|
+
c(t, r), E.appendChild(t);
|
|
22
|
+
}), s.appendChild(E);
|
|
23
23
|
}
|
|
24
|
-
const P = "cc-webplayer",
|
|
25
|
-
function
|
|
26
|
-
return `https://cdn.car-cutter.com/gallery/${
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
48
|
+
g as generateCompositionUrl
|
|
48
49
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -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
|
|
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.
|
|
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.
|
|
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": "^
|
|
47
|
+
"vite": "^6.2.0",
|
|
48
48
|
"vite-bundle-visualizer": "^1.2.1",
|
|
49
49
|
"vite-plugin-dts": "^4.2.1"
|
|
50
50
|
},
|