@ai-matrx/records 0.84.4 → 0.84.5
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/CHANGELOG.md +8 -0
- package/dist/app-table/index.cjs +15 -2
- package/dist/app-table/index.cjs.map +1 -1
- package/dist/app-table/index.js +15 -2
- package/dist/app-table/index.js.map +1 -1
- package/dist/core/index.cjs +23 -4
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +7 -1
- package/dist/core/index.d.ts +7 -1
- package/dist/core/index.js +23 -4
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +15 -2
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.js +15 -2
- package/dist/data/index.js.map +1 -1
- package/dist/react/index.cjs +20 -4
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +20 -4
- package/dist/react/index.js.map +1 -1
- package/package.json +3 -3
package/dist/react/index.cjs
CHANGED
|
@@ -368,6 +368,16 @@ function announceRecordChanged(recordId) {
|
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
+
var removed = /* @__PURE__ */ new Set();
|
|
372
|
+
function markRecordRemoved(recordId) {
|
|
373
|
+
removed.add(recordId);
|
|
374
|
+
}
|
|
375
|
+
function markRecordRestored(recordId) {
|
|
376
|
+
removed.delete(recordId);
|
|
377
|
+
}
|
|
378
|
+
function isRecordRemoved(recordId) {
|
|
379
|
+
return removed.has(recordId);
|
|
380
|
+
}
|
|
371
381
|
function onRecordChanged(listener) {
|
|
372
382
|
listeners.add(listener);
|
|
373
383
|
return () => listeners.delete(listener);
|
|
@@ -4898,7 +4908,10 @@ function createRecordsClient(given) {
|
|
|
4898
4908
|
{ p_organization_id: org, p_record_id: record_id },
|
|
4899
4909
|
"recordDelete"
|
|
4900
4910
|
);
|
|
4901
|
-
if (result.ok)
|
|
4911
|
+
if (result.ok) {
|
|
4912
|
+
markRecordRemoved(record_id);
|
|
4913
|
+
announceRecordChanged(record_id);
|
|
4914
|
+
}
|
|
4902
4915
|
return result;
|
|
4903
4916
|
},
|
|
4904
4917
|
async recordRestore({ record_id }) {
|
|
@@ -4907,7 +4920,10 @@ function createRecordsClient(given) {
|
|
|
4907
4920
|
{ p_organization_id: org, p_record_id: record_id },
|
|
4908
4921
|
"recordRestore"
|
|
4909
4922
|
);
|
|
4910
|
-
if (result.ok)
|
|
4923
|
+
if (result.ok) {
|
|
4924
|
+
markRecordRestored(record_id);
|
|
4925
|
+
announceRecordChanged(record_id);
|
|
4926
|
+
}
|
|
4911
4927
|
return result;
|
|
4912
4928
|
},
|
|
4913
4929
|
async tableArchive({ table_id, chunk, includeTable }) {
|
|
@@ -8670,7 +8686,7 @@ function liveRecordFor(recordId, tableId) {
|
|
|
8670
8686
|
const stops = [];
|
|
8671
8687
|
stops.push(
|
|
8672
8688
|
onRecordChanged((changed) => {
|
|
8673
|
-
if (changed === recordId) entry.refetch();
|
|
8689
|
+
if (changed === recordId && !isRecordRemoved(recordId)) entry.refetch();
|
|
8674
8690
|
})
|
|
8675
8691
|
);
|
|
8676
8692
|
const client = entry.client;
|
|
@@ -8681,7 +8697,7 @@ function liveRecordFor(recordId, tableId) {
|
|
|
8681
8697
|
{ organization_id: client.config.organizationId, table_id: tableId },
|
|
8682
8698
|
{
|
|
8683
8699
|
records(ids) {
|
|
8684
|
-
if (ids === null || ids.includes(recordId)) entry.refetch();
|
|
8700
|
+
if ((ids === null || ids.includes(recordId)) && !isRecordRemoved(recordId)) entry.refetch();
|
|
8685
8701
|
},
|
|
8686
8702
|
shape() {
|
|
8687
8703
|
tableShapeChanged(tableId);
|