@car-cutter/vanilla-webplayer 0.13.0 → 3.0.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/README.md CHANGED
@@ -18,4 +18,4 @@ appendWebPlayer(targetElement, {
18
18
 
19
19
  ### Next Steps
20
20
 
21
- For more customisation, take a look at the **[Online Documentation](https://carcutter.github.io/cars-webplayer-js/)**
21
+ For more customization, take a look at the **[Online Documentation](https://carcutter.github.io/cars-webplayer-js/)**
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare function appendWebPlayer(parentElement: HTMLElement, webPlayerProps: WebPlayerProps, customisation?: {
1
+ export declare function appendWebPlayer(parentElement: HTMLElement, webPlayerProps: WebPlayerProps, customization?: {
2
2
  customMedias?: (WebPlayerCustomMediaProps & {
3
3
  element: HTMLElement;
4
4
  })[];
@@ -131,8 +131,10 @@ declare type WebPlayerIconName =
131
131
  | "UI_PLAY" // Play video
132
132
  | "UI_PLUS" // Increase zoom
133
133
  | "UI_REDUCE" // Reducing an extended view
134
- | "UI_360" // 360-degree view
135
- | "UI_INTERIOR_360" // interior 360 view
134
+ | "UI_360" // Exterior 360 view
135
+ | "UI_360_PLAY" // Play exterior 360
136
+ | "UI_INTERIOR_360" // Interior 360 view
137
+ | "UI_INTERIOR_360_PLAY" // Play interior 360 view
136
138
  | "UI_VOLUME" // Video volume
137
139
  | "UI_VOLUME_OFF" // Muted video
138
140
  | "CONTROLS_PREV" // Go to previous media
@@ -147,6 +149,10 @@ declare type WebPlayerIconProps = {
147
149
  declare type WebPlayerProps = {
148
150
  compositionUrl: string;
149
151
 
152
+ // Integration mode
153
+ integration?: boolean;
154
+ maxItemsShown?: number;
155
+
150
156
  // Layout
151
157
  hideCategoriesNav?: boolean;
152
158
  infiniteCarrousel?: boolean;
package/dist/index.js CHANGED
@@ -1,29 +1,29 @@
1
1
  import { ensureCustomElementsDefinition as T, WEB_PLAYER_WC_TAG as A, webPlayerPropsToAttributes as l, WEB_PLAYER_CUSTOM_MEDIA_WC_TAG as p, webPlayerCustomMediaPropsToAttributes as O, WEB_PLAYER_ICON_WC_TAG as m, webPlayerIconPropsToAttributes as d } from "@car-cutter/wc-webplayer";
2
- function P(_, c, i) {
3
- const s = (e, t) => {
4
- Object.entries(t).forEach(
5
- ([o, E]) => e.setAttribute(o, E)
2
+ function P(_, s, i) {
3
+ const c = (t, e) => {
4
+ Object.entries(e).forEach(
5
+ ([o, n]) => t.setAttribute(o, n)
6
6
  );
7
7
  };
8
8
  T();
9
- const n = document.createElement(A), a = l(c);
10
- s(n, a), i?.customMedias?.forEach((e) => {
11
- const t = document.createElement(
9
+ const E = document.createElement(A), a = l(s);
10
+ c(E, a), i?.customMedias?.forEach((t) => {
11
+ const e = document.createElement(
12
12
  p
13
- ), { element: o, ...E } = e;
14
- t.appendChild(o);
15
- const r = O(E);
16
- s(t, r), n.appendChild(t);
17
- }), i?.icons?.forEach((e) => {
18
- const t = document.createElement(m), { element: o, ...E } = e;
19
- t.appendChild(o);
20
- const r = d(E);
21
- s(t, r), n.appendChild(t);
22
- }), _.appendChild(n);
13
+ ), { element: o, ...n } = t;
14
+ e.appendChild(o);
15
+ const r = O(n);
16
+ c(e, r), E.appendChild(e);
17
+ }), i?.icons?.forEach((t) => {
18
+ const e = document.createElement(m), { element: o, ...n } = t;
19
+ e.appendChild(o);
20
+ const r = d(n);
21
+ c(e, r), E.appendChild(e);
22
+ }), _.appendChild(E);
23
23
  }
24
24
  const N = "cc-webplayer", u = "cc-webplayer-custom-media", b = "cc-webplayer-icon", W = "composition-loading", L = "composition-loaded", I = "composition-load-error", M = "item-change", R = "extend-mode-on", y = "extend-mode-off", D = "hotspots-on", G = "hotspots-off", h = "gallery-open", f = "gallery-close", S = "cc-webplayer:";
25
- function V(_, c) {
26
- return `https://cdn.car-cutter.com/gallery/${_}/${c}/composition_v3.json`;
25
+ function V(_, s) {
26
+ return `https://cdn.car-cutter.com/gallery/${_}/${s}/composition_v3.json`;
27
27
  }
28
28
  export {
29
29
  S as DEFAULT_EVENT_PREFIX,
@@ -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 r(T,O,N){const i=(_,t)=>{Object.entries(t).forEach(([n,o])=>_.setAttribute(n,o))};E.ensureCustomElementsDefinition();const c=document.createElement(E.WEB_PLAYER_WC_TAG),R=E.webPlayerPropsToAttributes(O);i(c,R),N?.customMedias?.forEach(_=>{const t=document.createElement(E.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG),{element:n,...o}=_;t.appendChild(n);const s=E.webPlayerCustomMediaPropsToAttributes(o);i(t,s),c.appendChild(t)}),N?.icons?.forEach(_=>{const t=document.createElement(E.WEB_PLAYER_ICON_WC_TAG),{element:n,...o}=_;t.appendChild(n);const s=E.webPlayerIconPropsToAttributes(o);i(t,s),c.appendChild(t)}),T.appendChild(c)}const A="cc-webplayer",a="cc-webplayer-custom-media",d="cc-webplayer-icon",l="composition-loading",C="composition-loaded",u="composition-load-error",P="item-change",m="extend-mode-on",L="extend-mode-off",p="hotspots-on",I="hotspots-off",V="gallery-open",f="gallery-close",D="cc-webplayer:";function M(T,O){return`https://cdn.car-cutter.com/gallery/${T}/${O}/composition_v3.json`}e.DEFAULT_EVENT_PREFIX=D,e.EVENT_COMPOSITION_LOADED=C,e.EVENT_COMPOSITION_LOADING=l,e.EVENT_COMPOSITION_LOAD_ERROR=u,e.EVENT_EXTEND_MODE_OFF=L,e.EVENT_EXTEND_MODE_ON=m,e.EVENT_GALLERY_CLOSE=f,e.EVENT_GALLERY_OPEN=V,e.EVENT_HOTSPOTS_OFF=I,e.EVENT_HOTSPOTS_ON=p,e.EVENT_ITEM_CHANGE=P,e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=a,e.WEB_PLAYER_ICON_WC_TAG=d,e.WEB_PLAYER_WC_TAG=A,e.appendWebPlayer=r,e.generateCompositionUrl=M,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 r(T,O,N){const i=(n,t)=>{Object.entries(t).forEach(([_,o])=>n.setAttribute(_,o))};E.ensureCustomElementsDefinition();const c=document.createElement(E.WEB_PLAYER_WC_TAG),R=E.webPlayerPropsToAttributes(O);i(c,R),N?.customMedias?.forEach(n=>{const t=document.createElement(E.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG),{element:_,...o}=n;t.appendChild(_);const s=E.webPlayerCustomMediaPropsToAttributes(o);i(t,s),c.appendChild(t)}),N?.icons?.forEach(n=>{const t=document.createElement(E.WEB_PLAYER_ICON_WC_TAG),{element:_,...o}=n;t.appendChild(_);const s=E.webPlayerIconPropsToAttributes(o);i(t,s),c.appendChild(t)}),T.appendChild(c)}const A="cc-webplayer",a="cc-webplayer-custom-media",d="cc-webplayer-icon",l="composition-loading",C="composition-loaded",u="composition-load-error",P="item-change",m="extend-mode-on",L="extend-mode-off",p="hotspots-on",I="hotspots-off",V="gallery-open",f="gallery-close",D="cc-webplayer:";function M(T,O){return`https://cdn.car-cutter.com/gallery/${T}/${O}/composition_v3.json`}e.DEFAULT_EVENT_PREFIX=D,e.EVENT_COMPOSITION_LOADED=C,e.EVENT_COMPOSITION_LOADING=l,e.EVENT_COMPOSITION_LOAD_ERROR=u,e.EVENT_EXTEND_MODE_OFF=L,e.EVENT_EXTEND_MODE_ON=m,e.EVENT_GALLERY_CLOSE=f,e.EVENT_GALLERY_OPEN=V,e.EVENT_HOTSPOTS_OFF=I,e.EVENT_HOTSPOTS_ON=p,e.EVENT_ITEM_CHANGE=P,e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=a,e.WEB_PLAYER_ICON_WC_TAG=d,e.WEB_PLAYER_WC_TAG=A,e.appendWebPlayer=r,e.generateCompositionUrl=M,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": "0.13.0",
3
+ "version": "3.0.1",
4
4
  "license": "Apache-2.0",
5
5
  "author": {
6
6
  "name": "CarCutter",
@@ -31,7 +31,7 @@
31
31
  "analyze": "vite-bundle-visualizer"
32
32
  },
33
33
  "dependencies": {
34
- "@car-cutter/wc-webplayer": "0.13.0"
34
+ "@car-cutter/wc-webplayer": "3.0.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@car-cutter/eslint-config": "*",