@hortiview/modulebase 0.0.16348 → 0.0.20436

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.
Files changed (47) hide show
  1. package/dist/ModuleCore-DpwHP0IU.js +14973 -0
  2. package/dist/{QueryClientProvider-VtJdNkDw.js → QueryClientProvider-Beog9TR7.js} +25 -23
  3. package/dist/{_baseGet-B7FwMMGI.js → _baseGet-C6jMXSsQ.js} +447 -447
  4. package/dist/api-CogBuK0n.js +473 -0
  5. package/dist/components/ModuleBase.js +1 -1
  6. package/dist/components/ModuleCore.js +9 -14698
  7. package/dist/constants.js +1 -1
  8. package/dist/enum/ActionStorage.js +4 -0
  9. package/dist/hooks/useCustom.js +15 -18
  10. package/dist/hooks/useCustomMutation.js +12 -11
  11. package/dist/hooks/useEntity.js +48 -60
  12. package/dist/hooks/useOffline.js +57 -0
  13. package/dist/hooks/useOption.js +20 -20
  14. package/dist/hooks/useServiceBus.js +1 -1
  15. package/dist/hooks/useStores.js +1 -1
  16. package/dist/{query-CFoO2uy7.js → isRestoring-CLuxJVSA.js} +21 -17
  17. package/dist/lib/constants.d.ts +1 -1
  18. package/dist/lib/enum/ActionStorage.d.ts +7 -0
  19. package/dist/lib/hooks/useCustom.d.ts +3 -2
  20. package/dist/lib/hooks/useCustomMutation.d.ts +2 -1
  21. package/dist/lib/hooks/useEntity.d.ts +9 -23
  22. package/dist/lib/hooks/useOffline.d.ts +15 -0
  23. package/dist/lib/hooks/useStores.d.ts +10 -2
  24. package/dist/lib/main.d.ts +4 -0
  25. package/dist/lib/types/ActionStorage.d.ts +8 -0
  26. package/dist/lib/types/BaseProps.d.ts +10 -1
  27. package/dist/lib/types/Deprecated.d.ts +4 -0
  28. package/dist/lib/types/Entities.d.ts +22 -0
  29. package/dist/lib/utils/IndexedDbService.d.ts +33 -0
  30. package/dist/lib/utils/api.d.ts +1 -1
  31. package/dist/lib/utils/baseFetches.d.ts +2 -2
  32. package/dist/lib/utils/fetches.d.ts +2 -2
  33. package/dist/lib/utils/helper.d.ts +1 -0
  34. package/dist/main.js +218 -144
  35. package/dist/{mutation-CnKIetRs.js → mutation-DSKlaYzY.js} +1 -1
  36. package/dist/{omit-B7MWDtHq.js → omit-C9Qe80rl.js} +1 -1
  37. package/dist/types/ActionStorage.js +1 -0
  38. package/dist/types/Entities.js +25 -0
  39. package/dist/{useMutation-Num57Ulc.js → useMutation-zu8uxBak.js} +16 -16
  40. package/dist/{useQuery-XBGd5Kep.js → useQuery-Bj9k9zik.js} +39 -39
  41. package/dist/utils/IndexedDbService.js +43 -0
  42. package/dist/utils/api.js +1 -1
  43. package/dist/utils/baseFetches.js +15 -15
  44. package/dist/utils/fetches.js +10 -10
  45. package/dist/utils/helper.js +25 -20
  46. package/package.json +7 -3
  47. package/dist/api-D9Lmqe6S.js +0 -458
@@ -1,9 +1,9 @@
1
- import { S as N, p as U, b as f, f as w, g as O, a as H, j as Q, k, t as V, l as z, r as M, n as A, u as W } from "./QueryClientProvider-VtJdNkDw.js";
2
- import { f as $ } from "./query-CFoO2uy7.js";
3
- import * as p from "react";
1
+ import { S as B, p as U, b as f, s as w, g as O, a as N, j as Q, k, t as H, l as V, r as M, n as A, u as z } from "./QueryClientProvider-Beog9TR7.js";
2
+ import { f as W, u as $ } from "./isRestoring-CLuxJVSA.js";
3
+ import * as y from "react";
4
4
  import "react/jsx-runtime";
