aptechka 0.43.4 → 0.44.1
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-D1lL_XhF.cjs +1 -0
- package/lib/Animation-Je56LXXj.js +106 -0
- package/lib/{Damped-DxylD27S.js → Damped-BMmEn7PH.js} +4 -3
- package/lib/Damped-BbJjFOLH.cjs +1 -0
- package/lib/{Store-Cm3LPXlx.js → Store-D2xCXENW.js} +1 -1
- package/lib/Store-DRp_K37w.cjs +1 -0
- package/lib/{Tweened-p5hYr6lL.js → Tweened-BNCj14Jz.js} +4 -3
- package/lib/Tweened-Dk1UNPSH.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +45 -45
- package/lib/animation/index.cjs +1 -1
- package/lib/animation/index.js +3 -3
- package/lib/attribute/index.cjs +1 -1
- package/lib/attribute/index.js +2 -2
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +11 -11
- package/lib/class-linked-status/index.cjs +1 -1
- package/lib/class-linked-status/index.js +12 -11
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +3 -3
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +7 -6
- package/lib/custom-scrollbar/index.cjs +1 -1
- package/lib/custom-scrollbar/index.js +13 -12
- package/lib/dev/index.cjs +1 -1
- package/lib/dev/index.js +7 -6
- package/lib/device/index.cjs +1 -1
- package/lib/device/index.js +2 -2
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +1 -1
- package/lib/en3/index.cjs +1 -1
- package/lib/en3/index.js +9 -8
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +6 -5
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +5 -4
- package/lib/index-Cqw2NKev.cjs +1 -0
- package/lib/index-euf5anj6.js +64 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +4 -61
- package/lib/{jss-CjccJC-K.js → jss-BQSxj7Ls.js} +1 -1
- package/lib/jss-B_mh4mIw.cjs +1 -0
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +35 -34
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +1 -1
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +10 -9
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +17 -16
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +7 -6
- package/lib/morph/Morph.d.ts +11 -2
- package/lib/morph/MorphAnnouncer.d.ts +0 -1
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +263 -211
- package/lib/need_redo_tweaker/index.cjs +3 -3
- package/lib/need_redo_tweaker/index.js +260 -260
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +34 -33
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +25 -25
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +6 -5
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +278 -278
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +57 -56
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +6 -6
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +12 -11
- package/lib/slicer/SlicerElement.d.ts +2 -2
- package/lib/slicer/index.cjs +2 -2
- package/lib/slicer/index.js +10 -9
- package/lib/source/index.cjs +2 -2
- package/lib/source/index.js +2 -2
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +13 -12
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +1 -1
- package/lib/url-CLvdjbII.cjs +1 -0
- package/lib/url-CfcHdBT6.js +49 -0
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +163 -148
- package/lib/utils/timeouts.d.ts +5 -0
- package/lib/utils/url.d.ts +15 -2
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +7 -6
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +1 -1
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +13 -12
- package/package.json +1 -1
- package/lib/Animation-CMiBKrwE.cjs +0 -1
- package/lib/Animation-DPRlQfW2.js +0 -105
- package/lib/Damped-CHZ314Rn.cjs +0 -1
- package/lib/Store-C2J4Q87x.cjs +0 -1
- package/lib/Tweened-Dn6CMA-p.cjs +0 -1
- package/lib/browser-0zX67oeU.js +0 -4
- package/lib/browser-CpzFX2xg.cjs +0 -1
- package/lib/jss-GJLvaNfT.cjs +0 -1
- package/lib/url-CHQeS8b5.cjs +0 -1
- package/lib/url-DqQuzXwT.js +0 -37
package/lib/ladder/index.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
var
|
|
1
|
+
var w = Object.defineProperty;
|
|
2
2
|
var k = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
throw TypeError(
|
|
3
|
+
var V = Object.prototype.hasOwnProperty, x = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var m = (e) => {
|
|
5
|
+
throw TypeError(e);
|
|
6
6
|
};
|
|
7
|
-
var S = (
|
|
8
|
-
for (var
|
|
9
|
-
|
|
7
|
+
var S = (e, s, t) => s in e ? w(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t, v = (e, s) => {
|
|
8
|
+
for (var t in s || (s = {}))
|
|
9
|
+
V.call(s, t) && S(e, t, s[t]);
|
|
10
10
|
if (k)
|
|
11
|
-
for (var
|
|
12
|
-
x.call(s,
|
|
13
|
-
return
|
|
11
|
+
for (var t of k(s))
|
|
12
|
+
x.call(s, t) && S(e, t, s[t]);
|
|
13
|
+
return e;
|
|
14
14
|
};
|
|
15
|
-
var g = (
|
|
16
|
-
var r = (
|
|
17
|
-
import { S as M } from "../Store-
|
|
15
|
+
var g = (e, s, t) => s.has(e) || m("Cannot " + t);
|
|
16
|
+
var r = (e, s, t) => (g(e, s, "read from private field"), t ? t.call(e) : s.get(e)), p = (e, s, t) => s.has(e) ? m("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), d = (e, s, t, i) => (g(e, s, "write to private field"), i ? i.call(e, t) : s.set(e, t), t), b = (e, s, t) => (g(e, s, "access private method"), t);
|
|
17
|
+
import { S as M } from "../Store-D2xCXENW.js";
|
|
18
|
+
import "../index-euf5anj6.js";
|
|
18
19
|
var f, h, a, u, y;
|
|
19
|
-
class
|
|
20
|
-
constructor(
|
|
21
|
-
super(
|
|
20
|
+
class I extends M {
|
|
21
|
+
constructor(t) {
|
|
22
|
+
super(t, {
|
|
22
23
|
equalityCheck: () => !1
|
|
23
24
|
});
|
|
24
25
|
p(this, u);
|
|
25
26
|
p(this, f);
|
|
26
27
|
p(this, h);
|
|
27
28
|
p(this, a);
|
|
28
|
-
d(this, f,
|
|
29
|
+
d(this, f, v({}, t)), d(this, h, /* @__PURE__ */ new Map()), d(this, a, /* @__PURE__ */ new Set());
|
|
29
30
|
}
|
|
30
31
|
get base() {
|
|
31
32
|
return r(this, f);
|
|
@@ -36,47 +37,47 @@ class E extends M {
|
|
|
36
37
|
close() {
|
|
37
38
|
super.close(), r(this, a).clear(), r(this, h).clear();
|
|
38
39
|
}
|
|
39
|
-
bind(
|
|
40
|
-
r(this, a).add(
|
|
40
|
+
bind(t) {
|
|
41
|
+
r(this, a).add(t);
|
|
41
42
|
}
|
|
42
|
-
unbind(
|
|
43
|
-
r(this, a).delete(
|
|
43
|
+
unbind(t) {
|
|
44
|
+
r(this, a).delete(t);
|
|
44
45
|
}
|
|
45
|
-
deleteStep(
|
|
46
|
-
this.steps.delete(
|
|
46
|
+
deleteStep(t) {
|
|
47
|
+
this.steps.delete(t);
|
|
47
48
|
}
|
|
48
|
-
getStepValue(
|
|
49
|
+
getStepValue(t) {
|
|
49
50
|
var i;
|
|
50
|
-
return (i = this.steps.get(
|
|
51
|
+
return (i = this.steps.get(t)) == null ? void 0 : i[1];
|
|
51
52
|
}
|
|
52
|
-
getExcludedStepsValue(...
|
|
53
|
+
getExcludedStepsValue(...t) {
|
|
53
54
|
const i = /* @__PURE__ */ new Map();
|
|
54
|
-
return
|
|
55
|
+
return t.map((c) => {
|
|
55
56
|
const n = this.steps.get(c);
|
|
56
57
|
n && i.set(c, n);
|
|
57
58
|
}), b(this, u, y).call(this, i);
|
|
58
59
|
}
|
|
59
|
-
getIncludedStepsValue(...
|
|
60
|
+
getIncludedStepsValue(...t) {
|
|
60
61
|
const i = new Map(this.steps);
|
|
61
|
-
return
|
|
62
|
+
return t.map((c) => {
|
|
62
63
|
this.steps.has(c) && i.delete(c);
|
|
63
64
|
}), b(this, u, y).call(this, i);
|
|
64
65
|
}
|
|
65
|
-
setStep(
|
|
66
|
+
setStep(t, i, c) {
|
|
66
67
|
const n = {};
|
|
67
68
|
for (const o in this.current)
|
|
68
69
|
n[o] = c[o] || 0;
|
|
69
|
-
this.steps.set(
|
|
70
|
+
this.steps.set(t, [i, n]), this.calculate();
|
|
70
71
|
}
|
|
71
72
|
calculate() {
|
|
72
73
|
this.current = b(this, u, y).call(this, r(this, h));
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
f = new WeakMap(), h = new WeakMap(), a = new WeakMap(), u = new WeakSet(), y = function(
|
|
76
|
+
f = new WeakMap(), h = new WeakMap(), a = new WeakMap(), u = new WeakSet(), y = function(t) {
|
|
76
77
|
const i = {};
|
|
77
78
|
for (const c in this.base)
|
|
78
79
|
i[c] = this.base[c];
|
|
79
|
-
for (const c of
|
|
80
|
+
for (const c of t) {
|
|
80
81
|
const n = c[1];
|
|
81
82
|
if (n[0] === "+")
|
|
82
83
|
for (const o in this.base) {
|
|
@@ -105,5 +106,5 @@ f = new WeakMap(), h = new WeakMap(), a = new WeakMap(), u = new WeakSet(), y =
|
|
|
105
106
|
return i;
|
|
106
107
|
};
|
|
107
108
|
export {
|
|
108
|
-
|
|
109
|
+
I as Ladder
|
|
109
110
|
};
|
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/index.cjs"),tt=require("../
|
|
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("../index-Cqw2NKev.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;
|
package/lib/layout-box/index.js
CHANGED
|
@@ -8,7 +8,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
10
|
import { ticker as j } from "../ticker/index.js";
|
|
11
|
-
import { i as tt } from "../
|
|
11
|
+
import { i as tt } from "../index-euf5anj6.js";
|
|
12
12
|
import { g as et } from "../dom-CVWzyXPH.js";
|
|
13
13
|
import { g as F, a as G } from "../layout-DpZo-I0y.js";
|
|
14
14
|
import { elementResizer as st } from "../element-resizer/index.js";
|
package/lib/loading/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=i=>{throw TypeError(i)};var f=(i,t,s)=>t.has(i)||p("Cannot "+s);var e=(i,t,s)=>(f(i,t,"read from private field"),s?s.call(i):t.get(i)),a=(i,t,s)=>t.has(i)?p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),g=(i,t,s,
|
|
1
|
+
"use strict";var p=i=>{throw TypeError(i)};var f=(i,t,s)=>t.has(i)||p("Cannot "+s);var e=(i,t,s)=>(f(i,t,"read from private field"),s?s.call(i):t.get(i)),a=(i,t,s)=>t.has(i)?p("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),g=(i,t,s,d)=>(f(i,t,"write to private field"),d?d.call(i,s):t.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../events-KVanG9sR.cjs"),u=require("../function-MthRj-GJ.cjs");require("../index-Cqw2NKev.cjs");var o,n,h,r,c;class v{constructor(){a(this,o,new Map);a(this,n,!1);a(this,h,u.debounce(()=>{e(this,n)||(g(this,n,!0),l.dispatchEvent(window,"loadingStart"),e(this,r).call(this))},0));a(this,r,()=>{if(!e(this,n))return;const t=e(this,o).size,s=Array.from(e(this,o)).filter(w=>w[1]).length,d=s/t;l.dispatchEvent(window,"loadingProgress",{detail:{total:t,loaded:s,progress:d}}),d===1&&e(this,c).call(this)});a(this,c,u.debounce(()=>{g(this,n,!1),l.dispatchEvent(window,"loadingComplete",{detail:{total:e(this,o).size}}),e(this,o).clear()},0))}get map(){return e(this,o)}add(t){e(this,o).set(t,!1),e(this,h).call(this)}complete(t){e(this,o).set(t,!0),e(this,r).call(this)}error(t){e(this,o).has(t)&&(console.error(`Failed to load ${t}`),e(this,o).delete(t),l.dispatchEvent(window,"loadingError",{detail:{name:t}})),e(this,r).call(this)}}o=new WeakMap,n=new WeakMap,h=new WeakMap,r=new WeakMap,c=new WeakMap;const m=new v;exports.loading=m;
|
package/lib/loading/index.js
CHANGED
|
@@ -2,16 +2,17 @@ var c = (s) => {
|
|
|
2
2
|
throw TypeError(s);
|
|
3
3
|
};
|
|
4
4
|
var g = (s, t, e) => t.has(s) || c("Cannot " + e);
|
|
5
|
-
var i = (s, t, e) => (g(s, t, "read from private field"), e ? e.call(s) : t.get(s)), r = (s, t, e) => t.has(s) ? c("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e),
|
|
5
|
+
var i = (s, t, e) => (g(s, t, "read from private field"), e ? e.call(s) : t.get(s)), r = (s, t, e) => t.has(s) ? c("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), f = (s, t, e, l) => (g(s, t, "write to private field"), l ? l.call(s, e) : t.set(s, e), e);
|
|
6
6
|
import { d as n } from "../events-CsVF98U6.js";
|
|
7
7
|
import { d as w } from "../function-C10DGppn.js";
|
|
8
|
-
|
|
8
|
+
import "../index-euf5anj6.js";
|
|
9
|
+
var o, a, h, d, p;
|
|
9
10
|
class u {
|
|
10
11
|
constructor() {
|
|
11
12
|
r(this, o, /* @__PURE__ */ new Map());
|
|
12
13
|
r(this, a, !1);
|
|
13
14
|
r(this, h, w(() => {
|
|
14
|
-
i(this, a) || (
|
|
15
|
+
i(this, a) || (f(this, a, !0), n(window, "loadingStart"), i(this, d).call(this));
|
|
15
16
|
}, 0));
|
|
16
17
|
r(this, d, () => {
|
|
17
18
|
if (!i(this, a))
|
|
@@ -23,10 +24,10 @@ class u {
|
|
|
23
24
|
loaded: e,
|
|
24
25
|
progress: l
|
|
25
26
|
}
|
|
26
|
-
}), l === 1 && i(this,
|
|
27
|
+
}), l === 1 && i(this, p).call(this);
|
|
27
28
|
});
|
|
28
|
-
r(this,
|
|
29
|
-
|
|
29
|
+
r(this, p, w(() => {
|
|
30
|
+
f(this, a, !1), n(window, "loadingComplete", {
|
|
30
31
|
detail: {
|
|
31
32
|
total: i(this, o).size
|
|
32
33
|
}
|
|
@@ -50,8 +51,8 @@ class u {
|
|
|
50
51
|
})), i(this, d).call(this);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
o = new WeakMap(), a = new WeakMap(), h = new WeakMap(), d = new WeakMap(),
|
|
54
|
-
const
|
|
54
|
+
o = new WeakMap(), a = new WeakMap(), h = new WeakMap(), d = new WeakMap(), p = new WeakMap();
|
|
55
|
+
const k = new u();
|
|
55
56
|
export {
|
|
56
|
-
|
|
57
|
+
k as loading
|
|
57
58
|
};
|
|
@@ -1 +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-
|
|
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"),w=require("../index-Cqw2NKev.cjs"),E=require("../jss-B_mh4mIw.cjs");var n,a,c,h,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,h,()=>{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,h))),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 u=document.createElement("div");u.classList.add("column"),u.innerHTML=`<slot name="col-${l}"></slot>`,o(this,a).push(u),(i=this.shadowRoot)==null||i.appendChild(u)}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,h=new WeakMap,d=new WeakSet,b=function(){[...this.children].forEach((i,l)=>{i.slot=`col-${l%o(this,n).current}`}),this.classList.add("distributed")};w.isBrowser&&!customElements.get("e-masonry-layout")&&customElements.define("e-masonry-layout",g);exports.MasonryLayoutElement=g;
|
|
@@ -2,23 +2,24 @@ var L = (t) => {
|
|
|
2
2
|
throw TypeError(t);
|
|
3
3
|
};
|
|
4
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)),
|
|
6
|
-
import { CSSProperty as
|
|
7
|
-
import {
|
|
8
|
-
|
|
5
|
+
var o = (t, s, e) => (u(t, s, "read from private field"), e ? e.call(t) : s.get(t)), n = (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 f } from "../css-property/index.js";
|
|
7
|
+
import { i as v } from "../index-euf5anj6.js";
|
|
8
|
+
import { c as w } from "../jss-BQSxj7Ls.js";
|
|
9
|
+
var r, a, c, m, d, y;
|
|
9
10
|
class g extends HTMLElement {
|
|
10
11
|
constructor() {
|
|
11
12
|
super();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
n(this, d);
|
|
14
|
+
n(this, r, new f(this, "--columns", 2));
|
|
15
|
+
n(this, a, []);
|
|
16
|
+
n(this, c, null);
|
|
17
|
+
n(this, m, () => {
|
|
17
18
|
b(this, d, y).call(this);
|
|
18
19
|
});
|
|
19
20
|
const e = this.attachShadow({ mode: "open" });
|
|
20
21
|
e.adoptedStyleSheets = [
|
|
21
|
-
|
|
22
|
+
w({
|
|
22
23
|
":host": {
|
|
23
24
|
display: "grid",
|
|
24
25
|
gridTemplateColumns: "repeat(var(--columns), 1fr)"
|
|
@@ -35,7 +36,7 @@ class g extends HTMLElement {
|
|
|
35
36
|
connectedCallback() {
|
|
36
37
|
p(this, c, new MutationObserver(o(this, m))), o(this, c).observe(this, {
|
|
37
38
|
childList: !0
|
|
38
|
-
}), o(this,
|
|
39
|
+
}), o(this, r).subscribe((e) => {
|
|
39
40
|
var i;
|
|
40
41
|
this.shadowRoot.innerHTML = "", p(this, a, []);
|
|
41
42
|
for (let l = 0; l < e.current; l++) {
|
|
@@ -43,18 +44,18 @@ class g extends HTMLElement {
|
|
|
43
44
|
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
|
}
|
|
45
46
|
b(this, d, y).call(this);
|
|
46
|
-
}), o(this,
|
|
47
|
+
}), o(this, r).observe();
|
|
47
48
|
}
|
|
48
49
|
disconnectedCallback() {
|
|
49
|
-
o(this,
|
|
50
|
+
o(this, r).close(), o(this, c).disconnect(), this.classList.remove("distributed");
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
r = new WeakMap(), a = new WeakMap(), c = new WeakMap(), m = new WeakMap(), d = new WeakSet(), y = function() {
|
|
53
54
|
[...this.children].forEach((i, l) => {
|
|
54
|
-
i.slot = `col-${l % o(this,
|
|
55
|
+
i.slot = `col-${l % o(this, r).current}`;
|
|
55
56
|
}), this.classList.add("distributed");
|
|
56
57
|
};
|
|
57
|
-
customElements.get("e-masonry-layout")
|
|
58
|
+
v && !customElements.get("e-masonry-layout") && customElements.define("e-masonry-layout", g);
|
|
58
59
|
export {
|
|
59
60
|
g as MasonryLayoutElement
|
|
60
61
|
};
|
package/lib/media/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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)),
|
|
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)),u=(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),c=(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-DRp_K37w.cjs");require("../index-Cqw2NKev.cjs");var i,t;class w extends b.Store{constructor(s){super(!1);u(this,i);u(this,t);c(this,i,s),c(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.js
CHANGED
|
@@ -2,17 +2,18 @@ var a = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var h = (e, s, r) => s.has(e) || a("Cannot " + r);
|
|
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),
|
|
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), m = (e, s, r, u) => (h(e, s, "write to private field"), u ? u.call(e, r) : s.set(e, r), r);
|
|
6
6
|
import { RESIZE_ORDER as n } from "../order/index.js";
|
|
7
|
-
import { windowResizer as
|
|
8
|
-
import { S as
|
|
7
|
+
import { windowResizer as p } from "../window-resizer/index.js";
|
|
8
|
+
import { S as f } from "../Store-D2xCXENW.js";
|
|
9
|
+
import "../index-euf5anj6.js";
|
|
9
10
|
var t, i;
|
|
10
|
-
class
|
|
11
|
+
class E extends f {
|
|
11
12
|
constructor(r) {
|
|
12
13
|
super(!1);
|
|
13
14
|
c(this, t);
|
|
14
15
|
c(this, i);
|
|
15
|
-
|
|
16
|
+
m(this, t, r), m(this, i, p.subscribe(() => {
|
|
16
17
|
matchMedia(o(this, t)).matches ? this.current = !0 : this.current = !1;
|
|
17
18
|
}, n.MEDIA));
|
|
18
19
|
}
|
|
@@ -22,5 +23,5 @@ class w extends l {
|
|
|
22
23
|
}
|
|
23
24
|
t = new WeakMap(), i = new WeakMap();
|
|
24
25
|
export {
|
|
25
|
-
|
|
26
|
+
E as Media
|
|
26
27
|
};
|
package/lib/morph/Morph.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface MorphTransitionEntry extends MorphNavigationEntry {
|
|
|
15
15
|
newDocument: Document;
|
|
16
16
|
}
|
|
17
17
|
export interface MorphChildrenActionEntry {
|
|
18
|
-
|
|
18
|
+
morphElement: HTMLElement;
|
|
19
19
|
pathname: string;
|
|
20
20
|
isCached: boolean;
|
|
21
21
|
state?: any;
|
|
@@ -27,9 +27,18 @@ export interface MorphPreprocessorEntry extends MorphNavigationEntry {
|
|
|
27
27
|
export type MorphPreprocessor = (entry: MorphPreprocessorEntry) => void;
|
|
28
28
|
export type MorphNavigationCallback = (entry: MorphNavigationEntry) => void;
|
|
29
29
|
export type MorphPostprocessor = MorphNavigationCallback;
|
|
30
|
+
export interface MorphScrollState {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
selector: string;
|
|
34
|
+
}
|
|
30
35
|
export interface MorphNavigateOptions {
|
|
31
36
|
historyAction?: ChangeHistoryAction;
|
|
32
37
|
state?: any;
|
|
38
|
+
saveScrollState?: MorphScrollState;
|
|
39
|
+
saveDocumentState?: boolean;
|
|
40
|
+
restoreScrollState?: boolean;
|
|
41
|
+
restoreDocumentState?: boolean;
|
|
33
42
|
}
|
|
34
43
|
export interface MorphEvents {
|
|
35
44
|
morphStart: CustomEvent<MorphTransitionEntry>;
|
|
@@ -53,7 +62,7 @@ export declare class Morph {
|
|
|
53
62
|
hash: string;
|
|
54
63
|
};
|
|
55
64
|
prefetch(path: string): Promise<Document>;
|
|
56
|
-
navigate(path: string, { historyAction, state }?: MorphNavigateOptions): Promise<void>;
|
|
65
|
+
navigate(path: string, { historyAction, state, saveScrollState, saveDocumentState, restoreDocumentState, restoreScrollState, }?: MorphNavigateOptions): Promise<void>;
|
|
57
66
|
addLink(element: HTMLAnchorElement): void;
|
|
58
67
|
addLinks(elements: Array<HTMLAnchorElement>): void;
|
|
59
68
|
removeLink(element: HTMLAnchorElement): void;
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var dt=(r,t)=>(t=Symbol[r])?t:Symbol.for("Symbol."+r),ut=r=>{throw TypeError(r)};var $=(r,t,s)=>t.has(r)||ut("Cannot "+s);var e=(r,t,s)=>($(r,t,"read from private field"),s?s.call(r):t.get(r)),a=(r,t,s)=>t.has(r)?ut("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(r):t.set(r,s),c=(r,t,s,n)=>($(r,t,"write to private field"),n?n.call(r,s):t.set(r,s),s),y=(r,t,s)=>($(r,t,"access private method"),s);var D=(r,t,s)=>new Promise((n,l)=>{var d=m=>{try{E(s.next(m))}catch(P){l(P)}},o=m=>{try{E(s.throw(m))}catch(P){l(P)}},E=m=>m.done?n(m.value):Promise.resolve(m.value).then(d,o);E((s=s.apply(r,t)).next())});var mt=(r,t,s)=>(t=r[dt("asyncIterator")])?t.call(r):(r=r[dt("iterator")](),t={},s=(n,l)=>(l=r[n])&&(t[n]=d=>new Promise((o,E,m)=>(d=l.call(r,d),m=d.done,Promise.resolve(d.value).then(P=>o({value:P,done:m}),E)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const yt=require("../browser-CpzFX2xg.cjs"),J=require("../events-KVanG9sR.cjs"),Q=require("../url-CHQeS8b5.cjs"),ft=require("../loading/index.cjs");class gt extends HTMLElement{constructor(){super()}connectedCallback(){const t={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,n]of Object.entries(t))this.setAttribute(s,n)}}customElements.get("morph-announcer")||customElements.define("morph-announcer",gt);var T,h,g,q,R,k,O,H;class pt{constructor(t,s){a(this,T);a(this,h);a(this,g);a(this,q);a(this,R);a(this,k);a(this,O,t=>{t.preventDefault(),e(this,T).links.forEach(s=>{var n;e(this,g)===e(s,g)||(n=e(s,k))!=null&&n.includes(e(this,g))?e(s,h).classList.add("clicked"):e(s,h).classList.remove("clicked")}),e(this,T).navigate(e(this,g),{historyAction:e(this,q),state:e(this,R)})});a(this,H,()=>{e(this,T).prefetch(e(this,g)),e(this,h).removeEventListener("pointerenter",e(this,H))});var d,o;c(this,T,s),c(this,h,t),c(this,g,e(this,h).getAttribute("href")||"/"),c(this,q,e(this,h).getAttribute("data-history-action")||"push"),c(this,R,e(this,h).getAttribute("data-state")||void 0),e(this,h).addEventListener("click",e(this,O));const n=s.normalizePath(e(this,g)),l=s.normalizePath(location.pathname);c(this,k,(d=e(this,h).getAttribute("data-match-paths"))==null?void 0:d.split(",").map(E=>s.normalizePath(E.trim()).pathname)),e(this,h).hasAttribute("data-include")?l.pathname.includes(n.pathname)&&e(this,h).classList.add("current"):n.pathname===l.pathname||(o=e(this,k))!=null&&o.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,H))}get element(){return e(this,h)}destroy(){e(this,h).removeEventListener("click",e(this,O)),e(this,h).removeEventListener("pointerenter",e(this,H)),e(this,h).classList.remove("current")}}T=new WeakMap,h=new WeakMap,g=new WeakMap,q=new WeakMap,R=new WeakMap,k=new WeakMap,O=new WeakMap,H=new WeakMap;var _,F,I,j,N,v,U,M,b,L,B,W,C,A,u,tt,et,Lt,st,X;class bt{constructor(t){a(this,u);a(this,_,null);a(this,F,null);a(this,I,null);a(this,j,!1);a(this,N,null);a(this,v,[]);a(this,U,new DOMParser);a(this,M,new Map);a(this,b);a(this,L,null);a(this,B);a(this,W);a(this,C,[]);a(this,A,null);a(this,X,t=>{t.state&&this.navigate(t.state,{historyAction:"none"})});if(yt.isBrowser){c(this,_,Q.normalizeBase(t==null?void 0:t.base)),c(this,F,(t==null?void 0:t.waitForHeadToLoad)!==!1),c(this,I,(t==null?void 0:t.cachePages)!==!1),c(this,j,(t==null?void 0:t.trailingSlash)||!1),c(this,N,y(this,u,et).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);c(this,L,s.pathname),document.documentElement.setAttribute("data-current-pathname",e(this,L)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,X)),Q.changeHistory("replace",e(this,L),s.parameters,s.hash),e(this,N).map(n=>[...n.children]).flat().forEach(n=>{n instanceof HTMLElement&&n.classList.add("current")}),c(this,A,new gt)}}get currentPathname(){return e(this,L)}get previousPathname(){return e(this,B)}get currentState(){return e(this,W)}get links(){return e(this,v)}normalizePath(t){return Q.splitPath(t,e(this,_),e(this,j))}prefetch(t){return D(this,null,function*(){const s=this.normalizePath(t);return y(this,u,tt).call(this,s.pathname)})}navigate(l){return D(this,arguments,function*(t,{historyAction:s="push",state:n}={}){var it;if(e(this,C).length)return;const d=this.normalizePath(t);let{pathname:o,hash:E,parameters:m,leaf:P}=d;if(e(this,b)===o||e(this,L)===o)return;c(this,W,n),c(this,b,o);const Y=e(this,M).has(o);try{ft.loading.add("__morph");let K=!0;if(this.preprocessor)try{yield new Promise((i,f)=>{var w;(w=this.preprocessor)==null||w.call(this,{pathname:o,resolve:i,reject:f,isCached:Y,state:n})})}catch(i){i?console.error(i):console.log("Route change canceled"),K=!1}if(!K||e(this,b)!==o)return;const S=(e(this,M).get(o)||(yield y(this,u,tt).call(this,o))).cloneNode(!0);if(e(this,b)!==o)return;if(S.title)e(this,A).textContent=S.title;else{const i=S.querySelector("h1"),f=(i==null?void 0:i.innerText)||(i==null?void 0:i.textContent)||o;e(this,A).textContent=f}document.body.appendChild(e(this,A));const nt={pathname:o,isCached:Y,state:n,newDocument:S};J.dispatchEvent(document,"morphStart",{detail:nt});const rt=Array.from(document.head.children),at=Array.from(S.head.children),ot=y(this,u,Lt).call(this,rt,at),Et=y(this,u,st).call(this,rt,ot),V=y(this,u,st).call(this,at,ot);V.forEach((i,f)=>{if(i.tagName==="SCRIPT"&&i.getAttribute("src")){const w=document.createElement("script");w.type="module",w.src=i.getAttribute("src"),V[f]=w}}),V.forEach(i=>{document.head.appendChild(i)});const Z=V.filter(i=>!i.hasAttribute("data-no-waiting")&&(i.tagName==="STYLE"||i.tagName==="SCRIPT"||i.tagName==="LINK")&&i.getAttribute("rel")!=="canonical");e(this,F)&&Z.length&&(yield new Promise(i=>D(this,null,function*(){let f=0;try{for(var w=mt(Z),ct,x,lt;ct=!(x=yield w.next()).done;ct=!1){const G=x.value;G.onload=()=>{f++,f===Z.length&&i()}}}catch(x){lt=[x]}finally{try{ct&&(x=w.return)&&(yield x.call(w))}finally{if(lt)throw lt[0]}}})));const ht=[];Et.forEach(i=>{i.hasAttribute("data-permanent")||(i.tagName==="SCRIPT"||i.tagName==="STYLE"||i.getAttribute("rel")==="stylesheet"?ht.push(i):i.remove())}),c(this,B,e(this,L)),c(this,L,o),Q.changeHistory(s,o,m,E);const vt=y(this,u,et).call(this,S.body);e(this,N).forEach((i,f)=>{const w=vt[f++],ct=getComputedStyle(i).getPropertyValue("--morph-duration"),x=[...w.childNodes];if(ct){const lt=[...i.childNodes];lt.forEach(p=>{p instanceof HTMLElement&&p.classList.add("old")}),x.forEach(p=>{p instanceof HTMLElement&&p.classList.add("new")}),i.append(...x),setTimeout(()=>{x.forEach(p=>{p instanceof HTMLElement&&p.classList.add("in")})},10);const G={element:i,pathname:o,isCached:Y,state:n};J.dispatchEvent(document,"morphNewChildrenAdded",{detail:G});const wt=new Promise(p=>{setTimeout(()=>{lt.forEach(z=>z.remove()),x.forEach(z=>{z instanceof HTMLElement&&(z.classList.remove("new","in"),z.classList.add("current"))}),J.dispatchEvent(document,"morphOldChildrenRemoved",{detail:G}),p()},(parseFloat(ct)||0)*1e3+10)});e(this,C).push(wt)}else i.innerHTML="",i.append(...x)}),yield Promise.all(e(this,C)),ht.forEach(i=>i.remove()),c(this,C,[]),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",o),document.documentElement.setAttribute("data-current-leaf",P),e(this,A).remove(),(it=this.postprocessor)==null||it.call(this,{pathname:o,isCached:Y,state:n}),J.dispatchEvent(document,"morphComplete",{detail:nt}),ft.loading.complete("__morph")}catch(K){console.error(K)}c(this,b,void 0)})}addLink(t){e(this,v).push(new pt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){c(this,v,e(this,v).filter(s=>s.element===t?(s.destroy(),!1):!0))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(s=>{var n;return((n=s.getAttribute("href"))==null?void 0:n.startsWith("/"))&&!s.hasAttribute("download")&&!s.hasAttribute("data-morph-skip")&&!s.closest("[data-morph-skip]")});e(this,v).forEach(s=>s.destroy()),c(this,v,t.map(s=>new pt(s,this)))}}_=new WeakMap,F=new WeakMap,I=new WeakMap,j=new WeakMap,N=new WeakMap,v=new WeakMap,U=new WeakMap,M=new WeakMap,b=new WeakMap,L=new WeakMap,B=new WeakMap,W=new WeakMap,C=new WeakMap,A=new WeakMap,u=new WeakSet,tt=function(t){return D(this,null,function*(){const s=e(this,M).get(t);if(s)return s;const l=yield(yield fetch(t)).text(),d=e(this,U).parseFromString(l,"text/html");return e(this,I)&&e(this,M).set(t,d),d})},et=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Lt=function(t,s){return t.filter(n=>s.find(l=>l.outerHTML===n.outerHTML))},st=function(t,s){return t.filter(n=>!s.find(l=>l.outerHTML===n.outerHTML))},X=new WeakMap;exports.Morph=bt;
|
|
1
|
+
"use strict";var Et=(r,e)=>(e=Symbol[r])?e:Symbol.for("Symbol."+r),St=r=>{throw TypeError(r)};var ot=(r,e,s)=>e.has(r)||St("Cannot "+s);var t=(r,e,s)=>(ot(r,e,"read from private field"),s?s.call(r):e.get(r)),o=(r,e,s)=>e.has(r)?St("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,s),a=(r,e,s,n)=>(ot(r,e,"write to private field"),n?n.call(r,s):e.set(r,s),s),A=(r,e,s)=>(ot(r,e,"access private method"),s);var O=(r,e,s)=>new Promise((n,c)=>{var d=f=>{try{p(s.next(f))}catch(M){c(M)}},y=f=>{try{p(s.throw(f))}catch(M){c(M)}},p=f=>f.done?n(f.value):Promise.resolve(f.value).then(d,y);p((s=s.apply(r,e)).next())});var wt=(r,e,s)=>(e=r[Et("asyncIterator")])?e.call(r):(r=r[Et("iterator")](),e={},s=(n,c)=>(c=r[n])&&(e[n]=d=>new Promise((y,p,f)=>(d=c.call(r,d),f=d.done,Promise.resolve(d.value).then(M=>y({value:M,done:f}),p)))),s("next"),s("return"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const yt=require("../loading/index.cjs"),At=require("../index-Cqw2NKev.cjs"),st=require("../events-KVanG9sR.cjs"),it=require("../url-CLvdjbII.cjs"),Dt=require("../dom-JBOkFLTh.cjs");var C,h,v,B,L,F,j,W,Y,x,K,D;class bt{constructor(e,s){o(this,C);o(this,h);o(this,v);o(this,B);o(this,L,null);o(this,F,!1);o(this,j,!1);o(this,W,!1);o(this,Y);o(this,x);o(this,K,e=>{e.preventDefault(),t(this,C).links.forEach(n=>{var c;t(this,v)===t(n,v)||(c=t(n,x))!=null&&c.includes(t(this,v))?t(n,h).classList.add("clicked"):t(n,h).classList.remove("clicked")});let s;t(this,L)&&(s={x:t(this,L).scrollLeft,y:t(this,L).scrollTop,selector:t(this,L).id?"#"+t(this,L).id:""}),t(this,C).navigate(t(this,v),{historyAction:t(this,B),state:t(this,Y),saveScrollState:s,saveDocumentState:t(this,F),restoreDocumentState:t(this,W),restoreScrollState:t(this,j)})});o(this,D,()=>{t(this,C).prefetch(t(this,v)),t(this,h).removeEventListener("pointerenter",t(this,D))});var y,p;a(this,C,s),a(this,h,e),a(this,v,t(this,h).getAttribute("href")||"/"),a(this,B,t(this,h).getAttribute("data-history-action")||"push");const n=t(this,h).getAttribute("data-save-scroll-state");typeof n=="string"&&(n===""?a(this,L,Dt.findScrollParentElement(t(this,h))):a(this,L,document.getElementById(n))),a(this,F,t(this,h).hasAttribute("data-save-document-state")),a(this,W,t(this,h).hasAttribute("data-restore-document-state")),a(this,j,t(this,h).hasAttribute("data-restore-scroll-state")),a(this,Y,t(this,h).getAttribute("data-state")||void 0),t(this,h).addEventListener("click",t(this,K));const c=s.normalizePath(t(this,v)),d=s.normalizePath(location.pathname);a(this,x,(y=t(this,h).getAttribute("data-match-paths"))==null?void 0:y.split(",").map(f=>s.normalizePath(f.trim()).pathname)),t(this,h).hasAttribute("data-include")?d.pathname.includes(c.pathname)&&t(this,h).classList.add("current"):c.pathname===d.pathname||(p=t(this,x))!=null&&p.includes(d.pathname)?(t(this,h).classList.add("current"),t(this,h).classList.add("clicked")):t(this,h).classList.remove("clicked"),t(this,h).hasAttribute("data-prefetch")&&t(this,h).addEventListener("pointerenter",t(this,D))}get element(){return t(this,h)}destroy(){t(this,h).removeEventListener("click",t(this,K)),t(this,h).removeEventListener("pointerenter",t(this,D)),t(this,h).classList.remove("current")}}C=new WeakMap,h=new WeakMap,v=new WeakMap,B=new WeakMap,L=new WeakMap,F=new WeakMap,j=new WeakMap,W=new WeakMap,Y=new WeakMap,x=new WeakMap,K=new WeakMap,D=new WeakMap;class Pt extends HTMLElement{connectedCallback(){const e={"aria-live":"assertive","aria-atomic":"true",style:"position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"};for(const[s,n]of Object.entries(e))this.setAttribute(s,n)}}At.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Pt);var V,G,J,Q,q,S,nt,k,P,E,U,X,H,w,z,R,T,m,ht,ct,Tt,lt,at;class qt{constructor(e){o(this,m);o(this,V,null);o(this,G,null);o(this,J,null);o(this,Q,!1);o(this,q,null);o(this,S,[]);o(this,nt,new DOMParser);o(this,k,new Map);o(this,P);o(this,E,null);o(this,U);o(this,X);o(this,H,[]);o(this,w);o(this,z);o(this,R,!1);o(this,T,null);o(this,at,e=>{var s;(s=e.state)!=null&&s.path&&(a(this,R,!0),this.navigate(e.state.path,{historyAction:"none"}),a(this,R,!1))});if(At.isBrowser){a(this,V,it.normalizeBase(e==null?void 0:e.base)),a(this,G,(e==null?void 0:e.waitForHeadToLoad)!==!1),a(this,J,(e==null?void 0:e.cachePages)!==!1),a(this,Q,(e==null?void 0:e.trailingSlash)||!1),a(this,q,A(this,m,ct).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);a(this,E,s.pathname),document.documentElement.setAttribute("data-current-pathname",t(this,E)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",t(this,at)),it.changeHistory({action:"replace",pathname:t(this,E),searchParameters:s.parameters,hash:s.hash}),t(this,q).map(n=>[...n.children]).flat().forEach(n=>{n instanceof HTMLElement&&n.classList.add("current")}),a(this,T,new Pt)}}get currentPathname(){return t(this,E)}get previousPathname(){return t(this,U)}get currentState(){return t(this,X)}get links(){return t(this,S)}normalizePath(e){return it.splitPath(e,{base:t(this,V),trailingSlash:t(this,Q)})}prefetch(e){return O(this,null,function*(){const s=this.normalizePath(e);return A(this,m,ht).call(this,s.pathname)})}navigate(f){return O(this,arguments,function*(e,{historyAction:s="push",state:n,saveScrollState:c,saveDocumentState:d,restoreDocumentState:y,restoreScrollState:p}={}){var dt;if(t(this,H).length)return;t(this,R)||(y||a(this,z,void 0),p||a(this,w,void 0));const M=this.normalizePath(e);let{pathname:l,hash:Mt,parameters:Ct,leaf:kt}=M;if(t(this,P)===l||t(this,E)===l)return;a(this,X,n),a(this,P,l);const Z=t(this,k).has(l);try{yt.loading.add("__morph");let $=!0;if(this.preprocessor)try{yield new Promise((i,g)=>{var b;(b=this.preprocessor)==null||b.call(this,{pathname:l,resolve:i,reject:g,isCached:Z,state:n})})}catch(i){i?console.error(i):console.log("Route change canceled"),$=!1}if(!$||t(this,P)!==l)return;const N=(t(this,z)||t(this,k).get(l)||(yield A(this,m,ht).call(this,l))).cloneNode(!0);if(t(this,P)!==l)return;if(a(this,z,d?document.cloneNode(!0):void 0),N.title)t(this,T).textContent=N.title;else{const i=N.querySelector("h1"),g=(i==null?void 0:i.innerText)||(i==null?void 0:i.textContent)||l;t(this,T).textContent=g}document.body.appendChild(t(this,T));const ut={pathname:l,isCached:Z,state:n,newDocument:N};st.dispatchEvent(document,"morphStart",{detail:ut});const mt=Array.from(document.head.children),ft=Array.from(N.head.children),pt=A(this,m,Tt).call(this,mt,ft),Ht=A(this,m,lt).call(this,mt,pt),tt=A(this,m,lt).call(this,ft,pt);tt.forEach((i,g)=>{if(i.tagName==="SCRIPT"&&i.getAttribute("src")){const b=document.createElement("script");b.type="module",b.src=i.getAttribute("src"),tt[g]=b}}),tt.forEach(i=>{document.head.appendChild(i)});const rt=tt.filter(i=>!i.hasAttribute("data-no-waiting")&&(i.tagName==="STYLE"||i.tagName==="SCRIPT"||i.tagName==="LINK")&&i.getAttribute("rel")!=="canonical");t(this,G)&&rt.length&&(yield new Promise(i=>O(this,null,function*(){let g=0;try{for(var b=wt(rt),vt,_,Lt;vt=!(_=yield b.next()).done;vt=!1){const et=_.value;et.onload=()=>{g++,g===rt.length&&i()}}}catch(_){Lt=[_]}finally{try{vt&&(_=b.return)&&(yield _.call(b))}finally{if(Lt)throw Lt[0]}}})));const gt=[];Ht.forEach(i=>{i.hasAttribute("data-permanent")||(i.tagName==="SCRIPT"||i.tagName==="STYLE"||i.getAttribute("rel")==="stylesheet"?gt.push(i):i.remove())}),a(this,U,t(this,E)),a(this,E,l),it.changeHistory({action:s,pathname:l,searchParameters:Ct,hash:Mt});const Nt=A(this,m,ct).call(this,N.body);t(this,q).forEach((i,g)=>{const b=Nt[g++],vt=getComputedStyle(i).getPropertyValue("--morph-duration"),_=[...b.childNodes];if(vt){const Lt=[...i.childNodes];if(Lt.forEach(u=>{u instanceof HTMLElement&&u.classList.add("old")}),_.forEach(u=>{u instanceof HTMLElement&&(u.classList.remove("current"),u.classList.add("new"))}),i.prepend(..._),t(this,w)){const u=document.querySelector(t(this,w).selector);u&&u.scroll({top:t(this,w).y,left:t(this,w).x,behavior:"auto"})}setTimeout(()=>{_.forEach(u=>{u instanceof HTMLElement&&u.classList.add("in")})},10);const et={morphElement:i,pathname:l,isCached:Z,state:n};st.dispatchEvent(document,"morphNewChildrenAdded",{detail:et});const xt=new Promise(u=>{setTimeout(()=>{Lt.forEach(I=>I.remove()),_.forEach(I=>{I instanceof HTMLElement&&(I.classList.remove("new","in"),I.classList.add("current"))}),st.dispatchEvent(document,"morphOldChildrenRemoved",{detail:et}),u()},(parseFloat(vt)||0)*1e3+10)});t(this,H).push(xt)}else i.innerHTML="",i.append(..._)}),yield Promise.all(t(this,H)),gt.forEach(i=>i.remove()),a(this,H,[]),a(this,w,c),this.findLinks(),document.documentElement.setAttribute("data-current-pathname",l),document.documentElement.setAttribute("data-current-leaf",kt),t(this,T).remove(),(dt=this.postprocessor)==null||dt.call(this,{pathname:l,isCached:Z,state:n}),st.dispatchEvent(document,"morphComplete",{detail:ut}),yt.loading.complete("__morph")}catch($){console.error($)}a(this,P,void 0)})}addLink(e){t(this,S).push(new bt(e,this))}addLinks(e){e.forEach(s=>{this.addLink(s)})}removeLink(e){a(this,S,t(this,S).filter(s=>s.element===e?(s.destroy(),!1):!0))}findLinks(){const e=[...document.documentElement.querySelectorAll("a")].filter(s=>{var n;return((n=s.getAttribute("href"))==null?void 0:n.startsWith("/"))&&!s.hasAttribute("download")&&!s.hasAttribute("data-morph-skip")&&!s.closest("[data-morph-skip]")});t(this,S).forEach(s=>s.destroy()),a(this,S,e.map(s=>new bt(s,this)))}}V=new WeakMap,G=new WeakMap,J=new WeakMap,Q=new WeakMap,q=new WeakMap,S=new WeakMap,nt=new WeakMap,k=new WeakMap,P=new WeakMap,E=new WeakMap,U=new WeakMap,X=new WeakMap,H=new WeakMap,w=new WeakMap,z=new WeakMap,R=new WeakMap,T=new WeakMap,m=new WeakSet,ht=function(e){return O(this,null,function*(){const s=t(this,k).get(e);if(s)return s;const c=yield(yield fetch(e)).text(),d=t(this,nt).parseFromString(c,"text/html");return t(this,J)&&t(this,k).set(e,d),d})},ct=function(e){const s=[...e.querySelectorAll("[data-morph]")];return s.length?s:[e]},Tt=function(e,s){return e.filter(n=>s.find(c=>c.outerHTML===n.outerHTML))},lt=function(e,s){return e.filter(n=>!s.find(c=>c.outerHTML===n.outerHTML))},at=new WeakMap;exports.Morph=qt;
|