@hortiview/modulebase 0.0.13075 → 0.0.13101-beta
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/ModuleCore-BWvRhZyP.js +14980 -0
- package/dist/{QueryClientProvider-Q_mWQTzQ.js → QueryClientProvider-BSM1ol7r.js} +81 -78
- package/dist/{_baseGet-B7FwMMGI.js → _baseGet-C6jMXSsQ.js} +447 -447
- package/dist/{api-D9Lmqe6S.js → api-s6E2GJtu.js} +48 -48
- package/dist/assets/ModuleCore.css +1 -0
- package/dist/components/ModuleBase.js +17 -498
- package/dist/components/ModuleCore.js +10 -0
- package/dist/hooks/useCustom.js +15 -18
- package/dist/hooks/useCustomMutation.js +14 -12
- package/dist/hooks/useEntity.js +48 -58
- package/dist/hooks/useOffline.js +45 -0
- package/dist/hooks/useOption.js +16 -16
- package/dist/hooks/useServiceBus.js +19 -11
- package/dist/hooks/useStores.js +1 -1
- package/dist/{query-CRIVoEP7.js → isRestoring-LSIsLTaI.js} +21 -17
- package/dist/lib/components/ModuleBase.d.ts +36 -0
- package/dist/lib/components/ModuleCore.d.ts +32 -0
- package/dist/{constants.d.ts → lib/constants.d.ts} +1 -1
- package/dist/{hooks → lib/hooks}/useCustom.d.ts +2 -1
- package/dist/{hooks → lib/hooks}/useCustomMutation.d.ts +2 -1
- package/dist/{hooks → lib/hooks}/useEntity.d.ts +6 -24
- package/dist/lib/hooks/useOffline.d.ts +15 -0
- package/dist/{hooks → lib/hooks}/useServiceBus.d.ts +6 -2
- package/dist/lib/hooks/useStores.d.ts +38 -0
- package/dist/lib/main.d.ts +27 -0
- package/dist/lib/types/ActionStorage.d.ts +13 -0
- package/dist/{types → lib/types}/BaseProps.d.ts +11 -2
- package/dist/{types → lib/types}/Deprecated.d.ts +6 -0
- package/dist/lib/types/Entities.d.ts +22 -0
- package/dist/{types → lib/types}/Environment.d.ts +1 -1
- package/dist/lib/types/EnvironmentVariable.d.ts +6 -0
- package/dist/{types → lib/types}/Requests.d.ts +4 -10
- package/dist/{utils → lib/utils}/api.d.ts +1 -1
- package/dist/{utils → lib/utils}/baseFetches.d.ts +2 -2
- package/dist/{utils → lib/utils}/fetches.d.ts +14 -6
- package/dist/lib/utils/helper.d.ts +29 -0
- package/dist/main.js +212 -133
- package/dist/{mutation-X73nm7Df.js → mutation-EhVtpjb0.js} +1 -1
- package/dist/{omit-B7MWDtHq.js → omit-C9Qe80rl.js} +1 -1
- package/dist/stores/EnvironmentStore.js +3 -2
- package/dist/types/ActionStorage.js +4 -0
- package/dist/types/Entities.js +25 -0
- package/dist/types/Environment.js +1 -4
- package/dist/types/EnvironmentVariable.js +1 -0
- package/dist/types/Requests.js +1 -4
- package/dist/{useMutation-3rykrmeD.js → useMutation-BYO7aks8.js} +16 -16
- package/dist/{useQuery-CwwWze9O.js → useQuery-Jx956wwH.js} +94 -94
- package/dist/utils/api.js +1 -1
- package/dist/utils/baseFetches.js +15 -15
- package/dist/utils/fetches.js +14 -13
- package/dist/utils/helper.js +55 -0
- package/package.json +7 -2
- package/dist/components/ModuleBase.d.ts +0 -11
- package/dist/hooks/useStores.d.ts +0 -30
- package/dist/main.d.ts +0 -13
- /package/dist/{hooks → lib/hooks}/useBreadcrumbTranslation.d.ts +0 -0
- /package/dist/{hooks → lib/hooks}/useOption.d.ts +0 -0
- /package/dist/{hooks → lib/hooks}/useSignalRMessages.d.ts +0 -0
- /package/dist/{module-router.d.ts → lib/module-router.d.ts} +0 -0
- /package/dist/{provider → lib/provider}/SignalR/SignalRProvider.d.ts +0 -0
- /package/dist/{provider → lib/provider}/SignalR/signalR.d.ts +0 -0
- /package/dist/{stores → lib/stores}/BasePropsStore.d.ts +0 -0
- /package/dist/{stores → lib/stores}/EnvironmentStore.d.ts +0 -0
- /package/dist/{types → lib/types}/AppInsights.d.ts +0 -0
- /package/dist/{types → lib/types}/CommonOptions.d.ts +0 -0
- /package/dist/{types → lib/types}/ModuleApi.d.ts +0 -0
- /package/dist/{types → lib/types}/ServiceBus.d.ts +0 -0
- /package/dist/{types → lib/types}/SystemMessage.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { jsx as
|
|
3
|
-
var
|
|
1
|
+
import * as g from "react";
|
|
2
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
3
|
+
var L = class {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|
|
6
6
|
}
|
|
@@ -16,25 +16,25 @@ var C = class {
|
|
|
16
16
|
}
|
|
17
17
|
onUnsubscribe() {
|
|
18
18
|
}
|
|
19
|
-
},
|
|
20
|
-
function
|
|
19
|
+
}, y = typeof window > "u" || "Deno" in globalThis;
|
|
20
|
+
function _() {
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function B(e, t) {
|
|
23
23
|
return typeof e == "function" ? e(t) : e;
|
|
24
24
|
}
|
|
25
25
|
function Q(e) {
|
|
26
26
|
return typeof e == "number" && e >= 0 && e !== 1 / 0;
|
|
27
27
|
}
|
|
28
|
-
function B(e, t) {
|
|
29
|
-
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
30
|
-
}
|
|
31
28
|
function W(e, t) {
|
|
32
|
-
return
|
|
29
|
+
return Math.max(e + (t || 0) - Date.now(), 0);
|
|
33
30
|
}
|
|
34
31
|
function X(e, t) {
|
|
35
32
|
return typeof e == "function" ? e(t) : e;
|
|
36
33
|
}
|
|
37
34
|
function Y(e, t) {
|
|
35
|
+
return typeof e == "function" ? e(t) : e;
|
|
36
|
+
}
|
|
37
|
+
function Z(e, t) {
|
|
38
38
|
const {
|
|
39
39
|
type: n = "all",
|
|
40
40
|
exact: r,
|
|
@@ -47,7 +47,7 @@ function Y(e, t) {
|
|
|
47
47
|
if (r) {
|
|
48
48
|
if (t.queryHash !== K(l, t.options))
|
|
49
49
|
return !1;
|
|
50
|
-
} else if (!
|
|
50
|
+
} else if (!F(t.queryKey, l))
|
|
51
51
|
return !1;
|
|
52
52
|
}
|
|
53
53
|
if (n !== "all") {
|
|
@@ -57,7 +57,7 @@ function Y(e, t) {
|
|
|
57
57
|
}
|
|
58
58
|
return !(typeof i == "boolean" && t.isStale() !== i || s && s !== t.state.fetchStatus || o && !o(t));
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function ee(e, t) {
|
|
61
61
|
const { exact: n, status: r, predicate: s, mutationKey: o } = e;
|
|
62
62
|
if (o) {
|
|
63
63
|
if (!t.options.mutationKey)
|
|
@@ -65,7 +65,7 @@ function Z(e, t) {
|
|
|
65
65
|
if (n) {
|
|
66
66
|
if (w(t.options.mutationKey) !== w(o))
|
|
67
67
|
return !1;
|
|
68
|
-
} else if (!
|
|
68
|
+
} else if (!F(t.options.mutationKey, o))
|
|
69
69
|
return !1;
|
|
70
70
|
}
|
|
71
71
|
return !(r && t.state.status !== r || s && !s(t));
|
|
@@ -76,17 +76,17 @@ function K(e, t) {
|
|
|
76
76
|
function w(e) {
|
|
77
77
|
return JSON.stringify(
|
|
78
78
|
e,
|
|
79
|
-
(t, n) =>
|
|
79
|
+
(t, n) => S(n) ? Object.keys(n).sort().reduce((r, s) => (r[s] = n[s], r), {}) : n
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((n) => !
|
|
82
|
+
function F(e, t) {
|
|
83
|
+
return e === t ? !0 : typeof e != typeof t ? !1 : e && t && typeof e == "object" && typeof t == "object" ? !Object.keys(t).some((n) => !F(e[n], t[n])) : !1;
|
|
84
84
|
}
|
|
85
85
|
function E(e, t) {
|
|
86
86
|
if (e === t)
|
|
87
87
|
return e;
|
|
88
88
|
const n = j(e) && j(t);
|
|
89
|
-
if (n ||
|
|
89
|
+
if (n || S(e) && S(t)) {
|
|
90
90
|
const r = n ? e : Object.keys(e), s = r.length, o = n ? t : Object.keys(t), l = o.length, i = n ? [] : {};
|
|
91
91
|
let u = 0;
|
|
92
92
|
for (let f = 0; f < l; f++) {
|
|
@@ -97,7 +97,7 @@ function E(e, t) {
|
|
|
97
97
|
}
|
|
98
98
|
return t;
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function te(e, t) {
|
|
101
101
|
if (!t || Object.keys(e).length !== Object.keys(t).length)
|
|
102
102
|
return !1;
|
|
103
103
|
for (const n in e)
|
|
@@ -108,7 +108,7 @@ function ee(e, t) {
|
|
|
108
108
|
function j(e) {
|
|
109
109
|
return Array.isArray(e) && e.length === Object.keys(e).length;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function S(e) {
|
|
112
112
|
if (!T(e))
|
|
113
113
|
return !1;
|
|
114
114
|
const t = e.constructor;
|
|
@@ -125,7 +125,7 @@ function z(e) {
|
|
|
125
125
|
setTimeout(t, e);
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function ne(e, t, n) {
|
|
129
129
|
if (typeof n.structuralSharing == "function")
|
|
130
130
|
return n.structuralSharing(e, t);
|
|
131
131
|
if (n.structuralSharing !== !1) {
|
|
@@ -133,35 +133,35 @@ function te(e, t, n) {
|
|
|
133
133
|
try {
|
|
134
134
|
return E(e, t);
|
|
135
135
|
} catch (r) {
|
|
136
|
-
console.error(
|
|
136
|
+
throw console.error(
|
|
137
137
|
`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`
|
|
138
|
-
);
|
|
138
|
+
), r;
|
|
139
139
|
}
|
|
140
140
|
return E(e, t);
|
|
141
141
|
}
|
|
142
142
|
return t;
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function re(e, t, n = 0) {
|
|
145
145
|
const r = [...e, t];
|
|
146
146
|
return n && r.length > n ? r.slice(1) : r;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function se(e, t, n = 0) {
|
|
149
149
|
const r = [t, ...e];
|
|
150
150
|
return n && r.length > n ? r.slice(0, -1) : r;
|
|
151
151
|
}
|
|
152
152
|
var P = Symbol();
|
|
153
|
-
function
|
|
153
|
+
function ie(e, t) {
|
|
154
154
|
return process.env.NODE_ENV !== "production" && e.queryFn === P && console.error(
|
|
155
155
|
`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`
|
|
156
156
|
), !e.queryFn && t?.initialPromise ? () => t.initialPromise : !e.queryFn || e.queryFn === P ? () => Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)) : e.queryFn;
|
|
157
157
|
}
|
|
158
|
-
var D = class extends
|
|
158
|
+
var D = class extends L {
|
|
159
159
|
#e;
|
|
160
160
|
#t;
|
|
161
161
|
#n;
|
|
162
162
|
constructor() {
|
|
163
163
|
super(), this.#n = (e) => {
|
|
164
|
-
if (!
|
|
164
|
+
if (!y && window.addEventListener) {
|
|
165
165
|
const t = () => e();
|
|
166
166
|
return window.addEventListener("visibilitychange", t, !1), () => {
|
|
167
167
|
window.removeEventListener("visibilitychange", t);
|
|
@@ -192,13 +192,13 @@ var D = class extends C {
|
|
|
192
192
|
isFocused() {
|
|
193
193
|
return typeof this.#e == "boolean" ? this.#e : globalThis.document?.visibilityState !== "hidden";
|
|
194
194
|
}
|
|
195
|
-
}, I = new D(), A = class extends
|
|
195
|
+
}, I = new D(), A = class extends L {
|
|
196
196
|
#e = !0;
|
|
197
197
|
#t;
|
|
198
198
|
#n;
|
|
199
199
|
constructor() {
|
|
200
200
|
super(), this.#n = (e) => {
|
|
201
|
-
if (!
|
|
201
|
+
if (!y && window.addEventListener) {
|
|
202
202
|
const t = () => e(!0), n = () => e(!1);
|
|
203
203
|
return window.addEventListener("online", t, !1), window.addEventListener("offline", n, !1), () => {
|
|
204
204
|
window.removeEventListener("online", t), window.removeEventListener("offline", n);
|
|
@@ -223,7 +223,7 @@ var D = class extends C {
|
|
|
223
223
|
isOnline() {
|
|
224
224
|
return this.#e;
|
|
225
225
|
}
|
|
226
|
-
},
|
|
226
|
+
}, k = new A();
|
|
227
227
|
function U() {
|
|
228
228
|
let e, t;
|
|
229
229
|
const n = new Promise((s, o) => {
|
|
@@ -250,25 +250,25 @@ function G(e) {
|
|
|
250
250
|
return Math.min(1e3 * 2 ** e, 3e4);
|
|
251
251
|
}
|
|
252
252
|
function H(e) {
|
|
253
|
-
return (e ?? "online") === "online" ?
|
|
253
|
+
return (e ?? "online") === "online" ? k.isOnline() : !0;
|
|
254
254
|
}
|
|
255
|
-
var
|
|
255
|
+
var C = class extends Error {
|
|
256
256
|
constructor(e) {
|
|
257
257
|
super("CancelledError"), this.revert = e?.revert, this.silent = e?.silent;
|
|
258
258
|
}
|
|
259
259
|
};
|
|
260
|
-
function ie(e) {
|
|
261
|
-
return e instanceof q;
|
|
262
|
-
}
|
|
263
260
|
function oe(e) {
|
|
261
|
+
return e instanceof C;
|
|
262
|
+
}
|
|
263
|
+
function ue(e) {
|
|
264
264
|
let t = !1, n = 0, r = !1, s;
|
|
265
265
|
const o = U(), l = (a) => {
|
|
266
|
-
r || (b(new
|
|
266
|
+
r || (b(new C(a)), e.abort?.());
|
|
267
267
|
}, i = () => {
|
|
268
268
|
t = !0;
|
|
269
269
|
}, u = () => {
|
|
270
270
|
t = !1;
|
|
271
|
-
}, f = () => I.isFocused() && (e.networkMode === "always" ||
|
|
271
|
+
}, f = () => I.isFocused() && (e.networkMode === "always" || k.isOnline()) && e.canRun(), c = () => H(e.networkMode) && e.canRun(), M = (a) => {
|
|
272
272
|
r || (r = !0, e.onSuccess?.(a), s?.(), o.resolve(a));
|
|
273
273
|
}, b = (a) => {
|
|
274
274
|
r || (r = !0, e.onError?.(a), s?.(), o.reject(a));
|
|
@@ -291,12 +291,12 @@ function oe(e) {
|
|
|
291
291
|
Promise.resolve(a).then(M).catch((h) => {
|
|
292
292
|
if (r)
|
|
293
293
|
return;
|
|
294
|
-
const
|
|
295
|
-
if (t || !
|
|
294
|
+
const d = e.retry ?? (y ? 0 : 3), v = e.retryDelay ?? G, x = typeof v == "function" ? v(n, h) : v, N = d === !0 || typeof d == "number" && n < d || typeof d == "function" && d(n, h);
|
|
295
|
+
if (t || !N) {
|
|
296
296
|
b(h);
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
|
-
n++, e.onFail?.(n, h), z(
|
|
299
|
+
n++, e.onFail?.(n, h), z(x).then(() => f() ? void 0 : O()).then(() => {
|
|
300
300
|
t ? b(h) : m();
|
|
301
301
|
});
|
|
302
302
|
});
|
|
@@ -311,12 +311,13 @@ function oe(e) {
|
|
|
311
311
|
start: () => (c() ? m() : O().then(m), o)
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
|
-
|
|
314
|
+
var V = (e) => setTimeout(e, 0);
|
|
315
|
+
function $() {
|
|
315
316
|
let e = [], t = 0, n = (i) => {
|
|
316
317
|
i();
|
|
317
318
|
}, r = (i) => {
|
|
318
319
|
i();
|
|
319
|
-
}, s =
|
|
320
|
+
}, s = V;
|
|
320
321
|
const o = (i) => {
|
|
321
322
|
t ? e.push(i) : s(() => {
|
|
322
323
|
n(i);
|
|
@@ -370,7 +371,7 @@ function V() {
|
|
|
370
371
|
}
|
|
371
372
|
};
|
|
372
373
|
}
|
|
373
|
-
var
|
|
374
|
+
var ce = $(), ae = class {
|
|
374
375
|
#e;
|
|
375
376
|
destroy() {
|
|
376
377
|
this.clearGcTimeout();
|
|
@@ -383,53 +384,55 @@ var ue = V(), ce = class {
|
|
|
383
384
|
updateGcTime(e) {
|
|
384
385
|
this.gcTime = Math.max(
|
|
385
386
|
this.gcTime || 0,
|
|
386
|
-
e ?? (
|
|
387
|
+
e ?? (y ? 1 / 0 : 5 * 60 * 1e3)
|
|
387
388
|
);
|
|
388
389
|
}
|
|
389
390
|
clearGcTimeout() {
|
|
390
391
|
this.#e && (clearTimeout(this.#e), this.#e = void 0);
|
|
391
392
|
}
|
|
392
|
-
},
|
|
393
|
+
}, q = g.createContext(
|
|
393
394
|
void 0
|
|
394
|
-
),
|
|
395
|
-
const t =
|
|
395
|
+
), le = (e) => {
|
|
396
|
+
const t = g.useContext(q);
|
|
397
|
+
if (e)
|
|
398
|
+
return e;
|
|
396
399
|
if (!t)
|
|
397
400
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
398
401
|
return t;
|
|
399
|
-
},
|
|
402
|
+
}, fe = ({
|
|
400
403
|
client: e,
|
|
401
404
|
children: t
|
|
402
|
-
}) => (
|
|
405
|
+
}) => (g.useEffect(() => (e.mount(), () => {
|
|
403
406
|
e.unmount();
|
|
404
|
-
}), [e]), /* @__PURE__ */
|
|
407
|
+
}), [e]), /* @__PURE__ */ R(q.Provider, { value: e, children: t }));
|
|
405
408
|
export {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
409
|
+
fe as Q,
|
|
410
|
+
ae as R,
|
|
411
|
+
L as S,
|
|
412
|
+
_ as a,
|
|
413
|
+
Y as b,
|
|
414
|
+
ue as c,
|
|
415
|
+
P as d,
|
|
416
|
+
ie as e,
|
|
417
|
+
H as f,
|
|
418
|
+
X as g,
|
|
416
419
|
w as h,
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
420
|
+
oe as i,
|
|
421
|
+
y as j,
|
|
422
|
+
Q as k,
|
|
423
|
+
I as l,
|
|
424
|
+
K as m,
|
|
425
|
+
ce as n,
|
|
426
|
+
Z as o,
|
|
427
|
+
U as p,
|
|
428
|
+
ee as q,
|
|
429
|
+
ne as r,
|
|
430
|
+
te as s,
|
|
431
|
+
W as t,
|
|
432
|
+
le as u,
|
|
433
|
+
se as v,
|
|
434
|
+
re as w,
|
|
435
|
+
k as x,
|
|
436
|
+
B as y,
|
|
437
|
+
F as z
|
|
435
438
|
};
|