@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,52 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
closeAriaLabel: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
filterAriaLabel: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
filtersTitle: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
showResolvedComments: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
showResolvedCommentsDescription: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
hideResolvedComments: {
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
hideResolvedCommentsDescription: {
|
|
33
|
+
defaultMessage: string;
|
|
34
|
+
description: string;
|
|
35
|
+
id: string;
|
|
36
|
+
};
|
|
37
|
+
mentionMe: {
|
|
38
|
+
defaultMessage: string;
|
|
39
|
+
description: string;
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
42
|
+
mentionMeDescription: {
|
|
43
|
+
defaultMessage: string;
|
|
44
|
+
description: string;
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
mentionMeDescriptionWithTasks: {
|
|
48
|
+
defaultMessage: string;
|
|
49
|
+
description: string;
|
|
50
|
+
id: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface InteractiveHeaderProps {
|
|
2
|
+
/** Whether the feed includes tasks (changes Mention Me caption). */
|
|
3
|
+
hasTasks?: boolean;
|
|
4
|
+
/** Seed for the mention-me filter; updating via Storybook controls resets interactive state. */
|
|
5
|
+
initialMentionMe?: boolean;
|
|
6
|
+
/** Seed for the resolved-comments filter; updating via Storybook controls resets interactive state. */
|
|
7
|
+
initialShowResolvedComments?: boolean;
|
|
8
|
+
/** Callback fired when the close button is clicked. */
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/** Header title text. */
|
|
11
|
+
title: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const InteractiveHeader: ({ hasTasks, initialMentionMe, initialShowResolvedComments, onClose, title, }: InteractiveHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TaskButton, type TaskButtonProps } from './task-button';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
approvalTaskDescription: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
approvalTaskTitle: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
generalTaskDescription: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
generalTaskTitle: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
taskButtonLabel: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TaskType } from '../../task-item/types';
|
|
2
|
+
export interface TaskButtonProps {
|
|
3
|
+
/** Whether the button is disabled. */
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** Callback fired when a task type is selected from the dropdown. */
|
|
6
|
+
onMenuItemClick: (taskType: TaskType) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const TaskButton: ({ disabled, onMenuItemClick }: TaskButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TaskItemProps } from './types';
|
|
2
|
+
export declare function TaskItem({ assignees, author, completedAt, completionRule, createdAt, currentUserId, description, disabled, dueDate, fileCount, getAvatarUrl, hasNextPage, id, onApprove, onComplete, onDelete, onEdit, onLoadAllAssignee, onReject, onView, permissions: taskPermissions, status, taskType, }: TaskItemProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default TaskItem;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TaskAssignee } from './types';
|
|
2
|
+
export type TaskItemFooterProps = {
|
|
3
|
+
assignees: TaskAssignee[];
|
|
4
|
+
canApprove: boolean;
|
|
5
|
+
canReject: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
dueDate?: number;
|
|
8
|
+
hasNextPage?: boolean;
|
|
9
|
+
onApprove: () => void;
|
|
10
|
+
onComplete: () => void;
|
|
11
|
+
onLoadAllAssignee?: () => Promise<TaskAssignee[]>;
|
|
12
|
+
onReject: () => void;
|
|
13
|
+
onView: () => void;
|
|
14
|
+
showActionButtons: boolean;
|
|
15
|
+
showApprovalActions: boolean;
|
|
16
|
+
showGeneralComplete: boolean;
|
|
17
|
+
showViewDetails: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare function TaskItemFooter({ assignees, canApprove, canReject, disabled, dueDate, hasNextPage, onApprove, onComplete, onLoadAllAssignee, onReject, onView, showActionButtons, showApprovalActions, showGeneralComplete, showViewDetails, }: TaskItemFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TaskAssignee } from '../../types';
|
|
2
|
+
export interface AssigneeListProps {
|
|
3
|
+
assignees: TaskAssignee[];
|
|
4
|
+
/** Disables "Show More" and "Show Less" buttons when true */
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Whether there are more assignees to load from the server */
|
|
7
|
+
hasNextPage?: boolean;
|
|
8
|
+
/** Callback to load all assignees (up to 1000). Called when "Show More" is clicked and hasNextPage is true. Returns array of all assignees. */
|
|
9
|
+
onLoadAllAssignee?: () => Promise<TaskAssignee[]>;
|
|
10
|
+
}
|
|
11
|
+
export declare function AssigneeList({ assignees, disabled, hasNextPage, onLoadAllAssignee, }: AssigneeListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AssigneeList, type AssigneeListProps } from './AssigneeList';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TaskDueDate, type TaskDueDateProps } from './TaskDueDate';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TaskMessageAuthor, TaskMessageDocument } from './types';
|
|
3
|
+
export interface TaskMessageProps {
|
|
4
|
+
id: string;
|
|
5
|
+
author: TaskMessageAuthor;
|
|
6
|
+
message: TaskMessageDocument;
|
|
7
|
+
createdAt: number;
|
|
8
|
+
canEdit?: boolean;
|
|
9
|
+
canDelete?: boolean;
|
|
10
|
+
onEdit?: (id: string) => void;
|
|
11
|
+
onDelete?: (id: string) => void;
|
|
12
|
+
/** When true, shows the threaded indicator vertical line */
|
|
13
|
+
showThreadedIndicator?: boolean;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function TaskMessage({ id, author, message, createdAt, canEdit, canDelete, onEdit, onDelete, showThreadedIndicator, children, }: TaskMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
moreOptionsAriaLabel: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
deleteTaskConfirmationBody: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
deleteTaskConfirmationDialogAriaLabel: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
deleteTaskConfirmationCancel: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
deleteTaskConfirmationConfirm: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default messages;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TaskDeleteConfirmationPopoverProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
onConfirm: () => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Delete confirmation anchored below the task message options control (ellipsis).
|
|
9
|
+
* Mirrors threaded-annotations DeleteConfirmationPopover + message-header placement.
|
|
10
|
+
*/
|
|
11
|
+
export declare function TaskDeleteConfirmationPopover({ open, onOpenChange, onConfirm, onCancel, }: TaskDeleteConfirmationPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface TaskOptionsMenuProps {
|
|
2
|
+
canDelete?: boolean;
|
|
3
|
+
canEdit?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onEdit?: () => void;
|
|
6
|
+
onDelete?: () => void;
|
|
7
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Context menu for a task message with Modify task and Delete task options.
|
|
11
|
+
* Delete opens an anchored confirmation popover (same pattern as threaded message-header).
|
|
12
|
+
*/
|
|
13
|
+
export declare function TaskOptionsMenu({ canDelete, canEdit, disabled, onEdit, onDelete, onOpenChange, }: TaskOptionsMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface TaskMessageAuthor {
|
|
2
|
+
avatarUrl?: string;
|
|
3
|
+
email: string;
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TaskMessageDocument {
|
|
8
|
+
type: 'doc';
|
|
9
|
+
content: TaskMessageNode[];
|
|
10
|
+
}
|
|
11
|
+
export type TaskMessageNode = TaskMessageParagraphNode;
|
|
12
|
+
export interface TaskMessageParagraphNode {
|
|
13
|
+
type: 'paragraph';
|
|
14
|
+
content: TaskMessageTextNode[];
|
|
15
|
+
}
|
|
16
|
+
export interface TaskMessageTextNode {
|
|
17
|
+
type: 'text';
|
|
18
|
+
text: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TaskStatus } from '../../types';
|
|
2
|
+
export type TaskStateProps = {
|
|
3
|
+
/** Unix ms when this collective state was reached. */
|
|
4
|
+
completedAt: number;
|
|
5
|
+
/**
|
|
6
|
+
* Whether to display the "(n of n)" count. Should be true only when:
|
|
7
|
+
* - completionRule is ALL_ASSIGNEES
|
|
8
|
+
* - All assignees are loaded (no pagination)
|
|
9
|
+
* Count is only shown for COMPLETED and APPROVED, never for REJECTED.
|
|
10
|
+
*/
|
|
11
|
+
showCount?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Total assignee count. Shows "(n of n)" for COMPLETED and APPROVED when `showCount` is true.
|
|
14
|
+
* Never shows count for REJECTED.
|
|
15
|
+
*/
|
|
16
|
+
totalCount: number;
|
|
17
|
+
variant: TaskStatus;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Status row for terminal task outcomes: completed (general), approved, or rejected (approval).
|
|
21
|
+
*
|
|
22
|
+
* Shows "(n of n)" count for COMPLETED and APPROVED when:
|
|
23
|
+
* - completionRule is ALL_ASSIGNEES (controlled by showCount prop)
|
|
24
|
+
* - All assignees are loaded (no pagination)
|
|
25
|
+
*
|
|
26
|
+
* Never shows count for REJECTED status.
|
|
27
|
+
*/
|
|
28
|
+
export declare function TaskState({ completedAt, showCount, totalCount, variant }: TaskStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
approvedHeadline: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
completedHeadline: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
completedCountParenthetical: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
rejectedHeadline: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default messages;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task item feature exports (item, subcomponents, types, messages).
|
|
3
|
+
*/
|
|
4
|
+
export { TaskItem } from './TaskItem';
|
|
5
|
+
export { TaskDueDate } from './components/task-due-date';
|
|
6
|
+
export { AssigneeList } from './components/assignee-list';
|
|
7
|
+
export type { TaskItemProps, TaskItemPermissions, TaskStatus as TaskStatusType, TaskCompletionRule, TaskAssignee, TaskAuthor, } from './types';
|
|
8
|
+
/** General vs approval task kind. */
|
|
9
|
+
export { TaskType } from './types';
|
|
10
|
+
/** String enum for task / assignee row status. */
|
|
11
|
+
export { TaskStatus as TaskItemStatus } from './types';
|
|
12
|
+
export { default as messages } from './messages';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
declare const messages: {
|
|
2
|
+
taskLabel: {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultMessage: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
approvalTaskLabel: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
taskEditMenuItem: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
taskDeleteMenuItem: {
|
|
18
|
+
id: string;
|
|
19
|
+
defaultMessage: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
taskCompleteAction: {
|
|
23
|
+
id: string;
|
|
24
|
+
defaultMessage: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
taskApproveAction: {
|
|
28
|
+
id: string;
|
|
29
|
+
defaultMessage: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
taskRejectAction: {
|
|
33
|
+
id: string;
|
|
34
|
+
defaultMessage: string;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
taskViewDetailsAction: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
taskDueDateLabel: {
|
|
43
|
+
id: string;
|
|
44
|
+
defaultMessage: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
assigneeRowStatusCompleted: {
|
|
48
|
+
id: string;
|
|
49
|
+
defaultMessage: string;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
assigneeRowStatusApproved: {
|
|
53
|
+
id: string;
|
|
54
|
+
defaultMessage: string;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
assigneeRowStatusRejected: {
|
|
58
|
+
id: string;
|
|
59
|
+
defaultMessage: string;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
showMoreAssignees: {
|
|
63
|
+
id: string;
|
|
64
|
+
defaultMessage: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
showMoreAssigneesApproximate: {
|
|
68
|
+
id: string;
|
|
69
|
+
defaultMessage: string;
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
showMore: {
|
|
73
|
+
id: string;
|
|
74
|
+
defaultMessage: string;
|
|
75
|
+
description: string;
|
|
76
|
+
};
|
|
77
|
+
showLessAssignees: {
|
|
78
|
+
id: string;
|
|
79
|
+
defaultMessage: string;
|
|
80
|
+
description: string;
|
|
81
|
+
};
|
|
82
|
+
loadingAssignees: {
|
|
83
|
+
id: string;
|
|
84
|
+
defaultMessage: string;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
loadAssigneesError: {
|
|
88
|
+
id: string;
|
|
89
|
+
defaultMessage: string;
|
|
90
|
+
description: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export default messages;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** Task / assignee workflow status (string enum for API alignment). */
|
|
2
|
+
export declare enum TaskStatus {
|
|
3
|
+
NOT_STARTED = "NOT_STARTED",
|
|
4
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
5
|
+
COMPLETED = "COMPLETED",
|
|
6
|
+
APPROVED = "APPROVED",
|
|
7
|
+
REJECTED = "REJECTED"
|
|
8
|
+
}
|
|
9
|
+
export declare enum TaskType {
|
|
10
|
+
APPROVAL = "APPROVAL",
|
|
11
|
+
GENERAL = "GENERAL"
|
|
12
|
+
}
|
|
13
|
+
export declare enum TaskCompletionRule {
|
|
14
|
+
ALL_ASSIGNEES = "ALL_ASSIGNEES",
|
|
15
|
+
ANY_ASSIGNEE = "ANY_ASSIGNEE"
|
|
16
|
+
}
|
|
17
|
+
/** Task resource permissions from the Tasks API (`permissions` on the task). */
|
|
18
|
+
export interface TaskItemPermissions {
|
|
19
|
+
canCreateTaskCollaborator: boolean;
|
|
20
|
+
canCreateTaskLink: boolean;
|
|
21
|
+
canDelete: boolean;
|
|
22
|
+
canUpdate: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface TaskAssignee {
|
|
25
|
+
avatarUrl?: string;
|
|
26
|
+
completedAt?: number;
|
|
27
|
+
email?: string;
|
|
28
|
+
id: string;
|
|
29
|
+
/** When true, shows external collaborator treatment on the avatar (e.g. badge). */
|
|
30
|
+
isExternal?: boolean;
|
|
31
|
+
name: string;
|
|
32
|
+
/** Permissions for this specific assignee (task_collaborator permissions from API). */
|
|
33
|
+
permissions?: {
|
|
34
|
+
canDelete: boolean;
|
|
35
|
+
canUpdate: boolean;
|
|
36
|
+
};
|
|
37
|
+
status: TaskStatus;
|
|
38
|
+
}
|
|
39
|
+
export interface TaskAuthor {
|
|
40
|
+
avatarUrl?: string;
|
|
41
|
+
email?: string;
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
export interface TaskItemProps {
|
|
46
|
+
/** Current logged-in user ID (used to determine if action buttons should show) */
|
|
47
|
+
currentUserId?: string;
|
|
48
|
+
/** Unique task ID */
|
|
49
|
+
id: string;
|
|
50
|
+
/** Task type: approval or general */
|
|
51
|
+
taskType: TaskType;
|
|
52
|
+
/** Task author */
|
|
53
|
+
author: TaskAuthor;
|
|
54
|
+
/** Task creation timestamp (Unix ms) */
|
|
55
|
+
createdAt: number;
|
|
56
|
+
/** Task description/message */
|
|
57
|
+
description: string;
|
|
58
|
+
/** List of task assignees */
|
|
59
|
+
assignees: TaskAssignee[];
|
|
60
|
+
/** Overall task status */
|
|
61
|
+
status: TaskStatus;
|
|
62
|
+
/**
|
|
63
|
+
* When the task reached a terminal outcome (e.g. completed / approved / rejected), Unix ms.
|
|
64
|
+
* Passed through to threaded task UI for the status banner timestamp; omit when unknown.
|
|
65
|
+
*/
|
|
66
|
+
completedAt?: number;
|
|
67
|
+
/** Task due date (Unix ms) */
|
|
68
|
+
dueDate?: number;
|
|
69
|
+
/** Completion rule */
|
|
70
|
+
completionRule?: TaskCompletionRule;
|
|
71
|
+
/**
|
|
72
|
+
* Number of files associated with this task.
|
|
73
|
+
* Omitted or nullish values are treated as 1. When the result is > 1 and `onView` is provided, shows "View Task Details" instead of other footer actions.
|
|
74
|
+
*/
|
|
75
|
+
fileCount?: number | null;
|
|
76
|
+
/**
|
|
77
|
+
* API permissions for the task. When set, `canDelete` / `canUpdate` drive message delete & edit UI;
|
|
78
|
+
* omit to fall back to whether `onDelete` and `onEdit` callbacks are provided.
|
|
79
|
+
*/
|
|
80
|
+
permissions?: TaskItemPermissions;
|
|
81
|
+
/** Callback when a general task is completed (footer shows only for `taskType: TaskType.GENERAL`). */
|
|
82
|
+
onComplete?: (taskId: string) => void;
|
|
83
|
+
/** Callback when an approval task is approved (shown with Reject when `taskType: TaskType.APPROVAL`). */
|
|
84
|
+
onApprove?: (taskId: string) => void;
|
|
85
|
+
/** Callback when an approval task is rejected. */
|
|
86
|
+
onReject?: (taskId: string) => void;
|
|
87
|
+
/** Callback when task is edited */
|
|
88
|
+
onEdit?: (taskId: string) => void;
|
|
89
|
+
/** Callback when task is deleted */
|
|
90
|
+
onDelete?: (taskId: string) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Callback when "View Task Details" is clicked for multi-file tasks.
|
|
93
|
+
* When effective file count (`fileCount` with nullish treated as 1) is > 1 and this is provided, replaces other footer actions; if omitted, normal actions still show when allowed.
|
|
94
|
+
*/
|
|
95
|
+
onView?: (taskId: string) => void;
|
|
96
|
+
/** Get avatar URL for a user (omit or return undefined when none). */
|
|
97
|
+
getAvatarUrl?: (userId: string) => string | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* When true, disables and blocks interactions (action buttons, edit/delete menu, assignee controls).
|
|
100
|
+
*/
|
|
101
|
+
disabled?: boolean;
|
|
102
|
+
/** Whether there are more assignees to load from the server */
|
|
103
|
+
hasNextPage?: boolean;
|
|
104
|
+
/** Callback to load all assignees (up to 1000) when "Show More" is clicked. Returns array of all assignees. */
|
|
105
|
+
onLoadAllAssignee?: () => Promise<TaskAssignee[]>;
|
|
106
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TaskMessageAuthor, TaskMessageDocument } from '../components/task-message';
|
|
2
|
+
import { TaskAuthor } from '../types';
|
|
3
|
+
export declare const taskDescriptionToDocument: (description: string) => TaskMessageDocument;
|
|
4
|
+
export declare const taskAuthorToTaskMessageAuthor: (author: TaskAuthor, getAvatarUrl?: (userId: string) => string | undefined) => TaskMessageAuthor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getInitials: (name: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UserAvatar, type UserAvatarProps, type UserAvatarType } from './user-avatar';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type UserAvatarType = {
|
|
2
|
+
avatarUrl?: string;
|
|
3
|
+
id: string;
|
|
4
|
+
isExternal?: boolean;
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
|
+
export interface UserAvatarProps {
|
|
8
|
+
user: UserAvatarType;
|
|
9
|
+
size?: 'xsmall' | 'small' | 'medium' | 'large';
|
|
10
|
+
}
|
|
11
|
+
export declare function UserAvatar({ user, size }: UserAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface DeleteVersionItemProps {
|
|
2
|
+
authorName?: string;
|
|
3
|
+
avatarUrl?: string;
|
|
4
|
+
createdAt?: number;
|
|
5
|
+
id: string;
|
|
6
|
+
versionNumber: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const DeleteVersionItem: ({ authorName, avatarUrl, createdAt, id, versionNumber }: DeleteVersionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeleteVersionItem, type DeleteVersionItemProps } from './delete-version-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DividerVersionItem, type DividerVersionItemProps } from './divider-version-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { VersionItem, type VersionActionType, type VersionItemProps } from './version-item';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const messages: {
|
|
2
|
+
appPromoted: {
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
appRestored: {
|
|
8
|
+
defaultMessage: string;
|
|
9
|
+
description: string;
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
appUploaded: {
|
|
13
|
+
defaultMessage: string;
|
|
14
|
+
description: string;
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
versionDeleted: {
|
|
18
|
+
defaultMessage: string;
|
|
19
|
+
description: string;
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
versionDeletedNoTimestamp: {
|
|
23
|
+
defaultMessage: string;
|
|
24
|
+
description: string;
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
versionPromoted: {
|
|
28
|
+
defaultMessage: string;
|
|
29
|
+
description: string;
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
versionRestored: {
|
|
33
|
+
defaultMessage: string;
|
|
34
|
+
description: string;
|
|
35
|
+
id: string;
|
|
36
|
+
};
|
|
37
|
+
versionUploaded: {
|
|
38
|
+
defaultMessage: string;
|
|
39
|
+
description: string;
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type VersionActionType = 'delete' | 'promote' | 'restore' | 'upload';
|
|
2
|
+
export interface VersionItemProps {
|
|
3
|
+
/** The action label to display for this version entry. */
|
|
4
|
+
actionType?: VersionActionType;
|
|
5
|
+
/** Display name of the app that created this version (e.g., "Box Sign"). When provided, the action label uses the app name as prefix (e.g., "Box Sign Uploaded:") rather than "Version". */
|
|
6
|
+
appName?: string;
|
|
7
|
+
/** Display name of the user who performed the action. Expected for 'delete' action type. */
|
|
8
|
+
authorName?: string;
|
|
9
|
+
/** URL for the user's avatar image. Expected for 'delete' action type. */
|
|
10
|
+
avatarUrl?: string;
|
|
11
|
+
/** Unix timestamp (in ms) for when the action occurred. Expected for 'delete' action type. */
|
|
12
|
+
createdAt?: number;
|
|
13
|
+
/** Unique identifier for this version (file version ID). */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Callback invoked when the version badge is clicked. Receives the version id and version number. */
|
|
16
|
+
onVersionClick?: (versionInfo: {
|
|
17
|
+
id: string;
|
|
18
|
+
versionNumber: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
/** The version number to display in the badge. */
|
|
21
|
+
versionNumber: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const VersionItem: ({ actionType, appName, authorName, avatarUrl, createdAt, id, onVersionClick, versionNumber, }: VersionItemProps) => import("react/jsx-runtime").JSX.Element;
|