@car-cutter/vue-webplayer 0.11.0 → 0.13.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/index.cjs +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +29 -28
- package/dist/{utils-_R5huBBV.js → utils-TWVtfImY.js} +10 -10
- package/dist/vue2.cjs +1 -1
- package/dist/vue2.d.ts +16 -2
- package/dist/vue2.js +39 -38
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),e=require("./utils-CbTbWQZC.cjs"),O=require("@car-cutter/wc-webplayer"),C=o.defineComponent({__name:"WebPlayer",props:{compositionUrl:{},hideCategoriesNav:{type:Boolean},infiniteCarrousel:{type:Boolean},permanentGallery:{type:Boolean},mediaLoadStrategy:{},minMediaWidth:{},maxMediaWidth:{},preloadRange:{},autoLoad360:{type:Boolean},categoriesFilter:{},extendBehavior:{},eventPrefix:{},demoSpin:{type:Boolean},reverse360:{type:Boolean},class:{},style:{}},emits:["compositionLoading","compositionLoaded","compositionLoadError","itemChange","extendModeOn","extendModeOff","hotspotsOn","hotspotsOff","galleryOpen","galleryClose"],setup(_,{emit:s}){O.ensureCustomElementsDefinition();const r=_,{class:a,style:i,...c}=r,l={display:"block",...i??{}},N=O.webPlayerPropsToAttributes(c),E=s,p=r.eventPrefix??e.DEFAULT_EVENT_PREFIX,d=t=>`${p}${t}`,m={[e.EVENT_COMPOSITION_LOADING]:t=>E("compositionLoading",t),[e.EVENT_COMPOSITION_LOADED]:t=>E("compositionLoaded",t),[e.EVENT_COMPOSITION_LOAD_ERROR]:t=>E("compositionLoadError",t),[e.EVENT_ITEM_CHANGE]:t=>E("itemChange",t),[e.EVENT_EXTEND_MODE_ON]:()=>E("extendModeOn"),[e.EVENT_EXTEND_MODE_OFF]:()=>E("extendModeOff"),[e.EVENT_HOTSPOTS_ON]:()=>E("hotspotsOn"),[e.EVENT_HOTSPOTS_OFF]:()=>E("hotspotsOff"),[e.EVENT_GALLERY_OPEN]:()=>E("galleryOpen"),[e.EVENT_GALLERY_CLOSE]:()=>E("galleryClose")},T=new Map;return Object.entries(m).forEach(([t,n])=>{if(!n)return;const P=d(t),u=L=>n(L.detail);T.set(P,u)}),o.onMounted(()=>{T.forEach((t,n)=>{document.addEventListener(n,t)})}),o.onUnmounted(()=>{T.forEach((t,n)=>{document.removeEventListener(n,t)})}),(t,n)=>(o.openBlock(),o.createElementBlock("cc-webplayer",o.mergeProps(o.unref(N),{class:o.unref(a),style:l}),[o.renderSlot(t.$slots,"default")],16))}}),A=o.defineComponent({__name:"WebPlayerCustomMedia",props:{index:{},thumbnailSrc:{}},setup(_){const s=_,r=O.webPlayerCustomMediaPropsToAttributes(s);return(a,i)=>(o.openBlock(),o.createElementBlock("cc-webplayer-custom-media",o.normalizeProps(o.guardReactiveProps(o.unref(r))),[o.renderSlot(a.$slots,"default")],16))}}),M=o.defineComponent({__name:"WebPlayerIcon",props:{name:{}},setup(_){const s=_,r=O.webPlayerIconPropsToAttributes(s);return(a,i)=>(o.openBlock(),o.createElementBlock("cc-webplayer-icon",o.normalizeProps(o.guardReactiveProps(o.unref(r))),[o.renderSlot(a.$slots,"default")],16))}});exports.DEFAULT_EVENT_PREFIX=e.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=e.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=e.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=e.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=e.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=e.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=e.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=e.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=e.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=e.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=e.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG;exports.WEB_PLAYER_ICON_WC_TAG=e.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=e.WEB_PLAYER_WC_TAG;exports.generateCompositionUrl=e.generateCompositionUrl;exports.WebPlayer=C;exports.WebPlayerCustomMedia=A;exports.WebPlayerIcon=M;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),e=require("./utils-CbTbWQZC.cjs"),O=require("@car-cutter/wc-webplayer"),C=o.defineComponent({__name:"WebPlayer",props:{compositionUrl:{},hideCategoriesNav:{type:Boolean},infiniteCarrousel:{type:Boolean},permanentGallery:{type:Boolean},mediaLoadStrategy:{},minMediaWidth:{},maxMediaWidth:{},preloadRange:{},autoLoad360:{type:Boolean},autoLoadInterior360:{type:Boolean},categoriesFilter:{},extendBehavior:{},eventPrefix:{},demoSpin:{type:Boolean},reverse360:{type:Boolean},class:{},style:{}},emits:["compositionLoading","compositionLoaded","compositionLoadError","itemChange","extendModeOn","extendModeOff","hotspotsOn","hotspotsOff","galleryOpen","galleryClose"],setup(_,{emit:s}){O.ensureCustomElementsDefinition();const r=_,{class:a,style:i,...c}=r,l={display:"block",...i??{}},N=O.webPlayerPropsToAttributes(c),E=s,p=r.eventPrefix??e.DEFAULT_EVENT_PREFIX,d=t=>`${p}${t}`,m={[e.EVENT_COMPOSITION_LOADING]:t=>E("compositionLoading",t),[e.EVENT_COMPOSITION_LOADED]:t=>E("compositionLoaded",t),[e.EVENT_COMPOSITION_LOAD_ERROR]:t=>E("compositionLoadError",t),[e.EVENT_ITEM_CHANGE]:t=>E("itemChange",t),[e.EVENT_EXTEND_MODE_ON]:()=>E("extendModeOn"),[e.EVENT_EXTEND_MODE_OFF]:()=>E("extendModeOff"),[e.EVENT_HOTSPOTS_ON]:()=>E("hotspotsOn"),[e.EVENT_HOTSPOTS_OFF]:()=>E("hotspotsOff"),[e.EVENT_GALLERY_OPEN]:()=>E("galleryOpen"),[e.EVENT_GALLERY_CLOSE]:()=>E("galleryClose")},T=new Map;return Object.entries(m).forEach(([t,n])=>{if(!n)return;const P=d(t),u=L=>n(L.detail);T.set(P,u)}),o.onMounted(()=>{T.forEach((t,n)=>{document.addEventListener(n,t)})}),o.onUnmounted(()=>{T.forEach((t,n)=>{document.removeEventListener(n,t)})}),(t,n)=>(o.openBlock(),o.createElementBlock("cc-webplayer",o.mergeProps(o.unref(N),{class:o.unref(a),style:l}),[o.renderSlot(t.$slots,"default")],16))}}),A=o.defineComponent({__name:"WebPlayerCustomMedia",props:{index:{},thumbnailSrc:{}},setup(_){const s=_,r=O.webPlayerCustomMediaPropsToAttributes(s);return(a,i)=>(o.openBlock(),o.createElementBlock("cc-webplayer-custom-media",o.normalizeProps(o.guardReactiveProps(o.unref(r))),[o.renderSlot(a.$slots,"default")],16))}}),M=o.defineComponent({__name:"WebPlayerIcon",props:{name:{}},setup(_){const s=_,r=O.webPlayerIconPropsToAttributes(s);return(a,i)=>(o.openBlock(),o.createElementBlock("cc-webplayer-icon",o.normalizeProps(o.guardReactiveProps(o.unref(r))),[o.renderSlot(a.$slots,"default")],16))}});exports.DEFAULT_EVENT_PREFIX=e.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=e.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=e.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=e.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=e.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=e.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=e.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=e.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=e.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=e.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=e.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG;exports.WEB_PLAYER_ICON_WC_TAG=e.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=e.WEB_PLAYER_WC_TAG;exports.generateCompositionUrl=e.generateCompositionUrl;exports.WebPlayer=C;exports.WebPlayerCustomMedia=A;exports.WebPlayerIcon=M;
|
package/dist/index.d.ts
CHANGED
|
@@ -159,7 +159,16 @@ declare type ImageWithHotspots = {
|
|
|
159
159
|
hotspots?: Hotspot[];
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
declare type InteriorThreeSixtyItem = {
|
|
163
|
+
type: "interior-360";
|
|
164
|
+
poster?: string;
|
|
165
|
+
} & ImageWithHotspots;
|
|
166
|
+
|
|
167
|
+
export declare type Item =
|
|
168
|
+
| ImageItem
|
|
169
|
+
| VideoItem
|
|
170
|
+
| ThreeSixtyItem
|
|
171
|
+
| InteriorThreeSixtyItem;
|
|
163
172
|
|
|
164
173
|
export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
|
|
165
174
|
|
|
@@ -223,6 +232,7 @@ declare type WebPlayerIconName =
|
|
|
223
232
|
| "UI_PLUS" // Increase zoom
|
|
224
233
|
| "UI_REDUCE" // Reducing an extended view
|
|
225
234
|
| "UI_360" // 360-degree view
|
|
235
|
+
| "UI_INTERIOR_360" // interior 360 view
|
|
226
236
|
| "UI_VOLUME" // Video volume
|
|
227
237
|
| "UI_VOLUME_OFF" // Muted video
|
|
228
238
|
| "CONTROLS_PREV" // Go to previous media
|
|
@@ -253,8 +263,9 @@ declare type WebPlayerProps_2 = {
|
|
|
253
263
|
maxMediaWidth?: MediaWidth;
|
|
254
264
|
preloadRange?: number;
|
|
255
265
|
autoLoad360?: boolean;
|
|
266
|
+
autoLoadInterior360?: boolean;
|
|
256
267
|
|
|
257
|
-
//
|
|
268
|
+
// Miscellaneous
|
|
258
269
|
categoriesFilter?: string;
|
|
259
270
|
extendBehavior?: ExtendBehavior;
|
|
260
271
|
eventPrefix?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as l, onMounted as M, onUnmounted as h,
|
|
2
|
-
import { D as A, E as v, a as
|
|
3
|
-
import { j as K, k as Q, W as Z, l as ee } from "./utils-
|
|
1
|
+
import { defineComponent as l, onMounted as M, onUnmounted as h, createElementBlock as E, openBlock as _, mergeProps as g, unref as r, renderSlot as m, normalizeProps as d, guardReactiveProps as O } from "vue";
|
|
2
|
+
import { D as A, E as v, a as I, b as W, c as B, d as S, e as x, f as D, g as R, h as V, i as w } from "./utils-TWVtfImY.js";
|
|
3
|
+
import { j as K, k as Q, W as Z, l as ee } from "./utils-TWVtfImY.js";
|
|
4
4
|
import { ensureCustomElementsDefinition as G, webPlayerPropsToAttributes as F, webPlayerCustomMediaPropsToAttributes as $, webPlayerIconPropsToAttributes as U } from "@car-cutter/wc-webplayer";
|
|
5
5
|
const X = /* @__PURE__ */ l({
|
|
6
6
|
__name: "WebPlayer",
|
|
@@ -14,6 +14,7 @@ const X = /* @__PURE__ */ l({
|
|
|
14
14
|
maxMediaWidth: {},
|
|
15
15
|
preloadRange: {},
|
|
16
16
|
autoLoad360: { type: Boolean },
|
|
17
|
+
autoLoadInterior360: { type: Boolean },
|
|
17
18
|
categoriesFilter: {},
|
|
18
19
|
extendBehavior: {},
|
|
19
20
|
eventPrefix: {},
|
|
@@ -25,23 +26,23 @@ const X = /* @__PURE__ */ l({
|
|
|
25
26
|
emits: ["compositionLoading", "compositionLoaded", "compositionLoadError", "itemChange", "extendModeOn", "extendModeOff", "hotspotsOn", "hotspotsOff", "galleryOpen", "galleryClose"],
|
|
26
27
|
setup(n, { emit: i }) {
|
|
27
28
|
G();
|
|
28
|
-
const s = n, { class: a, style: c, ...u } = s, f = { display: "block", ...c ?? {} }, y = F(u), o = i, P = s.eventPrefix ?? A, T = (e) => `${P}${e}`,
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
29
|
+
const s = n, { class: a, style: c, ...u } = s, f = { display: "block", ...c ?? {} }, y = F(u), o = i, P = s.eventPrefix ?? A, T = (e) => `${P}${e}`, L = {
|
|
30
|
+
[w]: (e) => o("compositionLoading", e),
|
|
31
|
+
[V]: (e) => o("compositionLoaded", e),
|
|
32
|
+
[R]: (e) => o("compositionLoadError", e),
|
|
33
|
+
[D]: (e) => o("itemChange", e),
|
|
33
34
|
[x]: () => o("extendModeOn"),
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
38
|
-
[
|
|
35
|
+
[S]: () => o("extendModeOff"),
|
|
36
|
+
[B]: () => o("hotspotsOn"),
|
|
37
|
+
[W]: () => o("hotspotsOff"),
|
|
38
|
+
[I]: () => o("galleryOpen"),
|
|
39
|
+
[v]: () => o("galleryClose")
|
|
39
40
|
}, p = /* @__PURE__ */ new Map();
|
|
40
|
-
return Object.entries(
|
|
41
|
+
return Object.entries(L).forEach(([e, t]) => {
|
|
41
42
|
if (!t)
|
|
42
43
|
return;
|
|
43
|
-
const
|
|
44
|
-
p.set(
|
|
44
|
+
const N = T(e), b = (C) => t(C.detail);
|
|
45
|
+
p.set(N, b);
|
|
45
46
|
}), M(() => {
|
|
46
47
|
p.forEach((e, t) => {
|
|
47
48
|
document.addEventListener(t, e);
|
|
@@ -50,7 +51,7 @@ const X = /* @__PURE__ */ l({
|
|
|
50
51
|
p.forEach((e, t) => {
|
|
51
52
|
document.removeEventListener(t, e);
|
|
52
53
|
});
|
|
53
|
-
}), (e, t) => (
|
|
54
|
+
}), (e, t) => (_(), E("cc-webplayer", g(r(y), {
|
|
54
55
|
class: r(a),
|
|
55
56
|
style: f
|
|
56
57
|
}), [
|
|
@@ -65,7 +66,7 @@ const X = /* @__PURE__ */ l({
|
|
|
65
66
|
},
|
|
66
67
|
setup(n) {
|
|
67
68
|
const s = $(n);
|
|
68
|
-
return (a, c) => (
|
|
69
|
+
return (a, c) => (_(), E("cc-webplayer-custom-media", d(O(r(s))), [
|
|
69
70
|
m(a.$slots, "default")
|
|
70
71
|
], 16));
|
|
71
72
|
}
|
|
@@ -76,23 +77,23 @@ const X = /* @__PURE__ */ l({
|
|
|
76
77
|
},
|
|
77
78
|
setup(n) {
|
|
78
79
|
const s = U(n);
|
|
79
|
-
return (a, c) => (
|
|
80
|
+
return (a, c) => (_(), E("cc-webplayer-icon", d(O(r(s))), [
|
|
80
81
|
m(a.$slots, "default")
|
|
81
82
|
], 16));
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
85
|
export {
|
|
85
86
|
A as DEFAULT_EVENT_PREFIX,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
V as EVENT_COMPOSITION_LOADED,
|
|
88
|
+
w as EVENT_COMPOSITION_LOADING,
|
|
89
|
+
R as EVENT_COMPOSITION_LOAD_ERROR,
|
|
90
|
+
S as EVENT_EXTEND_MODE_OFF,
|
|
90
91
|
x as EVENT_EXTEND_MODE_ON,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
v as EVENT_GALLERY_CLOSE,
|
|
93
|
+
I as EVENT_GALLERY_OPEN,
|
|
94
|
+
W as EVENT_HOTSPOTS_OFF,
|
|
95
|
+
B as EVENT_HOTSPOTS_ON,
|
|
96
|
+
D as EVENT_ITEM_CHANGE,
|
|
96
97
|
K as WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,
|
|
97
98
|
Q as WEB_PLAYER_ICON_WC_TAG,
|
|
98
99
|
Z as WEB_PLAYER_WC_TAG,
|
|
@@ -4,17 +4,17 @@ function A(o, E) {
|
|
|
4
4
|
}
|
|
5
5
|
export {
|
|
6
6
|
p as D,
|
|
7
|
-
|
|
7
|
+
l as E,
|
|
8
8
|
s as W,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
i as a,
|
|
10
|
+
r as b,
|
|
11
|
+
N as c,
|
|
12
|
+
T as d,
|
|
13
|
+
O as e,
|
|
14
|
+
a as f,
|
|
15
|
+
e as g,
|
|
16
|
+
n as h,
|
|
17
|
+
t as i,
|
|
18
18
|
_ as j,
|
|
19
19
|
c as k,
|
|
20
20
|
A as l
|
package/dist/vue2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),e=require("./utils-CbTbWQZC.cjs"),_=require("@car-cutter/wc-webplayer");_.ensureCustomElementsDefinition();const O=t.defineComponent({props:{compositionUrl:{type:String,required:!0},hideCategoriesNav:Boolean,infiniteCarrousel:Boolean,permanentGallery:Boolean,mediaLoadStrategy:String,minMediaWidth:Number,maxMediaWidth:Number,preloadRange:Number,autoLoad360:Boolean,categoriesFilter:String,extendBehavior:String,eventPrefix:String,demoSpin:Boolean,reverse360:Boolean},data(){return{eventCbMap:new Map}},computed:{attributes(){return _.webPlayerPropsToAttributes(this.$props)}},methods:{generateEventName(r){return`${this.eventPrefix||e.DEFAULT_EVENT_PREFIX}${r}`},setupEventListeners(){const r={[e.EVENT_COMPOSITION_LOADING]:o=>this.$emit("compositionLoading",o),[e.EVENT_COMPOSITION_LOADED]:o=>this.$emit("compositionLoaded",o),[e.EVENT_COMPOSITION_LOAD_ERROR]:o=>this.$emit("compositionLoadError",o),[e.EVENT_ITEM_CHANGE]:o=>this.$emit("itemChange",o),[e.EVENT_EXTEND_MODE_ON]:()=>this.$emit("extendModeOn"),[e.EVENT_EXTEND_MODE_OFF]:()=>this.$emit("extendModeOff"),[e.EVENT_HOTSPOTS_ON]:()=>this.$emit("hotspotsOn"),[e.EVENT_HOTSPOTS_OFF]:()=>this.$emit("hotspotsOff"),[e.EVENT_GALLERY_OPEN]:()=>this.$emit("galleryOpen"),[e.EVENT_GALLERY_CLOSE]:()=>this.$emit("galleryClose")};Object.entries(r).forEach(([o,n])=>{if(!n)return;const E=this.generateEventName(o),i=s=>n(s.detail);this.eventCbMap.set(E,i),document.addEventListener(E,i)})}},mounted(){this.setupEventListeners()},beforeDestroy(){this.eventCbMap.forEach((r,o)=>{document.removeEventListener(o,r)})}}),a=(r,o)=>{const n=r.__vccOpts||r;for(const[E,i]of o)n[E]=i;return n};function T(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const N=a(O,[["render",T]]),p=t.defineComponent({props:{index:{type:Number,required:!0},thumbnailSrc:String},computed:{attributes(){return _.webPlayerCustomMediaPropsToAttributes(this.$props)}}});function c(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer-custom-media",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const u=a(p,[["render",c]]),d=t.defineComponent({props:{name:{type:String,required:!0}},computed:{attributes(){return _.webPlayerIconPropsToAttributes(this.$props)}}});function l(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer-icon",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const m=a(d,[["render",l]]);exports.DEFAULT_EVENT_PREFIX=e.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=e.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=e.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=e.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=e.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=e.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=e.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=e.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=e.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=e.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=e.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG;exports.WEB_PLAYER_ICON_WC_TAG=e.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=e.WEB_PLAYER_WC_TAG;exports.generateCompositionUrl=e.generateCompositionUrl;exports.WebPlayer=N;exports.WebPlayerCustomMedia=u;exports.WebPlayerIcon=m;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),e=require("./utils-CbTbWQZC.cjs"),_=require("@car-cutter/wc-webplayer");_.ensureCustomElementsDefinition();const O=t.defineComponent({props:{compositionUrl:{type:String,required:!0},hideCategoriesNav:Boolean,infiniteCarrousel:Boolean,permanentGallery:Boolean,mediaLoadStrategy:String,minMediaWidth:Number,maxMediaWidth:Number,preloadRange:Number,autoLoad360:Boolean,autoLoadInterior360:Boolean,categoriesFilter:String,extendBehavior:String,eventPrefix:String,demoSpin:Boolean,reverse360:Boolean},data(){return{eventCbMap:new Map}},computed:{attributes(){return _.webPlayerPropsToAttributes(this.$props)}},methods:{generateEventName(r){return`${this.eventPrefix||e.DEFAULT_EVENT_PREFIX}${r}`},setupEventListeners(){const r={[e.EVENT_COMPOSITION_LOADING]:o=>this.$emit("compositionLoading",o),[e.EVENT_COMPOSITION_LOADED]:o=>this.$emit("compositionLoaded",o),[e.EVENT_COMPOSITION_LOAD_ERROR]:o=>this.$emit("compositionLoadError",o),[e.EVENT_ITEM_CHANGE]:o=>this.$emit("itemChange",o),[e.EVENT_EXTEND_MODE_ON]:()=>this.$emit("extendModeOn"),[e.EVENT_EXTEND_MODE_OFF]:()=>this.$emit("extendModeOff"),[e.EVENT_HOTSPOTS_ON]:()=>this.$emit("hotspotsOn"),[e.EVENT_HOTSPOTS_OFF]:()=>this.$emit("hotspotsOff"),[e.EVENT_GALLERY_OPEN]:()=>this.$emit("galleryOpen"),[e.EVENT_GALLERY_CLOSE]:()=>this.$emit("galleryClose")};Object.entries(r).forEach(([o,n])=>{if(!n)return;const E=this.generateEventName(o),i=s=>n(s.detail);this.eventCbMap.set(E,i),document.addEventListener(E,i)})}},mounted(){this.setupEventListeners()},beforeDestroy(){this.eventCbMap.forEach((r,o)=>{document.removeEventListener(o,r)})}}),a=(r,o)=>{const n=r.__vccOpts||r;for(const[E,i]of o)n[E]=i;return n};function T(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const N=a(O,[["render",T]]),p=t.defineComponent({props:{index:{type:Number,required:!0},thumbnailSrc:String},computed:{attributes(){return _.webPlayerCustomMediaPropsToAttributes(this.$props)}}});function c(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer-custom-media",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const u=a(p,[["render",c]]),d=t.defineComponent({props:{name:{type:String,required:!0}},computed:{attributes(){return _.webPlayerIconPropsToAttributes(this.$props)}}});function l(r,o,n,E,i,s){return t.openBlock(),t.createElementBlock("cc-webplayer-icon",t.normalizeProps(t.guardReactiveProps(r.attributes)),[t.renderSlot(r.$slots,"default")],16)}const m=a(d,[["render",l]]);exports.DEFAULT_EVENT_PREFIX=e.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=e.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=e.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=e.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=e.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=e.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=e.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=e.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=e.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=e.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=e.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG=e.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG;exports.WEB_PLAYER_ICON_WC_TAG=e.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=e.WEB_PLAYER_WC_TAG;exports.generateCompositionUrl=e.generateCompositionUrl;exports.WebPlayer=N;exports.WebPlayerCustomMedia=u;exports.WebPlayerIcon=m;
|
package/dist/vue2.d.ts
CHANGED
|
@@ -82,7 +82,16 @@ declare type ImageWithHotspots = {
|
|
|
82
82
|
hotspots?: Hotspot[];
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
declare type InteriorThreeSixtyItem = {
|
|
86
|
+
type: "interior-360";
|
|
87
|
+
poster?: string;
|
|
88
|
+
} & ImageWithHotspots;
|
|
89
|
+
|
|
90
|
+
export declare type Item =
|
|
91
|
+
| ImageItem
|
|
92
|
+
| VideoItem
|
|
93
|
+
| ThreeSixtyItem
|
|
94
|
+
| InteriorThreeSixtyItem;
|
|
86
95
|
|
|
87
96
|
export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
|
|
88
97
|
|
|
@@ -126,6 +135,7 @@ minMediaWidth: NumberConstructor;
|
|
|
126
135
|
maxMediaWidth: NumberConstructor;
|
|
127
136
|
preloadRange: NumberConstructor;
|
|
128
137
|
autoLoad360: BooleanConstructor;
|
|
138
|
+
autoLoadInterior360: BooleanConstructor;
|
|
129
139
|
categoriesFilter: StringConstructor;
|
|
130
140
|
extendBehavior: StringConstructor;
|
|
131
141
|
eventPrefix: StringConstructor;
|
|
@@ -151,6 +161,7 @@ minMediaWidth: NumberConstructor;
|
|
|
151
161
|
maxMediaWidth: NumberConstructor;
|
|
152
162
|
preloadRange: NumberConstructor;
|
|
153
163
|
autoLoad360: BooleanConstructor;
|
|
164
|
+
autoLoadInterior360: BooleanConstructor;
|
|
154
165
|
categoriesFilter: StringConstructor;
|
|
155
166
|
extendBehavior: StringConstructor;
|
|
156
167
|
eventPrefix: StringConstructor;
|
|
@@ -161,6 +172,7 @@ hideCategoriesNav: boolean;
|
|
|
161
172
|
infiniteCarrousel: boolean;
|
|
162
173
|
permanentGallery: boolean;
|
|
163
174
|
autoLoad360: boolean;
|
|
175
|
+
autoLoadInterior360: boolean;
|
|
164
176
|
demoSpin: boolean;
|
|
165
177
|
reverse360: boolean;
|
|
166
178
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
@@ -214,6 +226,7 @@ declare type WebPlayerIconName =
|
|
|
214
226
|
| "UI_PLUS" // Increase zoom
|
|
215
227
|
| "UI_REDUCE" // Reducing an extended view
|
|
216
228
|
| "UI_360" // 360-degree view
|
|
229
|
+
| "UI_INTERIOR_360" // interior 360 view
|
|
217
230
|
| "UI_VOLUME" // Video volume
|
|
218
231
|
| "UI_VOLUME_OFF" // Muted video
|
|
219
232
|
| "CONTROLS_PREV" // Go to previous media
|
|
@@ -239,8 +252,9 @@ export declare type WebPlayerProps = {
|
|
|
239
252
|
maxMediaWidth?: MediaWidth;
|
|
240
253
|
preloadRange?: number;
|
|
241
254
|
autoLoad360?: boolean;
|
|
255
|
+
autoLoadInterior360?: boolean;
|
|
242
256
|
|
|
243
|
-
//
|
|
257
|
+
// Miscellaneous
|
|
244
258
|
categoriesFilter?: string;
|
|
245
259
|
extendBehavior?: ExtendBehavior;
|
|
246
260
|
eventPrefix?: string;
|
package/dist/vue2.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as i,
|
|
2
|
-
import { D as d, E as _, a as l, b as f, c as O, d as $, e as h, f as N, g as b, h as T, i as P } from "./utils-
|
|
3
|
-
import { j as Y, k, W as U, l as q } from "./utils-
|
|
4
|
-
import { ensureCustomElementsDefinition as
|
|
5
|
-
|
|
1
|
+
import { defineComponent as i, createElementBlock as a, openBlock as p, normalizeProps as m, guardReactiveProps as E, renderSlot as c } from "vue";
|
|
2
|
+
import { D as d, E as _, a as l, b as f, c as O, d as $, e as h, f as N, g as b, h as T, i as P } from "./utils-TWVtfImY.js";
|
|
3
|
+
import { j as Y, k, W as U, l as q } from "./utils-TWVtfImY.js";
|
|
4
|
+
import { ensureCustomElementsDefinition as L, webPlayerPropsToAttributes as v, webPlayerCustomMediaPropsToAttributes as C, webPlayerIconPropsToAttributes as g } from "@car-cutter/wc-webplayer";
|
|
5
|
+
L();
|
|
6
6
|
const S = i({
|
|
7
7
|
props: {
|
|
8
8
|
compositionUrl: { type: String, required: !0 },
|
|
@@ -14,6 +14,7 @@ const S = i({
|
|
|
14
14
|
maxMediaWidth: Number,
|
|
15
15
|
preloadRange: Number,
|
|
16
16
|
autoLoad360: Boolean,
|
|
17
|
+
autoLoadInterior360: Boolean,
|
|
17
18
|
categoriesFilter: String,
|
|
18
19
|
extendBehavior: String,
|
|
19
20
|
eventPrefix: String,
|
|
@@ -27,7 +28,7 @@ const S = i({
|
|
|
27
28
|
},
|
|
28
29
|
computed: {
|
|
29
30
|
attributes() {
|
|
30
|
-
return
|
|
31
|
+
return v(this.$props);
|
|
31
32
|
}
|
|
32
33
|
},
|
|
33
34
|
methods: {
|
|
@@ -36,21 +37,21 @@ const S = i({
|
|
|
36
37
|
},
|
|
37
38
|
setupEventListeners() {
|
|
38
39
|
const e = {
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[
|
|
48
|
-
[
|
|
40
|
+
[P]: (t) => this.$emit("compositionLoading", t),
|
|
41
|
+
[T]: (t) => this.$emit("compositionLoaded", t),
|
|
42
|
+
[b]: (t) => this.$emit("compositionLoadError", t),
|
|
43
|
+
[N]: (t) => this.$emit("itemChange", t),
|
|
44
|
+
[h]: () => this.$emit("extendModeOn"),
|
|
45
|
+
[$]: () => this.$emit("extendModeOff"),
|
|
46
|
+
[O]: () => this.$emit("hotspotsOn"),
|
|
47
|
+
[f]: () => this.$emit("hotspotsOff"),
|
|
48
|
+
[l]: () => this.$emit("galleryOpen"),
|
|
49
|
+
[_]: () => this.$emit("galleryClose")
|
|
49
50
|
};
|
|
50
51
|
Object.entries(e).forEach(([t, r]) => {
|
|
51
52
|
if (!r) return;
|
|
52
|
-
const o = this.generateEventName(t),
|
|
53
|
-
this.eventCbMap.set(o,
|
|
53
|
+
const o = this.generateEventName(t), n = (s) => r(s.detail);
|
|
54
|
+
this.eventCbMap.set(o, n), document.addEventListener(o, n);
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
},
|
|
@@ -64,12 +65,12 @@ const S = i({
|
|
|
64
65
|
}
|
|
65
66
|
}), u = (e, t) => {
|
|
66
67
|
const r = e.__vccOpts || e;
|
|
67
|
-
for (const [o,
|
|
68
|
-
r[o] =
|
|
68
|
+
for (const [o, n] of t)
|
|
69
|
+
r[o] = n;
|
|
69
70
|
return r;
|
|
70
71
|
};
|
|
71
|
-
function M(e, t, r, o,
|
|
72
|
-
return
|
|
72
|
+
function M(e, t, r, o, n, s) {
|
|
73
|
+
return p(), a("cc-webplayer", m(E(e.attributes)), [
|
|
73
74
|
c(e.$slots, "default")
|
|
74
75
|
], 16);
|
|
75
76
|
}
|
|
@@ -84,12 +85,12 @@ const V = /* @__PURE__ */ u(S, [["render", M]]), y = i({
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
});
|
|
87
|
-
function A(e, t, r, o,
|
|
88
|
-
return
|
|
88
|
+
function A(e, t, r, o, n, s) {
|
|
89
|
+
return p(), a("cc-webplayer-custom-media", m(E(e.attributes)), [
|
|
89
90
|
c(e.$slots, "default")
|
|
90
91
|
], 16);
|
|
91
92
|
}
|
|
92
|
-
const x = /* @__PURE__ */ u(y, [["render", A]]),
|
|
93
|
+
const x = /* @__PURE__ */ u(y, [["render", A]]), I = i({
|
|
93
94
|
props: {
|
|
94
95
|
name: { type: String, required: !0 }
|
|
95
96
|
},
|
|
@@ -99,24 +100,24 @@ const x = /* @__PURE__ */ u(y, [["render", A]]), D = i({
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
});
|
|
102
|
-
function
|
|
103
|
-
return
|
|
103
|
+
function B(e, t, r, o, n, s) {
|
|
104
|
+
return p(), a("cc-webplayer-icon", m(E(e.attributes)), [
|
|
104
105
|
c(e.$slots, "default")
|
|
105
106
|
], 16);
|
|
106
107
|
}
|
|
107
|
-
const G = /* @__PURE__ */ u(
|
|
108
|
+
const G = /* @__PURE__ */ u(I, [["render", B]]);
|
|
108
109
|
export {
|
|
109
110
|
d as DEFAULT_EVENT_PREFIX,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
T as EVENT_COMPOSITION_LOADED,
|
|
112
|
+
P as EVENT_COMPOSITION_LOADING,
|
|
113
|
+
b as EVENT_COMPOSITION_LOAD_ERROR,
|
|
114
|
+
$ as EVENT_EXTEND_MODE_OFF,
|
|
115
|
+
h as EVENT_EXTEND_MODE_ON,
|
|
116
|
+
_ as EVENT_GALLERY_CLOSE,
|
|
117
|
+
l as EVENT_GALLERY_OPEN,
|
|
118
|
+
f as EVENT_HOTSPOTS_OFF,
|
|
119
|
+
O as EVENT_HOTSPOTS_ON,
|
|
120
|
+
N as EVENT_ITEM_CHANGE,
|
|
120
121
|
Y as WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,
|
|
121
122
|
k as WEB_PLAYER_ICON_WC_TAG,
|
|
122
123
|
U as WEB_PLAYER_WC_TAG,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@car-cutter/vue-webplayer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CarCutter",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"analyze": "vite-bundle-visualizer"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@car-cutter/wc-webplayer": "0.
|
|
44
|
+
"@car-cutter/wc-webplayer": "0.13.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"vue": ">=2"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"browserslist-to-esbuild": "^2.1.1",
|
|
55
55
|
"eslint": "^8.57.0",
|
|
56
56
|
"typescript": "^5.5.4",
|
|
57
|
-
"vite": "^5.4.
|
|
57
|
+
"vite": "^5.4.19",
|
|
58
58
|
"vite-bundle-visualizer": "^1.2.1",
|
|
59
59
|
"vite-plugin-dts": "^4.2.1",
|
|
60
60
|
"vue": "^3.5.6",
|