aptechka 0.63.3 → 0.64.2
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-BRqj4VfN.cjs +1 -0
- package/lib/{Animation-Cb-klopb.js → Animation-D29tc5VS.js} +5 -4
- package/lib/Damped-BD1OQ1fH.cjs +1 -0
- package/lib/{Damped-ByZFbNSt.js → Damped-YrqW5V4w.js} +5 -4
- package/lib/DragControls-D8BXtKVu.cjs +1 -0
- package/lib/DragControls-DGDUw6bM.js +226 -0
- package/lib/ScrollSegmentElement-B6gp1q_z.js +459 -0
- package/lib/ScrollSegmentElement-DtMMAirz.cjs +1 -0
- package/lib/SourceElement-D_YeNqsI.cjs +5 -0
- package/lib/SourceElement-jbviggZp.js +217 -0
- package/lib/{Store-swP_0ymB.js → Store-0BVty6AZ.js} +2 -1
- package/lib/Store-Cd1GlEmZ.cjs +1 -0
- package/lib/Tweened-B-AHx93m.cjs +1 -0
- package/lib/{Tweened-C4xgzPkR.js → Tweened-_pF0zXXN.js} +10 -9
- package/lib/Viewport-DA10iWAO.js +109 -0
- package/lib/Viewport-DB0qAZPJ.cjs +1 -0
- package/lib/accordion/index.cjs +1 -1
- package/lib/accordion/index.js +2 -1
- 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 +5 -4
- package/lib/billboard/index.cjs +1 -1
- package/lib/billboard/index.js +2 -1
- package/lib/canvas/index.cjs +1 -1
- package/lib/canvas/index.js +5 -5
- package/lib/controls/index.cjs +1 -1
- package/lib/controls/index.js +6 -223
- package/lib/css-property/index.cjs +1 -1
- package/lib/css-property/index.js +15 -14
- package/lib/custom-scrollbar/index.cjs +1 -1
- package/lib/custom-scrollbar/index.js +25 -24
- 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 +5 -106
- package/lib/{easings-Bni3YAAW.js → easings-BEmRlrDd.js} +15 -15
- package/lib/element-CGVl1jA-.js +7 -0
- package/lib/element-linked-store/index.cjs +1 -1
- package/lib/element-linked-store/index.js +5 -4
- package/lib/element-resizer/index.cjs +1 -1
- package/lib/element-resizer/index.js +22 -21
- package/lib/element-yhcBhsho.cjs +1 -0
- package/lib/en3/En3View.d.ts +2 -2
- package/lib/en3/en3.d.ts +3 -2
- package/lib/en3/index.cjs +3 -3
- package/lib/en3/index.js +90 -89
- package/lib/iframe/index.cjs +1 -1
- package/lib/iframe/index.js +4 -3
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.js +5 -4
- package/lib/{index-euf5anj6.js → index-Bv9zgfdb.js} +3 -2
- package/lib/index-DekP7OZe.cjs +1 -0
- package/lib/intersector/index.cjs +1 -1
- package/lib/intersector/index.js +4 -3
- package/lib/ladder/index.cjs +1 -1
- package/lib/ladder/index.js +41 -40
- package/lib/{layout-DpZo-I0y.js → layout-BSMtwCga.js} +2 -2
- package/lib/layout-box/index.cjs +1 -1
- package/lib/layout-box/index.js +18 -17
- package/lib/loading/index.cjs +1 -1
- package/lib/loading/index.js +4 -3
- package/lib/masonry-layout/index.cjs +1 -1
- package/lib/masonry-layout/index.js +2 -2
- package/lib/media/index.cjs +1 -1
- package/lib/media/index.js +12 -11
- package/lib/morph/index.cjs +1 -1
- package/lib/morph/index.js +3 -2
- package/lib/need_redo_tweaker/index.cjs +3 -3
- package/lib/need_redo_tweaker/index.js +368 -340
- package/lib/pixel-perfect/index.cjs +1 -1
- package/lib/pixel-perfect/index.js +2 -2
- package/lib/pointer/index.cjs +1 -1
- package/lib/pointer/index.js +19 -18
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.js +3 -2
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.js +2 -1
- package/lib/router/index.cjs +1 -1
- package/lib/router/index.js +11 -10
- package/lib/scroll/ScrollElement.d.ts +1 -0
- package/lib/scroll/index.cjs +1 -1
- package/lib/scroll/index.js +448 -437
- package/lib/{scroll-Benkuq-t.js → scroll-BWF48oHS.js} +11 -10
- package/lib/scroll-CFDCeArT.cjs +1 -0
- package/lib/scroll-segment/index.cjs +1 -1
- package/lib/scroll-segment/index.js +3 -456
- package/lib/sequence/index.cjs +1 -1
- package/lib/sequence/index.js +4 -3
- package/lib/size-element/index.cjs +1 -1
- package/lib/size-element/index.js +2 -1
- package/lib/slicer/index.cjs +3 -3
- package/lib/slicer/index.js +31 -30
- package/lib/source/SourceElement.d.ts +1 -1
- package/lib/source/index.cjs +1 -5
- package/lib/source/index.js +5 -214
- package/lib/store/index.cjs +1 -1
- package/lib/store/index.js +14 -13
- package/lib/stylesheet-DpnWNVyD.js +24 -0
- package/lib/stylesheet-HWF2a3nr.cjs +1 -0
- package/lib/ticker/index.cjs +1 -1
- package/lib/ticker/index.js +14 -13
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +124 -127
- package/lib/utils/jss.d.ts +0 -1
- package/lib/utils/stylesheet.d.ts +2 -0
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.js +11 -10
- package/lib/window-resizer/index.cjs +1 -1
- package/lib/window-resizer/index.js +9 -8
- package/lib/youtube/index.cjs +1 -1
- package/lib/youtube/index.js +12 -11
- package/package.json +4 -4
- package/lib/Animation-dD_idtTU.cjs +0 -1
- package/lib/Damped-B8bmTxAr.cjs +0 -1
- package/lib/Store-GokLe_g-.cjs +0 -1
- package/lib/Tweened-BsL9FamJ.cjs +0 -1
- package/lib/index-Cqw2NKev.cjs +0 -1
- package/lib/jss-CRBgdvJ3.cjs +0 -1
- package/lib/jss-DtnXPEnq.js +0 -23
- package/lib/scroll-DAhSpkhR.cjs +0 -1
package/lib/image/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { d as m } from "../Viewport-DA10iWAO.js";
|
|
2
|
+
import { a as s } from "../SourceElement-jbviggZp.js";
|
|
3
3
|
import "../window-resizer/index.js";
|
|
4
|
-
import "../Store-
|
|
5
|
-
import { i } from "../index-
|
|
4
|
+
import "../Store-0BVty6AZ.js";
|
|
5
|
+
import { i } from "../index-Bv9zgfdb.js";
|
|
6
|
+
import "construct-style-sheets-polyfill";
|
|
6
7
|
class r extends s {
|
|
7
8
|
createConsumer() {
|
|
8
9
|
return document.createElement("img");
|
|
@@ -4,6 +4,7 @@ var m = (s) => {
|
|
|
4
4
|
var y = (s, t, n) => t.has(s) || m("Cannot " + n);
|
|
5
5
|
var i = (s, t, n) => (y(s, t, "read from private field"), n ? n.call(s) : t.get(s)), u = (s, t, n) => t.has(s) ? m("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, n), h = (s, t, n, e) => (y(s, t, "write to private field"), e ? e.call(s, n) : t.set(s, n), n);
|
|
6
6
|
import { g as d } from "./dom-CVWzyXPH.js";
|
|
7
|
+
import "construct-style-sheets-polyfill";
|
|
7
8
|
const w = typeof window != "undefined" && typeof window.document != "undefined";
|
|
8
9
|
var r, f, b;
|
|
9
10
|
class p {
|
|
@@ -56,9 +57,9 @@ class p {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
r = new WeakMap(), f = new WeakMap(), b = new WeakMap();
|
|
59
|
-
const
|
|
60
|
+
const a = new p();
|
|
60
61
|
export {
|
|
61
62
|
p as I,
|
|
62
|
-
|
|
63
|
+
a,
|
|
63
64
|
w as i
|
|
64
65
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var d=s=>{throw TypeError(s)};var w=(s,t,n)=>t.has(s)||d("Cannot "+n);var r=(s,t,n)=>(w(s,t,"read from private field"),n?n.call(s):t.get(s)),f=(s,t,n)=>t.has(s)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(s):t.set(s,n),h=(s,t,n,e)=>(w(s,t,"write to private field"),e?e.call(s,n):t.set(s,n),n);const p=require("./dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");const y=typeof window!="undefined"&&typeof window.document!="undefined";var i,u,b;class m{constructor(){f(this,i,[]);f(this,u,null);f(this,b,t=>{r(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))})});y&&window.IntersectionObserver&&h(this,u,new IntersectionObserver(r(this,b)))}subscribe(t,n){const e=p.getElement(t);if(!e)return()=>{};const o=r(this,i).find(c=>c.element===e);if(!o)r(this,u).observe(e);else{const c=r(this,i).find(l=>l.element===e&&l.entry);c!=null&&c.entry.isIntersecting&&n(c.entry)}return r(this,i).push({element:e,callback:n,entry:(o==null?void 0:o.entry)||null}),()=>{this.unsubscribe(n)}}unsubscribe(t){const n=r(this,i).find(e=>e.callback===t);n&&(h(this,i,r(this,i).filter(e=>e.callback!==t)),r(this,i).find(e=>e.element===n.element)||r(this,u).unobserve(n.element))}}i=new WeakMap,u=new WeakMap,b=new WeakMap;const v=new m;exports.Intersector=m;exports.intersector=v;exports.isBrowser=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-DekP7OZe.cjs");require("../dom-JBOkFLTh.cjs");require("construct-style-sheets-polyfill");exports.Intersector=e.Intersector;exports.intersector=e.intersector;
|
package/lib/intersector/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { I as
|
|
1
|
+
import { I as s, a } from "../index-Bv9zgfdb.js";
|
|
2
2
|
import "../dom-CVWzyXPH.js";
|
|
3
|
+
import "construct-style-sheets-polyfill";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
s as Intersector,
|
|
6
|
+
a as intersector
|
|
6
7
|
};
|
package/lib/ladder/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var w=Object.defineProperty;var S=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var v=t=>{throw TypeError(t)};var k=(t,s,e)=>s in t?w(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e,q=(t,s)=>{for(var e in s||(s={}))M.call(s,e)&&k(t,e,s[e]);if(S)for(var e of S(s))V.call(s,e)&&k(t,e,s[e]);return t};var g=(t,s,e)=>s.has(t)||v("Cannot "+e);var o=(t,s,e)=>(g(t,s,"read from private field"),e?e.call(t):s.get(t)),p=(t,s,e)=>s.has(t)?v("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(t):s.set(t,e),f=(t,s,e,i)=>(g(t,s,"write to private field"),i?i.call(t,e):s.set(t,e),e),b=(t,s,e)=>(g(t,s,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../Store-Cd1GlEmZ.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");var d,u,a,h,y;class x extends m.Store{constructor(e){super(e,{equalityCheck:()=>!1});p(this,h);p(this,d);p(this,u);p(this,a);f(this,d,q({},e)),f(this,u,new Map),f(this,a,new Set)}get base(){return o(this,d)}get steps(){return o(this,u)}close(){super.close(),o(this,a).clear(),o(this,u).clear()}bind(e){o(this,a).add(e)}unbind(e){o(this,a).delete(e)}deleteStep(e){this.steps.delete(e)}getStepValue(e){var i;return(i=this.steps.get(e))==null?void 0:i[1]}getExcludedStepsValue(...e){const i=new Map;return e.map(r=>{const n=this.steps.get(r);n&&i.set(r,n)}),b(this,h,y).call(this,i)}getIncludedStepsValue(...e){const i=new Map(this.steps);return e.map(r=>{this.steps.has(r)&&i.delete(r)}),b(this,h,y).call(this,i)}setStep(e,i,r){const n={};for(const c in this.current)n[c]=r[c]||0;this.steps.set(e,[i,n]),this.calculate()}calculate(){this.current=b(this,h,y).call(this,o(this,u))}}d=new WeakMap,u=new WeakMap,a=new WeakMap,h=new WeakSet,y=function(e){const i={};for(const r in this.base)i[r]=this.base[r];for(const r of e){const n=r[1];if(n[0]==="+")for(const c in this.base){const l=n[1][c];i[c]+=l}else if(n[0]==="*")for(const c in this.base){const l=n[1][c];i[c]*=l}else if(n[0]==="/")for(const c in this.base){const l=n[1][c];i[c]/=l}else if(n[0]==="-")for(const c in this.base){const l=n[1][c];i[c]-=l}}for(const r of o(this,a))for(const n in i)r[n]=i[n];return i};exports.Ladder=x;
|
package/lib/ladder/index.js
CHANGED
|
@@ -13,19 +13,20 @@ var S = (e, s, t) => s in e ? w(e, s, { enumerable: !0, configurable: !0, writab
|
|
|
13
13
|
return e;
|
|
14
14
|
};
|
|
15
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)),
|
|
17
|
-
import { S as M } from "../Store-
|
|
18
|
-
import "
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
var r = (e, s, t) => (g(e, s, "read from private field"), t ? t.call(e) : s.get(e)), u = (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-0BVty6AZ.js";
|
|
18
|
+
import "construct-style-sheets-polyfill";
|
|
19
|
+
import "../index-Bv9zgfdb.js";
|
|
20
|
+
var f, h, a, p, y;
|
|
21
|
+
class L extends M {
|
|
21
22
|
constructor(t) {
|
|
22
23
|
super(t, {
|
|
23
24
|
equalityCheck: () => !1
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
u(this, p);
|
|
27
|
+
u(this, f);
|
|
28
|
+
u(this, h);
|
|
29
|
+
u(this, a);
|
|
29
30
|
d(this, f, v({}, t)), d(this, h, /* @__PURE__ */ new Map()), d(this, a, /* @__PURE__ */ new Set());
|
|
30
31
|
}
|
|
31
32
|
get base() {
|
|
@@ -52,59 +53,59 @@ class I extends M {
|
|
|
52
53
|
}
|
|
53
54
|
getExcludedStepsValue(...t) {
|
|
54
55
|
const i = /* @__PURE__ */ new Map();
|
|
55
|
-
return t.map((
|
|
56
|
-
const n = this.steps.get(
|
|
57
|
-
n && i.set(
|
|
58
|
-
}), b(this,
|
|
56
|
+
return t.map((o) => {
|
|
57
|
+
const n = this.steps.get(o);
|
|
58
|
+
n && i.set(o, n);
|
|
59
|
+
}), b(this, p, y).call(this, i);
|
|
59
60
|
}
|
|
60
61
|
getIncludedStepsValue(...t) {
|
|
61
62
|
const i = new Map(this.steps);
|
|
62
|
-
return t.map((
|
|
63
|
-
this.steps.has(
|
|
64
|
-
}), b(this,
|
|
63
|
+
return t.map((o) => {
|
|
64
|
+
this.steps.has(o) && i.delete(o);
|
|
65
|
+
}), b(this, p, y).call(this, i);
|
|
65
66
|
}
|
|
66
|
-
setStep(t, i,
|
|
67
|
+
setStep(t, i, o) {
|
|
67
68
|
const n = {};
|
|
68
|
-
for (const
|
|
69
|
-
n[
|
|
69
|
+
for (const c in this.current)
|
|
70
|
+
n[c] = o[c] || 0;
|
|
70
71
|
this.steps.set(t, [i, n]), this.calculate();
|
|
71
72
|
}
|
|
72
73
|
calculate() {
|
|
73
|
-
this.current = b(this,
|
|
74
|
+
this.current = b(this, p, y).call(this, r(this, h));
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
f = new WeakMap(), h = new WeakMap(), a = new WeakMap(),
|
|
77
|
+
f = new WeakMap(), h = new WeakMap(), a = new WeakMap(), p = new WeakSet(), y = function(t) {
|
|
77
78
|
const i = {};
|
|
78
|
-
for (const
|
|
79
|
-
i[
|
|
80
|
-
for (const
|
|
81
|
-
const n =
|
|
79
|
+
for (const o in this.base)
|
|
80
|
+
i[o] = this.base[o];
|
|
81
|
+
for (const o of t) {
|
|
82
|
+
const n = o[1];
|
|
82
83
|
if (n[0] === "+")
|
|
83
|
-
for (const
|
|
84
|
-
const l = n[1][
|
|
85
|
-
i[
|
|
84
|
+
for (const c in this.base) {
|
|
85
|
+
const l = n[1][c];
|
|
86
|
+
i[c] += l;
|
|
86
87
|
}
|
|
87
88
|
else if (n[0] === "*")
|
|
88
|
-
for (const
|
|
89
|
-
const l = n[1][
|
|
90
|
-
i[
|
|
89
|
+
for (const c in this.base) {
|
|
90
|
+
const l = n[1][c];
|
|
91
|
+
i[c] *= l;
|
|
91
92
|
}
|
|
92
93
|
else if (n[0] === "/")
|
|
93
|
-
for (const
|
|
94
|
-
const l = n[1][
|
|
95
|
-
i[
|
|
94
|
+
for (const c in this.base) {
|
|
95
|
+
const l = n[1][c];
|
|
96
|
+
i[c] /= l;
|
|
96
97
|
}
|
|
97
98
|
else if (n[0] === "-")
|
|
98
|
-
for (const
|
|
99
|
-
const l = n[1][
|
|
100
|
-
i[
|
|
99
|
+
for (const c in this.base) {
|
|
100
|
+
const l = n[1][c];
|
|
101
|
+
i[c] -= l;
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
|
-
for (const
|
|
104
|
+
for (const o of r(this, a))
|
|
104
105
|
for (const n in i)
|
|
105
|
-
|
|
106
|
+
o[n] = i[n];
|
|
106
107
|
return i;
|
|
107
108
|
};
|
|
108
109
|
export {
|
|
109
|
-
|
|
110
|
+
L as Ladder
|
|
110
111
|
};
|
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("../index-
|
|
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-DekP7OZe.cjs"),et=require("../dom-JBOkFLTh.cjs"),V=require("../layout-Ctc2p3uz.cjs");require("construct-style-sheets-polyfill");const 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,P=i.m42*-1,O=i.m43;return{scaleX:e,scaleY:s,scaleZ:l,rotationX:y,rotationY:B,rotationZ:K,translationX:a,translationY:P,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,q,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,q,()=>{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,q)),it.windowResizer.subscribe(t(this,q),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,q)),it.windowResizer.unsubscribe(t(this,q)),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 P=t(this,d)/y,O=t(this,S)/B;r(this,d,(P-Math.floor(P))*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 P=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)-P+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})}},q=new WeakMap,D=new WeakMap,Z=new WeakMap;exports.LayoutBox=ft;exports.decomposeCSSMatrix=ht;
|
package/lib/layout-box/index.js
CHANGED
|
@@ -8,9 +8,10 @@ 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 "../index-
|
|
11
|
+
import { i as tt } from "../index-Bv9zgfdb.js";
|
|
12
12
|
import { g as et } from "../dom-CVWzyXPH.js";
|
|
13
|
-
import { g as F, a as G } from "../layout-
|
|
13
|
+
import { g as F, a as G } from "../layout-BSMtwCga.js";
|
|
14
|
+
import "construct-style-sheets-polyfill";
|
|
14
15
|
import { elementResizer as st } from "../element-resizer/index.js";
|
|
15
16
|
import { windowResizer as it } from "../window-resizer/index.js";
|
|
16
17
|
import { Notifier as ft } from "../notifier/index.js";
|
|
@@ -37,8 +38,8 @@ function pt(i) {
|
|
|
37
38
|
translationZ: O
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
|
-
var a, z, b, _, W, X, v, w, q, B, x, M, Y, S, d, C, H, I, D, p,
|
|
41
|
-
class
|
|
41
|
+
var a, z, b, _, W, X, v, w, q, B, x, M, Y, S, d, C, H, I, D, p, m, g, c, n, o, E, R, T, f, J, ht, rt, nt, P, U, Z;
|
|
42
|
+
class Pt {
|
|
42
43
|
constructor(e, s) {
|
|
43
44
|
h(this, f);
|
|
44
45
|
h(this, a, null);
|
|
@@ -61,8 +62,8 @@ class Ct {
|
|
|
61
62
|
h(this, I, 0);
|
|
62
63
|
h(this, D, 0);
|
|
63
64
|
h(this, p, { x: 0, y: 0, z: 0 });
|
|
64
|
-
h(this,
|
|
65
|
-
h(this,
|
|
65
|
+
h(this, m, { x: 0, y: 0, z: 0 });
|
|
66
|
+
h(this, g, { x: 1, y: 1, z: 1 });
|
|
66
67
|
h(this, c, new N({ x: 0, y: 0, z: 0 }));
|
|
67
68
|
h(this, n, new N({ x: 0, y: 0, z: 0 }));
|
|
68
69
|
h(this, o, new N({ x: 0, y: 0, z: 0 }));
|
|
@@ -139,10 +140,10 @@ class Ct {
|
|
|
139
140
|
return t(this, p);
|
|
140
141
|
}
|
|
141
142
|
get CSSRotation() {
|
|
142
|
-
return t(this,
|
|
143
|
+
return t(this, m);
|
|
143
144
|
}
|
|
144
145
|
get CSSScale() {
|
|
145
|
-
return t(this,
|
|
146
|
+
return t(this, g);
|
|
146
147
|
}
|
|
147
148
|
get front() {
|
|
148
149
|
return t(this, C);
|
|
@@ -243,7 +244,7 @@ class Ct {
|
|
|
243
244
|
return t(this, T).unsubscribe(...e);
|
|
244
245
|
}
|
|
245
246
|
}
|
|
246
|
-
a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W = new WeakMap(), X = new WeakMap(), v = new WeakMap(), w = new WeakMap(), q = new WeakMap(), B = new WeakMap(), x = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), S = new WeakMap(), d = new WeakMap(), C = new WeakMap(), H = new WeakMap(), I = new WeakMap(), D = new WeakMap(), p = new WeakMap(),
|
|
247
|
+
a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W = new WeakMap(), X = new WeakMap(), v = new WeakMap(), w = new WeakMap(), q = new WeakMap(), B = new WeakMap(), x = new WeakMap(), M = new WeakMap(), Y = new WeakMap(), S = new WeakMap(), d = new WeakMap(), C = new WeakMap(), H = new WeakMap(), I = new WeakMap(), D = new WeakMap(), p = new WeakMap(), m = new WeakMap(), g = new WeakMap(), c = new WeakMap(), n = new WeakMap(), o = new WeakMap(), E = new WeakMap(), R = new WeakMap(), T = new WeakMap(), f = new WeakSet(), J = function() {
|
|
247
248
|
t(this, o).calculate(), t(this, n).calculate(), t(this, c).calculate();
|
|
248
249
|
}, ht = function() {
|
|
249
250
|
t(this, o).setStep("_size", "+", {
|
|
@@ -257,17 +258,17 @@ a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W =
|
|
|
257
258
|
y: s,
|
|
258
259
|
z: l
|
|
259
260
|
}), t(this, q) ? (t(this, o).setStep("_scale", "*", {
|
|
260
|
-
x: t(this,
|
|
261
|
-
y: t(this,
|
|
262
|
-
z: t(this,
|
|
261
|
+
x: t(this, g).x,
|
|
262
|
+
y: t(this, g).y,
|
|
263
|
+
z: t(this, g).z
|
|
263
264
|
}), t(this, n).setStep("_translation", "+", {
|
|
264
265
|
x: t(this, p).x,
|
|
265
266
|
y: t(this, p).y,
|
|
266
267
|
z: t(this, p).z
|
|
267
268
|
}), t(this, c).setStep("_rotation", "+", {
|
|
268
|
-
x: t(this,
|
|
269
|
-
y: t(this,
|
|
270
|
-
z: t(this,
|
|
269
|
+
x: t(this, m).x,
|
|
270
|
+
y: t(this, m).y,
|
|
271
|
+
z: t(this, m).z
|
|
271
272
|
})) : (t(this, o).setStep("_scale", "*", {
|
|
272
273
|
x: 1,
|
|
273
274
|
y: 1,
|
|
@@ -299,7 +300,7 @@ a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W =
|
|
|
299
300
|
r(this, H, t(this, d)), r(this, I, t(this, S));
|
|
300
301
|
r(this, D, t(this, C) * -1);
|
|
301
302
|
const k = new WebKitCSSMatrix(e.transform), u = pt(k);
|
|
302
|
-
t(this, p).x = u.translationX, t(this, p).y = u.translationY, t(this, p).z = u.translationZ, t(this,
|
|
303
|
+
t(this, p).x = u.translationX, t(this, p).y = u.translationY, t(this, p).z = u.translationZ, t(this, g).x = u.scaleX, t(this, g).y = u.scaleY, t(this, g).z = u.scaleZ, t(this, m).x = u.rotationX, t(this, m).y = u.rotationY, t(this, m).z = u.rotationZ, L(this, f, ht).call(this), L(this, f, J).call(this), t(this, T).notify();
|
|
303
304
|
}, nt = function() {
|
|
304
305
|
t(this, E).x = 0, t(this, E).y = 0, t(this, E).z = 0;
|
|
305
306
|
for (let e = 0; e < t(this, b).length; e++) {
|
|
@@ -313,6 +314,6 @@ a = new WeakMap(), z = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), W =
|
|
|
313
314
|
}
|
|
314
315
|
}, P = new WeakMap(), U = new WeakMap(), Z = new WeakMap();
|
|
315
316
|
export {
|
|
316
|
-
|
|
317
|
+
Pt as LayoutBox,
|
|
317
318
|
pt as decomposeCSSMatrix
|
|
318
319
|
};
|
package/lib/loading/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var m=i=>{throw TypeError(i)};var v=(i,t,s)=>t.has(i)||m("Cannot "+s);var e=(i,t,s)=>(v(i,t,"read from private field"),s?s.call(i):t.get(i)),r=(i,t,s)=>t.has(i)?m("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),n=(i,t,s,d)=>(v(i,t,"write to private field"),d?d.call(i,s):t.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../events-KVanG9sR.cjs"),E=require("../function-MthRj-GJ.cjs");require("../index-
|
|
1
|
+
"use strict";var m=i=>{throw TypeError(i)};var v=(i,t,s)=>t.has(i)||m("Cannot "+s);var e=(i,t,s)=>(v(i,t,"read from private field"),s?s.call(i):t.get(i)),r=(i,t,s)=>t.has(i)?m("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,s),n=(i,t,s,d)=>(v(i,t,"write to private field"),d?d.call(i,s):t.set(i,s),s);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../events-KVanG9sR.cjs"),E=require("../function-MthRj-GJ.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");var o,a,h,l,u,c,p;class q{constructor(){r(this,o,new Map);r(this,a,!1);r(this,h,0);r(this,l,0);r(this,u,E.debounce(()=>{e(this,a)||(n(this,a,!0),g.dispatchEvent(document,"loadingStart"),e(this,c).call(this))},0));r(this,c,t=>{if(!e(this,a))return;const s=e(this,o).size,d=Array.from(e(this,o)).filter(b=>b[1]).length,f=d/s;n(this,h,d),n(this,l,f),g.dispatchEvent(document,"loadingProgress",{detail:{total:s,loaded:d,progress:f,resourceName:t}}),f===1&&e(this,p).call(this)});r(this,p,E.debounce(()=>{n(this,a,!1),g.dispatchEvent(document,"loadingComplete",{detail:{total:e(this,o).size}}),n(this,h,0),n(this,l,0),e(this,o).clear()},0))}get total(){return e(this,o).size}get loaded(){return e(this,h)}get progress(){return e(this,l)}get map(){return e(this,o)}add(t){e(this,o).set(t,!1),e(this,u).call(this)}complete(t){e(this,o).set(t,!0),e(this,c).call(this,t)}error(t){e(this,o).has(t)&&(console.error(`Failed to load ${t}`),e(this,o).delete(t),g.dispatchEvent(document,"loadingError",{detail:{name:t}})),e(this,c).call(this)}}o=new WeakMap,a=new WeakMap,h=new WeakMap,l=new WeakMap,u=new WeakMap,c=new WeakMap,p=new WeakMap;const S=new q;exports.loading=S;
|
package/lib/loading/index.js
CHANGED
|
@@ -5,7 +5,8 @@ var z = (i, t, e) => t.has(i) || u("Cannot " + e);
|
|
|
5
5
|
var s = (i, t, e) => (z(i, t, "read from private field"), e ? e.call(i) : t.get(i)), r = (i, t, e) => t.has(i) ? u("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), a = (i, t, e, h) => (z(i, t, "write to private field"), h ? h.call(i, e) : t.set(i, e), e);
|
|
6
6
|
import { d as p } from "../events-CsVF98U6.js";
|
|
7
7
|
import { d as w } from "../function-C10DGppn.js";
|
|
8
|
-
import "
|
|
8
|
+
import "construct-style-sheets-polyfill";
|
|
9
|
+
import "../index-Bv9zgfdb.js";
|
|
9
10
|
var o, d, l, n, c, g, m;
|
|
10
11
|
class S {
|
|
11
12
|
constructor() {
|
|
@@ -64,7 +65,7 @@ class S {
|
|
|
64
65
|
}
|
|
65
66
|
}
|
|
66
67
|
o = new WeakMap(), d = new WeakMap(), l = new WeakMap(), n = new WeakMap(), c = new WeakMap(), g = new WeakMap(), m = new WeakMap();
|
|
67
|
-
const
|
|
68
|
+
const A = new S();
|
|
68
69
|
export {
|
|
69
|
-
|
|
70
|
+
A as loading
|
|
70
71
|
};
|
|
@@ -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"),w=require("../index-
|
|
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-DekP7OZe.cjs"),E=require("../stylesheet-HWF2a3nr.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")};w.isBrowser&&!customElements.get("e-masonry-layout")&&customElements.define("e-masonry-layout",g);exports.MasonryLayoutElement=g;
|
|
@@ -4,8 +4,8 @@ var L = (t) => {
|
|
|
4
4
|
var u = (t, s, e) => s.has(t) || L("Cannot " + e);
|
|
5
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
6
|
import { CSSProperty as f } from "../css-property/index.js";
|
|
7
|
-
import { i as v } from "../index-
|
|
8
|
-
import { c as w } from "../
|
|
7
|
+
import { i as v } from "../index-Bv9zgfdb.js";
|
|
8
|
+
import { c as w } from "../stylesheet-DpnWNVyD.js";
|
|
9
9
|
var r, a, c, m, d, y;
|
|
10
10
|
class g extends HTMLElement {
|
|
11
11
|
constructor() {
|
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)),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-
|
|
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-Cd1GlEmZ.cjs");require("construct-style-sheets-polyfill");require("../index-DekP7OZe.cjs");var i,t;class q 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=q;
|
package/lib/media/index.js
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
var a = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
|
-
var h = (e,
|
|
5
|
-
var o = (e,
|
|
6
|
-
import { RESIZE_ORDER as
|
|
7
|
-
import { windowResizer as
|
|
8
|
-
import { S as f } from "../Store-
|
|
9
|
-
import "
|
|
4
|
+
var h = (e, r, s) => r.has(e) || a("Cannot " + s);
|
|
5
|
+
var o = (e, r, s) => (h(e, r, "read from private field"), s ? s.call(e) : r.get(e)), c = (e, r, s) => r.has(e) ? a("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(e) : r.set(e, s), m = (e, r, s, u) => (h(e, r, "write to private field"), u ? u.call(e, s) : r.set(e, s), s);
|
|
6
|
+
import { RESIZE_ORDER as p } from "../order/index.js";
|
|
7
|
+
import { windowResizer as n } from "../window-resizer/index.js";
|
|
8
|
+
import { S as f } from "../Store-0BVty6AZ.js";
|
|
9
|
+
import "construct-style-sheets-polyfill";
|
|
10
|
+
import "../index-Bv9zgfdb.js";
|
|
10
11
|
var t, i;
|
|
11
|
-
class
|
|
12
|
-
constructor(
|
|
12
|
+
class M extends f {
|
|
13
|
+
constructor(s) {
|
|
13
14
|
super(!1);
|
|
14
15
|
c(this, t);
|
|
15
16
|
c(this, i);
|
|
16
|
-
m(this, t,
|
|
17
|
+
m(this, t, s), m(this, i, n.subscribe(() => {
|
|
17
18
|
matchMedia(o(this, t)).matches ? this.current = !0 : this.current = !1;
|
|
18
|
-
},
|
|
19
|
+
}, p.MEDIA));
|
|
19
20
|
}
|
|
20
21
|
close() {
|
|
21
22
|
super.close(), o(this, i).call(this);
|
|
@@ -23,5 +24,5 @@ class E extends f {
|
|
|
23
24
|
}
|
|
24
25
|
t = new WeakMap(), i = new WeakMap();
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
M as Media
|
|
27
28
|
};
|
package/lib/morph/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var kt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Ct=n=>{throw TypeError(n)};var dt=(n,t,s)=>t.has(n)||Ct("Cannot "+s);var e=(n,t,s)=>(dt(n,t,"read from private field"),s?s.call(n):t.get(n)),a=(n,t,s)=>t.has(n)?Ct("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),o=(n,t,s,i)=>(dt(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),m=(n,t,s)=>(dt(n,t,"access private method"),s);var z=(n,t,s)=>new Promise((i,d)=>{var v=E=>{try{S(s.next(E))}catch(D){d(D)}},b=E=>{try{S(s.throw(E))}catch(D){d(D)}},S=E=>E.done?i(E.value):Promise.resolve(E.value).then(v,b);S((s=s.apply(n,t)).next())});var Tt=(n,t,s)=>(t=n[kt("asyncIterator")])?t.call(n):(n=n[kt("iterator")](),t={},s=(i,d)=>(d=n[i])&&(t[i]=v=>new Promise((b,S,E)=>(v=d.call(n,v),E=v.done,Promise.resolve(v.value).then(D=>b({value:D,done:E}),S)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xt=require("../index-Cqw2NKev.cjs"),$=require("../events-KVanG9sR.cjs"),Bt=require("../polyfills-Df4r-ETT.cjs"),Mt=require("../scroll-DAhSpkhR.cjs"),rt=require("../url-lnBE_6yf.cjs"),Ft=require("../css-value-parser/index.cjs");class Nt extends HTMLElement{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,i]of Object.entries(t))this.setAttribute(s,i)}}xt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Nt);var k,l,I,_,K;class mt{constructor(t,s){a(this,k);a(this,l);a(this,I);a(this,_,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,k).previousPathname)history.back();else{const d=e(this,l).getAttribute("data-history-action")||"push",v=e(this,l).hasAttribute("data-center-scroll"),b=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),S=b?Ft.cssValueParser.parse(b):void 0,E=e(this,l).hasAttribute("data-revalidate"),D=e(this,l).hasAttribute("data-keep-search-parameters"),lt=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(W=>W.trim()),f=e(this,l).hasAttribute("data-clear-state");e(this,k).navigate(e(this,I),{historyAction:d,centerScroll:v,offsetScroll:S,revalidate:E,keepSearchParameters:D,submorph:lt,clearState:f})}});a(this,K,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,k).prefetch(e(this,I),t),e(this,l).removeEventListener("pointerenter",e(this,K))});o(this,k,s),o(this,l,t),o(this,I,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,_)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,K))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,k).normalizePath(t),i=e(this,k).normalizePath(e(this,I));e(this,l).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,l).classList.add("current"):i.pathname===s.pathname?e(this,l).classList.add("current"):e(this,l).classList.remove("current")}destroy(){e(this,l).removeEventListener("click",e(this,_)),e(this,l).removeEventListener("pointerenter",e(this,K)),e(this,l).classList.remove("current")}}k=new WeakMap,l=new WeakMap,I=new WeakMap,_=new WeakMap,K=new WeakMap;var H,Y,w,O,B,x,G;class Ht{constructor(t,s,i){a(this,H);a(this,Y);a(this,w,{x:0,y:0});a(this,O);a(this,B,null);a(this,x,null);a(this,G,null);o(this,H,t),o(this,Y,s),o(this,O,i.cloneNode(!0))}get pathname(){return e(this,Y)}get scrollState(){return e(this,w)}get document(){return e(this,x)}cloneDocument(){o(this,x,(e(this,B)||e(this,O)).cloneNode(!0))}get title(){let t="";if(e(this,x).title)t=e(this,x).title;else{const s=e(this,x).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,Y)}return t}clearScrollState(){e(this,w).x=0,e(this,w).y=0}clearDocumentState(){o(this,B,null)}saveScrollState(){e(this,O).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,w).x=0,e(this,w).y=0):(e(this,w).x=e(this,H).scrollElement.scrollLeft,e(this,w).y=e(this,H).scrollElement.scrollTop)}restoreScrollPosition(){e(this,H).scrollElement.scroll({top:e(this,w).y,left:e(this,w).x,behavior:"instant"})}saveDocumentState(){e(this,O).documentElement.hasAttribute("data-no-page-restoration")?o(this,B,null):o(this,B,document.cloneNode(!0))}renewScrollPosition(){e(this,H).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){o(this,G,t)}clearState(){const t=e(this,G);return o(this,G,null),t}}H=new WeakMap,Y=new WeakMap,w=new WeakMap,O=new WeakMap,B=new WeakMap,x=new WeakMap,G=new WeakMap;var C,J,p,at,N,u,tt,F,T,P,q,V,et,c,nt,qt,pt,Dt,Et,gt,St,vt,ot,Q;const Z=class Z{constructor(t){a(this,c);a(this,C,null);a(this,J,null);a(this,p,[]);a(this,at,new DOMParser);a(this,N);a(this,u,null);a(this,tt);a(this,F,[]);a(this,T,!1);a(this,P,null);a(this,q,new Map);a(this,V,null);a(this,et,t=>{var s;return((s=t.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!t.hasAttribute("download")&&!t.hasAttribute("data-morph-skip")&&!t.closest("[data-morph-skip]")&&t.getAttribute("target")!=="_blank"});a(this,ot,t=>z(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),o(this,T,!0),yield this.navigate(t.state.path,{historyAction:"none"}),o(this,T,!1))}));a(this,Q,()=>{const t=e(this,P).scrollTop,s=e(this,P).scrollLeft;document.documentElement.classList.toggle("top-scrolled",t>0),document.documentElement.classList.toggle("left-scrolled",s>0),$.dispatchEvent(document,"morphScroll",{detail:{left:s,top:t}})});if(xt.isBrowser&&!Z.instance){Z.instance=this,o(this,C,{base:rt.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:(t==null?void 0:t.scrollSelector)||"body",morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),o(this,J,m(this,c,pt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);o(this,u,s.pathname),e(this,q).set(e(this,u),new Ht(this,e(this,u),document)),document.documentElement.setAttribute("data-current-pathname",e(this,u)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,ot)),rt.changeHistory({action:"replace",pathname:e(this,u),searchParameters:s.parameters||location.search,hash:s.hash}),o(this,V,new Nt),m(this,c,St).call(this,document)}}get currentPathname(){return e(this,u)}get previousPathname(){return e(this,tt)}get links(){return e(this,p)}get scrollElement(){return e(this,P)}get isPopstateNavigation(){return e(this,T)}saveState(t){const s=e(this,q).get(e(this,u));s&&s.saveState(t)}getState(){const t=e(this,q).get(e(this,u));return t==null?void 0:t.clearState()}normalizePath(t){return rt.splitPath(t,{base:e(this,C).base,trailingSlash:e(this,C).trailingSlash})}prefetch(t,s){return z(this,null,function*(){const i=this.normalizePath(t);m(this,c,nt).call(this,i.pathname,{searchParameters:i.parameters,revalidate:s})})}navigate(D){return z(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:d,revalidate:v,keepSearchParameters:b,submorph:S,clearState:E}={}){var wt;if(e(this,F).length)return;const lt=this.normalizePath(((wt=this.pathnameModifier)==null?void 0:wt.call(this,t))||t);let{pathname:f,hash:W,parameters:yt,leaf:Rt}=lt;if(e(this,N)===f||e(this,u)===f){e(this,T)||m(this,c,vt).call(this,W||0,{centerScroll:i,offsetScroll:d,behavior:"smooth"});return}o(this,N,f),e(this,p).forEach(j=>{j.checkCurrent(f)});try{let j=!0;if(this.preprocessor)try{yield new Promise((r,A)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:f,resolve:r,reject:A,submorph:S})})}catch(r){r?console.error(r):console.log("Route change canceled"),j=!1}if(!j||e(this,N)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,u))});return}const ct={pathname:f,submorph:S};$.dispatchEvent(document,"morphNavigation",{detail:ct});const ht=yield m(this,c,nt).call(this,e(this,u)),L=yield m(this,c,nt).call(this,f,{searchParameters:yt,revalidate:v});if(e(this,N)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,u))});return}ht.clearState(),ht.saveScrollState(),ht.saveDocumentState(),e(this,T)||(L.clearScrollState(),L.clearDocumentState()),E&&L.clearState(),L.cloneDocument(),e(this,V).textContent=L.title,document.body.appendChild(e(this,V)),$.dispatchEvent(document,"morphStart",{detail:ct});const bt=Array.from(document.head.children),Lt=Array.from(L.document.head.children),Pt=m(this,c,Dt).call(this,bt,Lt),zt=m(this,c,Et).call(this,bt,Pt),st=m(this,c,Et).call(this,Lt,Pt);st.forEach((r,A)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),st[A]=y}}),st.forEach(r=>{document.head.appendChild(r)});const ut=st.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(m(this,c,gt).call(this,r))return!0});e(this,C).waitForHeadToLoad&&ut.length&&(yield new Promise(r=>z(this,null,function*(){let A=0;try{for(var y=Tt(ut),X,R,U;X=!(R=yield y.next()).done;X=!1){const it=R.value;it.onload=()=>{A++,A===ut.length&&r()}}}catch(R){U=[R]}finally{try{X&&(R=y.return)&&(yield R.call(y))}finally{if(U)throw U[0]}}}))),yield Mt.wait(10);const At=[];zt.forEach(r=>{r.hasAttribute("data-permanent")||(m(this,c,gt).call(this,r)?At.push(r):r.remove())});const It=m(this,c,pt).call(this,L.document.body);e(this,C).morphInsideScrollContainer||m(this,c,St).call(this,L.document),document.documentElement.setAttribute("data-current-pathname",f),document.documentElement.setAttribute("data-current-leaf",Rt),rt.changeHistory({action:s,pathname:f,searchParameters:yt||(b?location.search:""),hash:W}),e(this,V).remove(),o(this,tt,e(this,u)),o(this,u,f),e(this,J).forEach((r,A)=>{const y=It[A],X=getComputedStyle(r).getPropertyValue("--morph-duration");let R=[],U=[];S?S.forEach(h=>{const g=r.querySelector(h),M=y.querySelector(h);g&&M&&(U.push(g),R.push(M))}):(R.push(...y.childNodes),U.push(...r.childNodes)),U.forEach(h=>{h instanceof HTMLElement&&(this.destroyOldLinks(h),h.classList.add("old"))}),R.forEach(h=>{h instanceof HTMLElement&&(this.findNewLinks(h),h.classList.add("new"))}),S?R.forEach((h,g)=>{var M;(M=U[g].parentElement)==null||M.insertBefore(h,U[g])}):r.prepend(...R),Bt.requestIdleCallback(()=>{R.forEach(h=>{var g;h instanceof HTMLElement&&((g=h.parentElement)==null||g.style.setProperty("--new-content-height",h.offsetHeight+"px"),h.classList.add("in"))})});const it={morphElement:r,pathname:f};$.dispatchEvent(document,"morphNewChildrenAdded",{detail:it});const Ot=new Promise(h=>{setTimeout(()=>{U.forEach(g=>g.remove()),R.forEach(g=>{var M;g instanceof HTMLElement&&((M=g.parentElement)==null||M.style.removeProperty("--new-content-height"),g.classList.remove("in","new"))}),$.dispatchEvent(document,"morphOldChildrenRemoved",{detail:it}),h()},(parseFloat(X)||0)*1e3+10)});e(this,F).push(Ot)}),W?(L.clearScrollState(),m(this,c,vt).call(this,W,{centerScroll:i,offsetScroll:d})):e(this,T)?L.restoreScrollPosition():L.renewScrollPosition(),yield Promise.all(e(this,F)),At.forEach(r=>r.remove()),o(this,F,[]),e(this,J).forEach(r=>{r.querySelectorAll("script").forEach(y=>{const X=document.createElement("script");X.type="module",X.src=y.getAttribute("src"),y.replaceWith(X)})}),$.dispatchEvent(document,"morphComplete",{detail:ct}),window.dispatchEvent(new Event("resize"))}catch(j){console.error(j)}o(this,N,void 0)})}addLink(t){e(this,p).push(new mt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){o(this,p,e(this,p).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){o(this,p,e(this,p).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,et));e(this,p).push(...s.map(i=>new mt(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,et));e(this,p).forEach(s=>s.destroy()),o(this,p,t.map(s=>new mt(s,this)))}};C=new WeakMap,J=new WeakMap,p=new WeakMap,at=new WeakMap,N=new WeakMap,u=new WeakMap,tt=new WeakMap,F=new WeakMap,T=new WeakMap,P=new WeakMap,q=new WeakMap,V=new WeakMap,et=new WeakMap,c=new WeakSet,nt=function(t,s){return z(this,null,function*(){let i=e(this,q).get(t);return(!i||s!=null&&s.revalidate)&&(i=yield m(this,c,qt).call(this,t,s==null?void 0:s.searchParameters)),i})},qt=function(t,s){return z(this,null,function*(){const d=yield(yield fetch(`${t}${s?"?"+s:""}`)).text(),v=e(this,at).parseFromString(d,"text/html"),b=new Ht(this,t,v);return e(this,q).set(t,b),b})},pt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Dt=function(t,s){return t.filter(i=>s.find(d=>d.outerHTML===i.outerHTML))},Et=function(t,s){return t.filter(i=>!s.find(d=>d.outerHTML===i.outerHTML))},gt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},St=function(t){var s,i;(s=e(this,P))==null||s.removeEventListener("scroll",e(this,Q)),o(this,P,t.querySelector(e(this,C).scrollSelector)||t.documentElement),(i=e(this,P))==null||i.addEventListener("scroll",e(this,Q)),e(this,Q).call(this)},vt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Mt.scrollToElement(i,{scrollElement:e(this,P),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ot=new WeakMap,Q=new WeakMap,Z.instance=null;let ft=Z;exports.Morph=ft;
|
|
1
|
+
"use strict";var kt=(n,t)=>(t=Symbol[n])?t:Symbol.for("Symbol."+n),Ct=n=>{throw TypeError(n)};var dt=(n,t,s)=>t.has(n)||Ct("Cannot "+s);var e=(n,t,s)=>(dt(n,t,"read from private field"),s?s.call(n):t.get(n)),a=(n,t,s)=>t.has(n)?Ct("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,s),o=(n,t,s,i)=>(dt(n,t,"write to private field"),i?i.call(n,s):t.set(n,s),s),m=(n,t,s)=>(dt(n,t,"access private method"),s);var z=(n,t,s)=>new Promise((i,d)=>{var v=E=>{try{S(s.next(E))}catch(D){d(D)}},b=E=>{try{S(s.throw(E))}catch(D){d(D)}},S=E=>E.done?i(E.value):Promise.resolve(E.value).then(v,b);S((s=s.apply(n,t)).next())});var Tt=(n,t,s)=>(t=n[kt("asyncIterator")])?t.call(n):(n=n[kt("iterator")](),t={},s=(i,d)=>(d=n[i])&&(t[i]=v=>new Promise((b,S,E)=>(v=d.call(n,v),E=v.done,Promise.resolve(v.value).then(D=>b({value:D,done:E}),S)))),s("next"),s("return"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const xt=require("../index-DekP7OZe.cjs"),$=require("../events-KVanG9sR.cjs"),Bt=require("../polyfills-Df4r-ETT.cjs"),Mt=require("../scroll-CFDCeArT.cjs");require("construct-style-sheets-polyfill");const rt=require("../url-lnBE_6yf.cjs"),Ft=require("../css-value-parser/index.cjs");class Nt extends HTMLElement{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,i]of Object.entries(t))this.setAttribute(s,i)}}xt.isBrowser&&!customElements.get("morph-announcer")&&customElements.define("morph-announcer",Nt);var k,l,I,_,K;class mt{constructor(t,s){a(this,k);a(this,l);a(this,I);a(this,_,t=>{var i;if(t.preventDefault(),e(this,l).hasAttribute("data-back")&&e(this,k).previousPathname)history.back();else{const d=e(this,l).getAttribute("data-history-action")||"push",v=e(this,l).hasAttribute("data-center-scroll"),b=getComputedStyle(e(this,l)).getPropertyValue("--offset-scroll").trim(),S=b?Ft.cssValueParser.parse(b):void 0,E=e(this,l).hasAttribute("data-revalidate"),D=e(this,l).hasAttribute("data-keep-search-parameters"),lt=(i=e(this,l).getAttribute("data-submorph"))==null?void 0:i.split(",").map(W=>W.trim()),f=e(this,l).hasAttribute("data-clear-state");e(this,k).navigate(e(this,I),{historyAction:d,centerScroll:v,offsetScroll:S,revalidate:E,keepSearchParameters:D,submorph:lt,clearState:f})}});a(this,K,()=>{const t=e(this,l).hasAttribute("data-revalidate");e(this,k).prefetch(e(this,I),t),e(this,l).removeEventListener("pointerenter",e(this,K))});o(this,k,s),o(this,l,t),o(this,I,e(this,l).getAttribute("href")||"/"),e(this,l).addEventListener("click",e(this,_)),this.checkCurrent(location.pathname),e(this,l).hasAttribute("data-prefetch")&&e(this,l).addEventListener("pointerenter",e(this,K))}get element(){return e(this,l)}checkCurrent(t){const s=e(this,k).normalizePath(t),i=e(this,k).normalizePath(e(this,I));e(this,l).hasAttribute("data-include")&&s.pathname.includes(i.pathname)?e(this,l).classList.add("current"):i.pathname===s.pathname?e(this,l).classList.add("current"):e(this,l).classList.remove("current")}destroy(){e(this,l).removeEventListener("click",e(this,_)),e(this,l).removeEventListener("pointerenter",e(this,K)),e(this,l).classList.remove("current")}}k=new WeakMap,l=new WeakMap,I=new WeakMap,_=new WeakMap,K=new WeakMap;var H,Y,w,O,B,x,G;class Ht{constructor(t,s,i){a(this,H);a(this,Y);a(this,w,{x:0,y:0});a(this,O);a(this,B,null);a(this,x,null);a(this,G,null);o(this,H,t),o(this,Y,s),o(this,O,i.cloneNode(!0))}get pathname(){return e(this,Y)}get scrollState(){return e(this,w)}get document(){return e(this,x)}cloneDocument(){o(this,x,(e(this,B)||e(this,O)).cloneNode(!0))}get title(){let t="";if(e(this,x).title)t=e(this,x).title;else{const s=e(this,x).querySelector("h1");t=(s==null?void 0:s.innerText)||(s==null?void 0:s.textContent)||e(this,Y)}return t}clearScrollState(){e(this,w).x=0,e(this,w).y=0}clearDocumentState(){o(this,B,null)}saveScrollState(){e(this,O).documentElement.hasAttribute("data-no-scroll-restoration")?(e(this,w).x=0,e(this,w).y=0):(e(this,w).x=e(this,H).scrollElement.scrollLeft,e(this,w).y=e(this,H).scrollElement.scrollTop)}restoreScrollPosition(){e(this,H).scrollElement.scroll({top:e(this,w).y,left:e(this,w).x,behavior:"instant"})}saveDocumentState(){e(this,O).documentElement.hasAttribute("data-no-page-restoration")?o(this,B,null):o(this,B,document.cloneNode(!0))}renewScrollPosition(){e(this,H).scrollElement.scroll({top:0,left:0,behavior:"instant"})}saveState(t){o(this,G,t)}clearState(){const t=e(this,G);return o(this,G,null),t}}H=new WeakMap,Y=new WeakMap,w=new WeakMap,O=new WeakMap,B=new WeakMap,x=new WeakMap,G=new WeakMap;var C,J,p,at,N,u,tt,F,T,P,q,V,et,c,nt,qt,pt,Dt,Et,gt,St,vt,ot,Q;const Z=class Z{constructor(t){a(this,c);a(this,C,null);a(this,J,null);a(this,p,[]);a(this,at,new DOMParser);a(this,N);a(this,u,null);a(this,tt);a(this,F,[]);a(this,T,!1);a(this,P,null);a(this,q,new Map);a(this,V,null);a(this,et,t=>{var s;return((s=t.getAttribute("href"))==null?void 0:s.startsWith("/"))&&!t.hasAttribute("download")&&!t.hasAttribute("data-morph-skip")&&!t.closest("[data-morph-skip]")&&t.getAttribute("target")!=="_blank"});a(this,ot,t=>z(this,null,function*(){var s;(s=t.state)!=null&&s.path&&(t.preventDefault(),o(this,T,!0),yield this.navigate(t.state.path,{historyAction:"none"}),o(this,T,!1))}));a(this,Q,()=>{const t=e(this,P).scrollTop,s=e(this,P).scrollLeft;document.documentElement.classList.toggle("top-scrolled",t>0),document.documentElement.classList.toggle("left-scrolled",s>0),$.dispatchEvent(document,"morphScroll",{detail:{left:s,top:t}})});if(xt.isBrowser&&!Z.instance){Z.instance=this,o(this,C,{base:rt.normalizeBase(t==null?void 0:t.base),waitForHeadToLoad:(t==null?void 0:t.waitForHeadToLoad)!==!1,cachePages:(t==null?void 0:t.cachePages)!==!1,trailingSlash:(t==null?void 0:t.trailingSlash)||!1,scrollSelector:(t==null?void 0:t.scrollSelector)||"body",morphInsideScrollContainer:(t==null?void 0:t.morphInsideScrollContainer)||!1}),o(this,J,m(this,c,pt).call(this,document.body));const s=this.normalizePath(location.pathname+location.hash);o(this,u,s.pathname),e(this,q).set(e(this,u),new Ht(this,e(this,u),document)),document.documentElement.setAttribute("data-current-pathname",e(this,u)),document.documentElement.setAttribute("data-current-leaf",s.leaf),this.findLinks(),addEventListener("popstate",e(this,ot)),rt.changeHistory({action:"replace",pathname:e(this,u),searchParameters:s.parameters||location.search,hash:s.hash}),o(this,V,new Nt),m(this,c,St).call(this,document)}}get currentPathname(){return e(this,u)}get previousPathname(){return e(this,tt)}get links(){return e(this,p)}get scrollElement(){return e(this,P)}get isPopstateNavigation(){return e(this,T)}saveState(t){const s=e(this,q).get(e(this,u));s&&s.saveState(t)}getState(){const t=e(this,q).get(e(this,u));return t==null?void 0:t.clearState()}normalizePath(t){return rt.splitPath(t,{base:e(this,C).base,trailingSlash:e(this,C).trailingSlash})}prefetch(t,s){return z(this,null,function*(){const i=this.normalizePath(t);m(this,c,nt).call(this,i.pathname,{searchParameters:i.parameters,revalidate:s})})}navigate(D){return z(this,arguments,function*(t,{historyAction:s="push",centerScroll:i,offsetScroll:d,revalidate:v,keepSearchParameters:b,submorph:S,clearState:E}={}){var wt;if(e(this,F).length)return;const lt=this.normalizePath(((wt=this.pathnameModifier)==null?void 0:wt.call(this,t))||t);let{pathname:f,hash:W,parameters:yt,leaf:Rt}=lt;if(e(this,N)===f||e(this,u)===f){e(this,T)||m(this,c,vt).call(this,W||0,{centerScroll:i,offsetScroll:d,behavior:"smooth"});return}o(this,N,f),e(this,p).forEach(j=>{j.checkCurrent(f)});try{let j=!0;if(this.preprocessor)try{yield new Promise((r,A)=>{var y;(y=this.preprocessor)==null||y.call(this,{pathname:f,resolve:r,reject:A,submorph:S})})}catch(r){r?console.error(r):console.log("Route change canceled"),j=!1}if(!j||e(this,N)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,u))});return}const ct={pathname:f,submorph:S};$.dispatchEvent(document,"morphNavigation",{detail:ct});const ht=yield m(this,c,nt).call(this,e(this,u)),L=yield m(this,c,nt).call(this,f,{searchParameters:yt,revalidate:v});if(e(this,N)!==f){e(this,p).forEach(r=>{r.checkCurrent(e(this,u))});return}ht.clearState(),ht.saveScrollState(),ht.saveDocumentState(),e(this,T)||(L.clearScrollState(),L.clearDocumentState()),E&&L.clearState(),L.cloneDocument(),e(this,V).textContent=L.title,document.body.appendChild(e(this,V)),$.dispatchEvent(document,"morphStart",{detail:ct});const bt=Array.from(document.head.children),Lt=Array.from(L.document.head.children),Pt=m(this,c,Dt).call(this,bt,Lt),zt=m(this,c,Et).call(this,bt,Pt),st=m(this,c,Et).call(this,Lt,Pt);st.forEach((r,A)=>{if(r.tagName==="SCRIPT"&&r.getAttribute("src")){const y=document.createElement("script");y.type="module",y.src=r.getAttribute("src"),st[A]=y}}),st.forEach(r=>{document.head.appendChild(r)});const ut=st.filter(r=>{if(r.hasAttribute("data-no-waiting"))return!1;if(m(this,c,gt).call(this,r))return!0});e(this,C).waitForHeadToLoad&&ut.length&&(yield new Promise(r=>z(this,null,function*(){let A=0;try{for(var y=Tt(ut),X,R,U;X=!(R=yield y.next()).done;X=!1){const it=R.value;it.onload=()=>{A++,A===ut.length&&r()}}}catch(R){U=[R]}finally{try{X&&(R=y.return)&&(yield R.call(y))}finally{if(U)throw U[0]}}}))),yield Mt.wait(10);const At=[];zt.forEach(r=>{r.hasAttribute("data-permanent")||(m(this,c,gt).call(this,r)?At.push(r):r.remove())});const It=m(this,c,pt).call(this,L.document.body);e(this,C).morphInsideScrollContainer||m(this,c,St).call(this,L.document),document.documentElement.setAttribute("data-current-pathname",f),document.documentElement.setAttribute("data-current-leaf",Rt),rt.changeHistory({action:s,pathname:f,searchParameters:yt||(b?location.search:""),hash:W}),e(this,V).remove(),o(this,tt,e(this,u)),o(this,u,f),e(this,J).forEach((r,A)=>{const y=It[A],X=getComputedStyle(r).getPropertyValue("--morph-duration");let R=[],U=[];S?S.forEach(h=>{const g=r.querySelector(h),M=y.querySelector(h);g&&M&&(U.push(g),R.push(M))}):(R.push(...y.childNodes),U.push(...r.childNodes)),U.forEach(h=>{h instanceof HTMLElement&&(this.destroyOldLinks(h),h.classList.add("old"))}),R.forEach(h=>{h instanceof HTMLElement&&(this.findNewLinks(h),h.classList.add("new"))}),S?R.forEach((h,g)=>{var M;(M=U[g].parentElement)==null||M.insertBefore(h,U[g])}):r.prepend(...R),Bt.requestIdleCallback(()=>{R.forEach(h=>{var g;h instanceof HTMLElement&&((g=h.parentElement)==null||g.style.setProperty("--new-content-height",h.offsetHeight+"px"),h.classList.add("in"))})});const it={morphElement:r,pathname:f};$.dispatchEvent(document,"morphNewChildrenAdded",{detail:it});const Ot=new Promise(h=>{setTimeout(()=>{U.forEach(g=>g.remove()),R.forEach(g=>{var M;g instanceof HTMLElement&&((M=g.parentElement)==null||M.style.removeProperty("--new-content-height"),g.classList.remove("in","new"))}),$.dispatchEvent(document,"morphOldChildrenRemoved",{detail:it}),h()},(parseFloat(X)||0)*1e3+10)});e(this,F).push(Ot)}),W?(L.clearScrollState(),m(this,c,vt).call(this,W,{centerScroll:i,offsetScroll:d})):e(this,T)?L.restoreScrollPosition():L.renewScrollPosition(),yield Promise.all(e(this,F)),At.forEach(r=>r.remove()),o(this,F,[]),e(this,J).forEach(r=>{r.querySelectorAll("script").forEach(y=>{const X=document.createElement("script");X.type="module",X.src=y.getAttribute("src"),y.replaceWith(X)})}),$.dispatchEvent(document,"morphComplete",{detail:ct}),window.dispatchEvent(new Event("resize"))}catch(j){console.error(j)}o(this,N,void 0)})}addLink(t){e(this,p).push(new mt(t,this))}addLinks(t){t.forEach(s=>{this.addLink(s)})}removeLink(t){o(this,p,e(this,p).filter(s=>s.element===t?(s.destroy(),!1):!0))}destroyOldLinks(t){o(this,p,e(this,p).filter(s=>t.contains(s.element)?(s.destroy(),!1):!0))}findNewLinks(t){const s=[...t.querySelectorAll("a")].filter(e(this,et));e(this,p).push(...s.map(i=>new mt(i,this)))}findLinks(){const t=[...document.documentElement.querySelectorAll("a")].filter(e(this,et));e(this,p).forEach(s=>s.destroy()),o(this,p,t.map(s=>new mt(s,this)))}};C=new WeakMap,J=new WeakMap,p=new WeakMap,at=new WeakMap,N=new WeakMap,u=new WeakMap,tt=new WeakMap,F=new WeakMap,T=new WeakMap,P=new WeakMap,q=new WeakMap,V=new WeakMap,et=new WeakMap,c=new WeakSet,nt=function(t,s){return z(this,null,function*(){let i=e(this,q).get(t);return(!i||s!=null&&s.revalidate)&&(i=yield m(this,c,qt).call(this,t,s==null?void 0:s.searchParameters)),i})},qt=function(t,s){return z(this,null,function*(){const d=yield(yield fetch(`${t}${s?"?"+s:""}`)).text(),v=e(this,at).parseFromString(d,"text/html"),b=new Ht(this,t,v);return e(this,q).set(t,b),b})},pt=function(t){const s=[...t.querySelectorAll("[data-morph]")];return s.length?s:[t]},Dt=function(t,s){return t.filter(i=>s.find(d=>d.outerHTML===i.outerHTML))},Et=function(t,s){return t.filter(i=>!s.find(d=>d.outerHTML===i.outerHTML))},gt=function(t){return t.tagName==="SCRIPT"||t.tagName==="STYLE"||t.tagName==="LINK"&&t.getAttribute("rel")==="stylesheet"},St=function(t){var s,i;(s=e(this,P))==null||s.removeEventListener("scroll",e(this,Q)),o(this,P,t.querySelector(e(this,C).scrollSelector)||t.documentElement),(i=e(this,P))==null||i.addEventListener("scroll",e(this,Q)),e(this,Q).call(this)},vt=function(t,s){const i=typeof t=="string"?document.getElementById(t):t;(typeof i=="number"||i)&&Mt.scrollToElement(i,{scrollElement:e(this,P),behavior:(s==null?void 0:s.behavior)||"instant",center:s==null?void 0:s.centerScroll,offset:s==null?void 0:s.offsetScroll})},ot=new WeakMap,Q=new WeakMap,Z.instance=null;let ft=Z;exports.Morph=ft;
|
package/lib/morph/index.js
CHANGED
|
@@ -20,10 +20,11 @@ var z = (n, t, s) => new Promise((i, d) => {
|
|
|
20
20
|
S((s = s.apply(n, t)).next());
|
|
21
21
|
});
|
|
22
22
|
var kt = (n, t, s) => (t = n[Pt("asyncIterator")]) ? t.call(n) : (n = n[Pt("iterator")](), t = {}, s = (i, d) => (d = n[i]) && (t[i] = (v) => new Promise((L, S, E) => (v = d.call(n, v), E = v.done, Promise.resolve(v.value).then((R) => L({ value: R, done: E }), S)))), s("next"), s("return"), t);
|
|
23
|
-
import { i as Ht } from "../index-
|
|
23
|
+
import { i as Ht } from "../index-Bv9zgfdb.js";
|
|
24
24
|
import { d as j } from "../events-CsVF98U6.js";
|
|
25
25
|
import { r as Ft } from "../polyfills-DJrTJQky.js";
|
|
26
|
-
import { w as Ot, s as Bt } from "../scroll-
|
|
26
|
+
import { w as Ot, s as Bt } from "../scroll-BWF48oHS.js";
|
|
27
|
+
import "construct-style-sheets-polyfill";
|
|
27
28
|
import { n as Vt, c as Ct, s as Wt } from "../url-Cc-RVfii.js";
|
|
28
29
|
import { cssValueParser as Ut } from "../css-value-parser/index.js";
|
|
29
30
|
class Nt extends HTMLElement {
|