aptechka 0.1.9 → 0.1.11

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 (79) hide show
  1. package/lib/Composed-C2Vv1xxR.cjs +1 -0
  2. package/lib/Composed-DhtYBEmo.js +79 -0
  3. package/lib/abstract-elements/index.cjs +1 -1
  4. package/lib/abstract-elements/index.js +1 -1
  5. package/lib/canvas/index.cjs +1 -1
  6. package/lib/canvas/index.d.ts +6 -5
  7. package/lib/canvas/index.js +47 -43
  8. package/lib/component/Component.d.ts +26 -0
  9. package/lib/component/hooks/animation.d.ts +9 -0
  10. package/lib/component/hooks/context.d.ts +2 -0
  11. package/lib/component/hooks/intersection.d.ts +4 -0
  12. package/lib/component/hooks/resize.d.ts +6 -0
  13. package/lib/component/hooks/shadow.d.ts +1 -0
  14. package/lib/component/hooks/stores.d.ts +6 -0
  15. package/lib/component/hooks/style.d.ts +2 -0
  16. package/lib/component/index.cjs +1 -0
  17. package/lib/component/index.d.ts +7 -0
  18. package/lib/component/index.js +183 -0
  19. package/lib/connector/index.cjs +1 -1
  20. package/lib/connector/index.js +1 -1
  21. package/lib/{createStylesheet-BoJwXvjE.cjs → createStylesheet-DTOK6fTn.cjs} +1 -1
  22. package/lib/{createStylesheet-DSgkNlUZ.js → createStylesheet-Zqf3lXhM.js} +1 -1
  23. package/lib/{createTheme-COo8IzPG.cjs → createTheme-B_W5dUY9.cjs} +1 -1
  24. package/lib/{createTheme-BMH9cRrS.js → createTheme-D0IoYkYN.js} +1 -1
  25. package/lib/element-constructor/ElementConstructor.d.ts +1 -1
  26. package/lib/element-constructor/index.cjs +1 -1
  27. package/lib/element-constructor/index.js +3 -3
  28. package/lib/element-constructor/tags.d.ts +2 -3
  29. package/lib/element-resizer/index.cjs +1 -1
  30. package/lib/element-resizer/index.d.ts +1 -1
  31. package/lib/element-resizer/index.js +2 -1
  32. package/lib/en3/core/en3.d.ts +2 -2
  33. package/lib/en3/objects/En3Clip.d.ts +1 -1
  34. package/lib/{index-Cv4y7_7y.cjs → index-3G1lTMEf.cjs} +1 -1
  35. package/lib/{index-228VqUsZ.js → index-BWTXnG5n.js} +2 -2
  36. package/lib/intersector/index.cjs +1 -1
  37. package/lib/intersector/index.d.ts +1 -1
  38. package/lib/intersector/index.js +2 -1
  39. package/lib/layout-box/index.cjs +1 -1
  40. package/lib/layout-box/index.d.ts +2 -2
  41. package/lib/layout-box/index.js +70 -72
  42. package/lib/modal/index.cjs +1 -1
  43. package/lib/modal/index.js +2 -2
  44. package/lib/object-C1ph624j.cjs +1 -0
  45. package/lib/object-DIPjdukP.js +73 -0
  46. package/lib/popover/index.cjs +1 -1
  47. package/lib/popover/index.js +79 -71
  48. package/lib/router/Route.d.ts +8 -2
  49. package/lib/router/index.cjs +1 -1
  50. package/lib/router/index.d.ts +1 -2
  51. package/lib/router/index.js +139 -140
  52. package/lib/scroll/index.cjs +1 -1
  53. package/lib/scroll/index.js +2 -2
  54. package/lib/select/index.cjs +1 -1
  55. package/lib/select/index.js +1 -1
  56. package/lib/store/index.cjs +1 -1
  57. package/lib/store/index.js +48 -111
  58. package/lib/string-3lAkpJJP.js +51 -0
  59. package/lib/string-vBu90jhV.cjs +1 -0
  60. package/lib/studio/index.cjs +1 -1
  61. package/lib/studio/index.js +3 -3
  62. package/lib/tags-75InVOh4.cjs +1 -0
  63. package/lib/{tags-kZqsS_nJ.js → tags-DgRVzazL.js} +141 -139
  64. package/lib/theme/index.cjs +1 -1
  65. package/lib/theme/index.js +2 -2
  66. package/lib/ticker/index.cjs +1 -1
  67. package/lib/ticker/index.d.ts +1 -1
  68. package/lib/ticker/index.js +33 -37
  69. package/lib/utils/dom.d.ts +2 -2
  70. package/lib/utils/index.cjs +1 -1
  71. package/lib/utils/index.d.ts +2 -2
  72. package/lib/utils/index.js +114 -168
  73. package/lib/utils/object.d.ts +1 -0
  74. package/lib/utils/string.d.ts +1 -0
  75. package/package.json +10 -2
  76. package/lib/router/RouteElement.d.ts +0 -14
  77. package/lib/string-BrDhnNUL.js +0 -39
  78. package/lib/string-DzUwFYSS.cjs +0 -1
  79. package/lib/tags-920hsh9U.cjs +0 -1
