aptechka 0.37.1 → 0.37.3
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-DN95L7Xo.js → Animation-DRQRcOQg.js} +1 -1
- package/lib/{Animation-B9m8bw96.cjs → Animation-DgE_dc5D.cjs} +1 -1
- package/lib/{Damped-CTsV8tl_.cjs → Damped-DbVDDRZi.cjs} +1 -1
- package/lib/{Damped-Chu29wn-.js → Damped-GT4z9D9j.js} +2 -2
- package/lib/{Tweened-lT5myPAZ.cjs → Tweened-DEqfwKKF.cjs} +1 -1
- package/lib/{Tweened-DJzAFsVZ.js → Tweened-YkiLB0BU.js} +2 -2
- 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 +2 -2
- package/lib/media-elements/index.cjs +2 -2
- package/lib/media-elements/index.js +135 -128
- package/lib/media-elements/source/index.d.ts +1 -0
- package/lib/need_redo_tweaker/index.cjs +1 -1
- package/lib/need_redo_tweaker/index.js +1 -1
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +1 -1
- package/lib/polyfills-BANSrI_m.cjs +1 -0
- package/lib/polyfills-CxfUK5OU.js +37 -0
- package/lib/scroll/vanilla/index.cjs +1 -1
- package/lib/scroll/vanilla/index.js +39 -38
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +1 -1
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +34 -33
- package/lib/utils/number.d.ts +1 -0
- package/package.json +1 -1
- package/lib/polyfills-CM4SCDTt.cjs +0 -1
- package/lib/polyfills-X6KXuHg-.js +0 -33
|
@@ -5,7 +5,7 @@ var S = (i, r, t) => r.has(i) || I("Cannot " + t);
|
|
|
5
5
|
var e = (i, r, t) => (S(i, r, "read from private field"), t ? t.call(i) : r.get(i)), a = (i, r, t) => r.has(i) ? I("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(i) : r.set(i, t), h = (i, r, t, u) => (S(i, r, "write to private field"), u ? u.call(i, t) : r.set(i, t), t), P = (i, r, t) => (S(i, r, "access private method"), t);
|
|
6
6
|
import { S as q } from "./Store-OTdcl6SX.js";
|
|
7
7
|
import { c as y } from "./math-BOBiC4TN.js";
|
|
8
|
-
import { p as z, n as F } from "./polyfills-
|
|
8
|
+
import { p as z, n as F } from "./polyfills-CxfUK5OU.js";
|
|
9
9
|
import { ticker as O } from "./ticker/vanilla/index.js";
|
|
10
10
|
import { TICK_ORDER as N } from "./order/index.js";
|
|
11
11
|
var f, d, A, l, b, s, n, m, c, g, M, R, x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var C=i=>{throw TypeError(i)};var S=(i,s,t)=>s.has(i)||C("Cannot "+t);var e=(i,s,t)=>(S(i,s,"read from private field"),t?t.call(i):s.get(i)),a=(i,s,t)=>s.has(i)?C("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),h=(i,s,t,n)=>(S(i,s,"write to private field"),n?n.call(i,t):s.set(i,t),t),M=(i,s,t)=>(S(i,s,"access private method"),t);const I=require("./Store-CDb6RMce.cjs"),z=require("./math-GDWEqu7y.cjs"),m=require("./polyfills-
|
|
1
|
+
"use strict";var C=i=>{throw TypeError(i)};var S=(i,s,t)=>s.has(i)||C("Cannot "+t);var e=(i,s,t)=>(S(i,s,"read from private field"),t?t.call(i):s.get(i)),a=(i,s,t)=>s.has(i)?C("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),h=(i,s,t,n)=>(S(i,s,"write to private field"),n?n.call(i,t):s.set(i,t),t),M=(i,s,t)=>(S(i,s,"access private method"),t);const I=require("./Store-CDb6RMce.cjs"),z=require("./math-GDWEqu7y.cjs"),m=require("./polyfills-BANSrI_m.cjs"),P=require("./ticker/vanilla/index.cjs"),N=require("./order/index.cjs");var f,b,A,c,F,r,u,l,g,d,q,y,x;class O extends I.Store{constructor(t,n){super(t||0,n);a(this,q);a(this,f);a(this,b,N.TICK_ORDER.ANIMATION);a(this,A);a(this,c,new I.Store(!1));a(this,F,0);a(this,r,0);a(this,u,-1/0);a(this,l,1/0);a(this,g,0);a(this,d,null);a(this,x,t=>{this.handleAnimationFrame(t)});h(this,r,this.current)}get direction(){return e(this,F)}get target(){return e(this,r)}get min(){return e(this,u)}set min(t){h(this,u,t),this.set(e(this,r),{equalize:!0})}get max(){return e(this,l)}set max(t){h(this,l,t),this.set(e(this,r),{equalize:!0})}get from(){return e(this,g)}get isRunning(){return e(this,c)}get delta(){return Math.abs(e(this,r)-e(this,g))}get deltaProgress(){return this.delta?m.preciseNumber(Math.abs(this.current-e(this,g))/this.delta,6):0}get distance(){return Math.abs(e(this,l)-e(this,u))}get distanceProgress(){return this.distance?m.preciseNumber(Math.abs(this.current-e(this,u))/this.distance,6):0}set(t,n){(e(this,r)!==t||n!=null&&n.restart)&&(h(this,d,t),this.updateOptions(n),h(this,d,null),e(this,r)!==this.current&&this.start())}shift(t,n){this.set(e(this,r)+t,n)}reset(){super.reset(),this.set(this.initial,{equalize:!0})}close(){super.close(),this.reset(),this.unlistenAnimationFrame()}listenAnimationFrame(){e(this,c).current||(e(this,c).current=!0,P.ticker.subscribe(e(this,x),{maxFPS:e(this,f),order:e(this,b),culling:e(this,A)}))}unlistenAnimationFrame(){e(this,c).current&&(e(this,c).current=!1,P.ticker.unsubscribe(e(this,x)))}updateOptions(t){h(this,f,m.nullishCoalescing(t==null?void 0:t.maxFPS,e(this,f))),h(this,b,m.nullishCoalescing(t==null?void 0:t.order,e(this,b))),h(this,A,m.nullishCoalescing(t==null?void 0:t.culling,e(this,A))),h(this,u,m.nullishCoalescing(t==null?void 0:t.min,e(this,u))),h(this,l,m.nullishCoalescing(t==null?void 0:t.max,e(this,l))),M(this,q,y).call(this,typeof e(this,d)=="number"?e(this,d):e(this,r)),t!=null&&t.equalize&&(this.unlistenAnimationFrame(),this.current=e(this,r)),t!=null&&t.restart&&(this.unlistenAnimationFrame(),this.current=this.initial)}start(){this.listenAnimationFrame()}}f=new WeakMap,b=new WeakMap,A=new WeakMap,c=new WeakMap,F=new WeakMap,r=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,d=new WeakMap,q=new WeakSet,y=function(t){h(this,F,Math.sign(t-e(this,r))),h(this,r,z.clamp(t,e(this,u),e(this,l))),h(this,g,this.current)},x=new WeakMap;exports.Animation=O;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var b=Object.defineProperty,y=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))O.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))v.call(e,s)&&d(t,s,e[s]);return t},p=(t,e)=>y(t,C(e));var q=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),u=(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)=>(q(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const w=require("./math-GDWEqu7y.cjs"),c=require("./polyfills-
|
|
1
|
+
"use strict";var b=Object.defineProperty,y=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var g=t=>{throw TypeError(t)};var d=(t,e,s)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))O.call(e,s)&&d(t,s,e[s]);if(l)for(var s of l(e))v.call(e,s)&&d(t,s,e[s]);return t},p=(t,e)=>y(t,C(e));var q=(t,e,s)=>e.has(t)||g("Cannot "+s);var a=(t,e,s)=>(q(t,e,"read from private field"),s?s.call(t):e.get(t)),u=(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)=>(q(t,e,"write to private field"),r?r.call(t,s):e.set(t,s),s);const w=require("./math-GDWEqu7y.cjs"),c=require("./polyfills-BANSrI_m.cjs"),B=require("./Animation-DgE_dc5D.cjs");var i,h;class D extends B.Animation{constructor(s,r){super(s,r);u(this,i);u(this,h);this.damping=20,this.stiffness=0,this.mass=0,n(this,i,0),n(this,h,0),this.updateOptions(p(f({},r),{equalize:!0}))}get velocity(){return a(this,i)}get speed(){return a(this,h)}updateOptions(s){this.damping=c.nullishCoalescing(s==null?void 0:s.damping,this.damping),this.mass=c.nullishCoalescing(s==null?void 0:s.mass,this.mass),this.stiffness=c.nullishCoalescing(s==null?void 0:s.stiffness,this.stiffness),super.updateOptions(s)}handleAnimationFrame(s){c.preciseNumber(this.current,6)===c.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 m=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*m),this.current+=a(this,i)*m}else this.current=w.damp(this.current,this.target,this.damping,m)}}i=new WeakMap,h=new WeakMap;exports.Damped=D;
|
|
@@ -16,8 +16,8 @@ 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 { n as u, p as F } from "./polyfills-
|
|
20
|
-
import { A as q } from "./Animation-
|
|
19
|
+
import { n as u, p as F } from "./polyfills-CxfUK5OU.js";
|
|
20
|
+
import { A as q } from "./Animation-DRQRcOQg.js";
|
|
21
21
|
var i, h;
|
|
22
22
|
class j extends q {
|
|
23
23
|
constructor(t, r) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty,O=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var m=(i,a,e)=>a in i?y(i,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[a]=e,g=(i,a)=>{for(var e in a||(a={}))w.call(a,e)&&m(i,e,a[e]);if(h)for(var e of h(a))S.call(a,e)&&m(i,e,a[e]);return i},f=(i,a)=>O(i,b(a));var A=(i,a,e)=>a.has(i)||d("Cannot "+e);var s=(i,a,e)=>(A(i,a,"read from private field"),e?e.call(i):a.get(i)),l=(i,a,e)=>a.has(i)?d("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(i):a.set(i,e),c=(i,a,e,r)=>(A(i,a,"write to private field"),r?r.call(i,e):a.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),T=require("./math-GDWEqu7y.cjs"),q=require("./polyfills-
|
|
1
|
+
"use strict";var y=Object.defineProperty,O=Object.defineProperties;var b=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var m=(i,a,e)=>a in i?y(i,a,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[a]=e,g=(i,a)=>{for(var e in a||(a={}))w.call(a,e)&&m(i,e,a[e]);if(h)for(var e of h(a))S.call(a,e)&&m(i,e,a[e]);return i},f=(i,a)=>O(i,b(a));var A=(i,a,e)=>a.has(i)||d("Cannot "+e);var s=(i,a,e)=>(A(i,a,"read from private field"),e?e.call(i):a.get(i)),l=(i,a,e)=>a.has(i)?d("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(i):a.set(i,e),c=(i,a,e,r)=>(A(i,a,"write to private field"),r?r.call(i,e):a.set(i,e),e);const u=require("./easings-GegIwET5.cjs"),T=require("./math-GDWEqu7y.cjs"),q=require("./polyfills-BANSrI_m.cjs"),x=require("./Animation-DgE_dc5D.cjs");var n,t;class z extends x.Animation{constructor(e,r){super(e||0,r);l(this,n,u.linear);l(this,t,1e3);this.updateOptions(f(g({},r),{equalize:!0}))}updateOptions(e){super.updateOptions(e),c(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),c(this,t,(e==null?void 0:e.duration)===!1?0:q.nullishCoalescing(e==null?void 0:e.duration,s(this,t)))}handleAnimationFrame(e){const r=e.timeElapsedSinceSubscription/1e3/(s(this,t)/1e3)||0,F=s(this,n).call(this,T.clamp(r,0,1));this.current=q.preciseNumber(this.from+(this.target-this.from)*F,6),r>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}n=new WeakMap,t=new WeakMap;exports.Tweened=z;
|
|
@@ -17,8 +17,8 @@ var A = (a, r, e) => r.has(a) || f("Cannot " + e);
|
|
|
17
17
|
var m = (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 { n as w, p as z } from "./polyfills-
|
|
21
|
-
import { A as C } from "./Animation-
|
|
20
|
+
import { n as w, p as z } from "./polyfills-CxfUK5OU.js";
|
|
21
|
+
import { A as C } from "./Animation-DRQRcOQg.js";
|
|
22
22
|
var s, t;
|
|
23
23
|
class B extends C {
|
|
24
24
|
constructor(e, i) {
|
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-DgE_dc5D.cjs"),n=require("../Damped-DbVDDRZi.cjs"),i=require("../Tweened-DEqfwKKF.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-DRQRcOQg.js";
|
|
2
|
+
import { D as m } from "../Damped-GT4z9D9j.js";
|
|
3
|
+
import { T as t } from "../Tweened-YkiLB0BU.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 V=h=>{throw TypeError(h)};var F=(h,n,e)=>n.has(h)||V("Cannot "+e);var t=(h,n,e)=>(F(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?V("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),i=(h,n,e,r)=>(F(h,n,"write to private field"),r?r.call(h,e):n.set(h,e),e),k=(h,n,e)=>(F(h,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("../notifier/index.cjs"),m=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-JBOkFLTh.cjs"),q=require("../ticker/vanilla/index.cjs");require("../Store-CDb6RMce.cjs");const J=require("../easings-GegIwET5.cjs"),Z=require("../Tweened-
|
|
1
|
+
"use strict";var V=h=>{throw TypeError(h)};var F=(h,n,e)=>n.has(h)||V("Cannot "+e);var t=(h,n,e)=>(F(h,n,"read from private field"),e?e.call(h):n.get(h)),s=(h,n,e)=>n.has(h)?V("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(h):n.set(h,e),i=(h,n,e,r)=>(F(h,n,"write to private field"),r?r.call(h,e):n.set(h,e),e),k=(h,n,e)=>(F(h,n,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("../notifier/index.cjs"),m=require("../browser-CpzFX2xg.cjs"),Q=require("../dom-JBOkFLTh.cjs"),q=require("../ticker/vanilla/index.cjs");require("../Store-CDb6RMce.cjs");const J=require("../easings-GegIwET5.cjs"),Z=require("../Tweened-DEqfwKKF.cjs"),_=require("../gestures-DHLrn6Q8.cjs"),$=require("../polyfills-BANSrI_m.cjs"),p=require("../order/index.cjs");var R;class Y{constructor(){s(this,R,new G.Notifier)}get changeEvent(){return t(this,R)}}R=new WeakMap;var b,c,u,H;class ee extends Y{constructor(e){super();s(this,b,null);s(this,c,null);s(this,u,"offsetHeight");s(this,H,e=>{const r=e.shiftKey?-1:1;let a;e.code==="Space"?a=r*t(this,c)[t(this,u)]*.4:e.code==="ArrowLeft"?a=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowRight"?a=1*t(this,c)[t(this,u)]*.2:e.code==="ArrowUp"?a=-1*t(this,c)[t(this,u)]*.2:e.code==="ArrowDown"?a=1*t(this,c)[t(this,u)]*.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))});m.isBrowser&&(i(this,b,e!=null&&e.element&&Q.getElement(e.element)||window),i(this,c,t(this,b)instanceof HTMLElement?t(this,b):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,b).addEventListener("keydown",t(this,H))}disconnect(){m.isBrowser&&t(this,b).removeEventListener("keydown",t(this,H))}}b=new WeakMap,c=new WeakMap,u=new WeakMap,H=new WeakMap;var g,x,P,z,d,T,f,w,O,U,C,W,B;class te extends Y{constructor(e){super();s(this,w);s(this,g);s(this,x);s(this,P);s(this,z);s(this,d);s(this,T);s(this,f);s(this,C);s(this,W);s(this,B);this.direction=1,i(this,d,new Z.Tweened(0,{easing:J.easeInQuad})),i(this,f,!1),i(this,C,r=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",r.timeBetweenFrames*t(this,g)*this.direction*(1-t(this,d).current))}),i(this,W,()=>{t(this,d).current!==1&&this.changeEvent.notify("autoplay",Math.sign(t(this,g))*this.direction*(1-t(this,d).current))}),i(this,B,()=>{t(this,x)&&(document.hidden?t(this,d).set(1,{equalize:!0}):t(this,d).set(0,{equalize:!0}))}),i(this,g,(e==null?void 0:e.speed)||1),i(this,x,(e==null?void 0:e.interval)||!1),i(this,P,e)}set interval(e){i(this,x,e),t(this,f)&&k(this,w,O).call(this)}set speed(e){i(this,g,e),t(this,f)&&k(this,w,O).call(this)}connect(){t(this,f)||(i(this,f,!0),k(this,w,O).call(this))}disconnect(){t(this,f)&&(i(this,f,!1),k(this,w,U).call(this))}pauseAndContinue(e,r){t(this,f)&&e&&(clearTimeout(t(this,T)),t(this,d).set(1,{duration:Math.min(e,1e3),equalize:r}),i(this,T,setTimeout(()=>{t(this,d).set(0,{duration:Math.min(e,5e3),equalize:r})},e)))}}g=new WeakMap,x=new WeakMap,P=new WeakMap,z=new WeakMap,d=new WeakMap,T=new WeakMap,f=new WeakMap,w=new WeakSet,O=function(){k(this,w,U).call(this),t(this,x)?i(this,z,setInterval(t(this,W),Math.abs(t(this,g)))):q.ticker.subscribe(t(this,C),t(this,P)),document.addEventListener("visibilitychange",t(this,B))},U=function(){clearInterval(t(this,z)),q.ticker.unsubscribe(t(this,C)),clearTimeout(t(this,T)),t(this,d).close(),document.removeEventListener("visibilitychange",t(this,B))},C=new WeakMap,W=new WeakMap,B=new WeakMap;var A,v,D,X;class ie extends Y{constructor(e){super();s(this,A,null);s(this,v);s(this,D);s(this,X,e=>{let r=0;if(!(this.axis==="x"&&Math.abs(e.deltaY)>Math.abs(e.deltaX)*1||this.axis==="y"&&Math.abs(e.deltaX)>Math.abs(e.deltaY)*1))if(e.preventDefault(),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){const a=Date.now();if(a-t(this,D)>40&&(r=100*Math.sign(r)),i(this,D,a),Math.abs(r)<100||t(this,v))return;this.changeEvent.notify("wheel",r),i(this,v,setTimeout(()=>{i(this,v,void 0)},80))}else this.changeEvent.notify("wheel",r)});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.isBrowser&&i(this,A,e!=null&&e.element&&Q.getElement(e.element)||window)}connect(){m.isBrowser&&t(this,A).addEventListener("wheel",t(this,X),{passive:!1})}disconnect(){m.isBrowser&&(t(this,A).removeEventListener("wheel",t(this,X)),clearTimeout(t(this,v)))}}A=new WeakMap,v=new WeakMap,D=new WeakMap,X=new WeakMap;var M,o,l,I,y;const E=class E extends Y{constructor(e){super();s(this,o);s(this,l);s(this,I);s(this,y);this.inertion=1,i(this,o,null),i(this,l,0),i(this,I,r=>{if(r.composedPath().find(L=>L instanceof HTMLElement&&L.hasAttribute("drag-dead-zone")))return;this.swipe||q.ticker.unsubscribe(t(this,y));let a=r,S=!1;i(this,l,0),document.documentElement.classList.add("grabbing");let K=0,N=0;_.setupDrag(L=>{t(E,M)&&t(E,M)!==t(this,o)||(K=a.x-L.x,N=a.y-L.y,this.axis==="x"?i(this,l,K):i(this,l,N),a=L,S=this.axis==="x"&&Math.abs(K)>Math.abs(N)||this.axis==="y"&&Math.abs(N)>Math.abs(K),S&&(i(E,M,t(this,o)),this.changeEvent.notify("drag",t(this,l))))},()=>{i(E,M,null),S&&!this.swipe&&this.inertion?(i(this,l,t(this,l)*this.inertion),q.ticker.subscribe(t(this,y),{order:p.TICK_ORDER.CONTROLS-1})):this.swipe&&this.changeEvent.notify("drag-end",t(this,l)),document.documentElement.classList.remove("grabbing")})}),i(this,y,()=>{Math.floor(Math.abs(t(this,l)))||q.ticker.unsubscribe(t(this,y)),i(this,l,t(this,l)*.95),i(this,l,$.preciseNumber(t(this,l),3)),this.changeEvent.notify("drag",t(this,l))}),this.axis=(e==null?void 0:e.axis)||"y",this.swipe=(e==null?void 0:e.swipe)||!1,m.isBrowser&&i(this,o,e!=null&&e.element&&Q.getElement(e.element)||document.documentElement)}connect(){m.isBrowser&&t(this,o).addEventListener("pointerdown",t(this,I))}disconnect(){m.isBrowser&&(t(this,o).removeEventListener("pointerdown",t(this,I)),q.ticker.unsubscribe(t(this,y)))}};M=new WeakMap,o=new WeakMap,l=new WeakMap,I=new WeakMap,y=new WeakMap,s(E,M,null);let j=E;exports.AutoplayControls=te;exports.Controls=Y;exports.DragControls=j;exports.KeyboardControls=ee;exports.WheelControls=ie;
|
package/lib/controls/index.js
CHANGED
|
@@ -9,9 +9,9 @@ import { g as Q } from "../dom-0S_WDL4g.js";
|
|
|
9
9
|
import { ticker as k } from "../ticker/vanilla/index.js";
|
|
10
10
|
import "../Store-OTdcl6SX.js";
|
|
11
11
|
import { a as J } from "../easings-BEmRlrDd.js";
|
|
12
|
-
import { T as Z } from "../Tweened-
|
|
12
|
+
import { T as Z } from "../Tweened-YkiLB0BU.js";
|
|
13
13
|
import { s as $ } from "../gestures-D2Fdra_G.js";
|
|
14
|
-
import { p } from "../polyfills-
|
|
14
|
+
import { p } from "../polyfills-CxfUK5OU.js";
|
|
15
15
|
import { TICK_ORDER as _ } from "../order/index.js";
|
|
16
16
|
var O;
|
|
17
17
|
class B {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Y=r=>{throw TypeError(r)};var D=(r,i,t)=>i.has(r)||Y("Cannot "+t);var e=(r,i,t)=>(D(r,i,"read from private field"),t?t.call(r):i.get(r)),s=(r,i,t)=>i.has(r)?Y("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(r):i.set(r,t),a=(r,i,t,n)=>(D(r,i,"write to private field"),n?n.call(r,t):i.set(r,t),t),H=(r,i,t)=>(D(r,i,"access private method"),t);var G=(r,i,t)=>new Promise((n,l)=>{var S=d=>{try{b(t.next(d))}catch(h){l(h)}},$=d=>{try{b(t.throw(d))}catch(h){l(h)}},b=d=>d.done?n(d.value):Promise.resolve(d.value).then(S,$);b((t=t.apply(r,i)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const re=require("../device/index.cjs"),ne=require("../source/index.cjs"),ae=require("../class-linked-status/index.cjs"),Z=require("../browser-CpzFX2xg.cjs"),N=require("../events-KVanG9sR.cjs"),oe=require("../string-DhgS_iFl.cjs"),U=require("../loading/index.cjs"),O=require("../css-property/index.cjs"),J=require("../element-resizer/vanilla/index.cjs"),Q=require("../canvas-CU5Xjahf.cjs"),ce=require("../canvas/index.cjs"),K=require("../ticker/vanilla/index.cjs");let he=0;var u,o,p,I,m,_,C,c,q,P,R,V,W,T,F;class j extends HTMLElement{constructor(){super();s(this,R);s(this,u,null);s(this,o,null);s(this,p,!1);s(this,I,!1);s(this,m,!1);s(this,_,"");s(this,C,"");s(this,c,new ae.ClassLinkedStatus(this,{loading:!1,loaded:!1,error:!1,clear:!1}));s(this,q,null);s(this,P);s(this,W,t=>{const n=t[0];e(this,m)&&(!e(this,I)||this.hasAttribute("reload-source"))&&n.isIntersecting&&this.triggerLazyLoad(),n.isIntersecting?N.dispatchEvent(this,"sourceCapture",{custom:!0}):(this.hasAttribute("reload-source")&&H(this,R,V).call(this,void 0),N.dispatchEvent(this,"sourceRelease",{custom:!0}))});s(this,T,()=>{e(this,c).set("loaded",!0),e(this,c).set("error",!1),e(this,c).set("loading",!1),!e(this,m)&&!e(this,p)&&U.loading.complete(e(this,C));const t=getComputedStyle(this).getPropertyValue("--clear-duration");t&&a(this,P,setTimeout(()=>e(this,c).set("clear",!0),parseFloat(t)*1e3)),a(this,p,!0)});s(this,F,t=>{e(this,c).set("loaded",!1),e(this,c).set("error",!0),e(this,c).set("loading",!1),!e(this,m)&&!e(this,p)&&U.loading.error(e(this,C)),a(this,p,!0)});Z.isBrowser&&window.IntersectionObserver&&(a(this,_,`source-consumer-${++he}`),a(this,q,new IntersectionObserver(e(this,W))))}get consumerElement(){return e(this,o)}get sourceManager(){return e(this,u)}get status(){return e(this,c)}get isLazy(){return e(this,m)}triggerLazyLoad(){e(this,u).current&&e(this,u).current!==e(this,u).previous&&H(this,R,V).call(this,e(this,u).current),a(this,I,!0)}connectedCallback(){const t=this.getAttribute("srcset");t&&(a(this,o,this.createConsumer()),e(this,o).style.cssText=`
|
|
2
2
|
display: block;
|
|
3
3
|
width: 100%;
|
|
4
4
|
height: 100%;
|
|
5
|
-
`,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(n=>{if(n.name!=="srcset"){const l=n.nodeValue||"",
|
|
5
|
+
`,e(this,o).classList.add("source-consumer"),Array.from(this.attributes).forEach(n=>{if(n.name!=="srcset"){const l=n.nodeValue||"",S=oe.kebabToCamel(n.name);S in e(this,o)&&(e(this,o)[S]=l||!0)}}),this.appendChild(e(this,o)),a(this,u,new ne.SourceManager({srcset:t})),a(this,m,this.hasAttribute("lazy")),e(this,u).subscribe(n=>{(!e(this,m)||e(this,m)&&e(this,I))&&H(this,R,V).call(this,n.current)}),e(this,q).observe(this),e(this,u).connect())}disconnectedCallback(){e(this,q).disconnect(),e(this,u).close(),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,o).remove(),e(this,c).reset(),clearTimeout(e(this,P))}}u=new WeakMap,o=new WeakMap,p=new WeakMap,I=new WeakMap,m=new WeakMap,_=new WeakMap,C=new WeakMap,c=new WeakMap,q=new WeakMap,P=new WeakMap,R=new WeakSet,V=function(t){if(clearTimeout(e(this,P)),e(this,o).onloadeddata=null,e(this,o).onload=null,e(this,o).onerror=null,e(this,c).set("loaded",!1),e(this,c).set("error",!1),e(this,c).set("loading",!1),e(this,c).set("clear",!1),t){a(this,C,`${e(this,_)}-${t.url}`);const n=this.hasAttribute("keep-source-parameters");e(this,c).set("loading",!0);const l=n?t.url:t.name+t.extension;this.consumeSource(l),!e(this,m)&&!e(this,p)&&U.loading.add(e(this,C)),e(this,o).onloadeddata=()=>{e(this,T).call(this)},e(this,o).onload=()=>{e(this,T).call(this)},e(this,o).onerror=()=>{e(this,F).call(this,l)}}else this.consumeSource(null)},W=new WeakMap,T=new WeakMap,F=new WeakMap;class ee extends j{createConsumer(){return document.createElement("img")}consumeSource(i){if(i&&this.hasAttribute("webp")&&re.device.isWebp){const t=i.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=t}else this.consumerElement.src=i||""}}customElements.get("e-image")||customElements.define("e-image",ee);function le(r){const i=r.match(/\{([\d-]+)\}/);if(i){const t=i[1].split("-");if(t.length===2){const n=parseInt(t[0],10),l=parseInt(t[1],10);return{start:n,end:l}}}return null}var f,w,A,E,v,L,k,M,g,y;class te extends j{constructor(t){super();s(this,f,[]);s(this,w,new O.CSSProperty(this,"--fit","contain"));s(this,A,new O.CSSProperty(this,"--autoplay",!1));s(this,E,new O.CSSProperty(this,"--offset-x",.5));s(this,v,new O.CSSProperty(this,"--offset-y",.5));s(this,L,null);s(this,k,0);s(this,M,1);s(this,g,()=>{if(e(this,f).length){const t=e(this,f)[0];e(this,w).current==="cover"?a(this,L,Q.cover(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,E).current,e(this,v).current)):a(this,L,Q.contain(t.naturalWidth,t.naturalHeight,this.consumerElement.width,this.consumerElement.height,e(this,E).current,e(this,v).current))}});s(this,y,t=>{if(this.status.isFalse("loaded")||!e(this,L))return;t.detail.context.clearRect(0,0,t.detail.width,t.detail.height);const n=e(this,f)[e(this,k)];n&&t.detail.context.drawImage(n,...e(this,L)),e(this,A).current&&a(this,k,(e(this,k)+1)%e(this,f).length)});Z.isBrowser&&(a(this,M,parseInt(((t==null?void 0:t.pad)||this.getAttribute("pad")||"1").toString())),e(this,w).subscribe(e(this,g)),e(this,E).subscribe(e(this,g)),e(this,v).subscribe(e(this,g)),this.addEventListener("sourceCapture",n=>{this.consumerElement.addEventListener("canvasRender",e(this,y))}),this.addEventListener("sourceRelease",n=>{this.consumerElement.removeEventListener("canvasRender",e(this,y))}))}setProgress(t){e(this,f).length&&a(this,k,Math.floor((e(this,f).length-1)*t))}connectedCallback(){super.connectedCallback(),e(this,A).observe(),e(this,w).observe(),e(this,E).observe(),e(this,v).observe(),J.elementResizer.subscribe(this,e(this,g))}disconnectedCallback(){super.disconnectedCallback(),e(this,A).unobserve(),e(this,w).unobserve(),e(this,E).unobserve(),e(this,v).unobserve(),a(this,f,[]),J.elementResizer.unsubscribe(e(this,g)),this.consumerElement.removeEventListener("canvasRender",e(this,y))}createConsumer(){return new ce.CanvasElement}consumeSource(t){return G(this,null,function*(){var n,l,S,$;if(t){this.consumerElement.removeEventListener("canvasRender",e(this,y));const b=[],d=le(t);if(d)for(let h=d.start;h<=d.end;h++){const X=t.replace(/\{([^}]+)\}/,h.toString().padStart(e(this,M),"0")),B=new Image;B.src=X,b.push(B)}else{const h=new Image;h.src=t,b.push(h)}try{yield Promise.all(b.map((h,X)=>new Promise((B,ie)=>{h.onload=()=>{B()},h.onerror=ue=>{ie(`${h.src} Image not found`)}}))),a(this,f,b),e(this,g).call(this),(l=(n=this.consumerElement).onload)==null||l.call(n,new Event("load")),this.isLazy||this.consumerElement.addEventListener("canvasRender",e(this,y))}catch(h){console.error(h),($=(S=this.consumerElement).onerror)==null||$.call(S,new Event("error"))}}})}}f=new WeakMap,w=new WeakMap,A=new WeakMap,E=new WeakMap,v=new WeakMap,L=new WeakMap,k=new WeakMap,M=new WeakMap,g=new WeakMap,y=new WeakMap;customElements.get("e-sequence")||customElements.define("e-sequence",te);var x,z;class se extends j{constructor(){super(...arguments);s(this,x,0);s(this,z,()=>{this.classList.add(`state-${this.consumerElement.readyState}`);const t=this.consumerElement.readyState/4;t>e(this,x)&&a(this,x,t),N.dispatchEvent(this,"videoReadyStateChange",{detail:{readyState:this.consumerElement.readyState,progress:e(this,x)}}),this.consumerElement.readyState===4&&K.ticker.unsubscribe(e(this,z))})}connectedCallback(){super.connectedCallback(),this.addEventListener("sourceCapture",()=>{K.ticker.subscribe(e(this,z)),this.hasAttribute("capture-autoplay")&&this.consumerElement.play()}),this.addEventListener("sourceRelease",()=>{this.hasAttribute("capture-autoplay")&&(this.consumerElement.pause(),this.hasAttribute("replay")&&(this.consumerElement.currentTime=0)),this.hasAttribute("reload-source")&&this.classList.remove("state-0","state-1","state-2","state-3","state-4")})}disconnectedCallback(){super.disconnectedCallback(),K.ticker.unsubscribe(e(this,z)),a(this,x,0)}createConsumer(){return document.createElement("video")}consumeSource(t){this.consumerElement.src=t||"",this.consumerElement.autoplay=!0}}x=new WeakMap,z=new WeakMap;customElements.get("e-video")||customElements.define("e-video",se);exports.ImageElement=ee;exports.SequenceElement=te;exports.SourceElement=j;exports.VideoElement=se;
|