aptechka 0.5.41 → 0.5.42
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-BcWwYyuC.cjs → Animation-DDHjrbtL.cjs} +1 -1
- package/lib/{Animation-BCsZmZbP.js → Animation-Dq_05jlR.js} +1 -1
- package/lib/{Damped-Ct0JVxUB.js → Damped-P4MkCGoY.js} +2 -2
- package/lib/{Damped-C9p_f19T.cjs → Damped-l0mnlhar.cjs} +1 -1
- package/lib/{Tweened-CdEuSQDX.js → Tweened-CwDC2zl8.js} +2 -2
- package/lib/{Tweened-DISO_ORE.cjs → Tweened-DIt9j9B-.cjs} +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +118 -110
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/{polyfills-mNjpy6Nt.js → polyfills-BA-CL_HF.js} +3 -3
- package/lib/polyfills-DHs2SNbz.cjs +1 -0
- package/lib/scroll/ScrollElement.d.ts +16 -5
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +542 -498
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
- package/lib/polyfills-BsJ5md2Q.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var W=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var K=(e,s,t)=>s in e?W(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,j=(e,s)=>{for(var t in s||(s={}))Z.call(s,t)&&K(e,t,s[t]);if(V)for(var t of V(s))$.call(s,t)&&K(e,t,s[t]);return e},G=(e,s)=>X(e,Y(s));var _=(e,s,t)=>{if(!s.has(e))throw TypeError("Cannot "+t)};var i=(e,s,t)=>(_(e,s,"read from private field"),t?t.call(e):s.get(e)),r=(e,s,t)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,t)},n=(e,s,t,h)=>(_(e,s,"write to private field"),h?h.call(e,t):s.set(e,t),t);var x=(e,s,t)=>(_(e,s,"access private method"),t);const L=require("./Store-C-1ruEIm.cjs"),v=require("./math-GDWEqu7y.cjs"),o=require("./polyfills-
|
|
1
|
+
"use strict";var W=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var V=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var K=(e,s,t)=>s in e?W(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,j=(e,s)=>{for(var t in s||(s={}))Z.call(s,t)&&K(e,t,s[t]);if(V)for(var t of V(s))$.call(s,t)&&K(e,t,s[t]);return e},G=(e,s)=>X(e,Y(s));var _=(e,s,t)=>{if(!s.has(e))throw TypeError("Cannot "+t)};var i=(e,s,t)=>(_(e,s,"read from private field"),t?t.call(e):s.get(e)),r=(e,s,t)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,t)},n=(e,s,t,h)=>(_(e,s,"write to private field"),h?h.call(e,t):s.set(e,t),t);var x=(e,s,t)=>(_(e,s,"access private method"),t);const L=require("./Store-C-1ruEIm.cjs"),v=require("./math-GDWEqu7y.cjs"),o=require("./polyfills-DHs2SNbz.cjs"),H=require("./ticker/index.cjs"),tt=require("./order/index.cjs");var u,m,k,y,b,q,S,w,R,J,T,Q,O,B,z,U,P;class it{constructor(s,t,h,N,E){r(this,R);r(this,T);r(this,O);r(this,z);r(this,u,void 0);r(this,m,void 0);r(this,k,void 0);r(this,y,void 0);r(this,b,!1);r(this,q,!1);r(this,S,!1);r(this,w,void 0);r(this,P,s=>{!i(this,S)&&i(this,u).initial!==i(this,u).current&&n(this,S,!0),i(this,S)&&(s.direction>0&&s.progress>=i(this,k).current?x(this,R,J).call(this):s.direction<0&&s.progress<=i(this,k).current&&x(this,T,Q).call(this))});n(this,u,s),n(this,m,t),n(this,k,new L.Store(h,{passport:t.passport?{name:t.passport+"-start",manager:{type:"number"}}:void 0})),n(this,y,new L.Store(N,{passport:t.passport?{name:t.passport+"-set",manager:{type:"number"}}:void 0})),n(this,w,E),i(this,u).subscribe(i(this,P)),i(this,u).linked.add(this)}get targetAnimation(){return i(this,m)}get triggerAnimation(){return i(this,u)}destroy(){i(this,y).close(),i(this,k).close(),i(this,u).unsubscribe(i(this,P)),i(this,u).linked.delete(this)}}u=new WeakMap,m=new WeakMap,k=new WeakMap,y=new WeakMap,b=new WeakMap,q=new WeakMap,S=new WeakMap,w=new WeakMap,R=new WeakSet,J=function(){i(this,b)||(n(this,q,!1),n(this,b,!0),x(this,O,B).call(this,i(this,y).current))},T=new WeakSet,Q=function(){i(this,b)&&!i(this,q)&&(n(this,b,!1),n(this,q,!0),x(this,O,B).call(this,i(this,m).initial))},O=new WeakSet,B=function(s){x(this,z,U).call(this),i(this,m).updateOptions(i(this,w)),i(this,m).set(s)},z=new WeakSet,U=function(){var s;(s=i(this,w))!=null&&s.once&&this.destroy()},P=new WeakMap;var C,D,M,g,A,d,p,a,c,l,f,F,I;class st extends L.Store{constructor(t,h){super(t||0,h);r(this,C,void 0);r(this,D,tt.TICK_ORDER.ANIMATION);r(this,M,void 0);r(this,g,new L.Store(!1));r(this,A,new Set);r(this,d,null);r(this,p,0);r(this,a,0);r(this,c,-1/0);r(this,l,1/0);r(this,f,0);r(this,F,1);r(this,I,t=>{this.handleAnimationFrame(t)});n(this,a,this.current)}get linked(){return i(this,A)}get animationLink(){return i(this,d)}get direction(){return i(this,p)}get target(){return i(this,a)}get min(){return i(this,c)}set min(t){n(this,c,t),this.set(i(this,a),{equalize:!0})}get max(){return i(this,l)}set max(t){n(this,l,t),this.set(i(this,a),{equalize:!0})}get from(){return i(this,f)}get to(){return i(this,F)}get isRunning(){return i(this,g)}get currentDistance(){return Math.abs(i(this,F)-i(this,f))}get distance(){return Math.abs(i(this,l)-i(this,c))}get currentProgress(){return this.currentDistance?o.preciseNumber(Math.abs(this.current-i(this,f))/this.currentDistance,6):0}get progress(){return this.distance?o.preciseNumber(Math.abs(this.current-i(this,c))/this.distance,6):0}get entry(){return G(j({},super.entry),{from:i(this,f),to:i(this,F),currentDistance:this.currentDistance,distance:this.distance,direction:this.direction,currentProgress:this.currentProgress,progress:this.progress})}setTarget(t){n(this,p,Math.sign(t-i(this,a))),n(this,a,v.clamp(t,i(this,c),i(this,l))),n(this,f,this.current),n(this,F,t)}set(t,h){i(this,a)!==t&&(this.setTarget(t),h&&this.updateOptions(h),i(this,a)!==this.current&&this.start())}shift(t,h){this.set(i(this,a)+t,h)}reset(){this.set(this.initial,{equalize:!0}),super.reset(),i(this,A).forEach(t=>{t.targetAnimation.reset()})}close(){super.close(),this.unlistenAnimationFrame(),this.unlink(),i(this,A).clear()}listenAnimationFrame(){i(this,g).current||(i(this,g).current=!0,H.ticker.subscribe(i(this,I),{maxFPS:i(this,C),order:i(this,D),culling:i(this,M)}))}unlistenAnimationFrame(){i(this,g).current&&(i(this,g).current=!1,H.ticker.unsubscribe(i(this,I)),i(this,A).forEach(t=>{t.targetAnimation.unlistenAnimationFrame()}))}updateOptions(t){n(this,C,o.nullishCoalescing(t==null?void 0:t.maxFPS,i(this,C))),n(this,D,o.nullishCoalescing(t==null?void 0:t.order,i(this,D))),n(this,M,o.nullishCoalescing(t==null?void 0:t.culling,i(this,M))),n(this,c,o.nullishCoalescing(t==null?void 0:t.min,i(this,c))),n(this,l,o.nullishCoalescing(t==null?void 0:t.max,i(this,l))),t!=null&&t.equalize&&(this.unlistenAnimationFrame(),this.current=i(this,a))}linkTo(t,h,N,E){this.unlink(),n(this,d,new it(t,this,h,N,E))}unlink(){i(this,d)&&(i(this,d).destroy(),n(this,d,null))}start(){this.listenAnimationFrame()}}C=new WeakMap,D=new WeakMap,M=new WeakMap,g=new WeakMap,A=new WeakMap,d=new WeakMap,p=new WeakMap,a=new WeakMap,c=new WeakMap,l=new WeakMap,f=new WeakMap,F=new WeakMap,I=new WeakMap;exports.Animation=st;
|
|
@@ -22,7 +22,7 @@ var i = (e, s, t) => (C(e, s, "read from private field"), t ? t.call(e) : s.get(
|
|
|
22
22
|
var F = (e, s, t) => (C(e, s, "access private method"), t);
|
|
23
23
|
import { S as T } from "./Store-BQXXikps.js";
|
|
24
24
|
import { c as tt } from "./math-BOBiC4TN.js";
|
|
25
|
-
import { p as H, n as P } from "./polyfills-
|
|
25
|
+
import { p as H, n as P } from "./polyfills-BA-CL_HF.js";
|
|
26
26
|
import { ticker as J } from "./ticker/index.js";
|
|
27
27
|
import { TICK_ORDER as it } from "./order/index.js";
|
|
28
28
|
var u, l, o, p, b, x, y, w, q, Q, z, U, S, V, E, W, I;
|
|
@@ -20,8 +20,8 @@ var r = (e, s, t) => (p(e, s, "read from private field"), t ? t.call(e) : s.get(
|
|
|
20
20
|
s instanceof WeakSet ? s.add(e) : s.set(e, t);
|
|
21
21
|
}, n = (e, s, t, a) => (p(e, s, "write to private field"), a ? a.call(e, t) : s.set(e, t), t);
|
|
22
22
|
import { d as B } from "./math-BOBiC4TN.js";
|
|
23
|
-
import { n as f, p as y } from "./polyfills-
|
|
24
|
-
import { A as D } from "./Animation-
|
|
23
|
+
import { n as f, p as y } from "./polyfills-BA-CL_HF.js";
|
|
24
|
+
import { A as D } from "./Animation-Dq_05jlR.js";
|
|
25
25
|
var i, h;
|
|
26
26
|
class N extends D {
|
|
27
27
|
constructor(t, a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var A=Object.defineProperty,F=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var f=(e,s,t)=>s in e?A(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,m=(e,s)=>{for(var t in s||(s={}))v.call(s,t)&&f(e,t,s[t]);if(g)for(var t of g(s))C.call(s,t)&&f(e,t,s[t]);return e},l=(e,s)=>F(e,b(s));var p=(e,s,t)=>{if(!s.has(e))throw TypeError("Cannot "+t)};var r=(e,s,t)=>(p(e,s,"read from private field"),t?t.call(e):s.get(e)),d=(e,s,t)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,t)},n=(e,s,t,a)=>(p(e,s,"write to private field"),a?a.call(e,t):s.set(e,t),t);const O=require("./math-GDWEqu7y.cjs"),u=require("./polyfills-
|
|
1
|
+
"use strict";var A=Object.defineProperty,F=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var f=(e,s,t)=>s in e?A(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,m=(e,s)=>{for(var t in s||(s={}))v.call(s,t)&&f(e,t,s[t]);if(g)for(var t of g(s))C.call(s,t)&&f(e,t,s[t]);return e},l=(e,s)=>F(e,b(s));var p=(e,s,t)=>{if(!s.has(e))throw TypeError("Cannot "+t)};var r=(e,s,t)=>(p(e,s,"read from private field"),t?t.call(e):s.get(e)),d=(e,s,t)=>{if(s.has(e))throw TypeError("Cannot add the same private member more than once");s instanceof WeakSet?s.add(e):s.set(e,t)},n=(e,s,t,a)=>(p(e,s,"write to private field"),a?a.call(e,t):s.set(e,t),t);const O=require("./math-GDWEqu7y.cjs"),u=require("./polyfills-DHs2SNbz.cjs"),w=require("./Animation-DDHjrbtL.cjs");var i,h;class B extends w.Animation{constructor(t,a){super(t,a);d(this,i,void 0);d(this,h,void 0);this.damping=20,this.stiffness=0,this.mass=0,n(this,i,0),n(this,h,0),this.updateOptions(l(m({},a),{equalize:!0}))}get velocity(){return r(this,i)}get speed(){return r(this,h)}get entry(){return l(m({},super.entry),{velocity:r(this,i),speed:r(this,h)})}updateOptions(t){this.damping=u.nullishCoalescing(t==null?void 0:t.damping,this.damping),this.mass=u.nullishCoalescing(t==null?void 0:t.mass,this.mass),this.stiffness=u.nullishCoalescing(t==null?void 0:t.stiffness,this.stiffness),super.updateOptions(t)}updateManually(t){this.setTarget(t),this.current=this.target}handleAnimationFrame(t){u.preciseNumber(this.current,4)===u.preciseNumber(this.target,4)&&(this.unlistenAnimationFrame(),this.current=this.target);const a=this.current,y=Math.abs(a-this.target);n(this,h,y/t.timeBetweenFrames);const c=t.timeBetweenFrames/1e3;if(this.mass||this.stiffness){const q=(this.target-this.current)*this.stiffness-r(this,i)*this.damping;n(this,i,r(this,i)+q/this.mass*c),this.current+=r(this,i)*c}else this.current=O.damp(this.current,this.target,this.damping,c)}}i=new WeakMap,h=new WeakMap;exports.Damped=B;
|
|
@@ -21,8 +21,8 @@ var n = (i, e, t) => (f(i, e, "read from private field"), t ? t.call(i) : e.get(
|
|
|
21
21
|
}, u = (i, e, t, a) => (f(i, e, "write to private field"), a ? a.call(i, t) : e.set(i, t), t);
|
|
22
22
|
import { l as y } from "./easings-BKi40vHz.js";
|
|
23
23
|
import { c as M } from "./math-BOBiC4TN.js";
|
|
24
|
-
import { n as A, p as S } from "./polyfills-
|
|
25
|
-
import { A as T } from "./Animation-
|
|
24
|
+
import { n as A, p as S } from "./polyfills-BA-CL_HF.js";
|
|
25
|
+
import { A as T } from "./Animation-Dq_05jlR.js";
|
|
26
26
|
var r, s;
|
|
27
27
|
class N extends T {
|
|
28
28
|
constructor(t, a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var q=Object.defineProperty,F=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var m=(t,i,e)=>i in t?q(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,d=(t,i)=>{for(var e in i||(i={}))O.call(i,e)&&m(t,e,i[e]);if(c)for(var e of c(i))b.call(i,e)&&m(t,e,i[e]);return t},A=(t,i)=>F(t,y(i));var f=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var n=(t,i,e)=>(f(t,i,"read from private field"),e?e.call(t):i.get(t)),u=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},l=(t,i,e,a)=>(f(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);const w=require("./easings-DsS5-Kqc.cjs"),C=require("./math-GDWEqu7y.cjs"),h=require("./polyfills-
|
|
1
|
+
"use strict";var q=Object.defineProperty,F=Object.defineProperties;var y=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var m=(t,i,e)=>i in t?q(t,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[i]=e,d=(t,i)=>{for(var e in i||(i={}))O.call(i,e)&&m(t,e,i[e]);if(c)for(var e of c(i))b.call(i,e)&&m(t,e,i[e]);return t},A=(t,i)=>F(t,y(i));var f=(t,i,e)=>{if(!i.has(t))throw TypeError("Cannot "+e)};var n=(t,i,e)=>(f(t,i,"read from private field"),e?e.call(t):i.get(t)),u=(t,i,e)=>{if(i.has(t))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(t):i.set(t,e)},l=(t,i,e,a)=>(f(t,i,"write to private field"),a?a.call(t,e):i.set(t,e),e);const w=require("./easings-DsS5-Kqc.cjs"),C=require("./math-GDWEqu7y.cjs"),h=require("./polyfills-DHs2SNbz.cjs"),M=require("./Animation-DDHjrbtL.cjs");var r,s;class S extends M.Animation{constructor(e,a){super(e||0,a);u(this,r,w.linear);u(this,s,1e3);this.updateOptions(A(d({},a),{equalize:!0}))}updateOptions(e){super.updateOptions(e),l(this,r,h.nullishCoalescing(e==null?void 0:e.easing,n(this,r))),l(this,s,h.nullishCoalescing(e==null?void 0:e.duration,n(this,s))),e!=null&&e.restart&&(this.current=this.initial)}updateManually(e){const a=e/1e3/(n(this,s)/1e3),g=n(this,r).call(this,C.clamp(a,0,1));return this.current=h.preciseNumber(this.from+(this.to-this.from)*g,6),a}handleAnimationFrame(e){this.updateManually(e.timeElapsedSinceSubscription)>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}r=new WeakMap,s=new WeakMap;exports.Tweened=S;
|
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-DDHjrbtL.cjs"),n=require("../Damped-l0mnlhar.cjs"),i=require("../Tweened-DIt9j9B-.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-Dq_05jlR.js";
|
|
2
|
+
import { D as m } from "../Damped-P4MkCGoY.js";
|
|
3
|
+
import { T as t } from "../Tweened-CwDC2zl8.js";
|
|
4
4
|
export {
|
|
5
5
|
r as Animation,
|
|
6
6
|
m as Damped,
|
package/lib/controls/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var N=(r,n,e)=>{if(!n.has(r))throw TypeError("Cannot "+e)};var t=(r,n,e)=>(N(r,n,"read from private field"),e?e.call(r):n.get(r)),s=(r,n,e)=>{if(n.has(r))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(r):n.set(r,e)},i=(r,n,e,a)=>(N(r,n,"write to private field"),a?a.call(r,e):n.set(r,e),e);var L=(r,n,e)=>(N(r,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("../notifier/index.cjs"),m=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-JBOkFLTh.cjs"),M=require("../ticker/index.cjs");require("../Store-C-1ruEIm.cjs");const G=require("../easings-DsS5-Kqc.cjs"),J=require("../Tweened-DIt9j9B-.cjs"),Z=require("../gestures-DHLrn6Q8.cjs"),$=require("../polyfills-DHs2SNbz.cjs"),_=require("../order/index.cjs");var z;class R{constructor(){s(this,z,new V.Notifier)}get changeEvent(){return t(this,z)}}z=new WeakMap;var o,d,u,D;class p extends R{constructor(e){super();s(this,o,null);s(this,d,null);s(this,u,"offsetHeight");s(this,D,e=>{const a=e.shiftKey?-1:1;let h;e.code==="Space"?h=a*t(this,d)[t(this,u)]*.4:e.code==="ArrowLeft"?h=-1*t(this,d)[t(this,u)]*.2:e.code==="ArrowRight"?h=1*t(this,d)[t(this,u)]*.2:e.code==="ArrowUp"?h=-1*t(this,d)[t(this,u)]*.2:e.code==="ArrowDown"?h=1*t(this,d)[t(this,u)]*.2:e.code==="PageUp"?h=-1*t(this,d)[t(this,u)]:e.code==="PageDown"?h=1*t(this,d)[t(this,u)]:e.code==="Home"?h=0:e.code==="End"&&(h=t(this,u)==="offsetWidth"?t(this,d).scrollWidth:t(this,d).scrollHeight),h&&(e.stopPropagation(),this.changeEvent.notify("keyboard",h))});m.isBrowser&&(i(this,o,e!=null&&e.element&&Q.getElement(e.element)||window),i(this,d,t(this,o)instanceof HTMLElement?t(this,o):document.documentElement),this.dimension=e==null?void 0:e.dimension)}set dimension(e){i(this,u,e==="width"?"offsetWidth":"offsetHeight")}connect(){m.isBrowser&&t(this,o).addEventListener("keydown",t(this,D))}disconnect(){m.isBrowser&&t(this,o).removeEventListener("keydown",t(this,D))}}o=new WeakMap,d=new WeakMap,u=new WeakMap,D=new WeakMap;var w,y,H,P,l,k,f,C,S,W,U,q,X,B;class ee extends R{constructor(e){super();s(this,C);s(this,W);s(this,w,void 0);s(this,y,void 0);s(this,H,void 0);s(this,P,void 0);s(this,l,void 0);s(this,k,void 0);s(this,f,void 0);s(this,q,void 0);s(this,X,void 0);s(this,B,void 0);this.direction=1,i(this,l,new J.Tweened(0,{easing:G.easeInQuad})),i(this,f,!1),i(this,q,a=>{t(this,l).current!==1&&this.changeEvent.notify("autoplay",a.timeBetweenFrames*t(this,w)*this.direction*(1-t(this,l).current))}),i(this,X,()=>{t(this,l).current!==1&&this.changeEvent.notify("autoplay",Math.sign(t(this,w))*this.direction*(1-t(this,l).current))}),i(this,B,()=>{t(this,y)&&(document.hidden?t(this,l).set(1,{equalize:!0}):t(this,l).set(0,{equalize:!0}))}),i(this,w,(e==null?void 0:e.speed)||1),i(this,y,(e==null?void 0:e.interval)||!1),i(this,H,e)}set interval(e){i(this,y,e),t(this,f)&&L(this,C,S).call(this)}set speed(e){i(this,w,e),t(this,f)&&L(this,C,S).call(this)}connect(){t(this,f)||(i(this,f,!0),L(this,C,S).call(this))}disconnect(){t(this,f)&&(i(this,f,!1),L(this,W,U).call(this))}pauseAndContinue(e){e&&!t(this,l).target&&(clearInterval(t(this,k)),t(this,l).set(1,{duration:Math.min(e,1e3)}),i(this,k,setTimeout(()=>{t(this,l).set(0,{duration:Math.min(e,5e3)})},e)))}}w=new WeakMap,y=new WeakMap,H=new WeakMap,P=new WeakMap,l=new WeakMap,k=new WeakMap,f=new WeakMap,C=new WeakSet,S=function(){L(this,W,U).call(this),t(this,y)?i(this,P,setInterval(t(this,X),Math.abs(t(this,w)))):M.ticker.subscribe(t(this,q),t(this,H)),document.addEventListener("visibilitychange",t(this,B))},W=new WeakSet,U=function(){clearInterval(t(this,P)),M.ticker.unsubscribe(t(this,q)),clearInterval(t(this,k)),t(this,l).close(),document.removeEventListener("visibilitychange",t(this,B))},q=new WeakMap,X=new WeakMap,B=new WeakMap;var T,E,I,Y;class te extends R{constructor(e){super();s(this,T,null);s(this,E,void 0);s(this,I,void 0);s(this,Y,e=>{let a=0;if(e.preventDefault(),!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*.5||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*.5))if(a=(this.axis==="max"?Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY:this.axis==="x"?e.deltaX:e.deltaY)*this.speed,e.stopPropagation(),this.debounce){const h=Date.now();if(h-t(this,I)>40&&(a=100*Math.sign(a)),i(this,I,h),Math.abs(a)<100||t(this,E))return;this.changeEvent.notify("wheel",a),i(this,E,setTimeout(()=>{i(this,E,void 0)},80))}else this.changeEvent.notify("wheel",a)});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,I,Date.now()),m.isBrowser&&i(this,T,e!=null&&e.element&&Q.getElement(e.element)||window)}connect(){m.isBrowser&&t(this,T).addEventListener("wheel",t(this,Y),{passive:!1})}disconnect(){m.isBrowser&&(t(this,T).removeEventListener("wheel",t(this,Y)),clearTimeout(t(this,E)))}}T=new WeakMap,E=new WeakMap,I=new WeakMap,Y=new WeakMap;var x,b,A,c,K,v;const g=class g extends R{constructor(e){super();s(this,b,null);s(this,A,!1);s(this,c,0);s(this,K,e=>{if(e.composedPath().find(h=>h instanceof HTMLElement&&h.hasAttribute("drag-dead-zone")))return;this.swipe||M.ticker.unsubscribe(t(this,v));let a=e;i(this,c,0),document.documentElement.classList.add("grabbing"),Z.setupDrag(h=>{if(t(this,A)||t(g,x)&&t(g,x)!==t(this,b))return;this.swipe&&i(this,A,!0);const O=a.x-h.x,F=a.y-h.y;this.axis==="x"?i(this,c,O):i(this,c,F),a=h,(this.axis==="x"&&Math.abs(O)>Math.abs(F)||this.axis==="y"&&Math.abs(F)>Math.abs(O))&&(i(g,x,t(this,b)),this.changeEvent.notify("drag",t(this,c)))},()=>{i(g,x,null),this.swipe||(i(this,c,t(this,c)*3),M.ticker.subscribe(t(this,v),{order:_.TICK_ORDER.SCROLL-1})),document.documentElement.classList.remove("grabbing"),i(this,A,!1)})});s(this,v,()=>{Math.floor(t(this,c))||M.ticker.unsubscribe(t(this,v)),i(this,c,t(this,c)*.95),i(this,c,$.preciseNumber(t(this,c),3)),this.changeEvent.notify("drag",t(this,c))});this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,m.isBrowser&&i(this,b,e!=null&&e.element&&Q.getElement(e.element)||document.documentElement)}connect(){m.isBrowser&&t(this,b).addEventListener("pointerdown",t(this,K))}disconnect(){m.isBrowser&&(t(this,b).removeEventListener("pointerdown",t(this,K)),M.ticker.unsubscribe(t(this,v)))}};x=new WeakMap,b=new WeakMap,A=new WeakMap,c=new WeakMap,K=new WeakMap,v=new WeakMap,s(g,x,null);let j=g;exports.AutoplayControls=ee;exports.Controls=R;exports.DragControls=j;exports.KeyboardControls=p;exports.WheelControls=te;
|
package/lib/controls/index.js
CHANGED
|
@@ -1,205 +1,213 @@
|
|
|
1
|
-
var
|
|
2
|
-
if (!
|
|
1
|
+
var S = (a, n, e) => {
|
|
2
|
+
if (!n.has(a))
|
|
3
3
|
throw TypeError("Cannot " + e);
|
|
4
4
|
};
|
|
5
|
-
var t = (a,
|
|
6
|
-
if (
|
|
5
|
+
var t = (a, n, e) => (S(a, n, "read from private field"), e ? e.call(a) : n.get(a)), s = (a, n, e) => {
|
|
6
|
+
if (n.has(a))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
|
-
|
|
9
|
-
}, i = (a,
|
|
10
|
-
|
|
8
|
+
n instanceof WeakSet ? n.add(a) : n.set(a, e);
|
|
9
|
+
}, i = (a, n, e, r) => (S(a, n, "write to private field"), r ? r.call(a, e) : n.set(a, e), e);
|
|
10
|
+
var L = (a, n, e) => (S(a, n, "access private method"), e);
|
|
11
|
+
import { Notifier as j } from "../notifier/index.js";
|
|
11
12
|
import { i as m } from "../browser-0zX67oeU.js";
|
|
12
|
-
import { g as
|
|
13
|
-
import { ticker as
|
|
13
|
+
import { g as Q } from "../dom-0S_WDL4g.js";
|
|
14
|
+
import { ticker as M } from "../ticker/index.js";
|
|
14
15
|
import "../Store-BQXXikps.js";
|
|
15
|
-
import {
|
|
16
|
-
import { T as
|
|
17
|
-
import { s as
|
|
18
|
-
import { p as
|
|
19
|
-
import { TICK_ORDER as
|
|
20
|
-
var
|
|
21
|
-
class
|
|
16
|
+
import { e as G } from "../easings-BKi40vHz.js";
|
|
17
|
+
import { T as J } from "../Tweened-CwDC2zl8.js";
|
|
18
|
+
import { s as Z } from "../gestures-D2Fdra_G.js";
|
|
19
|
+
import { p as $ } from "../polyfills-BA-CL_HF.js";
|
|
20
|
+
import { TICK_ORDER as p } from "../order/index.js";
|
|
21
|
+
var B;
|
|
22
|
+
class F {
|
|
22
23
|
constructor() {
|
|
23
|
-
s(this,
|
|
24
|
+
s(this, B, new j());
|
|
24
25
|
}
|
|
25
26
|
get changeEvent() {
|
|
26
|
-
return t(this,
|
|
27
|
+
return t(this, B);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
class
|
|
30
|
+
B = new WeakMap();
|
|
31
|
+
var w, c, f, P;
|
|
32
|
+
class ce extends F {
|
|
32
33
|
constructor(e) {
|
|
33
34
|
super();
|
|
34
|
-
s(this,
|
|
35
|
-
s(this,
|
|
35
|
+
s(this, w, null);
|
|
36
|
+
s(this, c, null);
|
|
36
37
|
s(this, f, "offsetHeight");
|
|
37
|
-
s(this,
|
|
38
|
-
const
|
|
38
|
+
s(this, P, (e) => {
|
|
39
|
+
const r = e.shiftKey ? -1 : 1;
|
|
39
40
|
let h;
|
|
40
|
-
e.code === "Space" ? h =
|
|
41
|
+
e.code === "Space" ? h = r * t(this, c)[t(this, f)] * 0.4 : e.code === "ArrowLeft" ? h = -1 * t(this, c)[t(this, f)] * 0.2 : e.code === "ArrowRight" ? h = 1 * t(this, c)[t(this, f)] * 0.2 : e.code === "ArrowUp" ? h = -1 * t(this, c)[t(this, f)] * 0.2 : e.code === "ArrowDown" ? h = 1 * t(this, c)[t(this, f)] * 0.2 : e.code === "PageUp" ? h = -1 * t(this, c)[t(this, f)] : e.code === "PageDown" ? h = 1 * t(this, c)[t(this, f)] : e.code === "Home" ? h = 0 : e.code === "End" && (h = t(this, f) === "offsetWidth" ? t(this, c).scrollWidth : t(this, c).scrollHeight), h && (e.stopPropagation(), this.changeEvent.notify("keyboard", h));
|
|
41
42
|
});
|
|
42
|
-
m && (i(this,
|
|
43
|
+
m && (i(this, w, e != null && e.element && Q(e.element) || window), i(this, c, t(this, w) instanceof HTMLElement ? t(this, w) : document.documentElement), this.dimension = e == null ? void 0 : e.dimension);
|
|
43
44
|
}
|
|
44
45
|
set dimension(e) {
|
|
45
46
|
i(this, f, e === "width" ? "offsetWidth" : "offsetHeight");
|
|
46
47
|
}
|
|
47
48
|
connect() {
|
|
48
|
-
m && t(this,
|
|
49
|
+
m && t(this, w).addEventListener(
|
|
49
50
|
"keydown",
|
|
50
|
-
t(this,
|
|
51
|
+
t(this, P)
|
|
51
52
|
);
|
|
52
53
|
}
|
|
53
54
|
disconnect() {
|
|
54
|
-
m && t(this,
|
|
55
|
+
m && t(this, w).removeEventListener(
|
|
55
56
|
"keydown",
|
|
56
|
-
t(this,
|
|
57
|
+
t(this, P)
|
|
57
58
|
);
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
var
|
|
62
|
-
class
|
|
61
|
+
w = new WeakMap(), c = new WeakMap(), f = new WeakMap(), P = new WeakMap();
|
|
62
|
+
var b, E, X, Y, l, I, u, T, q, R, U, k, W, C;
|
|
63
|
+
class fe extends F {
|
|
63
64
|
constructor(e) {
|
|
64
65
|
super();
|
|
65
|
-
s(this,
|
|
66
|
-
s(this,
|
|
67
|
-
s(this,
|
|
68
|
-
s(this,
|
|
66
|
+
s(this, T);
|
|
67
|
+
s(this, R);
|
|
68
|
+
s(this, b, void 0);
|
|
69
|
+
s(this, E, void 0);
|
|
70
|
+
s(this, X, void 0);
|
|
71
|
+
s(this, Y, void 0);
|
|
69
72
|
s(this, l, void 0);
|
|
70
|
-
s(this, L, void 0);
|
|
71
|
-
s(this, M, void 0);
|
|
72
|
-
s(this, P, void 0);
|
|
73
73
|
s(this, I, void 0);
|
|
74
|
-
|
|
74
|
+
s(this, u, void 0);
|
|
75
|
+
s(this, k, void 0);
|
|
76
|
+
s(this, W, void 0);
|
|
77
|
+
s(this, C, void 0);
|
|
78
|
+
this.direction = 1, i(this, l, new J(0, { easing: G })), i(this, u, !1), i(this, k, (r) => {
|
|
75
79
|
t(this, l).current !== 1 && this.changeEvent.notify(
|
|
76
80
|
"autoplay",
|
|
77
|
-
|
|
81
|
+
r.timeBetweenFrames * t(this, b) * this.direction * (1 - t(this, l).current)
|
|
78
82
|
);
|
|
79
|
-
}), i(this,
|
|
83
|
+
}), i(this, W, () => {
|
|
80
84
|
t(this, l).current !== 1 && this.changeEvent.notify(
|
|
81
85
|
"autoplay",
|
|
82
|
-
Math.sign(t(this,
|
|
86
|
+
Math.sign(t(this, b)) * this.direction * (1 - t(this, l).current)
|
|
83
87
|
);
|
|
84
|
-
}), i(this,
|
|
85
|
-
t(this,
|
|
86
|
-
}), i(this,
|
|
88
|
+
}), i(this, C, () => {
|
|
89
|
+
t(this, E) && (document.hidden ? t(this, l).set(1, { equalize: !0 }) : t(this, l).set(0, { equalize: !0 }));
|
|
90
|
+
}), i(this, b, (e == null ? void 0 : e.speed) || 1), i(this, E, (e == null ? void 0 : e.interval) || !1), i(this, X, e);
|
|
87
91
|
}
|
|
88
92
|
set interval(e) {
|
|
89
|
-
i(this,
|
|
93
|
+
i(this, E, e), t(this, u) && L(this, T, q).call(this);
|
|
90
94
|
}
|
|
91
95
|
set speed(e) {
|
|
92
|
-
i(this,
|
|
96
|
+
i(this, b, e), t(this, u) && L(this, T, q).call(this);
|
|
93
97
|
}
|
|
94
98
|
connect() {
|
|
95
|
-
|
|
96
|
-
t(this, P),
|
|
97
|
-
Math.abs(t(this, o))
|
|
98
|
-
)) : x.subscribe(t(this, M), t(this, D)), document.addEventListener(
|
|
99
|
-
"visibilitychange",
|
|
100
|
-
t(this, I)
|
|
101
|
-
);
|
|
99
|
+
t(this, u) || (i(this, u, !0), L(this, T, q).call(this));
|
|
102
100
|
}
|
|
103
101
|
disconnect() {
|
|
104
|
-
|
|
105
|
-
"visibilitychange",
|
|
106
|
-
t(this, I)
|
|
107
|
-
);
|
|
102
|
+
t(this, u) && (i(this, u, !1), L(this, R, U).call(this));
|
|
108
103
|
}
|
|
109
104
|
pauseAndContinue(e) {
|
|
110
|
-
e && !t(this, l).target && (clearInterval(t(this,
|
|
105
|
+
e && !t(this, l).target && (clearInterval(t(this, I)), t(this, l).set(1, { duration: Math.min(e, 1e3) }), i(this, I, setTimeout(() => {
|
|
111
106
|
t(this, l).set(0, { duration: Math.min(e, 5e3) });
|
|
112
107
|
}, e)));
|
|
113
108
|
}
|
|
114
109
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
b = new WeakMap(), E = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), l = new WeakMap(), I = new WeakMap(), u = new WeakMap(), T = new WeakSet(), q = function() {
|
|
111
|
+
L(this, R, U).call(this), t(this, E) ? i(this, Y, setInterval(
|
|
112
|
+
t(this, W),
|
|
113
|
+
Math.abs(t(this, b))
|
|
114
|
+
)) : M.subscribe(t(this, k), t(this, X)), document.addEventListener(
|
|
115
|
+
"visibilitychange",
|
|
116
|
+
t(this, C)
|
|
117
|
+
);
|
|
118
|
+
}, R = new WeakSet(), U = function() {
|
|
119
|
+
clearInterval(t(this, Y)), M.unsubscribe(t(this, k)), clearInterval(t(this, I)), t(this, l).close(), document.removeEventListener(
|
|
120
|
+
"visibilitychange",
|
|
121
|
+
t(this, C)
|
|
122
|
+
);
|
|
123
|
+
}, k = new WeakMap(), W = new WeakMap(), C = new WeakMap();
|
|
124
|
+
var A, y, D, z;
|
|
125
|
+
class ue extends F {
|
|
118
126
|
constructor(e) {
|
|
119
127
|
super();
|
|
120
|
-
s(this,
|
|
121
|
-
s(this,
|
|
122
|
-
s(this,
|
|
123
|
-
s(this,
|
|
124
|
-
let
|
|
128
|
+
s(this, A, null);
|
|
129
|
+
s(this, y, void 0);
|
|
130
|
+
s(this, D, void 0);
|
|
131
|
+
s(this, z, (e) => {
|
|
132
|
+
let r = 0;
|
|
125
133
|
if (e.preventDefault(), !(this.axis === "x" && Math.abs(e.deltaY) > Math.abs(e.deltaX) * 0.5 || this.axis === "y" && Math.abs(e.deltaX) > Math.abs(e.deltaY) * 0.5))
|
|
126
|
-
if (
|
|
134
|
+
if (r = (this.axis === "max" ? Math.abs(e.deltaX) > Math.abs(e.deltaY) ? e.deltaX : e.deltaY : this.axis === "x" ? e.deltaX : e.deltaY) * this.speed, e.stopPropagation(), this.debounce) {
|
|
127
135
|
const h = Date.now();
|
|
128
|
-
if (h - t(this,
|
|
136
|
+
if (h - t(this, D) > 40 && (r = 100 * Math.sign(r)), i(this, D, h), Math.abs(r) < 100 || t(this, y))
|
|
129
137
|
return;
|
|
130
|
-
this.changeEvent.notify("wheel",
|
|
131
|
-
i(this,
|
|
138
|
+
this.changeEvent.notify("wheel", r), i(this, y, setTimeout(() => {
|
|
139
|
+
i(this, y, void 0);
|
|
132
140
|
}, 80));
|
|
133
141
|
} else
|
|
134
|
-
this.changeEvent.notify("wheel",
|
|
142
|
+
this.changeEvent.notify("wheel", r);
|
|
135
143
|
});
|
|
136
|
-
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,
|
|
144
|
+
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, D, Date.now()), m && i(this, A, e != null && e.element && Q(e.element) || window);
|
|
137
145
|
}
|
|
138
146
|
connect() {
|
|
139
|
-
m && t(this,
|
|
147
|
+
m && t(this, A).addEventListener(
|
|
140
148
|
"wheel",
|
|
141
|
-
t(this,
|
|
149
|
+
t(this, z),
|
|
142
150
|
{
|
|
143
151
|
passive: !1
|
|
144
152
|
}
|
|
145
153
|
);
|
|
146
154
|
}
|
|
147
155
|
disconnect() {
|
|
148
|
-
m && (t(this,
|
|
156
|
+
m && (t(this, A).removeEventListener(
|
|
149
157
|
"wheel",
|
|
150
|
-
t(this,
|
|
151
|
-
), clearTimeout(t(this,
|
|
158
|
+
t(this, z)
|
|
159
|
+
), clearTimeout(t(this, y)));
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
|
-
|
|
155
|
-
var
|
|
156
|
-
const
|
|
162
|
+
A = new WeakMap(), y = new WeakMap(), D = new WeakMap(), z = new WeakMap();
|
|
163
|
+
var v, o, H, d, K, x;
|
|
164
|
+
const g = class g extends F {
|
|
157
165
|
constructor(e) {
|
|
158
166
|
super();
|
|
159
|
-
s(this,
|
|
160
|
-
s(this,
|
|
161
|
-
s(this,
|
|
162
|
-
s(this,
|
|
167
|
+
s(this, o, null);
|
|
168
|
+
s(this, H, !1);
|
|
169
|
+
s(this, d, 0);
|
|
170
|
+
s(this, K, (e) => {
|
|
163
171
|
if (e.composedPath().find(
|
|
164
172
|
(h) => h instanceof HTMLElement && h.hasAttribute("drag-dead-zone")
|
|
165
173
|
))
|
|
166
174
|
return;
|
|
167
|
-
this.swipe ||
|
|
168
|
-
let
|
|
169
|
-
i(this,
|
|
175
|
+
this.swipe || M.unsubscribe(t(this, x));
|
|
176
|
+
let r = e;
|
|
177
|
+
i(this, d, 0), document.documentElement.classList.add("grabbing"), Z(
|
|
170
178
|
(h) => {
|
|
171
|
-
if (t(this,
|
|
179
|
+
if (t(this, H) || t(g, v) && t(g, v) !== t(this, o))
|
|
172
180
|
return;
|
|
173
|
-
this.swipe && i(this,
|
|
174
|
-
const
|
|
175
|
-
this.axis === "x" ? i(this,
|
|
181
|
+
this.swipe && i(this, H, !0);
|
|
182
|
+
const N = r.x - h.x, O = r.y - h.y;
|
|
183
|
+
this.axis === "x" ? i(this, d, N) : i(this, d, O), r = h, (this.axis === "x" && Math.abs(N) > Math.abs(O) || this.axis === "y" && Math.abs(O) > Math.abs(N)) && (i(g, v, t(this, o)), this.changeEvent.notify("drag", t(this, d)));
|
|
176
184
|
},
|
|
177
185
|
() => {
|
|
178
|
-
i(
|
|
186
|
+
i(g, v, null), this.swipe || (i(this, d, t(this, d) * 3), M.subscribe(t(this, x), { order: p.SCROLL - 1 })), document.documentElement.classList.remove("grabbing"), i(this, H, !1);
|
|
179
187
|
}
|
|
180
188
|
);
|
|
181
189
|
});
|
|
182
|
-
s(this,
|
|
183
|
-
Math.floor(t(this,
|
|
190
|
+
s(this, x, () => {
|
|
191
|
+
Math.floor(t(this, d)) || M.unsubscribe(t(this, x)), i(this, d, t(this, d) * 0.95), i(this, d, $(t(this, d), 3)), this.changeEvent.notify("drag", t(this, d));
|
|
184
192
|
});
|
|
185
|
-
this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, m && i(this,
|
|
193
|
+
this.axis = (e == null ? void 0 : e.axis) || "y", this.swipe = (e == null ? void 0 : e.swipe) || !1, m && i(this, o, e != null && e.element && Q(e.element) || document.documentElement);
|
|
186
194
|
}
|
|
187
195
|
connect() {
|
|
188
|
-
m && t(this,
|
|
196
|
+
m && t(this, o).addEventListener("pointerdown", t(this, K));
|
|
189
197
|
}
|
|
190
198
|
disconnect() {
|
|
191
|
-
m && (t(this,
|
|
199
|
+
m && (t(this, o).removeEventListener(
|
|
192
200
|
"pointerdown",
|
|
193
|
-
t(this,
|
|
194
|
-
),
|
|
201
|
+
t(this, K)
|
|
202
|
+
), M.unsubscribe(t(this, x)));
|
|
195
203
|
}
|
|
196
204
|
};
|
|
197
|
-
|
|
198
|
-
let
|
|
205
|
+
v = new WeakMap(), o = new WeakMap(), H = new WeakMap(), d = new WeakMap(), K = new WeakMap(), x = new WeakMap(), s(g, v, null);
|
|
206
|
+
let V = g;
|
|
199
207
|
export {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
208
|
+
fe as AutoplayControls,
|
|
209
|
+
F as Controls,
|
|
210
|
+
V as DragControls,
|
|
211
|
+
ce as KeyboardControls,
|
|
212
|
+
ue as WheelControls
|
|
205
213
|
};
|
package/lib/en3/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Fs=Object.defineProperty,Gs=Object.defineProperties;var ms=Object.getOwnPropertyDescriptors;var bt=Object.getOwnPropertySymbols;var Rs=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable;var Nt=(C,A,e)=>A in C?Fs(C,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):C[A]=e,eA=(C,A)=>{for(var e in A||(A={}))Rs.call(A,e)&&Nt(C,e,A[e]);if(bt)for(var e of bt(A))ws.call(A,e)&&Nt(C,e,A[e]);return C},Fe=(C,A)=>Gs(C,ms(A));var at=(C,A,e)=>{if(!A.has(C))throw TypeError("Cannot "+e)};var o=(C,A,e)=>(at(C,A,"read from private field"),e?e.call(C):A.get(C)),d=(C,A,e)=>{if(A.has(C))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(C):A.set(C,e)},D=(C,A,e,s)=>(at(C,A,"write to private field"),s?s.call(C,e):A.set(C,e),e);var tA=(C,A,e)=>(at(C,A,"access private method"),e);var YA=(C,A,e)=>new Promise((s,t)=>{var n=r=>{try{a(e.next(r))}catch(I){t(I)}},i=r=>{try{a(e.throw(r))}catch(I){t(I)}},a=r=>r.done?s(r.value):Promise.resolve(r.value).then(n,i);a((e=e.apply(C,A)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("../order/index.cjs"),wA=require("../window-resizer/index.cjs"),yA=require("../ticker/index.cjs"),Zt=require("../dom-JBOkFLTh.cjs"),B=require("three"),mt=require("../layout-box/index.cjs"),Ct=require("../loading/index.cjs"),ys=require("../SourceManager-vSlsMKUE.cjs"),J=require("../Store-C-1ruEIm.cjs"),Ms=require("../easings-DsS5-Kqc.cjs"),Ss=require("../function-MthRj-GJ.cjs"),Ls=require("../Tweened-
|
|
1
|
+
"use strict";var Fs=Object.defineProperty,Gs=Object.defineProperties;var ms=Object.getOwnPropertyDescriptors;var bt=Object.getOwnPropertySymbols;var Rs=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable;var Nt=(C,A,e)=>A in C?Fs(C,A,{enumerable:!0,configurable:!0,writable:!0,value:e}):C[A]=e,eA=(C,A)=>{for(var e in A||(A={}))Rs.call(A,e)&&Nt(C,e,A[e]);if(bt)for(var e of bt(A))ws.call(A,e)&&Nt(C,e,A[e]);return C},Fe=(C,A)=>Gs(C,ms(A));var at=(C,A,e)=>{if(!A.has(C))throw TypeError("Cannot "+e)};var o=(C,A,e)=>(at(C,A,"read from private field"),e?e.call(C):A.get(C)),d=(C,A,e)=>{if(A.has(C))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(C):A.set(C,e)},D=(C,A,e,s)=>(at(C,A,"write to private field"),s?s.call(C,e):A.set(C,e),e);var tA=(C,A,e)=>(at(C,A,"access private method"),e);var YA=(C,A,e)=>new Promise((s,t)=>{var n=r=>{try{a(e.next(r))}catch(I){t(I)}},i=r=>{try{a(e.throw(r))}catch(I){t(I)}},a=r=>r.done?s(r.value):Promise.resolve(r.value).then(n,i);a((e=e.apply(C,A)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const we=require("../order/index.cjs"),wA=require("../window-resizer/index.cjs"),yA=require("../ticker/index.cjs"),Zt=require("../dom-JBOkFLTh.cjs"),B=require("three"),mt=require("../layout-box/index.cjs"),Ct=require("../loading/index.cjs"),ys=require("../SourceManager-vSlsMKUE.cjs"),J=require("../Store-C-1ruEIm.cjs"),Ms=require("../easings-DsS5-Kqc.cjs"),Ss=require("../function-MthRj-GJ.cjs"),Ls=require("../Tweened-DIt9j9B-.cjs"),Ts=require("../Viewport-DMB0dO-s.cjs"),zt=require("../custom-element/index.cjs");function xs(C){const A=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(C){for(const e in C)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(C,e);Object.defineProperty(A,e,s.get?s:{enumerable:!0,get:()=>C[e]})}}return A.default=C,Object.freeze(A)}const It=xs(B);function vA(C){const A=e=>{e.dispose();for(const s of Object.keys(e)){const t=e[s];t&&typeof t=="object"&&"minFilter"in t&&t.dispose()}};C.traverse(e=>{if(e instanceof B.Mesh){if(e.geometry.dispose(),!Array.isArray(e.material)&&e.material.isMaterial)A(e.material);else if(Array.isArray(e.material))for(const s of e.material)A(s)}})}var ye,H,TA,EA,QA,XA,lA,hA;class Rt{constructor(A,e){d(this,ye,void 0);d(this,H,void 0);d(this,TA,void 0);d(this,EA,void 0);d(this,QA,void 0);d(this,XA,void 0);d(this,lA,void 0);d(this,hA,void 0);D(this,ye,A),D(this,H,(e==null?void 0:e.cameraType)==="orthographic"?new B.OrthographicCamera:new B.PerspectiveCamera),D(this,TA,new B.Scene),D(this,EA,[]),D(this,QA,(e==null?void 0:e.cameraDistance)||1e3),o(this,H).near=(e==null?void 0:e.cameraNear)||1,o(this,H).far=(e==null?void 0:e.cameraFar)||11e3,D(this,XA,(e==null?void 0:e.cameraFov)||"auto"),D(this,lA,Zt.getElement(e==null?void 0:e.sizeElement)||document.documentElement),this.beforeRenderCallback=e==null?void 0:e.beforeRender,D(this,hA,new mt.LayoutBox(o(this,lA))),o(this,hA).onScale(()=>{this.resize()})}get name(){return o(this,ye)}get camera(){return o(this,H)}get scene(){return o(this,TA)}get box(){return o(this,hA)}get cameraDistance(){return o(this,QA)}set cameraDistance(A){D(this,QA,A),this.resize()}get sizeElement(){return o(this,lA)}get isClipped(){return o(this,lA)!==w.containerElement}resize(){const{width:A,height:e}=o(this,hA);o(this,H).position.z=o(this,QA),o(this,H)instanceof B.PerspectiveCamera?(o(this,H).aspect=A/e,o(this,H).fov=o(this,XA)==="auto"?2*Math.atan(e/2/o(this,QA))*(180/Math.PI):o(this,XA)):o(this,H)instanceof B.OrthographicCamera&&(o(this,H).left=A/-2,o(this,H).right=A/2,o(this,H).top=e/2,o(this,H).bottom=e/-2),o(this,H).updateProjectionMatrix()}destroy(){o(this,EA).forEach(A=>{A.userData.box.destroy()}),o(this,TA).clear(),vA(o(this,TA)),w.destroyView(this.name),o(this,hA).destroy()}attachToHTMLElement(A,e,s){const t=new mt.LayoutBox(A,Fe(eA({},s),{containerElement:o(this,lA),cartesian:!0,scrollStep:!this.isClipped}));return t.bindObject(e),e.userData.box=t,o(this,EA).push(e),e}detachFromHTMLElement(A){D(this,EA,o(this,EA).filter(e=>e===A?(A.userData.box.destroy(),!1):!0))}add(...A){const e=A[0],s=A[1],t=A[2];return this.scene.add(e),s?this.attachToHTMLElement(s,e,t):e}remove(A,e){this.scene.remove(A),e&&this.detachFromHTMLElement(A)}}ye=new WeakMap,H=new WeakMap,TA=new WeakMap,EA=new WeakMap,QA=new WeakMap,XA=new WeakMap,lA=new WeakMap,hA=new WeakMap;const Y=new Map;var nt,iA,T,k,VA,WA,jA,Me,xA,Se,Le,Te;class Hs{constructor(){d(this,nt,`https://unpkg.com/three@0.${B.REVISION}.x`);d(this,iA,null);d(this,T,null);d(this,k,new Map);d(this,VA,0);d(this,WA,0);d(this,jA,0);d(this,Me,2);d(this,xA,!1);d(this,Se,!1);d(this,Le,()=>{var A;D(this,VA,o(this,iA).clientWidth),D(this,WA,o(this,iA).clientHeight),D(this,jA,Math.min(o(this,Me),devicePixelRatio||1)),o(this,T).setPixelRatio(o(this,jA)),o(this,T).setSize(o(this,VA),o(this,WA)),(A=this.onResize)==null||A.call(this)});d(this,Te,()=>{o(this,T).setRenderTarget(null),o(this,k).forEach(A=>{this.render(A)})})}get CDNVersion(){return o(this,nt)}get containerElement(){return o(this,iA)}get webglRenderer(){return o(this,T)}get views(){return o(this,k)}get view(){return this.getView("default")}get width(){return o(this,VA)}get height(){return o(this,WA)}get pixelRatio(){return o(this,jA)}get cacheAssets(){return o(this,Se)}setup(A){if(o(this,xA)){console.warn("[en3.setup]: You are trying to setup en3 again.");return}D(this,iA,Zt.getElement(A==null?void 0:A.containerElement)||document.body),D(this,Me,(A==null?void 0:A.maxPixelRatio)||2),D(this,T,new B.WebGLRenderer(A==null?void 0:A.webGLRendererParameters)),o(this,T).domElement.style.cssText=`
|
|
2
2
|
position: fixed;
|
|
3
3
|
left: 0;
|
|
4
4
|
top: 0;
|
package/lib/en3/index.js
CHANGED
|
@@ -48,7 +48,7 @@ import { S as Di } from "../SourceManager-Q-PB-Rkh.js";
|
|
|
48
48
|
import { S as T } from "../Store-BQXXikps.js";
|
|
49
49
|
import { f as Fi } from "../easings-BKi40vHz.js";
|
|
50
50
|
import { d as pi } from "../function-C10DGppn.js";
|
|
51
|
-
import { T as Gi } from "../Tweened-
|
|
51
|
+
import { T as Gi } from "../Tweened-CwDC2zl8.js";
|
|
52
52
|
import { d as mi } from "../Viewport-CFFhFKqX.js";
|
|
53
53
|
import { CustomElement as Ri, define as wi } from "../custom-element/index.js";
|
|
54
54
|
function Me(a) {
|
package/lib/pointer/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var J=Object.defineProperty;var D=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(i,e,s)=>e in i?J(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,O=(i,e)=>{for(var s in e||(e={}))K.call(e,s)&&k(i,s,e[s]);if(D)for(var s of D(e))N.call(e,s)&&k(i,s,e[s]);return i};var T=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(T(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},l=(i,e,s,o)=>(T(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-C-1ruEIm.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),A=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const M=require("../Damped-
|
|
1
|
+
"use strict";var J=Object.defineProperty;var D=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var k=(i,e,s)=>e in i?J(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,O=(i,e)=>{for(var s in e||(e={}))K.call(e,s)&&k(i,s,e[s]);if(D)for(var s of D(e))N.call(e,s)&&k(i,s,e[s]);return i};var T=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)};var t=(i,e,s)=>(T(i,e,"read from private field"),s?s.call(i):e.get(i)),a=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},l=(i,e,s,o)=>(T(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-C-1ruEIm.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),Q=require("../dom-JBOkFLTh.cjs"),A=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const M=require("../Damped-l0mnlhar.cjs"),B=require("../element-resizer/index.cjs"),G=require("../window-resizer/index.cjs"),H=require("../custom-element/index.cjs"),S=require("../css-property/index.cjs");var c,u,m,v,f,d,P,w,_,C,E,y;class F{constructor(e){a(this,c,void 0);a(this,u,void 0);a(this,m,void 0);a(this,v,void 0);a(this,f,void 0);a(this,d,void 0);a(this,P,0);a(this,w,0);a(this,_,e=>{t(this,v).set(1)});a(this,C,e=>{t(this,v).set(0)});a(this,E,e=>{const s=q.getPointerPosition(e,t(this,c).getBoundingClientRect()),o={width:t(this,P),height:t(this,w)},n={x:s.x,y:s.y};if(t(this,f)){const p=q.screenToCartesian(n,o);n.x=p.x,n.y=p.y}if(t(this,d)){const p=q.normalize(n,o);n.x=A.clamp(p.x*2,-1,1),n.y=A.clamp(p.y*2,-1,1)}t(this,u).set(n.x),t(this,m).set(n.y)});a(this,y,()=>{l(this,P,this.element.clientWidth),l(this,w,this.element.clientHeight);let e=0,s=0,o=0,n=0;t(this,f)?t(this,d)?(e=-1,s=1,o=-1,n=1):(e=t(this,P)/2*-1,s=t(this,P)/2*1,o=t(this,w)/2*-1,n=t(this,w)/2*1):t(this,d)?(e=0,s=1,o=0,n=1):(e=0,s=t(this,P),o=0,n=t(this,w)),t(this,u).min=e,t(this,u).max=s,t(this,m).min=o,t(this,m).max=n});l(this,c,Q.getElement(e.element)),l(this,u,new M.Damped(0,e.damped)),l(this,m,new M.Damped(0,e.damped)),l(this,v,new M.Damped(0,O({min:0,max:1},e.damped))),l(this,f,e.cartesian||!1),l(this,d,e.normalize||!1)}get element(){return t(this,c)}get x(){return t(this,u)}get y(){return t(this,m)}get z(){return t(this,v)}get cartesian(){return t(this,f)}set cartesian(e){l(this,f,e),t(this,y).call(this)}get normalize(){return t(this,d)}set normalize(e){l(this,d,e),t(this,y).call(this)}connect(){t(this,c).addEventListener("pointerenter",t(this,_)),t(this,c).addEventListener("pointerleave",t(this,C)),t(this,c).addEventListener("pointermove",t(this,E)),B.elementResizer.subscribe(t(this,c),t(this,y)),G.windowResizer.subscribe(t(this,y))}disconnect(){t(this,c).removeEventListener("pointerenter",t(this,_)),t(this,c).removeEventListener("pointerleave",t(this,C)),t(this,c).removeEventListener("pointermove",t(this,E)),B.elementResizer.unsubscribe(t(this,y)),G.windowResizer.unsubscribe(t(this,y)),t(this,u).reset(),t(this,m).reset(),t(this,v).reset()}}c=new WeakMap,u=new WeakMap,m=new WeakMap,v=new WeakMap,f=new WeakMap,d=new WeakMap,P=new WeakMap,w=new WeakMap,_=new WeakMap,C=new WeakMap,E=new WeakMap,y=new WeakMap;var U=Object.defineProperty,V=Object.getOwnPropertyDescriptor,X=(i,e,s,o)=>{for(var n=o>1?void 0:o?V(e,s):e,p=i.length-1,L;p>=0;p--)(L=i[p])&&(n=(o?L(e,s,n):L(n))||n);return o&&n&&U(e,s,n),n},I=(i,e,s)=>{if(!e.has(i))throw TypeError("Cannot "+s)},r=(i,e,s)=>(I(i,e,"read from private field"),s?s.call(i):e.get(i)),x=(i,e,s)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,s)},Y=(i,e,s,o)=>(I(i,e,"write to private field"),o?o.call(i,s):e.set(i,s),s),h,b,g,z,W,R;exports.PointerElement=class extends H.CustomElement{constructor(){super(),x(this,h,void 0),x(this,b,new S.CSSProperty(this,"--damping",20)),x(this,g,new S.CSSProperty(this,"--mass",0)),x(this,z,new S.CSSProperty(this,"--stiffness",0)),x(this,W,new S.CSSProperty(this,"--cartesian",!1)),x(this,R,new S.CSSProperty(this,"--normalize",!1)),Y(this,h,new F({element:this})),r(this,b).subscribe(e=>{r(this,h).x.damping=e.current,r(this,h).y.damping=e.current,r(this,h).z.damping=e.current}),r(this,W).subscribe(e=>{r(this,h).cartesian=e.current}),r(this,R).subscribe(e=>{r(this,h).normalize=e.current}),r(this,g).subscribe(e=>{r(this,h).x.mass=e.current,r(this,h).y.mass=e.current,r(this,h).z.mass=e.current}),r(this,z).subscribe(e=>{r(this,h).x.stiffness=e.current,r(this,h).y.stiffness=e.current,r(this,h).z.stiffness=e.current}),r(this,h).x.subscribe(e=>{this.style.setProperty("--x",e.current.toString())}),r(this,h).y.subscribe(e=>{this.style.setProperty("--y",e.current.toString())}),r(this,h).z.subscribe(e=>{this.style.setProperty("--z",e.current.toString())})}get pointer(){return r(this,h)}connectedCallback(){r(this,h).connect(),r(this,b).observe(),r(this,g).observe(),r(this,z).observe()}disconnectedCallback(){r(this,h).disconnect(),r(this,b).unobserve(),r(this,g).unobserve(),r(this,z).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}};h=new WeakMap;b=new WeakMap;g=new WeakMap;z=new WeakMap;W=new WeakMap;R=new WeakMap;exports.PointerElement=X([H.define("e-pointer")],exports.PointerElement);exports.Pointer=F;
|
package/lib/pointer/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import { g as K, s as N, n as Q } from "../coordinates-CgdGoSYs.js";
|
|
|
23
23
|
import { g as U } from "../dom-0S_WDL4g.js";
|
|
24
24
|
import { c as A } from "../math-BOBiC4TN.js";
|
|
25
25
|
import "../ticker/index.js";
|
|
26
|
-
import { D as W } from "../Damped-
|
|
26
|
+
import { D as W } from "../Damped-P4MkCGoY.js";
|
|
27
27
|
import { elementResizer as B } from "../element-resizer/index.js";
|
|
28
28
|
import { windowResizer as G } from "../window-resizer/index.js";
|
|
29
29
|
import { CustomElement as V, define as X } from "../custom-element/index.js";
|
|
@@ -12,16 +12,16 @@ const r = [
|
|
|
12
12
|
1e10
|
|
13
13
|
];
|
|
14
14
|
function u(n, e = 5) {
|
|
15
|
-
return (
|
|
15
|
+
return Math.round(n * r[e]) / r[e];
|
|
16
16
|
}
|
|
17
17
|
function o(n, e) {
|
|
18
18
|
return Math.round(n / e) * e;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function t(n, e) {
|
|
21
21
|
return typeof n == "undefined" ? e : n;
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
t as n,
|
|
25
25
|
u as p,
|
|
26
26
|
o as r
|
|
27
27
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10];function u(n,e=5){return Math.round(n*r[e])/r[e]}function i(n,e){return Math.round(n/e)*e}function o(n,e){return typeof n=="undefined"?e:n}exports.nullishCoalescing=o;exports.preciseNumber=u;exports.roundNumberTo=i;
|