@webex/cc-components 1.28.0-ccwidgets.99 → 1.28.0-next.1

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.
Files changed (26) hide show
  1. package/dist/index.js +121 -121
  2. package/dist/index.js.LICENSE.txt +20 -0
  3. package/dist/types/components/StationLogin/station-login.d.ts +2 -4
  4. package/dist/types/components/StationLogin/station-login.types.d.ts +9 -3
  5. package/dist/types/components/StationLogin/station-login.utils.d.ts +10 -10
  6. package/dist/types/components/UserState/user-state.d.ts +2 -4
  7. package/dist/types/components/UserState/user-state.utils.d.ts +10 -8
  8. package/dist/types/components/task/AutoWrapupTimer/AutoWrapupTimer.utils.d.ts +25 -0
  9. package/dist/types/components/task/CallControl/CallControlCustom/call-control-custom.utils.d.ts +41 -45
  10. package/dist/types/components/task/CallControl/CallControlCustom/consult-transfer-dial-number.d.ts +5 -0
  11. package/dist/types/components/task/CallControl/CallControlCustom/consult-transfer-popover-hooks.d.ts +47 -0
  12. package/dist/types/components/task/CallControl/call-control.d.ts +2 -4
  13. package/dist/types/components/task/CallControl/call-control.utils.d.ts +13 -11
  14. package/dist/types/components/task/CallControlCAD/call-control-cad.d.ts +2 -4
  15. package/dist/types/components/task/IncomingTask/incoming-task.d.ts +2 -4
  16. package/dist/types/components/task/IncomingTask/incoming-task.utils.d.ts +1 -1
  17. package/dist/types/components/task/OutdialCall/constants.d.ts +9 -0
  18. package/dist/types/components/task/OutdialCall/outdial-call.d.ts +2 -4
  19. package/dist/types/components/task/Task/task.utils.d.ts +9 -9
  20. package/dist/types/components/task/TaskList/task-list.d.ts +2 -4
  21. package/dist/types/components/task/TaskList/task-list.utils.d.ts +7 -7
  22. package/dist/types/components/task/constants.d.ts +12 -0
  23. package/dist/types/components/task/task.types.d.ts +174 -65
  24. package/dist/wc.js +120 -120
  25. package/dist/wc.js.LICENSE.txt +20 -0
  26. package/package.json +6 -3
@@ -1,12 +1,12 @@
1
1
  import { TaskListItemData } from '../task.types';
2
- import { ITask } from '@webex/cc-store';
2
+ import { ILogger, ITask } from '@webex/cc-store';
3
3
  /**
4
4
  * Extracts and processes data from a task for rendering in the task list
5
5
  * @param task - The task object
6
6
  * @param isBrowser - Whether the device type is browser
7
7
  * @returns Processed task data with computed values
8
8
  */
9
- export declare const extractTaskListItemData: (task: ITask, isBrowser: boolean) => TaskListItemData;
9
+ export declare const extractTaskListItemData: (task: ITask, isBrowser: boolean, agentId: string, logger?: ILogger) => TaskListItemData;
10
10
  /**
11
11
  * Determines if a task should be selectable
12
12
  * @param task - The task object
@@ -14,26 +14,26 @@ export declare const extractTaskListItemData: (task: ITask, isBrowser: boolean)
14
14
  * @param taskData - Processed task data
15
15
  * @returns Whether the task should be selectable
16
16
  */
17
- export declare const isTaskSelectable: (task: ITask, currentTask: ITask | null, taskData: TaskListItemData) => boolean;
17
+ export declare const isTaskSelectable: (task: ITask, currentTask: ITask | null, taskData: TaskListItemData, logger?: any) => boolean;
18
18
  /**
19
19
  * Determines if the current task is selected
20
20
  * @param task - The task object
21
21
  * @param currentTask - The currently selected task
22
22
  * @returns Whether this task is currently selected
23
23
  */
