aptechka 0.19.0 → 0.21.0

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.
Files changed (54) hide show
  1. package/lib/Tweened-CDYmG9hk.js +138 -0
  2. package/lib/Tweened-DlyMbHu_.cjs +1 -0
  3. package/lib/animation/index.cjs +1 -1
  4. package/lib/animation/index.js +53 -6
  5. package/lib/controls/index.cjs +1 -1
  6. package/lib/controls/index.js +29 -27
  7. package/lib/need_redo_tweaker/index.cjs +3 -3
  8. package/lib/need_redo_tweaker/index.js +1 -2
  9. package/lib/order/index.cjs +1 -1
  10. package/lib/order/index.d.ts +14 -18
  11. package/lib/order/index.js +1 -1
  12. package/lib/polyfills-AItxku8u.js +76 -0
  13. package/lib/polyfills-Caa6z-Ay.cjs +1 -0
  14. package/lib/source/index.cjs +1 -5
  15. package/lib/source/index.d.ts +0 -1
  16. package/lib/source/index.js +67 -152
  17. package/lib/utils/index.cjs +1 -1
  18. package/lib/utils/index.js +213 -154
  19. package/package.json +1 -41
  20. package/lib/Animation-DI864E0i.cjs +0 -1
  21. package/lib/Animation-w6BLTCum.js +0 -105
  22. package/lib/Damped-DEHDEq-b.js +0 -53
  23. package/lib/Damped-ipnDc0iX.cjs +0 -1
  24. package/lib/Tweened-B1TfANfR.cjs +0 -1
  25. package/lib/Tweened-C52xXDLY.js +0 -44
  26. package/lib/canvas/index.cjs +0 -1
  27. package/lib/canvas/index.d.ts +0 -34
  28. package/lib/canvas/index.js +0 -108
  29. package/lib/canvas-CU5Xjahf.cjs +0 -1
  30. package/lib/canvas-DeZ0SLUJ.js +0 -34
  31. package/lib/coordinates-CgdGoSYs.js +0 -24
  32. package/lib/coordinates-D8Np3cPD.cjs +0 -1
  33. package/lib/image/index.cjs +0 -1
  34. package/lib/image/index.d.ts +0 -10
  35. package/lib/image/index.js +0 -15
  36. package/lib/jss-CjccJC-K.js +0 -21
  37. package/lib/jss-GJLvaNfT.cjs +0 -1
  38. package/lib/math-BOBiC4TN.js +0 -45
  39. package/lib/math-GDWEqu7y.cjs +0 -1
  40. package/lib/pointer/Pointer.d.ts +0 -22
  41. package/lib/pointer/PointerElement.d.ts +0 -13
  42. package/lib/pointer/index.cjs +0 -1
  43. package/lib/pointer/index.d.ts +0 -2
  44. package/lib/pointer/index.js +0 -151
  45. package/lib/polyfills-CM4SCDTt.cjs +0 -1
  46. package/lib/polyfills-X6KXuHg-.js +0 -33
  47. package/lib/sequence/index.cjs +0 -1
  48. package/lib/sequence/index.d.ts +0 -20
  49. package/lib/sequence/index.js +0 -158
  50. package/lib/source/SourceElement.d.ts +0 -24
  51. package/lib/test/starting-style/index.d.ts +0 -1
  52. package/lib/video/index.cjs +0 -1
  53. package/lib/video/index.d.ts +0 -21
  54. package/lib/video/index.js +0 -55
