aptechka 0.65.5 → 0.65.6
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/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +19 -17
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.d.ts +1 -0
- package/lib/ticker/index.js +85 -82
- package/package.json +1 -1
package/lib/billboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var W=n=>{throw TypeError(n)};var Q=(n,l,e)=>l.has(n)||W("Cannot "+e);var t=(n,l,e)=>(Q(n,l,"read from private field"),e?e.call(n):l.get(n)),i=(n,l,e)=>l.has(n)?W("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,e),c=(n,l,e,s)=>(Q(n,l,"write to private field"),s?s.call(n,e):l.set(n,e),e),d=(n,l,e)=>(Q(n,l,"access private method"),e);var F=(n,l,e)=>new Promise((s,r)=>{var o=v=>{try{x(e.next(v))}catch(z){r(z)}},f=v=>{try{x(e.throw(v))}catch(z){r(z)}},x=v=>v.done?s(v.value):Promise.resolve(v.value).then(o,f);x((e=e.apply(n,l)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../index-DekP7OZe.cjs"),et=require("../custom-elements-Dh4TWRDJ.cjs"),V=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const P=require("../css-property/index.cjs"),st=require("../events-KVanG9sR.cjs"),it=require("../gestures-C7gbKx11.cjs"),rt=require("../math-GDWEqu7y.cjs"),X=require("../number-DyefJ5a1.cjs");var T,A,E,L,C,B,N,m,h,b,a,R,G,q,O,U,M,J,K;class j extends HTMLElement{constructor(){super(...arguments);i(this,a);i(this,T,new P.CSSProperty(this,"--resize",!0));i(this,A,new P.CSSProperty(this,"--loop",!0));i(this,E,new P.CSSProperty(this,"--autoplay",!1));i(this,L,new P.CSSProperty(this,"--swipe","x"));i(this,C);i(this,B,!1);i(this,N,[]);i(this,m,new Map);i(this,h,0);i(this,b,0);i(this,q,e=>{c(this,B,e.isIntersecting),t(this,B)?d(this,a,G).call(this):clearInterval(t(this,C))});i(this,O,()=>{clearInterval(t(this,C)),t(this,B)&&c(this,C,setInterval(t(this,J),this.autoplayDuration))});i(this,J,()=>{d(this,a,M).call(this,t(this,h)+1)});i(this,K,e=>{if(!t(this,L).current)return;let s=0;it.setupDrag(r=>{const o=e.x-r.x,f=e.y-r.y;t(this,L).current==="x"?Math.abs(o)>Math.abs(f)&&Math.abs(o)>10&&(s=Math.sign(o)):t(this,L).current==="y"&&Math.abs(f)>Math.abs(o)&&Math.abs(f)>10&&(s=Math.sign(f))},()=>{s&&this.shift(s)})})}get counter(){return t(this,h)}get loop(){return t(this,A)}get autoplay(){return t(this,E)}get autoplayDuration(){return parseFloat(t(this,E).current||"0")*1e3}get swipe(){return t(this,L)}get itemElements(){return t(this,N)}get groups(){return t(this,m)}get length(){return t(this,b)}addItem(e){d(this,a,R).call(this,e),d(this,a,M).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(d(this,a,M).call(this,e),d(this,a,G).call(this))}shift(e){this.set(t(this,h)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(s=>{d(this,a,R).call(this,s)}),t(this,m).forEach(s=>{var r;(r=s[0])==null||r.classList.add("current")}),t(this,E).subscribe(s=>{s.current?(I.intersector.subscribe(this,t(this,q)),d(this,a,G).call(this)):(c(this,B,!0),I.intersector.unsubscribe(t(this,q)),clearInterval(t(this,C)),d(this,a,M).call(this,0))}),t(this,E).observe(),t(this,L).observe(),t(this,A).observe(),t(this,T).observe(),d(this,a,M).call(this,0),this.addEventListener("pointerdown",t(this,K))}disconnectedCallback(){t(this,E).unobserve(),t(this,L).unobserve(),t(this,A).unobserve(),t(this,T).unobserve(),t(this,m).clear(),I.intersector.unsubscribe(t(this,q)),clearInterval(t(this,C))}}T=new WeakMap,A=new WeakMap,E=new WeakMap,L=new WeakMap,C=new WeakMap,B=new WeakMap,N=new WeakMap,m=new WeakMap,h=new WeakMap,b=new WeakMap,a=new WeakSet,R=function(e){t(this,N).push(e);const s=e.getAttribute("data-billboard-item-group")||"default";let r=t(this,m).get(s);r||(r=[],t(this,m).set(s,r)),r.push(e),c(this,b,0),t(this,m).forEach(o=>{o.length>t(this,b)&&c(this,b,o.length)})},G=function(){t(this,E).current!==!1&&t(this,O).call(this)},q=new WeakMap,O=new WeakMap,U=function(e,s){e.classList.remove("current","previous","next","previous-sibling","next-sibling"),s===t(this,h)?e.classList.add("current"):s<t(this,h)?e.classList.add("previous"):s>t(this,h)&&e.classList.add("next"),s===X.loopNumber(t(this,h)-1,this.length)?e.classList.add("previous-sibling"):s===(t(this,h)+1)%this.length&&e.classList.add("next-sibling")},M=function(){return F(this,arguments,function*(e=t(this,h)){const s=t(this,h);t(this,A).current?c(this,h,X.loopNumber(e,t(this,b))):c(this,h,rt.clamp(e,0,t(this,b)-1)),this.classList.remove("forward","backward"),t(this,h)-s>=0?this.classList.add("forward"):t(this,h)-s<0&&this.classList.add("backward");let r=[];t(this,m).forEach(o=>{o.forEach((f,x)=>{const v=f.classList.contains("visited");x===t(this,h)&&!v?(f.classList.add("visited"),r.push(new Promise(z=>{setTimeout(()=>{d(this,a,U).call(this,f,x),z()},10)}))):d(this,a,U).call(this,f,x)})}),r.length&&(yield Promise.all(r)),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,h)===0),this.classList.toggle("end",t(this,h)===t(this,b)-1),this.style.setProperty("--counter",t(this,h).toString()),this.style.setProperty("--sections",t(this,b).toString()),t(this,h)!==s&&(st.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,h)}}),t(this,T).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0))})},J=new WeakMap,K=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",j);var p,D,g,_,H;class Y extends HTMLElement{constructor(){super(...arguments);i(this,p,null);i(this,D,null);i(this,g,[]);i(this,_,e=>{const s=e.currentTarget,r=t(this,g).findIndex(o=>o===s);r>=0&&t(this,p).set(r)});i(this,H,()=>{t(this,g).forEach((e,s)=>{s===t(this,p).counter?e.classList.add("current"):e.classList.remove("current")})})}get buttonElements(){return t(this,g)}connectedCallback(){return F(this,null,function*(){var e;if(yield et.whenDefined("e-billboard"),c(this,p,V.findParentElement(this,j)),t(this,p)&&this.isConnected){this.innerHTML="";const s=t(this,p).length;c(this,D,document.createElement("div"));for(let r=0;r<s;r++){const o=document.createElement("button");o.setAttribute("aria-label",`Go to item ${r+1}`),t(this,g).push(o),t(this,D).appendChild(o)}this.appendChild(t(this,D)),t(this,g).forEach(r=>{r.addEventListener("click",t(this,_))}),(e=t(this,p))==null||e.addEventListener("billboardChange",t(this,H)),t(this,H).call(this)}})}disconnectedCallback(){var e;t(this,g).forEach(s=>{s.removeEventListener("click",t(this,_))}),(e=t(this,p))==null||e.removeEventListener("billboardChange",t(this,H)),this.innerHTML="",c(this,g,[])}}p=new WeakMap,D=new WeakMap,g=new WeakMap,_=new WeakMap,H=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",Y);var w,y,k;class Z extends HTMLElement{constructor(){super();i(this,w,new P.CSSProperty(this,"--index",0));i(this,y,null);i(this,k,()=>{var e;t(this,w).current===((e=t(this,y))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,y)&&(!this.handleClick||this.handleClick(e))&&t(this,y).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){var e;this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),c(this,y,V.findParentElement(this,j)),(e=t(this,y))==null||e.addEventListener("billboardChange",t(this,k)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,k).call(this)}),t(this,w).subscribe(t(this,k)),t(this,w).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,w).unsubscribe(t(this,k)),t(this,w).unobserve(),(e=t(this,y))==null||e.removeEventListener("billboardChange",t(this,k))}}w=new WeakMap,y=new WeakMap,k=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",Z);var S,u,$;class tt extends HTMLElement{constructor(){super();i(this,S,new P.CSSProperty(this,"--step",1));i(this,u,null);i(this,$,()=>{t(this,u)&&(!t(this,u).loop.current&&(t(this,u).counter===0&&t(this,S).current<=0||t(this,u).counter===t(this,u).length-1&&t(this,S).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,u)&&(!this.handleClick||this.handleClick(e))&&t(this,u).shift(t(this,S).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return F(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,S).observe(),this.tabIndex=0,c(this,u,V.findParentElement(this,j)),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,$)),setTimeout(()=>{t(this,$).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,S).unobserve(),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,$))}}S=new WeakMap,u=new WeakMap,$=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",tt);exports.BillboardBulletsElement=Y;exports.BillboardElement=j;exports.BillboardSetButtonElement=Z;exports.BillboardStepButtonElement=tt;
|
|
1
|
+
"use strict";var W=n=>{throw TypeError(n)};var Q=(n,l,e)=>l.has(n)||W("Cannot "+e);var t=(n,l,e)=>(Q(n,l,"read from private field"),e?e.call(n):l.get(n)),i=(n,l,e)=>l.has(n)?W("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,e),c=(n,l,e,s)=>(Q(n,l,"write to private field"),s?s.call(n,e):l.set(n,e),e),d=(n,l,e)=>(Q(n,l,"access private method"),e);var F=(n,l,e)=>new Promise((s,r)=>{var o=v=>{try{x(e.next(v))}catch(z){r(z)}},f=v=>{try{x(e.throw(v))}catch(z){r(z)}},x=v=>v.done?s(v.value):Promise.resolve(v.value).then(o,f);x((e=e.apply(n,l)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../index-DekP7OZe.cjs"),et=require("../custom-elements-Dh4TWRDJ.cjs"),V=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const P=require("../css-property/index.cjs"),st=require("../events-KVanG9sR.cjs"),it=require("../gestures-C7gbKx11.cjs"),rt=require("../math-GDWEqu7y.cjs"),X=require("../number-DyefJ5a1.cjs");var T,A,E,L,C,B,N,m,h,b,a,R,G,q,O,U,M,J,K;class j extends HTMLElement{constructor(){super(...arguments);i(this,a);i(this,T,new P.CSSProperty(this,"--resize",!0));i(this,A,new P.CSSProperty(this,"--loop",!0));i(this,E,new P.CSSProperty(this,"--autoplay",!1));i(this,L,new P.CSSProperty(this,"--swipe","x"));i(this,C);i(this,B,!1);i(this,N,[]);i(this,m,new Map);i(this,h,0);i(this,b,0);i(this,q,e=>{c(this,B,e.isIntersecting),t(this,B)?d(this,a,G).call(this):clearInterval(t(this,C))});i(this,O,()=>{clearInterval(t(this,C)),t(this,B)&&c(this,C,setInterval(t(this,J),this.autoplayDuration))});i(this,J,()=>{d(this,a,M).call(this,t(this,h)+1)});i(this,K,e=>{if(!t(this,L).current)return;let s=0;it.setupDrag(r=>{const o=e.x-r.x,f=e.y-r.y;t(this,L).current==="x"?Math.abs(o)>Math.abs(f)&&Math.abs(o)>10&&(s=Math.sign(o)):t(this,L).current==="y"&&Math.abs(f)>Math.abs(o)&&Math.abs(f)>10&&(s=Math.sign(f))},()=>{s&&this.shift(s)})})}get counter(){return t(this,h)}get loop(){return t(this,A)}get autoplay(){return t(this,E)}get autoplayDuration(){return parseFloat(t(this,E).current||"0")*1e3}get swipe(){return t(this,L)}get itemElements(){return t(this,N)}get groups(){return t(this,m)}get length(){return t(this,b)}addItem(e){d(this,a,R).call(this,e),d(this,a,M).call(this)}set(e){(!this.handleSet||this.handleSet(e))&&(d(this,a,M).call(this,e),d(this,a,G).call(this))}shift(e){this.set(t(this,h)+e)}connectedCallback(){[...this.querySelectorAll(`[data-billboard-item${this.id?`="${this.id}"`:""}]`)].forEach(s=>{d(this,a,R).call(this,s)}),t(this,m).forEach(s=>{var r;(r=s[0])==null||r.classList.add("current")}),t(this,E).subscribe(s=>{s.current?(I.intersector.subscribe(this,t(this,q)),d(this,a,G).call(this)):(c(this,B,!0),I.intersector.unsubscribe(t(this,q)),clearInterval(t(this,C)),d(this,a,M).call(this,0))}),t(this,E).observe(),t(this,L).observe(),t(this,A).observe(),t(this,T).observe(),d(this,a,M).call(this,0),this.addEventListener("pointerdown",t(this,K))}disconnectedCallback(){t(this,E).unobserve(),t(this,L).unobserve(),t(this,A).unobserve(),t(this,T).unobserve(),t(this,m).clear(),I.intersector.unsubscribe(t(this,q)),clearInterval(t(this,C))}}T=new WeakMap,A=new WeakMap,E=new WeakMap,L=new WeakMap,C=new WeakMap,B=new WeakMap,N=new WeakMap,m=new WeakMap,h=new WeakMap,b=new WeakMap,a=new WeakSet,R=function(e){t(this,N).push(e);const s=e.getAttribute("data-billboard-item-group")||"default";let r=t(this,m).get(s);r||(r=[],t(this,m).set(s,r)),r.push(e),c(this,b,0),t(this,m).forEach(o=>{o.length>t(this,b)&&c(this,b,o.length)})},G=function(){t(this,E).current!==!1&&t(this,O).call(this)},q=new WeakMap,O=new WeakMap,U=function(e,s){e.classList.remove("current","previous","next","previous-sibling","next-sibling"),s===t(this,h)?e.classList.add("current"):s<t(this,h)?e.classList.add("previous"):s>t(this,h)&&e.classList.add("next"),s===X.loopNumber(t(this,h)-1,this.length)?e.classList.add("previous-sibling"):s===(t(this,h)+1)%this.length&&e.classList.add("next-sibling")},M=function(){return F(this,arguments,function*(e=t(this,h)){const s=t(this,h);t(this,A).current?c(this,h,X.loopNumber(e,t(this,b))):c(this,h,rt.clamp(e,0,t(this,b)-1)),this.classList.remove("forward","backward","next-round","prev-round"),t(this,h)-s>=0?this.classList.add("forward"):t(this,h)-s<0&&this.classList.add("backward");let r=[];t(this,m).forEach(o=>{o.forEach((f,x)=>{const v=f.classList.contains("visited");x===t(this,h)&&!v?(f.classList.add("visited"),r.push(new Promise(z=>{setTimeout(()=>{d(this,a,U).call(this,f,x),z()},10)}))):d(this,a,U).call(this,f,x)})}),r.length&&(yield Promise.all(r)),this.classList.toggle("has-length",t(this,b)>1),this.classList.toggle("start",t(this,h)===0),this.classList.toggle("end",t(this,h)===t(this,b)-1),this.style.setProperty("--counter",t(this,h).toString()),this.style.setProperty("--sections",t(this,b).toString()),t(this,h)!==s&&(st.dispatchEvent(this,"billboardChange",{detail:{counter:t(this,h)}}),t(this,T).current&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},0)),setTimeout(()=>{this.classList.remove("next-round","prev-round")},10)})},J=new WeakMap,K=new WeakMap;customElements.get("e-billboard")||customElements.define("e-billboard",j);var p,D,g,_,H;class Y extends HTMLElement{constructor(){super(...arguments);i(this,p,null);i(this,D,null);i(this,g,[]);i(this,_,e=>{const s=e.currentTarget,r=t(this,g).findIndex(o=>o===s);r>=0&&t(this,p).set(r)});i(this,H,()=>{t(this,g).forEach((e,s)=>{s===t(this,p).counter?e.classList.add("current"):e.classList.remove("current")})})}get buttonElements(){return t(this,g)}connectedCallback(){return F(this,null,function*(){var e;if(yield et.whenDefined("e-billboard"),c(this,p,V.findParentElement(this,j)),t(this,p)&&this.isConnected){this.innerHTML="";const s=t(this,p).length;c(this,D,document.createElement("div"));for(let r=0;r<s;r++){const o=document.createElement("button");o.setAttribute("aria-label",`Go to item ${r+1}`),t(this,g).push(o),t(this,D).appendChild(o)}this.appendChild(t(this,D)),t(this,g).forEach(r=>{r.addEventListener("click",t(this,_))}),(e=t(this,p))==null||e.addEventListener("billboardChange",t(this,H)),t(this,H).call(this)}})}disconnectedCallback(){var e;t(this,g).forEach(s=>{s.removeEventListener("click",t(this,_))}),(e=t(this,p))==null||e.removeEventListener("billboardChange",t(this,H)),this.innerHTML="",c(this,g,[])}}p=new WeakMap,D=new WeakMap,g=new WeakMap,_=new WeakMap,H=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-bullets")&&customElements.define("e-billboard-bullets",Y);var w,y,k;class Z extends HTMLElement{constructor(){super();i(this,w,new P.CSSProperty(this,"--index",0));i(this,y,null);i(this,k,()=>{var e;t(this,w).current===((e=t(this,y))==null?void 0:e.counter)?this.classList.add("current"):this.classList.remove("current")});this.addEventListener("click",e=>{t(this,y)&&(!this.handleClick||this.handleClick(e))&&t(this,y).set(t(this,w).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){var e;this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),c(this,y,V.findParentElement(this,j)),(e=t(this,y))==null||e.addEventListener("billboardChange",t(this,k)),customElements.whenDefined("e-billboard").then(()=>{this.isConnected&&t(this,k).call(this)}),t(this,w).subscribe(t(this,k)),t(this,w).observe()}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,w).unsubscribe(t(this,k)),t(this,w).unobserve(),(e=t(this,y))==null||e.removeEventListener("billboardChange",t(this,k))}}w=new WeakMap,y=new WeakMap,k=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-set-button")&&customElements.define("e-billboard-set-button",Z);var S,u,$;class tt extends HTMLElement{constructor(){super();i(this,S,new P.CSSProperty(this,"--step",1));i(this,u,null);i(this,$,()=>{t(this,u)&&(!t(this,u).loop.current&&(t(this,u).counter===0&&t(this,S).current<=0||t(this,u).counter===t(this,u).length-1&&t(this,S).current>=0)?this.setAttribute("disabled",""):this.removeAttribute("disabled"))});this.addEventListener("click",e=>{t(this,u)&&(!this.handleClick||this.handleClick(e))&&t(this,u).shift(t(this,S).current)}),this.addEventListener("keydown",e=>{e.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(e.preventDefault(),this.click())})}connectedCallback(){return F(this,null,function*(){var e;yield customElements.whenDefined("e-billboard"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,S).observe(),this.tabIndex=0,c(this,u,V.findParentElement(this,j)),(e=t(this,u))==null||e.addEventListener("billboardChange",t(this,$)),setTimeout(()=>{t(this,$).call(this)},0)})}disconnectedCallback(){var e;this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,S).unobserve(),(e=t(this,u))==null||e.removeEventListener("billboardChange",t(this,$))}}S=new WeakMap,u=new WeakMap,$=new WeakMap;I.isBrowser&&!customElements.get("e-billboard-step-button")&&customElements.define("e-billboard-step-button",tt);exports.BillboardBulletsElement=Y;exports.BillboardElement=j;exports.BillboardSetButtonElement=Z;exports.BillboardStepButtonElement=tt;
|
package/lib/billboard/index.js
CHANGED
|
@@ -138,7 +138,7 @@ D = new WeakMap(), M = new WeakMap(), E = new WeakMap(), L = new WeakMap(), C =
|
|
|
138
138
|
}, S = function() {
|
|
139
139
|
return F(this, arguments, function* (e = t(this, h)) {
|
|
140
140
|
const s = t(this, h);
|
|
141
|
-
t(this, M).current ? c(this, h, Z(e, t(this, b))) : c(this, h, st(e, 0, t(this, b) - 1)), this.classList.remove("forward", "backward"), t(this, h) - s >= 0 ? this.classList.add("forward") : t(this, h) - s < 0 && this.classList.add("backward");
|
|
141
|
+
t(this, M).current ? c(this, h, Z(e, t(this, b))) : c(this, h, st(e, 0, t(this, b) - 1)), this.classList.remove("forward", "backward", "next-round", "prev-round"), t(this, h) - s >= 0 ? this.classList.add("forward") : t(this, h) - s < 0 && this.classList.add("backward");
|
|
142
142
|
let r = [];
|
|
143
143
|
t(this, m).forEach((o) => {
|
|
144
144
|
o.forEach((f, A) => {
|
|
@@ -157,7 +157,9 @@ D = new WeakMap(), M = new WeakMap(), E = new WeakMap(), L = new WeakMap(), C =
|
|
|
157
157
|
}
|
|
158
158
|
}), t(this, D).current && setTimeout(() => {
|
|
159
159
|
window.dispatchEvent(new Event("resize"));
|
|
160
|
-
}, 0))
|
|
160
|
+
}, 0)), setTimeout(() => {
|
|
161
|
+
this.classList.remove("next-round", "prev-round");
|
|
162
|
+
}, 10);
|
|
161
163
|
});
|
|
162
164
|
}, J = new WeakMap(), K = new WeakMap();
|
|
163
165
|
customElements.get("e-billboard") || customElements.define("e-billboard", O);
|
|
@@ -213,13 +215,13 @@ class it extends HTMLElement {
|
|
|
213
215
|
}
|
|
214
216
|
p = new WeakMap(), H = new WeakMap(), g = new WeakMap(), q = new WeakMap(), P = new WeakMap();
|
|
215
217
|
W && !customElements.get("e-billboard-bullets") && customElements.define("e-billboard-bullets", it);
|
|
216
|
-
var w, k,
|
|
218
|
+
var w, k, x;
|
|
217
219
|
class rt extends HTMLElement {
|
|
218
220
|
constructor() {
|
|
219
221
|
super();
|
|
220
222
|
i(this, w, new T(this, "--index", 0));
|
|
221
223
|
i(this, k, null);
|
|
222
|
-
i(this,
|
|
224
|
+
i(this, x, () => {
|
|
223
225
|
var e;
|
|
224
226
|
t(this, w).current === ((e = t(this, k)) == null ? void 0 : e.counter) ? this.classList.add("current") : this.classList.remove("current");
|
|
225
227
|
});
|
|
@@ -233,32 +235,32 @@ class rt extends HTMLElement {
|
|
|
233
235
|
var e;
|
|
234
236
|
this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), c(this, k, X(this, O)), (e = t(this, k)) == null || e.addEventListener(
|
|
235
237
|
"billboardChange",
|
|
236
|
-
t(this,
|
|
238
|
+
t(this, x)
|
|
237
239
|
), customElements.whenDefined("e-billboard").then(() => {
|
|
238
|
-
this.isConnected && t(this,
|
|
239
|
-
}), t(this, w).subscribe(t(this,
|
|
240
|
+
this.isConnected && t(this, x).call(this);
|
|
241
|
+
}), t(this, w).subscribe(t(this, x)), t(this, w).observe();
|
|
240
242
|
}
|
|
241
243
|
disconnectedCallback() {
|
|
242
244
|
var e;
|
|
243
|
-
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, w).unsubscribe(t(this,
|
|
245
|
+
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, w).unsubscribe(t(this, x)), t(this, w).unobserve(), (e = t(this, k)) == null || e.removeEventListener(
|
|
244
246
|
"billboardChange",
|
|
245
|
-
t(this,
|
|
247
|
+
t(this, x)
|
|
246
248
|
);
|
|
247
249
|
}
|
|
248
250
|
}
|
|
249
|
-
w = new WeakMap(), k = new WeakMap(),
|
|
251
|
+
w = new WeakMap(), k = new WeakMap(), x = new WeakMap();
|
|
250
252
|
W && !customElements.get("e-billboard-set-button") && customElements.define("e-billboard-set-button", rt);
|
|
251
|
-
var
|
|
253
|
+
var y, u, z;
|
|
252
254
|
class nt extends HTMLElement {
|
|
253
255
|
constructor() {
|
|
254
256
|
super();
|
|
255
|
-
i(this,
|
|
257
|
+
i(this, y, new T(this, "--step", 1));
|
|
256
258
|
i(this, u, null);
|
|
257
259
|
i(this, z, () => {
|
|
258
|
-
t(this, u) && (!t(this, u).loop.current && (t(this, u).counter === 0 && t(this,
|
|
260
|
+
t(this, u) && (!t(this, u).loop.current && (t(this, u).counter === 0 && t(this, y).current <= 0 || t(this, u).counter === t(this, u).length - 1 && t(this, y).current >= 0) ? this.setAttribute("disabled", "") : this.removeAttribute("disabled"));
|
|
259
261
|
});
|
|
260
262
|
this.addEventListener("click", (e) => {
|
|
261
|
-
t(this, u) && (!this.handleClick || this.handleClick(e)) && t(this, u).shift(t(this,
|
|
263
|
+
t(this, u) && (!this.handleClick || this.handleClick(e)) && t(this, u).shift(t(this, y).current);
|
|
262
264
|
}), this.addEventListener("keydown", (e) => {
|
|
263
265
|
e.code === "Space" && !this.hasAttribute("keydown-disabled") && (e.preventDefault(), this.click());
|
|
264
266
|
});
|
|
@@ -266,7 +268,7 @@ class nt extends HTMLElement {
|
|
|
266
268
|
connectedCallback() {
|
|
267
269
|
return F(this, null, function* () {
|
|
268
270
|
var e;
|
|
269
|
-
yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this,
|
|
271
|
+
yield customElements.whenDefined("e-billboard"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.hasAttribute("role") || this.setAttribute("role", "button"), t(this, y).observe(), this.tabIndex = 0, c(this, u, X(this, O)), (e = t(this, u)) == null || e.addEventListener(
|
|
270
272
|
"billboardChange",
|
|
271
273
|
t(this, z)
|
|
272
274
|
), setTimeout(() => {
|
|
@@ -276,13 +278,13 @@ class nt extends HTMLElement {
|
|
|
276
278
|
}
|
|
277
279
|
disconnectedCallback() {
|
|
278
280
|
var e;
|
|
279
|
-
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this,
|
|
281
|
+
this.removeAttribute("tabindex"), this.removeAttribute("role"), t(this, y).unobserve(), (e = t(this, u)) == null || e.removeEventListener(
|
|
280
282
|
"billboardChange",
|
|
281
283
|
t(this, z)
|
|
282
284
|
);
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
|
-
|
|
287
|
+
y = new WeakMap(), u = new WeakMap(), z = new WeakMap();
|
|
286
288
|
W && !customElements.get("e-billboard-step-button") && customElements.define("e-billboard-step-button", nt);
|
|
287
289
|
export {
|
|
288
290
|
it as BillboardBulletsElement,
|
package/lib/ticker/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var I=h=>{throw TypeError(h)};var B=(h,e,s)=>e.has(h)||I("Cannot "+s);var i=(h,e,s)=>(B(h,e,"read from private field"),s?s.call(h):e.get(h)),r=(h,e,s)=>e.has(h)?I("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(h):e.set(h,s),t=(h,e,s,n)=>(B(h,e,"write to private field"),n?n.call(h,s):e.set(h,s),s),E=(h,e,s)=>(B(h,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../index-DekP7OZe.cjs"),j=require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");var g,u,v,k,b,m,w,l,d,y,A;class C{constructor(e,s){r(this,g);r(this,u);r(this,v);r(this,k,0);r(this,b,0);r(this,m,0);r(this,w,0);r(this,l,0);r(this,d,!1);r(this,y,null);r(this,A,e=>{const s=e[0];t(this,d,s.isIntersecting),i(this,d)&&t(this,w,i(this,k))});if(t(this,g,e),t(this,u,s==null?void 0:s.maxFPS),t(this,v,(s==null?void 0:s.order)||0),s!=null&&s.culling&&L.isBrowser){const n=j.getElement(s.culling);n&&(t(this,y,new IntersectionObserver(i(this,A))),i(this,y).observe(n))}else t(this,d,!0)}get callback(){return i(this,g)}get order(){return i(this,v)}sync(e){t(this,b,e-i(this,l))}tick(e){if(t(this,k,e),t(this,l,Math.max(0,e-i(this,b))),i(this,m)||t(this,m,e),i(this,u))if(i(this,l)>=1e3/i(this,u))t(this,b,e-i(this,l)%i(this,u));else return;else t(this,b,e);i(this,d)&&i(this,g).call(this,{timeBetweenFrames:i(this,l),timestamp:e,subscribeTimestamp:i(this,m),timeElapsedSinceSubscription:e-i(this,m),timeElapsedSinceIntersection:e-i(this,w)})}destroy(){var e;(e=i(this,y))==null||e.disconnect()}}g=new WeakMap,u=new WeakMap,v=new WeakMap,k=new WeakMap,b=new WeakMap,m=new WeakMap,w=new WeakMap,l=new WeakMap,d=new WeakMap,y=new WeakMap,A=new WeakMap;var T,f,a,F,c,o,P,x,S,q;class O{constructor(){r(this,o);r(this,T,0);r(this,f,0);r(this,a);r(this,F,!1);r(this,c,[]);r(this,S,e=>{if(i(this,F)){t(this,F,!1),t(this,T,e-i(this,f));for(const s of i(this,c))s.sync(i(this,f))}t(this,a,requestAnimationFrame(i(this,S))),t(this,f,e-i(this,T));for(const s of i(this,c))s.tick(i(this,f))});r(this,q,()=>{document.hidden&&t(this,F,!0)});L.isBrowser&&document.addEventListener("visibilitychange",i(this,q))}subscribe(e,s){if(!i(this,c).find(n=>n.callback===e)){const n=new C(e,s);n.sync(performance.now()),i(this,c).push(n),t(this,c,i(this,c).sort((M,V)=>M.order-V.order))}return E(this,o,P).call(this),()=>this.unsubscribe(e)}unsubscribe(e){const s=i(this,c).filter(n=>n.callback===e);s.length&&(s.forEach(n=>n.destroy()),t(this,c,i(this,c).filter(n=>n.callback!==e)),i(this,c).length||E(this,o,x).call(this))}destroy(){L.isBrowser&&(E(this,o,x).call(this),document.removeEventListener("visibilitychange",i(this,q)))}}T=new WeakMap,f=new WeakMap,a=new WeakMap,F=new WeakMap,c=new WeakMap,o=new WeakSet,P=function(){i(this,c).length&&!i(this,a)&&t(this,a,requestAnimationFrame(i(this,S)))},x=function(){i(this,a)&&(cancelAnimationFrame(i(this,a)),t(this,a,void 0))},S=new WeakMap,q=new WeakMap;const D=new O;exports.Ticker=O;exports.ticker=D;
|
package/lib/ticker/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export interface TickerCallbackEntry {
|
|
|
4
4
|
subscribeTimestamp: number;
|
|
5
5
|
timeBetweenFrames: number;
|
|
6
6
|
timeElapsedSinceSubscription: number;
|
|
7
|
+
timeElapsedSinceIntersection: number;
|
|
7
8
|
}
|
|
8
9
|
export type TickerCallback = (entry: TickerCallbackEntry) => void;
|
|
9
10
|
export interface TickerAddOptions {
|
package/lib/ticker/index.js
CHANGED
|
@@ -1,120 +1,123 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var B = (h) => {
|
|
2
|
+
throw TypeError(h);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
import { i as
|
|
7
|
-
import { g as
|
|
4
|
+
var x = (h, s, e) => s.has(h) || B("Cannot " + e);
|
|
5
|
+
var i = (h, s, e) => (x(h, s, "read from private field"), e ? e.call(h) : s.get(h)), r = (h, s, e) => s.has(h) ? B("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(h) : s.set(h, e), t = (h, s, e, n) => (x(h, s, "write to private field"), n ? n.call(h, e) : s.set(h, e), e), A = (h, s, e) => (x(h, s, "access private method"), e);
|
|
6
|
+
import { i as I } from "../index-Bv9zgfdb.js";
|
|
7
|
+
import { g as C } from "../dom-CVWzyXPH.js";
|
|
8
8
|
import "construct-style-sheets-polyfill";
|
|
9
|
-
var
|
|
10
|
-
class
|
|
11
|
-
constructor(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
var g, m, v, k, u, b, w, l, f, F, L;
|
|
10
|
+
class D {
|
|
11
|
+
constructor(s, e) {
|
|
12
|
+
r(this, g);
|
|
13
|
+
r(this, m);
|
|
14
|
+
r(this, v);
|
|
15
|
+
r(this, k, 0);
|
|
16
|
+
r(this, u, 0);
|
|
17
|
+
r(this, b, 0);
|
|
18
|
+
r(this, w, 0);
|
|
19
|
+
r(this, l, 0);
|
|
20
|
+
r(this, f, !1);
|
|
21
|
+
r(this, F, null);
|
|
22
|
+
r(this, L, (s) => {
|
|
23
|
+
const e = s[0];
|
|
24
|
+
t(this, f, e.isIntersecting), i(this, f) && t(this, w, i(this, k));
|
|
23
25
|
});
|
|
24
|
-
if (t(this,
|
|
25
|
-
const n =
|
|
26
|
+
if (t(this, g, s), t(this, m, e == null ? void 0 : e.maxFPS), t(this, v, (e == null ? void 0 : e.order) || 0), e != null && e.culling && I) {
|
|
27
|
+
const n = C(e.culling);
|
|
26
28
|
n && (t(this, F, new IntersectionObserver(
|
|
27
|
-
|
|
28
|
-
)),
|
|
29
|
+
i(this, L)
|
|
30
|
+
)), i(this, F).observe(n));
|
|
29
31
|
} else
|
|
30
|
-
t(this,
|
|
32
|
+
t(this, f, !0);
|
|
31
33
|
}
|
|
32
34
|
get callback() {
|
|
33
|
-
return
|
|
35
|
+
return i(this, g);
|
|
34
36
|
}
|
|
35
37
|
get order() {
|
|
36
|
-
return
|
|
38
|
+
return i(this, v);
|
|
37
39
|
}
|
|
38
|
-
sync(
|
|
39
|
-
t(this, u,
|
|
40
|
+
sync(s) {
|
|
41
|
+
t(this, u, s - i(this, l));
|
|
40
42
|
}
|
|
41
|
-
tick(
|
|
42
|
-
if (t(this, l, Math.max(0,
|
|
43
|
-
if (
|
|
44
|
-
t(this, u,
|
|
43
|
+
tick(s) {
|
|
44
|
+
if (t(this, k, s), t(this, l, Math.max(0, s - i(this, u))), i(this, b) || t(this, b, s), i(this, m))
|
|
45
|
+
if (i(this, l) >= 1e3 / i(this, m))
|
|
46
|
+
t(this, u, s - i(this, l) % i(this, m));
|
|
45
47
|
else
|
|
46
48
|
return;
|
|
47
49
|
else
|
|
48
|
-
t(this, u,
|
|
49
|
-
|
|
50
|
-
timeBetweenFrames:
|
|
51
|
-
timestamp:
|
|
52
|
-
subscribeTimestamp:
|
|
53
|
-
timeElapsedSinceSubscription:
|
|
50
|
+
t(this, u, s);
|
|
51
|
+
i(this, f) && i(this, g).call(this, {
|
|
52
|
+
timeBetweenFrames: i(this, l),
|
|
53
|
+
timestamp: s,
|
|
54
|
+
subscribeTimestamp: i(this, b),
|
|
55
|
+
timeElapsedSinceSubscription: s - i(this, b),
|
|
56
|
+
timeElapsedSinceIntersection: s - i(this, w)
|
|
54
57
|
});
|
|
55
58
|
}
|
|
56
59
|
destroy() {
|
|
57
|
-
var
|
|
58
|
-
(
|
|
60
|
+
var s;
|
|
61
|
+
(s = i(this, F)) == null || s.disconnect();
|
|
59
62
|
}
|
|
60
63
|
}
|
|
61
|
-
|
|
62
|
-
var
|
|
63
|
-
class
|
|
64
|
+
g = new WeakMap(), m = new WeakMap(), v = new WeakMap(), k = new WeakMap(), u = new WeakMap(), b = new WeakMap(), w = new WeakMap(), l = new WeakMap(), f = new WeakMap(), F = new WeakMap(), L = new WeakMap();
|
|
65
|
+
var T, d, a, y, c, o, O, q, E, S;
|
|
66
|
+
class H {
|
|
64
67
|
constructor() {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
t(this, y, !1), t(this,
|
|
74
|
-
for (const
|
|
75
|
-
|
|
68
|
+
r(this, o);
|
|
69
|
+
r(this, T, 0);
|
|
70
|
+
r(this, d, 0);
|
|
71
|
+
r(this, a);
|
|
72
|
+
r(this, y, !1);
|
|
73
|
+
r(this, c, []);
|
|
74
|
+
r(this, E, (s) => {
|
|
75
|
+
if (i(this, y)) {
|
|
76
|
+
t(this, y, !1), t(this, T, s - i(this, d));
|
|
77
|
+
for (const e of i(this, c))
|
|
78
|
+
e.sync(i(this, d));
|
|
76
79
|
}
|
|
77
|
-
t(this, a, requestAnimationFrame(
|
|
78
|
-
for (const
|
|
79
|
-
|
|
80
|
+
t(this, a, requestAnimationFrame(i(this, E))), t(this, d, s - i(this, T));
|
|
81
|
+
for (const e of i(this, c))
|
|
82
|
+
e.tick(i(this, d));
|
|
80
83
|
});
|
|
81
|
-
|
|
84
|
+
r(this, S, () => {
|
|
82
85
|
document.hidden && t(this, y, !0);
|
|
83
86
|
});
|
|
84
|
-
|
|
87
|
+
I && document.addEventListener(
|
|
85
88
|
"visibilitychange",
|
|
86
|
-
|
|
89
|
+
i(this, S)
|
|
87
90
|
);
|
|
88
91
|
}
|
|
89
|
-
subscribe(
|
|
90
|
-
if (!
|
|
91
|
-
const n = new
|
|
92
|
-
n.sync(performance.now()),
|
|
92
|
+
subscribe(s, e) {
|
|
93
|
+
if (!i(this, c).find((n) => n.callback === s)) {
|
|
94
|
+
const n = new D(s, e);
|
|
95
|
+
n.sync(performance.now()), i(this, c).push(n), t(this, c, i(this, c).sort((P, V) => P.order - V.order));
|
|
93
96
|
}
|
|
94
|
-
return A(this,
|
|
97
|
+
return A(this, o, O).call(this), () => this.unsubscribe(s);
|
|
95
98
|
}
|
|
96
|
-
unsubscribe(
|
|
97
|
-
const
|
|
98
|
-
(n) => n.callback ===
|
|
99
|
+
unsubscribe(s) {
|
|
100
|
+
const e = i(this, c).filter(
|
|
101
|
+
(n) => n.callback === s
|
|
99
102
|
);
|
|
100
|
-
|
|
101
|
-
(n) => n.callback !==
|
|
102
|
-
)),
|
|
103
|
+
e.length && (e.forEach((n) => n.destroy()), t(this, c, i(this, c).filter(
|
|
104
|
+
(n) => n.callback !== s
|
|
105
|
+
)), i(this, c).length || A(this, o, q).call(this));
|
|
103
106
|
}
|
|
104
107
|
destroy() {
|
|
105
|
-
|
|
108
|
+
I && (A(this, o, q).call(this), document.removeEventListener(
|
|
106
109
|
"visibilitychange",
|
|
107
|
-
|
|
110
|
+
i(this, S)
|
|
108
111
|
));
|
|
109
112
|
}
|
|
110
113
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
const
|
|
114
|
+
T = new WeakMap(), d = new WeakMap(), a = new WeakMap(), y = new WeakMap(), c = new WeakMap(), o = new WeakSet(), O = function() {
|
|
115
|
+
i(this, c).length && !i(this, a) && t(this, a, requestAnimationFrame(i(this, E)));
|
|
116
|
+
}, q = function() {
|
|
117
|
+
i(this, a) && (cancelAnimationFrame(i(this, a)), t(this, a, void 0));
|
|
118
|
+
}, E = new WeakMap(), S = new WeakMap();
|
|
119
|
+
const J = new H();
|
|
117
120
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
121
|
+
H as Ticker,
|
|
122
|
+
J as ticker
|
|
120
123
|
};
|