aptechka 0.65.6 → 0.65.8
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/{Animation-D29tc5VS.js → Animation-BDEX44-i.js} +1 -1
- package/lib/{Animation-BRqj4VfN.cjs → Animation-hZcAchp_.cjs} +1 -1
- package/lib/{Damped-YrqW5V4w.js → Damped-CtQmJ52v.js} +2 -2
- package/lib/{Damped-BD1OQ1fH.cjs → Damped-z9Uaw2MJ.cjs} +1 -1
- package/lib/DragControls-CfE2oPAi.cjs +1 -0
- package/lib/{DragControls-DGDUw6bM.js → DragControls-CkhCt-4W.js} +21 -21
- package/lib/{Tweened-_pF0zXXN.js → Tweened-BlZB0vl4.js} +2 -2
- package/lib/{Tweened-B-AHx93m.cjs → Tweened-mvHucL4Y.cjs} +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +1 -1
- package/lib/{layout-BSMtwCga.js → layout-DpZo-I0y.js} +2 -2
- package/lib/layout-box/index.js +1 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +90 -89
- package/lib/need_redo_tweaker/index.cjs +1 -1
- package/lib/need_redo_tweaker/index.js +1 -1
- package/lib/number-ChAm68cm.cjs +1 -0
- package/lib/number-CumqY64S.js +40 -0
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/scroll/ScrollSegmentElement.d.ts +63 -2
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +935 -556
- package/lib/{scroll-DNGJVxa2.js → scroll-DPkCFTxg.js} +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +3 -3
- package/package.json +1 -9
- package/lib/DragControls-D8BXtKVu.cjs +0 -1
- package/lib/ScrollSegmentElement-B6gp1q_z.js +0 -459
- package/lib/ScrollSegmentElement-DtMMAirz.cjs +0 -1
- package/lib/number-CbdpfO3u.js +0 -39
- package/lib/number-DyefJ5a1.cjs +0 -1
- package/lib/scroll-segment/ScrollSegmentDefaultContainer.d.ts +0 -11
- package/lib/scroll-segment/ScrollSegmentElement.d.ts +0 -81
- package/lib/scroll-segment/index.cjs +0 -1
- package/lib/scroll-segment/index.d.ts +0 -2
- package/lib/scroll-segment/index.js +0 -5
|
@@ -5,7 +5,7 @@ var S = (r, h, t) => h.has(r) || q("Cannot " + t);
|
|
|
5
5
|
var e = (r, h, t) => (S(r, h, "read from private field"), t ? t.call(r) : h.get(r)), a = (r, h, t) => h.has(r) ? q("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(r) : h.set(r, t), i = (r, h, t, u) => (S(r, h, "write to private field"), u ? u.call(r, t) : h.set(r, t), t), z = (r, h, t) => (S(r, h, "access private method"), t);
|
|
6
6
|
import { S as I } from "./Store-0BVty6AZ.js";
|
|
7
7
|
import { c as R } from "./math-BOBiC4TN.js";
|
|
8
|
-
import { p as P } from "./number-
|
|
8
|
+
import { p as P } from "./number-CumqY64S.js";
|
|
9
9
|
import { n as A } from "./polyfills-DJrTJQky.js";
|
|
10
10
|
import "construct-style-sheets-polyfill";
|
|
11
11
|
import "./index-Bv9zgfdb.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var C=i=>{throw TypeError(i)};var S=(i,h,e)=>h.has(i)||C("Cannot "+e);var t=(i,h,e)=>(S(i,h,"read from private field"),e?e.call(i):h.get(i)),u=(i,h,e)=>h.has(i)?C("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(i):h.set(i,e),r=(i,h,e,a)=>(S(i,h,"write to private field"),a?a.call(i,e):h.set(i,e),e),M=(i,h,e)=>(S(i,h,"access private method"),e);const y=require("./Store-Cd1GlEmZ.cjs"),N=require("./math-GDWEqu7y.cjs"),z=require("./number-
|
|
1
|
+
"use strict";var C=i=>{throw TypeError(i)};var S=(i,h,e)=>h.has(i)||C("Cannot "+e);var t=(i,h,e)=>(S(i,h,"read from private field"),e?e.call(i):h.get(i)),u=(i,h,e)=>h.has(i)?C("Cannot add the same private member more than once"):h instanceof WeakSet?h.add(i):h.set(i,e),r=(i,h,e,a)=>(S(i,h,"write to private field"),a?a.call(i,e):h.set(i,e),e),M=(i,h,e)=>(S(i,h,"access private method"),e);const y=require("./Store-Cd1GlEmZ.cjs"),N=require("./math-GDWEqu7y.cjs"),z=require("./number-ChAm68cm.cjs"),q=require("./polyfills-Df4r-ETT.cjs");require("construct-style-sheets-polyfill");require("./index-DekP7OZe.cjs");const I=require("./ticker/index.cjs"),O=require("./order/index.cjs");var d,f,b,m,A,s,l,c,n,g,x,P,F;class R extends y.Store{constructor(e,a){super(e||0,a);u(this,x);u(this,d);u(this,f,O.TICK_ORDER.ANIMATION);u(this,b);u(this,m,new y.Store(!1));u(this,A,0);u(this,s,0);u(this,l,-1/0);u(this,c,1/0);u(this,n,0);u(this,g,null);u(this,F,e=>{this.handleAnimationFrame(e)});r(this,s,this.current)}get direction(){return t(this,A)}get target(){return t(this,s)}get min(){return t(this,l)}set min(e){r(this,l,e),this.set(t(this,s),{equalize:!0})}get max(){return t(this,c)}set max(e){r(this,c,e),this.set(t(this,s),{equalize:!0})}get from(){return t(this,n)}get isRunning(){return t(this,m)}get delta(){return Math.abs(t(this,s)-t(this,n))}get deltaProgress(){return this.delta?z.preciseNumber(Math.abs(this.current-t(this,n))/this.delta,6):0}get distance(){return Math.abs(t(this,c)-t(this,l))}get distanceProgress(){return this.distance?z.preciseNumber(Math.abs(this.current-t(this,l))/this.distance,6):0}set(e,a){(t(this,s)!==e||a!=null&&a.restart)&&(r(this,g,e),this.updateOptions(a),r(this,g,null),t(this,s)!==this.current&&this.start())}shift(e,a){this.set(t(this,s)+e,a)}reset(){super.reset(),this.set(this.initial,{equalize:!0})}close(){super.close(),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){t(this,m).current||(t(this,m).current=!0,I.ticker.subscribe(t(this,F),{maxFPS:t(this,d),order:t(this,f),culling:t(this,b)}))}unlistenAnimationFrame(){t(this,m).current&&(t(this,m).current=!1,I.ticker.unsubscribe(t(this,F)))}updateOptions(e){r(this,d,q.nullishCoalescing(e==null?void 0:e.maxFPS,t(this,d))),r(this,f,q.nullishCoalescing(e==null?void 0:e.order,t(this,f))),r(this,b,q.nullishCoalescing(e==null?void 0:e.culling,t(this,b))),r(this,l,q.nullishCoalescing(e==null?void 0:e.min,t(this,l))),r(this,c,q.nullishCoalescing(e==null?void 0:e.max,t(this,c))),M(this,x,P).call(this,typeof t(this,g)=="number"?t(this,g):t(this,s)),e!=null&&e.equalize&&!(e!=null&&e.restart)&&(this.unlistenAnimationFrame(),this.current=r(this,n,t(this,s))),e!=null&&e.restart&&(this.unlistenAnimationFrame(),this.current=r(this,n,this.initial),e!=null&&e.equalize&&(this.current=r(this,n,t(this,s)))),typeof(e==null?void 0:e.current)=="number"&&r(this,n,this.current=e.current)}start(){this.listenAnimationFrame()}}d=new WeakMap,f=new WeakMap,b=new WeakMap,m=new WeakMap,A=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,n=new WeakMap,g=new WeakMap,x=new WeakSet,P=function(e){r(this,A,Math.sign(e-t(this,s))),r(this,s,N.clamp(e,t(this,l),t(this,c))),r(this,n,this.current)},F=new WeakMap;exports.Animation=R;
|
|
@@ -16,11 +16,11 @@ var f = (s, e, t) => e in s ? v(s, e, { enumerable: !0, configurable: !0, writab
|
|
|
16
16
|
var A = (s, e, t) => e.has(s) || g("Cannot " + t);
|
|
17
17
|
var a = (s, e, t) => (A(s, e, "read from private field"), t ? t.call(s) : e.get(s)), c = (s, e, t) => e.has(s) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), m = (s, e, t, r) => (A(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
|
|
18
18
|
import { d as D } from "./math-BOBiC4TN.js";
|
|
19
|
-
import { p as F } from "./number-
|
|
19
|
+
import { p as F } from "./number-CumqY64S.js";
|
|
20
20
|
import { n as u } from "./polyfills-DJrTJQky.js";
|
|
21
21
|
import "construct-style-sheets-polyfill";
|
|
22
22
|
import "./index-Bv9zgfdb.js";
|
|
23
|
-
import { A as q } from "./Animation-
|
|
23
|
+
import { A as q } from "./Animation-BDEX44-i.js";
|
|
24
24
|
var i, h;
|
|
25
25
|
class G extends q {
|
|
26
26
|
constructor(t, r) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty,C=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))v.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))w.call(e,s)&&d(t,s,e[s]);return t},q=(t,e)=>C(t,O(e));var p=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(p(t,e,"read from private field"),s?s.call(t):e.get(t)),c=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),n=(t,e,s,r)=>(p(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const B=require("./math-GDWEqu7y.cjs"),b=require("./number-
|
|
1
|
+
"use strict";var y=Object.defineProperty,C=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?y(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))v.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))w.call(e,s)&&d(t,s,e[s]);return t},q=(t,e)=>C(t,O(e));var p=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(p(t,e,"read from private field"),s?s.call(t):e.get(t)),c=(t,e,s)=>e.has(t)?g("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),n=(t,e,s,r)=>(p(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const B=require("./math-GDWEqu7y.cjs"),b=require("./number-ChAm68cm.cjs"),m=require("./polyfills-Df4r-ETT.cjs");require("construct-style-sheets-polyfill");require("./index-DekP7OZe.cjs");const D=require("./Animation-hZcAchp_.cjs");var i,h;class N extends D.Animation{constructor(s,r){super(s,r);c(this,i);c(this,h);this.damping=20,this.stiffness=0,this.mass=0,n(this,i,0),n(this,h,0),this.updateOptions(q(f({},r),{equalize:!0}))}get velocity(){return a(this,i)}get speed(){return a(this,h)}updateOptions(s){this.damping=m.nullishCoalescing(s==null?void 0:s.damping,this.damping),this.mass=m.nullishCoalescing(s==null?void 0:s.mass,this.mass),this.stiffness=m.nullishCoalescing(s==null?void 0:s.stiffness,this.stiffness),super.updateOptions(s)}handleAnimationFrame(s){b.preciseNumber(this.current,6)===b.preciseNumber(this.target,6)&&(this.unlistenAnimationFrame(),this.current=this.target);const r=this.current,A=Math.abs(r-this.target);n(this,h,A/s.timeBetweenFrames);const u=s.timeBetweenFrames/1e3;if(this.mass||this.stiffness){const F=(this.target-this.current)*this.stiffness-a(this,i)*this.damping;n(this,i,a(this,i)+F/this.mass*u),this.current+=a(this,i)*u}else this.current=B.damp(this.current,this.target,this.damping,u)}}i=new WeakMap,h=new WeakMap;exports.Damped=N;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var p=r=>{throw TypeError(r)};var G=(r,a,e)=>a.has(r)||p("Cannot "+e);var t=(r,a,e)=>(G(r,a,"read from private field"),e?e.call(r):a.get(r)),s=(r,a,e)=>a.has(r)?p("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(r):a.set(r,e),i=(r,a,e,h)=>(G(r,a,"write to private field"),h?h.call(r,e):a.set(r,e),e),T=(r,a,e)=>(G(r,a,"access private method"),e);const w=require("./index-DekP7OZe.cjs"),_=require("./dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const B=require("./ticker/index.cjs");require("./Store-Cd1GlEmZ.cjs");const ee=require("./easings-GegIwET5.cjs"),te=require("./Tweened-mvHucL4Y.cjs"),ie=require("./gestures-C7gbKx11.cjs"),se=require("./number-ChAm68cm.cjs"),he=require("./order/index.cjs"),re=require("./notifier/index.cjs");var j;class F{constructor(){s(this,j,new re.Notifier)}get changeEvent(){return t(this,j)}}j=new WeakMap;var y,c,u,R;class ne extends F{constructor(e){super();s(this,y,null);s(this,c,null);s(this,u,"offsetHeight");s(this,R,e=>{const h=e.shiftKey?-1:1;let n;e.code==="Space"?n=h*t(this,c)[t(this,u)]*.4:e.code==="ArrowLeft"?n=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowRight"?n=1*t(this,c)[t(this,u)]*.2:e.code==="ArrowUp"?n=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowDown"?n=1*t(this,c)[t(this,u)]*.2:e.code==="PageUp"?n=-1*t(this,c)[t(this,u)]:e.code==="PageDown"?n=1*t(this,c)[t(this,u)]:e.code==="Home"?n=0:e.code==="End"&&(n=t(this,u)==="offsetWidth"?t(this,c).scrollWidth:t(this,c).scrollHeight),n&&(e.stopPropagation(),this.changeEvent.notify("keyboard",n,e))});w.isBrowser&&(i(this,y,e!=null&&e.element&&_.getElement(e.element)||window),i(this,c,t(this,y)instanceof HTMLElement?t(this,y):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,u,e==="width"?"offsetWidth":"offsetHeight")}connect(){w.isBrowser&&t(this,y).addEventListener("keydown",t(this,R))}disconnect(){w.isBrowser&&t(this,y).removeEventListener("keydown",t(this,R))}}y=new WeakMap,c=new WeakMap,u=new WeakMap,R=new WeakMap;var x,k,X,Y,d,A,m,b,V,J,D,O,I;class ae extends F{constructor(e){super();s(this,b);s(this,x);s(this,k);s(this,X);s(this,Y);s(this,d);s(this,A);s(this,m);s(this,D);s(this,O);s(this,I);this.direction=1,i(this,d,new te.Tweened(0,{easing:ee.easeInQuad})),i(this,m,!1),i(this,D,h=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",h.timeBetweenFrames*t(this,x)*this.direction*(1-t(this,d).current),h)}),i(this,O,()=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",Math.sign(t(this,x))*this.direction*(1-t(this,d).current),null)}),i(this,I,()=>{t(this,k)&&(document.hidden?t(this,d).set(1,{equalize:!0}):t(this,d).set(0,{equalize:!0}))}),i(this,x,(e==null?void 0:e.speed)||1),i(this,k,(e==null?void 0:e.interval)||!1),i(this,X,e)}set interval(e){i(this,k,e),t(this,m)&&T(this,b,V).call(this)}set speed(e){i(this,x,e),t(this,m)&&T(this,b,V).call(this)}connect(){t(this,m)||(i(this,m,!0),T(this,b,V).call(this))}disconnect(){t(this,m)&&(i(this,m,!1),T(this,b,J).call(this))}pauseAndContinue(e,h){t(this,m)&&e&&(clearTimeout(t(this,A)),t(this,d).set(1,{duration:Math.min(e,1e3),equalize:h}),i(this,A,setTimeout(()=>{t(this,d).set(0,{duration:Math.min(e,5e3),equalize:h})},e)))}}x=new WeakMap,k=new WeakMap,X=new WeakMap,Y=new WeakMap,d=new WeakMap,A=new WeakMap,m=new WeakMap,b=new WeakSet,V=function(){T(this,b,J).call(this),t(this,k)?i(this,Y,setInterval(t(this,O),Math.abs(t(this,x)))):B.ticker.subscribe(t(this,D),t(this,X)),document.addEventListener("visibilitychange",t(this,I))},J=function(){clearInterval(t(this,Y)),B.ticker.unsubscribe(t(this,D)),clearTimeout(t(this,A)),t(this,d).close(),document.removeEventListener("visibilitychange",t(this,I))},D=new WeakMap,O=new WeakMap,I=new WeakMap;var H,M,z,S;class le extends F{constructor(e){super();s(this,H,null);s(this,M);s(this,z);s(this,S,e=>{let h=0;const n=Math.abs(e.deltaY),g=Math.abs(e.deltaX);if(!(this.axis==="x"&&n>g||this.axis==="y"&&g>n)&&(e.preventDefault(),!(this.debounce&&this.axis==="x"&&g<5||this.debounce&&this.axis==="y"&&n<5)))if(h=(this.axis==="max"?g>n?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const N=Date.now();if(N-t(this,z)>40&&(h=100*Math.sign(h)),i(this,z,N),Math.abs(h)<100||t(this,M))return;this.changeEvent.notify("wheel",h,e),i(this,M,setTimeout(()=>{i(this,M,void 0)},80))}else this.changeEvent.notify("wheel",h,e)});this.axis=(e==null?void 0:e.axis)||"y",this.speed=(e==null?void 0:e.speed)||1,this.debounce=(e==null?void 0:e.debounce)||!1,i(this,z,Date.now()),w.isBrowser&&i(this,H,e!=null&&e.element&&_.getElement(e.element)||window)}connect(){w.isBrowser&&t(this,H).addEventListener("wheel",t(this,S),{passive:!1})}disconnect(){w.isBrowser&&(t(this,H).removeEventListener("wheel",t(this,S)),clearTimeout(t(this,M)))}}H=new WeakMap,M=new WeakMap,z=new WeakMap,S=new WeakMap;var q,P,o,l,C,E,W,K,L;const v=class v extends F{constructor(e){super();s(this,P);s(this,o);s(this,l);s(this,C);s(this,E);s(this,W);s(this,K);s(this,L);this.inertion=1,i(this,P,null),i(this,o,null),i(this,l,0),i(this,C,[]),i(this,E,0),i(this,W,h=>{Math.abs(t(this,E))>2&&h.preventDefault()}),i(this,K,h=>{if(i(this,E,0),i(this,l,0),h.button!==0||h.composedPath().find(f=>f instanceof HTMLElement&&f.hasAttribute("drag-dead-zone")))return;this.swipe||B.ticker.unsubscribe(t(this,L));let n=h,g=!1;document.documentElement.classList.add("grabbing");let N=0,$=0,U=0,Q=0;ie.setupDrag(f=>{t(v,q)&&t(v,q)!==t(this,o)||(N=n.x-f.x,$=n.y-f.y,U=f.x-h.x,Q=f.y-h.y,this.axis==="x"?(i(this,E,U),i(this,l,N)):(i(this,E,Q),i(this,l,$)),n=f,g=this.axis==="x"&&Math.abs(U)>Math.abs(Q)||this.axis==="y"&&Math.abs(Q)>Math.abs(U),g&&(document.documentElement.classList.add("dragging"),i(v,q,t(this,o)),this.changeEvent.notify("drag",t(this,l),f)))},f=>{i(v,q,null),g&&(!this.swipe&&this.inertion?(i(this,l,t(this,l)*this.inertion),B.ticker.subscribe(t(this,L),{order:he.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",t(this,l),f)),document.documentElement.classList.remove("grabbing"),document.documentElement.classList.remove("dragging")})}),i(this,L,()=>{Math.floor(Math.abs(t(this,l)))||B.ticker.unsubscribe(t(this,L)),i(this,l,t(this,l)*.95),i(this,l,se.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l),null)}),this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,w.isBrowser&&(i(this,o,e!=null&&e.element&&_.getElement(e.element)||document.documentElement),i(this,P,(e==null?void 0:e.rootElement)||t(this,o)))}connect(){w.isBrowser&&(i(this,C,[...t(this,P).querySelectorAll("a")]),t(this,C).forEach(e=>{e.addEventListener("click",t(this,W))}),t(this,o).addEventListener("pointerdown",t(this,K)))}disconnect(){w.isBrowser&&(t(this,C).forEach(e=>{e.removeEventListener("click",t(this,W))}),t(this,o).removeEventListener("pointerdown",t(this,K)),B.ticker.unsubscribe(t(this,L)))}};q=new WeakMap,P=new WeakMap,o=new WeakMap,l=new WeakMap,C=new WeakMap,E=new WeakMap,W=new WeakMap,K=new WeakMap,L=new WeakMap,s(v,q,null);let Z=v;exports.AutoplayControls=ae;exports.Controls=F;exports.DragControls=Z;exports.KeyboardControls=ne;exports.WheelControls=le;
|
|
@@ -3,15 +3,15 @@ var _ = (n) => {
|
|
|
3
3
|
};
|
|
4
4
|
var G = (n, r, e) => r.has(n) || _("Cannot " + e);
|
|
5
5
|
var t = (n, r, e) => (G(n, r, "read from private field"), e ? e.call(n) : r.get(n)), s = (n, r, e) => r.has(n) ? _("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(n) : r.set(n, e), i = (n, r, e, h) => (G(n, r, "write to private field"), h ? h.call(n, e) : r.set(n, e), e), A = (n, r, e) => (G(n, r, "access private method"), e);
|
|
6
|
-
import { i as
|
|
6
|
+
import { i as b } from "./index-Bv9zgfdb.js";
|
|
7
7
|
import { g as Z } from "./dom-CVWzyXPH.js";
|
|
8
8
|
import "construct-style-sheets-polyfill";
|
|
9
9
|
import { ticker as D } from "./ticker/index.js";
|
|
10
10
|
import "./Store-0BVty6AZ.js";
|
|
11
11
|
import { a as ee } from "./easings-BEmRlrDd.js";
|
|
12
|
-
import { T as te } from "./Tweened-
|
|
12
|
+
import { T as te } from "./Tweened-BlZB0vl4.js";
|
|
13
13
|
import { s as ie } from "./gestures-CcXV6fCp.js";
|
|
14
|
-
import { p as se } from "./number-
|
|
14
|
+
import { p as se } from "./number-CumqY64S.js";
|
|
15
15
|
import { TICK_ORDER as he } from "./order/index.js";
|
|
16
16
|
import { Notifier as ne } from "./notifier/index.js";
|
|
17
17
|
var V;
|
|
@@ -36,30 +36,30 @@ class ye extends j {
|
|
|
36
36
|
let a;
|
|
37
37
|
e.code === "Space" ? a = h * t(this, c)[t(this, u)] * 0.4 : e.code === "ArrowLeft" ? a = -1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowRight" ? a = 1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowUp" ? a = -1 * t(this, c)[t(this, u)] * 0.2 : e.code === "ArrowDown" ? a = 1 * t(this, c)[t(this, u)] * 0.2 : e.code === "PageUp" ? a = -1 * t(this, c)[t(this, u)] : e.code === "PageDown" ? a = 1 * t(this, c)[t(this, u)] : e.code === "Home" ? a = 0 : e.code === "End" && (a = t(this, u) === "offsetWidth" ? t(this, c).scrollWidth : t(this, c).scrollHeight), a && (e.stopPropagation(), this.changeEvent.notify("keyboard", a, e));
|
|
38
38
|
});
|
|
39
|
-
|
|
39
|
+
b && (i(this, y, e != null && e.element && Z(e.element) || window), i(this, c, t(this, y) instanceof HTMLElement ? t(this, y) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
|
|
40
40
|
}
|
|
41
41
|
set dimension(e) {
|
|
42
42
|
i(this, u, e === "width" ? "offsetWidth" : "offsetHeight");
|
|
43
43
|
}
|
|
44
44
|
connect() {
|
|
45
|
-
|
|
45
|
+
b && t(this, y).addEventListener(
|
|
46
46
|
"keydown",
|
|
47
47
|
t(this, X)
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
disconnect() {
|
|
51
|
-
|
|
51
|
+
b && t(this, y).removeEventListener(
|
|
52
52
|
"keydown",
|
|
53
53
|
t(this, X)
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
y = new WeakMap(), c = new WeakMap(), u = new WeakMap(), X = new WeakMap();
|
|
58
|
-
var E, M, Y, O, d, I, m,
|
|
58
|
+
var E, M, Y, O, d, I, m, w, Q, J, H, S, q;
|
|
59
59
|
class Ee extends j {
|
|
60
60
|
constructor(e) {
|
|
61
61
|
super();
|
|
62
|
-
s(this,
|
|
62
|
+
s(this, w);
|
|
63
63
|
s(this, E);
|
|
64
64
|
s(this, M);
|
|
65
65
|
s(this, Y);
|
|
@@ -87,16 +87,16 @@ class Ee extends j {
|
|
|
87
87
|
}), i(this, E, (e == null ? void 0 : e.speed) || 1), i(this, M, (e == null ? void 0 : e.interval) || !1), i(this, Y, e);
|
|
88
88
|
}
|
|
89
89
|
set interval(e) {
|
|
90
|
-
i(this, M, e), t(this, m) && A(this,
|
|
90
|
+
i(this, M, e), t(this, m) && A(this, w, Q).call(this);
|
|
91
91
|
}
|
|
92
92
|
set speed(e) {
|
|
93
|
-
i(this, E, e), t(this, m) && A(this,
|
|
93
|
+
i(this, E, e), t(this, m) && A(this, w, Q).call(this);
|
|
94
94
|
}
|
|
95
95
|
connect() {
|
|
96
|
-
t(this, m) || (i(this, m, !0), A(this,
|
|
96
|
+
t(this, m) || (i(this, m, !0), A(this, w, Q).call(this));
|
|
97
97
|
}
|
|
98
98
|
disconnect() {
|
|
99
|
-
t(this, m) && (i(this, m, !1), A(this,
|
|
99
|
+
t(this, m) && (i(this, m, !1), A(this, w, J).call(this));
|
|
100
100
|
}
|
|
101
101
|
pauseAndContinue(e, h) {
|
|
102
102
|
t(this, m) && e && (clearTimeout(t(this, I)), t(this, d).set(1, {
|
|
@@ -110,8 +110,8 @@ class Ee extends j {
|
|
|
110
110
|
}, e)));
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
E = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), d = new WeakMap(), I = new WeakMap(), m = new WeakMap(),
|
|
114
|
-
A(this,
|
|
113
|
+
E = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), O = new WeakMap(), d = new WeakMap(), I = new WeakMap(), m = new WeakMap(), w = new WeakSet(), Q = function() {
|
|
114
|
+
A(this, w, J).call(this), t(this, M) ? i(this, O, setInterval(
|
|
115
115
|
t(this, S),
|
|
116
116
|
Math.abs(t(this, E))
|
|
117
117
|
)) : D.subscribe(t(this, H), t(this, Y)), document.addEventListener(
|
|
@@ -134,7 +134,7 @@ class xe extends j {
|
|
|
134
134
|
s(this, B, (e) => {
|
|
135
135
|
let h = 0;
|
|
136
136
|
const a = Math.abs(e.deltaY), g = Math.abs(e.deltaX);
|
|
137
|
-
if (!(this.axis === "x" && a > g || this.axis === "y" && g > a) && (e.preventDefault(), !(this.debounce && this.axis === "x" && g < 5 || this.axis === "y" && a < 5)))
|
|
137
|
+
if (!(this.axis === "x" && a > g || this.axis === "y" && g > a) && (e.preventDefault(), !(this.debounce && this.axis === "x" && g < 5 || this.debounce && this.axis === "y" && a < 5)))
|
|
138
138
|
if (h = (this.axis === "max" ? g > a ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), this.debounce) {
|
|
139
139
|
const R = Date.now();
|
|
140
140
|
if (R - t(this, P) > 40 && (h = 100 * Math.sign(h)), i(this, P, R), Math.abs(h) < 100 || t(this, k))
|
|
@@ -145,10 +145,10 @@ class xe extends j {
|
|
|
145
145
|
} else
|
|
146
146
|
this.changeEvent.notify("wheel", h, e);
|
|
147
147
|
});
|
|
148
|
-
this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this, P, Date.now()),
|
|
148
|
+
this.axis = (e == null ? void 0 : e.axis) || "y", this.speed = (e == null ? void 0 : e.speed) || 1, this.debounce = (e == null ? void 0 : e.debounce) || !1, i(this, P, Date.now()), b && i(this, z, e != null && e.element && Z(e.element) || window);
|
|
149
149
|
}
|
|
150
150
|
connect() {
|
|
151
|
-
|
|
151
|
+
b && t(this, z).addEventListener(
|
|
152
152
|
"wheel",
|
|
153
153
|
t(this, B),
|
|
154
154
|
{
|
|
@@ -157,7 +157,7 @@ class xe extends j {
|
|
|
157
157
|
);
|
|
158
158
|
}
|
|
159
159
|
disconnect() {
|
|
160
|
-
|
|
160
|
+
b && (t(this, z).removeEventListener(
|
|
161
161
|
"wheel",
|
|
162
162
|
t(this, B)
|
|
163
163
|
), clearTimeout(t(this, k)));
|
|
@@ -199,15 +199,15 @@ const v = class v extends j {
|
|
|
199
199
|
);
|
|
200
200
|
}), i(this, L, () => {
|
|
201
201
|
Math.floor(Math.abs(t(this, l))) || D.unsubscribe(t(this, L)), i(this, l, t(this, l) * 0.95), i(this, l, se(t(this, l), 3)), this.changeEvent.notify("drag", t(this, l), null);
|
|
202
|
-
}), this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1,
|
|
202
|
+
}), this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, b && (i(this, o, e != null && e.element && Z(e.element) || document.documentElement), i(this, W, (e == null ? void 0 : e.rootElement) || t(this, o)));
|
|
203
203
|
}
|
|
204
204
|
connect() {
|
|
205
|
-
|
|
205
|
+
b && (i(this, C, [...t(this, W).querySelectorAll("a")]), t(this, C).forEach((e) => {
|
|
206
206
|
e.addEventListener("click", t(this, K));
|
|
207
207
|
}), t(this, o).addEventListener("pointerdown", t(this, N)));
|
|
208
208
|
}
|
|
209
209
|
disconnect() {
|
|
210
|
-
|
|
210
|
+
b && (t(this, C).forEach((e) => {
|
|
211
211
|
e.removeEventListener("click", t(this, K));
|
|
212
212
|
}), t(this, o).removeEventListener(
|
|
213
213
|
"pointerdown",
|
|
@@ -17,11 +17,11 @@ var A = (a, r, e) => r.has(a) || f("Cannot " + e);
|
|
|
17
17
|
var s = (a, r, e) => (A(a, r, "read from private field"), e ? e.call(a) : r.get(a)), n = (a, r, e) => r.has(a) ? f("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, e), u = (a, r, e, i) => (A(a, r, "write to private field"), i ? i.call(a, e) : r.set(a, e), e);
|
|
18
18
|
import { l as h, e as T } from "./easings-BEmRlrDd.js";
|
|
19
19
|
import { c as q } from "./math-BOBiC4TN.js";
|
|
20
|
-
import { p as w } from "./number-
|
|
20
|
+
import { p as w } from "./number-CumqY64S.js";
|
|
21
21
|
import { n as z } from "./polyfills-DJrTJQky.js";
|
|
22
22
|
import "construct-style-sheets-polyfill";
|
|
23
23
|
import "./index-Bv9zgfdb.js";
|
|
24
|
-
import { A as C } from "./Animation-
|
|
24
|
+
import { A as C } from "./Animation-BDEX44-i.js";
|
|
25
25
|
var m, t;
|
|
26
26
|
class G extends C {
|
|
27
27
|
constructor(e, i) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var F=Object.defineProperty,b=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var h=(i,r,e)=>r in i?F(i,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[r]=e,g=(i,r)=>{for(var e in r||(r={}))O.call(r,e)&&h(i,e,r[e]);if(m)for(var e of m(r))w.call(r,e)&&h(i,e,r[e]);return i},f=(i,r)=>b(i,y(r));var q=(i,r,e)=>r.has(i)||d("Cannot "+e);var s=(i,r,e)=>(q(i,r,"read from private field"),e?e.call(i):r.get(i)),c=(i,r,e)=>r.has(i)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),l=(i,r,e,a)=>(q(i,r,"write to private field"),a?a.call(i,e):r.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),S=require("./math-GDWEqu7y.cjs"),T=require("./number-
|
|
1
|
+
"use strict";var F=Object.defineProperty,b=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var m=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var h=(i,r,e)=>r in i?F(i,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[r]=e,g=(i,r)=>{for(var e in r||(r={}))O.call(r,e)&&h(i,e,r[e]);if(m)for(var e of m(r))w.call(r,e)&&h(i,e,r[e]);return i},f=(i,r)=>b(i,y(r));var q=(i,r,e)=>r.has(i)||d("Cannot "+e);var s=(i,r,e)=>(q(i,r,"read from private field"),e?e.call(i):r.get(i)),c=(i,r,e)=>r.has(i)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(i):r.set(i,e),l=(i,r,e,a)=>(q(i,r,"write to private field"),a?a.call(i,e):r.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),S=require("./math-GDWEqu7y.cjs"),T=require("./number-ChAm68cm.cjs"),x=require("./polyfills-Df4r-ETT.cjs");require("construct-style-sheets-polyfill");require("./index-DekP7OZe.cjs");const z=require("./Animation-hZcAchp_.cjs");var n,t;class C extends z.Animation{constructor(e,a){super(e||0,a);c(this,n,u.linear);c(this,t,1e3);this.updateOptions(f(g({},a),{equalize:!0}))}updateOptions(e){super.updateOptions(e),l(this,n,typeof(e==null?void 0:e.easing)=="function"?e.easing:typeof(e==null?void 0:e.easing)=="string"&&u.easings[e.easing]||u.linear),l(this,t,(e==null?void 0:e.duration)===!1?0:x.nullishCoalescing(e==null?void 0:e.duration,s(this,t)))}handleAnimationFrame(e){const a=e.timeElapsedSinceSubscription/1e3/(s(this,t)/1e3)||0,A=s(this,n).call(this,S.clamp(a,0,1));this.current=T.preciseNumber(this.from+(this.target-this.from)*A,6),a>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}n=new WeakMap,t=new WeakMap;exports.Tweened=C;
|
package/lib/animation/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Animation-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../Animation-hZcAchp_.cjs"),n=require("../Damped-z9Uaw2MJ.cjs"),i=require("../Tweened-mvHucL4Y.cjs");exports.Animation=e.Animation;exports.Damped=n.Damped;exports.Tweened=i.Tweened;
|
package/lib/animation/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as r } from "../Animation-
|
|
2
|
-
import { D as m } from "../Damped-
|
|
3
|
-
import { T as t } from "../Tweened-
|
|
1
|
+
import { A as r } from "../Animation-BDEX44-i.js";
|
|
2
|
+
import { D as m } from "../Damped-CtQmJ52v.js";
|
|
3
|
+
import { T as t } from "../Tweened-BlZB0vl4.js";
|
|
4
4
|
export {
|
|
5
5
|
r as Animation,
|
|
6
6
|
m as Damped,
|
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-
|
|
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-ChAm68cm.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
|
@@ -27,7 +27,7 @@ import { CSSProperty as T } from "../css-property/index.js";
|
|
|
27
27
|
import { d as tt } from "../events-CsVF98U6.js";
|
|
28
28
|
import { s as et } from "../gestures-CcXV6fCp.js";
|
|
29
29
|
import { c as st } from "../math-BOBiC4TN.js";
|
|
30
|
-
import { l as Z } from "../number-
|
|
30
|
+
import { l as Z } from "../number-CumqY64S.js";
|
|
31
31
|
var D, M, E, L, C, I, N, m, h, b, a, U, G, B, j, V, S, J, K;
|
|
32
32
|
class O extends HTMLElement {
|
|
33
33
|
constructor() {
|
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../DragControls-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../DragControls-CfE2oPAi.cjs");exports.AutoplayControls=o.AutoplayControls;exports.Controls=o.Controls;exports.DragControls=o.DragControls;exports.KeyboardControls=o.KeyboardControls;exports.WheelControls=o.WheelControls;
|
package/lib/controls/index.js
CHANGED
package/lib/layout-box/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { scrollEntries as $ } from "../scroll-entries/index.js";
|
|
|
10
10
|
import { ticker as j } from "../ticker/index.js";
|
|
11
11
|
import { i as tt } from "../index-Bv9zgfdb.js";
|
|
12
12
|
import { g as et } from "../dom-CVWzyXPH.js";
|
|
13
|
-
import { g as F, a as G } from "../layout-
|
|
13
|
+
import { g as F, a as G } from "../layout-DpZo-I0y.js";
|
|
14
14
|
import "construct-style-sheets-polyfill";
|
|
15
15
|
import { elementResizer as st } from "../element-resizer/index.js";
|
|
16
16
|
import { windowResizer as it } from "../window-resizer/index.js";
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Mt=(a,t)=>(t=Symbol[a])?t:Symbol.for("Symbol."+a),xt=a=>{throw TypeError(a)};var pt=(a,t,s)=>t.has(a)||xt("Cannot "+s);var e=(a,t,s)=>(pt(a,t,"read from private field"),s?s.call(a):t.get(a)),o=(a,t,s)=>t.has(a)?xt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,s),n=(a,t,s,i)=>(pt(a,t,"write to private field"),i?i.call(a,s):t.set(a,s),s),m=(a,t,s)=>(pt(a,t,"access private method"),s);var z=(a,t,s)=>new Promise((i,h)=>{var v=E=>{try{S(s.next(E))}catch(D){h(D)}},b=E=>{try{S(s.throw(E))}catch(D){h(D)}},S=E=>E.done?i(E.value):Promise.resolve(E.value).then(v,b);S((s=s.apply(a,t)).next())});var Ht=(a,t,s)=>(t=a[Mt("asyncIterator")])?t.call(a):(a=a[Mt("iterator")](),t={},s=(i,h)=>(h=a[i])&&(t[i]=v=>new Promise((b,S,E)=>(v=h.call(a,v),E=v.done,Promise.resolve(v.value).then(D=>b({value:D,done:E}),S)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Dt=require("../index-DekP7OZe.cjs"),V=require("../events-KVanG9sR.cjs"),Wt=require("../polyfills-Df4r-ETT.cjs"),Nt=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const ot=require("../url-lnBE_6yf.cjs"),Yt=require("../css-value-parser/index.cjs");class Rt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,i]of Object.entries(t))this.setAttribute(s,i)}}Dt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Rt);var C,l,I,et,U;class Et{constructor(t,s){o(this,C);o(this,l);o(this,I);o(this,et,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,C).previousPathname)history.back();else{const h=e(this,l).getAttribute("data-history-action")||"push",v=e(this,l).hasAttribute("data-center-scroll"),b=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),S=b?Yt.cssValueParser.parse(b):void 0,E=e(this,l).hasAttribute("data-revalidate"),D=e(this,l).hasAttribute("data-keep-search-parameters"),ut=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(Y=>Y.trim()),f=e(this,l).hasAttribute("data-clear-state");e(this,C).navigate(e(this,I),{historyAction:h,centerScroll:v,offsetScroll:S,revalidate:E,keepSearchParameters:D,submorph:ut,clearState:f})}});o(this,U,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,C).prefetch(e(this,I),t),e(this,l).removeEventListener("pointerenter",e(this,U))});n(this,C,s),n(this,l,t),n(this,I,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,et)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,U))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,C).normalizePath(t),i=e(this,C).normalizePath(e(this,I));e(this,l).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,l).classList.add("current"):i.pathname===s.pathname?e(this,l).classList.add("current"):e(this,l).classList.remove("current")}destroy(){e(this,l).removeEventListener("click",e(this,et)),e(this,l).removeEventListener("pointerenter",e(this,U)),e(this,l).classList.remove("current")}}C=new WeakMap,l=new WeakMap,I=new WeakMap,et=new WeakMap,U=new WeakMap;var x,$,L,O,B,H,K;class qt{constructor(t,s,i){o(this,x);o(this,$);o(this,L,{x:0,y:0});o(this,O);o(this,B,null);o(this,H,null);o(this,K,null);n(this,x,t),n(this,$,s),n(this,O,i.cloneNode(!0))}get pathname(){return e(this,$)}get scrollState(){return e(this,L)}get document(){return e(this,H)}cloneDocument(){n(this,H,(e(this,B)||e(this,O)).cloneNode(!0))}get title(){let t="";if(e(this,H).title)t=e(this,H).title;else{const s=e(this,H).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,$)}return t}clearScrollState(){e(this,L).x=0,e(this,L).y=0}clearDocumentState(){n(this,B,null)}saveScrollState(){e(this,O).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,L).x=0,e(this,L).y=0):(e(this,L).x=e(this,x).scrollValue.left,e(this,L).y=e(this,x).scrollValue.top)}restoreScrollPosition(){e(this,x).scrollElement.scroll({top:e(this,L).y,left:e(this,L).x,behavior:"instant"})}saveDocumentState(){e(this,O).documentElement.hasAttribute("data-no-page-restoration")?n(this,B,null):n(this,B,document.cloneNode(!0))}renewScrollPosition(){e(this,x).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){n(this,K,t)}clearState(){const t=e(this,K);return n(this,K,null),t}}x=new WeakMap,$=new WeakMap,L=new WeakMap,O=new WeakMap,B=new WeakMap,H=new WeakMap,K=new WeakMap;var k,G,p,ct,N,d,st,F,T,P,it,q,W,J,Q,rt,c,lt,zt,St,Vt,vt,wt,yt,Lt,ht,Z;const tt=class tt{constructor(t){o(this,c);o(this,k,null);o(this,G,null);o(this,p,[]);o(this,ct,new DOMParser);o(this,N);o(this,d,null);o(this,st);o(this,F,[]);o(this,T,!1);o(this,P,null);o(this,it,!1);o(this,q,new Map);o(this,W,null);o(this,J,0);o(this,Q,0);o(this,rt,t=>{var s;return((s=t.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!t.hasAttribute("download")&&!t.hasAttribute("data-morph-skip")&&!t.closest("[data-morph-skip]")&&t.getAttribute("target")!=="_blank"});o(this,ht,t=>z(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),n(this,T,!0),yield this.navigate(t.state.path,{historyAction:"none"}),n(this,T,!1))}));o(this,Z,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,Q),h=t-e(this,J);n(this,Q,s),n(this,J,t),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",t>0),document.documentElement.classList.toggle("scroll-y-forward",i>0),document.documentElement.classList.toggle("scroll-y-backward",i<0),document.documentElement.classList.toggle("scroll-x-forward",h>0),document.documentElement.classList.toggle("scroll-x-backward",h<0),V.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Dt.isBrowser&&!tt.instance){tt.instance=this,n(this,k,{base:ot.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:t==null?void 0:t.scrollSelector,morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),n(this,G,m(this,c,St).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);n(this,d,s.pathname),e(this,q).set(e(this,d),new qt(this,e(this,d),document)),document.documentElement.setAttribute("data-current-pathname",e(this,d)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,ht)),ot.changeHistory({action:"replace",pathname:e(this,d),searchParameters:s.parameters||location.search,hash:s.hash}),n(this,W,new Rt),m(this,c,yt).call(this,document)}}get currentPathname(){return e(this,d)}get previousPathname(){return e(this,st)}get links(){return e(this,p)}get scrollElement(){return e(this,P)}get isPopstateNavigation(){return e(this,T)}get scrollValue(){let t=0,s=0;return e(this,it)?(t=window.scrollY,s=window.scrollX):(t=e(this,P).scrollTop,s=e(this,P).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,q).get(e(this,d));s&&s.saveState(t)}getState(){const t=e(this,q).get(e(this,d));return t==null?void 0:t.clearState()}normalizePath(t){return ot.splitPath(t,{base:e(this,k).base,trailingSlash:e(this,k).trailingSlash})}prefetch(t,s){return z(this,null,function*(){const i=this.normalizePath(t);m(this,c,lt).call(this,i.pathname,{searchParameters:i.parameters,revalidate:s})})}navigate(D){return z(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:h,revalidate:v,keepSearchParameters:b,submorph:S,clearState:E}={}){var Pt;if(e(this,F).length)return;const ut=this.normalizePath(((Pt=this.pathnameModifier)==null?void 0:Pt.call(this,t))||t);let{pathname:f,hash:Y,parameters:bt,leaf:It}=ut;if(e(this,N)===f||e(this,d)===f){e(this,T)||m(this,c,Lt).call(this,Y||0,{centerScroll:i,offsetScroll:h,behavior:"smooth"});return}n(this,N,f),e(this,p).forEach(X=>{X.checkCurrent(f)});try{let X=!0;if(this.preprocessor)try{yield new Promise((r,A)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:f,resolve:r,reject:A,submorph:S})})}catch(r){r?console.error(r):console.log("Route change canceled"),X=!1}if(!X||e(this,N)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,d))});return}const dt={pathname:f,submorph:S};V.dispatchEvent(document,"morphNavigation",{detail:dt});const mt=yield m(this,c,lt).call(this,e(this,d)),w=yield m(this,c,lt).call(this,f,{searchParameters:bt,revalidate:v});if(e(this,N)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,d))});return}mt.clearState(),mt.saveScrollState(),mt.saveDocumentState(),e(this,T)||(w.clearScrollState(),w.clearDocumentState()),E&&w.clearState(),w.cloneDocument(),e(this,W).textContent=w.title,document.body.appendChild(e(this,W)),V.dispatchEvent(document,"morphStart",{detail:dt});const kt=Array.from(document.head.children),At=Array.from(w.document.head.children),Ct=m(this,c,Vt).call(this,kt,At),Ot=m(this,c,vt).call(this,kt,Ct),nt=m(this,c,vt).call(this,At,Ct);nt.forEach((r,A)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),nt[A]=y}}),nt.forEach(r=>{document.head.appendChild(r)});const ft=nt.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(m(this,c,wt).call(this,r))return!0});e(this,k).waitForHeadToLoad&&ft.length&&(yield new Promise(r=>z(this,null,function*(){let A=0;try{for(var y=Ht(ft),_,R,j;_=!(R=yield y.next()).done;_=!1){const at=R.value;at.onload=()=>{A++,A===ft.length&&r()}}}catch(R){j=[R]}finally{try{_&&(R=y.return)&&(yield R.call(y))}finally{if(j)throw j[0]}}}))),yield Nt.wait(10);const Tt=[];Ot.forEach(r=>{r.hasAttribute("data-permanent")||(m(this,c,wt).call(this,r)?Tt.push(r):r.remove())});const Bt=m(this,c,St).call(this,w.document.body);e(this,k).morphInsideScrollContainer||m(this,c,yt).call(this,w.document),document.documentElement.setAttribute("data-current-pathname",f),document.documentElement.setAttribute("data-current-leaf",It),ot.changeHistory({action:s,pathname:f,searchParameters:bt||(b?location.search:""),hash:Y}),e(this,W).remove(),n(this,st,e(this,d)),n(this,d,f),e(this,G).forEach((r,A)=>{const y=Bt[A],_=getComputedStyle(r).getPropertyValue("--morph-duration");let R=[],j=[];S?S.forEach(u=>{const g=r.querySelector(u),M=y.querySelector(u);g&&M&&(j.push(g),R.push(M))}):(R.push(...y.childNodes),j.push(...r.childNodes)),j.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"))}),R.forEach(u=>{u instanceof HTMLElement&&(this.findNewLinks(u),u.classList.add("new"))}),S?R.forEach((u,g)=>{var M;(M=j[g].parentElement)==null||M.insertBefore(u,j[g])}):r.prepend(...R),Wt.requestIdleCallback(()=>{R.forEach(u=>{var g;u instanceof HTMLElement&&((g=u.parentElement)==null||g.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("in"))})});const at={morphElement:r,pathname:f};V.dispatchEvent(document,"morphNewChildrenAdded",{detail:at});const Ft=new Promise(u=>{setTimeout(()=>{j.forEach(g=>g.remove()),R.forEach(g=>{var M;g instanceof HTMLElement&&((M=g.parentElement)==null||M.style.removeProperty("--new-content-height"),g.classList.remove("in","new"))}),V.dispatchEvent(document,"morphOldChildrenRemoved",{detail:at}),u()},(parseFloat(_)||0)*1e3+10)});e(this,F).push(Ft)}),Y?(w.clearScrollState(),m(this,c,Lt).call(this,Y,{centerScroll:i,offsetScroll:h})):e(this,T)?w.restoreScrollPosition():w.renewScrollPosition(),V.dispatchEvent(document,"morphNavigationScroll",{detail:w.scrollState}),yield Promise.all(e(this,F)),Tt.forEach(r=>r.remove()),n(this,F,[]),e(this,G).forEach(r=>{r.querySelectorAll("script").forEach(y=>{const _=document.createElement("script");_.type="module",_.src=y.getAttribute("src"),y.replaceWith(_)})}),V.dispatchEvent(document,"morphComplete",{detail:dt}),window.dispatchEvent(new Event("resize"))}catch(X){console.error(X)}n(this,N,void 0)})}addLink(t){e(this,p).push(new Et(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){n(this,p,e(this,p).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){n(this,p,e(this,p).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,rt));e(this,p).push(...s.map(i=>new Et(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,rt));e(this,p).forEach(s=>s.destroy()),n(this,p,t.map(s=>new Et(s,this)))}};k=new WeakMap,G=new WeakMap,p=new WeakMap,ct=new WeakMap,N=new WeakMap,d=new WeakMap,st=new WeakMap,F=new WeakMap,T=new WeakMap,P=new WeakMap,it=new WeakMap,q=new WeakMap,W=new WeakMap,J=new WeakMap,Q=new WeakMap,rt=new WeakMap,c=new WeakSet,lt=function(t,s){return z(this,null,function*(){let i=e(this,q).get(t);return(!i||s!=null&&s.revalidate)&&(i=yield m(this,c,zt).call(this,t,s==null?void 0:s.searchParameters)),i})},zt=function(t,s){return z(this,null,function*(){const h=yield(yield fetch(`${t}${s?"?"+s:""}`)).text(),v=e(this,ct).parseFromString(h,"text/html"),b=new qt(this,t,v);return e(this,q).set(t,b),b})},St=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Vt=function(t,s){return t.filter(i=>s.find(h=>h.outerHTML===i.outerHTML))},vt=function(t,s){return t.filter(i=>!s.find(h=>h.outerHTML===i.outerHTML))},wt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},yt=function(t){var s,i;(s=e(this,P))==null||s.removeEventListener("scroll",e(this,Z)),n(this,Q,0),n(this,J,0),n(this,P,e(this,k).scrollSelector&&t.querySelector(e(this,k).scrollSelector)||window),n(this,it,e(this,P)===window),(i=e(this,P))==null||i.addEventListener("scroll",e(this,Z)),e(this,Z).call(this)},Lt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Nt.scrollToElement(i,{scrollElement:e(this,P),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ht=new WeakMap,Z=new WeakMap,tt.instance=null;let gt=tt;exports.Morph=gt;
|
|
1
|
+
"use strict";var Mt=(a,t)=>(t=Symbol[a])?t:Symbol.for("Symbol."+a),xt=a=>{throw TypeError(a)};var pt=(a,t,s)=>t.has(a)||xt("Cannot "+s);var e=(a,t,s)=>(pt(a,t,"read from private field"),s?s.call(a):t.get(a)),o=(a,t,s)=>t.has(a)?xt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,s),n=(a,t,s,i)=>(pt(a,t,"write to private field"),i?i.call(a,s):t.set(a,s),s),m=(a,t,s)=>(pt(a,t,"access private method"),s);var V=(a,t,s)=>new Promise((i,h)=>{var v=E=>{try{S(s.next(E))}catch(R){h(R)}},b=E=>{try{S(s.throw(E))}catch(R){h(R)}},S=E=>E.done?i(E.value):Promise.resolve(E.value).then(v,b);S((s=s.apply(a,t)).next())});var Ht=(a,t,s)=>(t=a[Mt("asyncIterator")])?t.call(a):(a=a[Mt("iterator")](),t={},s=(i,h)=>(h=a[i])&&(t[i]=v=>new Promise((b,S,E)=>(v=h.call(a,v),E=v.done,Promise.resolve(v.value).then(R=>b({value:R,done:E}),S)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Dt=require("../index-DekP7OZe.cjs"),I=require("../events-KVanG9sR.cjs"),Wt=require("../polyfills-Df4r-ETT.cjs"),Nt=require("../scroll-CIdNtj3G.cjs");require("construct-style-sheets-polyfill");const ot=require("../url-lnBE_6yf.cjs"),Yt=require("../css-value-parser/index.cjs");class Rt extends HTMLElement{connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,i]of Object.entries(t))this.setAttribute(s,i)}}Dt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Rt);var C,l,x,et,U;class Et{constructor(t,s){o(this,C);o(this,l);o(this,x);o(this,et,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,C).previousPathname)history.back();else{n(this,x,e(this,l).getAttribute("href")||"/");const h=e(this,l).getAttribute("data-history-action")||"push",v=e(this,l).hasAttribute("data-center-scroll"),b=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),S=b?Yt.cssValueParser.parse(b):void 0,E=e(this,l).hasAttribute("data-revalidate"),R=e(this,l).hasAttribute("data-keep-search-parameters"),ut=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(Y=>Y.trim()),f=e(this,l).hasAttribute("data-clear-state");e(this,C).navigate(e(this,x),{historyAction:h,centerScroll:v,offsetScroll:S,revalidate:E,keepSearchParameters:R,submorph:ut,clearState:f})}});o(this,U,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,C).prefetch(e(this,x),t),e(this,l).removeEventListener("pointerenter",e(this,U))});n(this,C,s),n(this,l,t),n(this,x,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,et)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,U))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,C).normalizePath(t),i=e(this,C).normalizePath(e(this,x));e(this,l).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,l).classList.add("current"):i.pathname===s.pathname?e(this,l).classList.add("current"):e(this,l).classList.remove("current")}destroy(){e(this,l).removeEventListener("click",e(this,et)),e(this,l).removeEventListener("pointerenter",e(this,U)),e(this,l).classList.remove("current")}}C=new WeakMap,l=new WeakMap,x=new WeakMap,et=new WeakMap,U=new WeakMap;var H,$,L,O,B,N,K;class qt{constructor(t,s,i){o(this,H);o(this,$);o(this,L,{x:0,y:0});o(this,O);o(this,B,null);o(this,N,null);o(this,K,null);n(this,H,t),n(this,$,s),n(this,O,i.cloneNode(!0))}get pathname(){return e(this,$)}get scrollState(){return e(this,L)}get document(){return e(this,N)}cloneDocument(){n(this,N,(e(this,B)||e(this,O)).cloneNode(!0))}get title(){let t="";if(e(this,N).title)t=e(this,N).title;else{const s=e(this,N).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,$)}return t}clearScrollState(){e(this,L).x=0,e(this,L).y=0}clearDocumentState(){n(this,B,null)}saveScrollState(){e(this,O).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,L).x=0,e(this,L).y=0):(e(this,L).x=e(this,H).scrollValue.left,e(this,L).y=e(this,H).scrollValue.top)}restoreScrollPosition(){e(this,H).scrollElement.scroll({top:e(this,L).y,left:e(this,L).x,behavior:"instant"})}saveDocumentState(){e(this,O).documentElement.hasAttribute("data-no-page-restoration")?n(this,B,null):n(this,B,document.cloneNode(!0))}renewScrollPosition(){e(this,H).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){n(this,K,t)}clearState(){const t=e(this,K);return n(this,K,null),t}}H=new WeakMap,$=new WeakMap,L=new WeakMap,O=new WeakMap,B=new WeakMap,N=new WeakMap,K=new WeakMap;var A,G,p,ct,q,d,st,F,T,P,it,D,W,J,Q,rt,c,lt,zt,St,Vt,vt,wt,yt,Lt,ht,Z;const tt=class tt{constructor(t){o(this,c);o(this,A,null);o(this,G,null);o(this,p,[]);o(this,ct,new DOMParser);o(this,q);o(this,d,null);o(this,st);o(this,F,[]);o(this,T,!1);o(this,P,null);o(this,it,!1);o(this,D,new Map);o(this,W,null);o(this,J,0);o(this,Q,0);o(this,rt,t=>{var s;return((s=t.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!t.hasAttribute("download")&&!t.hasAttribute("data-morph-skip")&&!t.closest("[data-morph-skip]")&&t.getAttribute("target")!=="_blank"});o(this,ht,t=>V(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),n(this,T,!0),yield this.navigate(t.state.path,{historyAction:"none"}),n(this,T,!1))}));o(this,Z,()=>{const{left:t,top:s}=this.scrollValue,i=s-e(this,Q),h=t-e(this,J);n(this,Q,s),n(this,J,t),document.documentElement.classList.toggle("scroll-y",s>0),document.documentElement.classList.toggle("scroll-x",t>0),document.documentElement.classList.toggle("scroll-y-forward",i>0),document.documentElement.classList.toggle("scroll-y-backward",i<0),document.documentElement.classList.toggle("scroll-x-forward",h>0),document.documentElement.classList.toggle("scroll-x-backward",h<0),I.dispatchEvent(document,"morphScroll",{detail:{left:t,top:s}})});if(Dt.isBrowser&&!tt.instance){tt.instance=this,n(this,A,{base:ot.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:t==null?void 0:t.scrollSelector,morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),n(this,G,m(this,c,St).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);n(this,d,s.pathname),e(this,D).set(e(this,d),new qt(this,e(this,d),document)),document.documentElement.setAttribute("data-current-pathname",e(this,d)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),history.scrollRestoration="manual",addEventListener("popstate",e(this,ht)),ot.changeHistory({action:"replace",pathname:e(this,d),searchParameters:s.parameters||location.search,hash:s.hash}),n(this,W,new Rt),m(this,c,yt).call(this,document)}}get currentPathname(){return e(this,d)}get previousPathname(){return e(this,st)}get links(){return e(this,p)}get scrollElement(){return e(this,P)}get isPopstateNavigation(){return e(this,T)}get scrollValue(){let t=0,s=0;return e(this,it)?(t=window.scrollY,s=window.scrollX):(t=e(this,P).scrollTop,s=e(this,P).scrollLeft),{top:t,left:s}}saveState(t){const s=e(this,D).get(e(this,d));s&&s.saveState(t)}getState(){const t=e(this,D).get(e(this,d));return t==null?void 0:t.clearState()}normalizePath(t){return ot.splitPath(t,{base:e(this,A).base,trailingSlash:e(this,A).trailingSlash})}prefetch(t,s){return V(this,null,function*(){const i=this.normalizePath(t);m(this,c,lt).call(this,i.pathname,{searchParameters:i.parameters,revalidate:s})})}navigate(R){return V(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:h,revalidate:v,keepSearchParameters:b,submorph:S,clearState:E}={}){var Pt;if(e(this,F).length)return;const ut=this.normalizePath(((Pt=this.pathnameModifier)==null?void 0:Pt.call(this,t))||t);let{pathname:f,hash:Y,parameters:bt,leaf:It}=ut;if(e(this,q)===f||e(this,d)===f){e(this,T)||m(this,c,Lt).call(this,Y||0,{centerScroll:i,offsetScroll:h,behavior:"smooth"});return}n(this,q,f),e(this,p).forEach(X=>{X.checkCurrent(f)});try{let X=!0;if(this.preprocessor)try{yield new Promise((r,k)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:f,resolve:r,reject:k,submorph:S})})}catch(r){r?console.error(r):console.log("Route change canceled"),X=!1}if(!X||e(this,q)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,d))});return}const dt={pathname:f,submorph:S};I.dispatchEvent(document,"morphNavigation",{detail:dt});const mt=yield m(this,c,lt).call(this,e(this,d)),w=yield m(this,c,lt).call(this,f,{searchParameters:bt,revalidate:v});if(e(this,q)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,d))});return}mt.clearState(),mt.saveScrollState(),mt.saveDocumentState(),e(this,T)||(w.clearScrollState(),w.clearDocumentState()),E&&w.clearState(),w.cloneDocument(),e(this,W).textContent=w.title,document.body.appendChild(e(this,W)),I.dispatchEvent(document,"morphStart",{detail:dt});const At=Array.from(document.head.children),kt=Array.from(w.document.head.children),Ct=m(this,c,Vt).call(this,At,kt),Ot=m(this,c,vt).call(this,At,Ct),nt=m(this,c,vt).call(this,kt,Ct);nt.forEach((r,k)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),nt[k]=y}}),nt.forEach(r=>{document.head.appendChild(r)});const ft=nt.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(m(this,c,wt).call(this,r))return!0});e(this,A).waitForHeadToLoad&&ft.length&&(yield new Promise(r=>V(this,null,function*(){let k=0;try{for(var y=Ht(ft),_,z,j;_=!(z=yield y.next()).done;_=!1){const at=z.value;at.onload=()=>{k++,k===ft.length&&r()}}}catch(z){j=[z]}finally{try{_&&(z=y.return)&&(yield z.call(y))}finally{if(j)throw j[0]}}}))),yield Nt.wait(10);const Tt=[];Ot.forEach(r=>{r.hasAttribute("data-permanent")||(m(this,c,wt).call(this,r)?Tt.push(r):r.remove())});const Bt=m(this,c,St).call(this,w.document.body);e(this,A).morphInsideScrollContainer||m(this,c,yt).call(this,w.document),document.documentElement.setAttribute("data-current-pathname",f),document.documentElement.setAttribute("data-current-leaf",It),ot.changeHistory({action:s,pathname:f,searchParameters:bt||(b?location.search:""),hash:Y}),e(this,W).remove(),n(this,st,e(this,d)),n(this,d,f),e(this,G).forEach((r,k)=>{const y=Bt[k],_=getComputedStyle(r).getPropertyValue("--morph-duration");let z=[],j=[];S?S.forEach(u=>{const g=r.querySelector(u),M=y.querySelector(u);g&&M&&(j.push(g),z.push(M))}):(z.push(...y.childNodes),j.push(...r.childNodes)),j.forEach(u=>{u instanceof HTMLElement&&(this.destroyOldLinks(u),u.classList.add("old"))}),z.forEach(u=>{u instanceof HTMLElement&&(this.findNewLinks(u),u.classList.add("new"))}),S?z.forEach((u,g)=>{var M;(M=j[g].parentElement)==null||M.insertBefore(u,j[g])}):r.prepend(...z),Wt.requestIdleCallback(()=>{z.forEach(u=>{var g;u instanceof HTMLElement&&((g=u.parentElement)==null||g.style.setProperty("--new-content-height",u.offsetHeight+"px"),u.classList.add("in"))})});const at={morphElement:r,pathname:f};I.dispatchEvent(document,"morphNewChildrenAdded",{detail:at});const Ft=new Promise(u=>{setTimeout(()=>{j.forEach(g=>g.remove()),z.forEach(g=>{var M;g instanceof HTMLElement&&((M=g.parentElement)==null||M.style.removeProperty("--new-content-height"),g.classList.remove("in","new"))}),I.dispatchEvent(document,"morphOldChildrenRemoved",{detail:at}),u()},(parseFloat(_)||0)*1e3+10)});e(this,F).push(Ft)}),Y?(w.clearScrollState(),m(this,c,Lt).call(this,Y,{centerScroll:i,offsetScroll:h})):e(this,T)?w.restoreScrollPosition():w.renewScrollPosition(),I.dispatchEvent(document,"morphNavigationScroll",{detail:w.scrollState}),yield Promise.all(e(this,F)),Tt.forEach(r=>r.remove()),n(this,F,[]),e(this,G).forEach(r=>{r.querySelectorAll("script").forEach(y=>{const _=document.createElement("script");_.type="module",_.src=y.getAttribute("src"),y.replaceWith(_)})}),I.dispatchEvent(document,"morphComplete",{detail:dt}),window.dispatchEvent(new Event("resize"))}catch(X){console.error(X)}n(this,q,void 0)})}addLink(t){e(this,p).push(new Et(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){n(this,p,e(this,p).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){n(this,p,e(this,p).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,rt));e(this,p).push(...s.map(i=>new Et(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,rt));e(this,p).forEach(s=>s.destroy()),n(this,p,t.map(s=>new Et(s,this)))}};A=new WeakMap,G=new WeakMap,p=new WeakMap,ct=new WeakMap,q=new WeakMap,d=new WeakMap,st=new WeakMap,F=new WeakMap,T=new WeakMap,P=new WeakMap,it=new WeakMap,D=new WeakMap,W=new WeakMap,J=new WeakMap,Q=new WeakMap,rt=new WeakMap,c=new WeakSet,lt=function(t,s){return V(this,null,function*(){let i=e(this,D).get(t);return(!i||s!=null&&s.revalidate)&&(i=yield m(this,c,zt).call(this,t,s==null?void 0:s.searchParameters)),i})},zt=function(t,s){return V(this,null,function*(){const h=yield(yield fetch(`${t}${s?"?"+s:""}`)).text(),v=e(this,ct).parseFromString(h,"text/html"),b=new qt(this,t,v);return e(this,D).set(t,b),b})},St=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Vt=function(t,s){return t.filter(i=>s.find(h=>h.outerHTML===i.outerHTML))},vt=function(t,s){return t.filter(i=>!s.find(h=>h.outerHTML===i.outerHTML))},wt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},yt=function(t){var s,i;(s=e(this,P))==null||s.removeEventListener("scroll",e(this,Z)),n(this,Q,0),n(this,J,0),n(this,P,e(this,A).scrollSelector&&t.querySelector(e(this,A).scrollSelector)||window),n(this,it,e(this,P)===window),(i=e(this,P))==null||i.addEventListener("scroll",e(this,Z)),e(this,Z).call(this)},Lt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Nt.scrollToElement(i,{scrollElement:e(this,P),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ht=new WeakMap,Z=new WeakMap,tt.instance=null;let gt=tt;exports.Morph=gt;
|