@ai-matrx/records-ui 0.116.108 → 0.116.109

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 CHANGED
@@ -1,10 +1,29 @@
1
1
  # Changelog
2
2
 
3
- ## 0.116.108
3
+ ## 0.116.109
4
4
 
5
5
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
6
6
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
7
7
 
8
+ ## 0.116.108
9
+
10
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 45e5dca239 d324df1734 -- apps/shared/records-ui/src`
11
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
12
+
13
+ ## 0.116.107
14
+
15
+ Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 33bd1514e6 45e5dca239 -- apps/shared/records-ui/src`
16
+ has no shipped-source changes outside tests, fixtures and docs). No consumer action required.
17
+
18
+ ## 0.116.106
19
+
20
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
21
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
22
+ Diff: `git diff 5b7c48a99c 33bd1514e6 -- apps/shared/records-ui/src`
23
+
24
+ Changed shipped source files (1):
25
+ - `apps/shared/records-ui/src/RecordsTableCard.tsx`
26
+
8
27
  ## 0.116.105
9
28
 
10
29
  Automatic changed-only republish (docs/metadata drift since the last published version; verified: `git diff 82d533cb27 5b7c48a99c -- apps/shared/records-ui/src`
package/dist/index.cjs CHANGED
@@ -27880,6 +27880,7 @@ function DocTemplate({ tableId, seed, pageSettings, activeTemplateId, onActiveTe
27880
27880
  };
27881
27881
  const [unresolved, setUnresolved] = (0, import_react141.useState)([]);
27882
27882
  const [saving, setSaving] = (0, import_react141.useState)(false);
27883
+ const [askingToRemove, setAskingToRemove] = (0, import_react141.useState)(false);
27883
27884
  const load = (0, import_react141.useCallback)(async () => {
27884
27885
  const held = await client.docTemplates({ table_id: tableId });
27885
27886
  if (!held.ok) {
@@ -27952,6 +27953,19 @@ function DocTemplate({ tableId, seed, pageSettings, activeTemplateId, onActiveTe
27952
27953
  setActiveId(saved.data);
27953
27954
  await load();
27954
27955
  }
27956
+ async function remove(templateId) {
27957
+ setAskingToRemove(false);
27958
+ const gone = await client.docTemplateDelete({ template_id: templateId });
27959
+ if (!gone.ok) {
27960
+ setError(gone.error);
27961
+ return;
27962
+ }
27963
+ setActiveId(null);
27964
+ setDraftName("");
27965
+ setDraftBody("");
27966
+ setDraftLayout({ ...EMPTY_LAYOUT });
27967
+ await load();
27968
+ }
27955
27969
  if (fields.error) return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
27956
27970
  if (error) {
27957
27971
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
@@ -28004,7 +28018,18 @@ function DocTemplate({ tableId, seed, pageSettings, activeTemplateId, onActiveTe
28004
28018
  children: "New template"
28005
28019
  }
28006
28020
  ),
28007
- /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_design_system76.Button, { size: "sm", className: "ml-auto", disabled: saving, onClick: () => void save(), children: saving ? "Saving\u2026" : "Save" })
28021
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "ml-auto flex shrink-0 items-center gap-1", children: [
28022
+ activeId && askingToRemove ? /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
28023
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("span", { className: "text-xs text-destructive", children: [
28024
+ "Remove \\u201c",
28025
+ templates.find((t) => t.id === activeId)?.name ?? draftName,
28026
+ "\\u201d? Trash brings it back."
28027
+ ] }),
28028
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_design_system76.Button, { size: "sm", variant: "destructive", "data-doc-template-remove-confirm": "", onClick: () => void remove(activeId), children: "Remove it" }),
28029
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_design_system76.Button, { size: "sm", variant: "ghost", onClick: () => setAskingToRemove(false), children: "Keep it" })
28030
+ ] }) : activeId ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_design_system76.Button, { size: "sm", variant: "ghost", "data-doc-template-remove": "", disabled: saving, onClick: () => setAskingToRemove(true), children: "Remove" }) : null,
28031
+ /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_design_system76.Button, { size: "sm", disabled: saving, onClick: () => void save(), children: saving ? "Saving\u2026" : "Save" })
28032
+ ] })
28008
28033
  ] }),
