@webex/cc-components 1.28.0-ccwidgets.98 → 1.28.0-ccwidgets.99
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/index.js +56 -56
- package/dist/types/components/task/CallControl/CallControlCustom/call-control-custom.utils.d.ts +140 -0
- package/dist/types/components/task/CallControl/call-control.utils.d.ts +58 -0
- package/dist/types/components/task/task.types.d.ts +28 -0
- package/dist/wc.js +24 -24
- package/package.json +2 -2
package/dist/types/components/task/CallControl/CallControlCustom/call-control-custom.utils.d.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { BuddyDetails, ContactServiceQueue, ILogger } from '@webex/cc-store';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for button configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface ButtonConfig {
|
|
6
|
+
key: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
tooltip: string;
|
|
10
|
+
className: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
shouldShow: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interface for list item data
|
|
16
|
+
*/
|
|
17
|
+
export interface ListItemData {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates the consult button configuration array
|
|
23
|
+
*/
|
|
24
|
+
export declare const createConsultButtons: (isMuted: boolean, isMuteDisabled: boolean, consultCompleted: boolean, isAgentBeingConsulted: boolean, isEndConsultEnabled: boolean, muteUnmute: boolean, onTransfer?: () => void, handleConsultMuteToggle?: () => void, handleEndConsult?: () => void) => ButtonConfig[];
|
|
25
|
+
/**
|
|
26
|
+
* Filters buttons that should be visible
|
|
27
|
+
*/
|
|
28
|
+
export declare const getVisibleButtons: (buttons: ButtonConfig[]) => ButtonConfig[];
|
|
29
|
+
/**
|
|
30
|
+
* Creates initials from a name string
|
|
31
|
+
*/
|
|
32
|
+
export declare const createInitials: (name: string) => string;
|
|
33
|
+
/**
|
|
34
|
+
* Handles transfer button press with logging
|
|
35
|
+
*/
|
|
36
|
+
export declare const handleTransferPress: (onTransfer: (() => void) | undefined, logger: ILogger) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Handles end consult button press with logging
|
|
39
|
+
*/
|
|
40
|
+
export declare const handleEndConsultPress: (endConsultCall: (() => void) | undefined, logger: ILogger) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Handles mute toggle with disabled state management
|
|
43
|
+
*/
|
|
44
|
+
export declare const handleMuteToggle: (onToggleConsultMute: (() => void) | undefined, setIsMuteDisabled: (disabled: boolean) => void, logger: ILogger) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Gets the consult status text based on completion state
|
|
47
|
+
*/
|
|
48
|
+
export declare const getConsultStatusText: (consultCompleted: boolean) => string;
|
|
49
|
+
/**
|
|
50
|
+
* Handles list item button press with logging
|
|
51
|
+
*/
|
|
52
|
+
export declare const handleListItemPress: (title: string, onButtonPress: () => void, logger: ILogger) => void;
|
|
53
|
+
/**
|
|
54
|
+
* Determines if tabs should be shown based on available data
|
|
55
|
+
*/
|
|
56
|
+
export declare const shouldShowTabs: (buddyAgents: BuddyDetails[], queues: ContactServiceQueue[]) => boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Checks if agents list is empty
|
|
59
|
+
*/
|
|
60
|
+
export declare const isAgentsEmpty: (buddyAgents: BuddyDetails[]) => boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Checks if queues list is empty
|
|
63
|
+
*/
|
|
64
|
+
export declare const isQueuesEmpty: (queues: ContactServiceQueue[]) => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Handles tab selection with logging
|
|
67
|
+
*/
|
|
68
|
+
export declare const handleTabSelection: (key: string, setSelectedTab: (tab: string) => void, logger: ILogger) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Handles agent selection with logging
|
|
71
|
+
*/
|
|
72
|
+
export declare const handleAgentSelection: (agentId: string, agentName: string, onAgentSelect: ((agentId: string, agentName: string) => void) | undefined, logger: ILogger) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Handles queue selection with logging
|
|
75
|
+
*/
|
|
76
|
+
export declare const handleQueueSelection: (queueId: string, queueName: string, onQueueSelect: ((queueId: string, queueName: string) => void) | undefined, logger: ILogger) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Gets the appropriate empty state message based on context
|
|
79
|
+
*/
|
|
80
|
+
export declare const getEmptyStateMessage: (selectedTab: string, showTabs: boolean) => string;
|
|
81
|
+
/**
|
|
82
|
+
* Creates list item data from buddy agents
|
|
83
|
+
*/
|
|
84
|
+
export declare const createAgentListData: (buddyAgents: BuddyDetails[]) => ListItemData[];
|
|
85
|
+
/**
|
|
86
|
+
* Creates list item data from queues
|
|
87
|
+
*/
|
|
88
|
+
export declare const createQueueListData: (queues: ContactServiceQueue[]) => ListItemData[];
|
|
89
|
+
/**
|
|
90
|
+
* Creates a timer key based on timestamp
|
|
91
|
+
*/
|
|
92
|
+
export declare const createTimerKey: (startTimeStamp: number) => string;
|
|
93
|
+
/**
|
|
94
|
+
* Handles popover open with logging
|
|
95
|
+
*/
|
|
96
|
+
export declare const handlePopoverOpen: (menuType: string, setActiveMenu: (menu: string) => void, logger: ILogger) => void;
|
|
97
|
+
/**
|
|
98
|
+
* Handles popover close with logging
|
|
99
|
+
*/
|
|
100
|
+
export declare const handlePopoverClose: (setActiveMenu: (menu: string | null) => void, logger: ILogger) => void;
|
|
101
|
+
/**
|
|
102
|
+
* Handles hold toggle with logging
|
|
103
|
+
*/
|
|
104
|
+
export declare const handleHoldToggle: (toggleHold: (() => void) | undefined, logger: ILogger) => void;
|
|
105
|
+
/**
|
|
106
|
+
* Handles wrapup call with logging
|
|
107
|
+
*/
|
|
108
|
+
export declare const handleWrapupCall: (onWrapupCall: (() => void) | undefined, logger: ILogger) => void;
|
|
109
|
+
/**
|
|
110
|
+
* Validates if a menu type is supported
|
|
111
|
+
*/
|
|
112
|
+
export declare const isValidMenuType: (menuType: string) => boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Gets button style class based on state
|
|
115
|
+
*/
|
|
116
|
+
export declare const getButtonStyleClass: (isActive: boolean, isDisabled: boolean, baseClass?: string) => string;
|
|
117
|
+
/**
|
|
118
|
+
* Formats elapsed time for display
|
|
119
|
+
*/
|
|
120
|
+
export declare const formatElapsedTime: (startTime: number) => string;
|
|
121
|
+
/**
|
|
122
|
+
* Checks if an agent is available for selection
|
|
123
|
+
*/
|
|
124
|
+
export declare const isAgentAvailable: (agent: BuddyDetails) => boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Checks if a queue is available for selection
|
|
127
|
+
*/
|
|
128
|
+
export declare const isQueueAvailable: (queue: ContactServiceQueue) => boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Filters available agents
|
|
131
|
+
*/
|
|
132
|
+
export declare const filterAvailableAgents: (agents: BuddyDetails[]) => BuddyDetails[];
|
|
133
|
+
/**
|
|
134
|
+
* Filters available queues
|
|
135
|
+
*/
|
|
136
|
+
export declare const filterAvailableQueues: (queues: ContactServiceQueue[]) => ContactServiceQueue[];
|
|
137
|
+
/**
|
|
138
|
+
* Debounces a function call
|
|
139
|
+
*/
|
|
140
|
+
export declare const debounce: <T extends (...args: unknown[]) => unknown>(func: T, wait: number) => ((...args: Parameters<T>) => void);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CallControlMenuType } from '../task.types';
|
|
2
|
+
import type { CallControlButton, ControlVisibility, MEDIA_CHANNEL as MediaChannelType, MediaTypeInfo } from '../task.types';
|
|
3
|
+
import { DestinationType, ILogger, ITask } from '@webex/cc-store';
|
|
4
|
+
/**
|
|
5
|
+
* Handles toggle hold functionality
|
|
6
|
+
*/
|
|
7
|
+
export declare const handleToggleHold: (isHeld: boolean, toggleHold: (hold: boolean) => void, setIsHeld: (held: boolean) => void, logger: ILogger) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Handles mute toggle functionality with disabled state management
|
|
10
|
+
*/
|
|
11
|
+
export declare const handleMuteToggle: (toggleMute: () => void, setIsMuteButtonDisabled: (disabled: boolean) => void, logger: ILogger) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Handles wrapup call submission
|
|
14
|
+
*/
|
|
15
|
+
export declare const handleWrapupCall: (selectedWrapupReason: string | null, selectedWrapupId: string | null, wrapupCall: (reason: string, id: string) => void, setSelectedWrapupReason: (reason: string | null) => void, setSelectedWrapupId: (id: string | null) => void, logger: ILogger) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Handles wrapup reason change
|
|
18
|
+
*/
|
|
19
|
+
export declare const handleWrapupChange: (text: string, value: string, setSelectedWrapupReason: (reason: string) => void, setSelectedWrapupId: (id: string) => void) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Handles target selection for consult/transfer
|
|
22
|
+
*/
|
|
23
|
+
export declare const handleTargetSelect: (id: string, name: string, type: DestinationType, agentMenuType: CallControlMenuType | null, consultCall: (id: string, type: DestinationType) => void, transferCall: (id: string, type: DestinationType) => void, setConsultAgentId: (id: string) => void, setConsultAgentName: (name: string) => void, setLastTargetType: (type: DestinationType) => void, logger: ILogger) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Gets the media type information
|
|
26
|
+
*/
|
|
27
|
+
export declare const getMediaType: (mediaType: MediaChannelType, mediaChannel: MediaChannelType) => MediaTypeInfo;
|
|
28
|
+
/**
|
|
29
|
+
* Checks if the media type is telephony
|
|
30
|
+
*/
|
|
31
|
+
export declare const isTelephonyMediaType: (mediaType: MediaChannelType) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Builds the call control buttons configuration
|
|
34
|
+
*/
|
|
35
|
+
export declare const buildCallControlButtons: (isMuted: boolean, isHeld: boolean, isRecording: boolean, isMuteButtonDisabled: boolean, currentMediaType: MediaTypeInfo, controlVisibility: ControlVisibility, handleMuteToggleFunc: () => void, handleToggleHoldFunc: () => void, toggleRecording: () => void, endCall: () => void) => CallControlButton[];
|
|
36
|
+
/**
|
|
37
|
+
* Filters buttons based on consultation state
|
|
38
|
+
*/
|
|
39
|
+
export declare const filterButtonsForConsultation: (buttons: CallControlButton[], consultInitiated: boolean, isTelephony: boolean) => CallControlButton[];
|
|
40
|
+
/**
|
|
41
|
+
* Updates call state from current task data
|
|
42
|
+
*/
|
|
43
|
+
export declare const updateCallStateFromTask: (currentTask: ITask, setIsHeld: (held: boolean) => void, setIsRecording: (recording: boolean) => void) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Handles close button press for popover components
|
|
46
|
+
*/
|
|
47
|
+
export declare const handleCloseButtonPress: (setShowAgentMenu: (show: boolean) => void, setAgentMenuType: (type: CallControlMenuType | null) => void) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Handles wrapup reason selection change event
|
|
50
|
+
*/
|
|
51
|
+
export declare const handleWrapupReasonChange: (event: CustomEvent, wrapupCodes: Array<{
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
}> | undefined, handleWrapupChange: (text: string, value: string) => void) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Handles audio element ref assignment
|
|
57
|
+
*/
|
|
58
|
+
export declare const handleAudioRef: (audioElement: HTMLAudioElement | null, callControlAudio: MediaStream | null) => void;
|
|
@@ -437,6 +437,34 @@ export interface AutoWrapupTimerProps {
|
|
|
437
437
|
allowCancelAutoWrapup?: boolean;
|
|
438
438
|
handleCancelWrapup: () => void;
|
|
439
439
|
}
|
|
440
|
+
export interface CallControlButton {
|
|
441
|
+
id: string;
|
|
442
|
+
icon: string;
|
|
443
|
+
onClick?: () => void;
|
|
444
|
+
tooltip: string;
|
|
445
|
+
className: string;
|
|
446
|
+
disabled: boolean;
|
|
447
|
+
isVisible: boolean;
|
|
448
|
+
menuType?: CallControlMenuType;
|
|
449
|
+
dataTestId?: string;
|
|
450
|
+
}
|
|
451
|
+
export interface ControlVisibility {
|
|
452
|
+
accept: boolean;
|
|
453
|
+
decline: boolean;
|
|
454
|
+
end: boolean;
|
|
455
|
+
muteUnmute: boolean;
|
|
456
|
+
holdResume: boolean;
|
|
457
|
+
consult: boolean;
|
|
458
|
+
transfer: boolean;
|
|
459
|
+
conference: boolean;
|
|
460
|
+
wrapup: boolean;
|
|
461
|
+
pauseResumeRecording: boolean;
|
|
462
|
+
endConsult: boolean;
|
|
463
|
+
recordingIndicator: boolean;
|
|
464
|
+
}
|
|
465
|
+
export interface MediaTypeInfo {
|
|
466
|
+
labelName: string;
|
|
467
|
+
}
|
|
440
468
|
export interface TaskComponentData {
|
|
441
469
|
currentMediaType: {
|
|
442
470
|
labelName: string;
|