@pega/cosmos-react-work 9.0.0-build.29.2 → 9.0.0-build.29.21
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/CaseHierarchy/CaseHierarchy.d.ts +2 -2
- package/lib/components/CaseHierarchy/CaseHierarchy.d.ts.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.js +3 -3
- package/lib/components/CaseHierarchy/CaseHierarchy.js.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.styles.d.ts.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.styles.js +9 -7
- package/lib/components/CaseHierarchy/CaseHierarchy.styles.js.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.d.ts +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.d.ts.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.js +2 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.js.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.types.d.ts +7 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.types.d.ts.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.types.js.map +1 -1
- package/lib/components/CasePreview/CasePreview.d.ts +1 -1
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +5 -4
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.js +24 -4
- package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +1 -1
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.styles.js +69 -65
- package/lib/components/CaseView/CaseView.styles.js.map +1 -1
- package/lib/components/CaseView/CaseView.types.d.ts +9 -3
- package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.types.js.map +1 -1
- package/lib/components/GenAICoach/CaseWorkflow.d.ts.map +1 -1
- package/lib/components/GenAICoach/CaseWorkflow.js +5 -4
- package/lib/components/GenAICoach/CaseWorkflow.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.js +57 -7
- package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js +23 -23
- package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts +2 -0
- package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
- package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts.map +1 -1
- package/lib/components/HierarchicalAssignments/Assignments.styles.js +0 -1
- package/lib/components/HierarchicalAssignments/Assignments.styles.js.map +1 -1
- package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts +2 -0
- package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts.map +1 -1
- package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.js.map +1 -1
- package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts +1 -1
- package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts.map +1 -1
- package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js +2 -2
- package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js.map +1 -1
- package/lib/components/Tasks/TaskList.d.ts +3 -1
- package/lib/components/Tasks/TaskList.d.ts.map +1 -1
- package/lib/components/Tasks/TaskList.js +2 -2
- package/lib/components/Tasks/TaskList.js.map +1 -1
- package/lib/components/Tasks/Tasks.d.ts +5 -0
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +29 -5
- package/lib/components/Tasks/Tasks.js.map +1 -1
- package/package.json +4 -4
|
@@ -36,7 +36,7 @@ export const AgentIcon = () => {
|
|
|
36
36
|
};
|
|
37
37
|
export const AISuggestedBadge = () => {
|
|
38
38
|
const t = useI18n();
|
|
39
|
-
return (_jsxs(StyledAISuggestedBadge, { container: { alignItems: 'center', gap: 0.5 }, children: [_jsx(Icon, { name: 'polaris-solid', "aria-hidden": true }), _jsx(Text, { children: t('ai_suggestion') })] }));
|
|
39
|
+
return (_jsxs(StyledAISuggestedBadge, { container: { alignItems: 'center', gap: 0.5 }, children: [_jsx(Icon, { name: 'polaris-solid', "aria-hidden": true, size: 'font-size' }), _jsx(Text, { children: t('ai_suggestion') })] }));
|
|
40
40
|
};
|
|
41
41
|
const HeaderActions = ({ actions, allowFullScreen, variant, isUserTriggeredRef, onFullscreenToggle, isFullscreen, selectedCoach, actionsTestId }) => {
|
|
42
42
|
const t = useI18n();
|
|
@@ -71,7 +71,7 @@ const HeaderActions = ({ actions, allowFullScreen, variant, isUserTriggeredRef,
|
|
|
71
71
|
return null;
|
|
72
72
|
return (_jsx(Actions, { ...(actions ?? {}), menuAt: 1, "data-testid": actionsTestId, contextualLabel: selectedCoach, items: mergedItems }));
|
|
73
73
|
};
|
|
74
|
-
const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, onNewChat, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation = true, isPortalAgent = false, pagePanel, suggestionCardsView, draftMessage, caseWorkflow, activeCases, onStop, isCreatingConversation, questionnaireData, onQuestionnaireDismiss, ...restProps }) => {
|
|
74
|
+
const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, onNewChat, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation = true, isPortalAgent = false, pagePanel, suggestionCardsView, draftMessage, caseWorkflow, activeCases, onStop, isCreatingConversation, conversationError, questionnaireData, onQuestionnaireDismiss, ...restProps }) => {
|
|
75
75
|
const scrollTolerancePx = 2;
|
|
76
76
|
const scrollThresholdPx = 50;
|
|
77
77
|
const streamBufferLh = 5;
|
|
@@ -113,7 +113,9 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
113
113
|
const observersRef = useRef({
|
|
114
114
|
inputContainer: null,
|
|
115
115
|
messageContainer: null,
|
|
116
|
-
streamingMessage: null
|
|
116
|
+
streamingMessage: null,
|
|
117
|
+
tileSync: null,
|
|
118
|
+
tileMutation: null
|
|
117
119
|
});
|
|
118
120
|
const isSmallOrAbove = useBreakpoint('sm', {
|
|
119
121
|
breakpointRef: genAICoachRef
|
|
@@ -311,6 +313,53 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
311
313
|
lastMessage.focus();
|
|
312
314
|
}
|
|
313
315
|
}, [scrollToLatest]);
|
|
316
|
+
const suggestionCardsViewElRef = useRef(null);
|
|
317
|
+
const setSuggestionCardsViewRef = useCallback((el) => {
|
|
318
|
+
if (suggestionCardsViewElRef.current === el)
|
|
319
|
+
return;
|
|
320
|
+
observersRef.current.tileSync?.disconnect();
|
|
321
|
+
observersRef.current.tileSync = null;
|
|
322
|
+
observersRef.current.tileMutation?.disconnect();
|
|
323
|
+
observersRef.current.tileMutation = null;
|
|
324
|
+
suggestionCardsViewElRef.current = el;
|
|
325
|
+
if (!el)
|
|
326
|
+
return;
|
|
327
|
+
const tileSelector = '[data-tile-content]';
|
|
328
|
+
let scheduled = false;
|
|
329
|
+
const measure = () => {
|
|
330
|
+
const tileContents = Array.from(el.querySelectorAll(tileSelector));
|
|
331
|
+
if (tileContents.length === 0) {
|
|
332
|
+
el.style.removeProperty('--tile-col-track');
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
tileContents.forEach(tileEl => {
|
|
336
|
+
tileEl.style.width = 'auto';
|
|
337
|
+
});
|
|
338
|
+
const maxWidth = Math.max(...tileContents.map(tileEl => Math.round(tileEl.getBoundingClientRect().width)));
|
|
339
|
+
tileContents.forEach(tileEl => {
|
|
340
|
+
tileEl.style.width = '';
|
|
341
|
+
});
|
|
342
|
+
const newTrack = `${maxWidth}px`;
|
|
343
|
+
if (el.style.getPropertyValue('--tile-col-track') !== newTrack) {
|
|
344
|
+
el.style.setProperty('--tile-col-track', newTrack);
|
|
345
|
+
}
|
|
346
|
+
};
|
|
347
|
+
const schedule = () => {
|
|
348
|
+
if (scheduled)
|
|
349
|
+
return;
|
|
350
|
+
scheduled = true;
|
|
351
|
+
requestAnimationFrame(() => {
|
|
352
|
+
scheduled = false;
|
|
353
|
+
measure();
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
const ro = new ResizeObserver(() => schedule());
|
|
357
|
+
ro.observe(el);
|
|
358
|
+
observersRef.current.tileSync = ro;
|
|
359
|
+
const mo = new MutationObserver(() => schedule());
|
|
360
|
+
mo.observe(el, { childList: true, subtree: true });
|
|
361
|
+
observersRef.current.tileMutation = mo;
|
|
362
|
+
}, []);
|
|
314
363
|
const setInputContainerRef = useCallback((el) => {
|
|
315
364
|
if (inputContainerRef.current === el)
|
|
316
365
|
return;
|
|
@@ -464,9 +513,10 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
464
513
|
}
|
|
465
514
|
}, [questionnaireData]);
|
|
466
515
|
useEffect(() => {
|
|
467
|
-
if (
|
|
516
|
+
if (draftMessage !== undefined) {
|
|
468
517
|
setMessage(draftMessage);
|
|
469
|
-
|
|
518
|
+
if (suggestionCardsView || draftMessage)
|
|
519
|
+
textAreaRef.current?.focus();
|
|
470
520
|
}
|
|
471
521
|
}, [draftMessage, suggestionCardsView]);
|
|
472
522
|
useEffect(() => {
|
|
@@ -661,7 +711,7 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
661
711
|
if (!(e.relatedTarget instanceof Node) || !e.currentTarget.contains(e.relatedTarget)) {
|
|
662
712
|
setFocused(false);
|
|
663
713
|
}
|
|
664
|
-
}, children: [questionnaireData && !questionnaireDismissed && !questionnaireData.inline && (_jsx(Questionnaire, { data: questionnaireData, onChange: handleFormChange, onCancel: handleFormCancel }, questionnaireKey)), _jsx(FormField, { label: t('message_pega_gen_ai_coach'), labelHidden: true, labelFor: composerId, children: _jsx(StyledGenAIFormControl, { focused: (!questionnaireData || questionnaireDismissed) && focused, children: _jsxs(Flex, { container: { direction: 'column', gap: 0.25 }, children: [_jsx(StyledGenAITextArea, { id: composerId, ref: textAreaRef, value: interimMessage ? `${message}${interimMessage}` : message, placeholder: t('write_message'), onKeyDown: handleEnterKeyDown, onChange: handleTextAreaChange, onFocus: () => {
|
|
714
|
+
}, children: [questionnaireData && !questionnaireDismissed && !questionnaireData.inline && (_jsx(Questionnaire, { data: questionnaireData, onChange: handleFormChange, onCancel: handleFormCancel }, questionnaireKey)), _jsx(FormField, { label: t('message_pega_gen_ai_coach'), labelHidden: true, labelFor: composerId, info: conversationError || undefined, status: conversationError ? 'error' : undefined, children: _jsx(StyledGenAIFormControl, { focused: (!questionnaireData || questionnaireDismissed) && focused, status: conversationError ? 'error' : undefined, children: _jsxs(Flex, { container: { direction: 'column', gap: 0.25 }, children: [_jsx(StyledGenAITextArea, { id: composerId, ref: textAreaRef, value: interimMessage ? `${message}${interimMessage}` : message, placeholder: t('write_message'), onKeyDown: handleEnterKeyDown, onChange: handleTextAreaChange, onFocus: () => {
|
|
665
715
|
if (active)
|
|
666
716
|
stop();
|
|
667
717
|
}, autoResize: true }), _jsxs(Flex, { container: {
|
|
@@ -877,7 +927,7 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
877
927
|
}, ...(prevFullScreen !== fullScreen ? { animationInitialCursorPos } : {}) }));
|
|
878
928
|
}) })) })) }), showScrollToBottom && (_jsx(StyledScrollButton, { ref: scrollButtonRef, icon: true, onClick: handleScrollToBottomClick, ariaLabel: t('scroll_to_latest_message'), onKeyDown: focusLastMessageLi, children: _jsx(Icon, { name: 'caret-down' }) })), !loading && messages.length === 0 && suggestionCardsView ? (_jsxs(_Fragment, { children: [((isInUtilities(variant) && variant.state !== 'minimized') ||
|
|
879
929
|
!isInUtilities(variant)) &&
|
|
880
|
-
!guidedMode && (_jsx(StyledStickyComposer, { children: _jsx(Flex, { container: { direction: 'column' }, as: StyledInputContainer, ref: setInputContainerRef, children: _jsx(StyledComposerSection, { children: genAIFooter }) }) })), _jsx(Flex, { container: { direction: 'column' }, as: StyledSuggestionCardsBottomHalf, children: _jsx(StyledSuggestionCardsView, { children: suggestionCardsView }) })] })) : (((isInUtilities(variant) && variant.state !== 'minimized') ||
|
|
930
|
+
!guidedMode && (_jsx(StyledStickyComposer, { children: _jsx(Flex, { container: { direction: 'column' }, as: StyledInputContainer, ref: setInputContainerRef, children: _jsx(StyledComposerSection, { children: genAIFooter }) }) })), _jsx(Flex, { container: { direction: 'column' }, as: StyledSuggestionCardsBottomHalf, children: _jsx(StyledSuggestionCardsView, { ref: setSuggestionCardsViewRef, children: suggestionCardsView }) })] })) : (((isInUtilities(variant) && variant.state !== 'minimized') ||
|
|
881
931
|
!isInUtilities(variant)) &&
|
|
882
932
|
!loading && (_jsx(Flex, { container: { direction: 'column' }, as: StyledInputContainer, ref: setInputContainerRef, children: _jsxs(StyledComposerSection, { children: [guidedMode &&
|
|
883
933
|
questionnaireData &&
|