@manyducks.co/dolla 2.0.0-alpha.18 → 2.0.0-alpha.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +447 -442
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/modules/render.d.ts +5 -8
- package/dist/{passthrough-TqzdQt5Q.js → passthrough-DcOD0Wf3.js} +153 -152
- package/dist/passthrough-DcOD0Wf3.js.map +1 -0
- package/notes/scratch.md +1 -1
- package/package.json +1 -1
- package/dist/passthrough-TqzdQt5Q.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (n, e, t) =>
|
|
4
|
-
function
|
|
1
|
+
var me = Object.defineProperty;
|
|
2
|
+
var ge = (n, e, t) => e in n ? me(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var r = (n, e, t) => ge(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
function we(n) {
|
|
5
5
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
6
6
|
}
|
|
7
|
-
var
|
|
8
|
-
function
|
|
7
|
+
var O = { exports: {} }, Z;
|
|
8
|
+
function ye() {
|
|
9
9
|
return Z || (Z = 1, function(n, e) {
|
|
10
10
|
Object.defineProperty(e, "__esModule", { value: !0 });
|
|
11
11
|
var t = /* @__PURE__ */ function() {
|
|
@@ -49,14 +49,14 @@ function we() {
|
|
|
49
49
|
return c * h.charCodeAt(0) * d + 1;
|
|
50
50
|
}, 1);
|
|
51
51
|
}, a = function(l) {
|
|
52
|
-
var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, b = l.hashFunction, g = b === void 0 ? u : b, k = l.scheme, _ = k === void 0 ? "hex" : k, L = o(g(c), d, m, S), w = t(L, 3), D = w[0], H = w[1], z = w[2], Y = i(D / 360, H, z),
|
|
53
|
-
return _ === "hsl" ? [D, H, z] : _ === "rgb" ? Y :
|
|
52
|
+
var c = l.str, h = l.hue, d = h === void 0 ? { min: 0, max: 360 } : h, f = l.sat, m = f === void 0 ? { min: 0.35, max: 0.65 } : f, v = l.light, S = v === void 0 ? { min: 0.3, max: 0.7 } : v, b = l.hashFunction, g = b === void 0 ? u : b, k = l.scheme, _ = k === void 0 ? "hex" : k, L = o(g(c), d, m, S), w = t(L, 3), D = w[0], H = w[1], z = w[2], Y = i(D / 360, H, z), pe = s(Y);
|
|
53
|
+
return _ === "hsl" ? [D, H, z] : _ === "rgb" ? Y : pe;
|
|
54
54
|
};
|
|
55
55
|
e.default = a, n.exports = e.default;
|
|
56
|
-
}(
|
|
56
|
+
}(O, O.exports)), O.exports;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
const
|
|
58
|
+
var Ce = ye();
|
|
59
|
+
const be = /* @__PURE__ */ we(Ce);
|
|
60
60
|
function G(n) {
|
|
61
61
|
if (n === void 0)
|
|
62
62
|
return "undefined";
|
|
@@ -67,9 +67,9 @@ function G(n) {
|
|
|
67
67
|
case "number":
|
|
68
68
|
return isNaN(n) ? "NaN" : "number";
|
|
69
69
|
case "function":
|
|
70
|
-
return
|
|
70
|
+
return oe(n) ? "class" : e;
|
|
71
71
|
case "object":
|
|
72
|
-
return M(n) ? "array" :
|
|
72
|
+
return M(n) ? "array" : ve(n) ? "promise" : e;
|
|
73
73
|
default:
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
@@ -77,11 +77,11 @@ function G(n) {
|
|
|
77
77
|
function M(n) {
|
|
78
78
|
return Array.isArray(n);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function ie(...n) {
|
|
81
81
|
const e = n[0], t = (s) => M(s) && s.every((i) => e(i));
|
|
82
82
|
return n.length < 2 ? t : t(n[1]);
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function He(...n) {
|
|
85
85
|
const e = n[0], t = $(n[2]) ? n[2] : "Expected an array of valid items. Got type: %t, value: %v", s = (i) => {
|
|
86
86
|
if (M(i) && i.every((o) => e(o)))
|
|
87
87
|
return !0;
|
|
@@ -92,26 +92,26 @@ function De(...n) {
|
|
|
92
92
|
function $(n) {
|
|
93
93
|
return typeof n == "string";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function ze(n, e) {
|
|
96
96
|
if ($(n))
|
|
97
97
|
return !0;
|
|
98
98
|
throw new TypeError(j(n, e ?? "Expected a string. Got type: %t, value: %v"));
|
|
99
99
|
}
|
|
100
100
|
function x(n) {
|
|
101
|
-
return typeof n == "function" && !
|
|
101
|
+
return typeof n == "function" && !oe(n);
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function _e(n) {
|
|
104
104
|
return typeof n == "number" && !isNaN(n);
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function ve(n) {
|
|
107
107
|
if (n == null) return !1;
|
|
108
108
|
const e = n;
|
|
109
109
|
return e instanceof Promise || x(e.then) && x(e.catch) && x(e.finally);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function oe(n) {
|
|
112
112
|
return typeof n == "function" && /^\s*class\s+/.test(n.toString());
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Ye(...n) {
|
|
115
115
|
const e = n[0], t = $(n[2]) ? n[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, s = (i) => {
|
|
116
116
|
if (i instanceof e)
|
|
117
117
|
return !0;
|
|
@@ -119,7 +119,7 @@ function ze(...n) {
|
|
|
119
119
|
};
|
|
120
120
|
return n.length < 2 ? s : s(n[1]);
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function W(n) {
|
|
123
123
|
return n != null && typeof n == "object" && !M(n);
|
|
124
124
|
}
|
|
125
125
|
function j(n, e) {
|
|
@@ -127,9 +127,9 @@ function j(n, e) {
|
|
|
127
127
|
const t = G(n), s = ((i = n == null ? void 0 : n.toString) == null ? void 0 : i.call(n)) || String(n);
|
|
128
128
|
return e.replaceAll("%t", t).replaceAll("%v", s);
|
|
129
129
|
}
|
|
130
|
-
const
|
|
130
|
+
const ke = () => {
|
|
131
131
|
};
|
|
132
|
-
function
|
|
132
|
+
function Se(n, e) {
|
|
133
133
|
const t = (s) => {
|
|
134
134
|
const i = {};
|
|
135
135
|
for (const o in s)
|
|
@@ -138,20 +138,20 @@ function ke(n, e) {
|
|
|
138
138
|
};
|
|
139
139
|
return e == null ? t : t(e);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function Ze() {
|
|
142
142
|
if (typeof window < "u" && window.console)
|
|
143
143
|
return window.console;
|
|
144
144
|
if (typeof global < "u" && global.console)
|
|
145
145
|
return global.console;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
147
|
+
function xe(n) {
|
|
148
|
+
return be({
|
|
149
149
|
str: n,
|
|
150
150
|
sat: { min: 0.35, max: 0.55 },
|
|
151
151
|
light: { min: 0.6, max: 0.6 }
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Je(n) {
|
|
155
155
|
if (n instanceof RegExp)
|
|
156
156
|
return (s) => n.test(s);
|
|
157
157
|
const e = {
|
|
@@ -173,7 +173,7 @@ function Ze(n) {
|
|
|
173
173
|
return !(o.some((u) => u(s)) || i.length > 0 && !i.some((u) => u(s)));
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
const
|
|
176
|
+
const P = {
|
|
177
177
|
watcherCount: 0,
|
|
178
178
|
increment() {
|
|
179
179
|
this.watcherCount++, this._log();
|
|
@@ -188,7 +188,7 @@ const O = {
|
|
|
188
188
|
console.log(
|
|
189
189
|
`%c[DOLLA_DEV_DEBUG] %c${this._label}%c%c%c`,
|
|
190
190
|
"color:#e44c4c;font-weight:bold",
|
|
191
|
-
`color:${
|
|
191
|
+
`color:${xe(this._label)};font-weight:bold`,
|
|
192
192
|
"color:#777",
|
|
193
193
|
"color:#aaa",
|
|
194
194
|
"color:#777",
|
|
@@ -196,26 +196,26 @@ const O = {
|
|
|
196
196
|
), this._timeout = null;
|
|
197
197
|
}, 200));
|
|
198
198
|
}
|
|
199
|
-
},
|
|
199
|
+
}, T = Symbol("State"), B = Symbol("SettableState"), re = Symbol("Ref");
|
|
200
200
|
function p(n) {
|
|
201
|
-
return (n == null ? void 0 : n[
|
|
201
|
+
return (n == null ? void 0 : n[T]) === !0;
|
|
202
202
|
}
|
|
203
203
|
function R(n) {
|
|
204
204
|
return (n == null ? void 0 : n[B]) === !0;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
return (n == null ? void 0 : n[
|
|
206
|
+
function ue(n) {
|
|
207
|
+
return (n == null ? void 0 : n[re]) === !0;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function Ee(n) {
|
|
210
210
|
return p(n) ? n.get() : n;
|
|
211
211
|
}
|
|
212
212
|
function F(n) {
|
|
213
|
-
return R(n) ? new
|
|
213
|
+
return R(n) ? new U(n) : p(n) ? n : new U({
|
|
214
214
|
get() {
|
|
215
215
|
return n;
|
|
216
216
|
},
|
|
217
217
|
watch(e, t = {}) {
|
|
218
|
-
return t != null && t.lazy || e(n),
|
|
218
|
+
return t != null && t.lazy || e(n), ke;
|
|
219
219
|
}
|
|
220
220
|
});
|
|
221
221
|
}
|
|
@@ -244,15 +244,15 @@ class A {
|
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
246
|
watch(e, t) {
|
|
247
|
-
return this.watchers.push(e), t != null && t.lazy || e(this.value),
|
|
247
|
+
return this.watchers.push(e), t != null && t.lazy || e(this.value), P.increment(), () => {
|
|
248
248
|
const s = this.watchers.indexOf(e);
|
|
249
|
-
s > -1 && this.watchers.splice(s, 1),
|
|
249
|
+
s > -1 && this.watchers.splice(s, 1), P.decrement();
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
var X;
|
|
254
|
-
X =
|
|
255
|
-
class
|
|
254
|
+
X = T;
|
|
255
|
+
class U {
|
|
256
256
|
constructor(e) {
|
|
257
257
|
// Instances will pass isState() with this symbol
|
|
258
258
|
r(this, X, !0);
|
|
@@ -270,11 +270,11 @@ class P {
|
|
|
270
270
|
}
|
|
271
271
|
function I(n, e) {
|
|
272
272
|
const t = new A(n, e);
|
|
273
|
-
return [new
|
|
273
|
+
return [new U(t), (i) => t.set(i)];
|
|
274
274
|
}
|
|
275
275
|
var ee, te;
|
|
276
|
-
te =
|
|
277
|
-
class
|
|
276
|
+
te = T, ee = B;
|
|
277
|
+
class $e {
|
|
278
278
|
constructor(e) {
|
|
279
279
|
// Instances will pass isState() and isSettableState() with these symbols
|
|
280
280
|
r(this, te, !0);
|
|
@@ -294,19 +294,19 @@ class Ee {
|
|
|
294
294
|
return this.__value.watch(e, t);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
function Je(n, e) {
|
|
298
|
-
return new Ee(new A(n, e));
|
|
299
|
-
}
|
|
300
297
|
function Qe(n, e) {
|
|
298
|
+
return new $e(new A(n, e));
|
|
299
|
+
}
|
|
300
|
+
function Xe(n, e) {
|
|
301
301
|
return {
|
|
302
|
-
[
|
|
302
|
+
[T]: !0,
|
|
303
303
|
[B]: !0,
|
|
304
304
|
get: n.get.bind(n),
|
|
305
305
|
watch: n.watch.bind(n),
|
|
306
306
|
set: e
|
|
307
307
|
};
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function et(n, e) {
|
|
310
310
|
return function(s) {
|
|
311
311
|
const i = n.get();
|
|
312
312
|
let o;
|
|
@@ -314,7 +314,7 @@ function Xe(n, e) {
|
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
const J = Symbol("EMPTY");
|
|
317
|
-
class
|
|
317
|
+
class Ne {
|
|
318
318
|
constructor(e, t, s) {
|
|
319
319
|
r(this, "equals", A.defaultEquals);
|
|
320
320
|
/**
|
|
@@ -364,8 +364,8 @@ class $e {
|
|
|
364
364
|
watch(e, t) {
|
|
365
365
|
this.isWatchingSources || this.startWatchingSources();
|
|
366
366
|
const s = this.watchers;
|
|
367
|
-
return s.push(e), t != null && t.lazy || e(this.rawValue),
|
|
368
|
-
s.splice(s.indexOf(e), 1), this.isWatchingSources && s.length === 0 && this.stopWatchingSources(),
|
|
367
|
+
return s.push(e), t != null && t.lazy || e(this.rawValue), P.increment(), () => {
|
|
368
|
+
s.splice(s.indexOf(e), 1), this.isWatchingSources && s.length === 0 && this.stopWatchingSources(), P.decrement();
|
|
369
369
|
};
|
|
370
370
|
}
|
|
371
371
|
/*==========================*\
|
|
@@ -386,7 +386,7 @@ class $e {
|
|
|
386
386
|
return this.isWatchingSources || this.update(), this.rawValue;
|
|
387
387
|
}
|
|
388
388
|
setValue(e) {
|
|
389
|
-
this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = e, this.rawValue =
|
|
389
|
+
this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.value = e, this.rawValue = Ee(e), this.isWatchingSources && p(e) ? this.stopWatchingCurrentValue = e.watch((t) => {
|
|
390
390
|
this.rawValue = t, this.notify(t);
|
|
391
391
|
}) : this.notify(this.rawValue);
|
|
392
392
|
}
|
|
@@ -407,15 +407,16 @@ class $e {
|
|
|
407
407
|
this.sourceWatcher.stopAll(), this.stopWatchingCurrentValue && (this.stopWatchingCurrentValue(), this.stopWatchingCurrentValue = void 0), this.isWatchingSources = !1;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
function
|
|
411
|
-
const s = new
|
|
412
|
-
return new
|
|
410
|
+
function Me(n, e, t) {
|
|
411
|
+
const s = new Ne(n, e, t);
|
|
412
|
+
return new U(s);
|
|
413
413
|
}
|
|
414
|
-
var ne;
|
|
415
|
-
ne =
|
|
416
|
-
class
|
|
414
|
+
var ne, se;
|
|
415
|
+
se = re, ne = T;
|
|
416
|
+
class Ae {
|
|
417
417
|
constructor(e) {
|
|
418
|
-
// Instances will pass isRef() with
|
|
418
|
+
// Instances will pass isRef() and isState() with these symbols
|
|
419
|
+
r(this, se, !0);
|
|
419
420
|
r(this, ne, !0);
|
|
420
421
|
r(this, "__value");
|
|
421
422
|
this.__value = e;
|
|
@@ -433,8 +434,8 @@ class Me {
|
|
|
433
434
|
this.__value.set(e);
|
|
434
435
|
}
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
-
return new
|
|
437
|
+
function tt() {
|
|
438
|
+
return new Ae(new A(void 0));
|
|
438
439
|
}
|
|
439
440
|
function K() {
|
|
440
441
|
const n = [];
|
|
@@ -444,7 +445,7 @@ function K() {
|
|
|
444
445
|
throw new TypeError("Expected at least one state to watch.");
|
|
445
446
|
e = e.map(F);
|
|
446
447
|
let s;
|
|
447
|
-
return e.length > 1 ? s =
|
|
448
|
+
return e.length > 1 ? s = Me(e, t).watch(() => null) : s = e[0].watch(t), n.push(s), () => {
|
|
448
449
|
let i = n.indexOf(s);
|
|
449
450
|
i > -1 && n.splice(i, 1), s();
|
|
450
451
|
};
|
|
@@ -455,7 +456,7 @@ function K() {
|
|
|
455
456
|
}
|
|
456
457
|
};
|
|
457
458
|
}
|
|
458
|
-
function
|
|
459
|
+
function Ve(n) {
|
|
459
460
|
for (var e, t, s = arguments, i = 1, o = "", u = "", a = [0], l = function(d) {
|
|
460
461
|
i === 1 && (d || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(d ? s[d] : o) : i === 3 && (d || o) ? (a[1] = d ? s[d] : o, i = 2) : i === 2 && o === "..." && d ? a[2] = Object.assign(a[2] || {}, s[d]) : i === 2 && o && !d ? (a[2] = a[2] || {})[o] = !0 : i >= 5 && (i === 5 ? ((a[2] = a[2] || {})[t] = d ? o ? o + s[d] : s[d] : o, i = 6) : (d || o) && (a[2][t] += d ? o + s[d] : o)), o = "";
|
|
461
462
|
}, c = 0; c < n.length; c++) {
|
|
@@ -465,7 +466,7 @@ function Ae(n) {
|
|
|
465
466
|
}
|
|
466
467
|
return l(), a.length > 2 ? a.slice(1) : a[1];
|
|
467
468
|
}
|
|
468
|
-
class
|
|
469
|
+
class Te {
|
|
469
470
|
constructor(e) {
|
|
470
471
|
r(this, "node");
|
|
471
472
|
r(this, "endNode");
|
|
@@ -508,33 +509,33 @@ class Ve {
|
|
|
508
509
|
}
|
|
509
510
|
}
|
|
510
511
|
}
|
|
511
|
-
const
|
|
512
|
-
let
|
|
512
|
+
const Oe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
513
|
+
let ae = (n = 21) => {
|
|
513
514
|
let e = "", t = crypto.getRandomValues(new Uint8Array(n |= 0));
|
|
514
515
|
for (; n--; )
|
|
515
|
-
e +=
|
|
516
|
+
e += Oe[t[n] & 63];
|
|
516
517
|
return e;
|
|
517
518
|
};
|
|
518
|
-
const
|
|
519
|
-
class
|
|
519
|
+
const Pe = (n) => /^on[A-Z]/.test(n);
|
|
520
|
+
class Ue {
|
|
520
521
|
constructor({ tag: e, props: t, children: s, elementContext: i }) {
|
|
521
522
|
r(this, "node");
|
|
522
523
|
r(this, "props");
|
|
523
524
|
r(this, "children");
|
|
524
525
|
r(this, "stopCallbacks", []);
|
|
525
526
|
r(this, "elementContext");
|
|
526
|
-
r(this, "uniqueId",
|
|
527
|
+
r(this, "uniqueId", ae());
|
|
527
528
|
// Track the ref so we can nullify it on unmount.
|
|
528
529
|
r(this, "ref");
|
|
529
530
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
530
531
|
r(this, "canClickAway", !1);
|
|
531
532
|
if (i = { ...i }, e.toLowerCase() === "svg" && (i.isSVG = !0), i.isSVG ? this.node = document.createElementNS("http://www.w3.org/2000/svg", e) : this.node = document.createElement(e), i.root.getEnv() === "development" && (this.node.dataset.uniqueId = this.uniqueId), t.ref)
|
|
532
|
-
if (
|
|
533
|
+
if (ue(t.ref))
|
|
533
534
|
this.ref = t.ref;
|
|
534
535
|
else
|
|
535
536
|
throw new Error("Expected ref to be a Ref object. Got: " + t.ref);
|
|
536
537
|
this.props = {
|
|
537
|
-
...
|
|
538
|
+
...Se(["ref", "class", "className"], t),
|
|
538
539
|
class: t.className ?? t.class
|
|
539
540
|
}, this.children = s ? C(i, s) : [], this.elementContext = i;
|
|
540
541
|
}
|
|
@@ -570,11 +571,11 @@ class Pe {
|
|
|
570
571
|
attachProp(e, t, s) {
|
|
571
572
|
p(e) ? this.stopCallbacks.push(
|
|
572
573
|
e.watch((i) => {
|
|
573
|
-
this.elementContext.root.render.
|
|
574
|
+
this.elementContext.root.render.write(() => {
|
|
574
575
|
t(i);
|
|
575
576
|
}, s);
|
|
576
577
|
})
|
|
577
|
-
) : this.elementContext.root.render.
|
|
578
|
+
) : this.elementContext.root.render.write(() => {
|
|
578
579
|
t(e);
|
|
579
580
|
}, s);
|
|
580
581
|
}
|
|
@@ -617,13 +618,13 @@ class Pe {
|
|
|
617
618
|
this.getUpdateKey("attr", "value")
|
|
618
619
|
);
|
|
619
620
|
const o = (u) => {
|
|
620
|
-
const a =
|
|
621
|
+
const a = We(i.get(), u.currentTarget.value);
|
|
621
622
|
i.set(a);
|
|
622
623
|
};
|
|
623
624
|
e.addEventListener("input", o), this.stopCallbacks.push(() => {
|
|
624
625
|
e.removeEventListener("input", o);
|
|
625
626
|
});
|
|
626
|
-
} else if (
|
|
627
|
+
} else if (Pe(s)) {
|
|
627
628
|
const o = s.slice(2).toLowerCase(), u = p(i) ? (a) => i.get()(a) : i;
|
|
628
629
|
e.addEventListener(o, u), this.stopCallbacks.push(() => {
|
|
629
630
|
e.removeEventListener(o, u);
|
|
@@ -636,7 +637,7 @@ class Pe {
|
|
|
636
637
|
},
|
|
637
638
|
this.getUpdateKey("attr", s)
|
|
638
639
|
);
|
|
639
|
-
else if (!
|
|
640
|
+
else if (!Fe.includes(s))
|
|
640
641
|
if (this.elementContext.isSVG)
|
|
641
642
|
this.attachProp(
|
|
642
643
|
i,
|
|
@@ -719,7 +720,7 @@ class Pe {
|
|
|
719
720
|
if (p(t)) {
|
|
720
721
|
let o;
|
|
721
722
|
const u = t.watch((a) => {
|
|
722
|
-
this.elementContext.root.render.
|
|
723
|
+
this.elementContext.root.render.write(
|
|
723
724
|
() => {
|
|
724
725
|
x(o) && o(), e.style.cssText = "", o = this.applyStyles(e, a, s);
|
|
725
726
|
},
|
|
@@ -728,12 +729,12 @@ class Pe {
|
|
|
728
729
|
});
|
|
729
730
|
s.push(u), i.push(u);
|
|
730
731
|
} else {
|
|
731
|
-
const o =
|
|
732
|
+
const o = ce(t);
|
|
732
733
|
for (const u in o) {
|
|
733
734
|
const { value: a, priority: l } = o[u];
|
|
734
735
|
if (p(a)) {
|
|
735
736
|
const c = a.watch((h) => {
|
|
736
|
-
this.elementContext.root.render.
|
|
737
|
+
this.elementContext.root.render.write(() => {
|
|
737
738
|
h ? e.style.setProperty(u, String(h), l) : e.style.removeProperty(u);
|
|
738
739
|
});
|
|
739
740
|
});
|
|
@@ -751,7 +752,7 @@ class Pe {
|
|
|
751
752
|
if (p(t)) {
|
|
752
753
|
let o;
|
|
753
754
|
const u = t.watch((a) => {
|
|
754
|
-
this.elementContext.root.render.
|
|
755
|
+
this.elementContext.root.render.write(
|
|
755
756
|
() => {
|
|
756
757
|
x(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, a, s);
|
|
757
758
|
},
|
|
@@ -760,12 +761,12 @@ class Pe {
|
|
|
760
761
|
});
|
|
761
762
|
s.push(u), i.push(u);
|
|
762
763
|
} else {
|
|
763
|
-
const o =
|
|
764
|
+
const o = le(t);
|
|
764
765
|
for (const u in o) {
|
|
765
766
|
const a = o[u];
|
|
766
767
|
if (p(a)) {
|
|
767
768
|
const l = a.watch((c) => {
|
|
768
|
-
this.elementContext.root.render.
|
|
769
|
+
this.elementContext.root.render.write(() => {
|
|
769
770
|
c ? e.classList.add(u) : e.classList.remove(u);
|
|
770
771
|
});
|
|
771
772
|
});
|
|
@@ -779,18 +780,18 @@ class Pe {
|
|
|
779
780
|
};
|
|
780
781
|
}
|
|
781
782
|
}
|
|
782
|
-
function
|
|
783
|
+
function le(n) {
|
|
783
784
|
let e = {};
|
|
784
785
|
if ($(n)) {
|
|
785
786
|
const t = n.split(" ");
|
|
786
787
|
for (const s of t)
|
|
787
788
|
e[s] = !0;
|
|
788
|
-
} else
|
|
789
|
-
Object.assign(e,
|
|
789
|
+
} else W(n) ? Object.assign(e, n) : Array.isArray(n) && Array.from(n).filter(Boolean).forEach((t) => {
|
|
790
|
+
Object.assign(e, le(t));
|
|
790
791
|
});
|
|
791
792
|
return delete e.undefined, e;
|
|
792
793
|
}
|
|
793
|
-
function
|
|
794
|
+
function ce(n) {
|
|
794
795
|
let e = {};
|
|
795
796
|
if ($(n)) {
|
|
796
797
|
const t = n.split(";").filter((s) => s.trim() !== "");
|
|
@@ -801,23 +802,23 @@ function le(n) {
|
|
|
801
802
|
o.includes("!important") ? (u.priority = "important", u.value = o.replace("!important", "").trim()) : u.value = o.trim(), e[Q(i.trim())] = u;
|
|
802
803
|
}
|
|
803
804
|
}
|
|
804
|
-
if (
|
|
805
|
+
if (W(n))
|
|
805
806
|
for (const t in n)
|
|
806
807
|
t.startsWith("--") ? e[t] = { value: n[t] } : e[Q(t)] = { value: n[t] };
|
|
807
808
|
else Array.isArray(n) && Array.from(n).filter((t) => t != null).forEach((t) => {
|
|
808
|
-
Object.assign(e,
|
|
809
|
+
Object.assign(e, ce(t));
|
|
809
810
|
});
|
|
810
811
|
return e;
|
|
811
812
|
}
|
|
812
813
|
function Q(n) {
|
|
813
814
|
return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e.toLowerCase());
|
|
814
815
|
}
|
|
815
|
-
function
|
|
816
|
+
function We(n, e) {
|
|
816
817
|
const t = typeof n;
|
|
817
818
|
return t === "string" ? String(e) : t === "number" ? Number(e) : t === "boolean" ? !!e : e;
|
|
818
819
|
}
|
|
819
|
-
const
|
|
820
|
-
class
|
|
820
|
+
const Fe = ["ref", "children", "class", "style", "data"];
|
|
821
|
+
class qe {
|
|
821
822
|
constructor({ states: e, renderFn: t, elementContext: s }) {
|
|
822
823
|
r(this, "node");
|
|
823
824
|
r(this, "endNode");
|
|
@@ -832,7 +833,7 @@ class Fe {
|
|
|
832
833
|
start: () => {
|
|
833
834
|
i == null && (i = this.watcher.watch(e, (...o) => {
|
|
834
835
|
const u = this.renderFn(...o);
|
|
835
|
-
if (!
|
|
836
|
+
if (!fe(u))
|
|
836
837
|
throw console.error(u), new TypeError(
|
|
837
838
|
`Observer received invalid value to render. Got type: ${G(u)}, value: ${u}`
|
|
838
839
|
);
|
|
@@ -863,7 +864,7 @@ class Fe {
|
|
|
863
864
|
var s, i;
|
|
864
865
|
if (this.cleanup(), e == null || !this.isMounted)
|
|
865
866
|
return;
|
|
866
|
-
const t = e.map((o) =>
|
|
867
|
+
const t = e.map((o) => he(o) ? o : N(o) ? E(C(this.elementContext, o)) : E(C(this.elementContext, V(o))));
|
|
867
868
|
for (const o of t) {
|
|
868
869
|
const u = ((s = this.connectedViews.at(-1)) == null ? void 0 : s.node) || this.node;
|
|
869
870
|
o.mount(this.node.parentNode, u), this.connectedViews.push(o);
|
|
@@ -874,7 +875,7 @@ class Fe {
|
|
|
874
875
|
}
|
|
875
876
|
}
|
|
876
877
|
}
|
|
877
|
-
class
|
|
878
|
+
class Le {
|
|
878
879
|
constructor(e) {
|
|
879
880
|
r(this, "node");
|
|
880
881
|
r(this, "endNode");
|
|
@@ -915,7 +916,7 @@ class qe {
|
|
|
915
916
|
));
|
|
916
917
|
}
|
|
917
918
|
}
|
|
918
|
-
class
|
|
919
|
+
class Ie {
|
|
919
920
|
constructor(e) {
|
|
920
921
|
r(this, "config");
|
|
921
922
|
r(this, "element");
|
|
@@ -926,14 +927,14 @@ class Le {
|
|
|
926
927
|
}
|
|
927
928
|
mount(e, t) {
|
|
928
929
|
const { content: s, parent: i } = this.config;
|
|
929
|
-
|
|
930
|
+
he(s) ? this.element = s : N(s) ? this.element = E(C(this.config.elementContext, s)) : this.element = E(C(this.config.elementContext, V(s))), this.element.mount(i);
|
|
930
931
|
}
|
|
931
932
|
unmount() {
|
|
932
933
|
var e;
|
|
933
934
|
(e = this.element) != null && e.isMounted && this.element.unmount();
|
|
934
935
|
}
|
|
935
936
|
}
|
|
936
|
-
class
|
|
937
|
+
class Ge {
|
|
937
938
|
constructor(e) {
|
|
938
939
|
r(this, "__view");
|
|
939
940
|
this.__view = e;
|
|
@@ -1003,7 +1004,7 @@ class Ie {
|
|
|
1003
1004
|
}
|
|
1004
1005
|
class q {
|
|
1005
1006
|
constructor(e, t, s, i = []) {
|
|
1006
|
-
r(this, "uniqueId",
|
|
1007
|
+
r(this, "uniqueId", ae());
|
|
1007
1008
|
r(this, "_elementContext");
|
|
1008
1009
|
r(this, "_logger");
|
|
1009
1010
|
r(this, "_view");
|
|
@@ -1053,7 +1054,7 @@ class q {
|
|
|
1053
1054
|
|| Internal ||
|
|
1054
1055
|
\*===============================*/
|
|
1055
1056
|
initialize() {
|
|
1056
|
-
const e = new
|
|
1057
|
+
const e = new Ge(this);
|
|
1057
1058
|
let t;
|
|
1058
1059
|
try {
|
|
1059
1060
|
t = this._view(this._props, e);
|
|
@@ -1062,7 +1063,7 @@ class q {
|
|
|
1062
1063
|
}
|
|
1063
1064
|
if (t !== null) if (t instanceof Node)
|
|
1064
1065
|
this._element = E(C(this._elementContext, y("$node", { value: t })));
|
|
1065
|
-
else if (N(t) ||
|
|
1066
|
+
else if (N(t) || ie(N, t))
|
|
1066
1067
|
this._element = E(C(this._elementContext, t));
|
|
1067
1068
|
else if (p(t))
|
|
1068
1069
|
this._element = E(
|
|
@@ -1076,7 +1077,7 @@ class q {
|
|
|
1076
1077
|
}
|
|
1077
1078
|
}
|
|
1078
1079
|
}
|
|
1079
|
-
class
|
|
1080
|
+
class je {
|
|
1080
1081
|
constructor({ elementContext: e, $items: t, renderFn: s, keyFn: i }) {
|
|
1081
1082
|
r(this, "node");
|
|
1082
1083
|
r(this, "endNode");
|
|
@@ -1132,7 +1133,7 @@ class Ge {
|
|
|
1132
1133
|
setValue: d,
|
|
1133
1134
|
$index: f,
|
|
1134
1135
|
setIndex: m,
|
|
1135
|
-
element: new q(this.elementContext,
|
|
1136
|
+
element: new q(this.elementContext, Be, {
|
|
1136
1137
|
$value: h,
|
|
1137
1138
|
$index: f,
|
|
1138
1139
|
renderFn: this.renderFn
|
|
@@ -1151,10 +1152,10 @@ class Ge {
|
|
|
1151
1152
|
}
|
|
1152
1153
|
}
|
|
1153
1154
|
}
|
|
1154
|
-
function
|
|
1155
|
+
function Be({ $value: n, $index: e, renderFn: t }, s) {
|
|
1155
1156
|
return t(n, e, s);
|
|
1156
1157
|
}
|
|
1157
|
-
class
|
|
1158
|
+
class Re {
|
|
1158
1159
|
constructor({ value: e }) {
|
|
1159
1160
|
r(this, "node", document.createTextNode(""));
|
|
1160
1161
|
r(this, "value", "");
|
|
@@ -1177,20 +1178,20 @@ class Be {
|
|
|
1177
1178
|
}
|
|
1178
1179
|
}
|
|
1179
1180
|
function N(n) {
|
|
1180
|
-
return
|
|
1181
|
+
return W(n) && (typeof n.type == "string" || typeof n.type == "function") && Array.isArray(n.children);
|
|
1181
1182
|
}
|
|
1182
|
-
function
|
|
1183
|
-
return
|
|
1183
|
+
function he(n) {
|
|
1184
|
+
return W(n) && x(n.connect) && x(n.disconnect);
|
|
1184
1185
|
}
|
|
1185
1186
|
function V(n) {
|
|
1186
1187
|
return M(n) || (n = [n]), n.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => {
|
|
1187
1188
|
if (e instanceof Node)
|
|
1188
1189
|
return y("$node", { value: e });
|
|
1189
|
-
if (e instanceof
|
|
1190
|
+
if (e instanceof de)
|
|
1190
1191
|
return y("$node", { value: e.node });
|
|
1191
1192
|
if (N(e))
|
|
1192
1193
|
return e;
|
|
1193
|
-
if ($(e) ||
|
|
1194
|
+
if ($(e) || _e(e))
|
|
1194
1195
|
return y("$text", { value: e });
|
|
1195
1196
|
if (p(e))
|
|
1196
1197
|
return y("$observer", {
|
|
@@ -1201,14 +1202,14 @@ function V(n) {
|
|
|
1201
1202
|
});
|
|
1202
1203
|
}
|
|
1203
1204
|
function y(n, e, ...t) {
|
|
1204
|
-
return e != null &&
|
|
1205
|
+
return e != null && Ke(e), {
|
|
1205
1206
|
type: n,
|
|
1206
1207
|
props: e,
|
|
1207
1208
|
children: V(t)
|
|
1208
1209
|
};
|
|
1209
1210
|
}
|
|
1210
|
-
function
|
|
1211
|
-
if (n.ref && !
|
|
1211
|
+
function Ke(n) {
|
|
1212
|
+
if (n.ref && !ue(n.ref))
|
|
1212
1213
|
throw console.warn(n.ref), new TypeError(`Prop 'ref' must be a Ref object. Got: ${n.ref}`);
|
|
1213
1214
|
for (const e in n)
|
|
1214
1215
|
if (e.startsWith("$$") && n[e] !== void 0) {
|
|
@@ -1217,8 +1218,8 @@ function Re(n) {
|
|
|
1217
1218
|
} else if (e.startsWith("$") && n[e] !== void 0 && !p(n[e]))
|
|
1218
1219
|
throw new TypeError(`Prop '${e}' is named as a State but value is not. Got: ${n[e]}`);
|
|
1219
1220
|
}
|
|
1220
|
-
const
|
|
1221
|
-
function
|
|
1221
|
+
const nt = Ve.bind(y);
|
|
1222
|
+
function st(n, e, t) {
|
|
1222
1223
|
const s = F(n);
|
|
1223
1224
|
return y("$cond", {
|
|
1224
1225
|
$predicate: s,
|
|
@@ -1226,14 +1227,14 @@ function nt(n, e, t) {
|
|
|
1226
1227
|
elseContent: t
|
|
1227
1228
|
});
|
|
1228
1229
|
}
|
|
1229
|
-
function
|
|
1230
|
+
function it(n, e, t) {
|
|
1230
1231
|
const s = F(n);
|
|
1231
1232
|
return y("$repeat", { $items: s, keyFn: e, renderFn: t });
|
|
1232
1233
|
}
|
|
1233
|
-
function
|
|
1234
|
+
function ot(n, e) {
|
|
1234
1235
|
return y("$portal", { parent: n, content: e });
|
|
1235
1236
|
}
|
|
1236
|
-
class
|
|
1237
|
+
class de {
|
|
1237
1238
|
constructor(e) {
|
|
1238
1239
|
r(this, "node");
|
|
1239
1240
|
this.node = e;
|
|
@@ -1256,17 +1257,17 @@ function C(n, e) {
|
|
|
1256
1257
|
switch (s.type) {
|
|
1257
1258
|
case "$node": {
|
|
1258
1259
|
const i = s.props;
|
|
1259
|
-
return new
|
|
1260
|
+
return new de(i.value);
|
|
1260
1261
|
}
|
|
1261
1262
|
case "$text": {
|
|
1262
1263
|
const i = s.props;
|
|
1263
|
-
return new
|
|
1264
|
+
return new Re({
|
|
1264
1265
|
value: i.value
|
|
1265
1266
|
});
|
|
1266
1267
|
}
|
|
1267
1268
|
case "$cond": {
|
|
1268
1269
|
const i = s.props;
|
|
1269
|
-
return new
|
|
1270
|
+
return new Te({
|
|
1270
1271
|
$predicate: i.$predicate,
|
|
1271
1272
|
thenContent: i.thenContent,
|
|
1272
1273
|
elseContent: i.elseContent,
|
|
@@ -1275,7 +1276,7 @@ function C(n, e) {
|
|
|
1275
1276
|
}
|
|
1276
1277
|
case "$repeat": {
|
|
1277
1278
|
const i = s.props;
|
|
1278
|
-
return new
|
|
1279
|
+
return new je({
|
|
1279
1280
|
$items: i.$items,
|
|
1280
1281
|
keyFn: i.keyFn,
|
|
1281
1282
|
renderFn: i.renderFn,
|
|
@@ -1284,7 +1285,7 @@ function C(n, e) {
|
|
|
1284
1285
|
}
|
|
1285
1286
|
case "$observer": {
|
|
1286
1287
|
const i = s.props;
|
|
1287
|
-
return new
|
|
1288
|
+
return new qe({
|
|
1288
1289
|
states: i.states,
|
|
1289
1290
|
renderFn: i.renderFn,
|
|
1290
1291
|
elementContext: n
|
|
@@ -1292,14 +1293,14 @@ function C(n, e) {
|
|
|
1292
1293
|
}
|
|
1293
1294
|
case "$outlet": {
|
|
1294
1295
|
const i = s.props;
|
|
1295
|
-
return new
|
|
1296
|
+
return new Le({
|
|
1296
1297
|
$children: i.$children,
|
|
1297
1298
|
elementContext: n
|
|
1298
1299
|
});
|
|
1299
1300
|
}
|
|
1300
1301
|
case "$portal": {
|
|
1301
1302
|
const i = s.props;
|
|
1302
|
-
return new
|
|
1303
|
+
return new Ie({
|
|
1303
1304
|
content: i.content,
|
|
1304
1305
|
parent: i.parent,
|
|
1305
1306
|
elementContext: n
|
|
@@ -1308,7 +1309,7 @@ function C(n, e) {
|
|
|
1308
1309
|
default:
|
|
1309
1310
|
if (s.type.startsWith("$"))
|
|
1310
1311
|
throw new Error(`Unknown markup type: ${s.type}`);
|
|
1311
|
-
return new
|
|
1312
|
+
return new Ue({
|
|
1312
1313
|
tag: s.type,
|
|
1313
1314
|
props: s.props ?? {},
|
|
1314
1315
|
children: s.children,
|
|
@@ -1350,43 +1351,43 @@ function E(n) {
|
|
|
1350
1351
|
}
|
|
1351
1352
|
};
|
|
1352
1353
|
}
|
|
1353
|
-
function
|
|
1354
|
-
return n == null || n === !1 || typeof n == "string" || typeof n == "number" || N(n) || p(n) ||
|
|
1354
|
+
function fe(n) {
|
|
1355
|
+
return n == null || n === !1 || typeof n == "string" || typeof n == "number" || N(n) || p(n) || ie(fe, n);
|
|
1355
1356
|
}
|
|
1356
|
-
function
|
|
1357
|
+
function rt(n, e) {
|
|
1357
1358
|
return e.outlet();
|
|
1358
1359
|
}
|
|
1359
1360
|
export {
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1361
|
+
et as A,
|
|
1362
|
+
ot as B,
|
|
1363
|
+
it as C,
|
|
1364
|
+
rt as P,
|
|
1364
1365
|
q as V,
|
|
1365
1366
|
I as a,
|
|
1366
1367
|
x as b,
|
|
1367
|
-
|
|
1368
|
-
|
|
1368
|
+
st as c,
|
|
1369
|
+
Me as d,
|
|
1369
1370
|
$ as e,
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1371
|
+
ze as f,
|
|
1372
|
+
we as g,
|
|
1373
|
+
nt as h,
|
|
1374
|
+
W as i,
|
|
1375
|
+
He as j,
|
|
1375
1376
|
K as k,
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1377
|
+
Je as l,
|
|
1378
|
+
Qe as m,
|
|
1379
|
+
Xe as n,
|
|
1379
1380
|
F as o,
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1381
|
+
tt as p,
|
|
1382
|
+
ue as q,
|
|
1383
|
+
Ye as r,
|
|
1383
1384
|
y as s,
|
|
1384
1385
|
G as t,
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1386
|
+
Ze as u,
|
|
1387
|
+
Ee as v,
|
|
1388
|
+
ke as w,
|
|
1389
|
+
xe as x,
|
|
1389
1390
|
E as y,
|
|
1390
1391
|
C as z
|
|
1391
1392
|
};
|
|
1392
|
-
//# sourceMappingURL=passthrough-
|
|
1393
|
+
//# sourceMappingURL=passthrough-DcOD0Wf3.js.map
|