aptechka 0.1.11 → 0.1.12

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.
@@ -0,0 +1,5 @@
1
+ export declare function getRootVariables<T extends string, V extends {
2
+ [key in T]: string;
3
+ } = {
4
+ [key in T]: string;
5
+ }>(...names: T[]): V;
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../attributes-Bf2svn4j.cjs"),x=require("../browser-CpzFX2xg.cjs"),p=require("../dom-qY2LdCVL.cjs"),a=require("../easings-DsS5-Kqc.cjs"),y=require("../events-Crwi8fz6.cjs"),E=require("../file-EevnUtRj.cjs"),g=require("../function-MthRj-GJ.cjs"),h=require("../layout-8ryRAMGJ.cjs"),o=require("../math-GDWEqu7y.cjs"),f=require("../number-yVpzMdbQ.cjs"),u=require("../object-C1ph624j.cjs"),l=require("../string-vBu90jhV.cjs"),O=require("../style-At6aDoqG.cjs");function I(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function S(t,e){const n=t.measureText(e),i=n.actualBoundingBoxAscent+n.actualBoundingBoxDescent,s=n.width;return{height:i,width:s}}function w(t){return Math.floor(t)+.5}function Q(t,e,n,i,s,r){let m=t/e,C=n/i,c=0,d=0;return s=typeof s=="undefined"?.5:s,r=typeof r=="undefined"?.5:r,m>C?(c=i,d=i*m):(d=n,c=n/m),[(n-d)*s,(i-c)*r,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 v(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function D(t,e,n=!1){let i=t.x-e.width/2,s=e.height/2-t.y;return n&&(i=i/(e.width/2),s=s/(e.height/2)),{x:i,y:s}}function P(t,e){const n=t.x/e.x,i=t.y/e.y;return{x:n,y:i}}function q(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={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(i=>{i instanceof CSSStyleRule&&i.selectorText===":root"&&t.forEach(s=>{const r=i.styleMap.get(s);r?e[s]=r.toString():console.warn(`variable named ${s} not found`)})})}),e}function A(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=x.isBrowser;exports.findParentElement=p.findParentElement;exports.findScrollParentElement=p.findScrollParentElement;exports.getElement=p.getElement;exports.easeInCubic=a.easeInCubic;exports.easeInExpo=a.easeInExpo;exports.easeInOutCubic=a.easeInOutCubic;exports.easeInOutExpo=a.easeInOutExpo;exports.easeInOutQuad=a.easeInOutQuad;exports.easeInOutQuart=a.easeInOutQuart;exports.easeInOutQuint=a.easeInOutQuint;exports.easeInQuad=a.easeInQuad;exports.easeInQuart=a.easeInQuart;exports.easeInQuint=a.easeInQuint;exports.easeOutCubic=a.easeOutCubic;exports.easeOutExpo=a.easeOutExpo;exports.easeOutQuad=a.easeOutQuad;exports.easeOutQuart=a.easeOutQuart;exports.easeOutQuint=a.easeOutQuint;exports.linear=a.linear;exports.dispatchSizeChangeEvent=y.dispatchSizeChangeEvent;exports.createJSONAndSave=E.createJSONAndSave;exports.debounce=g.debounce;exports.throttle=g.throttle;exports.getCumulativeOffsetLeft=h.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=h.getCumulativeOffsetTop;exports.getCumulativePosition=h.getCumulativePosition;exports.calculateDistance=o.calculateDistance;exports.calculateDistanceWithRadius=o.calculateDistanceWithRadius;exports.clamp=o.clamp;exports.damp=o.damp;exports.lerp=o.lerp;exports.mapRange=o.mapRange;exports.round=o.round;exports.smootherstep=o.smootherstep;exports.smoothstep=o.smoothstep;exports.step=o.step;exports.preciseNumber=f.preciseNumber;exports.roundNumberTo=f.roundNumberTo;exports.cloneDeep=u.cloneDeep;exports.compareObjects=u.compareObjects;exports.isESClass=u.isESClass;exports.isNullish=u.isNullish;exports.isObject=u.isObject;exports.mergeDeep=u.mergeDeep;exports.omit=u.omit;exports.pick=u.pick;exports.camelToKebab=l.camelToKebab;exports.capitalize=l.capitalize;exports.generateId=l.generateId;exports.kebabToCamel=l.kebabToCamel;exports.snakeToDotted=l.snakeToDotted;exports.toPascalCase=l.toPascalCase;exports.uncapitalize=l.uncapitalize;exports.getElementTransitionDurationMS=O.getElementTransitionDurationMS;exports.getElementTransitionDurationS=O.getElementTransitionDurationS;exports.cover=Q;exports.decode=N;exports.dotCircleCollision=v;exports.dotRectCollision=T;exports.encode=A;exports.fixPosition=w;exports.getPointerPosition=q;exports.getRootVariables=R;exports.insert=I;exports.measureText=S;exports.normalize=P;exports.screenToCartesian=D;
@@ -4,6 +4,7 @@ export { isBrowser } from './browser';
4
4
  export { measureText, fixPosition, cover } from './canvas';
