@hortiview/modulebase 0.0.12628 → 0.0.13100-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-YCIFN_02.js +14973 -0
- package/dist/{QueryClientProvider-Q_mWQTzQ.js → QueryClientProvider-Beog9TR7.js} +39 -37
- 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 +51 -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-CLuxJVSA.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 +37 -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 +10 -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}/ModuleApi.d.ts +5 -5
- 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 +215 -133
- package/dist/{mutation-X73nm7Df.js → mutation-DSKlaYzY.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-zu8uxBak.js} +16 -16
- package/dist/{useQuery-CwwWze9O.js → useQuery-Bj9k9zik.js} +47 -47
- 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}/ServiceBus.d.ts +0 -0
- /package/dist/{types → lib/types}/SystemMessage.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as F from "react";
|
|
2
|
-
import { jsx as
|
|
3
|
-
var
|
|
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,7 +16,7 @@ var C = class {
|
|
|
16
16
|
}
|
|
17
17
|
onUnsubscribe() {
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, y = typeof window > "u" || "Deno" in globalThis;
|
|
20
20
|
function J() {
|
|
21
21
|
}
|
|
22
22
|
function _(e, t) {
|
|
@@ -155,13 +155,13 @@ function se(e, t) {
|
|
|
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
260
|
function ie(e) {
|
|
261
|
-
return e instanceof
|
|
261
|
+
return e instanceof C;
|
|
262
262
|
}
|
|
263
263
|
function oe(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
|
});
|
|
@@ -383,16 +383,18 @@ var ue = V(), ce = class {
|
|
|
383
383
|
updateGcTime(e) {
|
|
384
384
|
this.gcTime = Math.max(
|
|
385
385
|
this.gcTime || 0,
|
|
386
|
-
e ?? (
|
|
386
|
+
e ?? (y ? 1 / 0 : 5 * 60 * 1e3)
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
389
|
clearGcTimeout() {
|
|
390
390
|
this.#e && (clearTimeout(this.#e), this.#e = void 0);
|
|
391
391
|
}
|
|
392
|
-
},
|
|
392
|
+
}, q = F.createContext(
|
|
393
393
|
void 0
|
|
394
394
|
), ae = (e) => {
|
|
395
|
-
const t = F.useContext(
|
|
395
|
+
const t = F.useContext(q);
|
|
396
|
+
if (e)
|
|
397
|
+
return e;
|
|
396
398
|
if (!t)
|
|
397
399
|
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
398
400
|
return t;
|
|
@@ -401,35 +403,35 @@ var ue = V(), ce = class {
|
|
|
401
403
|
children: t
|
|
402
404
|
}) => (F.useEffect(() => (e.mount(), () => {
|
|
403
405
|
e.unmount();
|
|
404
|
-
}), [e]), /* @__PURE__ */
|
|
406
|
+
}), [e]), /* @__PURE__ */ R(q.Provider, { value: e, children: t }));
|
|
405
407
|
export {
|
|
406
408
|
le as Q,
|
|
407
409
|
ce as R,
|
|
408
|
-
|
|
410
|
+
L as S,
|
|
409
411
|
J as a,
|
|
410
412
|
X as b,
|
|
411
413
|
oe as c,
|
|
412
|
-
|
|
414
|
+
P as d,
|
|
413
415
|
se as e,
|
|
414
|
-
|
|
415
|
-
|
|
416
|
+
H as f,
|
|
417
|
+
W as g,
|
|
416
418
|
w as h,
|
|
417
419
|
ie as i,
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
y as j,
|
|
421
|
+
Q as k,
|
|
422
|
+
I as l,
|
|
423
|
+
K as m,
|
|
422
424
|
ue as n,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
425
|
+
Y as o,
|
|
426
|
+
U as p,
|
|
427
|
+
Z as q,
|
|
426
428
|
te as r,
|
|
427
|
-
|
|
429
|
+
ee as s,
|
|
428
430
|
B as t,
|
|
429
431
|
ae as u,
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
432
|
+
re as v,
|
|
433
|
+
ne as w,
|
|
434
|
+
k as x,
|
|
435
|
+
_ as y,
|
|
436
|
+
S as z
|
|
435
437
|
};
|