@pega/cosmos-react-cs 2.1.6 → 2.1.7
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/lib/components/Article/Article.d.ts +32 -0
- package/lib/components/Article/Article.d.ts.map +1 -0
- package/lib/components/Article/Article.js +51 -0
- package/lib/components/Article/Article.js.map +1 -0
- package/lib/components/Article/ArticleFooter.d.ts +19 -0
- package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
- package/lib/components/Article/ArticleFooter.js +40 -0
- package/lib/components/Article/ArticleFooter.js.map +1 -0
- package/lib/components/Article/ArticleSkeleton.d.ts +8 -0
- package/lib/components/Article/ArticleSkeleton.d.ts.map +1 -0
- package/lib/components/Article/ArticleSkeleton.js +15 -0
- package/lib/components/Article/ArticleSkeleton.js.map +1 -0
- package/lib/components/Article/index.d.ts +6 -0
- package/lib/components/Article/index.d.ts.map +1 -0
- package/lib/components/Article/index.js +3 -0
- package/lib/components/Article/index.js.map +1 -0
- package/lib/components/ArticleList/ArticleList.d.ts +17 -0
- package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleList.js +65 -0
- package/lib/components/ArticleList/ArticleList.js.map +1 -0
- package/lib/components/ArticleList/ArticleListHeader.d.ts +20 -0
- package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleListHeader.js +68 -0
- package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts +14 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.js +30 -0
- package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
- package/lib/components/ArticleList/SummarySkeleton.d.ts +7 -0
- package/lib/components/ArticleList/SummarySkeleton.d.ts.map +1 -0
- package/lib/components/ArticleList/SummarySkeleton.js +9 -0
- package/lib/components/ArticleList/SummarySkeleton.js.map +1 -0
- package/lib/components/ArticleList/index.d.ts +7 -0
- package/lib/components/ArticleList/index.d.ts.map +1 -0
- package/lib/components/ArticleList/index.js +4 -0
- package/lib/components/ArticleList/index.js.map +1 -0
- package/lib/components/CSCaseView/CSCaseView.d.ts +9 -0
- package/lib/components/CSCaseView/CSCaseView.d.ts.map +1 -0
- package/lib/components/CSCaseView/CSCaseView.js +16 -0
- package/lib/components/CSCaseView/CSCaseView.js.map +1 -0
- package/lib/components/CSCaseView/index.d.ts +3 -0
- package/lib/components/CSCaseView/index.d.ts.map +1 -0
- package/lib/components/CSCaseView/index.js +2 -0
- package/lib/components/CSCaseView/index.js.map +1 -0
- package/lib/components/CallControlPanel/Call.d.ts +6 -0
- package/lib/components/CallControlPanel/Call.d.ts.map +1 -0
- package/lib/components/CallControlPanel/Call.js +142 -0
- package/lib/components/CallControlPanel/Call.js.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.d.ts +6 -0
- package/lib/components/CallControlPanel/CallControlPanel.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.js +68 -0
- package/lib/components/CallControlPanel/CallControlPanel.js.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts +15 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.js +118 -0
- package/lib/components/CallControlPanel/CallControlPanel.styles.js.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.types.d.ts +112 -0
- package/lib/components/CallControlPanel/CallControlPanel.types.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanel.types.js +2 -0
- package/lib/components/CallControlPanel/CallControlPanel.types.js.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanelIcon.d.ts +19 -0
- package/lib/components/CallControlPanel/CallControlPanelIcon.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallControlPanelIcon.js +74 -0
- package/lib/components/CallControlPanel/CallControlPanelIcon.js.map +1 -0
- package/lib/components/CallControlPanel/CallTransfer.d.ts +19 -0
- package/lib/components/CallControlPanel/CallTransfer.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CallTransfer.js +121 -0
- package/lib/components/CallControlPanel/CallTransfer.js.map +1 -0
- package/lib/components/CallControlPanel/CalleePicker.d.ts +20 -0
- package/lib/components/CallControlPanel/CalleePicker.d.ts.map +1 -0
- package/lib/components/CallControlPanel/CalleePicker.js +61 -0
- package/lib/components/CallControlPanel/CalleePicker.js.map +1 -0
- package/lib/components/CallControlPanel/ContactsList.d.ts +23 -0
- package/lib/components/CallControlPanel/ContactsList.d.ts.map +1 -0
- package/lib/components/CallControlPanel/ContactsList.js +88 -0
- package/lib/components/CallControlPanel/ContactsList.js.map +1 -0
- package/lib/components/CallControlPanel/DTMFKeypad.d.ts +11 -0
- package/lib/components/CallControlPanel/DTMFKeypad.d.ts.map +1 -0
- package/lib/components/CallControlPanel/DTMFKeypad.js +23 -0
- package/lib/components/CallControlPanel/DTMFKeypad.js.map +1 -0
- package/lib/components/CallControlPanel/StopWatch.d.ts +9 -0
- package/lib/components/CallControlPanel/StopWatch.d.ts.map +1 -0
- package/lib/components/CallControlPanel/StopWatch.js +28 -0
- package/lib/components/CallControlPanel/StopWatch.js.map +1 -0
- package/lib/components/CallControlPanel/index.d.ts +5 -0
- package/lib/components/CallControlPanel/index.d.ts.map +1 -0
- package/lib/components/CallControlPanel/index.js +4 -0
- package/lib/components/CallControlPanel/index.js.map +1 -0
- package/lib/components/CallControlPanel/utils.d.ts +7 -0
- package/lib/components/CallControlPanel/utils.d.ts.map +1 -0
- package/lib/components/CallControlPanel/utils.js +35 -0
- package/lib/components/CallControlPanel/utils.js.map +1 -0
- package/lib/components/DialPad/DialPad.d.ts +16 -0
- package/lib/components/DialPad/DialPad.d.ts.map +1 -0
- package/lib/components/DialPad/DialPad.js +33 -0
- package/lib/components/DialPad/DialPad.js.map +1 -0
- package/lib/components/DialPad/DialPad.types.d.ts +33 -0
- package/lib/components/DialPad/DialPad.types.d.ts.map +1 -0
- package/lib/components/DialPad/DialPad.types.js +2 -0
- package/lib/components/DialPad/DialPad.types.js.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.d.ts +12 -0
- package/lib/components/DialPad/DialPadKeyboard.d.ts.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.js +87 -0
- package/lib/components/DialPad/DialPadKeyboard.js.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.styles.d.ts +5 -0
- package/lib/components/DialPad/DialPadKeyboard.styles.d.ts.map +1 -0
- package/lib/components/DialPad/DialPadKeyboard.styles.js +76 -0
- package/lib/components/DialPad/DialPadKeyboard.styles.js.map +1 -0
- package/lib/components/DialPad/KeyboardNavigation.d.ts +6 -0
- package/lib/components/DialPad/KeyboardNavigation.d.ts.map +1 -0
- package/lib/components/DialPad/KeyboardNavigation.js +156 -0
- package/lib/components/DialPad/KeyboardNavigation.js.map +1 -0
- package/lib/components/DialPad/index.d.ts +3 -0
- package/lib/components/DialPad/index.d.ts.map +1 -0
- package/lib/components/DialPad/index.js +2 -0
- package/lib/components/DialPad/index.js.map +1 -0
- package/lib/components/DialPad/utils.d.ts +4 -0
- package/lib/components/DialPad/utils.d.ts.map +1 -0
- package/lib/components/DialPad/utils.js +7 -0
- package/lib/components/DialPad/utils.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +6 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js +75 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +9 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +142 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +31 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +2 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -0
- package/lib/components/IntelligentGuidance/index.d.ts +3 -0
- package/lib/components/IntelligentGuidance/index.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/index.js +2 -0
- package/lib/components/IntelligentGuidance/index.js.map +1 -0
- package/lib/components/InteractionNotification/InteractionNotification.d.ts +26 -0
- package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -0
- package/lib/components/InteractionNotification/InteractionNotification.js +78 -0
- package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -0
- package/lib/components/InteractionNotification/index.d.ts +2 -0
- package/lib/components/InteractionNotification/index.d.ts.map +1 -0
- package/lib/components/InteractionNotification/index.js +2 -0
- package/lib/components/InteractionNotification/index.js.map +1 -0
- package/lib/components/InteractionTimer/InteractionTimer.d.ts +29 -0
- package/lib/components/InteractionTimer/InteractionTimer.d.ts.map +1 -0
- package/lib/components/InteractionTimer/InteractionTimer.js +72 -0
- package/lib/components/InteractionTimer/InteractionTimer.js.map +1 -0
- package/lib/components/InteractionTimer/index.d.ts +2 -0
- package/lib/components/InteractionTimer/index.d.ts.map +1 -0
- package/lib/components/InteractionTimer/index.js +2 -0
- package/lib/components/InteractionTimer/index.js.map +1 -0
- package/lib/components/TaskManager/Picker/Picker.d.ts +6 -0
- package/lib/components/TaskManager/Picker/Picker.d.ts.map +1 -0
- package/lib/components/TaskManager/Picker/Picker.js +171 -0
- package/lib/components/TaskManager/Picker/Picker.js.map +1 -0
- package/lib/components/TaskManager/Picker/Picker.types.d.ts +27 -0
- package/lib/components/TaskManager/Picker/Picker.types.d.ts.map +1 -0
- package/lib/components/TaskManager/Picker/Picker.types.js +2 -0
- package/lib/components/TaskManager/Picker/Picker.types.js.map +1 -0
- package/lib/components/TaskManager/TaskManager.context.d.ts +5 -0
- package/lib/components/TaskManager/TaskManager.context.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManager.context.js +3 -0
- package/lib/components/TaskManager/TaskManager.context.js.map +1 -0
- package/lib/components/TaskManager/TaskManager.d.ts +6 -0
- package/lib/components/TaskManager/TaskManager.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManager.js +76 -0
- package/lib/components/TaskManager/TaskManager.js.map +1 -0
- package/lib/components/TaskManager/TaskManager.styles.d.ts +20 -0
- package/lib/components/TaskManager/TaskManager.styles.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManager.styles.js +232 -0
- package/lib/components/TaskManager/TaskManager.styles.js.map +1 -0
- package/lib/components/TaskManager/TaskManager.types.d.ts +74 -0
- package/lib/components/TaskManager/TaskManager.types.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManager.types.js +2 -0
- package/lib/components/TaskManager/TaskManager.types.js.map +1 -0
- package/lib/components/TaskManager/TaskManagerTabs.d.ts +6 -0
- package/lib/components/TaskManager/TaskManagerTabs.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskManagerTabs.js +159 -0
- package/lib/components/TaskManager/TaskManagerTabs.js.map +1 -0
- package/lib/components/TaskManager/TaskView.d.ts +6 -0
- package/lib/components/TaskManager/TaskView.d.ts.map +1 -0
- package/lib/components/TaskManager/TaskView.js +10 -0
- package/lib/components/TaskManager/TaskView.js.map +1 -0
- package/lib/components/TaskManager/index.d.ts +5 -0
- package/lib/components/TaskManager/index.d.ts.map +1 -0
- package/lib/components/TaskManager/index.js +4 -0
- package/lib/components/TaskManager/index.js.map +1 -0
- package/lib/index.d.ts +18 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +19 -0
- package/lib/index.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useContext, createRef, useMemo, useRef, useEffect, useState, useLayoutEffect } from 'react';
|
|
4
|
+
import { Flex, useDirection } from '@pega/cosmos-react-core';
|
|
5
|
+
import { useI18n } from '@pega/cosmos-react-core/lib/hooks';
|
|
6
|
+
import { StyledTaskManagerTabs, StyleTaskName, StyledTaskStatus, StyledTasksTabList, StyledTaskManagerTab, StyledOverflowTabMenu } from './TaskManager.styles';
|
|
7
|
+
import TaskManagerContext from './TaskManager.context';
|
|
8
|
+
const TaskManagerTabs = forwardRef((props, ref) => {
|
|
9
|
+
const { wrapUp, tasks = [], onTaskLaunch } = useContext(TaskManagerContext);
|
|
10
|
+
const t = useI18n();
|
|
11
|
+
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
12
|
+
// Used to keep a reference for every tab in order to focus them with key presses
|
|
13
|
+
const tabRefs = tasks.map(() => createRef());
|
|
14
|
+
const wrapUpRef = useRef(null);
|
|
15
|
+
const { rtl } = useDirection();
|
|
16
|
+
const menuTasksArr = useMemo(() => {
|
|
17
|
+
const tasksData = tasks.map(task => {
|
|
18
|
+
return {
|
|
19
|
+
primary: task.name,
|
|
20
|
+
secondary: [
|
|
21
|
+
_jsx(StyledTaskStatus, { variant: task.status?.variant || 'info', children: task.variant }, void 0)
|
|
22
|
+
],
|
|
23
|
+
id: task.id,
|
|
24
|
+
selected: !!task.active,
|
|
25
|
+
onClick: () => {
|
|
26
|
+
onTaskLaunch?.(task.id);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
if (wrapUp?.showTab) {
|
|
31
|
+
tasksData.push({
|
|
32
|
+
primary: t('task_manager_wrap_up'),
|
|
33
|
+
secondary: [],
|
|
34
|
+
id: '',
|
|
35
|
+
selected: !!wrapUp.active,
|
|
36
|
+
onClick: () => {
|
|
37
|
+
wrapUp?.onWrapUp();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return tasksData;
|
|
42
|
+
}, [wrapUp?.showTab, wrapUp?.onWrapUp, wrapUp?.active, tasks]);
|
|
43
|
+
const tabListRef = useRef(null);
|
|
44
|
+
const checkAndUpdateIsOverflowing = () => {
|
|
45
|
+
if (tabListRef.current) {
|
|
46
|
+
const value = tabListRef.current.scrollWidth > tabListRef.current.clientWidth;
|
|
47
|
+
if (value !== isOverflowing) {
|
|
48
|
+
setIsOverflowing(value);
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return isOverflowing;
|
|
53
|
+
};
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
56
|
+
checkAndUpdateIsOverflowing();
|
|
57
|
+
});
|
|
58
|
+
if (tabListRef?.current)
|
|
59
|
+
resizeObserver.observe(tabListRef?.current);
|
|
60
|
+
return () => {
|
|
61
|
+
resizeObserver.disconnect();
|
|
62
|
+
};
|
|
63
|
+
}, [checkAndUpdateIsOverflowing]);
|
|
64
|
+
useLayoutEffect(() => {
|
|
65
|
+
if (!checkAndUpdateIsOverflowing())
|
|
66
|
+
return;
|
|
67
|
+
const activeTabRef = [...tabRefs, wrapUpRef].find(tab => tab?.current?.getAttribute('aria-selected') === 'true');
|
|
68
|
+
if (activeTabRef && activeTabRef.current && tabListRef.current) {
|
|
69
|
+
const activeTabRect = activeTabRef.current.getBoundingClientRect();
|
|
70
|
+
const tabListWidth = tabListRef.current.clientWidth;
|
|
71
|
+
// Check if it is not in view
|
|
72
|
+
if (activeTabRect.left <= 0 || activeTabRect.right >= tabListWidth) {
|
|
73
|
+
tabListRef.current.scrollLeft = rtl
|
|
74
|
+
? -(tabListWidth - (activeTabRef.current.offsetLeft + activeTabRect.width))
|
|
75
|
+
: activeTabRef.current.offsetLeft;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, [tasks, wrapUp]);
|
|
79
|
+
const changeTabFocus = (event, index) => {
|
|
80
|
+
let activeIndex = index;
|
|
81
|
+
if (tasks.length) {
|
|
82
|
+
const { key } = event;
|
|
83
|
+
if (key === 'ArrowRight' || key === 'ArrowDown') {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
let nextIndex;
|
|
86
|
+
if (wrapUpRef?.current === event.currentTarget) {
|
|
87
|
+
nextIndex = 0;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
if (index === tasks.length - 1 && wrapUp?.showTab) {
|
|
91
|
+
wrapUpRef?.current?.focus();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
nextIndex = index + 1 < tasks.length ? index + 1 : 0;
|
|
95
|
+
}
|
|
96
|
+
activeIndex = nextIndex;
|
|
97
|
+
const nextTab = tabRefs[nextIndex]?.current;
|
|
98
|
+
nextTab?.focus();
|
|
99
|
+
}
|
|
100
|
+
else if (key === 'ArrowLeft' || key === 'ArrowUp') {
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
let prevIndex;
|
|
103
|
+
if (wrapUpRef?.current === event.currentTarget) {
|
|
104
|
+
prevIndex = tasks.length - 1;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
if (index === 0 && wrapUp?.showTab) {
|
|
108
|
+
wrapUpRef?.current?.focus();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
prevIndex = index === 0 ? tasks.length - 1 : index - 1;
|
|
112
|
+
}
|
|
113
|
+
const prevTab = tabRefs[prevIndex]?.current;
|
|
114
|
+
activeIndex = prevIndex;
|
|
115
|
+
prevTab?.focus();
|
|
116
|
+
}
|
|
117
|
+
else if (key === 'Enter' || key === ' ') {
|
|
118
|
+
event.preventDefault();
|
|
119
|
+
if (wrapUpRef?.current === event.currentTarget) {
|
|
120
|
+
wrapUp?.onWrapUp();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
onTaskLaunch?.(tasks[activeIndex].id);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
return (_jsx(Flex, { container: true, as: StyledTaskManagerTabs, ref: ref, children: tasks.length > 0 && (_jsxs(_Fragment, { children: [_jsxs(StyledTasksTabList, { role: 'tablist', ref: tabListRef, children: [tasks.map((task, i) => {
|
|
128
|
+
const { id, active = false, variant, status, icon, meta, ...restProps } = task;
|
|
129
|
+
return (_createElement(StyledTaskManagerTab, { ...restProps, ref: tabRefs[i], key: id, onClick: () => onTaskLaunch?.(id), "aria-selected": active, role: 'tab', tabIndex: active ? 0 : -1, onKeyUp: (e) => {
|
|
130
|
+
changeTabFocus(e, i);
|
|
131
|
+
}, onKeyDown: (e) => {
|
|
132
|
+
const { key } = e;
|
|
133
|
+
if (key === 'ArrowRight' ||
|
|
134
|
+
key === 'ArrowDown' ||
|
|
135
|
+
key === 'ArrowLeft' ||
|
|
136
|
+
key === 'ArrowUp' ||
|
|
137
|
+
key === 'Enter' ||
|
|
138
|
+
key === ' ') {
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
}
|
|
141
|
+
}, active: active, variant: variant },
|
|
142
|
+
_jsxs(Flex, { container: { justify: 'start', gap: 1, alignItems: 'center' }, children: [_jsx(StyleTaskName, { children: task.name }, void 0), _jsx(StyledTaskStatus, { variant: task.status?.variant || 'info', children: variant }, void 0)] }, void 0)));
|
|
143
|
+
}), wrapUp?.showTab && (_jsx(StyledTaskManagerTab, { onClick: wrapUp.onWrapUp, variant: 'wrap-up', "aria-selected": wrapUp.active, role: 'tab', active: wrapUp.active, tabIndex: wrapUp.active ? 0 : -1, onKeyUp: (e) => {
|
|
144
|
+
changeTabFocus(e);
|
|
145
|
+
}, onKeyDown: (e) => {
|
|
146
|
+
const { key } = e;
|
|
147
|
+
if (key === 'ArrowRight' ||
|
|
148
|
+
key === 'ArrowDown' ||
|
|
149
|
+
key === 'ArrowLeft' ||
|
|
150
|
+
key === 'ArrowUp') {
|
|
151
|
+
e.preventDefault();
|
|
152
|
+
}
|
|
153
|
+
}, ref: wrapUpRef, children: _jsx("span", { children: t('task_manager_wrap_up') }, void 0) }, void 0))] }, void 0), isOverflowing && (_jsx(StyledOverflowTabMenu, { menu: {
|
|
154
|
+
items: menuTasksArr,
|
|
155
|
+
mode: 'single-select'
|
|
156
|
+
}, icon: 'caret-down', iconOnly: true, variant: 'text', text: t('task_manager_overflow_menu') }, void 0))] }, void 0)) }, void 0));
|
|
157
|
+
});
|
|
158
|
+
export default TaskManagerTabs;
|
|
159
|
+
//# sourceMappingURL=TaskManagerTabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskManagerTabs.js","sourceRoot":"","sources":["../../../src/components/TaskManager/TaskManagerTabs.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EACV,UAAU,EACV,SAAS,EAGT,OAAO,EAEP,MAAM,EACN,SAAS,EACT,QAAQ,EACR,eAAe,EAChB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,IAAI,EAAgB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAE5D,OAAO,EACL,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AAGvD,MAAM,eAAe,GAA2D,UAAU,CACxF,CAAC,KAA4C,EAAE,GAAgC,EAAE,EAAE;IACjF,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC5E,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1D,iFAAiF;IACjF,MAAM,OAAO,GAA+B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,EAAiB,CAAC,CAAC;IACxF,MAAM,SAAS,GAAG,MAAM,CAAgB,IAAI,CAAC,CAAC;IAC9C,MAAM,EAAE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AC,CAAC,CAAC,CAAC,EAChC,OAAO,EAAE,CAAC,CAAgB,EAAE,EAAE;gCAC5B,cAAc,CAAC,CAAC,CAAC,CAAC;4BACpB,CAAC,EACD,SAAS,EAAE,CAAC,CAAgB,EAAE,EAAE;gCAC9B,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;gCAClB,IACE,GAAG,KAAK,YAAY;oCACpB,GAAG,KAAK,WAAW;oCACnB,GAAG,KAAK,WAAW;oCACnB,GAAG,KAAK,SAAS,EACjB;oCACA,CAAC,CAAC,cAAc,EAAE,CAAC;iCACpB;4BACH,CAAC,EACD,GAAG,EAAE,SAAS,YAEd,yBAAO,CAAC,CAAC,sBAAsB,CAAC,WAAQ,WACnB,CACxB,YACkB,EACpB,aAAa,IAAI,CAChB,KAAC,qBAAqB,IACpB,IAAI,EAAE;wBACJ,KAAK,EAAE,YAAY;wBACnB,IAAI,EAAE,eAAe;qBACtB,EACD,IAAI,EAAC,YAAY,EACjB,QAAQ,QACR,OAAO,EAAC,MAAM,EACd,IAAI,EAAE,CAAC,CAAC,4BAA4B,CAAC,WACrC,CACH,YACA,CACJ,WACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n useContext,\n createRef,\n RefObject,\n KeyboardEvent,\n useMemo,\n PropsWithoutRef,\n useRef,\n useEffect,\n useState,\n useLayoutEffect\n} from 'react';\n\nimport { Flex, ForwardProps, useDirection } from '@pega/cosmos-react-core';\nimport { useI18n } from '@pega/cosmos-react-core/lib/hooks';\n\nimport {\n StyledTaskManagerTabs,\n StyleTaskName,\n StyledTaskStatus,\n StyledTasksTabList,\n StyledTaskManagerTab,\n StyledOverflowTabMenu\n} from './TaskManager.styles';\nimport TaskManagerContext from './TaskManager.context';\nimport { TaskManagerTabsProps } from './TaskManager.types';\n\nconst TaskManagerTabs: FunctionComponent<TaskManagerTabsProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<TaskManagerTabsProps>, ref: TaskManagerTabsProps['ref']) => {\n const { wrapUp, tasks = [], onTaskLaunch } = useContext(TaskManagerContext);\n const t = useI18n();\n const [isOverflowing, setIsOverflowing] = useState(false);\n\n // Used to keep a reference for every tab in order to focus them with key presses\n const tabRefs: RefObject<HTMLLIElement>[] = tasks.map(() => createRef<HTMLLIElement>());\n const wrapUpRef = useRef<HTMLLIElement>(null);\n const { rtl } = useDirection();\n const menuTasksArr = useMemo(() => {\n const tasksData = tasks.map(task => {\n return {\n primary: task.name,\n secondary: [\n <StyledTaskStatus variant={task.status?.variant || 'info'}>\n {task.variant}\n </StyledTaskStatus>\n ],\n id: task.id,\n selected: !!task.active,\n onClick: () => {\n onTaskLaunch?.(task.id);\n }\n };\n });\n\n if (wrapUp?.showTab) {\n tasksData.push({\n primary: t('task_manager_wrap_up'),\n secondary: [],\n id: '',\n selected: !!wrapUp.active,\n onClick: () => {\n wrapUp?.onWrapUp();\n }\n });\n }\n\n return tasksData;\n }, [wrapUp?.showTab, wrapUp?.onWrapUp, wrapUp?.active, tasks]);\n\n const tabListRef = useRef<HTMLUListElement>(null);\n\n const checkAndUpdateIsOverflowing = () => {\n if (tabListRef.current) {\n const value = tabListRef.current.scrollWidth > tabListRef.current.clientWidth;\n if (value !== isOverflowing) {\n setIsOverflowing(value);\n return value;\n }\n }\n return isOverflowing;\n };\n\n useEffect(() => {\n const resizeObserver = new ResizeObserver(() => {\n checkAndUpdateIsOverflowing();\n });\n if (tabListRef?.current) resizeObserver.observe(tabListRef?.current as Element);\n return () => {\n resizeObserver.disconnect();\n };\n }, [checkAndUpdateIsOverflowing]);\n\n useLayoutEffect(() => {\n if (!checkAndUpdateIsOverflowing()) return;\n const activeTabRef = [...tabRefs, wrapUpRef].find(\n tab => tab?.current?.getAttribute('aria-selected') === 'true'\n );\n\n if (activeTabRef && activeTabRef.current && tabListRef.current) {\n const activeTabRect = activeTabRef.current.getBoundingClientRect();\n const tabListWidth = tabListRef.current.clientWidth;\n\n // Check if it is not in view\n if (activeTabRect.left <= 0 || activeTabRect.right >= tabListWidth) {\n tabListRef.current.scrollLeft = rtl\n ? -(tabListWidth - (activeTabRef.current.offsetLeft + activeTabRect.width))\n : activeTabRef.current.offsetLeft;\n }\n }\n }, [tasks, wrapUp]);\n\n const changeTabFocus = (event: KeyboardEvent, index?: number): void => {\n let activeIndex = index;\n if (tasks.length) {\n const { key } = event;\n if (key === 'ArrowRight' || key === 'ArrowDown') {\n event.preventDefault();\n let nextIndex;\n if (wrapUpRef?.current === event.currentTarget) {\n nextIndex = 0;\n } else {\n if (index === tasks.length - 1 && wrapUp?.showTab) {\n wrapUpRef?.current?.focus();\n return;\n }\n nextIndex = index! + 1 < tasks.length ? index! + 1 : 0;\n }\n activeIndex = nextIndex;\n const nextTab = tabRefs[nextIndex]?.current;\n nextTab?.focus();\n } else if (key === 'ArrowLeft' || key === 'ArrowUp') {\n event.preventDefault();\n let prevIndex;\n if (wrapUpRef?.current === event.currentTarget) {\n prevIndex = tasks.length - 1;\n } else {\n if (index === 0 && wrapUp?.showTab) {\n wrapUpRef?.current?.focus();\n return;\n }\n prevIndex = index === 0 ? tasks.length - 1 : index! - 1;\n }\n const prevTab = tabRefs[prevIndex]?.current;\n activeIndex = prevIndex;\n prevTab?.focus();\n } else if (key === 'Enter' || key === ' ') {\n event.preventDefault();\n if (wrapUpRef?.current === event.currentTarget) {\n wrapUp?.onWrapUp();\n return;\n }\n onTaskLaunch?.(tasks[activeIndex!].id);\n }\n }\n };\n\n return (\n <Flex container as={StyledTaskManagerTabs} ref={ref}>\n {tasks.length > 0 && (\n <>\n <StyledTasksTabList role='tablist' ref={tabListRef}>\n {tasks.map((task, i) => {\n const { id, active = false, variant, status, icon, meta, ...restProps } = task;\n return (\n <StyledTaskManagerTab\n {...restProps}\n ref={tabRefs[i]}\n key={id}\n onClick={() => onTaskLaunch?.(id)}\n aria-selected={active}\n role='tab'\n tabIndex={active ? 0 : -1}\n onKeyUp={(e: KeyboardEvent) => {\n changeTabFocus(e, i);\n }}\n onKeyDown={(e: KeyboardEvent) => {\n const { key } = e;\n if (\n key === 'ArrowRight' ||\n key === 'ArrowDown' ||\n key === 'ArrowLeft' ||\n key === 'ArrowUp' ||\n key === 'Enter' ||\n key === ' '\n ) {\n e.preventDefault();\n }\n }}\n active={active}\n variant={variant}\n >\n <Flex container={{ justify: 'start', gap: 1, alignItems: 'center' }}>\n <StyleTaskName>{task.name}</StyleTaskName>\n <StyledTaskStatus variant={task.status?.variant || 'info'}>\n {variant}\n </StyledTaskStatus>\n </Flex>\n </StyledTaskManagerTab>\n );\n })}\n {wrapUp?.showTab && (\n <StyledTaskManagerTab\n onClick={wrapUp.onWrapUp}\n variant='wrap-up'\n aria-selected={wrapUp.active}\n role='tab'\n active={wrapUp.active}\n tabIndex={wrapUp.active ? 0 : -1}\n onKeyUp={(e: KeyboardEvent) => {\n changeTabFocus(e);\n }}\n onKeyDown={(e: KeyboardEvent) => {\n const { key } = e;\n if (\n key === 'ArrowRight' ||\n key === 'ArrowDown' ||\n key === 'ArrowLeft' ||\n key === 'ArrowUp'\n ) {\n e.preventDefault();\n }\n }}\n ref={wrapUpRef}\n >\n <span>{t('task_manager_wrap_up')}</span>\n </StyledTaskManagerTab>\n )}\n </StyledTasksTabList>\n {isOverflowing && (\n <StyledOverflowTabMenu\n menu={{\n items: menuTasksArr,\n mode: 'single-select'\n }}\n icon='caret-down'\n iconOnly\n variant='text'\n text={t('task_manager_overflow_menu')}\n />\n )}\n </>\n )}\n </Flex>\n );\n }\n);\n\nexport default TaskManagerTabs;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FunctionComponent } from 'react';
|
|
2
|
+
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import { TaskViewProps } from './TaskManager.types';
|
|
4
|
+
declare const TaskView: FunctionComponent<TaskViewProps & ForwardProps>;
|
|
5
|
+
export default TaskView;
|
|
6
|
+
//# sourceMappingURL=TaskView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskView.d.ts","sourceRoot":"","sources":["../../../src/components/TaskManager/TaskView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAiC,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGpD,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAa7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Card, CardContent, CardHeader } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledStickyCardHeader } from './TaskManager.styles';
|
|
5
|
+
const TaskView = forwardRef((props, ref) => {
|
|
6
|
+
const { header, actions, children, ...restProps } = props;
|
|
7
|
+
return (_jsxs(Card, { ...restProps, ref: ref, children: [_jsxs(CardHeader, { as: StyledStickyCardHeader, children: [header, actions] }, void 0), _jsx(CardContent, { children: children }, void 0)] }, void 0));
|
|
8
|
+
});
|
|
9
|
+
export default TaskView;
|
|
10
|
+
//# sourceMappingURL=TaskView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TaskView.js","sourceRoot":"","sources":["../../../src/components/TaskManager/TaskView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAmB,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAgB,MAAM,yBAAyB,CAAC;AAGtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,QAAQ,GAAoD,UAAU,CAC1E,CAAC,KAAqC,EAAE,GAAyB,EAAE,EAAE;IACnE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAC1D,OAAO,CACL,MAAC,IAAI,OAAK,SAAS,EAAE,GAAG,EAAE,GAAG,aAC3B,MAAC,UAAU,IAAC,EAAE,EAAE,sBAAsB,aACnC,MAAM,EACN,OAAO,YACG,EACb,KAAC,WAAW,cAAE,QAAQ,WAAe,YAChC,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, PropsWithoutRef } from 'react';\n\nimport { Card, CardContent, CardHeader, ForwardProps } from '@pega/cosmos-react-core';\n\nimport { TaskViewProps } from './TaskManager.types';\nimport { StyledStickyCardHeader } from './TaskManager.styles';\n\nconst TaskView: FunctionComponent<TaskViewProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<TaskViewProps>, ref: TaskViewProps['ref']) => {\n const { header, actions, children, ...restProps } = props;\n return (\n <Card {...restProps} ref={ref}>\n <CardHeader as={StyledStickyCardHeader}>\n {header}\n {actions}\n </CardHeader>\n <CardContent>{children}</CardContent>\n </Card>\n );\n }\n);\n\nexport default TaskView;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default } from './TaskManager';
|
|
2
|
+
export { default as TaskView } from './TaskView';
|
|
3
|
+
export { TaskManagerProps, TaskProps, TaskManagerTabsProps, TaskViewProps } from './TaskManager.types';
|
|
4
|
+
export { default as Picker } from './Picker/Picker';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/TaskManager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,aAAa,EACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TaskManager/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAOjD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["export { default } from './TaskManager';\nexport { default as TaskView } from './TaskView';\nexport {\n TaskManagerProps,\n TaskProps,\n TaskManagerTabsProps,\n TaskViewProps\n} from './TaskManager.types';\nexport { default as Picker } from './Picker/Picker';\n"]}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { default as Article } from './components/Article';
|
|
2
|
+
export * from './components/Article';
|
|
3
|
+
export { default as ArticleList } from './components/ArticleList';
|
|
4
|
+
export * from './components/ArticleList';
|
|
5
|
+
export { default as CallControlPanel } from './components/CallControlPanel';
|
|
6
|
+
export * from './components/CallControlPanel';
|
|
7
|
+
export { default as CSCaseView } from './components/CSCaseView';
|
|
8
|
+
export * from './components/CSCaseView';
|
|
9
|
+
export { default as DialPad } from './components/DialPad';
|
|
10
|
+
export * from './components/DialPad';
|
|
11
|
+
export { default as IntelligentGuidance } from './components/IntelligentGuidance';
|
|
12
|
+
export * from './components/IntelligentGuidance';
|
|
13
|
+
export { default as InteractionNotification } from './components/InteractionNotification';
|
|
14
|
+
export { default as InteractionTimer } from './components/InteractionTimer';
|
|
15
|
+
export * from './components/InteractionTimer';
|
|
16
|
+
export { default as TaskManager } from './components/TaskManager';
|
|
17
|
+
export * from './components/TaskManager';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAClF,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,0BAA0B,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// This file is autogenerated. Any changes will be overwritten.
|
|
2
|
+
export { default as Article } from './components/Article';
|
|
3
|
+
export * from './components/Article';
|
|
4
|
+
export { default as ArticleList } from './components/ArticleList';
|
|
5
|
+
export * from './components/ArticleList';
|
|
6
|
+
export { default as CallControlPanel } from './components/CallControlPanel';
|
|
7
|
+
export * from './components/CallControlPanel';
|
|
8
|
+
export { default as CSCaseView } from './components/CSCaseView';
|
|
9
|
+
export * from './components/CSCaseView';
|
|
10
|
+
export { default as DialPad } from './components/DialPad';
|
|
11
|
+
export * from './components/DialPad';
|
|
12
|
+
export { default as IntelligentGuidance } from './components/IntelligentGuidance';
|
|
13
|
+
export * from './components/IntelligentGuidance';
|
|
14
|
+
export { default as InteractionNotification } from './components/InteractionNotification';
|
|
15
|
+
export { default as InteractionTimer } from './components/InteractionTimer';
|
|
16
|
+
export * from './components/InteractionTimer';
|
|
17
|
+
export { default as TaskManager } from './components/TaskManager';
|
|
18
|
+
export * from './components/TaskManager';
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAClF,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,0BAA0B,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\nexport { default as Article } from './components/Article';\nexport * from './components/Article';\nexport { default as ArticleList } from './components/ArticleList';\nexport * from './components/ArticleList';\nexport { default as CallControlPanel } from './components/CallControlPanel';\nexport * from './components/CallControlPanel';\nexport { default as CSCaseView } from './components/CSCaseView';\nexport * from './components/CSCaseView';\nexport { default as DialPad } from './components/DialPad';\nexport * from './components/DialPad';\nexport { default as IntelligentGuidance } from './components/IntelligentGuidance';\nexport * from './components/IntelligentGuidance';\nexport { default as InteractionNotification } from './components/InteractionNotification';\nexport { default as InteractionTimer } from './components/InteractionTimer';\nexport * from './components/InteractionTimer';\nexport { default as TaskManager } from './components/TaskManager';\nexport * from './components/TaskManager';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-cs",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.7",
|
|
4
4
|
"author": "Pegasystems",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "2.1.
|
|
24
|
-
"@pega/cosmos-react-dnd": "2.1.
|
|
23
|
+
"@pega/cosmos-react-core": "2.1.7",
|
|
24
|
+
"@pega/cosmos-react-dnd": "2.1.7",
|
|
25
25
|
"polished": "^4.1.0",
|
|
26
26
|
"react": "^16.14.0 || ^17.0.0",
|
|
27
27
|
"react-dom": "^16.14.0 || ^17.0.0",
|