@maveio/components 0.0.141 → 0.0.142
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/{chunk-F2JWRUYQ.js → chunk-2QEL5V7S.js} +2 -2
- package/dist/chunk-4G3UNTTF.cjs +10 -0
- package/dist/{chunk-M6QOOH2P.cjs → chunk-4ZJZI2FW.cjs} +3 -3
- package/dist/{chunk-RH46KJ2U.js → chunk-CVACOZHI.js} +1 -1
- package/dist/chunk-F3J3FNUF.js +7 -0
- package/dist/{chunk-RXQCD32F.cjs → chunk-IQ3OUVST.cjs} +2 -2
- package/dist/{chunk-DEXZ7LYE.js → chunk-JVLABVDW.js} +1 -1
- package/dist/{chunk-C53WH6NA.cjs → chunk-L7YVVHJW.cjs} +2 -2
- package/dist/{chunk-B4QSXYZX.js → chunk-OGPHY4IM.js} +1 -1
- package/dist/{chunk-RAL7SZSI.cjs → chunk-STRTUCAH.cjs} +2 -2
- package/dist/{chunk-TG5YS3U2.cjs → chunk-TLDASKLX.cjs} +2 -2
- package/dist/{chunk-KMY3TZSO.js → chunk-V5DP73TU.js} +1 -1
- package/dist/components/clip.cjs +3 -3
- package/dist/components/clip.js +2 -2
- package/dist/components/files.cjs +3 -3
- package/dist/components/files.js +2 -2
- package/dist/components/list.cjs +5 -5
- package/dist/components/list.js +4 -4
- package/dist/components/player.cjs +3 -3
- package/dist/components/player.js +2 -2
- package/dist/components/pop.cjs +5 -5
- package/dist/components/pop.js +3 -3
- package/dist/embed/api.d.cts +1 -1
- package/dist/embed/api.d.ts +1 -1
- package/dist/embed/controller.cjs +3 -3
- package/dist/embed/controller.d.cts +1 -0
- package/dist/embed/controller.d.ts +1 -0
- package/dist/embed/controller.js +1 -1
- package/dist/index.cjs +11 -11
- package/dist/index.js +6 -6
- package/dist/react.cjs +7 -7
- package/dist/react.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-AD46M5D7.js +0 -7
- package/dist/chunk-EWPOZC44.cjs +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as b$1 } from './chunk-
|
|
2
|
-
import { b } from './chunk-
|
|
1
|
+
import { b as b$1 } from './chunk-OGPHY4IM.js';
|
|
2
|
+
import { b } from './chunk-F3J3FNUF.js';
|
|
3
3
|
import { a as a$2 } from './chunk-VOXORDG3.js';
|
|
4
4
|
import { a as a$1 } from './chunk-R2QJ6RON.js';
|
|
5
5
|
import { h as h$1, c as c$1, f as f$2 } from './chunk-IFM2GZME.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkTI75IJ2E_cjs = require('./chunk-TI75IJ2E.cjs');
|
|
4
|
+
var chunkLG2O4WV2_cjs = require('./chunk-LG2O4WV2.cjs');
|
|
5
|
+
var chunk5STN56TL_cjs = require('./chunk-5STN56TL.cjs');
|
|
6
|
+
|
|
7
|
+
var c=(t=>(t[t.Collection=0]="Collection",t[t.Embed=1]="Embed",t))(c||{}),a=class{constructor(e,t=1){this.caching=!0;this.loading=!0;this.host=e,this.type=t,this.loading=!0,this.task=new chunkLG2O4WV2_cjs.a(this.host,async()=>{try{if(this.type==1&&!this.embed)return;if(this.type==0&&!this.token){console.warn("No token attr provided for mave-list");return}let i=await(await fetch(this.manifest_url)).json();return this.loading=!1,this.type==1?(this._embedData=i,this.version=this._embedData.video?.version||0,this._embedData):i}catch(s){throw console.log(s),new Error(`Failed to fetch "${this.embed}"`)}},()=>[this.embed]);}get manifest_url(){if(this.type==1)return this.embedFile("manifest.json");{let e=new URL(`${chunkTI75IJ2E_cjs.a}/collection/${this.token}`);return this.embed&&this.embed?.length>1&&e.searchParams.append("embed",this.embed),e.toString()}}set embed(e){this._embed!=e&&(this._embed=e,this.loading=!0,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed?.substring(0,5)}get embedId(){return this.embed?.substring(5,this.embed?.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return chunk5STN56TL_cjs.a.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}refresh(){return this.loading=!0,this.task?.run()}embedFile(e,t=new URLSearchParams){let s=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest"?"/":this.version}${e}`);if(e.includes("?")){let[i,h]=e.split("?");new URLSearchParams(h).forEach((d,m)=>{t.append(m,d);});}if(this.token&&t.append("token",this.token),e=="manifest"&&t.append("e",new Date().getTime().toString()),e!=="manifest"&&this._embedData?.created_at){let i=this.caching?this._embedData.created_at:new Date().getTime();t.append("e",i.toString());}return s.search=t.toString(),s.toString()}render(e){return this.task?.render(e)}};
|
|
8
|
+
|
|
9
|
+
exports.a = c;
|
|
10
|
+
exports.b = a;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkTLDASKLX_cjs = require('./chunk-TLDASKLX.cjs');
|
|
4
|
+
var chunk4G3UNTTF_cjs = require('./chunk-4G3UNTTF.cjs');
|
|
5
5
|
var chunk5C42H643_cjs = require('./chunk-5C42H643.cjs');
|
|
6
6
|
var chunk26S26OLO_cjs = require('./chunk-26S26OLO.cjs');
|
|
7
7
|
var chunkKGTAAGUE_cjs = require('./chunk-KGTAAGUE.cjs');
|
|
8
8
|
var chunk5Y5M5ND5_cjs = require('./chunk-5Y5M5ND5.cjs');
|
|
9
9
|
|
|
10
|
-
var p,w,f,g,a,h,u=class extends chunk5C42H643_cjs.a{constructor(){super(...arguments);chunk5Y5M5ND5_cjs.e(this,p);chunk5Y5M5ND5_cjs.e(this,f);chunk5Y5M5ND5_cjs.e(this,a);this.order="newest";this.embedController=new
|
|
10
|
+
var p,w,f,g,a,h,u=class extends chunk5C42H643_cjs.a{constructor(){super(...arguments);chunk5Y5M5ND5_cjs.e(this,p);chunk5Y5M5ND5_cjs.e(this,f);chunk5Y5M5ND5_cjs.e(this,a);this.order="newest";this.embedController=new chunk4G3UNTTF_cjs.b(this,0);}connectedCallback(){super.connectedCallback(),this.embedController.token=this.token;}requestUpdate(t,o){super.requestUpdate(t,o),t==="embed"&&(this.embedController.token=this.token);}get _slottedChildren(){return this.shadowRoot?.querySelector("slot")?.assignedElements({flatten:!0})||[]}updated(){this.shadowRoot&&chunkTLDASKLX_cjs.b(this.shadowRoot);}refresh(){return this.embedController.refresh()}containsEmbed(t){return this._collection?.videos?.some(o=>o.id===t)}getNextForEmbed(t){let o=chunk5Y5M5ND5_cjs.f(this,p,w).call(this),e=o.findIndex(n=>n.id===t);if(e!==-1)return o[e+1]}render(){return chunkKGTAAGUE_cjs.c`
|
|
11
11
|
${this.embedController.render({pending:this.renderPending,error:t=>chunkKGTAAGUE_cjs.c`<p>${t instanceof Error?t.message:chunkKGTAAGUE_cjs.f}</p>`,complete:t=>{if(this._collection=t,!t)return this.renderPending();if(t.error)return console.warn(t.error);let o=this._slottedChildren.map(e=>{function n(){let i;return e.nodeName==="TEMPLATE"?i=e.content.cloneNode(!0):i=e.cloneNode(!0),i}if(e.getAttribute("name")=="list-title"){let i=n();return i.textContent=this._collection?.name,chunkKGTAAGUE_cjs.c`${i}`}if(e.getAttribute("name")=="mave-list-root"&&this.embedController.embed){let i=n(),r=i.querySelector('[slot="root-link"]');return r&&(r.addEventListener("click",c=>{c.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"back",embedId:""}),this.embedController.embed="";}),r.removeAttribute("slot")),chunkKGTAAGUE_cjs.c`${i}`}if(e.getAttribute("name")=="mave-list-folder"){let i=this._collection.collections?.map(r=>{let c=n(),s=c.querySelector('[slot="folder-link"]');return [e,s].forEach(d=>{d&&(d.addEventListener("click",E=>{E.preventDefault(),this.emit(this.EVENT_TYPES.CLICK,{action:"show_collection",collectionId:r.id}),this.embedController.embed=r.id;}),d.removeAttribute("slot"));}),chunk5Y5M5ND5_cjs.f(this,a,h).call(this,c,'[slot="folder-title"]',r.name),typeof r.video_count=="number"&&chunk5Y5M5ND5_cjs.f(this,a,h).call(this,c,'[slot="folder-count"]',r.video_count.toString()),chunkKGTAAGUE_cjs.c`${c}`});return chunkKGTAAGUE_cjs.c`${i}`}if(e.getAttribute("name")=="mave-list-item"||!["mave-list-folder","mave-list-item","mave-list-root","list-title"].includes(e.hasAttribute("name")?e.getAttribute("name"):"")&&e.nodeName=="TEMPLATE"){let i=chunk5Y5M5ND5_cjs.f(this,p,w).call(this).map((r,c)=>{let s=n(),d=c+1;chunk5Y5M5ND5_cjs.f(this,a,h).call(this,s,'[slot="item-title"]',r.name),chunk5Y5M5ND5_cjs.f(this,a,h).call(this,s,'[slot="item-position"]',d.toString()),chunk5Y5M5ND5_cjs.f(this,a,h).call(this,s,'[slot="item-duration"]',this.durationToTime(r.duration)),chunk5Y5M5ND5_cjs.f(this,f,g).call(this,s,"mave-clip",r.id),chunk5Y5M5ND5_cjs.f(this,f,g).call(this,s,"mave-player",r.id),chunk5Y5M5ND5_cjs.f(this,f,g).call(this,s,"mave-img",r.id);let E=s.querySelector("mave-clip"),S=s.querySelector('[slot="item-title"]'),P=s.querySelector("mave-img");return [E,S,P,s].forEach(q=>{q?.addEventListener("click",x=>{this.emit(this.EVENT_TYPES.CLICK,{action:"show_embed",embedId:r.id,position:d});});}),chunkKGTAAGUE_cjs.c`${s}`});return chunkKGTAAGUE_cjs.c`${i}`}}).filter(e=>e);return chunkKGTAAGUE_cjs.c`${this._stylesheets} ${o}`}})}
|
|
12
12
|
`}renderPending(){return chunkKGTAAGUE_cjs.c`<slot style="display: none"></slot>`}};p=new WeakSet,w=function(){if(!this._collection)return [];let t=this._collection.videos;return this.order=="newest"&&(t=this._collection.videos?.sort((o,e)=>e.created-o.created)),this.order=="oldest"&&(t=this._collection.videos?.sort((o,e)=>o.created-e.created)),this.order=="az"&&(t=this._collection.videos?.sort((o,e)=>o.name.localeCompare(e.name))),this.order=="za"&&(t=this._collection.videos?.sort((o,e)=>e.name.localeCompare(o.name))),t},f=new WeakSet,g=function(t,o,e){let n=t.querySelector(o);n&&(n.setAttribute("embed",e),n.removeAttribute("slot"));},a=new WeakSet,h=function(t,o,e){let n=t.querySelector(o);n&&(n.textContent=e,n.removeAttribute("slot"));},u.styles=chunkKGTAAGUE_cjs.h`
|
|
13
13
|
:host {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as a$2 } from './chunk-AEKWMZ2I.js';
|
|
2
2
|
import { b as b$2, a as a$1, c as c$2 } from './chunk-NR4EI5W5.js';
|
|
3
3
|
import { a as a$3 } from './chunk-MK4VIJT3.js';
|
|
4
|
-
import { b as b$4 } from './chunk-
|
|
4
|
+
import { b as b$4 } from './chunk-F3J3FNUF.js';
|
|
5
5
|
import { a, b as b$3 } from './chunk-R2QJ6RON.js';
|
|
6
6
|
import { h, i, c as c$1 } from './chunk-IFM2GZME.js';
|
|
7
7
|
import { a as a$4 } from './chunk-JBV2AYRP.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as a$2 } from './chunk-TPP5OQFR.js';
|
|
2
|
+
import { a as a$1 } from './chunk-LCTGZL3L.js';
|
|
3
|
+
import { a as a$3 } from './chunk-JBV2AYRP.js';
|
|
4
|
+
|
|
5
|
+
var c=(t=>(t[t.Collection=0]="Collection",t[t.Embed=1]="Embed",t))(c||{}),a=class{constructor(e,t=1){this.caching=!0;this.loading=!0;this.host=e,this.type=t,this.loading=!0,this.task=new a$1(this.host,async()=>{try{if(this.type==1&&!this.embed)return;if(this.type==0&&!this.token){console.warn("No token attr provided for mave-list");return}let i=await(await fetch(this.manifest_url)).json();return this.loading=!1,this.type==1?(this._embedData=i,this.version=this._embedData.video?.version||0,this._embedData):i}catch(s){throw console.log(s),new Error(`Failed to fetch "${this.embed}"`)}},()=>[this.embed]);}get manifest_url(){if(this.type==1)return this.embedFile("manifest.json");{let e=new URL(`${a$2}/collection/${this.token}`);return this.embed&&this.embed?.length>1&&e.searchParams.append("embed",this.embed),e.toString()}}set embed(e){this._embed!=e&&(this._embed=e,this.loading=!0,this.host.requestUpdate());}get embed(){return this._embed}set token(e){this._token!=e&&(this._token=e,this.host.requestUpdate());}get token(){return this._token}get spaceId(){return this.embed?.substring(0,5)}get embedId(){return this.embed?.substring(5,this.embed?.length)}get version(){return this._version?`/v${this._version}/`:"/"}set version(e){this._version!=e&&(this._version=e,this.host.requestUpdate());}get cdnRoot(){return a$3.cdn.endpoint.replace("${this.spaceId}",this.spaceId)}refresh(){return this.loading=!0,this.task?.run()}embedFile(e,t=new URLSearchParams){let s=new URL(`${this.cdnRoot}/${this.embedId}${e=="manifest"?"/":this.version}${e}`);if(e.includes("?")){let[i,h]=e.split("?");new URLSearchParams(h).forEach((d,m)=>{t.append(m,d);});}if(this.token&&t.append("token",this.token),e=="manifest"&&t.append("e",new Date().getTime().toString()),e!=="manifest"&&this._embedData?.created_at){let i=this.caching?this._embedData.created_at:new Date().getTime();t.append("e",i.toString());}return s.search=t.toString(),s.toString()}render(e){return this.task?.render(e)}};
|
|
6
|
+
|
|
7
|
+
export { c as a, a as b };
|