twd-js 1.5.1 → 1.6.0
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/bundled.es.js +282 -279
- package/dist/cli.js +1 -1
- package/dist/index.cjs.js +56 -39
- package/dist/index.d.ts +26 -0
- package/dist/index.es.js +3998 -3830
- package/dist/mock-sw.js +1 -1
- package/package.json +5 -5
package/dist/bundled.es.js
CHANGED
|
@@ -1,94 +1,95 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var Ye = Object.defineProperty;
|
|
2
|
+
var Ke = (e, t, r) => t in e ? Ye(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var he = (e, t, r) => Ke(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
var Y, w, We, E, me, ze, He, Ne, ae, re, ne, V = {}, J = [], Ze = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, K = Array.isArray;
|
|
5
5
|
function T(e, t) {
|
|
6
6
|
for (var r in t) e[r] = t[r];
|
|
7
7
|
return e;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function le(e) {
|
|
10
10
|
e && e.parentNode && e.parentNode.removeChild(e);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Qe(e, t, r) {
|
|
13
13
|
var n, s, o, l = {};
|
|
14
14
|
for (o in t) o == "key" ? n = t[o] : o == "ref" ? s = t[o] : l[o] = t[o];
|
|
15
|
-
if (arguments.length > 2 && (l.children = arguments.length > 3 ?
|
|
16
|
-
return
|
|
15
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? Y.call(arguments, 2) : r), typeof e == "function" && e.defaultProps != null) for (o in e.defaultProps) l[o] === void 0 && (l[o] = e.defaultProps[o]);
|
|
16
|
+
return F(e, l, n, s, null);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function F(e, t, r, n, s) {
|
|
19
19
|
var o = { type: e, props: t, key: r, ref: n, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: s ?? ++We, __i: -1, __u: 0 };
|
|
20
20
|
return s == null && w.vnode != null && w.vnode(o), o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function N(e) {
|
|
23
23
|
return e.children;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function O(e, t) {
|
|
26
26
|
this.props = e, this.context = t;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
if (t == null) return e.__ ?
|
|
28
|
+
function A(e, t) {
|
|
29
|
+
if (t == null) return e.__ ? A(e.__, e.__i + 1) : null;
|
|
30
30
|
for (var r; t < e.__k.length; t++) if ((r = e.__k[t]) != null && r.__e != null) return r.__e;
|
|
31
|
-
return typeof e.type == "function" ?
|
|
31
|
+
return typeof e.type == "function" ? A(e) : null;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
e.__e = e.__c.base = r.__e;
|
|
38
|
-
break;
|
|
39
|
-
}
|
|
40
|
-
return De(e);
|
|
33
|
+
function et(e) {
|
|
34
|
+
if (e.__P && e.__d) {
|
|
35
|
+
var t = e.__v, r = t.__e, n = [], s = [], o = T({}, t);
|
|
36
|
+
o.__v = t.__v + 1, w.vnode && w.vnode(o), ce(e.__P, o, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [r] : null, n, r ?? A(t), !!(32 & t.__u), s), o.__v = t.__v, o.__.__k[o.__i] = o, Fe(n, o, s), t.__e = t.__ = null, o.__e != r && Be(o);
|
|
41
37
|
}
|
|
42
38
|
}
|
|
39
|
+
function Be(e) {
|
|
40
|
+
if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
|
|
41
|
+
if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
|
|
42
|
+
}), Be(e);
|
|
43
|
+
}
|
|
43
44
|
function ve(e) {
|
|
44
|
-
(!e.__d && (e.__d = !0) &&
|
|
45
|
+
(!e.__d && (e.__d = !0) && E.push(e) && !X.__r++ || me != w.debounceRendering) && ((me = w.debounceRendering) || ze)(X);
|
|
45
46
|
}
|
|
46
|
-
function
|
|
47
|
-
for (var e, t
|
|
48
|
-
|
|
47
|
+
function X() {
|
|
48
|
+
for (var e, t = 1; E.length; ) E.length > t && E.sort(He), e = E.shift(), t = E.length, et(e);
|
|
49
|
+
X.__r = 0;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
var i, u, p, _,
|
|
52
|
-
for (f =
|
|
53
|
-
return r.__e =
|
|
51
|
+
function De(e, t, r, n, s, o, l, c, f, a, g) {
|
|
52
|
+
var i, u, p, _, h, v, m, y = n && n.__k || J, R = t.length;
|
|
53
|
+
for (f = tt(r, t, y, f, R), i = 0; i < R; i++) (p = r.__k[i]) != null && (u = p.__i != -1 && y[p.__i] || V, p.__i = i, v = ce(e, p, u, s, o, l, c, f, a, g), _ = p.__e, p.ref && u.ref != p.ref && (u.ref && de(u.ref, null, p), g.push(p.ref, p.__c || _, p)), h == null && _ != null && (h = _), (m = !!(4 & p.__u)) || u.__k === p.__k ? f = Pe(p, f, e, m) : typeof p.type == "function" && v !== void 0 ? f = v : _ && (f = _.nextSibling), p.__u &= -7);
|
|
54
|
+
return r.__e = h, f;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
var o, l, c, f, a,
|
|
57
|
-
for (e.__k = new Array(s), o = 0; o < s; o++) (l = t[o]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = e.__k[o] =
|
|
58
|
-
if (i) for (o = 0; o <
|
|
56
|
+
function tt(e, t, r, n, s) {
|
|
57
|
+
var o, l, c, f, a, g = r.length, i = g, u = 0;
|
|
58
|
+
for (e.__k = new Array(s), o = 0; o < s; o++) (l = t[o]) != null && typeof l != "boolean" && typeof l != "function" ? (typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? l = e.__k[o] = F(null, l, null, null, null) : K(l) ? l = e.__k[o] = F(N, { children: l }, null, null, null) : l.constructor === void 0 && l.__b > 0 ? l = e.__k[o] = F(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : e.__k[o] = l, f = o + u, l.__ = e, l.__b = e.__b + 1, c = null, (a = l.__i = rt(l, r, f, i)) != -1 && (i--, (c = r[a]) && (c.__u |= 2)), c == null || c.__v == null ? (a == -1 && (s > g ? u-- : s < g && u++), typeof l.type != "function" && (l.__u |= 4)) : a != f && (a == f - 1 ? u-- : a == f + 1 ? u++ : (a > f ? u-- : u++, l.__u |= 4))) : e.__k[o] = null;
|
|
59
|
+
if (i) for (o = 0; o < g; o++) (c = r[o]) != null && (2 & c.__u) == 0 && (c.__e == n && (n = A(c)), Ue(c, c));
|
|
59
60
|
return n;
|
|
60
61
|
}
|
|
61
|
-
function
|
|
62
|
+
function Pe(e, t, r, n) {
|
|
62
63
|
var s, o;
|
|
63
64
|
if (typeof e.type == "function") {
|
|
64
|
-
for (s = e.__k, o = 0; s && o < s.length; o++) s[o] && (s[o].__ = e, t =
|
|
65
|
+
for (s = e.__k, o = 0; s && o < s.length; o++) s[o] && (s[o].__ = e, t = Pe(s[o], t, r, n));
|
|
65
66
|
return t;
|
|
66
67
|
}
|
|
67
|
-
e.__e != t && (n && (t && e.type && !t.parentNode && (t =
|
|
68
|
+
e.__e != t && (n && (t && e.type && !t.parentNode && (t = A(e)), r.insertBefore(e.__e, t || null)), t = e.__e);
|
|
68
69
|
do
|
|
69
70
|
t = t && t.nextSibling;
|
|
70
71
|
while (t != null && t.nodeType == 8);
|
|
71
72
|
return t;
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
-
var s, o, l, c = e.key, f = e.type, a = t[r],
|
|
75
|
-
if (a === null && c == null ||
|
|
76
|
-
if (n > (
|
|
74
|
+
function rt(e, t, r, n) {
|
|
75
|
+
var s, o, l, c = e.key, f = e.type, a = t[r], g = a != null && (2 & a.__u) == 0;
|
|
76
|
+
if (a === null && c == null || g && c == a.key && f == a.type) return r;
|
|
77
|
+
if (n > (g ? 1 : 0)) {
|
|
77
78
|
for (s = r - 1, o = r + 1; s >= 0 || o < t.length; ) if ((a = t[l = s >= 0 ? s-- : o++]) != null && (2 & a.__u) == 0 && c == a.key && f == a.type) return l;
|
|
78
79
|
}
|
|
79
80
|
return -1;
|
|
80
81
|
}
|
|
81
82
|
function we(e, t, r) {
|
|
82
|
-
t[0] == "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" ||
|
|
83
|
+
t[0] == "-" ? e.setProperty(t, r ?? "") : e[t] = r == null ? "" : typeof r != "number" || Ze.test(t) ? r : r + "px";
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function D(e, t, r, n, s) {
|
|
85
86
|
var o, l;
|
|
86
87
|
e: if (t == "style") if (typeof r == "string") e.style.cssText = r;
|
|
87
88
|
else {
|
|
88
89
|
if (typeof n == "string" && (e.style.cssText = n = ""), n) for (t in n) r && t in r || we(e.style, t, "");
|
|
89
90
|
if (r) for (t in r) n && r[t] == n[t] || we(e.style, t, r[t]);
|
|
90
91
|
}
|
|
91
|
-
else if (t[0] == "o" && t[1] == "n") o = t != (t = t.replace(Ne, "$1")), l = t.toLowerCase(), t = l in e || t == "onFocusOut" || t == "onFocusIn" ? l.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + o] = r, r ? n ? r.u = n.u : (r.u =
|
|
92
|
+
else if (t[0] == "o" && t[1] == "n") o = t != (t = t.replace(Ne, "$1")), l = t.toLowerCase(), t = l in e || t == "onFocusOut" || t == "onFocusIn" ? l.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + o] = r, r ? n ? r.u = n.u : (r.u = ae, e.addEventListener(t, o ? ne : re, o)) : e.removeEventListener(t, o ? ne : re, o);
|
|
92
93
|
else {
|
|
93
94
|
if (s == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
94
95
|
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
|
|
@@ -103,56 +104,53 @@ function ye(e) {
|
|
|
103
104
|
return function(t) {
|
|
104
105
|
if (this.l) {
|
|
105
106
|
var r = this.l[t.type + e];
|
|
106
|
-
if (t.t == null) t.t =
|
|
107
|
+
if (t.t == null) t.t = ae++;
|
|
107
108
|
else if (t.t < r.u) return;
|
|
108
109
|
return r(w.event ? w.event(t) : t);
|
|
109
110
|
}
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
-
var
|
|
113
|
+
function ce(e, t, r, n, s, o, l, c, f, a) {
|
|
114
|
+
var g, i, u, p, _, h, v, m, y, R, C, L, ge, B, ee, x = t.type;
|
|
114
115
|
if (t.constructor !== void 0) return null;
|
|
115
|
-
128 & r.__u && (f = !!(32 & r.__u), o = [c = t.__e = r.__e]), (
|
|
116
|
+
128 & r.__u && (f = !!(32 & r.__u), o = [c = t.__e = r.__e]), (g = w.__b) && g(t);
|
|
116
117
|
e: if (typeof x == "function") try {
|
|
117
|
-
if (m = t.props, y = "prototype" in x && x.prototype.render,
|
|
118
|
+
if (m = t.props, y = "prototype" in x && x.prototype.render, R = (g = x.contextType) && n[g.__c], C = g ? R ? R.props.value : g.__ : n, r.__c ? v = (i = t.__c = r.__c).__ = i.__E : (y ? t.__c = i = new x(m, C) : (t.__c = i = new O(m, C), i.constructor = x, i.render = ot), R && R.sub(i), i.state || (i.state = {}), i.__n = n, u = i.__d = !0, i.__h = [], i._sb = []), y && i.__s == null && (i.__s = i.state), y && x.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = T({}, i.__s)), T(i.__s, x.getDerivedStateFromProps(m, i.__s))), p = i.props, _ = i.state, i.__v = t, u) y && x.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), y && i.componentDidMount != null && i.__h.push(i.componentDidMount);
|
|
118
119
|
else {
|
|
119
|
-
if (y && x.getDerivedStateFromProps == null && m !== p && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}),
|
|
123
|
-
i._sb = [], i.__h.length && l.push(i);
|
|
120
|
+
if (y && x.getDerivedStateFromProps == null && m !== p && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, C), t.__v == r.__v || !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, C) === !1) {
|
|
121
|
+
t.__v != r.__v && (i.props = m, i.state = i.__s, i.__d = !1), t.__e = r.__e, t.__k = r.__k, t.__k.some(function(I) {
|
|
122
|
+
I && (I.__ = t);
|
|
123
|
+
}), J.push.apply(i.__h, i._sb), i._sb = [], i.__h.length && l.push(i);
|
|
124
124
|
break e;
|
|
125
125
|
}
|
|
126
|
-
i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s,
|
|
127
|
-
i.componentDidUpdate(p, _,
|
|
126
|
+
i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, C), y && i.componentDidUpdate != null && i.__h.push(function() {
|
|
127
|
+
i.componentDidUpdate(p, _, h);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
|
-
if (i.context =
|
|
131
|
-
|
|
132
|
-
i.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
} catch (A) {
|
|
138
|
-
if (t.__v = null, f || o != null) if (A.then) {
|
|
130
|
+
if (i.context = C, i.props = m, i.__P = e, i.__e = !1, L = w.__r, ge = 0, y) i.state = i.__s, i.__d = !1, L && L(t), g = i.render(i.props, i.state, i.context), J.push.apply(i.__h, i._sb), i._sb = [];
|
|
131
|
+
else do
|
|
132
|
+
i.__d = !1, L && L(t), g = i.render(i.props, i.state, i.context), i.state = i.__s;
|
|
133
|
+
while (i.__d && ++ge < 25);
|
|
134
|
+
i.state = i.__s, i.getChildContext != null && (n = T(T({}, n), i.getChildContext())), y && !u && i.getSnapshotBeforeUpdate != null && (h = i.getSnapshotBeforeUpdate(p, _)), B = g != null && g.type === N && g.key == null ? Oe(g.props.children) : g, c = De(e, K(B) ? B : [B], t, r, n, s, o, l, c, f, a), i.base = t.__e, t.__u &= -161, i.__h.length && l.push(i), v && (i.__E = i.__ = null);
|
|
135
|
+
} catch (I) {
|
|
136
|
+
if (t.__v = null, f || o != null) if (I.then) {
|
|
139
137
|
for (t.__u |= f ? 160 : 128; c && c.nodeType == 8 && c.nextSibling; ) c = c.nextSibling;
|
|
140
138
|
o[o.indexOf(c)] = null, t.__e = c;
|
|
141
139
|
} else {
|
|
142
|
-
for (
|
|
143
|
-
|
|
140
|
+
for (ee = o.length; ee--; ) le(o[ee]);
|
|
141
|
+
oe(t);
|
|
144
142
|
}
|
|
145
|
-
else t.__e = r.__e, t.__k = r.__k,
|
|
146
|
-
w.__e(
|
|
143
|
+
else t.__e = r.__e, t.__k = r.__k, I.then || oe(t);
|
|
144
|
+
w.__e(I, t, r);
|
|
147
145
|
}
|
|
148
|
-
else o == null && t.__v == r.__v ? (t.__k = r.__k, t.__e = r.__e) : c = t.__e =
|
|
149
|
-
return (
|
|
146
|
+
else o == null && t.__v == r.__v ? (t.__k = r.__k, t.__e = r.__e) : c = t.__e = nt(r.__e, t, r, n, s, o, l, f, a);
|
|
147
|
+
return (g = w.diffed) && g(t), 128 & t.__u ? void 0 : c;
|
|
150
148
|
}
|
|
151
|
-
function
|
|
152
|
-
e && e.__c && (e.__c.__e = !0), e
|
|
149
|
+
function oe(e) {
|
|
150
|
+
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(oe));
|
|
153
151
|
}
|
|
154
|
-
function
|
|
155
|
-
for (var n = 0; n < r.length; n++)
|
|
152
|
+
function Fe(e, t, r) {
|
|
153
|
+
for (var n = 0; n < r.length; n++) de(r[n], r[++n], r[++n]);
|
|
156
154
|
w.__c && w.__c(t, e), e.some(function(s) {
|
|
157
155
|
try {
|
|
158
156
|
e = s.__h, s.__h = [], e.some(function(o) {
|
|
@@ -163,11 +161,11 @@ function Oe(e, t, r) {
|
|
|
163
161
|
}
|
|
164
162
|
});
|
|
165
163
|
}
|
|
166
|
-
function
|
|
167
|
-
return typeof e != "object" || e == null || e.__b
|
|
164
|
+
function Oe(e) {
|
|
165
|
+
return typeof e != "object" || e == null || e.__b > 0 ? e : K(e) ? e.map(Oe) : T({}, e);
|
|
168
166
|
}
|
|
169
|
-
function
|
|
170
|
-
var a,
|
|
167
|
+
function nt(e, t, r, n, s, o, l, c, f) {
|
|
168
|
+
var a, g, i, u, p, _, h, v = r.props || V, m = t.props, y = t.type;
|
|
171
169
|
if (y == "svg" ? s = "http://www.w3.org/2000/svg" : y == "math" ? s = "http://www.w3.org/1998/Math/MathML" : s || (s = "http://www.w3.org/1999/xhtml"), o != null) {
|
|
172
170
|
for (a = 0; a < o.length; a++) if ((p = o[a]) && "setAttribute" in p == !!y && (y ? p.localName == y : p.nodeType == 3)) {
|
|
173
171
|
e = p, o[a] = null;
|
|
@@ -180,22 +178,16 @@ function ot(e, t, r, n, s, o, l, c, f) {
|
|
|
180
178
|
}
|
|
181
179
|
if (y == null) v === m || c && e.data == m || (e.data = m);
|
|
182
180
|
else {
|
|
183
|
-
if (o = o &&
|
|
184
|
-
for (a in v)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
for (a in m) p = m[a], a == "children" ? u = p : a == "dangerouslySetInnerHTML" ? h = p : a == "value" ? _ = p : a == "checked" ? g = p : c && typeof p != "function" || v[a] === p || O(e, a, p, v[a], s);
|
|
192
|
-
if (h) c || i && (h.__html == i.__html || h.__html == e.innerHTML) || (e.innerHTML = h.__html), t.__k = [];
|
|
193
|
-
else if (i && (e.innerHTML = ""), Pe(t.type == "template" ? e.content : e, Z(u) ? u : [u], t, r, n, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, o, l, o ? o[0] : r.__k && I(r, 0), c, f), o != null) for (a = o.length; a--; ) ce(o[a]);
|
|
194
|
-
c || (a = "value", y == "progress" && _ == null ? e.removeAttribute("value") : _ != null && (_ !== e[a] || y == "progress" && !_ || y == "option" && _ != v[a]) && O(e, a, _, v[a], s), a = "checked", g != null && g != e[a] && O(e, a, g, v[a], s));
|
|
181
|
+
if (o = o && Y.call(e.childNodes), !c && o != null) for (v = {}, a = 0; a < e.attributes.length; a++) v[(p = e.attributes[a]).name] = p.value;
|
|
182
|
+
for (a in v) p = v[a], a == "dangerouslySetInnerHTML" ? i = p : a == "children" || a in m || a == "value" && "defaultValue" in m || a == "checked" && "defaultChecked" in m || D(e, a, null, p, s);
|
|
183
|
+
for (a in m) p = m[a], a == "children" ? u = p : a == "dangerouslySetInnerHTML" ? g = p : a == "value" ? _ = p : a == "checked" ? h = p : c && typeof p != "function" || v[a] === p || D(e, a, p, v[a], s);
|
|
184
|
+
if (g) c || i && (g.__html == i.__html || g.__html == e.innerHTML) || (e.innerHTML = g.__html), t.__k = [];
|
|
185
|
+
else if (i && (e.innerHTML = ""), De(t.type == "template" ? e.content : e, K(u) ? u : [u], t, r, n, y == "foreignObject" ? "http://www.w3.org/1999/xhtml" : s, o, l, o ? o[0] : r.__k && A(r, 0), c, f), o != null) for (a = o.length; a--; ) le(o[a]);
|
|
186
|
+
c || (a = "value", y == "progress" && _ == null ? e.removeAttribute("value") : _ != null && (_ !== e[a] || y == "progress" && !_ || y == "option" && _ != v[a]) && D(e, a, _, v[a], s), a = "checked", h != null && h != e[a] && D(e, a, h, v[a], s));
|
|
195
187
|
}
|
|
196
188
|
return e;
|
|
197
189
|
}
|
|
198
|
-
function
|
|
190
|
+
function de(e, t, r) {
|
|
199
191
|
try {
|
|
200
192
|
if (typeof e == "function") {
|
|
201
193
|
var n = typeof e.__u == "function";
|
|
@@ -207,7 +199,7 @@ function _e(e, t, r) {
|
|
|
207
199
|
}
|
|
208
200
|
function Ue(e, t, r) {
|
|
209
201
|
var n, s;
|
|
210
|
-
if (w.unmount && w.unmount(e), (n = e.ref) && (n.current && n.current != e.__e ||
|
|
202
|
+
if (w.unmount && w.unmount(e), (n = e.ref) && (n.current && n.current != e.__e || de(n, null, t)), (n = e.__c) != null) {
|
|
211
203
|
if (n.componentWillUnmount) try {
|
|
212
204
|
n.componentWillUnmount();
|
|
213
205
|
} catch (o) {
|
|
@@ -216,40 +208,40 @@ function Ue(e, t, r) {
|
|
|
216
208
|
n.base = n.__P = null;
|
|
217
209
|
}
|
|
218
210
|
if (n = e.__k) for (s = 0; s < n.length; s++) n[s] && Ue(n[s], t, r || typeof e.type != "function");
|
|
219
|
-
r ||
|
|
211
|
+
r || le(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
220
212
|
}
|
|
221
|
-
function
|
|
213
|
+
function ot(e, t, r) {
|
|
222
214
|
return this.constructor(e, r);
|
|
223
215
|
}
|
|
224
|
-
function
|
|
216
|
+
function st(e, t, r) {
|
|
225
217
|
var n, s, o, l;
|
|
226
|
-
t == document && (t = document.documentElement), w.__ && w.__(e, t), s = (n = !1) ? null : t.__k, o = [], l = [],
|
|
218
|
+
t == document && (t = document.documentElement), w.__ && w.__(e, t), s = (n = !1) ? null : t.__k, o = [], l = [], ce(t, e = t.__k = Qe(N, null, [e]), s || V, V, t.namespaceURI, s ? null : t.firstChild ? Y.call(t.childNodes) : null, o, s ? s.__e : t.firstChild, n, l), Fe(o, e, l);
|
|
227
219
|
}
|
|
228
|
-
|
|
220
|
+
Y = J.slice, w = { __e: function(e, t, r, n) {
|
|
229
221
|
for (var s, o, l; t = t.__; ) if ((s = t.__c) && !s.__) try {
|
|
230
222
|
if ((o = s.constructor) && o.getDerivedStateFromError != null && (s.setState(o.getDerivedStateFromError(e)), l = s.__d), s.componentDidCatch != null && (s.componentDidCatch(e, n || {}), l = s.__d), l) return s.__E = s;
|
|
231
223
|
} catch (c) {
|
|
232
224
|
e = c;
|
|
233
225
|
}
|
|
234
226
|
throw e;
|
|
235
|
-
} }, We = 0,
|
|
227
|
+
} }, We = 0, O.prototype.setState = function(e, t) {
|
|
236
228
|
var r;
|
|
237
229
|
r = this.__s != null && this.__s != this.state ? this.__s : this.__s = T({}, this.state), typeof e == "function" && (e = e(T({}, r), this.props)), e && T(r, e), e != null && this.__v && (t && this._sb.push(t), ve(this));
|
|
238
|
-
},
|
|
230
|
+
}, O.prototype.forceUpdate = function(e) {
|
|
239
231
|
this.__v && (this.__e = !0, e && this.__h.push(e), ve(this));
|
|
240
|
-
},
|
|
232
|
+
}, O.prototype.render = N, E = [], ze = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, He = function(e, t) {
|
|
241
233
|
return e.__v.__b - t.__v.__b;
|
|
242
|
-
},
|
|
243
|
-
var
|
|
234
|
+
}, X.__r = 0, Ne = /(PointerCapture)$|Capture$/i, ae = 0, re = ye(!1), ne = ye(!0);
|
|
235
|
+
var it = 0;
|
|
244
236
|
function d(e, t, r, n, s, o) {
|
|
245
237
|
t || (t = {});
|
|
246
238
|
var l, c, f = t;
|
|
247
239
|
if ("ref" in f) for (c in f = {}, t) c == "ref" ? l = t[c] : f[c] = t[c];
|
|
248
|
-
var a = { type: e, props: f, key: r, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --
|
|
240
|
+
var a = { type: e, props: f, key: r, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --it, __i: -1, __u: 0, __source: s, __self: o };
|
|
249
241
|
if (typeof e == "function" && (l = e.defaultProps)) for (c in l) f[c] === void 0 && (f[c] = l[c]);
|
|
250
242
|
return w.vnode && w.vnode(a), a;
|
|
251
243
|
}
|
|
252
|
-
const
|
|
244
|
+
const at = {
|
|
253
245
|
// Colors
|
|
254
246
|
primary: "#2563eb",
|
|
255
247
|
// Darker blue for AA contrast with white text (4.5:1)
|
|
@@ -312,56 +304,56 @@ const lt = {
|
|
|
312
304
|
iconColor: "#f1f5f9",
|
|
313
305
|
iconColorSecondary: "#cbd5e1"
|
|
314
306
|
};
|
|
315
|
-
function
|
|
316
|
-
const t = { ...
|
|
307
|
+
function lt(e = {}) {
|
|
308
|
+
const t = { ...at, ...e };
|
|
317
309
|
return Object.entries(t).map(([r, n]) => `${`--twd-${r.replace(/([A-Z])/g, "-$1").toLowerCase()}`}: ${n};`).join(`
|
|
318
310
|
`);
|
|
319
311
|
}
|
|
320
|
-
function
|
|
312
|
+
function ct(e) {
|
|
321
313
|
const t = "twd-theme-variables";
|
|
322
314
|
let r = document.getElementById(t);
|
|
323
315
|
r || (r = document.createElement("style"), r.id = t, document.head.appendChild(r));
|
|
324
|
-
const n =
|
|
316
|
+
const n = lt(e);
|
|
325
317
|
r.textContent = `
|
|
326
318
|
:root {
|
|
327
319
|
${n}
|
|
328
320
|
}
|
|
329
321
|
`;
|
|
330
322
|
}
|
|
331
|
-
const
|
|
323
|
+
const dt = (e) => {
|
|
332
324
|
const { Component: t, createRoot: r, theme: n } = e;
|
|
333
|
-
|
|
325
|
+
ct(n);
|
|
334
326
|
const s = document.createElement("div");
|
|
335
327
|
s.setAttribute("id", "twd-sidebar-root"), document.body.appendChild(s), r(s).render(t);
|
|
336
|
-
},
|
|
328
|
+
}, _t = async (e, t, r, n) => {
|
|
337
329
|
for (const s in e) await e[s]();
|
|
338
|
-
|
|
330
|
+
dt({ Component: t, createRoot: r, theme: n });
|
|
339
331
|
};
|
|
340
|
-
var
|
|
341
|
-
function
|
|
342
|
-
k.__h && k.__h(b, e,
|
|
332
|
+
var z, b, te, be, G = 0, je = [], k = w, ke = k.__b, Se = k.__r, xe = k.diffed, Te = k.__c, Re = k.unmount, $e = k.__;
|
|
333
|
+
function _e(e, t) {
|
|
334
|
+
k.__h && k.__h(b, e, G || t), G = 0;
|
|
343
335
|
var r = b.__H || (b.__H = { __: [], __h: [] });
|
|
344
336
|
return e >= r.__.length && r.__.push({}), r.__[e];
|
|
345
337
|
}
|
|
346
|
-
function
|
|
347
|
-
return
|
|
338
|
+
function U(e) {
|
|
339
|
+
return G = 1, ut(Ve, e);
|
|
348
340
|
}
|
|
349
|
-
function
|
|
350
|
-
var n =
|
|
351
|
-
if (n.t = e, !n.__c && (n.__ = [
|
|
341
|
+
function ut(e, t, r) {
|
|
342
|
+
var n = _e(z++, 2);
|
|
343
|
+
if (n.t = e, !n.__c && (n.__ = [Ve(void 0, t), function(c) {
|
|
352
344
|
var f = n.__N ? n.__N[0] : n.__[0], a = n.t(f, c);
|
|
353
345
|
f !== a && (n.__N = [a, n.__[1]], n.__c.setState({}));
|
|
354
346
|
}], n.__c = b, !b.__f)) {
|
|
355
347
|
var s = function(c, f, a) {
|
|
356
348
|
if (!n.__c.__H) return !0;
|
|
357
|
-
var
|
|
358
|
-
return
|
|
349
|
+
var g = n.__c.__H.__.filter(function(u) {
|
|
350
|
+
return u.__c;
|
|
359
351
|
});
|
|
360
|
-
if (
|
|
352
|
+
if (g.every(function(u) {
|
|
361
353
|
return !u.__N;
|
|
362
354
|
})) return !o || o.call(this, c, f, a);
|
|
363
355
|
var i = n.__c.props !== c;
|
|
364
|
-
return
|
|
356
|
+
return g.some(function(u) {
|
|
365
357
|
if (u.__N) {
|
|
366
358
|
var p = u.__[0];
|
|
367
359
|
u.__ = u.__N, u.__N = void 0, p !== u.__[0] && (i = !0);
|
|
@@ -372,55 +364,58 @@ function pt(e, t, r) {
|
|
|
372
364
|
var o = b.shouldComponentUpdate, l = b.componentWillUpdate;
|
|
373
365
|
b.componentWillUpdate = function(c, f, a) {
|
|
374
366
|
if (this.__e) {
|
|
375
|
-
var
|
|
376
|
-
o = void 0, s(c, f, a), o =
|
|
367
|
+
var g = o;
|
|
368
|
+
o = void 0, s(c, f, a), o = g;
|
|
377
369
|
}
|
|
378
370
|
l && l.call(this, c, f, a);
|
|
379
371
|
}, b.shouldComponentUpdate = s;
|
|
380
372
|
}
|
|
381
373
|
return n.__N || n.__;
|
|
382
374
|
}
|
|
383
|
-
function
|
|
384
|
-
var r =
|
|
385
|
-
!k.__s &&
|
|
375
|
+
function Z(e, t) {
|
|
376
|
+
var r = _e(z++, 3);
|
|
377
|
+
!k.__s && qe(r.__H, t) && (r.__ = e, r.u = t, b.__H.__h.push(r));
|
|
386
378
|
}
|
|
387
|
-
function
|
|
388
|
-
return
|
|
379
|
+
function W(e) {
|
|
380
|
+
return G = 5, j(function() {
|
|
389
381
|
return { current: e };
|
|
390
382
|
}, []);
|
|
391
383
|
}
|
|
392
|
-
function
|
|
393
|
-
var r =
|
|
394
|
-
return
|
|
384
|
+
function j(e, t) {
|
|
385
|
+
var r = _e(z++, 7);
|
|
386
|
+
return qe(r.__H, t) && (r.__ = e(), r.__H = t, r.__h = e), r.__;
|
|
395
387
|
}
|
|
396
|
-
function
|
|
397
|
-
for (var e; e =
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
388
|
+
function pt() {
|
|
389
|
+
for (var e; e = je.shift(); ) {
|
|
390
|
+
var t = e.__H;
|
|
391
|
+
if (e.__P && t) try {
|
|
392
|
+
t.__h.some(q), t.__h.some(se), t.__h = [];
|
|
393
|
+
} catch (r) {
|
|
394
|
+
t.__h = [], k.__e(r, e.__v);
|
|
395
|
+
}
|
|
401
396
|
}
|
|
402
397
|
}
|
|
403
398
|
k.__b = function(e) {
|
|
404
399
|
b = null, ke && ke(e);
|
|
405
400
|
}, k.__ = function(e, t) {
|
|
406
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
401
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), $e && $e(e, t);
|
|
407
402
|
}, k.__r = function(e) {
|
|
408
|
-
Se && Se(e),
|
|
403
|
+
Se && Se(e), z = 0;
|
|
409
404
|
var t = (b = e.__c).__H;
|
|
410
|
-
t && (
|
|
405
|
+
t && (te === b ? (t.__h = [], b.__h = [], t.__.some(function(r) {
|
|
411
406
|
r.__N && (r.__ = r.__N), r.u = r.__N = void 0;
|
|
412
|
-
})) : (t.__h.
|
|
407
|
+
})) : (t.__h.some(q), t.__h.some(se), t.__h = [], z = 0)), te = b;
|
|
413
408
|
}, k.diffed = function(e) {
|
|
414
409
|
xe && xe(e);
|
|
415
410
|
var t = e.__c;
|
|
416
|
-
t && t.__H && (t.__H.__h.length && (
|
|
411
|
+
t && t.__H && (t.__H.__h.length && (je.push(t) !== 1 && be === k.requestAnimationFrame || ((be = k.requestAnimationFrame) || ft)(pt)), t.__H.__.some(function(r) {
|
|
417
412
|
r.u && (r.__H = r.u), r.u = void 0;
|
|
418
|
-
})),
|
|
413
|
+
})), te = b = null;
|
|
419
414
|
}, k.__c = function(e, t) {
|
|
420
415
|
t.some(function(r) {
|
|
421
416
|
try {
|
|
422
|
-
r.__h.
|
|
423
|
-
return !n.__ ||
|
|
417
|
+
r.__h.some(q), r.__h = r.__h.filter(function(n) {
|
|
418
|
+
return !n.__ || se(n);
|
|
424
419
|
});
|
|
425
420
|
} catch (n) {
|
|
426
421
|
t.some(function(s) {
|
|
@@ -429,37 +424,37 @@ k.__b = function(e) {
|
|
|
429
424
|
}
|
|
430
425
|
}), Te && Te(e, t);
|
|
431
426
|
}, k.unmount = function(e) {
|
|
432
|
-
|
|
427
|
+
Re && Re(e);
|
|
433
428
|
var t, r = e.__c;
|
|
434
|
-
r && r.__H && (r.__H.__.
|
|
429
|
+
r && r.__H && (r.__H.__.some(function(n) {
|
|
435
430
|
try {
|
|
436
|
-
|
|
431
|
+
q(n);
|
|
437
432
|
} catch (s) {
|
|
438
433
|
t = s;
|
|
439
434
|
}
|
|
440
435
|
}), r.__H = void 0, t && k.__e(t, r.__v));
|
|
441
436
|
};
|
|
442
|
-
var
|
|
443
|
-
function
|
|
437
|
+
var Ce = typeof requestAnimationFrame == "function";
|
|
438
|
+
function ft(e) {
|
|
444
439
|
var t, r = function() {
|
|
445
|
-
clearTimeout(n),
|
|
440
|
+
clearTimeout(n), Ce && cancelAnimationFrame(t), setTimeout(e);
|
|
446
441
|
}, n = setTimeout(r, 35);
|
|
447
|
-
|
|
442
|
+
Ce && (t = requestAnimationFrame(r));
|
|
448
443
|
}
|
|
449
|
-
function
|
|
444
|
+
function q(e) {
|
|
450
445
|
var t = b, r = e.__c;
|
|
451
446
|
typeof r == "function" && (e.__c = void 0, r()), b = t;
|
|
452
447
|
}
|
|
453
|
-
function
|
|
448
|
+
function se(e) {
|
|
454
449
|
var t = b;
|
|
455
450
|
e.__c = e.__(), b = t;
|
|
456
451
|
}
|
|
457
|
-
function
|
|
452
|
+
function qe(e, t) {
|
|
458
453
|
return !e || e.length !== t.length || t.some(function(r, n) {
|
|
459
454
|
return r !== e[n];
|
|
460
455
|
});
|
|
461
456
|
}
|
|
462
|
-
function
|
|
457
|
+
function Ve(e, t) {
|
|
463
458
|
return typeof t == "function" ? t(e) : t;
|
|
464
459
|
}
|
|
465
460
|
const gt = (e) => {
|
|
@@ -468,9 +463,9 @@ const gt = (e) => {
|
|
|
468
463
|
for (const n of t.values())
|
|
469
464
|
n.parent ? t.get(n.parent)?.childrenNodes?.push(n) : r.push(n);
|
|
470
465
|
return r;
|
|
471
|
-
},
|
|
466
|
+
}, ht = {
|
|
472
467
|
animation: "spin 1s linear infinite"
|
|
473
|
-
},
|
|
468
|
+
}, mt = () => /* @__PURE__ */ d(
|
|
474
469
|
"svg",
|
|
475
470
|
{
|
|
476
471
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -483,18 +478,18 @@ const gt = (e) => {
|
|
|
483
478
|
strokeLinecap: "round",
|
|
484
479
|
strokeLinejoin: "round",
|
|
485
480
|
className: "lucide lucide-loader-circle-icon lucide-loader-circle",
|
|
486
|
-
style:
|
|
481
|
+
style: ht,
|
|
487
482
|
"data-testid": "loader-icon",
|
|
488
483
|
children: /* @__PURE__ */ d("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
489
484
|
}
|
|
490
|
-
),
|
|
491
|
-
|
|
485
|
+
), P = document.createElement("style");
|
|
486
|
+
P && !document.getElementById("loader-spin-keyframes") && (P.id = "loader-spin-keyframes", P.innerHTML = `
|
|
492
487
|
@keyframes spin {
|
|
493
488
|
0% { transform: rotate(0deg); }
|
|
494
489
|
100% { transform: rotate(360deg); }
|
|
495
490
|
}
|
|
496
|
-
`, document.head.appendChild(
|
|
497
|
-
const
|
|
491
|
+
`, document.head.appendChild(P));
|
|
492
|
+
const Q = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
|
|
498
493
|
"svg",
|
|
499
494
|
{
|
|
500
495
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -510,7 +505,7 @@ const ee = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
|
|
|
510
505
|
"data-testid": r,
|
|
511
506
|
children: t
|
|
512
507
|
}
|
|
513
|
-
),
|
|
508
|
+
), vt = () => /* @__PURE__ */ d(Q, { className: "lucide-play-icon lucide-play", dataTestId: "play-icon", children: /* @__PURE__ */ d("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) }), Je = ({ id: e, name: t, skip: r, only: n }) => /* @__PURE__ */ d(N, { children: [
|
|
514
509
|
t,
|
|
515
510
|
" ",
|
|
516
511
|
n && /* @__PURE__ */ d(
|
|
@@ -536,8 +531,8 @@ const ee = ({ className: e, children: t, dataTestId: r }) => /* @__PURE__ */ d(
|
|
|
536
531
|
}
|
|
537
532
|
)
|
|
538
533
|
] });
|
|
539
|
-
var
|
|
540
|
-
const
|
|
534
|
+
var $ = /* @__PURE__ */ ((e) => (e.CHAI_DIFF = "chai-diff", e.CHAI_MESSAGE = "chai-message", e.ERROR = "error", e))($ || {});
|
|
535
|
+
const wt = (e) => {
|
|
541
536
|
try {
|
|
542
537
|
const t = JSON.parse(e);
|
|
543
538
|
if (t && typeof t == "object" && "type" in t)
|
|
@@ -545,7 +540,7 @@ const yt = (e) => {
|
|
|
545
540
|
} catch {
|
|
546
541
|
}
|
|
547
542
|
return null;
|
|
548
|
-
},
|
|
543
|
+
}, Ee = (e) => {
|
|
549
544
|
if (e === null) return "null";
|
|
550
545
|
if (e === void 0) return "undefined";
|
|
551
546
|
if (typeof e == "string") return e;
|
|
@@ -556,9 +551,9 @@ const yt = (e) => {
|
|
|
556
551
|
return String(e);
|
|
557
552
|
}
|
|
558
553
|
return String(e);
|
|
559
|
-
},
|
|
560
|
-
const r =
|
|
561
|
-
if (r?.type ===
|
|
554
|
+
}, yt = (e) => e.startsWith("Assertion passed") || e.startsWith("Event fired") ? { color: "var(--twd-success)", fontWeight: "var(--twd-font-weight-bold)" } : e.startsWith("Test failed") ? { color: "var(--twd-error)", fontWeight: "var(--twd-font-weight-bold)" } : {}, bt = (e) => e.type === "chai-message" || e.type === "error", kt = (e, t) => t && bt(t) ? t.message : e, St = ({ log: e, index: t }) => {
|
|
555
|
+
const r = wt(e);
|
|
556
|
+
if (r?.type === $.CHAI_DIFF)
|
|
562
557
|
return /* @__PURE__ */ d(
|
|
563
558
|
"li",
|
|
564
559
|
{
|
|
@@ -593,7 +588,7 @@ const yt = (e) => {
|
|
|
593
588
|
overflowX: "auto",
|
|
594
589
|
whiteSpace: "pre-wrap",
|
|
595
590
|
wordBreak: "break-word"
|
|
596
|
-
}, children:
|
|
591
|
+
}, children: Ee(r.expected) })
|
|
597
592
|
] }),
|
|
598
593
|
/* @__PURE__ */ d("div", { style: {
|
|
599
594
|
marginTop: "var(--twd-spacing-xs)",
|
|
@@ -614,13 +609,13 @@ const yt = (e) => {
|
|
|
614
609
|
overflowX: "auto",
|
|
615
610
|
whiteSpace: "pre-wrap",
|
|
616
611
|
wordBreak: "break-word"
|
|
617
|
-
}, children:
|
|
612
|
+
}, children: Ee(r.actual) })
|
|
618
613
|
] })
|
|
619
614
|
]
|
|
620
615
|
},
|
|
621
616
|
t
|
|
622
617
|
);
|
|
623
|
-
const n =
|
|
618
|
+
const n = kt(e, r);
|
|
624
619
|
return /* @__PURE__ */ d(
|
|
625
620
|
"li",
|
|
626
621
|
{
|
|
@@ -629,13 +624,13 @@ const yt = (e) => {
|
|
|
629
624
|
padding: "var(--twd-spacing-xs) var(--twd-spacing-sm)",
|
|
630
625
|
borderBottom: "1px solid var(--twd-border-light)",
|
|
631
626
|
color: "var(--twd-text)",
|
|
632
|
-
...
|
|
627
|
+
...yt(n)
|
|
633
628
|
},
|
|
634
629
|
children: n
|
|
635
630
|
},
|
|
636
631
|
t
|
|
637
632
|
);
|
|
638
|
-
},
|
|
633
|
+
}, M = {
|
|
639
634
|
container: {
|
|
640
635
|
marginBottom: "var(--twd-spacing-xs)"
|
|
641
636
|
},
|
|
@@ -676,7 +671,7 @@ const yt = (e) => {
|
|
|
676
671
|
marginTop: "var(--twd-spacing-xs)",
|
|
677
672
|
textAlign: "left"
|
|
678
673
|
}
|
|
679
|
-
},
|
|
674
|
+
}, xt = (e) => {
|
|
680
675
|
switch (e.status) {
|
|
681
676
|
case "pass":
|
|
682
677
|
return {
|
|
@@ -715,22 +710,22 @@ const yt = (e) => {
|
|
|
715
710
|
}
|
|
716
711
|
};
|
|
717
712
|
}
|
|
718
|
-
},
|
|
713
|
+
}, Tt = ({
|
|
719
714
|
node: e,
|
|
720
715
|
depth: t,
|
|
721
716
|
id: r,
|
|
722
717
|
runTest: n
|
|
723
718
|
}) => {
|
|
724
|
-
const s =
|
|
719
|
+
const s = W(null), o = W(e.status), l = W(e.logs?.length || 0), c = j(() => xt(e), [e.status]), f = typeof window < "u" && sessionStorage.getItem("twd-last-run-test-name") === e.name, a = j(
|
|
725
720
|
() => ({
|
|
726
|
-
...
|
|
721
|
+
...M.container,
|
|
727
722
|
marginLeft: `calc(${t} * var(--twd-spacing-sm))`,
|
|
728
723
|
...c.container || {}
|
|
729
724
|
}),
|
|
730
725
|
[t, c]
|
|
731
|
-
),
|
|
726
|
+
), g = j(
|
|
732
727
|
() => ({
|
|
733
|
-
...
|
|
728
|
+
...M.item,
|
|
734
729
|
...c.item,
|
|
735
730
|
...f && {
|
|
736
731
|
border: "1px dashed var(--twd-border)"
|
|
@@ -738,7 +733,7 @@ const yt = (e) => {
|
|
|
738
733
|
}),
|
|
739
734
|
[c, f]
|
|
740
735
|
);
|
|
741
|
-
|
|
736
|
+
Z(() => {
|
|
742
737
|
const u = s.current;
|
|
743
738
|
if (!u || !e.logs || e.logs.length === 0) return;
|
|
744
739
|
const p = o.current === "running" && (e.status === "pass" || e.status === "fail"), _ = e.logs.length > l.current;
|
|
@@ -769,9 +764,9 @@ const yt = (e) => {
|
|
|
769
764
|
role: "listitem",
|
|
770
765
|
"aria-label": `Test ${e.name}, status: ${i()}`,
|
|
771
766
|
children: [
|
|
772
|
-
/* @__PURE__ */ d("div", { style:
|
|
773
|
-
/* @__PURE__ */ d("span", { style:
|
|
774
|
-
|
|
767
|
+
/* @__PURE__ */ d("div", { style: g, children: [
|
|
768
|
+
/* @__PURE__ */ d("span", { style: M.nameSpan, children: /* @__PURE__ */ d(
|
|
769
|
+
Je,
|
|
775
770
|
{
|
|
776
771
|
id: r,
|
|
777
772
|
name: e.name,
|
|
@@ -784,30 +779,30 @@ const yt = (e) => {
|
|
|
784
779
|
{
|
|
785
780
|
onClick: () => n(r),
|
|
786
781
|
"aria-label": `Run ${e.name} test`,
|
|
787
|
-
style:
|
|
782
|
+
style: M.button,
|
|
788
783
|
disabled: e.status === "running",
|
|
789
784
|
"data-testid": `run-test-button-${r}`,
|
|
790
|
-
children: e.status === "running" ? /* @__PURE__ */ d(
|
|
785
|
+
children: e.status === "running" ? /* @__PURE__ */ d(mt, {}) : /* @__PURE__ */ d(vt, {})
|
|
791
786
|
}
|
|
792
787
|
)
|
|
793
788
|
] }),
|
|
794
|
-
e.logs && e.logs.length > 0 && /* @__PURE__ */ d("ul", { ref: s, style:
|
|
789
|
+
e.logs && e.logs.length > 0 && /* @__PURE__ */ d("ul", { ref: s, style: M.logsList, children: e.logs.map((u, p) => /* @__PURE__ */ d(St, { log: u, index: p }, p)) })
|
|
795
790
|
]
|
|
796
791
|
},
|
|
797
792
|
e.name
|
|
798
793
|
);
|
|
799
|
-
}, Rt = () => /* @__PURE__ */ d(
|
|
800
|
-
const [r, n] =
|
|
801
|
-
|
|
794
|
+
}, Rt = () => /* @__PURE__ */ d(Q, { className: "lucide-chevron-down-icon lucide-chevron-down", dataTestId: "chevron-down-icon", children: /* @__PURE__ */ d("path", { d: "m6 9 6 6 6-6" }) }), $t = () => /* @__PURE__ */ d(Q, { className: "lucide-chevron-right-icon lucide-chevron-right", dataTestId: "chevron-right-icon", children: /* @__PURE__ */ d("path", { d: "m9 18 6-6-6-6" }) }), Ct = ({ tests: e, runTest: t }) => {
|
|
795
|
+
const [r, n] = U({}), s = W(null), o = W(!1), l = (a) => n((g) => ({ ...g, [a]: !g[a] }));
|
|
796
|
+
Z(() => {
|
|
802
797
|
if (o.current) return;
|
|
803
798
|
const a = sessionStorage.getItem("twd-last-run-test-name");
|
|
804
799
|
if (!a) return;
|
|
805
|
-
const
|
|
800
|
+
const g = setTimeout(() => {
|
|
806
801
|
const i = document.querySelector(`[data-test-name="${a}"]`);
|
|
807
802
|
if (i) {
|
|
808
803
|
const u = s.current?.closest('[data-testid="twd-sidebar"]');
|
|
809
804
|
if (u) {
|
|
810
|
-
const p = i.getBoundingClientRect(), _ = u.getBoundingClientRect(),
|
|
805
|
+
const p = i.getBoundingClientRect(), _ = u.getBoundingClientRect(), h = u.scrollTop, v = p.top - _.top + h;
|
|
811
806
|
u.scrollTo({
|
|
812
807
|
top: v - 150,
|
|
813
808
|
// 150px offset from top
|
|
@@ -817,22 +812,22 @@ const yt = (e) => {
|
|
|
817
812
|
o.current = !0;
|
|
818
813
|
}
|
|
819
814
|
}, 100);
|
|
820
|
-
return () => clearTimeout(
|
|
815
|
+
return () => clearTimeout(g);
|
|
821
816
|
}, []);
|
|
822
|
-
const c = (a,
|
|
817
|
+
const c = (a, g = 0) => {
|
|
823
818
|
if (a.type === "test")
|
|
824
819
|
return /* @__PURE__ */ d(
|
|
825
|
-
|
|
820
|
+
Tt,
|
|
826
821
|
{
|
|
827
822
|
node: a,
|
|
828
|
-
depth:
|
|
823
|
+
depth: g,
|
|
829
824
|
id: a.id,
|
|
830
825
|
runTest: () => t(a.id)
|
|
831
826
|
},
|
|
832
827
|
a.id
|
|
833
828
|
);
|
|
834
829
|
const i = r[a.id];
|
|
835
|
-
return /* @__PURE__ */ d("li", { style: { marginLeft: `calc(${
|
|
830
|
+
return /* @__PURE__ */ d("li", { style: { marginLeft: `calc(${g} * var(--twd-spacing-lg))` }, children: [
|
|
836
831
|
/* @__PURE__ */ d(
|
|
837
832
|
"div",
|
|
838
833
|
{
|
|
@@ -865,14 +860,14 @@ const yt = (e) => {
|
|
|
865
860
|
"aria-label": `${i ? "Expand" : "Collapse"} test suite ${a.name}`,
|
|
866
861
|
onClick: () => l(a.id),
|
|
867
862
|
children: [
|
|
868
|
-
/* @__PURE__ */ d(
|
|
863
|
+
/* @__PURE__ */ d(Je, { id: a.id, name: a.name, skip: a.skip, only: a.only }),
|
|
869
864
|
i ? /* @__PURE__ */ d($t, {}) : /* @__PURE__ */ d(Rt, {})
|
|
870
865
|
]
|
|
871
866
|
}
|
|
872
867
|
)
|
|
873
868
|
}
|
|
874
869
|
),
|
|
875
|
-
!i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ d("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: a.childrenNodes.map((u) => c(u,
|
|
870
|
+
!i && a.childrenNodes && a.childrenNodes.length > 0 && /* @__PURE__ */ d("ul", { style: { listStyle: "none", padding: 0, margin: 0 }, children: a.childrenNodes.map((u) => c(u, g + 1)) })
|
|
876
871
|
] }, a.id);
|
|
877
872
|
}, f = gt(e);
|
|
878
873
|
return /* @__PURE__ */ d(
|
|
@@ -885,7 +880,7 @@ const yt = (e) => {
|
|
|
885
880
|
children: f.map((a) => c(a))
|
|
886
881
|
}
|
|
887
882
|
);
|
|
888
|
-
},
|
|
883
|
+
}, Et = {
|
|
889
884
|
left: {
|
|
890
885
|
left: 0,
|
|
891
886
|
borderTopRightRadius: "var(--twd-border-radius-lg)",
|
|
@@ -913,19 +908,19 @@ const yt = (e) => {
|
|
|
913
908
|
padding: "var(--twd-spacing-sm) 10px",
|
|
914
909
|
cursor: "pointer",
|
|
915
910
|
fontSize: "var(--twd-font-size-sm)",
|
|
916
|
-
...
|
|
911
|
+
...Et[t]
|
|
917
912
|
},
|
|
918
913
|
onClick: () => e(!0),
|
|
919
914
|
children: "TWD"
|
|
920
915
|
}
|
|
921
|
-
),
|
|
922
|
-
|
|
916
|
+
), At = ({ isOpen: e, position: t }) => {
|
|
917
|
+
Z(() => {
|
|
923
918
|
const r = document.documentElement, n = getComputedStyle(document.documentElement).getPropertyValue("--twd-sidebar-width") || "280px";
|
|
924
919
|
return e ? t === "left" ? r.style.marginLeft = n : r.style.marginRight = n : (r.style.marginRight = "0", r.style.marginLeft = "0"), () => {
|
|
925
920
|
r.style.marginRight = "0", r.style.marginLeft = "0";
|
|
926
921
|
};
|
|
927
922
|
}, [e, t]);
|
|
928
|
-
},
|
|
923
|
+
}, Lt = () => typeof window < "u" ? (window.__TWD_STATE__ || (window.__TWD_STATE__ = {
|
|
929
924
|
handlers: /* @__PURE__ */ new Map(),
|
|
930
925
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
931
926
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
@@ -935,16 +930,16 @@ const yt = (e) => {
|
|
|
935
930
|
beforeEachHooks: /* @__PURE__ */ new Map(),
|
|
936
931
|
afterEachHooks: /* @__PURE__ */ new Map(),
|
|
937
932
|
stack: []
|
|
938
|
-
},
|
|
933
|
+
}, ue = Lt(), S = ue.handlers, Ie = ue.beforeEachHooks, Ae = ue.afterEachHooks, Mt = (e) => {
|
|
939
934
|
const t = [], r = [];
|
|
940
935
|
let n = e;
|
|
941
936
|
for (; n; )
|
|
942
|
-
|
|
937
|
+
Ie.has(n) && t.unshift(...Ie.get(n)), Ae.has(n) && r.push(...Ae.get(n)), n = S.get(n)?.parent;
|
|
943
938
|
return { before: t, after: r };
|
|
944
|
-
},
|
|
939
|
+
}, ie = (e) => {
|
|
945
940
|
const t = S.get(e);
|
|
946
|
-
return t ? t.only ? !0 : t.children ? t.children.some((r) =>
|
|
947
|
-
},
|
|
941
|
+
return t ? t.only ? !0 : t.children ? t.children.some((r) => ie(r)) : !1 : !1;
|
|
942
|
+
}, Wt = (e) => {
|
|
948
943
|
let t = S.get(e);
|
|
949
944
|
for (; t?.parent; ) {
|
|
950
945
|
const r = S.get(t.parent);
|
|
@@ -961,9 +956,9 @@ const yt = (e) => {
|
|
|
961
956
|
}
|
|
962
957
|
return !1;
|
|
963
958
|
};
|
|
964
|
-
class
|
|
959
|
+
class Xe {
|
|
965
960
|
constructor(t) {
|
|
966
|
-
|
|
961
|
+
he(this, "events");
|
|
967
962
|
this.events = t;
|
|
968
963
|
}
|
|
969
964
|
async runAll() {
|
|
@@ -980,11 +975,11 @@ class Ge {
|
|
|
980
975
|
await this.runTest(r, !1);
|
|
981
976
|
}
|
|
982
977
|
async runSuite(t, r) {
|
|
983
|
-
if (Le(t.id) && !
|
|
978
|
+
if (Le(t.id) && !ie(t.id)) {
|
|
984
979
|
this.events.onSkip?.(t);
|
|
985
980
|
return;
|
|
986
981
|
}
|
|
987
|
-
if (r && !
|
|
982
|
+
if (r && !ie(t.id)) return;
|
|
988
983
|
this.events.onSuiteStart?.(t);
|
|
989
984
|
const s = (t.children || []).map((o) => S.get(o));
|
|
990
985
|
for (const o of s)
|
|
@@ -996,13 +991,13 @@ class Ge {
|
|
|
996
991
|
this.events.onSkip(t);
|
|
997
992
|
return;
|
|
998
993
|
}
|
|
999
|
-
const s =
|
|
994
|
+
const s = Wt(t.id);
|
|
1000
995
|
if (r && !t.only && !s) {
|
|
1001
996
|
this.events.onSkip(t);
|
|
1002
997
|
return;
|
|
1003
998
|
}
|
|
1004
999
|
this.events.onStart?.(t);
|
|
1005
|
-
const o =
|
|
1000
|
+
const o = Mt(t.parent);
|
|
1006
1001
|
try {
|
|
1007
1002
|
for (const l of o.before) await l();
|
|
1008
1003
|
t.logs = [], await t.handler(), this.events.onPass(t);
|
|
@@ -1013,16 +1008,16 @@ class Ge {
|
|
|
1013
1008
|
}
|
|
1014
1009
|
}
|
|
1015
1010
|
}
|
|
1016
|
-
window.__testRunner =
|
|
1017
|
-
const
|
|
1011
|
+
window.__testRunner = Xe;
|
|
1012
|
+
const pe = "1.6.0", zt = () => typeof window < "u" ? (window.__TWD_MOCK_STATE__ || (window.__TWD_MOCK_STATE__ = {
|
|
1018
1013
|
rules: [],
|
|
1019
1014
|
counts: {}
|
|
1020
1015
|
}), window.__TWD_MOCK_STATE__) : {
|
|
1021
1016
|
rules: [],
|
|
1022
1017
|
counts: {}
|
|
1023
|
-
},
|
|
1018
|
+
}, H = zt(), fe = H.rules;
|
|
1024
1019
|
let Me = !1;
|
|
1025
|
-
const
|
|
1020
|
+
const Ht = async (e) => {
|
|
1026
1021
|
if (Me) {
|
|
1027
1022
|
console.warn("[TWD] Request mocking already initialized");
|
|
1028
1023
|
return;
|
|
@@ -1030,29 +1025,29 @@ const Nt = async (e) => {
|
|
|
1030
1025
|
if ("serviceWorker" in navigator) {
|
|
1031
1026
|
Me = !0;
|
|
1032
1027
|
const t = e ?? "/mock-sw.js";
|
|
1033
|
-
await navigator.serviceWorker.register(`${t}?v=${
|
|
1028
|
+
await navigator.serviceWorker.register(`${t}?v=${pe}`), navigator.serviceWorker.controller || await new Promise((r) => {
|
|
1034
1029
|
navigator.serviceWorker.addEventListener("controllerchange", r, { once: !0 });
|
|
1035
1030
|
}), navigator.serviceWorker.addEventListener("message", (r) => {
|
|
1036
1031
|
if (r.data?.type === "EXECUTED") {
|
|
1037
1032
|
const { alias: n, request: s, hitCount: o } = r.data, l = fe.find((c) => c.alias === n);
|
|
1038
|
-
l && (l.executed = !0, l.request = s, l.hitCount = o),
|
|
1033
|
+
l && (l.executed = !0, l.request = s, l.hitCount = o), H.counts[n] = o ?? (H.counts[n] ?? 0) + 1;
|
|
1039
1034
|
}
|
|
1040
1035
|
});
|
|
1041
1036
|
}
|
|
1042
|
-
},
|
|
1037
|
+
}, Nt = () => fe, Bt = () => {
|
|
1043
1038
|
navigator.serviceWorker.controller?.postMessage({
|
|
1044
1039
|
type: "CLEAR_RULES",
|
|
1045
|
-
version:
|
|
1040
|
+
version: pe
|
|
1046
1041
|
}), fe.length = 0;
|
|
1047
|
-
for (const e in
|
|
1048
|
-
delete
|
|
1049
|
-
},
|
|
1042
|
+
for (const e in H.counts)
|
|
1043
|
+
delete H.counts[e];
|
|
1044
|
+
}, Dt = () => /* @__PURE__ */ d(Q, { className: "lucide-wifi-pen-icon lucide-wifi-pen", dataTestId: "wifi-pen-icon", children: [
|
|
1050
1045
|
/* @__PURE__ */ d("path", { d: "M2 8.82a15 15 0 0 1 20 0" }),
|
|
1051
1046
|
/* @__PURE__ */ d("path", { d: "M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z" }),
|
|
1052
1047
|
/* @__PURE__ */ d("path", { d: "M5 12.859a10 10 0 0 1 10.5-2.222" }),
|
|
1053
1048
|
/* @__PURE__ */ d("path", { d: "M8.5 16.429a5 5 0 0 1 3-1.406" })
|
|
1054
|
-
] }),
|
|
1055
|
-
const e =
|
|
1049
|
+
] }), Pt = () => {
|
|
1050
|
+
const e = Nt(), t = e.filter((n) => n.executed);
|
|
1056
1051
|
return /* @__PURE__ */ d(
|
|
1057
1052
|
"button",
|
|
1058
1053
|
{
|
|
@@ -1078,7 +1073,7 @@ const Nt = async (e) => {
|
|
|
1078
1073
|
boxShadow: "var(--twd-shadow-sm)"
|
|
1079
1074
|
},
|
|
1080
1075
|
children: [
|
|
1081
|
-
/* @__PURE__ */ d(
|
|
1076
|
+
/* @__PURE__ */ d(Dt, {}),
|
|
1082
1077
|
/* @__PURE__ */ d("span", { style: { flex: 1 }, children: [
|
|
1083
1078
|
"Rules: ",
|
|
1084
1079
|
t.length,
|
|
@@ -1094,11 +1089,11 @@ const Nt = async (e) => {
|
|
|
1094
1089
|
]
|
|
1095
1090
|
}
|
|
1096
1091
|
);
|
|
1097
|
-
},
|
|
1098
|
-
function
|
|
1099
|
-
|
|
1092
|
+
}, Ft = /* @__PURE__ */ new Map();
|
|
1093
|
+
function Ot() {
|
|
1094
|
+
Ft.clear();
|
|
1100
1095
|
}
|
|
1101
|
-
const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e,
|
|
1096
|
+
const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ge = (e) => e.actual !== void 0 && e.expected !== void 0 ? {
|
|
1102
1097
|
type: "diff",
|
|
1103
1098
|
actual: e.actual,
|
|
1104
1099
|
expected: e.expected,
|
|
@@ -1106,14 +1101,14 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1106
1101
|
} : {
|
|
1107
1102
|
type: "message",
|
|
1108
1103
|
message: e.message
|
|
1109
|
-
},
|
|
1110
|
-
const t =
|
|
1104
|
+
}, jt = (e) => {
|
|
1105
|
+
const t = Ge(e);
|
|
1111
1106
|
if (t.type === "diff") {
|
|
1112
1107
|
const r = t.operator || "unknown";
|
|
1113
1108
|
console.error(`Assertion failed with operator: ${r}`), console.group("Expected:"), console.log(t.expected), console.groupEnd(), console.group("Actual:"), console.log(t.actual), console.groupEnd();
|
|
1114
1109
|
} else
|
|
1115
1110
|
console.error(t.message);
|
|
1116
|
-
},
|
|
1111
|
+
}, qt = (e) => {
|
|
1117
1112
|
if (e.status === "pass")
|
|
1118
1113
|
return `Test "${e.name}" passed.`;
|
|
1119
1114
|
if (e.status === "fail") {
|
|
@@ -1122,67 +1117,67 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1122
1117
|
const t = e.logs[e.logs.length - 1];
|
|
1123
1118
|
try {
|
|
1124
1119
|
const r = JSON.parse(t);
|
|
1125
|
-
return r.type ===
|
|
1120
|
+
return r.type === $.CHAI_MESSAGE || r.type === $.ERROR ? `Test "${e.name}" failed. ${r.message}` : r.type === $.CHAI_DIFF ? `Test "${e.name}" failed. Expected value does not match actual value.` : `Test "${e.name}" failed.`;
|
|
1126
1121
|
} catch {
|
|
1127
1122
|
return `Test "${e.name}" failed. ${t}`;
|
|
1128
1123
|
}
|
|
1129
1124
|
} else if (e.status === "skip")
|
|
1130
1125
|
return `Test "${e.name}" skipped.`;
|
|
1131
1126
|
return "";
|
|
1132
|
-
},
|
|
1127
|
+
}, Vt = (e) => {
|
|
1133
1128
|
const t = e.filter((l) => l.type === "test"), r = t.filter((l) => l.status === "pass").length, n = t.filter((l) => l.status === "fail").length, s = t.filter((l) => l.status === "skip").length, o = [];
|
|
1134
1129
|
return n > 0 ? (o.push("Test run completed."), o.push(`${r} test${r !== 1 ? "s" : ""} passed`), o.push(`${n} test${n !== 1 ? "s" : ""} failed`), s > 0 && o.push(`${s} test${s !== 1 ? "s" : ""} skipped`), o.join(", ") + ".") : (o.push("All tests passed."), o.push(`${r} test${r !== 1 ? "s" : ""} completed`), s > 0 && o.push(`${s} test${s !== 1 ? "s" : ""} skipped`), o.join(", ") + ".");
|
|
1135
|
-
},
|
|
1130
|
+
}, Jt = {
|
|
1136
1131
|
left: { left: 0, borderRight: "1px solid var(--twd-border)" },
|
|
1137
1132
|
right: { right: 0, borderLeft: "1px solid var(--twd-border)" }
|
|
1138
|
-
},
|
|
1139
|
-
const [r, n] =
|
|
1140
|
-
|
|
1141
|
-
const [l, c] =
|
|
1142
|
-
|
|
1143
|
-
const _ = () => n((
|
|
1133
|
+
}, Xt = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Gt = (e) => sessionStorage.getItem("twd-sidebar-open") ? sessionStorage.getItem("twd-sidebar-open") === "true" : e, Yt = ({ open: e, position: t = "left" }) => {
|
|
1134
|
+
const [r, n] = U(0), [s, o] = U(Gt(e));
|
|
1135
|
+
At({ isOpen: s, position: t });
|
|
1136
|
+
const [l, c] = U("");
|
|
1137
|
+
Z(() => {
|
|
1138
|
+
const _ = () => n((h) => h + 1);
|
|
1144
1139
|
return window.addEventListener("twd:state-change", _), () => window.removeEventListener("twd:state-change", _);
|
|
1145
1140
|
}, []);
|
|
1146
|
-
const f = new
|
|
1141
|
+
const f = new Xe({
|
|
1147
1142
|
onStart: (_) => {
|
|
1148
|
-
_.status = "running", n((
|
|
1143
|
+
_.status = "running", n((h) => h + 1);
|
|
1149
1144
|
},
|
|
1150
1145
|
onPass: (_) => {
|
|
1151
|
-
_.status = "pass", n((
|
|
1146
|
+
_.status = "pass", n((h) => h + 1);
|
|
1152
1147
|
},
|
|
1153
|
-
onFail: (_,
|
|
1154
|
-
if (_.status = "fail", console.group(`%c❌ Test failed: ${_.name}`, "color: red; font-weight: bold;"), Ut(
|
|
1155
|
-
|
|
1156
|
-
const v =
|
|
1148
|
+
onFail: (_, h) => {
|
|
1149
|
+
if (_.status = "fail", console.group(`%c❌ Test failed: ${_.name}`, "color: red; font-weight: bold;"), Ut(h)) {
|
|
1150
|
+
jt(h);
|
|
1151
|
+
const v = Ge(h);
|
|
1157
1152
|
v.type === "diff" ? _.logs.push(JSON.stringify({
|
|
1158
|
-
type:
|
|
1153
|
+
type: $.CHAI_DIFF,
|
|
1159
1154
|
expected: v.expected,
|
|
1160
1155
|
actual: v.actual
|
|
1161
1156
|
})) : _.logs.push(JSON.stringify({
|
|
1162
|
-
type:
|
|
1157
|
+
type: $.CHAI_MESSAGE,
|
|
1163
1158
|
message: `Test failed: ${v.message}`
|
|
1164
1159
|
}));
|
|
1165
1160
|
} else
|
|
1166
|
-
console.error(
|
|
1167
|
-
type:
|
|
1168
|
-
message: `Test failed: ${
|
|
1161
|
+
console.error(h.message), _.logs.push(JSON.stringify({
|
|
1162
|
+
type: $.ERROR,
|
|
1163
|
+
message: `Test failed: ${h.message}`
|
|
1169
1164
|
}));
|
|
1170
1165
|
console.groupEnd(), n((v) => v + 1);
|
|
1171
1166
|
},
|
|
1172
1167
|
onSkip: (_) => {
|
|
1173
|
-
_.status = "skip", n((
|
|
1168
|
+
_.status = "skip", n((h) => h + 1);
|
|
1174
1169
|
}
|
|
1175
1170
|
}), a = (_) => {
|
|
1176
1171
|
o(_), sessionStorage.setItem("twd-sidebar-open", _.toString());
|
|
1177
|
-
},
|
|
1172
|
+
}, g = async () => {
|
|
1178
1173
|
c(""), sessionStorage.removeItem("twd-last-run-test-name"), await f.runAll();
|
|
1179
|
-
const _ =
|
|
1174
|
+
const _ = Vt(u);
|
|
1180
1175
|
c(_);
|
|
1181
1176
|
}, i = async (_) => {
|
|
1182
|
-
const
|
|
1183
|
-
if (!
|
|
1184
|
-
c(""), sessionStorage.setItem("twd-last-run-test-name",
|
|
1185
|
-
const v =
|
|
1177
|
+
const h = Array.from(S.values()).filter((m) => m.type === "test").find((m) => m.id === _);
|
|
1178
|
+
if (!h) return;
|
|
1179
|
+
c(""), sessionStorage.setItem("twd-last-run-test-name", h.name), await f.runSingle(h.id);
|
|
1180
|
+
const v = qt(h);
|
|
1186
1181
|
c(v);
|
|
1187
1182
|
}, u = Array.from(S.values());
|
|
1188
1183
|
if (!s)
|
|
@@ -1192,7 +1187,7 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1192
1187
|
"div",
|
|
1193
1188
|
{
|
|
1194
1189
|
style: {
|
|
1195
|
-
fontFamily:
|
|
1190
|
+
fontFamily: Xt,
|
|
1196
1191
|
position: "fixed",
|
|
1197
1192
|
top: 0,
|
|
1198
1193
|
bottom: 0,
|
|
@@ -1205,7 +1200,7 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1205
1200
|
zIndex: "var(--twd-z-index-sidebar)",
|
|
1206
1201
|
pointerEvents: "all",
|
|
1207
1202
|
isolation: "isolate",
|
|
1208
|
-
...
|
|
1203
|
+
...Jt[t]
|
|
1209
1204
|
},
|
|
1210
1205
|
"data-testid": "twd-sidebar",
|
|
1211
1206
|
role: "complementary",
|
|
@@ -1230,7 +1225,7 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1230
1225
|
/* @__PURE__ */ d(
|
|
1231
1226
|
"button",
|
|
1232
1227
|
{
|
|
1233
|
-
onClick:
|
|
1228
|
+
onClick: g,
|
|
1234
1229
|
style: {
|
|
1235
1230
|
background: "var(--twd-button-primary)",
|
|
1236
1231
|
color: "var(--twd-button-primary-text)",
|
|
@@ -1246,7 +1241,7 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1246
1241
|
"button",
|
|
1247
1242
|
{
|
|
1248
1243
|
onClick: () => {
|
|
1249
|
-
|
|
1244
|
+
Bt(), Ot();
|
|
1250
1245
|
},
|
|
1251
1246
|
"aria-label": "Clear all mocks",
|
|
1252
1247
|
style: {
|
|
@@ -1259,7 +1254,15 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1259
1254
|
},
|
|
1260
1255
|
children: "Clear mocks"
|
|
1261
1256
|
}
|
|
1262
|
-
)
|
|
1257
|
+
),
|
|
1258
|
+
/* @__PURE__ */ d("span", { style: {
|
|
1259
|
+
color: "var(--twd-text-secondary)",
|
|
1260
|
+
fontSize: "var(--twd-font-size-sm)",
|
|
1261
|
+
alignSelf: "center"
|
|
1262
|
+
}, children: [
|
|
1263
|
+
"v",
|
|
1264
|
+
pe
|
|
1265
|
+
] })
|
|
1263
1266
|
] }),
|
|
1264
1267
|
/* @__PURE__ */ d(
|
|
1265
1268
|
"button",
|
|
@@ -1301,7 +1304,7 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1301
1304
|
] })
|
|
1302
1305
|
] })
|
|
1303
1306
|
] }),
|
|
1304
|
-
/* @__PURE__ */ d(
|
|
1307
|
+
/* @__PURE__ */ d(Pt, {})
|
|
1305
1308
|
] }),
|
|
1306
1309
|
/* @__PURE__ */ d("div", { style: { padding: "var(--twd-spacing-md)" }, children: /* @__PURE__ */ d(
|
|
1307
1310
|
Ct,
|
|
@@ -1323,18 +1326,18 @@ const Ut = (e) => e instanceof Error && "actual" in e && "expected" in e, Ke = (
|
|
|
1323
1326
|
]
|
|
1324
1327
|
}
|
|
1325
1328
|
);
|
|
1326
|
-
},
|
|
1329
|
+
}, Kt = (e) => ({
|
|
1327
1330
|
render: (t) => {
|
|
1328
|
-
|
|
1331
|
+
st(t, e);
|
|
1329
1332
|
}
|
|
1330
|
-
}),
|
|
1333
|
+
}), Qt = (e, t) => {
|
|
1331
1334
|
const { open: r = !0, position: n = "left", serviceWorker: s = !0, serviceWorkerUrl: o = "/mock-sw.js", theme: l } = t || {};
|
|
1332
|
-
|
|
1335
|
+
_t(e, /* @__PURE__ */ d(Yt, { open: r, position: n }), Kt, l), s && Ht(o).then(() => {
|
|
1333
1336
|
console.log("Request mocking initialized");
|
|
1334
1337
|
}).catch((c) => {
|
|
1335
1338
|
console.error("Error initializing request mocking:", c);
|
|
1336
1339
|
});
|
|
1337
1340
|
};
|
|
1338
1341
|
export {
|
|
1339
|
-
|
|
1342
|
+
Qt as initTWD
|
|
1340
1343
|
};
|