aptechka 0.4.41 → 0.4.42
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/utils/index.cjs +1 -1
- package/lib/utils/index.js +122 -115
- package/package.json +1 -1
package/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../attributes-Bf2svn4j.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../attributes-Bf2svn4j.cjs"),S=require("../browser-CpzFX2xg.cjs"),h=require("../canvas-CU5Xjahf.cjs"),b=require("../coordinates-D8Np3cPD.cjs"),g=require("../dom-JBOkFLTh.cjs"),i=require("../easings-DsS5-Kqc.cjs"),T=require("../events-Crwi8fz6.cjs"),q=require("../file-EevnUtRj.cjs"),x=require("../function-MthRj-GJ.cjs"),D=require("../gestures-DHLrn6Q8.cjs"),C=require("../layout-8ryRAMGJ.cjs"),c=require("../math-GDWEqu7y.cjs"),O=require("../number-yVpzMdbQ.cjs"),l=require("../object-CCiXnER2.cjs"),Q=require("../polyfills-CrcS4RcO.cjs"),p=require("../string-DhgS_iFl.cjs"),E=require("../style-At6aDoqG.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");function A(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function M(t,e){const n=t.length;e=e%n;const s=new Array(n);for(let o=0;o<n;o++){const r=(o+e)%n;s[r]=t[o]}return s}function R(t,e){return t.x<e.x+e.width&&t.x>e.x&&t.y<e.y+e.height&&t.y>e.y}function z(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)<e.radius}function v(t,e){const n=t.styleMap.get(e);if(n){const s=n.toString();return s.startsWith("var")?v(t,s.slice(4,-1)):s}}function N(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(s=>{s instanceof CSSStyleRule&&s.selectorText===":root"&&t.forEach(o=>{const r=v(s,o);r&&(e[o]=r)})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function j(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function k(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function w(t,{pathSelector:e="path"}={}){const n=document.createElement(null);n.innerHTML=t;const s=n.firstElementChild,r=s.querySelector(e).getPathData(),a=s.getAttribute("viewBox").split(" ").map(m=>m.trim()),u={x:parseInt(a[0]),y:parseInt(a[1]),width:parseInt(a[2]),height:parseInt(a[3])},d=Math.min(u.width,u.height);return r.forEach(m=>{m.values=m.values.map(f=>f/d)}),r}function V(t,e,n,s,o){const r=[];for(let a=0;a<=1;a+=1/o){const u=Math.pow(1-a,3)*t.x+3*Math.pow(1-a,2)*a*e.x+3*(1-a)*Math.pow(a,2)*n.x+Math.pow(a,3)*s.x,d=Math.pow(1-a,3)*t.y+3*Math.pow(1-a,2)*a*e.y+3*(1-a)*Math.pow(a,2)*n.y+Math.pow(a,3)*s.y;r.push({x:u,y:d})}return r}function B(t,e){const n=(e==null?void 0:e.segments)||20,s=w(t,e);let o=[];for(let r=0;r<s.length-1;r++){const{type:a,values:u}=s[r];if(a==="M"&&r===0)o.push({x:u[0],y:u[1]});else if(a==="C"){const d=o[o.length-1],m={x:u[0],y:u[1]},f={x:u[2],y:u[3]},I={x:u[4],y:u[5]},P=V(d,m,f,I,n);o=[...o,...P]}}return o}exports.parseAttribute=y.parseAttribute;exports.parseAttributeValue=y.parseAttributeValue;exports.isBrowser=S.isBrowser;exports.contain=h.contain;exports.cover=h.cover;exports.fixPosition=h.fixPosition;exports.measureText=h.measureText;exports.getPointerPosition=b.getPointerPosition;exports.normalize=b.normalize;exports.screenToCartesian=b.screenToCartesian;exports.findParentElement=g.findParentElement;exports.findScrollParentElement=g.findScrollParentElement;exports.getAllParentElements=g.getAllParentElements;exports.getElement=g.getElement;exports.easeInCubic=i.easeInCubic;exports.easeInExpo=i.easeInExpo;exports.easeInOutCubic=i.easeInOutCubic;exports.easeInOutExpo=i.easeInOutExpo;exports.easeInOutQuad=i.easeInOutQuad;exports.easeInOutQuart=i.easeInOutQuart;exports.easeInOutQuint=i.easeInOutQuint;exports.easeInQuad=i.easeInQuad;exports.easeInQuart=i.easeInQuart;exports.easeInQuint=i.easeInQuint;exports.easeOutCubic=i.easeOutCubic;exports.easeOutExpo=i.easeOutExpo;exports.easeOutQuad=i.easeOutQuad;exports.easeOutQuart=i.easeOutQuart;exports.easeOutQuint=i.easeOutQuint;exports.linear=i.linear;exports.dispatchSizeChangeEvent=T.dispatchSizeChangeEvent;exports.createJSONAndSave=q.createJSONAndSave;exports.debounce=x.debounce;exports.throttle=x.throttle;exports.setupDrag=D.setupDrag;exports.getCumulativeOffsetLeft=C.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=C.getCumulativeOffsetTop;exports.getCumulativePosition=C.getCumulativePosition;exports.calculateDistance=c.calculateDistance;exports.calculateDistanceWithRadius=c.calculateDistanceWithRadius;exports.clamp=c.clamp;exports.damp=c.damp;exports.lerp=c.lerp;exports.mapRange=c.mapRange;exports.round=c.round;exports.smootherstep=c.smootherstep;exports.smoothstep=c.smoothstep;exports.step=c.step;exports.preciseNumber=O.preciseNumber;exports.roundNumberTo=O.roundNumberTo;exports.cloneDeep=l.cloneDeep;exports.compareObjects=l.compareObjects;exports.isESClass=l.isESClass;exports.isNullish=l.isNullish;exports.isObject=l.isObject;exports.mergeDeep=l.mergeDeep;exports.mixin=l.mixin;exports.omit=l.omit;exports.pick=l.pick;exports.nullishCoalescing=Q.nullishCoalescing;exports.camelToKebab=p.camelToKebab;exports.capitalize=p.capitalize;exports.generateId=p.generateId;exports.isUppercase=p.isUppercase;exports.kebabToCamel=p.kebabToCamel;exports.snakeToDotted=p.snakeToDotted;exports.toPascalCase=p.toPascalCase;exports.uncapitalize=p.uncapitalize;exports.getElementTransitionDurationMS=E.getElementTransitionDurationMS;exports.getElementTransitionDurationS=E.getElementTransitionDurationS;exports.decode=k;exports.dotCircleCollision=z;exports.dotRectCollision=R;exports.encode=j;exports.getPathData=w;exports.getPoints=B;exports.getRootVariables=N;exports.insert=A;exports.shiftArray=M;
|
package/lib/utils/index.js
CHANGED
|
@@ -1,174 +1,181 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as M, p as P } from "../attributes-69we3byR.js";
|
|
2
2
|
import { i as T } from "../browser-0zX67oeU.js";
|
|
3
|
-
import { a as
|
|
4
|
-
import { g as B, n as N, s as
|
|
5
|
-
import { f as q, b as L, a as
|
|
6
|
-
import { c as K, n as
|
|
7
|
-
import { d as
|
|
8
|
-
import { c as
|
|
9
|
-
import { d as
|
|
10
|
-
import { s as
|
|
11
|
-
import { g as
|
|
12
|
-
import { e as
|
|
13
|
-
import { p as
|
|
14
|
-
import { c as
|
|
3
|
+
import { a as Q, c as R, f as z, m as k } from "../canvas-DeZ0SLUJ.js";
|
|
4
|
+
import { g as B, n as N, s as V } from "../coordinates-CgdGoSYs.js";
|
|
5
|
+
import { f as q, b as L, a as W, g as H } from "../dom-0S_WDL4g.js";
|
|
6
|
+
import { c as K, n as $, f as F, p as G, b as X, i as Y, m as Z, e as _, g as ee, j as te, d as ae, o as se, a as ne, h as oe, k as re, l as ie } from "../easings-BKi40vHz.js";
|
|
7
|
+
import { d as ue } from "../events-_C2CztxR.js";
|
|
8
|
+
import { c as pe } from "../file-lxi_oXJf.js";
|
|
9
|
+
import { d as me, t as he } from "../function-C10DGppn.js";
|
|
10
|
+
import { s as xe } from "../gestures-D2Fdra_G.js";
|
|
11
|
+
import { g as be, a as we, b as ye } from "../layout-HoBT_Da2.js";
|
|
12
|
+
import { e as ve, f as Ee, c as Ie, d as Oe, l as Se, m as Me, r as Pe, b as Ae, a as Te, s as De } from "../math-BOBiC4TN.js";
|
|
13
|
+
import { p as Re, r as ze } from "../number-Bo5RdrA1.js";
|
|
14
|
+
import { c as je, d as Be, i as Ne, b as Ve, a as Ue, m as qe, e as Le, o as We, p as He } from "../object-D6MVWB4l.js";
|
|
15
15
|
import { n as Ke } from "../polyfills-DJUYczFm.js";
|
|
16
|
-
import { c as
|
|
17
|
-
import { a as
|
|
16
|
+
import { c as Fe, a as Ge, g as Xe, i as Ye, k as Ze, s as _e, t as et, u as tt } from "../string-f0Dnk0L1.js";
|
|
17
|
+
import { a as st, g as nt } from "../style-CklEF62D.js";
|
|
18
18
|
import "../path-data-polyfill-DgeDWYeI.js";
|
|
19
|
-
function
|
|
20
|
-
return [...t.slice(0, e), ...
|
|
19
|
+
function g(t, e, ...a) {
|
|
20
|
+
return [...t.slice(0, e), ...a, ...t.slice(e)];
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
e = e %
|
|
25
|
-
const n = new Array(
|
|
26
|
-
for (let o = 0; o <
|
|
27
|
-
const r = (o + e) %
|
|
22
|
+
function b(t, e) {
|
|
23
|
+
const a = t.length;
|
|
24
|
+
e = e % a;
|
|
25
|
+
const n = new Array(a);
|
|
26
|
+
for (let o = 0; o < a; o++) {
|
|
27
|
+
const r = (o + e) % a;
|
|
28
28
|
n[r] = t[o];
|
|
29
29
|
}
|
|
30
30
|
return n;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function w(t, e) {
|
|
33
33
|
return t.x < e.x + e.width && t.x > e.x && t.y < e.y + e.height && t.y > e.y;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function y(t, e) {
|
|
36
36
|
return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function p(t, e) {
|
|
39
|
+
const a = t.styleMap.get(e);
|
|
40
|
+
if (a) {
|
|
41
|
+
const n = a.toString();
|
|
42
|
+
return n.startsWith("var") ? p(t, n.slice(4, -1)) : n;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function C(...t) {
|
|
39
46
|
const e = {};
|
|
40
|
-
return Array.from(document.styleSheets).forEach((
|
|
41
|
-
Array.from(
|
|
47
|
+
return Array.from(document.styleSheets).forEach((a) => {
|
|
48
|
+
Array.from(a.cssRules).forEach((n) => {
|
|
42
49
|
n instanceof CSSStyleRule && n.selectorText === ":root" && t.forEach((o) => {
|
|
43
|
-
const r = n
|
|
44
|
-
r && (e[o] = r
|
|
50
|
+
const r = p(n, o);
|
|
51
|
+
r && (e[o] = r);
|
|
45
52
|
});
|
|
46
53
|
});
|
|
47
|
-
}), t.forEach((
|
|
48
|
-
e[
|
|
54
|
+
}), t.forEach((a) => {
|
|
55
|
+
e[a] || console.warn(`variable named ${a} not found`);
|
|
49
56
|
}), e;
|
|
50
57
|
}
|
|
51
|
-
function
|
|
58
|
+
function v(t) {
|
|
52
59
|
const e = window.atob(t);
|
|
53
60
|
return decodeURIComponent(window.escape(e));
|
|
54
61
|
}
|
|
55
|
-
function
|
|
62
|
+
function E(t) {
|
|
56
63
|
const e = window.unescape(encodeURIComponent(t));
|
|
57
64
|
return window.btoa(e);
|
|
58
65
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
const n =
|
|
63
|
-
x: parseInt(
|
|
64
|
-
y: parseInt(
|
|
65
|
-
width: parseInt(
|
|
66
|
-
height: parseInt(
|
|
66
|
+
function h(t, { pathSelector: e = "path" } = {}) {
|
|
67
|
+
const a = document.createElement(null);
|
|
68
|
+
a.innerHTML = t;
|
|
69
|
+
const n = a.firstElementChild, r = n.querySelector(e).getPathData(), s = n.getAttribute("viewBox").split(" ").map((c) => c.trim()), i = {
|
|
70
|
+
x: parseInt(s[0]),
|
|
71
|
+
y: parseInt(s[1]),
|
|
72
|
+
width: parseInt(s[2]),
|
|
73
|
+
height: parseInt(s[3])
|
|
67
74
|
}, u = Math.min(i.width, i.height);
|
|
68
75
|
return r.forEach((c) => {
|
|
69
76
|
c.values = c.values.map((l) => l / u);
|
|
70
77
|
}), r;
|
|
71
78
|
}
|
|
72
|
-
function
|
|
79
|
+
function d(t, e, a, n, o) {
|
|
73
80
|
const r = [];
|
|
74
|
-
for (let
|
|
75
|
-
const i = Math.pow(1 -
|
|
81
|
+
for (let s = 0; s <= 1; s += 1 / o) {
|
|
82
|
+
const i = Math.pow(1 - s, 3) * t.x + 3 * Math.pow(1 - s, 2) * s * e.x + 3 * (1 - s) * Math.pow(s, 2) * a.x + Math.pow(s, 3) * n.x, u = Math.pow(1 - s, 3) * t.y + 3 * Math.pow(1 - s, 2) * s * e.y + 3 * (1 - s) * Math.pow(s, 2) * a.y + Math.pow(s, 3) * n.y;
|
|
76
83
|
r.push({ x: i, y: u });
|
|
77
84
|
}
|
|
78
85
|
return r;
|
|
79
86
|
}
|
|
80
|
-
function
|
|
81
|
-
const
|
|
87
|
+
function I(t, e) {
|
|
88
|
+
const a = (e == null ? void 0 : e.segments) || 20, n = h(t, e);
|
|
82
89
|
let o = [];
|
|
83
90
|
for (let r = 0; r < n.length - 1; r++) {
|
|
84
|
-
const { type:
|
|
85
|
-
if (
|
|
91
|
+
const { type: s, values: i } = n[r];
|
|
92
|
+
if (s === "M" && r === 0)
|
|
86
93
|
o.push({ x: i[0], y: i[1] });
|
|
87
|
-
else if (
|
|
88
|
-
const u = o[o.length - 1], c = { x: i[0], y: i[1] }, l = { x: i[2], y: i[3] },
|
|
89
|
-
o = [...o, ...
|
|
94
|
+
else if (s === "C") {
|
|
95
|
+
const u = o[o.length - 1], c = { x: i[0], y: i[1] }, l = { x: i[2], y: i[3] }, f = { x: i[4], y: i[5] }, m = d(u, c, l, f, a);
|
|
96
|
+
o = [...o, ...m];
|
|
90
97
|
}
|
|
91
98
|
}
|
|
92
99
|
return o;
|
|
93
100
|
}
|
|
94
101
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
ve as calculateDistance,
|
|
103
|
+
Ee as calculateDistanceWithRadius,
|
|
104
|
+
Fe as camelToKebab,
|
|
105
|
+
Ge as capitalize,
|
|
106
|
+
Ie as clamp,
|
|
107
|
+
je as cloneDeep,
|
|
101
108
|
Be as compareObjects,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
Q as contain,
|
|
110
|
+
R as cover,
|
|
111
|
+
pe as createJSONAndSave,
|
|
112
|
+
Oe as damp,
|
|
113
|
+
me as debounce,
|
|
114
|
+
E as decode,
|
|
115
|
+
ue as dispatchSizeChangeEvent,
|
|
116
|
+
y as dotCircleCollision,
|
|
117
|
+
w as dotRectCollision,
|
|
111
118
|
K as easeInCubic,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
$ as easeInExpo,
|
|
120
|
+
F as easeInOutCubic,
|
|
121
|
+
G as easeInOutExpo,
|
|
122
|
+
X as easeInOutQuad,
|
|
123
|
+
Y as easeInOutQuart,
|
|
124
|
+
Z as easeInOutQuint,
|
|
125
|
+
_ as easeInQuad,
|
|
126
|
+
ee as easeInQuart,
|
|
127
|
+
te as easeInQuint,
|
|
128
|
+
ae as easeOutCubic,
|
|
129
|
+
se as easeOutExpo,
|
|
130
|
+
ne as easeOutQuad,
|
|
124
131
|
oe as easeOutQuart,
|
|
125
|
-
|
|
126
|
-
|
|
132
|
+
re as easeOutQuint,
|
|
133
|
+
v as encode,
|
|
127
134
|
q as findParentElement,
|
|
128
135
|
L as findScrollParentElement,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
136
|
+
z as fixPosition,
|
|
137
|
+
Xe as generateId,
|
|
138
|
+
W as getAllParentElements,
|
|
139
|
+
be as getCumulativeOffsetLeft,
|
|
140
|
+
we as getCumulativeOffsetTop,
|
|
141
|
+
ye as getCumulativePosition,
|
|
135
142
|
H as getElement,
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
143
|
+
st as getElementTransitionDurationMS,
|
|
144
|
+
nt as getElementTransitionDurationS,
|
|
145
|
+
h as getPathData,
|
|
139
146
|
B as getPointerPosition,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
147
|
+
I as getPoints,
|
|
148
|
+
C as getRootVariables,
|
|
149
|
+
g as insert,
|
|
143
150
|
T as isBrowser,
|
|
144
151
|
Ne as isESClass,
|
|
145
|
-
|
|
152
|
+
Ve as isNullish,
|
|
146
153
|
Ue as isObject,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
Ye as isUppercase,
|
|
155
|
+
Ze as kebabToCamel,
|
|
156
|
+
Se as lerp,
|
|
157
|
+
ie as linear,
|
|
158
|
+
Me as mapRange,
|
|
159
|
+
k as measureText,
|
|
153
160
|
qe as mergeDeep,
|
|
154
161
|
Le as mixin,
|
|
155
162
|
N as normalize,
|
|
156
163
|
Ke as nullishCoalescing,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
We as omit,
|
|
165
|
+
M as parseAttribute,
|
|
166
|
+
P as parseAttributeValue,
|
|
160
167
|
He as pick,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
Re as preciseNumber,
|
|
169
|
+
Pe as round,
|
|
170
|
+
ze as roundNumberTo,
|
|
171
|
+
V as screenToCartesian,
|
|
172
|
+
xe as setupDrag,
|
|
173
|
+
b as shiftArray,
|
|
174
|
+
Ae as smootherstep,
|
|
168
175
|
Te as smoothstep,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
176
|
+
_e as snakeToDotted,
|
|
177
|
+
De as step,
|
|
178
|
+
he as throttle,
|
|
179
|
+
et as toPascalCase,
|
|
180
|
+
tt as uncapitalize
|
|
174
181
|
};
|