@manyducks.co/dolla 2.0.0-alpha.24 → 2.0.0-alpha.26
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/core/dolla.d.ts +3 -4
- package/dist/core/markup.d.ts +1 -6
- package/dist/core/nodes/observer.d.ts +7 -11
- package/dist/core/nodes/outlet.d.ts +6 -5
- package/dist/core/nodes/repeat.d.ts +1 -2
- package/dist/core/nodes/view.d.ts +1 -0
- package/dist/core/state.d.ts +44 -35
- package/dist/index.d.ts +4 -4
- package/dist/index.js +94 -97
- 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-BeKX_qRr.js → passthrough-CACEgFx5.js} +394 -546
- package/dist/passthrough-CACEgFx5.js.map +1 -0
- package/dist/types.d.ts +2 -2
- package/docs/states.md +3 -50
- package/notes/scratch.md +112 -11
- package/package.json +1 -1
- package/dist/core/nodes/cond.d.ts +0 -28
- package/dist/passthrough-BeKX_qRr.js.map +0 -1
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (s, t, e) =>
|
|
4
|
-
function
|
|
1
|
+
var St = Object.defineProperty;
|
|
2
|
+
var Mt = (s, t, e) => t in s ? St(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
|
|
3
|
+
var o = (s, t, e) => Mt(s, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
function ct(s) {
|
|
5
5
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
6
6
|
}
|
|
7
|
-
var O = { exports: {} },
|
|
8
|
-
function
|
|
9
|
-
return
|
|
7
|
+
var O = { exports: {} }, Y;
|
|
8
|
+
function Et() {
|
|
9
|
+
return Y || (Y = 1, function(s, t) {
|
|
10
10
|
Object.defineProperty(t, "__esModule", { value: !0 });
|
|
11
11
|
var e = /* @__PURE__ */ function() {
|
|
12
|
-
function
|
|
13
|
-
var
|
|
12
|
+
function l(c, f) {
|
|
13
|
+
var h = [], d = !0, m = !1, g = void 0;
|
|
14
14
|
try {
|
|
15
|
-
for (var
|
|
16
|
-
} catch (
|
|
17
|
-
m = !0,
|
|
15
|
+
for (var M, k = c[Symbol.iterator](); !(d = (M = k.next()).done) && (h.push(M.value), !(f && h.length === f)); d = !0) ;
|
|
16
|
+
} catch (w) {
|
|
17
|
+
m = !0, g = w;
|
|
18
18
|
} finally {
|
|
19
19
|
try {
|
|
20
|
-
!d &&
|
|
20
|
+
!d && k.return && k.return();
|
|
21
21
|
} finally {
|
|
22
|
-
if (m) throw
|
|
22
|
+
if (m) throw g;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return h;
|
|
26
26
|
}
|
|
27
|
-
return function(
|
|
28
|
-
if (Array.isArray(
|
|
29
|
-
if (Symbol.iterator in Object(
|
|
27
|
+
return function(c, f) {
|
|
28
|
+
if (Array.isArray(c)) return c;
|
|
29
|
+
if (Symbol.iterator in Object(c)) return l(c, f);
|
|
30
30
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
31
31
|
};
|
|
32
|
-
}(), n = function(
|
|
33
|
-
return
|
|
34
|
-
return 16 >
|
|
32
|
+
}(), n = function(l) {
|
|
33
|
+
return l.reduce(function(c, f) {
|
|
34
|
+
return 16 > f ? c + "0" + f.toString(16) : c + f.toString(16);
|
|
35
35
|
}, "#");
|
|
36
|
-
}, r = function(
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
return
|
|
40
|
-
},
|
|
41
|
-
return [
|
|
42
|
-
}, i = function(
|
|
43
|
-
var d =
|
|
44
|
-
return
|
|
45
|
-
},
|
|
46
|
-
return [
|
|
47
|
-
}, u = function(
|
|
48
|
-
return
|
|
49
|
-
return
|
|
36
|
+
}, r = function(l, c, f) {
|
|
37
|
+
var h = 0.5 > f ? f * (1 + c) : f + c - f * c, d = 2 * f - h, m = function(w, b, v) {
|
|
38
|
+
var W = Math.round, y = 0 > v ? v + 1 : 1 < v ? v - 1 : v;
|
|
39
|
+
return y = y < 1 / 6 ? w + 6 * (b - w) * y : y < 1 / 2 ? b : y < 2 / 3 ? w + 6 * (b - w) * (2 / 3 - y) : w, W(255 * y);
|
|
40
|
+
}, g = m(d, h, l + 1 / 3), M = m(d, h, l), k = m(d, h, l - 1 / 3);
|
|
41
|
+
return [g, M, k];
|
|
42
|
+
}, i = function(l, c, f, h) {
|
|
43
|
+
var d = l % 1007 / 1007, m = function(w, b, v) {
|
|
44
|
+
return w * (v - b) + b;
|
|
45
|
+
}, g = m(d, c.min, c.max), M = m(d, f.min, f.max), k = m(d, h.max, h.min);
|
|
46
|
+
return [g, M, k];
|
|
47
|
+
}, u = function(l) {
|
|
48
|
+
return l.split("").reduce(function(c, f, h) {
|
|
49
|
+
return c * f.charCodeAt(0) * h + 1;
|
|
50
50
|
}, 1);
|
|
51
|
-
},
|
|
52
|
-
var
|
|
53
|
-
return v === "hsl" ? [
|
|
51
|
+
}, a = function(l) {
|
|
52
|
+
var c = l.str, f = l.hue, h = f === void 0 ? { min: 0, max: 360 } : f, d = l.sat, m = d === void 0 ? { min: 0.35, max: 0.65 } : d, g = l.light, M = g === void 0 ? { min: 0.3, max: 0.7 } : g, k = l.hashFunction, w = k === void 0 ? u : k, b = l.scheme, v = b === void 0 ? "hex" : b, W = i(w(c), h, m, M), y = e(W, 3), R = y[0], B = y[1], K = y[2], H = r(R / 360, B, K), Ct = n(H);
|
|
53
|
+
return v === "hsl" ? [R, B, K] : v === "rgb" ? H : Ct;
|
|
54
54
|
};
|
|
55
|
-
t.default =
|
|
55
|
+
t.default = a, s.exports = t.default;
|
|
56
56
|
}(O, O.exports)), O.exports;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
const
|
|
58
|
+
var xt = Et();
|
|
59
|
+
const At = /* @__PURE__ */ ct(xt);
|
|
60
60
|
function N(s) {
|
|
61
61
|
const t = typeof s;
|
|
62
62
|
switch (t) {
|
|
@@ -72,63 +72,63 @@ function N(s) {
|
|
|
72
72
|
return t;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function Jt(s, t) {
|
|
76
76
|
if (!s)
|
|
77
77
|
throw new TypeError(
|
|
78
|
-
|
|
78
|
+
q(s, t || "Failed assertion. Value is not truthy. Got type: %t, value: %v")
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function $(s) {
|
|
82
82
|
return Array.isArray(s);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
const t = s[0], e = (n) =>
|
|
84
|
+
function at(...s) {
|
|
85
|
+
const t = s[0], e = (n) => $(n) && n.every((r) => t(r));
|
|
86
86
|
return s.length < 2 ? e : e(s[1]);
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
const t = s[0], e =
|
|
90
|
-
if (
|
|
88
|
+
function Qt(...s) {
|
|
89
|
+
const t = s[0], e = E(s[2]) ? s[2] : "Expected an array of valid items. Got type: %t, value: %v", n = (r) => {
|
|
90
|
+
if ($(r) && r.every((i) => t(i)))
|
|
91
91
|
return !0;
|
|
92
|
-
throw new TypeError(
|
|
92
|
+
throw new TypeError(q(r, e));
|
|
93
93
|
};
|
|
94
94
|
return s.length < 2 ? n : n(s[1]);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function E(s) {
|
|
97
97
|
return typeof s == "string";
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
if (
|
|
99
|
+
function te(s, t) {
|
|
100
|
+
if (E(s))
|
|
101
101
|
return !0;
|
|
102
|
-
throw new TypeError(
|
|
102
|
+
throw new TypeError(q(s, t ?? "Expected a string. Got type: %t, value: %v"));
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
return typeof s == "function" &&
|
|
104
|
+
function V(s) {
|
|
105
|
+
return typeof s == "function" && !$t(s);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function lt(s) {
|
|
108
108
|
return typeof s == "number" && !isNaN(s);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function $t(s) {
|
|
111
111
|
return typeof s == "function" && /^\s*class\s+/.test(s.toString());
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
const t = s[0], e =
|
|
113
|
+
function ee(...s) {
|
|
114
|
+
const t = s[0], e = E(s[2]) ? s[2] : `Expected instance of ${t.name}. Got type: %t, value: %v`, n = (r) => {
|
|
115
115
|
if (r instanceof t)
|
|
116
116
|
return !0;
|
|
117
|
-
throw new TypeError(
|
|
117
|
+
throw new TypeError(q(r, e));
|
|
118
118
|
};
|
|
119
119
|
return s.length < 2 ? n : n(s[1]);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
return s != null && typeof s == "object" &&
|
|
121
|
+
function ht(s) {
|
|
122
|
+
return s != null && typeof s == "object" && !$(s);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function q(s, t) {
|
|
125
125
|
var r;
|
|
126
126
|
const e = N(s), n = ((r = s == null ? void 0 : s.toString) == null ? void 0 : r.call(s)) || String(s);
|
|
127
127
|
return t.replaceAll("%t", e).replaceAll("%v", n);
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
return
|
|
129
|
+
var F, Z;
|
|
130
|
+
function Nt() {
|
|
131
|
+
return Z || (Z = 1, F = function s(t, e) {
|
|
132
132
|
if (t === e) return !0;
|
|
133
133
|
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
134
134
|
if (t.constructor !== e.constructor) return !1;
|
|
@@ -172,19 +172,19 @@ function Lt() {
|
|
|
172
172
|
return !0;
|
|
173
173
|
}
|
|
174
174
|
return t !== t && e !== e;
|
|
175
|
-
}),
|
|
175
|
+
}), F;
|
|
176
176
|
}
|
|
177
|
-
var
|
|
178
|
-
const
|
|
177
|
+
var Ot = Nt();
|
|
178
|
+
const Vt = /* @__PURE__ */ ct(Ot), Tt = () => {
|
|
179
179
|
};
|
|
180
|
-
let
|
|
181
|
-
function
|
|
182
|
-
return
|
|
180
|
+
let U = 1;
|
|
181
|
+
function ft() {
|
|
182
|
+
return U = U % Number.MAX_SAFE_INTEGER + 1, U.toString(36) + Date.now().toString(36);
|
|
183
183
|
}
|
|
184
|
-
function
|
|
184
|
+
function dt(s, t) {
|
|
185
185
|
return s === t;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
187
|
+
function ne(s, t) {
|
|
188
188
|
if (s === t) return !0;
|
|
189
189
|
const e = N(s);
|
|
190
190
|
if (e !== N(t))
|
|
@@ -208,7 +208,7 @@ function pe(s, t) {
|
|
|
208
208
|
if (s[r] !== t[r]) return !1;
|
|
209
209
|
return !0;
|
|
210
210
|
case "set":
|
|
211
|
-
if (
|
|
211
|
+
if (V(s.symmetricDifference))
|
|
212
212
|
return s.symmetricDifference(t).size === 0;
|
|
213
213
|
for (const r of s.keys())
|
|
214
214
|
if (s[r] !== t.get(r)) return !1;
|
|
@@ -216,8 +216,8 @@ function pe(s, t) {
|
|
|
216
216
|
}
|
|
217
217
|
return !1;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
function
|
|
219
|
+
const se = Vt;
|
|
220
|
+
function Pt(s, t) {
|
|
221
221
|
const e = (n) => {
|
|
222
222
|
const r = {};
|
|
223
223
|
for (const i in n)
|
|
@@ -226,14 +226,14 @@ function Gt(s, t) {
|
|
|
226
226
|
};
|
|
227
227
|
return t == null ? e : e(t);
|
|
228
228
|
}
|
|
229
|
-
function
|
|
230
|
-
return
|
|
229
|
+
function qt(s) {
|
|
230
|
+
return At({
|
|
231
231
|
str: s,
|
|
232
232
|
sat: { min: 0.35, max: 0.55 },
|
|
233
233
|
light: { min: 0.6, max: 0.6 }
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function re(s) {
|
|
237
237
|
if (s instanceof RegExp)
|
|
238
238
|
return (n) => s.test(n);
|
|
239
239
|
const t = {
|
|
@@ -255,7 +255,7 @@ function ge(s) {
|
|
|
255
255
|
return !(i.some((u) => u(n)) || r.length > 0 && !r.some((u) => u(n)));
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const pt = Symbol.for("DollaState"), mt = Symbol.for("DollaRef"), gt = Symbol.for("DollaMarkup"), S = Symbol.for("DollaMarkupElement"), T = {
|
|
259
259
|
watcherCount: 0,
|
|
260
260
|
increment() {
|
|
261
261
|
this.watcherCount++, this._log();
|
|
@@ -270,7 +270,7 @@ const T = Symbol.for("DollaState"), D = Symbol.for("DollaSettableState"), St = S
|
|
|
270
270
|
console.log(
|
|
271
271
|
`%c[DOLLA_DEV_DEBUG] %c${this._label}%c%c%c`,
|
|
272
272
|
"color:#e44c4c;font-weight:bold",
|
|
273
|
-
`color:${
|
|
273
|
+
`color:${qt(this._label)};font-weight:bold`,
|
|
274
274
|
"color:#777",
|
|
275
275
|
"color:#aaa",
|
|
276
276
|
"color:#777",
|
|
@@ -280,32 +280,29 @@ const T = Symbol.for("DollaState"), D = Symbol.for("DollaSettableState"), St = S
|
|
|
280
280
|
}
|
|
281
281
|
};
|
|
282
282
|
function p(s) {
|
|
283
|
-
return (s == null ? void 0 : s[
|
|
283
|
+
return (s == null ? void 0 : s[pt]) === !0;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
return (s == null ? void 0 : s[
|
|
285
|
+
function Wt(s) {
|
|
286
|
+
return (s == null ? void 0 : s[mt]) === !0;
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
return (s == null ? void 0 : s[St]) === !0;
|
|
290
|
-
}
|
|
291
|
-
function Bt(s) {
|
|
288
|
+
function Ft(s) {
|
|
292
289
|
return p(s) ? s.get() : s;
|
|
293
290
|
}
|
|
294
|
-
function
|
|
295
|
-
return
|
|
291
|
+
function j(s) {
|
|
292
|
+
return p(s) ? s : new L({
|
|
296
293
|
get() {
|
|
297
294
|
return s;
|
|
298
295
|
},
|
|
299
296
|
watch(t, e = {}) {
|
|
300
|
-
return e != null && e.lazy || t(s),
|
|
297
|
+
return e != null && e.lazy || t(s), Tt;
|
|
301
298
|
}
|
|
302
299
|
});
|
|
303
300
|
}
|
|
304
|
-
class
|
|
301
|
+
class Ut {
|
|
305
302
|
constructor(t, e) {
|
|
306
303
|
o(this, "value");
|
|
307
304
|
o(this, "watchers", []);
|
|
308
|
-
o(this, "equals",
|
|
305
|
+
o(this, "equals", dt);
|
|
309
306
|
this.value = t, e != null && e.equals && (this.equals = e.equals);
|
|
310
307
|
}
|
|
311
308
|
get() {
|
|
@@ -323,79 +320,36 @@ class z {
|
|
|
323
320
|
}
|
|
324
321
|
}
|
|
325
322
|
watch(t, e) {
|
|
326
|
-
return this.watchers.push(t), e != null && e.lazy || t(this.value),
|
|
323
|
+
return this.watchers.push(t), e != null && e.lazy || t(this.value), T.increment(), () => {
|
|
327
324
|
const n = this.watchers.indexOf(t);
|
|
328
|
-
n > -1 && this.watchers.splice(n, 1),
|
|
325
|
+
n > -1 && this.watchers.splice(n, 1), T.decrement();
|
|
329
326
|
};
|
|
330
327
|
}
|
|
331
328
|
}
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
class
|
|
329
|
+
var Q;
|
|
330
|
+
Q = pt;
|
|
331
|
+
class L {
|
|
335
332
|
constructor(t) {
|
|
336
333
|
// Instances will pass isState() with this symbol
|
|
337
|
-
o(this,
|
|
338
|
-
o(this, "__value");
|
|
339
|
-
if (t == null)
|
|
340
|
-
throw new TypeError("Value is null");
|
|
341
|
-
this.__value = t;
|
|
342
|
-
}
|
|
343
|
-
get() {
|
|
344
|
-
return this.__value.get();
|
|
345
|
-
}
|
|
346
|
-
watch(t, e) {
|
|
347
|
-
return this.__value.watch(t, e);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
function G(s, t) {
|
|
351
|
-
const e = new z(s, t);
|
|
352
|
-
return [new q(e), (r) => e.set(r)];
|
|
353
|
-
}
|
|
354
|
-
var rt, it;
|
|
355
|
-
it = T, rt = D;
|
|
356
|
-
class zt {
|
|
357
|
-
constructor(t) {
|
|
358
|
-
// Instances will pass isState() and isSettableState() with these symbols
|
|
359
|
-
o(this, it, !0);
|
|
360
|
-
o(this, rt, !0);
|
|
334
|
+
o(this, Q, !0);
|
|
361
335
|
o(this, "__value");
|
|
362
|
-
if (t == null)
|
|
363
|
-
throw new TypeError("Value is null");
|
|
364
336
|
this.__value = t;
|
|
365
337
|
}
|
|
366
338
|
get() {
|
|
367
339
|
return this.__value.get();
|
|
368
340
|
}
|
|
369
|
-
set(t) {
|
|
370
|
-
this.__value.set(t);
|
|
371
|
-
}
|
|
372
341
|
watch(t, e) {
|
|
373
342
|
return this.__value.watch(t, e);
|
|
374
343
|
}
|
|
375
344
|
}
|
|
376
|
-
function
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
function ye(s, t) {
|
|
380
|
-
return {
|
|
381
|
-
[T]: !0,
|
|
382
|
-
[D]: !0,
|
|
383
|
-
get: s.get.bind(s),
|
|
384
|
-
watch: s.watch.bind(s),
|
|
385
|
-
set: t
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
function _e(s, t) {
|
|
389
|
-
return function(n) {
|
|
390
|
-
const r = s.get();
|
|
391
|
-
let i;
|
|
392
|
-
typeof n == "function" ? i = n(r) : i = n, t(i, r);
|
|
393
|
-
};
|
|
345
|
+
function I(s, t) {
|
|
346
|
+
const e = new Ut(s, t);
|
|
347
|
+
return [new L(e), (r) => e.set(r)];
|
|
394
348
|
}
|
|
395
|
-
const
|
|
396
|
-
class
|
|
349
|
+
const X = Symbol("EMPTY");
|
|
350
|
+
class It {
|
|
397
351
|
constructor(t, e, n) {
|
|
398
|
-
o(this, "equals",
|
|
352
|
+
o(this, "equals", dt);
|
|
399
353
|
/**
|
|
400
354
|
* Array of states this holder's value is derived from.
|
|
401
355
|
*/
|
|
@@ -407,7 +361,7 @@ class Kt {
|
|
|
407
361
|
/**
|
|
408
362
|
*
|
|
409
363
|
*/
|
|
410
|
-
o(this, "sourceWatcher",
|
|
364
|
+
o(this, "sourceWatcher", D());
|
|
411
365
|
/**
|
|
412
366
|
* Array of functions awaiting notification when this holder's value changes.
|
|
413
367
|
*/
|
|
@@ -423,7 +377,7 @@ class Kt {
|
|
|
423
377
|
/**
|
|
424
378
|
* The current value as returned from `fn` (may be a State)
|
|
425
379
|
*/
|
|
426
|
-
o(this, "value",
|
|
380
|
+
o(this, "value", X);
|
|
427
381
|
/**
|
|
428
382
|
* The current unwrapped value.
|
|
429
383
|
*/
|
|
@@ -432,7 +386,7 @@ class Kt {
|
|
|
432
386
|
* When value is a State, this function will stop watching its value.
|
|
433
387
|
*/
|
|
434
388
|
o(this, "stopWatchingCurrentValue");
|
|
435
|
-
this.sources = t.map(
|
|
389
|
+
this.sources = t.map(j), this.fn = e, n != null && n.equals && (this.equals = n.equals), this.previousSourceValues = new Array(t.length).fill(X, 0, t.length);
|
|
436
390
|
}
|
|
437
391
|
/*==========================*\
|
|
438
392
|
|| "Public" methods ||
|
|
@@ -443,8 +397,8 @@ class Kt {
|
|
|
443
397
|
watch(t, e) {
|
|
444
398
|
this.isWatchingSources || this.startWatchingSources();
|
|
445
399
|
const n = this.watchers;
|
|
446
|
-
return n.push(t), e != null && e.lazy || t(this.rawValue),
|
|
447
|
-
n.splice(n.indexOf(t), 1), this.isWatchingSources && n.length === 0 && this.stopWatchingSources(),
|
|
400
|
+
return n.push(t), e != null && e.lazy || t(this.rawValue), T.increment(), () => {
|
|
401
|
+
n.splice(n.indexOf(t), 1), this.isWatchingSources && n.length === 0 && this.stopWatchingSources(), T.decrement();
|
|
448
402
|
};
|
|
449
403
|
}
|
|
450
404
|
/*==========================*\
|
|
@@ -465,7 +419,7 @@ class Kt {
|
|
|
465
419
|
return this.isWatchingSources || this.update(), this.rawValue;
|
|
466
420
|
}
|
|
467
421
|
setValue(t) {
|
|
468
|
-
this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = t, this.rawValue =
|
|
422
|
+
this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = t, this.rawValue = Ft(t), this.isWatchingSources && p(t) ? this.stopWatchingCurrentValue = t.watch((e) => {
|
|
469
423
|
this.rawValue = e, this.notify(e);
|
|
470
424
|
}) : this.notify(this.rawValue);
|
|
471
425
|
}
|
|
@@ -486,45 +440,29 @@ class Kt {
|
|
|
486
440
|
this.sourceWatcher.stopAll(), this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.isWatchingSources = !1;
|
|
487
441
|
}
|
|
488
442
|
}
|
|
489
|
-
function
|
|
490
|
-
const n = new
|
|
491
|
-
return new
|
|
492
|
-
}
|
|
493
|
-
var ot, ut;
|
|
494
|
-
ut = St, ot = T;
|
|
495
|
-
class Yt {
|
|
496
|
-
constructor(t) {
|
|
497
|
-
// Instances will pass isRef() and isState() with these symbols
|
|
498
|
-
o(this, ut, !0);
|
|
499
|
-
o(this, ot, !0);
|
|
500
|
-
o(this, "__value");
|
|
501
|
-
this.__value = t;
|
|
502
|
-
}
|
|
503
|
-
get() {
|
|
504
|
-
return this.__value.get();
|
|
505
|
-
}
|
|
506
|
-
watch(t, e) {
|
|
507
|
-
return this.__value.watch(t, e);
|
|
508
|
-
}
|
|
509
|
-
get node() {
|
|
510
|
-
return this.__value.get();
|
|
511
|
-
}
|
|
512
|
-
set node(t) {
|
|
513
|
-
this.__value.set(t);
|
|
514
|
-
}
|
|
443
|
+
function jt(s, t, e) {
|
|
444
|
+
const n = new It(s, t, e);
|
|
445
|
+
return new L(n);
|
|
515
446
|
}
|
|
516
|
-
function
|
|
517
|
-
|
|
447
|
+
function ie(s) {
|
|
448
|
+
const t = function() {
|
|
449
|
+
if (arguments.length === 1)
|
|
450
|
+
s = arguments[0];
|
|
451
|
+
else if (arguments.length > 1)
|
|
452
|
+
throw new Error(`Too many arguments. Expected 0 or 1. Got: ${arguments.length}`);
|
|
453
|
+
return s;
|
|
454
|
+
};
|
|
455
|
+
return t[mt] = !0, t;
|
|
518
456
|
}
|
|
519
|
-
function
|
|
457
|
+
function D() {
|
|
520
458
|
const s = [];
|
|
521
459
|
return {
|
|
522
460
|
watch(t, e) {
|
|
523
461
|
if (t.length === 0)
|
|
524
462
|
throw new TypeError("Expected at least one state to watch.");
|
|
525
|
-
t = t.map(
|
|
463
|
+
t = t.map(j);
|
|
526
464
|
let n;
|
|
527
|
-
return t.length > 1 ? n =
|
|
465
|
+
return t.length > 1 ? n = jt(t, e).watch(() => null) : n = t[0].watch(e), s.push(n), () => {
|
|
528
466
|
let r = s.indexOf(n);
|
|
529
467
|
r > -1 && s.splice(r, 1), n();
|
|
530
468
|
};
|
|
@@ -535,88 +473,42 @@ function K() {
|
|
|
535
473
|
}
|
|
536
474
|
};
|
|
537
475
|
}
|
|
538
|
-
function
|
|
539
|
-
for (var t, e, n = arguments, r = 1, i = "", u = "",
|
|
540
|
-
r === 1 && (
|
|
541
|
-
},
|
|
542
|
-
|
|
543
|
-
for (var
|
|
544
|
-
` || t === "\r" ? (
|
|
545
|
-
}
|
|
546
|
-
return a(), c.length > 2 ? c.slice(1) : c[1];
|
|
547
|
-
}
|
|
548
|
-
var at;
|
|
549
|
-
at = b;
|
|
550
|
-
class Xt {
|
|
551
|
-
constructor(t) {
|
|
552
|
-
o(this, at, !0);
|
|
553
|
-
o(this, "node");
|
|
554
|
-
o(this, "endNode");
|
|
555
|
-
o(this, "$predicate");
|
|
556
|
-
o(this, "stopCallback");
|
|
557
|
-
o(this, "thenContent");
|
|
558
|
-
o(this, "elseContent");
|
|
559
|
-
o(this, "connectedContent", []);
|
|
560
|
-
o(this, "elementContext");
|
|
561
|
-
o(this, "initialUpdateHappened", !1);
|
|
562
|
-
o(this, "previousValue");
|
|
563
|
-
this.$predicate = t.$predicate, this.thenContent = t.thenContent ? A(t.thenContent) : void 0, this.elseContent = t.elseContent ? A(t.elseContent) : void 0, this.elementContext = t.elementContext, this.elementContext.root.getEnv() === "development" ? (this.node = document.createComment("Conditional"), this.endNode = document.createComment("/Conditional")) : (this.node = document.createTextNode(""), this.endNode = document.createTextNode(""));
|
|
564
|
-
}
|
|
565
|
-
get isMounted() {
|
|
566
|
-
return this.node.parentNode != null;
|
|
567
|
-
}
|
|
568
|
-
mount(t, e) {
|
|
569
|
-
this.isMounted || (t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), this.elementContext.root.getEnv() === "development" && t.insertBefore(this.endNode, this.node.nextSibling), this.stopCallback = this.$predicate.watch((n) => {
|
|
570
|
-
(!this.initialUpdateHappened || n && !this.previousValue || !n && this.previousValue) && (this.update(n), this.initialUpdateHappened = !0, this.previousValue = n);
|
|
571
|
-
}));
|
|
572
|
-
}
|
|
573
|
-
unmount(t = !1) {
|
|
574
|
-
var e, n;
|
|
575
|
-
this.stopCallback && (this.stopCallback(), this.stopCallback = void 0);
|
|
576
|
-
for (const r of this.connectedContent)
|
|
577
|
-
r.unmount(t);
|
|
578
|
-
this.connectedContent = [], this.isMounted && ((e = this.node.parentNode) == null || e.removeChild(this.node), (n = this.endNode.parentNode) == null || n.removeChild(this.endNode));
|
|
579
|
-
}
|
|
580
|
-
update(t) {
|
|
581
|
-
var e;
|
|
582
|
-
for (const n of this.connectedContent)
|
|
583
|
-
n.unmount(!1);
|
|
584
|
-
if (this.connectedContent = [], this.node.parentNode != null) {
|
|
585
|
-
t && this.thenContent ? this.connectedContent = _(this.elementContext, this.thenContent) : !t && this.elseContent && (this.connectedContent = _(this.elementContext, this.elseContent));
|
|
586
|
-
for (let n = 0; n < this.connectedContent.length; n++) {
|
|
587
|
-
const r = this.connectedContent[n], i = ((e = this.connectedContent[n - 1]) == null ? void 0 : e.node) ?? this.node;
|
|
588
|
-
r.mount(this.node.parentNode, i);
|
|
589
|
-
}
|
|
590
|
-
this.elementContext.root.getEnv() === "development" && (this.node.textContent = `Conditional (${t ? "truthy" : "falsy"})`);
|
|
591
|
-
}
|
|
476
|
+
function Lt(s) {
|
|
477
|
+
for (var t, e, n = arguments, r = 1, i = "", u = "", a = [0], l = function(h) {
|
|
478
|
+
r === 1 && (h || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(h ? n[h] : i) : r === 3 && (h || i) ? (a[1] = h ? n[h] : i, r = 2) : r === 2 && i === "..." && h ? a[2] = Object.assign(a[2] || {}, n[h]) : r === 2 && i && !h ? (a[2] = a[2] || {})[i] = !0 : r >= 5 && (r === 5 ? ((a[2] = a[2] || {})[e] = h ? i ? i + n[h] : n[h] : i, r = 6) : (h || i) && (a[2][e] += h ? i + n[h] : i)), i = "";
|
|
479
|
+
}, c = 0; c < s.length; c++) {
|
|
480
|
+
c && (r === 1 && l(), l(c));
|
|
481
|
+
for (var f = 0; f < s[c].length; f++) t = s[c][f], r === 1 ? t === "<" ? (l(), a = [a, "", null], r = 3) : i += t : r === 4 ? i === "--" && t === ">" ? (r = 1, i = "") : i = t + i[0] : u ? t === u ? u = "" : i += t : t === '"' || t === "'" ? u = t : t === ">" ? (l(), r = 1) : r && (t === "=" ? (r = 5, e = i, i = "") : t === "/" && (r < 5 || s[c][f + 1] === ">") ? (l(), r === 3 && (a = a[0]), r = a, (a = a[0]).push(this.apply(null, r.slice(1))), r = 0) : t === " " || t === " " || t === `
|
|
482
|
+
` || t === "\r" ? (l(), r = 2) : i += t), r === 3 && i === "!--" && (r = 4, a = a[0]);
|
|
592
483
|
}
|
|
484
|
+
return l(), a.length > 2 ? a.slice(1) : a[1];
|
|
593
485
|
}
|
|
594
|
-
const
|
|
595
|
-
var
|
|
596
|
-
|
|
597
|
-
class
|
|
486
|
+
const Dt = (s) => /^on[A-Z]/.test(s);
|
|
487
|
+
var tt;
|
|
488
|
+
tt = S;
|
|
489
|
+
class Gt {
|
|
598
490
|
constructor({ tag: t, props: e, children: n, elementContext: r }) {
|
|
599
|
-
o(this,
|
|
491
|
+
o(this, tt, !0);
|
|
600
492
|
o(this, "node");
|
|
601
493
|
o(this, "props");
|
|
602
494
|
o(this, "children");
|
|
603
495
|
o(this, "stopCallbacks", []);
|
|
604
496
|
o(this, "elementContext");
|
|
605
|
-
o(this, "uniqueId",
|
|
497
|
+
o(this, "uniqueId", ft());
|
|
606
498
|
o(this, "_batchWrite");
|
|
607
499
|
// Track the ref so we can nullify it on unmount.
|
|
608
500
|
o(this, "ref");
|
|
609
501
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
610
502
|
o(this, "canClickAway", !1);
|
|
611
503
|
if (r = { ...r }, this._batchWrite = r.root.batch.write.bind(r.root.batch), t.toLowerCase() === "svg" && (r.isSVG = !0), r.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", t) : this.node = document.createElement(t), r.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), e.ref)
|
|
612
|
-
if (
|
|
613
|
-
this.ref = e.ref, this.ref
|
|
504
|
+
if (Wt(e.ref))
|
|
505
|
+
this.ref = e.ref, this.ref(this.node);
|
|
614
506
|
else
|
|
615
|
-
throw new Error("Expected ref to be a
|
|
507
|
+
throw new Error("Expected ref to be a function. Got: " + e.ref);
|
|
616
508
|
this.props = {
|
|
617
|
-
...
|
|
509
|
+
...Pt(["ref", "class", "className"], e),
|
|
618
510
|
class: e.className ?? e.class
|
|
619
|
-
}, this.children = n ?
|
|
511
|
+
}, this.children = n ? C(r, n) : [], this.elementContext = r;
|
|
620
512
|
}
|
|
621
513
|
get isMounted() {
|
|
622
514
|
return this.node.parentNode != null;
|
|
@@ -625,8 +517,10 @@ class Qt {
|
|
|
625
517
|
if (t == null)
|
|
626
518
|
throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${t}`);
|
|
627
519
|
if (!this.isMounted) {
|
|
628
|
-
for (
|
|
629
|
-
n
|
|
520
|
+
for (let n = 0; n < this.children.length; n++) {
|
|
521
|
+
const r = this.children[n], i = n > 0 ? this.children[n - 1].node : void 0;
|
|
522
|
+
r.mount(this.node, i);
|
|
523
|
+
}
|
|
630
524
|
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);
|
|
631
525
|
}
|
|
632
526
|
t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), setTimeout(() => {
|
|
@@ -638,7 +532,7 @@ class Qt {
|
|
|
638
532
|
if (this.isMounted) {
|
|
639
533
|
for (const n of this.children)
|
|
640
534
|
n.unmount(!0);
|
|
641
|
-
t || (e = this.node.parentNode) == null || e.removeChild(this.node), this.ref &&
|
|
535
|
+
t || (e = this.node.parentNode) == null || e.removeChild(this.node), this.ref && this.ref(void 0), this.canClickAway = !1;
|
|
642
536
|
for (const n of this.stopCallbacks)
|
|
643
537
|
n();
|
|
644
538
|
this.stopCallbacks = [];
|
|
@@ -665,45 +559,28 @@ class Qt {
|
|
|
665
559
|
for (const u in i)
|
|
666
560
|
this.attachProp(
|
|
667
561
|
i[u],
|
|
668
|
-
(
|
|
669
|
-
|
|
562
|
+
(a) => {
|
|
563
|
+
a == null ? t.removeAttribute(u) : t.setAttribute(u, String(a));
|
|
670
564
|
},
|
|
671
565
|
this.getUpdateKey("attr", u)
|
|
672
566
|
);
|
|
673
567
|
} else if (n === "eventListeners") {
|
|
674
568
|
const i = r;
|
|
675
569
|
for (const u in i) {
|
|
676
|
-
const
|
|
677
|
-
t.addEventListener(u,
|
|
678
|
-
t.removeEventListener(u,
|
|
570
|
+
const a = p(r) ? (l) => r.get()(l) : r;
|
|
571
|
+
t.addEventListener(u, a), this.stopCallbacks.push(() => {
|
|
572
|
+
t.removeEventListener(u, a);
|
|
679
573
|
});
|
|
680
574
|
}
|
|
681
575
|
} else if (n === "onClickOutside" || n === "onclickoutside") {
|
|
682
|
-
const i = (
|
|
683
|
-
this.canClickAway && !t.contains(
|
|
576
|
+
const i = (a) => {
|
|
577
|
+
this.canClickAway && !t.contains(a.target) && (p(r) ? r.get()(a) : r(a));
|
|
684
578
|
}, u = { capture: !0 };
|
|
685
579
|
window.addEventListener("click", i, u), this.stopCallbacks.push(() => {
|
|
686
580
|
window.removeEventListener("click", i, u);
|
|
687
581
|
});
|
|
688
|
-
} else if (n
|
|
689
|
-
|
|
690
|
-
throw new TypeError(`$$value attribute must be a settable state. Got: ${r}`);
|
|
691
|
-
this.attachProp(
|
|
692
|
-
r,
|
|
693
|
-
(u) => {
|
|
694
|
-
u == null ? t.value = "" : t.value = String(u);
|
|
695
|
-
},
|
|
696
|
-
this.getUpdateKey("attr", "value")
|
|
697
|
-
);
|
|
698
|
-
const i = (u) => {
|
|
699
|
-
const c = te(r.get(), u.currentTarget.value);
|
|
700
|
-
r.set(c);
|
|
701
|
-
};
|
|
702
|
-
t.addEventListener("input", i), this.stopCallbacks.push(() => {
|
|
703
|
-
t.removeEventListener("input", i);
|
|
704
|
-
});
|
|
705
|
-
} else if (Jt(n)) {
|
|
706
|
-
const i = n.slice(2).toLowerCase(), u = p(r) ? (c) => r.get()(c) : r;
|
|
582
|
+
} else if (Dt(n)) {
|
|
583
|
+
const i = n.slice(2).toLowerCase(), u = p(r) ? (a) => r.get()(a) : r;
|
|
707
584
|
t.addEventListener(i, u), this.stopCallbacks.push(() => {
|
|
708
585
|
t.removeEventListener(i, u);
|
|
709
586
|
});
|
|
@@ -715,7 +592,7 @@ class Qt {
|
|
|
715
592
|
},
|
|
716
593
|
this.getUpdateKey("attr", n)
|
|
717
594
|
);
|
|
718
|
-
else if (!
|
|
595
|
+
else if (!zt.includes(n))
|
|
719
596
|
if (this.elementContext.isSVG)
|
|
720
597
|
this.attachProp(
|
|
721
598
|
r,
|
|
@@ -797,27 +674,27 @@ class Qt {
|
|
|
797
674
|
const r = [];
|
|
798
675
|
if (p(e)) {
|
|
799
676
|
let i;
|
|
800
|
-
const u = e.watch((
|
|
677
|
+
const u = e.watch((a) => {
|
|
801
678
|
this._mutate(
|
|
802
679
|
() => {
|
|
803
|
-
|
|
680
|
+
V(i) && i(), t.style.cssText = "", i = this.applyStyles(t, a, n);
|
|
804
681
|
},
|
|
805
682
|
this.getUpdateKey("styles", "*")
|
|
806
683
|
);
|
|
807
684
|
});
|
|
808
685
|
n.push(u), r.push(u);
|
|
809
686
|
} else {
|
|
810
|
-
const i =
|
|
687
|
+
const i = yt(e);
|
|
811
688
|
for (const u in i) {
|
|
812
|
-
const { value:
|
|
813
|
-
if (p(
|
|
814
|
-
const
|
|
689
|
+
const { value: a, priority: l } = i[u];
|
|
690
|
+
if (p(a)) {
|
|
691
|
+
const c = a.watch((f) => {
|
|
815
692
|
this._mutate(() => {
|
|
816
|
-
|
|
693
|
+
f ? t.style.setProperty(u, String(f), l) : t.style.removeProperty(u);
|
|
817
694
|
});
|
|
818
695
|
});
|
|
819
|
-
n.push(
|
|
820
|
-
} else
|
|
696
|
+
n.push(c), r.push(c);
|
|
697
|
+
} else a != null && t.style.setProperty(u, String(a));
|
|
821
698
|
}
|
|
822
699
|
}
|
|
823
700
|
return function() {
|
|
@@ -829,27 +706,27 @@ class Qt {
|
|
|
829
706
|
const r = [];
|
|
830
707
|
if (p(e)) {
|
|
831
708
|
let i;
|
|
832
|
-
const u = e.watch((
|
|
709
|
+
const u = e.watch((a) => {
|
|
833
710
|
this._mutate(
|
|
834
711
|
() => {
|
|
835
|
-
|
|
712
|
+
V(i) && i(), t.removeAttribute("class"), i = this.applyClasses(t, a, n);
|
|
836
713
|
},
|
|
837
714
|
this.getUpdateKey("attr", "class")
|
|
838
715
|
);
|
|
839
716
|
});
|
|
840
717
|
n.push(u), r.push(u);
|
|
841
718
|
} else {
|
|
842
|
-
const i =
|
|
719
|
+
const i = wt(e);
|
|
843
720
|
for (const u in i) {
|
|
844
|
-
const
|
|
845
|
-
if (p(
|
|
846
|
-
const
|
|
721
|
+
const a = i[u];
|
|
722
|
+
if (p(a)) {
|
|
723
|
+
const l = a.watch((c) => {
|
|
847
724
|
this._mutate(() => {
|
|
848
|
-
|
|
725
|
+
c ? t.classList.add(u) : t.classList.remove(u);
|
|
849
726
|
});
|
|
850
727
|
});
|
|
851
|
-
n.push(
|
|
852
|
-
} else
|
|
728
|
+
n.push(l), r.push(l);
|
|
729
|
+
} else a && t.classList.add(u);
|
|
853
730
|
}
|
|
854
731
|
}
|
|
855
732
|
return function() {
|
|
@@ -858,143 +735,129 @@ class Qt {
|
|
|
858
735
|
};
|
|
859
736
|
}
|
|
860
737
|
}
|
|
861
|
-
function
|
|
738
|
+
function wt(s) {
|
|
862
739
|
let t = {};
|
|
863
|
-
if (
|
|
740
|
+
if (E(s)) {
|
|
864
741
|
const e = s.split(" ");
|
|
865
742
|
for (const n of e)
|
|
866
743
|
t[n] = !0;
|
|
867
|
-
} else
|
|
868
|
-
Object.assign(t,
|
|
744
|
+
} else ht(s) ? Object.assign(t, s) : Array.isArray(s) && Array.from(s).filter(Boolean).forEach((e) => {
|
|
745
|
+
Object.assign(t, wt(e));
|
|
869
746
|
});
|
|
870
747
|
return delete t.undefined, t;
|
|
871
748
|
}
|
|
872
|
-
function
|
|
749
|
+
function yt(s) {
|
|
873
750
|
let t = {};
|
|
874
|
-
if (
|
|
751
|
+
if (E(s)) {
|
|
875
752
|
const e = s.split(";").filter((n) => n.trim() !== "");
|
|
876
753
|
for (const n of e) {
|
|
877
754
|
const [r, i] = n.split(":"), u = {
|
|
878
755
|
value: i
|
|
879
756
|
};
|
|
880
|
-
i.includes("!important") ? (u.priority = "important", u.value = i.replace("!important", "").trim()) : u.value = i.trim(), t[
|
|
757
|
+
i.includes("!important") ? (u.priority = "important", u.value = i.replace("!important", "").trim()) : u.value = i.trim(), t[J(r.trim())] = u;
|
|
881
758
|
}
|
|
882
759
|
}
|
|
883
|
-
if (
|
|
760
|
+
if (ht(s))
|
|
884
761
|
for (const e in s)
|
|
885
|
-
e.startsWith("--") ? t[e] = { value: s[e] } : t[
|
|
762
|
+
e.startsWith("--") ? t[e] = { value: s[e] } : t[J(e)] = { value: s[e] };
|
|
886
763
|
else Array.isArray(s) && Array.from(s).filter((e) => e != null).forEach((e) => {
|
|
887
|
-
Object.assign(t,
|
|
764
|
+
Object.assign(t, yt(e));
|
|
888
765
|
});
|
|
889
766
|
return t;
|
|
890
767
|
}
|
|
891
|
-
function
|
|
768
|
+
function J(s) {
|
|
892
769
|
return s.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, e) => (e ? "-" : "") + t.toLowerCase());
|
|
893
770
|
}
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
constructor({ states: t, renderFn: e, elementContext: n }) {
|
|
903
|
-
o(this, lt, !0);
|
|
904
|
-
o(this, "node");
|
|
905
|
-
o(this, "endNode");
|
|
906
|
-
o(this, "connectedViews", []);
|
|
771
|
+
const zt = ["ref", "children", "class", "style", "data"];
|
|
772
|
+
var et;
|
|
773
|
+
et = S;
|
|
774
|
+
class Rt {
|
|
775
|
+
constructor({ sources: t, renderFn: e, elementContext: n }) {
|
|
776
|
+
o(this, et, !0);
|
|
777
|
+
o(this, "node", document.createTextNode(""));
|
|
778
|
+
o(this, "children", []);
|
|
907
779
|
o(this, "renderFn");
|
|
908
780
|
o(this, "elementContext");
|
|
909
|
-
o(this, "
|
|
910
|
-
o(this, "
|
|
911
|
-
this.elementContext = n, this.renderFn = e, this.
|
|
912
|
-
let r;
|
|
913
|
-
this.observerControls = {
|
|
914
|
-
start: () => {
|
|
915
|
-
r == null && (r = this.watcher.watch(t, (...i) => {
|
|
916
|
-
let u = this.renderFn(...i);
|
|
917
|
-
if (!Vt(u))
|
|
918
|
-
throw console.error(u, i), new TypeError(
|
|
919
|
-
`Observer received invalid value to render. Got type: ${N(u)}, value: ${u}`
|
|
920
|
-
);
|
|
921
|
-
Array.isArray(u) ? this.update(...u) : this.update(u);
|
|
922
|
-
}));
|
|
923
|
-
},
|
|
924
|
-
stop: () => {
|
|
925
|
-
r != null && (r(), r = void 0);
|
|
926
|
-
}
|
|
927
|
-
};
|
|
781
|
+
o(this, "watcher", D());
|
|
782
|
+
o(this, "sources");
|
|
783
|
+
this.elementContext = n, this.renderFn = e, this.sources = t;
|
|
928
784
|
}
|
|
929
785
|
get isMounted() {
|
|
930
786
|
return this.node.parentNode != null;
|
|
931
787
|
}
|
|
932
788
|
mount(t, e) {
|
|
933
|
-
this.isMounted || (t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), this.
|
|
789
|
+
this.isMounted || (t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), this.watcher.watch(this.sources, (...n) => {
|
|
790
|
+
const r = this.renderFn(...n);
|
|
791
|
+
if (!bt(r))
|
|
792
|
+
throw console.error(r, n), new TypeError(
|
|
793
|
+
`Observer received invalid value to render. Got type: ${N(r)}, value: ${r}`
|
|
794
|
+
);
|
|
795
|
+
this.update($(r) ? r : [r]);
|
|
796
|
+
}));
|
|
934
797
|
}
|
|
935
798
|
unmount(t = !1) {
|
|
936
799
|
var e;
|
|
937
|
-
this.
|
|
800
|
+
this.watcher.stopAll(), this.isMounted && (this.cleanup(t), (e = this.node.parentNode) == null || e.removeChild(this.node));
|
|
938
801
|
}
|
|
939
802
|
cleanup(t) {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
803
|
+
for (const e of this.children)
|
|
804
|
+
e.unmount(t);
|
|
805
|
+
this.children = [];
|
|
943
806
|
}
|
|
944
|
-
update(
|
|
945
|
-
var
|
|
946
|
-
if (this.cleanup(!1), t == null || !this.isMounted)
|
|
807
|
+
update(t) {
|
|
808
|
+
var i, u, a;
|
|
809
|
+
if (this.cleanup(!1), t == null || t.length === 0 || !this.isMounted)
|
|
947
810
|
return;
|
|
948
|
-
const e = t.map((
|
|
949
|
-
for (const
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
}
|
|
953
|
-
if (this.elementContext.root.getEnv() === "development") {
|
|
954
|
-
const i = (r = this.connectedViews.at(-1)) == null ? void 0 : r.node;
|
|
955
|
-
this.endNode.previousSibling !== i && this.node.parentNode.insertBefore(this.endNode, (i == null ? void 0 : i.nextSibling) ?? null);
|
|
811
|
+
const e = t.map((l) => kt(l) ? l : A(l) ? x(C(this.elementContext, l)) : x(C(this.elementContext, G(l))));
|
|
812
|
+
for (const l of e) {
|
|
813
|
+
const c = ((i = this.children.at(-1)) == null ? void 0 : i.node) || this.node;
|
|
814
|
+
l.mount(this.node.parentNode, c), this.children.push(l);
|
|
956
815
|
}
|
|
816
|
+
const n = this.node.parentNode, r = ((a = (u = this.children.at(-1)) == null ? void 0 : u.node) == null ? void 0 : a.nextSibling) ?? null;
|
|
817
|
+
n.insertBefore(this.node, r);
|
|
957
818
|
}
|
|
958
819
|
}
|
|
959
|
-
var
|
|
960
|
-
|
|
961
|
-
class
|
|
820
|
+
var nt;
|
|
821
|
+
nt = S;
|
|
822
|
+
class _t {
|
|
962
823
|
constructor(t) {
|
|
963
|
-
o(this,
|
|
824
|
+
o(this, nt, !0);
|
|
964
825
|
o(this, "node", document.createTextNode(""));
|
|
965
826
|
o(this, "isMounted", !1);
|
|
966
|
-
o(this, "
|
|
967
|
-
o(this, "
|
|
827
|
+
o(this, "source");
|
|
828
|
+
o(this, "elements", []);
|
|
968
829
|
o(this, "stopCallback");
|
|
969
|
-
this.
|
|
830
|
+
this.source = t;
|
|
970
831
|
}
|
|
971
832
|
mount(t, e) {
|
|
972
|
-
this.isMounted || (this.isMounted = !0, t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), p(this.
|
|
833
|
+
this.isMounted || (this.isMounted = !0, t.insertBefore(this.node, (e == null ? void 0 : e.nextSibling) ?? null), p(this.source) ? this.stopCallback = this.source.watch((n) => {
|
|
973
834
|
this.update(n);
|
|
974
|
-
}) : this.update(this.
|
|
835
|
+
}) : this.update(this.elements));
|
|
975
836
|
}
|
|
976
837
|
unmount(t = !1) {
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
838
|
+
this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), this.isMounted && (this.cleanup(t), this.isMounted = !1);
|
|
839
|
+
}
|
|
840
|
+
cleanup(t) {
|
|
841
|
+
for (const e of this.elements)
|
|
842
|
+
e.unmount(t);
|
|
843
|
+
this.elements = [];
|
|
982
844
|
}
|
|
983
845
|
update(t) {
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
846
|
+
var e, n;
|
|
847
|
+
if (this.cleanup(!1), t.length > 0) {
|
|
848
|
+
for (let r = 0; r < t.length; r++) {
|
|
849
|
+
const i = t[r], u = r > 0 ? this.elements[r - 1] : void 0;
|
|
850
|
+
i.mount(this.node.parentElement, u == null ? void 0 : u.node), this.elements.push(i);
|
|
851
|
+
}
|
|
852
|
+
(n = this.node.parentNode) == null || n.insertBefore(this.node, ((e = this.elements.at(-1)) == null ? void 0 : e.node) ?? null);
|
|
989
853
|
}
|
|
990
|
-
this.children = t;
|
|
991
854
|
}
|
|
992
855
|
}
|
|
993
|
-
var
|
|
994
|
-
|
|
995
|
-
class
|
|
856
|
+
var st;
|
|
857
|
+
st = S;
|
|
858
|
+
class Bt {
|
|
996
859
|
constructor(t) {
|
|
997
|
-
o(this,
|
|
860
|
+
o(this, st, !0);
|
|
998
861
|
o(this, "config");
|
|
999
862
|
o(this, "element");
|
|
1000
863
|
this.config = t;
|
|
@@ -1004,14 +867,14 @@ class se {
|
|
|
1004
867
|
}
|
|
1005
868
|
mount(t, e) {
|
|
1006
869
|
const { content: n, parent: r } = this.config;
|
|
1007
|
-
|
|
870
|
+
kt(n) ? this.element = n : A(n) ? this.element = x(C(this.config.elementContext, n)) : this.element = x(C(this.config.elementContext, G(n))), this.element.mount(r);
|
|
1008
871
|
}
|
|
1009
872
|
unmount(t = !1) {
|
|
1010
873
|
var e;
|
|
1011
874
|
(e = this.element) != null && e.isMounted && this.element.unmount(t);
|
|
1012
875
|
}
|
|
1013
876
|
}
|
|
1014
|
-
class
|
|
877
|
+
class Kt {
|
|
1015
878
|
constructor(t) {
|
|
1016
879
|
o(this, "__view");
|
|
1017
880
|
this.__view = t;
|
|
@@ -1076,29 +939,30 @@ class re {
|
|
|
1076
939
|
}
|
|
1077
940
|
}
|
|
1078
941
|
outlet() {
|
|
1079
|
-
return
|
|
942
|
+
return _("$outlet", { $children: this.__view._$children });
|
|
1080
943
|
}
|
|
1081
944
|
}
|
|
1082
|
-
var
|
|
1083
|
-
|
|
1084
|
-
const
|
|
945
|
+
var rt;
|
|
946
|
+
rt = S;
|
|
947
|
+
const z = class z {
|
|
1085
948
|
constructor(t, e, n, r = []) {
|
|
1086
|
-
o(this,
|
|
1087
|
-
o(this, "uniqueId",
|
|
949
|
+
o(this, rt, !0);
|
|
950
|
+
o(this, "uniqueId", ft());
|
|
1088
951
|
o(this, "_elementContext");
|
|
1089
952
|
o(this, "_logger");
|
|
1090
953
|
o(this, "_view");
|
|
1091
954
|
o(this, "_props");
|
|
1092
955
|
o(this, "_element");
|
|
956
|
+
o(this, "_childMarkup");
|
|
1093
957
|
o(this, "_$children");
|
|
1094
958
|
o(this, "_setChildren");
|
|
1095
|
-
o(this, "_watcher",
|
|
959
|
+
o(this, "_watcher", D());
|
|
1096
960
|
o(this, "_beforeMountCallbacks", []);
|
|
1097
961
|
o(this, "_onMountCallbacks", []);
|
|
1098
962
|
o(this, "_beforeUnmountCallbacks", []);
|
|
1099
963
|
o(this, "_onUnmountCallbacks", []);
|
|
1100
964
|
o(this, "isMounted", !1);
|
|
1101
|
-
this._elementContext = { ...t, data: {}, parent: t }, this._logger = t.root.createLogger(e.name, { uid: this.uniqueId }), this._view = e, this._props = n, [this._$children, this._setChildren] =
|
|
965
|
+
this._elementContext = { ...t, data: {}, parent: t }, this._logger = t.root.createLogger(e.name, { uid: this.uniqueId }), this._view = e, this._props = n, this._childMarkup = r, [this._$children, this._setChildren] = I([]);
|
|
1102
966
|
}
|
|
1103
967
|
/*===============================*\
|
|
1104
968
|
|| "Public" API ||
|
|
@@ -1125,27 +989,28 @@ const H = class H {
|
|
|
1125
989
|
this._watcher.stopAll();
|
|
1126
990
|
}
|
|
1127
991
|
setChildView(t) {
|
|
1128
|
-
|
|
992
|
+
this._childMarkup = [];
|
|
993
|
+
const e = new z(this._elementContext, t, {});
|
|
1129
994
|
return this._setChildren([e]), e;
|
|
1130
995
|
}
|
|
1131
996
|
/*===============================*\
|
|
1132
997
|
|| Internal ||
|
|
1133
998
|
\*===============================*/
|
|
1134
999
|
initialize() {
|
|
1135
|
-
const t = new
|
|
1000
|
+
const t = new Kt(this);
|
|
1136
1001
|
let e;
|
|
1137
1002
|
try {
|
|
1138
|
-
e = this._view(this._props, t);
|
|
1003
|
+
this._childMarkup.length && this._setChildren(C(this._elementContext, this._childMarkup)), e = this._view(this._props, t);
|
|
1139
1004
|
} catch (n) {
|
|
1140
1005
|
throw n instanceof Error && this._logger.crash(n), n;
|
|
1141
1006
|
}
|
|
1142
1007
|
if (e !== null) if (e instanceof Node)
|
|
1143
|
-
this._element =
|
|
1144
|
-
else if (
|
|
1145
|
-
this._element =
|
|
1008
|
+
this._element = x(C(this._elementContext, _("$node", { value: e })));
|
|
1009
|
+
else if (A(e) || at(A, e))
|
|
1010
|
+
this._element = x(C(this._elementContext, e));
|
|
1146
1011
|
else if (p(e))
|
|
1147
|
-
this._element =
|
|
1148
|
-
|
|
1012
|
+
this._element = x(
|
|
1013
|
+
C(this._elementContext, _("$observer", { sources: [e], renderFn: (n) => n }))
|
|
1149
1014
|
);
|
|
1150
1015
|
else {
|
|
1151
1016
|
const n = new TypeError(
|
|
@@ -1155,21 +1020,20 @@ const H = class H {
|
|
|
1155
1020
|
}
|
|
1156
1021
|
}
|
|
1157
1022
|
};
|
|
1158
|
-
let
|
|
1159
|
-
var
|
|
1160
|
-
|
|
1161
|
-
class
|
|
1023
|
+
let P = z;
|
|
1024
|
+
var it;
|
|
1025
|
+
it = S;
|
|
1026
|
+
class Ht {
|
|
1162
1027
|
constructor({ elementContext: t, $items: e, renderFn: n, keyFn: r }) {
|
|
1163
|
-
o(this,
|
|
1164
|
-
o(this, "node");
|
|
1165
|
-
o(this, "endNode");
|
|
1028
|
+
o(this, it, !0);
|
|
1029
|
+
o(this, "node", document.createTextNode(""));
|
|
1166
1030
|
o(this, "$items");
|
|
1167
1031
|
o(this, "stopCallback");
|
|
1168
1032
|
o(this, "connectedItems", []);
|
|
1169
1033
|
o(this, "elementContext");
|
|
1170
1034
|
o(this, "renderFn");
|
|
1171
1035
|
o(this, "keyFn");
|
|
1172
|
-
this.elementContext = t, this.$items = e, this.renderFn = n, this.keyFn = r
|
|
1036
|
+
this.elementContext = t, this.$items = e, this.renderFn = n, this.keyFn = r;
|
|
1173
1037
|
}
|
|
1174
1038
|
get isMounted() {
|
|
1175
1039
|
return this.node.parentNode != null;
|
|
@@ -1180,8 +1044,8 @@ class ie {
|
|
|
1180
1044
|
}));
|
|
1181
1045
|
}
|
|
1182
1046
|
unmount(t = !1) {
|
|
1183
|
-
var e
|
|
1184
|
-
this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), !t && this.isMounted && ((e = this.node.parentNode) == null || e.removeChild(this.node)
|
|
1047
|
+
var e;
|
|
1048
|
+
this.stopCallback && (this.stopCallback(), this.stopCallback = void 0), !t && this.isMounted && ((e = this.node.parentNode) == null || e.removeChild(this.node)), this._cleanup(t);
|
|
1185
1049
|
}
|
|
1186
1050
|
_cleanup(t) {
|
|
1187
1051
|
for (const e of this.connectedItems)
|
|
@@ -1189,59 +1053,57 @@ class ie {
|
|
|
1189
1053
|
this.connectedItems = [];
|
|
1190
1054
|
}
|
|
1191
1055
|
_update(t) {
|
|
1192
|
-
var
|
|
1056
|
+
var u, a, l;
|
|
1193
1057
|
if (t.length === 0 || !this.isMounted)
|
|
1194
1058
|
return this._cleanup(!1);
|
|
1195
1059
|
const e = [];
|
|
1196
1060
|
let n = 0;
|
|
1197
|
-
for (const
|
|
1061
|
+
for (const c of t)
|
|
1198
1062
|
e.push({
|
|
1199
|
-
key: this.keyFn(
|
|
1200
|
-
value:
|
|
1063
|
+
key: this.keyFn(c, n),
|
|
1064
|
+
value: c,
|
|
1201
1065
|
index: n++
|
|
1202
1066
|
});
|
|
1203
1067
|
const r = [];
|
|
1204
|
-
for (const
|
|
1205
|
-
e.find((h) => h.key ===
|
|
1206
|
-
for (const
|
|
1207
|
-
const
|
|
1208
|
-
if (
|
|
1209
|
-
|
|
1068
|
+
for (const c of this.connectedItems)
|
|
1069
|
+
e.find((h) => h.key === c.key) || c.element.unmount(!1);
|
|
1070
|
+
for (const c of e) {
|
|
1071
|
+
const f = this.connectedItems.find((h) => h.key === c.key);
|
|
1072
|
+
if (f)
|
|
1073
|
+
f.setValue(c.value), f.setIndex(c.index), r[c.index] = f;
|
|
1210
1074
|
else {
|
|
1211
|
-
const [h,
|
|
1212
|
-
r[
|
|
1213
|
-
key:
|
|
1075
|
+
const [h, d] = I(c.value), [m, g] = I(c.index);
|
|
1076
|
+
r[c.index] = {
|
|
1077
|
+
key: c.key,
|
|
1214
1078
|
$value: h,
|
|
1215
|
-
setValue:
|
|
1216
|
-
$index:
|
|
1217
|
-
setIndex:
|
|
1218
|
-
element: new
|
|
1079
|
+
setValue: d,
|
|
1080
|
+
$index: m,
|
|
1081
|
+
setIndex: g,
|
|
1082
|
+
element: new P(this.elementContext, Yt, {
|
|
1219
1083
|
$value: h,
|
|
1220
|
-
$index:
|
|
1084
|
+
$index: m,
|
|
1221
1085
|
renderFn: this.renderFn
|
|
1222
1086
|
})
|
|
1223
1087
|
};
|
|
1224
1088
|
}
|
|
1225
1089
|
}
|
|
1226
|
-
for (let
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1229
|
-
}
|
|
1230
|
-
if (this.connectedItems = r, this.elementContext.root.getEnv() === "development") {
|
|
1231
|
-
this.node.textContent = `Repeat (${r.length} item${r.length === 1 ? "" : "s"})`;
|
|
1232
|
-
const a = ((u = r.at(-1)) == null ? void 0 : u.element.node) ?? this.node;
|
|
1233
|
-
(c = this.node.parentNode) == null || c.insertBefore(this.endNode, a.nextSibling);
|
|
1090
|
+
for (let c = 0; c < r.length; c++) {
|
|
1091
|
+
const f = r[c], h = ((u = r[c - 1]) == null ? void 0 : u.element.node) ?? this.node;
|
|
1092
|
+
f.element.mount(this.node.parentNode, h);
|
|
1234
1093
|
}
|
|
1094
|
+
this.connectedItems = r;
|
|
1095
|
+
const i = ((a = r.at(-1)) == null ? void 0 : a.element.node) ?? this.node;
|
|
1096
|
+
(l = this.node.parentNode) == null || l.insertBefore(this.node, i.nextSibling);
|
|
1235
1097
|
}
|
|
1236
1098
|
}
|
|
1237
|
-
function
|
|
1099
|
+
function Yt({ $value: s, $index: t, renderFn: e }, n) {
|
|
1238
1100
|
return e(s, t, n);
|
|
1239
1101
|
}
|
|
1240
|
-
var
|
|
1241
|
-
|
|
1242
|
-
class
|
|
1102
|
+
var ot;
|
|
1103
|
+
ot = S;
|
|
1104
|
+
class Zt {
|
|
1243
1105
|
constructor({ value: t }) {
|
|
1244
|
-
o(this,
|
|
1106
|
+
o(this, ot, !0);
|
|
1245
1107
|
o(this, "node", document.createTextNode(""));
|
|
1246
1108
|
o(this, "value", "");
|
|
1247
1109
|
o(this, "stopCallback");
|
|
@@ -1262,69 +1124,57 @@ class ue {
|
|
|
1262
1124
|
t != null ? this.node.textContent = t.toString() : this.node.textContent = "";
|
|
1263
1125
|
}
|
|
1264
1126
|
}
|
|
1265
|
-
function
|
|
1266
|
-
return (s == null ? void 0 : s[
|
|
1127
|
+
function A(s) {
|
|
1128
|
+
return (s == null ? void 0 : s[gt]) === !0;
|
|
1267
1129
|
}
|
|
1268
|
-
function
|
|
1269
|
-
return (s == null ? void 0 : s[
|
|
1130
|
+
function kt(s) {
|
|
1131
|
+
return (s == null ? void 0 : s[S]) === !0;
|
|
1270
1132
|
}
|
|
1271
|
-
function
|
|
1272
|
-
return
|
|
1133
|
+
function G(s) {
|
|
1134
|
+
return $(s) || (s = [s]), s.flat(1 / 0).filter((t) => t != null && t !== !1).map((t) => {
|
|
1273
1135
|
if (t instanceof Node)
|
|
1274
|
-
return
|
|
1275
|
-
if (t instanceof
|
|
1276
|
-
return
|
|
1277
|
-
if (
|
|
1136
|
+
return _("$node", { value: t });
|
|
1137
|
+
if (t instanceof vt)
|
|
1138
|
+
return _("$node", { value: t.node });
|
|
1139
|
+
if (A(t))
|
|
1278
1140
|
return t;
|
|
1279
|
-
if (
|
|
1280
|
-
return
|
|
1141
|
+
if (E(t) || lt(t))
|
|
1142
|
+
return _("$text", { value: t });
|
|
1281
1143
|
if (p(t))
|
|
1282
|
-
return
|
|
1283
|
-
|
|
1144
|
+
return _("$observer", {
|
|
1145
|
+
sources: [t],
|
|
1284
1146
|
renderFn: (e) => e
|
|
1285
1147
|
});
|
|
1286
1148
|
throw console.error(t), new TypeError(`Unexpected child type. Got: ${t}`);
|
|
1287
1149
|
});
|
|
1288
1150
|
}
|
|
1289
|
-
function
|
|
1290
|
-
return
|
|
1291
|
-
[
|
|
1151
|
+
function _(s, t, ...e) {
|
|
1152
|
+
return {
|
|
1153
|
+
[gt]: !0,
|
|
1292
1154
|
type: s,
|
|
1293
1155
|
props: t,
|
|
1294
|
-
children:
|
|
1156
|
+
children: G(e)
|
|
1295
1157
|
};
|
|
1296
1158
|
}
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
if (!B(s[t]))
|
|
1303
|
-
throw new TypeError(`Prop '${t}' is named as a SettableState but value is not. Got: ${s[t]}`);
|
|
1304
|
-
} else if (t.startsWith("$") && s[t] !== void 0 && !p(s[t]))
|
|
1305
|
-
throw new TypeError(`Prop '${t}' is named as a State but value is not. Got: ${s[t]}`);
|
|
1306
|
-
}
|
|
1307
|
-
const ve = Zt.bind(y);
|
|
1308
|
-
function be(s, t, e) {
|
|
1309
|
-
const n = L(s);
|
|
1310
|
-
return y("$cond", {
|
|
1311
|
-
$predicate: n,
|
|
1312
|
-
thenContent: t,
|
|
1313
|
-
elseContent: e
|
|
1159
|
+
const oe = Lt.bind(_);
|
|
1160
|
+
function ue(s, t, e) {
|
|
1161
|
+
return _("$observer", {
|
|
1162
|
+
sources: [s],
|
|
1163
|
+
renderFn: (n) => n && t ? t : !n && e ? e : null
|
|
1314
1164
|
});
|
|
1315
1165
|
}
|
|
1316
|
-
function
|
|
1317
|
-
const n =
|
|
1318
|
-
return
|
|
1166
|
+
function ce(s, t, e) {
|
|
1167
|
+
const n = j(s);
|
|
1168
|
+
return _("$repeat", { $items: n, keyFn: t, renderFn: e });
|
|
1319
1169
|
}
|
|
1320
|
-
function
|
|
1321
|
-
return
|
|
1170
|
+
function ae(s, t) {
|
|
1171
|
+
return _("$portal", { parent: s, content: t });
|
|
1322
1172
|
}
|
|
1323
|
-
var
|
|
1324
|
-
|
|
1325
|
-
class
|
|
1173
|
+
var ut;
|
|
1174
|
+
ut = S;
|
|
1175
|
+
class vt {
|
|
1326
1176
|
constructor(t) {
|
|
1327
|
-
o(this,
|
|
1177
|
+
o(this, ut, !0);
|
|
1328
1178
|
o(this, "node");
|
|
1329
1179
|
this.node = t;
|
|
1330
1180
|
}
|
|
@@ -1338,34 +1188,34 @@ class At {
|
|
|
1338
1188
|
this.node.parentNode && this.node.parentNode.removeChild(this.node);
|
|
1339
1189
|
}
|
|
1340
1190
|
}
|
|
1341
|
-
function
|
|
1342
|
-
return (
|
|
1343
|
-
if (
|
|
1344
|
-
return new
|
|
1345
|
-
if (
|
|
1191
|
+
function C(s, t) {
|
|
1192
|
+
return ($(t) ? t : [t]).map((n) => {
|
|
1193
|
+
if (V(n.type))
|
|
1194
|
+
return new P(s, n.type, n.props, n.children);
|
|
1195
|
+
if (E(n.type))
|
|
1346
1196
|
switch (n.type) {
|
|
1347
1197
|
case "$node": {
|
|
1348
1198
|
const r = n.props;
|
|
1349
|
-
return new
|
|
1199
|
+
return new vt(r.value);
|
|
1350
1200
|
}
|
|
1351
1201
|
case "$text": {
|
|
1352
1202
|
const r = n.props;
|
|
1353
|
-
return new
|
|
1203
|
+
return new Zt({
|
|
1354
1204
|
value: r.value
|
|
1355
1205
|
});
|
|
1356
1206
|
}
|
|
1357
|
-
case "$cond": {
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
}
|
|
1207
|
+
// case "$cond": {
|
|
1208
|
+
// const attrs = item.props! as MarkupAttributes["$cond"];
|
|
1209
|
+
// return new Conditional({
|
|
1210
|
+
// $predicate: attrs.$predicate,
|
|
1211
|
+
// thenContent: attrs.thenContent,
|
|
1212
|
+
// elseContent: attrs.elseContent,
|
|
1213
|
+
// elementContext,
|
|
1214
|
+
// });
|
|
1215
|
+
// }
|
|
1366
1216
|
case "$repeat": {
|
|
1367
1217
|
const r = n.props;
|
|
1368
|
-
return new
|
|
1218
|
+
return new Ht({
|
|
1369
1219
|
$items: r.$items,
|
|
1370
1220
|
keyFn: r.keyFn,
|
|
1371
1221
|
renderFn: r.renderFn,
|
|
@@ -1374,19 +1224,19 @@ function _(s, t) {
|
|
|
1374
1224
|
}
|
|
1375
1225
|
case "$observer": {
|
|
1376
1226
|
const r = n.props;
|
|
1377
|
-
return new
|
|
1378
|
-
|
|
1227
|
+
return new Rt({
|
|
1228
|
+
sources: r.sources,
|
|
1379
1229
|
renderFn: r.renderFn,
|
|
1380
1230
|
elementContext: s
|
|
1381
1231
|
});
|
|
1382
1232
|
}
|
|
1383
1233
|
case "$outlet": {
|
|
1384
1234
|
const r = n.props;
|
|
1385
|
-
return new
|
|
1235
|
+
return new _t(r.$children);
|
|
1386
1236
|
}
|
|
1387
1237
|
case "$portal": {
|
|
1388
1238
|
const r = n.props;
|
|
1389
|
-
return new
|
|
1239
|
+
return new Bt({
|
|
1390
1240
|
content: r.content,
|
|
1391
1241
|
parent: r.parent,
|
|
1392
1242
|
elementContext: s
|
|
@@ -1395,7 +1245,7 @@ function _(s, t) {
|
|
|
1395
1245
|
default:
|
|
1396
1246
|
if (n.type.startsWith("$"))
|
|
1397
1247
|
throw new Error(`Unknown markup type: ${n.type}`);
|
|
1398
|
-
return new
|
|
1248
|
+
return new Gt({
|
|
1399
1249
|
tag: n.type,
|
|
1400
1250
|
props: n.props ?? {},
|
|
1401
1251
|
children: n.children,
|
|
@@ -1406,48 +1256,46 @@ function _(s, t) {
|
|
|
1406
1256
|
throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
|
|
1407
1257
|
});
|
|
1408
1258
|
}
|
|
1409
|
-
function
|
|
1410
|
-
return s.length === 1 ? s[0] : new
|
|
1259
|
+
function x(s) {
|
|
1260
|
+
return s.length === 1 ? s[0] : new _t(s);
|
|
1411
1261
|
}
|
|
1412
|
-
function
|
|
1413
|
-
return s == null || s === !1 ||
|
|
1262
|
+
function bt(s) {
|
|
1263
|
+
return s == null || s === !1 || E(s) || lt(s) || A(s) || p(s) || at(bt, s);
|
|
1414
1264
|
}
|
|
1415
|
-
function
|
|
1265
|
+
function le(s, t) {
|
|
1416
1266
|
return t.outlet();
|
|
1417
1267
|
}
|
|
1418
1268
|
export {
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
Et as r,
|
|
1444
|
-
pe as s,
|
|
1269
|
+
dt as A,
|
|
1270
|
+
ae as B,
|
|
1271
|
+
ce as C,
|
|
1272
|
+
le as P,
|
|
1273
|
+
P as V,
|
|
1274
|
+
I as a,
|
|
1275
|
+
E as b,
|
|
1276
|
+
ue as c,
|
|
1277
|
+
jt as d,
|
|
1278
|
+
se as e,
|
|
1279
|
+
V as f,
|
|
1280
|
+
te as g,
|
|
1281
|
+
oe as h,
|
|
1282
|
+
ht as i,
|
|
1283
|
+
Qt as j,
|
|
1284
|
+
Jt as k,
|
|
1285
|
+
D as l,
|
|
1286
|
+
re as m,
|
|
1287
|
+
j as n,
|
|
1288
|
+
Ft as o,
|
|
1289
|
+
p,
|
|
1290
|
+
ie as q,
|
|
1291
|
+
Wt as r,
|
|
1292
|
+
ne as s,
|
|
1445
1293
|
N as t,
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1294
|
+
ee as u,
|
|
1295
|
+
_ as v,
|
|
1296
|
+
Tt as w,
|
|
1297
|
+
qt as x,
|
|
1298
|
+
x as y,
|
|
1299
|
+
C as z
|
|
1452
1300
|
};
|
|
1453
|
-
//# sourceMappingURL=passthrough-
|
|
1301
|
+
//# sourceMappingURL=passthrough-CACEgFx5.js.map
|