@@ -1,53 +0,0 @@
1
- var v = Object.defineProperty, w = Object.defineProperties;
2
- var x = Object.getOwnPropertyDescriptors;
3
- var d = Object.getOwnPropertySymbols;
4
- var y = Object.prototype.hasOwnProperty, B = Object.prototype.propertyIsEnumerable;
5
- var g = (s) => {
6
- throw TypeError(s);
7
- };
8
- var f = (s, e, t) => e in s ? v(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, l = (s, e) => {
9
- for (var t in e || (e = {}))
10
- y.call(e, t) && f(s, t, e[t]);
11
- if (d)
12
- for (var t of d(e))
13
- B.call(e, t) && f(s, t, e[t]);
14
- return s;
15
- }, p = (s, e) => w(s, x(e));
16
- var A = (s, e, t) => e.has(s) || g("Cannot " + t);
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
- import { d as D } from "./math-BOBiC4TN.js";
19
- import { n as u, p as F } from "./polyfills-X6KXuHg-.js";
20
- import { A as q } from "./Animation-w6BLTCum.js";
21
- var i, h;
22
- class j extends q {
23
- constructor(t, r) {
24
- super(t, r);
25
- c(this, i);
26
- c(this, h);
27
- this.damping = 20, this.stiffness = 0, this.mass = 0, m(this, i, 0), m(this, h, 0), this.updateOptions(p(l({}, r), { equalize: !0 }));
28
- }
29
- get velocity() {
30
- return a(this, i);
31
- }
32
- get speed() {
33
- return a(this, h);
34
- }
35
- updateOptions(t) {
36
- this.damping = u(t == null ? void 0 : t.damping, this.damping), this.mass = u(t == null ? void 0 : t.mass, this.mass), this.stiffness = u(t == null ? void 0 : t.stiffness, this.stiffness), super.updateOptions(t);
37
- }
38
- handleAnimationFrame(t) {
39
- F(this.current, 6) === F(this.target, 6) && (this.unlistenAnimationFrame(), this.current = this.target);
40
- const r = this.current, O = Math.abs(r - this.target);
41
- m(this, h, O / t.timeBetweenFrames);
42
- const n = t.timeBetweenFrames / 1e3;
43
- if (this.mass || this.stiffness) {
44
- const b = (this.target - this.current) * this.stiffness - a(this, i) * this.damping;
45
- m(this, i, a(this, i) + b / this.mass * n), this.current += a(this, i) * n;
46
- } else
47
- this.current = D(this.current, this.target, this.damping, n);
48
- }
49
- }
50
- i = new WeakMap(), h = new WeakMap();
51
- export {
52
- j as D
53
- };
@@ -1 +0,0 @@
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-CM4SCDTt.cjs"),B=require("./Animation-DI864E0i.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;
@@ -1 +0,0 @@
1
- "use strict";var F=Object.defineProperty,o=Object.defineProperties;var O=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable;var d=i=>{throw TypeError(i)};var m=(i,t,e)=>t in i?F(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,g=(i,t)=>{for(var e in t||(t={}))b.call(t,e)&&m(i,e,t[e]);if(c)for(var e of c(t))p.call(t,e)&&m(i,e,t[e]);return i},A=(i,t)=>o(i,O(t));var q=(i,t,e)=>t.has(i)||d("Cannot "+e);var a=(i,t,e)=>(q(i,t,"read from private field"),e?e.call(i):t.get(i)),u=(i,t,e)=>t.has(i)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),h=(i,t,e,s)=>(q(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e);const w=require("./easings-DsS5-Kqc.cjs"),C=require("./math-GDWEqu7y.cjs"),l=require("./polyfills-CM4SCDTt.cjs"),S=require("./Animation-DI864E0i.cjs");var n,r;class T extends S.Animation{constructor(e,s){super(e||0,s);u(this,n,w.linear);u(this,r,1e3);this.updateOptions(A(g({},s),{equalize:!0}))}updateOptions(e){super.updateOptions(e),h(this,n,l.nullishCoalescing(e==null?void 0:e.easing,a(this,n))),h(this,r,l.nullishCoalescing(e==null?void 0:e.duration,a(this,r)))}handleAnimationFrame(e){const s=e.timeElapsedSinceSubscription/1e3/(a(this,r)/1e3),f=a(this,n).call(this,C.clamp(s,0,1));this.current=l.preciseNumber(this.from+(this.target-this.from)*f,6),s>1&&this.unlistenAnimationFrame()}start(){this.unlistenAnimationFrame(),this.listenAnimationFrame()}}n=new WeakMap,r=new WeakMap;exports.Tweened=T;
@@ -1,44 +0,0 @@
1
- var g = Object.defineProperty, F = Object.defineProperties;
2
- var O = Object.getOwnPropertyDescriptors;
3
- var u = Object.getOwnPropertySymbols;
4
- var b = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
5
- var c = (e) => {
6
- throw TypeError(e);
7
- };
8
- var l = (e, i, t) => i in e ? g(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, d = (e, i) => {
9
- for (var t in i || (i = {}))
10
- b.call(i, t) && l(e, t, i[t]);
11
- if (u)
12
- for (var t of u(i))
13
- x.call(i, t) && l(e, t, i[t]);
14
- return e;
15
- }, f = (e, i) => F(e, O(i));
16
- var p = (e, i, t) => i.has(e) || c("Cannot " + t);
17
- var n = (e, i, t) => (p(e, i, "read from private field"), t ? t.call(e) : i.get(e)), m = (e, i, t) => i.has(e) ? c("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(e) : i.set(e, t), h = (e, i, t, a) => (p(e, i, "write to private field"), a ? a.call(e, t) : i.set(e, t), t);
18
- import { l as S } from "./easings-BKi40vHz.js";
19
- import { c as T } from "./math-BOBiC4TN.js";
20
- import { n as A, p as q } from "./polyfills-X6KXuHg-.js";
21
- import { A as w } from "./Animation-w6BLTCum.js";
22
- var s, r;
23
- class k extends w {
24
- constructor(t, a) {
25
- super(t || 0, a);
26
- m(this, s, S);
27
- m(this, r, 1e3);
28
- this.updateOptions(f(d({}, a), { equalize: !0 }));
29
- }
30
- updateOptions(t) {
31
- super.updateOptions(t), h(this, s, A(t == null ? void 0 : t.easing, n(this, s))), h(this, r, A(t == null ? void 0 : t.duration, n(this, r)));
32
- }
33
- handleAnimationFrame(t) {
34
- const a = t.timeElapsedSinceSubscription / 1e3 / (n(this, r) / 1e3), o = n(this, s).call(this, T(a, 0, 1));
35
- this.current = q(this.from + (this.target - this.from) * o, 6), a > 1 && this.unlistenAnimationFrame();
36
- }
37
- start() {
38
- this.unlistenAnimationFrame(), this.listenAnimationFrame();
39
- }
40
- }
41
- s = new WeakMap(), r = new WeakMap();
42
- export {
43
- k as T
44
- };
@@ -1 +0,0 @@
1
- "use strict";var f=i=>{throw TypeError(i)};var R=(i,s,e)=>s.has(i)||f("Cannot "+e);var t=(i,s,e)=>(R(i,s,"read from private field"),e?e.call(i):s.get(i)),n=(i,s,e)=>s.has(i)?f("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,e),a=(i,s,e,d)=>(R(i,s,"write to private field"),d?d.call(i,e):s.set(i,e),e),o=(i,s,e)=>(R(i,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../css-property/index.cjs"),C=require("../element-resizer/index.cjs"),w=require("../ticker/index.cjs"),z=require("../browser-CpzFX2xg.cjs"),B=require("../jss-GJLvaNfT.cjs"),F=require("../math-GDWEqu7y.cjs");var c,r,m,l,u,p,b,g,h,E,k,x,v,S,P;class y extends HTMLElement{constructor(){super();n(this,h);n(this,c,new q.CSSProperty(this,"--fps",0));n(this,r,null);n(this,m,null);n(this,l,0);n(this,u,0);n(this,p,1);n(this,b,0);n(this,g,1);n(this,x,e=>{a(this,p,F.clamp(devicePixelRatio,1,2)),a(this,l,e.contentRect.width),a(this,u,e.contentRect.height),t(this,r).width=t(this,l)*this.pixelRatio,t(this,r).height=t(this,u)*this.pixelRatio,this.context.scale(this.pixelRatio,this.pixelRatio),o(this,h,P).call(this),o(this,h,S).call(this)});n(this,v,e=>{a(this,b,e.timestamp),a(this,g,e.timeBetweenFrames),o(this,h,S).call(this)});if(z.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets.push(B.createStylesheet({" :host, canvas":{display:"block",width:"100%",height:"100%"}})),a(this,r,document.createElement("canvas")),a(this,m,t(this,r).getContext("2d")),e.appendChild(t(this,r)),t(this,c).subscribe(d=>{typeof d.previous!="undefined"&&d.current!==d.previous&&o(this,h,E).call(this)})}}get fpsCSSProperty(){return t(this,c)}get canvasElement(){return t(this,r)}get context(){return t(this,m)}get pixelRatio(){return t(this,p)}get width(){return t(this,l)}get height(){return t(this,u)}get detail(){return{width:t(this,l),height:t(this,u),element:this,canvasElement:t(this,r),pixelRatio:t(this,p),context:t(this,m),timestamp:t(this,b),timeBetweenFrames:t(this,g)}}connectedCallback(){t(this,c).observe(),C.elementResizer.subscribe(this,t(this,x)),o(this,h,E).call(this)}disconnectedCallback(){t(this,c).unobserve(),C.elementResizer.unsubscribe(t(this,x)),o(this,h,k).call(this)}}c=new WeakMap,r=new WeakMap,m=new WeakMap,l=new WeakMap,u=new WeakMap,p=new WeakMap,b=new WeakMap,g=new WeakMap,h=new WeakSet,E=function(){w.ticker.unsubscribe(t(this,v)),this.hasAttribute("static")||w.ticker.subscribe(t(this,v),{culling:this,maxFPS:t(this,c).current})},k=function(){w.ticker.unsubscribe(t(this,v))},x=new WeakMap,v=new WeakMap,S=function(){this.dispatchEvent(new CustomEvent("canvasRender",{composed:!0,detail:this.detail}))},P=function(){this.dispatchEvent(new CustomEvent("canvasResize",{composed:!0,detail:this.detail}))};customElements.get("e-canvas")||customElements.define("e-canvas",y);exports.CanvasElement=y;
@@ -1,34 +0,0 @@
1
- import { CSSProperty } from '../css-property';
2
- export interface Canvas2DRenderDetail {
3
- pixelRatio: number;
4
- width: number;
5
- height: number;
6
- element: HTMLElement;
7
- canvasElement: HTMLCanvasElement;
8
- context: CanvasRenderingContext2D;
9
- timestamp: number;
10
- timeBetweenFrames: number;
11
- }
12
- export type CanvasRenderEvent = CustomEvent<Canvas2DRenderDetail>;
13
- export declare class CanvasElement extends HTMLElement {
14
- #private;
15
- constructor();
16
- get fpsCSSProperty(): CSSProperty<number>;
17
- get canvasElement(): HTMLCanvasElement;
18
- get context(): CanvasRenderingContext2D;
19
- get pixelRatio(): number;
20
- get width(): number;
21
- get height(): number;
22
- get detail(): Canvas2DRenderDetail;
23
- protected connectedCallback(): void;
24
- protected disconnectedCallback(): void;
25
- }
26
- declare global {
27
- interface HTMLElementTagNameMap {
28
- 'e-canvas': CanvasElement;
29
- }
30
- interface HTMLElementEventMap {
31
- canvasRender: CanvasRenderEvent;
32
- canvasResize: CanvasRenderEvent;
33
- }
34
- }
@@ -1,108 +0,0 @@
1
- var S = (i) => {
2
- throw TypeError(i);
3
- };
4
- var x = (i, s, e) => s.has(i) || S("Cannot " + e);
5
- var t = (i, s, e) => (x(i, s, "read from private field"), e ? e.call(i) : s.get(i)), h = (i, s, e) => s.has(i) ? S("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), a = (i, s, e, p) => (x(i, s, "write to private field"), p ? p.call(i, e) : s.set(i, e), e), c = (i, s, e) => (x(i, s, "access private method"), e);
6
- import { CSSProperty as P } from "../css-property/index.js";
7
- import { elementResizer as C } from "../element-resizer/index.js";
8
- import { ticker as w } from "../ticker/index.js";
9
- import { i as z } from "../browser-0zX67oeU.js";
10
- import { c as B } from "../jss-CjccJC-K.js";
11
- import { c as F } from "../math-BOBiC4TN.js";
12
- var o, r, d, m, l, u, b, f, n, R, y, g, v, E, k;
13
- class L extends HTMLElement {
14
- constructor() {
15
- super();
16
- h(this, n);
17
- h(this, o, new P(this, "--fps", 0));
18
- h(this, r, null);
19
- h(this, d, null);
20
- h(this, m, 0);
21
- h(this, l, 0);
22
- h(this, u, 1);
23
- h(this, b, 0);
24
- h(this, f, 1);
25
- h(this, g, (e) => {
26
- a(this, u, F(devicePixelRatio, 1, 2)), a(this, m, e.contentRect.width), a(this, l, e.contentRect.height), t(this, r).width = t(this, m) * this.pixelRatio, t(this, r).height = t(this, l) * this.pixelRatio, this.context.scale(this.pixelRatio, this.pixelRatio), c(this, n, k).call(this), c(this, n, E).call(this);
27
- });
28
- h(this, v, (e) => {
29
- a(this, b, e.timestamp), a(this, f, e.timeBetweenFrames), c(this, n, E).call(this);
30
- });
31
- if (z) {
32
- const e = this.attachShadow({ mode: "open" });
33
- e.adoptedStyleSheets.push(
34
- B({
35
- " :host, canvas": {
36
- display: "block",
37
- width: "100%",
38
- height: "100%"
39
- }
40
- })
41
- ), a(this, r, document.createElement("canvas")), a(this, d, t(this, r).getContext("2d")), e.appendChild(t(this, r)), t(this, o).subscribe((p) => {
42
- typeof p.previous != "undefined" && p.current !== p.previous && c(this, n, R).call(this);
43
- });
44
- }
45
- }
46
- get fpsCSSProperty() {
47
- return t(this, o);
48
- }
49
- get canvasElement() {
50
- return t(this, r);
51
- }
52
- get context() {
53
- return t(this, d);
54
- }
55
- get pixelRatio() {
56
- return t(this, u);
57
- }
58
- get width() {
59
- return t(this, m);
60
- }
61
- get height() {
62
- return t(this, l);
63
- }
64
- get detail() {
65
- return {
66
- width: t(this, m),
67
- height: t(this, l),
68
- element: this,
69
- canvasElement: t(this, r),
70
- pixelRatio: t(this, u),
71
- context: t(this, d),
72
- timestamp: t(this, b),
73
- timeBetweenFrames: t(this, f)
74
- };
75
- }
76
- connectedCallback() {
77
- t(this, o).observe(), C.subscribe(this, t(this, g)), c(this, n, R).call(this);
78
- }
79
- disconnectedCallback() {
80
- t(this, o).unobserve(), C.unsubscribe(t(this, g)), c(this, n, y).call(this);
81
- }
82
- }
83
- o = new WeakMap(), r = new WeakMap(), d = new WeakMap(), m = new WeakMap(), l = new WeakMap(), u = new WeakMap(), b = new WeakMap(), f = new WeakMap(), n = new WeakSet(), R = function() {
84
- w.unsubscribe(t(this, v)), this.hasAttribute("static") || w.subscribe(t(this, v), {
85
- culling: this,
86
- maxFPS: t(this, o).current
87
- });
88
- }, y = function() {
89
- w.unsubscribe(t(this, v));
90
- }, g = new WeakMap(), v = new WeakMap(), E = function() {
91
- this.dispatchEvent(
92
- new CustomEvent("canvasRender", {
93
- composed: !0,
94
- detail: this.detail
95
- })
96
- );
97
- }, k = function() {
98
- this.dispatchEvent(
99
- new CustomEvent("canvasResize", {
100
- composed: !0,
101
- detail: this.detail
102
- })
103
- );
104
- };
105
- customElements.get("e-canvas") || customElements.define("e-canvas", L);
106
- export {
107
- L as CanvasElement
108
- };
@@ -1 +0,0 @@
1
- "use strict";function x(r,d){const u=r.measureText(d),e=u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,n=u.width;return{height:e,width:n}}function a(r){return Math.floor(r)+.5}function m(r,d,u,e,n,l){let c=r/d,s=u/e,t=0,i=0;return n=typeof n=="undefined"?.5:n,l=typeof l=="undefined"?.5:l,c>s?(t=e,i=e*c):(i=u,t=u/c),[(u-i)*n,(e-t)*l,i,t]}function y(r,d,u,e,n,l){let c=r/d,s=u/e,t=0,i=0;return n=typeof n=="undefined"?.5:n,l=typeof l=="undefined"?.5:l,c>s?(i=u,t=u/c):(t=e,i=e*c),[(u-i)*n,(e-t)*l,i,t]}exports.contain=y;exports.cover=m;exports.fixPosition=a;exports.measureText=x;
@@ -1,34 +0,0 @@
1
- function i(r, c) {
2
- const u = r.measureText(c), l = u.actualBoundingBoxAscent + u.actualBoundingBoxDescent, n = u.width;
3
- return {
4
- height: l,
5
- width: n
6
- };
7
- }
8
- function x(r) {
9
- return Math.floor(r) + 0.5;
10
- }
11
- function m(r, c, u, l, n, e) {
12
- let a = r / c, s = u / l, t = 0, d = 0;
13
- return n = typeof n == "undefined" ? 0.5 : n, e = typeof e == "undefined" ? 0.5 : e, a > s ? (t = l, d = l * a) : (d = u, t = u / a), [
14
- (u - d) * n,
15
- (l - t) * e,
16
- d,
17
- t
18
- ];
19
- }
20
- function y(r, c, u, l, n, e) {
21
- let a = r / c, s = u / l, t = 0, d = 0;
22
- return n = typeof n == "undefined" ? 0.5 : n, e = typeof e == "undefined" ? 0.5 : e, a > s ? (d = u, t = u / a) : (t = l, d = l * a), [
23
- (u - d) * n,
24
- (l - t) * e,
25
- d,
26
- t
27
- ];
28
- }
29
- export {
30
- y as a,
31
- m as c,
32
- x as f,
33
- i as m
34
- };
@@ -1,24 +0,0 @@
1
- function s(t, h, n = !1) {
2
- let i = t.x - h.width / 2, g = h.height / 2 - t.y;
3
- return n && (i = i / (h.width / 2), g = g / (h.height / 2)), { x: i, y: g };
4
- }
5
- function x(t, h) {
6
- const n = t.x / h.width, i = t.y / h.height;
7
- return { x: n, y: i };
8
- }
9
- function e(t, h) {
10
- return h = h || {
11
- x: 0,
12
- y: 0,
13
- width: document.documentElement.offsetWidth,
14
- height: innerHeight
15
- }, {
16
- x: (t.x - h.x) / h.width * h.width,
17
- y: (t.y - h.y) / h.height * h.height
18
- };
19
- }
20
- export {
21
- e as g,
22
- x as n,
23
- s
24
- };
@@ -1 +0,0 @@
1
- "use strict";function o(t,i,n=!1){let h=t.x-i.width/2,e=i.height/2-t.y;return n&&(h=h/(i.width/2),e=e/(i.height/2)),{x:h,y:e}}function s(t,i){const n=t.x/i.width,h=t.y/i.height;return{x:n,y:h}}function g(t,i){return i=i||{x:0,y:0,width:document.documentElement.offsetWidth,height:innerHeight},{x:(t.x-i.x)/i.width*i.width,y:(t.y-i.y)/i.height*i.height}}exports.getPointerPosition=g;exports.normalize=s;exports.screenToCartesian=o;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../window-resizer/index.cjs");require("../Store-CDb6RMce.cjs");const r=require("../source/index.cjs");class e extends r.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(t){this.consumerElement.src=t||""}}customElements.get("e-image")||customElements.define("e-image",e);exports.ImageElement=e;
@@ -1,10 +0,0 @@
1
- import { SourceElement } from '../source';
2
- export declare class ImageElement extends SourceElement<HTMLImageElement> {
3
- protected createConsumer(): HTMLImageElement;
4
- protected consumeSource(url: string | null): void;
5
- }
6
- declare global {
7
- interface HTMLElementTagNameMap {
8
- 'e-image': ImageElement;
9
- }
10
- }
@@ -1,15 +0,0 @@
1
- import "../window-resizer/index.js";
2
- import "../Store-OTdcl6SX.js";
3
- import { SourceElement as m } from "../source/index.js";
4
- class t extends m {
5
- createConsumer() {
6
- return document.createElement("img");
7
- }
8
- consumeSource(e) {
9
- this.consumerElement.src = e || "";
10
- }
11
- }
12
- customElements.get("e-image") || customElements.define("e-image", t);
13
- export {
14
- t as ImageElement
15
- };
@@ -1,21 +0,0 @@
1
- import { i as s } from "./browser-0zX67oeU.js";
2
- import { c } from "./string-f0Dnk0L1.js";
3
- function o(t) {
4
- let e = "";
5
- for (const r in t) {
6
- const n = t[r];
7
- typeof n == "object" ? (e += `${r} {`, e += o(n), e += "}") : e += `${c(r)}: ${n};`;
8
- }
9
- return e;
10
- }
11
- function a(t) {
12
- if (s) {
13
- const e = new CSSStyleSheet();
14
- return e.replaceSync(o(t)), e;
15
- }
16
- return null;
17
- }
18
- export {
19
- a as c,
20
- o as s
21
- };
@@ -1 +0,0 @@
1
- "use strict";const o=require("./browser-CpzFX2xg.cjs"),c=require("./string-DhgS_iFl.cjs");function s(t){let e="";for(const r in t){const n=t[r];typeof n=="object"?(e+=`${r} {`,e+=s(n),e+="}"):e+=`${c.camelToKebab(r)}: ${n};`}return e}function l(t){if(o.isBrowser){const e=new CSSStyleSheet;return e.replaceSync(s(t)),e}return null}exports.createStylesheet=l;exports.styleToString=s;
@@ -1,45 +0,0 @@
1
- function o(t, n, a) {
2
- return (1 - a) * t + a * n;
3
- }
4
- function p(t, n, a, s) {
5
- return o(t, n, 1 - Math.exp(-a * s));
6
- }
7
- function d(t, n, a = 0, s = 1) {
8
- return n < t ? a : s;
9
- }
10
- function l(t, n = 5) {
11
- return +t.toFixed(n);
12
- }
13
- function i(t, n = 0, a = 0) {
14
- return Math.max(n, Math.min(t, a));
15
- }
16
- function h(t, n, a) {
17
- const c = (t - n[0]) / (n[1] - n[0]) * (a[1] - a[0]) + a[0];
18
- return i(c, a[0], a[1]);
19
- }
20
- function M(t, n, a) {
21
- return t <= n ? 0 : t >= a ? 1 : (t = (t - n) / (a - n), t * t * (3 - 2 * t));
22
- }
23
- function m(t, n, a) {
24
- return t <= n ? 0 : t >= a ? 1 : (t = (t - n) / (a - n), t * t * t * (t * (t * 6 - 15) + 10));
25
- }
26
- function y(t, n) {
27
- const a = n.x - t.x, s = n.y - t.y;
28
- return Math.sqrt(Math.pow(a, 2) + Math.pow(s, 2));
29
- }
30
- function D(t, n, a, s, c, e) {
31
- const r = s - t, u = c - n;
32
- return Math.sqrt(r * r + u * u) - (a + e);
33
- }
34
- export {
35
- M as a,
36
- m as b,
37
- i as c,
38
- p as d,
39
- y as e,
40
- D as f,
41
- o as l,
42
- h as m,
43
- l as r,
44
- d as s
45
- };
@@ -1 +0,0 @@
1
- "use strict";function r(t,n,e){return(1-e)*t+e*n}function p(t,n,e,c){return r(t,n,1-Math.exp(-e*c))}function l(t,n,e=0,c=1){return n<t?e:c}function d(t,n=5){return+t.toFixed(n)}function i(t,n=0,e=0){return Math.max(n,Math.min(t,e))}function f(t,n,e){const a=(t-n[0])/(n[1]-n[0])*(e[1]-e[0])+e[0];return i(a,e[0],e[1])}function h(t,n,e){return t<=n?0:t>=e?1:(t=(t-n)/(e-n),t*t*(3-2*t))}function m(t,n,e){return t<=n?0:t>=e?1:(t=(t-n)/(e-n),t*t*t*(t*(t*6-15)+10))}function M(t,n){const e=n.x-t.x,c=n.y-t.y;return Math.sqrt(Math.pow(e,2)+Math.pow(c,2))}function D(t,n,e,c,a,u){const s=c-t,o=a-n;return Math.sqrt(s*s+o*o)-(e+u)}exports.calculateDistance=M;exports.calculateDistanceWithRadius=D;exports.clamp=i;exports.damp=p;exports.lerp=r;exports.mapRange=f;exports.round=d;exports.smootherstep=m;exports.smoothstep=h;exports.step=l;
@@ -1,22 +0,0 @@
1
- import { Damped, DampedOptions } from '../animation';
2
- import { ElementOrSelector } from '../utils';
3
- export interface PointerParameters {
4
- element: ElementOrSelector<HTMLElement>;
5
- damped?: DampedOptions;
6
- cartesian?: boolean;
7
- normalize?: boolean;
8
- }
9
- export declare class Pointer {
10
- #private;
11
- constructor(parameters: PointerParameters);
12
- get element(): HTMLElement;
13
- get x(): Damped;
14
- get y(): Damped;
15
- get z(): Damped;
16
- get cartesian(): boolean;
17
- set cartesian(value: boolean);
18
- get normalize(): boolean;
19
- set normalize(value: boolean);
20
- connect(): void;
21
- disconnect(): void;
22
- }
@@ -1,13 +0,0 @@
1
- import { Pointer } from './Pointer';
2
- export declare class PointerElement extends HTMLElement {
3
- #private;
4
- constructor();
5
- get pointer(): Pointer;
6
- protected connectedCallback(): void;
7
- protected disconnectedCallback(): void;
8
- }
9
- declare global {
10
- interface HTMLElementTagNameMap {
11
- 'e-pointer': PointerElement;
12
- }
13
- }
@@ -1 +0,0 @@
1
- "use strict";var A=Object.defineProperty;var D=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;var T=i=>{throw TypeError(i)};var M=(i,s,t)=>s in i?A(i,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[s]=t,_=(i,s)=>{for(var t in s||(s={}))F.call(s,t)&&M(i,t,s[t]);if(D)for(var t of D(s))G.call(s,t)&&M(i,t,s[t]);return i};var k=(i,s,t)=>s.has(i)||T("Cannot "+t);var e=(i,s,t)=>(k(i,s,"read from private field"),t?t.call(i):s.get(i)),n=(i,s,t)=>s.has(i)?T("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(i):s.set(i,t),c=(i,s,t,m)=>(k(i,s,"write to private field"),m?m.call(i,t):s.set(i,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-CDb6RMce.cjs");const q=require("../coordinates-D8Np3cPD.cjs"),I=require("../dom-JBOkFLTh.cjs"),H=require("../math-GDWEqu7y.cjs");require("../ticker/index.cjs");const R=require("../Damped-ipnDc0iX.cjs"),j=require("../element-resizer/index.cjs"),B=require("../window-resizer/index.cjs"),P=require("../css-property/index.cjs");var o,a,l,d,y,u,b,x,f,w,C,p;class O{constructor(s){n(this,o);n(this,a);n(this,l);n(this,d);n(this,y);n(this,u);n(this,b,0);n(this,x,0);n(this,f,s=>{e(this,d).set(1)});n(this,w,s=>{e(this,d).set(0)});n(this,C,s=>{const t=q.getPointerPosition(s,e(this,o).getBoundingClientRect()),m={width:e(this,b),height:e(this,x)},h={x:t.x,y:t.y};if(e(this,y)){const z=q.screenToCartesian(h,m);h.x=z.x,h.y=z.y}if(e(this,u)){const z=q.normalize(h,m);h.x=H.clamp(z.x*2,-1,1),h.y=H.clamp(z.y*2,-1,1)}e(this,a).set(h.x),e(this,l).set(h.y)});n(this,p,()=>{c(this,b,this.element.clientWidth),c(this,x,this.element.clientHeight);let s=0,t=0,m=0,h=0;e(this,y)?e(this,u)?(s=-1,t=1,m=-1,h=1):(s=e(this,b)/2*-1,t=e(this,b)/2*1,m=e(this,x)/2*-1,h=e(this,x)/2*1):e(this,u)?(s=0,t=1,m=0,h=1):(s=0,t=e(this,b),m=0,h=e(this,x)),e(this,a).min=s,e(this,a).max=t,e(this,l).min=m,e(this,l).max=h});c(this,o,I.getElement(s.element)),c(this,a,new R.Damped(0,s.damped)),c(this,l,new R.Damped(0,s.damped)),c(this,d,new R.Damped(0,_({min:0,max:1},s.damped))),c(this,y,s.cartesian||!1),c(this,u,s.normalize||!1)}get element(){return e(this,o)}get x(){return e(this,a)}get y(){return e(this,l)}get z(){return e(this,d)}get cartesian(){return e(this,y)}set cartesian(s){c(this,y,s),e(this,p).call(this)}get normalize(){return e(this,u)}set normalize(s){c(this,u,s),e(this,p).call(this)}connect(){e(this,o).addEventListener("pointerenter",e(this,f)),e(this,o).addEventListener("pointerleave",e(this,w)),e(this,o).addEventListener("pointermove",e(this,C)),j.elementResizer.subscribe(e(this,o),e(this,p)),B.windowResizer.subscribe(e(this,p))}disconnect(){e(this,o).removeEventListener("pointerenter",e(this,f)),e(this,o).removeEventListener("pointerleave",e(this,w)),e(this,o).removeEventListener("pointermove",e(this,C)),j.elementResizer.unsubscribe(e(this,p)),B.windowResizer.unsubscribe(e(this,p)),e(this,a).reset(),e(this,l).reset(),e(this,d).reset()}}o=new WeakMap,a=new WeakMap,l=new WeakMap,d=new WeakMap,y=new WeakMap,u=new WeakMap,b=new WeakMap,x=new WeakMap,f=new WeakMap,w=new WeakMap,C=new WeakMap,p=new WeakMap;var r,g,v,S,E,L;class W extends HTMLElement{constructor(){super();n(this,r);n(this,g,new P.CSSProperty(this,"--damping",20));n(this,v,new P.CSSProperty(this,"--mass",0));n(this,S,new P.CSSProperty(this,"--stiffness",0));n(this,E,new P.CSSProperty(this,"--cartesian",!1));n(this,L,new P.CSSProperty(this,"--normalize",!1));c(this,r,new O({element:this})),e(this,g).subscribe(t=>{e(this,r).x.damping=t.current,e(this,r).y.damping=t.current,e(this,r).z.damping=t.current}),e(this,E).subscribe(t=>{e(this,r).cartesian=t.current}),e(this,L).subscribe(t=>{e(this,r).normalize=t.current}),e(this,v).subscribe(t=>{e(this,r).x.mass=t.current,e(this,r).y.mass=t.current,e(this,r).z.mass=t.current}),e(this,S).subscribe(t=>{e(this,r).x.stiffness=t.current,e(this,r).y.stiffness=t.current,e(this,r).z.stiffness=t.current}),e(this,r).x.subscribe(t=>{this.style.setProperty("--x",t.current.toString())}),e(this,r).y.subscribe(t=>{this.style.setProperty("--y",t.current.toString())}),e(this,r).z.subscribe(t=>{this.style.setProperty("--z",t.current.toString())})}get pointer(){return e(this,r)}connectedCallback(){e(this,r).connect(),e(this,g).observe(),e(this,v).observe(),e(this,S).observe()}disconnectedCallback(){e(this,r).disconnect(),e(this,g).unobserve(),e(this,v).unobserve(),e(this,S).unobserve(),this.style.removeProperty("--x"),this.style.removeProperty("--y"),this.style.removeProperty("--z")}}r=new WeakMap,g=new WeakMap,v=new WeakMap,S=new WeakMap,E=new WeakMap,L=new WeakMap;customElements.get("e-pointer")||customElements.define("e-pointer",W);exports.Pointer=O;exports.PointerElement=W;
@@ -1,2 +0,0 @@
1
- export { Pointer, type PointerParameters } from './Pointer';
2
- export { PointerElement } from './PointerElement';
@@ -1,151 +0,0 @@
1
- var q = Object.defineProperty;
2
- var k = Object.getOwnPropertySymbols;
3
- var A = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
4
- var H = (i) => {
5
- throw TypeError(i);
6
- };
7
- var D = (i, s, e) => s in i ? q(i, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[s] = e, M = (i, s) => {
8
- for (var e in s || (s = {}))
9
- A.call(s, e) && D(i, e, s[e]);
10
- if (k)
11
- for (var e of k(s))
12
- F.call(s, e) && D(i, e, s[e]);
13
- return i;
14
- };
15
- var T = (i, s, e) => s.has(i) || H("Cannot " + e);
16
- var t = (i, s, e) => (T(i, s, "read from private field"), e ? e.call(i) : s.get(i)), n = (i, s, e) => s.has(i) ? H("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(i) : s.set(i, e), c = (i, s, e, m) => (T(i, s, "write to private field"), m ? m.call(i, e) : s.set(i, e), e);
17
- import "../Store-OTdcl6SX.js";
18
- import { g as G, s as I, n as J } from "../coordinates-CgdGoSYs.js";
19
- import { g as K } from "../dom-0S_WDL4g.js";
20
- import { c as B } from "../math-BOBiC4TN.js";
21
- import "../ticker/index.js";
22
- import { D as R } from "../Damped-DEHDEq-b.js";
23
- import { elementResizer as W } from "../element-resizer/index.js";
24
- import { windowResizer as j } from "../window-resizer/index.js";
25
- import { CSSProperty as P } from "../css-property/index.js";
26
- var o, a, l, y, b, u, d, f, S, w, E, p;
27
- class N {
28
- constructor(s) {
29
- n(this, o);
30
- n(this, a);
31
- n(this, l);
32
- n(this, y);
33
- n(this, b);
34
- n(this, u);
35
- n(this, d, 0);
36
- n(this, f, 0);
37
- n(this, S, (s) => {
38
- t(this, y).set(1);
39
- });
40
- n(this, w, (s) => {
41
- t(this, y).set(0);
42
- });
43
- n(this, E, (s) => {
44
- const e = G(s, t(this, o).getBoundingClientRect()), m = {
45
- width: t(this, d),
46
- height: t(this, f)
47
- }, h = {
48
- x: e.x,
49
- y: e.y
50
- };
51
- if (t(this, b)) {
52
- const z = I(h, m);
53
- h.x = z.x, h.y = z.y;
54
- }
55
- if (t(this, u)) {
56
- const z = J(h, m);
57
- h.x = B(z.x * 2, -1, 1), h.y = B(z.y * 2, -1, 1);
58
- }
59
- t(this, a).set(h.x), t(this, l).set(h.y);
60
- });
61
- n(this, p, () => {
62
- c(this, d, this.element.clientWidth), c(this, f, this.element.clientHeight);
63
- let s = 0, e = 0, m = 0, h = 0;
64
- t(this, b) ? t(this, u) ? (s = -1, e = 1, m = -1, h = 1) : (s = t(this, d) / 2 * -1, e = t(this, d) / 2 * 1, m = t(this, f) / 2 * -1, h = t(this, f) / 2 * 1) : t(this, u) ? (s = 0, e = 1, m = 0, h = 1) : (s = 0, e = t(this, d), m = 0, h = t(this, f)), t(this, a).min = s, t(this, a).max = e, t(this, l).min = m, t(this, l).max = h;
65
- });
66
- c(this, o, K(s.element)), c(this, a, new R(0, s.damped)), c(this, l, new R(0, s.damped)), c(this, y, new R(0, M({ min: 0, max: 1 }, s.damped))), c(this, b, s.cartesian || !1), c(this, u, s.normalize || !1);
67
- }
68
- get element() {
69
- return t(this, o);
70
- }
71
- get x() {
72
- return t(this, a);
73
- }
74
- get y() {
75
- return t(this, l);
76
- }
77
- get z() {
78
- return t(this, y);
79
- }
80
- get cartesian() {
81
- return t(this, b);
82
- }
83
- set cartesian(s) {
84
- c(this, b, s), t(this, p).call(this);
85
- }
86
- get normalize() {
87
- return t(this, u);
88
- }
89
- set normalize(s) {
90
- c(this, u, s), t(this, p).call(this);
91
- }
92
- connect() {
93
- t(this, o).addEventListener("pointerenter", t(this, S)), t(this, o).addEventListener("pointerleave", t(this, w)), t(this, o).addEventListener("pointermove", t(this, E)), W.subscribe(t(this, o), t(this, p)), j.subscribe(t(this, p));
94
- }
95
- disconnect() {
96
- t(this, o).removeEventListener(
97
- "pointerenter",
98
- t(this, S)
99
- ), t(this, o).removeEventListener(
100
- "pointerleave",
101
- t(this, w)
102
- ), t(this, o).removeEventListener("pointermove", t(this, E)), W.unsubscribe(t(this, p)), j.unsubscribe(t(this, p)), t(this, a).reset(), t(this, l).reset(), t(this, y).reset();
103
- }
104
- }
105
- o = new WeakMap(), a = new WeakMap(), l = new WeakMap(), y = new WeakMap(), b = new WeakMap(), u = new WeakMap(), d = new WeakMap(), f = new WeakMap(), S = new WeakMap(), w = new WeakMap(), E = new WeakMap(), p = new WeakMap();
106
- var r, g, v, x, L, C;
107
- class O extends HTMLElement {
108
- constructor() {
109
- super();
110
- n(this, r);
111
- n(this, g, new P(this, "--damping", 20));
112
- n(this, v, new P(this, "--mass", 0));
113
- n(this, x, new P(this, "--stiffness", 0));
114
- n(this, L, new P(this, "--cartesian", !1));
115
- n(this, C, new P(this, "--normalize", !1));
116
- c(this, r, new N({
117
- element: this
118
- })), t(this, g).subscribe((e) => {
119
- t(this, r).x.damping = e.current, t(this, r).y.damping = e.current, t(this, r).z.damping = e.current;
120
- }), t(this, L).subscribe((e) => {
121
- t(this, r).cartesian = e.current;
122
- }), t(this, C).subscribe((e) => {
123
- t(this, r).normalize = e.current;
124
- }), t(this, v).subscribe((e) => {
125
- t(this, r).x.mass = e.current, t(this, r).y.mass = e.current, t(this, r).z.mass = e.current;
126
- }), t(this, x).subscribe((e) => {
127
- t(this, r).x.stiffness = e.current, t(this, r).y.stiffness = e.current, t(this, r).z.stiffness = e.current;
128
- }), t(this, r).x.subscribe((e) => {
129
- this.style.setProperty("--x", e.current.toString());
130
- }), t(this, r).y.subscribe((e) => {
131
- this.style.setProperty("--y", e.current.toString());
132
- }), t(this, r).z.subscribe((e) => {
133
- this.style.setProperty("--z", e.current.toString());
134
- });
135
- }
136
- get pointer() {
137
- return t(this, r);
138
- }
139
- connectedCallback() {
140
- t(this, r).connect(), t(this, g).observe(), t(this, v).observe(), t(this, x).observe();
141
- }
142
- disconnectedCallback() {
143
- t(this, r).disconnect(), t(this, g).unobserve(), t(this, v).unobserve(), t(this, x).unobserve(), this.style.removeProperty("--x"), this.style.removeProperty("--y"), this.style.removeProperty("--z");
144
- }
145
- }
146
- r = new WeakMap(), g = new WeakMap(), v = new WeakMap(), x = new WeakMap(), L = new WeakMap(), C = new WeakMap();
147
- customElements.get("e-pointer") || customElements.define("e-pointer", O);
148
- export {
149
- N as Pointer,
150
- O as PointerElement
151
- };
@@ -1 +0,0 @@
1
- "use strict";const i=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10];function o(e,n=5){return Math.round(e*i[n])/i[n]}function u(e,n){return Math.round(e/n)*n}function c(e,n){var r;const t=((r=n.toString().split(".")[1])==null?void 0:r.length)||0;return t?+e.toFixed(t):Math.ceil(e)}function s(e,n){return typeof e=="undefined"?n:e}exports.nullishCoalescing=s;exports.preciseNumber=o;exports.roundNumberTo=u;exports.toStep=c;