twd-js 1.2.2 → 1.3.0-beta.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.d.ts +9 -0
- package/dist/bundled.es.js +46257 -0
- package/dist/bundled.umd.js +311 -0
- package/dist/index.cjs.js +25 -25
- package/dist/index.d.ts +6 -2
- package/dist/index.es.js +638 -623
- package/dist/jsx-runtime-CjngqUuo.js +6 -0
- package/dist/{jsx-runtime-CtyxV31n.mjs → jsx-runtime-DqUUEvWR.mjs} +125 -127
- package/dist/mock-sw.js +2 -2
- package/dist/runner-ci.cjs.js +1 -1
- package/dist/runner-ci.es.js +22 -33
- package/dist/runner.cjs.js +1 -1
- package/dist/runner.es.js +43 -33
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/package.json +14 -9
- package/dist/_commonjsHelpers-C6fGbg64.mjs +0 -6
- package/dist/_commonjsHelpers-DwGv2jUC.js +0 -1
- package/dist/jsx-runtime-DN5DOl8k.js +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const ee=require("react"),P=new Map,re=(a,l)=>{P.set(a,l)};function te(){P.clear()}const ne=a=>P.get(a);var b={exports:{}},E={};var $;function oe(){if($)return E;$=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(f,s,u){var m=null;if(u!==void 0&&(m=""+u),s.key!==void 0&&(m=""+s.key),"key"in s){u={};for(var d in s)d!=="key"&&(u[d]=s[d])}else u=s;return s=u.ref,{$$typeof:a,type:f,key:m,ref:s!==void 0?s:null,props:u}}return E.Fragment=l,E.jsx=i,E.jsxs=i,E}var _={};var F;function ae(){return F||(F=1,process.env.NODE_ENV!=="production"&&(function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case q:return"Profiler";case U:return"StrictMode";case G:return"Suspense";case X:return"SuspenseList";case H:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case W:return"Portal";case V:return e.displayName||"Context";case J:return(e._context.displayName||"Context")+".Consumer";case z:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case T:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function l(e){return""+e}function i(e){try{l(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),l(e)}}function f(e){if(e===v)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===T)return"<...>";try{var r=a(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=k.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function m(e){if(j.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function d(e,r){function t(){h||(h=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function D(){var e=a(this.type);return C[e]||(C[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function L(e,r,t,n,p,A){var o=t.ref;return e={$$typeof:y,type:e,key:r,props:t,_owner:n},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:D}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:p}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,r,t,n,p,A){var o=r.children;if(o!==void 0)if(n)if(Q(o)){for(n=0;n<o.length;n++)g(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(o);if(j.call(r,"key")){o=a(e);var c=Object.keys(r).filter(function(K){return K!=="key"});n=0<c.length?"{key: someKey, "+c.join(": ..., ")+": ...}":"{key: someKey}",M[o+n]||(c=0<c.length?"{"+c.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
|
+
let props = %s;
|
|
3
|
+
<%s {...props} />
|
|
4
|
+
React keys must be passed directly to JSX without using spread:
|
|
5
|
+
let props = %s;
|
|
6
|
+
<%s key={someKey} {...props} />`,n,o,c,o),M[o+n]=!0)}if(o=null,t!==void 0&&(i(t),o=""+t),m(r)&&(i(r.key),o=""+r.key),"key"in r){t={};for(var S in r)S!=="key"&&(t[S]=r[S])}else t=r;return o&&d(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),L(e,o,t,s(),p,A)}function g(e){x(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===T&&(e._payload.status==="fulfilled"?x(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function x(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}var R=ee,y=Symbol.for("react.transitional.element"),W=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),V=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),Z=Symbol.for("react.client.reference"),k=R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=Object.prototype.hasOwnProperty,Q=Array.isArray,O=console.createTask?console.createTask:function(){return null};R={react_stack_bottom_frame:function(e){return e()}};var h,C={},N=R.react_stack_bottom_frame.bind(R,u)(),Y=O(f(u)),M={};_.Fragment=v,_.jsx=function(e,r,t){var n=1e4>k.recentlyCreatedOwnerStacks++;return w(e,r,t,!1,n?Error("react-stack-top-frame"):N,n?O(f(e)):Y)},_.jsxs=function(e,r,t){var n=1e4>k.recentlyCreatedOwnerStacks++;return w(e,r,t,!0,n?Error("react-stack-top-frame"):N,n?O(f(e)):Y)}})()),_}var I;function se(){return I||(I=1,process.env.NODE_ENV==="production"?b.exports=oe():b.exports=ae()),b.exports}var ue=se();exports.clearComponentMocks=te;exports.getMockForComponent=ne;exports.jsxRuntimeExports=ue;exports.mockComponent=re;
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import ee from "react";
|
|
2
|
+
const P = /* @__PURE__ */ new Map(), oe = (o, l) => {
|
|
3
|
+
P.set(o, l);
|
|
4
4
|
};
|
|
5
|
-
function
|
|
6
|
-
|
|
5
|
+
function se() {
|
|
6
|
+
P.clear();
|
|
7
7
|
}
|
|
8
|
-
const ue = (
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
var
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
for (var
|
|
20
|
-
|
|
21
|
-
} else
|
|
22
|
-
return s =
|
|
23
|
-
$$typeof:
|
|
24
|
-
type:
|
|
25
|
-
key:
|
|
8
|
+
const ue = (o) => P.get(o);
|
|
9
|
+
var b = { exports: {} }, _ = {};
|
|
10
|
+
var F;
|
|
11
|
+
function re() {
|
|
12
|
+
if (F) return _;
|
|
13
|
+
F = 1;
|
|
14
|
+
var o = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
|
|
15
|
+
function i(f, s, u) {
|
|
16
|
+
var m = null;
|
|
17
|
+
if (u !== void 0 && (m = "" + u), s.key !== void 0 && (m = "" + s.key), "key" in s) {
|
|
18
|
+
u = {};
|
|
19
|
+
for (var d in s)
|
|
20
|
+
d !== "key" && (u[d] = s[d]);
|
|
21
|
+
} else u = s;
|
|
22
|
+
return s = u.ref, {
|
|
23
|
+
$$typeof: o,
|
|
24
|
+
type: f,
|
|
25
|
+
key: m,
|
|
26
26
|
ref: s !== void 0 ? s : null,
|
|
27
|
-
props:
|
|
27
|
+
props: u
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return _.Fragment = l, _.jsx = i, _.jsxs = i, _;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
33
|
-
var
|
|
34
|
-
function
|
|
35
|
-
return
|
|
36
|
-
function
|
|
32
|
+
var E = {};
|
|
33
|
+
var I;
|
|
34
|
+
function te() {
|
|
35
|
+
return I || (I = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
36
|
+
function o(e) {
|
|
37
37
|
if (e == null) return null;
|
|
38
38
|
if (typeof e == "function")
|
|
39
|
-
return e.$$typeof ===
|
|
39
|
+
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
40
40
|
if (typeof e == "string") return e;
|
|
41
41
|
switch (e) {
|
|
42
|
-
case
|
|
42
|
+
case v:
|
|
43
43
|
return "Fragment";
|
|
44
|
-
case J:
|
|
45
|
-
return "Profiler";
|
|
46
44
|
case q:
|
|
45
|
+
return "Profiler";
|
|
46
|
+
case U:
|
|
47
47
|
return "StrictMode";
|
|
48
|
-
case
|
|
48
|
+
case G:
|
|
49
49
|
return "Suspense";
|
|
50
|
-
case
|
|
50
|
+
case X:
|
|
51
51
|
return "SuspenseList";
|
|
52
|
-
case
|
|
52
|
+
case H:
|
|
53
53
|
return "Activity";
|
|
54
54
|
}
|
|
55
55
|
if (typeof e == "object")
|
|
56
56
|
switch (typeof e.tag == "number" && console.error(
|
|
57
57
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
58
58
|
), e.$$typeof) {
|
|
59
|
-
case
|
|
59
|
+
case W:
|
|
60
60
|
return "Portal";
|
|
61
61
|
case V:
|
|
62
|
-
return
|
|
63
|
-
case
|
|
62
|
+
return e.displayName || "Context";
|
|
63
|
+
case J:
|
|
64
64
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
65
|
-
case
|
|
65
|
+
case z:
|
|
66
66
|
var r = e.render;
|
|
67
67
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
68
|
-
case
|
|
69
|
-
return r = e.displayName || null, r !== null ? r :
|
|
70
|
-
case
|
|
68
|
+
case B:
|
|
69
|
+
return r = e.displayName || null, r !== null ? r : o(e.type) || "Memo";
|
|
70
|
+
case T:
|
|
71
71
|
r = e._payload, e = e._init;
|
|
72
72
|
try {
|
|
73
|
-
return
|
|
73
|
+
return o(e(r));
|
|
74
74
|
} catch {
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
return null;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function l(e) {
|
|
80
80
|
return "" + e;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function i(e) {
|
|
83
83
|
try {
|
|
84
|
-
|
|
84
|
+
l(e);
|
|
85
85
|
var r = !1;
|
|
86
86
|
} catch {
|
|
87
87
|
r = !0;
|
|
@@ -93,15 +93,15 @@ function ne() {
|
|
|
93
93
|
r,
|
|
94
94
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
95
95
|
n
|
|
96
|
-
),
|
|
96
|
+
), l(e);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
if (e ===
|
|
101
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
99
|
+
function f(e) {
|
|
100
|
+
if (e === v) return "<>";
|
|
101
|
+
if (typeof e == "object" && e !== null && e.$$typeof === T)
|
|
102
102
|
return "<...>";
|
|
103
103
|
try {
|
|
104
|
-
var r =
|
|
104
|
+
var r = o(e);
|
|
105
105
|
return r ? "<" + r + ">" : "<...>";
|
|
106
106
|
} catch {
|
|
107
107
|
return "<...>";
|
|
@@ -111,19 +111,19 @@ function ne() {
|
|
|
111
111
|
var e = k.A;
|
|
112
112
|
return e === null ? null : e.getOwner();
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function u() {
|
|
115
115
|
return Error("react-stack-top-frame");
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
if (
|
|
117
|
+
function m(e) {
|
|
118
|
+
if (x.call(e, "key")) {
|
|
119
119
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
120
120
|
if (r && r.isReactWarning) return !1;
|
|
121
121
|
}
|
|
122
122
|
return e.key !== void 0;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function d(e, r) {
|
|
125
125
|
function t() {
|
|
126
|
-
|
|
126
|
+
h || (h = !0, console.error(
|
|
127
127
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
128
128
|
r
|
|
129
129
|
));
|
|
@@ -133,22 +133,23 @@ function ne() {
|
|
|
133
133
|
configurable: !0
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
var e =
|
|
138
|
-
return
|
|
136
|
+
function D() {
|
|
137
|
+
var e = o(this.type);
|
|
138
|
+
return N[e] || (N[e] = !0, console.error(
|
|
139
139
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
140
140
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
function L(e, r, t, n, p, A) {
|
|
143
|
+
var a = t.ref;
|
|
144
|
+
return e = {
|
|
145
|
+
$$typeof: j,
|
|
145
146
|
type: e,
|
|
146
147
|
key: r,
|
|
147
|
-
props:
|
|
148
|
-
_owner:
|
|
149
|
-
}, (
|
|
148
|
+
props: t,
|
|
149
|
+
_owner: n
|
|
150
|
+
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
|
|
150
151
|
enumerable: !1,
|
|
151
|
-
get:
|
|
152
|
+
get: D
|
|
152
153
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
153
154
|
configurable: !1,
|
|
154
155
|
enumerable: !1,
|
|
@@ -163,33 +164,33 @@ function ne() {
|
|
|
163
164
|
configurable: !1,
|
|
164
165
|
enumerable: !1,
|
|
165
166
|
writable: !0,
|
|
166
|
-
value:
|
|
167
|
+
value: p
|
|
167
168
|
}), Object.defineProperty(e, "_debugTask", {
|
|
168
169
|
configurable: !1,
|
|
169
170
|
enumerable: !1,
|
|
170
171
|
writable: !0,
|
|
171
|
-
value:
|
|
172
|
+
value: A
|
|
172
173
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
if (
|
|
175
|
+
function w(e, r, t, n, p, A) {
|
|
176
|
+
var a = r.children;
|
|
177
|
+
if (a !== void 0)
|
|
177
178
|
if (n)
|
|
178
|
-
if (
|
|
179
|
-
for (n = 0; n <
|
|
180
|
-
|
|
181
|
-
Object.freeze && Object.freeze(
|
|
179
|
+
if (Q(a)) {
|
|
180
|
+
for (n = 0; n < a.length; n++)
|
|
181
|
+
g(a[n]);
|
|
182
|
+
Object.freeze && Object.freeze(a);
|
|
182
183
|
} else
|
|
183
184
|
console.error(
|
|
184
185
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
185
186
|
);
|
|
186
|
-
else
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
var
|
|
190
|
-
return
|
|
187
|
+
else g(a);
|
|
188
|
+
if (x.call(r, "key")) {
|
|
189
|
+
a = o(e);
|
|
190
|
+
var c = Object.keys(r).filter(function(K) {
|
|
191
|
+
return K !== "key";
|
|
191
192
|
});
|
|
192
|
-
n = 0 <
|
|
193
|
+
n = 0 < c.length ? "{key: someKey, " + c.join(": ..., ") + ": ...}" : "{key: someKey}", $[a + n] || (c = 0 < c.length ? "{" + c.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
193
194
|
`A props object containing a "key" prop is being spread into JSX:
|
|
194
195
|
let props = %s;
|
|
195
196
|
<%s {...props} />
|
|
@@ -197,80 +198,77 @@ React keys must be passed directly to JSX without using spread:
|
|
|
197
198
|
let props = %s;
|
|
198
199
|
<%s key={someKey} {...props} />`,
|
|
199
200
|
n,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
),
|
|
201
|
+
a,
|
|
202
|
+
c,
|
|
203
|
+
a
|
|
204
|
+
), $[a + n] = !0);
|
|
204
205
|
}
|
|
205
|
-
if (
|
|
206
|
+
if (a = null, t !== void 0 && (i(t), a = "" + t), m(r) && (i(r.key), a = "" + r.key), "key" in r) {
|
|
206
207
|
t = {};
|
|
207
|
-
for (var
|
|
208
|
-
|
|
208
|
+
for (var S in r)
|
|
209
|
+
S !== "key" && (t[S] = r[S]);
|
|
209
210
|
} else t = r;
|
|
210
|
-
return
|
|
211
|
+
return a && d(
|
|
211
212
|
t,
|
|
212
213
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
213
|
-
),
|
|
214
|
+
), L(
|
|
214
215
|
e,
|
|
215
|
-
|
|
216
|
-
u,
|
|
217
|
-
l,
|
|
218
|
-
s(),
|
|
216
|
+
a,
|
|
219
217
|
t,
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
s(),
|
|
219
|
+
p,
|
|
220
|
+
A
|
|
222
221
|
);
|
|
223
222
|
}
|
|
224
|
-
function
|
|
225
|
-
typeof e == "object" && e !== null && e.$$typeof ===
|
|
223
|
+
function g(e) {
|
|
224
|
+
y(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === T && (e._payload.status === "fulfilled" ? y(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
225
|
+
}
|
|
226
|
+
function y(e) {
|
|
227
|
+
return typeof e == "object" && e !== null && e.$$typeof === j;
|
|
226
228
|
}
|
|
227
|
-
var
|
|
229
|
+
var R = ee, j = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), V = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), k = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, Q = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
228
230
|
return null;
|
|
229
231
|
};
|
|
230
|
-
|
|
232
|
+
R = {
|
|
231
233
|
react_stack_bottom_frame: function(e) {
|
|
232
234
|
return e();
|
|
233
235
|
}
|
|
234
236
|
};
|
|
235
|
-
var
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
)(),
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
return
|
|
237
|
+
var h, N = {}, C = R.react_stack_bottom_frame.bind(
|
|
238
|
+
R,
|
|
239
|
+
u
|
|
240
|
+
)(), Y = O(f(u)), $ = {};
|
|
241
|
+
E.Fragment = v, E.jsx = function(e, r, t) {
|
|
242
|
+
var n = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
243
|
+
return w(
|
|
242
244
|
e,
|
|
243
245
|
r,
|
|
244
246
|
t,
|
|
245
247
|
!1,
|
|
246
|
-
n,
|
|
247
|
-
|
|
248
|
-
u ? Error("react-stack-top-frame") : Y,
|
|
249
|
-
u ? O(d(e)) : F
|
|
248
|
+
n ? Error("react-stack-top-frame") : C,
|
|
249
|
+
n ? O(f(e)) : Y
|
|
250
250
|
);
|
|
251
|
-
},
|
|
252
|
-
var
|
|
253
|
-
return
|
|
251
|
+
}, E.jsxs = function(e, r, t) {
|
|
252
|
+
var n = 1e4 > k.recentlyCreatedOwnerStacks++;
|
|
253
|
+
return w(
|
|
254
254
|
e,
|
|
255
255
|
r,
|
|
256
256
|
t,
|
|
257
257
|
!0,
|
|
258
|
-
n,
|
|
259
|
-
|
|
260
|
-
u ? Error("react-stack-top-frame") : Y,
|
|
261
|
-
u ? O(d(e)) : F
|
|
258
|
+
n ? Error("react-stack-top-frame") : C,
|
|
259
|
+
n ? O(f(e)) : Y
|
|
262
260
|
);
|
|
263
261
|
};
|
|
264
|
-
})()),
|
|
262
|
+
})()), E;
|
|
265
263
|
}
|
|
266
|
-
var
|
|
267
|
-
function
|
|
268
|
-
return
|
|
264
|
+
var M;
|
|
265
|
+
function ne() {
|
|
266
|
+
return M || (M = 1, process.env.NODE_ENV === "production" ? b.exports = re() : b.exports = te()), b.exports;
|
|
269
267
|
}
|
|
270
|
-
var le =
|
|
268
|
+
var le = ne();
|
|
271
269
|
export {
|
|
272
|
-
|
|
270
|
+
se as c,
|
|
273
271
|
ue as g,
|
|
274
272
|
le as j,
|
|
275
|
-
|
|
273
|
+
oe as m
|
|
276
274
|
};
|
package/dist/mock-sw.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const h=e=>{try{return new RegExp(e),!0}catch{return!1}},u=e=>{const s=e.split("?")[0];return/\.([a-zA-Z0-9]+)$/.test(s)};function f(e,s,n){return n.find(t=>{const o=t.method.toLowerCase()===e.toLowerCase();if(t.urlRegex&&h(t.url)){const
|
|
1
|
+
const h=e=>{try{return new RegExp(e),!0}catch{return!1}},u=e=>{const s=e.split("?")[0];return/\.([a-zA-Z0-9]+)$/.test(s)};function f(e,s,n){return n.find(t=>{const o=t.method.toLowerCase()===e.toLowerCase();if(t.urlRegex&&h(t.url)){const r=new RegExp(t.url);return o&&r.test(s)}if(u(t.url))return o&&s.includes(t.url);const l=t.url===s||s.includes(t.url);return o&&l&&!u(s)})}function p(e,s,n){e.forEach(t=>t.postMessage({type:"EXECUTED",alias:s.alias,request:n}))}const y=(e,s,n)=>{const o=![204,205,304].includes(s),i=o?JSON.stringify(e):null;return new Response(i,{status:s,headers:o?n||{"Content-Type":"application/json"}:n||{}})},c="1.3.0-beta.0";let a=[];const g=async e=>{const{method:s}=e.request,n=e.request.url,t=f(s,n,a);t&&(console.log("[TWD] Mock hit:",t.alias,s,n),e.respondWith((async()=>{let o=null;const i=e.request.headers.get("content-type")||"application/json";if(i.includes("application/json"))try{o=await e.request.clone().json()}catch{}else if(i.includes("form"))try{const l=await e.request.clone().formData();o={},l.forEach((r,d)=>{o[d]=r})}catch{}else if(i.includes("text"))try{o=await e.request.clone().text()}catch{}else if(i.includes("octet-stream"))try{o=await e.request.clone().arrayBuffer()}catch{}else if(i.includes("image"))try{o=await e.request.clone().blob()}catch{}else try{o=await e.request.clone().text()}catch{}return self.clients.matchAll().then(l=>{p(l,t,o)}),y(t.response,t.status??200,t.responseHeaders)})()))},m=e=>{e!==c&&console.warn(`[TWD] ⚠️ Version mismatch detected:
|
|
2
2
|
Client version: ${e}
|
|
3
3
|
Service Worker version: ${c}
|
|
4
4
|
|
|
@@ -8,4 +8,4 @@ Please unregister the Service Worker and reload the page to ensure compatibility
|
|
|
8
8
|
To reinstall:
|
|
9
9
|
npx twd-js init public --save
|
|
10
10
|
|
|
11
|
-
Docs: https://brikev.github.io/twd/api-mocking.html#_1-install-mock-service-worker`)},w=e=>{const{type:s,rule:n,version:t}=e.data||{};m(t),s==="ADD_RULE"&&(
|
|
11
|
+
Docs: https://brikev.github.io/twd/api-mocking.html#_1-install-mock-service-worker`)},w=e=>{const{type:s,rule:n,version:t}=e.data||{};m(t),s==="ADD_RULE"&&(a=a.filter(o=>o.alias!==n.alias),a.push(n),console.log("[TWD] Rule added:",n)),s==="CLEAR_RULES"&&(a=[],console.log("[TWD] All rules cleared"))};self.addEventListener("install",()=>{self.skipWaiting()});self.addEventListener("activate",e=>{e.waitUntil(self.clients.claim())});console.log(`[TWD] Mock Service Worker loaded - version ${c}`);self.addEventListener("fetch",g);self.addEventListener("message",w);
|
package/dist/runner-ci.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i="\x1B[0m",x="\x1B[32m",$="\x1B[31m",y="\x1B[33m",E=(e,t)=>{const f=[...e].filter(s=>!s.parent),o=(s,n=0)=>{const c=" ".repeat(n),u=t.find(l=>l.id===s.id);let r="",a="";s.type!=="suite"&&(u?.status==="pass"?r=`${x}✓${i}`:u?.status==="fail"?(r=`${$}✗${i}`,a=` - Error: ${u.error}`):r=`${y}○${i}`);const d=s.type==="suite"?`${c}${s.name}`:`${c}${r} ${s.name}`;if(console.log(d),a&&console.log(`${$}${c}${a}${i}`),s.children)for(const l of s.children){const p=e.find(m=>m.id===l);p&&o(p,n+1)}};for(const s of f)o(s)},R=async()=>{const e=window.__testRunner,t=[],o=await new e({onStart:()=>{},onPass:s=>{t.push({id:s.id,status:"pass"})},onFail:(s,n)=>{t.push({id:s.id,status:"fail",error:n.message})},onSkip:s=>{t.push({id:s.id,status:"skip"})}}).runAll();return{handlers:Array.from(o.values()),testStatus:t}};exports.executeTests=R;exports.reportResults=E;
|
package/dist/runner-ci.es.js
CHANGED
|
@@ -1,44 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var y = /* @__PURE__ */ w();
|
|
12
|
-
const a = /* @__PURE__ */ B(y), m = (r, t) => {
|
|
13
|
-
const p = [...r].filter((e) => !e.parent), o = (e, s = 0) => {
|
|
14
|
-
const g = " ".repeat(s), l = t.find((u) => u.id === e.id);
|
|
15
|
-
let i = "", c = "";
|
|
16
|
-
e.type !== "suite" && (l?.status === "pass" ? i = a.green("✓") : l?.status === "fail" ? (i = a.red("✗"), c = ` - Error: ${l.error}`) : i = a.yellow("○"));
|
|
17
|
-
const d = e.type === "suite" ? `${g}${e.name}` : `${g}${i} ${e.name}`;
|
|
18
|
-
if (console.log(d), c && console.log(a.red(`${g}${c}`)), e.children)
|
|
19
|
-
for (const u of e.children) {
|
|
20
|
-
const b = r.find((f) => f.id === u);
|
|
21
|
-
b && o(b, s + 1);
|
|
1
|
+
const i = "\x1B[0m", x = "\x1B[32m", p = "\x1B[31m", E = "\x1B[33m", R = (o, t) => {
|
|
2
|
+
const f = [...o].filter((s) => !s.parent), n = (s, e = 0) => {
|
|
3
|
+
const c = " ".repeat(e), a = t.find((l) => l.id === s.id);
|
|
4
|
+
let r = "", u = "";
|
|
5
|
+
s.type !== "suite" && (a?.status === "pass" ? r = `${x}✓${i}` : a?.status === "fail" ? (r = `${p}✗${i}`, u = ` - Error: ${a.error}`) : r = `${E}○${i}`);
|
|
6
|
+
const d = s.type === "suite" ? `${c}${s.name}` : `${c}${r} ${s.name}`;
|
|
7
|
+
if (console.log(d), u && console.log(`${p}${c}${u}${i}`), s.children)
|
|
8
|
+
for (const l of s.children) {
|
|
9
|
+
const $ = o.find((m) => m.id === l);
|
|
10
|
+
$ && n($, e + 1);
|
|
22
11
|
}
|
|
23
12
|
};
|
|
24
|
-
for (const
|
|
25
|
-
},
|
|
26
|
-
const
|
|
13
|
+
for (const s of f) n(s);
|
|
14
|
+
}, y = async () => {
|
|
15
|
+
const o = window.__testRunner, t = [], n = await new o({
|
|
27
16
|
onStart: () => {
|
|
28
17
|
},
|
|
29
|
-
onPass: (
|
|
30
|
-
t.push({ id:
|
|
18
|
+
onPass: (s) => {
|
|
19
|
+
t.push({ id: s.id, status: "pass" });
|
|
31
20
|
},
|
|
32
|
-
onFail: (
|
|
33
|
-
t.push({ id:
|
|
21
|
+
onFail: (s, e) => {
|
|
22
|
+
t.push({ id: s.id, status: "fail", error: e.message });
|
|
34
23
|
},
|
|
35
|
-
onSkip: (
|
|
36
|
-
t.push({ id:
|
|
24
|
+
onSkip: (s) => {
|
|
25
|
+
t.push({ id: s.id, status: "skip" });
|
|
37
26
|
}
|
|
38
27
|
}).runAll();
|
|
39
|
-
return { handlers: Array.from(
|
|
28
|
+
return { handlers: Array.from(n.values()), testStatus: t };
|
|
40
29
|
};
|
|
41
30
|
export {
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
y as executeTests,
|
|
32
|
+
R as reportResults
|
|
44
33
|
};
|
package/dist/runner.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=()=>typeof window<"u"?(window.__TWD_STATE__||(window.__TWD_STATE__={handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]}),window.__TWD_STATE__):{handlers:new Map,beforeEachHooks:new Map,afterEachHooks:new Map,stack:[]},u=w(),s=u.handlers,c=u.beforeEachHooks,h=u.afterEachHooks,o=u.stack,l=()=>Math.random().toString(36).substr(2,9),d=(r,e)=>{const t=l(),n=o.at(-1);s.set(t,{id:t,name:r,type:"suite",children:[],logs:[],depth:o.length,parent:n,handler:e}),n&&s.get(n).children.push(t),o.push(t),e(),o.pop()};d.only=(r,e)=>{const t=l(),n=o.at(-1);s.set(t,{id:t,name:r,type:"suite",children:[],logs:[],depth:o.length,parent:n,handler:e,only:!0}),n&&s.get(n).children.push(t),o.push(t),e(),o.pop()};d.skip=(r,e)=>{const t=l(),n=o.at(-1);s.set(t,{id:t,name:r,type:"suite",children:[],logs:[],depth:o.length,parent:n,handler:e,skip:!0}),n&&s.get(n).children.push(t),o.push(t),e(),o.pop()};const g=(r,e)=>{const t=l(),n=o.at(-1),i={id:t,name:r,type:"test",depth:o.length,handler:e,logs:[],parent:n};n&&s.get(n).children.push(t),s.set(t,i)};g.only=(r,e)=>{const t=l(),n=o.at(-1),i={id:t,name:r,type:"test",depth:o.length,handler:e,logs:[],parent:n,only:!0};n&&s.get(n).children.push(t),s.set(t,i)};g.skip=(r,e)=>{const t=l(),n=o.at(-1),i={id:t,name:r,type:"test",depth:o.length,handler:e||(()=>{}),logs:[],parent:n,skip:!0};n&&s.get(n).children.push(t),s.set(t,i)};const S=r=>{const e=o.at(-1);if(!e)throw new Error("beforeEach() must be inside a describe()");c.has(e)||c.set(e,[]),c.get(e).push(r)},b=r=>{const e=o.at(-1);if(!e)throw new Error("afterEach() must be inside a describe()");h.has(e)||h.set(e,[]),h.get(e).push(r)},E=r=>{const e=[],t=[];let n=r;for(;n;)c.has(n)&&e.unshift(...c.get(n)),h.has(n)&&t.push(...h.get(n)),n=s.get(n)?.parent;return{before:e,after:t}},f=r=>{const e=s.get(r);return e?e.only?!0:e.children?e.children.some(t=>f(t)):!1:!1},T=r=>{let e=s.get(r);for(;e?.parent;){const t=s.get(e.parent);if(t?.only)return!0;e=t}return!1},y=r=>{let e=s.get(r);for(;e;){if(e.skip)return!0;if(!e.parent)break;e=s.get(e.parent)}return!1},_=()=>{s.clear(),c.clear(),h.clear()};class k{events;constructor(e){this.events=e}async runAll(){const e=Array.from(s.values()).filter(n=>!n.parent&&n.type==="suite"),t=Array.from(s.values()).some(n=>n.only);for(const n of e)await this.runSuite(n,t);return s}async runSingle(e){const t=s.get(e);if(!t||t.type!=="test")return;await this.runTest(t,!1)}async runSuite(e,t){if(y(e.id)&&!f(e.id)){this.events.onSkip?.(e);return}if(t&&!f(e.id))return;this.events.onSuiteStart?.(e);const i=(e.children||[]).map(a=>s.get(a));for(const a of i)a.type==="suite"?await this.runSuite(a,t):a.type==="test"&&await this.runTest(a,t);this.events.onSuiteEnd?.(e)}async runTest(e,t){if((y(e.id)||e.skip)&&!e.only){this.events.onSkip(e);return}const i=T(e.id);if(t&&!e.only&&!i){this.events.onSkip(e);return}this.events.onStart?.(e);const a=E(e.parent);try{for(const p of a.before)await p();e.logs=[],await e.handler(),this.events.onPass(e)}catch(p){this.events.onFail(e,p)}finally{for(const p of a.after)await p()}}}window.__testRunner=k;exports.TestRunner=k;exports.afterEach=b;exports.beforeEach=S;exports.clearTests=_;exports.describe=d;exports.handlers=s;exports.it=g;
|