aptechka 0.41.6 → 0.42.0
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/Animation-CMiBKrwE.cjs +1 -0
- package/lib/{Animation-CSexZn4M.js → Animation-DPRlQfW2.js} +1 -1
- package/lib/{Damped-BMr6Toib.cjs → Damped-CHZ314Rn.cjs} +1 -1
- package/lib/{Damped-Bcngr1kp.js → Damped-DxylD27S.js} +1 -1
- package/lib/{Tweened-D-vlLZdS.cjs → Tweened-Dn6CMA-p.cjs} +1 -1
- package/lib/{Tweened-sqOQu9Gf.js → Tweened-p5hYr6lL.js} +2 -2
- package/lib/animation/Animation.d.ts +2 -2
- package/lib/animation/Damped.d.ts +1 -1
- package/lib/animation/Tweened.d.ts +1 -1
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.d.ts +1 -1
- package/lib/attribute/index.js +1 -1
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +2 -2
- package/lib/class-linked-status/index.d.ts +1 -1
- package/lib/connector/index.cjs +1 -1
- package/lib/connector/index.js +1 -1
- package/lib/controls/AutoplayControls.d.ts +1 -1
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +4 -4
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.d.ts +1 -1
- package/lib/css-property/index.js +2 -2
- package/lib/custom-scrollbar/index.cjs +1 -0
- package/lib/custom-scrollbar/index.d.ts +13 -0
- package/lib/custom-scrollbar/index.js +60 -0
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +1 -1
- package/lib/device/Viewport.d.ts +1 -1
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +1 -1
- package/lib/{dom-0S_WDL4g.js → dom-CVWzyXPH.js} +2 -2
- package/lib/{easings-BEmRlrDd.js → easings-Bni3YAAW.js} +15 -15
- package/lib/element-resizer/index.cjs +1 -0
- package/lib/element-resizer/{vanilla/index.d.ts → index.d.ts} +1 -1
- package/lib/element-resizer/{vanilla/index.js → index.js} +2 -2
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +3 -3
- package/lib/iframe/index.cjs +1 -0
- package/lib/iframe/index.js +38 -0
- package/lib/image/index.cjs +1 -0
- package/lib/image/index.js +20 -0
- package/lib/intersector/index.cjs +1 -0
- package/lib/intersector/{vanilla/index.d.ts → index.d.ts} +1 -1
- package/lib/intersector/{vanilla/index.js → index.js} +2 -2
- package/lib/ladder/index.d.ts +1 -1
- package/lib/layout-Ctc2p3uz.cjs +1 -0
- package/lib/layout-DpZo-I0y.js +29 -0
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.d.ts +1 -1
- package/lib/layout-box/index.js +5 -5
- package/lib/masonry-layout/index.cjs +1 -0
- package/lib/masonry-layout/index.d.ts +11 -0
- package/lib/masonry-layout/index.js +60 -0
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.d.ts +1 -1
- package/lib/media/index.js +1 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +68 -68
- package/lib/need_redo_tweaker/TweakerBooleanManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerColorManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerFieldElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerFolderElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerLinkManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerNumberManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerSelectManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerStoreManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/TweakerStringManagerElement.d.ts +1 -1
- package/lib/need_redo_tweaker/element-constructor/ElementConstructor.d.ts +1 -1
- package/lib/need_redo_tweaker/index.cjs +1 -1
- package/lib/need_redo_tweaker/index.js +2 -2
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +5 -5
- package/lib/popover/PopoverElement.d.ts +1 -1
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +1 -1
- package/lib/scroll/{vanilla/ScrollElement.d.ts → ScrollElement.d.ts} +4 -4
- package/lib/scroll/{vanilla/ScrollSegmentElement.d.ts → ScrollSegmentElement.d.ts} +1 -1
- package/lib/scroll/index.cjs +1 -0
- package/lib/scroll/{vanilla/index.js → index.js} +50 -50
- package/lib/scroll-entries/index.js +1 -1
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.d.ts +1 -1
- package/lib/scroll-segment/index.js +4 -4
- package/lib/sequence/index.cjs +1 -0
- package/lib/{media-elements/sequence → sequence}/index.d.ts +2 -3
- package/lib/sequence/index.js +158 -0
- package/lib/size-element/index.cjs +1 -0
- package/lib/size-element/index.d.ts +10 -0
- package/lib/size-element/index.js +32 -0
- package/lib/{media-elements/source/index.d.ts → source/SourceElement.d.ts} +3 -3
- package/lib/source/SourceManager.d.ts +1 -1
- package/lib/source/index.cjs +5 -1
- package/lib/source/index.d.ts +1 -0
- package/lib/source/index.js +173 -67
- package/lib/store/index.cjs +1 -0
- package/lib/store/{vanilla/index.js → index.js} +3 -3
- package/lib/ticker/index.cjs +1 -0
- package/lib/ticker/{vanilla/index.d.ts → index.d.ts} +1 -1
- package/lib/ticker/{vanilla/index.js → index.js} +2 -2
- package/lib/utils/clipboard.d.ts +1 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +3 -1
- package/lib/utils/index.js +190 -144
- package/lib/utils/layout.d.ts +4 -3
- package/lib/utils/scroll.d.ts +6 -0
- package/lib/utils/template.d.ts +1 -0
- package/lib/video/index.cjs +1 -0
- package/lib/video/index.js +54 -0
- package/lib/window-resizer/index.cjs +1 -0
- package/lib/window-resizer/{vanilla/index.d.ts → index.d.ts} +1 -1
- package/lib/window-resizer/{vanilla/index.js → index.js} +3 -3
- package/lib/youtube/index.cjs +1 -0
- package/lib/youtube/index.js +81 -0
- package/package.json +101 -99
- package/lib/Animation-esZH7swx.cjs +0 -1
- package/lib/element-resizer/react/index.cjs +0 -1
- package/lib/element-resizer/react/index.d.ts +0 -2
- package/lib/element-resizer/react/index.js +0 -8
- package/lib/element-resizer/vanilla/index.cjs +0 -1
- package/lib/intersector/react/index.cjs +0 -1
- package/lib/intersector/react/index.d.ts +0 -4
- package/lib/intersector/react/index.js +0 -12
- package/lib/intersector/vanilla/index.cjs +0 -1
- package/lib/layout-8ryRAMGJ.cjs +0 -1
- package/lib/layout-HoBT_Da2.js +0 -12
- package/lib/media-elements/index.cjs +0 -5
- package/lib/media-elements/index.d.ts +0 -6
- package/lib/media-elements/index.js +0 -416
- package/lib/scroll/react/Scroll.d.ts +0 -13
- package/lib/scroll/react/ScrollBulletButtons.d.ts +0 -11
- package/lib/scroll/react/ScrollSegment.d.ts +0 -18
- package/lib/scroll/react/ScrollSetButton.d.ts +0 -14
- package/lib/scroll/react/ScrollStepButton.d.ts +0 -14
- package/lib/scroll/react/Scrollbar.d.ts +0 -11
- package/lib/scroll/react/index.cjs +0 -30
- package/lib/scroll/react/index.d.ts +0 -6
- package/lib/scroll/react/index.js +0 -761
- package/lib/scroll/vanilla/index.cjs +0 -1
- package/lib/store/react/index.cjs +0 -1
- package/lib/store/react/index.d.ts +0 -1
- package/lib/store/react/index.js +0 -14
- package/lib/store/react/useStore.d.ts +0 -2
- package/lib/store/vanilla/index.cjs +0 -1
- package/lib/studio/Outliner/File/index.d.ts +0 -8
- package/lib/studio/Outliner/Folder/index.d.ts +0 -9
- package/lib/studio/Outliner/index.d.ts +0 -2
- package/lib/studio/Studio/index.d.ts +0 -2
- package/lib/studio/Tweaker/index.d.ts +0 -4
- package/lib/studio/index.d.ts +0 -1
- package/lib/studio/store.d.ts +0 -2
- package/lib/ticker/react/index.cjs +0 -1
- package/lib/ticker/react/index.d.ts +0 -5
- package/lib/ticker/react/index.js +0 -19
- package/lib/ticker/vanilla/index.cjs +0 -1
- package/lib/utils/ts-react-utility.d.ts +0 -12
- package/lib/window-resizer/react/index.cjs +0 -1
- package/lib/window-resizer/react/index.d.ts +0 -2
- package/lib/window-resizer/react/index.js +0 -8
- package/lib/window-resizer/vanilla/index.cjs +0 -1
- /package/lib/{media-elements/iframe → iframe}/index.d.ts +0 -0
- /package/lib/{media-elements/image → image}/index.d.ts +0 -0
- /package/lib/scroll/{vanilla/ScrollBulletButtonsElement.d.ts → ScrollBulletButtonsElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollButtonElement.d.ts → ScrollButtonElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollSection.d.ts → ScrollSection.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollSetButtonElement.d.ts → ScrollSetButtonElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollStepButtonElement.d.ts → ScrollStepButtonElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollUserElement.d.ts → ScrollUserElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/ScrollbarElement.d.ts → ScrollbarElement.d.ts} +0 -0
- /package/lib/scroll/{vanilla/index.d.ts → index.d.ts} +0 -0
- /package/lib/store/{vanilla/Composed.d.ts → Composed.d.ts} +0 -0
- /package/lib/store/{vanilla/Derived.d.ts → Derived.d.ts} +0 -0
- /package/lib/store/{vanilla/DerivedArray.d.ts → DerivedArray.d.ts} +0 -0
- /package/lib/store/{vanilla/Resource.d.ts → Resource.d.ts} +0 -0
- /package/lib/store/{vanilla/Store.d.ts → Store.d.ts} +0 -0
- /package/lib/store/{vanilla/StoreRegistry.d.ts → StoreRegistry.d.ts} +0 -0
- /package/lib/store/{vanilla/index.d.ts → index.d.ts} +0 -0
- /package/lib/{media-elements/video → video}/index.d.ts +0 -0
- /package/lib/{media-elements/youtube → youtube}/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../device/index.cjs"),n=require("../source/index.cjs");require("../window-resizer/index.cjs");require("../Store-C2J4Q87x.cjs");class t extends n.SourceElement{createConsumer(){return document.createElement("img")}consumeSource(e){if(e&&this.hasAttribute("webp")&&i.device.isWebp){const s=e.split(".").slice(0,-1).join(".")+".webp";this.consumerElement.src=s}else this.consumerElement.src=e||""}}customElements.get("e-image")||customElements.define("e-image",t);exports.ImageElement=t;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { device as m } from "../device/index.js";
|
|
2
|
+
import { SourceElement as s } from "../source/index.js";
|
|
3
|
+
import "../window-resizer/index.js";
|
|
4
|
+
import "../Store-Cm3LPXlx.js";
|
|
5
|
+
class i extends s {
|
|
6
|
+
createConsumer() {
|
|
7
|
+
return document.createElement("img");
|
|
8
|
+
}
|
|
9
|
+
consumeSource(e) {
|
|
10
|
+
if (e && this.hasAttribute("webp") && m.isWebp) {
|
|
11
|
+
const t = e.split(".").slice(0, -1).join(".") + ".webp";
|
|
12
|
+
this.consumerElement.src = t;
|
|
13
|
+
} else
|
|
14
|
+
this.consumerElement.src = e || "";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
customElements.get("e-image") || customElements.define("e-image", i);
|
|
18
|
+
export {
|
|
19
|
+
i as ImageElement
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=n=>{throw TypeError(n)};var m=(n,t,r)=>t.has(n)||y("Cannot "+r);var s=(n,t,r)=>(m(n,t,"read from private field"),r?r.call(n):t.get(n)),b=(n,t,r)=>t.has(n)?y("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,r),f=(n,t,r,e)=>(m(n,t,"write to private field"),e?e.call(n,r):t.set(n,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../browser-CpzFX2xg.cjs"),g=require("../dom-JBOkFLTh.cjs");var i,u,l;class w{constructor(){b(this,i,[]);b(this,u,null);b(this,l,t=>{s(this,i).map(e=>({subscriber:e,entry:t.find(o=>o.target===e.element)})).forEach(e=>{e.entry&&(e.subscriber.entry=e.entry,e.subscriber.callback(e.entry))})});d.isBrowser&&window.IntersectionObserver&&f(this,u,new IntersectionObserver(s(this,l)))}subscribe(t,r){const e=g.getElement(t);if(!e)return()=>{};const o=s(this,i).find(c=>c.element===e);if(!o)s(this,u).observe(e);else{const c=s(this,i).find(h=>h.element===e&&h.entry);c!=null&&c.entry.isIntersecting&&r(c.entry)}return s(this,i).push({element:e,callback:r,entry:(o==null?void 0:o.entry)||null}),()=>{this.unsubscribe(r)}}unsubscribe(t){const r=s(this,i).find(e=>e.callback===t);r&&(f(this,i,s(this,i).filter(e=>e.callback!==t)),s(this,i).find(e=>e.element===r.element)||s(this,u).unobserve(r.element))}}i=new WeakMap,u=new WeakMap,l=new WeakMap;const v=new w;exports.Intersector=w;exports.intersector=v;
|
|
@@ -3,8 +3,8 @@ var m = (n) => {
|
|
|
3
3
|
};
|
|
4
4
|
var y = (n, t, s) => t.has(n) || m("Cannot " + s);
|
|
5
5
|
var r = (n, t, s) => (y(n, t, "read from private field"), s ? s.call(n) : t.get(n)), f = (n, t, s) => t.has(n) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), h = (n, t, s, e) => (y(n, t, "write to private field"), e ? e.call(n, s) : t.set(n, s), s);
|
|
6
|
-
import { i as p } from "
|
|
7
|
-
import { g as w } from "
|
|
6
|
+
import { i as p } from "../browser-0zX67oeU.js";
|
|
7
|
+
import { g as w } from "../dom-CVWzyXPH.js";
|
|
8
8
|
var i, b, u;
|
|
9
9
|
class g {
|
|
10
10
|
constructor() {
|
package/lib/ladder/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function i(t,f="offsetLeft",s){let e=0;do e+=t[f]||0,t=t.offsetParent;while(t&&t!==s);return e}function u(t,f){return i(t,"offsetLeft",f)}function c(t,f){return i(t,"offsetTop",f)}function l(t,f){const s=[];let e=t.parentElement;for(;e;)window.getComputedStyle(e).position==="sticky"&&s.push(e),e=e.parentElement;return s.reduce((o,n)=>o+(f==="top"?n.offsetTop:n.offsetLeft),0)}exports.getCumulativeOffsetLeft=u;exports.getCumulativeOffsetTop=c;exports.getCumulativePosition=i;exports.getStickyOffset=l;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function i(t, f = "offsetLeft", s) {
|
|
2
|
+
let e = 0;
|
|
3
|
+
do
|
|
4
|
+
e += t[f] || 0, t = t.offsetParent;
|
|
5
|
+
while (t && t !== s);
|
|
6
|
+
return e;
|
|
7
|
+
}
|
|
8
|
+
function c(t, f) {
|
|
9
|
+
return i(t, "offsetLeft", f);
|
|
10
|
+
}
|
|
11
|
+
function l(t, f) {
|
|
12
|
+
return i(t, "offsetTop", f);
|
|
13
|
+
}
|
|
14
|
+
function p(t, f) {
|
|
15
|
+
const s = [];
|
|
16
|
+
let e = t.parentElement;
|
|
17
|
+
for (; e; )
|
|
18
|
+
window.getComputedStyle(e).position === "sticky" && s.push(e), e = e.parentElement;
|
|
19
|
+
return s.reduce(
|
|
20
|
+
(n, o) => n + (f === "top" ? o.offsetTop : o.offsetLeft),
|
|
21
|
+
0
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
l as a,
|
|
26
|
+
i as b,
|
|
27
|
+
p as c,
|
|
28
|
+
c as g
|
|
29
|
+
};
|
package/lib/layout-box/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var J=i=>{throw TypeError(i)};var N=(i,e,s)=>e.has(i)||J("Cannot "+s);var t=(i,e,s)=>(N(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(i,e,s)=>e.has(i)?J("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),r=(i,e,s,l)=>(N(i,e,"write to private field"),l?l.call(i,s):e.set(i,s),s),L=(i,e,s)=>(N(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const St=require("../css-unit-parser/index.cjs"),$=require("../ladder/index.cjs"),Q=require("../order/index.cjs"),F=require("../scroll-entries/index.cjs"),j=require("../ticker/
|
|
1
|
+
"use strict";var J=i=>{throw TypeError(i)};var N=(i,e,s)=>e.has(i)||J("Cannot "+s);var t=(i,e,s)=>(N(i,e,"read from private field"),s?s.call(i):e.get(i)),h=(i,e,s)=>e.has(i)?J("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,s),r=(i,e,s,l)=>(N(i,e,"write to private field"),l?l.call(i,s):e.set(i,s),s),L=(i,e,s)=>(N(i,e,"access private method"),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const St=require("../css-unit-parser/index.cjs"),$=require("../ladder/index.cjs"),Q=require("../order/index.cjs"),F=require("../scroll-entries/index.cjs"),j=require("../ticker/index.cjs"),tt=require("../browser-CpzFX2xg.cjs"),et=require("../dom-JBOkFLTh.cjs"),V=require("../layout-Ctc2p3uz.cjs"),st=require("../element-resizer/index.cjs"),it=require("../window-resizer/index.cjs"),dt=require("../notifier/index.cjs");function ht(i){const e=Math.sqrt(i.m11*i.m11+i.m12*i.m12+i.m13*i.m13),s=Math.sqrt(i.m21*i.m21+i.m22*i.m22+i.m23*i.m23),l=Math.sqrt(i.m31*i.m31+i.m32*i.m32+i.m33*i.m33),y=Math.atan2(i.m32,i.m33),B=Math.atan2(-i.m31,Math.sqrt(i.m32*i.m32+i.m33*i.m33)),K=Math.atan2(i.m21,i.m11),a=i.m41,q=i.m42*-1,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:l,rotationX:y,rotationY:B,rotationZ:K,translationX:a,translationY:q,translationZ:O}}var u,b,m,R,A,T,v,w,W,k,x,_,X,S,d,C,Y,H,U,g,p,z,o,n,c,E,M,I,f,G,rt,nt,lt,P,D,Z;class ft{constructor(e,s){h(this,f);h(this,u,null);h(this,b,null);h(this,m,[]);h(this,R,"auto");h(this,A,"top");h(this,T,!1);h(this,v,!0);h(this,w,!0);h(this,W,!0);h(this,k,!0);h(this,x,0);h(this,_,0);h(this,X,0);h(this,S,0);h(this,d,0);h(this,C,0);h(this,Y,0);h(this,H,0);h(this,U,0);h(this,g,{x:0,y:0,z:0});h(this,p,{x:0,y:0,z:0});h(this,z,{x:1,y:1,z:1});h(this,o,new $.Ladder({x:0,y:0,z:0}));h(this,n,new $.Ladder({x:0,y:0,z:0}));h(this,c,new $.Ladder({x:0,y:0,z:0}));h(this,E,{x:0,y:0,z:0});h(this,M,new Map);h(this,I,new dt.Notifier);h(this,P,()=>{tt.isBrowser&&L(this,f,nt).call(this)});h(this,D,()=>{L(this,f,lt).call(this),L(this,f,G).call(this)});h(this,Z,()=>{const e=F.scrollEntries.getAll(this.element);t(this,M).forEach((s,l)=>{e.includes(l)||(this.deleteScrollStep(s),t(this,M).delete(l))}),e.forEach(s=>{if(!t(this,M).has(s)){const l=()=>s;t(this,M).set(s,l),this.setScrollStep(l)}})});tt.isBrowser&&(r(this,u,et.getElement(e)||document.body),r(this,b,et.getElement(s==null?void 0:s.containerElement)||document.body),r(this,R,(s==null?void 0:s.scrollAxis)||"auto"),r(this,A,(s==null?void 0:s.frontSide)||"top"),r(this,T,(s==null?void 0:s.cartesian)||!1),r(this,v,(s==null?void 0:s.sizeStep)!==void 0?s.sizeStep:!0),r(this,w,(s==null?void 0:s.positionStep)!==void 0?s.positionStep:!0),r(this,W,(s==null?void 0:s.transformStep)!==void 0?s.transformStep:!0),r(this,k,(s==null?void 0:s.scrollStep)!==void 0?s.scrollStep:!0),t(this,c).setStep("_size","+",{x:1,y:1,z:1}),t(this,n).setStep("_position","+",{x:0,y:0,z:0}),t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,n).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}),t(this,k)&&(F.scrollEntries.notifier.subscribe(t(this,Z)),t(this,Z).call(this)),st.elementResizer.subscribe(this.element,t(this,P)),it.windowResizer.subscribe(t(this,P),Q.RESIZE_ORDER.LAYOUT_BOX),j.ticker.subscribe(t(this,D),{order:Q.TICK_ORDER.LAYOUT_BOX,culling:s!=null&&s.culling?this.element:void 0}))}get element(){return t(this,u)}get containerElement(){return t(this,b)}get position(){return t(this,n).current}get rotation(){return t(this,o).current}get scale(){return t(this,c).current}get scrollValue(){return t(this,E)}get left(){return t(this,d)}get top(){return t(this,S)}get CSSTranslation(){return t(this,g)}get CSSRotation(){return t(this,p)}get CSSScale(){return t(this,z)}get front(){return t(this,C)}get width(){return t(this,x)}get height(){return t(this,_)}get depth(){return t(this,X)}destroy(){j.ticker.unsubscribe(t(this,D)),st.elementResizer.unsubscribe(t(this,P)),it.windowResizer.unsubscribe(t(this,P)),F.scrollEntries.notifier.unsubscribe(t(this,Z)),t(this,M).clear(),t(this,n).close(),t(this,o).close(),t(this,c).close()}bindObject(e){e.position&&t(this,n).bind(e.position),e.rotation&&t(this,o).bind(e.rotation),e.scale&&t(this,c).bind(e.scale)}unbindObject(e){e.position&&t(this,n).unbind(e.position),e.rotation&&t(this,o).unbind(e.rotation),e.scale&&t(this,c).unbind(e.scale)}setScrollStep(e){return t(this,m).includes(e)||t(this,m).push(e),()=>this.deleteScrollStep(e)}deleteScrollStep(e){r(this,m,t(this,m).filter(s=>s!==e))}setPositionStep(...e){t(this,n).setStep(...e)}getPositionStep(...e){return t(this,n).getStepValue(...e)}setRotationStep(...e){t(this,o).setStep(...e)}getRotationStep(...e){return t(this,o).getStepValue(...e)}getExcludedRotationSteps(...e){return t(this,o).getExcludedStepsValue(...e)}getIncludedRotationSteps(...e){return t(this,o).getIncludedStepsValue(...e)}setScaleStep(...e){t(this,c).setStep(...e)}getScaleStep(...e){return t(this,c).getStepValue(...e)}getExcludedScaleSteps(...e){return t(this,c).getExcludedStepsValue(...e)}getIncludedScaleSteps(...e){return t(this,c).getIncludedStepsValue(...e)}deletePositionStep(...e){t(this,n).deleteStep(...e)}getExcludedPositionSteps(...e){return t(this,n).getExcludedStepsValue(...e)}getIncludedPositionSteps(...e){return t(this,n).getIncludedStepsValue(...e)}deleteRotationStep(...e){t(this,o).deleteStep(...e)}deleteScaleStep(...e){t(this,c).deleteStep(...e)}onPosition(...e){return t(this,n).subscribe(...e)}offPosition(...e){t(this,n).unsubscribe(...e)}onScale(...e){return t(this,c).subscribe(...e)}offScale(...e){t(this,c).unsubscribe(...e)}onRotation(...e){return t(this,o).subscribe(...e)}offRotation(...e){t(this,o).unsubscribe(...e)}onResize(...e){return t(this,I).subscribe(...e)}offResize(...e){return t(this,I).unsubscribe(...e)}}u=new WeakMap,b=new WeakMap,m=new WeakMap,R=new WeakMap,A=new WeakMap,T=new WeakMap,v=new WeakMap,w=new WeakMap,W=new WeakMap,k=new WeakMap,x=new WeakMap,_=new WeakMap,X=new WeakMap,S=new WeakMap,d=new WeakMap,C=new WeakMap,Y=new WeakMap,H=new WeakMap,U=new WeakMap,g=new WeakMap,p=new WeakMap,z=new WeakMap,o=new WeakMap,n=new WeakMap,c=new WeakMap,E=new WeakMap,M=new WeakMap,I=new WeakMap,f=new WeakSet,G=function(){t(this,c).calculate(),t(this,n).calculate(),t(this,o).calculate()},rt=function(){t(this,c).setStep("_size","+",{x:t(this,v)?t(this,x):1,y:t(this,v)?t(this,_):1,z:t(this,v)?t(this,X):1});const e=t(this,w)?t(this,Y):0,s=t(this,w)?t(this,H):0,l=t(this,w)?t(this,U):0;t(this,n).setStep("_position","+",{x:e,y:s,z:l}),t(this,W)?(t(this,c).setStep("_scale","*",{x:t(this,z).x,y:t(this,z).y,z:t(this,z).z}),t(this,n).setStep("_translation","+",{x:t(this,g).x,y:t(this,g).y,z:t(this,g).z}),t(this,o).setStep("_rotation","+",{x:t(this,p).x,y:t(this,p).y,z:t(this,p).z})):(t(this,c).setStep("_scale","*",{x:1,y:1,z:1}),t(this,n).setStep("_translation","+",{x:0,y:0,z:0}),t(this,o).setStep("_rotation","+",{x:0,y:0,z:0}))},nt=function(){const e=getComputedStyle(t(this,u));r(this,x,Math.max(t(this,u).clientWidth,1)),r(this,_,Math.max(t(this,u).clientHeight,1)),r(this,X,Math.max(St.cssUnitParser.parse(e.getPropertyValue("--depth")||"0px"),1));const s=V.getCumulativeOffsetLeft(t(this,b)),l=V.getCumulativeOffsetTop(t(this,b)),y=t(this,b).clientWidth,B=t(this,b).clientHeight;if(r(this,d,V.getCumulativeOffsetLeft(t(this,u))-s),r(this,S,V.getCumulativeOffsetTop(t(this,u))-l),t(this,R)==="z"){const q=t(this,d)/y,O=t(this,S)/B;r(this,d,(q-Math.floor(q))*y),r(this,S,(O-Math.floor(O))*B),t(this,A)==="left"?r(this,C,V.getCumulativeOffsetLeft(t(this,u))-s-t(this,d)):r(this,C,V.getCumulativeOffsetTop(t(this,u))-l-t(this,S))}if(r(this,d,t(this,d)+t(this,u).clientLeft),r(this,S,t(this,S)+t(this,u).clientTop),t(this,T)){const q=Math.round(y/2),O=Math.round(B/2),ct=t(this,x)?Math.round(t(this,x)/2):0,ot=t(this,_)?Math.round(t(this,_)/2):0,ut=t(this,d)-q+ct,at=(t(this,S)-O+ot)*-1;r(this,Y,ut),r(this,H,at)}else r(this,Y,t(this,d)),r(this,H,t(this,S));r(this,U,t(this,C)*-1);const K=new WebKitCSSMatrix(e.transform),a=ht(K);t(this,g).x=a.translationX,t(this,g).y=a.translationY,t(this,g).z=a.translationZ,t(this,z).x=a.scaleX,t(this,z).y=a.scaleY,t(this,z).z=a.scaleZ,t(this,p).x=a.rotationX,t(this,p).y=a.rotationY,t(this,p).z=a.rotationZ,L(this,f,rt).call(this),L(this,f,G).call(this),t(this,I).notify()},lt=function(){t(this,E).x=0,t(this,E).y=0,t(this,E).z=0;for(let e=0;e<t(this,m).length;e++){const s=t(this,m)[e]();let l=s.axis;t(this,R)!=="auto"&&(l=t(this,R));const y=s.value*(l==="x"?-1:t(this,T)?1:-1);t(this,E)[l]+=y,t(this,n).setStep(`_scroll_${e}`,"+",{[l]:y})}},P=new WeakMap,D=new WeakMap,Z=new WeakMap;exports.LayoutBox=ft;exports.decomposeCSSMatrix=ht;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ladder } from '../ladder';
|
|
2
|
-
import { StoreSubscribeCallback } from '../store
|
|
2
|
+
import { StoreSubscribeCallback } from '../store';
|
|
3
3
|
import { ElementOrSelector, Axes3D, Axes2D } from '../utils';
|
|
4
4
|
import { Notifier } from '../notifier';
|
|
5
5
|
export declare function decomposeCSSMatrix(matrix: WebKitCSSMatrix): {
|
package/lib/layout-box/index.js
CHANGED
|
@@ -7,12 +7,12 @@ import { cssUnitParser as ut } from "../css-unit-parser/index.js";
|
|
|
7
7
|
import { Ladder as N } from "../ladder/index.js";
|
|
8
8
|
import { RESIZE_ORDER as St, TICK_ORDER as dt } from "../order/index.js";
|
|
9
9
|
import { scrollEntries as $ } from "../scroll-entries/index.js";
|
|
10
|
-
import { ticker as j } from "../ticker/
|
|
10
|
+
import { ticker as j } from "../ticker/index.js";
|
|
11
11
|
import { i as tt } from "../browser-0zX67oeU.js";
|
|
12
|
-
import { g as et } from "../dom-
|
|
13
|
-
import { g as F, a as G } from "../layout-
|
|
14
|
-
import { elementResizer as st } from "../element-resizer/
|
|
15
|
-
import { windowResizer as it } from "../window-resizer/
|
|
12
|
+
import { g as et } from "../dom-CVWzyXPH.js";
|
|
13
|
+
import { g as F, a as G } from "../layout-DpZo-I0y.js";
|
|
14
|
+
import { elementResizer as st } from "../element-resizer/index.js";
|
|
15
|
+
import { windowResizer as it } from "../window-resizer/index.js";
|
|
16
16
|
import { Notifier as ft } from "../notifier/index.js";
|
|
17
17
|
function pt(i) {
|
|
18
18
|
const e = Math.sqrt(
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var L=t=>{throw TypeError(t)};var m=(t,s,e)=>s.has(t)||L("Cannot "+e);var o=(t,s,e)=>(m(t,s,"read from private field"),e?e.call(t):s.get(t)),r=(t,s,e)=>s.has(t)?L("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),y=(t,s,e,i)=>(m(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e),p=(t,s,e)=>(m(t,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../css-property/index.cjs"),E=require("../jss-GJLvaNfT.cjs");var n,a,c,u,d,b;class g extends HTMLElement{constructor(){super();r(this,d);r(this,n,new v.CSSProperty(this,"--columns",2));r(this,a,[]);r(this,c,null);r(this,u,()=>{p(this,d,b).call(this)});const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[E.createStylesheet({":host":{display:"grid",gridTemplateColumns:"repeat(var(--columns), 1fr)"},".column":{display:"grid",width:"100%",gap:"var(--gap, 0rem)",gridAutoRows:"max-content"}})]}connectedCallback(){y(this,c,new MutationObserver(o(this,u))),o(this,c).observe(this,{childList:!0}),o(this,n).subscribe(e=>{var i;this.shadowRoot.innerHTML="",y(this,a,[]);for(let l=0;l<e.current;l++){const h=document.createElement("div");h.classList.add("column"),h.innerHTML=`<slot name="col-${l}"></slot>`,o(this,a).push(h),(i=this.shadowRoot)==null||i.appendChild(h)}p(this,d,b).call(this)}),o(this,n).observe()}disconnectedCallback(){o(this,n).close(),o(this,c).disconnect(),this.classList.remove("distributed")}}n=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,d=new WeakSet,b=function(){[...this.children].forEach((i,l)=>{i.slot=`col-${l%o(this,n).current}`}),this.classList.add("distributed")};customElements.get("e-masonry-layout")||customElements.define("e-masonry-layout",g);exports.MasonryLayoutElement=g;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class MasonryLayoutElement extends HTMLElement {
|
|
2
|
+
#private;
|
|
3
|
+
constructor();
|
|
4
|
+
protected connectedCallback(): void;
|
|
5
|
+
protected disconnectedCallback(): void;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'e-masonry-layout': MasonryLayoutElement;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var L = (t) => {
|
|
2
|
+
throw TypeError(t);
|
|
3
|
+
};
|
|
4
|
+
var u = (t, s, e) => s.has(t) || L("Cannot " + e);
|
|
5
|
+
var o = (t, s, e) => (u(t, s, "read from private field"), e ? e.call(t) : s.get(t)), r = (t, s, e) => s.has(t) ? L("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), p = (t, s, e, i) => (u(t, s, "write to private field"), i ? i.call(t, e) : s.set(t, e), e), b = (t, s, e) => (u(t, s, "access private method"), e);
|
|
6
|
+
import { CSSProperty as v } from "../css-property/index.js";
|
|
7
|
+
import { c as f } from "../jss-CjccJC-K.js";
|
|
8
|
+
var n, a, c, m, d, y;
|
|
9
|
+
class g extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
r(this, d);
|
|
13
|
+
r(this, n, new v(this, "--columns", 2));
|
|
14
|
+
r(this, a, []);
|
|
15
|
+
r(this, c, null);
|
|
16
|
+
r(this, m, () => {
|
|
17
|
+
b(this, d, y).call(this);
|
|
18
|
+
});
|
|
19
|
+
const e = this.attachShadow({ mode: "open" });
|
|
20
|
+
e.adoptedStyleSheets = [
|
|
21
|
+
f({
|
|
22
|
+
":host": {
|
|
23
|
+
display: "grid",
|
|
24
|
+
gridTemplateColumns: "repeat(var(--columns), 1fr)"
|
|
25
|
+
},
|
|
26
|
+
".column": {
|
|
27
|
+
display: "grid",
|
|
28
|
+
width: "100%",
|
|
29
|
+
gap: "var(--gap, 0rem)",
|
|
30
|
+
gridAutoRows: "max-content"
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
connectedCallback() {
|
|
36
|
+
p(this, c, new MutationObserver(o(this, m))), o(this, c).observe(this, {
|
|
37
|
+
childList: !0
|
|
38
|
+
}), o(this, n).subscribe((e) => {
|
|
39
|
+
var i;
|
|
40
|
+
this.shadowRoot.innerHTML = "", p(this, a, []);
|
|
41
|
+
for (let l = 0; l < e.current; l++) {
|
|
42
|
+
const h = document.createElement("div");
|
|
43
|
+
h.classList.add("column"), h.innerHTML = `<slot name="col-${l}"></slot>`, o(this, a).push(h), (i = this.shadowRoot) == null || i.appendChild(h);
|
|
44
|
+
}
|
|
45
|
+
b(this, d, y).call(this);
|
|
46
|
+
}), o(this, n).observe();
|
|
47
|
+
}
|
|
48
|
+
disconnectedCallback() {
|
|
49
|
+
o(this, n).close(), o(this, c).disconnect(), this.classList.remove("distributed");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
n = new WeakMap(), a = new WeakMap(), c = new WeakMap(), m = new WeakMap(), d = new WeakSet(), y = function() {
|
|
53
|
+
[...this.children].forEach((i, l) => {
|
|
54
|
+
i.slot = `col-${l % o(this, n).current}`;
|
|
55
|
+
}), this.classList.add("distributed");
|
|
56
|
+
};
|
|
57
|
+
customElements.get("e-masonry-layout") || customElements.define("e-masonry-layout", g);
|
|
58
|
+
export {
|
|
59
|
+
g as MasonryLayoutElement
|
|
60
|
+
};
|
package/lib/media/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var d=e=>{throw TypeError(e)};var a=(e,r,s)=>r.has(e)||d("Cannot "+s);var o=(e,r,s)=>(a(e,r,"read from private field"),s?s.call(e):r.get(e)),c=(e,r,s)=>r.has(e)?d("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(e):r.set(e,s),u=(e,r,s,n)=>(a(e,r,"write to private field"),n?n.call(e,s):r.set(e,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../order/index.cjs"),h=require("../window-resizer/index.cjs"),b=require("../Store-C2J4Q87x.cjs");var i,t;class w extends b.Store{constructor(s){super(!1);c(this,i);c(this,t);u(this,i,s),u(this,t,h.windowResizer.subscribe(()=>{matchMedia(o(this,i)).matches?this.current=!0:this.current=!1},l.RESIZE_ORDER.MEDIA))}close(){super.close(),o(this,t).call(this)}}i=new WeakMap,t=new WeakMap;exports.Media=w;
|
package/lib/media/index.d.ts
CHANGED
package/lib/media/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var a = (e) => {
|
|
|
4
4
|
var h = (e, s, r) => s.has(e) || a("Cannot " + r);
|
|
5
5
|
var o = (e, s, r) => (h(e, s, "read from private field"), r ? r.call(e) : s.get(e)), c = (e, s, r) => s.has(e) ? a("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, r), u = (e, s, r, m) => (h(e, s, "write to private field"), m ? m.call(e, r) : s.set(e, r), r);
|
|
6
6
|
import { RESIZE_ORDER as n } from "../order/index.js";
|
|
7
|
-
import { windowResizer as f } from "../window-resizer/
|
|
7
|
+
import { windowResizer as f } from "../window-resizer/index.js";
|
|
8
8
|
import { S as l } from "../Store-Cm3LPXlx.js";
|
|
9
9
|
var t, i;
|
|
10
10
|
class w extends l {
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ot=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ht=n=>{throw TypeError(n)};var Q=(n,t,i)=>t.has(n)||ht("Cannot "+i);var e=(n,t,i)=>(Q(n,t,"read from private field"),i?i.call(n):t.get(n)),o=(n,t,i)=>t.has(n)?ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),c=(n,t,i,s)=>(Q(n,t,"write to private field"),s?s.call(n,i):t.set(n,i),i),A=(n,t,i)=>(Q(n,t,"access private method"),i);var z=(n,t,i)=>new Promise((s,l)=>{var u=f=>{try{g(i.next(f))}catch(b){l(b)}},a=f=>{try{g(i.throw(f))}catch(b){l(b)}},g=f=>f.done?s(f.value):Promise.resolve(f.value).then(u,a);g((i=i.apply(n,t)).next())});var ct=(n,t,i)=>(t=n[ot("asyncIterator")])?t.call(n):(n=n[ot("iterator")](),t={},i=(s,l)=>(l=n[s])&&(t[s]=u=>new Promise((a,g,f)=>(u=l.call(n,u),f=u.done,Promise.resolve(u.value).then(b=>a({value:b,done:f}),g)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pt=require("../browser-CpzFX2xg.cjs"),K=require("../events-KVanG9sR.cjs"),V=require("../url-BiHPIsKq.cjs"),dt=require("../loading/index.cjs");var T,h,p,q,x,H,D,k;class lt{constructor(t,i){o(this,T);o(this,h);o(this,p);o(this,q);o(this,x);o(this,H);o(this,D,t=>{t.preventDefault(),e(this,T).links.forEach(i=>{var s;e(this,p)===e(i,p)||(s=e(i,H))!=null&&s.includes(e(this,p))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,T).navigate(e(this,p),{historyAction:e(this,q),state:e(this,x)})});o(this,k,()=>{e(this,T).prefetch(e(this,p)),e(this,h).removeEventListener("pointerenter",e(this,k))});var u,a;c(this,T,i),c(this,h,t),c(this,p,e(this,h).getAttribute("href")||"/"),c(this,q,e(this,h).getAttribute("data-history-action")||"push"),c(this,x,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,D));const s=i.normalizePath(e(this,p)),l=i.normalizePath(location.pathname);c(this,H,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(g=>i.normalizePath(g.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(s.pathname)&&e(this,h).classList.add("current"):s.pathname===l.pathname||(a=e(this,H))!=null&&a.includes(l.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,k))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,D)),e(this,h).removeEventListener("pointerenter",e(this,k)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,p=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,D=new WeakMap,k=new WeakMap;var I,O,R,S,E,Y,M,P,L,_,B,v,m,U,X,ut,Z,G;class Lt{constructor(t){o(this,m);o(this,I,null);o(this,O,null);o(this,R,null);o(this,S,null);o(this,E,[]);o(this,Y,new DOMParser);o(this,M,new Map);o(this,P);o(this,L,null);o(this,_);o(this,B);o(this,v,[]);o(this,G,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(pt.isBrowser){c(this,I,V.normalizeBase(t==null?void 0:t.base)),c(this,O,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,R,(t==null?void 0:t.cachePages)!==!1),c(this,S,A(this,m,X).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,L,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,L)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,G)),V.changeHistory("replace",e(this,L),i.parameters,i.hash),e(this,S).map(s=>[...s.children]).flat().forEach(s=>{s instanceof HTMLElement&&s.classList.add("current")})}}get currentPathname(){return e(this,L)}get previousPathname(){return e(this,_)}get currentState(){return e(this,B)}get links(){return e(this,E)}normalizePath(t){return V.splitPath(t,e(this,I))}prefetch(t){return z(this,null,function*(){const i=this.normalizePath(t);return A(this,m,U).call(this,i.pathname)})}navigate(l){return z(this,arguments,function*(t,{historyAction:i="push",state:s}={}){var $;if(e(this,v).length)return;const u=this.normalizePath(t);let{pathname:a,hash:g,parameters:f,leaf:b}=u;if(e(this,P)===a||e(this,L)===a)return;c(this,B,s),c(this,P,a);const N=e(this,M).has(a);try{dt.loading.add("__morph");let F=!0;if(K.dispatchEvent(document,"morphBeforeNavigation",{detail:{pathname:a,isCached:N,state:s}}),this.preprocessor)try{yield new Promise((r,w)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:a,resolve:r,reject:w,isCached:N,state:s})})}catch(r){r?console.error(r):console.log("Route change canceled"),F=!1}if(!F||e(this,P)!==a)return;const tt=e(this,M).get(a)||(yield A(this,m,U).call(this,a));if(e(this,P)!==a)return;const et=Array.from(document.head.children),it=Array.from(tt.head.cloneNode(!0).children),st=A(this,m,ut).call(this,et,it),mt=A(this,m,Z).call(this,et,st),W=A(this,m,Z).call(this,it,st);W.forEach((r,w)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),W[w]=y}}),W.forEach(r=>{document.head.appendChild(r)});const J=W.filter(r=>(r.tagName==="STYLE"||r.tagName==="SCRIPT"||r.tagName==="LINK")&&r.getAttribute("rel")!=="canonical");e(this,O)&&J.length&&(yield new Promise(r=>z(this,null,function*(){let w=0;try{for(var y=ct(J),nt,C,rt;nt=!(C=yield y.next()).done;nt=!1){const j=C.value;j.onload=()=>{w++,w===J.length&&r()}}}catch(C){rt=[C]}finally{try{nt&&(C=y.return)&&(yield C.call(y))}finally{if(rt)throw rt[0]}}}))),mt.forEach(r=>{r.hasAttribute("data-permanent")||r.remove()}),c(this,_,e(this,L)),c(this,L,a),V.changeHistory(i,a,f,g);const ft=A(this,m,X).call(this,tt.body.cloneNode(!0));e(this,v).forEach(r=>clearTimeout(r)),c(this,v,[]),e(this,S).forEach((r,w)=>{const y=ft[w],nt=getComputedStyle(r).getPropertyValue("--morph-duration"),C=[...y.childNodes];if(nt){const rt=[...r.childNodes];rt.forEach(d=>{d instanceof HTMLElement&&d.classList.add("old")}),C.forEach(d=>{d instanceof HTMLElement&&d.classList.add("new")}),r.append(...C),setTimeout(()=>{C.forEach(d=>{d instanceof HTMLElement&&d.classList.add("in")})},10);const j={element:r,pathname:a,isCached:N,state:s};K.dispatchEvent(document,"morphBeforeElementOut",{detail:j});const at=setTimeout(()=>{rt.forEach(d=>d.remove()),C.forEach(d=>{d instanceof HTMLElement&&(d.classList.remove("new","in"),d.classList.add("current"))}),K.dispatchEvent(document,"morphAfterElementOut",{detail:j}),c(this,v,e(this,v).filter(d=>d!==at))},(parseFloat(nt)||0)*1e3+10);e(this,v).push(at)}else r.innerHTML="",r.append(...C)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",a),document.documentElement.setAttribute("data-current-leaf",b),($=this.postprocessor)==null||$.call(this,{pathname:a,isCached:N,state:s}),K.dispatchEvent(document,"morphAfterNavigation",{detail:{pathname:a,isCached:N,state:s}}),dt.loading.complete("__morph")}catch(F){console.error(F)}c(this,P,void 0)})}addLink(t){e(this,E).push(new lt(t,this))}addLinks(t){t.forEach(i=>{this.addLink(i)})}removeLink(t){c(this,E,e(this,E).filter(i=>i.element===t?(i.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var s;return((s=i.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")});e(this,E).forEach(i=>i.destroy()),c(this,E,t.map(i=>new lt(i,this)))}}I=new WeakMap,O=new WeakMap,R=new WeakMap,S=new WeakMap,E=new WeakMap,Y=new WeakMap,M=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,B=new WeakMap,v=new WeakMap,m=new WeakSet,U=function(t){return z(this,null,function*(){const i=e(this,M).get(t);if(i)return i;const l=yield(yield fetch(t)).text(),u=e(this,Y).parseFromString(l,"text/html");return e(this,R)&&e(this,M).set(t,u),u})},X=function(t){const i=[...t.querySelectorAll("[data-morph]")];return i.length?i:[t]},ut=function(t,i){return t.filter(s=>i.find(l=>l.outerHTML===s.outerHTML))},Z=function(t,i){return t.filter(s=>!i.find(l=>l.outerHTML===s.outerHTML))},G=new WeakMap;exports.Morph=Lt;
|
|
1
|
+
"use strict";var ot=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),ht=n=>{throw TypeError(n)};var Q=(n,t,i)=>t.has(n)||ht("Cannot "+i);var e=(n,t,i)=>(Q(n,t,"read from private field"),i?i.call(n):t.get(n)),o=(n,t,i)=>t.has(n)?ht("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,i),c=(n,t,i,s)=>(Q(n,t,"write to private field"),s?s.call(n,i):t.set(n,i),i),A=(n,t,i)=>(Q(n,t,"access private method"),i);var z=(n,t,i)=>new Promise((s,l)=>{var u=f=>{try{g(i.next(f))}catch(b){l(b)}},a=f=>{try{g(i.throw(f))}catch(b){l(b)}},g=f=>f.done?s(f.value):Promise.resolve(f.value).then(u,a);g((i=i.apply(n,t)).next())});var ct=(n,t,i)=>(t=n[ot("asyncIterator")])?t.call(n):(n=n[ot("iterator")](),t={},i=(s,l)=>(l=n[s])&&(t[s]=u=>new Promise((a,g,f)=>(u=l.call(n,u),f=u.done,Promise.resolve(u.value).then(b=>a({value:b,done:f}),g)))),i("next"),i("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pt=require("../browser-CpzFX2xg.cjs"),K=require("../events-KVanG9sR.cjs"),V=require("../url-BiHPIsKq.cjs"),dt=require("../loading/index.cjs");var T,h,p,q,x,H,D,k;class lt{constructor(t,i){o(this,T);o(this,h);o(this,p);o(this,q);o(this,x);o(this,H);o(this,D,t=>{t.preventDefault(),e(this,T).links.forEach(i=>{var s;e(this,p)===e(i,p)||(s=e(i,H))!=null&&s.includes(e(this,p))?e(i,h).classList.add("clicked"):e(i,h).classList.remove("clicked")}),e(this,T).navigate(e(this,p),{historyAction:e(this,q),state:e(this,x)})});o(this,k,()=>{e(this,T).prefetch(e(this,p)),e(this,h).removeEventListener("pointerenter",e(this,k))});var u,a;c(this,T,i),c(this,h,t),c(this,p,e(this,h).getAttribute("href")||"/"),c(this,q,e(this,h).getAttribute("data-history-action")||"push"),c(this,x,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,D));const s=i.normalizePath(e(this,p)),l=i.normalizePath(location.pathname);c(this,H,(u=e(this,h).getAttribute("data-match-paths"))==null?void 0:u.split(",").map(g=>i.normalizePath(g.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(s.pathname)&&e(this,h).classList.add("current"):s.pathname===l.pathname||(a=e(this,H))!=null&&a.includes(l.pathname)?(e(this,h).classList.add("current"),e(this,h).classList.add("clicked")):e(this,h).classList.remove("clicked"),e(this,h).hasAttribute("data-prefetch")&&e(this,h).addEventListener("pointerenter",e(this,k))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,D)),e(this,h).removeEventListener("pointerenter",e(this,k)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,p=new WeakMap,q=new WeakMap,x=new WeakMap,H=new WeakMap,D=new WeakMap,k=new WeakMap;var I,O,R,S,E,Y,M,P,L,_,B,v,m,U,X,ut,Z,G;class Lt{constructor(t){o(this,m);o(this,I,null);o(this,O,null);o(this,R,null);o(this,S,null);o(this,E,[]);o(this,Y,new DOMParser);o(this,M,new Map);o(this,P);o(this,L,null);o(this,_);o(this,B);o(this,v,[]);o(this,G,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(pt.isBrowser){c(this,I,V.normalizeBase(t==null?void 0:t.base)),c(this,O,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,R,(t==null?void 0:t.cachePages)!==!1),c(this,S,A(this,m,X).call(this,document.body));const i=this.normalizePath(location.pathname);c(this,L,i.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,L)),document.documentElement.setAttribute("data-current-leaf",i.leaf),this.findLinks(),addEventListener("popstate",e(this,G)),V.changeHistory("replace",e(this,L),i.parameters,i.hash),e(this,S).map(s=>[...s.children]).flat().forEach(s=>{s instanceof HTMLElement&&s.classList.add("current")})}}get currentPathname(){return e(this,L)}get previousPathname(){return e(this,_)}get currentState(){return e(this,B)}get links(){return e(this,E)}normalizePath(t){return V.splitPath(t,e(this,I))}prefetch(t){return z(this,null,function*(){const i=this.normalizePath(t);return A(this,m,U).call(this,i.pathname)})}navigate(l){return z(this,arguments,function*(t,{historyAction:i="push",state:s}={}){var $;if(e(this,v).length)return;const u=this.normalizePath(t);let{pathname:a,hash:g,parameters:f,leaf:b}=u;if(e(this,P)===a||e(this,L)===a)return;c(this,B,s),c(this,P,a);const N=e(this,M).has(a);try{dt.loading.add("__morph");let F=!0;if(K.dispatchEvent(document,"morphBeforeNavigation",{detail:{pathname:a,isCached:N,state:s}}),this.preprocessor)try{yield new Promise((r,w)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:a,resolve:r,reject:w,isCached:N,state:s})})}catch(r){r?console.error(r):console.log("Route change canceled"),F=!1}if(!F||e(this,P)!==a)return;const tt=e(this,M).get(a)||(yield A(this,m,U).call(this,a));if(e(this,P)!==a)return;const et=Array.from(document.head.children),it=Array.from(tt.head.cloneNode(!0).children),st=A(this,m,ut).call(this,et,it),mt=A(this,m,Z).call(this,et,st),W=A(this,m,Z).call(this,it,st);W.forEach((r,w)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),W[w]=y}}),W.forEach(r=>{document.head.appendChild(r)});const J=W.filter(r=>(r.tagName==="STYLE"||r.tagName==="SCRIPT"||r.tagName==="LINK")&&r.getAttribute("rel")!=="canonical");e(this,O)&&J.length&&(yield new Promise(r=>z(this,null,function*(){let w=0;try{for(var y=ct(J),nt,C,rt;nt=!(C=yield y.next()).done;nt=!1){const j=C.value;j.onload=()=>{w++,w===J.length&&r()}}}catch(C){rt=[C]}finally{try{nt&&(C=y.return)&&(yield C.call(y))}finally{if(rt)throw rt[0]}}}))),mt.forEach(r=>{r.hasAttribute("data-permanent")||r.remove()}),c(this,_,e(this,L)),c(this,L,a),V.changeHistory(i,a,f,g);const ft=A(this,m,X).call(this,tt.body.cloneNode(!0));e(this,v).forEach(r=>clearTimeout(r)),c(this,v,[]),e(this,S).forEach((r,w)=>{const y=ft[w],nt=getComputedStyle(r).getPropertyValue("--morph-duration"),C=[...y.childNodes];if(nt){const rt=[...r.childNodes];rt.forEach(d=>{d instanceof HTMLElement&&d.classList.add("old")}),C.forEach(d=>{d instanceof HTMLElement&&d.classList.add("new")}),r.append(...C),setTimeout(()=>{C.forEach(d=>{d instanceof HTMLElement&&d.classList.add("in")})},10);const j={element:r,pathname:a,isCached:N,state:s};K.dispatchEvent(document,"morphBeforeElementOut",{detail:j});const at=setTimeout(()=>{rt.forEach(d=>d.remove()),C.forEach(d=>{d instanceof HTMLElement&&(d.classList.remove("new","in"),d.classList.add("current"))}),K.dispatchEvent(document,"morphAfterElementOut",{detail:j}),c(this,v,e(this,v).filter(d=>d!==at))},(parseFloat(nt)||0)*1e3+10);e(this,v).push(at)}else r.innerHTML="",r.append(...C)}),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",a),document.documentElement.setAttribute("data-current-leaf",b),($=this.postprocessor)==null||$.call(this,{pathname:a,isCached:N,state:s}),K.dispatchEvent(document,"morphAfterNavigation",{detail:{pathname:a,isCached:N,state:s}}),dt.loading.complete("__morph")}catch(F){console.error(F)}c(this,P,void 0)})}addLink(t){e(this,E).push(new lt(t,this))}addLinks(t){t.forEach(i=>{this.addLink(i)})}removeLink(t){c(this,E,e(this,E).filter(i=>i.element===t?(i.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(i=>{var s;return((s=i.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!i.hasAttribute("download")&&!i.hasAttribute("data-morph-skip")&&!i.closest("[data-morph-skip]")});e(this,E).forEach(i=>i.destroy()),c(this,E,t.map(i=>new lt(i,this)))}}I=new WeakMap,O=new WeakMap,R=new WeakMap,S=new WeakMap,E=new WeakMap,Y=new WeakMap,M=new WeakMap,P=new WeakMap,L=new WeakMap,_=new WeakMap,B=new WeakMap,v=new WeakMap,m=new WeakSet,U=function(t){return z(this,null,function*(){const i=e(this,M).get(t);if(i)return i;const l=yield(yield fetch(t)).text(),u=e(this,Y).parseFromString(l,"text/html");return e(this,R)&&e(this,M).set(t,u),u})},X=function(t){const i=[...t.querySelectorAll("[data-morph]")];return i.length?i:[t]},ut=function(t,i){return t.filter(s=>i.find(l=>l.outerHTML===s.outerHTML))},Z=function(t,i){return t.filter(s=>!i.find(l=>l.outerHTML===s.outerHTML))},G=new WeakMap;exports.Morph=Lt;
|
package/lib/morph/index.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
var rt = (n, t) => (t = Symbol[n]) ? t : Symbol.for("Symbol." + n), ot = (n) => {
|
|
2
2
|
throw TypeError(n);
|
|
3
3
|
};
|
|
4
|
-
var J = (n, t,
|
|
5
|
-
var e = (n, t,
|
|
6
|
-
var z = (n, t,
|
|
4
|
+
var J = (n, t, s) => t.has(n) || ot("Cannot " + s);
|
|
5
|
+
var e = (n, t, s) => (J(n, t, "read from private field"), s ? s.call(n) : t.get(n)), o = (n, t, s) => t.has(n) ? ot("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), c = (n, t, s, i) => (J(n, t, "write to private field"), i ? i.call(n, s) : t.set(n, s), s), P = (n, t, s) => (J(n, t, "access private method"), s);
|
|
6
|
+
var z = (n, t, s) => new Promise((i, l) => {
|
|
7
7
|
var u = (f) => {
|
|
8
8
|
try {
|
|
9
|
-
E(
|
|
9
|
+
E(s.next(f));
|
|
10
10
|
} catch (b) {
|
|
11
11
|
l(b);
|
|
12
12
|
}
|
|
13
13
|
}, r = (f) => {
|
|
14
14
|
try {
|
|
15
|
-
E(
|
|
15
|
+
E(s.throw(f));
|
|
16
16
|
} catch (b) {
|
|
17
17
|
l(b);
|
|
18
18
|
}
|
|
19
|
-
}, E = (f) => f.done ?
|
|
20
|
-
E((
|
|
19
|
+
}, E = (f) => f.done ? i(f.value) : Promise.resolve(f.value).then(u, r);
|
|
20
|
+
E((s = s.apply(n, t)).next());
|
|
21
21
|
});
|
|
22
|
-
var ht = (n, t,
|
|
22
|
+
var ht = (n, t, s) => (t = n[rt("asyncIterator")]) ? t.call(n) : (n = n[rt("iterator")](), t = {}, s = (i, l) => (l = n[i]) && (t[i] = (u) => new Promise((r, E, f) => (u = l.call(n, u), f = u.done, Promise.resolve(u.value).then((b) => r({ value: b, done: f }), E)))), s("next"), s("return"), t);
|
|
23
23
|
import { i as pt } from "../browser-0zX67oeU.js";
|
|
24
24
|
import { d as V } from "../events-CsVF98U6.js";
|
|
25
25
|
import { n as Lt, c as ct, s as Et } from "../url-B5eH5z6S.js";
|
|
26
26
|
import { loading as dt } from "../loading/index.js";
|
|
27
|
-
var T, h, p, x, D,
|
|
27
|
+
var T, h, p, x, D, H, I, M;
|
|
28
28
|
class lt {
|
|
29
|
-
constructor(t,
|
|
29
|
+
constructor(t, s) {
|
|
30
30
|
o(this, T);
|
|
31
31
|
o(this, h);
|
|
32
32
|
o(this, p);
|
|
33
33
|
o(this, x);
|
|
34
34
|
o(this, D);
|
|
35
|
-
o(this,
|
|
35
|
+
o(this, H);
|
|
36
36
|
o(this, I, (t) => {
|
|
37
|
-
t.preventDefault(), e(this, T).links.forEach((
|
|
38
|
-
var
|
|
39
|
-
e(this, p) === e(
|
|
37
|
+
t.preventDefault(), e(this, T).links.forEach((s) => {
|
|
38
|
+
var i;
|
|
39
|
+
e(this, p) === e(s, p) || (i = e(s, H)) != null && i.includes(e(this, p)) ? e(s, h).classList.add("clicked") : e(s, h).classList.remove("clicked");
|
|
40
40
|
}), e(this, T).navigate(e(this, p), {
|
|
41
41
|
historyAction: e(this, x),
|
|
42
42
|
state: e(this, D)
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
|
-
o(this,
|
|
46
|
-
e(this, T).prefetch(e(this, p)), e(this, h).removeEventListener("pointerenter", e(this,
|
|
45
|
+
o(this, M, () => {
|
|
46
|
+
e(this, T).prefetch(e(this, p)), e(this, h).removeEventListener("pointerenter", e(this, M));
|
|
47
47
|
});
|
|
48
48
|
var u, r;
|
|
49
|
-
c(this, T,
|
|
49
|
+
c(this, T, s), c(this, h, t), c(this, p, e(this, h).getAttribute("href") || "/"), c(this, x, e(this, h).getAttribute(
|
|
50
50
|
"data-history-action"
|
|
51
51
|
) || "push"), c(this, D, e(this, h).getAttribute("data-state") || void 0), e(this, h).addEventListener("click", e(this, I));
|
|
52
|
-
const
|
|
53
|
-
c(this,
|
|
52
|
+
const i = s.normalizePath(e(this, p)), l = s.normalizePath(location.pathname);
|
|
53
|
+
c(this, H, (u = e(this, h).getAttribute("data-match-paths")) == null ? void 0 : u.split(",").map((E) => s.normalizePath(E.trim()).pathname)), e(this, h).hasAttribute("data-include") ? l.pathname.includes(i.pathname) && e(this, h).classList.add("current") : i.pathname === l.pathname || (r = e(this, H)) != null && r.includes(l.pathname) ? (e(this, h).classList.add("current"), e(this, h).classList.add("clicked")) : e(this, h).classList.remove("clicked"), e(this, h).hasAttribute("data-prefetch") && e(this, h).addEventListener("pointerenter", e(this, M));
|
|
54
54
|
}
|
|
55
55
|
get element() {
|
|
56
56
|
return e(this, h);
|
|
57
57
|
}
|
|
58
58
|
destroy() {
|
|
59
|
-
e(this, h).removeEventListener("click", e(this, I)), e(this, h).removeEventListener("pointerenter", e(this,
|
|
59
|
+
e(this, h).removeEventListener("click", e(this, I)), e(this, h).removeEventListener("pointerenter", e(this, M)), e(this, h).classList.remove("current");
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
T = new WeakMap(), h = new WeakMap(), p = new WeakMap(), x = new WeakMap(), D = new WeakMap(),
|
|
63
|
-
var R, B, F, N, g, Y,
|
|
62
|
+
T = new WeakMap(), h = new WeakMap(), p = new WeakMap(), x = new WeakMap(), D = new WeakMap(), H = new WeakMap(), I = new WeakMap(), M = new WeakMap();
|
|
63
|
+
var R, B, F, N, g, Y, k, y, L, O, _, v, m, Q, U, ut, X, j;
|
|
64
64
|
class yt {
|
|
65
65
|
constructor(t) {
|
|
66
66
|
o(this, m);
|
|
@@ -70,7 +70,7 @@ class yt {
|
|
|
70
70
|
o(this, N, null);
|
|
71
71
|
o(this, g, []);
|
|
72
72
|
o(this, Y, new DOMParser());
|
|
73
|
-
o(this,
|
|
73
|
+
o(this, k, /* @__PURE__ */ new Map());
|
|
74
74
|
o(this, y);
|
|
75
75
|
o(this, L, null);
|
|
76
76
|
o(this, O);
|
|
@@ -81,20 +81,20 @@ class yt {
|
|
|
81
81
|
});
|
|
82
82
|
if (pt) {
|
|
83
83
|
c(this, R, Lt(t == null ? void 0 : t.base)), c(this, B, (t == null ? void 0 : t.waitForHeadToLoad) !== !1), c(this, F, (t == null ? void 0 : t.cachePages) !== !1), c(this, N, P(this, m, U).call(this, document.body));
|
|
84
|
-
const
|
|
85
|
-
c(this, L,
|
|
84
|
+
const s = this.normalizePath(location.pathname);
|
|
85
|
+
c(this, L, s.pathname), document.documentElement.setAttribute(
|
|
86
86
|
"data-current-pathname",
|
|
87
87
|
e(this, L)
|
|
88
88
|
), document.documentElement.setAttribute(
|
|
89
89
|
"data-current-leaf",
|
|
90
|
-
|
|
90
|
+
s.leaf
|
|
91
91
|
), this.findLinks(), addEventListener("popstate", e(this, j)), ct(
|
|
92
92
|
"replace",
|
|
93
93
|
e(this, L),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
), e(this, N).map((
|
|
97
|
-
|
|
94
|
+
s.parameters,
|
|
95
|
+
s.hash
|
|
96
|
+
), e(this, N).map((i) => [...i.children]).flat().forEach((i) => {
|
|
97
|
+
i instanceof HTMLElement && i.classList.add("current");
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
}
|
|
@@ -115,12 +115,12 @@ class yt {
|
|
|
115
115
|
}
|
|
116
116
|
prefetch(t) {
|
|
117
117
|
return z(this, null, function* () {
|
|
118
|
-
const
|
|
119
|
-
return P(this, m, Q).call(this,
|
|
118
|
+
const s = this.normalizePath(t);
|
|
119
|
+
return P(this, m, Q).call(this, s.pathname);
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
navigate(l) {
|
|
123
|
-
return z(this, arguments, function* (t, { historyAction:
|
|
123
|
+
return z(this, arguments, function* (t, { historyAction: s = "push", state: i } = {}) {
|
|
124
124
|
var Z;
|
|
125
125
|
if (e(this, v).length)
|
|
126
126
|
return;
|
|
@@ -128,8 +128,8 @@ class yt {
|
|
|
128
128
|
let { pathname: r, hash: E, parameters: f, leaf: b } = u;
|
|
129
129
|
if (e(this, y) === r || e(this, L) === r)
|
|
130
130
|
return;
|
|
131
|
-
c(this, _,
|
|
132
|
-
const C = e(this,
|
|
131
|
+
c(this, _, i), c(this, y, r);
|
|
132
|
+
const C = e(this, k).has(r);
|
|
133
133
|
try {
|
|
134
134
|
dt.add("__morph");
|
|
135
135
|
let q = !0;
|
|
@@ -137,25 +137,25 @@ class yt {
|
|
|
137
137
|
detail: {
|
|
138
138
|
pathname: r,
|
|
139
139
|
isCached: C,
|
|
140
|
-
state:
|
|
140
|
+
state: i
|
|
141
141
|
}
|
|
142
142
|
}), this.preprocessor)
|
|
143
143
|
try {
|
|
144
144
|
yield new Promise((a, A) => {
|
|
145
145
|
var w;
|
|
146
|
-
(w = this.preprocessor) == null || w.call(this, { pathname: r, resolve: a, reject: A, isCached: C, state:
|
|
146
|
+
(w = this.preprocessor) == null || w.call(this, { pathname: r, resolve: a, reject: A, isCached: C, state: i });
|
|
147
147
|
});
|
|
148
148
|
} catch (a) {
|
|
149
149
|
a ? console.error(a) : console.log("Route change canceled"), q = !1;
|
|
150
150
|
}
|
|
151
151
|
if (!q || e(this, y) !== r)
|
|
152
152
|
return;
|
|
153
|
-
const $ = e(this,
|
|
153
|
+
const $ = e(this, k).get(r) || (yield P(this, m, Q).call(this, r));
|
|
154
154
|
if (e(this, y) !== r)
|
|
155
155
|
return;
|
|
156
156
|
const tt = Array.from(document.head.children), et = Array.from(
|
|
157
157
|
$.head.cloneNode(!0).children
|
|
158
|
-
),
|
|
158
|
+
), st = P(this, m, ut).call(this, tt, et), mt = P(this, m, X).call(this, tt, st), W = P(this, m, X).call(this, et, st);
|
|
159
159
|
W.forEach((a, A) => {
|
|
160
160
|
if (a.tagName === "SCRIPT" && a.getAttribute("src")) {
|
|
161
161
|
const w = document.createElement("script");
|
|
@@ -170,7 +170,7 @@ class yt {
|
|
|
170
170
|
e(this, B) && G.length && (yield new Promise((a) => z(this, null, function* () {
|
|
171
171
|
let A = 0;
|
|
172
172
|
try {
|
|
173
|
-
for (var w = ht(G),
|
|
173
|
+
for (var w = ht(G), it, S, nt; it = !(S = yield w.next()).done; it = !1) {
|
|
174
174
|
const K = S.value;
|
|
175
175
|
K.onload = () => {
|
|
176
176
|
A++, A === G.length && a();
|
|
@@ -180,7 +180,7 @@ class yt {
|
|
|
180
180
|
nt = [S];
|
|
181
181
|
} finally {
|
|
182
182
|
try {
|
|
183
|
-
|
|
183
|
+
it && (S = w.return) && (yield S.call(w));
|
|
184
184
|
} finally {
|
|
185
185
|
if (nt)
|
|
186
186
|
throw nt[0];
|
|
@@ -188,11 +188,11 @@ class yt {
|
|
|
188
188
|
}
|
|
189
189
|
}))), mt.forEach((a) => {
|
|
190
190
|
a.hasAttribute("data-permanent") || a.remove();
|
|
191
|
-
}), c(this, O, e(this, L)), c(this, L, r), ct(
|
|
191
|
+
}), c(this, O, e(this, L)), c(this, L, r), ct(s, r, f, E);
|
|
192
192
|
const ft = P(this, m, U).call(this, $.body.cloneNode(!0));
|
|
193
193
|
e(this, v).forEach((a) => clearTimeout(a)), c(this, v, []), e(this, N).forEach((a, A) => {
|
|
194
|
-
const w = ft[A],
|
|
195
|
-
if (
|
|
194
|
+
const w = ft[A], it = getComputedStyle(a).getPropertyValue("--morph-duration"), S = [...w.childNodes];
|
|
195
|
+
if (it) {
|
|
196
196
|
const nt = [...a.childNodes];
|
|
197
197
|
nt.forEach((d) => {
|
|
198
198
|
d instanceof HTMLElement && d.classList.add("old");
|
|
@@ -207,7 +207,7 @@ class yt {
|
|
|
207
207
|
element: a,
|
|
208
208
|
pathname: r,
|
|
209
209
|
isCached: C,
|
|
210
|
-
state:
|
|
210
|
+
state: i
|
|
211
211
|
};
|
|
212
212
|
V(document, "morphBeforeElementOut", {
|
|
213
213
|
detail: K
|
|
@@ -218,15 +218,15 @@ class yt {
|
|
|
218
218
|
}), V(document, "morphAfterElementOut", {
|
|
219
219
|
detail: K
|
|
220
220
|
}), c(this, v, e(this, v).filter((d) => d !== at));
|
|
221
|
-
}, (parseFloat(
|
|
221
|
+
}, (parseFloat(it) || 0) * 1e3 + 10);
|
|
222
222
|
e(this, v).push(at);
|
|
223
223
|
} else
|
|
224
224
|
a.innerHTML = "", a.append(...S);
|
|
225
|
-
}), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", r), document.documentElement.setAttribute("data-current-leaf", b), (Z = this.postprocessor) == null || Z.call(this, { pathname: r, isCached: C, state:
|
|
225
|
+
}), this.findLinks(), document.documentElement.setAttribute("data-current-pathname", r), document.documentElement.setAttribute("data-current-leaf", b), (Z = this.postprocessor) == null || Z.call(this, { pathname: r, isCached: C, state: i }), V(document, "morphAfterNavigation", {
|
|
226
226
|
detail: {
|
|
227
227
|
pathname: r,
|
|
228
228
|
isCached: C,
|
|
229
|
-
state:
|
|
229
|
+
state: i
|
|
230
230
|
}
|
|
231
231
|
}), dt.complete("__morph");
|
|
232
232
|
} catch (q) {
|
|
@@ -239,46 +239,46 @@ class yt {
|
|
|
239
239
|
e(this, g).push(new lt(t, this));
|
|
240
240
|
}
|
|
241
241
|
addLinks(t) {
|
|
242
|
-
t.forEach((
|
|
243
|
-
this.addLink(
|
|
242
|
+
t.forEach((s) => {
|
|
243
|
+
this.addLink(s);
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
removeLink(t) {
|
|
247
|
-
c(this, g, e(this, g).filter((
|
|
247
|
+
c(this, g, e(this, g).filter((s) => s.element === t ? (s.destroy(), !1) : !0));
|
|
248
248
|
}
|
|
249
249
|
findLinks() {
|
|
250
250
|
const t = [
|
|
251
251
|
...document.documentElement.querySelectorAll("a")
|
|
252
252
|
].filter(
|
|
253
|
-
(
|
|
254
|
-
var
|
|
255
|
-
return ((
|
|
253
|
+
(s) => {
|
|
254
|
+
var i;
|
|
255
|
+
return ((i = s.getAttribute("href")) == null ? void 0 : i.startsWith("/")) && !s.hasAttribute("download") && !s.hasAttribute("data-morph-skip") && !s.closest("[data-morph-skip]");
|
|
256
256
|
}
|
|
257
257
|
);
|
|
258
|
-
e(this, g).forEach((
|
|
258
|
+
e(this, g).forEach((s) => s.destroy()), c(this, g, t.map((s) => new lt(s, this)));
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
R = new WeakMap(), B = new WeakMap(), F = new WeakMap(), N = new WeakMap(), g = new WeakMap(), Y = new WeakMap(),
|
|
261
|
+
R = new WeakMap(), B = new WeakMap(), F = new WeakMap(), N = new WeakMap(), g = new WeakMap(), Y = new WeakMap(), k = new WeakMap(), y = new WeakMap(), L = new WeakMap(), O = new WeakMap(), _ = new WeakMap(), v = new WeakMap(), m = new WeakSet(), Q = function(t) {
|
|
262
262
|
return z(this, null, function* () {
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
return
|
|
263
|
+
const s = e(this, k).get(t);
|
|
264
|
+
if (s)
|
|
265
|
+
return s;
|
|
266
266
|
const l = yield (yield fetch(t)).text(), u = e(this, Y).parseFromString(l, "text/html");
|
|
267
|
-
return e(this, F) && e(this,
|
|
267
|
+
return e(this, F) && e(this, k).set(t, u), u;
|
|
268
268
|
});
|
|
269
269
|
}, U = function(t) {
|
|
270
|
-
const
|
|
271
|
-
return
|
|
272
|
-
}, ut = function(t,
|
|
270
|
+
const s = [...t.querySelectorAll("[data-morph]")];
|
|
271
|
+
return s.length ? s : [t];
|
|
272
|
+
}, ut = function(t, s) {
|
|
273
273
|
return t.filter(
|
|
274
|
-
(
|
|
275
|
-
(l) => l.outerHTML ===
|
|
274
|
+
(i) => s.find(
|
|
275
|
+
(l) => l.outerHTML === i.outerHTML
|
|
276
276
|
)
|
|
277
277
|
);
|
|
278
|
-
}, X = function(t,
|
|
278
|
+
}, X = function(t, s) {
|
|
279
279
|
return t.filter(
|
|
280
|
-
(
|
|
281
|
-
(l) => l.outerHTML ===
|
|
280
|
+
(i) => !s.find(
|
|
281
|
+
(l) => l.outerHTML === i.outerHTML
|
|
282
282
|
)
|
|
283
283
|
);
|
|
284
284
|
}, j = new WeakMap();
|