@@ -1,34 +1,34 @@
1
- var T = (r, s, t) => {
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) => (T(r, s, "read from private field"), t ? t.call(r) : s.get(r)), h = (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) => (T(r, s, "write to private field"), n ? n.call(r, t) : s.set(r, t), t);
10
- var w = (r, s, t) => (T(r, s, "access private method"), t);
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 g } from "../browser-0zX67oeU.js";
13
- var m, u, y, f, l, d, F;
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, y, void 0);
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, F, (s) => {
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, y, (t == null ? void 0 : t.order) || 0), t != null && t.culling && g ? E.subscribe(t.culling, i(this, F)) : e(this, d, !0);
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, y);
31
+ return i(this, g);
32
32
  }
33
33
  sync(s) {
34
34
  e(this, f, s - i(this, l));
@@ -47,69 +47,65 @@ class V {
47
47
  });
48
48
  }
49
49
  destroy() {
50
- E.unsubscribe(i(this, F));
50
+ E.unsubscribe(i(this, y));
51
51
  }
52
52
  }
53
- m = new WeakMap(), u = new WeakMap(), y = new WeakMap(), f = new WeakMap(), l = new WeakMap(), d = new WeakMap(), F = new WeakMap();
54
- var k, b, a, o, c, x, S, v, q, A, L;
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, x);
58
- h(this, v);
59
- h(this, k, 0);
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, A, (s) => {
64
+ h(this, v, (s) => {
65
65
  if (i(this, o)) {
66
- e(this, o, !1), e(this, k, s - i(this, b));
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, A))), e(this, b, s - i(this, k));
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, L, () => {
74
+ h(this, A, () => {
75
75
  document.hidden && e(this, o, !0);
76
76
  });
77
- g && document.addEventListener(
77
+ T && document.addEventListener(
78
78
  "visibilitychange",
79
- i(this, L)
79
+ i(this, A)
80
80
  );
81
81
  }
82
82
  subscribe(s, t) {
83
- if (g) {
84
- if (!i(this, c).find((n) => n.callback === s)) {
85
- const n = new V(s, t);
86
- n.sync(performance.now()), i(this, c).push(n), e(this, c, i(this, c).sort((I, P) => I.order - P.order));
87
- }
88
- 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));
89
86
  }
87
+ return L(this, w, S).call(this), () => this.unsubscribe(s);
90
88
  }
91
89
  unsubscribe(s) {
92
- if (!g)
93
- return;
94
90
  const t = i(this, c).filter(
95
91
  (n) => n.callback === s
96
92
  );
97
93
  t.length && (t.forEach((n) => n.destroy()), e(this, c, i(this, c).filter(
98
94
  (n) => n.callback !== s
99
- )), i(this, c).length || w(this, v, q).call(this));
95
+ )), i(this, c).length || L(this, k, q).call(this));
100
96
  }