5
5
  import { s as K, n as _ } from "./utils-DxRR_XLb.js";
6
- var G = class extends N {
6
+ var G = class extends B {
7
7
  constructor(e, t) {
8
8
  super(), this.options = t, this.#s = e, this.#r = null, this.#i = U(), this.options.experimental_prefetchInRender || this.#i.reject(
9
9
  new Error("experimental_prefetchInRender feature flag is not enabled")
@@ -117,7 +117,7 @@ var G = class extends N {
117
117
  this.options,
118
118
  e
119
119
  );
120
- return e?.throwOnError || (t = t.catch(H)), t;
120
+ return e?.throwOnError || (t = t.catch(N)), t;
121
121
  }
122
122
  #b() {
123
123
  this.#v();
@@ -127,7 +127,7 @@ var G = class extends N {
127
127
  );
128
128
  if (Q || this.#t.isStale || !k(e))
129
129
  return;
130
- const s = V(this.#t.dataUpdatedAt, e) + 1;
130
+ const s = H(this.#t.dataUpdatedAt, e) + 1;
131
131
  this.#o = setTimeout(() => {
132
132
  this.#t.isStale || this.updateResult();
133
133
  }, s);
@@ -137,7 +137,7 @@ var G = class extends N {
137
137
  }
138
138
  #g(e) {
139
139
  this.#O(), this.#n = e, !(Q || f(this.options.enabled, this.#e) === !1 || !k(this.#n) || this.#n === 0) && (this.#h = setInterval(() => {
140
- (this.options.refetchIntervalInBackground || z.isFocused()) && this.#u();
140
+ (this.options.refetchIntervalInBackground || V.isFocused()) && this.#u();
141
141
  }, this.#n));
142
142
  }
143
143
  #R() {
@@ -156,10 +156,10 @@ var G = class extends N {
156
156
  const h = this.hasListeners(), b = !h && j(e, t), m = h && L(e, s, t, r);
157
157
  (b || m) && (n = {
158
158
  ...n,
159
- ...$(c.data, e.options)
159
+ ...W(c.data, e.options)
160
160
  }), t._optimisticResults === "isRestoring" && (n.fetchStatus = "idle");
161
161
  }
162
- let { error: x, errorUpdatedAt: F, status: y } = n;
162
+ let { error: F, errorUpdatedAt: x, status: p } = n;
163
163
  if (t.select && n.data !== void 0)
164
164
  if (a && n.data === u?.data && t.select === this.#y)
165
165
  l = this.#l;
@@ -171,7 +171,7 @@ var G = class extends N {
171
171
  }
172
172
  else
173
173
  l = n.data;
174
- if (t.placeholderData !== void 0 && l === void 0 && y === "pending") {
174
+ if (t.placeholderData !== void 0 && l === void 0 && p === "pending") {
175
175
  let h;
176
176
  if (a?.isPlaceholderData && t.placeholderData === i?.placeholderData)
177
177
  h = a.data;
@@ -184,25 +184,25 @@ var G = class extends N {
184
184
  } catch (b) {
185
185
  this.#r = b;
186
186
  }
187
- h !== void 0 && (y = "success", l = M(
187
+ h !== void 0 && (p = "success", l = M(
188
188
  a?.data,
189
189
  h,
190
190
  t
191
191
  ), R = !0);
192
192
  }
193
- this.#r && (x = this.#r, l = this.#l, F = Date.now(), y = "error");
194
- const C = n.fetchStatus === "fetching", S = y === "pending", E = y === "error", D = S && C, P = l !== void 0, d = {
195
- status: y,
193
+ this.#r && (F = this.#r, l = this.#l, x = Date.now(), p = "error");
194
+ const C = n.fetchStatus === "fetching", S = p === "pending", E = p === "error", D = S && C, P = l !== void 0, d = {
195
+ status: p,
196
196
  fetchStatus: n.fetchStatus,
197
197
  isPending: S,
198
- isSuccess: y === "success",
198
+ isSuccess: p === "success",
199
199
  isError: E,
200
200
  isInitialLoading: D,
201
201
  isLoading: D,
202
202
  data: l,
203
203
  dataUpdatedAt: n.dataUpdatedAt,
204
- error: x,
205
- errorUpdatedAt: F,
204
+ error: F,
205
+ errorUpdatedAt: x,
206
206
  failureCount: n.fetchFailureCount,
207
207
  failureReason: n.fetchFailureReason,
208
208
  errorUpdateCount: n.errorUpdateCount,
@@ -303,9 +303,7 @@ function I(e, t) {
303
303
  function X(e, t) {
304
304
  return !w(e.getCurrentResult(), t);
305
305
  }
306
- var B = p.createContext(!1), Y = () => p.useContext(B);
307
- B.Provider;
308
- function Z() {
306
+ function Y() {
309
307
  let e = !1;
310
308
  return {
311
309
  clearReset: () => {
@@ -317,43 +315,43 @@ function Z() {
317
315
  isReset: () => e
318
316
  };
319
317
  }
320
- var ee = p.createContext(Z()), te = () => p.useContext(ee), se = (e, t) => {
318
+ var Z = y.createContext(Y()), ee = () => y.useContext(Z), te = (e, t) => {
321
319
  (e.suspense || e.throwOnError || e.experimental_prefetchInRender) && (t.isReset() || (e.retryOnMount = !1));
322
- }, re = (e) => {
323
- p.useEffect(() => {
320
+ }, se = (e) => {
321
+ y.useEffect(() => {
324
322
  e.clearReset();
325
323
  }, [e]);
326
- }, ie = ({
324
+ }, re = ({
327
325
  result: e,
328
326
  errorResetBoundary: t,
329
327
  throwOnError: s,
330
328
  query: r,
331
329
  suspense: a
332
- }) => e.isError && !t.isReset() && !e.isFetching && r && (a && e.data === void 0 || K(s, [e.error, r])), ne = (e) => {
330
+ }) => e.isError && !t.isReset() && !e.isFetching && r && (a && e.data === void 0 || K(s, [e.error, r])), ie = (e) => {
333
331
  const t = e.staleTime;
334
332
  e.suspense && (e.staleTime = typeof t == "function" ? (...s) => Math.max(t(...s), 1e3) : Math.max(t ?? 1e3, 1e3), typeof e.gcTime == "number" && (e.gcTime = Math.max(e.gcTime, 1e3)));
335
- }, ae = (e, t) => e.isLoading && e.isFetching && !t, oe = (e, t) => e?.suspense && t.isPending, q = (e, t, s) => t.fetchOptimistic(e).catch(() => {
333
+ }, ne = (e, t) => e.isLoading && e.isFetching && !t, ae = (e, t) => e?.suspense && t.isPending, q = (e, t, s) => t.fetchOptimistic(e).catch(() => {
336
334
  s.clearReset();
337
335
  });
338
- function he(e, t, s) {
336
+ function oe(e, t, s) {
339
337
  if (process.env.NODE_ENV !== "production" && (typeof e != "object" || Array.isArray(e)))
340
338
  throw new Error(
341
339
  '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'
342
340
  );
343
- const r = W(), a = Y(), u = te(), i = r.defaultQueryOptions(e);
341
+ const r = z(s), a = $(), u = ee(), i = r.defaultQueryOptions(e);
344
342
  r.getDefaultOptions().queries?._experimental_beforeQuery?.(
345
343
  i
346
344
  ), process.env.NODE_ENV !== "production" && (i.queryFn || console.error(
347
345
  `[${i.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`
348
- )), i._optimisticResults = a ? "isRestoring" : "optimistic", ne(i), se(i, u), re(u);
349
- const g = !r.getQueryCache().get(i.queryHash), [o] = p.useState(
346
+ )), i._optimisticResults = a ? "isRestoring" : "optimistic", ie(i), te(i, u), se(u);
347
+ const g = !r.getQueryCache().get(i.queryHash), [o] = y.useState(
350
348
  () => new t(
351
349
  r,
352
350
  i
353
351
  )
354
352
  ), c = o.getOptimisticResult(i), n = !a && e.subscribed !== !1;
355
- if (p.useSyncExternalStore(
356
- p.useCallback(
353
+ if (y.useSyncExternalStore(
354
+ y.useCallback(
357
355
  (R) => {
358
356
  const l = n ? o.subscribe(A.batchCalls(R)) : _;
359
357
  return o.updateResult(), l;
@@ -362,11 +360,11 @@ function he(e, t, s) {
362
360
  ),
363
361
  () => o.getCurrentResult(),
364
362
  () => o.getCurrentResult()
365
- ), p.useEffect(() => {
363
+ ), y.useEffect(() => {
366
364
  o.setOptions(i, { listeners: !1 });
367
- }, [i, o]), oe(i, c))
365
+ }, [i, o]), ae(i, c))
368
366
  throw q(i, o, u);
369
- if (ie({
367
+ if (re({
370
368
  result: c,
371
369
  errorResetBoundary: u,
372
370
  throwOnError: i.throwOnError,
@@ -377,7 +375,7 @@ function he(e, t, s) {
377
375
  return r.getDefaultOptions().queries?._experimental_afterQuery?.(
378
376
  i,
379
377
  c
380
- ), i.experimental_prefetchInRender && !Q && ae(c, a) && (g ? (
378
+ ), i.experimental_prefetchInRender && !Q && ne(c, a) && (g ? (
381
379
  // Fetch immediately on render in order to ensure `.promise` is resolved even if the component is unmounted
382
380
  q(i, o, u)
383
381
  ) : (
@@ -387,9 +385,11 @@ function he(e, t, s) {
387
385
  o.updateResult();
388
386
  }), i.notifyOnChangeProps ? c : o.trackResult(c);
389
387
  }
390
- function pe(e, t) {
391
- return he(e, G);
388
+ function fe(e, t) {
389
+ return oe(e, G, t);
392
390
  }
393
391
  export {
394
- pe as u
392
+ G as Q,
393
+ oe as a,
394
+ fe as u
395
395
  };
@@ -0,0 +1,43 @@
1
+ function a(e) {
2
+ return new Promise((n, t) => {
3
+ e.oncomplete = e.onsuccess = () => n(e.result), e.onabort = e.onerror = () => t(e.error);
4
+ });
5
+ }
6
+ function s(e, n) {
7
+ let t;
8
+ const o = () => {
9
+ if (t)
10
+ return t;
11
+ const r = indexedDB.open(e);
12
+ return r.onupgradeneeded = () => r.result.createObjectStore(n), t = a(r), t.then((c) => {
13
+ c.onclose = () => t = void 0;
14
+ }, () => {
15
+ }), t;
16
+ };
17
+ return (r, c) => o().then((d) => c(d.transaction(n, r).objectStore(n)));
18
+ }
19
+ let u;
20
+ function i() {
21
+ return u || (u = s("keyval-store", "keyval")), u;
22
+ }
23
+ function l(e, n = i()) {
24
+ return n("readonly", (t) => a(t.get(e)));
25
+ }
26
+ function f(e, n, t = i()) {
27
+ return t("readwrite", (o) => (o.put(n, e), a(o.transaction)));
28
+ }
29
+ function p(e, n = i()) {
30
+ return n("readwrite", (t) => (t.delete(e), a(t.transaction)));
31
+ }
32
+ const y = {
33
+ getItem: async (e) => await l(e),
34
+ setItem: async (e, n) => {
35
+ await f(e, n);
36
+ },
37
+ removeItem: async (e) => {
38
+ await p(e);
39
+ }
40
+ };
41
+ export {
42
+ y as indexedDbStorage
43
+ };
package/dist/utils/api.js CHANGED
@@ -1,4 +1,4 @@
1
- import { f as t, b as s, a as f, h as i } from "../api-D9Lmqe6S.js";
1
+ import { f as t, b as s, a as f, h as i } from "../api-CogBuK0n.js";
2
2
  import "../constants.js";
3
3
  import "../stores/BasePropsStore.js";
4
4
  export {
@@ -1,19 +1,19 @@
1
- import { a as d, f, i as m, b as S } from "../api-D9Lmqe6S.js";
1
+ import { a as u, f as m, i as S, b as I } from "../api-CogBuK0n.js";
2
2
  import { useBasePropsStore as t } from "../stores/BasePropsStore.js";
3
- const k = (n, o, a, e, s) => {
4
- const r = e ?? t.getState().modulePermissionToken, g = t.getState().organizationId, i = t.getState().currentLanguageId, c = t.getState().throwError;
5
- if (!r)
6
- return c?.("No token found", 404), Promise.reject();
7
- const u = d(r, g, i, a, s);
8
- return u.body = JSON.stringify(o), f(n, u);
9
- }, E = (n, o, a) => {
10
- const e = a ?? t.getState().modulePermissionToken, s = t.getState().organizationId, r = t.getState().currentLanguageId, g = t.getState().throwError;
11
- if (!e)
12
- return g?.("No token found", 404), Promise.reject();
13
- const i = d(e, s, r), c = m(o) ? "" : S(o);
14
- return f(`${n}${c}`, i);
3
+ const E = (s, e, g, o, r, n = !1) => {
4
+ const a = n ? void 0 : o ?? t.getState().modulePermissionToken, i = t.getState().organizationId, c = t.getState().currentLanguageId, d = t.getState().throwError;
5
+ if (!n && !a)
6
+ return d?.("No token found", 404), Promise.reject();
7
+ const f = u(a, i, c, g, r);
8
+ return f.body = JSON.stringify(e), m(s, f);
9
+ }, h = (s, e, g, o = !1) => {
10
+ const r = o ? void 0 : g ?? t.getState().modulePermissionToken, n = t.getState().organizationId, a = t.getState().currentLanguageId, i = t.getState().throwError;
11
+ if (!o && !r)
12
+ return i?.("No token found", 404), Promise.reject();
13
+ const c = u(r, n, a), d = S(e) ? "" : I(e);
14
+ return m(`${s}${d}`, c);
15
15
  };
16
16
  export {
17
- E as baseFetch,
18
- k as baseMutation
17
+ h as baseFetch,
18
+ E as baseMutation
19
19
  };
@@ -1,22 +1,22 @@
1
- import { useBasePropsStore as u } from "../stores/BasePropsStore.js";
1
+ import { useBasePropsStore as a } from "../stores/BasePropsStore.js";
2
2
  import { useEnvironmentStore as i } from "../stores/EnvironmentStore.js";
3
3
  import { baseMutation as d, baseFetch as o } from "./baseFetches.js";
4
- const p = (e, t, n = "POST", s, m) => d(e, t, n, s, m), I = (e, t) => r(`FarmOrgEntities/${e}/byId/${t}`), g = (e, t) => r(`ModuleDependentEntities/${e}/byId/${t}`), E = (e, t) => r(`ModuleDependentEntitiesRaw/${e}/byId/${t}`), A = (e, t) => o(`${e}`, {}, t), r = (e) => {
5
- const t = i.getState().environment, n = u.getState().organizationId;
4
+ const I = (e, t, n = "POST", s, m, u = !1) => d(e, t, n, s, m, u), g = (e, t) => r(`FarmOrgEntities/${e}/byId/${t}`), E = (e, t) => r(`ModuleDependentEntities/${e}/byId/${t}`), A = (e, t) => r(`ModuleDependentEntitiesRaw/${e}/byId/${t}`), M = (e, t, n = !1) => o(`${e}`, {}, t, n), r = (e) => {
5
+ const t = i.getState().environment, n = a.getState().organizationId;
6
6
  return o(
7
7
  `${t?.MODULE_AUTH_API}${t?.API_PREFIX}/${n}/${e}`,
8
8
  {}
9
9
  );
10
- }, M = (e) => {
10
+ }, f = (e) => {
11
11
  const t = i.getState().environment;
12
12
  return o(`${t?.COMMON_API}${t?.API_PREFIX}/${e}`, {});
13
13
  };
14
14
  export {
15
- M as fetchFromCommonApi,
16
- A as fetchFromCustomApi,
15
+ f as fetchFromCommonApi,
16
+ M as fetchFromCustomApi,
17
17
  r as fetchFromModuleApi,
18
- I as getFarmOrgEntities,
19
- g as getModuleDependedEntities,
20
- E as getModuleDependedEntitiesRaw,
21
- p as mutateOnCustomApi
18
+ g as getFarmOrgEntities,
19
+ E as getModuleDependedEntities,
20
+ A as getModuleDependedEntitiesRaw,
21
+ I as mutateOnCustomApi
22
22
  };
@@ -1,50 +1,55 @@
1
- import { REQUIRED_PROPS as d } from "../constants.js";
2
- const h = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, u = (r) => {
1
+ import { REQUIRED_PROPS as m } from "../constants.js";
2
+ import { useBasePropsStore as u } from "../stores/BasePropsStore.js";
3
+ const g = /^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i, c = (r) => {
3
4
  if (typeof r != "string")
4
5
  throw new TypeError("Invalid argument expected string");
5
- const e = r.match(h);
6
+ const e = r.match(g);
6
7
  if (!e)
7
8
  throw new Error(`Invalid argument not valid semver ('${r}' received)`);
8
9
  return e.shift(), e;
9
- }, c = (r) => r === "*" || r === "x" || r === "X", f = (r) => {
10
+ }, f = (r) => r === "*" || r === "x" || r === "X", l = (r) => {
10
11
  const e = parseInt(r, 10);
11
12
  return isNaN(e) ? r : e;
12
- }, m = (r, e) => typeof r != typeof e ? [String(r), String(e)] : [r, e], E = (r, e) => {
13
- if (c(r) || c(e))
13
+ }, h = (r, e) => typeof r != typeof e ? [String(r), String(e)] : [r, e], E = (r, e) => {
14
+ if (f(r) || f(e))
14
15
  return 0;
15
- const [n, t] = m(f(r), f(e));
16
+ const [n, t] = h(l(r), l(e));
16
17
  return n > t ? 1 : n < t ? -1 : 0;
17
- }, l = (r, e) => {
18
+ }, p = (r, e) => {
18
19
  for (let n = 0; n < Math.max(r.length, e.length); n++) {
19
20
  const t = E(r[n] || "0", e[n] || "0");
20
21
  if (t !== 0)
21
22
  return t;
22
23
  }
23
24
  return 0;
24
- }, g = (r, e) => {
25
- const n = u(r), t = u(e), i = n.pop(), o = t.pop(), s = l(n, t);
26
- return s !== 0 ? s : i && o ? l(i.split("."), o.split(".")) : i || o ? i ? -1 : 1 : 0;
27
- }, p = "0.0.16348", w = (r) => d.every((e) => v(e, r)), v = (r, e) => {
25
+ }, y = (r, e) => {
26
+ const n = c(r), t = c(e), o = n.pop(), i = t.pop(), s = p(n, t);
27
+ return s !== 0 ? s : o && i ? p(o.split("."), i.split(".")) : o || i ? o ? -1 : 1 : 0;
28
+ }, d = "0.0.20436", w = (r) => m.every((e) => a(e, r)), a = (r, e) => {
28
29
  if (!e[r]) {
29
30
  if (e.throwError)
30
31
  return e.throwError(`Missing required prop: ${r}`, 404), !1;
31
32
  throw new Error(`Missing required prop: ${r}`);
32
33
  }
33
34
  return !0;
34
- }, I = () => {
35
+ }, P = () => {
35
36
  const r = window.__env__;
36
37
  if (r && r.COMMON_API && r.MODULE_AUTH_API && r.API_PREFIX && r.ENVIRONMENT)
37
38
  return r;
38
- }, P = (r) => {
39
+ }, S = (r) => {
39
40
  if (!r?.REQ_VERSION) return null;
40
41
  const e = r.REQ_VERSION;
41
- return g(p, e) < 0 ? `ModuleBase version ${p} is probably not compatible with the current HortiView version ${e}. Please update the modulebase to be at least ${e}` : null;
42
- }, _ = (r) => typeof r == "string" || typeof r == "boolean" || typeof r == "number" ? r : typeof r == "object" && "value" in r ? r.value : typeof r == "object" && "items" in r ? r.items : (Array.isArray(r), r), a = (r) => r;
42
+ return y(d, e) < 0 ? `ModuleBase version ${d} is probably not compatible with the current HortiView version ${e}. Please update the modulebase to be at least ${e}` : null;
43
+ }, _ = (r) => typeof r == "string" || typeof r == "boolean" || typeof r == "number" ? r : typeof r == "object" && "value" in r ? r.value : typeof r == "object" && "items" in r ? r.items : (Array.isArray(r), r), M = (r) => r, R = (r) => {
44
+ const e = u.getState().organizationId, n = u.getState().moduleId;
45
+ return [...r, e, n];
46
+ };
43
47
  export {
44
48
  w as arePropsValid,
45
- a as checkConfig,
46
- v as checkIfPropExists,
47
- P as checkVersion,
48
- I as getEnvironmentVariables,
49
+ M as checkConfig,
50
+ a as checkIfPropExists,
51
+ S as checkVersion,
52
+ P as getEnvironmentVariables,
53
+ R as getModuleQueryKey,
49
54
  _ as universalSelector
50
55
  };
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": "0.0.16348",
4
+ "version": "0.0.20436",
5
5
  "type": "module",
6
6
  "author": "Falk Menge <falk.menge.ext@bayer.com>",
7
7
  "contributors": [
@@ -20,13 +20,16 @@
20
20
  "dev": "vite",
21
21
  "build": "tsc -b && vite build",
22
22
  "lint": "eslint .",
23
- "preview": "vite preview"
23
+ "preview": "vite preview",
24
+ "tsCheck": "tsc --build --pretty --watch"
24
25
  },
25
26
  "dependencies": {
26
27
  "@hortiview/default-components": "^1.2.1",
27
28
  "@hortiview/shared-components": "^2.0.0",
28
29
  "@microsoft/signalr": "^8.0.7",
30
+ "@tanstack/query-async-storage-persister": "^5.85.5",
29
31
  "@tanstack/react-query": "^5.67.3",
32
+ "@tanstack/react-query-persist-client": "^5.85.5",
30
33
  "compare-versions": "^6.1.1",
31
34
  "lodash": "^4.17.21",
32
35
  "odata-query": "^7.0.9",
@@ -37,7 +40,8 @@
37
40
  "socket.io-client": "^4.8.1",
38
41
  "vite-plugin-dts": "^4.5.0",
39
42
  "vite-plugin-lib-inject-css": "^2.2.1",
40
- "zustand": "^5.0.3"
43
+ "zustand": "^5.0.3",
44
+ "idb-keyval": "^6.2.2"
41
45
  },
42
46
  "devDependencies": {
43
47
  "@eslint/js": "^9.17.0",