@hiai-gg/docsmint 0.5.3 → 0.5.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.
@@ -245,6 +245,11 @@ function mutationRefreshImpact(input, init) {
245
245
  folders: true,
246
246
  tags: false
247
247
  };
248
+ if (/^\/api\/(?:v1\/)?trash(?:\/|$)/.test(pathname)) return {
249
+ documents: true,
250
+ folders: true,
251
+ tags: false
252
+ };
248
253
  if (/^\/api\/(?:v1\/)?(?:documents|import|imports)(?:\/|$)/.test(pathname)) return {
249
254
  documents: true,
250
255
  folders: true,
@@ -1,4 +1,4 @@
1
- import { Cr as doc_open, Dr as doc_share, Fr as dashboard_page_title, Ir as dashboard_new_document, Lr as dashboard_subtitle, Rr as dashboard_title, Sr as doc_duplicate, Tr as doc_updated, _n as action_cancel, _r as folders_rename, _t as folder_page_title, a as import_progress_error, bt as editor_more_options, c as import_progress_queued, cr as folders_subfolders, d as import_progress_title, f as sidebar_uncategorized, fn as action_back, gn as action_delete, gr as folders_delete, gt as share_copied, hr as folders_delete_title, i as import_progress_summary, k as dashboard_import, l as import_progress_uploading, lr as folders_document, mr as folders_delete_description, n as import_progress_empty, o as import_progress_done, or as folders_move, pn as action_close, r as import_progress_close, s as import_progress_processing, sr as folders_subfolder, u as import_progress_total, un as action_loading, ur as folders_documents, vn as action_save, vr as folders_empty_description, wr as doc_open_menu, xr as doc_move_to_folder, yr as folders_empty, yt as action_copy_content, zr as nav_documents } from "./assets/messages-BAQzILs4.js";
1
+ import { Cr as doc_open, Dr as doc_share, Fr as dashboard_page_title, Ir as dashboard_new_document, Lr as dashboard_subtitle, Pr as doc_title_placeholder, Rr as dashboard_title, Sr as doc_duplicate, Tr as doc_updated, _n as action_cancel, _r as folders_rename, _t as folder_page_title, a as import_progress_error, bt as editor_more_options, c as import_progress_queued, cr as folders_subfolders, d as import_progress_title, f as sidebar_uncategorized, fn as action_back, gn as action_delete, gr as folders_delete, gt as share_copied, hr as folders_delete_title, i as import_progress_summary, k as dashboard_import, l as import_progress_uploading, lr as folders_document, mr as folders_delete_description, n as import_progress_empty, o as import_progress_done, or as folders_move, pn as action_close, r as import_progress_close, s as import_progress_processing, sr as folders_subfolder, u as import_progress_total, un as action_loading, ur as folders_documents, vn as action_save, vr as folders_empty_description, wr as doc_open_menu, xr as doc_move_to_folder, yr as folders_empty, yt as action_copy_content, zr as nav_documents } from "./assets/messages-BAQzILs4.js";
2
2
  import { t as Icon } from "./assets/Icon-QwirKi9Y.js";
3
3
  import { i as Folder_kanban, n as Badge, r as X, t as DatePicker } from "./assets/DatePicker-D84cJ-Eq.js";
4
4
  import { i as Check, n as Plus, r as File_text, t as FolderDialog } from "./assets/confirm-dialog-XuyaL8sr.js";
@@ -1787,6 +1787,10 @@ function HiaiDocsDashboardHost($$renderer, $$props) {
1787
1787
  let showDeleteFolderDialog = false;
1788
1788
  let deleteFolderTargetId = null;
1789
1789
  let deleteFolderBusy = false;
1790
+ let showDeleteDocumentDialog = false;
1791
+ let deleteDocumentTargetId = null;
1792
+ let deleteDocumentTargetTitle = "";
1793
+ let deleteDocumentBusy = false;
1790
1794
  let showShareDialog = false;
1791
1795
  let shareTarget = null;
1792
1796
  let importOpen = false;
@@ -1874,14 +1878,26 @@ function HiaiDocsDashboardHost($$renderer, $$props) {
1874
1878
  deleteFolderBusy = false;
1875
1879
  }
1876
1880
  }
1877
- async function handleDeleteDocument(id) {
1878
- if (!confirm(`${action_delete()}?`)) return;
1881
+ function handleDeleteDocument(id) {
1882
+ const document = filteredDocuments().find((candidate) => candidate.id === id);
1883
+ deleteDocumentTargetId = id;
1884
+ deleteDocumentTargetTitle = document?.title || doc_title_placeholder();
1885
+ showDeleteDocumentDialog = true;
1886
+ }
1887
+ async function confirmDeleteDocument() {
1888
+ const id = deleteDocumentTargetId;
1889
+ if (!id || deleteDocumentBusy) return;
1890
+ deleteDocumentBusy = true;
1879
1891
  try {
1880
1892
  await apiFetch(`/api/documents/${id}`, { method: "DELETE" }, request.fetch);
1893
+ showDeleteDocumentDialog = false;
1894
+ deleteDocumentTargetId = null;
1881
1895
  await invalidateAll();
1882
1896
  refreshDocs();
1883
1897
  } catch (e) {
1884
1898
  console.error("Failed to delete document", e);
1899
+ } finally {
1900
+ deleteDocumentBusy = false;
1885
1901
  }
1886
1902
  }
1887
1903
  async function handleDuplicateDocument(id) {
@@ -2676,6 +2692,24 @@ function HiaiDocsDashboardHost($$renderer, $$props) {
2676
2692
  }
2677
2693
  });
2678
2694
  $$renderer.push(`<!----> `);
2695
+ ConfirmDialog($$renderer, {
2696
+ title: "Move to Trash?",
2697
+ description: `“${deleteDocumentTargetTitle}” will be moved to Trash and can be restored later.`,
2698
+ confirmLabel: "Move to Trash",
2699
+ cancelLabel: action_cancel(),
2700
+ variant: "destructive",
2701
+ busy: deleteDocumentBusy,
2702
+ onConfirm: confirmDeleteDocument,
2703
+ onCancel: () => showDeleteDocumentDialog = false,
2704
+ get open() {
2705
+ return showDeleteDocumentDialog;
2706
+ },
2707
+ set open($$value) {
2708
+ showDeleteDocumentDialog = $$value;
2709
+ $$settled = false;
2710
+ }
2711
+ });
2712
+ $$renderer.push(`<!----> `);
2679
2713
  if (shareTarget) {
2680
2714
  $$renderer.push("<!--[0-->");
2681
2715
  ShareDialog($$renderer, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hiai-gg/docsmint",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "type": "module",
5
5
  "browser": {
6
6
  "./dist/backend-launcher.js": false,
@@ -24,7 +24,7 @@ import { registerSearch } from "./commands/search.js";
24
24
  import { registerSnapshot } from "./commands/snapshot.js";
25
25
  import { registerUpdate } from "./commands/update.js";
26
26
 
27
- const VERSION = "0.5.3";
27
+ const VERSION = "0.5.5";
28
28
 
29
29
  const program = new Command();
30
30
  program
@@ -35,7 +35,7 @@ interface McpToolResult {
35
35
 
36
36
  const server = new McpServer({
37
37
  name: "hiai-docs",
38
- version: "0.5.3",
38
+ version: "0.5.5",
39
39
  });
40
40
 
41
41
  /**