@vryzel/file-next-ui 0.4.1 → 0.4.2

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.cjs CHANGED
@@ -836,24 +836,26 @@ function ExplorerContextMenu(props) {
836
836
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { "aria-hidden": "true", className: "size-4" }),
837
837
  labels.restore
838
838
  ] }),
839
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px bg-border" }),
840
- /* @__PURE__ */ jsxRuntime.jsxs(
841
- "button",
842
- {
843
- type: "button",
844
- role: "menuitem",
845
- className: cn(itemClass, "text-destructive"),
846
- onClick: () => {
847
- close();
848
- if (onRequestPurge) onRequestPurge(target.file);
849
- else void actions.purgeNode?.({ id: target.file.id });
850
- },
851
- children: [
852
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { "aria-hidden": "true", className: "size-4" }),
853
- labels.deleteForever
854
- ]
855
- }
856
- )
839
+ onRequestPurge || actions.purgeNode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
840
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 h-px bg-border" }),
841
+ /* @__PURE__ */ jsxRuntime.jsxs(
842
+ "button",
843
+ {
844
+ type: "button",
845
+ role: "menuitem",
846
+ className: cn(itemClass, "text-destructive"),
847
+ onClick: () => {
848
+ close();
849
+ if (onRequestPurge) onRequestPurge(target.file);
850
+ else void actions.purgeNode?.({ id: target.file.id });
851
+ },
852
+ children: [
853
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { "aria-hidden": "true", className: "size-4" }),
854
+ labels.deleteForever
855
+ ]
856
+ }
857
+ )
858
+ ] }) : null
857
859
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
858
860
  target.file.kind === "file" && onPreview ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", role: "menuitem", className: itemClass, onClick: () => {
859
861
  close();
@@ -1954,7 +1956,7 @@ function FileExplorerInner(props) {
1954
1956
  if ((event.key === "Delete" || event.key === "Backspace") && selectedFiles.length > 0) {
1955
1957
  event.preventDefault();
1956
1958
  if (trashOpen) {
1957
- setPurgeTargets(selectedFiles);
1959
+ if (actions.purgeNode) setPurgeTargets(selectedFiles);
1958
1960
  return;
1959
1961
  }
1960
1962
  if (selectedFiles.some((file) => protectedSet.has(file.id))) return;
@@ -2157,7 +2159,7 @@ function FileExplorerInner(props) {
2157
2159
  onDownload,
2158
2160
  onRename: setRenameTarget,
2159
2161
  onRequestDelete: (file) => setDeleteTargets([file]),
2160
- onRequestPurge: (file) => setPurgeTargets([file]),
2162
+ onRequestPurge: actions.purgeNode ? (file) => setPurgeTargets([file]) : void 0,
2161
2163
  onCopy: (file) => copyToClipboard([file]),
2162
2164
  onPaste: clipboard.length > 0 && !trashOpen ? (folder) => void pasteClipboard(folder ? folder.id : parentId) : void 0,
2163
2165
  onNewFolder: actions.createFolder ? () => setFolderOpen(true) : void 0,
@@ -2186,7 +2188,7 @@ function FileExplorerInner(props) {
2186
2188
  clearSelection();
2187
2189
  await reload();
2188
2190
  } : void 0,
2189
- onPurge: () => setPurgeTargets(selectedFiles),
2191
+ onPurge: actions.purgeNode ? () => setPurgeTargets(selectedFiles) : void 0,
2190
2192
  onClear: clearSelection
2191
2193
  }
2192
2194
  ),