101
97
  destroy() {
102
- g && (w(this, v, q).call(this), document.removeEventListener(
98
+ T && (L(this, k, q).call(this), document.removeEventListener(
103
99
  "visibilitychange",
104
- i(this, L)
100
+ i(this, A)
105
101
  ));
106
102
  }
107
103
  }
108
- k = new WeakMap(), b = new WeakMap(), a = new WeakMap(), o = new WeakMap(), c = new WeakMap(), x = new WeakSet(), S = function() {
109
- i(this, c).length && !i(this, a) && e(this, a, requestAnimationFrame(i(this, A)));
110
- }, v = new WeakSet(), q = function() {
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() {
111
107
  i(this, a) && (cancelAnimationFrame(i(this, a)), e(this, a, void 0));
112
- }, A = new WeakMap(), L = new WeakMap();
108
+ }, v = new WeakMap(), A = new WeakMap();
113
109
  const M = new B();
114
110
  export {
115
111
  B as Ticker,
@@ -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 HTMLElement = HTMLElement> = string | T;
3
- export declare function getElement<T extends HTMLElement>(elementOrSelector: ElementOrSelector<T>, from?: Document): T | null;
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;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../attributes-Bf2svn4j.cjs"),Q=require("../browser-CpzFX2xg.cjs"),m=require("../dom-qY2LdCVL.cjs"),r=require("../easings-DsS5-Kqc.cjs"),T=require("../events-Crwi8fz6.cjs"),D=require("../file-EevnUtRj.cjs"),h=require("../function-MthRj-GJ.cjs"),p=require("../layout-8ryRAMGJ.cjs"),u=require("../math-GDWEqu7y.cjs"),g=require("../number-yVpzMdbQ.cjs"),o=require("../string-DzUwFYSS.cjs"),O=require("../style-At6aDoqG.cjs");function P(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function S(e,t){const n=e.measureText(t),i=n.actualBoundingBoxAscent+n.actualBoundingBoxDescent,s=n.width;return{height:i,width:s}}function A(e){return Math.floor(e)+.5}function q(e,t,n,i,s,a){let d=e/t,E=n/i,c=0,l=0;return s=typeof s=="undefined"?.5:s,a=typeof a=="undefined"?.5:a,d>E?(c=i,l=i*d):(l=n,c=n/d),[(n-l)*s,(i-c)*a,l,c]}function k(e,t){return e.x<t.x+t.width&&e.x>t.x&&e.y<t.y+t.height&&e.y>t.y}function v(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)<t.radius}function N(e,t,n=!1){let i=e.x-t.width/2,s=t.height/2-e.y;return n&&(i=i/(t.width/2),s=s/(t.height/2)),{x:i,y:s}}function R(e,t){const n=e.x/t.x,i=e.y/t.y;return{x:n,y:i}}function B(e,t){return t=t||{x:0,y:0,width:document.documentElement.offsetWidth,height:innerHeight},{x:(e.x-t.x)/t.width*t.width,y:(e.y-t.y)/t.height*t.height}}function z(e){const t=window.atob(e);return decodeURIComponent(window.escape(t))}function M(e){const t=window.unescape(encodeURIComponent(e));return window.btoa(t)}function x(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function C(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Node)return e;const t=Array.isArray(e)?[]:{};for(const n in e)e.hasOwnProperty(n)&&(t[n]=C(e[n]));return t}function I(e,t,n=x){for(const i in t)n(t[i])?(e[i]||Object.assign(e,{[i]:{}}),I(e[i],t[i],n)):Object.assign(e,{[i]:t[i]});return e}function w(e){return e===null||typeof e=="undefined"}function f(e,t){if(typeof e!=typeof t)return!1;if([e,t].some(n=>w(n)))return e===t;if(Array.isArray(e)){const n=e.length>t.length?e:t,i=e.length>t.length?t:e;return n.every((s,a)=>f(s,i[a]))}if(typeof e!="object"||e instanceof Node||typeof e=="object"&&e.constructor.toString().startsWith("class"))return e===t;for(const n in e){if(!t.hasOwnProperty(n))return!1;if(typeof e[n]=="object"&&typeof t[n]=="object"){if(!f(e[n],t[n]))return!1}else if(e[n]!==t[n])return!1}return!0}function b(e,t){const n={};for(const i in e)t.includes(i)&&(n[i]=e[i]);return n}function J(e,t){const n={};for(const i in e)t.includes(i)||(n[i]=e[i]);return n}exports.parseAttribute=y.parseAttribute;exports.parseAttributeValue=y.parseAttributeValue;exports.isBrowser=Q.isBrowser;exports.findParentElement=m.findParentElement;exports.findScrollParentElement=m.findScrollParentElement;exports.getElement=m.getElement;exports.easeInCubic=r.easeInCubic;exports.easeInExpo=r.easeInExpo;exports.easeInOutCubic=r.easeInOutCubic;exports.easeInOutExpo=r.easeInOutExpo;exports.easeInOutQuad=r.easeInOutQuad;exports.easeInOutQuart=r.easeInOutQuart;exports.easeInOutQuint=r.easeInOutQuint;exports.easeInQuad=r.easeInQuad;exports.easeInQuart=r.easeInQuart;exports.easeInQuint=r.easeInQuint;exports.easeOutCubic=r.easeOutCubic;exports.easeOutExpo=r.easeOutExpo;exports.easeOutQuad=r.easeOutQuad;exports.easeOutQuart=r.easeOutQuart;exports.easeOutQuint=r.easeOutQuint;exports.linear=r.linear;exports.dispatchSizeChangeEvent=T.dispatchSizeChangeEvent;exports.createJSONAndSave=D.createJSONAndSave;exports.debounce=h.debounce;exports.throttle=h.throttle;exports.getCumulativeOffsetLeft=p.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=p.getCumulativeOffsetTop;exports.getCumulativePosition=p.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=g.preciseNumber;exports.roundNumberTo=g.roundNumberTo;exports.camelToKebab=o.camelToKebab;exports.capitalize=o.capitalize;exports.generateId=o.generateId;exports.kebabToCamel=o.kebabToCamel;exports.snakeToDotted=o.snakeToDotted;exports.toPascalCase=o.toPascalCase;exports.getElementTransitionDurationMS=O.getElementTransitionDurationMS;exports.getElementTransitionDurationS=O.getElementTransitionDurationS;exports.cloneDeep=C;exports.compareObjects=f;exports.cover=q;exports.decode=M;exports.dotCircleCollision=v;exports.dotRectCollision=k;exports.encode=z;exports.fixPosition=A;exports.getPointerPosition=B;exports.insert=P;exports.isNullish=w;exports.isObject=x;exports.measureText=S;exports.mergeDeep=I;exports.normalize=R;exports.omit=J;exports.pick=b;exports.screenToCartesian=N;
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-vBu90jhV.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.uncapitalize=r.uncapitalize;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;
@@ -13,8 +13,8 @@ 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';
17
- export { kebabToCamel, camelToKebab, snakeToDotted, toPascalCase, capitalize, generateId, } from './string';
16
+ export { isObject, cloneDeep, mergeDeep, isNullish, compareObjects, pick, omit, isESClass, } from './object';
17
+ export { kebabToCamel, camelToKebab, snakeToDotted, toPascalCase, capitalize, uncapitalize, generateId, } from './string';
18
18
  export { getElementTransitionDurationMS, getElementTransitionDurationS, } from './style';
19
19
  export type { Axes2D, Axes3D, Dot2D, Rect2D, Circle, Dot3D, Rect3D, } from './ts-shape';
20
20
  export type { NestedKeys, NestedValueOf, DeepOmit, DeepPartial, Requiredish, WithRequired, Split, SplitFirst, Tail, KebabToCamel, CamelToKebab, } from './ts-utility';
@@ -1,193 +1,139 @@
1
- import { a as T, p as R } from "../attributes-69we3byR.js";
2
- import { i as B } from "../browser-0zX67oeU.js";
3
- import { f as M, a as z, g as U } from "../dom-BY7JhTx5.js";
4
- import { c as J, n as K, f as V, p as W, b as G, i as X, m as Y, e as Z, g as _, j as $, d as F, o as H, a as L, h as b, k as j, l as ee } from "../easings-BKi40vHz.js";
5
- import { d as ne } from "../events-_C2CztxR.js";
6
- import { c as ae } from "../file-lxi_oXJf.js";
7
- import { d as ie, t as ue } from "../function-C10DGppn.js";
8
- import { g as fe, a as ce, b as le } from "../layout-HoBT_Da2.js";
9
- import { e as pe, f as me, c as ye, d as he, l as xe, m as ge, r as we, b as Oe, a as Ce, s as Ie } from "../math-BOBiC4TN.js";
10
- import { p as ke, r as De } from "../number-Bo5RdrA1.js";
11
- import { c as Pe, a as Qe, g as Se, k as Te, s as Re, t as Ne } from "../string-BrDhnNUL.js";
12
- import { g as ve, a as Me } from "../style-j2TwriJ_.js";
13
- function y(e, t, ...n) {
14
- return [...e.slice(0, t), ...n, ...e.slice(t)];
15
- }
16
- function h(e, t) {
17
- const n = e.measureText(t), s = n.actualBoundingBoxAscent + n.actualBoundingBoxDescent, a = n.width;
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 z, m as M, 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 ce, r as me, 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, u as Ne } from "../string-3lAkpJJP.js";
13
+ import { g as ze, 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 c(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: a
21
+ width: n
21
22
  };
22
23
  }
23
- function x(e) {
24
- return Math.floor(e) + 0.5;
24
+ function m(a) {
25
+ return Math.floor(a) + 0.5;
25
26
  }
26
- function g(e, t, n, s, a, r) {
27
- let o = e / t, c = n / s, i = 0, u = 0;
28
- return a = typeof a == "undefined" ? 0.5 : a, r = typeof r == "undefined" ? 0.5 : r, o > c ? (i = s, u = s * o) : (u = n, i = n / o), [
29
- (n - u) * a,
30
- (s - i) * r,
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 w(e, t) {
36
- return e.x < t.x + t.width && e.x > t.x && e.y < t.y + t.height && e.y > t.y;
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 O(e, t) {
39
- return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2) < t.radius;
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 C(e, t, n = !1) {
42
- let s = e.x - t.width / 2, a = t.height / 2 - e.y;
43
- return n && (s = s / (t.width / 2), a = a / (t.height / 2)), { x: s, y: a };
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 I(e, t) {
46
- const n = e.x / t.x, s = e.y / t.y;
47
- return { x: n, y: s };
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 A(e, t) {
50
- return t = t || {
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: (e.x - t.x) / t.width * t.width,
57
- y: (e.y - t.y) / t.height * t.height
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 k(e) {
61
- const t = window.atob(e);
62
- return decodeURIComponent(window.escape(t));
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 P(e, t) {
120
- const n = {};
121
- for (const s in e)
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
- pe as calculateDistance,
127
- me as calculateDistanceWithRadius,
128
- Pe as camelToKebab,
129
- Qe as capitalize,
130
- ye as clamp,
131
- d as cloneDeep,
132
- f as compareObjects,
133
- g as cover,
134
- ae as createJSONAndSave,
135
- he as damp,
136
- ie as debounce,
137
- D as decode,
138
- ne as dispatchSizeChangeEvent,
139
- O as dotCircleCollision,
140
- w as dotRectCollision,
141
- J as easeInCubic,
142
- K as easeInExpo,
143
- V as easeInOutCubic,
144
- W as easeInOutExpo,
145
- G as easeInOutQuad,
146
- X as easeInOutQuart,
147
- Y as easeInOutQuint,
148
- Z as easeInQuad,
149
- _ as easeInQuart,
150
- $ as easeInQuint,
151
- F as easeOutCubic,
152
- H as easeOutExpo,
153
- L as easeOutQuad,
154
- b as easeOutQuart,
155
- j as easeOutQuint,
156
- k as encode,
157
- M as findParentElement,
158
- z as findScrollParentElement,
159
- x as fixPosition,
160
- Se as generateId,
161
- fe as getCumulativeOffsetLeft,
162
- ce as getCumulativeOffsetTop,
163
- le as getCumulativePosition,
164
- U as getElement,
165
- ve as getElementTransitionDurationMS,
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
+ z as easeInOutQuart,
91
+ M 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
+ m as fixPosition,
104
+ ke as generateId,
105
+ te as getCumulativeOffsetLeft,
106
+ se as getCumulativeOffsetTop,
107
+ ne as getCumulativePosition,
108
+ T as getElement,
109
+ ze as getElementTransitionDurationMS,
166
110
  Me as getElementTransitionDurationS,
167
- A as getPointerPosition,
168
- y as insert,
169
- B as isBrowser,
170
- m as isNullish,
171
- l as isObject,
172
- Te as kebabToCamel,
173
- xe as lerp,
174
- ee as linear,
175
- ge as mapRange,
176
- h as measureText,
177
- p as mergeDeep,
178
- I as normalize,
179
- P as omit,
180
- T as parseAttribute,
181
- R as parseAttributeValue,
182
- E as pick,
183
- ke as preciseNumber,
184
- we as round,
185
- De as roundNumberTo,
186
- C as screenToCartesian,
187
- Oe as smootherstep,
188
- Ce as smoothstep,
189
- Re as snakeToDotted,
190
- Ie as step,
191
- ue as throttle,
192
- Ne as toPascalCase
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
+ ce as mapRange,
121
+ c 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
+ me 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,
138
+ Ne as uncapitalize
193
139
  };
@@ -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;
@@ -3,4 +3,5 @@ export declare function camelToKebab(camelCaseString: string): string;
3
3
  export declare function snakeToDotted(snake: string): string;
4
4
  export declare function toPascalCase(str: string): string;
5
5
  export declare function capitalize(string: string, everyWord?: boolean): string;
6
+ export declare function uncapitalize(string: string, everyWord?: boolean): string;
6
7
  export declare function generateId(length: number, characters?: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
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.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
- }
@@ -1,39 +0,0 @@
1
- function i(e, n = !1) {
2
- let a = "";
3
- return e.split("-").forEach((t, s) => {
4
- if (s === 0 && !n)
5
- a += t;
6
- else {
7
- const r = t[0], o = t.slice(1), c = r.toUpperCase() + o;
8
- a += c;
9
- }
10
- }), a;
11
- }
12
- function l(e) {
13
- return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
14
- }
15
- function p(e) {
16
- return e.split("_").join(".");
17
- }
18
- function u(e) {
19
- return /^[a-z\d]+$/i.test(e) ? e.charAt(0).toUpperCase() + e.slice(1) : e.replace(/([a-z\d])([a-z\d]*)/gi, (n, a, t) => a.toUpperCase() + t.toLowerCase()).replace(/[^a-z\d]/gi, "");
20
- }
21
- function f(e, n = !1) {
22
- const a = (t) => t.slice(0, 1).toUpperCase() + t.slice(1);
23
- return n ? e.split(" ").map((t) => a(t)).join(" ") : a(e);
24
- }
25
- function d(e, n = "abcdefghijklmnopqrstuvwxyz0123456789") {
26
- const a = n.length, t = crypto.getRandomValues(new Uint8Array(e));
27
- let s = "";
28
- for (let r = 0; r < e; r++)
29
- s += n.charAt(t[r] % a);
30
- return s;
31
- }
32
- export {
33
- f as a,
34
- l as c,
35
- d as g,
36
- i as k,
37
- p as s,
38
- u as t
39
- };
@@ -1 +0,0 @@
1
- "use strict";function i(e,n=!1){let a="";return e.split("-").forEach((t,r)=>{if(r===0&&!n)a+=t;else{const o=t[0],c=t.slice(1),s=o.toUpperCase()+c;a+=s}}),a}function l(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function p(e){return e.split("_").join(".")}function u(e){return/^[a-z\d]+$/i.test(e)?e.charAt(0).toUpperCase()+e.slice(1):e.replace(/([a-z\d])([a-z\d]*)/gi,(n,a,t)=>a.toUpperCase()+t.toLowerCase()).replace(/[^a-z\d]/gi,"")}function f(e,n=!1){const a=t=>t.slice(0,1).toUpperCase()+t.slice(1);return n?e.split(" ").map(t=>a(t)).join(" "):a(e)}function d(e,n="abcdefghijklmnopqrstuvwxyz0123456789"){const a=n.length,t=crypto.getRandomValues(new Uint8Array(e));let r="";for(let o=0;o<e;o++)r+=n.charAt(t[o]%a);return r}exports.camelToKebab=l;exports.capitalize=f;exports.generateId=d;exports.kebabToCamel=i;exports.snakeToDotted=p;exports.toPascalCase=u;