@instantdb/react 0.22.60-experimental.topifeffectfix.19553724954.1 → 0.22.60
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/standalone/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ci, { useRef as at, useCallback as ge, useSyncExternalStore as nn, useEffect as
|
|
1
|
+
import ci, { useRef as at, useCallback as ge, useSyncExternalStore as nn, useEffect as je, useMemo as rn, useState as di, createElement as ks } from "react";
|
|
2
2
|
function V(t) {
|
|
3
3
|
if (typeof t == "number")
|
|
4
4
|
return (Math.abs(t * 2654435761) >>> 0).toString(16);
|
|
@@ -127,7 +127,7 @@ function sn(t) {
|
|
|
127
127
|
for (; t.finalities.revoke.length > 0; )
|
|
128
128
|
t.finalities.revoke.pop()();
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Ae(t, e) {
|
|
131
131
|
return e ? t : [""].concat(t).map((n) => {
|
|
132
132
|
const r = `${n}`;
|
|
133
133
|
return r.indexOf("/") === -1 && r.indexOf("~") === -1 ? r : r.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
@@ -351,7 +351,7 @@ function Rs(t, e, n, r, i) {
|
|
|
351
351
|
u.length < s.length && ([s, u] = [u, s], [n, r] = [r, n]);
|
|
352
352
|
for (let d = 0; d < s.length; d += 1)
|
|
353
353
|
if (o.get(d.toString()) && u[d] !== s[d]) {
|
|
354
|
-
const c = e.concat([d]), f =
|
|
354
|
+
const c = e.concat([d]), f = Ae(c, i);
|
|
355
355
|
n.push({
|
|
356
356
|
op: U.Replace,
|
|
357
357
|
path: f,
|
|
@@ -365,7 +365,7 @@ function Rs(t, e, n, r, i) {
|
|
|
365
365
|
});
|
|
366
366
|
}
|
|
367
367
|
for (let d = s.length; d < u.length; d += 1) {
|
|
368
|
-
const c = e.concat([d]), f =
|
|
368
|
+
const c = e.concat([d]), f = Ae(c, i);
|
|
369
369
|
n.push({
|
|
370
370
|
op: U.Add,
|
|
371
371
|
path: f,
|
|
@@ -376,7 +376,7 @@ function Rs(t, e, n, r, i) {
|
|
|
376
376
|
if (s.length < u.length) {
|
|
377
377
|
const { arrayLengthAssignment: d = !0 } = a.enablePatches;
|
|
378
378
|
if (d) {
|
|
379
|
-
const c = e.concat(["length"]), f =
|
|
379
|
+
const c = e.concat(["length"]), f = Ae(c, i);
|
|
380
380
|
r.push({
|
|
381
381
|
op: U.Replace,
|
|
382
382
|
path: f,
|
|
@@ -384,7 +384,7 @@ function Rs(t, e, n, r, i) {
|
|
|
384
384
|
});
|
|
385
385
|
} else
|
|
386
386
|
for (let c = u.length; s.length < c; c -= 1) {
|
|
387
|
-
const f = e.concat([c - 1]), l =
|
|
387
|
+
const f = e.concat([c - 1]), l = Ae(f, i);
|
|
388
388
|
r.push({
|
|
389
389
|
op: U.Remove,
|
|
390
390
|
path: l
|
|
@@ -397,7 +397,7 @@ function xs({ original: t, copy: e, assignedMap: n }, r, i, s, o) {
|
|
|
397
397
|
const d = be(t, u), c = St(be(e, u)), f = a ? nt(t, u) ? U.Replace : U.Add : U.Remove;
|
|
398
398
|
if (ye(d, c) && f === U.Replace)
|
|
399
399
|
return;
|
|
400
|
-
const l = r.concat(u), p =
|
|
400
|
+
const l = r.concat(u), p = Ae(l, o);
|
|
401
401
|
i.push(f === U.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), s.push(f === U.Add ? { op: U.Remove, path: p } : f === U.Remove ? { op: U.Add, path: p, value: d } : { op: U.Replace, path: p, value: d });
|
|
402
402
|
});
|
|
403
403
|
}
|
|
@@ -405,7 +405,7 @@ function $s({ original: t, copy: e }, n, r, i, s) {
|
|
|
405
405
|
let o = 0;
|
|
406
406
|
t.forEach((a) => {
|
|
407
407
|
if (!e.has(a)) {
|
|
408
|
-
const u = n.concat([o]), d =
|
|
408
|
+
const u = n.concat([o]), d = Ae(u, s);
|
|
409
409
|
r.push({
|
|
410
410
|
op: U.Remove,
|
|
411
411
|
path: d,
|
|
@@ -419,7 +419,7 @@ function $s({ original: t, copy: e }, n, r, i, s) {
|
|
|
419
419
|
o += 1;
|
|
420
420
|
}), o = 0, e.forEach((a) => {
|
|
421
421
|
if (!t.has(a)) {
|
|
422
|
-
const u = n.concat([o]), d =
|
|
422
|
+
const u = n.concat([o]), d = Ae(u, s);
|
|
423
423
|
r.push({
|
|
424
424
|
op: U.Add,
|
|
425
425
|
path: d,
|
|
@@ -909,12 +909,12 @@ const Ns = (t) => function e(n, r, i) {
|
|
|
909
909
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
910
910
|
const q = S == null ? void 0 : S[js];
|
|
911
911
|
if (q) {
|
|
912
|
-
const
|
|
912
|
+
const Te = q[0];
|
|
913
913
|
return _.strict && typeof S == "object" && S !== null && cn({
|
|
914
914
|
rootDraft: I,
|
|
915
915
|
value: S,
|
|
916
916
|
useRawReturn: !0
|
|
917
|
-
}), w([
|
|
917
|
+
}), w([Te]);
|
|
918
918
|
}
|
|
919
919
|
if (S !== void 0)
|
|
920
920
|
return typeof S == "object" && S !== null && cn({ rootDraft: I, value: S }), w([S]);
|
|
@@ -1671,7 +1671,7 @@ function bo(t, e, n) {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
return i;
|
|
1673
1673
|
}
|
|
1674
|
-
function
|
|
1674
|
+
function we(t, e, n) {
|
|
1675
1675
|
var r;
|
|
1676
1676
|
return (r = t.attrIndexes.forwardIdents.get(e)) === null || r === void 0 ? void 0 : r.get(n);
|
|
1677
1677
|
}
|
|
@@ -1876,7 +1876,7 @@ function zo(t, e, n) {
|
|
|
1876
1876
|
return t.map((r) => r === e ? n : r);
|
|
1877
1877
|
}
|
|
1878
1878
|
function Ri(t, e, n, r, i) {
|
|
1879
|
-
const s =
|
|
1879
|
+
const s = we(e, n, i), o = Pi(e, n, i), a = s || o;
|
|
1880
1880
|
if (!a)
|
|
1881
1881
|
throw new Ke(`Could not find attr for ${[n, i]}`);
|
|
1882
1882
|
if (a["value-type"] !== "ref")
|
|
@@ -1965,11 +1965,11 @@ function Vo(t, e) {
|
|
|
1965
1965
|
return e;
|
|
1966
1966
|
}
|
|
1967
1967
|
function Bo(t, e, n, r, i, s) {
|
|
1968
|
-
const o =
|
|
1968
|
+
const o = we(e, n, i), a = Pi(e, n, i), u = o || a;
|
|
1969
1969
|
if (!u)
|
|
1970
1970
|
throw new Ke(`No attr for etype = ${n} label = ${i}`);
|
|
1971
1971
|
if (s != null && s.hasOwnProperty("$isNull")) {
|
|
1972
|
-
const d =
|
|
1972
|
+
const d = we(e, n, "id");
|
|
1973
1973
|
if (!d)
|
|
1974
1974
|
throw new Ke(`No attr for etype = ${n} label = id`);
|
|
1975
1975
|
return [
|
|
@@ -2119,7 +2119,7 @@ function sa(t, e) {
|
|
|
2119
2119
|
}
|
|
2120
2120
|
function oa(t, e, n) {
|
|
2121
2121
|
const r = Object.keys(n)[0];
|
|
2122
|
-
return
|
|
2122
|
+
return we(t, e, r);
|
|
2123
2123
|
}
|
|
2124
2124
|
function aa(t, e, n, r) {
|
|
2125
2125
|
if (n)
|
|
@@ -2133,11 +2133,11 @@ function ua(t, e, n) {
|
|
|
2133
2133
|
return _o(t, e);
|
|
2134
2134
|
const s = /* @__PURE__ */ new Map();
|
|
2135
2135
|
for (const o of n.fields) {
|
|
2136
|
-
const a =
|
|
2136
|
+
const a = we(t, e, o), u = (r = a == null ? void 0 : a["forward-identity"]) === null || r === void 0 ? void 0 : r[2];
|
|
2137
2137
|
u && qn(a) && s.set(u, a);
|
|
2138
2138
|
}
|
|
2139
2139
|
if (!s.has("id")) {
|
|
2140
|
-
const o =
|
|
2140
|
+
const o = we(t, e, "id"), a = (i = o == null ? void 0 : o["forward-identity"]) === null || i === void 0 ? void 0 : i[2];
|
|
2141
2141
|
a && s.set(a, o);
|
|
2142
2142
|
}
|
|
2143
2143
|
return s;
|
|
@@ -2325,7 +2325,7 @@ function B(t, e, n) {
|
|
|
2325
2325
|
return s === e && o === n;
|
|
2326
2326
|
});
|
|
2327
2327
|
}
|
|
2328
|
-
function
|
|
2328
|
+
function ke(t, e, n) {
|
|
2329
2329
|
return Object.values(t).find((r) => {
|
|
2330
2330
|
const i = r["reverse-identity"];
|
|
2331
2331
|
if (!i)
|
|
@@ -2356,7 +2356,7 @@ function _n(t) {
|
|
|
2356
2356
|
function Ta(t, e, n) {
|
|
2357
2357
|
if (!bn(t, e, n))
|
|
2358
2358
|
return B(t, e, n);
|
|
2359
|
-
const r = _n(n), i = B(t, e, r) ||
|
|
2359
|
+
const r = _n(n), i = B(t, e, r) || ke(t, e, r);
|
|
2360
2360
|
if (i && i["value-type"] !== "ref")
|
|
2361
2361
|
throw new Error(`${n} does not reference a valid link attribute.`);
|
|
2362
2362
|
return i;
|
|
@@ -2384,7 +2384,7 @@ function Fi(t, e, n, r) {
|
|
|
2384
2384
|
}
|
|
2385
2385
|
function ma({ attrs: t }, [e, n, r]) {
|
|
2386
2386
|
const i = Object.entries(r).flatMap(([s, o]) => {
|
|
2387
|
-
const a = Array.isArray(o) ? o : [o], u = B(t, e, s), d =
|
|
2387
|
+
const a = Array.isArray(o) ? o : [o], u = B(t, e, s), d = ke(t, e, s);
|
|
2388
2388
|
return a.map((c) => u ? [
|
|
2389
2389
|
"add-triple",
|
|
2390
2390
|
ee(t, e, n),
|
|
@@ -2401,7 +2401,7 @@ function ma({ attrs: t }, [e, n, r]) {
|
|
|
2401
2401
|
}
|
|
2402
2402
|
function va({ attrs: t }, [e, n, r]) {
|
|
2403
2403
|
const i = Object.entries(r).flatMap(([s, o]) => {
|
|
2404
|
-
const a = Array.isArray(o) ? o : [o], u = B(t, e, s), d =
|
|
2404
|
+
const a = Array.isArray(o) ? o : [o], u = B(t, e, s), d = ke(t, e, s);
|
|
2405
2405
|
return a.map((c) => u ? [
|
|
2406
2406
|
"retract-triple",
|
|
2407
2407
|
ee(t, e, n),
|
|
@@ -2602,7 +2602,7 @@ function Ka({ attrs: t, schema: e }, n) {
|
|
|
2602
2602
|
f != null && f.isUnsynced && !s.has(f.id) && (a.push(["add-attr", f]), s.add(f.id));
|
|
2603
2603
|
}
|
|
2604
2604
|
function c(f, l) {
|
|
2605
|
-
const p = B(o, f, l), y =
|
|
2605
|
+
const p = B(o, f, l), y = ke(o, f, l);
|
|
2606
2606
|
d(p), d(y), !p && !y && u(Rr(e, f, l, Fa));
|
|
2607
2607
|
}
|
|
2608
2608
|
for (const f of n)
|
|
@@ -2610,7 +2610,7 @@ function Ka({ attrs: t, schema: e }, n) {
|
|
|
2610
2610
|
const b = p[0];
|
|
2611
2611
|
if (y) {
|
|
2612
2612
|
c(l, y);
|
|
2613
|
-
const _ = B(o, l, y), T =
|
|
2613
|
+
const _ = B(o, l, y), T = ke(o, l, y);
|
|
2614
2614
|
d(_), d(T);
|
|
2615
2615
|
const w = ((r = _ == null ? void 0 : _["reverse-identity"]) === null || r === void 0 ? void 0 : r[1]) || ((i = T == null ? void 0 : T["forward-identity"]) === null || i === void 0 ? void 0 : i[1]) || y;
|
|
2616
2616
|
if (bn(o, w, b))
|
|
@@ -2634,7 +2634,7 @@ function Ka({ attrs: t, schema: e }, n) {
|
|
|
2634
2634
|
for (const T of Object.keys(b)) {
|
|
2635
2635
|
const w = B(o, p, T);
|
|
2636
2636
|
if (d(w), Ua.has(l) && (w || u(wt(e, p, T, T === "id" ? { "unique?": !0 } : null))), Da.has(l)) {
|
|
2637
|
-
const m =
|
|
2637
|
+
const m = ke(o, p, T);
|
|
2638
2638
|
!w && !m && u(Rr(e, p, T)), d(m);
|
|
2639
2639
|
}
|
|
2640
2640
|
}
|
|
@@ -3546,7 +3546,7 @@ function Kr(t) {
|
|
|
3546
3546
|
}, e;
|
|
3547
3547
|
}, {});
|
|
3548
3548
|
}
|
|
3549
|
-
const Gn = "v0.22.60
|
|
3549
|
+
const Gn = "v0.22.60";
|
|
3550
3550
|
function fu(t, e) {
|
|
3551
3551
|
return {
|
|
3552
3552
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
@@ -4090,7 +4090,7 @@ function Zt(t, e) {
|
|
|
4090
4090
|
}
|
|
4091
4091
|
function Yr(t, e, n) {
|
|
4092
4092
|
var r;
|
|
4093
|
-
const i = (r =
|
|
4093
|
+
const i = (r = we(e, t.table, "id")) === null || r === void 0 ? void 0 : r.id;
|
|
4094
4094
|
if (!i)
|
|
4095
4095
|
return -1;
|
|
4096
4096
|
const s = ze(e.eav, [n, i, n]);
|
|
@@ -4148,10 +4148,10 @@ function Au(t, e) {
|
|
|
4148
4148
|
return Xe(o.entity.id, o.entity[r], s.entity.id, s.entity[r], n);
|
|
4149
4149
|
});
|
|
4150
4150
|
}
|
|
4151
|
-
var
|
|
4151
|
+
var Se;
|
|
4152
4152
|
(function(t) {
|
|
4153
4153
|
t.InitialSyncBatch = "InitialSyncBatch", t.InitialSyncComplete = "InitialSyncComplete", t.LoadFromStorage = "LoadFromStorage", t.SyncTransaction = "SyncTransaction", t.Error = "Error";
|
|
4154
|
-
})(
|
|
4154
|
+
})(Se || (Se = {}));
|
|
4155
4155
|
class ku {
|
|
4156
4156
|
constructor(e, n, r, i, s) {
|
|
4157
4157
|
this.callbacks = {}, this.idToHash = {}, this.trySend = e, this.config = r, this.log = i, this.createStore = s, this.subs = new Tn({
|
|
@@ -4221,12 +4221,12 @@ class ku {
|
|
|
4221
4221
|
const d = this.subs.currentValue[n];
|
|
4222
4222
|
if (d && d.state && d.state.txId) {
|
|
4223
4223
|
this.sendResync(d, d.state), !((i = d.values) === null || i === void 0) && i.entities && r && (Object.keys(e)[0], r({
|
|
4224
|
-
type:
|
|
4224
|
+
type: Se.LoadFromStorage,
|
|
4225
4225
|
data: Tt(d, (s = d.values) === null || s === void 0 ? void 0 : s.entities)
|
|
4226
4226
|
}));
|
|
4227
4227
|
return;
|
|
4228
4228
|
}
|
|
4229
|
-
const c = Object.keys(e)[0], f = ((a = (o = e[c]) === null || o === void 0 ? void 0 : o.$) === null || a === void 0 ? void 0 : a.order) || { serverCreatedAt: "asc" }, [l, p] = Object.entries(f)[0], y = l === "serverCreatedAt" ? "number" : (u =
|
|
4229
|
+
const c = Object.keys(e)[0], f = ((a = (o = e[c]) === null || o === void 0 ? void 0 : o.$) === null || a === void 0 ? void 0 : a.order) || { serverCreatedAt: "asc" }, [l, p] = Object.entries(f)[0], y = l === "serverCreatedAt" ? "number" : (u = we(this.createStore([]), c, l)) === null || u === void 0 ? void 0 : u["checked-data-type"];
|
|
4230
4230
|
this.subs.updateInPlace((b) => {
|
|
4231
4231
|
b[n] = {
|
|
4232
4232
|
query: e,
|
|
@@ -4297,7 +4297,7 @@ class ku {
|
|
|
4297
4297
|
this.subs.updateInPlace((c) => {
|
|
4298
4298
|
c[s] = a, c[s].updatedAt = Date.now();
|
|
4299
4299
|
}), a.values && this.notifyCbs(s, {
|
|
4300
|
-
type:
|
|
4300
|
+
type: Se.InitialSyncBatch,
|
|
4301
4301
|
data: Tt(a, a.values.entities),
|
|
4302
4302
|
batch: o
|
|
4303
4303
|
});
|
|
@@ -4322,7 +4322,7 @@ class ku {
|
|
|
4322
4322
|
});
|
|
4323
4323
|
const s = this.subs.currentValue[i];
|
|
4324
4324
|
s && this.notifyCbs(i, {
|
|
4325
|
-
type:
|
|
4325
|
+
type: Se.InitialSyncComplete,
|
|
4326
4326
|
data: Tt(s, ((n = s.values) === null || n === void 0 ? void 0 : n.entities) || [])
|
|
4327
4327
|
});
|
|
4328
4328
|
}
|
|
@@ -4363,8 +4363,8 @@ class ku {
|
|
|
4363
4363
|
if (oo(E.store, T)) {
|
|
4364
4364
|
Jr(E.store, w);
|
|
4365
4365
|
const S = Zt(a, E.store), I = Eu(E.store, w)[T];
|
|
4366
|
-
for (const [x, { oldValue: q, newValue:
|
|
4367
|
-
q ===
|
|
4366
|
+
for (const [x, { oldValue: q, newValue: Te }] of Object.entries(I || {}))
|
|
4367
|
+
q === Te && delete I[x];
|
|
4368
4368
|
S ? (y.push({
|
|
4369
4369
|
oldEntity: E.entity,
|
|
4370
4370
|
newEntity: S,
|
|
@@ -4395,7 +4395,7 @@ class ku {
|
|
|
4395
4395
|
for (const T of c.sort().reverse())
|
|
4396
4396
|
_.push(p[T].entity), p.splice(T, 1);
|
|
4397
4397
|
Au(a, p), this.notifyCbs(o, {
|
|
4398
|
-
type:
|
|
4398
|
+
type: Se.SyncTransaction,
|
|
4399
4399
|
data: Tt(a, (i = a.values) === null || i === void 0 ? void 0 : i.entities),
|
|
4400
4400
|
added: b,
|
|
4401
4401
|
removed: _,
|
|
@@ -4425,7 +4425,7 @@ class ku {
|
|
|
4425
4425
|
hint: e.hint
|
|
4426
4426
|
}, i = Object.keys(e["original-event"].q)[0];
|
|
4427
4427
|
this.notifyCbs(n, {
|
|
4428
|
-
type:
|
|
4428
|
+
type: Se.Error,
|
|
4429
4429
|
data: { [i]: [] },
|
|
4430
4430
|
error: r
|
|
4431
4431
|
});
|
|
@@ -4833,8 +4833,8 @@ class Nu {
|
|
|
4833
4833
|
});
|
|
4834
4834
|
const _ = Xr(b.entries()), T = l.map((w) => {
|
|
4835
4835
|
var m, E, S, I;
|
|
4836
|
-
const x = w["instaql-query"], q = w["instaql-result"],
|
|
4837
|
-
return { q: x, hash:
|
|
4836
|
+
const x = w["instaql-query"], q = w["instaql-result"], Te = V(x), lt = Nr(q), Ft = Et(this.attrs, lt, d, this._linkIndex, this.config.useDateObjects), Nt = this._applyOptimisticUpdates(Ft, _, y), ht = (E = (m = q == null ? void 0 : q[0]) === null || m === void 0 ? void 0 : m.data) === null || E === void 0 ? void 0 : E["page-info"], ce = (I = (S = q == null ? void 0 : q[0]) === null || S === void 0 ? void 0 : S.data) === null || I === void 0 ? void 0 : I.aggregate;
|
|
4837
|
+
return { q: x, hash: Te, store: Nt, pageInfo: ht, aggregate: ce };
|
|
4838
4838
|
});
|
|
4839
4839
|
T.forEach(({ hash: w, q: m, store: E, pageInfo: S, aggregate: I }) => {
|
|
4840
4840
|
this.querySubs.updateInPlace((x) => {
|
|
@@ -5047,7 +5047,7 @@ class Nu {
|
|
|
5047
5047
|
return B(e, l, p);
|
|
5048
5048
|
}, s = (c) => {
|
|
5049
5049
|
const [f, l, p] = c["forward-identity"];
|
|
5050
|
-
return
|
|
5050
|
+
return ke(e, l, p);
|
|
5051
5051
|
}, o = { attrIdMap: {}, refSwapAttrIds: /* @__PURE__ */ new Set() };
|
|
5052
5052
|
let a = !1;
|
|
5053
5053
|
const u = (c, f) => {
|
|
@@ -6211,10 +6211,10 @@ function pc() {
|
|
|
6211
6211
|
M.unshift("Warning: " + g), Function.prototype.apply.call(console[h], console, M);
|
|
6212
6212
|
}
|
|
6213
6213
|
}
|
|
6214
|
-
var S = !1, I = !1, x = !1, q = !1,
|
|
6214
|
+
var S = !1, I = !1, x = !1, q = !1, Te = !1, lt;
|
|
6215
6215
|
lt = Symbol.for("react.module.reference");
|
|
6216
6216
|
function Ft(h) {
|
|
6217
|
-
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o ||
|
|
6217
|
+
return !!(typeof h == "string" || typeof h == "function" || h === i || h === o || Te || h === s || h === c || h === f || q || h === y || S || I || x || typeof h == "object" && h !== null && (h.$$typeof === p || h.$$typeof === l || h.$$typeof === a || h.$$typeof === u || h.$$typeof === d || // This needs to include all possible module reference object
|
|
6218
6218
|
// types supported by any Flight configuration anywhere since
|
|
6219
6219
|
// we don't know which Flight build this will end up being used
|
|
6220
6220
|
// with.
|
|
@@ -6275,7 +6275,7 @@ function pc() {
|
|
|
6275
6275
|
}
|
|
6276
6276
|
return null;
|
|
6277
6277
|
}
|
|
6278
|
-
var
|
|
6278
|
+
var me = Object.assign, Be = 0, Yn, Jn, Zn, Xn, er, tr, nr;
|
|
6279
6279
|
function rr() {
|
|
6280
6280
|
}
|
|
6281
6281
|
rr.__reactDisabledLog = !0;
|
|
@@ -6311,25 +6311,25 @@ function pc() {
|
|
|
6311
6311
|
writable: !0
|
|
6312
6312
|
};
|
|
6313
6313
|
Object.defineProperties(console, {
|
|
6314
|
-
log:
|
|
6314
|
+
log: me({}, h, {
|
|
6315
6315
|
value: Yn
|
|
6316
6316
|
}),
|
|
6317
|
-
info:
|
|
6317
|
+
info: me({}, h, {
|
|
6318
6318
|
value: Jn
|
|
6319
6319
|
}),
|
|
6320
|
-
warn:
|
|
6320
|
+
warn: me({}, h, {
|
|
6321
6321
|
value: Zn
|
|
6322
6322
|
}),
|
|
6323
|
-
error:
|
|
6323
|
+
error: me({}, h, {
|
|
6324
6324
|
value: Xn
|
|
6325
6325
|
}),
|
|
6326
|
-
group:
|
|
6326
|
+
group: me({}, h, {
|
|
6327
6327
|
value: er
|
|
6328
6328
|
}),
|
|
6329
|
-
groupCollapsed:
|
|
6329
|
+
groupCollapsed: me({}, h, {
|
|
6330
6330
|
value: tr
|
|
6331
6331
|
}),
|
|
6332
|
-
groupEnd:
|
|
6332
|
+
groupEnd: me({}, h, {
|
|
6333
6333
|
value: nr
|
|
6334
6334
|
})
|
|
6335
6335
|
});
|
|
@@ -6424,8 +6424,8 @@ function pc() {
|
|
|
6424
6424
|
} finally {
|
|
6425
6425
|
Wt = !1, Kt.current = M, ts(), Error.prepareStackTrace = P;
|
|
6426
6426
|
}
|
|
6427
|
-
var Me = h ? h.displayName || h.name : "",
|
|
6428
|
-
return typeof h == "function" && yt.set(h,
|
|
6427
|
+
var Me = h ? h.displayName || h.name : "", ve = Me ? pt(Me) : "";
|
|
6428
|
+
return typeof h == "function" && yt.set(h, ve), ve;
|
|
6429
6429
|
}
|
|
6430
6430
|
function rs(h, g, v) {
|
|
6431
6431
|
return ir(h, !1);
|
|
@@ -6747,17 +6747,17 @@ Check the top-level render call using <` + v + ">.");
|
|
|
6747
6747
|
br(re, h);
|
|
6748
6748
|
}
|
|
6749
6749
|
if (Ge.call(g, "key")) {
|
|
6750
|
-
var
|
|
6750
|
+
var ve = ce(h), Y = Object.keys(g).filter(function(As) {
|
|
6751
6751
|
return As !== "key";
|
|
6752
6752
|
}), Qt = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
6753
|
-
if (!_r[
|
|
6753
|
+
if (!_r[ve + Qt]) {
|
|
6754
6754
|
var Es = Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}";
|
|
6755
6755
|
m(`A props object containing a "key" prop is being spread into JSX:
|
|
6756
6756
|
let props = %s;
|
|
6757
6757
|
<%s {...props} />
|
|
6758
6758
|
React keys must be passed directly to JSX without using spread:
|
|
6759
6759
|
let props = %s;
|
|
6760
|
-
<%s key={someKey} {...props} />`, Qt,
|
|
6760
|
+
<%s key={someKey} {...props} />`, Qt, ve, Es, ve), _r[ve + Qt] = !0;
|
|
6761
6761
|
}
|
|
6762
6762
|
}
|
|
6763
6763
|
return h === i ? Ts(L) : ws(L), L;
|
|
@@ -6799,7 +6799,7 @@ function _c(t, e, n) {
|
|
|
6799
6799
|
}
|
|
6800
6800
|
function gc() {
|
|
6801
6801
|
const t = at(null);
|
|
6802
|
-
|
|
6802
|
+
je(() => {
|
|
6803
6803
|
n();
|
|
6804
6804
|
}, []);
|
|
6805
6805
|
function e(r, i) {
|
|
@@ -6813,14 +6813,12 @@ function gc() {
|
|
|
6813
6813
|
const wc = 1e3;
|
|
6814
6814
|
function Tc(t, e, n) {
|
|
6815
6815
|
const r = at(n);
|
|
6816
|
-
|
|
6817
|
-
r.current = n;
|
|
6818
|
-
}, [n]), we(() => t.core._reactor.subscribeTopic(t.id, e, (s, o) => {
|
|
6816
|
+
r.current = n, je(() => t.core._reactor.subscribeTopic(t.id, e, (s, o) => {
|
|
6819
6817
|
r.current(s, o);
|
|
6820
6818
|
}), [t.id, e]);
|
|
6821
6819
|
}
|
|
6822
6820
|
function mc(t, e) {
|
|
6823
|
-
return
|
|
6821
|
+
return je(() => t.core._reactor.joinRoom(t.id), [t.id]), ge((r) => {
|
|
6824
6822
|
t.core._reactor.publishTopic({
|
|
6825
6823
|
roomType: t.type,
|
|
6826
6824
|
roomId: t.id,
|
|
@@ -6838,7 +6836,7 @@ function vc(t, e = {}) {
|
|
|
6838
6836
|
isLoading: !0
|
|
6839
6837
|
};
|
|
6840
6838
|
});
|
|
6841
|
-
|
|
6839
|
+
je(() => t.core._reactor.subscribePresence(t.type, t.id, e, (d) => {
|
|
6842
6840
|
s(d);
|
|
6843
6841
|
}), [t.id, e.user, (n = e.peers) === null || n === void 0 ? void 0 : n.join(), (r = e.keys) === null || r === void 0 ? void 0 : r.join()]);
|
|
6844
6842
|
const o = ge((u) => {
|
|
@@ -6847,10 +6845,10 @@ function vc(t, e = {}) {
|
|
|
6847
6845
|
return rn(() => Object.assign(Object.assign({}, i), { publishPresence: o }), [i, o]);
|
|
6848
6846
|
}
|
|
6849
6847
|
function Sc(t, e, n) {
|
|
6850
|
-
|
|
6848
|
+
je(() => t.core._reactor.joinRoom(t.id, e), [t.id]), je(() => t.core._reactor.publishPresence(t.type, t.id, e), [t.type, t.id, n ?? JSON.stringify(e)]);
|
|
6851
6849
|
}
|
|
6852
6850
|
function Oc(t, e, n = {}) {
|
|
6853
|
-
const r = gc(), i =
|
|
6851
|
+
const r = gc(), i = Oe.usePresence(t, {
|
|
6854
6852
|
keys: [e]
|
|
6855
6853
|
}), s = rn(() => {
|
|
6856
6854
|
var c;
|
|
@@ -6877,7 +6875,7 @@ function Oc(t, e, n = {}) {
|
|
|
6877
6875
|
inputProps: d
|
|
6878
6876
|
};
|
|
6879
6877
|
}
|
|
6880
|
-
const
|
|
6878
|
+
const Oe = {
|
|
6881
6879
|
useTopicEffect: Tc,
|
|
6882
6880
|
usePublishTopic: mc,
|
|
6883
6881
|
usePresence: vc,
|
|
@@ -6887,8 +6885,8 @@ const Ee = {
|
|
|
6887
6885
|
class Ec {
|
|
6888
6886
|
constructor(e, n, r) {
|
|
6889
6887
|
this.useTopicEffect = (i, s) => {
|
|
6890
|
-
|
|
6891
|
-
}, this.usePublishTopic = (i) =>
|
|
6888
|
+
Oe.useTopicEffect(this, i, s);
|
|
6889
|
+
}, this.usePublishTopic = (i) => Oe.usePublishTopic(this, i), this.usePresence = (i = {}) => Oe.usePresence(this, i), this.useSyncPresence = (i, s) => Oe.useSyncPresence(this, i, s), this.useTypingIndicator = (i, s = {}) => Oe.useTypingIndicator(this, i, s), this.core = e, this._core = this.core, this.type = n, this.id = r;
|
|
6892
6890
|
}
|
|
6893
6891
|
}
|
|
6894
6892
|
var Ac = function(t, e, n, r) {
|
|
@@ -6927,13 +6925,13 @@ class jc {
|
|
|
6927
6925
|
constructor(e, n) {
|
|
6928
6926
|
this.tx = Vn(), this.getLocalId = (r) => this.core.getLocalId(r), this.useLocalId = (r) => {
|
|
6929
6927
|
const [i, s] = di(null);
|
|
6930
|
-
return
|
|
6928
|
+
return je(() => {
|
|
6931
6929
|
Ac(this, void 0, void 0, function* () {
|
|
6932
6930
|
const a = yield this.getLocalId(r);
|
|
6933
6931
|
s(a);
|
|
6934
6932
|
});
|
|
6935
6933
|
}, [r]), i;
|
|
6936
|
-
}, this.rooms =
|
|
6934
|
+
}, this.rooms = Oe, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => _c(this.core, r, i).state, this.useAuth = () => {
|
|
6937
6935
|
const r = at(this.core._reactor._currentUserCached), i = ge((o) => this.core.subscribeAuth((u) => {
|
|
6938
6936
|
r.current = Object.assign({ isLoading: !1 }, u), o();
|
|
6939
6937
|
}), []);
|
|
@@ -7161,11 +7159,11 @@ function oi(t) {
|
|
|
7161
7159
|
}
|
|
7162
7160
|
var Xi = (t) => {
|
|
7163
7161
|
throw TypeError(t);
|
|
7164
|
-
}, Qn = (t, e, n) => e.has(t) || Xi("Cannot " + n), A = (t, e, n) => (Qn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), N = (t, e, n) => e.has(t) ? Xi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), $ = (t, e, n, r) => (Qn(t, e, "write to private field"), e.set(t, n), n), he = (t, e, n) => (Qn(t, e, "access private method"), n), J,
|
|
7162
|
+
}, Qn = (t, e, n) => e.has(t) || Xi("Cannot " + n), A = (t, e, n) => (Qn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), N = (t, e, n) => e.has(t) ? Xi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), $ = (t, e, n, r) => (Qn(t, e, "write to private field"), e.set(t, n), n), he = (t, e, n) => (Qn(t, e, "access private method"), n), J, Ee, xe, At, Rt, st, Ue, ot, _e, $e, Fe, De, et, se, En, An, kn, ai, jn, Cn, tt, Pn, In;
|
|
7165
7163
|
class kt extends EventTarget {
|
|
7166
7164
|
constructor(e, n) {
|
|
7167
7165
|
var r, i;
|
|
7168
|
-
super(), N(this, se), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, N(this, J), N(this,
|
|
7166
|
+
super(), N(this, se), this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, N(this, J), N(this, Ee), N(this, xe), N(this, At), N(this, Rt), N(this, st), N(this, Ue), N(this, ot, null), N(this, _e), N(this, $e), N(this, Fe, null), N(this, De, null), N(this, et, null), N(this, An, async (s) => {
|
|
7169
7167
|
var o;
|
|
7170
7168
|
A(this, $e).reset();
|
|
7171
7169
|
const { body: a, redirected: u, status: d, headers: c } = s;
|
|
@@ -7201,7 +7199,7 @@ class kt extends EventTarget {
|
|
|
7201
7199
|
typeof s.id == "string" && $(this, ot, s.id);
|
|
7202
7200
|
const o = new MessageEvent(s.event || "message", {
|
|
7203
7201
|
data: s.data,
|
|
7204
|
-
origin: A(this, xe) ? A(this, xe).origin : A(this,
|
|
7202
|
+
origin: A(this, xe) ? A(this, xe).origin : A(this, Ee).origin,
|
|
7205
7203
|
lastEventId: s.id || ""
|
|
7206
7204
|
});
|
|
7207
7205
|
A(this, De) && (!s.event || s.event === "message") && A(this, De).call(this, o), this.dispatchEvent(o);
|
|
@@ -7212,9 +7210,9 @@ class kt extends EventTarget {
|
|
|
7212
7210
|
});
|
|
7213
7211
|
try {
|
|
7214
7212
|
if (e instanceof URL)
|
|
7215
|
-
$(this,
|
|
7213
|
+
$(this, Ee, e);
|
|
7216
7214
|
else if (typeof e == "string")
|
|
7217
|
-
$(this,
|
|
7215
|
+
$(this, Ee, new URL(e, Mc()));
|
|
7218
7216
|
else
|
|
7219
7217
|
throw new Error("Invalid URL");
|
|
7220
7218
|
} catch {
|
|
@@ -7246,7 +7244,7 @@ class kt extends EventTarget {
|
|
|
7246
7244
|
* @public
|
|
7247
7245
|
*/
|
|
7248
7246
|
get url() {
|
|
7249
|
-
return A(this,
|
|
7247
|
+
return A(this, Ee).href;
|
|
7250
7248
|
}
|
|
7251
7249
|
/**
|
|
7252
7250
|
* Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
|
|
@@ -7296,13 +7294,13 @@ class kt extends EventTarget {
|
|
|
7296
7294
|
A(this, Ue) && clearTimeout(A(this, Ue)), A(this, J) !== this.CLOSED && (A(this, _e) && A(this, _e).abort(), $(this, J, this.CLOSED), $(this, _e, void 0));
|
|
7297
7295
|
}
|
|
7298
7296
|
}
|
|
7299
|
-
J = /* @__PURE__ */ new WeakMap(),
|
|
7297
|
+
J = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Rt = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), _e = /* @__PURE__ */ new WeakMap(), $e = /* @__PURE__ */ new WeakMap(), Fe = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), se = /* @__PURE__ */ new WeakSet(), /**
|
|
7300
7298
|
* Connect to the given URL and start receiving events
|
|
7301
7299
|
*
|
|
7302
7300
|
* @internal
|
|
7303
7301
|
*/
|
|
7304
7302
|
En = function() {
|
|
7305
|
-
$(this, J, this.CONNECTING), $(this, _e, new AbortController()), A(this, Rt)(A(this,
|
|
7303
|
+
$(this, J, this.CONNECTING), $(this, _e, new AbortController()), A(this, Rt)(A(this, Ee), he(this, se, ai).call(this)).then(A(this, An)).catch(A(this, kn));
|
|
7306
7304
|
}, An = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), /**
|
|
7307
7305
|
* Get request options for the `fetch()` request
|
|
7308
7306
|
*
|
|
@@ -7543,7 +7541,7 @@ export {
|
|
|
7543
7541
|
Dt as InstantAPIError,
|
|
7544
7542
|
jc as InstantReactAbstractDatabase,
|
|
7545
7543
|
Mn as InstantReactWebDatabase,
|
|
7546
|
-
|
|
7544
|
+
Se as SyncTableCallbackEventType,
|
|
7547
7545
|
Nc as i,
|
|
7548
7546
|
K as id,
|
|
7549
7547
|
Rc as init,
|