5
5
  export { dotRectCollision, dotCircleCollision } from './collisions';
6
6
  export { screenToCartesian, normalize, getPointerPosition } from './coordinates';
7
+ export { getRootVariables } from './cssom';
7
8
  export { encode, decode } from './decoding';
8
9
  export { findParentElement, getElement, findScrollParentElement, type ElementOrSelector, } from './dom';
9
10
  export { linear, easeInQuad, easeOutQuad, easeInOutQuad, easeInCubic, easeOutCubic, easeInOutCubic, easeInQuart, easeOutQuart, easeInOutQuart, easeInQuint, easeOutQuint, easeInOutQuint, easeInExpo, easeOutExpo, easeInOutExpo, type EasingFunction, } from './easings';
@@ -1,139 +1,151 @@
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";
1
+ import { a as S, p as I } from "../attributes-69we3byR.js";
2
+ import { i as Q } from "../browser-0zX67oeU.js";
3
+ import { f as D, a as T, g as P } from "../dom-BY7JhTx5.js";
4
+ import { c as k, n as B, f as M, p as N, b as j, i as z, m as U, e as V, g as q, j as J, d as K, o as $, a as F, h as G, k as W, l as X } from "../easings-BKi40vHz.js";
5
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)];
6
+ import { c as H } from "../file-lxi_oXJf.js";
7
+ import { d as ee, t as te } from "../function-C10DGppn.js";
8
+ import { g as se, a as ne, b as oe } from "../layout-HoBT_Da2.js";
9
+ import { e as re, f as ue, c as le, d as ce, l as de, m as me, r as pe, b as fe, a as xe, s as he } from "../math-BOBiC4TN.js";
10
+ import { p as be, r as ye } from "../number-Bo5RdrA1.js";
11
+ import { c as Ce, d as Oe, i as Ee, b as Se, a as Ie, m as Re, o as Qe, p as ve } from "../object-DIPjdukP.js";
12
+ import { c as Te, a as Pe, g as Ae, k as ke, s as Be, t as Me, u as Ne } from "../string-3lAkpJJP.js";
13
+ import { g as ze, a as Ue } from "../style-j2TwriJ_.js";
14
+ function c(t, e, ...a) {
15
+ return [...t.slice(0, e), ...a, ...t.slice(e)];
16
16
  }
