@manyducks.co/dolla 2.0.0-alpha.59 → 2.0.0-alpha.60
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/context.d.ts +2 -18
- package/dist/core/index.d.ts +3 -4
- package/dist/core/logger.d.ts +5 -2
- package/dist/core/markup.d.ts +47 -21
- package/dist/core/mount.d.ts +2 -2
- package/dist/core/nodes/dom.d.ts +4 -4
- package/dist/core/nodes/dynamic.d.ts +4 -4
- package/dist/core/nodes/html.d.ts +4 -5
- package/dist/core/nodes/portal.d.ts +3 -3
- package/dist/core/nodes/repeat.d.ts +3 -3
- package/dist/core/nodes/view.d.ts +8 -3
- package/dist/core/symbols.d.ts +2 -2
- package/dist/core/views/default-crash-view.d.ts +1 -12
- package/dist/http.js +1 -1
- package/dist/i18n.js +2 -2
- package/dist/index.js +38 -37
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/{logger-Ck_9LCem.js → logger-MPwl-Xqu.js} +70 -62
- package/dist/logger-MPwl-Xqu.js.map +1 -0
- package/dist/{markup-BBa4WBj1.js → markup-BGlfQYQk.js} +302 -325
- package/dist/markup-BGlfQYQk.js.map +1 -0
- package/dist/router/router.d.ts +12 -5
- package/dist/router-BpuJQ6OA.js +516 -0
- package/dist/router-BpuJQ6OA.js.map +1 -0
- package/dist/router.js +1 -1
- package/dist/{typeChecking-BJ-ymQ2F.js → typeChecking-CbltMOUt.js} +2 -1
- package/dist/{typeChecking-BJ-ymQ2F.js.map → typeChecking-CbltMOUt.js.map} +1 -1
- package/dist/types.d.ts +11 -2
- package/dist/utils.d.ts +2 -0
- package/package.json +1 -1
- package/dist/core/app.d.ts +0 -17
- package/dist/logger-Ck_9LCem.js.map +0 -1
- package/dist/markup-BBa4WBj1.js.map +0 -1
- package/dist/router-CaR7Xd4T.js +0 -490
- package/dist/router-CaR7Xd4T.js.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var ut = Object.defineProperty;
|
|
2
|
+
var j = (o) => {
|
|
3
3
|
throw TypeError(o);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var c = (o, t, e) =>
|
|
7
|
-
var L = (o, t, e) => (
|
|
8
|
-
import { c as f, t as
|
|
9
|
-
import { u as
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
var lt = (o, t, e) => t in o ? ut(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
|
|
6
|
+
var c = (o, t, e) => lt(o, typeof t != "symbol" ? t + "" : t, e), R = (o, t, e) => t.has(o) || j("Cannot " + e);
|
|
7
|
+
var L = (o, t, e) => (R(o, t, "read from private field"), e ? e.call(o) : t.get(o)), V = (o, t, e) => t.has(o) ? j("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(o) : t.set(o, e), O = (o, t, e, s) => (R(o, t, "write to private field"), s ? s.call(o, e) : t.set(o, e), e);
|
|
8
|
+
import { c as f, t as dt, i as D, b as C } from "./typeChecking-CbltMOUt.js";
|
|
9
|
+
import { u as E, h as ft, g as y, k as st, e as w, t as it, c as mt, l as pt, m as bt, b as gt, $ as _, d as wt } from "./logger-MPwl-Xqu.js";
|
|
10
|
+
var b = /* @__PURE__ */ ((o) => (o[o.WILL_MOUNT = 0] = "WILL_MOUNT", o[o.DID_MOUNT = 1] = "DID_MOUNT", o[o.WILL_UNMOUNT = 2] = "WILL_UNMOUNT", o[o.DID_UNMOUNT = 3] = "DID_UNMOUNT", o[o.DISPOSE = 4] = "DISPOSE", o))(b || {});
|
|
11
|
+
const T = Symbol("name"), l = Symbol("lifecycle"), p = Symbol("parent"), v = Symbol("stores"), g = Symbol("state");
|
|
12
|
+
class yt {
|
|
12
13
|
constructor(t) {
|
|
13
14
|
c(this, "context");
|
|
14
15
|
c(this, "state", 0);
|
|
@@ -52,7 +53,7 @@ class bt {
|
|
|
52
53
|
break;
|
|
53
54
|
}
|
|
54
55
|
case 4: {
|
|
55
|
-
this.state === 0 ? (this.notify(t), this.listeners.clear(), this.bound = void 0, this.state = 5) : this.context.crash(new Error(`Tried to DISPOSE context at state ${this.state}`));
|
|
56
|
+
this.state === 0 ? (this.notify(t), this.listeners.clear(), this.bound = void 0, this.context[g] = void 0, this.context[v] = void 0, this.state = 5) : this.context.crash(new Error(`Tried to DISPOSE context at state ${this.state}`));
|
|
56
57
|
break;
|
|
57
58
|
}
|
|
58
59
|
}
|
|
@@ -73,79 +74,40 @@ class bt {
|
|
|
73
74
|
s();
|
|
74
75
|
if (this.bound)
|
|
75
76
|
for (const s of this.bound)
|
|
76
|
-
s[
|
|
77
|
+
s[l].emit(t);
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
const
|
|
80
|
+
var H, z, F, Z, K, x;
|
|
81
|
+
K = T, Z = l, F = p, z = v, H = g;
|
|
82
|
+
const I = class I {
|
|
82
83
|
constructor(t, e) {
|
|
83
|
-
|
|
84
|
+
V(this, x);
|
|
85
|
+
c(this, K);
|
|
86
|
+
c(this, Z, new yt(this));
|
|
87
|
+
c(this, F);
|
|
84
88
|
c(this, z);
|
|
85
|
-
c(this, H
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
c(this, j);
|
|
89
|
-
$(this, v, t), this[A] = S(t);
|
|
90
|
-
const s = lt(() => w(L(this, v)), e == null ? void 0 : e.logger), i = Object.getOwnPropertyDescriptors(s);
|
|
89
|
+
c(this, H);
|
|
90
|
+
O(this, x, t), this[T] = E(t);
|
|
91
|
+
const s = ft(() => y(L(this, x)), e == null ? void 0 : e.logger), i = Object.getOwnPropertyDescriptors(s);
|
|
91
92
|
for (const n in i)
|
|
92
93
|
Object.defineProperty(this, n, i[n]);
|
|
93
94
|
}
|
|
94
95
|
get isMounted() {
|
|
95
|
-
const { state: t } = this[
|
|
96
|
+
const { state: t } = this[l];
|
|
96
97
|
return t >= 2 && t < 4;
|
|
97
98
|
}
|
|
98
99
|
/**
|
|
99
100
|
* Returns a new Context with this one as its parent.
|
|
100
101
|
*/
|
|
101
102
|
static linked(t, e, s) {
|
|
102
|
-
const i = new
|
|
103
|
-
return i[p] = t, s != null && s.bindLifecycleToParent && t[
|
|
103
|
+
const i = new I(e, s);
|
|
104
|
+
return i[p] = t, s != null && s.bindLifecycleToParent && t[l].bind(i), i;
|
|
104
105
|
}
|
|
105
106
|
/**
|
|
106
|
-
* Emit
|
|
107
|
+
* Emit a lifecycle event to `context`.
|
|
107
108
|
*/
|
|
108
|
-
static
|
|
109
|
-
t[
|
|
110
|
-
0
|
|
111
|
-
/* WILL_MOUNT */
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Emit "did mount" lifecycle event to `context`.
|
|
116
|
-
*/
|
|
117
|
-
static didMount(t) {
|
|
118
|
-
t[u].emit(
|
|
119
|
-
1
|
|
120
|
-
/* DID_MOUNT */
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Emit "will unmount" lifecycle event to `context`.
|
|
125
|
-
*/
|
|
126
|
-
static willUnmount(t) {
|
|
127
|
-
t[u].emit(
|
|
128
|
-
2
|
|
129
|
-
/* WILL_UNMOUNT */
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Emit "did unmount" lifecycle event to `context`.
|
|
134
|
-
*/
|
|
135
|
-
static didUnmount(t) {
|
|
136
|
-
t[u].emit(
|
|
137
|
-
3
|
|
138
|
-
/* DID_UNMOUNT */
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Emit "dispose" lifecycle event to `context`.
|
|
143
|
-
*/
|
|
144
|
-
static dispose(t) {
|
|
145
|
-
t[u].emit(
|
|
146
|
-
4
|
|
147
|
-
/* DISPOSE */
|
|
148
|
-
), t[b] = void 0, t[y] = void 0;
|
|
109
|
+
static emit(t, e) {
|
|
110
|
+
t[l].emit(e);
|
|
149
111
|
}
|
|
150
112
|
/**
|
|
151
113
|
* Traverses _parent contexts until arriving at one that doesn't have a parent itself.
|
|
@@ -161,31 +123,31 @@ const N = class N {
|
|
|
161
123
|
* Returns the current name of this context.
|
|
162
124
|
*/
|
|
163
125
|
getName() {
|
|
164
|
-
return
|
|
126
|
+
return E(L(this, x));
|
|
165
127
|
}
|
|
166
128
|
/**
|
|
167
129
|
* Sets a new name for this context.
|
|
168
130
|
*/
|
|
169
131
|
setName(t) {
|
|
170
|
-
|
|
132
|
+
O(this, x, t), this[T] = E(t);
|
|
171
133
|
}
|
|
172
134
|
/**
|
|
173
135
|
* Creates an instance of a store and attaches it to this context.
|
|
174
136
|
*/
|
|
175
137
|
addStore(t, e) {
|
|
176
138
|
var i;
|
|
177
|
-
if ((i = this[
|
|
139
|
+
if ((i = this[v]) != null && i.get(t)) {
|
|
178
140
|
let n = t.name ? `'${t.name}'` : "this store";
|
|
179
|
-
throw this.crash(new
|
|
141
|
+
throw this.crash(new U(`An instance of ${n} was already added on this context.`));
|
|
180
142
|
}
|
|
181
|
-
const s =
|
|
143
|
+
const s = I.linked(this, t.name, {
|
|
182
144
|
bindLifecycleToParent: !0,
|
|
183
|
-
logger: { tag:
|
|
145
|
+
logger: { tag: st(), tagName: "uid" }
|
|
184
146
|
});
|
|
185
147
|
try {
|
|
186
|
-
this[
|
|
148
|
+
this[v] || (this[v] = /* @__PURE__ */ new Map());
|
|
187
149
|
const n = t.call(s, e, s);
|
|
188
|
-
this[
|
|
150
|
+
this[v].set(t, n);
|
|
189
151
|
} catch (n) {
|
|
190
152
|
throw this.crash(n);
|
|
191
153
|
}
|
|
@@ -199,37 +161,37 @@ const N = class N {
|
|
|
199
161
|
getStore(t) {
|
|
200
162
|
var i;
|
|
201
163
|
if (!f(t))
|
|
202
|
-
throw new
|
|
164
|
+
throw new U("Invalid store.");
|
|
203
165
|
let e = this, s;
|
|
204
|
-
for (; s = (i = e[
|
|
166
|
+
for (; s = (i = e[v]) == null ? void 0 : i.get(t), s == null && e[p] != null; )
|
|
205
167
|
e = e[p];
|
|
206
168
|
if (s == null)
|
|
207
|
-
throw this.crash(new
|
|
169
|
+
throw this.crash(new U(`Store '${t.name}' is not provided by this context.`));
|
|
208
170
|
return s;
|
|
209
171
|
}
|
|
210
172
|
/**
|
|
211
173
|
* Schedule a callback function to run just before this context is mounted.
|
|
212
174
|
*/
|
|
213
175
|
beforeMount(t) {
|
|
214
|
-
return this[
|
|
176
|
+
return this[l].on(0, t), () => this[l].off(0, t);
|
|
215
177
|
}
|
|
216
178
|
/**
|
|
217
179
|
* Schedule a callback function to run after this context is mounted.
|
|
218
180
|
*/
|
|
219
181
|
onMount(t) {
|
|
220
|
-
return this[
|
|
182
|
+
return this[l].on(1, t), () => this[l].off(1, t);
|
|
221
183
|
}
|
|
222
184
|
/**
|
|
223
185
|
* Schedule a callback function to run just before this context is unmounted.
|
|
224
186
|
*/
|
|
225
187
|
beforeUnmount(t) {
|
|
226
|
-
return this[
|
|
188
|
+
return this[l].on(2, t), () => this[l].off(2, t);
|
|
227
189
|
}
|
|
228
190
|
/**
|
|
229
191
|
* Schedule a callback function to run after this context is unmounted.
|
|
230
192
|
*/
|
|
231
193
|
onUnmount(t) {
|
|
232
|
-
return this[
|
|
194
|
+
return this[l].on(3, t), () => this[l].off(3, t);
|
|
233
195
|
}
|
|
234
196
|
effect(t) {
|
|
235
197
|
const e = () => {
|
|
@@ -239,13 +201,13 @@ const N = class N {
|
|
|
239
201
|
this.error(s), s instanceof Error ? this.crash(s) : typeof s == "string" ? this.crash(new Error(s)) : this.crash(new Error("Unknown error thrown in effect callback"));
|
|
240
202
|
}
|
|
241
203
|
};
|
|
242
|
-
if (this[
|
|
243
|
-
const s =
|
|
244
|
-
return this[
|
|
204
|
+
if (this[l].state >= 1) {
|
|
205
|
+
const s = w(e);
|
|
206
|
+
return this[l].on(3, s), s;
|
|
245
207
|
} else {
|
|
246
208
|
let s, i = !1;
|
|
247
|
-
return this[
|
|
248
|
-
i || (s =
|
|
209
|
+
return this[l].on(0, () => {
|
|
210
|
+
i || (s = w(e), this[l].on(3, s));
|
|
249
211
|
}), () => {
|
|
250
212
|
s != null && (i = !0, s());
|
|
251
213
|
};
|
|
@@ -255,7 +217,7 @@ const N = class N {
|
|
|
255
217
|
var s;
|
|
256
218
|
if (arguments.length > 0) {
|
|
257
219
|
let i = this, n;
|
|
258
|
-
for (; n = (s = i[
|
|
220
|
+
for (; n = (s = i[g]) == null ? void 0 : s.get(t), n === void 0 && i[p] != null; )
|
|
259
221
|
i = i[p];
|
|
260
222
|
if (n === void 0) {
|
|
261
223
|
if (arguments.length > 1)
|
|
@@ -266,35 +228,35 @@ const N = class N {
|
|
|
266
228
|
} else {
|
|
267
229
|
let i = this;
|
|
268
230
|
const n = [];
|
|
269
|
-
for (; i[
|
|
231
|
+
for (; i[g] && n.push(...i[g].entries()), i[p] != null; )
|
|
270
232
|
i = i[p];
|
|
271
233
|
return new Map(n.reverse());
|
|
272
234
|
}
|
|
273
235
|
}
|
|
274
236
|
setState() {
|
|
275
|
-
if (this[
|
|
276
|
-
this[
|
|
277
|
-
else if (
|
|
237
|
+
if (this[g] || (this[g] = /* @__PURE__ */ new Map()), arguments.length === 2)
|
|
238
|
+
this[g].set(arguments[0], arguments[1]);
|
|
239
|
+
else if (dt(arguments[0]) === "array")
|
|
278
240
|
for (const [t, e] of arguments[0])
|
|
279
|
-
e === void 0 ? this[
|
|
241
|
+
e === void 0 ? this[g].delete(t) : this[g].set(t, e);
|
|
280
242
|
else
|
|
281
243
|
throw new Error("Invalid arguments.");
|
|
282
244
|
return this;
|
|
283
245
|
}
|
|
284
246
|
};
|
|
285
|
-
|
|
286
|
-
let
|
|
287
|
-
function
|
|
288
|
-
return new
|
|
247
|
+
x = new WeakMap();
|
|
248
|
+
let d = I;
|
|
249
|
+
function _t(o, t) {
|
|
250
|
+
return new d(o, t);
|
|
289
251
|
}
|
|
290
|
-
class
|
|
252
|
+
class U extends Error {
|
|
291
253
|
}
|
|
292
|
-
const
|
|
293
|
-
var
|
|
294
|
-
|
|
295
|
-
class
|
|
254
|
+
const N = Symbol("type"), k = Symbol("MarkupNode");
|
|
255
|
+
var Y;
|
|
256
|
+
Y = N;
|
|
257
|
+
class $ {
|
|
296
258
|
constructor(t) {
|
|
297
|
-
c(this,
|
|
259
|
+
c(this, Y, k);
|
|
298
260
|
c(this, "root");
|
|
299
261
|
this.root = t;
|
|
300
262
|
}
|
|
@@ -305,7 +267,7 @@ class E {
|
|
|
305
267
|
t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null);
|
|
306
268
|
}
|
|
307
269
|
unmount(t = !1) {
|
|
308
|
-
this.root.parentNode &&
|
|
270
|
+
!t && this.root.parentNode && this.root.parentNode.removeChild(this.root);
|
|
309
271
|
}
|
|
310
272
|
move(t, e) {
|
|
311
273
|
if ("moveBefore" in t && this.root instanceof Element)
|
|
@@ -318,11 +280,11 @@ class E {
|
|
|
318
280
|
this.mount(t, e);
|
|
319
281
|
}
|
|
320
282
|
}
|
|
321
|
-
var
|
|
322
|
-
|
|
323
|
-
class
|
|
283
|
+
var J;
|
|
284
|
+
J = N;
|
|
285
|
+
class A {
|
|
324
286
|
constructor(t, e) {
|
|
325
|
-
c(this,
|
|
287
|
+
c(this, J, k);
|
|
326
288
|
c(this, "root", document.createTextNode(""));
|
|
327
289
|
c(this, "children", []);
|
|
328
290
|
c(this, "context");
|
|
@@ -334,11 +296,11 @@ class C {
|
|
|
334
296
|
return this.root.parentElement != null;
|
|
335
297
|
}
|
|
336
298
|
mount(t, e) {
|
|
337
|
-
this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe =
|
|
299
|
+
this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe = w(() => {
|
|
338
300
|
try {
|
|
339
301
|
const s = this.$slot();
|
|
340
|
-
|
|
341
|
-
this.update(
|
|
302
|
+
E(() => {
|
|
303
|
+
this.update(it(s));
|
|
342
304
|
});
|
|
343
305
|
} catch (s) {
|
|
344
306
|
this.context.crash(s);
|
|
@@ -371,7 +333,7 @@ class C {
|
|
|
371
333
|
update(t) {
|
|
372
334
|
var s;
|
|
373
335
|
if (this.cleanup(!1), t.length === 0 || !this.isMounted()) return;
|
|
374
|
-
const e =
|
|
336
|
+
const e = B(this.context, t);
|
|
375
337
|
for (const i of e) {
|
|
376
338
|
const n = ((s = this.children.at(-1)) == null ? void 0 : s.root) || this.root;
|
|
377
339
|
i.mount(this.root.parentElement, n), this.children.push(i);
|
|
@@ -387,23 +349,28 @@ class C {
|
|
|
387
349
|
"moveBefore" in t ? t.moveBefore(this.root, e) : t.insertBefore(this.root, e);
|
|
388
350
|
}
|
|
389
351
|
}
|
|
390
|
-
const
|
|
391
|
-
var
|
|
392
|
-
|
|
393
|
-
class
|
|
352
|
+
const ot = Symbol("View");
|
|
353
|
+
var Q;
|
|
354
|
+
Q = N;
|
|
355
|
+
class nt {
|
|
356
|
+
/**
|
|
357
|
+
* @param context - Parent contenxt to link to.
|
|
358
|
+
* @param view - View function to mount.
|
|
359
|
+
* @param props - Props to pass to view function.
|
|
360
|
+
*/
|
|
394
361
|
constructor(t, e, s) {
|
|
395
|
-
c(this,
|
|
396
|
-
c(this, "uniqueId",
|
|
362
|
+
c(this, Q, k);
|
|
363
|
+
c(this, "uniqueId", st());
|
|
397
364
|
c(this, "context");
|
|
398
365
|
c(this, "props");
|
|
399
366
|
c(this, "view");
|
|
400
367
|
c(this, "node");
|
|
401
|
-
this.context =
|
|
368
|
+
this.context = d.linked(t, e.name ?? "anonymous view", {
|
|
402
369
|
logger: {
|
|
403
370
|
tag: this.uniqueId,
|
|
404
371
|
tagName: "uid"
|
|
405
372
|
}
|
|
406
|
-
}), this.context.setState(
|
|
373
|
+
}), this.context.setState(ot, this), this.props = s, this.view = e;
|
|
407
374
|
}
|
|
408
375
|
get root() {
|
|
409
376
|
var t;
|
|
@@ -419,28 +386,28 @@ class it {
|
|
|
419
386
|
const { context: i, props: n, view: r } = this;
|
|
420
387
|
try {
|
|
421
388
|
const a = r.call(i, n, i);
|
|
422
|
-
a != null && a !== !1 && (this.node =
|
|
389
|
+
a != null && a !== !1 && (this.node = ht(a, i));
|
|
423
390
|
} catch (a) {
|
|
424
391
|
throw a instanceof Error && i.crash(a), a;
|
|
425
392
|
}
|
|
426
|
-
|
|
393
|
+
d.emit(this.context, b.WILL_MOUNT);
|
|
427
394
|
}
|
|
428
|
-
this.node && this.node.mount(t, e), s ||
|
|
395
|
+
this.node && this.node.mount(t, e), s || d.emit(this.context, b.DID_MOUNT);
|
|
429
396
|
}
|
|
430
397
|
unmount(t = !1) {
|
|
431
|
-
|
|
398
|
+
d.emit(this.context, b.WILL_UNMOUNT), this.node && this.node.unmount(t), d.emit(this.context, b.DID_UNMOUNT), d.emit(this.context, b.DISPOSE);
|
|
432
399
|
}
|
|
433
400
|
move(t, e) {
|
|
434
401
|
var s;
|
|
435
402
|
(s = this.node) == null || s.move(t, e);
|
|
436
403
|
}
|
|
437
404
|
}
|
|
438
|
-
const
|
|
439
|
-
var
|
|
440
|
-
|
|
441
|
-
class
|
|
405
|
+
const vt = (o) => /^on[A-Z]/.test(o), P = Symbol("HTML.isSVG"), xt = ["class", "className", "ref", "mixin", "children"];
|
|
406
|
+
var X;
|
|
407
|
+
X = N;
|
|
408
|
+
class Nt {
|
|
442
409
|
constructor(t, e, s) {
|
|
443
|
-
c(this,
|
|
410
|
+
c(this, X, k);
|
|
444
411
|
c(this, "root");
|
|
445
412
|
c(this, "parentContext");
|
|
446
413
|
c(this, "context");
|
|
@@ -452,28 +419,26 @@ class wt {
|
|
|
452
419
|
c(this, "ref");
|
|
453
420
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
454
421
|
c(this, "canClickAway", !1);
|
|
455
|
-
if (this.parentContext = t, this.tag = e, this.props = s, this.context =
|
|
456
|
-
const n = this.context.getState(
|
|
422
|
+
if (this.parentContext = t, this.tag = e, this.props = s, this.context = d.linked(this.parentContext, q.bind(this)), e.toLowerCase() === "svg" && this.context.setState(P, !0), this.context.getState(P, !1) ? this.root = document.createElementNS("http://www.w3.org/2000/svg", e) : this.root = document.createElement(e), mt() === "development") {
|
|
423
|
+
const n = this.context.getState(ot, null);
|
|
457
424
|
n && (this.root.dataset.view = n.context.getName());
|
|
458
425
|
}
|
|
459
|
-
if (s.mixin)
|
|
460
|
-
const n
|
|
461
|
-
|
|
462
|
-
r(
|
|
426
|
+
if (s.mixin)
|
|
427
|
+
for (const n of it(s.mixin))
|
|
428
|
+
n(
|
|
463
429
|
this.root,
|
|
464
|
-
|
|
430
|
+
d.linked(this.context, q.bind(this), {
|
|
465
431
|
bindLifecycleToParent: !0,
|
|
466
|
-
logger: { tagName:
|
|
432
|
+
logger: { tagName: n.name === "mixin" ? void 0 : "mixin", tag: n.name }
|
|
467
433
|
})
|
|
468
434
|
);
|
|
469
|
-
}
|
|
470
435
|
const i = s.className ?? s.class;
|
|
471
|
-
if (this.applyProps(this.root,
|
|
436
|
+
if (this.applyProps(this.root, pt(xt, s)), s.style && this.applyStyles(this.root, s.style, this.unsubscribers), i && this.applyClasses(this.root, i, this.unsubscribers), s.ref)
|
|
472
437
|
if (f(s.ref))
|
|
473
438
|
this.ref = s.ref, this.ref(this.root);
|
|
474
439
|
else
|
|
475
440
|
throw new Error("Expected ref to be a function. Got: " + s.ref);
|
|
476
|
-
s.children && (this.childNodes =
|
|
441
|
+
s.children && (this.childNodes = B(this.context, s.children));
|
|
477
442
|
}
|
|
478
443
|
isMounted() {
|
|
479
444
|
return this.context.isMounted;
|
|
@@ -481,23 +446,23 @@ class wt {
|
|
|
481
446
|
mount(t, e) {
|
|
482
447
|
const s = this.isMounted();
|
|
483
448
|
if (!s) {
|
|
484
|
-
|
|
449
|
+
d.emit(this.context, b.WILL_MOUNT);
|
|
485
450
|
for (let i = 0; i < this.childNodes.length; i++) {
|
|
486
451
|
const n = this.childNodes[i], r = i > 0 ? this.childNodes[i - 1].root : void 0;
|
|
487
452
|
n.mount(this.root, r);
|
|
488
453
|
}
|
|
489
454
|
}
|
|
490
|
-
t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.canClickAway = !0, s ||
|
|
455
|
+
t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.canClickAway = !0, s || d.emit(this.context, b.DID_MOUNT);
|
|
491
456
|
}
|
|
492
457
|
unmount(t = !1) {
|
|
493
458
|
var e;
|
|
494
|
-
|
|
459
|
+
d.emit(this.context, b.WILL_UNMOUNT), t || (e = this.root.parentNode) == null || e.removeChild(this.root);
|
|
495
460
|
for (const s of this.childNodes)
|
|
496
461
|
s.unmount(!0);
|
|
497
462
|
this.canClickAway = !1;
|
|
498
463
|
for (const s of this.unsubscribers)
|
|
499
464
|
s();
|
|
500
|
-
this.unsubscribers.length = 0, this.ref && this.ref(void 0),
|
|
465
|
+
this.unsubscribers.length = 0, this.ref && this.ref(void 0), d.emit(this.context, b.DID_UNMOUNT), d.emit(this.context, b.DISPOSE);
|
|
501
466
|
}
|
|
502
467
|
move(t, e) {
|
|
503
468
|
if ("moveBefore" in t)
|
|
@@ -511,7 +476,7 @@ class wt {
|
|
|
511
476
|
}
|
|
512
477
|
attachProp(t, e) {
|
|
513
478
|
f(t) ? this.unsubscribers.push(
|
|
514
|
-
|
|
479
|
+
w(() => {
|
|
515
480
|
try {
|
|
516
481
|
e(t());
|
|
517
482
|
} catch (s) {
|
|
@@ -521,110 +486,123 @@ class wt {
|
|
|
521
486
|
) : e(t);
|
|
522
487
|
}
|
|
523
488
|
applyProps(t, e) {
|
|
524
|
-
const s
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
window.removeEventListener("click", r, a);
|
|
489
|
+
for (const s in e) {
|
|
490
|
+
const i = e[s];
|
|
491
|
+
if (s === "on:clickoutside" || s === "onClickOutside" || s === "onclickoutside") {
|
|
492
|
+
const n = (a) => {
|
|
493
|
+
this.canClickAway && !t.contains(a.target) && i(a);
|
|
494
|
+
}, r = { capture: !0 };
|
|
495
|
+
window.addEventListener("click", n, r), this.unsubscribers.push(() => {
|
|
496
|
+
window.removeEventListener("click", n, r);
|
|
533
497
|
});
|
|
534
|
-
} else if (
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
t
|
|
498
|
+
} else if (s.startsWith("prop:")) {
|
|
499
|
+
const n = s.substring(5);
|
|
500
|
+
this.attachProp(i, (r) => {
|
|
501
|
+
t[n] = r;
|
|
538
502
|
});
|
|
539
|
-
} else if (
|
|
540
|
-
|
|
541
|
-
|
|
503
|
+
} else if (s.startsWith("on:")) {
|
|
504
|
+
const n = s.substring(3);
|
|
505
|
+
let r;
|
|
506
|
+
f(i) ? (t.addEventListener(n, i), this.unsubscribers.push(() => {
|
|
507
|
+
t.removeEventListener(n, i);
|
|
508
|
+
})) : this.attachProp(i, (a) => {
|
|
509
|
+
!a && r ? t.removeEventListener(n, r) : a != null && (r && r !== a && t.removeEventListener(n, r), t.addEventListener(n, a)), r = a;
|
|
542
510
|
});
|
|
543
|
-
else if (
|
|
544
|
-
|
|
545
|
-
|
|
511
|
+
} else if (s.startsWith("attr:")) {
|
|
512
|
+
const n = s.substring(5).toLowerCase();
|
|
513
|
+
this.attachProp(i, (r) => {
|
|
514
|
+
r != null ? t.setAttribute(n, String(r)) : t.removeAttribute(n);
|
|
546
515
|
});
|
|
547
|
-
else if (
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
a != null ? t.setAttribute(r, String(a)) : t.removeAttribute(r);
|
|
603
|
-
});
|
|
516
|
+
} else if (f(i) && vt(s)) {
|
|
517
|
+
const n = s.slice(2).toLowerCase(), r = i;
|
|
518
|
+
t.addEventListener(n, r), this.unsubscribers.push(() => {
|
|
519
|
+
t.removeEventListener(n, r);
|
|
520
|
+
});
|
|
521
|
+
} else if (s.startsWith("on") && f(i) && kt.includes(s.substring(2)))
|
|
522
|
+
t[s] = i, this.unsubscribers.push(() => {
|
|
523
|
+
t[s] = void 0;
|
|
524
|
+
});
|
|
525
|
+
else if (s.includes("-"))
|
|
526
|
+
this.attachProp(i, (n) => {
|
|
527
|
+
n == null ? t.removeAttribute(s) : t.setAttribute(s, String(n));
|
|
528
|
+
});
|
|
529
|
+
else if (this.context.getState(P, !1))
|
|
530
|
+
this.attachProp(i, (n) => {
|
|
531
|
+
n != null ? t.setAttribute(s, String(e[s])) : t.removeAttribute(s);
|
|
532
|
+
});
|
|
533
|
+
else
|
|
534
|
+
switch (s) {
|
|
535
|
+
case "contentEditable":
|
|
536
|
+
case "value":
|
|
537
|
+
this.attachProp(i, (r) => {
|
|
538
|
+
t[s] = String(r);
|
|
539
|
+
});
|
|
540
|
+
break;
|
|
541
|
+
case "for":
|
|
542
|
+
this.attachProp(i, (r) => {
|
|
543
|
+
t.htmlFor = r;
|
|
544
|
+
});
|
|
545
|
+
break;
|
|
546
|
+
case "innerHTML":
|
|
547
|
+
this.attachProp(i, (r) => {
|
|
548
|
+
t.innerHTML = r;
|
|
549
|
+
});
|
|
550
|
+
break;
|
|
551
|
+
case "title":
|
|
552
|
+
this.attachProp(i, (r) => {
|
|
553
|
+
r == null ? t.removeAttribute(s) : t.setAttribute(s, String(r));
|
|
554
|
+
});
|
|
555
|
+
case "checked":
|
|
556
|
+
this.attachProp(i, (r) => {
|
|
557
|
+
t.checked = r, r ? t.setAttribute("checked", "") : t.removeAttribute("checked");
|
|
558
|
+
});
|
|
559
|
+
break;
|
|
560
|
+
case "dataset":
|
|
561
|
+
let n = {};
|
|
562
|
+
this.attachProp(i, (r) => {
|
|
563
|
+
if (D(r)) {
|
|
564
|
+
const a = {};
|
|
565
|
+
for (const u in r)
|
|
566
|
+
a[bt(u)] = String(r[u]);
|
|
567
|
+
for (const u in n)
|
|
568
|
+
Object.hasOwn(n, u) && !Object.hasOwn(a, u) && (delete t.dataset[u], delete n[u]);
|
|
569
|
+
for (const u in a)
|
|
570
|
+
n[u] !== a[u] && (t.dataset[u] = a[u], n[u] = a[u]);
|
|
604
571
|
} else
|
|
605
|
-
|
|
606
|
-
t[
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
572
|
+
for (const a in n)
|
|
573
|
+
delete t.dataset[a];
|
|
574
|
+
});
|
|
575
|
+
break;
|
|
576
|
+
case "autocomplete":
|
|
577
|
+
case "autocapitalize":
|
|
578
|
+
this.attachProp(i, (r) => {
|
|
579
|
+
typeof r == "string" ? t[s] = r : r ? t[s] = "on" : t[s] = "off";
|
|
580
|
+
});
|
|
581
|
+
break;
|
|
582
|
+
default: {
|
|
583
|
+
this.attachProp(i, (r) => {
|
|
584
|
+
t[s] = r;
|
|
585
|
+
});
|
|
586
|
+
break;
|
|
610
587
|
}
|
|
588
|
+
}
|
|
611
589
|
}
|
|
612
590
|
}
|
|
613
591
|
applyStyles(t, e, s) {
|
|
614
592
|
const i = [];
|
|
615
593
|
if (f(e)) {
|
|
616
594
|
let n;
|
|
617
|
-
const r =
|
|
618
|
-
f(n) && n(), t.style.cssText = "", n = this.applyStyles(t,
|
|
595
|
+
const r = w(() => {
|
|
596
|
+
f(n) && n(), t.style.cssText = "", n = this.applyStyles(t, y(e), s);
|
|
619
597
|
});
|
|
620
598
|
s.push(r), i.push(r);
|
|
621
599
|
} else {
|
|
622
|
-
const n =
|
|
600
|
+
const n = ct(e);
|
|
623
601
|
for (const r in n) {
|
|
624
|
-
const { value: a, priority:
|
|
602
|
+
const { value: a, priority: u } = n[r];
|
|
625
603
|
if (f(a)) {
|
|
626
|
-
const h =
|
|
627
|
-
|
|
604
|
+
const h = w(() => {
|
|
605
|
+
y(a) ? t.style.setProperty(r, String(y(a)), u) : t.style.removeProperty(r);
|
|
628
606
|
});
|
|
629
607
|
s.push(h), i.push(h);
|
|
630
608
|
} else a != null && t.style.setProperty(r, String(a));
|
|
@@ -639,19 +617,19 @@ class wt {
|
|
|
639
617
|
const i = [];
|
|
640
618
|
if (f(e)) {
|
|
641
619
|
let n;
|
|
642
|
-
const r =
|
|
643
|
-
f(n) && n(), t.removeAttribute("class"), n = this.applyClasses(t,
|
|
620
|
+
const r = w(() => {
|
|
621
|
+
f(n) && n(), t.removeAttribute("class"), n = this.applyClasses(t, y(e), s);
|
|
644
622
|
});
|
|
645
623
|
s.push(r), i.push(r);
|
|
646
624
|
} else {
|
|
647
|
-
const n =
|
|
625
|
+
const n = rt(e);
|
|
648
626
|
for (const r in n) {
|
|
649
627
|
const a = n[r];
|
|
650
628
|
if (f(a)) {
|
|
651
|
-
const
|
|
652
|
-
|
|
629
|
+
const u = w(() => {
|
|
630
|
+
y(a) ? t.classList.add(r) : t.classList.remove(r);
|
|
653
631
|
});
|
|
654
|
-
s.push(
|
|
632
|
+
s.push(u), i.push(u);
|
|
655
633
|
} else a && t.classList.add(r);
|
|
656
634
|
}
|
|
657
635
|
}
|
|
@@ -661,37 +639,37 @@ class wt {
|
|
|
661
639
|
};
|
|
662
640
|
}
|
|
663
641
|
}
|
|
664
|
-
function
|
|
642
|
+
function rt(o) {
|
|
665
643
|
let t = {};
|
|
666
|
-
if (
|
|
644
|
+
if (C(o)) {
|
|
667
645
|
const e = o.split(" ");
|
|
668
646
|
for (const s of e)
|
|
669
647
|
t[s] = !0;
|
|
670
|
-
} else
|
|
671
|
-
Object.assign(t,
|
|
648
|
+
} else D(o) ? Object.assign(t, o) : Array.isArray(o) && Array.from(o).filter(Boolean).forEach((e) => {
|
|
649
|
+
Object.assign(t, rt(e));
|
|
672
650
|
});
|
|
673
651
|
return delete t.undefined, t;
|
|
674
652
|
}
|
|
675
|
-
function
|
|
653
|
+
function ct(o) {
|
|
676
654
|
let t = {};
|
|
677
|
-
if (
|
|
655
|
+
if (C(o)) {
|
|
678
656
|
const e = o.split(";").filter((s) => s.trim() !== "");
|
|
679
657
|
for (const s of e) {
|
|
680
658
|
const [i, n] = s.split(":"), r = {
|
|
681
659
|
value: n
|
|
682
660
|
};
|
|
683
|
-
n.includes("!important") ? (r.priority = "important", r.value = n.replace("!important", "").trim()) : r.value = n.trim(), t[
|
|
661
|
+
n.includes("!important") ? (r.priority = "important", r.value = n.replace("!important", "").trim()) : r.value = n.trim(), t[G(i.trim())] = r;
|
|
684
662
|
}
|
|
685
663
|
}
|
|
686
|
-
if (
|
|
664
|
+
if (D(o))
|
|
687
665
|
for (const e in o)
|
|
688
|
-
e.startsWith("--") ? t[e] = { value: o[e] } : t[
|
|
666
|
+
e.startsWith("--") ? t[e] = { value: o[e] } : t[G(e)] = { value: o[e] };
|
|
689
667
|
else Array.isArray(o) && Array.from(o).filter((e) => e != null).forEach((e) => {
|
|
690
|
-
Object.assign(t,
|
|
668
|
+
Object.assign(t, ct(e));
|
|
691
669
|
});
|
|
692
670
|
return t;
|
|
693
671
|
}
|
|
694
|
-
function
|
|
672
|
+
function q() {
|
|
695
673
|
if (this.root == null) return this.tag;
|
|
696
674
|
let o = this.root.tagName.toLowerCase();
|
|
697
675
|
if (this.root.id && (o += `#${this.root.id}`), this.root.classList.length > 0)
|
|
@@ -699,10 +677,10 @@ function V() {
|
|
|
699
677
|
o += `.${t}`;
|
|
700
678
|
return o;
|
|
701
679
|
}
|
|
702
|
-
function
|
|
680
|
+
function G(o) {
|
|
703
681
|
return o.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (t, e) => (e ? "-" : "") + t.toLowerCase());
|
|
704
682
|
}
|
|
705
|
-
const
|
|
683
|
+
const kt = [
|
|
706
684
|
// Element
|
|
707
685
|
"animationcancel",
|
|
708
686
|
"animationend",
|
|
@@ -792,11 +770,11 @@ const yt = ["ref", "children", "class", "style", "data", "mixin"], vt = [
|
|
|
792
770
|
"reset",
|
|
793
771
|
"submit"
|
|
794
772
|
];
|
|
795
|
-
var
|
|
796
|
-
|
|
797
|
-
class
|
|
773
|
+
var tt;
|
|
774
|
+
tt = N;
|
|
775
|
+
class Mt {
|
|
798
776
|
constructor(t, e, s) {
|
|
799
|
-
c(this,
|
|
777
|
+
c(this, tt, k);
|
|
800
778
|
c(this, "context");
|
|
801
779
|
c(this, "content");
|
|
802
780
|
c(this, "parent");
|
|
@@ -807,7 +785,7 @@ class xt {
|
|
|
807
785
|
return this.element ? this.element.isMounted() : !1;
|
|
808
786
|
}
|
|
809
787
|
mount(t, e) {
|
|
810
|
-
this.element =
|
|
788
|
+
this.element = ht(this.content, this.context), this.element.mount(this.parent);
|
|
811
789
|
}
|
|
812
790
|
unmount(t = !1) {
|
|
813
791
|
var e;
|
|
@@ -816,11 +794,11 @@ class xt {
|
|
|
816
794
|
move(t, e) {
|
|
817
795
|
}
|
|
818
796
|
}
|
|
819
|
-
var
|
|
820
|
-
|
|
821
|
-
class
|
|
797
|
+
var et;
|
|
798
|
+
et = N;
|
|
799
|
+
class St {
|
|
822
800
|
constructor(t, e, s, i) {
|
|
823
|
-
c(this,
|
|
801
|
+
c(this, et, k);
|
|
824
802
|
c(this, "root", document.createTextNode(""));
|
|
825
803
|
c(this, "context");
|
|
826
804
|
c(this, "items");
|
|
@@ -834,9 +812,9 @@ class kt {
|
|
|
834
812
|
return this.root.parentElement != null;
|
|
835
813
|
}
|
|
836
814
|
mount(t, e) {
|
|
837
|
-
this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe =
|
|
815
|
+
this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe = w(() => {
|
|
838
816
|
let s = this.items();
|
|
839
|
-
s == null && (s = [], this.context.warn("repeat() received empty value for items", s)),
|
|
817
|
+
s == null && (s = [], this.context.warn("repeat() received empty value for items", s)), E(() => {
|
|
840
818
|
this._update(Array.from(s));
|
|
841
819
|
});
|
|
842
820
|
}));
|
|
@@ -854,7 +832,7 @@ class kt {
|
|
|
854
832
|
this.connectedItems.clear();
|
|
855
833
|
}
|
|
856
834
|
_update(t) {
|
|
857
|
-
var r, a,
|
|
835
|
+
var r, a, u;
|
|
858
836
|
if (t.length === 0 || !this.isMounted())
|
|
859
837
|
return this._cleanup(!1);
|
|
860
838
|
const e = /* @__PURE__ */ new Map();
|
|
@@ -870,20 +848,20 @@ class kt {
|
|
|
870
848
|
const i = [];
|
|
871
849
|
for (const h of this.connectedItems.values())
|
|
872
850
|
!e.has(h.key) && h.node.isMounted() && h.node.unmount(!1);
|
|
873
|
-
|
|
851
|
+
gt(() => {
|
|
874
852
|
for (const h of e.values()) {
|
|
875
853
|
const m = this.connectedItems.get(h.key);
|
|
876
854
|
if (m && m.node.isMounted())
|
|
877
855
|
m.$item(h.value), m.$index(h.index), i[h.index] = m;
|
|
878
856
|
else {
|
|
879
|
-
const
|
|
857
|
+
const M = _(h.value, { equals: wt }), S = _(h.index);
|
|
880
858
|
i[h.index] = {
|
|
881
859
|
key: h.key,
|
|
882
|
-
$item:
|
|
883
|
-
$index:
|
|
884
|
-
node: new
|
|
885
|
-
$item: () =>
|
|
886
|
-
$index: () =>
|
|
860
|
+
$item: M,
|
|
861
|
+
$index: S,
|
|
862
|
+
node: new nt(this.context, It, {
|
|
863
|
+
$item: () => M(),
|
|
864
|
+
$index: () => S(),
|
|
887
865
|
render: this.render
|
|
888
866
|
})
|
|
889
867
|
};
|
|
@@ -891,20 +869,21 @@ class kt {
|
|
|
891
869
|
}
|
|
892
870
|
});
|
|
893
871
|
for (let h = 0; h < i.length; h++) {
|
|
894
|
-
const m = i[h],
|
|
895
|
-
|
|
872
|
+
const m = i[h], M = ((r = i[h - 1]) == null ? void 0 : r.node.root) ?? this.root, S = this.connectedItems.get(m.key);
|
|
873
|
+
S && S.node.isMounted() ? m.node.move(this.root.parentElement, M) : m.node.mount(this.root.parentElement, M);
|
|
896
874
|
}
|
|
897
875
|
this.connectedItems.clear();
|
|
898
876
|
for (const h of i)
|
|
899
877
|
this.connectedItems.set(h.key, h);
|
|
900
878
|
const n = ((a = i.at(-1)) == null ? void 0 : a.node.root) ?? this.root;
|
|
901
|
-
(
|
|
879
|
+
(u = this.root.parentNode) == null || u.insertBefore(this.root, n.nextSibling);
|
|
902
880
|
}
|
|
903
881
|
}
|
|
904
|
-
|
|
905
|
-
|
|
882
|
+
const Et = "dolla.RepeatItemView";
|
|
883
|
+
function It(o, t) {
|
|
884
|
+
return t.setName(Et), o.render.call(t, o.$item, o.$index, t);
|
|
906
885
|
}
|
|
907
|
-
class
|
|
886
|
+
class at {
|
|
908
887
|
constructor(t, e) {
|
|
909
888
|
/**
|
|
910
889
|
* In the case of a view, type will be the View function itself. It can also hold an identifier for special nodes like "$cond", "$repeat", etc.
|
|
@@ -919,101 +898,99 @@ class rt {
|
|
|
919
898
|
this.type = t, this.props = e;
|
|
920
899
|
}
|
|
921
900
|
}
|
|
922
|
-
function
|
|
923
|
-
return (o == null ? void 0 : o[
|
|
901
|
+
function Lt(o) {
|
|
902
|
+
return (o == null ? void 0 : o[N]) === k;
|
|
924
903
|
}
|
|
925
|
-
|
|
926
|
-
|
|
904
|
+
var Ot = /* @__PURE__ */ ((o) => (o.DOM = "$dom", o.Dynamic = "$dynamic", o.Portal = "$portal", o.Repeat = "$repeat", o))(Ot || {});
|
|
905
|
+
function W(o, t) {
|
|
906
|
+
return new at(o, t ?? {});
|
|
927
907
|
}
|
|
928
|
-
function
|
|
929
|
-
return
|
|
930
|
-
source:
|
|
931
|
-
const s =
|
|
908
|
+
function Tt(o, t, e) {
|
|
909
|
+
return W("$dynamic", {
|
|
910
|
+
source: _(() => {
|
|
911
|
+
const s = y(o);
|
|
932
912
|
return s && t ? t : !s && e ? e : null;
|
|
933
913
|
})
|
|
934
914
|
});
|
|
935
915
|
}
|
|
936
|
-
function
|
|
937
|
-
return
|
|
916
|
+
function At(o, t, e) {
|
|
917
|
+
return Tt(o, e, t);
|
|
938
918
|
}
|
|
939
|
-
function
|
|
940
|
-
return
|
|
919
|
+
function Dt(o, t, e) {
|
|
920
|
+
return W("$repeat", { items: () => y(o), key: t, render: e });
|
|
941
921
|
}
|
|
942
|
-
function
|
|
943
|
-
return
|
|
922
|
+
function Ct(o, t) {
|
|
923
|
+
return W("$portal", { parent: o, content: t });
|
|
944
924
|
}
|
|
945
|
-
function
|
|
946
|
-
const e =
|
|
947
|
-
return e.length === 1 ? e[0] : new
|
|
925
|
+
function ht(o, t = new d("$")) {
|
|
926
|
+
const e = B(t, [o]);
|
|
927
|
+
return e.length === 1 ? e[0] : new A(t, () => e);
|
|
948
928
|
}
|
|
949
|
-
function
|
|
929
|
+
function B(o, ...t) {
|
|
950
930
|
const e = t.flat(1 / 0), s = [];
|
|
951
931
|
for (const i of e)
|
|
952
932
|
if (!(i == null || i === !1)) {
|
|
953
933
|
if (i instanceof Node) {
|
|
954
|
-
s.push(new
|
|
934
|
+
s.push(new $(i));
|
|
955
935
|
continue;
|
|
956
936
|
}
|
|
957
|
-
if (i instanceof
|
|
937
|
+
if (i instanceof at)
|
|
958
938
|
if (f(i.type)) {
|
|
959
|
-
s.push(new
|
|
939
|
+
s.push(new nt(o, i.type, i.props));
|
|
960
940
|
continue;
|
|
961
|
-
} else if (
|
|
941
|
+
} else if (C(i.type))
|
|
962
942
|
switch (i.type) {
|
|
963
943
|
case "$dom": {
|
|
964
944
|
const n = i.props;
|
|
965
|
-
s.push(new
|
|
945
|
+
s.push(new $(n.value));
|
|
966
946
|
continue;
|
|
967
947
|
}
|
|
968
|
-
case "$
|
|
969
|
-
const n = i.props;
|
|
970
|
-
s.push(new E(document.createTextNode(String(n.value))));
|
|
971
|
-
continue;
|
|
972
|
-
}
|
|
973
|
-
case "$repeat": {
|
|
948
|
+
case "$dynamic": {
|
|
974
949
|
const n = i.props;
|
|
975
|
-
s.push(new
|
|
950
|
+
s.push(new A(o, n.source));
|
|
976
951
|
continue;
|
|
977
952
|
}
|
|
978
|
-
case "$
|
|
953
|
+
case "$portal": {
|
|
979
954
|
const n = i.props;
|
|
980
|
-
s.push(new
|
|
955
|
+
s.push(new Mt(o, n.content, n.parent));
|
|
981
956
|
continue;
|
|
982
957
|
}
|
|
983
|
-
case "$
|
|
958
|
+
case "$repeat": {
|
|
984
959
|
const n = i.props;
|
|
985
|
-
s.push(new
|
|
960
|
+
s.push(new St(o, n.items, n.key, n.render));
|
|
986
961
|
continue;
|
|
987
962
|
}
|
|
988
963
|
default:
|
|
989
|
-
s.push(new
|
|
964
|
+
s.push(new Nt(o, i.type, i.props));
|
|
990
965
|
continue;
|
|
991
966
|
}
|
|
992
967
|
else
|
|
993
968
|
throw new TypeError(`Expected a string or view function. Got: ${i.type}`);
|
|
994
|
-
if (
|
|
969
|
+
if (Lt(i)) {
|
|
995
970
|
s.push(i);
|
|
996
971
|
continue;
|
|
997
972
|
}
|
|
998
973
|
if (f(i)) {
|
|
999
|
-
s.push(new
|
|
974
|
+
s.push(new A(o, i));
|
|
1000
975
|
continue;
|
|
1001
976
|
}
|
|
1002
|
-
s.push(new
|
|
977
|
+
s.push(new $(document.createTextNode(String(i))));
|
|
1003
978
|
}
|
|
1004
979
|
return s;
|
|
1005
980
|
}
|
|
1006
981
|
export {
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
982
|
+
d as C,
|
|
983
|
+
A as D,
|
|
984
|
+
b as L,
|
|
985
|
+
Ot as M,
|
|
986
|
+
nt as V,
|
|
987
|
+
Dt as a,
|
|
988
|
+
at as b,
|
|
989
|
+
_t as c,
|
|
990
|
+
W as m,
|
|
991
|
+
Ct as p,
|
|
992
|
+
ht as r,
|
|
993
|
+
At as u,
|
|
994
|
+
Tt as w
|
|
1018
995
|
};
|
|
1019
|
-
//# sourceMappingURL=markup-
|
|
996
|
+
//# sourceMappingURL=markup-BGlfQYQk.js.map
|