@webex/cc-components 1.28.0-ccwidgets.96 → 1.28.0-ccwidgets.98
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/dist/47609.js +1 -1
- package/dist/69990.js +1 -1
- package/dist/index.js +84 -84
- package/dist/types/components/task/IncomingTask/incoming-task.utils.d.ts +23 -0
- package/dist/types/components/task/Task/index.d.ts +1 -1
- package/dist/types/components/task/Task/task.utils.d.ts +76 -0
- package/dist/types/components/task/TaskList/task-list.utils.d.ts +45 -0
- package/dist/types/components/task/task.types.d.ts +59 -2
- package/dist/wc.js +75 -75
- package/package.json +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ITask } from '@webex/cc-store';
|
|
2
|
+
export interface IncomingTaskData {
|
|
3
|
+
ani: string;
|
|
4
|
+
customerName: string;
|
|
5
|
+
virtualTeamName: string;
|
|
6
|
+
ronaTimeout: number | null;
|
|
7
|
+
startTimeStamp: number;
|
|
8
|
+
mediaType: string;
|
|
9
|
+
mediaChannel: string;
|
|
10
|
+
isTelephony: boolean;
|
|
11
|
+
isSocial: boolean;
|
|
12
|
+
acceptText: string | undefined;
|
|
13
|
+
declineText: string | undefined;
|
|
14
|
+
title: string;
|
|
15
|
+
disableAccept: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Extracts and processes all data needed for rendering an incoming task
|
|
19
|
+
* @param incomingTask - The incoming task object
|
|
20
|
+
* @param isBrowser - Whether the device type is browser
|
|
21
|
+
* @returns Processed task data with computed values
|
|
22
|
+
*/
|
|
23
|
+
export declare const extractIncomingTaskData: (incomingTask: ITask, isBrowser: boolean) => IncomingTaskData;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { PressEvent } from '@react-types/shared';
|
|
3
3
|
import type { MEDIA_CHANNEL as MediaChannelType } from '../task.types';
|
|
4
4
|
import './styles.scss';
|
|
5
|
-
interface TaskProps {
|
|
5
|
+
export interface TaskProps {
|
|
6
6
|
interactionId?: string;
|
|
7
7
|
title?: string;
|
|
8
8
|
state?: string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { MEDIA_CHANNEL as MediaChannelType, TaskComponentData } from '../task.types';
|
|
2
|
+
/**
|
|
3
|
+
* Capitalizes the first word of a string
|
|
4
|
+
* @param str - The string to capitalize
|
|
5
|
+
* @returns The string with the first word capitalized
|
|
6
|
+
*/
|
|
7
|
+
export declare const capitalizeFirstWord: (str: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Gets the correct CSS class name for the task title
|
|
10
|
+
* @param isNonVoiceMedia - Whether the media type is non-voice
|
|
11
|
+
* @param isIncomingTask - Whether this is an incoming task
|
|
12
|
+
* @returns The appropriate CSS class name
|
|
13
|
+
*/
|
|
14
|
+
export declare const getTitleClassName: (isNonVoiceMedia: boolean, isIncomingTask: boolean) => string;
|
|
15
|
+
/**
|
|
16
|
+
* Creates unique IDs for tooltip elements
|
|
17
|
+
* @param interactionId - The interaction ID
|
|
18
|
+
* @returns Object with tooltip trigger and tooltip IDs
|
|
19
|
+
*/
|
|
20
|
+
export declare const createTooltipIds: (interactionId?: string) => {
|
|
21
|
+
tooltipTriggerId: string;
|
|
22
|
+
tooltipId: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Determines if the state should be shown
|
|
26
|
+
* @param state - The task state
|
|
27
|
+
* @param isIncomingTask - Whether this is an incoming task
|
|
28
|
+
* @returns Whether to show the state
|
|
29
|
+
*/
|
|
30
|
+
export declare const shouldShowState: (state?: string, isIncomingTask?: boolean) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Determines if the queue should be shown
|
|
33
|
+
* @param queue - The queue name
|
|
34
|
+
* @param isIncomingTask - Whether this is an incoming task
|
|
35
|
+
* @returns Whether to show the queue
|
|
36
|
+
*/
|
|
37
|
+
export declare const shouldShowQueue: (queue?: string, isIncomingTask?: boolean) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Determines if handle time should be shown
|
|
40
|
+
* @param isIncomingTask - Whether this is an incoming task
|
|
41
|
+
* @param ronaTimeout - The RONA timeout value
|
|
42
|
+
* @param startTimeStamp - The start timestamp
|
|
43
|
+
* @returns Whether to show handle time
|
|
44
|
+
*/
|
|
45
|
+
export declare const shouldShowHandleTime: (isIncomingTask?: boolean, ronaTimeout?: number, startTimeStamp?: number) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Determines if time left should be shown
|
|
48
|
+
* @param isIncomingTask - Whether this is an incoming task
|
|
49
|
+
* @param ronaTimeout - The RONA timeout value
|
|
50
|
+
* @returns Whether to show time left
|
|
51
|
+
*/
|
|
52
|
+
export declare const shouldShowTimeLeft: (isIncomingTask?: boolean, ronaTimeout?: number) => boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Gets the task list item CSS classes
|
|
55
|
+
* @param selected - Whether the task is selected
|
|
56
|
+
* @param styles - Additional styles
|
|
57
|
+
* @returns The combined CSS class string
|
|
58
|
+
*/
|
|
59
|
+
export declare const getTaskListItemClasses: (selected?: boolean, styles?: string) => string;
|
|
60
|
+
/**
|
|
61
|
+
* Extracts and processes all data needed for rendering the Task component
|
|
62
|
+
* @param props - The Task component props
|
|
63
|
+
* @returns Processed task data with computed values
|
|
64
|
+
*/
|
|
65
|
+
export declare const extractTaskComponentData: ({ mediaType, mediaChannel, isIncomingTask, interactionId, state, queue, ronaTimeout, startTimeStamp, }: {
|
|
66
|
+
mediaType?: MediaChannelType;
|
|
67
|
+
mediaChannel?: MediaChannelType;
|
|
68
|
+
isIncomingTask?: boolean;
|
|
69
|
+
interactionId?: string;
|
|
70
|
+
state?: string;
|
|
71
|
+
queue?: string;
|
|
72
|
+
ronaTimeout?: number;
|
|
73
|
+
startTimeStamp?: number;
|
|
74
|
+
acceptText?: string;
|
|
75
|
+
declineText?: string;
|
|
76
|
+
}) => TaskComponentData;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { TaskListItemData } from '../task.types';
|
|
2
|
+
import { ITask } from '@webex/cc-store';
|
|
3
|
+
/**
|
|
4
|
+
* Extracts and processes data from a task for rendering in the task list
|
|
5
|
+
* @param task - The task object
|
|
6
|
+
* @param isBrowser - Whether the device type is browser
|
|
7
|
+
* @returns Processed task data with computed values
|
|
8
|
+
*/
|
|
9
|
+
export declare const extractTaskListItemData: (task: ITask, isBrowser: boolean) => TaskListItemData;
|
|
10
|
+
/**
|
|
11
|
+
* Determines if a task should be selectable
|
|
12
|
+
* @param task - The task object
|
|
13
|
+
* @param currentTask - The currently selected task
|
|
14
|
+
* @param taskData - Processed task data
|
|
15
|
+
* @returns Whether the task should be selectable
|
|
16
|
+
*/
|
|
17
|
+
export declare const isTaskSelectable: (task: ITask, currentTask: ITask | null, taskData: TaskListItemData) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Determines if the current task is selected
|
|
20
|
+
* @param task - The task object
|
|
21
|
+
* @param currentTask - The currently selected task
|
|
22
|
+
* @returns Whether this task is currently selected
|
|
23
|
+
*/
|
|
24
|
+
export declare const isCurrentTaskSelected: (task: ITask, currentTask: ITask | null) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Validates if a task list is empty or invalid
|
|
27
|
+
* @param taskList - The task list object
|
|
28
|
+
* @returns Whether the task list is empty or invalid
|
|
29
|
+
*/
|
|
30
|
+
export declare const isTaskListEmpty: (taskList: Record<string, ITask> | null | undefined) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Gets tasks as an array from the task list object
|
|
33
|
+
* @param taskList - The task list object
|
|
34
|
+
* @returns Array of tasks
|
|
35
|
+
*/
|
|
36
|
+
export declare const getTasksArray: (taskList: Record<string, ITask> | null | undefined) => ITask[];
|
|
37
|
+
/**
|
|
38
|
+
* Creates task select handler with logging
|
|
39
|
+
* @param task - The task to select
|
|
40
|
+
* @param currentTask - The currently selected task
|
|
41
|
+
* @param onTaskSelect - The task select function
|
|
42
|
+
* @param logger - The logger instance
|
|
43
|
+
* @returns Task select handler function
|
|
44
|
+
*/
|
|
45
|
+
export declare const createTaskSelectHandler: (task: ITask, currentTask: ITask | null, onTaskSelect: (task: ITask) => void) => () => void;
|
|
@@ -96,8 +96,8 @@ export interface TaskProps {
|
|
|
96
96
|
*/
|
|
97
97
|
logger: ILogger;
|
|
98
98
|
}
|
|
99
|
-
export type IncomingTaskComponentProps = Pick<TaskProps, '
|
|
100
|
-
export type TaskListComponentProps = Pick<TaskProps, '
|
|
99
|
+
export type IncomingTaskComponentProps = Pick<TaskProps, 'isBrowser' | 'accept' | 'reject'> & Partial<Pick<TaskProps, 'incomingTask'>>;
|
|
100
|
+
export type TaskListComponentProps = Pick<TaskProps, 'isBrowser' | 'acceptTask' | 'declineTask' | 'onTaskSelect' | 'logger'> & Partial<Pick<TaskProps, 'currentTask' | 'taskList'>>;
|
|
101
101
|
/**
|
|
102
102
|
* Interface representing the properties for control actions on a task.
|
|
103
103
|
*/
|
|
@@ -437,4 +437,61 @@ export interface AutoWrapupTimerProps {
|
|
|
437
437
|
allowCancelAutoWrapup?: boolean;
|
|
438
438
|
handleCancelWrapup: () => void;
|
|
439
439
|
}
|
|
440
|
+
export interface TaskComponentData {
|
|
441
|
+
currentMediaType: {
|
|
442
|
+
labelName: string;
|
|
443
|
+
iconName: string;
|
|
444
|
+
className: string;
|
|
445
|
+
isBrandVisual: boolean;
|
|
446
|
+
};
|
|
447
|
+
isNonVoiceMedia: boolean;
|
|
448
|
+
tooltipTriggerId: string;
|
|
449
|
+
tooltipId: string;
|
|
450
|
+
titleClassName: string;
|
|
451
|
+
shouldShowState: boolean;
|
|
452
|
+
shouldShowQueue: boolean;
|
|
453
|
+
shouldShowHandleTime: boolean;
|
|
454
|
+
shouldShowTimeLeft: boolean;
|
|
455
|
+
capitalizedState: string;
|
|
456
|
+
capitalizedQueue: string;
|
|
457
|
+
}
|
|
458
|
+
export interface TaskListItemData {
|
|
459
|
+
ani: string;
|
|
460
|
+
customerName: string;
|
|
461
|
+
virtualTeamName: string;
|
|
462
|
+
ronaTimeout: number | null;
|
|
463
|
+
taskState: string;
|
|
464
|
+
startTimeStamp: number;
|
|
465
|
+
isIncomingTask: boolean;
|
|
466
|
+
mediaType: string;
|
|
467
|
+
mediaChannel: string;
|
|
468
|
+
isTelephony: boolean;
|
|
469
|
+
isSocial: boolean;
|
|
470
|
+
acceptText: string | undefined;
|
|
471
|
+
declineText: string | undefined;
|
|
472
|
+
title: string;
|
|
473
|
+
disableAccept: boolean;
|
|
474
|
+
displayState: string;
|
|
475
|
+
}
|
|
476
|
+
export declare enum TaskState {
|
|
477
|
+
NEW = "new",
|
|
478
|
+
ACTIVE = "active",
|
|
479
|
+
CONNECTED = "connected",
|
|
480
|
+
HOLD = "hold",
|
|
481
|
+
CONSULT = "consult",
|
|
482
|
+
CONFERENCE = "conference",
|
|
483
|
+
WRAP_UP = "wrap_up",
|
|
484
|
+
ENDED = "ended",
|
|
485
|
+
TRANSFERRED = "transferred",
|
|
486
|
+
DECLINED = "declined"
|
|
487
|
+
}
|
|
488
|
+
export declare enum TaskQueue {
|
|
489
|
+
SUPPORT = "support",
|
|
490
|
+
SALES = "sales",
|
|
491
|
+
TECHNICAL = "technical",
|
|
492
|
+
BILLING = "billing",
|
|
493
|
+
GENERAL = "general",
|
|
494
|
+
VIP = "vip",
|
|
495
|
+
ESCALATION = "escalation"
|
|
496
|
+
}
|
|
440
497
|
export {};
|