@manyducks.co/dolla 2.0.0-alpha.65 → 2.0.0-alpha.67
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/index.d.ts +1 -0
- package/dist/core/markup.d.ts +9 -1
- package/dist/core/signals.d.ts +21 -0
- package/dist/core/views/portal.d.ts +17 -0
- package/dist/hooks/index.d.ts +19 -3
- package/dist/hooks.js +32 -28
- package/dist/hooks.js.map +1 -1
- package/dist/http.js +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{index-Bh8JrCt1.js → index-DKMlSUEt.js} +5 -5
- package/dist/{index-Bh8JrCt1.js.map → index-DKMlSUEt.js.map} +1 -1
- package/dist/index.js +80 -68
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/{logger-BuZRMjzE.js → logger-BcgYqLUO.js} +8 -8
- package/dist/{logger-BuZRMjzE.js.map → logger-BcgYqLUO.js.map} +1 -1
- package/dist/{markup-DsJHUuod.js → markup-BgNq6mZF.js} +106 -103
- package/dist/markup-BgNq6mZF.js.map +1 -0
- package/dist/router.js +1 -1
- package/dist/{signals-BDlRtifZ.js → signals-HNnDUJRQ.js} +146 -134
- package/dist/signals-HNnDUJRQ.js.map +1 -0
- package/dist/{typeChecking-D0-H8_Xm.js → typeChecking-Cw-4pIto.js} +9 -5
- package/dist/{typeChecking-D0-H8_Xm.js.map → typeChecking-Cw-4pIto.js.map} +1 -1
- package/package.json +1 -1
- package/dist/markup-DsJHUuod.js.map +0 -1
- package/dist/signals-BDlRtifZ.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { g as
|
|
1
|
+
import { i as d } from "./typeChecking-Cw-4pIto.js";
|
|
2
|
+
import { g as i, u as w, c as m, q as o, r as h, v } from "./signals-HNnDUJRQ.js";
|
|
3
3
|
let g = {
|
|
4
4
|
info: "development",
|
|
5
5
|
log: "development",
|
|
@@ -12,8 +12,8 @@ function $(r) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
function k(r, e) {
|
|
15
|
-
const c = (e == null ? void 0 : e.console) ??
|
|
16
|
-
let n =
|
|
15
|
+
const c = (e == null ? void 0 : e.console) ?? b(), t = (a) => {
|
|
16
|
+
let n = w(r);
|
|
17
17
|
if (g[a] === !1 || d(g[a]) && g[a] !== m() || !s(n))
|
|
18
18
|
return h;
|
|
19
19
|
{
|
|
@@ -21,7 +21,7 @@ function k(r, e) {
|
|
|
21
21
|
return e != null && e.tag ? e.tagName ? l += ` %c[${e.tagName}: %c${e.tag}%c]` : l += ` %c[%c${e.tag}%c]` : l += "%c%c%c", c[a].bind(
|
|
22
22
|
c,
|
|
23
23
|
l,
|
|
24
|
-
`color:${
|
|
24
|
+
`color:${v(l)};font-weight:bold`,
|
|
25
25
|
"color:#777",
|
|
26
26
|
"color:#aaa",
|
|
27
27
|
"color:#777"
|
|
@@ -46,7 +46,7 @@ function k(r, e) {
|
|
|
46
46
|
u = !0;
|
|
47
47
|
const n = {
|
|
48
48
|
error: a,
|
|
49
|
-
loggerName:
|
|
49
|
+
loggerName: i(r),
|
|
50
50
|
tag: e == null ? void 0 : e.tag,
|
|
51
51
|
tagName: e == null ? void 0 : e.tagName
|
|
52
52
|
};
|
|
@@ -67,7 +67,7 @@ function y(r) {
|
|
|
67
67
|
c && (g[e] = c);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function b() {
|
|
71
71
|
if (typeof window < "u" && window.console)
|
|
72
72
|
return window.console;
|
|
73
73
|
if (typeof global < "u" && global.console)
|
|
@@ -79,4 +79,4 @@ export {
|
|
|
79
79
|
$ as o,
|
|
80
80
|
x as s
|
|
81
81
|
};
|
|
82
|
-
//# sourceMappingURL=logger-
|
|
82
|
+
//# sourceMappingURL=logger-BcgYqLUO.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger-
|
|
1
|
+
{"version":3,"file":"logger-BcgYqLUO.js","sources":["../src/core/logger.ts"],"sourcesContent":["import { isString } from \"../typeChecking.js\";\nimport type { Env } from \"../types.js\";\nimport { createMatcher, noOp, okhash, type MatcherFunction } from \"../utils.js\";\nimport { getEnv } from \"./env.js\";\nimport { get, untracked, type MaybeSignal } from \"./signals.js\";\n\nexport interface LogLevels {\n info: boolean | Env;\n log: boolean | Env;\n warn: boolean | Env;\n error: boolean | Env;\n}\n\nexport interface Logger {\n info(...args: any[]): void;\n log(...args: any[]): void;\n warn(...args: any[]): void;\n error(...args: any[]): void;\n crash(error: Error): Error;\n}\n\nexport interface LoggerOptions {\n /**\n * Tag value to print with logs.\n */\n tag?: string;\n\n /**\n * Label for tag value. Will be printed without a label if not specified.\n */\n tagName?: string;\n\n /**\n * Console object to use for logging (mostly for testing). Uses window.console by default.\n */\n console?: any;\n}\n\nexport interface LoggerCrashProps {\n error: Error;\n loggerName: string;\n tag?: string;\n tagName?: string;\n}\n\nlet levels: LogLevels = {\n info: \"development\",\n log: \"development\",\n warn: \"development\",\n error: true,\n};\nlet match: MatcherFunction = createMatcher(\"*,-dolla.*\");\nlet crashListeners: ((context: LoggerCrashProps) => void)[] = [];\nlet isCrashed = false;\n\n/**\n * Listen for logged crashes.\n */\nexport function onLoggerCrash(listener: (context: LoggerCrashProps) => void) {\n crashListeners.push(listener);\n\n return function cancel() {\n crashListeners.splice(crashListeners.indexOf(listener), 1);\n };\n}\n\nexport function createLogger(name: MaybeSignal<string>, options?: LoggerOptions): Logger {\n const _console = options?.console ?? _getDefaultConsole();\n\n const bind = (method: keyof LogLevels) => {\n let _name = untracked(name);\n if (levels[method] === false || (isString(levels[method]) && levels[method] !== getEnv()) || !match(_name)) {\n return noOp;\n } else {\n let label = `%c${_name}`;\n if (options?.tag) {\n if (options.tagName) {\n label += ` %c[${options.tagName}: %c${options.tag}%c]`;\n } else {\n label += ` %c[%c${options.tag}%c]`;\n }\n } else {\n label += `%c%c%c`;\n }\n return _console[method].bind(\n _console,\n label,\n `color:${okhash(label)};font-weight:bold`,\n `color:#777`,\n `color:#aaa`,\n `color:#777`,\n );\n }\n };\n\n return {\n get info() {\n return bind(\"info\");\n },\n get log() {\n return bind(\"log\");\n },\n get warn() {\n return bind(\"warn\");\n },\n get error() {\n return bind(\"error\");\n },\n crash(error: Error) {\n if (!isCrashed) {\n isCrashed = true;\n const ctx: LoggerCrashProps = {\n error,\n loggerName: get(name),\n tag: options?.tag,\n tagName: options?.tagName,\n };\n\n for (const listener of crashListeners) {\n listener(ctx);\n }\n\n throw error;\n }\n\n return error;\n },\n };\n}\n\nexport function setLogFilter(filter: string | RegExp) {\n match = createMatcher(filter);\n}\n\nexport function setLogLevels(options: Partial<LogLevels>) {\n for (const key in options) {\n const value = options[key as keyof LogLevels];\n if (value) {\n levels[key as keyof LogLevels] = value;\n }\n }\n}\n\nfunction _getDefaultConsole() {\n if (typeof window !== \"undefined\" && window.console) {\n return window.console;\n }\n if (typeof global !== \"undefined\" && global.console) {\n return global.console;\n }\n}\n"],"names":["levels","match","createMatcher","crashListeners","isCrashed","onLoggerCrash","listener","createLogger","name","options","_console","_getDefaultConsole","bind","method","_name","untracked","isString","getEnv","noOp","label","okhash","error","ctx","get","setLogFilter","filter","setLogLevels","key","value"],"mappings":";;AA6CA,IAAIA,IAAoB;AAAA,EACtB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AACT,GACIC,IAAyBC,EAAc,YAAY,GACnDC,IAA0D,CAAC,GAC3DC,IAAY;AAKT,SAASC,EAAcC,GAA+C;AAC3E,SAAAH,EAAe,KAAKG,CAAQ,GAErB,WAAkB;AACvB,IAAAH,EAAe,OAAOA,EAAe,QAAQG,CAAQ,GAAG,CAAC;AAAA,EAC3D;AACF;AAEgB,SAAAC,EAAaC,GAA2BC,GAAiC;AACjF,QAAAC,KAAWD,KAAA,gBAAAA,EAAS,YAAWE,EAAmB,GAElDC,IAAO,CAACC,MAA4B;AACpC,QAAAC,IAAQC,EAAUP,CAAI;AAC1B,QAAIR,EAAOa,CAAM,MAAM,MAAUG,EAAShB,EAAOa,CAAM,CAAC,KAAKb,EAAOa,CAAM,MAAMI,OAAa,CAAChB,EAAMa,CAAK;AAChG,aAAAI;AACF;AACD,UAAAC,IAAQ,KAAKL,CAAK;AACtB,aAAIL,KAAA,QAAAA,EAAS,MACPA,EAAQ,UACVU,KAAS,OAAOV,EAAQ,OAAO,OAAOA,EAAQ,GAAG,QAExCU,KAAA,SAASV,EAAQ,GAAG,QAGtBU,KAAA,UAEJT,EAASG,CAAM,EAAE;AAAA,QACtBH;AAAA,QACAS;AAAA,QACA,SAASC,EAAOD,CAAK,CAAC;AAAA,QACtB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAAA;AAAA,EAEJ;AAEO,SAAA;AAAA,IACL,IAAI,OAAO;AACT,aAAOP,EAAK,MAAM;AAAA,IACpB;AAAA,IACA,IAAI,MAAM;AACR,aAAOA,EAAK,KAAK;AAAA,IACnB;AAAA,IACA,IAAI,OAAO;AACT,aAAOA,EAAK,MAAM;AAAA,IACpB;AAAA,IACA,IAAI,QAAQ;AACV,aAAOA,EAAK,OAAO;AAAA,IACrB;AAAA,IACA,MAAMS,GAAc;AAClB,UAAI,CAACjB,GAAW;AACF,QAAAA,IAAA;AACZ,cAAMkB,IAAwB;AAAA,UAC5B,OAAAD;AAAA,UACA,YAAYE,EAAIf,CAAI;AAAA,UACpB,KAAKC,KAAA,gBAAAA,EAAS;AAAA,UACd,SAASA,KAAA,gBAAAA,EAAS;AAAA,QACpB;AAEA,mBAAWH,KAAYH;AACrB,UAAAG,EAASgB,CAAG;AAGR,cAAAD;AAAA,MAAA;AAGD,aAAAA;AAAA,IAAA;AAAA,EAEX;AACF;AAEO,SAASG,EAAaC,GAAyB;AACpD,EAAAxB,IAAQC,EAAcuB,CAAM;AAC9B;AAEO,SAASC,EAAajB,GAA6B;AACxD,aAAWkB,KAAOlB,GAAS;AACnB,UAAAmB,IAAQnB,EAAQkB,CAAsB;AAC5C,IAAIC,MACF5B,EAAO2B,CAAsB,IAAIC;AAAA,EACnC;AAEJ;AAEA,SAASjB,IAAqB;AAC5B,MAAI,OAAO,SAAW,OAAe,OAAO;AAC1C,WAAO,OAAO;AAEhB,MAAI,OAAO,SAAW,OAAe,OAAO;AAC1C,WAAO,OAAO;AAElB;"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
1
|
+
var bt = Object.defineProperty;
|
|
2
2
|
var J = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var a = (n, s, t) =>
|
|
7
|
-
var d = (n, s, t) => (B(n, s, "read from private field"), t ? t.call(n) : s.get(n)), w = (n, s, t) => s.has(n) ? J("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(n) : s.set(n, t),
|
|
8
|
-
import { b as m, t as
|
|
9
|
-
import { u as
|
|
10
|
-
import { c as
|
|
5
|
+
var yt = (n, s, t) => s in n ? bt(n, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[s] = t;
|
|
6
|
+
var a = (n, s, t) => yt(n, typeof s != "symbol" ? s + "" : s, t), B = (n, s, t) => s.has(n) || J("Cannot " + t);
|
|
7
|
+
var d = (n, s, t) => (B(n, s, "read from private field"), t ? t.call(n) : s.get(n)), w = (n, s, t) => s.has(n) ? J("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(n) : s.set(n, t), $ = (n, s, t, e) => (B(n, s, "write to private field"), e ? e.call(n, t) : s.set(n, t), t), j = (n, s, t) => (B(n, s, "access private method"), t);
|
|
8
|
+
import { b as m, t as wt, a as H, i as Z, h as xt } from "./typeChecking-Cw-4pIto.js";
|
|
9
|
+
import { u as A, g as N, j as ht, k as _, e as v, I as k, t as lt, l as X, n as vt, c as kt, o as Nt, p as Mt, b as St, w as tt, d as Et, m as It } from "./signals-HNnDUJRQ.js";
|
|
10
|
+
import { c as Lt } from "./logger-BcgYqLUO.js";
|
|
11
11
|
var y = /* @__PURE__ */ ((n) => (n[n.WILL_MOUNT = 0] = "WILL_MOUNT", n[n.DID_MOUNT = 1] = "DID_MOUNT", n[n.WILL_UNMOUNT = 2] = "WILL_UNMOUNT", n[n.DID_UNMOUNT = 3] = "DID_UNMOUNT", n[n.DISPOSE = 4] = "DISPOSE", n))(y || {});
|
|
12
|
-
const V = Symbol("name"), f = Symbol("lifecycle"), b = Symbol("parent"), M = Symbol("stores"),
|
|
13
|
-
class
|
|
12
|
+
const V = Symbol("name"), f = Symbol("lifecycle"), b = Symbol("parent"), M = Symbol("stores"), x = Symbol("state");
|
|
13
|
+
class Ot {
|
|
14
14
|
constructor(s) {
|
|
15
15
|
a(this, "context");
|
|
16
16
|
a(this, "state", 0);
|
|
@@ -54,7 +54,7 @@ class It {
|
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
56
|
case 4: {
|
|
57
|
-
this.state === 0 ? (this.notify(s), this.listeners.clear(), this.bound = void 0, this.context[
|
|
57
|
+
this.state === 0 ? (this.notify(s), this.listeners.clear(), this.bound = void 0, this.context[x] = void 0, this.context[M] = void 0, this.state = 5) : this.context.crash(new Error(`Tried to DISPOSE context at state ${this.state}`));
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -78,18 +78,18 @@ class It {
|
|
|
78
78
|
e[f].emit(s);
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
var
|
|
82
|
-
|
|
81
|
+
var it, nt, rt, ct, at, S;
|
|
82
|
+
at = V, ct = f, rt = b, nt = M, it = x;
|
|
83
83
|
const R = class R {
|
|
84
84
|
constructor(s, t) {
|
|
85
85
|
w(this, S);
|
|
86
|
-
a(this,
|
|
87
|
-
a(this,
|
|
86
|
+
a(this, at);
|
|
87
|
+
a(this, ct, new Ot(this));
|
|
88
|
+
a(this, rt);
|
|
88
89
|
a(this, nt);
|
|
89
90
|
a(this, it);
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const e = Et(() => N(d(this, S)), t == null ? void 0 : t.logger), o = Object.getOwnPropertyDescriptors(e);
|
|
91
|
+
$(this, S, s), this[V] = A(s);
|
|
92
|
+
const e = Lt(() => N(d(this, S)), t == null ? void 0 : t.logger), o = Object.getOwnPropertyDescriptors(e);
|
|
93
93
|
for (const i in o)
|
|
94
94
|
Object.defineProperty(this, i, o[i]);
|
|
95
95
|
}
|
|
@@ -127,13 +127,13 @@ const R = class R {
|
|
|
127
127
|
* Returns the current name of this context.
|
|
128
128
|
*/
|
|
129
129
|
getName() {
|
|
130
|
-
return
|
|
130
|
+
return A(d(this, S));
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
133
133
|
* Sets a new name for this context.
|
|
134
134
|
*/
|
|
135
135
|
setName(s) {
|
|
136
|
-
|
|
136
|
+
$(this, S, s), this[V] = A(s);
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Creates an instance of a store and attaches it to this context.
|
|
@@ -146,7 +146,7 @@ const R = class R {
|
|
|
146
146
|
}
|
|
147
147
|
const e = R.linked(this, s.name, {
|
|
148
148
|
bindLifecycleToParent: !0,
|
|
149
|
-
logger: { tag:
|
|
149
|
+
logger: { tag: ht(), tagName: "uid" }
|
|
150
150
|
});
|
|
151
151
|
try {
|
|
152
152
|
this[M] || (this[M] = /* @__PURE__ */ new Map());
|
|
@@ -206,12 +206,12 @@ const R = class R {
|
|
|
206
206
|
}
|
|
207
207
|
};
|
|
208
208
|
if (this[f].state >= 1) {
|
|
209
|
-
const e =
|
|
209
|
+
const e = v(t, { _type: k });
|
|
210
210
|
return this[f].on(3, e), e;
|
|
211
211
|
} else {
|
|
212
212
|
let e, o = !1;
|
|
213
213
|
return this[f].on(0, () => {
|
|
214
|
-
o || (e =
|
|
214
|
+
o || (e = v(t, { _type: k }), this[f].on(3, e));
|
|
215
215
|
}), () => {
|
|
216
216
|
e != null && (o = !0, e());
|
|
217
217
|
};
|
|
@@ -221,7 +221,7 @@ const R = class R {
|
|
|
221
221
|
var c;
|
|
222
222
|
const e = (t == null ? void 0 : t.immediate) ?? !1;
|
|
223
223
|
let o = this, i;
|
|
224
|
-
for (; i = (c = o[
|
|
224
|
+
for (; i = (c = o[x]) == null ? void 0 : c.get(s), i === void 0 && !e && o[b] != null; )
|
|
225
225
|
o = o[b];
|
|
226
226
|
if (i === void 0) {
|
|
227
227
|
if (t != null && Object.hasOwn(t, "fallback"))
|
|
@@ -239,16 +239,16 @@ const R = class R {
|
|
|
239
239
|
getStateMap(s) {
|
|
240
240
|
let t = this;
|
|
241
241
|
const e = (s == null ? void 0 : s.immediate) ?? !1, o = [];
|
|
242
|
-
for (; t[
|
|
242
|
+
for (; t[x] && o.push(...t[x].entries()), !e && t[b] != null; )
|
|
243
243
|
t = t[b];
|
|
244
244
|
return new Map(o.reverse());
|
|
245
245
|
}
|
|
246
246
|
setState(...s) {
|
|
247
|
-
if (this[
|
|
248
|
-
this[
|
|
249
|
-
else if (
|
|
247
|
+
if (this[x] || (this[x] = /* @__PURE__ */ new Map()), s.length === 2)
|
|
248
|
+
this[x].set(s[0], s[1]);
|
|
249
|
+
else if (wt(s[0]) === "array")
|
|
250
250
|
for (const [t, e] of s[0])
|
|
251
|
-
e === void 0 ? this[
|
|
251
|
+
e === void 0 ? this[x].delete(t) : this[x].set(t, e);
|
|
252
252
|
else
|
|
253
253
|
throw new Error("Invalid arguments.");
|
|
254
254
|
return this;
|
|
@@ -256,7 +256,7 @@ const R = class R {
|
|
|
256
256
|
};
|
|
257
257
|
S = new WeakMap();
|
|
258
258
|
let p = R;
|
|
259
|
-
function
|
|
259
|
+
function zt(n, s) {
|
|
260
260
|
return new p(n, s);
|
|
261
261
|
}
|
|
262
262
|
class I {
|
|
@@ -346,12 +346,12 @@ class z extends I {
|
|
|
346
346
|
return this.root.parentElement != null;
|
|
347
347
|
}
|
|
348
348
|
mount(t, e) {
|
|
349
|
-
this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe =
|
|
349
|
+
this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe = v(
|
|
350
350
|
() => {
|
|
351
351
|
try {
|
|
352
352
|
const o = this.$slot();
|
|
353
|
-
|
|
354
|
-
this.update(
|
|
353
|
+
A(() => {
|
|
354
|
+
this.update(lt(o));
|
|
355
355
|
});
|
|
356
356
|
} catch (o) {
|
|
357
357
|
this.context.crash(o);
|
|
@@ -396,7 +396,7 @@ class z extends I {
|
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
398
|
var L, O, T, U, W, E, D, G, K;
|
|
399
|
-
class
|
|
399
|
+
class Tt {
|
|
400
400
|
constructor() {
|
|
401
401
|
w(this, D);
|
|
402
402
|
w(this, L, /* @__PURE__ */ new Map());
|
|
@@ -424,7 +424,7 @@ class Lt {
|
|
|
424
424
|
);
|
|
425
425
|
for (const c of d(this, T))
|
|
426
426
|
c();
|
|
427
|
-
d(this, T).length = 0,
|
|
427
|
+
d(this, T).length = 0, $(this, U, !1);
|
|
428
428
|
});
|
|
429
429
|
}
|
|
430
430
|
scheduleNodeUpdate(s, t) {
|
|
@@ -450,10 +450,10 @@ L = new WeakMap(), O = new WeakMap(), T = new WeakMap(), U = new WeakMap(), W =
|
|
|
450
450
|
* Lets the scheduler know there is work to be done.
|
|
451
451
|
*/
|
|
452
452
|
G = function() {
|
|
453
|
-
d(this, U) || (queueMicrotask(d(this, K)),
|
|
453
|
+
d(this, U) || (queueMicrotask(d(this, K)), $(this, U, !0));
|
|
454
454
|
}, K = new WeakMap();
|
|
455
|
-
const
|
|
456
|
-
class
|
|
455
|
+
const Ut = new Tt(), ut = Symbol("ViewNode");
|
|
456
|
+
class dt extends I {
|
|
457
457
|
/**
|
|
458
458
|
* @param context - Parent contenxt to link to.
|
|
459
459
|
* @param view - View function to mount.
|
|
@@ -461,7 +461,7 @@ class ut extends I {
|
|
|
461
461
|
*/
|
|
462
462
|
constructor(t, e, o) {
|
|
463
463
|
super();
|
|
464
|
-
a(this, "id",
|
|
464
|
+
a(this, "id", ht());
|
|
465
465
|
a(this, "props");
|
|
466
466
|
a(this, "context");
|
|
467
467
|
a(this, "view");
|
|
@@ -471,7 +471,7 @@ class ut extends I {
|
|
|
471
471
|
tag: this.id,
|
|
472
472
|
tagName: "uid"
|
|
473
473
|
}
|
|
474
|
-
}), this.context.setState(
|
|
474
|
+
}), this.context.setState(ut, this), this.props = o, this.view = e;
|
|
475
475
|
}
|
|
476
476
|
getRoot() {
|
|
477
477
|
var t;
|
|
@@ -487,7 +487,7 @@ class ut extends I {
|
|
|
487
487
|
const { context: i, props: c, view: r } = this;
|
|
488
488
|
try {
|
|
489
489
|
const h = _(i), l = r.call(i, c, i);
|
|
490
|
-
_(h), l != null && l !== !1 && (this.node =
|
|
490
|
+
_(h), l != null && l !== !1 && (this.node = gt(l, i));
|
|
491
491
|
} catch (h) {
|
|
492
492
|
throw h instanceof Error && i.crash(h), h;
|
|
493
493
|
}
|
|
@@ -503,12 +503,12 @@ class ut extends I {
|
|
|
503
503
|
(o = this.node) == null || o.move(t, e);
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
|
-
const
|
|
507
|
-
class
|
|
506
|
+
const _t = (n) => /^on[A-Z]/.test(n), F = Symbol("HTML.isSVG"), Pt = ["class", "className", "ref", "mixin", "children"];
|
|
507
|
+
class Ct extends I {
|
|
508
508
|
constructor(t, e, o) {
|
|
509
509
|
super();
|
|
510
510
|
a(this, "root");
|
|
511
|
-
a(this, "id",
|
|
511
|
+
a(this, "id", vt());
|
|
512
512
|
a(this, "tag");
|
|
513
513
|
a(this, "props");
|
|
514
514
|
a(this, "context");
|
|
@@ -518,8 +518,8 @@ class _t extends I {
|
|
|
518
518
|
a(this, "ref");
|
|
519
519
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
520
520
|
a(this, "canClickAway", !1);
|
|
521
|
-
if (this.tag = e, this.props = o, this.context = p.linked(t, et.bind(this)), e.toLowerCase() === "svg" && this.context.setState(F, !0), this.context.getState(F, { fallback: !1 }) ? this.root = document.createElementNS("http://www.w3.org/2000/svg", e) : this.root = document.createElement(e),
|
|
522
|
-
const i = this.context.getState(
|
|
521
|
+
if (this.tag = e, this.props = o, this.context = p.linked(t, et.bind(this)), e.toLowerCase() === "svg" && this.context.setState(F, !0), this.context.getState(F, { fallback: !1 }) ? this.root = document.createElementNS("http://www.w3.org/2000/svg", e) : this.root = document.createElement(e), kt() === "development") {
|
|
522
|
+
const i = this.context.getState(ut, { fallback: null });
|
|
523
523
|
i && (this.root.dataset.view = i.context.getName());
|
|
524
524
|
}
|
|
525
525
|
if (o.ref)
|
|
@@ -539,7 +539,7 @@ class _t extends I {
|
|
|
539
539
|
if (!o) {
|
|
540
540
|
const { props: i } = this;
|
|
541
541
|
if (i.mixin)
|
|
542
|
-
for (const r of
|
|
542
|
+
for (const r of lt(i.mixin)) {
|
|
543
543
|
const h = p.linked(this.context, et.bind(this), {
|
|
544
544
|
bindLifecycleToParent: !0,
|
|
545
545
|
logger: { tagName: r.name === "mixin" ? void 0 : "mixin", tag: r.name }
|
|
@@ -559,7 +559,7 @@ class _t extends I {
|
|
|
559
559
|
}
|
|
560
560
|
unmount(t = !1) {
|
|
561
561
|
var e;
|
|
562
|
-
|
|
562
|
+
Ut.cancelNodeUpdates(this.id), p.emit(this.context, y.WILL_UNMOUNT), t || (e = this.root.parentNode) == null || e.removeChild(this.root);
|
|
563
563
|
for (const o of this.childNodes)
|
|
564
564
|
o.unmount(!0);
|
|
565
565
|
this.canClickAway = !1;
|
|
@@ -582,7 +582,7 @@ class _t extends I {
|
|
|
582
582
|
}
|
|
583
583
|
attachProp(t, e, o) {
|
|
584
584
|
m(t) ? this.unsubscribers.push(
|
|
585
|
-
|
|
585
|
+
v(
|
|
586
586
|
() => {
|
|
587
587
|
try {
|
|
588
588
|
e(t());
|
|
@@ -598,7 +598,7 @@ class _t extends I {
|
|
|
598
598
|
return this.id + ":" + t;
|
|
599
599
|
}
|
|
600
600
|
applyProps(t, e) {
|
|
601
|
-
for (const o in
|
|
601
|
+
for (const o in Nt(Pt, e)) {
|
|
602
602
|
const i = e[o];
|
|
603
603
|
if (o === "on:clickoutside" || o === "onClickOutside" || o === "onclickoutside") {
|
|
604
604
|
const c = (h) => {
|
|
@@ -637,12 +637,12 @@ class _t extends I {
|
|
|
637
637
|
},
|
|
638
638
|
this.getKey(c)
|
|
639
639
|
);
|
|
640
|
-
} else if (m(i) &&
|
|
640
|
+
} else if (m(i) && _t(o)) {
|
|
641
641
|
const c = o.slice(2).toLowerCase(), r = i;
|
|
642
642
|
t.addEventListener(c, r), this.unsubscribers.push(() => {
|
|
643
643
|
t.removeEventListener(c, r);
|
|
644
644
|
});
|
|
645
|
-
} else if (o.startsWith("on") && m(i) &&
|
|
645
|
+
} else if (o.startsWith("on") && m(i) && $t.includes(o.substring(2)))
|
|
646
646
|
t[o] = i, this.unsubscribers.push(() => {
|
|
647
647
|
t[o] = void 0;
|
|
648
648
|
});
|
|
@@ -717,7 +717,7 @@ class _t extends I {
|
|
|
717
717
|
if (H(r)) {
|
|
718
718
|
const h = {};
|
|
719
719
|
for (const l in r)
|
|
720
|
-
h[
|
|
720
|
+
h[Mt(l)] = String(r[l]);
|
|
721
721
|
for (const l in c)
|
|
722
722
|
Object.hasOwn(h, l) || (delete t.dataset[l], delete c[l]);
|
|
723
723
|
for (const l in h)
|
|
@@ -756,7 +756,7 @@ class _t extends I {
|
|
|
756
756
|
const i = [];
|
|
757
757
|
if (m(e)) {
|
|
758
758
|
let c;
|
|
759
|
-
const r =
|
|
759
|
+
const r = v(
|
|
760
760
|
() => {
|
|
761
761
|
m(c) && c(), t.style.cssText = "", c = this.applyStyles(t, N(e), o);
|
|
762
762
|
},
|
|
@@ -764,18 +764,18 @@ class _t extends I {
|
|
|
764
764
|
);
|
|
765
765
|
o.push(r), i.push(r);
|
|
766
766
|
} else {
|
|
767
|
-
const c =
|
|
767
|
+
const c = pt(e);
|
|
768
768
|
for (const r in c) {
|
|
769
769
|
const { value: h, priority: l } = c[r];
|
|
770
770
|
if (m(h)) {
|
|
771
|
-
const u =
|
|
771
|
+
const u = v(
|
|
772
772
|
() => {
|
|
773
|
-
N(h) ? t.style.setProperty(r, String(N(h)), l) : t.style.removeProperty(r);
|
|
773
|
+
N(h) ? t.style.setProperty(r, String(ot(N(h))), l) : t.style.removeProperty(r);
|
|
774
774
|
},
|
|
775
775
|
{ _type: k }
|
|
776
776
|
);
|
|
777
777
|
o.push(u), i.push(u);
|
|
778
|
-
} else h != null && t.style.setProperty(r, String(h));
|
|
778
|
+
} else h != null && t.style.setProperty(r, String(ot(h)));
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
return function() {
|
|
@@ -787,7 +787,7 @@ class _t extends I {
|
|
|
787
787
|
const i = [];
|
|
788
788
|
if (m(e)) {
|
|
789
789
|
let c;
|
|
790
|
-
const r =
|
|
790
|
+
const r = v(
|
|
791
791
|
() => {
|
|
792
792
|
m(c) && c(), t.removeAttribute("class"), c = this.applyClasses(t, N(e), o);
|
|
793
793
|
},
|
|
@@ -795,11 +795,11 @@ class _t extends I {
|
|
|
795
795
|
);
|
|
796
796
|
o.push(r), i.push(r);
|
|
797
797
|
} else {
|
|
798
|
-
const c =
|
|
798
|
+
const c = ft(e);
|
|
799
799
|
for (const r in c) {
|
|
800
800
|
const h = c[r];
|
|
801
801
|
if (m(h)) {
|
|
802
|
-
const l =
|
|
802
|
+
const l = v(
|
|
803
803
|
() => {
|
|
804
804
|
N(h) ? t.classList.add(r) : t.classList.remove(r);
|
|
805
805
|
},
|
|
@@ -815,18 +815,18 @@ class _t extends I {
|
|
|
815
815
|
};
|
|
816
816
|
}
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function ft(n) {
|
|
819
819
|
let s = {};
|
|
820
820
|
if (Z(n)) {
|
|
821
821
|
const t = n.split(" ");
|
|
822
822
|
for (const e of t)
|
|
823
823
|
s[e] = !0;
|
|
824
824
|
} else H(n) ? Object.assign(s, n) : Array.isArray(n) && Array.from(n).filter(Boolean).forEach((t) => {
|
|
825
|
-
Object.assign(s,
|
|
825
|
+
Object.assign(s, ft(t));
|
|
826
826
|
});
|
|
827
827
|
return delete s.undefined, s;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function pt(n) {
|
|
830
830
|
let s = {};
|
|
831
831
|
if (Z(n)) {
|
|
832
832
|
const t = n.split(";").filter((e) => e.trim() !== "");
|
|
@@ -841,7 +841,7 @@ function ft(n) {
|
|
|
841
841
|
for (const t in n)
|
|
842
842
|
t.startsWith("--") ? s[t] = { value: n[t] } : s[st(t)] = { value: n[t] };
|
|
843
843
|
else Array.isArray(n) && Array.from(n).filter((t) => t != null).forEach((t) => {
|
|
844
|
-
Object.assign(s,
|
|
844
|
+
Object.assign(s, pt(t));
|
|
845
845
|
});
|
|
846
846
|
return s;
|
|
847
847
|
}
|
|
@@ -857,7 +857,10 @@ function et() {
|
|
|
857
857
|
function st(n) {
|
|
858
858
|
return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (s, t) => (t ? "-" : "") + s.toLowerCase());
|
|
859
859
|
}
|
|
860
|
-
|
|
860
|
+
function ot(n) {
|
|
861
|
+
return xt(n) ? `${n}px` : n;
|
|
862
|
+
}
|
|
863
|
+
const $t = [
|
|
861
864
|
// Element
|
|
862
865
|
"animationcancel",
|
|
863
866
|
"animationend",
|
|
@@ -947,7 +950,7 @@ const Pt = [
|
|
|
947
950
|
"reset",
|
|
948
951
|
"submit"
|
|
949
952
|
];
|
|
950
|
-
class
|
|
953
|
+
class At extends I {
|
|
951
954
|
constructor(t, e, o) {
|
|
952
955
|
super();
|
|
953
956
|
a(this, "context");
|
|
@@ -964,7 +967,7 @@ class Ct extends I {
|
|
|
964
967
|
return this.node ? this.node.isMounted() : !1;
|
|
965
968
|
}
|
|
966
969
|
mount(t, e) {
|
|
967
|
-
const o =
|
|
970
|
+
const o = gt(this.value, this.context);
|
|
968
971
|
this.node = o, o.mount(this.parent);
|
|
969
972
|
}
|
|
970
973
|
unmount(t = !1) {
|
|
@@ -974,7 +977,7 @@ class Ct extends I {
|
|
|
974
977
|
move(t, e) {
|
|
975
978
|
}
|
|
976
979
|
}
|
|
977
|
-
class
|
|
980
|
+
class Dt extends I {
|
|
978
981
|
constructor(t, e, o, i) {
|
|
979
982
|
super();
|
|
980
983
|
a(this, "root", document.createTextNode(""));
|
|
@@ -993,10 +996,10 @@ class At extends I {
|
|
|
993
996
|
return this.root.parentElement != null;
|
|
994
997
|
}
|
|
995
998
|
mount(t, e) {
|
|
996
|
-
this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe =
|
|
999
|
+
this.isMounted() || (t.insertBefore(this.root, (e == null ? void 0 : e.nextSibling) ?? null), this.unsubscribe = v(
|
|
997
1000
|
() => {
|
|
998
1001
|
let o = this.items();
|
|
999
|
-
o == null && (o = [], this.context.warn("repeat() received empty value for items", o)),
|
|
1002
|
+
o == null && (o = [], this.context.warn("repeat() received empty value for items", o)), A(() => {
|
|
1000
1003
|
this._update(Array.from(o));
|
|
1001
1004
|
});
|
|
1002
1005
|
},
|
|
@@ -1032,18 +1035,18 @@ class At extends I {
|
|
|
1032
1035
|
const i = [];
|
|
1033
1036
|
for (const u of this.connectedItems.values())
|
|
1034
1037
|
!e.has(u.key) && u.node.isMounted() && u.node.unmount(!1);
|
|
1035
|
-
|
|
1038
|
+
St(() => {
|
|
1036
1039
|
for (const u of e.values()) {
|
|
1037
1040
|
const g = this.connectedItems.get(u.key);
|
|
1038
1041
|
if (g && g.node.isMounted())
|
|
1039
1042
|
g.item.set(u.value), g.index.set(u.index), i[u.index] = g;
|
|
1040
1043
|
else {
|
|
1041
|
-
const P = tt(u.value, { equals:
|
|
1044
|
+
const P = tt(u.value, { equals: Et }), C = tt(u.index);
|
|
1042
1045
|
i[u.index] = {
|
|
1043
1046
|
key: u.key,
|
|
1044
1047
|
item: P,
|
|
1045
1048
|
index: C,
|
|
1046
|
-
node: new
|
|
1049
|
+
node: new dt(this.context, Wt, {
|
|
1047
1050
|
item: () => P(),
|
|
1048
1051
|
index: () => C(),
|
|
1049
1052
|
render: this.render
|
|
@@ -1063,11 +1066,11 @@ class At extends I {
|
|
|
1063
1066
|
(l = this.root.parentNode) == null || l.insertBefore(this.root, c.nextSibling);
|
|
1064
1067
|
}
|
|
1065
1068
|
}
|
|
1066
|
-
const
|
|
1067
|
-
function
|
|
1068
|
-
return s.setName(
|
|
1069
|
+
const Rt = "dolla.RepeatItemView";
|
|
1070
|
+
function Wt(n, s) {
|
|
1071
|
+
return s.setName(Rt), n.render.call(s, n.item, n.index, s);
|
|
1069
1072
|
}
|
|
1070
|
-
class
|
|
1073
|
+
class mt {
|
|
1071
1074
|
constructor(s, t) {
|
|
1072
1075
|
/**
|
|
1073
1076
|
* 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.
|
|
@@ -1082,28 +1085,28 @@ class pt {
|
|
|
1082
1085
|
this.type = s, this.props = t;
|
|
1083
1086
|
}
|
|
1084
1087
|
}
|
|
1085
|
-
var
|
|
1088
|
+
var Kt = /* @__PURE__ */ ((n) => (n.DOM = "$dom", n.Dynamic = "$dynamic", n.Portal = "$portal", n.Repeat = "$repeat", n))(Kt || {});
|
|
1086
1089
|
function Q(n, s) {
|
|
1087
|
-
return new
|
|
1090
|
+
return new mt(n, s ?? {});
|
|
1088
1091
|
}
|
|
1089
|
-
function
|
|
1092
|
+
function Bt(n, s, t) {
|
|
1090
1093
|
return Q("$dynamic", {
|
|
1091
|
-
source:
|
|
1094
|
+
source: It(() => {
|
|
1092
1095
|
const e = N(n);
|
|
1093
1096
|
return e && s ? s : !e && t ? t : null;
|
|
1094
1097
|
})
|
|
1095
1098
|
});
|
|
1096
1099
|
}
|
|
1097
|
-
function
|
|
1098
|
-
return
|
|
1100
|
+
function Gt(n, s, t) {
|
|
1101
|
+
return Bt(n, t, s);
|
|
1099
1102
|
}
|
|
1100
|
-
function
|
|
1103
|
+
function Ht(n, s, t) {
|
|
1101
1104
|
return Q("$repeat", { items: () => N(n), key: s, render: t });
|
|
1102
1105
|
}
|
|
1103
|
-
function
|
|
1106
|
+
function Zt(n, s) {
|
|
1104
1107
|
return Q("$portal", { parent: n, content: s });
|
|
1105
1108
|
}
|
|
1106
|
-
function
|
|
1109
|
+
function gt(n, s = new p("$")) {
|
|
1107
1110
|
const t = Y(s, n);
|
|
1108
1111
|
return t.length === 1 ? t[0] : new z(s, () => t);
|
|
1109
1112
|
}
|
|
@@ -1115,9 +1118,9 @@ function Y(n, ...s) {
|
|
|
1115
1118
|
e.push(new q(o));
|
|
1116
1119
|
continue;
|
|
1117
1120
|
}
|
|
1118
|
-
if (o instanceof
|
|
1121
|
+
if (o instanceof mt)
|
|
1119
1122
|
if (m(o.type)) {
|
|
1120
|
-
e.push(new
|
|
1123
|
+
e.push(new dt(n, o.type, o.props));
|
|
1121
1124
|
continue;
|
|
1122
1125
|
} else if (Z(o.type))
|
|
1123
1126
|
switch (o.type) {
|
|
@@ -1133,16 +1136,16 @@ function Y(n, ...s) {
|
|
|
1133
1136
|
}
|
|
1134
1137
|
case "$portal": {
|
|
1135
1138
|
const i = o.props;
|
|
1136
|
-
e.push(new
|
|
1139
|
+
e.push(new At(n, i.content, i.parent));
|
|
1137
1140
|
continue;
|
|
1138
1141
|
}
|
|
1139
1142
|
case "$repeat": {
|
|
1140
1143
|
const i = o.props;
|
|
1141
|
-
e.push(new
|
|
1144
|
+
e.push(new Dt(n, i.items, i.key, i.render));
|
|
1142
1145
|
continue;
|
|
1143
1146
|
}
|
|
1144
1147
|
default:
|
|
1145
|
-
e.push(new
|
|
1148
|
+
e.push(new Ct(n, o.type, o.props));
|
|
1146
1149
|
continue;
|
|
1147
1150
|
}
|
|
1148
1151
|
else
|
|
@@ -1163,17 +1166,17 @@ export {
|
|
|
1163
1166
|
p as C,
|
|
1164
1167
|
z as D,
|
|
1165
1168
|
y as L,
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1169
|
+
mt as M,
|
|
1170
|
+
Dt as R,
|
|
1171
|
+
dt as V,
|
|
1172
|
+
Kt as a,
|
|
1173
|
+
I as b,
|
|
1174
|
+
zt as c,
|
|
1175
|
+
Ht as d,
|
|
1173
1176
|
Q as m,
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1177
|
+
Zt as p,
|
|
1178
|
+
gt as r,
|
|
1179
|
+
Gt as u,
|
|
1180
|
+
Bt as w
|
|
1178
1181
|
};
|
|
1179
|
-
//# sourceMappingURL=markup-
|
|
1182
|
+
//# sourceMappingURL=markup-BgNq6mZF.js.map
|