aptechka 0.4.13 → 0.4.14

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