28009
28034
  /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("label", { className: "flex flex-col gap-1", children: [
28010
28035
  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_design_system76.Label, { className: "text-xs font-medium", children: "Name" }),
@@ -57398,6 +57423,8 @@ function DocRender({ templateId, recordId, filename, onRendered, className }) {
57398
57423
  const [showing, setShowing] = (0, import_react333.useState)(null);
57399
57424
  const [error, setError] = (0, import_react333.useState)(null);
57400
57425
  const [busy, setBusy] = (0, import_react333.useState)(null);
57426
+ const [askingToRemove, setAskingToRemove] = (0, import_react333.useState)(false);
57427
+ const [removed, setRemoved] = (0, import_react333.useState)(null);
57401
57428
  const paper = (0, import_react333.useRef)(null);
57402
57429
  const load = (0, import_react333.useCallback)(async () => {
57403
57430
  const [body, held] = await Promise.all([
@@ -57435,6 +57462,31 @@ function DocRender({ templateId, recordId, filename, onRendered, className }) {
57435
57462
  if (row) onRendered?.(row);
57436
57463
  }
57437
57464
  }
57465
+ async function remove(renderId) {
57466
+ setAskingToRemove(false);
57467
+ setBusy("remove");
57468
+ const gone = await client.docRenderDelete({ render_id: renderId });
57469
+ setBusy(null);
57470
+ if (!gone.ok) {
57471
+ setError(gone.error);
57472
+ return;
57473
+ }
57474
+ setShowing(null);
57475
+ setRemoved(renderId);
57476
+ await load();
57477
+ }
57478
+ async function undoRemove(renderId) {
57479
+ setBusy("remove");
57480
+ const back = await client.docRenderRestore({ render_id: renderId });
57481
+ setBusy(null);
57482
+ if (!back.ok) {
57483
+ setError(back.error);
57484
+ return;
57485
+ }
57486
+ setRemoved(null);
57487
+ await load();
57488
+ setShowing(renderId);
57489
+ }
57438
57490
  async function toPdf() {
57439
57491
  const element = paper.current;
57440
57492
  if (!element) return;
@@ -57493,6 +57545,14 @@ function DocRender({ templateId, recordId, filename, onRendered, className }) {
57493
57545
  render.id
57494
57546
  )),
57495
57547
  /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)("span", { className: "ml-auto flex items-center gap-1", children: [
57548
+ frozen && askingToRemove ? /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(import_jsx_runtime190.Fragment, { children: [
57549
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("span", { className: "text-destructive", children: "This removes the saved version." }),
57550
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_design_system166.Button, { size: "sm", variant: "destructive", "data-doc-render-remove-confirm": "", disabled: busy !== null, onClick: () => void remove(frozen.id), children: "Remove it" }),
57551
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_design_system166.Button, { size: "sm", variant: "ghost", onClick: () => setAskingToRemove(false), children: "Keep it" })
57552
+ ] }) : frozen ? /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_design_system166.Button, { size: "sm", variant: "ghost", "data-doc-render-remove": "", disabled: busy !== null, onClick: () => setAskingToRemove(true), children: "Remove" }) : removed ? /* @__PURE__ */ (0, import_jsx_runtime190.jsxs)(import_jsx_runtime190.Fragment, { children: [
57553
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)("span", { className: "text-muted-foreground", children: "Removed." }),
57554
+ /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_design_system166.Button, { size: "sm", variant: "ghost", "data-doc-render-undo": "", disabled: busy !== null, onClick: () => void undoRemove(removed), children: "Undo" })
57555
+ ] }) : null,
57496
57556
  /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_design_system166.Button, { size: "sm", disabled: busy !== null, onClick: () => void freeze(), children: busy === "freeze" ? "Freezing\u2026" : "Freeze this version" }),
57497
57557
  /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_design_system166.Button, { size: "sm", variant: "ghost", disabled: busy !== null, onClick: () => void toPdf(), children: busy === "pdf" ? "Making the PDF\u2026" : "PDF" })
57498
57558
  ] })