@nivaro/react 0.3.59 → 0.3.61

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,27 +1,40 @@
1
- const s = (i) => String(i ?? "").toUpperCase();
2
- function k(i, u, p) {
3
- const n = new Map(u.map((t) => [s(t.id), t])).get(s(i));
1
+ const p = (t) => String(t ?? "").toUpperCase();
2
+ function k(t, r, o) {
3
+ const n = new Map(r.map((e) => [p(e.id), e])).get(p(t));
4
4
  if (!n) return null;
5
- if (!p) return { state: n, skipped: [] };
6
- const a = (t) => {
7
- for (const [e, o] of Object.entries(p)) if (s(e) === s(t)) return o;
8
- }, b = [...u].filter((t) => t.sort != null && Number.isFinite(Number(t.sort))).sort((t, e) => Number(t.sort) - Number(e.sort)), d = [];
9
- let r = n;
10
- for (let t = 0; t < u.length; t++) {
11
- const e = a(r.id);
12
- if (!(e != null && e.skipped)) break;
13
- d.push({ state: r, reasons: (e.skip_reasons ?? []).filter(Boolean) });
14
- const o = b.find(
15
- (f) => {
16
- var l;
17
- return Number(f.sort) > Number(r.sort) && ((l = a(f.id)) == null ? void 0 : l.on_path) !== !1;
5
+ if (!o) return { state: n, skipped: [] };
6
+ const f = (e) => {
7
+ for (const [s, u] of Object.entries(o)) if (p(s) === p(e)) return u;
8
+ }, b = [...r].filter((e) => e.sort != null && Number.isFinite(Number(e.sort))).sort((e, s) => Number(e.sort) - Number(s.sort)), l = [];
9
+ let i = n;
10
+ for (let e = 0; e < r.length; e++) {
11
+ const s = f(i.id);
12
+ if (!(s != null && s.skipped)) break;
13
+ l.push({ state: i, reasons: (s.skip_reasons ?? []).filter(Boolean) });
14
+ const u = b.find(
15
+ (c) => {
16
+ var d;
17
+ return Number(c.sort) > Number(i.sort) && ((d = f(c.id)) == null ? void 0 : d.on_path) !== !1;
18
18
  }
19
19
  );
20
- if (!o) return { state: n, skipped: [] };
21
- r = o;
20
+ if (!u) return { state: n, skipped: [] };
21
+ i = u;
22
22
  }
23
- return { state: r, skipped: d };
23
+ return { state: i, skipped: l };
24
+ }
25
+ function g(t) {
26
+ const r = [];
27
+ for (const o of (t == null ? void 0 : t.skipped) ?? []) {
28
+ const a = o.reasons.length > 0 ? [...new Set(o.reasons)].join("; ") : null, n = r[r.length - 1];
29
+ n && n.reason === a ? n.labels.push(o.state.label) : r.push({ labels: [o.state.label], reason: a });
30
+ }
31
+ return r;
32
+ }
33
+ function h(t) {
34
+ return t.length <= 1 ? t[0] ?? "" : `${t.slice(0, -1).join(", ")} and ${t[t.length - 1]}`;
24
35
  }
25
36
  export {
37
+ h as joinLabels,
38
+ g as landingSkipGroups,
26
39
  k as landingState
27
40
  };
@@ -1,22 +1,22 @@
1
- import { isRehearsalCommand as M, noteOwnWriteFromCommand as R } from "./own-writes.js";
2
- import { noteCredentialChanged as $, isIdentityRead as Z, claimIdentityCall as H, signedOutError as U, noteSignedIn as x, isSignedOutError as B, noteUnauthorized as F } from "./signed-out.js";
3
- function I(t) {
1
+ import { isRehearsalCommand as $, noteOwnWriteFromCommand as R } from "./own-writes.js";
2
+ import { noteCredentialChanged as Z, isIdentityRead as H, claimIdentityCall as U, signedOutError as x, noteSignedIn as B, isSignedOutError as F, noteUnauthorized as W } from "./signed-out.js";
3
+ function G(t) {
4
4
  if (!t || typeof t != "object") return "";
5
- const s = Object.entries(t).filter(([, o]) => o != null).map(([o, i]) => [o, String(i)]).sort(([o], [i]) => o < i ? -1 : o > i ? 1 : 0);
5
+ const s = Object.entries(t).filter(([, o]) => o != null).map(([o, c]) => [o, String(c)]).sort(([o], [c]) => o < c ? -1 : o > c ? 1 : 0);
6
6
  return s.length ? new URLSearchParams(s).toString() : "";
7
7
  }
8
8
  function P(t) {
9
9
  const s = (t._method ?? "GET").toUpperCase(), o = s === "GET" || t._body === void 0 ? "" : JSON.stringify(t._body);
10
- return `${s} ${t._path ?? ""} ${I(t._params)} ${o}`;
10
+ return `${s} ${t._path ?? ""} ${G(t._params)} ${o}`;
11
11
  }
12
- function S(t) {
12
+ function C(t) {
13
13
  return (t._method ?? "GET").toUpperCase() === "GET";
14
14
  }
15
- const N = /^\/(widgets-internal\/[^/]+\/render|items\/[^/]+\/[^/]+\/child-summary|items\/[^/]+\/auto-id-preview|config-conformance\/record\/.+\/check|pipelines\/instance\/[^/]+\/owners\/batch|addendums\/summary|at-risk\/evaluate|record-views\/.+\/touch)$/;
16
- function W(t) {
17
- return S(t) ? !0 : (t._method ?? "GET").toUpperCase() !== "POST" ? !1 : N.test((t._path ?? "").split("?")[0]);
15
+ const j = /^\/(widgets-internal\/[^/]+\/render|items\/[^/]+\/[^/]+\/child-summary|items\/[^/]+\/auto-id-preview|config-conformance\/record\/.+\/check|pipelines\/instance\/[^/]+\/owners\/batch|addendums\/summary|at-risk\/evaluate|record-views\/.+\/touch)$/;
16
+ function J(t) {
17
+ return C(t) ? !0 : (t._method ?? "GET").toUpperCase() !== "POST" ? !1 : j.test((t._path ?? "").split("?")[0]);
18
18
  }
19
- function T(t) {
19
+ function g(t) {
20
20
  if (t == null || typeof t != "object") return t;
21
21
  try {
22
22
  return structuredClone(t);
@@ -24,11 +24,18 @@ function T(t) {
24
24
  return t;
25
25
  }
26
26
  }
27
- const j = Symbol("nivaro.coalesced");
27
+ const N = Symbol("nivaro.coalesced");
28
28
  function K(t) {
29
- return t[j] === !0;
29
+ return t[N] === !0;
30
30
  }
31
- const k = 20, J = /^\/items\/([A-Za-z_][A-Za-z0-9_]*)(?:\/([^/?#]+))?$/, Y = /* @__PURE__ */ new Set(["aggregate", "export", "distinct", "resolve-paths", "batch-read"]), Q = /* @__PURE__ */ new Set([
31
+ const k = 20, Y = /^\/items\/([A-Za-z_][A-Za-z0-9_]*)(?:\/([^/?#]+))?$/, Q = /* @__PURE__ */ new Set([
32
+ "aggregate",
33
+ "export",
34
+ "distinct",
35
+ "resolve-paths",
36
+ "batch-read",
37
+ "filter-check"
38
+ ]), V = /* @__PURE__ */ new Set([
32
39
  "fields",
33
40
  "filter",
34
41
  "sort",
@@ -41,32 +48,32 @@ const k = 20, J = /^\/items\/([A-Za-z_][A-Za-z0-9_]*)(?:\/([^/?#]+))?$/, Y = /*
41
48
  "conditions",
42
49
  "labels"
43
50
  ]);
44
- function V(t) {
51
+ function X(t) {
45
52
  const s = t;
46
53
  if ((s._method ?? "GET").toUpperCase() !== "GET") return null;
47
- const o = J.exec(s._path ?? "");
54
+ const o = Y.exec(s._path ?? "");
48
55
  if (!o) return null;
49
- const [, i, d] = o;
50
- if (d !== void 0 && Y.has(d)) return null;
51
- const m = s._params ?? {}, c = {};
52
- for (const [r, u] of Object.entries(m))
53
- if (u !== void 0) {
54
- if (!Q.has(r)) return null;
55
- c[r] = u;
56
+ const [, c, d] = o;
57
+ if (d !== void 0 && Q.has(d)) return null;
58
+ const m = s._params ?? {}, u = {};
59
+ for (const [i, a] of Object.entries(m))
60
+ if (a !== void 0) {
61
+ if (!V.has(i)) return null;
62
+ u[i] = a;
56
63
  }
57
- return d === void 0 ? { collection: i, query: c } : { collection: i, id: d, query: c };
64
+ return d === void 0 ? { collection: c, query: u } : { collection: c, id: d, query: u };
58
65
  }
59
- function X(t) {
66
+ function ee(t) {
60
67
  let s = [], o;
61
- const i = (c) => t.request(c.command).then(c.resolve, c.reject), d = async (c) => {
62
- if (c.length === 1) return i(c[0]);
63
- let r;
68
+ const c = (u) => t.request(u.command).then(u.resolve, u.reject), d = async (u) => {
69
+ if (u.length === 1) return c(u[0]);
70
+ let i;
64
71
  try {
65
- const u = await t.request({
72
+ const a = await t.request({
66
73
  _method: "POST",
67
74
  _path: "/items/batch-read",
68
75
  _body: {
69
- reads: c.map((n, e) => ({
76
+ reads: u.map((n, e) => ({
70
77
  key: String(e),
71
78
  collection: n.read.collection,
72
79
  ...n.read.id !== void 0 ? { id: n.read.id } : {},
@@ -74,50 +81,54 @@ function X(t) {
74
81
  }))
75
82
  }
76
83
  });
77
- r = Array.isArray(u == null ? void 0 : u.results) ? u.results : void 0;
84
+ i = Array.isArray(a == null ? void 0 : a.results) ? a.results : void 0;
78
85
  } catch {
79
- r = void 0;
86
+ i = void 0;
80
87
  }
81
- c.forEach((u, n) => {
82
- const e = r == null ? void 0 : r[n];
88
+ u.forEach((a, n) => {
89
+ const e = i == null ? void 0 : i[n];
90
+ if ((e == null ? void 0 : e.status) === 404 && a.read.id !== void 0) {
91
+ a.reject(L());
92
+ return;
93
+ }
83
94
  if ((e == null ? void 0 : e.status) !== 200 || e === void 0) {
84
- i(u);
95
+ c(a);
85
96
  return;
86
97
  }
87
- u.resolve(u.read.id !== void 0 ? { data: e.data } : { data: e.data, ...e.meta ?? {} });
98
+ a.resolve(a.read.id !== void 0 ? { data: e.data } : { data: e.data, ...e.meta ?? {} });
88
99
  });
89
100
  }, m = () => {
90
101
  o = void 0;
91
- const c = s;
102
+ const u = s;
92
103
  s = [];
93
- for (let r = 0; r < c.length; r += k)
94
- d(c.slice(r, r + k));
104
+ for (let i = 0; i < u.length; i += k)
105
+ d(u.slice(i, i + k));
95
106
  };
96
- return (c, r) => new Promise((u, n) => {
107
+ return (u, i) => new Promise((a, n) => {
97
108
  s.push({
98
- read: r,
99
- command: c,
100
- resolve: u,
109
+ read: i,
110
+ command: u,
111
+ resolve: a,
101
112
  reject: n
102
113
  }), o === void 0 && (o = setTimeout(m, 0));
103
114
  });
104
115
  }
105
- const q = 50, ee = 10, te = /^\/collections\/([A-Za-z_][A-Za-z0-9_-]{0,127})$/;
106
- function ne(t) {
116
+ const I = 50, te = 10, ne = /^\/collections\/([A-Za-z_][A-Za-z0-9_-]{0,127})$/;
117
+ function se(t) {
107
118
  const s = t;
108
- if ((s._method ?? "GET").toUpperCase() !== "GET" || I(s._params) !== "") return null;
109
- const o = te.exec(s._path ?? "");
119
+ if ((s._method ?? "GET").toUpperCase() !== "GET" || G(s._params) !== "") return null;
120
+ const o = ne.exec(s._path ?? "");
110
121
  return o ? o[1] : null;
111
122
  }
112
- function se() {
123
+ function L() {
113
124
  return Object.assign(new Error("Not found"), { status: 404, response: { error: "Not found" } });
114
125
  }
115
126
  function oe(t) {
116
- let s = !0, o = [], i;
117
- const d = (r) => t.request(r.command).then(r.resolve, r.reject), m = async (r) => {
118
- const u = [...new Set(r.map((a) => a.name))];
119
- if (u.length === 1 || !s) {
120
- for (const a of r) d(a);
127
+ let s = !0, o = [], c;
128
+ const d = (i) => t.request(i.command).then(i.resolve, i.reject), m = async (i) => {
129
+ const a = [...new Set(i.map((r) => r.name))];
130
+ if (a.length === 1 || !s) {
131
+ for (const r of i) d(r);
121
132
  return;
122
133
  }
123
134
  let n;
@@ -125,13 +136,13 @@ function oe(t) {
125
136
  n = await t.request({
126
137
  _method: "GET",
127
138
  _path: "/collections",
128
- _params: { names: u.join(",") }
139
+ _params: { names: a.join(",") }
129
140
  });
130
- } catch (a) {
131
- const h = a == null ? void 0 : a.status;
141
+ } catch (r) {
142
+ const h = r == null ? void 0 : r.status;
132
143
  if (h === 400 || h === 404 || h === 405) s = !1;
133
144
  else if (h === 429 || h !== void 0 && h >= 500) {
134
- for (const p of r) p.reject(a);
145
+ for (const y of i) y.reject(r);
135
146
  return;
136
147
  }
137
148
  n = void 0;
@@ -139,166 +150,169 @@ function oe(t) {
139
150
  const e = n == null ? void 0 : n.data;
140
151
  if (!e || typeof e != "object" || Array.isArray(e)) {
141
152
  Array.isArray(e) && (s = !1);
142
- for (const a of r) d(a);
153
+ for (const r of i) d(r);
143
154
  return;
144
155
  }
145
156
  const l = e, f = new Set(Array.isArray(n == null ? void 0 : n.missing) ? n.missing : []);
146
- for (const a of r)
147
- Object.hasOwn(l, a.name) ? a.resolve({ data: T(l[a.name]) }) : f.has(a.name) ? a.reject(se()) : d(a);
148
- }, c = () => {
149
- i = void 0;
150
- const r = o;
157
+ for (const r of i)
158
+ Object.hasOwn(l, r.name) ? r.resolve({ data: g(l[r.name]) }) : f.has(r.name) ? r.reject(L()) : d(r);
159
+ }, u = () => {
160
+ c = void 0;
161
+ const i = o;
151
162
  o = [];
152
- const u = [], n = /* @__PURE__ */ new Map();
153
- for (const e of r) {
163
+ const a = [], n = /* @__PURE__ */ new Map();
164
+ for (const e of i) {
154
165
  let l = n.get(e.name);
155
166
  if (!l) {
156
- const f = u[u.length - 1], a = f ? new Set(f.map((h) => h.name)).size : q;
157
- l = f && a < q ? f : [], l !== f && u.push(l), n.set(e.name, l);
167
+ const f = a[a.length - 1], r = f ? new Set(f.map((h) => h.name)).size : I;
168
+ l = f && r < I ? f : [], l !== f && a.push(l), n.set(e.name, l);
158
169
  }
159
170
  l.push(e);
160
171
  }
161
- for (const e of u) m(e);
172
+ for (const e of a) m(e);
162
173
  };
163
- return (r, u) => new Promise((n, e) => {
174
+ return (i, a) => new Promise((n, e) => {
164
175
  o.push({
165
- name: u,
166
- command: r,
176
+ name: a,
177
+ command: i,
167
178
  resolve: n,
168
179
  reject: e
169
- }), i === void 0 && (i = setTimeout(c, ee));
180
+ }), c === void 0 && (c = setTimeout(u, te));
170
181
  });
171
182
  }
172
- const D = 3e3, re = /^\/(collections\/[A-Za-z_][A-Za-z0-9_-]*|field-config\/[A-Za-z_][A-Za-z0-9_-]*|collection-layouts(\/active|\/summary\/[A-Za-z_][A-Za-z0-9_-]*)?|chat\/room-types|users\/me)$/, ae = /^\/(record-views|item-locks|drafts|presence|rum|comments|notifications|tasks|field-rules\/evaluate|chat\/(?!room-types)|field-config\/[^/]+\/(evaluate-visibility|evaluate-defaults|evaluate-lock|cascade|project)$|items\/(?!nivaro_|directus_)[^/]+|users\/cards$|files\/verify$)/;
173
- function ie(t) {
183
+ const q = 3e3, re = /^\/(collections\/[A-Za-z_][A-Za-z0-9_-]*|field-config\/[A-Za-z_][A-Za-z0-9_-]*|collection-layouts(\/active|\/summary\/[A-Za-z_][A-Za-z0-9_-]*)?|chat\/room-types|users\/me)$/, ie = /^\/(record-views|item-locks|drafts|presence|rum|analytics|session-recordings|comments|notifications|tasks|field-rules\/evaluate|chat\/(?!room-types)|field-config\/[^/]+\/(evaluate-visibility|evaluate-defaults|evaluate-lock|cascade|project)$|items\/(?!nivaro_|directus_)[^/]+|users\/cards$|files\/verify$)/;
184
+ function ae(t) {
174
185
  const s = (t._path ?? "").split("?")[0];
175
- return (t._method ?? "GET").toUpperCase() === "POST" && N.test(s) ? !0 : ae.test(s);
186
+ return (t._method ?? "GET").toUpperCase() === "POST" && j.test(s) ? !0 : ie.test(s);
176
187
  }
177
188
  function ce(t) {
178
189
  const s = t;
179
- if (!S(s) || !re.test(s._path ?? "")) return !1;
190
+ if (!C(s) || !re.test(s._path ?? "")) return !1;
180
191
  const o = s._params;
181
192
  return !(o && o.item != null && /^\/collection-layouts\/active$/.test(s._path ?? ""));
182
193
  }
183
- let y = 0;
184
- function G() {
185
- y++;
194
+ let p = 0;
195
+ function D() {
196
+ p++;
186
197
  }
187
- let g = 0;
198
+ let E = 0;
188
199
  const ue = 50, le = /^\/items\//;
189
- function fe(t, s, o, i) {
190
- if (s.epoch !== i) return !1;
200
+ function fe(t, s) {
201
+ return t.config === s;
202
+ }
203
+ function de(t, s, o, c) {
204
+ if (s.epoch !== c) return !1;
191
205
  const d = t._path ?? "";
192
206
  return !le.test(d) || o - s.at < ue;
193
207
  }
194
208
  function w(t, s) {
195
209
  return t.then(
196
- (o) => (s && x(), o),
210
+ (o) => (s && B(), o),
197
211
  (o) => {
198
- throw B(o, s) && F(s), o;
212
+ throw F(o, s) && W(s), o;
199
213
  }
200
214
  );
201
215
  }
202
- function pe(t, s = {}) {
216
+ function ye(t, s = {}) {
203
217
  if (K(t)) return t;
204
- const o = /* @__PURE__ */ new Map(), i = s.batchReads ? X(t) : null, d = s.batchCollections === !1 ? null : oe(t), m = /* @__PURE__ */ new Map();
205
- let c = y;
206
- const r = (n, e, l) => {
207
- if (e !== y) return;
208
- c !== y && (m.clear(), c = y);
218
+ const o = /* @__PURE__ */ new Map(), c = s.batchReads ? ee(t) : null, d = s.batchCollections === !1 ? null : oe(t), m = /* @__PURE__ */ new Map();
219
+ let u = p;
220
+ const i = (n, e, l) => {
221
+ if (e !== p) return;
222
+ u !== p && (m.clear(), u = p);
209
223
  const f = Date.now();
210
- for (const [a, h] of m) f - h.at >= D && m.delete(a);
224
+ for (const [r, h] of m) f - h.at >= q && m.delete(r);
211
225
  m.set(n, { at: f, epoch: e, value: l });
212
- }, u = (n) => {
226
+ }, a = (n) => {
213
227
  const e = n;
214
- if (!S(e)) {
215
- const _ = M(e._path, e._params);
228
+ if (!C(e)) {
229
+ const _ = $(e._path, e._params);
216
230
  _ || R(e._method, e._path, e._body);
217
- const C = !ie(e);
218
- C && G(), g++;
231
+ const S = !ae(e);
232
+ S && D(), E++;
219
233
  const O = w(t.request(n), !1).finally(() => {
220
- g++;
234
+ E++;
221
235
  });
222
- return (C ? O.finally(G) : O).then((b) => (_ || R(e._method, e._path, e._body, b), b));
236
+ return (S ? O.finally(D) : O).then((b) => (_ || R(e._method, e._path, e._body, b), b));
223
237
  }
224
238
  if (n._signal)
225
239
  return w(t.request(n), !1);
226
240
  const l = P(e), f = ce(e);
227
241
  if (f) {
228
242
  const _ = m.get(l);
229
- if (_ && _.epoch === y && Date.now() - _.at < D)
230
- return Promise.resolve(T(_.value));
243
+ if (_ && _.epoch === p && Date.now() - _.at < q)
244
+ return Promise.resolve(g(_.value));
231
245
  }
232
- const a = o.get(l);
233
- if (a && fe(e, a, Date.now(), g))
234
- return a.p.then(T);
235
- const h = Z(e._method, e._path, e._params);
236
- if (h && !H()) return Promise.reject(U());
237
- const p = i ? V(e) : null, E = !p && d ? ne(e) : null, L = w(
238
- p && i ? i(n, p) : E && d ? d(n, E) : t.request(n),
246
+ const r = o.get(l);
247
+ if (r && (f ? fe(r, p) : de(e, r, Date.now(), E)))
248
+ return r.p.then(g);
249
+ const h = H(e._method, e._path, e._params);
250
+ if (h && !U()) return Promise.reject(x());
251
+ const y = c ? X(e) : null, T = !y && d ? se(e) : null, z = w(
252
+ y && c ? c(n, y) : T && d ? d(n, T) : t.request(n),
239
253
  h
240
- ), z = y, A = L.then((_) => (f && r(l, z, T(_)), _)).finally(() => {
254
+ ), M = p, A = z.then((_) => (f && i(l, M, g(_)), _)).finally(() => {
241
255
  var _;
242
256
  ((_ = o.get(l)) == null ? void 0 : _.p) === A && o.delete(l);
243
257
  });
244
- return o.set(l, { p: A, at: Date.now(), epoch: g }), A;
258
+ return o.set(l, { p: A, at: Date.now(), epoch: E, config: p }), A;
245
259
  };
246
260
  return new Proxy(t, {
247
261
  get(n, e, l) {
248
- if (e === "request") return u;
249
- if (e === j) return !0;
262
+ if (e === "request") return a;
263
+ if (e === N) return !0;
250
264
  if (e === "setToken" && typeof n.setToken == "function")
251
- return (a) => {
252
- n.setToken(a), $();
265
+ return (r) => {
266
+ n.setToken(r), Z();
253
267
  };
254
268
  const f = Reflect.get(n, e, l);
255
269
  return typeof f == "function" ? f.bind(n) : f;
256
270
  }
257
271
  });
258
272
  }
259
- const de = /^\/(item-locks|drafts|auth)\b/, v = /* @__PURE__ */ new Set();
260
- function he() {
273
+ const he = /^\/(item-locks|drafts|auth)\b/, v = /* @__PURE__ */ new Set();
274
+ function me() {
261
275
  for (const t of [...v]) t();
262
276
  }
263
- function ye(t) {
277
+ function ve(t) {
264
278
  return t.subscribe((s) => {
265
- s.type === "observerAdded" && s.query.state.fetchStatus === "fetching" && v.size !== 0 && he();
279
+ s.type === "observerAdded" && s.query.state.fetchStatus === "fetching" && v.size !== 0 && me();
266
280
  });
267
281
  }
268
- function ve(t, s = {}) {
269
- let o = s.open ?? !0, i;
282
+ function ge(t, s = {}) {
283
+ let o = s.open ?? !0, c;
270
284
  const d = /* @__PURE__ */ new Map(), m = () => {
271
285
  const n = [...d.values()];
272
286
  d.clear();
273
287
  for (const e of n) e.release();
274
- }, c = () => {
275
- v.delete(c), m();
276
- }, r = (n) => {
288
+ }, u = () => {
289
+ v.delete(u), m();
290
+ }, i = (n) => {
277
291
  const e = n;
278
- if (o || !W(e) || de.test(e._path ?? "")) return t.request(n);
292
+ if (o || !J(e) || he.test(e._path ?? "")) return t.request(n);
279
293
  const l = P(e), f = d.get(l);
280
- if (f) return f.promise.then(T);
281
- let a = () => {
294
+ if (f) return f.promise.then(g);
295
+ let r = () => {
282
296
  };
283
- const p = new Promise((E) => {
284
- a = E;
297
+ const y = new Promise((T) => {
298
+ r = T;
285
299
  }).then(() => t.request(n));
286
- return d.set(l, { promise: p, release: a }), v.add(c), p;
300
+ return d.set(l, { promise: y, release: r }), v.add(u), y;
287
301
  };
288
302
  return new Proxy(t, {
289
303
  get(n, e, l) {
290
- if (e === "request") return r;
304
+ if (e === "request") return i;
291
305
  if (e === "open") return o;
292
306
  if (e === "setOpen")
293
- return (a) => {
294
- i !== void 0 && (clearTimeout(i), i = void 0);
307
+ return (r) => {
308
+ c !== void 0 && (clearTimeout(c), c = void 0);
295
309
  const h = o;
296
- o = a, a && !h && (v.delete(c), m());
310
+ o = r, r && !h && (v.delete(u), m());
297
311
  };
298
312
  if (e === "dispose")
299
313
  return () => {
300
- i === void 0 && (i = setTimeout(() => {
301
- i = void 0, o = !0, v.delete(c), m();
314
+ c === void 0 && (c = setTimeout(() => {
315
+ c = void 0, o = !0, v.delete(u), m();
302
316
  }, 0));
303
317
  };
304
318
  const f = Reflect.get(n, e, l);
@@ -308,18 +322,19 @@ function ve(t, s = {}) {
308
322
  }
309
323
  export {
310
324
  k as BATCH_READ_LIMIT,
311
- q as COLLECTION_BATCH_LIMIT,
312
- ee as COLLECTION_BATCH_WINDOW_MS,
325
+ I as COLLECTION_BATCH_LIMIT,
326
+ te as COLLECTION_BATCH_WINDOW_MS,
313
327
  ue as RECORD_JOIN_MS,
314
- D as SETTLED_READ_MS,
315
- ne as batchableCollectionMeta,
316
- V as batchableRead,
317
- ve as createGatedClient,
318
- G as forgetSettledReads,
328
+ q as SETTLED_READ_MS,
329
+ se as batchableCollectionMeta,
330
+ X as batchableRead,
331
+ ge as createGatedClient,
332
+ D as forgetSettledReads,
319
333
  K as isCoalesced,
320
334
  ce as isSettledRead,
321
- fe as mayJoinInflight,
322
- he as releaseGatedReads,
323
- ye as releaseGatedReadsOnSharedFetch,
324
- pe as withGetCoalescing
335
+ fe as mayJoinConfigInflight,
336
+ de as mayJoinInflight,
337
+ me as releaseGatedReads,
338
+ ve as releaseGatedReadsOnSharedFetch,
339
+ ye as withGetCoalescing
325
340
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/react",
3
- "version": "0.3.59",
3
+ "version": "0.3.61",
4
4
  "description": "React hooks and components for Nivaro CMS forms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",