17
- function c(a, e) {
18
- const t = a.measureText(e), s = t.actualBoundingBoxAscent + t.actualBoundingBoxDescent, n = t.width;
17
+ function d(t, e) {
18
+ const a = t.measureText(e), s = a.actualBoundingBoxAscent + a.actualBoundingBoxDescent, n = a.width;
19
19
  return {
20
20
  height: s,
21
21
  width: n
22
22
  };
23
23
  }
24
- function m(a) {
25
- return Math.floor(a) + 0.5;
24
+ function m(t) {
25
+ return Math.floor(t) + 0.5;
26
26
  }
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,
27
+ function p(t, e, a, s, n, o) {
28
+ let u = t / e, l = a / s, i = 0, r = 0;
29
+ return n = typeof n == "undefined" ? 0.5 : n, o = typeof o == "undefined" ? 0.5 : o, u > l ? (i = s, r = s * u) : (r = a, i = a / u), [
30
+ (a - r) * n,
31
31
  (s - i) * o,
32
- u,
32
+ r,
33
33
  i
34
34
  ];
35
35
  }
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;
36
+ function f(t, e) {
37
+ return t.x < e.x + e.width && t.x > e.x && t.y < e.y + e.height && t.y > e.y;
38
38
  }
39
- function f(a, e) {
40
- return Math.sqrt((a.x - e.x) ** 2 + (a.y - e.y) ** 2) < e.radius;
39
+ function x(t, e) {
40
+ return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
41
41
  }
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 };
42
+ function h(t, e, a = !1) {
43
+ let s = t.x - e.width / 2, n = e.height / 2 - t.y;
44
+ return a && (s = s / (e.width / 2), n = n / (e.height / 2)), { x: s, y: n };
45
45
  }
46
- function g(a, e) {
47
- const t = a.x / e.x, s = a.y / e.y;
48
- return { x: t, y: s };
46
+ function g(t, e) {
47
+ const a = t.x / e.x, s = t.y / e.y;
48
+ return { x: a, y: s };
49
49
  }
50
- function b(a, e) {
50
+ function b(t, e) {
51
51
  return e = e || {
52
52
  x: 0,
53
53
  y: 0,
54
54
  width: document.documentElement.offsetWidth,
55
55
  height: innerHeight
56
56
  }, {
57
- x: (a.x - e.x) / e.width * e.width,
58
- y: (a.y - e.y) / e.height * e.height
57
+ x: (t.x - e.x) / e.width * e.width,
58
+ y: (t.y - e.y) / e.height * e.height
59
59
  };
60
60
  }
61
- function w(a) {
62
- const e = window.atob(a);
61
+ function y(...t) {
62
+ const e = {};
63
+ return Array.from(document.styleSheets).forEach((a) => {
64
+ Array.from(a.cssRules).forEach((s) => {
65
+ s instanceof CSSStyleRule && s.selectorText === ":root" && t.forEach((n) => {
66
+ const o = s.styleMap.get(n);
67
+ o ? e[n] = o.toString() : console.warn(`variable named ${n} not found`);
68
+ });
69
+ });
70
+ }), e;
71
+ }
72
+ function w(t) {
73
+ const e = window.atob(t);
63
74
  return decodeURIComponent(window.escape(e));
64
75
  }
65
- function y(a) {
66
- const e = window.unescape(encodeURIComponent(a));
76
+ function C(t) {
77
+ const e = window.unescape(encodeURIComponent(t));
67
78
  return window.btoa(e);
68
79
  }
69
80
  export {
70
- ie as calculateDistance,
81
+ re as calculateDistance,
71
82
  ue as calculateDistanceWithRadius,
72
- Re as camelToKebab,
73
- Te as capitalize,
74
- re as clamp,
75
- ye as cloneDeep,
76
- Ce as compareObjects,
83
+ Te as camelToKebab,
84
+ Pe as capitalize,
85
+ le as clamp,
86
+ Ce as cloneDeep,
87
+ Oe as compareObjects,
77
88
  p as cover,
78
- $ as createJSONAndSave,
79
- le as damp,
80
- L as debounce,
81
- y as decode,
89
+ H as createJSONAndSave,
90
+ ce as damp,
91
+ ee as debounce,
92
+ C as decode,
82
93
  Z as dispatchSizeChangeEvent,
83
- f as dotCircleCollision,
84
- x as dotRectCollision,
85
- v as easeInCubic,
94
+ x as dotCircleCollision,
95
+ f as dotRectCollision,
96
+ k as easeInCubic,
86
97
  B as easeInExpo,
87
- A as easeInOutCubic,
98
+ M as easeInOutCubic,
88
99
  N as easeInOutExpo,
89
100
  j as easeInOutQuad,
90
101
  z as easeInOutQuart,
91
- M as easeInOutQuint,
92
- U as easeInQuad,
102
+ U as easeInOutQuint,
103
+ V as easeInQuad,
93
104
  q as easeInQuart,
94
105
  J as easeInQuint,
95
106
  K as easeOutCubic,
96
- V as easeOutExpo,
107
+ $ as easeOutExpo,
97
108
  F as easeOutQuad,
98
109
  G as easeOutQuart,
99
110
  W as easeOutQuint,
100
111
  w as encode,
101
- P as findParentElement,
102
- R as findScrollParentElement,
112
+ D as findParentElement,
113
+ T as findScrollParentElement,
103
114
  m as fixPosition,
104
- ke as generateId,
105
- te as getCumulativeOffsetLeft,
106
- se as getCumulativeOffsetTop,
107
- ne as getCumulativePosition,
108
- T as getElement,
115
+ Ae as generateId,
116
+ se as getCumulativeOffsetLeft,
117
+ ne as getCumulativeOffsetTop,
118
+ oe as getCumulativePosition,
119
+ P as getElement,
109
120
  ze as getElementTransitionDurationMS,
110
- Me as getElementTransitionDurationS,
121
+ Ue as getElementTransitionDurationS,
111
122
  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,
123
+ y as getRootVariables,
124
+ c as insert,
125
+ Q as isBrowser,
126
+ Ee as isESClass,
127
+ Se as isNullish,
128
+ Ie as isObject,
129
+ ke as kebabToCamel,
118
130
  de as lerp,
119
131
  X as linear,
120
- ce as mapRange,
121
- c as measureText,
122
- Qe as mergeDeep,
132
+ me as mapRange,
133
+ d as measureText,
134
+ Re as mergeDeep,
123
135
  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,
136
+ Qe as omit,
137
+ S as parseAttribute,
138
+ I as parseAttributeValue,
139
+ ve as pick,
140
+ be as preciseNumber,
141
+ pe as round,
142
+ ye as roundNumberTo,
131
143
  h as screenToCartesian,
132
- pe as smootherstep,
144
+ fe as smootherstep,
133
145
  xe as smoothstep,
134
146
  Be as snakeToDotted,
135
- fe as step,
136
- ee as throttle,
137
- Ae as toPascalCase,
147
+ he as step,
148
+ te as throttle,
149
+ Me as toPascalCase,
138
150
  Ne as uncapitalize
139
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"