@box/activity-feed 1.15.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/LICENSE +379 -0
- package/README.md +57 -0
- package/dist/chunks/AssigneeList.js +125 -0
- package/dist/chunks/TaskDueDate.js +44 -0
- package/dist/chunks/TaskItemFooter.js +77 -0
- package/dist/chunks/TaskMessage.js +86 -0
- package/dist/chunks/TaskState.js +83 -0
- package/dist/chunks/activity-feed-list.js +21 -0
- package/dist/chunks/activity-feed.js +46 -0
- package/dist/chunks/app-activity-item.js +75 -0
- package/dist/chunks/editor.js +14 -0
- package/dist/chunks/empty-state.js +22 -0
- package/dist/chunks/header.js +63 -0
- package/dist/chunks/mock-collaboration-props.js +19379 -0
- package/dist/chunks/scroll.js +6 -0
- package/dist/chunks/task-button.js +44 -0
- package/dist/chunks/task-delete-confirmation-popover.js +50 -0
- package/dist/chunks/task-options-menu.js +58 -0
- package/dist/chunks/types.js +8 -0
- package/dist/chunks/version-item.module.js +10 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/lib/activity-feed.js +6 -0
- package/dist/esm/lib/components/activity-feed-list/activity-feed-list.js +2 -0
- package/dist/esm/lib/components/activity-feed-list/index.js +2 -0
- package/dist/esm/lib/components/app-activity-item/app-activity-item.js +2 -0
- package/dist/esm/lib/components/app-activity-item/index.js +2 -0
- package/dist/esm/lib/components/app-activity-item/messages.js +6 -0
- package/dist/esm/lib/components/editor/editor.js +2 -0
- package/dist/esm/lib/components/editor/index.js +2 -0
- package/dist/esm/lib/components/empty-state/empty-state.js +2 -0
- package/dist/esm/lib/components/empty-state/index.js +2 -0
- package/dist/esm/lib/components/empty-state/messages.js +12 -0
- package/dist/esm/lib/components/header/header-filter-options.js +30 -0
- package/dist/esm/lib/components/header/header.js +2 -0
- package/dist/esm/lib/components/header/messages.js +44 -0
- package/dist/esm/lib/components/header/task-button/index.js +2 -0
- package/dist/esm/lib/components/header/task-button/messages.js +24 -0
- package/dist/esm/lib/components/header/task-button/task-button.js +2 -0
- package/dist/esm/lib/components/task-item/TaskItem.js +81 -0
- package/dist/esm/lib/components/task-item/TaskItemFooter.js +2 -0
- package/dist/esm/lib/components/task-item/components/assignee-list/AssigneeList.js +2 -0
- package/dist/esm/lib/components/task-item/components/assignee-list/index.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-due-date/TaskDueDate.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-due-date/index.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-message/MessageRenderer.js +21 -0
- package/dist/esm/lib/components/task-item/components/task-message/TaskMessage.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-message/index.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-message/messages.js +24 -0
- package/dist/esm/lib/components/task-item/components/task-message/task-delete-confirmation-popover.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-message/task-options-menu.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-state/TaskState.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-state/index.js +2 -0
- package/dist/esm/lib/components/task-item/components/task-state/messages.js +20 -0
- package/dist/esm/lib/components/task-item/index.js +6 -0
- package/dist/esm/lib/components/task-item/messages.js +76 -0
- package/dist/esm/lib/components/task-item/utils/task-item-helpers.js +22 -0
- package/dist/esm/lib/components/user-avatar/getInitials.js +5 -0
- package/dist/esm/lib/components/user-avatar/index.js +2 -0
- package/dist/esm/lib/components/user-avatar/user-avatar.js +22 -0
- package/dist/esm/lib/components/version-item/delete-version-item/delete-version-item.js +41 -0
- package/dist/esm/lib/components/version-item/delete-version-item/index.js +2 -0
- package/dist/esm/lib/components/version-item/divider-version-item/divider-version-item.js +20 -0
- package/dist/esm/lib/components/version-item/divider-version-item/index.js +2 -0
- package/dist/esm/lib/components/version-item/index.js +2 -0
- package/dist/esm/lib/components/version-item/messages.js +36 -0
- package/dist/esm/lib/components/version-item/version-item.js +52 -0
- package/dist/esm/lib/scroll/create-activity-feed-scroll.js +18 -0
- package/dist/esm/lib/scroll/index.js +4 -0
- package/dist/esm/lib/scroll/use-activity-feed-scroll.js +7 -0
- package/dist/esm/lib/test-utils/mocks/index.js +6 -0
- package/dist/esm/lib/test-utils/mocks/mock-collaboration-props.js +2 -0
- package/dist/esm/lib/test-utils/mocks/mock-feed-items.js +187 -0
- package/dist/esm/lib/test-utils/mocks/mock-mention-context.js +7 -0
- package/dist/esm/lib/test-utils/mocks/mock-user-selector-props.js +9 -0
- package/dist/esm/lib/test-utils/mocks/mock-users.js +86 -0
- package/dist/esm/lib/types/ActivityItem.js +0 -0
- package/dist/esm/lib/types/common.js +0 -0
- package/dist/esm/lib/types/index.js +0 -0
- package/dist/i18n/bn-IN.js +55 -0
- package/dist/i18n/bn-IN.properties +106 -0
- package/dist/i18n/da-DK.js +55 -0
- package/dist/i18n/da-DK.properties +106 -0
- package/dist/i18n/de-DE.js +55 -0
- package/dist/i18n/de-DE.properties +106 -0
- package/dist/i18n/en-AU.js +55 -0
- package/dist/i18n/en-AU.properties +106 -0
- package/dist/i18n/en-CA.js +55 -0
- package/dist/i18n/en-CA.properties +106 -0
- package/dist/i18n/en-GB.js +55 -0
- package/dist/i18n/en-GB.properties +106 -0
- package/dist/i18n/en-US.js +55 -0
- package/dist/i18n/en-US.properties +106 -0
- package/dist/i18n/en-x-pseudo.js +55 -0
- package/dist/i18n/en-x-pseudo.properties +106 -0
- package/dist/i18n/es-419.js +55 -0
- package/dist/i18n/es-419.properties +106 -0
- package/dist/i18n/es-ES.js +55 -0
- package/dist/i18n/es-ES.properties +106 -0
- package/dist/i18n/fi-FI.js +55 -0
- package/dist/i18n/fi-FI.properties +106 -0
- package/dist/i18n/fr-CA.js +55 -0
- package/dist/i18n/fr-CA.properties +106 -0
- package/dist/i18n/fr-FR.js +55 -0
- package/dist/i18n/fr-FR.properties +106 -0
- package/dist/i18n/hi-IN.js +55 -0
- package/dist/i18n/hi-IN.properties +106 -0
- package/dist/i18n/it-IT.js +55 -0
- package/dist/i18n/it-IT.properties +106 -0
- package/dist/i18n/ja-JP.js +55 -0
- package/dist/i18n/ja-JP.properties +106 -0
- package/dist/i18n/json/src/lib/components/app-activity-item/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/empty-state/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/header/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/header/task-button/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/task-item/components/task-message/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/task-item/components/task-state/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/task-item/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/version-item/messages.json +1 -0
- package/dist/i18n/ko-KR.js +55 -0
- package/dist/i18n/ko-KR.properties +106 -0
- package/dist/i18n/nb-NO.js +55 -0
- package/dist/i18n/nb-NO.properties +106 -0
- package/dist/i18n/nl-NL.js +55 -0
- package/dist/i18n/nl-NL.properties +106 -0
- package/dist/i18n/pl-PL.js +55 -0
- package/dist/i18n/pl-PL.properties +106 -0
- package/dist/i18n/pt-BR.js +55 -0
- package/dist/i18n/pt-BR.properties +106 -0
- package/dist/i18n/ru-RU.js +55 -0
- package/dist/i18n/ru-RU.properties +106 -0
- package/dist/i18n/sv-SE.js +55 -0
- package/dist/i18n/sv-SE.properties +106 -0
- package/dist/i18n/tr-TR.js +55 -0
- package/dist/i18n/tr-TR.properties +106 -0
- package/dist/i18n/zh-CN.js +55 -0
- package/dist/i18n/zh-CN.properties +106 -0
- package/dist/i18n/zh-TW.js +55 -0
- package/dist/i18n/zh-TW.properties +106 -0
- package/dist/styles/AssigneeList.css +1 -0
- package/dist/styles/TaskDueDate.css +1 -0
- package/dist/styles/TaskItemFooter.css +1 -0
- package/dist/styles/TaskMessage.css +1 -0
- package/dist/styles/TaskState.css +1 -0
- package/dist/styles/activity-feed-list.css +1 -0
- package/dist/styles/activity-feed.css +1 -0
- package/dist/styles/app-activity-item.css +1 -0
- package/dist/styles/editor.css +1 -0
- package/dist/styles/empty-state.css +1 -0
- package/dist/styles/header.css +1 -0
- package/dist/styles/task-button.css +1 -0
- package/dist/styles/task-delete-confirmation-popover.css +1 -0
- package/dist/styles/task-options-menu.css +1 -0
- package/dist/styles/version-item.css +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/lib/activity-feed.d.ts +62 -0
- package/dist/types/lib/components/activity-feed-list/activity-feed-list.d.ts +7 -0
- package/dist/types/lib/components/activity-feed-list/index.d.ts +1 -0
- package/dist/types/lib/components/app-activity-item/app-activity-item.d.ts +13 -0
- package/dist/types/lib/components/app-activity-item/index.d.ts +1 -0
- package/dist/types/lib/components/app-activity-item/messages.d.ts +7 -0
- package/dist/types/lib/components/editor/editor.d.ts +3 -0
- package/dist/types/lib/components/editor/index.d.ts +1 -0
- package/dist/types/lib/components/empty-state/empty-state.d.ts +1 -0
- package/dist/types/lib/components/empty-state/index.d.ts +1 -0
- package/dist/types/lib/components/empty-state/messages.d.ts +12 -0
- package/dist/types/lib/components/header/header-filter-options.d.ts +16 -0
- package/dist/types/lib/components/header/header.d.ts +49 -0
- package/dist/types/lib/components/header/messages.d.ts +52 -0
- package/dist/types/lib/components/header/stories/shared.d.ts +13 -0
- package/dist/types/lib/components/header/task-button/index.d.ts +1 -0
- package/dist/types/lib/components/header/task-button/messages.d.ts +27 -0
- package/dist/types/lib/components/header/task-button/task-button.d.ts +8 -0
- package/dist/types/lib/components/task-item/TaskItem.d.ts +3 -0
- package/dist/types/lib/components/task-item/TaskItemFooter.d.ts +19 -0
- package/dist/types/lib/components/task-item/components/assignee-list/AssigneeList.d.ts +11 -0
- package/dist/types/lib/components/task-item/components/assignee-list/index.d.ts +1 -0
- package/dist/types/lib/components/task-item/components/task-due-date/TaskDueDate.d.ts +5 -0
- package/dist/types/lib/components/task-item/components/task-due-date/index.d.ts +1 -0
- package/dist/types/lib/components/task-item/components/task-message/MessageRenderer.d.ts +6 -0
- package/dist/types/lib/components/task-item/components/task-message/TaskMessage.d.ts +16 -0
- package/dist/types/lib/components/task-item/components/task-message/index.d.ts +3 -0
- package/dist/types/lib/components/task-item/components/task-message/messages.d.ts +28 -0
- package/dist/types/lib/components/task-item/components/task-message/task-delete-confirmation-popover.d.ts +11 -0
- package/dist/types/lib/components/task-item/components/task-message/task-options-menu.d.ts +13 -0
- package/dist/types/lib/components/task-item/components/task-message/types.d.ts +19 -0
- package/dist/types/lib/components/task-item/components/task-state/TaskState.d.ts +28 -0
- package/dist/types/lib/components/task-item/components/task-state/index.d.ts +2 -0
- package/dist/types/lib/components/task-item/components/task-state/messages.d.ts +23 -0
- package/dist/types/lib/components/task-item/index.d.ts +12 -0
- package/dist/types/lib/components/task-item/messages.d.ts +93 -0
- package/dist/types/lib/components/task-item/types.d.ts +106 -0
- package/dist/types/lib/components/task-item/utils/task-item-helpers.d.ts +4 -0
- package/dist/types/lib/components/user-avatar/getInitials.d.ts +1 -0
- package/dist/types/lib/components/user-avatar/index.d.ts +1 -0
- package/dist/types/lib/components/user-avatar/user-avatar.d.ts +11 -0
- package/dist/types/lib/components/version-item/delete-version-item/delete-version-item.d.ts +8 -0
- package/dist/types/lib/components/version-item/delete-version-item/index.d.ts +1 -0
- package/dist/types/lib/components/version-item/divider-version-item/divider-version-item.d.ts +5 -0
- package/dist/types/lib/components/version-item/divider-version-item/index.d.ts +1 -0
- package/dist/types/lib/components/version-item/index.d.ts +1 -0
- package/dist/types/lib/components/version-item/messages.d.ts +42 -0
- package/dist/types/lib/components/version-item/version-item.d.ts +23 -0
- package/dist/types/lib/scroll/create-activity-feed-scroll.d.ts +2 -0
- package/dist/types/lib/scroll/index.d.ts +4 -0
- package/dist/types/lib/scroll/types.d.ts +10 -0
- package/dist/types/lib/scroll/use-activity-feed-scroll.d.ts +6 -0
- package/dist/types/lib/stories/map-activity-item.d.ts +18 -0
- package/dist/types/lib/stories/shared.d.ts +15 -0
- package/dist/types/lib/test-utils/button-utils.d.ts +14 -0
- package/dist/types/lib/test-utils/index.d.ts +1 -0
- package/dist/types/lib/test-utils/mocks/index.d.ts +5 -0
- package/dist/types/lib/test-utils/mocks/mock-collaboration-props.d.ts +9 -0
- package/dist/types/lib/test-utils/mocks/mock-feed-items.d.ts +20 -0
- package/dist/types/lib/test-utils/mocks/mock-mention-context.d.ts +2 -0
- package/dist/types/lib/test-utils/mocks/mock-user-selector-props.d.ts +2 -0
- package/dist/types/lib/test-utils/mocks/mock-users.d.ts +55 -0
- package/dist/types/lib/test-utils/text-utils.d.ts +3 -0
- package/dist/types/lib/types/ActivityItem.d.ts +145 -0
- package/dist/types/lib/types/common.d.ts +82 -0
- package/dist/types/lib/types/index.d.ts +3 -0
- package/package.json +56 -0
|
@@ -0,0 +1,77 @@
|
|
|
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 = {
|
|
9
|
+
taskItem: "_taskItem_1bak0_1",
|
|
10
|
+
header: "_header_1bak0_11",
|
|
11
|
+
headerTitleRow: "_headerTitleRow_1bak0_19",
|
|
12
|
+
headerLeadingIcon: "_headerLeadingIcon_1bak0_25",
|
|
13
|
+
cardBody: "_cardBody_1bak0_32",
|
|
14
|
+
textMessageFooterSlot: "_textMessageFooterSlot_1bak0_39",
|
|
15
|
+
marginBottom: "_marginBottom_1bak0_47",
|
|
16
|
+
approvalActionsRow: "_approvalActionsRow_1bak0_51",
|
|
17
|
+
approvalApproveIcon: "_approvalApproveIcon_1bak0_58",
|
|
18
|
+
approvalRejectIcon: "_approvalRejectIcon_1bak0_62"
|
|
19
|
+
};
|
|
20
|
+
function u({ assignees: u, canApprove: d, canReject: f, disabled: p = !1, dueDate: m, hasNextPage: h, onApprove: g, onComplete: _, onLoadAllAssignee: v, onReject: y, onView: b, showActionButtons: x, showApprovalActions: S, showGeneralComplete: C, showViewDetails: w }) {
|
|
21
|
+
let T = i();
|
|
22
|
+
return /* @__PURE__ */ o("div", {
|
|
23
|
+
className: x ? l.textMessageFooterSlot : `${l.textMessageFooterSlot} ${l.marginBottom}`,
|
|
24
|
+
children: [
|
|
25
|
+
m && /* @__PURE__ */ a(n, { dueDate: m }),
|
|
26
|
+
/* @__PURE__ */ a(t, {
|
|
27
|
+
assignees: u,
|
|
28
|
+
disabled: p,
|
|
29
|
+
hasNextPage: h,
|
|
30
|
+
onLoadAllAssignee: v
|
|
31
|
+
}),
|
|
32
|
+
x && /* @__PURE__ */ o("div", { children: [
|
|
33
|
+
w && /* @__PURE__ */ a(r, {
|
|
34
|
+
disabled: p,
|
|
35
|
+
onClick: b,
|
|
36
|
+
size: "small",
|
|
37
|
+
variant: "primary",
|
|
38
|
+
children: T.formatMessage(e.taskViewDetailsAction)
|
|
39
|
+
}),
|
|
40
|
+
C && /* @__PURE__ */ a(r, {
|
|
41
|
+
disabled: p,
|
|
42
|
+
onClick: _,
|
|
43
|
+
size: "small",
|
|
44
|
+
variant: "primary",
|
|
45
|
+
children: T.formatMessage(e.taskCompleteAction)
|
|
46
|
+
}),
|
|
47
|
+
S && /* @__PURE__ */ o("div", {
|
|
48
|
+
className: l.approvalActionsRow,
|
|
49
|
+
children: [/* @__PURE__ */ a(r, {
|
|
50
|
+
disabled: p || !d,
|
|
51
|
+
onClick: g,
|
|
52
|
+
size: "small",
|
|
53
|
+
startIcon: () => /* @__PURE__ */ a(s, {
|
|
54
|
+
className: l.approvalApproveIcon,
|
|
55
|
+
color: "currentColor"
|
|
56
|
+
}),
|
|
57
|
+
type: "button",
|
|
58
|
+
variant: "secondary",
|
|
59
|
+
children: T.formatMessage(e.taskApproveAction)
|
|
60
|
+
}), /* @__PURE__ */ a(r, {
|
|
61
|
+
disabled: p || !f,
|
|
62
|
+
onClick: y,
|
|
63
|
+
size: "small",
|
|
64
|
+
startIcon: () => /* @__PURE__ */ a(c, {
|
|
65
|
+
className: l.approvalRejectIcon,
|
|
66
|
+
color: "currentColor"
|
|
67
|
+
}),
|
|
68
|
+
type: "button",
|
|
69
|
+
variant: "secondary",
|
|
70
|
+
children: T.formatMessage(e.taskRejectAction)
|
|
71
|
+
})]
|
|
72
|
+
})
|
|
73
|
+
] })
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
export { l as n, u as t };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { MessageRenderer as e } from "../esm/lib/components/task-item/components/task-message/MessageRenderer.js";
|
|
2
|
+
import { t } from "./task-options-menu.js";
|
|
3
|
+
import { useState as n } from "react";
|
|
4
|
+
import { Avatar as r, Text as i } from "@box/blueprint-web";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { ReadableTime as s } from "@box/readable-time";
|
|
7
|
+
import c from "clsx";
|
|
8
|
+
import '../styles/TaskMessage.css';var l = {
|
|
9
|
+
taskMessage: "_taskMessage_9yucp_1",
|
|
10
|
+
headerContainer: "_headerContainer_9yucp_11",
|
|
11
|
+
information: "_information_9yucp_19",
|
|
12
|
+
avatar: "_avatar_9yucp_26",
|
|
13
|
+
textContainer: "_textContainer_9yucp_29",
|
|
14
|
+
author: "_author_9yucp_37",
|
|
15
|
+
optionsMenu: "_optionsMenu_9yucp_45",
|
|
16
|
+
contentWrapper: "_contentWrapper_9yucp_65",
|
|
17
|
+
threadedIndicator: "_threadedIndicator_9yucp_69",
|
|
18
|
+
threadedIndicatorHidden: "_threadedIndicatorHidden_9yucp_85",
|
|
19
|
+
messageContent: "_messageContent_9yucp_88",
|
|
20
|
+
messageFooter: "_messageFooter_9yucp_95"
|
|
21
|
+
}, u = {
|
|
22
|
+
as: "span",
|
|
23
|
+
variant: "bodySmall",
|
|
24
|
+
color: "textOnLightSecondary"
|
|
25
|
+
};
|
|
26
|
+
function d(e) {
|
|
27
|
+
let t = e.trim().split(/\s+/);
|
|
28
|
+
return t.length === 1 ? t[0].charAt(0).toUpperCase() : (t[0].charAt(0) + t[t.length - 1].charAt(0)).toUpperCase();
|
|
29
|
+
}
|
|
30
|
+
function f({ id: f, author: p, message: m, createdAt: h, canEdit: g = !1, canDelete: _ = !1, onEdit: v, onDelete: y, showThreadedIndicator: b = !1, children: x }) {
|
|
31
|
+
let [S, C] = n(!1), w = g && !!v || _ && !!y, T = d(p.name);
|
|
32
|
+
return /* @__PURE__ */ o("div", {
|
|
33
|
+
className: l.taskMessage,
|
|
34
|
+
"data-message-wrapper": !0,
|
|
35
|
+
children: [/* @__PURE__ */ o("div", {
|
|
36
|
+
className: l.headerContainer,
|
|
37
|
+
children: [/* @__PURE__ */ o("div", {
|
|
38
|
+
className: l.information,
|
|
39
|
+
children: [/* @__PURE__ */ a(r, {
|
|
40
|
+
alt: p.name,
|
|
41
|
+
className: l.avatar,
|
|
42
|
+
colorIndex: parseInt(p.id, 10) || 0,
|
|
43
|
+
size: "medium",
|
|
44
|
+
src: p.avatarUrl || "",
|
|
45
|
+
text: T
|
|
46
|
+
}), /* @__PURE__ */ a("div", {
|
|
47
|
+
className: l.textContainer,
|
|
48
|
+
children: /* @__PURE__ */ a(i, {
|
|
49
|
+
as: "p",
|
|
50
|
+
className: l.author,
|
|
51
|
+
color: "textOnLightDefault",
|
|
52
|
+
variant: "bodyDefaultBold",
|
|
53
|
+
children: p.name
|
|
54
|
+
})
|
|
55
|
+
})]
|
|
56
|
+
}), w && /* @__PURE__ */ a("div", {
|
|
57
|
+
className: l.optionsMenu,
|
|
58
|
+
"data-state": S ? "open" : "closed",
|
|
59
|
+
children: /* @__PURE__ */ a(t, {
|
|
60
|
+
canDelete: _,
|
|
61
|
+
canEdit: g,
|
|
62
|
+
onDelete: y ? () => y(f) : void 0,
|
|
63
|
+
onEdit: v ? () => v(f) : void 0,
|
|
64
|
+
onOpenChange: C
|
|
65
|
+
})
|
|
66
|
+
})]
|
|
67
|
+
}), /* @__PURE__ */ o("div", {
|
|
68
|
+
className: l.contentWrapper,
|
|
69
|
+
children: [/* @__PURE__ */ a("div", { className: c(l.threadedIndicator, !b && l.threadedIndicatorHidden) }), /* @__PURE__ */ o("div", {
|
|
70
|
+
className: l.messageContent,
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ a(e, { messageObject: m }),
|
|
73
|
+
/* @__PURE__ */ a("div", {
|
|
74
|
+
className: l.messageFooter,
|
|
75
|
+
children: /* @__PURE__ */ a(s, {
|
|
76
|
+
textProps: u,
|
|
77
|
+
timestamp: h
|
|
78
|
+
})
|
|
79
|
+
}),
|
|
80
|
+
x
|
|
81
|
+
]
|
|
82
|
+
})]
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
export { f as t };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { n as e } from "./types.js";
|
|
2
|
+
import t from "../esm/lib/components/task-item/components/task-state/messages.js";
|
|
3
|
+
import { Text as n } from "@box/blueprint-web";
|
|
4
|
+
import { useIntl as r } from "react-intl";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { ReadableTime as s } from "@box/readable-time";
|
|
7
|
+
import { CheckmarkCircle as c, XMarkCircle as l } from "@box/blueprint-web-assets/icons/MediumFilled";
|
|
8
|
+
import { bpGreenLight125 as u, bpWatermelonRed125 as d } from "@box/blueprint-web-assets/tokens/tokens";
|
|
9
|
+
import '../styles/TaskState.css';var f = {
|
|
10
|
+
taskState: "_taskState_1qxrh_1",
|
|
11
|
+
leftContainer: "_leftContainer_1qxrh_8",
|
|
12
|
+
rightContainer: "_rightContainer_1qxrh_16",
|
|
13
|
+
statusLine: "_statusLine_1qxrh_22",
|
|
14
|
+
countText: "_countText_1qxrh_30"
|
|
15
|
+
}, p = {
|
|
16
|
+
as: "span",
|
|
17
|
+
variant: "bodySmall",
|
|
18
|
+
color: "textOnLightSecondary"
|
|
19
|
+
}, m = {
|
|
20
|
+
[e.REJECTED]: /* @__PURE__ */ a(l, {
|
|
21
|
+
color: d,
|
|
22
|
+
height: 24,
|
|
23
|
+
width: 24
|
|
24
|
+
}),
|
|
25
|
+
[e.COMPLETED]: /* @__PURE__ */ a(c, {
|
|
26
|
+
color: u,
|
|
27
|
+
height: 24,
|
|
28
|
+
width: 24
|
|
29
|
+
}),
|
|
30
|
+
[e.APPROVED]: /* @__PURE__ */ a(c, {
|
|
31
|
+
color: u,
|
|
32
|
+
height: 24,
|
|
33
|
+
width: 24
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
function h({ completedAt: c, showCount: l = !0, totalCount: u, variant: d }) {
|
|
37
|
+
let h = r();
|
|
38
|
+
if (d !== e.COMPLETED && d !== e.APPROVED && d !== e.REJECTED) return null;
|
|
39
|
+
let g = m[d], _ = l && u > 0 && d !== e.REJECTED, v;
|
|
40
|
+
switch (d) {
|
|
41
|
+
case e.APPROVED:
|
|
42
|
+
v = t.approvedHeadline;
|
|
43
|
+
break;
|
|
44
|
+
case e.COMPLETED:
|
|
45
|
+
v = t.completedHeadline;
|
|
46
|
+
break;
|
|
47
|
+
case e.REJECTED:
|
|
48
|
+
v = t.rejectedHeadline;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
let y = /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(n, {
|
|
52
|
+
as: "span",
|
|
53
|
+
color: "textOnLightDefault",
|
|
54
|
+
variant: "bodyDefaultBold",
|
|
55
|
+
children: h.formatMessage(v)
|
|
56
|
+
}), _ && /* @__PURE__ */ a(n, {
|
|
57
|
+
as: "span",
|
|
58
|
+
className: f.countText,
|
|
59
|
+
color: "textOnLightSecondary",
|
|
60
|
+
variant: "bodyDefault",
|
|
61
|
+
children: h.formatMessage(t.completedCountParenthetical, {
|
|
62
|
+
completedCount: u,
|
|
63
|
+
totalCount: u
|
|
64
|
+
})
|
|
65
|
+
})] });
|
|
66
|
+
return /* @__PURE__ */ o("div", {
|
|
67
|
+
className: f.taskState,
|
|
68
|
+
children: [/* @__PURE__ */ a("div", {
|
|
69
|
+
className: f.leftContainer,
|
|
70
|
+
children: g
|
|
71
|
+
}), /* @__PURE__ */ o("div", {
|
|
72
|
+
className: f.rightContainer,
|
|
73
|
+
children: [/* @__PURE__ */ a("div", {
|
|
74
|
+
className: f.statusLine,
|
|
75
|
+
children: y
|
|
76
|
+
}), /* @__PURE__ */ a(s, {
|
|
77
|
+
textProps: p,
|
|
78
|
+
timestamp: c
|
|
79
|
+
})]
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export { h as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { t as e } from "./empty-state.js";
|
|
2
|
+
import { Children as t, isValidElement as n } from "react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import '../styles/activity-feed-list.css';var i = {
|
|
5
|
+
emptyStateWrapper: "_emptyStateWrapper_net25_1",
|
|
6
|
+
list: "_list_net25_8"
|
|
7
|
+
}, a = ({ children: a }) => t.toArray(a).length === 0 ? /* @__PURE__ */ r("div", {
|
|
8
|
+
className: i.emptyStateWrapper,
|
|
9
|
+
children: /* @__PURE__ */ r(e, {})
|
|
10
|
+
}) : /* @__PURE__ */ r("ul", {
|
|
11
|
+
className: i.list,
|
|
12
|
+
children: t.map(a, (e, t) => {
|
|
13
|
+
if (!/* @__PURE__ */ n(e)) return /* @__PURE__ */ r("li", { children: e }, `activity-feed-row-${t}`);
|
|
14
|
+
let i = e.key == null ? void 0 : String(e.key), a = i ?? `activity-feed-row-${t}`;
|
|
15
|
+
return /* @__PURE__ */ r("li", {
|
|
16
|
+
"data-activity-id": i,
|
|
17
|
+
children: e
|
|
18
|
+
}, a);
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
export { a as t };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { t as e } from "./activity-feed-list.js";
|
|
2
|
+
import { t } from "./app-activity-item.js";
|
|
3
|
+
import { t as n } from "./editor.js";
|
|
4
|
+
import { t as r } from "./header.js";
|
|
5
|
+
import { TaskItem as i } from "../esm/lib/components/task-item/TaskItem.js";
|
|
6
|
+
import { VersionItem as a } from "../esm/lib/components/version-item/version-item.js";
|
|
7
|
+
import { createActivityFeedScroll as o } from "../esm/lib/scroll/create-activity-feed-scroll.js";
|
|
8
|
+
import { t as s } from "./scroll.js";
|
|
9
|
+
import { useActivityFeedScroll as c } from "../esm/lib/scroll/use-activity-feed-scroll.js";
|
|
10
|
+
import { useCallback as l, useLayoutEffect as u, useRef as d } from "react";
|
|
11
|
+
import { MentionContextProvider as f, ThreadedAnnotationsV2 as p } from "@box/threaded-annotations";
|
|
12
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
13
|
+
import '../styles/activity-feed.css';var h = { container: "_container_9nbtr_1" }, g = ({ children: e, scrollTo: t, mentionContext: n }) => {
|
|
14
|
+
let r = d(null);
|
|
15
|
+
r.current ||= o();
|
|
16
|
+
let i = r.current, a = t != null && s(t) ? t : i;
|
|
17
|
+
typeof process < "u" && process.env.NODE_ENV !== "production" && t != null && !s(t) && console.warn("ActivityFeed.Root: `scrollTo` must be the return value of `useActivityFeedScroll()`. Using an internal handle for container attachment instead.");
|
|
18
|
+
let c = d(a);
|
|
19
|
+
c.current = a;
|
|
20
|
+
let p = d(null), g = l((e) => {
|
|
21
|
+
p.current = e, c.current.attachContainer(e);
|
|
22
|
+
}, []);
|
|
23
|
+
return u(() => {
|
|
24
|
+
c.current.attachContainer(p.current);
|
|
25
|
+
}, [a]), /* @__PURE__ */ m(f, {
|
|
26
|
+
value: n,
|
|
27
|
+
children: /* @__PURE__ */ m("div", {
|
|
28
|
+
className: h.container,
|
|
29
|
+
ref: g,
|
|
30
|
+
children: e
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
function _(t) {
|
|
35
|
+
return /* @__PURE__ */ m(e, { ...t });
|
|
36
|
+
}
|
|
37
|
+
var v = _;
|
|
38
|
+
v.AppActivity = t, v.Task = i, v.ThreadedAnnotation = p, v.Version = a;
|
|
39
|
+
var y = {
|
|
40
|
+
Editor: n,
|
|
41
|
+
Header: r,
|
|
42
|
+
List: v,
|
|
43
|
+
Root: g,
|
|
44
|
+
useActivityFeedScroll: c
|
|
45
|
+
};
|
|
46
|
+
export { y as t };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { messages as e } from "../esm/lib/components/app-activity-item/messages.js";
|
|
2
|
+
import { createElement as t, useMemo as n } from "react";
|
|
3
|
+
import { Avatar as r, Link as i, Text as a } from "@box/blueprint-web";
|
|
4
|
+
import { useIntl as o } from "react-intl";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import { ReadableTime as l } from "@box/readable-time";
|
|
7
|
+
import '../styles/app-activity-item.css';var u = {
|
|
8
|
+
appActivityItem: "_appActivityItem_1g9je_1",
|
|
9
|
+
message: "_message_1g9je_8",
|
|
10
|
+
activityLink: "_activityLink_1g9je_12"
|
|
11
|
+
}, d = (e) => {
|
|
12
|
+
try {
|
|
13
|
+
let n = new DOMParser().parseFromString(e, "text/html");
|
|
14
|
+
return Array.from(n.body.childNodes).map((e, n) => {
|
|
15
|
+
if (e.nodeType === Node.ELEMENT_NODE) {
|
|
16
|
+
let r = e;
|
|
17
|
+
if (r.nodeName === "A") {
|
|
18
|
+
let e = r;
|
|
19
|
+
return /* @__PURE__ */ t(i, {
|
|
20
|
+
...Object.fromEntries([...e.attributes].filter((e) => e.name.startsWith("data-")).map((e) => [e.name, e.value])),
|
|
21
|
+
className: u.activityLink,
|
|
22
|
+
href: e.href,
|
|
23
|
+
key: n,
|
|
24
|
+
rel: "noreferrer noopener",
|
|
25
|
+
target: "_blank"
|
|
26
|
+
}, e.textContent);
|
|
27
|
+
}
|
|
28
|
+
return /* @__PURE__ */ t(r.tagName.toLowerCase(), { key: n }, r.textContent);
|
|
29
|
+
}
|
|
30
|
+
return e.textContent;
|
|
31
|
+
});
|
|
32
|
+
} catch {
|
|
33
|
+
return [e];
|
|
34
|
+
}
|
|
35
|
+
}, f = ({ appIconUrl: t, appName: i, createdAt: f, id: p, renderedText: m }) => {
|
|
36
|
+
let { formatMessage: h } = o(), g = parseInt(p, 10), _ = Number.isNaN(g) ? 0 : g % 10, v = n(() => d(m), [m]);
|
|
37
|
+
return /* @__PURE__ */ c("div", {
|
|
38
|
+
className: u.appActivityItem,
|
|
39
|
+
children: [/* @__PURE__ */ s(r, {
|
|
40
|
+
alt: i,
|
|
41
|
+
colorIndex: _,
|
|
42
|
+
size: "small",
|
|
43
|
+
src: t,
|
|
44
|
+
text: i.charAt(0)
|
|
45
|
+
}), /* @__PURE__ */ s(a, {
|
|
46
|
+
as: "span",
|
|
47
|
+
className: u.message,
|
|
48
|
+
color: "textOnLightSecondary",
|
|
49
|
+
variant: "bodyDefault",
|
|
50
|
+
children: h(e.activityItemText, {
|
|
51
|
+
appName: /* @__PURE__ */ s(a, {
|
|
52
|
+
as: "span",
|
|
53
|
+
color: "textOnLightSecondary",
|
|
54
|
+
variant: "bodyDefaultSemibold",
|
|
55
|
+
children: i
|
|
56
|
+
}),
|
|
57
|
+
parsedContent: /* @__PURE__ */ s(a, {
|
|
58
|
+
as: "span",
|
|
59
|
+
color: "textOnLightSecondary",
|
|
60
|
+
variant: "bodyDefault",
|
|
61
|
+
children: v
|
|
62
|
+
}),
|
|
63
|
+
timestamp: /* @__PURE__ */ s(l, {
|
|
64
|
+
textProps: {
|
|
65
|
+
as: "span",
|
|
66
|
+
color: "textOnLightSecondary",
|
|
67
|
+
variant: "bodyDefault"
|
|
68
|
+
},
|
|
69
|
+
timestamp: f
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
export { f as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MessageEditorV2 as e } from "@box/threaded-annotations";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import '../styles/editor.css';var n = { editorWrapper: "_editorWrapper_1ycxr_1" }, r = ({ disableComponent: r, onPost: i, onPostError: a, onPostSuccess: o, userSelectorProps: s }) => /* @__PURE__ */ t("div", {
|
|
4
|
+
className: n.editorWrapper,
|
|
5
|
+
children: /* @__PURE__ */ t(e, {
|
|
6
|
+
disableComponent: r,
|
|
7
|
+
isFirstAnnotation: !1,
|
|
8
|
+
onPost: i,
|
|
9
|
+
onPostError: a,
|
|
10
|
+
onPostSuccess: o,
|
|
11
|
+
userSelectorProps: s
|
|
12
|
+
})
|
|
13
|
+
});
|
|
14
|
+
export { r as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { messages as e } from "../esm/lib/components/empty-state/messages.js";
|
|
2
|
+
import { Text as t } from "@box/blueprint-web";
|
|
3
|
+
import { useIntl as n } from "react-intl";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
import '../styles/empty-state.css';var a = { container: "_container_ffym1_1" }, o = () => {
|
|
6
|
+
let { formatMessage: o } = n();
|
|
7
|
+
return /* @__PURE__ */ i("div", {
|
|
8
|
+
className: a.container,
|
|
9
|
+
children: [/* @__PURE__ */ r(t, {
|
|
10
|
+
as: "p",
|
|
11
|
+
color: "textOnLightSecondary",
|
|
12
|
+
variant: "titleSmall",
|
|
13
|
+
children: o(e.title)
|
|
14
|
+
}), /* @__PURE__ */ r(t, {
|
|
15
|
+
as: "p",
|
|
16
|
+
color: "textOnLightSecondary",
|
|
17
|
+
variant: "bodyDefault",
|
|
18
|
+
children: o(e.body)
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export { o as t };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { messages as e } from "../esm/lib/components/header/messages.js";
|
|
2
|
+
import { HeaderMentionMeOption as t, HeaderShowResolvedOption as n } from "../esm/lib/components/header/header-filter-options.js";
|
|
3
|
+
import { t as r } from "./task-button.js";
|
|
4
|
+
import { useState as i } from "react";
|
|
5
|
+
import { DropdownMenu as a, IconButton as o, IconToggleButton as s, Text 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 { Funnel as f, XMark as p } from "@box/blueprint-web-assets/icons/Medium";
|
|
9
|
+
import '../styles/header.css';var m = {
|
|
10
|
+
header: "_header_wn6yt_2",
|
|
11
|
+
title: "_title_wn6yt_12",
|
|
12
|
+
actions: "_actions_wn6yt_20",
|
|
13
|
+
filtersTitle: "_filtersTitle_wn6yt_27"
|
|
14
|
+
}, h = Object.assign(({ children: e, title: t }) => /* @__PURE__ */ d("div", {
|
|
15
|
+
className: m.header,
|
|
16
|
+
children: [/* @__PURE__ */ u(c, {
|
|
17
|
+
as: "h2",
|
|
18
|
+
className: m.title,
|
|
19
|
+
variant: "titleLarge",
|
|
20
|
+
children: t
|
|
21
|
+
}), e]
|
|
22
|
+
}), {
|
|
23
|
+
Actions: ({ children: e }) => /* @__PURE__ */ u("div", {
|
|
24
|
+
className: m.actions,
|
|
25
|
+
children: e
|
|
26
|
+
}),
|
|
27
|
+
CloseButton: ({ onClick: t }) => {
|
|
28
|
+
let { formatMessage: n } = l();
|
|
29
|
+
return /* @__PURE__ */ u(o, {
|
|
30
|
+
"aria-label": n(e.closeAriaLabel),
|
|
31
|
+
icon: p,
|
|
32
|
+
onClick: t,
|
|
33
|
+
size: "small"
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
FilterMenu: ({ children: t }) => {
|
|
37
|
+
let { formatMessage: n } = l(), [r, o] = i(!1);
|
|
38
|
+
return /* @__PURE__ */ d(a.Root, {
|
|
39
|
+
modal: !1,
|
|
40
|
+
onOpenChange: o,
|
|
41
|
+
open: r,
|
|
42
|
+
children: [/* @__PURE__ */ u(a.Trigger, { children: /* @__PURE__ */ u(s, {
|
|
43
|
+
"aria-label": n(e.filterAriaLabel),
|
|
44
|
+
icon: f,
|
|
45
|
+
pressed: r,
|
|
46
|
+
size: "small"
|
|
47
|
+
}) }), /* @__PURE__ */ d(a.Content, {
|
|
48
|
+
align: "end",
|
|
49
|
+
children: [/* @__PURE__ */ u(c, {
|
|
50
|
+
as: "p",
|
|
51
|
+
className: m.filtersTitle,
|
|
52
|
+
color: "textOnLightSecondary",
|
|
53
|
+
variant: "bodyDefaultBold",
|
|
54
|
+
children: n(e.filtersTitle)
|
|
55
|
+
}), t]
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
MentionMeOption: t,
|
|
60
|
+
ShowResolvedOption: n,
|
|
61
|
+
TaskButton: r
|
|
62
|
+
});
|
|
63
|
+
export { h as t };
|