@tracktor/shared-module 0.0.1
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/CHANGELOG.md +4 -0
- package/README.md +69 -0
- package/api/index.d.ts +1 -0
- package/auth/index.d.ts +1 -0
- package/context/index.d.ts +1 -0
- package/dist/InjectDependenciesProvider-c64526b4.js +654 -0
- package/dist/InjectDependenciesProvider-cdf994b6.cjs +27 -0
- package/dist/RequireAuth-03e1e3fb.js +24 -0
- package/dist/RequireAuth-edc931f8.cjs +1 -0
- package/dist/api/hooks/useResponseError.d.ts +19 -0
- package/dist/api/main.d.ts +2 -0
- package/dist/api/types/error.d.ts +14 -0
- package/dist/api.cjs +1 -0
- package/dist/api.js +6 -0
- package/dist/auth/components/RequireAuth.d.ts +22 -0
- package/dist/auth/main.d.ts +2 -0
- package/dist/auth.cjs +1 -0
- package/dist/auth.js +6 -0
- package/dist/context/InjectDependenciesProvider.d.ts +37 -0
- package/dist/context/main.d.ts +2 -0
- package/dist/context.cjs +1 -0
- package/dist/context.js +6 -0
- package/dist/main.cjs +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.js +10 -0
- package/dist/useResponseError-401ec650.js +15 -0
- package/dist/useResponseError-e4d8f886.cjs +1 -0
- package/package.json +69 -0
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# shared-module
|
|
2
|
+
|
|
3
|
+
> This package contains shared components and utilities for the Tracktor project.
|
|
4
|
+
> This package don't use any external dependencies.
|
|
5
|
+
> Note: This package is not intended to be used outside the Tracktor project.
|
|
6
|
+
|
|
7
|
+
- [Installation](#Installation)
|
|
8
|
+
- [Usage](#Usage)
|
|
9
|
+
- [Inject dependencies with provider](#Inject-dependencies-with-provider)
|
|
10
|
+
- [Package](#Package)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```console
|
|
16
|
+
yarn add @tracktor-private/shared-module
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```typescript jsx
|
|
22
|
+
import { RequireAuth } from "@tracktor-private/shared-module";
|
|
23
|
+
```
|
|
24
|
+
Or you can import only the package do you
|
|
25
|
+
need with `@tracktor-private/shared-module/{package}` like this:
|
|
26
|
+
|
|
27
|
+
```typescript jsx
|
|
28
|
+
import { RequireAuth } from "@tracktor-private/shared-module/auth";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Inject dependencies with provider
|
|
32
|
+
|
|
33
|
+
On this exemple below, dependencies are injected with the
|
|
34
|
+
provider `InjectDependenciesProvider` for the component `RequireAuth`:
|
|
35
|
+
|
|
36
|
+
```typescript jsx
|
|
37
|
+
import { RequireAuth } from "@tracktor-private/shared-module/auth"
|
|
38
|
+
import { InjectDependenciesProvider } from "@tracktor-private/shared-module/context";
|
|
39
|
+
import { Navigate, Outlet, Route, RouterProvider, useLocation } from "react-router-dom";
|
|
40
|
+
import { t } from "i18next";
|
|
41
|
+
|
|
42
|
+
const MyComponent = () => (
|
|
43
|
+
<InjectDependenciesProvider t={t} Navigate={Navigate}>
|
|
44
|
+
<RequireAuth />
|
|
45
|
+
</InjectDependenciesProvider>
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
const App = () => (
|
|
49
|
+
<InjectDependenciesProvider
|
|
50
|
+
t={t}
|
|
51
|
+
useAuth={useAuth}
|
|
52
|
+
useLocation={useLocation}
|
|
53
|
+
Outlet={Outlet}
|
|
54
|
+
Navigate={Navigate}
|
|
55
|
+
>
|
|
56
|
+
<MyComponent/>
|
|
57
|
+
</InjectDependenciesProvider>
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
export default App;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Package
|
|
64
|
+
|
|
65
|
+
| Package | Description |
|
|
66
|
+
|---------|----------------------------------------------------------------------------------------------------------|
|
|
67
|
+
| api | This package contains the api to communicate with the backend. |
|
|
68
|
+
| auth | This package contains the component `RequireAuth` that can be used to protect routes. |
|
|
69
|
+
| context | This package contains the provider `InjectDependenciesProvider` that can be used to inject dependencies. |
|
package/api/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/api/main";
|
package/auth/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/auth/main";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../dist/context/main";
|
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
import Ce, { createContext as ir, useMemo as ur } from "react";
|
|
2
|
+
var H = {}, sr = {
|
|
3
|
+
get exports() {
|
|
4
|
+
return H;
|
|
5
|
+
},
|
|
6
|
+
set exports(g) {
|
|
7
|
+
H = g;
|
|
8
|
+
}
|
|
9
|
+
}, A = {};
|
|
10
|
+
/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|
|
19
|
+
var Re;
|
|
20
|
+
function fr() {
|
|
21
|
+
if (Re)
|
|
22
|
+
return A;
|
|
23
|
+
Re = 1;
|
|
24
|
+
var g = Ce, m = Symbol.for("react.element"), S = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, y = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
25
|
+
function T(C, l, w) {
|
|
26
|
+
var d, b = {}, O = null, $ = null;
|
|
27
|
+
w !== void 0 && (O = "" + w), l.key !== void 0 && (O = "" + l.key), l.ref !== void 0 && ($ = l.ref);
|
|
28
|
+
for (d in l)
|
|
29
|
+
E.call(l, d) && !R.hasOwnProperty(d) && (b[d] = l[d]);
|
|
30
|
+
if (C && C.defaultProps)
|
|
31
|
+
for (d in l = C.defaultProps, l)
|
|
32
|
+
b[d] === void 0 && (b[d] = l[d]);
|
|
33
|
+
return { $$typeof: m, type: C, key: O, ref: $, props: b, _owner: y.current };
|
|
34
|
+
}
|
|
35
|
+
return A.Fragment = S, A.jsx = T, A.jsxs = T, A;
|
|
36
|
+
}
|
|
37
|
+
var I = {};
|
|
38
|
+
/**
|
|
39
|
+
* @license React
|
|
40
|
+
* react-jsx-runtime.development.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/
|
|
47
|
+
var Te;
|
|
48
|
+
function lr() {
|
|
49
|
+
return Te || (Te = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
|
+
var g = Ce, m = Symbol.for("react.element"), S = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), C = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), $ = Symbol.for("react.offscreen"), X = Symbol.iterator, Oe = "@@iterator";
|
|
51
|
+
function Pe(e) {
|
|
52
|
+
if (e === null || typeof e != "object")
|
|
53
|
+
return null;
|
|
54
|
+
var r = X && e[X] || e[Oe];
|
|
55
|
+
return typeof r == "function" ? r : null;
|
|
56
|
+
}
|
|
57
|
+
var x = g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
58
|
+
function c(e) {
|
|
59
|
+
{
|
|
60
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
61
|
+
t[n - 1] = arguments[n];
|
|
62
|
+
Se("error", e, t);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function Se(e, r, t) {
|
|
66
|
+
{
|
|
67
|
+
var n = x.ReactDebugCurrentFrame, i = n.getStackAddendum();
|
|
68
|
+
i !== "" && (r += "%s", t = t.concat([i]));
|
|
69
|
+
var u = t.map(function(o) {
|
|
70
|
+
return String(o);
|
|
71
|
+
});
|
|
72
|
+
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
var we = !1, xe = !1, je = !1, ke = !1, De = !1, Z;
|
|
76
|
+
Z = Symbol.for("react.module.reference");
|
|
77
|
+
function Fe(e) {
|
|
78
|
+
return !!(typeof e == "string" || typeof e == "function" || e === E || e === R || De || e === y || e === w || e === d || ke || e === $ || we || xe || je || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === b || e.$$typeof === T || e.$$typeof === C || e.$$typeof === l || // This needs to include all possible module reference object
|
|
79
|
+
// types supported by any Flight configuration anywhere since
|
|
80
|
+
// we don't know which Flight build this will end up being used
|
|
81
|
+
// with.
|
|
82
|
+
e.$$typeof === Z || e.getModuleId !== void 0));
|
|
83
|
+
}
|
|
84
|
+
function Ae(e, r, t) {
|
|
85
|
+
var n = e.displayName;
|
|
86
|
+
if (n)
|
|
87
|
+
return n;
|
|
88
|
+
var i = r.displayName || r.name || "";
|
|
89
|
+
return i !== "" ? t + "(" + i + ")" : t;
|
|
90
|
+
}
|
|
91
|
+
function Q(e) {
|
|
92
|
+
return e.displayName || "Context";
|
|
93
|
+
}
|
|
94
|
+
function h(e) {
|
|
95
|
+
if (e == null)
|
|
96
|
+
return null;
|
|
97
|
+
if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
98
|
+
return e.displayName || e.name || null;
|
|
99
|
+
if (typeof e == "string")
|
|
100
|
+
return e;
|
|
101
|
+
switch (e) {
|
|
102
|
+
case E:
|
|
103
|
+
return "Fragment";
|
|
104
|
+
case S:
|
|
105
|
+
return "Portal";
|
|
106
|
+
case R:
|
|
107
|
+
return "Profiler";
|
|
108
|
+
case y:
|
|
109
|
+
return "StrictMode";
|
|
110
|
+
case w:
|
|
111
|
+
return "Suspense";
|
|
112
|
+
case d:
|
|
113
|
+
return "SuspenseList";
|
|
114
|
+
}
|
|
115
|
+
if (typeof e == "object")
|
|
116
|
+
switch (e.$$typeof) {
|
|
117
|
+
case C:
|
|
118
|
+
var r = e;
|
|
119
|
+
return Q(r) + ".Consumer";
|
|
120
|
+
case T:
|
|
121
|
+
var t = e;
|
|
122
|
+
return Q(t._context) + ".Provider";
|
|
123
|
+
case l:
|
|
124
|
+
return Ae(e, e.render, "ForwardRef");
|
|
125
|
+
case b:
|
|
126
|
+
var n = e.displayName || null;
|
|
127
|
+
return n !== null ? n : h(e.type) || "Memo";
|
|
128
|
+
case O: {
|
|
129
|
+
var i = e, u = i._payload, o = i._init;
|
|
130
|
+
try {
|
|
131
|
+
return h(o(u));
|
|
132
|
+
} catch {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
var P = Object.assign, D = 0, ee, re, te, ne, ae, oe, ie;
|
|
140
|
+
function ue() {
|
|
141
|
+
}
|
|
142
|
+
ue.__reactDisabledLog = !0;
|
|
143
|
+
function Ie() {
|
|
144
|
+
{
|
|
145
|
+
if (D === 0) {
|
|
146
|
+
ee = console.log, re = console.info, te = console.warn, ne = console.error, ae = console.group, oe = console.groupCollapsed, ie = console.groupEnd;
|
|
147
|
+
var e = {
|
|
148
|
+
configurable: !0,
|
|
149
|
+
enumerable: !0,
|
|
150
|
+
value: ue,
|
|
151
|
+
writable: !0
|
|
152
|
+
};
|
|
153
|
+
Object.defineProperties(console, {
|
|
154
|
+
info: e,
|
|
155
|
+
log: e,
|
|
156
|
+
warn: e,
|
|
157
|
+
error: e,
|
|
158
|
+
group: e,
|
|
159
|
+
groupCollapsed: e,
|
|
160
|
+
groupEnd: e
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
D++;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function $e() {
|
|
167
|
+
{
|
|
168
|
+
if (D--, D === 0) {
|
|
169
|
+
var e = {
|
|
170
|
+
configurable: !0,
|
|
171
|
+
enumerable: !0,
|
|
172
|
+
writable: !0
|
|
173
|
+
};
|
|
174
|
+
Object.defineProperties(console, {
|
|
175
|
+
log: P({}, e, {
|
|
176
|
+
value: ee
|
|
177
|
+
}),
|
|
178
|
+
info: P({}, e, {
|
|
179
|
+
value: re
|
|
180
|
+
}),
|
|
181
|
+
warn: P({}, e, {
|
|
182
|
+
value: te
|
|
183
|
+
}),
|
|
184
|
+
error: P({}, e, {
|
|
185
|
+
value: ne
|
|
186
|
+
}),
|
|
187
|
+
group: P({}, e, {
|
|
188
|
+
value: ae
|
|
189
|
+
}),
|
|
190
|
+
groupCollapsed: P({}, e, {
|
|
191
|
+
value: oe
|
|
192
|
+
}),
|
|
193
|
+
groupEnd: P({}, e, {
|
|
194
|
+
value: ie
|
|
195
|
+
})
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
D < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
var V = x.ReactCurrentDispatcher, U;
|
|
202
|
+
function W(e, r, t) {
|
|
203
|
+
{
|
|
204
|
+
if (U === void 0)
|
|
205
|
+
try {
|
|
206
|
+
throw Error();
|
|
207
|
+
} catch (i) {
|
|
208
|
+
var n = i.stack.trim().match(/\n( *(at )?)/);
|
|
209
|
+
U = n && n[1] || "";
|
|
210
|
+
}
|
|
211
|
+
return `
|
|
212
|
+
` + U + e;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
var B = !1, Y;
|
|
216
|
+
{
|
|
217
|
+
var We = typeof WeakMap == "function" ? WeakMap : Map;
|
|
218
|
+
Y = new We();
|
|
219
|
+
}
|
|
220
|
+
function se(e, r) {
|
|
221
|
+
if (!e || B)
|
|
222
|
+
return "";
|
|
223
|
+
{
|
|
224
|
+
var t = Y.get(e);
|
|
225
|
+
if (t !== void 0)
|
|
226
|
+
return t;
|
|
227
|
+
}
|
|
228
|
+
var n;
|
|
229
|
+
B = !0;
|
|
230
|
+
var i = Error.prepareStackTrace;
|
|
231
|
+
Error.prepareStackTrace = void 0;
|
|
232
|
+
var u;
|
|
233
|
+
u = V.current, V.current = null, Ie();
|
|
234
|
+
try {
|
|
235
|
+
if (r) {
|
|
236
|
+
var o = function() {
|
|
237
|
+
throw Error();
|
|
238
|
+
};
|
|
239
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
240
|
+
set: function() {
|
|
241
|
+
throw Error();
|
|
242
|
+
}
|
|
243
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
244
|
+
try {
|
|
245
|
+
Reflect.construct(o, []);
|
|
246
|
+
} catch (_) {
|
|
247
|
+
n = _;
|
|
248
|
+
}
|
|
249
|
+
Reflect.construct(e, [], o);
|
|
250
|
+
} else {
|
|
251
|
+
try {
|
|
252
|
+
o.call();
|
|
253
|
+
} catch (_) {
|
|
254
|
+
n = _;
|
|
255
|
+
}
|
|
256
|
+
e.call(o.prototype);
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
try {
|
|
260
|
+
throw Error();
|
|
261
|
+
} catch (_) {
|
|
262
|
+
n = _;
|
|
263
|
+
}
|
|
264
|
+
e();
|
|
265
|
+
}
|
|
266
|
+
} catch (_) {
|
|
267
|
+
if (_ && n && typeof _.stack == "string") {
|
|
268
|
+
for (var a = _.stack.split(`
|
|
269
|
+
`), v = n.stack.split(`
|
|
270
|
+
`), s = a.length - 1, f = v.length - 1; s >= 1 && f >= 0 && a[s] !== v[f]; )
|
|
271
|
+
f--;
|
|
272
|
+
for (; s >= 1 && f >= 0; s--, f--)
|
|
273
|
+
if (a[s] !== v[f]) {
|
|
274
|
+
if (s !== 1 || f !== 1)
|
|
275
|
+
do
|
|
276
|
+
if (s--, f--, f < 0 || a[s] !== v[f]) {
|
|
277
|
+
var p = `
|
|
278
|
+
` + a[s].replace(" at new ", " at ");
|
|
279
|
+
return e.displayName && p.includes("<anonymous>") && (p = p.replace("<anonymous>", e.displayName)), typeof e == "function" && Y.set(e, p), p;
|
|
280
|
+
}
|
|
281
|
+
while (s >= 1 && f >= 0);
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
} finally {
|
|
286
|
+
B = !1, V.current = u, $e(), Error.prepareStackTrace = i;
|
|
287
|
+
}
|
|
288
|
+
var k = e ? e.displayName || e.name : "", ye = k ? W(k) : "";
|
|
289
|
+
return typeof e == "function" && Y.set(e, ye), ye;
|
|
290
|
+
}
|
|
291
|
+
function Ye(e, r, t) {
|
|
292
|
+
return se(e, !1);
|
|
293
|
+
}
|
|
294
|
+
function Le(e) {
|
|
295
|
+
var r = e.prototype;
|
|
296
|
+
return !!(r && r.isReactComponent);
|
|
297
|
+
}
|
|
298
|
+
function L(e, r, t) {
|
|
299
|
+
if (e == null)
|
|
300
|
+
return "";
|
|
301
|
+
if (typeof e == "function")
|
|
302
|
+
return se(e, Le(e));
|
|
303
|
+
if (typeof e == "string")
|
|
304
|
+
return W(e);
|
|
305
|
+
switch (e) {
|
|
306
|
+
case w:
|
|
307
|
+
return W("Suspense");
|
|
308
|
+
case d:
|
|
309
|
+
return W("SuspenseList");
|
|
310
|
+
}
|
|
311
|
+
if (typeof e == "object")
|
|
312
|
+
switch (e.$$typeof) {
|
|
313
|
+
case l:
|
|
314
|
+
return Ye(e.render);
|
|
315
|
+
case b:
|
|
316
|
+
return L(e.type, r, t);
|
|
317
|
+
case O: {
|
|
318
|
+
var n = e, i = n._payload, u = n._init;
|
|
319
|
+
try {
|
|
320
|
+
return L(u(i), r, t);
|
|
321
|
+
} catch {
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return "";
|
|
326
|
+
}
|
|
327
|
+
var M = Object.prototype.hasOwnProperty, fe = {}, le = x.ReactDebugCurrentFrame;
|
|
328
|
+
function N(e) {
|
|
329
|
+
if (e) {
|
|
330
|
+
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
331
|
+
le.setExtraStackFrame(t);
|
|
332
|
+
} else
|
|
333
|
+
le.setExtraStackFrame(null);
|
|
334
|
+
}
|
|
335
|
+
function Me(e, r, t, n, i) {
|
|
336
|
+
{
|
|
337
|
+
var u = Function.call.bind(M);
|
|
338
|
+
for (var o in e)
|
|
339
|
+
if (u(e, o)) {
|
|
340
|
+
var a = void 0;
|
|
341
|
+
try {
|
|
342
|
+
if (typeof e[o] != "function") {
|
|
343
|
+
var v = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
344
|
+
throw v.name = "Invariant Violation", v;
|
|
345
|
+
}
|
|
346
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
347
|
+
} catch (s) {
|
|
348
|
+
a = s;
|
|
349
|
+
}
|
|
350
|
+
a && !(a instanceof Error) && (N(i), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), N(null)), a instanceof Error && !(a.message in fe) && (fe[a.message] = !0, N(i), c("Failed %s type: %s", t, a.message), N(null));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
var Ne = Array.isArray;
|
|
355
|
+
function q(e) {
|
|
356
|
+
return Ne(e);
|
|
357
|
+
}
|
|
358
|
+
function Ve(e) {
|
|
359
|
+
{
|
|
360
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
361
|
+
return t;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
function Ue(e) {
|
|
365
|
+
try {
|
|
366
|
+
return ce(e), !1;
|
|
367
|
+
} catch {
|
|
368
|
+
return !0;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function ce(e) {
|
|
372
|
+
return "" + e;
|
|
373
|
+
}
|
|
374
|
+
function ve(e) {
|
|
375
|
+
if (Ue(e))
|
|
376
|
+
return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ve(e)), ce(e);
|
|
377
|
+
}
|
|
378
|
+
var F = x.ReactCurrentOwner, Be = {
|
|
379
|
+
key: !0,
|
|
380
|
+
ref: !0,
|
|
381
|
+
__self: !0,
|
|
382
|
+
__source: !0
|
|
383
|
+
}, de, pe, J;
|
|
384
|
+
J = {};
|
|
385
|
+
function qe(e) {
|
|
386
|
+
if (M.call(e, "ref")) {
|
|
387
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
388
|
+
if (r && r.isReactWarning)
|
|
389
|
+
return !1;
|
|
390
|
+
}
|
|
391
|
+
return e.ref !== void 0;
|
|
392
|
+
}
|
|
393
|
+
function Je(e) {
|
|
394
|
+
if (M.call(e, "key")) {
|
|
395
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
396
|
+
if (r && r.isReactWarning)
|
|
397
|
+
return !1;
|
|
398
|
+
}
|
|
399
|
+
return e.key !== void 0;
|
|
400
|
+
}
|
|
401
|
+
function Ge(e, r) {
|
|
402
|
+
if (typeof e.ref == "string" && F.current && r && F.current.stateNode !== r) {
|
|
403
|
+
var t = h(F.current.type);
|
|
404
|
+
J[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', h(F.current.type), e.ref), J[t] = !0);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
function ze(e, r) {
|
|
408
|
+
{
|
|
409
|
+
var t = function() {
|
|
410
|
+
de || (de = !0, c("%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://reactjs.org/link/special-props)", r));
|
|
411
|
+
};
|
|
412
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
413
|
+
get: t,
|
|
414
|
+
configurable: !0
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
function Ke(e, r) {
|
|
419
|
+
{
|
|
420
|
+
var t = function() {
|
|
421
|
+
pe || (pe = !0, c("%s: `ref` 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://reactjs.org/link/special-props)", r));
|
|
422
|
+
};
|
|
423
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
424
|
+
get: t,
|
|
425
|
+
configurable: !0
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
var He = function(e, r, t, n, i, u, o) {
|
|
430
|
+
var a = {
|
|
431
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
432
|
+
$$typeof: m,
|
|
433
|
+
// Built-in properties that belong on the element
|
|
434
|
+
type: e,
|
|
435
|
+
key: r,
|
|
436
|
+
ref: t,
|
|
437
|
+
props: o,
|
|
438
|
+
// Record the component responsible for creating this element.
|
|
439
|
+
_owner: u
|
|
440
|
+
};
|
|
441
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
442
|
+
configurable: !1,
|
|
443
|
+
enumerable: !1,
|
|
444
|
+
writable: !0,
|
|
445
|
+
value: !1
|
|
446
|
+
}), Object.defineProperty(a, "_self", {
|
|
447
|
+
configurable: !1,
|
|
448
|
+
enumerable: !1,
|
|
449
|
+
writable: !1,
|
|
450
|
+
value: n
|
|
451
|
+
}), Object.defineProperty(a, "_source", {
|
|
452
|
+
configurable: !1,
|
|
453
|
+
enumerable: !1,
|
|
454
|
+
writable: !1,
|
|
455
|
+
value: i
|
|
456
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
457
|
+
};
|
|
458
|
+
function Xe(e, r, t, n, i) {
|
|
459
|
+
{
|
|
460
|
+
var u, o = {}, a = null, v = null;
|
|
461
|
+
t !== void 0 && (ve(t), a = "" + t), Je(r) && (ve(r.key), a = "" + r.key), qe(r) && (v = r.ref, Ge(r, i));
|
|
462
|
+
for (u in r)
|
|
463
|
+
M.call(r, u) && !Be.hasOwnProperty(u) && (o[u] = r[u]);
|
|
464
|
+
if (e && e.defaultProps) {
|
|
465
|
+
var s = e.defaultProps;
|
|
466
|
+
for (u in s)
|
|
467
|
+
o[u] === void 0 && (o[u] = s[u]);
|
|
468
|
+
}
|
|
469
|
+
if (a || v) {
|
|
470
|
+
var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
471
|
+
a && ze(o, f), v && Ke(o, f);
|
|
472
|
+
}
|
|
473
|
+
return He(e, a, v, i, n, F.current, o);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
var G = x.ReactCurrentOwner, ge = x.ReactDebugCurrentFrame;
|
|
477
|
+
function j(e) {
|
|
478
|
+
if (e) {
|
|
479
|
+
var r = e._owner, t = L(e.type, e._source, r ? r.type : null);
|
|
480
|
+
ge.setExtraStackFrame(t);
|
|
481
|
+
} else
|
|
482
|
+
ge.setExtraStackFrame(null);
|
|
483
|
+
}
|
|
484
|
+
var z;
|
|
485
|
+
z = !1;
|
|
486
|
+
function K(e) {
|
|
487
|
+
return typeof e == "object" && e !== null && e.$$typeof === m;
|
|
488
|
+
}
|
|
489
|
+
function Ee() {
|
|
490
|
+
{
|
|
491
|
+
if (G.current) {
|
|
492
|
+
var e = h(G.current.type);
|
|
493
|
+
if (e)
|
|
494
|
+
return `
|
|
495
|
+
|
|
496
|
+
Check the render method of \`` + e + "`.";
|
|
497
|
+
}
|
|
498
|
+
return "";
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
function Ze(e) {
|
|
502
|
+
{
|
|
503
|
+
if (e !== void 0) {
|
|
504
|
+
var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
|
|
505
|
+
return `
|
|
506
|
+
|
|
507
|
+
Check your code at ` + r + ":" + t + ".";
|
|
508
|
+
}
|
|
509
|
+
return "";
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
var be = {};
|
|
513
|
+
function Qe(e) {
|
|
514
|
+
{
|
|
515
|
+
var r = Ee();
|
|
516
|
+
if (!r) {
|
|
517
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
518
|
+
t && (r = `
|
|
519
|
+
|
|
520
|
+
Check the top-level render call using <` + t + ">.");
|
|
521
|
+
}
|
|
522
|
+
return r;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
function he(e, r) {
|
|
526
|
+
{
|
|
527
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
528
|
+
return;
|
|
529
|
+
e._store.validated = !0;
|
|
530
|
+
var t = Qe(r);
|
|
531
|
+
if (be[t])
|
|
532
|
+
return;
|
|
533
|
+
be[t] = !0;
|
|
534
|
+
var n = "";
|
|
535
|
+
e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + h(e._owner.type) + "."), j(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), j(null);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
function _e(e, r) {
|
|
539
|
+
{
|
|
540
|
+
if (typeof e != "object")
|
|
541
|
+
return;
|
|
542
|
+
if (q(e))
|
|
543
|
+
for (var t = 0; t < e.length; t++) {
|
|
544
|
+
var n = e[t];
|
|
545
|
+
K(n) && he(n, r);
|
|
546
|
+
}
|
|
547
|
+
else if (K(e))
|
|
548
|
+
e._store && (e._store.validated = !0);
|
|
549
|
+
else if (e) {
|
|
550
|
+
var i = Pe(e);
|
|
551
|
+
if (typeof i == "function" && i !== e.entries)
|
|
552
|
+
for (var u = i.call(e), o; !(o = u.next()).done; )
|
|
553
|
+
K(o.value) && he(o.value, r);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
function er(e) {
|
|
558
|
+
{
|
|
559
|
+
var r = e.type;
|
|
560
|
+
if (r == null || typeof r == "string")
|
|
561
|
+
return;
|
|
562
|
+
var t;
|
|
563
|
+
if (typeof r == "function")
|
|
564
|
+
t = r.propTypes;
|
|
565
|
+
else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
|
|
566
|
+
// Inner props are checked in the reconciler.
|
|
567
|
+
r.$$typeof === b))
|
|
568
|
+
t = r.propTypes;
|
|
569
|
+
else
|
|
570
|
+
return;
|
|
571
|
+
if (t) {
|
|
572
|
+
var n = h(r);
|
|
573
|
+
Me(t, e.props, "prop", n, e);
|
|
574
|
+
} else if (r.PropTypes !== void 0 && !z) {
|
|
575
|
+
z = !0;
|
|
576
|
+
var i = h(r);
|
|
577
|
+
c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
578
|
+
}
|
|
579
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
function rr(e) {
|
|
583
|
+
{
|
|
584
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
585
|
+
var n = r[t];
|
|
586
|
+
if (n !== "children" && n !== "key") {
|
|
587
|
+
j(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), j(null);
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
e.ref !== null && (j(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
function me(e, r, t, n, i, u) {
|
|
595
|
+
{
|
|
596
|
+
var o = Fe(e);
|
|
597
|
+
if (!o) {
|
|
598
|
+
var a = "";
|
|
599
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
600
|
+
var v = Ze(i);
|
|
601
|
+
v ? a += v : a += Ee();
|
|
602
|
+
var s;
|
|
603
|
+
e === null ? s = "null" : q(e) ? s = "array" : e !== void 0 && e.$$typeof === m ? (s = "<" + (h(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
|
|
604
|
+
}
|
|
605
|
+
var f = Xe(e, r, t, i, u);
|
|
606
|
+
if (f == null)
|
|
607
|
+
return f;
|
|
608
|
+
if (o) {
|
|
609
|
+
var p = r.children;
|
|
610
|
+
if (p !== void 0)
|
|
611
|
+
if (n)
|
|
612
|
+
if (q(p)) {
|
|
613
|
+
for (var k = 0; k < p.length; k++)
|
|
614
|
+
_e(p[k], e);
|
|
615
|
+
Object.freeze && Object.freeze(p);
|
|
616
|
+
} else
|
|
617
|
+
c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
618
|
+
else
|
|
619
|
+
_e(p, e);
|
|
620
|
+
}
|
|
621
|
+
return e === E ? rr(f) : er(f), f;
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
function tr(e, r, t) {
|
|
625
|
+
return me(e, r, t, !0);
|
|
626
|
+
}
|
|
627
|
+
function nr(e, r, t) {
|
|
628
|
+
return me(e, r, t, !1);
|
|
629
|
+
}
|
|
630
|
+
var ar = nr, or = tr;
|
|
631
|
+
I.Fragment = E, I.jsx = ar, I.jsxs = or;
|
|
632
|
+
}()), I;
|
|
633
|
+
}
|
|
634
|
+
(function(g) {
|
|
635
|
+
process.env.NODE_ENV === "production" ? g.exports = fr() : g.exports = lr();
|
|
636
|
+
})(sr);
|
|
637
|
+
const cr = H.jsx, vr = ir(void 0), pr = ({ children: g, t: m, useAuth: S, Outlet: E, Navigate: y, useLocation: R }) => {
|
|
638
|
+
const T = ur(
|
|
639
|
+
() => ({
|
|
640
|
+
Navigate: y,
|
|
641
|
+
Outlet: E,
|
|
642
|
+
t: m,
|
|
643
|
+
useAuth: S,
|
|
644
|
+
useLocation: R
|
|
645
|
+
}),
|
|
646
|
+
[y, E, m, S, R]
|
|
647
|
+
);
|
|
648
|
+
return /* @__PURE__ */ cr(vr.Provider, { value: T, children: g });
|
|
649
|
+
};
|
|
650
|
+
export {
|
|
651
|
+
pr as I,
|
|
652
|
+
vr as a,
|
|
653
|
+
cr as j
|
|
654
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";const V=require("react");var X={},sr={get exports(){return X},set exports(g){X=g}},A={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Te;function fr(){if(Te)return A;Te=1;var g=V,y=Symbol.for("react.element"),S=Symbol.for("react.fragment"),E=Object.prototype.hasOwnProperty,R=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function T(C,l,w){var v,b={},O=null,$=null;w!==void 0&&(O=""+w),l.key!==void 0&&(O=""+l.key),l.ref!==void 0&&($=l.ref);for(v in l)E.call(l,v)&&!m.hasOwnProperty(v)&&(b[v]=l[v]);if(C&&C.defaultProps)for(v in l=C.defaultProps,l)b[v]===void 0&&(b[v]=l[v]);return{$$typeof:y,type:C,key:O,ref:$,props:b,_owner:R.current}}return A.Fragment=S,A.jsx=T,A.jsxs=T,A}var I={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ce;function lr(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var g=V,y=Symbol.for("react.element"),S=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),C=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),$=Symbol.for("react.offscreen"),Z=Symbol.iterator,Se="@@iterator";function we(e){if(e===null||typeof e!="object")return null;var r=Z&&e[Z]||e[Se];return typeof r=="function"?r:null}var j=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function c(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];je("error",e,t)}}function je(e,r,t){{var n=j.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var u=t.map(function(o){return String(o)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var xe=!1,ke=!1,De=!1,Fe=!1,Ae=!1,Q;Q=Symbol.for("react.module.reference");function Ie(e){return!!(typeof e=="string"||typeof e=="function"||e===E||e===m||Ae||e===R||e===w||e===v||Fe||e===$||xe||ke||De||typeof e=="object"&&e!==null&&(e.$$typeof===O||e.$$typeof===b||e.$$typeof===T||e.$$typeof===C||e.$$typeof===l||e.$$typeof===Q||e.getModuleId!==void 0))}function $e(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ee(e){return e.displayName||"Context"}function h(e){if(e==null)return null;if(typeof e.tag=="number"&&c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case S:return"Portal";case m:return"Profiler";case R:return"StrictMode";case w:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case C:var r=e;return ee(r)+".Consumer";case T:var t=e;return ee(t._context)+".Provider";case l:return $e(e,e.render,"ForwardRef");case b:var n=e.displayName||null;return n!==null?n:h(e.type)||"Memo";case O:{var i=e,u=i._payload,o=i._init;try{return h(o(u))}catch{return null}}}return null}var P=Object.assign,D=0,re,te,ne,ae,oe,ie,ue;function se(){}se.__reactDisabledLog=!0;function We(){{if(D===0){re=console.log,te=console.info,ne=console.warn,ae=console.error,oe=console.group,ie=console.groupCollapsed,ue=console.groupEnd;var e={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}D++}}function Ye(){{if(D--,D===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:re}),info:P({},e,{value:te}),warn:P({},e,{value:ne}),error:P({},e,{value:ae}),group:P({},e,{value:oe}),groupCollapsed:P({},e,{value:ie}),groupEnd:P({},e,{value:ue})})}D<0&&c("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var U=j.ReactCurrentDispatcher,q;function W(e,r,t){{if(q===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);q=n&&n[1]||""}return`
|
|
18
|
+
`+q+e}}var B=!1,Y;{var Le=typeof WeakMap=="function"?WeakMap:Map;Y=new Le}function fe(e,r){if(!e||B)return"";{var t=Y.get(e);if(t!==void 0)return t}var n;B=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=U.current,U.current=null,We();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(_){n=_}Reflect.construct(e,[],o)}else{try{o.call()}catch(_){n=_}e.call(o.prototype)}}else{try{throw Error()}catch(_){n=_}e()}}catch(_){if(_&&n&&typeof _.stack=="string"){for(var a=_.stack.split(`
|
|
19
|
+
`),d=n.stack.split(`
|
|
20
|
+
`),s=a.length-1,f=d.length-1;s>=1&&f>=0&&a[s]!==d[f];)f--;for(;s>=1&&f>=0;s--,f--)if(a[s]!==d[f]){if(s!==1||f!==1)do if(s--,f--,f<0||a[s]!==d[f]){var p=`
|
|
21
|
+
`+a[s].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),typeof e=="function"&&Y.set(e,p),p}while(s>=1&&f>=0);break}}}finally{B=!1,U.current=u,Ye(),Error.prepareStackTrace=i}var k=e?e.displayName||e.name:"",me=k?W(k):"";return typeof e=="function"&&Y.set(e,me),me}function Me(e,r,t){return fe(e,!1)}function Ne(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function L(e,r,t){if(e==null)return"";if(typeof e=="function")return fe(e,Ne(e));if(typeof e=="string")return W(e);switch(e){case w:return W("Suspense");case v:return W("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return Me(e.render);case b:return L(e.type,r,t);case O:{var n=e,i=n._payload,u=n._init;try{return L(u(i),r,t)}catch{}}}return""}var M=Object.prototype.hasOwnProperty,le={},ce=j.ReactDebugCurrentFrame;function N(e){if(e){var r=e._owner,t=L(e.type,e._source,r?r.type:null);ce.setExtraStackFrame(t)}else ce.setExtraStackFrame(null)}function Ve(e,r,t,n,i){{var u=Function.call.bind(M);for(var o in e)if(u(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var d=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(s){a=s}a&&!(a instanceof Error)&&(N(i),c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),N(null)),a instanceof Error&&!(a.message in le)&&(le[a.message]=!0,N(i),c("Failed %s type: %s",t,a.message),N(null))}}}var Ue=Array.isArray;function J(e){return Ue(e)}function qe(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Be(e){try{return de(e),!1}catch{return!0}}function de(e){return""+e}function ve(e){if(Be(e))return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",qe(e)),de(e)}var F=j.ReactCurrentOwner,Je={key:!0,ref:!0,__self:!0,__source:!0},pe,ge,G;G={};function Ge(e){if(M.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ze(e){if(M.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ke(e,r){if(typeof e.ref=="string"&&F.current&&r&&F.current.stateNode!==r){var t=h(F.current.type);G[t]||(c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',h(F.current.type),e.ref),G[t]=!0)}}function He(e,r){{var t=function(){pe||(pe=!0,c("%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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function Xe(e,r){{var t=function(){ge||(ge=!0,c("%s: `ref` 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://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Ze=function(e,r,t,n,i,u,o){var a={$$typeof:y,type:e,key:r,ref:t,props:o,_owner:u};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Qe(e,r,t,n,i){{var u,o={},a=null,d=null;t!==void 0&&(ve(t),a=""+t),ze(r)&&(ve(r.key),a=""+r.key),Ge(r)&&(d=r.ref,Ke(r,i));for(u in r)M.call(r,u)&&!Je.hasOwnProperty(u)&&(o[u]=r[u]);if(e&&e.defaultProps){var s=e.defaultProps;for(u in s)o[u]===void 0&&(o[u]=s[u])}if(a||d){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&He(o,f),d&&Xe(o,f)}return Ze(e,a,d,i,n,F.current,o)}}var z=j.ReactCurrentOwner,Ee=j.ReactDebugCurrentFrame;function x(e){if(e){var r=e._owner,t=L(e.type,e._source,r?r.type:null);Ee.setExtraStackFrame(t)}else Ee.setExtraStackFrame(null)}var K;K=!1;function H(e){return typeof e=="object"&&e!==null&&e.$$typeof===y}function be(){{if(z.current){var e=h(z.current.type);if(e)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function er(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
+
|
|
25
|
+
Check your code at `+r+":"+t+"."}return""}}var he={};function rr(e){{var r=be();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
|
+
|
|
27
|
+
Check the top-level render call using <`+t+">.")}return r}}function _e(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=rr(r);if(he[t])return;he[t]=!0;var n="";e&&e._owner&&e._owner!==z.current&&(n=" It was passed a child from "+h(e._owner.type)+"."),x(e),c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),x(null)}}function ye(e,r){{if(typeof e!="object")return;if(J(e))for(var t=0;t<e.length;t++){var n=e[t];H(n)&&_e(n,r)}else if(H(e))e._store&&(e._store.validated=!0);else if(e){var i=we(e);if(typeof i=="function"&&i!==e.entries)for(var u=i.call(e),o;!(o=u.next()).done;)H(o.value)&&_e(o.value,r)}}}function tr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===l||r.$$typeof===b))t=r.propTypes;else return;if(t){var n=h(r);Ve(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!K){K=!0;var i=h(r);c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){x(e),c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),x(null);break}}e.ref!==null&&(x(e),c("Invalid attribute `ref` supplied to `React.Fragment`."),x(null))}}function Re(e,r,t,n,i,u){{var o=Ie(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var d=er(i);d?a+=d:a+=be();var s;e===null?s="null":J(e)?s="array":e!==void 0&&e.$$typeof===y?(s="<"+(h(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):s=typeof e,c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",s,a)}var f=Qe(e,r,t,i,u);if(f==null)return f;if(o){var p=r.children;if(p!==void 0)if(n)if(J(p)){for(var k=0;k<p.length;k++)ye(p[k],e);Object.freeze&&Object.freeze(p)}else c("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 ye(p,e)}return e===E?nr(f):tr(f),f}}function ar(e,r,t){return Re(e,r,t,!0)}function or(e,r,t){return Re(e,r,t,!1)}var ir=or,ur=ar;I.Fragment=E,I.jsx=ir,I.jsxs=ur}()),I}(function(g){process.env.NODE_ENV==="production"?g.exports=fr():g.exports=lr()})(sr);const Oe=X.jsx,Pe=V.createContext(void 0),cr=({children:g,t:y,useAuth:S,Outlet:E,Navigate:R,useLocation:m})=>{const T=V.useMemo(()=>({Navigate:R,Outlet:E,t:y,useAuth:S,useLocation:m}),[R,E,y,S,m]);return Oe(Pe.Provider,{value:T,children:g})};exports.InjectDependenciesContext=Pe;exports.InjectDependenciesProvider=cr;exports.jsx=Oe;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { a as l, j as r } from "./InjectDependenciesProvider-c64526b4.js";
|
|
2
|
+
import { useContext as m, Suspense as w } from "react";
|
|
3
|
+
const L = ({ fallback: c, useAuth: o, useLocation: n, Outlet: s, Navigate: a, loginPath: d = "/login" }) => {
|
|
4
|
+
var u, h, f, v;
|
|
5
|
+
const e = m(l);
|
|
6
|
+
if (o === void 0 && (e == null ? void 0 : e.useAuth) === void 0)
|
|
7
|
+
throw new Error("useAuth is not defined or injected not with the InjectDependenciesProvider");
|
|
8
|
+
if (n === void 0 && (e == null ? void 0 : e.useLocation) === void 0)
|
|
9
|
+
throw new Error("useLocation is not defined or not injected with the InjectDependenciesProvider");
|
|
10
|
+
if (s === void 0 && (e == null ? void 0 : e.Outlet) === void 0)
|
|
11
|
+
throw new Error("Outlet is not defined or not injected with the InjectDependenciesProvider");
|
|
12
|
+
if (a === void 0 && (e == null ? void 0 : e.Navigate) === void 0)
|
|
13
|
+
throw new Error("Navigate is not defined or not injected with the InjectDependenciesProvider");
|
|
14
|
+
const t = {
|
|
15
|
+
Navigate: a || (e == null ? void 0 : e.Navigate) || (() => null),
|
|
16
|
+
Outlet: s || (e == null ? void 0 : e.Outlet) || (() => null),
|
|
17
|
+
useAuth: o || (e == null ? void 0 : e.useAuth) || (() => ({ isLogged: !1 })),
|
|
18
|
+
useLocation: n || (e == null ? void 0 : e.useLocation) || (() => ({}))
|
|
19
|
+
}, { isLogged: p } = t.useAuth(), i = t.useLocation();
|
|
20
|
+
return p ? /* @__PURE__ */ r(w, { fallback: c, children: (h = (u = i.state) == null ? void 0 : u.from) != null && h.state && ((v = (f = i.state) == null ? void 0 : f.from) == null ? void 0 : v.pathname) === d ? /* @__PURE__ */ r(t.Navigate, { to: i.state.from.state.from.pathname + i.state.from.state.from.search, replace: !0 }) : /* @__PURE__ */ r(t.Outlet, {}) }) : /* @__PURE__ */ r(t.Navigate, { to: d, state: { from: i }, replace: !0 });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
L as R
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("./InjectDependenciesProvider-cdf994b6.cjs"),f=require("react"),p=({fallback:j,useAuth:o,useLocation:n,Outlet:s,Navigate:d,loginPath:u="/login"})=>{var a,h,c,v;const e=f.useContext(r.InjectDependenciesContext);if(o===void 0&&(e==null?void 0:e.useAuth)===void 0)throw new Error("useAuth is not defined or injected not with the InjectDependenciesProvider");if(n===void 0&&(e==null?void 0:e.useLocation)===void 0)throw new Error("useLocation is not defined or not injected with the InjectDependenciesProvider");if(s===void 0&&(e==null?void 0:e.Outlet)===void 0)throw new Error("Outlet is not defined or not injected with the InjectDependenciesProvider");if(d===void 0&&(e==null?void 0:e.Navigate)===void 0)throw new Error("Navigate is not defined or not injected with the InjectDependenciesProvider");const i={Navigate:d||(e==null?void 0:e.Navigate)||(()=>null),Outlet:s||(e==null?void 0:e.Outlet)||(()=>null),useAuth:o||(e==null?void 0:e.useAuth)||(()=>({isLogged:!1})),useLocation:n||(e==null?void 0:e.useLocation)||(()=>({}))},{isLogged:l}=i.useAuth(),t=i.useLocation();return l?r.jsx(f.Suspense,{fallback:j,children:(h=(a=t.state)==null?void 0:a.from)!=null&&h.state&&((v=(c=t.state)==null?void 0:c.from)==null?void 0:v.pathname)===u?r.jsx(i.Navigate,{to:t.state.from.state.from.pathname+t.state.from.state.from.search,replace:!0}):r.jsx(i.Outlet,{})}):r.jsx(i.Navigate,{to:u,state:{from:t},replace:!0})};exports.RequireAuth=p;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type ResponseError from '../../api/types/error';
|
|
2
|
+
export interface useResponseErrorParams {
|
|
3
|
+
/**
|
|
4
|
+
* Translation function if you want to use your own translation function
|
|
5
|
+
* @param str
|
|
6
|
+
*/
|
|
7
|
+
t?: (str: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Translation key returned for the unknown error
|
|
10
|
+
*/
|
|
11
|
+
unknownErrorTranslationKey?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* This hook is used to print error messages from the API
|
|
15
|
+
*/
|
|
16
|
+
export declare const useResponseError: (params?: useResponseErrorParams) => {
|
|
17
|
+
printError: (response?: ResponseError) => string;
|
|
18
|
+
};
|
|
19
|
+
export default useResponseError;
|
package/dist/api.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useResponseError-e4d8f886.cjs");require("react");require("./InjectDependenciesProvider-cdf994b6.cjs");exports.useResponseError=e.useResponseError;
|
package/dist/api.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { InjectDependenciesContextProps } from '../../context/InjectDependenciesProvider';
|
|
3
|
+
export interface RequireAuthProps {
|
|
4
|
+
Outlet?: InjectDependenciesContextProps["Outlet"];
|
|
5
|
+
Navigate?: InjectDependenciesContextProps["Navigate"];
|
|
6
|
+
useLocation?: InjectDependenciesContextProps["useLocation"];
|
|
7
|
+
useAuth?: InjectDependenciesContextProps["useAuth"];
|
|
8
|
+
loginPath?: string;
|
|
9
|
+
fallback?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* RequireAuth
|
|
13
|
+
* @param fallbackComponent
|
|
14
|
+
* @param useAuth
|
|
15
|
+
* @param useLocation
|
|
16
|
+
* @param Outlet
|
|
17
|
+
* @param Navigate
|
|
18
|
+
* @param loginPath
|
|
19
|
+
* @constructor
|
|
20
|
+
*/
|
|
21
|
+
declare const RequireAuth: ({ fallback, useAuth, useLocation, Outlet, Navigate, loginPath }: RequireAuthProps) => JSX.Element;
|
|
22
|
+
export default RequireAuth;
|
package/dist/auth.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./RequireAuth-edc931f8.cjs");require("./InjectDependenciesProvider-cdf994b6.cjs");require("react");exports.RequireAuth=e.RequireAuth;
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from "react";
|
|
2
|
+
export interface InjectDependenciesContextProps {
|
|
3
|
+
/**
|
|
4
|
+
* Children
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Translate function
|
|
9
|
+
* @param str
|
|
10
|
+
*/
|
|
11
|
+
t?: (str: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Outlet component for react-router
|
|
14
|
+
* @param props
|
|
15
|
+
* @constructor
|
|
16
|
+
*/
|
|
17
|
+
Outlet?(props: any): ReactElement | null;
|
|
18
|
+
/**
|
|
19
|
+
* Navigate component for react-router
|
|
20
|
+
* @param props
|
|
21
|
+
* @constructor
|
|
22
|
+
*/
|
|
23
|
+
Navigate?(props: any): null;
|
|
24
|
+
/**
|
|
25
|
+
* useLocation hook for react-router
|
|
26
|
+
*/
|
|
27
|
+
useLocation?(): any;
|
|
28
|
+
/**
|
|
29
|
+
* useAuth hook for authentification
|
|
30
|
+
*/
|
|
31
|
+
useAuth?(): {
|
|
32
|
+
isLogged: boolean;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export declare const InjectDependenciesContext: import("react").Context<Omit<InjectDependenciesContextProps, "children"> | undefined>;
|
|
36
|
+
declare const InjectDependenciesProvider: ({ children, t, useAuth, Outlet, Navigate, useLocation }: InjectDependenciesContextProps) => JSX.Element;
|
|
37
|
+
export default InjectDependenciesProvider;
|
package/dist/context.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./InjectDependenciesProvider-cdf994b6.cjs");require("react");exports.InjectDependenciesContext=e.InjectDependenciesContext;exports.InjectDependenciesProvider=e.InjectDependenciesProvider;
|
package/dist/context.js
ADDED
package/dist/main.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./useResponseError-e4d8f886.cjs"),n=require("./RequireAuth-edc931f8.cjs"),e=require("./InjectDependenciesProvider-cdf994b6.cjs");require("react");exports.useResponseError=r.useResponseError;exports.RequireAuth=n.RequireAuth;exports.InjectDependenciesContext=e.InjectDependenciesContext;exports.InjectDependenciesProvider=e.InjectDependenciesProvider;
|
package/dist/main.d.ts
ADDED
package/dist/main.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { u as s } from "./useResponseError-401ec650.js";
|
|
2
|
+
import { R as n } from "./RequireAuth-03e1e3fb.js";
|
|
3
|
+
import { a, I as i } from "./InjectDependenciesProvider-c64526b4.js";
|
|
4
|
+
import "react";
|
|
5
|
+
export {
|
|
6
|
+
a as InjectDependenciesContext,
|
|
7
|
+
i as InjectDependenciesProvider,
|
|
8
|
+
n as RequireAuth,
|
|
9
|
+
s as useResponseError
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useContext as w, useCallback as C } from "react";
|
|
2
|
+
import { a as S } from "./InjectDependenciesProvider-c64526b4.js";
|
|
3
|
+
const h = (r) => {
|
|
4
|
+
const { t: y } = r || {}, { unknownErrorTranslationKey: d = "error.unknownError" } = r || {}, a = w(S), i = y || (a == null ? void 0 : a.t);
|
|
5
|
+
return { printError: C(
|
|
6
|
+
(t) => {
|
|
7
|
+
var u, g, l, c, m, n, f, E, k;
|
|
8
|
+
return (u = t == null ? void 0 : t.data) != null && u.reason ? String(t.data.reason) : (g = t == null ? void 0 : t.data) != null && g.message ? String(t.data.message) : (c = (l = t == null ? void 0 : t.data) == null ? void 0 : l.detail) != null && c.length && Array.isArray((m = t == null ? void 0 : t.data) == null ? void 0 : m.detail) && ((f = (n = t == null ? void 0 : t.data) == null ? void 0 : n.detail[0]) != null && f.msg) && typeof ((k = (E = t == null ? void 0 : t.data) == null ? void 0 : E.detail[0]) == null ? void 0 : k.msg) == "string" ? String(t.data.detail[0].msg) : i ? i(d) : "Unknown error";
|
|
9
|
+
},
|
|
10
|
+
[i, d]
|
|
11
|
+
) };
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
h as u
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const y=require("react"),w=require("./InjectDependenciesProvider-cdf994b6.cjs"),C=r=>{const{t:q}=r||{},{unknownErrorTranslationKey:d="error.unknownError"}=r||{},a=y.useContext(w.InjectDependenciesContext),i=q||(a==null?void 0:a.t);return{printError:y.useCallback(t=>{var u,c,n,g,l,E,f,k,m;return(u=t==null?void 0:t.data)!=null&&u.reason?String(t.data.reason):(c=t==null?void 0:t.data)!=null&&c.message?String(t.data.message):(g=(n=t==null?void 0:t.data)==null?void 0:n.detail)!=null&&g.length&&Array.isArray((l=t==null?void 0:t.data)==null?void 0:l.detail)&&((f=(E=t==null?void 0:t.data)==null?void 0:E.detail[0])!=null&&f.msg)&&typeof((m=(k=t==null?void 0:t.data)==null?void 0:k.detail[0])==null?void 0:m.msg)=="string"?String(t.data.detail[0].msg):i?i(d):"Unknown error"},[i,d])}};exports.useResponseError=C;
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tracktor/shared-module",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"types": "dist/main.d.ts",
|
|
7
|
+
"main": "dist/main.cjs",
|
|
8
|
+
"module": "dist/main.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"api/index.d.ts",
|
|
12
|
+
"auth/index.d.ts",
|
|
13
|
+
"context/index.d.ts"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
"./api": {
|
|
17
|
+
"import": "./dist/api.js",
|
|
18
|
+
"require": "./dist/api.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./auth": {
|
|
21
|
+
"import": "./dist/auth.js",
|
|
22
|
+
"require": "./dist/auth.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./context": {
|
|
25
|
+
"import": "./dist/context.js",
|
|
26
|
+
"require": "./dist/context.cjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+ssh://git@github.com/Tracktor/shared-module.git"
|
|
32
|
+
},
|
|
33
|
+
"author": "Mickaël Austoni",
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/Tracktor/shared-module/issues"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"dev": "vite",
|
|
39
|
+
"build": "tsc && vite build",
|
|
40
|
+
"lint": "eslint . --max-warnings=0 && tsc --noEmit",
|
|
41
|
+
"preview": "vite preview",
|
|
42
|
+
"test": "yarn lint && vitest",
|
|
43
|
+
"prepare": "yarn run build && husky install"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"react": "^18.2.0",
|
|
47
|
+
"react-dom": "^18.2.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
51
|
+
"@testing-library/react": "^14.0.0",
|
|
52
|
+
"@testing-library/react-hooks": "^8.0.1",
|
|
53
|
+
"@testing-library/user-event": "^14.4.3",
|
|
54
|
+
"@types/react": "^18.0.28",
|
|
55
|
+
"@types/react-dom": "^18.0.11",
|
|
56
|
+
"@vitejs/plugin-react": "^3.1.0",
|
|
57
|
+
"eslint-config-react-tracktor": "^1.0.5",
|
|
58
|
+
"husky": "^8.0.3",
|
|
59
|
+
"jsdom": "^21.1.0",
|
|
60
|
+
"typescript": "^4.9.5",
|
|
61
|
+
"vite": "^4.1.4",
|
|
62
|
+
"vite-plugin-dts": "^2.1.0",
|
|
63
|
+
"vitest": "^0.29.2"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"react": ">=18.0.0",
|
|
67
|
+
"react-dom": ">=18.0.0"
|
|
68
|
+
}
|
|
69
|
+
}
|