@pega/cosmos-react-work 10.0.0-build.5.16 → 10.0.0-build.5.18

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.
@@ -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;iCAs7DyB,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';
@@ -856,7 +856,29 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
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,23 +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: {
969
- cols: getGridColumns(),
970
- gap: simplifiedAgent ? 0.75 : 1.5,
971
- justifyItems: simplifiedAgent ? 'center' : undefined
972
- }, children: initialSuggestedMessages.map(initialSuggestedMessage => (_jsx(InitialSuggestedMessage, { ...initialSuggestedMessage, onSend: initialMessage => {
973
- if (guidedMode) {
974
- onSend({
975
- id: initialMessage.id,
976
- message: initialMessage.message
977
- });
978
- }
979
- else {
980
- setMessage(initialMessage.message ?? '');
981
- }
982
- isUserTriggered.current = true;
983
- textAreaRef.current?.focus();
984
- }, 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 &&
985
991
  !guidedMode &&
986
992
  !suggestionCardsView &&
987
993
  !agentInBanner &&