@box/activity-feed 2.1.30 → 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.
@@ -1,11 +1,12 @@
1
- import e from "../esm/lib/components/task-item/messages.js";
2
- import { t } from "./AssigneeList.js";
3
- import { t as n } from "./TaskDueDate.js";
4
- import { Button as r } from "@box/blueprint-web";
5
- import { useIntl as i } from "react-intl";
6
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- import { Checkmark as s, XMark as c } from "@box/blueprint-web-assets/icons/Medium";
8
- import '../styles/TaskItemFooter.css';var l = {
1
+ import { ACTIVITY_FEED_RESIN_TARGETS as e } from "../esm/lib/resin-targets.js";
2
+ import t from "../esm/lib/components/task-item/messages.js";
3
+ import { t as n } from "./AssigneeList.js";
4
+ import { t as r } from "./TaskDueDate.js";
5
+ import { Button as i } from "@box/blueprint-web";
6
+ import { useIntl as a } from "react-intl";
7
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
+ import { Checkmark as c, XMark as l } from "@box/blueprint-web-assets/icons/Medium";
9
+ import '../styles/TaskItemFooter.css';var u = {
9
10
  taskItem: "_taskItem_156h2_1",
10
11
  header: "_header_156h2_10",
11
12
  headerTitleRow: "_headerTitleRow_156h2_18",
@@ -17,57 +18,60 @@ import '../styles/TaskItemFooter.css';var l = {
17
18
  approvalApproveIcon: "_approvalApproveIcon_156h2_57",
18
19
  approvalRejectIcon: "_approvalRejectIcon_156h2_61"
19
20
  };
20
- function u({ assignees: u, canApprove: d, canReject: f, disabled: p = !1, dueDate: m, hasNextPage: h, onApprove: g, onComplete: _, onLoadAllAssignee: v, onReject: y, pendingAction: b, showActionButtons: x, showApprovalActions: S, showGeneralComplete: C }) {
21
- let w = i(), T = b !== void 0;
22
- return /* @__PURE__ */ o("div", {
23
- className: x ? l.textMessageFooterSlot : `${l.textMessageFooterSlot} ${l.marginBottom}`,
21
+ function d({ assignees: d, canApprove: f, canReject: p, disabled: m = !1, dueDate: h, hasNextPage: g, onApprove: _, onComplete: v, onLoadAllAssignee: y, onReject: b, pendingAction: x, showActionButtons: S, showApprovalActions: C, showGeneralComplete: w }) {
22
+ let T = a(), E = x !== void 0;
23
+ return /* @__PURE__ */ s("div", {
24
+ className: S ? u.textMessageFooterSlot : `${u.textMessageFooterSlot} ${u.marginBottom}`,
24
25
  children: [
25
- !!m && /* @__PURE__ */ a(n, { dueDate: m }),
26
- /* @__PURE__ */ a(t, {
27
- assignees: u,
28
- disabled: p,
29
- hasNextPage: h,
30
- onLoadAllAssignee: v
26
+ !!h && /* @__PURE__ */ o(r, { dueDate: h }),
27
+ /* @__PURE__ */ o(n, {
28
+ assignees: d,
29
+ disabled: m,
30
+ hasNextPage: g,
31
+ onLoadAllAssignee: y
31
32
  }),
32
- x && /* @__PURE__ */ o("div", { children: [C && /* @__PURE__ */ a(r, {
33
- disabled: p || T && b !== "complete",
34
- loading: b === "complete",
35
- loadingAriaLabel: w.formatMessage(e.taskCompleteActionLoading),
36
- onClick: _,
33
+ S && /* @__PURE__ */ s("div", { children: [w && /* @__PURE__ */ o(i, {
34
+ "data-resin-target": e.TASK_COMPLETE,
35
+ disabled: m || E && x !== "complete",
36
+ loading: x === "complete",
37
+ loadingAriaLabel: T.formatMessage(t.taskCompleteActionLoading),
38
+ onClick: v,
37
39
  size: "small",
38
40
  variant: "primary",
39
- children: w.formatMessage(e.taskCompleteAction)
40
- }), S && /* @__PURE__ */ o("div", {
41
- className: l.approvalActionsRow,
42
- children: [/* @__PURE__ */ a(r, {
43
- disabled: p || !d || T && b !== "approve",
44
- loading: b === "approve",
45
- loadingAriaLabel: w.formatMessage(e.taskApproveActionLoading),
46
- onClick: g,
41
+ children: T.formatMessage(t.taskCompleteAction)
42
+ }), C && /* @__PURE__ */ s("div", {
43
+ className: u.approvalActionsRow,
44
+ children: [/* @__PURE__ */ o(i, {
45
+ "data-resin-target": e.TASK_APPROVE,
46
+ disabled: m || !f || E && x !== "approve",
47
+ loading: x === "approve",
48
+ loadingAriaLabel: T.formatMessage(t.taskApproveActionLoading),
49
+ onClick: _,
47
50
  size: "small",
48
- startIcon: () => /* @__PURE__ */ a(s, {
49
- className: l.approvalApproveIcon,
51
+ startIcon: () => /* @__PURE__ */ o(c, {
52
+ className: u.approvalApproveIcon,
50
53
  color: "currentColor"
51
54
  }),
52
55
  type: "button",
53
56
  variant: "secondary",
54
- children: w.formatMessage(e.taskApproveAction)
55
- }), /* @__PURE__ */ a(r, {
56
- disabled: p || !f || T && b !== "reject",
57
- loading: b === "reject",
58
- loadingAriaLabel: w.formatMessage(e.taskRejectActionLoading),
59
- onClick: y,
57
+ children: T.formatMessage(t.taskApproveAction)
58
+ }), /* @__PURE__ */ o(i, {
59
+ "data-resin-target": e.TASK_REJECT,
60
+ disabled: m || !p || E && x !== "reject",
61
+ loading: x === "reject",
62
+ loadingAriaLabel: T.formatMessage(t.taskRejectActionLoading),
63
+ onClick: b,
60
64
  size: "small",
61
- startIcon: () => /* @__PURE__ */ a(c, {
62
- className: l.approvalRejectIcon,
65
+ startIcon: () => /* @__PURE__ */ o(l, {
66
+ className: u.approvalRejectIcon,
63
67
  color: "currentColor"
64
68
  }),
65
69
  type: "button",
66
70
  variant: "secondary",
67
- children: w.formatMessage(e.taskRejectAction)
71
+ children: T.formatMessage(t.taskRejectAction)
68
72
  })]
69
73
  })] })
70
74
  ]
71
75
  });
72
76
  }
73
- export { l as n, u as t };
77
+ export { u as n, d as t };
@@ -1,70 +1,72 @@
1
- import { ACTIVITY_FEED_RESIN_TARGETS as e } from "../esm/lib/resin-targets.js";
2
- import { messages as t } from "../esm/lib/components/header/messages.js";
3
- import { HeaderMentionMeOption as n, HeaderShowResolvedOption as r } from "../esm/lib/components/header/header-filter-options.js";
4
- import { t as i } from "./task-button.js";
5
- import { useState as a } from "react";
6
- import { DropdownMenu as o, IconButton as s, IconToggleButton as c, Text as l } from "@box/blueprint-web";
7
- import { useIntl as u } from "react-intl";
8
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
- import { Funnel as p, XMark as m } from "@box/blueprint-web-assets/icons/Medium";
10
- import '../styles/header.css';var h = {
1
+ import { ACTIVITY_FEED_RESIN_COMPONENTS as e, ACTIVITY_FEED_RESIN_FEATURE as t, ACTIVITY_FEED_RESIN_TARGETS as n } from "../esm/lib/resin-targets.js";
2
+ import { messages as r } from "../esm/lib/components/header/messages.js";
3
+ import { HeaderMentionMeOption as i, HeaderShowResolvedOption as a } from "../esm/lib/components/header/header-filter-options.js";
4
+ import { t as o } from "./task-button.js";
5
+ import { useState as s } from "react";
6
+ import { DropdownMenu as c, IconButton as l, IconToggleButton as u, Text as d } from "@box/blueprint-web";
7
+ import { useIntl as f } from "react-intl";
8
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
9
+ import { Funnel as h, XMark as g } from "@box/blueprint-web-assets/icons/Medium";
10
+ import '../styles/header.css';var _ = {
11
11
  header: "_header_1hyzr_27",
12
12
  title: "_title_1hyzr_37",
13
13
  actions: "_actions_1hyzr_45",
14
14
  filterMenuContent: "_filterMenuContent_1hyzr_52",
15
15
  filtersTitle: "_filtersTitle_1hyzr_56",
16
16
  filterTrigger: "_filterTrigger_1hyzr_60"
17
- }, g = Object.assign(({ children: t, title: n }) => /* @__PURE__ */ f("div", {
18
- className: h.header,
17
+ }, v = Object.assign(({ children: t, title: n }) => /* @__PURE__ */ m("div", {
18
+ className: _.header,
19
19
  "data-resin-component": e.HEADER,
20
- children: [/* @__PURE__ */ d(l, {
20
+ children: [/* @__PURE__ */ p(d, {
21
21
  as: "h2",
22
- className: h.title,
22
+ className: _.title,
23
23
  variant: "titleLarge",
24
24
  children: n
25
25
  }), t]
26
26
  }), {
27
- Actions: ({ children: e }) => /* @__PURE__ */ d("div", {
28
- className: h.actions,
27
+ Actions: ({ children: e }) => /* @__PURE__ */ p("div", {
28
+ className: _.actions,
29
29
  children: e
30
30
  }),
31
31
  CloseButton: ({ onClick: e }) => {
32
- let { formatMessage: n } = u();
33
- return /* @__PURE__ */ d(s, {
34
- "aria-label": n(t.closeAriaLabel),
35
- icon: m,
32
+ let { formatMessage: t } = f();
33
+ return /* @__PURE__ */ p(l, {
34
+ "aria-label": t(r.closeAriaLabel),
35
+ icon: g,
36
36
  onClick: e,
37
37
  size: "small"
38
38
  });
39
39
  },
40
- FilterMenu: ({ children: n, hasActiveFilters: r = !1 }) => {
41
- let { formatMessage: i } = u(), [s, m] = a(!1);
42
- return /* @__PURE__ */ f(o.Root, {
40
+ FilterMenu: ({ children: i, hasActiveFilters: a = !1 }) => {
41
+ let { formatMessage: o } = f(), [l, g] = s(!1);
42
+ return /* @__PURE__ */ m(c.Root, {
43
43
  modal: !1,
44
- onOpenChange: m,
45
- open: s,
46
- children: [/* @__PURE__ */ d(o.Trigger, { children: /* @__PURE__ */ d(c, {
47
- "aria-label": i(t.filterAriaLabel),
48
- className: h.filterTrigger,
49
- "data-resin-target": e.FILTER_MENU_TRIGGER,
50
- icon: p,
51
- pressed: s || r,
44
+ onOpenChange: g,
45
+ open: l,
46
+ children: [/* @__PURE__ */ p(c.Trigger, { children: /* @__PURE__ */ p(u, {
47
+ "aria-label": o(r.filterAriaLabel),
48
+ className: _.filterTrigger,
49
+ "data-resin-target": n.FILTER_MENU_TRIGGER,
50
+ icon: h,
51
+ pressed: l || a,
52
52
  size: "small"
53
- }) }), /* @__PURE__ */ f(o.Content, {
53
+ }) }), /* @__PURE__ */ m(c.Content, {
54
54
  align: "end",
55
- className: h.filterMenuContent,
56
- children: [/* @__PURE__ */ d(l, {
55
+ className: _.filterMenuContent,
56
+ "data-resin-component": e.HEADER,
57
+ "data-resin-feature": t,
58
+ children: [/* @__PURE__ */ p(d, {
57
59
  as: "p",
58
- className: h.filtersTitle,
60
+ className: _.filtersTitle,
59
61
  color: "textOnLightSecondary",
60
62
  variant: "bodyDefaultBold",
61
- children: i(t.filtersTitle)
62
- }), n]
63
+ children: o(r.filtersTitle)
64
+ }), i]
63
65
  })]
64
66
  });
65
67
  },
66
- MentionMeOption: n,
67
- ShowResolvedOption: r,
68
- TaskButton: i
68
+ MentionMeOption: i,
69
+ ShowResolvedOption: a,
70
+ TaskButton: o
69
71
  });
70
- export { g as t };
72
+ export { v as t };
@@ -1,47 +1,49 @@
1
- import { ACTIVITY_FEED_RESIN_TARGETS as e } from "../esm/lib/resin-targets.js";
2
- import { r as t } from "./types.js";
3
- import { messages as n } from "../esm/lib/components/header/task-button/messages.js";
4
- import { useRef as r, useState as i } from "react";
5
- import { DropdownMenu as a, TriggerButton as o } from "@box/blueprint-web";
6
- import { useIntl as s } from "react-intl";
7
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
- import { ApprovalTask as u } from "@box/blueprint-web-assets/icons/Fill";
9
- import { Tasks as d } from "@box/blueprint-web-assets/icons/MediumFilled";
10
- import '../styles/task-button.css';var f = { content: "_content_wjran_1" }, p = ({ disabled: p = !1, onMenuItemClick: m }) => {
11
- let { formatMessage: h } = s(), [g, _] = i(!1), v = r(!1), y = (e) => {
12
- v.current = !0, m(e), _(!1);
1
+ import { ACTIVITY_FEED_RESIN_COMPONENTS as e, ACTIVITY_FEED_RESIN_FEATURE as t, ACTIVITY_FEED_RESIN_TARGETS as n } from "../esm/lib/resin-targets.js";
2
+ import { r } from "./types.js";
3
+ import { messages as i } from "../esm/lib/components/header/task-button/messages.js";
4
+ import { useRef as a, useState as o } from "react";
5
+ import { DropdownMenu as s, TriggerButton as c } from "@box/blueprint-web";
6
+ import { useIntl as l } from "react-intl";
7
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
+ import { ApprovalTask as f } from "@box/blueprint-web-assets/icons/Fill";
9
+ import { Tasks as p } from "@box/blueprint-web-assets/icons/MediumFilled";
10
+ import '../styles/task-button.css';var m = { content: "_content_wjran_1" }, h = ({ disabled: h = !1, onMenuItemClick: g }) => {
11
+ let { formatMessage: _ } = l(), [v, y] = o(!1), b = a(!1), x = (e) => {
12
+ b.current = !0, g(e), y(!1);
13
13
  };
14
- return /* @__PURE__ */ l(a.Root, {
15
- onOpenChange: _,
16
- open: g,
17
- children: [/* @__PURE__ */ c(a.Trigger, { children: /* @__PURE__ */ c(o, {
18
- caretDirection: g ? "up" : "down",
19
- "data-resin-target": e.TASK_ADD_TRIGGER,
20
- disabled: p,
21
- label: h(n.taskButtonLabel),
14
+ return /* @__PURE__ */ d(s.Root, {
15
+ onOpenChange: y,
16
+ open: v,
17
+ children: [/* @__PURE__ */ u(s.Trigger, { children: /* @__PURE__ */ u(c, {
18
+ caretDirection: v ? "up" : "down",
19
+ "data-resin-target": n.TASK_ADD_TRIGGER,
20
+ disabled: h,
21
+ label: _(i.taskButtonLabel),
22
22
  variant: "secondary"
23
- }) }), /* @__PURE__ */ l(a.Content, {
23
+ }) }), /* @__PURE__ */ d(s.Content, {
24
24
  align: "end",
25
- className: f.content,
25
+ className: m.content,
26
+ "data-resin-component": e.HEADER,
27
+ "data-resin-feature": t,
26
28
  onCloseAutoFocus: (e) => {
27
- v.current &&= (e.preventDefault(), !1);
29
+ b.current &&= (e.preventDefault(), !1);
28
30
  },
29
- children: [/* @__PURE__ */ l(a.Item, {
30
- "data-resin-target": e.TASK_ADD_GENERAL,
31
- onSelect: () => y(t.GENERAL),
32
- children: [/* @__PURE__ */ c(a.Item.StartElement, { icon: d }), /* @__PURE__ */ c(a.Item.MainContent, {
33
- caption: h(n.generalTaskDescription),
34
- label: h(n.generalTaskTitle)
31
+ children: [/* @__PURE__ */ d(s.Item, {
32
+ "data-resin-target": n.TASK_ADD_GENERAL,
33
+ onSelect: () => x(r.GENERAL),
34
+ children: [/* @__PURE__ */ u(s.Item.StartElement, { icon: p }), /* @__PURE__ */ u(s.Item.MainContent, {
35
+ caption: _(i.generalTaskDescription),
36
+ label: _(i.generalTaskTitle)
35
37
  })]
36
- }), /* @__PURE__ */ l(a.Item, {
37
- "data-resin-target": e.TASK_ADD_APPROVAL,
38
- onSelect: () => y(t.APPROVAL),
39
- children: [/* @__PURE__ */ c(a.Item.StartElement, { icon: u }), /* @__PURE__ */ c(a.Item.MainContent, {
40
- caption: h(n.approvalTaskDescription),
41
- label: h(n.approvalTaskTitle)
38
+ }), /* @__PURE__ */ d(s.Item, {
39
+ "data-resin-target": n.TASK_ADD_APPROVAL,
40
+ onSelect: () => x(r.APPROVAL),
41
+ children: [/* @__PURE__ */ u(s.Item.StartElement, { icon: f }), /* @__PURE__ */ u(s.Item.MainContent, {
42
+ caption: _(i.approvalTaskDescription),
43
+ label: _(i.approvalTaskTitle)
42
44
  })]
43
45
  })]
44
46
  })]
45
47
  });
46
48
  };
47
- export { p as t };
49
+ export { h as t };
@@ -1,53 +1,57 @@
1
- import e from "../esm/lib/components/task-item/components/task-message/messages.js";
2
- import { Button as t, Popover as n, Text as r } from "@box/blueprint-web";
3
- import { useIntl as i } from "react-intl";
4
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
- import '../styles/task-delete-confirmation-popover.css';var s = {
1
+ import { ACTIVITY_FEED_RESIN_COMPONENTS as e, ACTIVITY_FEED_RESIN_FEATURE as t, ACTIVITY_FEED_RESIN_TARGETS as n } from "../esm/lib/resin-targets.js";
2
+ import r from "../esm/lib/components/task-item/components/task-message/messages.js";
3
+ import { Button as i, Popover as a, Text as o } from "@box/blueprint-web";
4
+ import { useIntl as s } from "react-intl";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ import '../styles/task-delete-confirmation-popover.css';var u = {
6
7
  deletePopoverAnchorWrapper: "_deletePopoverAnchorWrapper_2wpp6_3",
7
8
  deletePopoverAnchor: "_deletePopoverAnchor_2wpp6_3",
8
9
  deletePopover: "_deletePopover_2wpp6_3",
9
10
  footer: "_footer_2wpp6_25"
10
11
  };
11
- function c({ confirming: c = !1, onCancel: l, onConfirm: u, onOpenChange: d, open: f }) {
12
- let p = i();
13
- return /* @__PURE__ */ a("div", {
14
- className: s.deletePopoverAnchorWrapper,
15
- children: /* @__PURE__ */ o(n.Root, {
12
+ function d({ confirming: d = !1, onCancel: f, onConfirm: p, onOpenChange: m, open: h }) {
13
+ let g = s();
14
+ return /* @__PURE__ */ c("div", {
15
+ className: u.deletePopoverAnchorWrapper,
16
+ children: /* @__PURE__ */ l(a.Root, {
16
17
  modal: !1,
17
- onOpenChange: d,
18
- open: f,
19
- children: [/* @__PURE__ */ a(n.Anchor, { children: /* @__PURE__ */ a(r, {
18
+ onOpenChange: m,
19
+ open: h,
20
+ children: [/* @__PURE__ */ c(a.Anchor, { children: /* @__PURE__ */ c(o, {
20
21
  as: "span",
21
- className: s.deletePopoverAnchor
22
- }) }), /* @__PURE__ */ o(n.ContentContainer, {
22
+ className: u.deletePopoverAnchor
23
+ }) }), /* @__PURE__ */ l(a.ContentContainer, {
23
24
  align: "end",
24
- "aria-label": p.formatMessage(e.deleteTaskConfirmationDialogAriaLabel),
25
- className: s.deletePopover,
25
+ "aria-label": g.formatMessage(r.deleteTaskConfirmationDialogAriaLabel),
26
+ className: u.deletePopover,
27
+ "data-resin-component": e.TASK,
28
+ "data-resin-feature": t,
26
29
  side: "bottom",
27
- children: [/* @__PURE__ */ a(n.MainContent, { children: /* @__PURE__ */ a(r, {
30
+ children: [/* @__PURE__ */ c(a.MainContent, { children: /* @__PURE__ */ c(o, {
28
31
  as: "p",
29
32
  color: "textOnLightDefault",
30
33
  variant: "bodyDefault",
31
- children: p.formatMessage(e.deleteTaskConfirmationBody)
32
- }) }), /* @__PURE__ */ o(n.Footer, {
33
- className: s.footer,
34
- children: [/* @__PURE__ */ a(t, {
35
- disabled: c,
36
- onClick: l,
34
+ children: g.formatMessage(r.deleteTaskConfirmationBody)
35
+ }) }), /* @__PURE__ */ l(a.Footer, {
36
+ className: u.footer,
37
+ children: [/* @__PURE__ */ c(i, {
38
+ disabled: d,
39
+ onClick: f,
37
40
  size: "small",
38
41
  variant: "secondary",
39
- children: p.formatMessage(e.deleteTaskConfirmationCancel)
40
- }), /* @__PURE__ */ a(t, {
41
- loading: c,
42
- loadingAriaLabel: p.formatMessage(e.deleteTaskConfirmationConfirmLoading),
43
- onClick: u,
42
+ children: g.formatMessage(r.deleteTaskConfirmationCancel)
43
+ }), /* @__PURE__ */ c(i, {
44
+ "data-resin-target": n.TASK_DELETE_CONFIRM,
45
+ loading: d,
46
+ loadingAriaLabel: g.formatMessage(r.deleteTaskConfirmationConfirmLoading),
47
+ onClick: p,
44
48
  size: "small",
45
49
  variant: "destructive",
46
- children: p.formatMessage(e.deleteTaskConfirmationConfirm)
50
+ children: g.formatMessage(r.deleteTaskConfirmationConfirm)
47
51
  })]
48
52
  })]
49
53
  })]
50
54
  })
51
55
  });
52
56
  }
53
- export { c as t };
57
+ export { d as t };
@@ -1,75 +1,81 @@
1
- import e from "../esm/lib/components/task-item/messages.js";
2
- import t from "../esm/lib/components/task-item/components/task-message/messages.js";
3
- import { t as n } from "./task-delete-confirmation-popover.js";
4
- import { useEffect as r, useState as i } from "react";
5
- import { DropdownMenu as a, IconButton as o, Text as s } from "@box/blueprint-web";
6
- import { useIntl as c } from "react-intl";
7
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
8
- import { Ellipsis as d, InformationCircle as f, Pencil as p, Trash as m } from "@box/blueprint-web-assets/icons/Medium";
9
- import { bpTextTextDestructiveOnLight as h } from "@box/blueprint-web-assets/tokens/tokens";
10
- import '../styles/task-options-menu.css';var g = { shell: "_shell_zywke_2" };
11
- function _({ canDelete: _ = !0, canEdit: v = !0, disabled: y, onEdit: b, onDelete: x, onView: S, onOpenChange: C }) {
12
- let { formatMessage: w } = c(), [T, E] = i(!1), [D, O] = i(!1), [k, A] = i(!1);
13
- return r(() => {
14
- C?.(T || D);
1
+ import { ACTIVITY_FEED_RESIN_COMPONENTS as e, ACTIVITY_FEED_RESIN_FEATURE as t, ACTIVITY_FEED_RESIN_TARGETS as n } from "../esm/lib/resin-targets.js";
2
+ import r from "../esm/lib/components/task-item/messages.js";
3
+ import i from "../esm/lib/components/task-item/components/task-message/messages.js";
4
+ import { t as a } from "./task-delete-confirmation-popover.js";
5
+ import { useEffect as o, useState as s } from "react";
6
+ import { DropdownMenu as c, IconButton as l, Text as u } from "@box/blueprint-web";
7
+ import { useIntl as d } from "react-intl";
8
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
+ import { Ellipsis as m, InformationCircle as h, Pencil as g, Trash as _ } from "@box/blueprint-web-assets/icons/Medium";
10
+ import { bpTextTextDestructiveOnLight as v } from "@box/blueprint-web-assets/tokens/tokens";
11
+ import '../styles/task-options-menu.css';var y = { shell: "_shell_zywke_2" };
12
+ function b({ canDelete: b = !0, canEdit: x = !0, disabled: S, onEdit: C, onDelete: w, onView: T, onOpenChange: E }) {
13
+ let { formatMessage: D } = d(), [O, k] = s(!1), [A, j] = s(!1), [M, N] = s(!1);
14
+ return o(() => {
15
+ E?.(O || A);
15
16
  }, [
16
- T,
17
- D,
18
- C
19
- ]), /* @__PURE__ */ u("div", {
20
- className: g.shell,
21
- children: [/* @__PURE__ */ u(a.Root, {
22
- onOpenChange: E,
23
- children: [/* @__PURE__ */ l(a.Trigger, { children: /* @__PURE__ */ l(o, {
24
- "aria-label": w(t.moreOptionsAriaLabel),
17
+ O,
18
+ A,
19
+ E
20
+ ]), /* @__PURE__ */ p("div", {
21
+ className: y.shell,
22
+ children: [/* @__PURE__ */ p(c.Root, {
23
+ onOpenChange: k,
24
+ children: [/* @__PURE__ */ f(c.Trigger, { children: /* @__PURE__ */ f(l, {
25
+ "aria-label": D(i.moreOptionsAriaLabel),
25
26
  "data-no-expand": !0,
26
- disabled: y || D,
27
- icon: d,
27
+ disabled: S || A,
28
+ icon: m,
28
29
  size: "small"
29
- }) }), /* @__PURE__ */ u(a.Content, {
30
+ }) }), /* @__PURE__ */ p(c.Content, {
30
31
  align: "end",
32
+ "data-resin-component": e.TASK,
33
+ "data-resin-feature": t,
31
34
  children: [
32
- S && /* @__PURE__ */ u(a.Item, {
33
- onSelect: () => S(),
34
- children: [/* @__PURE__ */ l(a.Item.StartElement, { icon: f }), /* @__PURE__ */ l(a.Item.MainContent, { label: w(e.taskViewDetailsAction) })]
35
+ T && /* @__PURE__ */ p(c.Item, {
36
+ "data-resin-target": n.TASK_VIEW_DETAILS,
37
+ onSelect: () => T(),
38
+ children: [/* @__PURE__ */ f(c.Item.StartElement, { icon: h }), /* @__PURE__ */ f(c.Item.MainContent, { label: D(r.taskViewDetailsAction) })]
35
39
  }),
36
- v && b && /* @__PURE__ */ u(a.Item, {
37
- onSelect: () => b(),
38
- children: [/* @__PURE__ */ l(a.Item.StartElement, { icon: p }), /* @__PURE__ */ l(a.Item.MainContent, { label: w(e.taskEditMenuItem) })]
40
+ x && C && /* @__PURE__ */ p(c.Item, {
41
+ "data-resin-target": n.TASK_EDIT,
42
+ onSelect: () => C(),
43
+ children: [/* @__PURE__ */ f(c.Item.StartElement, { icon: g }), /* @__PURE__ */ f(c.Item.MainContent, { label: D(r.taskEditMenuItem) })]
39
44
  }),
40
- _ && x && /* @__PURE__ */ u(a.Item, {
45
+ b && w && /* @__PURE__ */ p(c.Item, {
46
+ "data-resin-target": n.TASK_DELETE,
41
47
  onSelect: () => {
42
- O(!0);
48
+ j(!0);
43
49
  },
44
- children: [/* @__PURE__ */ l(a.Item.StartElement, { children: /* @__PURE__ */ l(m, { color: h }) }), /* @__PURE__ */ l(a.Item.MainContent, { children: /* @__PURE__ */ l(s, {
50
+ children: [/* @__PURE__ */ f(c.Item.StartElement, { children: /* @__PURE__ */ f(_, { color: v }) }), /* @__PURE__ */ f(c.Item.MainContent, { children: /* @__PURE__ */ f(u, {
45
51
  as: "span",
46
52
  color: "textOnLightError",
47
53
  variant: "bodyDefault",
48
- children: w(e.taskDeleteMenuItem)
54
+ children: D(r.taskDeleteMenuItem)
49
55
  }) })]
50
56
  })
51
57
  ]
52
58
  })]
53
- }), _ && x && /* @__PURE__ */ l(n, {
54
- confirming: k,
59
+ }), b && w && /* @__PURE__ */ f(a, {
60
+ confirming: M,
55
61
  onCancel: () => {
56
- k || O(!1);
62
+ M || j(!1);
57
63
  },
58
64
  onConfirm: async () => {
59
- if (!(!x || k)) {
60
- A(!0);
65
+ if (!(!w || M)) {
66
+ N(!0);
61
67
  try {
62
- await x();
68
+ await w();
63
69
  } catch {} finally {
64
- A(!1), O(!1);
70
+ N(!1), j(!1);
65
71
  }
66
72
  }
67
73
  },
68
74
  onOpenChange: (e) => {
69
- !e && k || O(e);
75
+ !e && M || j(e);
70
76
  },
71
- open: D
77
+ open: A
72
78
  })]
73
79
  });
74
80
  }
75
- export { _ as t };
81
+ export { b as t };
@@ -1,90 +1,92 @@
1
- import { n as e, r as t, t as n } from "../../../../chunks/types.js";
2
- import { t as r } from "../../../../chunks/TaskMessage.js";
3
- import i from "./messages.js";
4
- import { t as a } from "../../../../chunks/TaskState.js";
5
- import { n as o, t as s } from "../../../../chunks/TaskItemFooter.js";
6
- import { taskAuthorToTaskMessageAuthor as ee, taskDescriptionToDocument as c } from "./utils/task-item-helpers.js";
7
- import { useState as l } from "react";
8
- import { Card as u, Text as d } from "@box/blueprint-web";
9
- import { useIntl as f } from "react-intl";
10
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
11
- import { Stamp as h, Tasks as g } from "@box/blueprint-web-assets/icons/Medium";
12
- function _({ assignees: _, author: v, completedAt: y, completionRule: te, createdAt: b, currentUserId: x, description: S, disabled: C = !1, dueDate: w, fileCount: T, getAvatarUrl: E, hasNextPage: D, id: O, managedBy: ne, onApprove: k, onComplete: A, onDelete: j, onEdit: M, onLoadAllAssignee: N, onReject: P, onView: F, permissions: I, status: L, taskType: R }) {
13
- let z = f(), B = L === e.COMPLETED || L === e.APPROVED || L === e.REJECTED, V = x ? _.find((e) => e.id === x) : void 0, H = !!(!B && V && V.permissions?.canUpdate && V.status === e.NOT_STARTED), [U, W] = l(void 0), G = async (e, t) => {
14
- if (!(!t || U)) {
15
- W(e);
1
+ import { ACTIVITY_FEED_RESIN_COMPONENTS as e } from "../../resin-targets.js";
2
+ import { n as t, r as n, t as r } from "../../../../chunks/types.js";
3
+ import { t as i } from "../../../../chunks/TaskMessage.js";
4
+ import a from "./messages.js";
5
+ import { t as o } from "../../../../chunks/TaskState.js";
6
+ import { n as s, t as ee } from "../../../../chunks/TaskItemFooter.js";
7
+ import { taskAuthorToTaskMessageAuthor as c, taskDescriptionToDocument as l } from "./utils/task-item-helpers.js";
8
+ import { useState as u } from "react";
9
+ import { Card as d, Text as f } from "@box/blueprint-web";
10
+ import { useIntl as p } from "react-intl";
11
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ import { Stamp as g, Tasks as _ } from "@box/blueprint-web-assets/icons/Medium";
13
+ function v({ assignees: v, author: y, completedAt: b, completionRule: te, createdAt: x, currentUserId: S, description: C, disabled: w = !1, dueDate: T, fileCount: E, getAvatarUrl: D, hasNextPage: O, id: k, managedBy: ne, onApprove: A, onComplete: j, onDelete: M, onEdit: N, onLoadAllAssignee: P, onReject: F, onView: I, permissions: L, status: R, taskType: z }) {
14
+ let B = p(), V = R === t.COMPLETED || R === t.APPROVED || R === t.REJECTED, H = S ? v.find((e) => e.id === S) : void 0, U = !!(!V && H && H.permissions?.canUpdate && H.status === t.NOT_STARTED), [W, G] = u(void 0), K = async (e, t) => {
15
+ if (!(!t || W)) {
16
+ G(e);
16
17
  try {
17
- await t(O);
18
+ await t(k);
18
19
  } catch {} finally {
19
- W(void 0);
20
+ G(void 0);
20
21
  }
21
22
  }
22
- }, K = () => {
23
- G("complete", A);
24
23
  }, q = () => {
25
- G("approve", k);
24
+ K("complete", j);
26
25
  }, J = () => {
27
- G("reject", P);
28
- }, Y = j ? () => G("delete", j) : void 0, X = (T ?? 1) > 1, Z = (X || (ne?.entries?.length ?? 0) > 0) && !!F, Q = !X && R === t.GENERAL && H && !!A, $ = !X && R === t.APPROVAL && H && !!(k || P), re = c(S), ie = ee(v, E), ae = I ? I.canDelete : !!j, oe = I ? I.canUpdate : !!M, se = Q || $, ce = U !== void 0, le = /* @__PURE__ */ p(a, {
29
- completedAt: y ?? b,
30
- showCount: te === n.ALL_ASSIGNEES && !D,
31
- totalCount: _.length,
32
- variant: L
26
+ K("approve", A);
27
+ }, Y = () => {
28
+ K("reject", F);
29
+ }, X = M ? () => K("delete", M) : void 0, Z = (E ?? 1) > 1, re = (Z || (ne?.entries?.length ?? 0) > 0) && !!I, Q = !Z && z === n.GENERAL && U && !!j, $ = !Z && z === n.APPROVAL && U && !!(A || F), ie = l(C), ae = c(y, D), oe = L ? L.canDelete : !!M, se = L ? L.canUpdate : !!N, ce = Q || $, le = W !== void 0, ue = /* @__PURE__ */ m(o, {
30
+ completedAt: b ?? x,
31
+ showCount: te === r.ALL_ASSIGNEES && !O,
32
+ totalCount: v.length,
33
+ variant: R
33
34
  });
34
- return /* @__PURE__ */ m(u, {
35
- className: o.taskItem,
36
- "data-task-id": O,
35
+ return /* @__PURE__ */ h(d, {
36
+ className: s.taskItem,
37
+ "data-resin-component": e.TASK,
38
+ "data-task-id": k,
37
39
  "data-testid": "task-item",
38
- children: [/* @__PURE__ */ p("div", {
39
- className: o.header,
40
- children: /* @__PURE__ */ m("div", {
41
- className: o.headerTitleRow,
42
- children: [R === t.APPROVAL ? /* @__PURE__ */ p(h, {
40
+ children: [/* @__PURE__ */ m("div", {
41
+ className: s.header,
42
+ children: /* @__PURE__ */ h("div", {
43
+ className: s.headerTitleRow,
44
+ children: [z === n.APPROVAL ? /* @__PURE__ */ m(g, {
43
45
  "aria-hidden": !0,
44
- className: o.headerLeadingIcon,
46
+ className: s.headerLeadingIcon,
45
47
  color: "currentColor"
46
- }) : /* @__PURE__ */ p(g, {
48
+ }) : /* @__PURE__ */ m(_, {
47
49
  "aria-hidden": !0,
48
- className: o.headerLeadingIcon,
50
+ className: s.headerLeadingIcon,
49
51
  color: "currentColor"
50
- }), /* @__PURE__ */ p(d, {
52
+ }), /* @__PURE__ */ m(f, {
51
53
  as: "h4",
52
54
  variant: "bodyDefaultSemibold",
53
- children: z.formatMessage(R === t.APPROVAL ? i.approvalTaskLabel : i.taskLabel)
55
+ children: B.formatMessage(z === n.APPROVAL ? a.approvalTaskLabel : a.taskLabel)
54
56
  })]
55
57
  })
56
- }), /* @__PURE__ */ m("div", {
57
- className: o.cardBody,
58
- children: [/* @__PURE__ */ p(r, {
59
- author: ie,
60
- canDelete: !C && ae,
61
- canEdit: !C && oe,
62
- createdAt: b,
63
- disabled: C || ce,
64
- id: O,
65
- message: re,
66
- onDelete: Y,
67
- onEdit: M,
68
- onView: Z ? F : void 0,
69
- showThreadedIndicator: B,
70
- children: /* @__PURE__ */ p(s, {
71
- assignees: _,
72
- canApprove: !!k,
73
- canReject: !!P,
74
- disabled: C,
75
- dueDate: w,
76
- hasNextPage: D,
77
- onApprove: q,
78
- onComplete: K,
79
- onLoadAllAssignee: N,
80
- onReject: J,
81
- pendingAction: U,
82
- showActionButtons: se,
58
+ }), /* @__PURE__ */ h("div", {
59
+ className: s.cardBody,
60
+ children: [/* @__PURE__ */ m(i, {
61
+ author: ae,
62
+ canDelete: !w && oe,
63
+ canEdit: !w && se,
64
+ createdAt: x,
65
+ disabled: w || le,
66
+ id: k,
67
+ message: ie,
68
+ onDelete: X,
69
+ onEdit: N,
70
+ onView: re ? I : void 0,
71
+ showThreadedIndicator: V,
72
+ children: /* @__PURE__ */ m(ee, {
73
+ assignees: v,
74
+ canApprove: !!A,
75
+ canReject: !!F,
76
+ disabled: w,
77
+ dueDate: T,
78
+ hasNextPage: O,
79
+ onApprove: J,
80
+ onComplete: q,
81
+ onLoadAllAssignee: P,
82
+ onReject: Y,
83
+ pendingAction: W,
84
+ showActionButtons: ce,
83
85
  showApprovalActions: $,
84
86
  showGeneralComplete: Q
85
87
  })
86
- }), le]
88
+ }), ue]
87
89
  })]
88
90
  });
89
91
  }
90
- export { _ as TaskItem, _ as default };
92
+ export { v as TaskItem, v as default };
@@ -1,52 +1,54 @@
1
- import { t as e } from "../../../../chunks/version-item.module.js";
2
- import { messages as t } from "./messages.js";
3
- import { DeleteVersionItem as n } from "./delete-version-item/delete-version-item.js";
4
- import { DividerVersionItem as r } from "./divider-version-item/divider-version-item.js";
5
- import { Text as i } from "@box/blueprint-web";
6
- import { FormattedMessage as a } from "react-intl";
7
- import { jsx as o } from "react/jsx-runtime";
8
- var s = {
9
- promote: t.versionPromoted,
10
- restore: t.versionRestored,
11
- upload: t.versionUploaded
12
- }, c = {
13
- promote: t.appPromoted,
14
- restore: t.appRestored,
15
- upload: t.appUploaded
16
- }, l = ({ actionType: t = "upload", appName: l, authorName: u, avatarUrl: d, createdAt: f, id: p, onVersionClick: m, versionNumber: h }) => {
17
- if (t === "delete") return /* @__PURE__ */ o(n, {
18
- authorName: u,
19
- avatarUrl: d,
20
- createdAt: f,
21
- id: p,
22
- versionNumber: h
1
+ import { ACTIVITY_FEED_RESIN_TARGETS as e } from "../../resin-targets.js";
2
+ import { t } from "../../../../chunks/version-item.module.js";
3
+ import { messages as n } from "./messages.js";
4
+ import { DeleteVersionItem as r } from "./delete-version-item/delete-version-item.js";
5
+ import { DividerVersionItem as i } from "./divider-version-item/divider-version-item.js";
6
+ import { Text as a } from "@box/blueprint-web";
7
+ import { FormattedMessage as o } from "react-intl";
8
+ import { jsx as s } from "react/jsx-runtime";
9
+ var c = {
10
+ promote: n.versionPromoted,
11
+ restore: n.versionRestored,
12
+ upload: n.versionUploaded
13
+ }, l = {
14
+ promote: n.appPromoted,
15
+ restore: n.appRestored,
16
+ upload: n.appUploaded
17
+ }, u = ({ actionType: n = "upload", appName: u, authorName: d, avatarUrl: f, createdAt: p, id: m, onVersionClick: h, versionNumber: g }) => {
18
+ if (n === "delete") return /* @__PURE__ */ s(r, {
19
+ authorName: d,
20
+ avatarUrl: f,
21
+ createdAt: p,
22
+ id: m,
23
+ versionNumber: g
23
24
  });
24
- let g = () => {
25
- m?.({
26
- id: p,
27
- versionNumber: h
25
+ let _ = () => {
26
+ h?.({
27
+ id: m,
28
+ versionNumber: g
28
29
  });
29
- }, _ = l ? c[t] : s[t];
30
- if (!_) return null;
31
- let v = (t) => m ? /* @__PURE__ */ o("button", {
32
- className: e.badgeButton,
33
- onClick: g,
30
+ }, v = u ? l[n] : c[n];
31
+ if (!v) return null;
32
+ let y = (n) => h ? /* @__PURE__ */ s("button", {
33
+ className: t.badgeButton,
34
+ "data-resin-target": e.VERSION_CARD,
35
+ onClick: _,
34
36
  type: "button",
35
- children: t
36
- }) : /* @__PURE__ */ o(i, {
37
+ children: n
38
+ }) : /* @__PURE__ */ s(a, {
37
39
  as: "span",
38
- className: e.badge,
40
+ className: t.badge,
39
41
  color: "textOnLightSecondary",
40
42
  variant: "labelBold",
41
- children: t
43
+ children: n
42
44
  });
43
- return /* @__PURE__ */ o(r, { children: /* @__PURE__ */ o(a, {
44
- ..._,
45
+ return /* @__PURE__ */ s(i, { children: /* @__PURE__ */ s(o, {
46
+ ...v,
45
47
  values: {
46
- appName: l,
47
- badge: v,
48
- versionNumber: h
48
+ appName: u,
49
+ badge: y,
50
+ versionNumber: g
49
51
  }
50
52
  }) });
51
53
  };
52
- export { l as VersionItem };
54
+ export { u as VersionItem };
@@ -1,10 +1,20 @@
1
- var e = {
1
+ var e = "activityfeedv2", t = {
2
+ HEADER: "activityfeedheader",
3
+ TASK: "activityfeedtask"
4
+ }, n = {
2
5
  FILTER_MENTION_ME: "activityfeed-filter-mentionme",
3
6
  FILTER_MENU_TRIGGER: "activityfeed-filter",
4
7
  FILTER_SHOW_RESOLVED: "activityfeed-filter-showresolved",
5
- HEADER: "activityfeedheader",
6
8
  TASK_ADD_APPROVAL: "activityfeed-addtask-approval",
7
9
  TASK_ADD_GENERAL: "activityfeed-addtask-general",
8
- TASK_ADD_TRIGGER: "activityfeed-addtask"
10
+ TASK_ADD_TRIGGER: "activityfeed-addtask",
11
+ TASK_APPROVE: "activityfeed-taskapprove",
12
+ TASK_COMPLETE: "activityfeed-taskcomplete",
13
+ TASK_DELETE: "activityfeed-task-delete",
14
+ TASK_DELETE_CONFIRM: "activityfeed-taskdeleteconfirm",
15
+ TASK_EDIT: "activityfeed-task-edit",
16
+ TASK_REJECT: "activityfeed-taskreject",
17
+ TASK_VIEW_DETAILS: "activityfeed-viewtaskdetails",
18
+ VERSION_CARD: "activityfeed-versioninfo"
9
19
  };
10
- export { e as ACTIVITY_FEED_RESIN_TARGETS };
20
+ export { t as ACTIVITY_FEED_RESIN_COMPONENTS, e as ACTIVITY_FEED_RESIN_FEATURE, n as ACTIVITY_FEED_RESIN_TARGETS };
@@ -1,9 +1,21 @@
1
+ export declare const ACTIVITY_FEED_RESIN_FEATURE = "activityfeedv2";
2
+ export declare const ACTIVITY_FEED_RESIN_COMPONENTS: {
3
+ readonly HEADER: "activityfeedheader";
4
+ readonly TASK: "activityfeedtask";
5
+ };
1
6
  export declare const ACTIVITY_FEED_RESIN_TARGETS: {
2
7
  readonly FILTER_MENTION_ME: "activityfeed-filter-mentionme";
3
8
  readonly FILTER_MENU_TRIGGER: "activityfeed-filter";
4
9
  readonly FILTER_SHOW_RESOLVED: "activityfeed-filter-showresolved";
5
- readonly HEADER: "activityfeedheader";
6
10
  readonly TASK_ADD_APPROVAL: "activityfeed-addtask-approval";
7
11
  readonly TASK_ADD_GENERAL: "activityfeed-addtask-general";
8
12
  readonly TASK_ADD_TRIGGER: "activityfeed-addtask";
13
+ readonly TASK_APPROVE: "activityfeed-taskapprove";
14
+ readonly TASK_COMPLETE: "activityfeed-taskcomplete";
15
+ readonly TASK_DELETE: "activityfeed-task-delete";
16
+ readonly TASK_DELETE_CONFIRM: "activityfeed-taskdeleteconfirm";
17
+ readonly TASK_EDIT: "activityfeed-task-edit";
18
+ readonly TASK_REJECT: "activityfeed-taskreject";
19
+ readonly TASK_VIEW_DETAILS: "activityfeed-viewtaskdetails";
20
+ readonly VERSION_CARD: "activityfeed-versioninfo";
9
21
  };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@box/activity-feed",
3
- "version": "2.1.30",
3
+ "version": "2.2.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@box/blueprint-web": "^16.7.1",
7
7
  "@box/blueprint-web-assets": "^5.4.2",
8
8
  "@box/collaboration-popover": "^2.1.22",
9
9
  "@box/readable-time": "^2.1.22",
10
- "@box/threaded-annotations": "^4.0.1",
10
+ "@box/threaded-annotations": "^4.0.2",
11
11
  "@box/user-selector": "^2.1.23",
12
12
  "clsx": "^1.2.1",
13
13
  "react": "^18.0.0",
@@ -24,7 +24,7 @@
24
24
  "@box/eslint-plugin-blueprint": "2.1.9",
25
25
  "@box/readable-time": "^2.1.22",
26
26
  "@box/storybook-utils": "1.1.21",
27
- "@box/threaded-annotations": "^4.0.1",
27
+ "@box/threaded-annotations": "^4.0.2",
28
28
  "@box/user-selector": "^2.1.23",
29
29
  "react-intl": "^6.4.2"
30
30
  },