@pega/cosmos-react-work 10.0.0-build.5.9 → 10.0.0-build.7.0

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 (25) hide show
  1. package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
  2. package/lib/components/GenAICoach/GenAICoach.js +27 -17
  3. package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
  4. package/lib/components/GenAICoach/GenAICoach.styles.d.ts +4 -0
  5. package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
  6. package/lib/components/GenAICoach/GenAICoach.styles.js +41 -17
  7. package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
  8. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts +5 -1
  9. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts.map +1 -1
  10. package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.js.map +1 -1
  11. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts +5 -1
  12. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts.map +1 -1
  13. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js +25 -15
  14. package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js.map +1 -1
  15. package/lib/components/Tasks/TaskCards.d.ts.map +1 -1
  16. package/lib/components/Tasks/TaskCards.js +4 -3
  17. package/lib/components/Tasks/TaskCards.js.map +1 -1
  18. package/lib/components/Tasks/TaskList.d.ts +3 -1
  19. package/lib/components/Tasks/TaskList.d.ts.map +1 -1
  20. package/lib/components/Tasks/TaskList.js +3 -2
  21. package/lib/components/Tasks/TaskList.js.map +1 -1
  22. package/lib/components/Tasks/Tasks.d.ts.map +1 -1
  23. package/lib/components/Tasks/Tasks.js +1 -1
  24. package/lib/components/Tasks/Tasks.js.map +1 -1
  25. package/package.json +4 -5
@@ -1 +1 @@
1
- {"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AA6GA,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;AAyChF,eAAO,MAAM,SAAS,+CA2GrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAQ5B,CAAC;iCAk7DyB,eAAe;;;AAQ1C,wBAA6D"}
1
+ {"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AA8GA,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;AAyChF,eAAO,MAAM,SAAS,+CA2GrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAQ5B,CAAC;iCAi8DyB,eAAe;;;AAQ1C,wBAA6D"}
@@ -19,7 +19,7 @@ import * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icon
19
19
  import * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';
20
20
  import { getGenAICoachTestIds } from './GenAICoach.test-ids';
21
21
  import { getSelectedKeys, isCoachMessage, isInUtilities, isUserMessage } from './GenAICoach.utils';
22
- import { StyledMessagesContainer, StyledDisclaimerText, StyledGenAICoachContainer, StyledGenAIOptionsMenu, StyledInitialMessageContainer, StyledInputContainer, StyledMenuSuggestions, StyledMessagesList, StyledGridContainer, StyledFlexWrapper, StyledErrorContainer, StyledInput, StyledGuidedSuggestions, StyledComposerSection, StyledSendButton, StyledStopGeneratingButton, StyledGenAIFormControl, StyledGenAITextArea, StyledInitialMessageGrid, StyledGenAIFooter, StyledAgentIcon, StyledActionsContainer, StyledHeaderContainer, StyledFullscreenWrapper, StyledScrollButton, StyledSuggestionCardsView, StyledSuggestionCardsBottomHalf, StyledStickyComposer, StyledAISuggestedBadge, StyledSalutation, StyledSubHeading, StyledComposerWrapper, StyledBannerSalutationBlock, StyledComposerSelector } from './GenAICoach.styles';
22
+ import { StyledMessagesContainer, StyledDisclaimerText, StyledGenAICoachContainer, StyledGenAIOptionsMenu, StyledInitialMessageContainer, StyledInputContainer, StyledMenuSuggestions, StyledMessagesList, StyledGridContainer, StyledFlexWrapper, StyledErrorContainer, StyledInput, StyledGuidedSuggestions, StyledComposerSection, StyledSendButton, StyledStopGeneratingButton, StyledGenAIFormControl, StyledGenAITextArea, StyledInitialMessageGrid, StyledGenAIFooter, StyledAgentIcon, StyledActionsContainer, StyledHeaderContainer, StyledFullscreenWrapper, StyledScrollButton, StyledSuggestionCardsView, StyledSuggestionCardsBottomHalf, StyledStickyComposer, StyledAISuggestedBadge, StyledSalutation, StyledSubHeading, StyledComposerWrapper, StyledBannerSalutationBlock, StyledComposerSelector, StyledSimplifiedInitialMessageGrid } from './GenAICoach.styles';
23
23
  import ActiveCases from './ActiveCases';
24
24
  import CaseWorkflow from './CaseWorkflow';
25
25
  import ConversationHistory from './ConversationHistory';
@@ -849,14 +849,36 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
849
849
  const getGridColumns = () => {
850
850
  const multiCol = 'repeat(auto-fit, minmax(calc(100% / 4 - 1rem), 1fr))';
851
851
  const singleCol = '1fr';
852
- return !isSmallOrAbove ? singleCol : multiCol;
852
+ return simplifiedAgent || !isSmallOrAbove ? singleCol : multiCol;
853
853
  };
854
854
  useEffect(() => {
855
855
  if (voiceToTextError) {
856
856
  push({ content: voiceToTextError });
857
857
  }
858
858
  }, [voiceToTextError]);
