@manyducks.co/dolla 2.0.0-alpha.15 → 2.0.0-alpha.16
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/dist/index.js +79 -78
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/{passthrough-CBbog_A9.js → passthrough-DUh0_zQF.js} +203 -238
- package/dist/passthrough-DUh0_zQF.js.map +1 -0
- package/dist/state.d.ts +4 -3
- package/package.json +1 -1
- package/dist/passthrough-CBbog_A9.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Lt = Object.defineProperty;
|
|
2
|
+
var ct = (i) => {
|
|
3
3
|
throw TypeError(i);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var S = (i, e, t) =>
|
|
7
|
-
var s = (i, e, t) => (Je(i, e, "read from private field"), t ? t.call(i) : e.get(i)), f = (i, e, t) => e.has(i) ?
|
|
8
|
-
var
|
|
5
|
+
var xt = (i, e, t) => e in i ? Lt(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
6
|
+
var S = (i, e, t) => xt(i, typeof e != "symbol" ? e + "" : e, t), Je = (i, e, t) => e.has(i) || ct("Cannot " + t);
|
|
7
|
+
var s = (i, e, t) => (Je(i, e, "read from private field"), t ? t.call(i) : e.get(i)), f = (i, e, t) => e.has(i) ? ct("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), b = (i, e, t, r) => (Je(i, e, "write to private field"), r ? r.call(i, t) : e.set(i, t), t), E = (i, e, t) => (Je(i, e, "access private method"), t);
|
|
8
|
+
var ut = (i, e, t, r) => ({
|
|
9
9
|
set _(a) {
|
|
10
10
|
b(i, e, a, t);
|
|
11
11
|
},
|
|
@@ -13,10 +13,10 @@ var ct = (i, e, t, r) => ({
|
|
|
13
13
|
return s(i, e, r);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { h as
|
|
17
|
-
import { B as dr, C as pr, D as mr } from "./passthrough-
|
|
16
|
+
import { h as ht, c as Rt, i as Ye, a as ie, d as ye, b as Xe, e as lt, f as V, t as ft, g as bt, j as Ot, k as Ze, P as vt, l as dt, m as Nt, n as Mt, o as pt, v as Tt, p as Dt, q as At, r as mt, s as gt, u as _t, w as Ce, x as Fe, y as jt, z as Ct, A as Ft } from "./passthrough-DUh0_zQF.js";
|
|
17
|
+
import { B as dr, C as pr, D as mr } from "./passthrough-DUh0_zQF.js";
|
|
18
18
|
function Vt(i) {
|
|
19
|
-
return
|
|
19
|
+
return ht`
|
|
20
20
|
<div
|
|
21
21
|
style=${{
|
|
22
22
|
backgroundColor: "#880000",
|
|
@@ -30,7 +30,7 @@ function Vt(i) {
|
|
|
30
30
|
<h1 style=${{ marginBottom: "0.5rem" }}>The app has crashed</h1>
|
|
31
31
|
<p style=${{ marginBottom: "0.25rem" }}>
|
|
32
32
|
<span style=${{ fontFamily: "monospace" }}>${i.loggerName}</span>
|
|
33
|
-
${
|
|
33
|
+
${Rt(i.uid, ht`<span style=${{ fontFamily: "monospace", opacity: 0.5 }}> [uid: ${i.uid}]</span>`)}
|
|
34
34
|
${" "}says:
|
|
35
35
|
</p>
|
|
36
36
|
<blockquote
|
|
@@ -196,7 +196,7 @@ async function It(i) {
|
|
|
196
196
|
throw new Ht(o);
|
|
197
197
|
return o;
|
|
198
198
|
}
|
|
199
|
-
var Ke, oe, re,
|
|
199
|
+
var Ke, oe, re, et, $t;
|
|
200
200
|
class Wt {
|
|
201
201
|
constructor(e, t) {
|
|
202
202
|
f(this, re);
|
|
@@ -209,7 +209,7 @@ class Wt {
|
|
|
209
209
|
async load() {
|
|
210
210
|
let e;
|
|
211
211
|
if (!s(this, Ke)) {
|
|
212
|
-
if (
|
|
212
|
+
if (lt(this.config.fetch)) {
|
|
213
213
|
if (e = await this.config.fetch(), !Ye(e))
|
|
214
214
|
throw new Error(`Fetch function did not return an object of language strings: ${e}`);
|
|
215
215
|
} else if (V(this.config.path)) {
|
|
@@ -226,7 +226,7 @@ class Wt {
|
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
if (e) {
|
|
229
|
-
const t = E(this, re,
|
|
229
|
+
const t = E(this, re, et).call(this, e);
|
|
230
230
|
for (const r of t)
|
|
231
231
|
s(this, oe).set(r[0], r[1]);
|
|
232
232
|
} else
|
|
@@ -241,23 +241,23 @@ class Wt {
|
|
|
241
241
|
return s(this, oe).has(e);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
Ke = new WeakMap(), oe = new WeakMap(), re = new WeakSet(),
|
|
244
|
+
Ke = new WeakMap(), oe = new WeakMap(), re = new WeakSet(), et = function(e, t = []) {
|
|
245
245
|
const r = [];
|
|
246
246
|
for (const a in e)
|
|
247
|
-
switch (
|
|
247
|
+
switch (ft(e[a])) {
|
|
248
248
|
case "string":
|
|
249
|
-
r.push([[...t, a].join("."), E(this, re,
|
|
249
|
+
r.push([[...t, a].join("."), E(this, re, $t).call(this, e[a])]);
|
|
250
250
|
break;
|
|
251
251
|
case "object":
|
|
252
|
-
r.push(...E(this, re,
|
|
252
|
+
r.push(...E(this, re, et).call(this, e[a], [...t, a]));
|
|
253
253
|
break;
|
|
254
254
|
default:
|
|
255
255
|
throw new Error(
|
|
256
|
-
`Expected to find a string or object at ${[...t, a].join(".")}. Got: ${
|
|
256
|
+
`Expected to find a string or object at ${[...t, a].join(".")}. Got: ${ft(e[a])}`
|
|
257
257
|
);
|
|
258
258
|
}
|
|
259
259
|
return r;
|
|
260
|
-
},
|
|
260
|
+
}, $t = function(e) {
|
|
261
261
|
let t;
|
|
262
262
|
((u) => {
|
|
263
263
|
u[u.Static = 0] = "Static", u[u.ValueName = 1] = "ValueName", u[u.FormatName = 2] = "FormatName", u[u.FormatOptionName = 3] = "FormatOptionName", u[u.FormatOptionValue = 4] = "FormatOptionValue", u[u.FormatOptionEnd = 5] = "FormatOptionEnd";
|
|
@@ -306,7 +306,7 @@ Ke = new WeakMap(), oe = new WeakMap(), re = new WeakSet(), Ze = function(e, t =
|
|
|
306
306
|
}
|
|
307
307
|
return o === 0 && a.length > 0 && r.segments.push({ type: 0, text: a }), r;
|
|
308
308
|
};
|
|
309
|
-
var ve, q, R, $e, Ee, ke, Pe, O,
|
|
309
|
+
var ve, q, R, $e, Ee, ke, Pe, O, Et, tt, rt, nt, kt;
|
|
310
310
|
class Gt {
|
|
311
311
|
constructor(e) {
|
|
312
312
|
f(this, O);
|
|
@@ -320,7 +320,7 @@ class Gt {
|
|
|
320
320
|
f(this, Pe);
|
|
321
321
|
b(this, ve, e), b(this, q, e.createLogger("dolla/i18n"));
|
|
322
322
|
const [t, r] = ie();
|
|
323
|
-
this.$locale = t, b(this, Pe, r), this.addFormat("number", (a, n, o) => E(this, O,
|
|
323
|
+
this.$locale = t, b(this, Pe, r), this.addFormat("number", (a, n, o) => E(this, O, tt).call(this, Number(n), o)), this.addFormat("datetime", (a, n, o) => E(this, O, rt).call(this, n, o)), this.addFormat("list", (a, n, o) => E(this, O, nt).call(this, n, o)), e.beforeMount(async () => {
|
|
324
324
|
s(this, R).size > 0 && await this.setLocale(s(this, ke));
|
|
325
325
|
});
|
|
326
326
|
}
|
|
@@ -388,7 +388,7 @@ class Gt {
|
|
|
388
388
|
const h = {};
|
|
389
389
|
for (let l = 0; l < o.length; l++)
|
|
390
390
|
h[r[l]] = o[l];
|
|
391
|
-
return E(this, O,
|
|
391
|
+
return E(this, O, Et).call(this, n, e, h);
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
/**
|
|
@@ -423,7 +423,7 @@ class Gt {
|
|
|
423
423
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
|
|
424
424
|
*/
|
|
425
425
|
number(e, t) {
|
|
426
|
-
return ye([this.$locale, e], (r, a) => E(this, O,
|
|
426
|
+
return ye([this.$locale, e], (r, a) => E(this, O, tt).call(this, a, t));
|
|
427
427
|
}
|
|
428
428
|
/**
|
|
429
429
|
* Returns a State containing the date formatted for the current locale. Uses `Intl.DateTimeFormat` under the hood.
|
|
@@ -435,7 +435,7 @@ class Gt {
|
|
|
435
435
|
* const $formatted = Dolla.i18n.dateTime(date, { dateFormat: "short" });
|
|
436
436
|
*/
|
|
437
437
|
dateTime(e, t) {
|
|
438
|
-
return ye([this.$locale, e], (r, a) => E(this, O,
|
|
438
|
+
return ye([this.$locale, e], (r, a) => E(this, O, rt).call(this, a, t));
|
|
439
439
|
}
|
|
440
440
|
/**
|
|
441
441
|
* Returns a State containing the date formatted for the current locale. Uses `Intl.DateTimeFormat` under the hood.
|
|
@@ -447,12 +447,12 @@ class Gt {
|
|
|
447
447
|
* const $formatted = Dolla.i18n.list(list, { });
|
|
448
448
|
*/
|
|
449
449
|
list(e, t) {
|
|
450
|
-
return ye([this.$locale, e], (r, a) => E(this, O,
|
|
450
|
+
return ye([this.$locale, e], (r, a) => E(this, O, nt).call(this, a, t));
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
ve = new WeakMap(), q = new WeakMap(), R = new WeakMap(), $e = new WeakMap(), Ee = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), O = new WeakSet(),
|
|
453
|
+
ve = new WeakMap(), q = new WeakMap(), R = new WeakMap(), $e = new WeakMap(), Ee = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), O = new WeakSet(), Et = function(e, t, r) {
|
|
454
454
|
var l;
|
|
455
|
-
const a = E(this, O,
|
|
455
|
+
const a = E(this, O, kt).call(this, t, r);
|
|
456
456
|
if (a) return a;
|
|
457
457
|
const n = s(this, R).get(e);
|
|
458
458
|
if (r.context != null && (t += "_" + r.context), r.count != null)
|
|
@@ -485,19 +485,19 @@ ve = new WeakMap(), q = new WeakMap(), R = new WeakMap(), $e = new WeakMap(), Ee
|
|
|
485
485
|
h += g;
|
|
486
486
|
}
|
|
487
487
|
return h;
|
|
488
|
-
}, et = function(e, t) {
|
|
489
|
-
return new Intl.NumberFormat(this.$locale.get(), t).format(e);
|
|
490
488
|
}, tt = function(e, t) {
|
|
489
|
+
return new Intl.NumberFormat(this.$locale.get(), t).format(e);
|
|
490
|
+
}, rt = function(e, t) {
|
|
491
491
|
return new Intl.DateTimeFormat(this.$locale.get(), t).format(
|
|
492
492
|
typeof e == "string" ? new Date(e) : e
|
|
493
493
|
);
|
|
494
|
-
},
|
|
494
|
+
}, nt = function(e, t) {
|
|
495
495
|
return new Intl.ListFormat(this.$locale.get(), t).format(e);
|
|
496
496
|
}, // relativeTime(): State<string> {
|
|
497
497
|
// }
|
|
498
|
-
|
|
498
|
+
kt = function(e, t) {
|
|
499
499
|
for (const r of s(this, $e))
|
|
500
|
-
if (r[0] === e &&
|
|
500
|
+
if (r[0] === e && Xe(r[1], t))
|
|
501
501
|
return r[2];
|
|
502
502
|
};
|
|
503
503
|
function Bt(i, e) {
|
|
@@ -597,7 +597,7 @@ function qe(i, e) {
|
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
var We = "beforeunload", Kt = "hashchange",
|
|
600
|
+
var We = "beforeunload", Kt = "hashchange", Pt = "popstate";
|
|
601
601
|
function Qt(i) {
|
|
602
602
|
i === void 0 && (i = {});
|
|
603
603
|
var e = i, t = e.window, r = t === void 0 ? document.defaultView : t, a = r.history;
|
|
@@ -639,7 +639,7 @@ function Qt(i) {
|
|
|
639
639
|
ne(w);
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
r.addEventListener(
|
|
642
|
+
r.addEventListener(Pt, h);
|
|
643
643
|
var l = A.Pop, d = n(), g = d[0], m = d[1], u = Be(), y = Be();
|
|
644
644
|
g == null && (g = 0, a.replaceState(de({}, a.state, {
|
|
645
645
|
idx: g
|
|
@@ -652,9 +652,9 @@ function Qt(i) {
|
|
|
652
652
|
pathname: m.pathname,
|
|
653
653
|
hash: "",
|
|
654
654
|
search: ""
|
|
655
|
-
}, typeof w == "string" ?
|
|
655
|
+
}, typeof w == "string" ? at(w) : w, {
|
|
656
656
|
state: c,
|
|
657
|
-
key:
|
|
657
|
+
key: St()
|
|
658
658
|
}));
|
|
659
659
|
}
|
|
660
660
|
function me(w, c) {
|
|
@@ -740,7 +740,7 @@ function Jt(i) {
|
|
|
740
740
|
i === void 0 && (i = {});
|
|
741
741
|
var e = i, t = e.window, r = t === void 0 ? document.defaultView : t, a = r.history;
|
|
742
742
|
function n() {
|
|
743
|
-
var c =
|
|
743
|
+
var c = at(r.location.hash.substr(1)), p = c.pathname, v = p === void 0 ? "/" : p, $ = c.search, L = $ === void 0 ? "" : $, N = c.hash, D = N === void 0 ? "" : N, _ = a.state || {};
|
|
744
744
|
return [_.idx, Ie({
|
|
745
745
|
pathname: v,
|
|
746
746
|
search: L,
|
|
@@ -777,7 +777,7 @@ function Jt(i) {
|
|
|
777
777
|
ae(c);
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
|
-
r.addEventListener(
|
|
780
|
+
r.addEventListener(Pt, h), r.addEventListener(Kt, function() {
|
|
781
781
|
var c = n(), p = c[1];
|
|
782
782
|
Ue(p) !== Ue(m) && h();
|
|
783
783
|
});
|
|
@@ -801,9 +801,9 @@ function Jt(i) {
|
|
|
801
801
|
pathname: m.pathname,
|
|
802
802
|
hash: "",
|
|
803
803
|
search: ""
|
|
804
|
-
}, typeof c == "string" ?
|
|
804
|
+
}, typeof c == "string" ? at(c) : c, {
|
|
805
805
|
state: p,
|
|
806
|
-
key:
|
|
806
|
+
key: St()
|
|
807
807
|
}));
|
|
808
808
|
}
|
|
809
809
|
function ge(c, p) {
|
|
@@ -908,14 +908,14 @@ function Be() {
|
|
|
908
908
|
}
|
|
909
909
|
};
|
|
910
910
|
}
|
|
911
|
-
function
|
|
911
|
+
function St() {
|
|
912
912
|
return Math.random().toString(36).substr(2, 8);
|
|
913
913
|
}
|
|
914
914
|
function Ue(i) {
|
|
915
915
|
var e = i.pathname, t = e === void 0 ? "/" : e, r = i.search, a = r === void 0 ? "" : r, n = i.hash, o = n === void 0 ? "" : n;
|
|
916
916
|
return a && a !== "?" && (t += a.charAt(0) === "?" ? a : "?" + a), o && o !== "#" && (t += o.charAt(0) === "#" ? o : "#" + o), t;
|
|
917
917
|
}
|
|
918
|
-
function
|
|
918
|
+
function at(i) {
|
|
919
919
|
var e = {};
|
|
920
920
|
if (i) {
|
|
921
921
|
var t = i.indexOf("#");
|
|
@@ -926,12 +926,12 @@ function nt(i) {
|
|
|
926
926
|
return e;
|
|
927
927
|
}
|
|
928
928
|
function be(i) {
|
|
929
|
-
return
|
|
929
|
+
return bt(i, "Expected `path` to be a string. Got type: %t, value: %v"), i.split("/").map((e) => e.trim()).filter((e) => e !== "");
|
|
930
930
|
}
|
|
931
931
|
function se(i) {
|
|
932
932
|
var t;
|
|
933
933
|
Ot(
|
|
934
|
-
(r) =>
|
|
934
|
+
(r) => lt(r == null ? void 0 : r.toString),
|
|
935
935
|
i,
|
|
936
936
|
"Expected `parts` to be an array of objects with a .toString() method. Got type: %t, value: %v"
|
|
937
937
|
), i = i.filter((r) => r).flatMap(String);
|
|
@@ -944,7 +944,7 @@ function se(i) {
|
|
|
944
944
|
return e ?? "";
|
|
945
945
|
}
|
|
946
946
|
function He(i, e) {
|
|
947
|
-
if (
|
|
947
|
+
if (bt(i, "Expected `base` to be a string. Got type: %t, value: %v"), e == null && (e = i, i = ""), e.startsWith("/"))
|
|
948
948
|
return e;
|
|
949
949
|
let t = i;
|
|
950
950
|
for (; ; )
|
|
@@ -960,7 +960,7 @@ function He(i, e) {
|
|
|
960
960
|
break;
|
|
961
961
|
return se([t, e]);
|
|
962
962
|
}
|
|
963
|
-
function
|
|
963
|
+
function st(i) {
|
|
964
964
|
if (!i) return {};
|
|
965
965
|
i.startsWith("?") && (i = i.slice(1));
|
|
966
966
|
const e = i.split("&").filter((t) => t.trim() !== "").map((t) => {
|
|
@@ -969,7 +969,7 @@ function at(i) {
|
|
|
969
969
|
});
|
|
970
970
|
return Object.fromEntries(e);
|
|
971
971
|
}
|
|
972
|
-
function
|
|
972
|
+
function wt(i, e, t = {}) {
|
|
973
973
|
var o;
|
|
974
974
|
const [r, a] = e.split("?"), n = be(r);
|
|
975
975
|
e: for (const h of i) {
|
|
@@ -1010,7 +1010,7 @@ function gt(i, e, t = {}) {
|
|
|
1010
1010
|
path: "/" + g.map((u) => u.value).join("/"),
|
|
1011
1011
|
pattern: "/" + l.map((u) => u.type === 2 ? `{${u.name}}` : u.type === 4 ? `{#${u.name}}` : u.name).join("/"),
|
|
1012
1012
|
params: m,
|
|
1013
|
-
query:
|
|
1013
|
+
query: st(a),
|
|
1014
1014
|
meta: h.meta
|
|
1015
1015
|
};
|
|
1016
1016
|
}
|
|
@@ -1057,14 +1057,14 @@ function Xt(i) {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
return t;
|
|
1059
1059
|
}
|
|
1060
|
-
var Le, M, X, xe, P, Qe, I, Re, Z, ee, ue, he, fe, Oe, K,
|
|
1060
|
+
var Le, M, X, xe, P, Qe, I, Re, Z, ee, ue, he, fe, Oe, K, it, ot;
|
|
1061
1061
|
class Zt {
|
|
1062
1062
|
constructor(e, t) {
|
|
1063
1063
|
f(this, K);
|
|
1064
1064
|
f(this, Le);
|
|
1065
1065
|
f(this, M);
|
|
1066
1066
|
f(this, X);
|
|
1067
|
-
f(this, xe,
|
|
1067
|
+
f(this, xe, Ze());
|
|
1068
1068
|
f(this, P);
|
|
1069
1069
|
f(this, Qe, 0);
|
|
1070
1070
|
f(this, I, []);
|
|
@@ -1093,8 +1093,9 @@ class Zt {
|
|
|
1093
1093
|
S(this, "$query");
|
|
1094
1094
|
f(this, Oe);
|
|
1095
1095
|
b(this, Le, e), b(this, M, e.createLogger("dolla/router")), b(this, X, t);
|
|
1096
|
-
const [r, a] = ie(null), [n, o] = ie(""), [h, l] = ie({}), [d, g] = ie(
|
|
1097
|
-
|
|
1096
|
+
const [r, a] = ie(null), [n, o] = ie(""), [h, l] = ie({}, { equals: Xe }), [d, g] = ie(
|
|
1097
|
+
st(typeof window > "u" ? "" : window.location.search ?? ""),
|
|
1098
|
+
{ equals: Xe }
|
|
1098
1099
|
);
|
|
1099
1100
|
this.$pattern = r, b(this, ue, a), this.$path = n, b(this, he, o), this.$params = h, b(this, fe, l), this.$query = d, b(this, Oe, g), e.beforeMount(() => {
|
|
1100
1101
|
s(this, P) != null && (s(this, xe).watch([d], (m) => {
|
|
@@ -1106,7 +1107,7 @@ class Zt {
|
|
|
1106
1107
|
pathname: s(this, P).location.pathname,
|
|
1107
1108
|
search: y
|
|
1108
1109
|
});
|
|
1109
|
-
}), s(this, ee).push(s(this, P).listen(E(this, K,
|
|
1110
|
+
}), s(this, ee).push(s(this, P).listen(E(this, K, ot).bind(this))), E(this, K, ot).call(this, s(this, P)), s(this, ee).push(
|
|
1110
1111
|
rr(s(this, X).rootElement, (m) => {
|
|
1111
1112
|
let u = m.getAttribute("href");
|
|
1112
1113
|
s(this, M).info("Intercepted link click", m, u), /^https?:\/\/|^\//.test(u) || (u = se([s(this, P).location.pathname, u])), s(this, P).push(u);
|
|
@@ -1126,7 +1127,7 @@ class Zt {
|
|
|
1126
1127
|
return;
|
|
1127
1128
|
}
|
|
1128
1129
|
e.style === "hash" ? b(this, P, Jt()) : b(this, P, Qt()), b(this, Z, Yt(
|
|
1129
|
-
e.routes.flatMap((t) => E(this, K,
|
|
1130
|
+
e.routes.flatMap((t) => E(this, K, it).call(this, t)).map((t) => ({
|
|
1130
1131
|
pattern: t.pattern,
|
|
1131
1132
|
meta: t.meta,
|
|
1132
1133
|
fragments: Xt(t.pattern)
|
|
@@ -1135,8 +1136,8 @@ class Zt {
|
|
|
1135
1136
|
for (const t of s(this, Z))
|
|
1136
1137
|
if (t.meta.redirect) {
|
|
1137
1138
|
let r;
|
|
1138
|
-
if (!
|
|
1139
|
-
if (r = t.meta.redirect, !
|
|
1139
|
+
if (!lt(t.meta.redirect)) if (V(t.meta.redirect)) {
|
|
1140
|
+
if (r = t.meta.redirect, !wt(s(this, Z), r, {
|
|
1140
1141
|
willMatch(n) {
|
|
1141
1142
|
return n !== t;
|
|
1142
1143
|
}
|
|
@@ -1202,7 +1203,7 @@ Le = new WeakMap(), M = new WeakMap(), X = new WeakMap(), xe = new WeakMap(), P
|
|
|
1202
1203
|
* @param route - Route config object.
|
|
1203
1204
|
* @param layers - Array of parent layers. Passed when this function calls itself on nested routes.
|
|
1204
1205
|
*/
|
|
1205
|
-
|
|
1206
|
+
it = function(e, t = [], r = []) {
|
|
1206
1207
|
if (!(typeof e == "object" && !Array.isArray(e)) || typeof e.path != "string")
|
|
1207
1208
|
throw new TypeError(`Route configs must be objects with a 'path' string property. Got: ${e}`);
|
|
1208
1209
|
if (e.redirect && e.routes)
|
|
@@ -1225,15 +1226,15 @@ st = function(e, t = [], r = []) {
|
|
|
1225
1226
|
}
|
|
1226
1227
|
}), n;
|
|
1227
1228
|
}
|
|
1228
|
-
let o =
|
|
1229
|
+
let o = vt;
|
|
1229
1230
|
if (typeof e.view == "function")
|
|
1230
1231
|
o = e.view;
|
|
1231
1232
|
else if (e.view)
|
|
1232
1233
|
throw new TypeError(`Route '${e.path}' expected a view function or undefined. Got: ${e.view}`);
|
|
1233
|
-
const h = { id:
|
|
1234
|
+
const h = { id: ut(this, Qe)._++, view: o };
|
|
1234
1235
|
if (e.routes)
|
|
1235
1236
|
for (const l of e.routes)
|
|
1236
|
-
n.push(...E(this, K,
|
|
1237
|
+
n.push(...E(this, K, it).call(this, l, [...t, e], [...r, h]));
|
|
1237
1238
|
else
|
|
1238
1239
|
n.push({
|
|
1239
1240
|
pattern: parent ? se([...t.map((l) => l.path), e.path]) : e.path,
|
|
@@ -1244,9 +1245,9 @@ st = function(e, t = [], r = []) {
|
|
|
1244
1245
|
}
|
|
1245
1246
|
});
|
|
1246
1247
|
return n;
|
|
1247
|
-
},
|
|
1248
|
-
e.search !== s(this, Re) && (b(this, Re, e.search), s(this, Oe).call(this,
|
|
1249
|
-
const t =
|
|
1248
|
+
}, ot = async function({ location: e }) {
|
|
1249
|
+
e.search !== s(this, Re) && (b(this, Re, e.search), s(this, Oe).call(this, st(e.search)));
|
|
1250
|
+
const t = wt(s(this, Z), e.pathname);
|
|
1250
1251
|
if (!t) {
|
|
1251
1252
|
s(this, ue).call(this, null), s(this, he).call(this, e.pathname), s(this, fe).call(this, {
|
|
1252
1253
|
wildcard: e.pathname
|
|
@@ -1324,7 +1325,7 @@ class ar {
|
|
|
1324
1325
|
f(this, G);
|
|
1325
1326
|
f(this, te);
|
|
1326
1327
|
f(this, Me, Vt);
|
|
1327
|
-
f(this, Te,
|
|
1328
|
+
f(this, Te, Ze());
|
|
1328
1329
|
f(this, De, []);
|
|
1329
1330
|
f(this, Ae, []);
|
|
1330
1331
|
f(this, _e, []);
|
|
@@ -1339,15 +1340,15 @@ class ar {
|
|
|
1339
1340
|
warn: "development",
|
|
1340
1341
|
error: !0
|
|
1341
1342
|
});
|
|
1342
|
-
f(this, z,
|
|
1343
|
+
f(this, z, dt("*,-dolla/*"));
|
|
1343
1344
|
S(this, "watch", s(this, Te).watch);
|
|
1344
1345
|
S(this, "createState", ie);
|
|
1345
1346
|
S(this, "createSettableState", Nt);
|
|
1346
1347
|
S(this, "toSettableState", Mt);
|
|
1347
|
-
S(this, "toState",
|
|
1348
|
+
S(this, "toState", pt);
|
|
1348
1349
|
S(this, "valueOf", Tt);
|
|
1349
1350
|
S(this, "derive", ye);
|
|
1350
|
-
S(this, "createWatcher",
|
|
1351
|
+
S(this, "createWatcher", Ze);
|
|
1351
1352
|
S(this, "createRef", Dt);
|
|
1352
1353
|
S(this, "isRef", At);
|
|
1353
1354
|
const e = this;
|
|
@@ -1410,11 +1411,11 @@ class ar {
|
|
|
1410
1411
|
throw new Error("Dolla is already mounted.");
|
|
1411
1412
|
if (V(e)) {
|
|
1412
1413
|
const a = document.querySelector(e);
|
|
1413
|
-
|
|
1414
|
+
mt(HTMLElement, a, `Selector '${e}' did not match any element.`), b(this, G, a);
|
|
1414
1415
|
} else
|
|
1415
|
-
|
|
1416
|
+
mt(HTMLElement, e, "Expected an HTML element or a selector string. Got type: %t, value: %v"), b(this, G, e);
|
|
1416
1417
|
let r;
|
|
1417
|
-
t ? r =
|
|
1418
|
+
t ? r = gt(t) : r = gt(vt), b(this, te, this.constructView(r.type, r.props)), await Promise.all(s(this, De).map((a) => a())), s(this, te).mount(s(this, G)), b(this, W, !0);
|
|
1418
1419
|
for (const a of s(this, Ae))
|
|
1419
1420
|
a();
|
|
1420
1421
|
}
|
|
@@ -1462,10 +1463,10 @@ class ar {
|
|
|
1462
1463
|
}
|
|
1463
1464
|
}
|
|
1464
1465
|
setLogFilter(e) {
|
|
1465
|
-
b(this, z,
|
|
1466
|
+
b(this, z, dt(e));
|
|
1466
1467
|
}
|
|
1467
1468
|
createLogger(e, t) {
|
|
1468
|
-
const r =
|
|
1469
|
+
const r = pt(e), a = (t == null ? void 0 : t.console) ?? _t(), n = this;
|
|
1469
1470
|
return {
|
|
1470
1471
|
get info() {
|
|
1471
1472
|
var h;
|
|
@@ -1558,7 +1559,7 @@ class ar {
|
|
|
1558
1559
|
}
|
|
1559
1560
|
}
|
|
1560
1561
|
W = new WeakMap(), Ne = new WeakMap(), G = new WeakMap(), te = new WeakMap(), Me = new WeakMap(), Te = new WeakMap(), De = new WeakMap(), Ae = new WeakMap(), _e = new WeakMap(), je = new WeakMap(), B = new WeakMap(), x = new WeakMap(), z = new WeakMap();
|
|
1561
|
-
const
|
|
1562
|
+
const yt = new ar(), lr = yt.i18n.t.bind(yt.i18n);
|
|
1562
1563
|
function cr(i) {
|
|
1563
1564
|
typeof window < "u" && (window.DOLLA_DEV_DEBUG = i);
|
|
1564
1565
|
}
|
|
@@ -1566,23 +1567,23 @@ function ur() {
|
|
|
1566
1567
|
return typeof window < "u" ? window.DOLLA_DEV_DEBUG === !0 : !1;
|
|
1567
1568
|
}
|
|
1568
1569
|
export {
|
|
1569
|
-
|
|
1570
|
-
|
|
1570
|
+
Rt as cond,
|
|
1571
|
+
gt as createMarkup,
|
|
1571
1572
|
Dt as createRef,
|
|
1572
1573
|
Nt as createSettableState,
|
|
1573
1574
|
dr as createSetter,
|
|
1574
1575
|
ie as createState,
|
|
1575
|
-
|
|
1576
|
+
yt as default,
|
|
1576
1577
|
ye as derive,
|
|
1577
1578
|
ur as getDevDebug,
|
|
1578
|
-
|
|
1579
|
+
ht as html,
|
|
1579
1580
|
At as isRef,
|
|
1580
1581
|
pr as portal,
|
|
1581
1582
|
mr as repeat,
|
|
1582
1583
|
cr as setDevDebug,
|
|
1583
1584
|
lr as t,
|
|
1584
1585
|
Mt as toSettableState,
|
|
1585
|
-
|
|
1586
|
+
pt as toState,
|
|
1586
1587
|
Tt as valueOf
|
|
1587
1588
|
};
|
|
1588
1589
|
//# sourceMappingURL=index.js.map
|