aptechka 0.4.14 → 0.4.15
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/{Damped-BZujMwuv.js → Damped-B91XlC1a.js} +6 -7
- package/lib/Damped-D2k3SbmP.cjs +1 -0
- package/lib/animation/Animation.d.ts +2 -2
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +21 -20
- package/lib/morph/Morph.d.ts +1 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +140 -121
- package/lib/scroll/ScrollElement.d.ts +13 -9
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +527 -491
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.js +38 -36
- package/package.json +1 -1
- package/lib/Damped-DK3CSBXb.cjs +0 -1
package/lib/utils/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../attributes-Bf2svn4j.cjs"),I=require("../browser-CpzFX2xg.cjs"),m=require("../dom-JBOkFLTh.cjs"),r=require("../easings-DsS5-Kqc.cjs"),v=require("../events-Crwi8fz6.cjs"),P=require("../file-EevnUtRj.cjs"),y=require("../function-MthRj-GJ.cjs"),S=require("../gestures-DHLrn6Q8.cjs"),f=require("../layout-8ryRAMGJ.cjs"),h=require("../math-GDWEqu7y.cjs"),b=require("../number-yVpzMdbQ.cjs"),d=require("../object-CCiXnER2.cjs"),D=require("../polyfills-CrcS4RcO.cjs"),p=require("../string-DhgS_iFl.cjs"),w=require("../style-At6aDoqG.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");function T(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function q(t,e){const n=t.length;e=e%n;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../attributes-Bf2svn4j.cjs"),I=require("../browser-CpzFX2xg.cjs"),m=require("../dom-JBOkFLTh.cjs"),r=require("../easings-DsS5-Kqc.cjs"),v=require("../events-Crwi8fz6.cjs"),P=require("../file-EevnUtRj.cjs"),y=require("../function-MthRj-GJ.cjs"),S=require("../gestures-DHLrn6Q8.cjs"),f=require("../layout-8ryRAMGJ.cjs"),h=require("../math-GDWEqu7y.cjs"),b=require("../number-yVpzMdbQ.cjs"),d=require("../object-CCiXnER2.cjs"),D=require("../polyfills-CrcS4RcO.cjs"),p=require("../string-DhgS_iFl.cjs"),w=require("../style-At6aDoqG.cjs");require("../path-data-polyfill-CXsOR7Oc.cjs");function T(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function q(t,e){const n=t.length;e=e%n;const s=new Array(n);for(let a=0;a<n;a++){const o=(a+e)%n;s[o]=t[a]}return s}function Q(t,e){const n=t.measureText(e),s=n.actualBoundingBoxAscent+n.actualBoundingBoxDescent,a=n.width;return{height:s,width:a}}function M(t){return Math.floor(t)+.5}function A(t,e,n,s,a,o){let i=t/e,u=n/s,l=0,c=0;return a=typeof a=="undefined"?.5:a,o=typeof o=="undefined"?.5:o,i>u?(l=s,c=s*i):(c=n,l=n/i),[(n-c)*a,(s-l)*o,c,l]}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 B(t,e,n=!1){let s=t.x-e.width/2,a=e.height/2-t.y;return n&&(s=s/(e.width/2),a=a/(e.height/2)),{x:s,y:a}}function N(t,e){const n=t.x/e.x,s=t.y/e.y;return{x:n,y:s}}function j(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 k(...t){const e={};return Array.from(document.styleSheets).forEach(n=>{Array.from(n.cssRules).forEach(s=>{s instanceof CSSStyleRule&&s.selectorText===":root"&&t.forEach(a=>{const o=s.styleMap.get(a);o&&(e[a]=o.toString())})})}),t.forEach(n=>{e[n]||console.warn(`variable named ${n} not found`)}),e}function U(t){const e=window.atob(t);return decodeURIComponent(window.escape(e))}function V(t){const e=window.unescape(encodeURIComponent(t));return window.btoa(e)}function C(t,{pathSelector:e="path"}={}){const n=document.createElement(null);n.innerHTML=t;const s=n.firstElementChild,o=s.querySelector(e).getPathData(),i=s.getAttribute("viewBox").split(" ").map(c=>c.trim()),u={x:parseInt(i[0]),y:parseInt(i[1]),width:parseInt(i[2]),height:parseInt(i[3])},l=Math.min(u.width,u.height);return o.forEach(c=>{c.values=c.values.map(g=>g/l)}),o}function J(t,e,n,s,a){const o=[];for(let i=0;i<=1;i+=1/a){const u=Math.pow(1-i,3)*t.x+3*Math.pow(1-i,2)*i*e.x+3*(1-i)*Math.pow(i,2)*n.x+Math.pow(i,3)*s.x,l=Math.pow(1-i,3)*t.y+3*Math.pow(1-i,2)*i*e.y+3*(1-i)*Math.pow(i,2)*n.y+Math.pow(i,3)*s.y;o.push({x:u,y:l})}return o}function K(t,e){const n=(e==null?void 0:e.segments)||20,s=C(t,e);let a=[];for(let o=0;o<s.length-1;o++){const{type:i,values:u}=s[o];if(i==="M"&&o===0)a.push({x:u[0],y:u[1]});else if(i==="C"){const l=a[a.length-1],c={x:u[0],y:u[1]},g={x:u[2],y:u[3]},O={x:u[4],y:u[5]},E=J(l,c,g,O,n);a=[...a,...E]}}return a}exports.parseAttribute=x.parseAttribute;exports.parseAttributeValue=x.parseAttributeValue;exports.isBrowser=I.isBrowser;exports.findParentElement=m.findParentElement;exports.findScrollParentElement=m.findScrollParentElement;exports.getAllParentElements=m.getAllParentElements;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=v.dispatchSizeChangeEvent;exports.createJSONAndSave=P.createJSONAndSave;exports.debounce=y.debounce;exports.throttle=y.throttle;exports.setupDrag=S.setupDrag;exports.getCumulativeOffsetLeft=f.getCumulativeOffsetLeft;exports.getCumulativeOffsetTop=f.getCumulativeOffsetTop;exports.getCumulativePosition=f.getCumulativePosition;exports.calculateDistance=h.calculateDistance;exports.calculateDistanceWithRadius=h.calculateDistanceWithRadius;exports.clamp=h.clamp;exports.damp=h.damp;exports.lerp=h.lerp;exports.mapRange=h.mapRange;exports.round=h.round;exports.smootherstep=h.smootherstep;exports.smoothstep=h.smoothstep;exports.step=h.step;exports.preciseNumber=b.preciseNumber;exports.roundNumberTo=b.roundNumberTo;exports.cloneDeep=d.cloneDeep;exports.compareObjects=d.compareObjects;exports.isESClass=d.isESClass;exports.isNullish=d.isNullish;exports.isObject=d.isObject;exports.mergeDeep=d.mergeDeep;exports.mixin=d.mixin;exports.omit=d.omit;exports.pick=d.pick;exports.nullishCoalescing=D.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=w.getElementTransitionDurationMS;exports.getElementTransitionDurationS=w.getElementTransitionDurationS;exports.cover=A;exports.decode=V;exports.dotCircleCollision=z;exports.dotRectCollision=R;exports.encode=U;exports.fixPosition=M;exports.getPathData=C;exports.getPointerPosition=j;exports.getPoints=K;exports.getRootVariables=k;exports.insert=T;exports.measureText=Q;exports.normalize=N;exports.screenToCartesian=B;exports.shiftArray=q;
|
package/lib/utils/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { d as oe } from "../events-_C2CztxR.js";
|
|
|
6
6
|
import { c as ie } from "../file-lxi_oXJf.js";
|
|
7
7
|
import { d as ce, t as le } from "../function-C10DGppn.js";
|
|
8
8
|
import { s as he } from "../gestures-D2Fdra_G.js";
|
|
9
|
-
import { g as
|
|
9
|
+
import { g as fe, a as de, b as xe } from "../layout-HoBT_Da2.js";
|
|
10
10
|
import { e as ye, f as we, c as be, d as Ce, l as Ee, m as ve, r as Ie, b as Me, a as Oe, s as Se } from "../math-BOBiC4TN.js";
|
|
11
11
|
import { p as Ae, r as De } from "../number-Bo5RdrA1.js";
|
|
12
12
|
import { c as Qe, d as Te, i as Be, b as ke, a as ze, m as Ne, e as je, o as Ue, p as qe } from "../object-D6MVWB4l.js";
|
|
@@ -20,28 +20,28 @@ function x(t, e, ...a) {
|
|
|
20
20
|
function g(t, e) {
|
|
21
21
|
const a = t.length;
|
|
22
22
|
e = e % a;
|
|
23
|
-
const
|
|
24
|
-
for (let
|
|
25
|
-
const r = (
|
|
26
|
-
|
|
23
|
+
const s = new Array(a);
|
|
24
|
+
for (let n = 0; n < a; n++) {
|
|
25
|
+
const r = (n + e) % a;
|
|
26
|
+
s[r] = t[n];
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return s;
|
|
29
29
|
}
|
|
30
30
|
function y(t, e) {
|
|
31
|
-
const a = t.measureText(e),
|
|
31
|
+
const a = t.measureText(e), s = a.actualBoundingBoxAscent + a.actualBoundingBoxDescent, n = a.width;
|
|
32
32
|
return {
|
|
33
|
-
height:
|
|
34
|
-
width:
|
|
33
|
+
height: s,
|
|
34
|
+
width: n
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
function w(t) {
|
|
38
38
|
return Math.floor(t) + 0.5;
|
|
39
39
|
}
|
|
40
|
-
function b(t, e, a,
|
|
41
|
-
let o = t / e, i = a /
|
|
42
|
-
return
|
|
43
|
-
(a - u) *
|
|
44
|
-
(
|
|
40
|
+
function b(t, e, a, s, n, r) {
|
|
41
|
+
let o = t / e, i = a / s, c = 0, u = 0;
|
|
42
|
+
return n = typeof n == "undefined" ? 0.5 : n, r = typeof r == "undefined" ? 0.5 : r, o > i ? (c = s, u = s * o) : (u = a, c = a / o), [
|
|
43
|
+
(a - u) * n,
|
|
44
|
+
(s - c) * r,
|
|
45
45
|
u,
|
|
46
46
|
c
|
|
47
47
|
];
|
|
@@ -53,12 +53,12 @@ function E(t, e) {
|
|
|
53
53
|
return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2) < e.radius;
|
|
54
54
|
}
|
|
55
55
|
function v(t, e, a = !1) {
|
|
56
|
-
let
|
|
57
|
-
return a && (
|
|
56
|
+
let s = t.x - e.width / 2, n = e.height / 2 - t.y;
|
|
57
|
+
return a && (s = s / (e.width / 2), n = n / (e.height / 2)), { x: s, y: n };
|
|
58
58
|
}
|
|
59
59
|
function I(t, e) {
|
|
60
|
-
const a = t.x / e.x,
|
|
61
|
-
return { x: a, y:
|
|
60
|
+
const a = t.x / e.x, s = t.y / e.y;
|
|
61
|
+
return { x: a, y: s };
|
|
62
62
|
}
|
|
63
63
|
function M(t, e) {
|
|
64
64
|
return e = e || {
|
|
@@ -74,12 +74,14 @@ function M(t, e) {
|
|
|
74
74
|
function O(...t) {
|
|
75
75
|
const e = {};
|
|
76
76
|
return Array.from(document.styleSheets).forEach((a) => {
|
|
77
|
-
Array.from(a.cssRules).forEach((
|
|
78
|
-
|
|
79
|
-
const r =
|
|
80
|
-
r
|
|
77
|
+
Array.from(a.cssRules).forEach((s) => {
|
|
78
|
+
s instanceof CSSStyleRule && s.selectorText === ":root" && t.forEach((n) => {
|
|
79
|
+
const r = s.styleMap.get(n);
|
|
80
|
+
r && (e[n] = r.toString());
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
|
+
}), t.forEach((a) => {
|
|
84
|
+
e[a] || console.warn(`variable named ${a} not found`);
|
|
83
85
|
}), e;
|
|
84
86
|
}
|
|
85
87
|
function S(t) {
|
|
@@ -93,7 +95,7 @@ function P(t) {
|
|
|
93
95
|
function m(t, { pathSelector: e = "path" } = {}) {
|
|
94
96
|
const a = document.createElement(null);
|
|
95
97
|
a.innerHTML = t;
|
|
96
|
-
const
|
|
98
|
+
const s = a.firstElementChild, r = s.querySelector(e).getPathData(), o = s.getAttribute("viewBox").split(" ").map((u) => u.trim()), i = {
|
|
97
99
|
x: parseInt(o[0]),
|
|
98
100
|
y: parseInt(o[1]),
|
|
99
101
|
width: parseInt(o[2]),
|
|
@@ -103,27 +105,27 @@ function m(t, { pathSelector: e = "path" } = {}) {
|
|
|
103
105
|
u.values = u.values.map((l) => l / c);
|
|
104
106
|
}), r;
|
|
105
107
|
}
|
|
106
|
-
function
|
|
108
|
+
function f(t, e, a, s, n) {
|
|
107
109
|
const r = [];
|
|
108
|
-
for (let o = 0; o <= 1; o += 1 /
|
|
109
|
-
const i = Math.pow(1 - o, 3) * t.x + 3 * Math.pow(1 - o, 2) * o * e.x + 3 * (1 - o) * Math.pow(o, 2) * a.x + Math.pow(o, 3) *
|
|
110
|
+
for (let o = 0; o <= 1; o += 1 / n) {
|
|
111
|
+
const i = Math.pow(1 - o, 3) * t.x + 3 * Math.pow(1 - o, 2) * o * e.x + 3 * (1 - o) * Math.pow(o, 2) * a.x + Math.pow(o, 3) * s.x, c = Math.pow(1 - o, 3) * t.y + 3 * Math.pow(1 - o, 2) * o * e.y + 3 * (1 - o) * Math.pow(o, 2) * a.y + Math.pow(o, 3) * s.y;
|
|
110
112
|
r.push({ x: i, y: c });
|
|
111
113
|
}
|
|
112
114
|
return r;
|
|
113
115
|
}
|
|
114
116
|
function A(t, e) {
|
|
115
|
-
const a = (e == null ? void 0 : e.segments) || 20,
|
|
116
|
-
let
|
|
117
|
-
for (let r = 0; r <
|
|
118
|
-
const { type: o, values: i } =
|
|
117
|
+
const a = (e == null ? void 0 : e.segments) || 20, s = m(t, e);
|
|
118
|
+
let n = [];
|
|
119
|
+
for (let r = 0; r < s.length - 1; r++) {
|
|
120
|
+
const { type: o, values: i } = s[r];
|
|
119
121
|
if (o === "M" && r === 0)
|
|
120
|
-
|
|
122
|
+
n.push({ x: i[0], y: i[1] });
|
|
121
123
|
else if (o === "C") {
|
|
122
|
-
const c =
|
|
123
|
-
|
|
124
|
+
const c = n[n.length - 1], u = { x: i[0], y: i[1] }, l = { x: i[2], y: i[3] }, p = { x: i[4], y: i[5] }, h = f(c, u, l, p, a);
|
|
125
|
+
n = [...n, ...h];
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
|
-
return
|
|
128
|
+
return n;
|
|
127
129
|
}
|
|
128
130
|
export {
|
|
129
131
|
ye as calculateDistance,
|
|
@@ -162,8 +164,8 @@ export {
|
|
|
162
164
|
w as fixPosition,
|
|
163
165
|
Ge as generateId,
|
|
164
166
|
U as getAllParentElements,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
fe as getCumulativeOffsetLeft,
|
|
168
|
+
de as getCumulativeOffsetTop,
|
|
167
169
|
xe as getCumulativePosition,
|
|
168
170
|
q as getElement,
|
|
169
171
|
Le as getElementTransitionDurationMS,
|
package/package.json
CHANGED
package/lib/Damped-DK3CSBXb.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var w=Object.defineProperty,L=Object.defineProperties;var _=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var k=(s,e,t)=>e in s?w(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e||(e={}))j.call(e,t)&&k(s,t,e[t]);if(O)for(var t of O(e))z.call(e,t)&&k(s,t,e[t]);return s},P=(s,e)=>L(s,_(e));var v=(s,e,t)=>{if(!e.has(s))throw TypeError("Cannot "+t)};var i=(s,e,t)=>(v(s,e,"read from private field"),t?t.call(s):e.get(s)),a=(s,e,t)=>{if(e.has(s))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(s):e.set(s,t)},r=(s,e,t,h)=>(v(s,e,"write to private field"),h?h.call(s,t):e.set(s,t),t);const D=require("./math-GDWEqu7y.cjs"),S=require("./number-yVpzMdbQ.cjs"),c=require("./polyfills-CrcS4RcO.cjs");require("./path-data-polyfill-CXsOR7Oc.cjs");const I=require("./Store-BQGNOHlY.cjs"),M=require("./ticker/index.cjs");var d,f,F,m,C;class R extends I.Store{constructor(t,h){super(t||0);a(this,d,void 0);a(this,f,void 0);a(this,F,void 0);a(this,m,new I.Store(!1));a(this,C,t=>{this.handleAnimationFrame(t)});this.updateOptions(h)}get isRunning(){return i(this,m)}reset(){this.unlistenAnimationFrame(),super.reset()}close(){super.close(),this.unlistenAnimationFrame()}updateOptions(t){r(this,d,c.nullishCoalescing(t==null?void 0:t.maxFPS,i(this,d))),r(this,f,c.nullishCoalescing(t==null?void 0:t.order,i(this,f))),r(this,F,c.nullishCoalescing(t==null?void 0:t.culling,i(this,F)))}listenAnimationFrame(){i(this,m).current||(i(this,m).current=!0,M.ticker.subscribe(i(this,C),{maxFPS:i(this,d),order:i(this,f),culling:i(this,F)}))}unlistenAnimationFrame(){i(this,m).current&&(i(this,m).current=!1,M.ticker.unsubscribe(i(this,C)))}}d=new WeakMap,f=new WeakMap,F=new WeakMap,m=new WeakMap,C=new WeakMap;var n,A,u,l,g,x,b;class B extends R{constructor(t,h){super(t||0,h);a(this,n,void 0);a(this,A,void 0);a(this,u,void 0);a(this,l,void 0);a(this,g,void 0);a(this,x,void 0);a(this,b,void 0);this.damping=.01,this.stiffness=0,this.mass=0,r(this,n,0),r(this,A,0),r(this,u,0),r(this,l,0),r(this,g,0),r(this,x,0),r(this,b,()=>{this.set(i(this,n),!0)}),r(this,u,c.nullishCoalescing(h==null?void 0:h.min,-1/0)),r(this,l,c.nullishCoalescing(h==null?void 0:h.max,1/0)),r(this,n,this.current)}get target(){return i(this,n)}get direction(){return i(this,A)}get min(){return i(this,u)}set min(t){r(this,u,t),i(this,b).call(this)}get max(){return i(this,l)}set max(t){r(this,l,t),i(this,b).call(this)}get velocity(){return i(this,g)}get speed(){return i(this,x)}get length(){return i(this,l)-i(this,u)}get progress(){return this.length?S.preciseNumber((this.current-i(this,u))/this.length,6):0}get entry(){return P(N({},super.entry),{min:i(this,u),max:i(this,l),length:this.length,direction:this.direction,progress:this.progress})}set(t,h=!1){const y=i(this,n);r(this,n,D.clamp(t,i(this,u),i(this,l))),h&&(this.current=i(this,n)),i(this,n)!==y&&(r(this,A,Math.sign(t-i(this,n))||1),this.listenAnimationFrame())}shift(t,h=!1){this.set(i(this,n)+t,h)}reset(){this.set(this.initial,!0),super.reset()}listenAnimationFrame(){this.current!==this.target&&super.listenAnimationFrame()}updateOptions(t){super.updateOptions(t),this.damping=c.nullishCoalescing(t==null?void 0:t.damping,this.damping),this.mass=c.nullishCoalescing(t==null?void 0:t.damping,this.mass),this.stiffness=c.nullishCoalescing(t==null?void 0:t.damping,this.stiffness)}handleAnimationFrame(t){S.preciseNumber(this.current,4)===S.preciseNumber(this.target,4)&&(this.unlistenAnimationFrame(),this.current=this.target);const h=this.current,y=Math.abs(h-this.target);r(this,x,y/t.elapsed);const q=t.elapsed/1e3;if(this.mass||this.stiffness){const p=(i(this,n)-this.current)*this.stiffness-i(this,g)*this.damping;r(this,g,i(this,g)+p/this.mass*q),this.current+=i(this,g)*q}else this.current=D.damp(this.current,this.target,this.damping,q)}}n=new WeakMap,A=new WeakMap,u=new WeakMap,l=new WeakMap,g=new WeakMap,x=new WeakMap,b=new WeakMap;exports.Animation=R;exports.Damped=B;
|