aptechka 0.1.12 → 0.1.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.
@@ -10,7 +10,6 @@ export declare class Tweened extends Animated {
10
10
  start(): void;
11
11
  pause(): void;
12
12
  stop(): void;
13
- get max(): import("../store").Store<number, keyof import("../store").StoreManagers, import("../store").StoreEntry<number>>;
14
13
  protected update(): void;
15
14
  protected handleAnimationFrame(e: TickerCallbackEntry): void;
16
15
  }
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty,c=Object.defineProperties;var l=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var i=(a,t,e)=>t in a?h(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,n=(a,t)=>{for(var e in t||(t={}))g.call(t,e)&&i(a,e,t[e]);if(r)for(var e of r(t))A.call(t,e)&&i(a,e,t[e]);return a},s=(a,t)=>c(a,l(t));var m=(a,t,e)=>(i(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../Animated-Bf-gPIQM.cjs"),x=require("../easings-DsS5-Kqc.cjs"),F=require("../Damped-BwpMU9Gi.cjs");class f extends d.Animated{constructor(e){super(s(n({},e),{min:(e==null?void 0:e.min)||0,max:(e==null?void 0:e.max)||1e3}));m(this,"easing");this.easing=(e==null?void 0:e.easing)||x.linear}start(){this.listenAnimationFrame()}pause(){this.unlistenAnimationFrame()}stop(){this.reset()}get max(){return super.max}update(){const e=(this.target-this.min.current)/(this.delta||1),u=this.easing(e);this.current=this.min.current+u*this.delta}handleAnimationFrame(e){this.shift(e.elapsed),(e.elapsed&&this.current===0||this.current===this.delta)&&this.unlistenAnimationFrame()}}exports.Animated=d.Animated;exports.Damped=F.Damped;exports.Tweened=f;
1
+ "use strict";var u=Object.defineProperty,c=Object.defineProperties;var l=Object.getOwnPropertyDescriptors;var r=Object.getOwnPropertySymbols;var g=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var i=(a,t,e)=>t in a?u(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,n=(a,t)=>{for(var e in t||(t={}))g.call(t,e)&&i(a,e,t[e]);if(r)for(var e of r(t))A.call(t,e)&&i(a,e,t[e]);return a},s=(a,t)=>c(a,l(t));var m=(a,t,e)=>(i(a,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../Animated-Bf-gPIQM.cjs"),F=require("../easings-DsS5-Kqc.cjs"),f=require("../Damped-BwpMU9Gi.cjs");class q extends d.Animated{constructor(e){super(s(n({},e),{min:(e==null?void 0:e.min)||0,max:(e==null?void 0:e.max)||1e3}));m(this,"easing");this.easing=(e==null?void 0:e.easing)||F.linear}start(){this.listenAnimationFrame()}pause(){this.unlistenAnimationFrame()}stop(){this.reset()}update(){const e=(this.target-this.min.current)/(this.delta||1),h=this.easing(e);this.current=this.min.current+h*this.delta}handleAnimationFrame(e){this.shift(e.elapsed),(e.elapsed&&this.current===0||this.current===this.delta)&&this.unlistenAnimationFrame()}}exports.Animated=d.Animated;exports.Damped=f.Damped;exports.Tweened=q;
@@ -1,27 +1,27 @@
1
1
  var d = Object.defineProperty, l = Object.defineProperties;
2
2
  var u = Object.getOwnPropertyDescriptors;
3
3
  var i = Object.getOwnPropertySymbols;
4
- var c = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
4
+ var c = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
5
5
  var r = (a, t, e) => t in a ? d(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, s = (a, t) => {
6
6
  for (var e in t || (t = {}))
7
7
  c.call(t, e) && r(a, e, t[e]);
8
8
  if (i)
9
9
  for (var e of i(t))
10
- x.call(t, e) && r(a, e, t[e]);
10
+ A.call(t, e) && r(a, e, t[e]);
11
11
  return a;
12
12
  }, m = (a, t) => l(a, u(t));
13
13
  var n = (a, t, e) => (r(a, typeof t != "symbol" ? t + "" : t, e), e);
14
- import { A as g } from "../Animated-Br_4OSth.js";
15
- import { l as A } from "../easings-BKi40vHz.js";
14
+ import { A as f } from "../Animated-Br_4OSth.js";
15
+ import { l as g } from "../easings-BKi40vHz.js";
16
16
  import { D as b } from "../Damped-urvryQLo.js";
17
- class w extends g {
17
+ class w extends f {
18
18
  constructor(e) {
19
19
  super(m(s({}, e), {
20
20
  min: (e == null ? void 0 : e.min) || 0,
21
21
  max: (e == null ? void 0 : e.max) || 1e3
22
22
  }));
23
23
  n(this, "easing");
24
- this.easing = (e == null ? void 0 : e.easing) || A;
24
+ this.easing = (e == null ? void 0 : e.easing) || g;
25
25
  }
26
26
  start() {
27
27
  this.listenAnimationFrame();
@@ -32,9 +32,6 @@ class w extends g {
32
32
  stop() {
33
33
  this.reset();
34
34
  }
35
- get max() {
36
- return super.max;
37
- }
38
35
  update() {
39
36
  const e = (this.target - this.min.current) / (this.delta || 1), h = this.easing(e);
40
37
  this.current = this.min.current + h * this.delta;
@@ -44,7 +41,7 @@ class w extends g {
44
41
  }
45
42
  }
46
43
  export {
47
- g as Animated,
44
+ f as Animated,
48
45
  b as Damped,
49
46
  w as Tweened
50
47
  };
@@ -22,5 +22,6 @@ export declare class Morph {
22
22
  constructor(parameters?: MorphParameters);
23
23
  beforeNavigationEvent(callback: MorphNavigationCallback): () => void;
24
24
  afterNavigationEvent(callback: MorphNavigationCallback): () => void;
25
+ prefetch(pathname: string): Promise<Document>;
25
26
  navigate(pathname: string, historyAction?: MorphHistoryAction): Promise<void>;
26
27
  }
@@ -1 +1 @@
1
- "use strict";var st=Object.defineProperty;var U=(i,t)=>(t=Symbol[i])?t:Symbol.for("Symbol."+i);var ot=(i,t,e)=>t in i?st(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var Y=(i,t,e)=>(ot(i,typeof t!="symbol"?t+"":t,e),e),_=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var s=(i,t,e)=>(_(i,t,"read from private field"),e?e.call(i):t.get(i)),o=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)},r=(i,t,e,n)=>(_(i,t,"write to private field"),n?n.call(i,e):t.set(i,e),e);var d=(i,t,e)=>(_(i,t,"access private method"),e);var F=(i,t,e)=>new Promise((n,h)=>{var u=l=>{try{g(e.next(l))}catch(w){h(w)}},E=l=>{try{g(e.throw(l))}catch(w){h(w)}},g=l=>l.done?n(l.value):Promise.resolve(l.value).then(u,E);g((e=e.apply(i,t)).next())});var V=(i,t,e)=>(t=i[U("asyncIterator")])?t.call(i):(i=i[U("iterator")](),t={},e=(n,h)=>(h=i[n])&&(t[n]=u=>new Promise((E,g,l)=>(u=h.call(i,u),l=u.done,Promise.resolve(u.value).then(w=>E({value:w,done:l}),g)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("../notifier/index.cjs"),nt=require("../browser-CpzFX2xg.cjs");var H,f,y,T,N;class rt{constructor(t,e){o(this,H,void 0);o(this,f,void 0);o(this,y,void 0);o(this,T,void 0);o(this,N,t=>{t.preventDefault(),s(this,H).navigate(s(this,y),s(this,T))});r(this,H,e),r(this,f,t),r(this,y,s(this,f).getAttribute("href")||"/"),r(this,T,s(this,f).getAttribute("data-history-action")||"push"),s(this,f).addEventListener("click",s(this,N)),s(this,y)===location.pathname&&s(this,f).classList.add("current")}destroy(){s(this,f).removeEventListener("click",s(this,N)),s(this,f).classList.remove("current")}}H=new WeakMap,f=new WeakMap,y=new WeakMap,T=new WeakMap,N=new WeakMap;var a,P,S,k,C,O,b,v,M,A,x,I,Z,j,$,D,z,q,G,m,p,R,J,B;class ct{constructor(t){o(this,I);o(this,j);o(this,D);o(this,q);o(this,m);o(this,R);o(this,a,null);o(this,P,null);o(this,S,null);o(this,k,null);o(this,C,[]);o(this,O,new DOMParser);o(this,b,new Map);o(this,v,void 0);o(this,M,null);Y(this,"preprocessor");Y(this,"postprocessor");o(this,A,new X.Notifier);o(this,x,new X.Notifier);o(this,B,t=>{t.state&&this.navigate(t.state,"none")});nt.isBrowser&&(r(this,a,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(r(this,a,t.base),t.base.endsWith("/")||r(this,a,s(this,a)+"/")):r(this,a,"/"),r(this,P,(t==null?void 0:t.waitForHeadToLoad)!==!1),r(this,S,(t==null?void 0:t.cachePages)!==!1),r(this,k,d(this,q,G).call(this,document)),r(this,M,location.pathname),d(this,D,z).call(this),addEventListener("popstate",s(this,B)))}beforeNavigationEvent(t){return s(this,A).subscribe(t)}afterNavigationEvent(t){return s(this,x).subscribe(t)}navigate(t,e="push"){return F(this,null,function*(){var h;if(t=d(this,j,$).call(this,t),s(this,v)===t||s(this,M)===t)return;r(this,v,t);const n=s(this,b).has(t);try{let u=!0;if(this.preprocessor)try{yield new Promise((c,L)=>{var W;(W=this.preprocessor)==null||W.call(this,{pathname:t,resolve:c,reject:L,isCached:n})})}catch(c){c?console.error(c):console.log("Route change canceled"),u=!1}if(s(this,A).notify({pathname:t,isCached:n}),!u||s(this,v)!==t)return;const E=yield d(this,I,Z).call(this,t);if(s(this,S)&&s(this,b).set(t,E),s(this,v)!==t)return;const g=Array.from(document.head.children),l=Array.from(E.head.cloneNode(!0).children),w=d(this,m,p).call(this,g,l),tt=d(this,R,J).call(this,g,w),Q=d(this,R,J).call(this,l,w);tt.forEach(c=>c.remove()),Q.forEach(c=>document.head.appendChild(c));const K=Q.filter(c=>c.tagName==="STYLE"||c.tagName==="SCRIPT"||c.tagName==="LINK");s(this,P)&&K.length&&(yield new Promise(c=>F(this,null,function*(){let L=0;try{for(var W=V(K),ut,dt,ft;ut=!(dt=yield W.next()).done;ut=!1){const it=dt.value;it.onload=()=>{L++,L===K.length&&c()}}}catch(dt){ft=[dt]}finally{try{ut&&(dt=W.return)&&(yield dt.call(W))}finally{if(ft)throw ft[0]}}})));const et=d(this,q,G).call(this,E);s(this,k).forEach((c,L)=>{const W=et[L];c.innerHTML=W.innerHTML}),r(this,M,t),e==="push"?history.pushState(t,"",t+location.search):e==="replace"&&history.replaceState(t,"",t+location.search),d(this,D,z).call(this),(h=this.postprocessor)==null||h.call(this,{pathname:t,isCached:n}),s(this,x).notify({pathname:t,isCached:n})}catch(u){console.error(u)}r(this,v,void 0)})}}a=new WeakMap,P=new WeakMap,S=new WeakMap,k=new WeakMap,C=new WeakMap,O=new WeakMap,b=new WeakMap,v=new WeakMap,M=new WeakMap,A=new WeakMap,x=new WeakMap,I=new WeakSet,Z=function(t){return F(this,null,function*(){const e=s(this,b).get(t);if(e)return e;const h=yield(yield fetch(t)).text();return s(this,O).parseFromString(h,"text/html")})},j=new WeakSet,$=function(t){return t=t.replace(s(this,a),""),t.startsWith("/")&&(t=t.slice(1)),s(this,a)+t},D=new WeakSet,z=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var n;return(n=e.getAttribute("href"))==null?void 0:n.startsWith("/")});s(this,C).forEach(e=>e.destroy()),r(this,C,t.map(e=>new rt(e,this)))},q=new WeakSet,G=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},m=new WeakSet,p=function(t,e){return t.filter(n=>e.find(h=>h.outerHTML===n.outerHTML))},R=new WeakSet,J=function(t,e){return t.filter(n=>!e.find(h=>h.outerHTML===n.outerHTML))},B=new WeakMap;exports.Morph=ct;
1
+ "use strict";var nt=Object.defineProperty;var V=(s,t)=>(t=Symbol[s])?t:Symbol.for("Symbol."+s);var ot=(s,t,e)=>t in s?nt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var _=(s,t,e)=>(ot(s,typeof t!="symbol"?t+"":t,e),e),m=(s,t,e)=>{if(!t.has(s))throw TypeError("Cannot "+e)};var i=(s,t,e)=>(m(s,t,"read from private field"),e?e.call(s):t.get(s)),n=(s,t,e)=>{if(t.has(s))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(s):t.set(s,e)},r=(s,t,e,o)=>(m(s,t,"write to private field"),o?o.call(s,e):t.set(s,e),e);var f=(s,t,e)=>(m(s,t,"access private method"),e);var T=(s,t,e)=>new Promise((o,c)=>{var l=u=>{try{g(e.next(u))}catch(v){c(v)}},y=u=>{try{g(e.throw(u))}catch(v){c(v)}},g=u=>u.done?o(u.value):Promise.resolve(u.value).then(l,y);g((e=e.apply(s,t)).next())});var X=(s,t,e)=>(t=s[V("asyncIterator")])?t.call(s):(s=s[V("iterator")](),t={},e=(o,c)=>(c=s[o])&&(t[o]=l=>new Promise((y,g,u)=>(l=c.call(s,l),u=l.done,Promise.resolve(l.value).then(v=>y({value:v,done:u}),g)))),e("next"),e("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Z=require("../notifier/index.cjs"),rt=require("../browser-CpzFX2xg.cjs");var M,d,w,N,P,S;class ht{constructor(t,e){n(this,M,void 0);n(this,d,void 0);n(this,w,void 0);n(this,N,void 0);n(this,P,t=>{t.preventDefault(),i(this,M).navigate(i(this,w),i(this,N))});n(this,S,()=>{i(this,M).prefetch(i(this,w))});r(this,M,e),r(this,d,t),r(this,w,i(this,d).getAttribute("href")||"/"),r(this,N,i(this,d).getAttribute("data-history-action")||"push"),i(this,d).addEventListener("click",i(this,P)),i(this,w)===location.pathname&&i(this,d).classList.add("current"),i(this,d).hasAttribute("data-prefetch")&&i(this,d).addEventListener("pointerenter",i(this,S))}destroy(){i(this,d).removeEventListener("click",i(this,P)),i(this,d).removeEventListener("pointerenter",i(this,S)),i(this,d).classList.remove("current")}}M=new WeakMap,d=new WeakMap,w=new WeakMap,N=new WeakMap,P=new WeakMap,S=new WeakMap;var a,k,A,C,x,j,E,L,H,D,q,R,z,p,$,W,G,F,J,B,tt,O,Q,K;class ct{constructor(t){n(this,R);n(this,p);n(this,W);n(this,F);n(this,B);n(this,O);n(this,a,null);n(this,k,null);n(this,A,null);n(this,C,null);n(this,x,[]);n(this,j,new DOMParser);n(this,E,new Map);n(this,L,void 0);n(this,H,null);_(this,"preprocessor");_(this,"postprocessor");n(this,D,new Z.Notifier);n(this,q,new Z.Notifier);n(this,K,t=>{t.state&&this.navigate(t.state,"none")});rt.isBrowser&&(r(this,a,(t==null?void 0:t.base)||"/"),t!=null&&t.base?(r(this,a,t.base),t.base.endsWith("/")||r(this,a,i(this,a)+"/")):r(this,a,"/"),r(this,k,(t==null?void 0:t.waitForHeadToLoad)!==!1),r(this,A,(t==null?void 0:t.cachePages)!==!1),r(this,C,f(this,F,J).call(this,document)),r(this,H,location.pathname),f(this,W,G).call(this),addEventListener("popstate",i(this,K)))}beforeNavigationEvent(t){return i(this,D).subscribe(t)}afterNavigationEvent(t){return i(this,q).subscribe(t)}prefetch(t){return T(this,null,function*(){return f(this,R,z).call(this,t)})}navigate(t,e="push"){return T(this,null,function*(){var c;if(t=f(this,p,$).call(this,t),i(this,L)===t||i(this,H)===t)return;r(this,L,t);const o=i(this,E).has(t);try{let l=!0;if(this.preprocessor)try{yield new Promise((h,b)=>{var I;(I=this.preprocessor)==null||I.call(this,{pathname:t,resolve:h,reject:b,isCached:o})})}catch(h){h?console.error(h):console.log("Route change canceled"),l=!1}if(i(this,D).notify({pathname:t,isCached:o}),!l||i(this,L)!==t)return;const y=i(this,E).get(t)||(yield f(this,R,z).call(this,t));if(i(this,L)!==t)return;const g=Array.from(document.head.children),u=Array.from(y.head.cloneNode(!0).children),v=f(this,B,tt).call(this,g,u),et=f(this,O,Q).call(this,g,v),U=f(this,O,Q).call(this,u,v);et.forEach(h=>h.remove()),U.forEach(h=>document.head.appendChild(h));const Y=U.filter(h=>h.tagName==="STYLE"||h.tagName==="SCRIPT"||h.tagName==="LINK");i(this,k)&&Y.length&&(yield new Promise(h=>T(this,null,function*(){let b=0;try{for(var I=X(Y),dt,ft,at;dt=!(ft=yield I.next()).done;dt=!1){const st=ft.value;st.onload=()=>{b++,b===Y.length&&h()}}}catch(ft){at=[ft]}finally{try{dt&&(ft=I.return)&&(yield ft.call(I))}finally{if(at)throw at[0]}}})));const it=f(this,F,J).call(this,y);i(this,C).forEach((h,b)=>{const I=it[b];h.innerHTML=I.innerHTML}),r(this,H,t),e==="push"?history.pushState(t,"",t+location.search):e==="replace"&&history.replaceState(t,"",t+location.search),f(this,W,G).call(this),(c=this.postprocessor)==null||c.call(this,{pathname:t,isCached:o}),i(this,q).notify({pathname:t,isCached:o})}catch(l){console.error(l)}r(this,L,void 0)})}}a=new WeakMap,k=new WeakMap,A=new WeakMap,C=new WeakMap,x=new WeakMap,j=new WeakMap,E=new WeakMap,L=new WeakMap,H=new WeakMap,D=new WeakMap,q=new WeakMap,R=new WeakSet,z=function(t){return T(this,null,function*(){const e=i(this,E).get(t);if(e)return e;const c=yield(yield fetch(t)).text(),l=i(this,j).parseFromString(c,"text/html");return i(this,A)&&i(this,E).set(t,l),l})},p=new WeakSet,$=function(t){return t=t.replace(i(this,a),""),t.startsWith("/")&&(t=t.slice(1)),i(this,a)+t},W=new WeakSet,G=function(){const t=[...document.documentElement.querySelectorAll("a")].filter(e=>{var o;return(o=e.getAttribute("href"))==null?void 0:o.startsWith("/")});i(this,x).forEach(e=>e.destroy()),r(this,x,t.map(e=>new ht(e,this)))},F=new WeakSet,J=function(t){const e=t.querySelectorAll("[data-morph]");return e.length?[...e]:[t.body]},B=new WeakSet,tt=function(t,e){return t.filter(o=>e.find(c=>c.outerHTML===o.outerHTML))},O=new WeakSet,Q=function(t,e){return t.filter(o=>!e.find(c=>c.outerHTML===o.outerHTML))},K=new WeakMap;exports.Morph=ct;
@@ -1,179 +1,191 @@
1
- var st = Object.defineProperty;
2
- var V = (i, t) => (t = Symbol[i]) ? t : Symbol.for("Symbol." + i);
3
- var ot = (i, t, e) => t in i ? st(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
4
- var j = (i, t, e) => (ot(i, typeof t != "symbol" ? t + "" : t, e), e), z = (i, t, e) => {
5
- if (!t.has(i))
1
+ var ot = Object.defineProperty;
2
+ var X = (s, t) => (t = Symbol[s]) ? t : Symbol.for("Symbol." + s);
3
+ var nt = (s, t, e) => t in s ? ot(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
4
+ var j = (s, t, e) => (nt(s, typeof t != "symbol" ? t + "" : t, e), e), z = (s, t, e) => {
5
+ if (!t.has(s))
6
6
  throw TypeError("Cannot " + e);
7
7
  };
8
- var s = (i, t, e) => (z(i, t, "read from private field"), e ? e.call(i) : t.get(i)), o = (i, t, e) => {
9
- if (t.has(i))
8
+ var i = (s, t, e) => (z(s, t, "read from private field"), e ? e.call(s) : t.get(s)), o = (s, t, e) => {
9
+ if (t.has(s))
10
10
  throw TypeError("Cannot add the same private member more than once");
11
- t instanceof WeakSet ? t.add(i) : t.set(i, e);
12
- }, r = (i, t, e, n) => (z(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e);
13
- var d = (i, t, e) => (z(i, t, "access private method"), e);
14
- var F = (i, t, e) => new Promise((n, h) => {
15
- var u = (l) => {
11
+ t instanceof WeakSet ? t.add(s) : t.set(s, e);
12
+ }, r = (s, t, e, n) => (z(s, t, "write to private field"), n ? n.call(s, e) : t.set(s, e), e);
13
+ var d = (s, t, e) => (z(s, t, "access private method"), e);
14
+ var T = (s, t, e) => new Promise((n, c) => {
15
+ var l = (f) => {
16
16
  try {
17
- g(e.next(l));
18
- } catch (w) {
19
- h(w);
17
+ g(e.next(f));
18
+ } catch (L) {
19
+ c(L);
20
20
  }
21
- }, L = (l) => {
21
+ }, y = (f) => {
22
22
  try {
23
- g(e.throw(l));
24
- } catch (w) {
25
- h(w);
23
+ g(e.throw(f));
24
+ } catch (L) {
25
+ c(L);
26
26
  }
27
- }, g = (l) => l.done ? n(l.value) : Promise.resolve(l.value).then(u, L);
28
- g((e = e.apply(i, t)).next());
27
+ }, g = (f) => f.done ? n(f.value) : Promise.resolve(f.value).then(l, y);
28
+ g((e = e.apply(s, t)).next());
29
29
  });
30
- var X = (i, t, e) => (t = i[V("asyncIterator")]) ? t.call(i) : (i = i[V("iterator")](), t = {}, e = (n, h) => (h = i[n]) && (t[n] = (u) => new Promise((L, g, l) => (u = h.call(i, u), l = u.done, Promise.resolve(u.value).then((w) => L({ value: w, done: l }), g)))), e("next"), e("return"), t);
31
- import { Notifier as Z } from "../notifier/index.js";
32
- import { i as nt } from "../browser-0zX67oeU.js";
33
- var M, f, y, T, N;
34
- class rt {
30
+ var Z = (s, t, e) => (t = s[X("asyncIterator")]) ? t.call(s) : (s = s[X("iterator")](), t = {}, e = (n, c) => (c = s[n]) && (t[n] = (l) => new Promise((y, g, f) => (l = c.call(s, l), f = l.done, Promise.resolve(l.value).then((L) => y({ value: L, done: f }), g)))), e("next"), e("return"), t);
31
+ import { Notifier as _ } from "../notifier/index.js";
32
+ import { i as rt } from "../browser-0zX67oeU.js";
33
+ var H, u, E, N, P, S;
34
+ class ht {
35
35
  constructor(t, e) {
36
- o(this, M, void 0);
37
- o(this, f, void 0);
38
- o(this, y, void 0);
39
- o(this, T, void 0);
40
- o(this, N, (t) => {
41
- t.preventDefault(), s(this, M).navigate(s(this, y), s(this, T));
36
+ o(this, H, void 0);
37
+ o(this, u, void 0);
38
+ o(this, E, void 0);
39
+ o(this, N, void 0);
40
+ o(this, P, (t) => {
41
+ t.preventDefault(), i(this, H).navigate(i(this, E), i(this, N));
42
+ });
43
+ o(this, S, () => {
44
+ i(this, H).prefetch(i(this, E));
42
45
  });
43
- r(this, M, e), r(this, f, t), r(this, y, s(this, f).getAttribute("href") || "/"), r(this, T, s(this, f).getAttribute("data-history-action") || "push"), s(this, f).addEventListener("click", s(this, N)), s(this, y) === location.pathname && s(this, f).classList.add("current");
46
+ r(this, H, e), r(this, u, t), r(this, E, i(this, u).getAttribute("href") || "/"), r(this, N, i(this, u).getAttribute(
47
+ "data-history-action"
48
+ ) || "push"), i(this, u).addEventListener("click", i(this, P)), i(this, E) === location.pathname && i(this, u).classList.add("current"), i(this, u).hasAttribute("data-prefetch") && i(this, u).addEventListener("pointerenter", i(this, S));
44
49
  }
45
50
  destroy() {
46
- s(this, f).removeEventListener("click", s(this, N)), s(this, f).classList.remove("current");
51
+ i(this, u).removeEventListener("click", i(this, P)), i(this, u).removeEventListener("pointerenter", i(this, S)), i(this, u).classList.remove("current");
47
52
  }
48
53
  }
49
- M = new WeakMap(), f = new WeakMap(), y = new WeakMap(), T = new WeakMap(), N = new WeakMap();
50
- var a, P, S, k, C, q, b, E, H, A, x, I, _, O, $, D, G, m, J, B, p, R, Q, K;
54
+ H = new WeakMap(), u = new WeakMap(), E = new WeakMap(), N = new WeakMap(), P = new WeakMap(), S = new WeakMap();
55
+ var a, k, A, C, x, I, w, v, M, D, R, W, G, O, $, m, J, F, Q, B, tt, p, U, K;
51
56
  class ut {
52
57
  constructor(t) {
53
- o(this, I);
58
+ o(this, W);
54
59
  o(this, O);
55
- o(this, D);
56
60
  o(this, m);
61
+ o(this, F);
57
62
  o(this, B);
58
- o(this, R);
63
+ o(this, p);
59
64
  o(this, a, null);
60
- o(this, P, null);
61
- o(this, S, null);
62
65
  o(this, k, null);
63
- o(this, C, []);
64
- o(this, q, new DOMParser());
65
- o(this, b, /* @__PURE__ */ new Map());
66
- o(this, E, void 0);
67
- o(this, H, null);
66
+ o(this, A, null);
67
+ o(this, C, null);
68
+ o(this, x, []);
69
+ o(this, I, new DOMParser());
70
+ o(this, w, /* @__PURE__ */ new Map());
71
+ o(this, v, void 0);
72
+ o(this, M, null);
68
73
  j(this, "preprocessor");
69
74
  j(this, "postprocessor");
70
- o(this, A, new Z());
71
- o(this, x, new Z());
75
+ o(this, D, new _());
76
+ o(this, R, new _());
72
77
  o(this, K, (t) => {
73
78
  t.state && this.navigate(t.state, "none");
74
79
  });
75
- nt && (r(this, a, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (r(this, a, t.base), t.base.endsWith("/") || r(this, a, s(this, a) + "/")) : r(this, a, "/"), r(this, P, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), r(this, S, (t == null ? void 0 : t.cachePages) !== !1), r(this, k, d(this, m, J).call(this, document)), r(this, H, location.pathname), d(this, D, G).call(this), addEventListener("popstate", s(this, K)));
80
+ rt && (r(this, a, (t == null ? void 0 : t.base) || "/"), t != null && t.base ? (r(this, a, t.base), t.base.endsWith("/") || r(this, a, i(this, a) + "/")) : r(this, a, "/"), r(this, k, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), r(this, A, (t == null ? void 0 : t.cachePages) !== !1), r(this, C, d(this, F, Q).call(this, document)), r(this, M, location.pathname), d(this, m, J).call(this), addEventListener("popstate", i(this, K)));
76
81
  }
77
82
  beforeNavigationEvent(t) {
78
- return s(this, A).subscribe(t);
83
+ return i(this, D).subscribe(t);
79
84
  }
80
85
  afterNavigationEvent(t) {
81
- return s(this, x).subscribe(t);
86
+ return i(this, R).subscribe(t);
87
+ }
88
+ prefetch(t) {
89
+ return T(this, null, function* () {
90
+ return d(this, W, G).call(this, t);
91
+ });
82
92
  }
83
93
  navigate(t, e = "push") {
84
- return F(this, null, function* () {
85
- var h;
86
- if (t = d(this, O, $).call(this, t), s(this, E) === t || s(this, H) === t)
94
+ return T(this, null, function* () {
95
+ var c;
96
+ if (t = d(this, O, $).call(this, t), i(this, v) === t || i(this, M) === t)
87
97
  return;
88
- r(this, E, t);
89
- const n = s(this, b).has(t);
98
+ r(this, v, t);
99
+ const n = i(this, w).has(t);
90
100
  try {
91
- let u = !0;
101
+ let l = !0;
92
102
  if (this.preprocessor)
93
103
  try {
94
- yield new Promise((c, v) => {
95
- var W;
96
- (W = this.preprocessor) == null || W.call(this, { pathname: t, resolve: c, reject: v, isCached: n });
104
+ yield new Promise((h, b) => {
105
+ var q;
106
+ (q = this.preprocessor) == null || q.call(this, { pathname: t, resolve: h, reject: b, isCached: n });
97
107
  });
98
- } catch (c) {
99
- c ? console.error(c) : console.log("Route change canceled"), u = !1;
108
+ } catch (h) {
109
+ h ? console.error(h) : console.log("Route change canceled"), l = !1;
100
110
  }
101
- if (s(this, A).notify({
111
+ if (i(this, D).notify({
102
112
  pathname: t,
103
113
  isCached: n
104
- }), !u || s(this, E) !== t)
114
+ }), !l || i(this, v) !== t)
105
115
  return;
106
- const L = yield d(this, I, _).call(this, t);
107
- if (s(this, S) && s(this, b).set(t, L), s(this, E) !== t)
116
+ const y = i(this, w).get(t) || (yield d(this, W, G).call(this, t));
117
+ if (i(this, v) !== t)
108
118
  return;
109
- const g = Array.from(document.head.children), l = Array.from(L.head.cloneNode(!0).children), w = d(this, B, p).call(this, g, l), tt = d(this, R, Q).call(this, g, w), U = d(this, R, Q).call(this, l, w);
110
- tt.forEach((c) => c.remove()), U.forEach((c) => document.head.appendChild(c));
111
- const Y = U.filter(
112
- (c) => c.tagName === "STYLE" || c.tagName === "SCRIPT" || c.tagName === "LINK"
119
+ const g = Array.from(document.head.children), f = Array.from(
120
+ y.head.cloneNode(!0).children
121
+ ), L = d(this, B, tt).call(this, g, f), et = d(this, p, U).call(this, g, L), V = d(this, p, U).call(this, f, L);
122
+ et.forEach((h) => h.remove()), V.forEach((h) => document.head.appendChild(h));
123
+ const Y = V.filter(
124
+ (h) => h.tagName === "STYLE" || h.tagName === "SCRIPT" || h.tagName === "LINK"
113
125
  );
114
- s(this, P) && Y.length && (yield new Promise((c) => F(this, null, function* () {
115
- let v = 0;
126
+ i(this, k) && Y.length && (yield new Promise((h) => T(this, null, function* () {
127
+ let b = 0;
116
128
  try {
117
- for (var W = X(Y), at, gt, wt; at = !(gt = yield W.next()).done; at = !1) {
118
- const it = gt.value;
119
- it.onload = () => {
120
- v++, v === Y.length && c();
129
+ for (var q = Z(Y), gt, Lt, vt; gt = !(Lt = yield q.next()).done; gt = !1) {
130
+ const st = Lt.value;
131
+ st.onload = () => {
132
+ b++, b === Y.length && h();
121
133
  };
122
134
  }
123
- } catch (gt) {
124
- wt = [gt];
135
+ } catch (Lt) {
136
+ vt = [Lt];
125
137
  } finally {
126
138
  try {
127
- at && (gt = W.return) && (yield gt.call(W));
139
+ gt && (Lt = q.return) && (yield Lt.call(q));
128
140
  } finally {
129
- if (wt)
130
- throw wt[0];
141
+ if (vt)
142
+ throw vt[0];
131
143
  }
132
144
  }
133
145
  })));
134
- const et = d(this, m, J).call(this, L);
135
- s(this, k).forEach((c, v) => {
136
- const W = et[v];
137
- c.innerHTML = W.innerHTML;
138
- }), r(this, H, t), e === "push" ? history.pushState(t, "", t + location.search) : e === "replace" && history.replaceState(t, "", t + location.search), d(this, D, G).call(this), (h = this.postprocessor) == null || h.call(this, { pathname: t, isCached: n }), s(this, x).notify({ pathname: t, isCached: n });
139
- } catch (u) {
140
- console.error(u);
146
+ const it = d(this, F, Q).call(this, y);
147
+ i(this, C).forEach((h, b) => {
148
+ const q = it[b];
149
+ h.innerHTML = q.innerHTML;
150
+ }), r(this, M, t), e === "push" ? history.pushState(t, "", t + location.search) : e === "replace" && history.replaceState(t, "", t + location.search), d(this, m, J).call(this), (c = this.postprocessor) == null || c.call(this, { pathname: t, isCached: n }), i(this, R).notify({ pathname: t, isCached: n });
151
+ } catch (l) {
152
+ console.error(l);
141
153
  }
142
- r(this, E, void 0);
154
+ r(this, v, void 0);
143
155
  });
144
156
  }
145
157
  }
146
- a = new WeakMap(), P = new WeakMap(), S = new WeakMap(), k = new WeakMap(), C = new WeakMap(), q = new WeakMap(), b = new WeakMap(), E = new WeakMap(), H = new WeakMap(), A = new WeakMap(), x = new WeakMap(), I = new WeakSet(), _ = function(t) {
147
- return F(this, null, function* () {
148
- const e = s(this, b).get(t);
158
+ a = new WeakMap(), k = new WeakMap(), A = new WeakMap(), C = new WeakMap(), x = new WeakMap(), I = new WeakMap(), w = new WeakMap(), v = new WeakMap(), M = new WeakMap(), D = new WeakMap(), R = new WeakMap(), W = new WeakSet(), G = function(t) {
159
+ return T(this, null, function* () {
160
+ const e = i(this, w).get(t);
149
161
  if (e)
150
162
  return e;
151
- const h = yield (yield fetch(t)).text();
152
- return s(this, q).parseFromString(h, "text/html");
163
+ const c = yield (yield fetch(t)).text(), l = i(this, I).parseFromString(c, "text/html");
164
+ return i(this, A) && i(this, w).set(t, l), l;
153
165
  });
154
166
  }, O = new WeakSet(), $ = function(t) {
155
- return t = t.replace(s(this, a), ""), t.startsWith("/") && (t = t.slice(1)), s(this, a) + t;
156
- }, D = new WeakSet(), G = function() {
157
- const t = [...document.documentElement.querySelectorAll("a")].filter(
158
- (e) => {
159
- var n;
160
- return (n = e.getAttribute("href")) == null ? void 0 : n.startsWith("/");
161
- }
162
- );
163
- s(this, C).forEach((e) => e.destroy()), r(this, C, t.map((e) => new rt(e, this)));
164
- }, m = new WeakSet(), J = function(t) {
167
+ return t = t.replace(i(this, a), ""), t.startsWith("/") && (t = t.slice(1)), i(this, a) + t;
168
+ }, m = new WeakSet(), J = function() {
169
+ const t = [
170
+ ...document.documentElement.querySelectorAll("a")
171
+ ].filter((e) => {
172
+ var n;
173
+ return (n = e.getAttribute("href")) == null ? void 0 : n.startsWith("/");
174
+ });
175
+ i(this, x).forEach((e) => e.destroy()), r(this, x, t.map((e) => new ht(e, this)));
176
+ }, F = new WeakSet(), Q = function(t) {
165
177
  const e = t.querySelectorAll("[data-morph]");
166
178
  return e.length ? [...e] : [t.body];
167
- }, B = new WeakSet(), p = function(t, e) {
179
+ }, B = new WeakSet(), tt = function(t, e) {
168
180
  return t.filter(
169
181
  (n) => e.find(
170
- (h) => h.outerHTML === n.outerHTML
182
+ (c) => c.outerHTML === n.outerHTML
171
183
  )
172
184
  );
173
- }, R = new WeakSet(), Q = function(t, e) {
185
+ }, p = new WeakSet(), U = function(t, e) {
174
186
  return t.filter(
175
187
  (n) => !e.find(
176
- (h) => h.outerHTML === n.outerHTML
188
+ (c) => c.outerHTML === n.outerHTML
177
189
  )
178
190
  );
179
191
  }, K = new WeakMap();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"