@box/uploads-manager 2.1.15 → 2.2.1
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/README.md
CHANGED
|
@@ -72,7 +72,7 @@ type UploadItemStatus = 'pending' | 'uploading' | 'staged' | 'complete' | 'error
|
|
|
72
72
|
| `onItemCancel` | `(itemId: string) => void` | No | Cancel a single item |
|
|
73
73
|
| `onItemRetry` | `(itemId: string) => void` | No | Retry a single item (labeled "Retry") |
|
|
74
74
|
| `onItemRemove` | `(itemId: string) => void` | No | Remove a completed/errored/canceled item |
|
|
75
|
-
| `onItemOpen` | `(itemId: string) => void` | No | Open
|
|
75
|
+
| `onItemOpen` | `(itemId: string) => void` | No | Open a completed item |
|
|
76
76
|
| `onItemShare` | `(itemId: string) => void` | No | Share a completed item via link |
|
|
77
77
|
|
|
78
78
|
## Usage
|
|
@@ -22,7 +22,7 @@ function l({ isExpanded: l, defaultExpanded: u = !0, onToggle: d, items: f, onCa
|
|
|
22
22
|
failedCount: 0,
|
|
23
23
|
canceledCount: 0,
|
|
24
24
|
activeCount: 0
|
|
25
|
-
}), O = D > 0, k = O && !!p, A = !O && T > 0 && !!m, j = r(f), M = n(f);
|
|
25
|
+
}), O = D > 0, k = O && !!p, A = !O && T > 0 && !!m, j = r(f), M = n(f), N = f.length > 0;
|
|
26
26
|
return /* @__PURE__ */ s("div", {
|
|
27
27
|
className: c.container,
|
|
28
28
|
children: [/* @__PURE__ */ o(e, {
|
|
@@ -36,7 +36,7 @@ function l({ isExpanded: l, defaultExpanded: u = !0, onToggle: d, items: f, onCa
|
|
|
36
36
|
progress: M,
|
|
37
37
|
status: j,
|
|
38
38
|
totalCount: C
|
|
39
|
-
}), /* @__PURE__ */ o("div", {
|
|
39
|
+
}), N && /* @__PURE__ */ o("div", {
|
|
40
40
|
className: a(c.itemListSlot, b && c.itemListSlotExpanded),
|
|
41
41
|
children: /* @__PURE__ */ o("div", {
|
|
42
42
|
"aria-hidden": !b,
|
|
@@ -5,14 +5,14 @@ import { ArrowUpRightSquare as r, ArrowsSpinning as i, Link as a, XMark as o } f
|
|
|
5
5
|
import { useIntl as s } from "react-intl";
|
|
6
6
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
7
|
function d({ item: d, onItemCancel: f, onItemRetry: p, onItemRemove: m, onItemOpen: h, onItemShare: g }) {
|
|
8
|
-
let _ = s(), { status: v,
|
|
8
|
+
let _ = s(), { status: v, isRetryable: y } = d;
|
|
9
9
|
return v === "pending" || v === "uploading" ? f ? /* @__PURE__ */ l(n.ActionIconButton, {
|
|
10
10
|
"aria-label": _.formatMessage(e.itemActionCancelAriaLabel),
|
|
11
11
|
className: t.actionButton,
|
|
12
12
|
icon: o,
|
|
13
13
|
onClick: () => f(d.id),
|
|
14
14
|
size: "small"
|
|
15
|
-
}) : null : v === "complete" ?
|
|
15
|
+
}) : null : v === "complete" ? /* @__PURE__ */ u(c, { children: [h && /* @__PURE__ */ l(n.ActionIconButton, {
|
|
16
16
|
"aria-label": _.formatMessage(e.itemActionOpenAriaLabel),
|
|
17
17
|
className: t.actionButton,
|
|
18
18
|
icon: r,
|
|
@@ -24,7 +24,7 @@ function d({ item: d, onItemCancel: f, onItemRetry: p, onItemRemove: m, onItemOp
|
|
|
24
24
|
icon: a,
|
|
25
25
|
onClick: () => g(d.id),
|
|
26
26
|
size: "small"
|
|
27
|
-
})] }) : v === "error" ? /* @__PURE__ */ u(c, { children: [
|
|
27
|
+
})] }) : v === "error" ? /* @__PURE__ */ u(c, { children: [y !== !1 && p && /* @__PURE__ */ l(n.ActionIconButton, {
|
|
28
28
|
"aria-label": _.formatMessage(e.itemActionRetryAriaLabel),
|
|
29
29
|
className: t.actionButton,
|
|
30
30
|
icon: i,
|
|
@@ -39,7 +39,7 @@ export interface UploadItem {
|
|
|
39
39
|
status: UploadItemStatus;
|
|
40
40
|
/**
|
|
41
41
|
* Whether this item represents a folder rather than a file.
|
|
42
|
-
* Folder items display a folder icon
|
|
42
|
+
* Folder items display a folder icon.
|
|
43
43
|
*
|
|
44
44
|
* @default false
|
|
45
45
|
*/
|
|
@@ -79,12 +79,12 @@ export interface UploadsItemActionCallbacks {
|
|
|
79
79
|
/** Remove an errored item from the list */
|
|
80
80
|
onItemRemove?: (itemId: string) => void;
|
|
81
81
|
/**
|
|
82
|
-
* Open file preview
|
|
82
|
+
* Open a completed item (file preview or folder).
|
|
83
83
|
* When not provided, the "Open" action button is not rendered.
|
|
84
84
|
*/
|
|
85
85
|
onItemOpen?: (itemId: string) => void;
|
|
86
86
|
/**
|
|
87
|
-
* Share a completed item via link.
|
|
87
|
+
* Share a completed item (file or folder) via link.
|
|
88
88
|
* When not provided, the "Share" action button is not rendered.
|
|
89
89
|
*/
|
|
90
90
|
onItemShare?: (itemId: string) => void;
|