@box/uploads-manager 2.1.14 → 2.2.0

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 file preview for a completed item |
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
@@ -5,36 +5,26 @@ 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, isFolder: y, isRetryable: b } = d;
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" ? y ? null : /* @__PURE__ */ u(c, { children: [
16
- h && /* @__PURE__ */ l(n.ActionIconButton, {
17
- "aria-label": _.formatMessage(e.itemActionOpenAriaLabel),
18
- className: t.actionButton,
19
- icon: r,
20
- onClick: () => h(d.id),
21
- size: "small"
22
- }),
23
- g && /* @__PURE__ */ l(n.ActionIconButton, {
24
- "aria-label": _.formatMessage(e.itemActionShareAriaLabel),
25
- className: t.actionButton,
26
- icon: a,
27
- onClick: () => g(d.id),
28
- size: "small"
29
- }),
30
- m && /* @__PURE__ */ l(n.ActionIconButton, {
31
- "aria-label": _.formatMessage(e.itemActionRemoveAriaLabel),
32
- className: t.actionButton,
33
- icon: o,
34
- onClick: () => m(d.id),
35
- size: "small"
36
- })
37
- ] }) : v === "error" ? /* @__PURE__ */ u(c, { children: [b !== !1 && p && /* @__PURE__ */ l(n.ActionIconButton, {
15
+ }) : null : v === "complete" ? /* @__PURE__ */ u(c, { children: [h && /* @__PURE__ */ l(n.ActionIconButton, {
16
+ "aria-label": _.formatMessage(e.itemActionOpenAriaLabel),
17
+ className: t.actionButton,
18
+ icon: r,
19
+ onClick: () => h(d.id),
20
+ size: "small"
21
+ }), g && /* @__PURE__ */ l(n.ActionIconButton, {
22
+ "aria-label": _.formatMessage(e.itemActionShareAriaLabel),
23
+ className: t.actionButton,
24
+ icon: a,
25
+ onClick: () => g(d.id),
26
+ size: "small"
27
+ })] }) : v === "error" ? /* @__PURE__ */ u(c, { children: [y !== !1 && p && /* @__PURE__ */ l(n.ActionIconButton, {
38
28
  "aria-label": _.formatMessage(e.itemActionRetryAriaLabel),
39
29
  className: t.actionButton,
40
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 and have limited actions.
42
+ * Folder items display a folder icon.
43
43
  *
44
44
  * @default false
45
45
  */
@@ -76,15 +76,15 @@ export interface UploadsItemActionCallbacks {
76
76
  * whether to resume from the last chunk or restart from scratch.
77
77
  */
78
78
  onItemRetry?: (itemId: string) => void;
79
- /** Remove a completed, errored, or canceled item from the list */
79
+ /** Remove an errored item from the list */
80
80
  onItemRemove?: (itemId: string) => void;
81
81
  /**
82
- * Open file preview for a completed item.
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@box/uploads-manager",
3
- "version": "2.1.14",
3
+ "version": "2.2.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^16.4.5",