@declarion/react 0.39.0 → 0.40.0

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.
@@ -1,4 +1,4 @@
1
- import { Ln as e, _t as t, at as n, ft as r, mt as i, pt as a, r as o, t as s } from "./useCurrentScreen-BA2lb-d7.js";
1
+ import { Dt as e, Mt as t, Ot as n, Qn as r, bt as i, kt as a, r as o, t as s } from "./useCurrentScreen-mw8TfE8q.js";
2
2
  import { useState as c } from "react";
3
3
  import { MemoryRouter as l } from "react-router-dom";
4
4
  import { QueryClient as u, QueryClientProvider as d } from "@tanstack/react-query";
@@ -85,11 +85,11 @@ function C(e) {
85
85
  }
86
86
  return e;
87
87
  }
88
- function w(e) {
89
- let t = e.entityData ?? {};
90
- i((e, n) => {
91
- let r = t[e], i = C(r), a = i.meta?.per_page ?? 50, o = i.meta?.total ?? i.rows.length;
92
- return n.count === "only" ? {
88
+ function w(t) {
89
+ let r = t.entityData ?? {};
90
+ a((e, t) => {
91
+ let n = r[e], i = C(n), a = i.meta?.per_page ?? 50, o = i.meta?.total ?? i.rows.length;
92
+ return t.count === "only" ? {
93
93
  data: [],
94
94
  meta: {
95
95
  page: 1,
@@ -108,50 +108,50 @@ function w(e) {
108
108
  ...i.refs === void 0 ? {} : { $refs: i.refs }
109
109
  };
110
110
  });
111
- let o = e.entityItems ?? {}, s = e.entityItemResponses ?? {};
112
- a((e, t) => {
113
- let r = typeof t == "string" ? t : n(t), i = s[e]?.[r];
114
- if (i instanceof Error) throw i;
115
- if (i !== void 0) return i;
116
- let a = o[e]?.[r];
111
+ let o = t.entityItems ?? {}, s = t.entityItemResponses ?? {};
112
+ n((e, t) => {
113
+ let n = typeof t == "string" ? t : i(t), r = s[e]?.[n];
114
+ if (r instanceof Error) throw r;
115
+ if (r !== void 0) return r;
116
+ let a = o[e]?.[n];
117
117
  if (a instanceof Error) throw a;
118
118
  return { data: a };
119
119
  });
120
- let c = e.actionResults ?? {};
121
- r(async (e, t) => {
120
+ let c = t.actionResults ?? {};
121
+ e(async (e, t) => {
122
122
  if (!(e in c)) throw Error(`renderWithDeclarion: no action result registered for "${e}" (seed it via actionResults)`);
123
123
  let n = c[e];
124
124
  return x(typeof n == "function" ? await n(t) : n);
125
125
  });
126
126
  }
127
127
  function T() {
128
- i(null), a(null), r(null), t.setState({
128
+ a(null), n(null), e(null), t.setState({
129
129
  user: null,
130
130
  isAuthenticated: !1,
131
131
  activeTenant: null,
132
132
  tenants: []
133
133
  });
134
134
  }
135
- function E(t, n = {}) {
136
- let r = new u({ defaultOptions: { queries: {
135
+ function E(e, t = {}) {
136
+ let n = new u({ defaultOptions: { queries: {
137
137
  retry: !1,
138
138
  gcTime: Infinity
139
139
  } } });
140
- S(), r.setQueryData(["schema", !0], n.schema ?? g()), w(n);
141
- let i = n.screenCode ? /* @__PURE__ */ p(s, {
142
- code: n.screenCode,
143
- children: t
144
- }) : t, a = /* @__PURE__ */ m(d, {
145
- client: r,
140
+ S(), n.setQueryData(["schema", !0], t.schema ?? g()), w(t);
141
+ let i = t.screenCode ? /* @__PURE__ */ p(s, {
142
+ code: t.screenCode,
143
+ children: e
144
+ }) : e, a = /* @__PURE__ */ m(d, {
145
+ client: n,
146
146
  children: [/* @__PURE__ */ p(l, {
147
- initialEntries: [n.route ?? "/"],
147
+ initialEntries: [t.route ?? "/"],
148
148
  children: /* @__PURE__ */ p(o, { children: i })
149
149
  }), /* @__PURE__ */ p(f, {})]
150
- }), c = h(n.viewport ? /* @__PURE__ */ p(e, {
151
- viewportOverride: n.viewport,
150
+ }), c = h(t.viewport ? /* @__PURE__ */ p(r, {
151
+ viewportOverride: t.viewport,
152
152
  children: a
153
153
  }) : a);
154
- return Object.assign(c, { queryClient: r });
154
+ return Object.assign(c, { queryClient: n });
155
155
  }
156
156
  function D({ children: e, authenticated: n = !0, ...r }) {
157
157
  let [i] = c(() => {