@manyducks.co/dolla 2.0.0-alpha.5 → 2.0.0-alpha.7
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/README.md +164 -514
- package/dist/index.d.ts +3 -3
- package/dist/index.js +223 -219
- 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 +19 -11
- package/dist/modules/dolla.d.ts +7 -7
- package/dist/modules/language.d.ts +4 -4
- package/dist/modules/router.d.ts +4 -4
- package/dist/nodes/cond.d.ts +3 -3
- package/dist/nodes/html.d.ts +1 -1
- package/dist/nodes/observer.d.ts +4 -4
- package/dist/nodes/outlet.d.ts +3 -3
- package/dist/nodes/repeat.d.ts +9 -9
- package/dist/nodes/text.d.ts +3 -3
- package/dist/{passthrough-CtoBcpag.js → passthrough-BVaqqjam.js} +322 -301
- package/dist/passthrough-BVaqqjam.js.map +1 -0
- package/dist/state.d.ts +101 -0
- package/dist/types.d.ts +11 -11
- package/dist/view.d.ts +20 -5
- package/notes/context-vars.md +21 -0
- package/notes/readme-scratch.md +222 -0
- package/notes/route-middleware.md +42 -0
- package/notes/scratch.md +1 -1
- package/package.json +1 -1
- package/tests/{signals.test.js → state.test.js} +6 -6
- package/dist/passthrough-CtoBcpag.js.map +0 -1
- package/dist/signals.d.ts +0 -101
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var f = (t, e, n) =>
|
|
4
|
-
function
|
|
1
|
+
var se = Object.defineProperty;
|
|
2
|
+
var ue = (t, e, n) => e in t ? se(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var f = (t, e, n) => ue(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
function ce(t) {
|
|
5
5
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
6
6
|
}
|
|
7
|
-
var U = { exports: {} },
|
|
8
|
-
function
|
|
9
|
-
return
|
|
7
|
+
var U = { exports: {} }, z;
|
|
8
|
+
function ae() {
|
|
9
|
+
return z || (z = 1, function(t, e) {
|
|
10
10
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
11
11
|
var n = /* @__PURE__ */ function() {
|
|
12
|
-
function u(
|
|
13
|
-
var h = [], b = !0,
|
|
12
|
+
function u(l, d) {
|
|
13
|
+
var h = [], b = !0, C = !1, k = void 0;
|
|
14
14
|
try {
|
|
15
|
-
for (var $,
|
|
16
|
-
} catch (
|
|
17
|
-
|
|
15
|
+
for (var $, v = l[Symbol.iterator](); !(b = ($ = v.next()).done) && (h.push($.value), !(d && h.length === d)); b = !0) ;
|
|
16
|
+
} catch (g) {
|
|
17
|
+
C = !0, k = g;
|
|
18
18
|
} finally {
|
|
19
19
|
try {
|
|
20
|
-
!b &&
|
|
20
|
+
!b && v.return && v.return();
|
|
21
21
|
} finally {
|
|
22
|
-
if (
|
|
22
|
+
if (C) throw k;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
return h;
|
|
26
26
|
}
|
|
27
|
-
return function(
|
|
28
|
-
if (Array.isArray(
|
|
29
|
-
if (Symbol.iterator in Object(
|
|
27
|
+
return function(l, d) {
|
|
28
|
+
if (Array.isArray(l)) return l;
|
|
29
|
+
if (Symbol.iterator in Object(l)) return u(l, d);
|
|
30
30
|
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
|
31
31
|
};
|
|
32
32
|
}(), o = function(u) {
|
|
33
|
-
return u.reduce(function(
|
|
34
|
-
return 16 > d ?
|
|
33
|
+
return u.reduce(function(l, d) {
|
|
34
|
+
return 16 > d ? l + "0" + d.toString(16) : l + d.toString(16);
|
|
35
35
|
}, "#");
|
|
36
|
-
}, r = function(u,
|
|
37
|
-
var h = 0.5 > d ? d * (1 +
|
|
38
|
-
var
|
|
39
|
-
return
|
|
40
|
-
},
|
|
41
|
-
return [
|
|
42
|
-
}, i = function(u,
|
|
43
|
-
var b = u % 1007 / 1007,
|
|
44
|
-
return
|
|
45
|
-
},
|
|
46
|
-
return [
|
|
36
|
+
}, r = function(u, l, d) {
|
|
37
|
+
var h = 0.5 > d ? d * (1 + l) : d + l - d * l, b = 2 * d - h, C = function(g, m, a) {
|
|
38
|
+
var p = Math.round, y = 0 > a ? a + 1 : 1 < a ? a - 1 : a;
|
|
39
|
+
return y = y < 1 / 6 ? g + 6 * (m - g) * y : y < 1 / 2 ? m : y < 2 / 3 ? g + 6 * (m - g) * (2 / 3 - y) : g, p(255 * y);
|
|
40
|
+
}, k = C(b, h, u + 1 / 3), $ = C(b, h, u), v = C(b, h, u - 1 / 3);
|
|
41
|
+
return [k, $, v];
|
|
42
|
+
}, i = function(u, l, d, h) {
|
|
43
|
+
var b = u % 1007 / 1007, C = function(g, m, a) {
|
|
44
|
+
return g * (a - m) + m;
|
|
45
|
+
}, k = C(b, l.min, l.max), $ = C(b, d.min, d.max), v = C(b, h.max, h.min);
|
|
46
|
+
return [k, $, v];
|
|
47
47
|
}, s = function(u) {
|
|
48
|
-
return u.split("").reduce(function(
|
|
49
|
-
return
|
|
48
|
+
return u.split("").reduce(function(l, d, h) {
|
|
49
|
+
return l * d.charCodeAt(0) * h + 1;
|
|
50
50
|
}, 1);
|
|
51
51
|
}, c = function(u) {
|
|
52
|
-
var
|
|
53
|
-
return
|
|
52
|
+
var l = u.str, d = u.hue, h = d === void 0 ? { min: 0, max: 360 } : d, b = u.sat, C = b === void 0 ? { min: 0.35, max: 0.65 } : b, k = u.light, $ = k === void 0 ? { min: 0.3, max: 0.7 } : k, v = u.hashFunction, g = v === void 0 ? s : v, m = u.scheme, a = m === void 0 ? "hex" : m, p = i(g(l), h, C, $), y = n(p, 3), N = y[0], P = y[1], W = y[2], H = r(N / 360, P, W), ie = o(H);
|
|
53
|
+
return a === "hsl" ? [N, P, W] : a === "rgb" ? H : ie;
|
|
54
54
|
};
|
|
55
55
|
e.default = c, t.exports = e.default;
|
|
56
56
|
}(U, U.exports)), U.exports;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
const
|
|
60
|
-
function
|
|
58
|
+
var le = ae();
|
|
59
|
+
const de = /* @__PURE__ */ ce(le);
|
|
60
|
+
function _(t) {
|
|
61
61
|
if (t === void 0)
|
|
62
62
|
return "undefined";
|
|
63
63
|
if (t === null)
|
|
@@ -67,77 +67,77 @@ function G(t) {
|
|
|
67
67
|
case "number":
|
|
68
68
|
return isNaN(t) ? "NaN" : "number";
|
|
69
69
|
case "function":
|
|
70
|
-
return
|
|
70
|
+
return J(t) ? "class" : e;
|
|
71
71
|
case "object":
|
|
72
|
-
return
|
|
72
|
+
return F(t) ? "array" : he(t) ? "promise" : e;
|
|
73
73
|
default:
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function F(t) {
|
|
78
78
|
return Array.isArray(t);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
const e = t[0], n = (o) =>
|
|
80
|
+
function Y(...t) {
|
|
81
|
+
const e = t[0], n = (o) => F(o) && o.every((r) => e(r));
|
|
82
82
|
return t.length < 2 ? n : n(t[1]);
|
|
83
83
|
}
|
|
84
84
|
function Fe(...t) {
|
|
85
85
|
const e = t[0], n = M(t[2]) ? t[2] : "Expected an array of valid items. Got type: %t, value: %v", o = (r) => {
|
|
86
|
-
if (
|
|
86
|
+
if (F(r) && r.every((i) => e(i)))
|
|
87
87
|
return !0;
|
|
88
|
-
throw new TypeError(
|
|
88
|
+
throw new TypeError(R(r, n));
|
|
89
89
|
};
|
|
90
90
|
return t.length < 2 ? o : o(t[1]);
|
|
91
91
|
}
|
|
92
92
|
function M(t) {
|
|
93
93
|
return typeof t == "string";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Pe(t, e) {
|
|
96
96
|
if (M(t))
|
|
97
97
|
return !0;
|
|
98
|
-
throw new TypeError(
|
|
98
|
+
throw new TypeError(R(t, e ?? "Expected a string. Got type: %t, value: %v"));
|
|
99
99
|
}
|
|
100
100
|
function E(t) {
|
|
101
|
-
return typeof t == "function" && !
|
|
101
|
+
return typeof t == "function" && !J(t);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function fe(t) {
|
|
104
104
|
return typeof t == "number" && !isNaN(t);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function he(t) {
|
|
107
107
|
if (t == null) return !1;
|
|
108
108
|
const e = t;
|
|
109
109
|
return e instanceof Promise || E(e.then) && E(e.catch) && E(e.finally);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function J(t) {
|
|
112
112
|
return typeof t == "function" && /^\s*class\s+/.test(t.toString());
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function je(...t) {
|
|
115
115
|
const e = t[0], n = M(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, o = (r) => {
|
|
116
116
|
if (r instanceof e)
|
|
117
117
|
return !0;
|
|
118
|
-
throw new TypeError(
|
|
118
|
+
throw new TypeError(R(r, n));
|
|
119
119
|
};
|
|
120
120
|
return t.length < 2 ? o : o(t[1]);
|
|
121
121
|
}
|
|
122
122
|
function L(t) {
|
|
123
|
-
return t != null && typeof t == "object" && !
|
|
123
|
+
return t != null && typeof t == "object" && !F(t);
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function R(t, e) {
|
|
126
126
|
var r;
|
|
127
|
-
const n =
|
|
127
|
+
const n = _(t), o = ((r = t == null ? void 0 : t.toString) == null ? void 0 : r.call(t)) || String(t);
|
|
128
128
|
return e.replaceAll("%t", n).replaceAll("%v", o);
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const pe = () => {
|
|
131
131
|
};
|
|
132
|
-
function
|
|
132
|
+
function D(t) {
|
|
133
133
|
return t != null && typeof t == "object" && !Array.isArray(t) && Object.getPrototypeOf(t) === Object.getPrototypeOf({});
|
|
134
134
|
}
|
|
135
135
|
function I(t, e) {
|
|
136
136
|
if (t === e)
|
|
137
137
|
return !0;
|
|
138
|
-
if (
|
|
138
|
+
if (w(t) || w(e))
|
|
139
139
|
return !1;
|
|
140
|
-
if (
|
|
140
|
+
if (D(t) && D(e)) {
|
|
141
141
|
const n = Object.keys(t), o = Object.keys(e);
|
|
142
142
|
if (n.length !== o.length)
|
|
143
143
|
return !1;
|
|
@@ -156,7 +156,7 @@ function I(t, e) {
|
|
|
156
156
|
}
|
|
157
157
|
return t === e;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function me(t, e) {
|
|
160
160
|
const n = (o) => {
|
|
161
161
|
const r = {};
|
|
162
162
|
for (const i in o)
|
|
@@ -165,20 +165,20 @@ function ye(t, e) {
|
|
|
165
165
|
};
|
|
166
166
|
return e == null ? n : n(e);
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function Ue() {
|
|
169
169
|
if (typeof window < "u" && window.console)
|
|
170
170
|
return window.console;
|
|
171
171
|
if (typeof global < "u" && global.console)
|
|
172
172
|
return global.console;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
174
|
+
function Ie(t) {
|
|
175
|
+
return de({
|
|
176
176
|
str: t,
|
|
177
177
|
sat: { min: 0.35, max: 0.55 },
|
|
178
178
|
light: { min: 0.6, max: 0.6 }
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Le(t) {
|
|
182
182
|
if (t instanceof RegExp)
|
|
183
183
|
return (o) => t.test(o);
|
|
184
184
|
const e = {
|
|
@@ -200,19 +200,29 @@ function Ge(t) {
|
|
|
200
200
|
return !(i.some((s) => s(o)) || r.length > 0 && !r.some((s) => s(o)));
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function w(t) {
|
|
204
204
|
return !(t == null || typeof t != "object" || typeof t.get != "function" || typeof t.watch != "function");
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function B(t) {
|
|
207
207
|
return !(t == null || typeof t != "object" || typeof t.set != "function" || typeof t.get != "function" || typeof t.watch != "function");
|
|
208
208
|
}
|
|
209
209
|
function O(t) {
|
|
210
|
-
return
|
|
210
|
+
return w(t) ? t.get() : t;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return
|
|
212
|
+
function q(t) {
|
|
213
|
+
return B(t) ? {
|
|
214
|
+
get: t.get,
|
|
215
|
+
watch: t.watch
|
|
216
|
+
} : w(t) ? t : {
|
|
217
|
+
get() {
|
|
218
|
+
return t;
|
|
219
|
+
},
|
|
220
|
+
watch(e, n = {}) {
|
|
221
|
+
return n != null && n.lazy || e(t), pe;
|
|
222
|
+
}
|
|
223
|
+
};
|
|
214
224
|
}
|
|
215
|
-
function
|
|
225
|
+
function qe(t, e) {
|
|
216
226
|
const [n, o] = T(t, e);
|
|
217
227
|
return {
|
|
218
228
|
get: n.get,
|
|
@@ -220,136 +230,123 @@ function _e(t, e) {
|
|
|
220
230
|
set: o
|
|
221
231
|
};
|
|
222
232
|
}
|
|
223
|
-
function
|
|
233
|
+
function Ge(t, e) {
|
|
224
234
|
return {
|
|
225
235
|
get: t.get,
|
|
226
236
|
watch: t.watch,
|
|
227
237
|
set: e
|
|
228
238
|
};
|
|
229
239
|
}
|
|
230
|
-
function
|
|
240
|
+
function _e(t, e) {
|
|
231
241
|
return function(o) {
|
|
232
242
|
const r = t.get();
|
|
233
243
|
let i;
|
|
234
244
|
typeof o == "function" ? i = o(r) : i = o, e(i, r);
|
|
235
245
|
};
|
|
236
246
|
}
|
|
237
|
-
function R(t) {
|
|
238
|
-
return {
|
|
239
|
-
get() {
|
|
240
|
-
return t;
|
|
241
|
-
},
|
|
242
|
-
watch(e, n = {}) {
|
|
243
|
-
return n.lazy || e(t), function() {
|
|
244
|
-
};
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
247
|
function T(t, e) {
|
|
249
248
|
let n = t, o = [];
|
|
250
249
|
function r() {
|
|
251
250
|
for (const u of o)
|
|
252
251
|
u(n);
|
|
253
252
|
}
|
|
254
|
-
function i(u,
|
|
255
|
-
return e != null && e.equality ? e.equality(u,
|
|
253
|
+
function i(u, l) {
|
|
254
|
+
return e != null && e.equality ? e.equality(u, l) : I(u, l);
|
|
256
255
|
}
|
|
257
256
|
const s = {
|
|
258
257
|
get() {
|
|
259
258
|
return O(n);
|
|
260
259
|
},
|
|
261
|
-
watch(u,
|
|
262
|
-
return o.push(u),
|
|
260
|
+
watch(u, l) {
|
|
261
|
+
return o.push(u), l != null && l.lazy || u(s.get()), function() {
|
|
263
262
|
o.splice(o.indexOf(u), 1);
|
|
264
263
|
};
|
|
265
264
|
}
|
|
266
265
|
};
|
|
267
266
|
function c(u) {
|
|
268
|
-
let
|
|
269
|
-
typeof u == "function" ?
|
|
267
|
+
let l;
|
|
268
|
+
typeof u == "function" ? l = u(n) : l = u, i(l, n) || (n = l, r());
|
|
270
269
|
}
|
|
271
270
|
return [s, c];
|
|
272
271
|
}
|
|
273
|
-
const
|
|
274
|
-
function
|
|
275
|
-
t = t.map(
|
|
276
|
-
let o = new Array(t.length).fill(
|
|
277
|
-
function d(
|
|
278
|
-
for (const
|
|
279
|
-
|
|
272
|
+
const ye = Symbol("EMPTY");
|
|
273
|
+
function ge(t, e, n) {
|
|
274
|
+
t = t.map(q);
|
|
275
|
+
let o = new Array(t.length).fill(ye, 0, t.length), r, i = [], s = !1, c = [], u, l;
|
|
276
|
+
function d(m = C()) {
|
|
277
|
+
for (const a of i)
|
|
278
|
+
a(m);
|
|
280
279
|
}
|
|
281
|
-
function h(
|
|
282
|
-
return n != null && n.equality ? n.equality(
|
|
280
|
+
function h(m, a) {
|
|
281
|
+
return n != null && n.equality ? n.equality(m, a) : I(m, a);
|
|
283
282
|
}
|
|
284
283
|
function b() {
|
|
285
|
-
const
|
|
286
|
-
for (let
|
|
287
|
-
if (!h(
|
|
288
|
-
|
|
284
|
+
const m = t.map((a) => a.get());
|
|
285
|
+
for (let a = 0; a < t.length; a++)
|
|
286
|
+
if (!h(m[a], o[a])) {
|
|
287
|
+
k(e(...m)), o = m;
|
|
289
288
|
break;
|
|
290
289
|
}
|
|
291
290
|
}
|
|
292
|
-
function
|
|
293
|
-
return s || b(),
|
|
291
|
+
function C() {
|
|
292
|
+
return s || b(), l = O(r), l;
|
|
294
293
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
297
|
-
const
|
|
298
|
-
h(
|
|
294
|
+
function k(m) {
|
|
295
|
+
m !== r && (u && (u(), u = void 0), r = m, l = O(m), w(m) && s && (u = m.watch((a) => {
|
|
296
|
+
const p = O(a);
|
|
297
|
+
h(p, l) || (l = p, d(p));
|
|
299
298
|
})));
|
|
300
299
|
}
|
|
301
300
|
function $() {
|
|
302
|
-
let
|
|
303
|
-
for (let
|
|
304
|
-
const
|
|
301
|
+
let m = [...o];
|
|
302
|
+
for (let a = 0; a < t.length; a++) {
|
|
303
|
+
const p = t[a];
|
|
305
304
|
c.push(
|
|
306
|
-
|
|
307
|
-
const
|
|
308
|
-
o[
|
|
305
|
+
p.watch((y) => {
|
|
306
|
+
const N = o[a];
|
|
307
|
+
o[a] = y, s && !h(y, N) && (k(e(...o)), d(O(r)));
|
|
309
308
|
})
|
|
310
309
|
);
|
|
311
310
|
}
|
|
312
311
|
s = !0;
|
|
313
|
-
for (let
|
|
314
|
-
if (!h(o[
|
|
315
|
-
|
|
312
|
+
for (let a = 0; a < t.length; a++)
|
|
313
|
+
if (!h(o[a], m[a])) {
|
|
314
|
+
k(e(...o)), d(O(r));
|
|
316
315
|
break;
|
|
317
316
|
}
|
|
318
317
|
}
|
|
319
|
-
function
|
|
320
|
-
for (const
|
|
321
|
-
|
|
318
|
+
function v() {
|
|
319
|
+
for (const m of c)
|
|
320
|
+
m();
|
|
322
321
|
c = [], u && (u(), u = void 0), s = !1;
|
|
323
322
|
}
|
|
324
323
|
return {
|
|
325
324
|
get() {
|
|
326
|
-
return
|
|
325
|
+
return C();
|
|
327
326
|
},
|
|
328
|
-
watch(
|
|
329
|
-
return s || $(), i.push(
|
|
330
|
-
i.splice(i.indexOf(
|
|
327
|
+
watch(m, a) {
|
|
328
|
+
return s || $(), i.push(m), a != null && a.lazy || m(C()), function() {
|
|
329
|
+
i.splice(i.indexOf(m), 1), s && i.length === 0 && v();
|
|
331
330
|
};
|
|
332
331
|
}
|
|
333
332
|
};
|
|
334
333
|
}
|
|
335
|
-
function
|
|
334
|
+
function G(t, e) {
|
|
336
335
|
if (t.length === 0)
|
|
337
|
-
throw new TypeError("Expected at least one
|
|
338
|
-
|
|
339
|
-
throw new TypeError("All values must be signals");
|
|
340
|
-
return t = t.map((n) => C(n) ? n : R(n)), t.length > 1 ? be(t, e).watch(() => null) : t[0].watch(e);
|
|
336
|
+
throw new TypeError("Expected at least one state to watch.");
|
|
337
|
+
return t = t.map(q), t.length > 1 ? ge(t, e).watch(() => null) : t[0].watch(e);
|
|
341
338
|
}
|
|
342
|
-
function
|
|
339
|
+
function be(t) {
|
|
343
340
|
for (var e, n, o = arguments, r = 1, i = "", s = "", c = [0], u = function(h) {
|
|
344
341
|
r === 1 && (h || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? c.push(h ? o[h] : i) : r === 3 && (h || i) ? (c[1] = h ? o[h] : i, r = 2) : r === 2 && i === "..." && h ? c[2] = Object.assign(c[2] || {}, o[h]) : r === 2 && i && !h ? (c[2] = c[2] || {})[i] = !0 : r >= 5 && (r === 5 ? ((c[2] = c[2] || {})[n] = h ? i ? i + o[h] : o[h] : i, r = 6) : (h || i) && (c[2][n] += h ? i + o[h] : i)), i = "";
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
for (var d = 0; d < t[
|
|
342
|
+
}, l = 0; l < t.length; l++) {
|
|
343
|
+
l && (r === 1 && u(), u(l));
|
|
344
|
+
for (var d = 0; d < t[l].length; d++) e = t[l][d], r === 1 ? e === "<" ? (u(), c = [c, "", null], r = 3) : i += e : r === 4 ? i === "--" && e === ">" ? (r = 1, i = "") : i = e + i[0] : s ? e === s ? s = "" : i += e : e === '"' || e === "'" ? s = e : e === ">" ? (u(), r = 1) : r && (e === "=" ? (r = 5, n = i, i = "") : e === "/" && (r < 5 || t[l][d + 1] === ">") ? (u(), r === 3 && (c = c[0]), r = c, (c = c[0]).push(this.apply(null, r.slice(1))), r = 0) : e === " " || e === " " || e === `
|
|
348
345
|
` || e === "\r" ? (u(), r = 2) : i += e), r === 3 && i === "!--" && (r = 4, c = c[0]);
|
|
349
346
|
}
|
|
350
347
|
return u(), c.length > 2 ? c.slice(1) : c[1];
|
|
351
348
|
}
|
|
352
|
-
class
|
|
349
|
+
class Ce {
|
|
353
350
|
constructor(e) {
|
|
354
351
|
f(this, "node");
|
|
355
352
|
f(this, "endNode");
|
|
@@ -392,15 +389,15 @@ class we {
|
|
|
392
389
|
}
|
|
393
390
|
}
|
|
394
391
|
}
|
|
395
|
-
const
|
|
392
|
+
const we = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
396
393
|
let Q = (t = 21) => {
|
|
397
394
|
let e = "", n = crypto.getRandomValues(new Uint8Array(t |= 0));
|
|
398
395
|
for (; t--; )
|
|
399
|
-
e +=
|
|
396
|
+
e += we[n[t] & 63];
|
|
400
397
|
return e;
|
|
401
398
|
};
|
|
402
399
|
const ke = (t) => /^on[A-Z]/.test(t);
|
|
403
|
-
class
|
|
400
|
+
class ve {
|
|
404
401
|
constructor({ tag: e, props: n, children: o, elementContext: r }) {
|
|
405
402
|
f(this, "node");
|
|
406
403
|
f(this, "props");
|
|
@@ -413,12 +410,12 @@ class $e {
|
|
|
413
410
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
414
411
|
f(this, "canClickAway", !1);
|
|
415
412
|
if (r = { ...r }, e.toLowerCase() === "svg" && (r.isSVG = !0), r.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", e) : this.node = document.createElement(e), r.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), n.ref)
|
|
416
|
-
if (
|
|
413
|
+
if (ne(n.ref))
|
|
417
414
|
this.ref = n.ref;
|
|
418
415
|
else
|
|
419
416
|
throw new Error("Expected ref to be a Ref object. Got: " + n.ref);
|
|
420
417
|
this.props = {
|
|
421
|
-
...
|
|
418
|
+
...me(["ref", "class", "className"], n),
|
|
422
419
|
class: n.className ?? n.class
|
|
423
420
|
}, this.children = o ? S(r, o) : [], this.elementContext = r;
|
|
424
421
|
}
|
|
@@ -453,7 +450,7 @@ class $e {
|
|
|
453
450
|
}
|
|
454
451
|
applyProps(e, n) {
|
|
455
452
|
const o = (r, i, s) => {
|
|
456
|
-
|
|
453
|
+
w(r) ? this.stopCallbacks.push(
|
|
457
454
|
r.watch((c) => {
|
|
458
455
|
this.elementContext.root.render.update(() => {
|
|
459
456
|
i(c);
|
|
@@ -478,21 +475,21 @@ class $e {
|
|
|
478
475
|
} else if (r === "eventListeners") {
|
|
479
476
|
const s = i;
|
|
480
477
|
for (const c in s) {
|
|
481
|
-
const u =
|
|
478
|
+
const u = w(i) ? (l) => i.get()(l) : i;
|
|
482
479
|
e.addEventListener(c, u), this.stopCallbacks.push(() => {
|
|
483
480
|
e.removeEventListener(c, u);
|
|
484
481
|
});
|
|
485
482
|
}
|
|
486
483
|
} else if (r === "onClickOutside" || r === "onclickoutside") {
|
|
487
484
|
const s = (u) => {
|
|
488
|
-
this.canClickAway && !e.contains(u.target) && (
|
|
485
|
+
this.canClickAway && !e.contains(u.target) && (w(i) ? i.get()(u) : i(u));
|
|
489
486
|
}, c = { capture: !0 };
|
|
490
487
|
window.addEventListener("click", s, c), this.stopCallbacks.push(() => {
|
|
491
488
|
window.removeEventListener("click", s, c);
|
|
492
489
|
});
|
|
493
490
|
} else if (r === "$$value") {
|
|
494
|
-
if (!
|
|
495
|
-
throw new TypeError(`$$value attribute must be a settable
|
|
491
|
+
if (!B(i))
|
|
492
|
+
throw new TypeError(`$$value attribute must be a settable state. Got: ${i}`);
|
|
496
493
|
o(
|
|
497
494
|
i,
|
|
498
495
|
(c) => {
|
|
@@ -501,14 +498,14 @@ class $e {
|
|
|
501
498
|
this.getUpdateKey("attr", "value")
|
|
502
499
|
);
|
|
503
500
|
const s = (c) => {
|
|
504
|
-
const u =
|
|
501
|
+
const u = $e(i.get(), c.currentTarget.value);
|
|
505
502
|
i.set(u);
|
|
506
503
|
};
|
|
507
504
|
e.addEventListener("input", s), this.stopCallbacks.push(() => {
|
|
508
505
|
e.removeEventListener("input", s);
|
|
509
506
|
});
|
|
510
507
|
} else if (ke(r)) {
|
|
511
|
-
const s = r.slice(2).toLowerCase(), c =
|
|
508
|
+
const s = r.slice(2).toLowerCase(), c = w(i) ? (u) => i.get()(u) : i;
|
|
512
509
|
e.addEventListener(s, c), this.stopCallbacks.push(() => {
|
|
513
510
|
e.removeEventListener(s, c);
|
|
514
511
|
});
|
|
@@ -520,7 +517,7 @@ class $e {
|
|
|
520
517
|
},
|
|
521
518
|
this.getUpdateKey("attr", r)
|
|
522
519
|
);
|
|
523
|
-
else if (!
|
|
520
|
+
else if (!Ne.includes(r))
|
|
524
521
|
if (this.elementContext.isSVG)
|
|
525
522
|
o(
|
|
526
523
|
i,
|
|
@@ -599,7 +596,7 @@ class $e {
|
|
|
599
596
|
}
|
|
600
597
|
applyStyles(e, n, o) {
|
|
601
598
|
const r = [];
|
|
602
|
-
if (
|
|
599
|
+
if (w(n)) {
|
|
603
600
|
let i;
|
|
604
601
|
const s = n.watch((c) => {
|
|
605
602
|
this.elementContext.root.render.update(
|
|
@@ -614,13 +611,13 @@ class $e {
|
|
|
614
611
|
const i = ee(n);
|
|
615
612
|
for (const s in i) {
|
|
616
613
|
const { value: c, priority: u } = i[s];
|
|
617
|
-
if (
|
|
618
|
-
const
|
|
614
|
+
if (w(c)) {
|
|
615
|
+
const l = c.watch((d) => {
|
|
619
616
|
this.elementContext.root.render.update(() => {
|
|
620
617
|
d ? e.style.setProperty(s, String(d), u) : e.style.removeProperty(s);
|
|
621
618
|
});
|
|
622
619
|
});
|
|
623
|
-
o.push(
|
|
620
|
+
o.push(l), r.push(l);
|
|
624
621
|
} else c != null && e.style.setProperty(s, String(c));
|
|
625
622
|
}
|
|
626
623
|
}
|
|
@@ -631,7 +628,7 @@ class $e {
|
|
|
631
628
|
}
|
|
632
629
|
applyClasses(e, n, o) {
|
|
633
630
|
const r = [];
|
|
634
|
-
if (
|
|
631
|
+
if (w(n)) {
|
|
635
632
|
let i;
|
|
636
633
|
const s = n.watch((c) => {
|
|
637
634
|
this.elementContext.root.render.update(
|
|
@@ -646,10 +643,10 @@ class $e {
|
|
|
646
643
|
const i = X(n);
|
|
647
644
|
for (const s in i) {
|
|
648
645
|
const c = i[s];
|
|
649
|
-
if (
|
|
650
|
-
const u = c.watch((
|
|
646
|
+
if (w(c)) {
|
|
647
|
+
const u = c.watch((l) => {
|
|
651
648
|
this.elementContext.root.render.update(() => {
|
|
652
|
-
|
|
649
|
+
l ? e.classList.add(s) : e.classList.remove(s);
|
|
653
650
|
});
|
|
654
651
|
});
|
|
655
652
|
o.push(u), r.push(u);
|
|
@@ -681,27 +678,27 @@ function ee(t) {
|
|
|
681
678
|
const [r, i] = o.split(":"), s = {
|
|
682
679
|
value: i
|
|
683
680
|
};
|
|
684
|
-
i.includes("!important") ? (s.priority = "important", s.value = i.replace("!important", "").trim()) : s.value = i.trim(), e[
|
|
681
|
+
i.includes("!important") ? (s.priority = "important", s.value = i.replace("!important", "").trim()) : s.value = i.trim(), e[Z(r.trim())] = s;
|
|
685
682
|
}
|
|
686
683
|
}
|
|
687
684
|
if (L(t))
|
|
688
685
|
for (const n in t)
|
|
689
|
-
n.startsWith("--") ? e[n] = { value: t[n] } : e[
|
|
686
|
+
n.startsWith("--") ? e[n] = { value: t[n] } : e[Z(n)] = { value: t[n] };
|
|
690
687
|
else Array.isArray(t) && Array.from(t).filter((n) => n != null).forEach((n) => {
|
|
691
688
|
Object.assign(e, ee(n));
|
|
692
689
|
});
|
|
693
690
|
return e;
|
|
694
691
|
}
|
|
695
|
-
function
|
|
692
|
+
function Z(t) {
|
|
696
693
|
return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, n) => (n ? "-" : "") + e.toLowerCase());
|
|
697
694
|
}
|
|
698
|
-
function
|
|
695
|
+
function $e(t, e) {
|
|
699
696
|
const n = typeof t;
|
|
700
697
|
return n === "string" ? String(e) : n === "number" ? Number(e) : n === "boolean" ? !!e : e;
|
|
701
698
|
}
|
|
702
|
-
const
|
|
699
|
+
const Ne = ["ref", "children", "class", "style", "data"];
|
|
703
700
|
class xe {
|
|
704
|
-
constructor({
|
|
701
|
+
constructor({ states: e, renderFn: n, elementContext: o }) {
|
|
705
702
|
f(this, "node");
|
|
706
703
|
f(this, "endNode");
|
|
707
704
|
f(this, "connectedViews", []);
|
|
@@ -712,11 +709,11 @@ class xe {
|
|
|
712
709
|
let r;
|
|
713
710
|
this.observerControls = {
|
|
714
711
|
start: () => {
|
|
715
|
-
r == null && (r =
|
|
712
|
+
r == null && (r = G(e, (...i) => {
|
|
716
713
|
const s = this.renderFn(...i);
|
|
717
|
-
if (!
|
|
714
|
+
if (!re(s))
|
|
718
715
|
throw console.error(s), new TypeError(
|
|
719
|
-
`Observer received invalid value to render. Got type: ${
|
|
716
|
+
`Observer received invalid value to render. Got type: ${_(s)}, value: ${s}`
|
|
720
717
|
);
|
|
721
718
|
Array.isArray(s) ? this.update(...s) : this.update(s);
|
|
722
719
|
}));
|
|
@@ -745,7 +742,7 @@ class xe {
|
|
|
745
742
|
var o, r;
|
|
746
743
|
if (this.cleanup(), e == null || !this.isMounted)
|
|
747
744
|
return;
|
|
748
|
-
const n = e.map((i) =>
|
|
745
|
+
const n = e.map((i) => te(i) ? i : V(i) ? A(S(this.elementContext, i)) : A(S(this.elementContext, j(i))));
|
|
749
746
|
for (const i of n) {
|
|
750
747
|
const s = ((o = this.connectedViews.at(-1)) == null ? void 0 : o.node) || this.node;
|
|
751
748
|
i.mount(this.node.parentNode, s), this.connectedViews.push(i);
|
|
@@ -756,7 +753,7 @@ class xe {
|
|
|
756
753
|
}
|
|
757
754
|
}
|
|
758
755
|
}
|
|
759
|
-
class
|
|
756
|
+
class Se {
|
|
760
757
|
constructor(e) {
|
|
761
758
|
f(this, "node");
|
|
762
759
|
f(this, "endNode");
|
|
@@ -797,7 +794,7 @@ class Ee {
|
|
|
797
794
|
));
|
|
798
795
|
}
|
|
799
796
|
}
|
|
800
|
-
class
|
|
797
|
+
class Ee {
|
|
801
798
|
constructor(e) {
|
|
802
799
|
f(this, "config");
|
|
803
800
|
f(this, "handle");
|
|
@@ -808,110 +805,136 @@ class Ae {
|
|
|
808
805
|
}
|
|
809
806
|
mount(e, n) {
|
|
810
807
|
const { content: o, parent: r } = this.config;
|
|
811
|
-
|
|
808
|
+
te(o) ? this.handle = o : V(o) ? this.handle = A(S(this.config.elementContext, o)) : this.handle = A(S(this.config.elementContext, j(o))), this.handle.mount(r);
|
|
812
809
|
}
|
|
813
810
|
unmount() {
|
|
814
811
|
var e;
|
|
815
812
|
(e = this.handle) != null && e.isMounted && this.handle.unmount();
|
|
816
813
|
}
|
|
817
814
|
}
|
|
818
|
-
function
|
|
819
|
-
t = { ...t };
|
|
815
|
+
function K(t, e, n, o = []) {
|
|
816
|
+
t = { ...t, data: {}, parent: t };
|
|
820
817
|
const [r, i] = T(S(t, o));
|
|
821
818
|
let s = !1;
|
|
822
|
-
const c = [], u = [],
|
|
819
|
+
const c = [], u = [], l = [], d = [], h = [], b = Q(), [C, k] = T(e.name), $ = t.root.createLogger(C, { uid: b }), v = {
|
|
823
820
|
get uid() {
|
|
824
821
|
return b;
|
|
825
822
|
},
|
|
826
|
-
|
|
827
|
-
|
|
823
|
+
set(a, p) {
|
|
824
|
+
t.data[a] = p;
|
|
828
825
|
},
|
|
829
|
-
|
|
830
|
-
|
|
826
|
+
get(a) {
|
|
827
|
+
let p = t;
|
|
828
|
+
for (; ; ) {
|
|
829
|
+
if (a in p.data)
|
|
830
|
+
return p.data[a];
|
|
831
|
+
if (p.parent)
|
|
832
|
+
p = p.parent;
|
|
833
|
+
else
|
|
834
|
+
break;
|
|
835
|
+
}
|
|
836
|
+
return null;
|
|
837
|
+
},
|
|
838
|
+
getAll() {
|
|
839
|
+
const a = [];
|
|
840
|
+
let p = t;
|
|
841
|
+
for (; a.push(p.data), p.parent; )
|
|
842
|
+
p = p.parent;
|
|
843
|
+
const y = {};
|
|
844
|
+
for (const N of a.reverse())
|
|
845
|
+
Object.assign(y, N);
|
|
846
|
+
return y;
|
|
847
|
+
},
|
|
848
|
+
setName(a) {
|
|
849
|
+
k(a);
|
|
831
850
|
},
|
|
832
|
-
|
|
833
|
-
|
|
851
|
+
beforeMount(a) {
|
|
852
|
+
u.push(a);
|
|
834
853
|
},
|
|
835
|
-
|
|
836
|
-
|
|
854
|
+
onMount(a) {
|
|
855
|
+
l.push(a);
|
|
837
856
|
},
|
|
838
|
-
|
|
839
|
-
|
|
857
|
+
beforeUnmount(a) {
|
|
858
|
+
d.push(a);
|
|
840
859
|
},
|
|
841
|
-
|
|
860
|
+
onUnmount(a) {
|
|
861
|
+
h.push(a);
|
|
862
|
+
},
|
|
863
|
+
watch(a, p) {
|
|
842
864
|
if (s) {
|
|
843
|
-
const
|
|
844
|
-
return c.push(
|
|
865
|
+
const y = G(a, p);
|
|
866
|
+
return c.push(y), y;
|
|
845
867
|
} else {
|
|
846
|
-
let
|
|
847
|
-
return
|
|
848
|
-
|
|
849
|
-
}), function
|
|
850
|
-
|
|
868
|
+
let y, N = !1;
|
|
869
|
+
return l.push(() => {
|
|
870
|
+
N || (y = G(a, p), c.push(y));
|
|
871
|
+
}), function P() {
|
|
872
|
+
P != null && (N = !0, P());
|
|
851
873
|
};
|
|
852
874
|
}
|
|
853
875
|
},
|
|
854
876
|
outlet() {
|
|
855
|
-
return
|
|
877
|
+
return x("$outlet", { $children: r });
|
|
856
878
|
}
|
|
857
879
|
};
|
|
858
|
-
Object.assign(
|
|
859
|
-
let
|
|
860
|
-
function
|
|
861
|
-
let
|
|
880
|
+
Object.assign(v, $);
|
|
881
|
+
let g;
|
|
882
|
+
function m() {
|
|
883
|
+
let a;
|
|
862
884
|
try {
|
|
863
|
-
|
|
864
|
-
} catch (
|
|
865
|
-
throw
|
|
885
|
+
a = e(n, v);
|
|
886
|
+
} catch (p) {
|
|
887
|
+
throw p instanceof Error && $.crash(p), p;
|
|
866
888
|
}
|
|
867
|
-
if (
|
|
889
|
+
if (a instanceof Promise)
|
|
868
890
|
throw new TypeError("View function cannot return a Promise.");
|
|
869
|
-
if (
|
|
870
|
-
|
|
871
|
-
else if (V(
|
|
872
|
-
|
|
873
|
-
else if (
|
|
874
|
-
|
|
875
|
-
S(t,
|
|
891
|
+
if (a !== null) if (a instanceof Node)
|
|
892
|
+
g = A(S(t, x("$node", { value: a })));
|
|
893
|
+
else if (V(a) || Y(V, a))
|
|
894
|
+
g = A(S(t, a));
|
|
895
|
+
else if (w(a))
|
|
896
|
+
g = A(
|
|
897
|
+
S(t, x("$observer", { states: [a], renderFn: (p) => p }))
|
|
876
898
|
);
|
|
877
899
|
else {
|
|
878
|
-
const
|
|
879
|
-
`Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${
|
|
900
|
+
const p = new TypeError(
|
|
901
|
+
`Expected '${e.name}' function to return a DOM node, Markup element, Readable or null. Got: ${_(a)}`
|
|
880
902
|
);
|
|
881
|
-
$.crash(
|
|
903
|
+
$.crash(p);
|
|
882
904
|
}
|
|
883
905
|
}
|
|
884
906
|
return {
|
|
885
907
|
get node() {
|
|
886
|
-
return
|
|
908
|
+
return g == null ? void 0 : g.node;
|
|
887
909
|
},
|
|
888
910
|
get isMounted() {
|
|
889
911
|
return s;
|
|
890
912
|
},
|
|
891
|
-
mount(
|
|
892
|
-
const
|
|
893
|
-
if (!
|
|
894
|
-
for (
|
|
913
|
+
mount(a, p) {
|
|
914
|
+
const y = s;
|
|
915
|
+
if (!y)
|
|
916
|
+
for (m(); u.length > 0; )
|
|
895
917
|
u.shift()();
|
|
896
|
-
|
|
897
|
-
for (;
|
|
898
|
-
|
|
918
|
+
g && g.mount(a, p), y || (s = !0, requestAnimationFrame(() => {
|
|
919
|
+
for (; l.length > 0; )
|
|
920
|
+
l.shift()();
|
|
899
921
|
}));
|
|
900
922
|
},
|
|
901
923
|
unmount() {
|
|
902
924
|
for (; d.length > 0; )
|
|
903
925
|
d.shift()();
|
|
904
|
-
for (
|
|
926
|
+
for (g && g.unmount(), s = !1; h.length > 0; )
|
|
905
927
|
h.shift()();
|
|
906
928
|
for (; c.length > 0; )
|
|
907
929
|
c.shift()();
|
|
908
930
|
},
|
|
909
|
-
|
|
910
|
-
|
|
931
|
+
setChildView(a) {
|
|
932
|
+
const p = K(t, a, {});
|
|
933
|
+
return i([p]), p;
|
|
911
934
|
}
|
|
912
935
|
};
|
|
913
936
|
}
|
|
914
|
-
class
|
|
937
|
+
class Ae {
|
|
915
938
|
constructor({ elementContext: e, $items: n, renderFn: o, keyFn: r }) {
|
|
916
939
|
f(this, "node");
|
|
917
940
|
f(this, "endNode");
|
|
@@ -956,18 +979,18 @@ class Me {
|
|
|
956
979
|
for (const u of this.connectedItems)
|
|
957
980
|
n.find((d) => d.key === u.key) || u.handle.unmount();
|
|
958
981
|
for (const u of n) {
|
|
959
|
-
const
|
|
960
|
-
if (
|
|
961
|
-
|
|
982
|
+
const l = this.connectedItems.find((d) => d.key === u.key);
|
|
983
|
+
if (l)
|
|
984
|
+
l.setValue(u.value), l.setIndex(u.index), r[u.index] = l;
|
|
962
985
|
else {
|
|
963
|
-
const [d, h] = T(u.value), [b,
|
|
986
|
+
const [d, h] = T(u.value), [b, C] = T(u.index);
|
|
964
987
|
r[u.index] = {
|
|
965
988
|
key: u.key,
|
|
966
989
|
$value: d,
|
|
967
990
|
setValue: h,
|
|
968
991
|
$index: b,
|
|
969
|
-
setIndex:
|
|
970
|
-
handle:
|
|
992
|
+
setIndex: C,
|
|
993
|
+
handle: K(this.elementContext, Me, {
|
|
971
994
|
$value: d,
|
|
972
995
|
$index: b,
|
|
973
996
|
renderFn: this.renderFn
|
|
@@ -976,8 +999,8 @@ class Me {
|
|
|
976
999
|
}
|
|
977
1000
|
}
|
|
978
1001
|
for (let u = 0; u < r.length; u++) {
|
|
979
|
-
const
|
|
980
|
-
|
|
1002
|
+
const l = r[u], d = ((i = r[u - 1]) == null ? void 0 : i.handle.node) ?? this.node;
|
|
1003
|
+
l.handle.mount(this.node.parentNode, d);
|
|
981
1004
|
}
|
|
982
1005
|
if (this.connectedItems = r, this.elementContext.root.getEnv() === "development") {
|
|
983
1006
|
this.node.textContent = `Repeat (${r.length} item${r.length === 1 ? "" : "s"})`;
|
|
@@ -986,10 +1009,10 @@ class Me {
|
|
|
986
1009
|
}
|
|
987
1010
|
}
|
|
988
1011
|
}
|
|
989
|
-
function
|
|
1012
|
+
function Me({ $value: t, $index: e, renderFn: n }, o) {
|
|
990
1013
|
return n(t, e, o);
|
|
991
1014
|
}
|
|
992
|
-
class
|
|
1015
|
+
class Oe {
|
|
993
1016
|
constructor({ value: e }) {
|
|
994
1017
|
f(this, "node", document.createTextNode(""));
|
|
995
1018
|
f(this, "value", "");
|
|
@@ -1000,7 +1023,7 @@ class Te {
|
|
|
1000
1023
|
return this.node.parentNode != null;
|
|
1001
1024
|
}
|
|
1002
1025
|
async mount(e, n = null) {
|
|
1003
|
-
this.isMounted || (
|
|
1026
|
+
this.isMounted || (w(this.value) ? this.stopCallback = this.value.watch((o) => {
|
|
1004
1027
|
this.update(o);
|
|
1005
1028
|
}) : this.update(this.value)), e.insertBefore(this.node, (n == null ? void 0 : n.nextSibling) ?? null);
|
|
1006
1029
|
}
|
|
@@ -1011,66 +1034,64 @@ class Te {
|
|
|
1011
1034
|
e != null ? this.node.textContent = e.toString() : this.node.textContent = "";
|
|
1012
1035
|
}
|
|
1013
1036
|
}
|
|
1014
|
-
const ne = Symbol("Markup");
|
|
1015
1037
|
function V(t) {
|
|
1016
|
-
return L(t) && t
|
|
1038
|
+
return L(t) && (typeof t.type == "string" || typeof t.type == "function") && Array.isArray(t.children);
|
|
1017
1039
|
}
|
|
1018
|
-
function
|
|
1040
|
+
function te(t) {
|
|
1019
1041
|
return L(t) && E(t.connect) && E(t.disconnect);
|
|
1020
1042
|
}
|
|
1021
1043
|
function j(t) {
|
|
1022
|
-
return
|
|
1044
|
+
return F(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
|
|
1023
1045
|
if (e instanceof Node)
|
|
1024
|
-
return
|
|
1025
|
-
if (e instanceof
|
|
1026
|
-
return
|
|
1046
|
+
return x("$node", { value: e });
|
|
1047
|
+
if (e instanceof oe)
|
|
1048
|
+
return x("$node", { value: e.node });
|
|
1027
1049
|
if (V(e))
|
|
1028
1050
|
return e;
|
|
1029
|
-
if (M(e) ||
|
|
1030
|
-
return
|
|
1031
|
-
if (
|
|
1032
|
-
return
|
|
1033
|
-
|
|
1051
|
+
if (M(e) || fe(e))
|
|
1052
|
+
return x("$text", { value: e });
|
|
1053
|
+
if (w(e))
|
|
1054
|
+
return x("$observer", {
|
|
1055
|
+
states: [e],
|
|
1034
1056
|
renderFn: (n) => n
|
|
1035
1057
|
});
|
|
1036
1058
|
throw console.error(e), new TypeError(`Unexpected child type. Got: ${e}`);
|
|
1037
1059
|
});
|
|
1038
1060
|
}
|
|
1039
|
-
function
|
|
1040
|
-
return e != null &&
|
|
1041
|
-
[ne]: !0,
|
|
1061
|
+
function x(t, e, ...n) {
|
|
1062
|
+
return e != null && Te(e), {
|
|
1042
1063
|
type: t,
|
|
1043
1064
|
props: e,
|
|
1044
1065
|
children: j(n)
|
|
1045
1066
|
};
|
|
1046
1067
|
}
|
|
1047
|
-
function
|
|
1048
|
-
if (t.ref && !
|
|
1068
|
+
function Te(t) {
|
|
1069
|
+
if (t.ref && !ne(t.ref))
|
|
1049
1070
|
throw console.warn(t.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${t.ref}`);
|
|
1050
1071
|
for (const e in t)
|
|
1051
1072
|
if (e.startsWith("$$") && t[e] !== void 0) {
|
|
1052
|
-
if (!
|
|
1053
|
-
throw new TypeError(`Prop '${e}' is named as a
|
|
1054
|
-
} else if (e.startsWith("$") && t[e] !== void 0 && !
|
|
1055
|
-
throw new TypeError(`Prop '${e}' is named as a
|
|
1073
|
+
if (!B(t[e]))
|
|
1074
|
+
throw new TypeError(`Prop '${e}' is named as a SettableState but value is not. Got: ${t[e]}`);
|
|
1075
|
+
} else if (e.startsWith("$") && t[e] !== void 0 && !w(t[e]))
|
|
1076
|
+
throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${t[e]}`);
|
|
1056
1077
|
}
|
|
1057
|
-
const
|
|
1058
|
-
function
|
|
1059
|
-
const o =
|
|
1060
|
-
return
|
|
1078
|
+
const Re = be.bind(x);
|
|
1079
|
+
function Be(t, e, n) {
|
|
1080
|
+
const o = q(t);
|
|
1081
|
+
return x("$cond", {
|
|
1061
1082
|
$predicate: o,
|
|
1062
1083
|
thenContent: e,
|
|
1063
1084
|
elseContent: n
|
|
1064
1085
|
});
|
|
1065
1086
|
}
|
|
1066
|
-
function
|
|
1067
|
-
const o =
|
|
1068
|
-
return
|
|
1087
|
+
function Ke(t, e, n) {
|
|
1088
|
+
const o = q(t);
|
|
1089
|
+
return x("$repeat", { $items: o, keyFn: e, renderFn: n });
|
|
1069
1090
|
}
|
|
1070
|
-
function
|
|
1071
|
-
return
|
|
1091
|
+
function We(t, e) {
|
|
1092
|
+
return x("$portal", { parent: t, content: e });
|
|
1072
1093
|
}
|
|
1073
|
-
function
|
|
1094
|
+
function He() {
|
|
1074
1095
|
const [t, e] = T();
|
|
1075
1096
|
return {
|
|
1076
1097
|
get: t.get,
|
|
@@ -1083,10 +1104,10 @@ function De() {
|
|
|
1083
1104
|
}
|
|
1084
1105
|
};
|
|
1085
1106
|
}
|
|
1086
|
-
function
|
|
1107
|
+
function ne(t) {
|
|
1087
1108
|
return !(t == null || typeof t != "object" || !t.hasOwnProperty("node"));
|
|
1088
1109
|
}
|
|
1089
|
-
class
|
|
1110
|
+
class oe {
|
|
1090
1111
|
constructor(e) {
|
|
1091
1112
|
f(this, "node");
|
|
1092
1113
|
this.node = e;
|
|
@@ -1102,24 +1123,24 @@ class ie {
|
|
|
1102
1123
|
}
|
|
1103
1124
|
}
|
|
1104
1125
|
function S(t, e) {
|
|
1105
|
-
return (
|
|
1126
|
+
return (F(e) ? e : [e]).map((o) => {
|
|
1106
1127
|
if (E(o.type))
|
|
1107
|
-
return
|
|
1128
|
+
return K(t, o.type, o.props, o.children);
|
|
1108
1129
|
if (M(o.type))
|
|
1109
1130
|
switch (o.type) {
|
|
1110
1131
|
case "$node": {
|
|
1111
1132
|
const r = o.props;
|
|
1112
|
-
return new
|
|
1133
|
+
return new oe(r.value);
|
|
1113
1134
|
}
|
|
1114
1135
|
case "$text": {
|
|
1115
1136
|
const r = o.props;
|
|
1116
|
-
return new
|
|
1137
|
+
return new Oe({
|
|
1117
1138
|
value: r.value
|
|
1118
1139
|
});
|
|
1119
1140
|
}
|
|
1120
1141
|
case "$cond": {
|
|
1121
1142
|
const r = o.props;
|
|
1122
|
-
return new
|
|
1143
|
+
return new Ce({
|
|
1123
1144
|
$predicate: r.$predicate,
|
|
1124
1145
|
thenContent: r.thenContent,
|
|
1125
1146
|
elseContent: r.elseContent,
|
|
@@ -1128,7 +1149,7 @@ function S(t, e) {
|
|
|
1128
1149
|
}
|
|
1129
1150
|
case "$repeat": {
|
|
1130
1151
|
const r = o.props;
|
|
1131
|
-
return new
|
|
1152
|
+
return new Ae({
|
|
1132
1153
|
$items: r.$items,
|
|
1133
1154
|
keyFn: r.keyFn,
|
|
1134
1155
|
renderFn: r.renderFn,
|
|
@@ -1138,21 +1159,21 @@ function S(t, e) {
|
|
|
1138
1159
|
case "$observer": {
|
|
1139
1160
|
const r = o.props;
|
|
1140
1161
|
return new xe({
|
|
1141
|
-
|
|
1162
|
+
states: r.states,
|
|
1142
1163
|
renderFn: r.renderFn,
|
|
1143
1164
|
elementContext: t
|
|
1144
1165
|
});
|
|
1145
1166
|
}
|
|
1146
1167
|
case "$outlet": {
|
|
1147
1168
|
const r = o.props;
|
|
1148
|
-
return new
|
|
1169
|
+
return new Se({
|
|
1149
1170
|
$children: r.$children,
|
|
1150
1171
|
elementContext: t
|
|
1151
1172
|
});
|
|
1152
1173
|
}
|
|
1153
1174
|
case "$portal": {
|
|
1154
1175
|
const r = o.props;
|
|
1155
|
-
return new
|
|
1176
|
+
return new Ee({
|
|
1156
1177
|
content: r.content,
|
|
1157
1178
|
parent: r.parent,
|
|
1158
1179
|
elementContext: t
|
|
@@ -1161,7 +1182,7 @@ function S(t, e) {
|
|
|
1161
1182
|
default:
|
|
1162
1183
|
if (o.type.startsWith("$"))
|
|
1163
1184
|
throw new Error(`Unknown markup type: ${o.type}`);
|
|
1164
|
-
return new
|
|
1185
|
+
return new ve({
|
|
1165
1186
|
tag: o.type,
|
|
1166
1187
|
props: o.props ?? {},
|
|
1167
1188
|
children: o.children,
|
|
@@ -1203,43 +1224,43 @@ function A(t) {
|
|
|
1203
1224
|
}
|
|
1204
1225
|
};
|
|
1205
1226
|
}
|
|
1206
|
-
function
|
|
1207
|
-
return t == null || t === !1 || typeof t == "string" || typeof t == "number" || V(t) ||
|
|
1227
|
+
function re(t) {
|
|
1228
|
+
return t == null || t === !1 || typeof t == "string" || typeof t == "number" || V(t) || w(t) || Y(re, t);
|
|
1208
1229
|
}
|
|
1209
|
-
function
|
|
1230
|
+
function ze(t, e) {
|
|
1210
1231
|
return e.outlet();
|
|
1211
1232
|
}
|
|
1212
1233
|
export {
|
|
1213
1234
|
S as A,
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1235
|
+
_e as B,
|
|
1236
|
+
We as C,
|
|
1237
|
+
Ke as D,
|
|
1238
|
+
ze as P,
|
|
1239
|
+
w as a,
|
|
1219
1240
|
I as b,
|
|
1220
|
-
|
|
1221
|
-
|
|
1241
|
+
Be as c,
|
|
1242
|
+
ge as d,
|
|
1222
1243
|
E as e,
|
|
1223
1244
|
M as f,
|
|
1224
1245
|
T as g,
|
|
1225
|
-
|
|
1246
|
+
Re as h,
|
|
1226
1247
|
L as i,
|
|
1227
|
-
|
|
1248
|
+
Pe as j,
|
|
1228
1249
|
Fe as k,
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1250
|
+
Le as l,
|
|
1251
|
+
qe as m,
|
|
1252
|
+
Ge as n,
|
|
1253
|
+
He as o,
|
|
1254
|
+
ne as p,
|
|
1255
|
+
je as q,
|
|
1256
|
+
x as r,
|
|
1257
|
+
Ue as s,
|
|
1258
|
+
q as t,
|
|
1259
|
+
pe as u,
|
|
1260
|
+
O as v,
|
|
1261
|
+
G as w,
|
|
1262
|
+
Ie as x,
|
|
1263
|
+
K as y,
|
|
1243
1264
|
A as z
|
|
1244
1265
|
};
|
|
1245
|
-
//# sourceMappingURL=passthrough-
|
|
1266
|
+
//# sourceMappingURL=passthrough-BVaqqjam.js.map
|