24
- export declare const isCurrentTaskSelected: (task: ITask, currentTask: ITask | null) => boolean;
24
+ export declare const isCurrentTaskSelected: (task: ITask, currentTask: ITask | null, logger?: any) => boolean;
25
25
  /**
26
26
  * Validates if a task list is empty or invalid
27
27
  * @param taskList - The task list object
28
28
  * @returns Whether the task list is empty or invalid
29
29
  */
30
- export declare const isTaskListEmpty: (taskList: Record<string, ITask> | null | undefined) => boolean;
30
+ export declare const isTaskListEmpty: (taskList: Record<string, ITask> | null | undefined, logger?: any) => boolean;
31
31
  /**
32
32
  * Gets tasks as an array from the task list object
33
33
  * @param taskList - The task list object
34
34
  * @returns Array of tasks
35
35
  */
36
- export declare const getTasksArray: (taskList: Record<string, ITask> | null | undefined) => ITask[];
36
+ export declare const getTasksArray: (taskList: Record<string, ITask> | null | undefined, logger?: any) => ITask[];
37
37
  /**
38
38
  * Creates task select handler with logging
39
39
  * @param task - The task to select
@@ -42,4 +42,4 @@ export declare const getTasksArray: (taskList: Record<string, ITask> | null | un
42
42
  * @param logger - The logger instance
43
43
  * @returns Task select handler function
44
44
  */
45
- export declare const createTaskSelectHandler: (task: ITask, currentTask: ITask | null, onTaskSelect: (task: ITask) => void) => () => void;
45
+ export declare const createTaskSelectHandler: (task: ITask, currentTask: ITask | null, onTaskSelect: (task: ITask) => void, agentId: string, logger?: any) => () => void;
@@ -14,6 +14,18 @@ export declare const SELECT = "Select";
14
14
  export declare const SUBMIT_WRAP_UP = "Submit & Wrap up";
15
15
  export declare const MUTE_CALL = "Mute";
16
16
  export declare const UNMUTE_CALL = "Unmute";
17
+ export declare const DIAL_NUMBER = "DialNumber";
18
+ export declare const AGENTS = "Agents";
19
+ export declare const QUEUES = "Queues";
20
+ export declare const SEARCH_PLACEHOLDER = "Search...";
21
+ export declare const CLEAR_SEARCH = "Clear search";
22
+ export declare const SCROLL_TO_LOAD_MORE = "Scroll to load more";
23
+ export declare const LOADING_MORE_QUEUES = "Loading more queues...";
24
+ export declare const LOADING_MORE_DIAL_NUMBERS = "Loading more dial numbers...";
25
+ export declare const LOADING_MORE_ENTRY_POINTS = "Loading more entry points...";
26
+ export declare const NO_DATA_AVAILABLE_CONSULT_TRANSFER = "No data available for consult transfer.";
27
+ export declare const VIA_SEARCH_SUFFIX = " via search";
28
+ export declare const DEFAULT_PAGE_SIZE = 25;
17
29
  export declare const NO_CUSTOMER_NAME = "No Customer Name";
18
30
  export declare const NO_CALLER_ID = "No Caller ID";
19
31
  export declare const NO_PHONE_NUMBER = "No Phone Number";
@@ -1,4 +1,4 @@
1
- import { ILogger, ITask, IContactCenter, IWrapupCode, BuddyDetails, DestinationType, ContactServiceQueue } from '@webex/cc-store';
1
+ import { ILogger, ITask, IContactCenter, IWrapupCode, BuddyDetails, DestinationType, ContactServiceQueue, AddressBookEntry, EntryPointRecord, FetchPaginatedList, Participant } from '@webex/cc-store';
2
2
  type Enum<T extends Record<string, unknown>> = T[keyof T];
3
3
  /**
4
4
  * Interface representing the TaskProps of a user.
@@ -95,9 +95,13 @@ export interface TaskProps {
95
95
  * The logger instance from SDK
96
96
  */
97
97
  logger: ILogger;
