@maveio/components 0.0.134 → 0.0.135

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.
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var chunkZWYDT7XS_cjs = require('./chunk-ZWYDT7XS.cjs');
3
+ var chunkRGIEUAZX_cjs = require('./chunk-RGIEUAZX.cjs');
4
4
  var chunkHEZWQOPO_cjs = require('./chunk-HEZWQOPO.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 chunkHEZWQOPO_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&&chunkZWYDT7XS_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`
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 chunkHEZWQOPO_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&&chunkRGIEUAZX_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,4 +1,4 @@
1
- import { a as a$2 } from './chunk-IBHRHICY.js';
1
+ import { a as a$2 } from './chunk-SULQSPXB.js';
2
2
  import { a as a$1 } from './chunk-CF5QCOBL.js';
3
3
  import { c as c$1, a } from './chunk-R2QJ6RON.js';
4
4
  import { h, i as i$1, c as c$2 } from './chunk-IFM2GZME.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk7QGZJLGA_cjs = require('./chunk-7QGZJLGA.cjs');
3
+ var chunkXYDVFCDI_cjs = require('./chunk-XYDVFCDI.cjs');
4
4
  var chunkUEEYC5OJ_cjs = require('./chunk-UEEYC5OJ.cjs');
5
5
  var chunk26S26OLO_cjs = require('./chunk-26S26OLO.cjs');
6
6
  var chunkKGTAAGUE_cjs = require('./chunk-KGTAAGUE.cjs');
@@ -159,7 +159,7 @@ var i=class extends chunkKGTAAGUE_cjs.i{get backdrop(){return this._backdropColo
159
159
  background-position: center center;
160
160
  background-repeat: no-repeat;
161
161
  }
162
- `,chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c("dialog")],i.prototype,"_dialog",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".content")],i.prototype,"_content",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".frame")],i.prototype,"_frame",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".backdrop")],i.prototype,"_backdrop",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],i.prototype,"backdrop",1),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a({attribute:"backdrop-filter"})],i.prototype,"backdropFilter",1);window&&window.customElements&&(window.customElements.get("mave-pop")||window.customElements.define("mave-pop",i));function k(l){let d={};if(!l)return d;for(let t=0;t<l.attributes.length;t++){let a=l.attributes[t];d[a.name]=a.value;}return d}var w=l=>{function d(o){let e,r,n=document.querySelector(`mave-pop[embed="${o}"]`);if(n)return r=k(n.querySelector("mave-player")),e=n,{pop:e,attributes:r};let p=document.querySelector("mave-pop:not([embed])");return p?(r=k(p.querySelector("mave-player")),e=p,{pop:e,attributes:r}):(e=new i,document.body.appendChild(e),{pop:e})}function t(o,e){let r=new chunk7QGZJLGA_cjs.a;if(e)for(let n in e)r.setAttribute(n,e[n]);return r.embed=o,r}function a(o){o.querySelectorAll("[x-mave-pop]").forEach(e=>{let r=e.getAttribute("x-mave-pop")||e.getAttribute("embed");if(!r)return;let{pop:n,attributes:p}=d(r);t(r,p),e.addEventListener("click",E=>{E.preventDefault();let _=document.querySelectorAll("mave-player");if(!Array.from(_).find(m=>m.popped)){let m=t(r,p);n.open(m).then(()=>{m.play();}),n.addEventListener("closed",()=>{m.pause();});}});});}a(l),new MutationObserver(o=>{for(let e of o)e.type==="childList"&&e.addedNodes.forEach(r=>{r instanceof HTMLElement&&a(r);});}).observe(document.body,{childList:!0,subtree:!0});};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{w(document);}):setTimeout(()=>w(document),500);
162
+ `,chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c("dialog")],i.prototype,"_dialog",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".content")],i.prototype,"_content",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".frame")],i.prototype,"_frame",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.c(".backdrop")],i.prototype,"_backdrop",2),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a()],i.prototype,"backdrop",1),chunk5Y5M5ND5_cjs.c([chunk26S26OLO_cjs.a({attribute:"backdrop-filter"})],i.prototype,"backdropFilter",1);window&&window.customElements&&(window.customElements.get("mave-pop")||window.customElements.define("mave-pop",i));function k(l){let d={};if(!l)return d;for(let t=0;t<l.attributes.length;t++){let a=l.attributes[t];d[a.name]=a.value;}return d}var w=l=>{function d(o){let e,r,n=document.querySelector(`mave-pop[embed="${o}"]`);if(n)return r=k(n.querySelector("mave-player")),e=n,{pop:e,attributes:r};let p=document.querySelector("mave-pop:not([embed])");return p?(r=k(p.querySelector("mave-player")),e=p,{pop:e,attributes:r}):(e=new i,document.body.appendChild(e),{pop:e})}function t(o,e){let r=new chunkXYDVFCDI_cjs.a;if(e)for(let n in e)r.setAttribute(n,e[n]);return r.embed=o,r}function a(o){o.querySelectorAll("[x-mave-pop]").forEach(e=>{let r=e.getAttribute("x-mave-pop")||e.getAttribute("embed");if(!r)return;let{pop:n,attributes:p}=d(r);t(r,p),e.addEventListener("click",E=>{E.preventDefault();let _=document.querySelectorAll("mave-player");if(!Array.from(_).find(m=>m.popped)){let m=t(r,p);n.open(m).then(()=>{m.play();}),n.addEventListener("closed",()=>{m.pause();});}});});}a(l),new MutationObserver(o=>{for(let e of o)e.type==="childList"&&e.addedNodes.forEach(r=>{r instanceof HTMLElement&&a(r);});}).observe(document.body,{childList:!0,subtree:!0});};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{w(document);}):setTimeout(()=>w(document),500);
163
163
 
164
164
  exports.a = i;
165
165
  exports.b = w;
@@ -1,4 +1,4 @@
1
- import { b as b$1 } from './chunk-EUSLOKEH.js';
1
+ import { b as b$1 } from './chunk-DZBAEURG.js';
2
2
  import { b } from './chunk-DBCDDWFV.js';
3
3
  import { a as a$2 } from './chunk-VOXORDG3.js';
4
4
  import { a as a$1 } from './chunk-R2QJ6RON.js';