@manyducks.co/dolla 2.0.0-alpha.19 → 2.0.0-alpha.20
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 +4 -4
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/markup.d.ts +4 -1
- package/dist/nodes/cond.d.ts +1 -1
- package/dist/nodes/html.d.ts +1 -1
- package/dist/nodes/observer.d.ts +2 -2
- package/dist/nodes/outlet.d.ts +1 -1
- package/dist/nodes/portal.d.ts +1 -1
- package/dist/nodes/repeat.d.ts +2 -2
- package/dist/nodes/text.d.ts +1 -1
- package/dist/{passthrough-DcOD0Wf3.js → passthrough-DrILnMr2.js} +327 -327
- package/dist/passthrough-DrILnMr2.js.map +1 -0
- package/dist/view.d.ts +1 -1
- package/package.json +1 -1
- package/dist/passthrough-DcOD0Wf3.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var me = Object.defineProperty;
|
|
2
|
-
var ge = (
|
|
3
|
-
var r = (
|
|
4
|
-
function we(
|
|
5
|
-
return
|
|
2
|
+
var ge = (s, e, t) => e in s ? me(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var r = (s, e, t) => ge(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
function we(s) {
|
|
5
|
+
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
6
6
|
}
|
|
7
7
|
var O = { exports: {} }, Z;
|
|
8
8
|
function ye() {
|
|
9
|
-
return Z || (Z = 1, function(
|
|
9
|
+
return Z || (Z = 1, function(s, e) {
|
|
10
10
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
11
11
|
var t = /* @__PURE__ */ function() {
|
|
12
12
|
function l(c, h) {
|
|
@@ -29,7 +29,7 @@ function ye() {
|
|
|
29
29
|
if (Symbol.iterator in Object(c)) return l(c, h);
|
|
30
30
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
31
31
|
};
|
|
32
|
-
}(),
|
|
32
|
+
}(), n = function(l) {
|
|
33
33
|
return l.reduce(function(c, h) {
|
|
34
34
|
return 16 > h ? c + "0" + h.toString(16) : c + h.toString(16);
|
|
35
35
|
}, "#");
|
|
@@ -49,91 +49,91 @@ function ye() {
|
|
|
49
49
|
return c * h.charCodeAt(0) * d + 1;
|
|
50
50
|
}, 1);
|
|
51
51
|
}, a = function(l) {
|
|
52
|
-
var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, b = l.hashFunction, g = b === void 0 ? u : b, k = l.scheme, _ = k === void 0 ? "hex" : k, L = o(g(c), d, m, S), w = t(L, 3), D = w[0], H = w[1], z = w[2], Y = i(D / 360, H, z), pe =
|
|
52
|
+
var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, b = l.hashFunction, g = b === void 0 ? u : b, k = l.scheme, _ = k === void 0 ? "hex" : k, L = o(g(c), d, m, S), w = t(L, 3), D = w[0], H = w[1], z = w[2], Y = i(D / 360, H, z), pe = n(Y);
|
|
53
53
|
return _ === "hsl" ? [D, H, z] : _ === "rgb" ? Y : pe;
|
|
54
54
|
};
|
|
55
|
-
e.default = a,
|
|
55
|
+
e.default = a, s.exports = e.default;
|
|
56
56
|
}(O, O.exports)), O.exports;
|
|
57
57
|
}
|
|
58
58
|
var Ce = ye();
|
|
59
59
|
const be = /* @__PURE__ */ we(Ce);
|
|
60
|
-
function G(
|
|
61
|
-
if (
|
|
60
|
+
function G(s) {
|
|
61
|
+
if (s === void 0)
|
|
62
62
|
return "undefined";
|
|
63
|
-
if (
|
|
63
|
+
if (s === null)
|
|
64
64
|
return "null";
|
|
65
|
-
const e = typeof
|
|
65
|
+
const e = typeof s;
|
|
66
66
|
switch (e) {
|
|
67
67
|
case "number":
|
|
68
|
-
return isNaN(
|
|
68
|
+
return isNaN(s) ? "NaN" : "number";
|
|
69
69
|
case "function":
|
|
70
|
-
return oe(
|
|
70
|
+
return oe(s) ? "class" : e;
|
|
71
71
|
case "object":
|
|
72
|
-
return M(
|
|
72
|
+
return M(s) ? "array" : ve(s) ? "promise" : e;
|
|
73
73
|
default:
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
function M(
|
|
78
|
-
return Array.isArray(
|
|
77
|
+
function M(s) {
|
|
78
|
+
return Array.isArray(s);
|
|
79
79
|
}
|
|
80
|
-
function ie(...
|
|
81
|
-
const e =
|
|
82
|
-
return
|
|
80
|
+
function ie(...s) {
|
|
81
|
+
const e = s[0], t = (n) => M(n) && n.every((i) => e(i));
|
|
82
|
+
return s.length < 2 ? t : t(s[1]);
|
|
83
83
|
}
|
|
84
|
-
function He(...
|
|
85
|
-
const e =
|
|
84
|
+
function He(...s) {
|
|
85
|
+
const e = s[0], t = $(s[2]) ? s[2] : "Expected an array of valid items. Got type: %t, value: %v", n = (i) => {
|
|
86
86
|
if (M(i) && i.every((o) => e(o)))
|
|
87
87
|
return !0;
|
|
88
88
|
throw new TypeError(j(i, t));
|
|
89
89
|
};
|
|
90
|
-
return
|
|
90
|
+
return s.length < 2 ? n : n(s[1]);
|
|
91
91
|
}
|
|
92
|
-
function $(
|
|
93
|
-
return typeof
|
|
92
|
+
function $(s) {
|
|
93
|
+
return typeof s == "string";
|
|
94
94
|
}
|
|
95
|
-
function ze(
|
|
96
|
-
if ($(
|
|
95
|
+
function ze(s, e) {
|
|
96
|
+
if ($(s))
|
|
97
97
|
return !0;
|
|
98
|
-
throw new TypeError(j(
|
|
98
|
+
throw new TypeError(j(s, e ?? "Expected a string. Got type: %t, value: %v"));
|
|
99
99
|
}
|
|
100
|
-
function x(
|
|
101
|
-
return typeof
|
|
100
|
+
function x(s) {
|
|
101
|
+
return typeof s == "function" && !oe(s);
|
|
102
102
|
}
|
|
103
|
-
function _e(
|
|
104
|
-
return typeof
|
|
103
|
+
function _e(s) {
|
|
104
|
+
return typeof s == "number" && !isNaN(s);
|
|
105
105
|
}
|
|
106
|
-
function ve(
|
|
107
|
-
if (
|
|
108
|
-
const e =
|
|
106
|
+
function ve(s) {
|
|
107
|
+
if (s == null) return !1;
|
|
108
|
+
const e = s;
|
|
109
109
|
return e instanceof Promise || x(e.then) && x(e.catch) && x(e.finally);
|
|
110
110
|
}
|
|
111
|
-
function oe(
|
|
112
|
-
return typeof
|
|
111
|
+
function oe(s) {
|
|
112
|
+
return typeof s == "function" && /^\s*class\s+/.test(s.toString());
|
|
113
113
|
}
|
|
114
|
-
function Ye(...
|
|
115
|
-
const e =
|
|
114
|
+
function Ye(...s) {
|
|
115
|
+
const e = s[0], t = $(s[2]) ? s[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, n = (i) => {
|
|
116
116
|
if (i instanceof e)
|
|
117
117
|
return !0;
|
|
118
118
|
throw new TypeError(j(i, t));
|
|
119
119
|
};
|
|
120
|
-
return
|
|
120
|
+
return s.length < 2 ? n : n(s[1]);
|
|
121
121
|
}
|
|
122
|
-
function W(
|
|
123
|
-
return
|
|
122
|
+
function W(s) {
|
|
123
|
+
return s != null && typeof s == "object" && !M(s);
|
|
124
124
|
}
|
|
125
|
-
function j(
|
|
125
|
+
function j(s, e) {
|
|
126
126
|
var i;
|
|
127
|
-
const t = G(
|
|
128
|
-
return e.replaceAll("%t", t).replaceAll("%v",
|
|
127
|
+
const t = G(s), n = ((i = s == null ? void 0 : s.toString) == null ? void 0 : i.call(s)) || String(s);
|
|
128
|
+
return e.replaceAll("%t", t).replaceAll("%v", n);
|
|
129
129
|
}
|
|
130
130
|
const ke = () => {
|
|
131
131
|
};
|
|
132
|
-
function Se(
|
|
133
|
-
const t = (
|
|
132
|
+
function Se(s, e) {
|
|
133
|
+
const t = (n) => {
|
|
134
134
|
const i = {};
|
|
135
|
-
for (const o in
|
|
136
|
-
|
|
135
|
+
for (const o in n)
|
|
136
|
+
s.includes(o) || (i[o] = n[o]);
|
|
137
137
|
return i;
|
|
138
138
|
};
|
|
139
139
|
return e == null ? t : t(e);
|
|
@@ -144,33 +144,33 @@ function Ze() {
|
|
|
144
144
|
if (typeof global < "u" && global.console)
|
|
145
145
|
return global.console;
|
|
146
146
|
}
|
|
147
|
-
function xe(
|
|
147
|
+
function xe(s) {
|
|
148
148
|
return be({
|
|
149
|
-
str:
|
|
149
|
+
str: s,
|
|
150
150
|
sat: { min: 0.35, max: 0.55 },
|
|
151
151
|
light: { min: 0.6, max: 0.6 }
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
function Je(
|
|
155
|
-
if (
|
|
156
|
-
return (
|
|
154
|
+
function Je(s) {
|
|
155
|
+
if (s instanceof RegExp)
|
|
156
|
+
return (n) => s.test(n);
|
|
157
157
|
const e = {
|
|
158
158
|
positive: [],
|
|
159
159
|
negative: []
|
|
160
|
-
}, t =
|
|
161
|
-
for (let
|
|
160
|
+
}, t = s.split(",").map((n) => n.trim()).filter((n) => n !== "");
|
|
161
|
+
for (let n of t) {
|
|
162
162
|
let i = "positive";
|
|
163
|
-
|
|
163
|
+
n.startsWith("-") && (i = "negative", n = n.slice(1)), n === "*" ? e[i].push(function() {
|
|
164
164
|
return !0;
|
|
165
|
-
}) :
|
|
166
|
-
return o.startsWith(
|
|
165
|
+
}) : n.endsWith("*") ? e[i].push(function(o) {
|
|
166
|
+
return o.startsWith(n.slice(0, n.length - 1));
|
|
167
167
|
}) : e[i].push(function(o) {
|
|
168
|
-
return o ===
|
|
168
|
+
return o === n;
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
|
-
return function(
|
|
171
|
+
return function(n) {
|
|
172
172
|
const { positive: i, negative: o } = e;
|
|
173
|
-
return !(o.some((u) => u(
|
|
173
|
+
return !(o.some((u) => u(n)) || i.length > 0 && !i.some((u) => u(n)));
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
const P = {
|
|
@@ -197,25 +197,25 @@ const P = {
|
|
|
197
197
|
}, 200));
|
|
198
198
|
}
|
|
199
199
|
}, T = Symbol("State"), B = Symbol("SettableState"), re = Symbol("Ref");
|
|
200
|
-
function p(
|
|
201
|
-
return (
|
|
200
|
+
function p(s) {
|
|
201
|
+
return (s == null ? void 0 : s[T]) === !0;
|
|
202
202
|
}
|
|
203
|
-
function R(
|
|
204
|
-
return (
|
|
203
|
+
function R(s) {
|
|
204
|
+
return (s == null ? void 0 : s[B]) === !0;
|
|
205
205
|
}
|
|
206
|
-
function ue(
|
|
207
|
-
return (
|
|
206
|
+
function ue(s) {
|
|
207
|
+
return (s == null ? void 0 : s[re]) === !0;
|
|
208
208
|
}
|
|
209
|
-
function Ee(
|
|
210
|
-
return p(
|
|
209
|
+
function Ee(s) {
|
|
210
|
+
return p(s) ? s.get() : s;
|
|
211
211
|
}
|
|
212
|
-
function F(
|
|
213
|
-
return R(
|
|
212
|
+
function F(s) {
|
|
213
|
+
return R(s) ? new U(s) : p(s) ? s : new U({
|
|
214
214
|
get() {
|
|
215
|
-
return
|
|
215
|
+
return s;
|
|
216
216
|
},
|
|
217
217
|
watch(e, t = {}) {
|
|
218
|
-
return t != null && t.lazy || e(
|
|
218
|
+
return t != null && t.lazy || e(s), ke;
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
221
|
}
|
|
@@ -245,8 +245,8 @@ class A {
|
|
|
245
245
|
}
|
|
246
246
|
watch(e, t) {
|
|
247
247
|
return this.watchers.push(e), t != null && t.lazy || e(this.value), P.increment(), () => {
|
|
248
|
-
const
|
|
249
|
-
|
|
248
|
+
const n = this.watchers.indexOf(e);
|
|
249
|
+
n > -1 && this.watchers.splice(n, 1), P.decrement();
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
252
|
}
|
|
@@ -268,8 +268,8 @@ class U {
|
|
|
268
268
|
return this.__value.watch(e, t);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
function I(
|
|
272
|
-
const t = new A(
|
|
271
|
+
function I(s, e) {
|
|
272
|
+
const t = new A(s, e);
|
|
273
273
|
return [new U(t), (i) => t.set(i)];
|
|
274
274
|
}
|
|
275
275
|
var ee, te;
|
|
@@ -294,28 +294,28 @@ class $e {
|
|
|
294
294
|
return this.__value.watch(e, t);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
function Qe(
|
|
298
|
-
return new $e(new A(
|
|
297
|
+
function Qe(s, e) {
|
|
298
|
+
return new $e(new A(s, e));
|
|
299
299
|
}
|
|
300
|
-
function Xe(
|
|
300
|
+
function Xe(s, e) {
|
|
301
301
|
return {
|
|
302
302
|
[T]: !0,
|
|
303
303
|
[B]: !0,
|
|
304
|
-
get:
|
|
305
|
-
watch:
|
|
304
|
+
get: s.get.bind(s),
|
|
305
|
+
watch: s.watch.bind(s),
|
|
306
306
|
set: e
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
|
-
function et(
|
|
310
|
-
return function(
|
|
311
|
-
const i =
|
|
309
|
+
function et(s, e) {
|
|
310
|
+
return function(n) {
|
|
311
|
+
const i = s.get();
|
|
312
312
|
let o;
|
|
313
|
-
typeof
|
|
313
|
+
typeof n == "function" ? o = n(i) : o = n, e(o, i);
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
const J = Symbol("EMPTY");
|
|
317
317
|
class Ne {
|
|
318
|
-
constructor(e, t,
|
|
318
|
+
constructor(e, t, n) {
|
|
319
319
|
r(this, "equals", A.defaultEquals);
|
|
320
320
|
/**
|
|
321
321
|
* Array of states this holder's value is derived from.
|
|
@@ -353,7 +353,7 @@ class Ne {
|
|
|
353
353
|
* When value is a State, this function will stop watching its value.
|
|
354
354
|
*/
|
|
355
355
|
r(this, "stopWatchingCurrentValue");
|
|
356
|
-
this.sources = e.map(F), this.fn = t,
|
|
356
|
+
this.sources = e.map(F), this.fn = t, n != null && n.equals && (this.equals = n.equals), this.previousSourceValues = new Array(e.length).fill(J, 0, e.length);
|
|
357
357
|
}
|
|
358
358
|
/*==========================*\
|
|
359
359
|
|| "Public" methods ||
|
|
@@ -363,9 +363,9 @@ class Ne {
|
|
|
363
363
|
}
|
|
364
364
|
watch(e, t) {
|
|
365
365
|
this.isWatchingSources || this.startWatchingSources();
|
|
366
|
-
const
|
|
367
|
-
return
|
|
368
|
-
|
|
366
|
+
const n = this.watchers;
|
|
367
|
+
return n.push(e), t != null && t.lazy || e(this.rawValue), P.increment(), () => {
|
|
368
|
+
n.splice(n.indexOf(e), 1), this.isWatchingSources && n.length === 0 && this.stopWatchingSources(), P.decrement();
|
|
369
369
|
};
|
|
370
370
|
}
|
|
371
371
|
/*==========================*\
|
|
@@ -377,10 +377,10 @@ class Ne {
|
|
|
377
377
|
}
|
|
378
378
|
update() {
|
|
379
379
|
const e = this.sources, t = this.previousSourceValues;
|
|
380
|
-
let
|
|
380
|
+
let n = !1, i;
|
|
381
381
|
for (let o = 0; o < e.length; o++)
|
|
382
|
-
i = e[o].get(), !
|
|
383
|
-
|
|
382
|
+
i = e[o].get(), !n && !this.equals(i, t[o]) && (n = !0), t[o] = i;
|
|
383
|
+
n && this.setValue(this.fn(...t));
|
|
384
384
|
}
|
|
385
385
|
getValue() {
|
|
386
386
|
return this.isWatchingSources || this.update(), this.rawValue;
|
|
@@ -392,9 +392,9 @@ class Ne {
|
|
|
392
392
|
}
|
|
393
393
|
startWatchingSources() {
|
|
394
394
|
const e = this.previousSourceValues;
|
|
395
|
-
for (let
|
|
396
|
-
this.sourceWatcher.watch([this.sources[
|
|
397
|
-
if (e[
|
|
395
|
+
for (let n = 0; n < this.sources.length; n++)
|
|
396
|
+
this.sourceWatcher.watch([this.sources[n]], (i) => {
|
|
397
|
+
if (e[n] = i, this.isWatchingSources) {
|
|
398
398
|
const o = this.fn(...e);
|
|
399
399
|
this.equals(o, this.value) || this.setValue(o);
|
|
400
400
|
}
|
|
@@ -407,9 +407,9 @@ class Ne {
|
|
|
407
407
|
this.sourceWatcher.stopAll(), this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.isWatchingSources = !1;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
function Me(
|
|
411
|
-
const
|
|
412
|
-
return new U(
|
|
410
|
+
function Me(s, e, t) {
|
|
411
|
+
const n = new Ne(s, e, t);
|
|
412
|
+
return new U(n);
|
|
413
413
|
}
|
|
414
414
|
var ne, se;
|
|
415
415
|
se = re, ne = T;
|
|
@@ -438,30 +438,30 @@ function tt() {
|
|
|
438
438
|
return new Ae(new A(void 0));
|
|
439
439
|
}
|
|
440
440
|
function K() {
|
|
441
|
-
const
|
|
441
|
+
const s = [];
|
|
442
442
|
return {
|
|
443
443
|
watch(e, t) {
|
|
444
444
|
if (e.length === 0)
|
|
445
445
|
throw new TypeError("Expected at least one state to watch.");
|
|
446
446
|
e = e.map(F);
|
|
447
|
-
let
|
|
448
|
-
return e.length > 1 ?
|
|
449
|
-
let i =
|
|
450
|
-
i > -1 &&
|
|
447
|
+
let n;
|
|
448
|
+
return e.length > 1 ? n = Me(e, t).watch(() => null) : n = e[0].watch(t), s.push(n), () => {
|
|
449
|
+
let i = s.indexOf(n);
|
|
450
|
+
i > -1 && s.splice(i, 1), n();
|
|
451
451
|
};
|
|
452
452
|
},
|
|
453
453
|
stopAll() {
|
|
454
|
-
for (;
|
|
455
|
-
|
|
454
|
+
for (; s.length > 0; )
|
|
455
|
+
s.pop()();
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
|
-
function Ve(
|
|
460
|
-
for (var e, t,
|
|
461
|
-
i === 1 && (d || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(d ?
|
|
462
|
-
}, c = 0; c <
|
|
459
|
+
function Ve(s) {
|
|
460
|
+
for (var e, t, n = arguments, i = 1, o = "", u = "", a = [0], l = function(d) {
|
|
461
|
+
i === 1 && (d || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(d ? n[d] : o) : i === 3 && (d || o) ? (a[1] = d ? n[d] : o, i = 2) : i === 2 && o === "..." && d ? a[2] = Object.assign(a[2] || {}, n[d]) : i === 2 && o && !d ? (a[2] = a[2] || {})[o] = !0 : i >= 5 && (i === 5 ? ((a[2] = a[2] || {})[t] = d ? o ? o + n[d] : n[d] : o, i = 6) : (d || o) && (a[2][t] += d ? o + n[d] : o)), o = "";
|
|
462
|
+
}, c = 0; c < s.length; c++) {
|
|
463
463
|
c && (i === 1 && l(), l(c));
|
|
464
|
-
for (var h = 0; h <
|
|
464
|
+
for (var h = 0; h < s[c].length; h++) e = s[c][h], i === 1 ? e === "<" ? (l(), a = [a, "", null], i = 3) : o += e : i === 4 ? o === "--" && e === ">" ? (i = 1, o = "") : o = e + o[0] : u ? e === u ? u = "" : o += e : e === '"' || e === "'" ? u = e : e === ">" ? (l(), i = 1) : i && (e === "=" ? (i = 5, t = o, o = "") : e === "/" && (i < 5 || s[c][h + 1] === ">") ? (l(), i === 3 && (a = a[0]), i = a, (a = a[0]).push(this.apply(null, i.slice(1))), i = 0) : e === " " || e === " " || e === `
|
|
465
465
|
` || e === "\r" ? (l(), i = 2) : o += e), i === 3 && o === "!--" && (i = 4, a = a[0]);
|
|
466
466
|
}
|
|
467
467
|
return l(), a.length > 2 ? a.slice(1) : a[1];
|
|
@@ -484,25 +484,25 @@ class Te {
|
|
|
484
484
|
return this.node.parentNode != null;
|
|
485
485
|
}
|
|
486
486
|
mount(e, t) {
|
|
487
|
-
this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.elementContext.root.getEnv() === "development" && e.insertBefore(this.endNode, this.node.nextSibling), this.stopCallback = this.$predicate.watch((
|
|
488
|
-
(!this.initialUpdateHappened ||
|
|
487
|
+
this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.elementContext.root.getEnv() === "development" && e.insertBefore(this.endNode, this.node.nextSibling), this.stopCallback = this.$predicate.watch((n) => {
|
|
488
|
+
(!this.initialUpdateHappened || n && !this.previousValue || !n && this.previousValue) && (this.update(n), this.initialUpdateHappened = !0, this.previousValue = n);
|
|
489
489
|
}));
|
|
490
490
|
}
|
|
491
|
-
unmount() {
|
|
492
|
-
var
|
|
491
|
+
unmount(e) {
|
|
492
|
+
var t, n;
|
|
493
493
|
this.stopCallback && (this.stopCallback(), this.stopCallback = void 0);
|
|
494
|
-
for (const
|
|
495
|
-
|
|
496
|
-
this.connectedContent = [], this.isMounted && ((
|
|
494
|
+
for (const i of this.connectedContent)
|
|
495
|
+
i.unmount(e);
|
|
496
|
+
this.connectedContent = [], this.isMounted && ((t = this.node.parentNode) == null || t.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode));
|
|
497
497
|
}
|
|
498
498
|
update(e) {
|
|
499
499
|
var t;
|
|
500
|
-
for (const
|
|
501
|
-
|
|
500
|
+
for (const n of this.connectedContent)
|
|
501
|
+
n.unmount(!1);
|
|
502
502
|
if (this.connectedContent = [], this.node.parentNode != null) {
|
|
503
503
|
e && this.thenContent ? this.connectedContent = C(this.elementContext, this.thenContent) : !e && this.elseContent && (this.connectedContent = C(this.elementContext, this.elseContent));
|
|
504
|
-
for (let
|
|
505
|
-
const i = this.connectedContent[
|
|
504
|
+
for (let n = 0; n < this.connectedContent.length; n++) {
|
|
505
|
+
const i = this.connectedContent[n], o = ((t = this.connectedContent[n - 1]) == null ? void 0 : t.node) ?? this.node;
|
|
506
506
|
i.mount(this.node.parentNode, o);
|
|
507
507
|
}
|
|
508
508
|
this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Conditional (${e ? "truthy" : "falsy"})`);
|
|
@@ -510,15 +510,15 @@ class Te {
|
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
const Oe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
513
|
-
let ae = (
|
|
514
|
-
let e = "", t = crypto.getRandomValues(new Uint8Array(
|
|
515
|
-
for (;
|
|
516
|
-
e += Oe[t[
|
|
513
|
+
let ae = (s = 21) => {
|
|
514
|
+
let e = "", t = crypto.getRandomValues(new Uint8Array(s |= 0));
|
|
515
|
+
for (; s--; )
|
|
516
|
+
e += Oe[t[s] & 63];
|
|
517
517
|
return e;
|
|
518
518
|
};
|
|
519
|
-
const Pe = (
|
|
519
|
+
const Pe = (s) => /^on[A-Z]/.test(s);
|
|
520
520
|
class Ue {
|
|
521
|
-
constructor({ tag: e, props: t, children:
|
|
521
|
+
constructor({ tag: e, props: t, children: n, elementContext: i }) {
|
|
522
522
|
r(this, "node");
|
|
523
523
|
r(this, "props");
|
|
524
524
|
r(this, "children");
|
|
@@ -537,7 +537,7 @@ class Ue {
|
|
|
537
537
|
this.props = {
|
|
538
538
|
...Se(["ref", "class", "className"], t),
|
|
539
539
|
class: t.className ?? t.class
|
|
540
|
-
}, this.children =
|
|
540
|
+
}, this.children = n ? C(i, n) : [], this.elementContext = i;
|
|
541
541
|
}
|
|
542
542
|
get isMounted() {
|
|
543
543
|
return this.node.parentNode != null;
|
|
@@ -546,43 +546,43 @@ class Ue {
|
|
|
546
546
|
if (e == null)
|
|
547
547
|
throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
|
|
548
548
|
if (!this.isMounted) {
|
|
549
|
-
for (const
|
|
550
|
-
|
|
549
|
+
for (const n of this.children)
|
|
550
|
+
n.mount(this.node);
|
|
551
551
|
this.applyProps(this.node, this.props), this.props.style && this.applyStyles(this.node, this.props.style, this.stopCallbacks), this.props.class && this.applyClasses(this.node, this.props.class, this.stopCallbacks);
|
|
552
552
|
}
|
|
553
553
|
e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.ref && (this.ref.node = this.node), setTimeout(() => {
|
|
554
554
|
this.canClickAway = !0;
|
|
555
555
|
}, 0);
|
|
556
556
|
}
|
|
557
|
-
unmount() {
|
|
558
|
-
var
|
|
557
|
+
unmount(e) {
|
|
558
|
+
var t;
|
|
559
559
|
if (this.isMounted) {
|
|
560
|
-
for (const
|
|
561
|
-
|
|
562
|
-
this.ref && (this.ref.node = void 0),
|
|
563
|
-
for (const
|
|
564
|
-
|
|
560
|
+
for (const n of this.children)
|
|
561
|
+
n.unmount(!0);
|
|
562
|
+
this.ref && (this.ref.node = void 0), e || (t = this.node.parentNode) == null || t.removeChild(this.node), this.canClickAway = !1;
|
|
563
|
+
for (const n of this.stopCallbacks)
|
|
564
|
+
n();
|
|
565
565
|
this.stopCallbacks = [];
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
getUpdateKey(e, t) {
|
|
569
569
|
return `${this.uniqueId}:${e}:${t}`;
|
|
570
570
|
}
|
|
571
|
-
attachProp(e, t,
|
|
571
|
+
attachProp(e, t, n) {
|
|
572
572
|
p(e) ? this.stopCallbacks.push(
|
|
573
573
|
e.watch((i) => {
|
|
574
574
|
this.elementContext.root.render.write(() => {
|
|
575
575
|
t(i);
|
|
576
|
-
},
|
|
576
|
+
}, n);
|
|
577
577
|
})
|
|
578
578
|
) : this.elementContext.root.render.write(() => {
|
|
579
579
|
t(e);
|
|
580
|
-
},
|
|
580
|
+
}, n);
|
|
581
581
|
}
|
|
582
582
|
applyProps(e, t) {
|
|
583
|
-
for (const
|
|
584
|
-
const i = t[
|
|
585
|
-
if (
|
|
583
|
+
for (const n in t) {
|
|
584
|
+
const i = t[n];
|
|
585
|
+
if (n === "attributes") {
|
|
586
586
|
const o = i;
|
|
587
587
|
for (const u in o)
|
|
588
588
|
this.attachProp(
|
|
@@ -592,7 +592,7 @@ class Ue {
|
|
|
592
592
|
},
|
|
593
593
|
this.getUpdateKey("attr", u)
|
|
594
594
|
);
|
|
595
|
-
} else if (
|
|
595
|
+
} else if (n === "eventListeners") {
|
|
596
596
|
const o = i;
|
|
597
597
|
for (const u in o) {
|
|
598
598
|
const a = p(i) ? (l) => i.get()(l) : i;
|
|
@@ -600,14 +600,14 @@ class Ue {
|
|
|
600
600
|
e.removeEventListener(u, a);
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
|
-
} else if (
|
|
603
|
+
} else if (n === "onClickOutside" || n === "onclickoutside") {
|
|
604
604
|
const o = (a) => {
|
|
605
605
|
this.canClickAway && !e.contains(a.target) && (p(i) ? i.get()(a) : i(a));
|
|
606
606
|
}, u = { capture: !0 };
|
|
607
607
|
window.addEventListener("click", o, u), this.stopCallbacks.push(() => {
|
|
608
608
|
window.removeEventListener("click", o, u);
|
|
609
609
|
});
|
|
610
|
-
} else if (
|
|
610
|
+
} else if (n === "$$value") {
|
|
611
611
|
if (!R(i))
|
|
612
612
|
throw new TypeError(`$$value attribute must be a settable state. Got: ${i}`);
|
|
613
613
|
this.attachProp(
|
|
@@ -624,38 +624,38 @@ class Ue {
|
|
|
624
624
|
e.addEventListener("input", o), this.stopCallbacks.push(() => {
|
|
625
625
|
e.removeEventListener("input", o);
|
|
626
626
|
});
|
|
627
|
-
} else if (Pe(
|
|
628
|
-
const o =
|
|
627
|
+
} else if (Pe(n)) {
|
|
628
|
+
const o = n.slice(2).toLowerCase(), u = p(i) ? (a) => i.get()(a) : i;
|
|
629
629
|
e.addEventListener(o, u), this.stopCallbacks.push(() => {
|
|
630
630
|
e.removeEventListener(o, u);
|
|
631
631
|
});
|
|
632
|
-
} else if (
|
|
632
|
+
} else if (n.includes("-"))
|
|
633
633
|
this.attachProp(
|
|
634
634
|
i,
|
|
635
635
|
(o) => {
|
|
636
|
-
o == null ? e.removeAttribute(
|
|
636
|
+
o == null ? e.removeAttribute(n) : e.setAttribute(n, String(o));
|
|
637
637
|
},
|
|
638
|
-
this.getUpdateKey("attr",
|
|
638
|
+
this.getUpdateKey("attr", n)
|
|
639
639
|
);
|
|
640
|
-
else if (!Fe.includes(
|
|
640
|
+
else if (!Fe.includes(n))
|
|
641
641
|
if (this.elementContext.isSVG)
|
|
642
642
|
this.attachProp(
|
|
643
643
|
i,
|
|
644
644
|
(o) => {
|
|
645
|
-
o != null ? e.setAttribute(
|
|
645
|
+
o != null ? e.setAttribute(n, String(t[n])) : e.removeAttribute(n);
|
|
646
646
|
},
|
|
647
|
-
this.getUpdateKey("attr",
|
|
647
|
+
this.getUpdateKey("attr", n)
|
|
648
648
|
);
|
|
649
649
|
else
|
|
650
|
-
switch (
|
|
650
|
+
switch (n) {
|
|
651
651
|
case "contentEditable":
|
|
652
652
|
case "value":
|
|
653
653
|
this.attachProp(
|
|
654
654
|
i,
|
|
655
655
|
(o) => {
|
|
656
|
-
e[
|
|
656
|
+
e[n] = String(o);
|
|
657
657
|
},
|
|
658
|
-
this.getUpdateKey("prop",
|
|
658
|
+
this.getUpdateKey("prop", n)
|
|
659
659
|
);
|
|
660
660
|
break;
|
|
661
661
|
case "for":
|
|
@@ -682,7 +682,7 @@ class Ue {
|
|
|
682
682
|
case "translate":
|
|
683
683
|
case "type":
|
|
684
684
|
case "title": {
|
|
685
|
-
const o =
|
|
685
|
+
const o = n.toLowerCase();
|
|
686
686
|
this.attachProp(
|
|
687
687
|
i,
|
|
688
688
|
(u) => {
|
|
@@ -699,35 +699,35 @@ class Ue {
|
|
|
699
699
|
(o) => {
|
|
700
700
|
typeof o == "string" ? e.autocomplete = o : o ? e.autocomplete = "on" : e.autocomplete = "off";
|
|
701
701
|
},
|
|
702
|
-
this.getUpdateKey("prop",
|
|
702
|
+
this.getUpdateKey("prop", n)
|
|
703
703
|
);
|
|
704
704
|
break;
|
|
705
705
|
default: {
|
|
706
706
|
this.attachProp(
|
|
707
707
|
i,
|
|
708
708
|
(o) => {
|
|
709
|
-
e[
|
|
709
|
+
e[n] = o;
|
|
710
710
|
},
|
|
711
|
-
this.getUpdateKey("prop",
|
|
711
|
+
this.getUpdateKey("prop", n)
|
|
712
712
|
);
|
|
713
713
|
break;
|
|
714
714
|
}
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
717
|
}
|
|
718
|
-
applyStyles(e, t,
|
|
718
|
+
applyStyles(e, t, n) {
|
|
719
719
|
const i = [];
|
|
720
720
|
if (p(t)) {
|
|
721
721
|
let o;
|
|
722
722
|
const u = t.watch((a) => {
|
|
723
723
|
this.elementContext.root.render.write(
|
|
724
724
|
() => {
|
|
725
|
-
x(o) && o(), e.style.cssText = "", o = this.applyStyles(e, a,
|
|
725
|
+
x(o) && o(), e.style.cssText = "", o = this.applyStyles(e, a, n);
|
|
726
726
|
},
|
|
727
727
|
this.getUpdateKey("styles", "*")
|
|
728
728
|
);
|
|
729
729
|
});
|
|
730
|
-
|
|
730
|
+
n.push(u), i.push(u);
|
|
731
731
|
} else {
|
|
732
732
|
const o = ce(t);
|
|
733
733
|
for (const u in o) {
|
|
@@ -738,28 +738,28 @@ class Ue {
|
|
|
738
738
|
h ? e.style.setProperty(u, String(h), l) : e.style.removeProperty(u);
|
|
739
739
|
});
|
|
740
740
|
});
|
|
741
|
-
|
|
741
|
+
n.push(c), i.push(c);
|
|
742
742
|
} else a != null && e.style.setProperty(u, String(a));
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
745
|
return function() {
|
|
746
746
|
for (const u of i)
|
|
747
|
-
u(),
|
|
747
|
+
u(), n.splice(n.indexOf(u), 1);
|
|
748
748
|
};
|
|
749
749
|
}
|
|
750
|
-
applyClasses(e, t,
|
|
750
|
+
applyClasses(e, t, n) {
|
|
751
751
|
const i = [];
|
|
752
752
|
if (p(t)) {
|
|
753
753
|
let o;
|
|
754
754
|
const u = t.watch((a) => {
|
|
755
755
|
this.elementContext.root.render.write(
|
|
756
756
|
() => {
|
|
757
|
-
x(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, a,
|
|
757
|
+
x(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, a, n);
|
|
758
758
|
},
|
|
759
759
|
this.getUpdateKey("attr", "class")
|
|
760
760
|
);
|
|
761
761
|
});
|
|
762
|
-
|
|
762
|
+
n.push(u), i.push(u);
|
|
763
763
|
} else {
|
|
764
764
|
const o = le(t);
|
|
765
765
|
for (const u in o) {
|
|
@@ -770,56 +770,56 @@ class Ue {
|
|
|
770
770
|
c ? e.classList.add(u) : e.classList.remove(u);
|
|
771
771
|
});
|
|
772
772
|
});
|
|
773
|
-
|
|
773
|
+
n.push(l), i.push(l);
|
|
774
774
|
} else a && e.classList.add(u);
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
return function() {
|
|
778
778
|
for (const u of i)
|
|
779
|
-
u(),
|
|
779
|
+
u(), n.splice(n.indexOf(u), 1);
|
|
780
780
|
};
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
|
-
function le(
|
|
783
|
+
function le(s) {
|
|
784
784
|
let e = {};
|
|
785
|
-
if ($(
|
|
786
|
-
const t =
|
|
787
|
-
for (const
|
|
788
|
-
e[
|
|
789
|
-
} else W(
|
|
785
|
+
if ($(s)) {
|
|
786
|
+
const t = s.split(" ");
|
|
787
|
+
for (const n of t)
|
|
788
|
+
e[n] = !0;
|
|
789
|
+
} else W(s) ? Object.assign(e, s) : Array.isArray(s) && Array.from(s).filter(Boolean).forEach((t) => {
|
|
790
790
|
Object.assign(e, le(t));
|
|
791
791
|
});
|
|
792
792
|
return delete e.undefined, e;
|
|
793
793
|
}
|
|
794
|
-
function ce(
|
|
794
|
+
function ce(s) {
|
|
795
795
|
let e = {};
|
|
796
|
-
if ($(
|
|
797
|
-
const t =
|
|
798
|
-
for (const
|
|
799
|
-
const [i, o] =
|
|
796
|
+
if ($(s)) {
|
|
797
|
+
const t = s.split(";").filter((n) => n.trim() !== "");
|
|
798
|
+
for (const n of t) {
|
|
799
|
+
const [i, o] = n.split(":"), u = {
|
|
800
800
|
value: o
|
|
801
801
|
};
|
|
802
802
|
o.includes("!important") ? (u.priority = "important", u.value = o.replace("!important", "").trim()) : u.value = o.trim(), e[Q(i.trim())] = u;
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
if (W(
|
|
806
|
-
for (const t in
|
|
807
|
-
t.startsWith("--") ? e[t] = { value:
|
|
808
|
-
else Array.isArray(
|
|
805
|
+
if (W(s))
|
|
806
|
+
for (const t in s)
|
|
807
|
+
t.startsWith("--") ? e[t] = { value: s[t] } : e[Q(t)] = { value: s[t] };
|
|
808
|
+
else Array.isArray(s) && Array.from(s).filter((t) => t != null).forEach((t) => {
|
|
809
809
|
Object.assign(e, ce(t));
|
|
810
810
|
});
|
|
811
811
|
return e;
|
|
812
812
|
}
|
|
813
|
-
function Q(
|
|
814
|
-
return
|
|
813
|
+
function Q(s) {
|
|
814
|
+
return s.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e.toLowerCase());
|
|
815
815
|
}
|
|
816
|
-
function We(
|
|
817
|
-
const t = typeof
|
|
816
|
+
function We(s, e) {
|
|
817
|
+
const t = typeof s;
|
|
818
818
|
return t === "string" ? String(e) : t === "number" ? Number(e) : t === "boolean" ? !!e : e;
|
|
819
819
|
}
|
|
820
820
|
const Fe = ["ref", "children", "class", "style", "data"];
|
|
821
821
|
class qe {
|
|
822
|
-
constructor({ states: e, renderFn: t, elementContext:
|
|
822
|
+
constructor({ states: e, renderFn: t, elementContext: n }) {
|
|
823
823
|
r(this, "node");
|
|
824
824
|
r(this, "endNode");
|
|
825
825
|
r(this, "connectedViews", []);
|
|
@@ -827,7 +827,7 @@ class qe {
|
|
|
827
827
|
r(this, "elementContext");
|
|
828
828
|
r(this, "observerControls");
|
|
829
829
|
r(this, "watcher", K());
|
|
830
|
-
this.elementContext =
|
|
830
|
+
this.elementContext = n, this.renderFn = t, this.node = document.createComment("Observer"), this.endNode = document.createComment("/Observer");
|
|
831
831
|
let i;
|
|
832
832
|
this.observerControls = {
|
|
833
833
|
start: () => {
|
|
@@ -851,22 +851,22 @@ class qe {
|
|
|
851
851
|
mount(e, t) {
|
|
852
852
|
this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.observerControls.start());
|
|
853
853
|
}
|
|
854
|
-
unmount() {
|
|
855
|
-
var
|
|
856
|
-
this.observerControls.stop(), this.watcher.stopAll(), this.isMounted && (this.cleanup(), (
|
|
854
|
+
unmount(e) {
|
|
855
|
+
var t;
|
|
856
|
+
this.observerControls.stop(), this.watcher.stopAll(), this.isMounted && (this.cleanup(e), (t = this.node.parentNode) == null || t.removeChild(this.node));
|
|
857
857
|
}
|
|
858
|
-
cleanup() {
|
|
859
|
-
var
|
|
858
|
+
cleanup(e) {
|
|
859
|
+
var t;
|
|
860
860
|
for (; this.connectedViews.length > 0; )
|
|
861
|
-
(
|
|
861
|
+
(t = this.connectedViews.pop()) == null || t.unmount(e);
|
|
862
862
|
}
|
|
863
863
|
update(...e) {
|
|
864
|
-
var
|
|
865
|
-
if (this.cleanup(), e == null || !this.isMounted)
|
|
864
|
+
var n, i;
|
|
865
|
+
if (this.cleanup(!1), e == null || !this.isMounted)
|
|
866
866
|
return;
|
|
867
867
|
const t = e.map((o) => he(o) ? o : N(o) ? E(C(this.elementContext, o)) : E(C(this.elementContext, V(o))));
|
|
868
868
|
for (const o of t) {
|
|
869
|
-
const u = ((
|
|
869
|
+
const u = ((n = this.connectedViews.at(-1)) == null ? void 0 : n.node) || this.node;
|
|
870
870
|
o.mount(this.node.parentNode, u), this.connectedViews.push(o);
|
|
871
871
|
}
|
|
872
872
|
if (this.elementContext.root.getEnv() === "development") {
|
|
@@ -890,29 +890,29 @@ class Le {
|
|
|
890
890
|
return ((e = this.node) == null ? void 0 : e.parentNode) != null;
|
|
891
891
|
}
|
|
892
892
|
mount(e, t) {
|
|
893
|
-
this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$children.watch((
|
|
894
|
-
this.update(
|
|
893
|
+
this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$children.watch((n) => {
|
|
894
|
+
this.update(n);
|
|
895
895
|
}));
|
|
896
896
|
}
|
|
897
|
-
unmount() {
|
|
898
|
-
var
|
|
897
|
+
unmount(e) {
|
|
898
|
+
var t;
|
|
899
899
|
if (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted) {
|
|
900
|
-
for (const
|
|
901
|
-
|
|
902
|
-
this.mountedChildren = [], (
|
|
900
|
+
for (const n of this.mountedChildren)
|
|
901
|
+
n.unmount(e);
|
|
902
|
+
this.mountedChildren = [], (t = this.endNode.parentNode) == null || t.removeChild(this.endNode);
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
update(e) {
|
|
906
|
-
var t,
|
|
906
|
+
var t, n, i;
|
|
907
907
|
for (const o of this.mountedChildren)
|
|
908
|
-
o.unmount();
|
|
908
|
+
o.unmount(!1);
|
|
909
909
|
for (let o = 0; o < e.length; o++) {
|
|
910
910
|
const u = e[o], a = o > 0 ? e[o] : void 0;
|
|
911
911
|
u.mount(this.node.parentElement, a == null ? void 0 : a.node);
|
|
912
912
|
}
|
|
913
913
|
this.mountedChildren = e, this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Outlet (${e.length} ${e.length === 1 ? "child" : "children"})`, (i = this.node.parentElement) == null || i.insertBefore(
|
|
914
914
|
this.endNode,
|
|
915
|
-
((
|
|
915
|
+
((n = (t = this.mountedChildren[this.mountedChildren.length - 1]) == null ? void 0 : t.node) == null ? void 0 : n.nextSibling) ?? null
|
|
916
916
|
));
|
|
917
917
|
}
|
|
918
918
|
}
|
|
@@ -926,12 +926,12 @@ class Ie {
|
|
|
926
926
|
return this.element ? this.element.isMounted : !1;
|
|
927
927
|
}
|
|
928
928
|
mount(e, t) {
|
|
929
|
-
const { content:
|
|
930
|
-
he(
|
|
929
|
+
const { content: n, parent: i } = this.config;
|
|
930
|
+
he(n) ? this.element = n : N(n) ? this.element = E(C(this.config.elementContext, n)) : this.element = E(C(this.config.elementContext, V(n))), this.element.mount(i);
|
|
931
931
|
}
|
|
932
|
-
unmount() {
|
|
933
|
-
var
|
|
934
|
-
(
|
|
932
|
+
unmount(e) {
|
|
933
|
+
var t;
|
|
934
|
+
(t = this.element) != null && t.isMounted && this.element.unmount(e);
|
|
935
935
|
}
|
|
936
936
|
}
|
|
937
937
|
class Ge {
|
|
@@ -939,8 +939,8 @@ class Ge {
|
|
|
939
939
|
r(this, "__view");
|
|
940
940
|
this.__view = e;
|
|
941
941
|
const t = Object.getOwnPropertyDescriptors(this.__view._logger);
|
|
942
|
-
for (const
|
|
943
|
-
|
|
942
|
+
for (const n in t)
|
|
943
|
+
n !== "getName" && Object.defineProperty(this, n, t[n]);
|
|
944
944
|
}
|
|
945
945
|
get uid() {
|
|
946
946
|
return this.__view.uniqueId;
|
|
@@ -968,10 +968,10 @@ class Ge {
|
|
|
968
968
|
let t = this.__view._elementContext;
|
|
969
969
|
for (; e.push(t.data), t.parent; )
|
|
970
970
|
t = t.parent;
|
|
971
|
-
const
|
|
971
|
+
const n = {};
|
|
972
972
|
for (const i of e.reverse())
|
|
973
|
-
Object.assign(
|
|
974
|
-
return
|
|
973
|
+
Object.assign(n, i);
|
|
974
|
+
return n;
|
|
975
975
|
}
|
|
976
976
|
beforeMount(e) {
|
|
977
977
|
this.__view._beforeMountCallbacks.push(e);
|
|
@@ -986,13 +986,13 @@ class Ge {
|
|
|
986
986
|
this.__view._onUnmountCallbacks.push(e);
|
|
987
987
|
}
|
|
988
988
|
watch(e, t) {
|
|
989
|
-
const
|
|
990
|
-
if (
|
|
991
|
-
return
|
|
989
|
+
const n = this.__view;
|
|
990
|
+
if (n.isMounted)
|
|
991
|
+
return n._watcher.watch(e, t);
|
|
992
992
|
{
|
|
993
993
|
let i, o = !1;
|
|
994
|
-
return
|
|
995
|
-
o || (i =
|
|
994
|
+
return n._onMountCallbacks.push(() => {
|
|
995
|
+
o || (i = n._watcher.watch(e, t));
|
|
996
996
|
}), () => {
|
|
997
997
|
i != null && (o = !0, i());
|
|
998
998
|
};
|
|
@@ -1003,7 +1003,7 @@ class Ge {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
1005
|
class q {
|
|
1006
|
-
constructor(e, t,
|
|
1006
|
+
constructor(e, t, n, i = []) {
|
|
1007
1007
|
r(this, "uniqueId", ae());
|
|
1008
1008
|
r(this, "_elementContext");
|
|
1009
1009
|
r(this, "_logger");
|
|
@@ -1018,7 +1018,7 @@ class q {
|
|
|
1018
1018
|
r(this, "_beforeUnmountCallbacks", []);
|
|
1019
1019
|
r(this, "_onUnmountCallbacks", []);
|
|
1020
1020
|
r(this, "isMounted", !1);
|
|
1021
|
-
this._elementContext = { ...e, data: {}, parent: e }, this._logger = e.root.createLogger(t.name, { uid: this.uniqueId }), this._view = t, this._props =
|
|
1021
|
+
this._elementContext = { ...e, data: {}, parent: e }, this._logger = e.root.createLogger(t.name, { uid: this.uniqueId }), this._view = t, this._props = n;
|
|
1022
1022
|
const [o, u] = I(C(e, i));
|
|
1023
1023
|
this._$children = o, this._setChildren = u;
|
|
1024
1024
|
}
|
|
@@ -1030,19 +1030,19 @@ class q {
|
|
|
1030
1030
|
return (e = this._element) == null ? void 0 : e.node;
|
|
1031
1031
|
}
|
|
1032
1032
|
mount(e, t) {
|
|
1033
|
-
const
|
|
1034
|
-
if (!
|
|
1033
|
+
const n = this.isMounted;
|
|
1034
|
+
if (!n)
|
|
1035
1035
|
for (this.initialize(); this._beforeMountCallbacks.length > 0; )
|
|
1036
1036
|
this._beforeMountCallbacks.shift()();
|
|
1037
|
-
this._element && this._element.mount(e, t),
|
|
1037
|
+
this._element && this._element.mount(e, t), n || (this.isMounted = !0, requestAnimationFrame(() => {
|
|
1038
1038
|
for (; this._onMountCallbacks.length > 0; )
|
|
1039
1039
|
this._onMountCallbacks.shift()();
|
|
1040
1040
|
}));
|
|
1041
1041
|
}
|
|
1042
|
-
unmount() {
|
|
1042
|
+
unmount(e) {
|
|
1043
1043
|
for (; this._beforeUnmountCallbacks.length > 0; )
|
|
1044
1044
|
this._beforeUnmountCallbacks.shift()();
|
|
1045
|
-
for (this._element && this._element.unmount(), this.isMounted = !1; this._onUnmountCallbacks.length > 0; )
|
|
1045
|
+
for (this._element && this._element.unmount(e), this.isMounted = !1; this._onUnmountCallbacks.length > 0; )
|
|
1046
1046
|
this._onUnmountCallbacks.shift()();
|
|
1047
1047
|
this._watcher.stopAll();
|
|
1048
1048
|
}
|
|
@@ -1058,8 +1058,8 @@ class q {
|
|
|
1058
1058
|
let t;
|
|
1059
1059
|
try {
|
|
1060
1060
|
t = this._view(this._props, e);
|
|
1061
|
-
} catch (
|
|
1062
|
-
throw
|
|
1061
|
+
} catch (n) {
|
|
1062
|
+
throw n instanceof Error && this._logger.crash(n), n;
|
|
1063
1063
|
}
|
|
1064
1064
|
if (t !== null) if (t instanceof Node)
|
|
1065
1065
|
this._element = E(C(this._elementContext, y("$node", { value: t })));
|
|
@@ -1067,18 +1067,18 @@ class q {
|
|
|
1067
1067
|
this._element = E(C(this._elementContext, t));
|
|
1068
1068
|
else if (p(t))
|
|
1069
1069
|
this._element = E(
|
|
1070
|
-
C(this._elementContext, y("$observer", { states: [t], renderFn: (
|
|
1070
|
+
C(this._elementContext, y("$observer", { states: [t], renderFn: (n) => n }))
|
|
1071
1071
|
);
|
|
1072
1072
|
else {
|
|
1073
|
-
const
|
|
1073
|
+
const n = new TypeError(
|
|
1074
1074
|
`Expected '${this._view.name}' function to return a DOM node, Markup element, Readable or null. Got: ${G(t)}`
|
|
1075
1075
|
);
|
|
1076
|
-
this._logger.crash(
|
|
1076
|
+
this._logger.crash(n);
|
|
1077
1077
|
}
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
1080
|
class je {
|
|
1081
|
-
constructor({ elementContext: e, $items: t, renderFn:
|
|
1081
|
+
constructor({ elementContext: e, $items: t, renderFn: n, keyFn: i }) {
|
|
1082
1082
|
r(this, "node");
|
|
1083
1083
|
r(this, "endNode");
|
|
1084
1084
|
r(this, "$items");
|
|
@@ -1087,40 +1087,40 @@ class je {
|
|
|
1087
1087
|
r(this, "elementContext");
|
|
1088
1088
|
r(this, "renderFn");
|
|
1089
1089
|
r(this, "keyFn");
|
|
1090
|
-
this.elementContext = e, this.$items = t, this.renderFn =
|
|
1090
|
+
this.elementContext = e, this.$items = t, this.renderFn = n, this.keyFn = i, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Repeat"), this.endNode = document.createComment("/Repeat")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
|
|
1091
1091
|
}
|
|
1092
1092
|
get isMounted() {
|
|
1093
1093
|
return this.node.parentNode != null;
|
|
1094
1094
|
}
|
|
1095
1095
|
mount(e, t) {
|
|
1096
|
-
this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$items.watch((
|
|
1097
|
-
this._update(Array.from(
|
|
1096
|
+
this.isMounted || (e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null), this.stopCallback = this.$items.watch((n) => {
|
|
1097
|
+
this._update(Array.from(n));
|
|
1098
1098
|
}));
|
|
1099
1099
|
}
|
|
1100
|
-
unmount() {
|
|
1101
|
-
var
|
|
1102
|
-
this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted && ((
|
|
1100
|
+
unmount(e) {
|
|
1101
|
+
var t, n;
|
|
1102
|
+
this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), !e && this.isMounted && ((t = this.node.parentNode) == null || t.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode)), this._cleanup(e);
|
|
1103
1103
|
}
|
|
1104
|
-
_cleanup() {
|
|
1105
|
-
for (const
|
|
1106
|
-
|
|
1104
|
+
_cleanup(e) {
|
|
1105
|
+
for (const t of this.connectedItems)
|
|
1106
|
+
t.element.unmount(e);
|
|
1107
1107
|
this.connectedItems = [];
|
|
1108
1108
|
}
|
|
1109
1109
|
_update(e) {
|
|
1110
1110
|
var o, u, a;
|
|
1111
1111
|
if (e.length === 0 || !this.isMounted)
|
|
1112
|
-
return this._cleanup();
|
|
1112
|
+
return this._cleanup(!1);
|
|
1113
1113
|
const t = [];
|
|
1114
|
-
let
|
|
1114
|
+
let n = 0;
|
|
1115
1115
|
for (const l of e)
|
|
1116
1116
|
t.push({
|
|
1117
|
-
key: this.keyFn(l,
|
|
1117
|
+
key: this.keyFn(l, n),
|
|
1118
1118
|
value: l,
|
|
1119
|
-
index:
|
|
1119
|
+
index: n++
|
|
1120
1120
|
});
|
|
1121
1121
|
const i = [];
|
|
1122
1122
|
for (const l of this.connectedItems)
|
|
1123
|
-
t.find((h) => h.key === l.key) || l.element.unmount();
|
|
1123
|
+
t.find((h) => h.key === l.key) || l.element.unmount(!1);
|
|
1124
1124
|
for (const l of t) {
|
|
1125
1125
|
const c = this.connectedItems.find((h) => h.key === l.key);
|
|
1126
1126
|
if (c)
|
|
@@ -1152,8 +1152,8 @@ class je {
|
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
|
-
function Be({ $value:
|
|
1156
|
-
return t(
|
|
1155
|
+
function Be({ $value: s, $index: e, renderFn: t }, n) {
|
|
1156
|
+
return t(s, e, n);
|
|
1157
1157
|
}
|
|
1158
1158
|
class Re {
|
|
1159
1159
|
constructor({ value: e }) {
|
|
@@ -1166,25 +1166,25 @@ class Re {
|
|
|
1166
1166
|
return this.node.parentNode != null;
|
|
1167
1167
|
}
|
|
1168
1168
|
async mount(e, t = null) {
|
|
1169
|
-
this.isMounted || (p(this.value) ? this.stopCallback = this.value.watch((
|
|
1170
|
-
this.update(
|
|
1169
|
+
this.isMounted || (p(this.value) ? this.stopCallback = this.value.watch((n) => {
|
|
1170
|
+
this.update(n);
|
|
1171
1171
|
}) : this.update(this.value)), e.insertBefore(this.node, (t == null ? void 0 : t.nextSibling) ?? null);
|
|
1172
1172
|
}
|
|
1173
|
-
async unmount() {
|
|
1174
|
-
this.isMounted && (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.node.parentNode.removeChild(this.node));
|
|
1173
|
+
async unmount(e) {
|
|
1174
|
+
this.isMounted && (this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), e || this.node.parentNode.removeChild(this.node));
|
|
1175
1175
|
}
|
|
1176
1176
|
update(e) {
|
|
1177
1177
|
e != null ? this.node.textContent = e.toString() : this.node.textContent = "";
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
function N(
|
|
1181
|
-
return W(
|
|
1180
|
+
function N(s) {
|
|
1181
|
+
return W(s) && (typeof s.type == "string" || typeof s.type == "function") && Array.isArray(s.children);
|
|
1182
1182
|
}
|
|
1183
|
-
function he(
|
|
1184
|
-
return W(
|
|
1183
|
+
function he(s) {
|
|
1184
|
+
return W(s) && x(s.connect) && x(s.disconnect);
|
|
1185
1185
|
}
|
|
1186
|
-
function V(
|
|
1187
|
-
return M(
|
|
1186
|
+
function V(s) {
|
|
1187
|
+
return M(s) || (s = [s]), s.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
|
|
1188
1188
|
if (e instanceof Node)
|
|
1189
1189
|
return y("$node", { value: e });
|
|
1190
1190
|
if (e instanceof de)
|
|
@@ -1201,38 +1201,38 @@ function V(n) {
|
|
|
1201
1201
|
throw console.error(e), new TypeError(`Unexpected child type. Got: ${e}`);
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
|
-
function y(
|
|
1204
|
+
function y(s, e, ...t) {
|
|
1205
1205
|
return e != null && Ke(e), {
|
|
1206
|
-
type:
|
|
1206
|
+
type: s,
|
|
1207
1207
|
props: e,
|
|
1208
1208
|
children: V(t)
|
|
1209
1209
|
};
|
|
1210
1210
|
}
|
|
1211
|
-
function Ke(
|
|
1212
|
-
if (
|
|
1213
|
-
throw console.warn(
|
|
1214
|
-
for (const e in
|
|
1215
|
-
if (e.startsWith("$$") &&
|
|
1216
|
-
if (!R(
|
|
1217
|
-
throw new TypeError(`Prop '${e}' is named as a SettableState but value is not. Got: ${
|
|
1218
|
-
} else if (e.startsWith("$") &&
|
|
1219
|
-
throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${
|
|
1211
|
+
function Ke(s) {
|
|
1212
|
+
if (s.ref && !ue(s.ref))
|
|
1213
|
+
throw console.warn(s.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${s.ref}`);
|
|
1214
|
+
for (const e in s)
|
|
1215
|
+
if (e.startsWith("$$") && s[e] !== void 0) {
|
|
1216
|
+
if (!R(s[e]))
|
|
1217
|
+
throw new TypeError(`Prop '${e}' is named as a SettableState but value is not. Got: ${s[e]}`);
|
|
1218
|
+
} else if (e.startsWith("$") && s[e] !== void 0 && !p(s[e]))
|
|
1219
|
+
throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${s[e]}`);
|
|
1220
1220
|
}
|
|
1221
1221
|
const nt = Ve.bind(y);
|
|
1222
|
-
function st(
|
|
1223
|
-
const
|
|
1222
|
+
function st(s, e, t) {
|
|
1223
|
+
const n = F(s);
|
|
1224
1224
|
return y("$cond", {
|
|
1225
|
-
$predicate:
|
|
1225
|
+
$predicate: n,
|
|
1226
1226
|
thenContent: e,
|
|
1227
1227
|
elseContent: t
|
|
1228
1228
|
});
|
|
1229
1229
|
}
|
|
1230
|
-
function it(
|
|
1231
|
-
const
|
|
1232
|
-
return y("$repeat", { $items:
|
|
1230
|
+
function it(s, e, t) {
|
|
1231
|
+
const n = F(s);
|
|
1232
|
+
return y("$repeat", { $items: n, keyFn: e, renderFn: t });
|
|
1233
1233
|
}
|
|
1234
|
-
function ot(
|
|
1235
|
-
return y("$portal", { parent:
|
|
1234
|
+
function ot(s, e) {
|
|
1235
|
+
return y("$portal", { parent: s, content: e });
|
|
1236
1236
|
}
|
|
1237
1237
|
class de {
|
|
1238
1238
|
constructor(e) {
|
|
@@ -1249,80 +1249,80 @@ class de {
|
|
|
1249
1249
|
this.node.parentNode && this.node.parentNode.removeChild(this.node);
|
|
1250
1250
|
}
|
|
1251
1251
|
}
|
|
1252
|
-
function C(
|
|
1253
|
-
return (M(e) ? e : [e]).map((
|
|
1254
|
-
if (x(
|
|
1255
|
-
return new q(
|
|
1256
|
-
if ($(
|
|
1257
|
-
switch (
|
|
1252
|
+
function C(s, e) {
|
|
1253
|
+
return (M(e) ? e : [e]).map((n) => {
|
|
1254
|
+
if (x(n.type))
|
|
1255
|
+
return new q(s, n.type, n.props, n.children);
|
|
1256
|
+
if ($(n.type))
|
|
1257
|
+
switch (n.type) {
|
|
1258
1258
|
case "$node": {
|
|
1259
|
-
const i =
|
|
1259
|
+
const i = n.props;
|
|
1260
1260
|
return new de(i.value);
|
|
1261
1261
|
}
|
|
1262
1262
|
case "$text": {
|
|
1263
|
-
const i =
|
|
1263
|
+
const i = n.props;
|
|
1264
1264
|
return new Re({
|
|
1265
1265
|
value: i.value
|
|
1266
1266
|
});
|
|
1267
1267
|
}
|
|
1268
1268
|
case "$cond": {
|
|
1269
|
-
const i =
|
|
1269
|
+
const i = n.props;
|
|
1270
1270
|
return new Te({
|
|
1271
1271
|
$predicate: i.$predicate,
|
|
1272
1272
|
thenContent: i.thenContent,
|
|
1273
1273
|
elseContent: i.elseContent,
|
|
1274
|
-
elementContext:
|
|
1274
|
+
elementContext: s
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|
|
1277
1277
|
case "$repeat": {
|
|
1278
|
-
const i =
|
|
1278
|
+
const i = n.props;
|
|
1279
1279
|
return new je({
|
|
1280
1280
|
$items: i.$items,
|
|
1281
1281
|
keyFn: i.keyFn,
|
|
1282
1282
|
renderFn: i.renderFn,
|
|
1283
|
-
elementContext:
|
|
1283
|
+
elementContext: s
|
|
1284
1284
|
});
|
|
1285
1285
|
}
|
|
1286
1286
|
case "$observer": {
|
|
1287
|
-
const i =
|
|
1287
|
+
const i = n.props;
|
|
1288
1288
|
return new qe({
|
|
1289
1289
|
states: i.states,
|
|
1290
1290
|
renderFn: i.renderFn,
|
|
1291
|
-
elementContext:
|
|
1291
|
+
elementContext: s
|
|
1292
1292
|
});
|
|
1293
1293
|
}
|
|
1294
1294
|
case "$outlet": {
|
|
1295
|
-
const i =
|
|
1295
|
+
const i = n.props;
|
|
1296
1296
|
return new Le({
|
|
1297
1297
|
$children: i.$children,
|
|
1298
|
-
elementContext:
|
|
1298
|
+
elementContext: s
|
|
1299
1299
|
});
|
|
1300
1300
|
}
|
|
1301
1301
|
case "$portal": {
|
|
1302
|
-
const i =
|
|
1302
|
+
const i = n.props;
|
|
1303
1303
|
return new Ie({
|
|
1304
1304
|
content: i.content,
|
|
1305
1305
|
parent: i.parent,
|
|
1306
|
-
elementContext:
|
|
1306
|
+
elementContext: s
|
|
1307
1307
|
});
|
|
1308
1308
|
}
|
|
1309
1309
|
default:
|
|
1310
|
-
if (
|
|
1311
|
-
throw new Error(`Unknown markup type: ${
|
|
1310
|
+
if (n.type.startsWith("$"))
|
|
1311
|
+
throw new Error(`Unknown markup type: ${n.type}`);
|
|
1312
1312
|
return new Ue({
|
|
1313
|
-
tag:
|
|
1314
|
-
props:
|
|
1315
|
-
children:
|
|
1316
|
-
elementContext:
|
|
1313
|
+
tag: n.type,
|
|
1314
|
+
props: n.props ?? {},
|
|
1315
|
+
children: n.children,
|
|
1316
|
+
elementContext: s
|
|
1317
1317
|
});
|
|
1318
1318
|
}
|
|
1319
1319
|
else
|
|
1320
|
-
throw new TypeError(`Expected a string or view function. Got: ${
|
|
1320
|
+
throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
|
|
1321
1321
|
});
|
|
1322
1322
|
}
|
|
1323
|
-
function E(
|
|
1324
|
-
if (
|
|
1325
|
-
return
|
|
1323
|
+
function E(s) {
|
|
1324
|
+
if (s.length === 1)
|
|
1325
|
+
return s[0];
|
|
1326
1326
|
const e = document.createComment("Fragment");
|
|
1327
1327
|
let t = !1;
|
|
1328
1328
|
return {
|
|
@@ -1332,29 +1332,29 @@ function E(n) {
|
|
|
1332
1332
|
get isMounted() {
|
|
1333
1333
|
return t;
|
|
1334
1334
|
},
|
|
1335
|
-
mount(
|
|
1335
|
+
mount(n, i) {
|
|
1336
1336
|
var o;
|
|
1337
|
-
|
|
1338
|
-
for (const u of
|
|
1339
|
-
const a = ((o =
|
|
1340
|
-
u.mount(
|
|
1337
|
+
n.insertBefore(e, i || null);
|
|
1338
|
+
for (const u of s) {
|
|
1339
|
+
const a = ((o = s[s.length - 1]) == null ? void 0 : o.node) ?? e;
|
|
1340
|
+
u.mount(n, a);
|
|
1341
1341
|
}
|
|
1342
1342
|
t = !0;
|
|
1343
1343
|
},
|
|
1344
|
-
unmount() {
|
|
1344
|
+
unmount(n) {
|
|
1345
1345
|
if (t) {
|
|
1346
|
-
for (const
|
|
1347
|
-
|
|
1346
|
+
for (const i of s)
|
|
1347
|
+
i.unmount(!0);
|
|
1348
1348
|
e.remove();
|
|
1349
1349
|
}
|
|
1350
1350
|
t = !1;
|
|
1351
1351
|
}
|
|
1352
1352
|
};
|
|
1353
1353
|
}
|
|
1354
|
-
function fe(
|
|
1355
|
-
return
|
|
1354
|
+
function fe(s) {
|
|
1355
|
+
return s == null || s === !1 || typeof s == "string" || typeof s == "number" || N(s) || p(s) || ie(fe, s);
|
|
1356
1356
|
}
|
|
1357
|
-
function rt(
|
|
1357
|
+
function rt(s, e) {
|
|
1358
1358
|
return e.outlet();
|
|
1359
1359
|
}
|
|
1360
1360
|
export {
|
|
@@ -1390,4 +1390,4 @@ export {
|
|
|
1390
1390
|
E as y,
|
|
1391
1391
|
C as z
|
|
1392
1392
|
};
|
|
1393
|
-
//# sourceMappingURL=passthrough-
|
|
1393
|
+
//# sourceMappingURL=passthrough-DrILnMr2.js.map
|