aptechka 0.1.8 → 0.1.10
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/Composed-C2Vv1xxR.cjs +1 -0
- package/lib/Composed-DhtYBEmo.js +79 -0
- package/lib/abstract-elements/index.cjs +1 -1
- package/lib/abstract-elements/index.js +1 -1
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +2 -2
- package/lib/component/Component.d.ts +29 -0
- package/lib/component/hooks/animation.d.ts +9 -0
- package/lib/component/hooks/context.d.ts +2 -0
- package/lib/component/hooks/intersection.d.ts +4 -0
- package/lib/component/hooks/resize.d.ts +6 -0
- package/lib/component/hooks/shadow.d.ts +1 -0
- package/lib/component/hooks/stores.d.ts +6 -0
- package/lib/component/hooks/style.d.ts +2 -0
- package/lib/component/index.cjs +1 -0
- package/lib/component/index.d.ts +7 -0
- package/lib/component/index.js +187 -0
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.d.ts +4 -3
- package/lib/connector/index.js +24 -22
- package/lib/{createStylesheet-BsVHqHhr.cjs → createStylesheet-BoJwXvjE.cjs} +1 -1
- package/lib/{createStylesheet-ITfBHk7A.js → createStylesheet-DSgkNlUZ.js} +1 -1
- package/lib/element-constructor/ElementConstructor.d.ts +4 -3
- package/lib/element-constructor/index.cjs +1 -1
- package/lib/element-constructor/index.js +2 -2
- package/lib/element-constructor/tags.d.ts +2 -3
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.d.ts +1 -1
- package/lib/element-resizer/index.js +2 -1
- package/lib/en3/core/en3.d.ts +2 -2
- package/lib/en3/objects/En3Clip.d.ts +1 -1
- package/lib/{index-COirQu7j.js → index-228VqUsZ.js} +2 -2
- package/lib/{index-Bt91QUTY.cjs → index-Cv4y7_7y.cjs} +1 -1
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.d.ts +1 -1
- package/lib/intersector/index.js +2 -1
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +2 -2
- package/lib/layout-box/index.js +70 -72
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.js +2 -2
- package/lib/object-C1ph624j.cjs +1 -0
- package/lib/object-DIPjdukP.js +73 -0
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +79 -71
- package/lib/router/Route.d.ts +8 -2
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.d.ts +1 -2
- package/lib/router/index.js +139 -140
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +2 -2
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.js +1 -1
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +48 -111
- package/lib/studio/index.cjs +1 -1
- package/lib/studio/index.js +3 -3
- package/lib/tags-920hsh9U.cjs +1 -0
- package/lib/tags-kZqsS_nJ.js +793 -0
- package/lib/theme/index.cjs +1 -1
- package/lib/theme/index.js +1 -1
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.d.ts +1 -1
- package/lib/ticker/index.js +42 -36
- package/lib/utils/dom.d.ts +2 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +113 -168
- package/lib/utils/object.d.ts +1 -0
- package/package.json +10 -2
- package/lib/router/RouteElement.d.ts +0 -14
- package/lib/tags-8Y7LSTwg.js +0 -779
- package/lib/tags-pcim-Cws.cjs +0 -1
package/lib/theme/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-D0_rDIsE.cjs");const r=require("../browser-CpzFX2xg.cjs"),t=require("../tags-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../Store-D0_rDIsE.cjs");const r=require("../browser-CpzFX2xg.cjs"),t=require("../tags-920hsh9U.cjs"),a=require("../createTheme-COo8IzPG.cjs"),e=a.createTheme({colorDark:"#1c1c1c",colorDarkAux:"#282828",colorLight:"#ffffff",colorActive:"#00E5B0",tweakerWidth:"480px",tweakerOffset:"20px",tweakerFolderHeight:"40px",heightInput:"30px",borderRadius:"12px",gapLarge:"16px",gapMedium:"12px",gapSmall:"8px",gapExtraSmall:"4px",fontSizeLarge:"20px",fontSizeMedium:"16px",fontSizeSmall:"14px",durationShort:"0.2s"},{prefix:"aptechka-"});r.isBrowser&&document.head.appendChild(t.style({":root":e.style}).node);exports.aptechkaTheme=e;
|
package/lib/theme/index.js
CHANGED
package/lib/ticker/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var A=(r,e,s)=>{if(!e.has(r))throw TypeError("Cannot "+s)};var i=(r,e,s)=>(A(r,e,"read from private field"),s?s.call(r):e.get(r)),h=(r,e,s)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,s)},t=(r,e,s,n)=>(A(r,e,"write to private field"),n?n.call(r,s):e.set(r,s),s);var T=(r,e,s)=>(A(r,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../intersector/index.cjs"),L=require("../browser-CpzFX2xg.cjs");var f,l,g,b,u,m,y;class M{constructor(e,s){h(this,f,void 0);h(this,l,void 0);h(this,g,void 0);h(this,b,0);h(this,u,0);h(this,m,!1);h(this,y,e=>{t(this,m,e.isIntersecting)});t(this,f,e),t(this,l,s==null?void 0:s.maxFPS),t(this,g,(s==null?void 0:s.order)||0),s!=null&&s.culling&&L.isBrowser?x.intersector.subscribe(s.culling,i(this,y)):t(this,m,!0)}get callback(){return i(this,f)}get order(){return i(this,g)}sync(e){t(this,b,e-i(this,u))}tick(e){if(t(this,u,Math.max(0,e-i(this,b))),i(this,l))if(i(this,u)>=1e3/i(this,l))t(this,b,e-i(this,u)%i(this,l));else return;else t(this,b,e);i(this,m)&&i(this,f).call(this,{elapsed:i(this,u),timestamp:e})}destroy(){x.intersector.unsubscribe(i(this,y))}}f=new WeakMap,l=new WeakMap,g=new WeakMap,b=new WeakMap,u=new WeakMap,m=new WeakMap,y=new WeakMap;var k,d,a,o,c,q,E,F,S,v,w;class B{constructor(){h(this,q);h(this,F);h(this,k,0);h(this,d,0);h(this,a,void 0);h(this,o,!1);h(this,c,[]);h(this,v,e=>{if(i(this,o)){t(this,o,!1),t(this,k,e-i(this,d));for(const s of i(this,c))s.sync(i(this,d))}t(this,a,requestAnimationFrame(i(this,v))),t(this,d,e-i(this,k));for(const s of i(this,c))s.tick(i(this,d))});h(this,w,()=>{document.hidden&&t(this,o,!0)});L.isBrowser&&document.addEventListener("visibilitychange",i(this,w))}subscribe(e,s){if(!i(this,c).find(n=>n.callback===e)){const n=new M(e,s);n.sync(performance.now()),i(this,c).push(n),t(this,c,i(this,c).sort((P,I)=>P.order-I.order))}return T(this,q,E).call(this),()=>this.unsubscribe(e)}unsubscribe(e){const s=i(this,c).filter(n=>n.callback===e);s.length&&(s.forEach(n=>n.destroy()),t(this,c,i(this,c).filter(n=>n.callback!==e)),i(this,c).length||T(this,F,S).call(this))}destroy(){L.isBrowser&&(T(this,F,S).call(this),document.removeEventListener("visibilitychange",i(this,w)))}}k=new WeakMap,d=new WeakMap,a=new WeakMap,o=new WeakMap,c=new WeakMap,q=new WeakSet,E=function(){i(this,c).length&&!i(this,a)&&t(this,a,requestAnimationFrame(i(this,v)))},F=new WeakSet,S=function(){i(this,a)&&(cancelAnimationFrame(i(this,a)),t(this,a,void 0))},v=new WeakMap,w=new WeakMap;const V=new B;exports.Ticker=B;exports.ticker=V;
|
package/lib/ticker/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface TickerAddOptions {
|
|
|
12
12
|
export declare class Ticker {
|
|
13
13
|
#private;
|
|
14
14
|
constructor();
|
|
15
|
-
subscribe(callback: TickerCallback, options?: TickerAddOptions): void;
|
|
15
|
+
subscribe(callback: TickerCallback, options?: TickerAddOptions): () => void;
|
|
16
16
|
unsubscribe(callback: TickerCallback): void;
|
|
17
17
|
destroy(): void;
|
|
18
18
|
}
|
package/lib/ticker/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
1
|
+
var x = (r, s, t) => {
|
|
2
2
|
if (!s.has(r))
|
|
3
3
|
throw TypeError("Cannot " + t);
|
|
4
4
|
};
|
|
5
|
-
var i = (r, s, t) => (
|
|
5
|
+
var i = (r, s, t) => (x(r, s, "read from private field"), t ? t.call(r) : s.get(r)), h = (r, s, t) => {
|
|
6
6
|
if (s.has(r))
|
|
7
7
|
throw TypeError("Cannot add the same private member more than once");
|
|
8
8
|
s instanceof WeakSet ? s.add(r) : s.set(r, t);
|
|
9
|
-
}, e = (r, s, t, n) => (
|
|
10
|
-
var
|
|
9
|
+
}, e = (r, s, t, n) => (x(r, s, "write to private field"), n ? n.call(r, t) : s.set(r, t), t);
|
|
10
|
+
var L = (r, s, t) => (x(r, s, "access private method"), t);
|
|
11
11
|
import { intersector as E } from "../intersector/index.js";
|
|
12
|
-
import { i as
|
|
13
|
-
var m, u,
|
|
12
|
+
import { i as T } from "../browser-0zX67oeU.js";
|
|
13
|
+
var m, u, g, f, l, d, y;
|
|
14
14
|
class V {
|
|
15
15
|
constructor(s, t) {
|
|
16
16
|
h(this, m, void 0);
|
|
17
17
|
h(this, u, void 0);
|
|
18
|
-
h(this,
|
|
18
|
+
h(this, g, void 0);
|
|
19
19
|
h(this, f, 0);
|
|
20
20
|
h(this, l, 0);
|
|
21
21
|
h(this, d, !1);
|
|
22
|
-
h(this,
|
|
22
|
+
h(this, y, (s) => {
|
|
23
23
|
e(this, d, s.isIntersecting);
|
|
24
24
|
});
|
|
25
|
-
e(this, m, s), e(this, u, t == null ? void 0 : t.maxFPS), e(this,
|
|
25
|
+
e(this, m, s), e(this, u, t == null ? void 0 : t.maxFPS), e(this, g, (t == null ? void 0 : t.order) || 0), t != null && t.culling && T ? E.subscribe(t.culling, i(this, y)) : e(this, d, !0);
|
|
26
26
|
}
|
|
27
27
|
get callback() {
|
|
28
28
|
return i(this, m);
|
|
29
29
|
}
|
|
30
30
|
get order() {
|
|
31
|
-
return i(this,
|
|
31
|
+
return i(this, g);
|
|
32
32
|
}
|
|
33
33
|
sync(s) {
|
|
34
34
|
e(this, f, s - i(this, l));
|
|
@@ -47,59 +47,65 @@ class V {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
destroy() {
|
|
50
|
-
E.unsubscribe(i(this,
|
|
50
|
+
E.unsubscribe(i(this, y));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
m = new WeakMap(), u = new WeakMap(),
|
|
54
|
-
var
|
|
53
|
+
m = new WeakMap(), u = new WeakMap(), g = new WeakMap(), f = new WeakMap(), l = new WeakMap(), d = new WeakMap(), y = new WeakMap();
|
|
54
|
+
var F, b, a, o, c, w, S, k, q, v, A;
|
|
55
55
|
class B {
|
|
56
56
|
constructor() {
|
|
57
|
-
h(this,
|
|
58
|
-
h(this,
|
|
59
|
-
h(this,
|
|
57
|
+
h(this, w);
|
|
58
|
+
h(this, k);
|
|
59
|
+
h(this, F, 0);
|
|
60
60
|
h(this, b, 0);
|
|
61
61
|
h(this, a, void 0);
|
|
62
62
|
h(this, o, !1);
|
|
63
63
|
h(this, c, []);
|
|
64
|
-
h(this,
|
|
64
|
+
h(this, v, (s) => {
|
|
65
65
|
if (i(this, o)) {
|
|
66
|
-
e(this, o, !1), e(this,
|
|
66
|
+
e(this, o, !1), e(this, F, s - i(this, b));
|
|
67
67
|
for (const t of i(this, c))
|
|
68
68
|
t.sync(i(this, b));
|
|
69
69
|
}
|
|
70
|
-
e(this, a, requestAnimationFrame(i(this,
|
|
70
|
+
e(this, a, requestAnimationFrame(i(this, v))), e(this, b, s - i(this, F));
|
|
71
71
|
for (const t of i(this, c))
|
|
72
72
|
t.tick(i(this, b));
|
|
73
73
|
});
|
|
74
|
-
h(this,
|
|
74
|
+
h(this, A, () => {
|
|
75
75
|
document.hidden && e(this, o, !0);
|
|
76
76
|
});
|
|
77
|
-
|
|
77
|
+
T && document.addEventListener(
|
|
78
|
+
"visibilitychange",
|
|
79
|
+
i(this, A)
|
|
80
|
+
);
|
|
78
81
|
}
|
|
79
82
|
subscribe(s, t) {
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
n.sync(performance.now()), i(this, c).push(n), e(this, c, i(this, c).sort((I, P) => I.order - P.order));
|
|
84
|
-
}
|
|
85
|
-
w(this, x, S).call(this);
|
|
83
|
+
if (!i(this, c).find((n) => n.callback === s)) {
|
|
84
|
+
const n = new V(s, t);
|
|
85
|
+
n.sync(performance.now()), i(this, c).push(n), e(this, c, i(this, c).sort((I, P) => I.order - P.order));
|
|
86
86
|
}
|
|
87
|
+
return L(this, w, S).call(this), () => this.unsubscribe(s);
|
|
87
88
|
}
|
|
88
89
|
unsubscribe(s) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
t.length && (t.forEach((n) => n.destroy()), e(this, c, i(this, c).filter(
|
|
90
|
+
const t = i(this, c).filter(
|
|
91
|
+
(n) => n.callback === s
|
|
92
|
+
);
|
|
93
|
+
t.length && (t.forEach((n) => n.destroy()), e(this, c, i(this, c).filter(
|
|
94
|
+
(n) => n.callback !== s
|
|
95
|
+
)), i(this, c).length || L(this, k, q).call(this));
|
|
93
96
|
}
|
|
94
97
|
destroy() {
|
|
95
|
-
|
|
98
|
+
T && (L(this, k, q).call(this), document.removeEventListener(
|
|
99
|
+
"visibilitychange",
|
|
100
|
+
i(this, A)
|
|
101
|
+
));
|
|
96
102
|
}
|
|
97
103
|
}
|
|
98
|
-
|
|
99
|
-
i(this, c).length && !i(this, a) && e(this, a, requestAnimationFrame(i(this,
|
|
100
|
-
},
|
|
104
|
+
F = new WeakMap(), b = new WeakMap(), a = new WeakMap(), o = new WeakMap(), c = new WeakMap(), w = new WeakSet(), S = function() {
|
|
105
|
+
i(this, c).length && !i(this, a) && e(this, a, requestAnimationFrame(i(this, v)));
|
|
106
|
+
}, k = new WeakSet(), q = function() {
|
|
101
107
|
i(this, a) && (cancelAnimationFrame(i(this, a)), e(this, a, void 0));
|
|
102
|
-
},
|
|
108
|
+
}, v = new WeakMap(), A = new WeakMap();
|
|
103
109
|
const M = new B();
|
|
104
110
|
export {
|
|
105
111
|
B as Ticker,
|
package/lib/utils/dom.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare function findParentElement<T extends typeof Element>(element: Element | null, Constructor: T): T | null;
|
|
2
|
-
export type ElementOrSelector<T extends
|
|
3
|
-
export declare function getElement<T extends
|
|
2
|
+
export type ElementOrSelector<T extends Element = Element> = string | T;
|
|
3
|
+
export declare function getElement<T extends Element>(elementOrSelector: ElementOrSelector<T> | undefined, from?: Document): T | null | undefined;
|
|
4
4
|
export declare function findScrollParentElement(node: Node | null, _initial?: Node | null): HTMLElement;
|
package/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),f=require("../browser-CpzFX2xg.cjs"),p=require("../dom-qY2LdCVL.cjs"),n=require("../easings-DsS5-Kqc.cjs"),I=require("../events-Crwi8fz6.cjs"),y=require("../file-EevnUtRj.cjs"),g=require("../function-MthRj-GJ.cjs"),h=require("../layout-8ryRAMGJ.cjs"),u=require("../math-GDWEqu7y.cjs"),O=require("../number-yVpzMdbQ.cjs"),o=require("../object-C1ph624j.cjs"),r=require("../string-DzUwFYSS.cjs"),C=require("../style-At6aDoqG.cjs");function E(t,e,...i){return[...t.slice(0,e),...i,...t.slice(e)]}function w(t,e){const i=t.measureText(e),a=i.actualBoundingBoxAscent+i.actualBoundingBoxDescent,s=i.width;return{height:a,width:s}}function Q(t){return Math.floor(t)+.5}function S(t,e,i,a,s,l){let m=t/e,x=i/a,c=0,d=0;return s=typeof s=="undefined"?.5:s,l=typeof l=="undefined"?.5:l,m>x?(c=a,d=a*m):(d=i,c=i/m),[(i-d)*s,(a-c)*l,d,c]}function T(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function D(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function P(t,e,i=!1){let a=t.x-e.width/2,s=e.height/2-t.y;return i&&(a=a/(e.width/2),s=s/(e.height/2)),{x:a,y:s}}function q(t,e){const i=t.x/e.x,a=t.y/e.y;return{x:i,y:a}}function v(t,e){return e=e||{x:0,y:0,width:document.documentElement.offsetWidth,height:innerHeight},{x:(t.x-e.x)/e.width*e.width,y:(t.y-e.y)/e.height*e.height}}function R(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function N(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}exports.parseAttribute=b.parseAttribute;exports.parseAttributeValue=b.parseAttributeValue;exports.isBrowser=f.isBrowser;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getElement=p.getElement;exports.easeInCubic=n.easeInCubic;exports.easeInExpo=n.easeInExpo;exports.easeInOutCubic=n.easeInOutCubic;exports.easeInOutExpo=n.easeInOutExpo;exports.easeInOutQuad=n.easeInOutQuad;exports.easeInOutQuart=n.easeInOutQuart;exports.easeInOutQuint=n.easeInOutQuint;exports.easeInQuad=n.easeInQuad;exports.easeInQuart=n.easeInQuart;exports.easeInQuint=n.easeInQuint;exports.easeOutCubic=n.easeOutCubic;exports.easeOutExpo=n.easeOutExpo;exports.easeOutQuad=n.easeOutQuad;exports.easeOutQuart=n.easeOutQuart;exports.easeOutQuint=n.easeOutQuint;exports.linear=n.linear;exports.dispatchSizeChangeEvent=I.dispatchSizeChangeEvent;exports.createJSONAndSave=y.createJSONAndSave;exports.debounce=g.debounce;exports.throttle=g.throttle;exports.getCumulativeOffsetLeft=h.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=h.getCumulativeOffsetTop;exports.getCumulativePosition=h.getCumulativePosition;exports.calculateDistance=u.calculateDistance;exports.calculateDistanceWithRadius=u.calculateDistanceWithRadius;exports.clamp=u.clamp;exports.damp=u.damp;exports.lerp=u.lerp;exports.mapRange=u.mapRange;exports.round=u.round;exports.smootherstep=u.smootherstep;exports.smoothstep=u.smoothstep;exports.step=u.step;exports.preciseNumber=O.preciseNumber;exports.roundNumberTo=O.roundNumberTo;exports.cloneDeep=o.cloneDeep;exports.compareObjects=o.compareObjects;exports.isESClass=o.isESClass;exports.isNullish=o.isNullish;exports.isObject=o.isObject;exports.mergeDeep=o.mergeDeep;exports.omit=o.omit;exports.pick=o.pick;exports.camelToKebab=r.camelToKebab;exports.capitalize=r.capitalize;exports.generateId=r.generateId;exports.kebabToCamel=r.kebabToCamel;exports.snakeToDotted=r.snakeToDotted;exports.toPascalCase=r.toPascalCase;exports.getElementTransitionDurationMS=C.getElementTransitionDurationMS;exports.getElementTransitionDurationS=C.getElementTransitionDurationS;exports.cover=S;exports.decode=N;exports.dotCircleCollision=D;exports.dotRectCollision=T;exports.encode=R;exports.fixPosition=Q;exports.getPointerPosition=v;exports.insert=E;exports.measureText=w;exports.normalize=q;exports.screenToCartesian=P;
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { debounce, throttle } from './function';
|
|
|
13
13
|
export { getCumulativePosition, getCumulativeOffsetLeft, getCumulativeOffsetTop, } from './layout';
|
|
14
14
|
export { lerp, damp, step, round, clamp, mapRange, smoothstep, smootherstep, calculateDistance, calculateDistanceWithRadius, } from './math';
|
|
15
15
|
export { preciseNumber, roundNumberTo } from './number';
|
|
16
|
-
export { isObject, cloneDeep, mergeDeep, isNullish, compareObjects, pick, omit, } from './object';
|
|
16
|
+
export { isObject, cloneDeep, mergeDeep, isNullish, compareObjects, pick, omit, isESClass, } from './object';
|
|
17
17
|
export { kebabToCamel, camelToKebab, snakeToDotted, toPascalCase, capitalize, generateId, } from './string';
|
|
18
18
|
export { getElementTransitionDurationMS, getElementTransitionDurationS, } from './style';
|
|
19
19
|
export type { Axes2D, Axes3D, Dot2D, Rect2D, Circle, Dot3D, Rect3D, } from './ts-shape';
|
package/lib/utils/index.js
CHANGED
|
@@ -1,193 +1,138 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { i as
|
|
3
|
-
import { f as
|
|
4
|
-
import { c as
|
|
5
|
-
import { d as
|
|
6
|
-
import { c as
|
|
7
|
-
import { d as
|
|
8
|
-
import { g as
|
|
9
|
-
import { e as
|
|
10
|
-
import { p as
|
|
11
|
-
import { c as
|
|
12
|
-
import { g as ve,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { a as I, p as E } from "../attributes-69we3byR.js";
|
|
2
|
+
import { i as S } from "../browser-0zX67oeU.js";
|
|
3
|
+
import { f as P, a as R, g as T } from "../dom-BY7JhTx5.js";
|
|
4
|
+
import { c as v, n as B, f as A, p as N, b as j, i as M, m as z, e as U, g as q, j as J, d as K, o as V, a as F, h as G, k as W, l as X } from "../easings-BKi40vHz.js";
|
|
5
|
+
import { d as Z } from "../events-_C2CztxR.js";
|
|
6
|
+
import { c as $ } from "../file-lxi_oXJf.js";
|
|
7
|
+
import { d as L, t as ee } from "../function-C10DGppn.js";
|
|
8
|
+
import { g as te, a as se, b as ne } from "../layout-HoBT_Da2.js";
|
|
9
|
+
import { e as ie, f as ue, c as re, d as le, l as de, m as me, r as ce, b as pe, a as xe, s as fe } from "../math-BOBiC4TN.js";
|
|
10
|
+
import { p as ge, r as be } from "../number-Bo5RdrA1.js";
|
|
11
|
+
import { c as ye, d as Ce, i as Oe, b as Ie, a as Ee, m as Qe, o as Se, p as De } from "../object-DIPjdukP.js";
|
|
12
|
+
import { c as Re, a as Te, g as ke, k as ve, s as Be, t as Ae } from "../string-BrDhnNUL.js";
|
|
13
|
+
import { g as je, a as Me } from "../style-j2TwriJ_.js";
|
|
14
|
+
function d(a, e, ...t) {
|
|
15
|
+
return [...a.slice(0, e), ...t, ...a.slice(e)];
|
|
16
|
+
}
|
|
17
|
+
function m(a, e) {
|
|
18
|
+
const t = a.measureText(e), s = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent, n = t.width;
|
|
18
19
|
return {
|
|
19
20
|
height: s,
|
|
20
|
-
width:
|
|
21
|
+
width: n
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
return Math.floor(
|
|
24
|
+
function c(a) {
|
|
25
|
+
return Math.floor(a) + 0.5;
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
let
|
|
28
|
-
return
|
|
29
|
-
(
|
|
30
|
-
(s - i) *
|
|
27
|
+
function p(a, e, t, s, n, o) {
|
|
28
|
+
let r = a / e, l = t / s, i = 0, u = 0;
|
|
29
|
+
return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, r > l ? (i = s, u = s * r) : (u = t, i = t / r), [
|
|
30
|
+
(t - u) * n,
|
|
31
|
+
(s - i) * o,
|
|
31
32
|
u,
|
|
32
33
|
i
|
|
33
34
|
];
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
36
|
+
function x(a, e) {
|
|
37
|
+
return a.x < e.x + e.width && a.x > e.x && a.y < e.y + e.height && a.y > e.y;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
return Math.sqrt((
|
|
39
|
+
function f(a, e) {
|
|
40
|
+
return Math.sqrt((a.x - e.x) ** 2 + (a.y - e.y) ** 2) < e.radius;
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
let s =
|
|
43
|
-
return
|
|
42
|
+
function h(a, e, t = !1) {
|
|
43
|
+
let s = a.x - e.width / 2, n = e.height / 2 - a.y;
|
|
44
|
+
return t && (s = s / (e.width / 2), n = n / (e.height / 2)), { x: s, y: n };
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
const
|
|
47
|
-
return { x:
|
|
46
|
+
function g(a, e) {
|
|
47
|
+
const t = a.x / e.x, s = a.y / e.y;
|
|
48
|
+
return { x: t, y: s };
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
-
return
|
|
50
|
+
function b(a, e) {
|
|
51
|
+
return e = e || {
|
|
51
52
|
x: 0,
|
|
52
53
|
y: 0,
|
|
53
54
|
width: document.documentElement.offsetWidth,
|
|
54
55
|
height: innerHeight
|
|
55
56
|
}, {
|
|
56
|
-
x: (
|
|
57
|
-
y: (
|
|
57
|
+
x: (a.x - e.x) / e.width * e.width,
|
|
58
|
+
y: (a.y - e.y) / e.height * e.height
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
const
|
|
62
|
-
return decodeURIComponent(window.escape(
|
|
63
|
-
}
|
|
64
|
-
function D(e) {
|
|
65
|
-
const t = window.unescape(encodeURIComponent(e));
|
|
66
|
-
return window.btoa(t);
|
|
67
|
-
}
|
|
68
|
-
function l(e) {
|
|
69
|
-
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
70
|
-
}
|
|
71
|
-
function d(e) {
|
|
72
|
-
if (e === null || typeof e != "object")
|
|
73
|
-
return e;
|
|
74
|
-
if (e instanceof Date)
|
|
75
|
-
return new Date(e.getTime());
|
|
76
|
-
if (e instanceof Node)
|
|
77
|
-
return e;
|
|
78
|
-
const t = Array.isArray(e) ? [] : {};
|
|
79
|
-
for (const n in e)
|
|
80
|
-
e.hasOwnProperty(n) && (t[n] = d(e[n]));
|
|
81
|
-
return t;
|
|
82
|
-
}
|
|
83
|
-
function p(e, t, n = l) {
|
|
84
|
-
for (const s in t)
|
|
85
|
-
n(t[s]) ? (e[s] || Object.assign(e, { [s]: {} }), p(e[s], t[s], n)) : Object.assign(e, { [s]: t[s] });
|
|
86
|
-
return e;
|
|
87
|
-
}
|
|
88
|
-
function m(e) {
|
|
89
|
-
return e === null || typeof e == "undefined";
|
|
90
|
-
}
|
|
91
|
-
function f(e, t) {
|
|
92
|
-
if (typeof e != typeof t)
|
|
93
|
-
return !1;
|
|
94
|
-
if ([e, t].some((n) => m(n)))
|
|
95
|
-
return e === t;
|
|
96
|
-
if (Array.isArray(e)) {
|
|
97
|
-
const n = e.length > t.length ? e : t, s = e.length > t.length ? t : e;
|
|
98
|
-
return n.every((a, r) => f(a, s[r]));
|
|
99
|
-
}
|
|
100
|
-
if (typeof e != "object" || e instanceof Node || typeof e == "object" && e.constructor.toString().startsWith("class"))
|
|
101
|
-
return e === t;
|
|
102
|
-
for (const n in e) {
|
|
103
|
-
if (!t.hasOwnProperty(n))
|
|
104
|
-
return !1;
|
|
105
|
-
if (typeof e[n] == "object" && typeof t[n] == "object") {
|
|
106
|
-
if (!f(e[n], t[n]))
|
|
107
|
-
return !1;
|
|
108
|
-
} else if (e[n] !== t[n])
|
|
109
|
-
return !1;
|
|
110
|
-
}
|
|
111
|
-
return !0;
|
|
112
|
-
}
|
|
113
|
-
function E(e, t) {
|
|
114
|
-
const n = {};
|
|
115
|
-
for (const s in e)
|
|
116
|
-
t.includes(s) && (n[s] = e[s]);
|
|
117
|
-
return n;
|
|
61
|
+
function w(a) {
|
|
62
|
+
const e = window.atob(a);
|
|
63
|
+
return decodeURIComponent(window.escape(e));
|
|
118
64
|
}
|
|
119
|
-
function
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
t.includes(s) || (n[s] = e[s]);
|
|
123
|
-
return n;
|
|
65
|
+
function y(a) {
|
|
66
|
+
const e = window.unescape(encodeURIComponent(a));
|
|
67
|
+
return window.btoa(e);
|
|
124
68
|
}
|
|
125
69
|
export {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
70
|
+
ie as calculateDistance,
|
|
71
|
+
ue as calculateDistanceWithRadius,
|
|
72
|
+
Re as camelToKebab,
|
|
73
|
+
Te as capitalize,
|
|
74
|
+
re as clamp,
|
|
75
|
+
ye as cloneDeep,
|
|
76
|
+
Ce as compareObjects,
|
|
77
|
+
p as cover,
|
|
78
|
+
$ as createJSONAndSave,
|
|
79
|
+
le as damp,
|
|
80
|
+
L as debounce,
|
|
81
|
+
y as decode,
|
|
82
|
+
Z as dispatchSizeChangeEvent,
|
|
83
|
+
f as dotCircleCollision,
|
|
84
|
+
x as dotRectCollision,
|
|
85
|
+
v as easeInCubic,
|
|
86
|
+
B as easeInExpo,
|
|
87
|
+
A as easeInOutCubic,
|
|
88
|
+
N as easeInOutExpo,
|
|
89
|
+
j as easeInOutQuad,
|
|
90
|
+
M as easeInOutQuart,
|
|
91
|
+
z as easeInOutQuint,
|
|
92
|
+
U as easeInQuad,
|
|
93
|
+
q as easeInQuart,
|
|
94
|
+
J as easeInQuint,
|
|
95
|
+
K as easeOutCubic,
|
|
96
|
+
V as easeOutExpo,
|
|
97
|
+
F as easeOutQuad,
|
|
98
|
+
G as easeOutQuart,
|
|
99
|
+
W as easeOutQuint,
|
|
100
|
+
w as encode,
|
|
101
|
+
P as findParentElement,
|
|
102
|
+
R as findScrollParentElement,
|
|
103
|
+
c as fixPosition,
|
|
104
|
+
ke as generateId,
|
|
105
|
+
te as getCumulativeOffsetLeft,
|
|
106
|
+
se as getCumulativeOffsetTop,
|
|
107
|
+
ne as getCumulativePosition,
|
|
108
|
+
T as getElement,
|
|
109
|
+
je as getElementTransitionDurationMS,
|
|
166
110
|
Me as getElementTransitionDurationS,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
E as
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
111
|
+
b as getPointerPosition,
|
|
112
|
+
d as insert,
|
|
113
|
+
S as isBrowser,
|
|
114
|
+
Oe as isESClass,
|
|
115
|
+
Ie as isNullish,
|
|
116
|
+
Ee as isObject,
|
|
117
|
+
ve as kebabToCamel,
|
|
118
|
+
de as lerp,
|
|
119
|
+
X as linear,
|
|
120
|
+
me as mapRange,
|
|
121
|
+
m as measureText,
|
|
122
|
+
Qe as mergeDeep,
|
|
123
|
+
g as normalize,
|
|
124
|
+
Se as omit,
|
|
125
|
+
I as parseAttribute,
|
|
126
|
+
E as parseAttributeValue,
|
|
127
|
+
De as pick,
|
|
128
|
+
ge as preciseNumber,
|
|
129
|
+
ce as round,
|
|
130
|
+
be as roundNumberTo,
|
|
131
|
+
h as screenToCartesian,
|
|
132
|
+
pe as smootherstep,
|
|
133
|
+
xe as smoothstep,
|
|
134
|
+
Be as snakeToDotted,
|
|
135
|
+
fe as step,
|
|
136
|
+
ee as throttle,
|
|
137
|
+
Ae as toPascalCase
|
|
193
138
|
};
|
package/lib/utils/object.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare function isNullish(value: any): boolean;
|
|
|
5
5
|
export declare function compareObjects(obj1: any, obj2: any): boolean;
|
|
6
6
|
export declare function pick<T extends object, R extends keyof T>(object: T, keys: Array<R>): Pick<T, R>;
|
|
7
7
|
export declare function omit<T extends object, R extends keyof T>(object: T, keys: Array<R>): Omit<T, R>;
|
|
8
|
+
export declare function isESClass(fn: Function): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aptechka",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/denisavitski/aptechka.git"
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
"default": "./lib/canvas/index.js",
|
|
44
44
|
"types": "./lib/canvas/index.d.ts"
|
|
45
45
|
},
|
|
46
|
+
"./component": {
|
|
47
|
+
"require": "./lib/component/index.cjs",
|
|
48
|
+
"default": "./lib/component/index.js",
|
|
49
|
+
"types": "./lib/component/index.d.ts"
|
|
50
|
+
},
|
|
46
51
|
"./connector": {
|
|
47
52
|
"require": "./lib/connector/index.cjs",
|
|
48
53
|
"default": "./lib/connector/index.js",
|
|
@@ -213,6 +218,9 @@
|
|
|
213
218
|
"canvas": [
|
|
214
219
|
"lib/canvas/index.d.ts"
|
|
215
220
|
],
|
|
221
|
+
"component": [
|
|
222
|
+
"lib/component/index.d.ts"
|
|
223
|
+
],
|
|
216
224
|
"connector": [
|
|
217
225
|
"lib/connector/index.d.ts"
|
|
218
226
|
],
|
|
@@ -313,7 +321,7 @@
|
|
|
313
321
|
"@types/three": "^0.161.2",
|
|
314
322
|
"vite": "5.1.1",
|
|
315
323
|
"vite-plugin-dts": "^3.7.2",
|
|
316
|
-
"vite-plugin-htmc": "^0.1.
|
|
324
|
+
"vite-plugin-htmc": "^0.1.5"
|
|
317
325
|
},
|
|
318
326
|
"dependencies": {
|
|
319
327
|
"detect-gpu": "^5.0.38",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CustomElement } from '../custom-element';
|
|
2
|
-
export type RouteURLParams<T extends string = string> = Partial<{
|
|
3
|
-
[key in T]: string;
|
|
4
|
-
}>;
|
|
5
|
-
export type RouteParameters<PathnameParams extends string = string, SearchParams extends string = string> = {
|
|
6
|
-
pathnameParams: RouteURLParams<PathnameParams>;
|
|
7
|
-
searchParams: RouteURLParams<SearchParams>;
|
|
8
|
-
};
|
|
9
|
-
export declare class RouteElement<PathnameParams extends string = string, SearchParams extends string = string> extends CustomElement {
|
|
10
|
-
#private;
|
|
11
|
-
constructor(parameters: RouteParameters<PathnameParams, SearchParams>);
|
|
12
|
-
get pathnameParams(): Partial<{ [key in PathnameParams]: string; }>;
|
|
13
|
-
get searchParams(): Partial<{ [key in SearchParams]: string; }>;
|
|
14
|
-
}
|