98
+ /**
99
+ * Agent ID of the logged-in user
100
+ */
101
+ agentId: string;
98
102
  }
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'>>;
103
+ export type IncomingTaskComponentProps = Pick<TaskProps, 'isBrowser' | 'accept' | 'reject' | 'logger'> & Partial<Pick<TaskProps, 'incomingTask'>>;
104
+ export type TaskListComponentProps = Pick<TaskProps, 'isBrowser' | 'acceptTask' | 'declineTask' | 'onTaskSelect' | 'logger' | 'agentId'> & Partial<Pick<TaskProps, 'currentTask' | 'taskList'>>;
101
105
  /**
102
106
  * Interface representing the properties for control actions on a task.
103
107
  */
@@ -236,29 +240,31 @@ export interface ControlProps {
236
240
  * @param destinationType
237
241
  * @returns
238
242
  */
239
- consultCall: (consultDestination: string, destinationType: DestinationType) => void;
243
+ consultCall: (consultDestination: string, destinationType: DestinationType, allowParticipantsToInteract: boolean) => void;
240
244
  /**
241
- * Function to end the consult call.
245
+ * Function to merge the consult call in a conference.
242
246
  */
243
- endConsultCall: () => void;
247
+ consultConference: () => void;
244
248
  /**
245
- * Function to transfer the consult call to a destination.
246
- * @param destination - The destination to transfer the consult call to.
247
- * @param destinationType - The type of destination.
249
+ * Function to switch to conference call.
250
+ */
251
+ switchToMainCall: () => void;
252
+ /**
253
+ * Function to switch to consult call.
248
254
  */
249
- consultTransfer: (destination: string, destinationType: DestinationType) => void;
255
+ switchToConsult: () => void;
250
256
  /**
251
- * Flag to determine if the consult call is connecting.
257
+ * Function to exit Conference
252
258
  */
253
- consultInitiated: boolean;
259
+ exitConference: () => void;
254
260
  /**
255
- * Flag to determine if the consult call is connecting.
261
+ * Function to end the consult call.
256
262
  */
257
- consultCompleted: boolean;
263
+ endConsultCall: () => void;
258
264
  /**
259
- * Flag to determine if the consult call is accepted.
265
+ * Function to transfer the consult call to a already established consult.
260
266
  */
261
- consultAccepted: boolean;
267
+ consultTransfer: () => void;
262
268
  /**
263
269
  * Timestamp when the consult call started.
264
270
  */
@@ -268,15 +274,6 @@ export interface ControlProps {
268
274
  * This is used to play audio for the call control.
269
275
  */
270
276
  callControlAudio: MediaStream | null;
271
- /**
272
- * ID of the consulting agent
273
- */
274
- consultAgentId: string;
275
- /**
276
- * Function to set the consulting agent ID
277
- * @param agentId - The ID of the consulting agent.
278
- */
279
- setConsultAgentId: (agentId: string) => void;
280
277
  /**
281
278
  * Name of the consulting agent.
282
279
  */
@@ -324,6 +321,10 @@ export interface ControlProps {
324
321
  * Flag to determine if the consulting to queue is enabled for the agent
325
322
  */
326
323
  allowConsultToQueue: boolean;
324
+ /**
325
+ * Flag to enable or disable conference feature
326
+ */
327
+ conferenceEnabled: boolean;
327
328
  /**
328
329
  * Function to set the last target type
329
330
  */
@@ -332,27 +333,46 @@ export interface ControlProps {
332
333
  * Function to set the last target type
333
334
  */
334
335
  setLastTargetType: (targetType: 'queue' | 'agent') => void;
335
- controlVisibility: {
336
- accept: boolean;
337
- decline: boolean;
338
- end: boolean;
339
- muteUnmute: boolean;
340
- holdResume: boolean;
341
- consult: boolean;
342
- transfer: boolean;
343
- conference: boolean;
344
- wrapup: boolean;
345
- pauseResumeRecording: boolean;
346
- endConsult: boolean;
347
- recordingIndicator: boolean;
348
- };
336
+ controlVisibility: ControlVisibility;
349
337
  secondsUntilAutoWrapup?: number;
350
338
  /**
351
339
  * Function to cancel the auto wrap-up timer.
352
340
  */
353
341
  cancelAutoWrapup: () => void;
342
+ /**
343
+ * List of participants in the conference excluding the agent themselves.
344
+ */
345
+ conferenceParticipants: Participant[];
346
+ /** Fetch paginated address book entries for dial numbers */
347
+ getAddressBookEntries?: FetchPaginatedList<AddressBookEntry>;
348
+ /** Fetch paginated entry points */
349
+ getEntryPoints?: FetchPaginatedList<EntryPointRecord>;
350
+ /** Fetch paginated queues (filtered by media type in store) */
351
+ getQueuesFetcher?: FetchPaginatedList<ContactServiceQueue>;
352
+ /**
353
+ * Options to configure consult/transfer popover behavior.
354
+ */
355
+ consultTransferOptions?: ConsultTransferOptions;
356
+ /**
357
+ * Agent ID of the logged-in user
358
+ */
359
+ agentId: string;
354
360
  }
355
- export type CallControlComponentProps = Pick<ControlProps, 'currentTask' | 'wrapupCodes' | 'toggleHold' | 'toggleRecording' | 'toggleMute' | 'isMuted' | 'endCall' | 'wrapupCall' | 'isHeld' | 'setIsHeld' | 'isRecording' | 'setIsRecording' | 'buddyAgents' | 'loadBuddyAgents' | 'transferCall' | 'consultCall' | 'endConsultCall' | 'consultInitiated' | 'consultTransfer' | 'consultCompleted' | 'consultAccepted' | 'consultStartTimeStamp' | 'callControlAudio' | 'consultAgentName' | 'setConsultAgentName' | 'consultAgentId' | 'setConsultAgentId' | 'holdTime' | 'callControlClassName' | 'callControlConsultClassName' | 'startTimestamp' | 'queues' | 'loadQueues' | 'isEndConsultEnabled' | 'allowConsultToQueue' | 'lastTargetType' | 'setLastTargetType' | 'controlVisibility' | 'logger' | 'secondsUntilAutoWrapup' | 'cancelAutoWrapup'>;
361
+ export type CallControlComponentProps = Pick<ControlProps, 'currentTask' | 'wrapupCodes' | 'toggleHold' | 'toggleRecording' | 'toggleMute' | 'isMuted' | 'endCall' | 'wrapupCall' | 'isRecording' | 'setIsRecording' | 'buddyAgents' | 'loadBuddyAgents' | 'transferCall' | 'consultCall' | 'consultConference' | 'switchToMainCall' | 'switchToConsult' | 'exitConference' | 'endConsultCall' | 'consultTransfer' | 'consultStartTimeStamp' | 'callControlAudio' | 'consultAgentName' | 'setConsultAgentName' | 'holdTime' | 'callControlClassName' | 'callControlConsultClassName' | 'startTimestamp' | 'allowConsultToQueue' | 'lastTargetType' | 'setLastTargetType' | 'controlVisibility' | 'logger' | 'secondsUntilAutoWrapup' | 'cancelAutoWrapup' | 'conferenceParticipants' | 'getAddressBookEntries' | 'getEntryPoints' | 'getQueuesFetcher' | 'consultTransferOptions'>;
362
+ export type OutdialAniEntry = {
363
+ /** Unique identifier for the ANI entry */
364
+ id: string;
365
+ /** Display name for the ANI entry */
366
+ name: string;
367
+ /** Phone number associated with this ANI entry */
368
+ number: string;
369
+ /** Related links for this ANI entry */
370
+ links: string[];
371
+ /** Timestamp when this entry was created (Unix timestamp in milliseconds) */
372
+ createdTime: number;
373
+ /** Timestamp when this entry was last updated (Unix timestamp in milliseconds) */
374
+ lastUpdatedTime: number;
375
+ };
356
376
  /**
357
377
  * Interface representing the properties for OutdialCall component.
358
378
  */
@@ -360,7 +380,11 @@ export interface OutdialCallProps {
360
380
  /**
361
381
  * Function to start outdial call.
362
382
  */
363
- startOutdial: (destination: string) => void;
383
+ startOutdial: (destination: string, origin?: string) => void;
384
+ /**
385
+ * Function to get a list of Outdial ANI entries.
386
+ */
387
+ getOutdialANIEntries: () => Promise<OutdialAniEntry[]>;
364
388
  /**
365
389
  * CC SDK Instance.
366
390
  */
@@ -370,7 +394,7 @@ export interface OutdialCallProps {
370
394
  */
371
395
  logger: ILogger;
372
396
  }
373
- export type OutdialCallComponentProps = Pick<OutdialCallProps, 'startOutdial'>;
397
+ export type OutdialCallComponentProps = Pick<OutdialCallProps, 'logger' | 'startOutdial' | 'getOutdialANIEntries'>;
374
398
  /**
375
399
  * Interface representing the properties for CallControlListItem component.
376
400
  */
@@ -382,6 +406,17 @@ export interface ConsultTransferListComponentProps {
382
406
  className?: string;
383
407
  logger: ILogger;
384
408
  }
409
+ /**
410
+ * Interface representing the properties for CallControlDialNumber component.
411
+ */
412
+ export interface ConsultTransferDialNumberComponentProps {
413
+ title: string;
414
+ subtitle?: string;
415
+ buttonIcon: string;
416
+ onButtonPress: (dialNumber: string) => void;
417
+ className?: string;
418
+ logger: ILogger;
419
+ }
385
420
  /**
386
421
  * Interface representing the properties for ConsultTransferPopover component.
387
422
  */
@@ -389,10 +424,17 @@ export interface ConsultTransferPopoverComponentProps {
389
424
  heading: string;
390
425
  buttonIcon: string;
391
426
  buddyAgents: BuddyDetails[];
392
- queues?: ContactServiceQueue[];
393
- onAgentSelect?: (agentId: string, agentName: string) => void;
394
- onQueueSelect?: (queueId: string, queueName: string) => void;
427
+ getAddressBookEntries?: FetchPaginatedList<AddressBookEntry>;
428
+ getEntryPoints?: FetchPaginatedList<EntryPointRecord>;
429
+ getQueues?: FetchPaginatedList<ContactServiceQueue>;
430
+ onAgentSelect: (agentId: string, agentName: string, allowParticipantsToInteract: boolean) => void;
431
+ onQueueSelect: (queueId: string, queueName: string, allowParticipantsToInteract: boolean) => void;
432
+ onEntryPointSelect: (entryPointId: string, entryPointName: string, allowParticipantsToInteract: boolean) => void;
433
+ onDialNumberSelect: (dialNumber: string, allowParticipantsToInteract: boolean) => void;
395
434
  allowConsultToQueue: boolean;
435
+ /** Options governing popover visibility/behavior */
436
+ consultTransferOptions?: ConsultTransferOptions;
437
+ isConferenceInProgress?: boolean;
396
438
  logger: ILogger;
397
439
  }
398
440
  /**
@@ -401,20 +443,19 @@ export interface ConsultTransferPopoverComponentProps {
401
443
  export interface CallControlConsultComponentsProps {
402
444
  agentName: string;
403
445
  startTimeStamp: number;
404
- onTransfer?: () => void;
405
- endConsultCall?: () => void;
406
- consultCompleted: boolean;
407
- isAgentBeingConsulted: boolean;
408
- isEndConsultEnabled: boolean;
446
+ consultTransfer: () => void;
447
+ endConsultCall: () => void;
448
+ consultConference: () => void;
449
+ switchToMainCall: () => void;
409
450
  logger: ILogger;
410
- muteUnmute: boolean;
411
451
  isMuted: boolean;
412
- onToggleConsultMute?: () => void;
452
+ controlVisibility: ControlVisibility;
453
+ toggleConsultMute: () => void;
413
454
  }
414
455
  /**
415
456
  * Type representing the possible menu types in call control.
416
457
  */
417
- export type CallControlMenuType = 'Consult' | 'Transfer';
458
+ export type CallControlMenuType = 'Consult' | 'Transfer' | 'ExitConference';
418
459
  export declare const MEDIA_CHANNEL: {
419
460
  readonly EMAIL: "email";
420
461
  readonly CHAT: "chat";
@@ -436,6 +477,7 @@ export interface AutoWrapupTimerProps {
436
477
  secondsUntilAutoWrapup: number;
437
478
  allowCancelAutoWrapup?: boolean;
438
479
  handleCancelWrapup: () => void;
480
+ logger?: ILogger;
439
481
  }
440
482
  export interface CallControlButton {
441
483
  id: string;
@@ -448,19 +490,38 @@ export interface CallControlButton {
448
490
  menuType?: CallControlMenuType;
449
491
  dataTestId?: string;
450
492
  }
493
+ export type Visibility = {
494
+ isVisible: boolean;
495
+ isEnabled: boolean;
496
+ };
451
497
  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;
498
+ accept: Visibility;
499
+ decline: Visibility;
500
+ end: Visibility;
501
+ muteUnmute: Visibility;
502
+ muteUnmuteConsult: Visibility;
503
+ holdResume: Visibility;
504
+ consult: Visibility;
505
+ transfer: Visibility;
506
+ conference: Visibility;
507
+ wrapup: Visibility;
508
+ pauseResumeRecording: Visibility;
509
+ endConsult: Visibility;
510
+ recordingIndicator: Visibility;
511
+ exitConference: Visibility;
512
+ mergeConference: Visibility;
513
+ consultTransfer: Visibility;
514
+ mergeConferenceConsult: Visibility;
515
+ consultTransferConsult: Visibility;
516
+ switchToMainCall: Visibility;
517
+ switchToConsult: Visibility;
518
+ isConferenceInProgress: boolean;
519
+ isConsultInitiated: boolean;
520
+ isConsultInitiatedAndAccepted: boolean;
521
+ isConsultReceived: boolean;
522
+ isConsultInitiatedOrAccepted: boolean;
523
+ isHeld: boolean;
524
+ consultCallHeld: boolean;
464
525
  }
465
526
  export interface MediaTypeInfo {
466
527
  labelName: string;
@@ -522,4 +583,52 @@ export declare enum TaskQueue {
522
583
  VIP = "vip",
523
584
  ESCALATION = "escalation"
524
585
  }
586
+ export interface TimerUIState {
587
+ isUrgent: boolean;
588
+ containerClassName: string;
589
+ iconClassName: string;
590
+ iconName: string;
591
+ formattedTime: string;
592
+ }
593
+ /**
594
+ * Categories displayed in Consult/Transfer popover.
595
+ */
596
+ export type CategoryType = 'Agents' | 'Queues' | 'Dial Number' | 'Entry Point';
597
+ /** Category string constants to avoid typos and ease reuse */
598
+ export declare const CATEGORY_DIAL_NUMBER: CategoryType;
599
+ export declare const CATEGORY_ENTRY_POINT: CategoryType;
600
+ export declare const CATEGORY_QUEUES: CategoryType;
601
+ export declare const CATEGORY_AGENTS: CategoryType;
602
+ /**
603
+ * Parameters for `useConsultTransferPopover` hook.
604
+ */
605
+ export type UseConsultTransferParams = {
606
+ showDialNumberTab: boolean;
607
+ showEntryPointTab: boolean;
608
+ getAddressBookEntries?: FetchPaginatedList<AddressBookEntry>;
609
+ getEntryPoints?: FetchPaginatedList<EntryPointRecord>;
610
+ getQueues?: FetchPaginatedList<ContactServiceQueue>;
611
+ logger?: ILogger;
612
+ };
613
+ /**
614
+ * Options to configure Consult/Transfer popover behavior and visibility.
615
+ */
616
+ export interface ConsultTransferOptions {
617
+ /** Show the Dial Number tab. Defaults to true. */
618
+ showDialNumberTab?: boolean;
619
+ /** Show the Entry Point tab. Defaults to true. */
620
+ showEntryPointTab?: boolean;
621
+ }
622
+ /**
623
+ * Interface for button configuration
624
+ */
625
+ export interface ButtonConfig {
626
+ key: string;
627
+ icon: string;
628
+ onClick: () => void;
629
+ tooltip: string;
630
+ className: string;
631
+ disabled?: boolean;
632
+ isVisible: boolean;
633
+ }
525
634
  export {};