859
- const genAIFooter = (_jsxs(Flex, { container: { direction: 'column' }, as: StyledGenAIFooter, children: [_jsxs(StyledComposerWrapper, { focused: focused, hasQuestionnaire: !!questionnaireData && !questionnaireDismissed, onFocus: () => setFocused(true), onBlur: e => {
859
+ const showStaticSuggestions = !loading &&
860
+ !error &&
861
+ (agentInBanner ? showInitialScreen : messages.length === 0) &&
862
+ initialSuggestedMessages &&
863
+ initialSuggestedMessages.length > 0;
864
+ const staticSuggestions = showStaticSuggestions && (_jsx(Grid, { as: agentInBanner ? StyledSimplifiedInitialMessageGrid : StyledInitialMessageGrid, container: {
865
+ cols: getGridColumns(),
866
+ gap: simplifiedAgent ? 0.75 : 1.5,
867
+ justifyItems: agentInBanner ? 'start' : undefined
868
+ }, children: initialSuggestedMessages.map(initialSuggestedMessage => (_jsx(InitialSuggestedMessage, { ...initialSuggestedMessage, onSend: initialMessage => {
869
+ if (guidedMode) {
870
+ onSend({
871
+ id: initialMessage.id,
872
+ message: initialMessage.message
873
+ });
874
+ }
875
+ else {
876
+ setMessage(initialMessage.message ?? '');
877
+ }
878
+ isUserTriggered.current = true;
879
+ textAreaRef.current?.focus();
880
+ }, testId: initialSuggestedMessage.id }))) }));
881
+ const genAIFooter = (_jsxs(Flex, { container: { direction: 'column' }, as: StyledGenAIFooter, children: [_jsxs(StyledComposerWrapper, { focused: focused, hasQuestionnaire: !!questionnaireData && !questionnaireDismissed, "$agentInBanner": agentInBanner, onFocus: () => setFocused(true), onBlur: e => {
860
882
  if (!(e.relatedTarget instanceof Node) || !e.currentTarget.contains(e.relatedTarget)) {
861
883
  setFocused(false);
862
884
  }
@@ -933,7 +955,7 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
933
955
  }, children: [t('generating_response'), _jsx(Progress, { placement: 'inline' })] }));
934
956
  }
935
957
  return sendButton;
936
- })()] })] }) }) })] }), attachments && attachments.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Flex, { as: FileList, type: 'item', "aria-label": `${t('attachments')}`, items: attachments, container: { pad: [1, 0] } }), attachmentsError && (_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, as: StyledErrorContainer, children: [_jsx(Icon, { name: 'warn-solid' }), _jsx(VisuallyHiddenText, { children: `${t('error')} ` }), attachmentsError] }))] })), hasAgentResponse && (_jsx(Flex, { container: { justify: 'center' }, children: _jsx(StyledDisclaimerText, { inFullPage: !condition, children: t('ai_disclaimer') }) }))] }));
958
+ })()] })] }) }) }), agentInBanner && !guidedMode && staticSuggestions] }), attachments && attachments.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Flex, { as: FileList, type: 'item', "aria-label": `${t('attachments')}`, items: attachments, container: { pad: [1, 0] } }), attachmentsError && (_jsxs(Flex, { container: { gap: 1, alignItems: 'center' }, as: StyledErrorContainer, children: [_jsx(Icon, { name: 'warn-solid' }), _jsx(VisuallyHiddenText, { children: `${t('error')} ` }), attachmentsError] }))] })), hasAgentResponse && (_jsx(Flex, { container: { justify: 'center' }, children: _jsx(StyledDisclaimerText, { inFullPage: !condition, children: t('ai_disclaimer') }) }))] }));
937
959
  const isCompact = variant.placement === 'fullpage' &&
938
960
  !fullScreen &&
939
961
  !isInLandingPageUtilities &&
@@ -965,19 +987,7 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
965
987
  alignItems: 'center',
966
988
  gap: simplifiedAgent ? 2.5 : 2,
967
989
  pad: simplifiedAgent ? [0, 2, 1, 2] : [0, 2]
968
- }, as: simplifiedAgent ? StyledBannerSalutationBlock : undefined, isExpanded: agentExpanded, children: [!simplifiedAgent && _jsx(AgentIcon, {}), _jsx(StyledSalutation, { variant: simplifiedAgent ? 'h1' : 'h3', simplified: simplifiedAgent, children: salutation ?? t('welcome_text') }), simplifiedAgent && (_jsx(StyledSubHeading, { variant: 'primary', as: 'p', children: subHeading ?? t('what_can_i_help_you_with') }))] })), initialSuggestedMessages && initialSuggestedMessages.length > 0 && (_jsx(Grid, { as: StyledInitialMessageGrid, container: { cols: getGridColumns(), gap: 1.5 }, children: initialSuggestedMessages.map(initialSuggestedMessage => (_jsx(InitialSuggestedMessage, { ...initialSuggestedMessage, onSend: initialMessage => {
969
- if (guidedMode) {
970
- onSend({
971
- id: initialMessage.id,
972
- message: initialMessage.message
973
- });
974
- }
975
- else {
976
- setMessage(initialMessage.message ?? '');
977
- }
978
- isUserTriggered.current = true;
979
- textAreaRef.current?.focus();
980
- }, testId: initialSuggestedMessage.id }))) })), fullPageAndInitialScreen &&
990
+ }, as: simplifiedAgent ? StyledBannerSalutationBlock : undefined, isExpanded: agentExpanded, children: [!simplifiedAgent && _jsx(AgentIcon, {}), _jsx(StyledSalutation, { variant: simplifiedAgent ? 'h1' : 'h3', simplified: simplifiedAgent, children: salutation ?? t('welcome_text') }), simplifiedAgent && (_jsx(StyledSubHeading, { variant: 'primary', as: 'p', children: subHeading ?? t('what_can_i_help_you_with') }))] })), (!agentInBanner || guidedMode) && staticSuggestions, fullPageAndInitialScreen &&
981
991
  !guidedMode &&
982
992
  !suggestionCardsView &&
983
993
  !agentInBanner &&