@ai-matrx/records-ui 0.116.98 → 0.116.99

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/index.js CHANGED
@@ -13945,7 +13945,21 @@ function GridBody({
13945
13945
  archived,
13946
13946
  " is archived. Nothing was destroyed \u2014 it is in this table\u2019s Archived items, where Restore brings it back."
13947
13947
  ] }),
13948
- /* @__PURE__ */ jsx46(Button34, { size: "sm", variant: "ghost", className: "ml-auto h-6", onClick: () => setArchived(null), children: "Dismiss" })
13948
+ undo.canUndo ? /* @__PURE__ */ jsx46(
13949
+ Button34,
13950
+ {
13951
+ size: "sm",
13952
+ variant: "outline",
13953
+ className: "ml-auto h-6",
13954
+ "data-records-undo-now": "",
13955
+ onClick: () => {
13956
+ setArchived(null);
13957
+ void undo.undo();
13958
+ },
13959
+ children: "Undo"
13960
+ }
13961
+ ) : null,
13962
+ /* @__PURE__ */ jsx46(Button34, { size: "sm", variant: "ghost", className: undo.canUndo ? "h-6" : "ml-auto h-6", onClick: () => setArchived(null), children: "Dismiss" })
13949
13963
  ]
13950
13964
  }
13951
13965
  ) : null,
@@ -14261,16 +14275,13 @@ function GridBody({
14261
14275
  setDeleteBusy(false);
14262
14276
  setDeleting(null);
14263
14277
  if (failed) return;
14264
- if (merged) {
14265
- undo.push({
14266
- label: `Archived ${name}`,
14267
- cells: [],
14268
- archived: [row.id]
14269
- });
14270
- sheetController.current?.focusGrid();
14271
- } else {
14272
- setArchived(name);
14273
- }
14278
+ undo.push({
14279
+ label: `Archived ${name}`,
14280
+ cells: [],
14281
+ archived: [row.id]
14282
+ });
14283
+ if (merged) sheetController.current?.focusGrid();
14284
+ else setArchived(name);
14274
14285
  }
14275
14286
  }
14276
14287
  )