@car-cutter/vue-webplayer 3.0.3 → 3.1.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/dist/index.cjs +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +10 -9
- package/dist/{utils-BfR5YfQn.js → utils-DkJWyyJQ.js} +3 -3
- package/dist/vue2.cjs +1 -1
- package/dist/vue2.d.ts +9 -0
- package/dist/vue2.js +7 -6
- package/package.json +7 -3
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),e=require("./utils-Bfc4MSUL.cjs"),i=require("@car-cutter/wc-webplayer"),S=n.defineComponent({__name:"WebPlayer",props:{compositionUrl:{},integration:{type:Boolean},maxItemsShown:{},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},analyticsEventPrefix:{},analyticsUrl:{},analyticsBearer:{},analyticsSimpleRequestsOnly:{type:Boolean},analyticsDryRun:{type:Boolean},analyticsDebug:{type:Boolean},class:{},style:{}},emits:["compositionLoading","compositionLoaded","compositionLoadError","itemChange","extendModeOn","extendModeOff","hotspotsOn","hotspotsOff","galleryOpen","galleryClose","analyticsIdentify","analyticsPage","analyticsTrack"],setup(r,{emit:s}){i.ensureCustomElementsDefinition();const a=r,{class:_,style:c,...A}=a,d={display:"block",...c??{}},L=i.webPlayerPropsToAttributes(A),E=s,m=a.eventPrefix??e.DEFAULT_EVENT_PREFIX,y=a.analyticsEventPrefix??e.DEFAULT_ANALYTICS_EVENT_PREFIX,P=t=>`${m}${t}`,C=t=>`${y}${t}`,I={[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")},u={[e.ANALYTICS_EVENT_IDENTIFY]:t=>E("analyticsIdentify",t),[e.ANALYTICS_EVENT_PAGE]:t=>E("analyticsPage",t),[e.ANALYTICS_EVENT_TRACK]:t=>E("analyticsTrack",t)},T=new Map,l=new Map;return Object.entries(I).forEach(([t,o])=>{if(!o)return;const N=P(t),O=p=>o(p.detail);T.set(N,O)}),Object.entries(u).forEach(([t,o])=>{if(!o)return;const N=C(t),O=p=>o(p.detail);l.set(N,O)}),n.onMounted(()=>{T.forEach((t,o)=>{document.addEventListener(o,t)}),l.forEach((t,o)=>{document.addEventListener(o,t)})}),n.onUnmounted(()=>{T.forEach((t,o)=>{document.removeEventListener(o,t)}),l.forEach((t,o)=>{document.removeEventListener(o,t)})}),(t,o)=>(n.openBlock(),n.createElementBlock("cc-webplayer",n.mergeProps(n.unref(L),{class:n.unref(_),style:d}),[n.renderSlot(t.$slots,"default")],16))}}),V=n.defineComponent({__name:"WebPlayerCustomMedia",props:{index:{},thumbnailSrc:{}},setup(r){const s=r,a=i.webPlayerCustomMediaPropsToAttributes(s);return(_,c)=>(n.openBlock(),n.createElementBlock("cc-webplayer-custom-media",n.normalizeProps(n.guardReactiveProps(n.unref(a))),[n.renderSlot(_.$slots,"default")],16))}}),f=n.defineComponent({__name:"WebPlayerIcon",props:{name:{}},setup(r){const s=r,a=i.webPlayerIconPropsToAttributes(s);return(_,c)=>(n.openBlock(),n.createElementBlock("cc-webplayer-icon",n.normalizeProps(n.guardReactiveProps(n.unref(a))),[n.renderSlot(_.$slots,"default")],16))}});exports.ANALYTICS_EVENT_IDENTIFY=e.ANALYTICS_EVENT_IDENTIFY;exports.ANALYTICS_EVENT_PAGE=e.ANALYTICS_EVENT_PAGE;exports.ANALYTICS_EVENT_TRACK=e.ANALYTICS_EVENT_TRACK;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=S;exports.WebPlayerCustomMedia=V;exports.WebPlayerIcon=f;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),e=require("./utils-Bfc4MSUL.cjs"),i=require("@car-cutter/wc-webplayer"),S=n.defineComponent({__name:"WebPlayer",props:{compositionUrl:{},integration:{type:Boolean},maxItemsShown:{},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},spinCursor:{},analyticsEventPrefix:{},analyticsUrl:{},analyticsBearer:{},analyticsSimpleRequestsOnly:{type:Boolean},analyticsDryRun:{type:Boolean},analyticsDebug:{type:Boolean},class:{},style:{}},emits:["compositionLoading","compositionLoaded","compositionLoadError","itemChange","extendModeOn","extendModeOff","hotspotsOn","hotspotsOff","galleryOpen","galleryClose","analyticsIdentify","analyticsPage","analyticsTrack"],setup(r,{emit:s}){i.ensureCustomElementsDefinition();const a=r,{class:_,style:c,...A}=a,d={display:"block",...c??{}},L=i.webPlayerPropsToAttributes(A),E=s,m=a.eventPrefix??e.DEFAULT_EVENT_PREFIX,y=a.analyticsEventPrefix??e.DEFAULT_ANALYTICS_EVENT_PREFIX,P=t=>`${m}${t}`,C=t=>`${y}${t}`,I={[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")},u={[e.ANALYTICS_EVENT_IDENTIFY]:t=>E("analyticsIdentify",t),[e.ANALYTICS_EVENT_PAGE]:t=>E("analyticsPage",t),[e.ANALYTICS_EVENT_TRACK]:t=>E("analyticsTrack",t)},T=new Map,l=new Map;return Object.entries(I).forEach(([t,o])=>{if(!o)return;const N=P(t),O=p=>o(p.detail);T.set(N,O)}),Object.entries(u).forEach(([t,o])=>{if(!o)return;const N=C(t),O=p=>o(p.detail);l.set(N,O)}),n.onMounted(()=>{T.forEach((t,o)=>{document.addEventListener(o,t)}),l.forEach((t,o)=>{document.addEventListener(o,t)})}),n.onUnmounted(()=>{T.forEach((t,o)=>{document.removeEventListener(o,t)}),l.forEach((t,o)=>{document.removeEventListener(o,t)})}),(t,o)=>(n.openBlock(),n.createElementBlock("cc-webplayer",n.mergeProps(n.unref(L),{class:n.unref(_),style:d}),[n.renderSlot(t.$slots,"default")],16))}}),V=n.defineComponent({__name:"WebPlayerCustomMedia",props:{index:{},thumbnailSrc:{}},setup(r){const s=r,a=i.webPlayerCustomMediaPropsToAttributes(s);return(_,c)=>(n.openBlock(),n.createElementBlock("cc-webplayer-custom-media",n.normalizeProps(n.guardReactiveProps(n.unref(a))),[n.renderSlot(_.$slots,"default")],16))}}),f=n.defineComponent({__name:"WebPlayerIcon",props:{name:{}},setup(r){const s=r,a=i.webPlayerIconPropsToAttributes(s);return(_,c)=>(n.openBlock(),n.createElementBlock("cc-webplayer-icon",n.normalizeProps(n.guardReactiveProps(n.unref(a))),[n.renderSlot(_.$slots,"default")],16))}});exports.ANALYTICS_EVENT_IDENTIFY=e.ANALYTICS_EVENT_IDENTIFY;exports.ANALYTICS_EVENT_PAGE=e.ANALYTICS_EVENT_PAGE;exports.ANALYTICS_EVENT_TRACK=e.ANALYTICS_EVENT_TRACK;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=S;exports.WebPlayerCustomMedia=V;exports.WebPlayerIcon=f;
|
package/dist/index.d.ts
CHANGED
|
@@ -44,27 +44,30 @@ declare const __VLS_component_2: DefineComponent<WebPlayerCustomMediaProps, {},
|
|
|
44
44
|
declare const __VLS_component_3: DefineComponent<WebPlayerIconProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<WebPlayerIconProps> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
45
45
|
|
|
46
46
|
declare function __VLS_template(): {
|
|
47
|
+
attrs: Partial<{}>;
|
|
47
48
|
slots: {
|
|
48
49
|
default?(_: {}): any;
|
|
49
50
|
};
|
|
50
51
|
refs: {};
|
|
51
|
-
|
|
52
|
+
rootEl: any;
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
declare function __VLS_template_2(): {
|
|
56
|
+
attrs: Partial<{}>;
|
|
55
57
|
slots: {
|
|
56
58
|
default?(_: {}): any;
|
|
57
59
|
};
|
|
58
60
|
refs: {};
|
|
59
|
-
|
|
61
|
+
rootEl: any;
|
|
60
62
|
};
|
|
61
63
|
|
|
62
64
|
declare function __VLS_template_3(): {
|
|
65
|
+
attrs: Partial<{}>;
|
|
63
66
|
slots: {
|
|
64
67
|
default?(_: {}): any;
|
|
65
68
|
};
|
|
66
69
|
refs: {};
|
|
67
|
-
|
|
70
|
+
rootEl: any;
|
|
68
71
|
};
|
|
69
72
|
|
|
70
73
|
declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
@@ -276,12 +279,18 @@ export declare type Item =
|
|
|
276
279
|
| ImageItem
|
|
277
280
|
| VideoItem
|
|
278
281
|
| ThreeSixtyItem
|
|
282
|
+
| NextGenThreeSixtyItem
|
|
279
283
|
| InteriorThreeSixtyItem;
|
|
280
284
|
|
|
281
285
|
export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
|
|
282
286
|
|
|
283
287
|
declare type MediaWidth = number;
|
|
284
288
|
|
|
289
|
+
declare type NextGenThreeSixtyItem = {
|
|
290
|
+
type: "next360";
|
|
291
|
+
images: ImageWithHotspots[];
|
|
292
|
+
};
|
|
293
|
+
|
|
285
294
|
declare type ThreeSixtyItem = {
|
|
286
295
|
type: "360";
|
|
287
296
|
images: ImageWithHotspots[];
|
|
@@ -388,6 +397,7 @@ declare type WebPlayerProps_2 = {
|
|
|
388
397
|
eventPrefix?: string;
|
|
389
398
|
demoSpin?: boolean;
|
|
390
399
|
reverse360?: boolean;
|
|
400
|
+
spinCursor?: string;
|
|
391
401
|
|
|
392
402
|
// Analytics
|
|
393
403
|
analyticsEventPrefix?: string;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as d, onMounted as g, onUnmounted as h,
|
|
2
|
-
import { D as B, a as x, E as D, b as R, c as V, d as W, e as w, f as F, g as Y, h as G, i as $, j as U, A as k, k as X, l as j } from "./utils-
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as d, onMounted as g, onUnmounted as h, openBlock as y, createElementBlock as u, mergeProps as S, unref as r, renderSlot as T, normalizeProps as O, guardReactiveProps as f } from "vue";
|
|
2
|
+
import { D as B, a as x, E as D, b as R, c as V, d as W, e as w, f as F, g as Y, h as G, i as $, j as U, A as k, k as X, l as j } from "./utils-DkJWyyJQ.js";
|
|
3
|
+
import { W as se, m as re, n as ie, o as ce } from "./utils-DkJWyyJQ.js";
|
|
4
4
|
import { ensureCustomElementsDefinition as H, webPlayerPropsToAttributes as q, webPlayerCustomMediaPropsToAttributes as z, webPlayerIconPropsToAttributes as K } from "@car-cutter/wc-webplayer";
|
|
5
5
|
const ee = /* @__PURE__ */ d({
|
|
6
6
|
__name: "WebPlayer",
|
|
@@ -22,6 +22,7 @@ const ee = /* @__PURE__ */ d({
|
|
|
22
22
|
eventPrefix: {},
|
|
23
23
|
demoSpin: { type: Boolean },
|
|
24
24
|
reverse360: { type: Boolean },
|
|
25
|
+
spinCursor: {},
|
|
25
26
|
analyticsEventPrefix: {},
|
|
26
27
|
analyticsUrl: {},
|
|
27
28
|
analyticsBearer: {},
|
|
@@ -72,11 +73,11 @@ const ee = /* @__PURE__ */ d({
|
|
|
72
73
|
}), E.forEach((e, t) => {
|
|
73
74
|
document.removeEventListener(t, e);
|
|
74
75
|
});
|
|
75
|
-
}), (e, t) => (
|
|
76
|
+
}), (e, t) => (y(), u("cc-webplayer", S(r(L), {
|
|
76
77
|
class: r(s),
|
|
77
78
|
style: P
|
|
78
79
|
}), [
|
|
79
|
-
|
|
80
|
+
T(e.$slots, "default")
|
|
80
81
|
], 16));
|
|
81
82
|
}
|
|
82
83
|
}), te = /* @__PURE__ */ d({
|
|
@@ -87,8 +88,8 @@ const ee = /* @__PURE__ */ d({
|
|
|
87
88
|
},
|
|
88
89
|
setup(n) {
|
|
89
90
|
const a = z(n);
|
|
90
|
-
return (s, c) => (
|
|
91
|
-
|
|
91
|
+
return (s, c) => (y(), u("cc-webplayer-custom-media", O(f(r(a))), [
|
|
92
|
+
T(s.$slots, "default")
|
|
92
93
|
], 16));
|
|
93
94
|
}
|
|
94
95
|
}), oe = /* @__PURE__ */ d({
|
|
@@ -98,8 +99,8 @@ const ee = /* @__PURE__ */ d({
|
|
|
98
99
|
},
|
|
99
100
|
setup(n) {
|
|
100
101
|
const a = K(n);
|
|
101
|
-
return (s, c) => (
|
|
102
|
-
|
|
102
|
+
return (s, c) => (y(), u("cc-webplayer-icon", O(f(r(a))), [
|
|
103
|
+
T(s.$slots, "default")
|
|
103
104
|
], 16));
|
|
104
105
|
}
|
|
105
106
|
});
|
package/dist/vue2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),e=require("./utils-Bfc4MSUL.cjs"),a=require("@car-cutter/wc-webplayer");a.ensureCustomElementsDefinition();const T=r.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,analyticsEventPrefix:String,analyticsUrl:String,analyticsBearer:String,analyticsSimpleRequestsOnly:Boolean,analyticsDryRun:Boolean,analyticsDebug:Boolean},data(){return{eventCbMap:new Map,analyticsEventCbMap:new Map}},computed:{attributes(){return a.webPlayerPropsToAttributes(this.$props)}},methods:{generateEventName(n){return`${this.eventPrefix||e.DEFAULT_EVENT_PREFIX}${n}`},setupEventListeners(){const n={[e.EVENT_COMPOSITION_LOADING]:t=>this.$emit("compositionLoading",t),[e.EVENT_COMPOSITION_LOADED]:t=>this.$emit("compositionLoaded",t),[e.EVENT_COMPOSITION_LOAD_ERROR]:t=>this.$emit("compositionLoadError",t),[e.EVENT_ITEM_CHANGE]:t=>this.$emit("itemChange",t),[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(n).forEach(([t,E])=>{if(!E)return;const i=this.generateEventName(t),o=s=>E(s.detail);this.eventCbMap.set(i,o),document.addEventListener(i,o)})},generateAnalyticsEventName(n){return`${this.analyticsEventPrefix||e.DEFAULT_ANALYTICS_EVENT_PREFIX}${n}`},setupAnalyticsEventListeners(){const n={[e.ANALYTICS_EVENT_IDENTIFY]:t=>this.$emit("analyticsIdentify",t),[e.ANALYTICS_EVENT_PAGE]:t=>this.$emit("analyticsPage",t),[e.ANALYTICS_EVENT_TRACK]:t=>this.$emit("analyticsTrack",t)};Object.entries(n).forEach(([t,E])=>{if(!E)return;const i=this.generateAnalyticsEventName(t),o=s=>E(s.detail);this.analyticsEventCbMap.set(i,o),document.addEventListener(i,o)})}},mounted(){this.setupEventListeners(),this.setupAnalyticsEventListeners()},beforeDestroy(){this.eventCbMap.forEach((n,t)=>{document.removeEventListener(t,n)}),this.analyticsEventCbMap.forEach((n,t)=>{document.removeEventListener(t,n)})}}),_=(n,t)=>{const E=n.__vccOpts||n;for(const[i,o]of t)E[i]=o;return E};function N(n,t,E,i,o,s){return r.openBlock(),r.createElementBlock("cc-webplayer",r.normalizeProps(r.guardReactiveProps(n.attributes)),[r.renderSlot(n.$slots,"default")],16)}const c=_(T,[["render",N]]),O=r.defineComponent({props:{index:{type:Number,required:!0},thumbnailSrc:String},computed:{attributes(){return a.webPlayerCustomMediaPropsToAttributes(this.$props)}}});function l(n,t,E,i,o,s){return r.openBlock(),r.createElementBlock("cc-webplayer-custom-media",r.normalizeProps(r.guardReactiveProps(n.attributes)),[r.renderSlot(n.$slots,"default")],16)}const p=_(O,[["render",l]]),u=r.defineComponent({props:{name:{type:String,required:!0}},computed:{attributes(){return a.webPlayerIconPropsToAttributes(this.$props)}}});function m(n,t,E,i,o,s){return r.openBlock(),r.createElementBlock("cc-webplayer-icon",r.normalizeProps(r.guardReactiveProps(n.attributes)),[r.renderSlot(n.$slots,"default")],16)}const A=_(u,[["render",m]]);exports.ANALYTICS_EVENT_IDENTIFY=e.ANALYTICS_EVENT_IDENTIFY;exports.ANALYTICS_EVENT_PAGE=e.ANALYTICS_EVENT_PAGE;exports.ANALYTICS_EVENT_TRACK=e.ANALYTICS_EVENT_TRACK;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=p;exports.WebPlayerIcon=A;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),e=require("./utils-Bfc4MSUL.cjs"),a=require("@car-cutter/wc-webplayer");a.ensureCustomElementsDefinition();const T=r.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,spinCursor:String,analyticsEventPrefix:String,analyticsUrl:String,analyticsBearer:String,analyticsSimpleRequestsOnly:Boolean,analyticsDryRun:Boolean,analyticsDebug:Boolean},data(){return{eventCbMap:new Map,analyticsEventCbMap:new Map}},computed:{attributes(){return a.webPlayerPropsToAttributes(this.$props)}},methods:{generateEventName(n){return`${this.eventPrefix||e.DEFAULT_EVENT_PREFIX}${n}`},setupEventListeners(){const n={[e.EVENT_COMPOSITION_LOADING]:t=>this.$emit("compositionLoading",t),[e.EVENT_COMPOSITION_LOADED]:t=>this.$emit("compositionLoaded",t),[e.EVENT_COMPOSITION_LOAD_ERROR]:t=>this.$emit("compositionLoadError",t),[e.EVENT_ITEM_CHANGE]:t=>this.$emit("itemChange",t),[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(n).forEach(([t,E])=>{if(!E)return;const i=this.generateEventName(t),o=s=>E(s.detail);this.eventCbMap.set(i,o),document.addEventListener(i,o)})},generateAnalyticsEventName(n){return`${this.analyticsEventPrefix||e.DEFAULT_ANALYTICS_EVENT_PREFIX}${n}`},setupAnalyticsEventListeners(){const n={[e.ANALYTICS_EVENT_IDENTIFY]:t=>this.$emit("analyticsIdentify",t),[e.ANALYTICS_EVENT_PAGE]:t=>this.$emit("analyticsPage",t),[e.ANALYTICS_EVENT_TRACK]:t=>this.$emit("analyticsTrack",t)};Object.entries(n).forEach(([t,E])=>{if(!E)return;const i=this.generateAnalyticsEventName(t),o=s=>E(s.detail);this.analyticsEventCbMap.set(i,o),document.addEventListener(i,o)})}},mounted(){this.setupEventListeners(),this.setupAnalyticsEventListeners()},beforeDestroy(){this.eventCbMap.forEach((n,t)=>{document.removeEventListener(t,n)}),this.analyticsEventCbMap.forEach((n,t)=>{document.removeEventListener(t,n)})}}),_=(n,t)=>{const E=n.__vccOpts||n;for(const[i,o]of t)E[i]=o;return E};function N(n,t,E,i,o,s){return r.openBlock(),r.createElementBlock("cc-webplayer",r.normalizeProps(r.guardReactiveProps(n.attributes)),[r.renderSlot(n.$slots,"default")],16)}const c=_(T,[["render",N]]),O=r.defineComponent({props:{index:{type:Number,required:!0},thumbnailSrc:String},computed:{attributes(){return a.webPlayerCustomMediaPropsToAttributes(this.$props)}}});function l(n,t,E,i,o,s){return r.openBlock(),r.createElementBlock("cc-webplayer-custom-media",r.normalizeProps(r.guardReactiveProps(n.attributes)),[r.renderSlot(n.$slots,"default")],16)}const p=_(O,[["render",l]]),u=r.defineComponent({props:{name:{type:String,required:!0}},computed:{attributes(){return a.webPlayerIconPropsToAttributes(this.$props)}}});function m(n,t,E,i,o,s){return r.openBlock(),r.createElementBlock("cc-webplayer-icon",r.normalizeProps(r.guardReactiveProps(n.attributes)),[r.renderSlot(n.$slots,"default")],16)}const A=_(u,[["render",m]]);exports.ANALYTICS_EVENT_IDENTIFY=e.ANALYTICS_EVENT_IDENTIFY;exports.ANALYTICS_EVENT_PAGE=e.ANALYTICS_EVENT_PAGE;exports.ANALYTICS_EVENT_TRACK=e.ANALYTICS_EVENT_TRACK;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=p;exports.WebPlayerIcon=A;
|
package/dist/vue2.d.ts
CHANGED
|
@@ -98,12 +98,18 @@ export declare type Item =
|
|
|
98
98
|
| ImageItem
|
|
99
99
|
| VideoItem
|
|
100
100
|
| ThreeSixtyItem
|
|
101
|
+
| NextGenThreeSixtyItem
|
|
101
102
|
| InteriorThreeSixtyItem;
|
|
102
103
|
|
|
103
104
|
export declare type MediaLoadStrategy = "quality" | "balanced" | "speed";
|
|
104
105
|
|
|
105
106
|
declare type MediaWidth = number;
|
|
106
107
|
|
|
108
|
+
declare type NextGenThreeSixtyItem = {
|
|
109
|
+
type: "next360";
|
|
110
|
+
images: ImageWithHotspots[];
|
|
111
|
+
};
|
|
112
|
+
|
|
107
113
|
declare type PropsToAttributes<T> = {
|
|
108
114
|
[K in keyof T as CamelToDashed<string & K>]: ToStringOrOptional<T[K]>;
|
|
109
115
|
};
|
|
@@ -148,6 +154,7 @@ extendBehavior: StringConstructor;
|
|
|
148
154
|
eventPrefix: StringConstructor;
|
|
149
155
|
demoSpin: BooleanConstructor;
|
|
150
156
|
reverse360: BooleanConstructor;
|
|
157
|
+
spinCursor: StringConstructor;
|
|
151
158
|
analyticsEventPrefix: StringConstructor;
|
|
152
159
|
analyticsUrl: StringConstructor;
|
|
153
160
|
analyticsBearer: StringConstructor;
|
|
@@ -183,6 +190,7 @@ extendBehavior: StringConstructor;
|
|
|
183
190
|
eventPrefix: StringConstructor;
|
|
184
191
|
demoSpin: BooleanConstructor;
|
|
185
192
|
reverse360: BooleanConstructor;
|
|
193
|
+
spinCursor: StringConstructor;
|
|
186
194
|
analyticsEventPrefix: StringConstructor;
|
|
187
195
|
analyticsUrl: StringConstructor;
|
|
188
196
|
analyticsBearer: StringConstructor;
|
|
@@ -291,6 +299,7 @@ export declare type WebPlayerProps = {
|
|
|
291
299
|
eventPrefix?: string;
|
|
292
300
|
demoSpin?: boolean;
|
|
293
301
|
reverse360?: boolean;
|
|
302
|
+
spinCursor?: string;
|
|
294
303
|
|
|
295
304
|
// Analytics
|
|
296
305
|
analyticsEventPrefix?: string;
|
package/dist/vue2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as i,
|
|
2
|
-
import { a as u, D as _, A as d, k as h, l as f, E as N, b as T, c as v, d as $, e as y, f as O, g as L, h as b, i as A, j as P } from "./utils-
|
|
3
|
-
import {
|
|
1
|
+
import { defineComponent as i, openBlock as o, createElementBlock as c, normalizeProps as E, guardReactiveProps as p, renderSlot as m } from "vue";
|
|
2
|
+
import { a as u, D as _, A as d, k as h, l as f, E as N, b as T, c as v, d as $, e as y, f as O, g as L, h as b, i as A, j as P } from "./utils-DkJWyyJQ.js";
|
|
3
|
+
import { W as X, m as j, n as H, o as z } from "./utils-DkJWyyJQ.js";
|
|
4
4
|
import { ensureCustomElementsDefinition as C, webPlayerPropsToAttributes as g, webPlayerCustomMediaPropsToAttributes as S, webPlayerIconPropsToAttributes as M } from "@car-cutter/wc-webplayer";
|
|
5
5
|
C();
|
|
6
6
|
const I = i({
|
|
@@ -20,6 +20,7 @@ const I = i({
|
|
|
20
20
|
eventPrefix: String,
|
|
21
21
|
demoSpin: Boolean,
|
|
22
22
|
reverse360: Boolean,
|
|
23
|
+
spinCursor: String,
|
|
23
24
|
analyticsEventPrefix: String,
|
|
24
25
|
analyticsUrl: String,
|
|
25
26
|
analyticsBearer: String,
|
|
@@ -96,7 +97,7 @@ const I = i({
|
|
|
96
97
|
return n;
|
|
97
98
|
};
|
|
98
99
|
function B(t, e, n, r, s, a) {
|
|
99
|
-
return
|
|
100
|
+
return o(), c("cc-webplayer", E(p(t.attributes)), [
|
|
100
101
|
m(t.$slots, "default")
|
|
101
102
|
], 16);
|
|
102
103
|
}
|
|
@@ -112,7 +113,7 @@ const G = /* @__PURE__ */ l(I, [["render", B]]), D = i({
|
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
115
|
function R(t, e, n, r, s, a) {
|
|
115
|
-
return
|
|
116
|
+
return o(), c("cc-webplayer-custom-media", E(p(t.attributes)), [
|
|
116
117
|
m(t.$slots, "default")
|
|
117
118
|
], 16);
|
|
118
119
|
}
|
|
@@ -127,7 +128,7 @@ const w = /* @__PURE__ */ l(D, [["render", R]]), V = i({
|
|
|
127
128
|
}
|
|
128
129
|
});
|
|
129
130
|
function x(t, e, n, r, s, a) {
|
|
130
|
-
return
|
|
131
|
+
return o(), c("cc-webplayer-icon", E(p(t.attributes)), [
|
|
131
132
|
m(t.$slots, "default")
|
|
132
133
|
], 16);
|
|
133
134
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@car-cutter/vue-webplayer",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CarCutter",
|
|
7
7
|
"url": "https://www.car-cutter.com/"
|
|
8
8
|
},
|
|
9
9
|
"homepage": "https://carcutter.github.io/cars-webplayer-js/",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/carcutter/cars-webplayer-js"
|
|
13
|
+
},
|
|
10
14
|
"description": "Use CarCutter WebPlayer in your Vue app",
|
|
11
15
|
"keywords": [
|
|
12
16
|
"car-cutter",
|
|
@@ -41,7 +45,7 @@
|
|
|
41
45
|
"analyze": "vite-bundle-visualizer"
|
|
42
46
|
},
|
|
43
47
|
"dependencies": {
|
|
44
|
-
"@car-cutter/wc-webplayer": "3.
|
|
48
|
+
"@car-cutter/wc-webplayer": "3.1.1"
|
|
45
49
|
},
|
|
46
50
|
"peerDependencies": {
|
|
47
51
|
"vue": ">=2"
|
|
@@ -54,7 +58,7 @@
|
|
|
54
58
|
"browserslist-to-esbuild": "^2.1.1",
|
|
55
59
|
"eslint": "^8.57.0",
|
|
56
60
|
"typescript": "^5.5.4",
|
|
57
|
-
"vite": "^5.4.
|
|
61
|
+
"vite": "^5.4.21",
|
|
58
62
|
"vite-bundle-visualizer": "^1.2.1",
|
|
59
63
|
"vite-plugin-dts": "^4.2.1",
|
|
60
64
|
"vue": "^3.5.6",
|