@hortiview/modulebase 1.0.0 → 1.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/dist/{IsRestoringProvider-CBSZo7ur.js → IsRestoringProvider-D5gAh2bq.js} +13 -4
- package/dist/{ModuleCore-DuJVrj6v.js → ModuleCore-CVkmRANQ.js} +3450 -3438
- package/dist/{QueryClientProvider-DyiNrPkn.js → QueryClientProvider-CTj9TWgb.js} +176 -159
- package/dist/assets/ModuleCore.css +1 -1
- package/dist/{chunk-LFPYN7LY-D1ls8FXf.js → chunk-EVOBXE3Y-BoyVF_Ri.js} +2917 -2780
- package/dist/components/ModuleBase.js +2 -2
- package/dist/components/ModuleCore.js +1 -1
- package/dist/hooks/useCustom.js +1 -1
- package/dist/hooks/useCustomMutation.js +3 -3
- package/dist/hooks/useEntity.js +1 -1
- package/dist/hooks/useOffline.js +1 -1
- package/dist/hooks/useOption.js +1 -1
- package/dist/hooks/useServiceBus.js +1 -1
- package/dist/hooks/useStores.js +1 -1
- package/dist/main.js +7 -7
- package/dist/module-router.js +878 -840
- package/dist/{mutation-CmhiEgfA.js → mutation-BIuQs3WB.js} +1 -1
- package/dist/{omit-Do6MFRwA.js → omit-DYPaIq41.js} +121 -128
- package/dist/{useMutation-Aoachkw_.js → useMutation-SlEg4Gf2.js} +2 -2
- package/dist/{useQuery-DEU_AUtf.js → useQuery-jyZ1SNKl.js} +105 -105
- package/dist/utils/helper.js +2 -2
- package/package.json +24 -24
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
import { f as J, u as X } from "./IsRestoringProvider-
|
|
1
|
+
import { S as q, p as L, d as u, s as M, f as y, a as Q, j as _, k as j, t as K, l as w, m as $, r as B, n as W, b as z, u as G } from "./QueryClientProvider-CTj9TWgb.js";
|
|
2
|
+
import { f as J, u as X } from "./IsRestoringProvider-D5gAh2bq.js";
|
|
3
3
|
import * as m from "react";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
|
-
var Y = class extends
|
|
5
|
+
var Y = class extends q {
|
|
6
6
|
constructor(t, e) {
|
|
7
7
|
super(), this.options = e, this.#s = t, this.#i = null, this.#r = L(), this.bindMethods(), this.setOptions(e);
|
|
8
8
|
}
|
|
@@ -10,7 +10,7 @@ var Y = class extends z {
|
|
|
10
10
|
#t = void 0;
|
|
11
11
|
#p = void 0;
|
|
12
12
|
#e = void 0;
|
|
13
|
-
#
|
|
13
|
+
#a;
|
|
14
14
|
#u;
|
|
15
15
|
#r;
|
|
16
16
|
#i;
|
|
@@ -21,13 +21,13 @@ var Y = class extends z {
|
|
|
21
21
|
#d;
|
|
22
22
|
#o;
|
|
23
23
|
#h;
|
|
24
|
-
#
|
|
24
|
+
#n;
|
|
25
25
|
#f = /* @__PURE__ */ new Set();
|
|
26
26
|
bindMethods() {
|
|
27
27
|
this.refetch = this.refetch.bind(this);
|
|
28
28
|
}
|
|
29
29
|
onSubscribe() {
|
|
30
|
-
this.listeners.size === 1 && (this.#t.addObserver(this),
|
|
30
|
+
this.listeners.size === 1 && (this.#t.addObserver(this), A(this.#t, this.options) ? this.#c() : this.updateResult(), this.#y());
|
|
31
31
|
}
|
|
32
32
|
onUnsubscribe() {
|
|
33
33
|
this.hasListeners() || this.destroy();
|
|
@@ -51,11 +51,11 @@ var Y = class extends z {
|
|
|
51
51
|
}
|
|
52
52
|
setOptions(t) {
|
|
53
53
|
const e = this.options, s = this.#t;
|
|
54
|
-
if (this.options = this.#s.defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof
|
|
54
|
+
if (this.options = this.#s.defaultQueryOptions(t), this.options.enabled !== void 0 && typeof this.options.enabled != "boolean" && typeof this.options.enabled != "function" && typeof u(this.options.enabled, this.#t) != "boolean")
|
|
55
55
|
throw new Error(
|
|
56
56
|
"Expected enabled to be a boolean or a callback that returns a boolean"
|
|
57
57
|
);
|
|
58
|
-
this.#
|
|
58
|
+
this.#O(), this.#t.setOptions(this.options), e._defaulted && !M(this.options, e) && this.#s.getQueryCache().notify({
|
|
59
59
|
type: "observerOptionsUpdated",
|
|
60
60
|
query: this.#t,
|
|
61
61
|
observer: this
|
|
@@ -66,13 +66,13 @@ var Y = class extends z {
|
|
|
66
66
|
s,
|
|
67
67
|
this.options,
|
|
68
68
|
e
|
|
69
|
-
) && this.#c(), this.updateResult(), r && (this.#t !== s ||
|
|
70
|
-
const i = this.#
|
|
71
|
-
r && (this.#t !== s ||
|
|
69
|
+
) && this.#c(), this.updateResult(), r && (this.#t !== s || u(this.options.enabled, this.#t) !== u(e.enabled, this.#t) || y(this.options.staleTime, this.#t) !== y(e.staleTime, this.#t)) && this.#v();
|
|
70
|
+
const i = this.#b();
|
|
71
|
+
r && (this.#t !== s || u(this.options.enabled, this.#t) !== u(e.enabled, this.#t) || i !== this.#n) && this.#g(i);
|
|
72
72
|
}
|
|
73
73
|
getOptimisticResult(t) {
|
|
74
74
|
const e = this.#s.getQueryCache().build(this.#s, t), s = this.createResult(e, t);
|
|
75
|
-
return tt(this, s) && (this.#e = s, this.#u = this.options, this.#
|
|
75
|
+
return tt(this, s) && (this.#e = s, this.#u = this.options, this.#a = this.#t.state), s;
|
|
76
76
|
}
|
|
77
77
|
getCurrentResult() {
|
|
78
78
|
return this.#e;
|
|
@@ -108,121 +108,121 @@ var Y = class extends z {
|
|
|
108
108
|
}).then(() => (this.updateResult(), this.#e));
|
|
109
109
|
}
|
|
110
110
|
#c(t) {
|
|
111
|
-
this.#
|
|
111
|
+
this.#O();
|
|
112
112
|
let e = this.#t.fetch(
|
|
113
113
|
this.options,
|
|
114
114
|
t
|
|
115
115
|
);
|
|
116
116
|
return t?.throwOnError || (e = e.catch(Q)), e;
|
|
117
117
|
}
|
|
118
|
-
#
|
|
118
|
+
#v() {
|
|
119
119
|
this.#R();
|
|
120
|
-
const t =
|
|
120
|
+
const t = y(
|
|
121
121
|
this.options.staleTime,
|
|
122
122
|
this.#t
|
|
123
123
|
);
|
|
124
|
-
if (_ || this.#e.isStale || !j(t))
|
|
124
|
+
if (_.isServer() || this.#e.isStale || !j(t))
|
|
125
125
|
return;
|
|
126
126
|
const s = K(this.#e.dataUpdatedAt, t) + 1;
|
|
127
127
|
this.#o = w.setTimeout(() => {
|
|
128
128
|
this.#e.isStale || this.updateResult();
|
|
129
129
|
}, s);
|
|
130
130
|
}
|
|
131
|
-
#
|
|
131
|
+
#b() {
|
|
132
132
|
return (typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.#t) : this.options.refetchInterval) ?? !1;
|
|
133
133
|
}
|
|
134
134
|
#g(t) {
|
|
135
|
-
this.#S(), this.#
|
|
135
|
+
this.#S(), this.#n = t, !(_.isServer() || u(this.options.enabled, this.#t) === !1 || !j(this.#n) || this.#n === 0) && (this.#h = w.setInterval(() => {
|
|
136
136
|
(this.options.refetchIntervalInBackground || $.isFocused()) && this.#c();
|
|
137
|
-
}, this.#
|
|
137
|
+
}, this.#n));
|
|
138
138
|
}
|
|
139
|
-
#
|
|
140
|
-
this.#
|
|
139
|
+
#y() {
|
|
140
|
+
this.#v(), this.#g(this.#b());
|
|
141
141
|
}
|
|
142
142
|
#R() {
|
|
143
|
-
this.#o && (w.clearTimeout(this.#o), this.#o = void 0);
|
|
143
|
+
this.#o !== void 0 && (w.clearTimeout(this.#o), this.#o = void 0);
|
|
144
144
|
}
|
|
145
145
|
#S() {
|
|
146
|
-
this.#h && (w.clearInterval(this.#h), this.#h = void 0);
|
|
146
|
+
this.#h !== void 0 && (w.clearInterval(this.#h), this.#h = void 0);
|
|
147
147
|
}
|
|
148
148
|
createResult(t, e) {
|
|
149
|
-
const s = this.#t, r = this.options, i = this.#e,
|
|
150
|
-
let
|
|
149
|
+
const s = this.#t, r = this.options, i = this.#e, l = this.#a, n = this.#u, v = t !== s ? t.state : this.#p, { state: h } = t;
|
|
150
|
+
let a = { ...h }, b = !1, o;
|
|
151
151
|
if (e._optimisticResults) {
|
|
152
|
-
const c = this.hasListeners(), g = !c &&
|
|
153
|
-
(g || S) && (
|
|
154
|
-
...
|
|
152
|
+
const c = this.hasListeners(), g = !c && A(t, e), S = c && H(t, s, e, r);
|
|
153
|
+
(g || S) && (a = {
|
|
154
|
+
...a,
|
|
155
155
|
...J(h.data, t.options)
|
|
156
|
-
}), e._optimisticResults === "isRestoring" && (
|
|
156
|
+
}), e._optimisticResults === "isRestoring" && (a.fetchStatus = "idle");
|
|
157
157
|
}
|
|
158
|
-
let { error: R, errorUpdatedAt: x, status: p } =
|
|
159
|
-
o =
|
|
160
|
-
let
|
|
158
|
+
let { error: R, errorUpdatedAt: x, status: p } = a;
|
|
159
|
+
o = a.data;
|
|
160
|
+
let D = !1;
|
|
161
161
|
if (e.placeholderData !== void 0 && o === void 0 && p === "pending") {
|
|
162
162
|
let c;
|
|
163
|
-
i?.isPlaceholderData && e.placeholderData ===
|
|
163
|
+
i?.isPlaceholderData && e.placeholderData === n?.placeholderData ? (c = i.data, D = !0) : c = typeof e.placeholderData == "function" ? e.placeholderData(
|
|
164
164
|
this.#d?.state.data,
|
|
165
165
|
this.#d
|
|
166
|
-
) : e.placeholderData, c !== void 0 && (p = "success", o =
|
|
166
|
+
) : e.placeholderData, c !== void 0 && (p = "success", o = B(
|
|
167
167
|
i?.data,
|
|
168
168
|
c,
|
|
169
169
|
e
|
|
170
|
-
),
|
|
170
|
+
), b = !0);
|
|
171
171
|
}
|
|
172
|
-
if (e.select && o !== void 0 && !
|
|
173
|
-
if (i && o ===
|
|
172
|
+
if (e.select && o !== void 0 && !D)
|
|
173
|
+
if (i && o === l?.data && e.select === this.#m)
|
|
174
174
|
o = this.#l;
|
|
175
175
|
else
|
|
176
176
|
try {
|
|
177
|
-
this.#m = e.select, o = e.select(o), o =
|
|
177
|
+
this.#m = e.select, o = e.select(o), o = B(i?.data, o, e), this.#l = o, this.#i = null;
|
|
178
178
|
} catch (c) {
|
|
179
179
|
this.#i = c;
|
|
180
180
|
}
|
|
181
181
|
this.#i && (R = this.#i, o = this.#l, x = Date.now(), p = "error");
|
|
182
|
-
const C =
|
|
182
|
+
const C = a.fetchStatus === "fetching", I = p === "pending", T = p === "error", U = I && C, k = o !== void 0, f = {
|
|
183
183
|
status: p,
|
|
184
|
-
fetchStatus:
|
|
184
|
+
fetchStatus: a.fetchStatus,
|
|
185
185
|
isPending: I,
|
|
186
186
|
isSuccess: p === "success",
|
|
187
187
|
isError: T,
|
|
188
|
-
isInitialLoading:
|
|
189
|
-
isLoading:
|
|
188
|
+
isInitialLoading: U,
|
|
189
|
+
isLoading: U,
|
|
190
190
|
data: o,
|
|
191
|
-
dataUpdatedAt:
|
|
191
|
+
dataUpdatedAt: a.dataUpdatedAt,
|
|
192
192
|
error: R,
|
|
193
193
|
errorUpdatedAt: x,
|
|
194
|
-
failureCount:
|
|
195
|
-
failureReason:
|
|
196
|
-
errorUpdateCount:
|
|
197
|
-
isFetched:
|
|
198
|
-
isFetchedAfterMount:
|
|
194
|
+
failureCount: a.fetchFailureCount,
|
|
195
|
+
failureReason: a.fetchFailureReason,
|
|
196
|
+
errorUpdateCount: a.errorUpdateCount,
|
|
197
|
+
isFetched: t.isFetched(),
|
|
198
|
+
isFetchedAfterMount: a.dataUpdateCount > v.dataUpdateCount || a.errorUpdateCount > v.errorUpdateCount,
|
|
199
199
|
isFetching: C,
|
|
200
200
|
isRefetching: C && !I,
|
|
201
201
|
isLoadingError: T && !k,
|
|
202
|
-
isPaused:
|
|
203
|
-
isPlaceholderData:
|
|
202
|
+
isPaused: a.fetchStatus === "paused",
|
|
203
|
+
isPlaceholderData: b,
|
|
204
204
|
isRefetchError: T && k,
|
|
205
205
|
isStale: P(t, e),
|
|
206
206
|
refetch: this.refetch,
|
|
207
207
|
promise: this.#r,
|
|
208
|
-
isEnabled:
|
|
208
|
+
isEnabled: u(e.enabled, t) !== !1
|
|
209
209
|
};
|
|
210
210
|
if (this.options.experimental_prefetchInRender) {
|
|
211
|
-
const c = f.data !== void 0, g = f.status === "error" && !c, S = (
|
|
212
|
-
g ?
|
|
211
|
+
const c = f.data !== void 0, g = f.status === "error" && !c, S = (E) => {
|
|
212
|
+
g ? E.reject(f.error) : c && E.resolve(f.data);
|
|
213
213
|
}, N = () => {
|
|
214
|
-
const
|
|
215
|
-
S(
|
|
216
|
-
},
|
|
217
|
-
switch (
|
|
214
|
+
const E = this.#r = f.promise = L();
|
|
215
|
+
S(E);
|
|
216
|
+
}, O = this.#r;
|
|
217
|
+
switch (O.status) {
|
|
218
218
|
case "pending":
|
|
219
|
-
t.queryHash === s.queryHash && S(
|
|
219
|
+
t.queryHash === s.queryHash && S(O);
|
|
220
220
|
break;
|
|
221
221
|
case "fulfilled":
|
|
222
|
-
(g || f.data !==
|
|
222
|
+
(g || f.data !== O.value) && N();
|
|
223
223
|
break;
|
|
224
224
|
case "rejected":
|
|
225
|
-
(!g || f.error !==
|
|
225
|
+
(!g || f.error !== O.reason) && N();
|
|
226
226
|
break;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -230,7 +230,7 @@ var Y = class extends z {
|
|
|
230
230
|
}
|
|
231
231
|
updateResult() {
|
|
232
232
|
const t = this.#e, e = this.createResult(this.#t, this.options);
|
|
233
|
-
if (this.#
|
|
233
|
+
if (this.#a = this.#t.state, this.#u = this.options, this.#a.data !== void 0 && (this.#d = this.#t), M(e, t))
|
|
234
234
|
return;
|
|
235
235
|
this.#e = e;
|
|
236
236
|
const s = () => {
|
|
@@ -239,17 +239,17 @@ var Y = class extends z {
|
|
|
239
239
|
const { notifyOnChangeProps: r } = this.options, i = typeof r == "function" ? r() : r;
|
|
240
240
|
if (i === "all" || !i && !this.#f.size)
|
|
241
241
|
return !0;
|
|
242
|
-
const
|
|
242
|
+
const l = new Set(
|
|
243
243
|
i ?? this.#f
|
|
244
244
|
);
|
|
245
|
-
return this.options.throwOnError &&
|
|
246
|
-
const d =
|
|
247
|
-
return this.#e[d] !== t[d] &&
|
|
245
|
+
return this.options.throwOnError && l.add("error"), Object.keys(this.#e).some((n) => {
|
|
246
|
+
const d = n;
|
|
247
|
+
return this.#e[d] !== t[d] && l.has(d);
|
|
248
248
|
});
|
|
249
249
|
};
|
|
250
|
-
this.#
|
|
250
|
+
this.#E({ listeners: s() });
|
|
251
251
|
}
|
|
252
|
-
#
|
|
252
|
+
#O() {
|
|
253
253
|
const t = this.#s.getQueryCache().build(this.#s, this.options);
|
|
254
254
|
if (t === this.#t)
|
|
255
255
|
return;
|
|
@@ -257,9 +257,9 @@ var Y = class extends z {
|
|
|
257
257
|
this.#t = t, this.#p = t.state, this.hasListeners() && (e?.removeObserver(this), t.addObserver(this));
|
|
258
258
|
}
|
|
259
259
|
onQueryUpdate() {
|
|
260
|
-
this.updateResult(), this.hasListeners() && this.#
|
|
260
|
+
this.updateResult(), this.hasListeners() && this.#y();
|
|
261
261
|
}
|
|
262
|
-
#
|
|
262
|
+
#E(t) {
|
|
263
263
|
W.batch(() => {
|
|
264
264
|
t.listeners && this.listeners.forEach((e) => {
|
|
265
265
|
e(this.#e);
|
|
@@ -271,23 +271,23 @@ var Y = class extends z {
|
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
273
|
function Z(t, e) {
|
|
274
|
-
return
|
|
274
|
+
return u(e.enabled, t) !== !1 && t.state.data === void 0 && !(t.state.status === "error" && u(e.retryOnMount, t) === !1);
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function A(t, e) {
|
|
277
277
|
return Z(t, e) || t.state.data !== void 0 && F(t, e, e.refetchOnMount);
|
|
278
278
|
}
|
|
279
279
|
function F(t, e, s) {
|
|
280
|
-
if (
|
|
280
|
+
if (u(e.enabled, t) !== !1 && y(e.staleTime, t) !== "static") {
|
|
281
281
|
const r = typeof s == "function" ? s(t) : s;
|
|
282
282
|
return r === "always" || r !== !1 && P(t, e);
|
|
283
283
|
}
|
|
284
284
|
return !1;
|
|
285
285
|
}
|
|
286
286
|
function H(t, e, s, r) {
|
|
287
|
-
return (t !== e ||
|
|
287
|
+
return (t !== e || u(r.enabled, t) === !1) && (!s.suspense || t.state.status !== "error") && P(t, s);
|
|
288
288
|
}
|
|
289
289
|
function P(t, e) {
|
|
290
|
-
return
|
|
290
|
+
return u(e.enabled, t) !== !1 && t.isStaleByTime(y(e.staleTime, t));
|
|
291
291
|
}
|
|
292
292
|
function tt(t, e) {
|
|
293
293
|
return !M(t.getCurrentResult(), e);
|
|
@@ -305,19 +305,19 @@ function et() {
|
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
var st = m.createContext(et()), rt = () => m.useContext(st), it = (t, e, s) => {
|
|
308
|
-
const r = s?.state.error && typeof t.throwOnError == "function" ?
|
|
308
|
+
const r = s?.state.error && typeof t.throwOnError == "function" ? z(t.throwOnError, [s.state.error, s]) : t.throwOnError;
|
|
309
309
|
(t.suspense || t.experimental_prefetchInRender || r) && (e.isReset() || (t.retryOnMount = !1));
|
|
310
|
-
},
|
|
310
|
+
}, nt = (t) => {
|
|
311
311
|
m.useEffect(() => {
|
|
312
312
|
t.clearReset();
|
|
313
313
|
}, [t]);
|
|
314
|
-
},
|
|
314
|
+
}, at = ({
|
|
315
315
|
result: t,
|
|
316
316
|
errorResetBoundary: e,
|
|
317
317
|
throwOnError: s,
|
|
318
318
|
query: r,
|
|
319
319
|
suspense: i
|
|
320
|
-
}) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 ||
|
|
320
|
+
}) => t.isError && !e.isReset() && !t.isFetching && r && (i && t.data === void 0 || z(s, [t.error, r])), ot = (t) => {
|
|
321
321
|
if (t.suspense) {
|
|
322
322
|
const s = (i) => i === "static" ? i : Math.max(i ?? 1e3, 1e3), r = t.staleTime;
|
|
323
323
|
t.staleTime = typeof r == "function" ? (...i) => s(r(...i)) : s(r), typeof t.gcTime == "number" && (t.gcTime = Math.max(
|
|
@@ -333,54 +333,54 @@ function ut(t, e, s) {
|
|
|
333
333
|
throw new Error(
|
|
334
334
|
'Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object'
|
|
335
335
|
);
|
|
336
|
-
const r = X(), i = rt(),
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
const r = X(), i = rt(), l = G(s), n = l.defaultQueryOptions(t);
|
|
337
|
+
l.getDefaultOptions().queries?._experimental_beforeQuery?.(
|
|
338
|
+
n
|
|
339
339
|
);
|
|
340
|
-
const d =
|
|
341
|
-
process.env.NODE_ENV !== "production" && (
|
|
342
|
-
`[${
|
|
343
|
-
)),
|
|
344
|
-
const
|
|
340
|
+
const d = l.getQueryCache().get(n.queryHash);
|
|
341
|
+
process.env.NODE_ENV !== "production" && (n.queryFn || console.error(
|
|
342
|
+
`[${n.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`
|
|
343
|
+
)), n._optimisticResults = r ? "isRestoring" : "optimistic", ot(n), it(n, i, d), nt(i);
|
|
344
|
+
const v = !l.getQueryCache().get(n.queryHash), [h] = m.useState(
|
|
345
345
|
() => new e(
|
|
346
|
-
|
|
347
|
-
|
|
346
|
+
l,
|
|
347
|
+
n
|
|
348
348
|
)
|
|
349
|
-
),
|
|
349
|
+
), a = h.getOptimisticResult(n), b = !r && t.subscribed !== !1;
|
|
350
350
|
if (m.useSyncExternalStore(
|
|
351
351
|
m.useCallback(
|
|
352
352
|
(o) => {
|
|
353
|
-
const R =
|
|
353
|
+
const R = b ? h.subscribe(W.batchCalls(o)) : Q;
|
|
354
354
|
return h.updateResult(), R;
|
|
355
355
|
},
|
|
356
|
-
[h,
|
|
356
|
+
[h, b]
|
|
357
357
|
),
|
|
358
358
|
() => h.getCurrentResult(),
|
|
359
359
|
() => h.getCurrentResult()
|
|
360
360
|
), m.useEffect(() => {
|
|
361
|
-
h.setOptions(
|
|
362
|
-
}, [
|
|
363
|
-
throw V(
|
|
364
|
-
if (
|
|
365
|
-
result:
|
|
361
|
+
h.setOptions(n);
|
|
362
|
+
}, [n, h]), ct(n, a))
|
|
363
|
+
throw V(n, h, i);
|
|
364
|
+
if (at({
|
|
365
|
+
result: a,
|
|
366
366
|
errorResetBoundary: i,
|
|
367
|
-
throwOnError:
|
|
367
|
+
throwOnError: n.throwOnError,
|
|
368
368
|
query: d,
|
|
369
|
-
suspense:
|
|
369
|
+
suspense: n.suspense
|
|
370
370
|
}))
|
|
371
|
-
throw
|
|
372
|
-
return
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
),
|
|
371
|
+
throw a.error;
|
|
372
|
+
return l.getDefaultOptions().queries?._experimental_afterQuery?.(
|
|
373
|
+
n,
|
|
374
|
+
a
|
|
375
|
+
), n.experimental_prefetchInRender && !_.isServer() && ht(a, r) && (v ? (
|
|
376
376
|
// Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
|
|
377
|
-
V(
|
|
377
|
+
V(n, h, i)
|
|
378
378
|
) : (
|
|
379
379
|
// subscribe to the "cache promise" so that we can finalize the currentThenable once data comes in
|
|
380
380
|
d?.promise
|
|
381
381
|
))?.catch(Q).finally(() => {
|
|
382
382
|
h.updateResult();
|
|
383
|
-
}),
|
|
383
|
+
}), n.notifyOnChangeProps ? a : h.trackResult(a);
|
|
384
384
|
}
|
|
385
385
|
function mt(t, e) {
|
|
386
386
|
return ut(t, Y, e);
|
package/dist/utils/helper.js
CHANGED
|
@@ -25,7 +25,7 @@ const g = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([
|
|
|
25
25
|
}, E = (r, e) => {
|
|
26
26
|
const t = c(r), n = c(e), o = t.pop(), i = n.pop(), s = p(t, n);
|
|
27
27
|
return s !== 0 ? s : o && i ? p(o.split("."), i.split(".")) : o || i ? o ? -1 : 1 : 0;
|
|
28
|
-
}, d = "0.0
|
|
28
|
+
}, d = "1.0.0", w = (r) => m.every((e) => y(e, r)), y = (r, e) => {
|
|
29
29
|
if (!e[r]) {
|
|
30
30
|
if (e.throwError)
|
|
31
31
|
return e.throwError(`Missing required prop: ${r}`, 404), !1;
|
|
@@ -47,7 +47,7 @@ const g = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([
|
|
|
47
47
|
export {
|
|
48
48
|
w as arePropsValid,
|
|
49
49
|
M as checkConfig,
|
|
50
|
-
|
|
50
|
+
y as checkIfPropExists,
|
|
51
51
|
S as checkVersion,
|
|
52
52
|
P as getEnvironmentVariables,
|
|
53
53
|
R as getModuleQueryKey,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hortiview/modulebase",
|
|
3
3
|
"description": "This is a base module for hortiview",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Falk Menge <falk.menge.ext@bayer.com>",
|
|
7
7
|
"contributors": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"tsCheck": "tsc --build --pretty --watch"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@hortiview/default-components": "^1.
|
|
29
|
-
"@hortiview/shared-components": "^2.
|
|
30
|
-
"@microsoft/signalr": "^8.0.
|
|
31
|
-
"@tanstack/query-async-storage-persister": "^5.
|
|
32
|
-
"@tanstack/react-query": "^5.
|
|
33
|
-
"@tanstack/react-query-persist-client": "^5.
|
|
28
|
+
"@hortiview/default-components": "^1.5.3",
|
|
29
|
+
"@hortiview/shared-components": "^2.23.4",
|
|
30
|
+
"@microsoft/signalr": "^8.0.17",
|
|
31
|
+
"@tanstack/query-async-storage-persister": "^5.100.1",
|
|
32
|
+
"@tanstack/react-query": "^5.100.1",
|
|
33
|
+
"@tanstack/react-query-persist-client": "^5.100.1",
|
|
34
34
|
"compare-versions": "^6.1.1",
|
|
35
35
|
"idb-keyval": "^6.2.2",
|
|
36
|
-
"lodash": "^4.
|
|
36
|
+
"lodash": "^4.18.1",
|
|
37
37
|
"react": "^18.3.1",
|
|
38
38
|
"react-dom": "^18.3.1",
|
|
39
|
-
"react-router": "^7.
|
|
39
|
+
"react-router": "^7.14.2",
|
|
40
40
|
"react-signalr": "^0.2.24",
|
|
41
|
-
"socket.io-client": "^4.8.
|
|
42
|
-
"vite-plugin-dts": "^4.5.
|
|
43
|
-
"vite-plugin-lib-inject-css": "^2.2.
|
|
44
|
-
"zustand": "^5.0.
|
|
41
|
+
"socket.io-client": "^4.8.3",
|
|
42
|
+
"vite-plugin-dts": "^4.5.4",
|
|
43
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
44
|
+
"zustand": "^5.0.12"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@eslint/js": "^10.0.1",
|
|
48
48
|
"@semantic-release/changelog": "^6.0.3",
|
|
49
49
|
"@semantic-release/exec": "^7.1.0",
|
|
50
50
|
"@semantic-release/git": "^10.0.1",
|
|
51
|
-
"@types/lodash": "^4.17.
|
|
52
|
-
"@types/node": "^22.
|
|
53
|
-
"@types/react": "^18.3.
|
|
54
|
-
"@types/react-dom": "^18.3.
|
|
55
|
-
"@vitejs/plugin-react": "^5.
|
|
56
|
-
"conventional-changelog-conventionalcommits": "^9.3.
|
|
57
|
-
"eslint": "^10.
|
|
58
|
-
"eslint-plugin-react-hooks": "^7.
|
|
51
|
+
"@types/lodash": "^4.17.24",
|
|
52
|
+
"@types/node": "^22.19.17",
|
|
53
|
+
"@types/react": "^18.3.28",
|
|
54
|
+
"@types/react-dom": "^18.3.7",
|
|
55
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
56
|
+
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
57
|
+
"eslint": "^10.2.1",
|
|
58
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
59
59
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
60
60
|
"glob": "^13.0.6",
|
|
61
|
-
"globals": "^17.
|
|
61
|
+
"globals": "^17.5.0",
|
|
62
62
|
"typescript": "~5.9.3",
|
|
63
|
-
"typescript-eslint": "^8.
|
|
64
|
-
"vite": "^7.3.
|
|
63
|
+
"typescript-eslint": "^8.59.0",
|
|
64
|
+
"vite": "^7.3.2"
|
|
65
65
|
}
|
|
66
66
|
}
|