@pega/cosmos-react-work 9.0.0-build.24.2 → 9.0.0-build.24.3
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/GenAICoach/ActiveCases.d.ts.map +1 -1
- package/lib/components/GenAICoach/ActiveCases.js +9 -1
- package/lib/components/GenAICoach/ActiveCases.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.d.ts +1 -1
- package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.js +40 -15
- package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts +3 -17
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js +32 -7
- package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts +20 -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/GenAICoach/GenAIMessage.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAIMessage.js +23 -15
- package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
- package/lib/components/GenAICoach/GenAIMessageProgress.d.ts +2 -1
- package/lib/components/GenAICoach/GenAIMessageProgress.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAIMessageProgress.js +3 -2
- package/lib/components/GenAICoach/GenAIMessageProgress.js.map +1 -1
- package/lib/components/GenAICoach/index.d.ts +1 -1
- package/lib/components/GenAICoach/index.d.ts.map +1 -1
- package/lib/components/GenAICoach/index.js.map +1 -1
- package/lib/components/Stages/Stages.d.ts.map +1 -1
- package/lib/components/Stages/Stages.js +24 -5
- package/lib/components/Stages/Stages.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveCases.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/ActiveCases.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAM/E,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ActiveCases.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/ActiveCases.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAM/E,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,oBAAoB,CAAC;AAoC3E,QAAA,MAAM,WAAW,EAAE,+BAA+B,CAAC,gBAAgB,CAwElE,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -15,7 +15,15 @@ const toStageProps = (bannerStages) => bannerStages.map(s => ({
|
|
|
15
15
|
completed: step.completed ?? false
|
|
16
16
|
}))
|
|
17
17
|
}));
|
|
18
|
-
const findCurrentStageId = (bannerStages) =>
|
|
18
|
+
const findCurrentStageId = (bannerStages) => {
|
|
19
|
+
const explicitCurrent = bannerStages.find(s => s.current);
|
|
20
|
+
if (explicitCurrent)
|
|
21
|
+
return explicitCurrent.id;
|
|
22
|
+
if (bannerStages.length > 0 && bannerStages.every(s => s.completed)) {
|
|
23
|
+
return bannerStages[bannerStages.length - 1].id;
|
|
24
|
+
}
|
|
25
|
+
return bannerStages[0]?.id ?? '';
|
|
26
|
+
};
|
|
19
27
|
const ActiveCases = forwardRef(function ActiveCases({ activeCases, ...restProps }, ref) {
|
|
20
28
|
const t = useI18n();
|
|
21
29
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveCases.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/ActiveCases.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OA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E,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,YAC9D,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;wBAC1B,MAAM,UAAU,GAAG,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;wBACjD,MAAM,SAAS,GAAG,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;wBAEtD,MAAM,eAAe,GAAqC,CAAC,CAAC,EAAE;4BAC5D,aAAa,EAAE,CAAC;4BAChB,QAAQ,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC;wBAC/B,CAAC,CAAC;wBAEF,OAAO,CACL,MAAC,IAAI,IAAmB,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAChE,KAAC,oBAAoB,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,eAAe,YAC1D,QAAQ,CAAC,OAAO,GACI,EAEvB,KAAC,sBAAsB,cACrB,KAAC,MAAM,IAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,SAAG,GACpC,KAPhB,QAAQ,CAAC,EAAE,CAQf,CACR,CAAC;oBACJ,CAAC,CAAC,GACoB,GACb,CACd,IACA,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { useState, useCallback, forwardRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Icon,\n Count,\n Flex,\n InfoDialog,\n useI18n,\n useElement,\n useConsolidatedRef,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\nimport * as caseIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/case.icon';\n\nimport Stages from '../Stages';\nimport type { StageProps, StepProps } from '../Stages/Stages.types';\n\nimport type { ActiveCasesProps, ActiveCaseItem } from './GenAICoach.types';\nimport {\n StyledActiveCaseButton,\n StyledActiveCasesList,\n StyledActiveCaseName,\n StyledActiveCaseStages\n} from './GenAICoach.styles';\n\nregisterIcon(caseIcon);\n\nconst toStageProps = (bannerStages: ActiveCaseItem['stages']): StageProps[] =>\n bannerStages.map(s => ({\n id: s.id,\n name: s.name,\n completed: s.completed ?? false,\n steps: s.steps?.map(\n (step): StepProps => ({\n id: step.id,\n name: step.name,\n completed: step.completed ?? false\n })\n )\n }));\n\nconst findCurrentStageId = (bannerStages: ActiveCaseItem['stages']): string => {\n const explicitCurrent = bannerStages.find(s => s.current);\n\n if (explicitCurrent) return explicitCurrent.id;\n\n if (bannerStages.length > 0 && bannerStages.every(s => s.completed)) {\n return bannerStages[bannerStages.length - 1].id;\n }\n\n return bannerStages[0]?.id ?? '';\n};\n\nconst ActiveCases: ForwardRefForwardPropsComponent<ActiveCasesProps> = forwardRef(\n function ActiveCases(\n { activeCases, ...restProps }: PropsWithoutRef<ActiveCasesProps>,\n ref: ActiveCasesProps['ref']\n ) {\n const t = useI18n();\n\n const [isOpen, setIsOpen] = useState(false);\n\n const [triggerEl, setTriggerEl] = useElement<HTMLButtonElement>();\n\n const triggerRef = useConsolidatedRef<HTMLButtonElement>(ref, setTriggerEl);\n\n const label = t('active_cases');\n\n const toggleDialog = useCallback(() => {\n setIsOpen(prev => !prev);\n }, []);\n\n const dismissDialog = useCallback(() => {\n setIsOpen(false);\n }, []);\n\n return (\n <>\n <Flex\n container={{ alignItems: 'center', gap: 1 }}\n as={StyledActiveCaseButton}\n {...restProps}\n ref={triggerRef}\n type='button'\n onClick={toggleDialog}\n aria-expanded={isOpen}\n aria-label={t('active_cases_trigger', [activeCases.length])}\n >\n <Icon name='case' />\n\n {label}\n\n <Count>{activeCases.length}</Count>\n </Flex>\n\n {isOpen && triggerEl && (\n <InfoDialog heading={label} target={triggerEl} onDismiss={dismissDialog}>\n <StyledActiveCasesList container={{ direction: 'column', gap: 4 }}>\n {activeCases.map(caseItem => {\n const stageProps = toStageProps(caseItem.stages);\n const currentId = findCurrentStageId(caseItem.stages);\n\n const handleCaseClick: ActiveCaseItem['onHeadingClick'] = e => {\n dismissDialog();\n caseItem.onHeadingClick?.(e);\n };\n\n return (\n <Flex key={caseItem.id} container={{ direction: 'column', gap: 1 }}>\n <StyledActiveCaseName variant='link' onClick={handleCaseClick}>\n {caseItem.heading}\n </StyledActiveCaseName>\n\n <StyledActiveCaseStages>\n <Stages stages={stageProps} current={currentId} readOnly />\n </StyledActiveCaseStages>\n </Flex>\n );\n })}\n </StyledActiveCasesList>\n </InfoDialog>\n )}\n </>\n );\n }\n);\n\nexport default ActiveCases;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GenAICoachProps } from '.';
|
|
2
2
|
export declare const AgentIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export declare const AISuggestedBadge: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare const _default: (({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages, onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode, actions, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation, isPortalAgent, pagePanel, suggestionCardsView, draftMessage, caseWorkflow, activeCases, ...restProps }: GenAICoachProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
4
|
+
declare const _default: (({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages, onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode, actions, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation, isPortalAgent, pagePanel, suggestionCardsView, draftMessage, caseWorkflow, activeCases, onStop, ...restProps }: GenAICoachProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
5
5
|
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["user-message", "coach-message", "system-message", "actions", "attachments"]>;
|
|
6
6
|
};
|
|
7
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AA8FA,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;AAchF,eAAO,MAAM,SAAS,+CAmDrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAQ5B,CAAC
|
|
1
|
+
{"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AA8FA,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;AAchF,eAAO,MAAM,SAAS,+CAmDrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAQ5B,CAAC;uhBAoCC,eAAe;;;AAq1ClB,wBAA6D"}
|
|
@@ -12,7 +12,7 @@ import * as sendSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icon
|
|
|
12
12
|
import * as squareSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/square-solid.icon';
|
|
13
13
|
import { getGenAICoachTestIds } from './GenAICoach.test-ids';
|
|
14
14
|
import { isCoachMessage, isInUtilities, isUserMessage } from './GenAICoach.utils';
|
|
15
|
-
import { StyledMessagesContainer, StyledDisclaimerText, StyledGenAICoachContainer, StyledGenAIOptionsMenu, StyledInitialMessageContainer, StyledInputContainer, StyledMenuSuggestions, StyledMessagesList, StyledGridContainer, StyledFlexWrapper, StyledErrorContainer, StyledInput, StyledGuidedSuggestions, StyledComposerSection, StyledSendButton, StyledGenAIFormControl, StyledGenAITextArea, StyledInitialMessageGrid, StyledGenAIFooter, StyledAgentIcon,
|
|
15
|
+
import { StyledMessagesContainer, StyledDisclaimerText, StyledGenAICoachContainer, StyledGenAIOptionsMenu, StyledInitialMessageContainer, StyledInputContainer, StyledMenuSuggestions, StyledMessagesList, StyledGridContainer, StyledFlexWrapper, StyledErrorContainer, StyledInput, StyledGuidedSuggestions, StyledComposerSection, StyledSendButton, StyledStopGeneratingButton, StyledGenAIFormControl, StyledGenAITextArea, StyledInitialMessageGrid, StyledGenAIFooter, StyledAgentIcon, StyledActionsContainer, StyledFullscreenWrapper, StyledScrollButton, StyledSuggestionCardsView, StyledSuggestionCardsBottomHalf, StyledStickyComposer, StyledAISuggestedBadge } from './GenAICoach.styles';
|
|
16
16
|
import ActiveCases from './ActiveCases';
|
|
17
17
|
import CaseWorkflow from './CaseWorkflow';
|
|
18
18
|
import ConversationHistory from './ConversationHistory';
|
|
@@ -29,7 +29,7 @@ export const AISuggestedBadge = () => {
|
|
|
29
29
|
const t = useI18n();
|
|
30
30
|
return (_jsxs(StyledAISuggestedBadge, { container: { alignItems: 'center', gap: 0.5 }, children: [_jsx(Icon, { name: 'polaris-solid', "aria-hidden": true }), _jsx(Text, { children: t('ai_suggestion') })] }));
|
|
31
31
|
};
|
|
32
|
-
const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation = true, isPortalAgent = false, pagePanel, suggestionCardsView, draftMessage, caseWorkflow, activeCases, ...restProps }) => {
|
|
32
|
+
const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation = true, isPortalAgent = false, pagePanel, suggestionCardsView, draftMessage, caseWorkflow, activeCases, onStop, ...restProps }) => {
|
|
33
33
|
const scrollTolerancePx = 2;
|
|
34
34
|
const scrollThresholdPx = 50;
|
|
35
35
|
const streamBufferLh = 20;
|
|
@@ -580,20 +580,45 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
|
|
|
580
580
|
fileUploadInputRef.current.value = '';
|
|
581
581
|
}
|
|
582
582
|
fileUploadInputRef.current?.click();
|
|
583
|
-
}, variant: 'simple', label: t('add_attachment'), children: _jsx(Icon, { name: 'paper-clip' }) }), _jsx(StyledInput, { type: 'file', ref: fileUploadInputRef, onChange: onFileChange, multiple: false, "data-testid": testIds.attachments })] }))] }), (
|
|
584
|
-
(active && pendingResult.current)
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
583
|
+
}, variant: 'simple', label: t('add_attachment'), children: _jsx(Icon, { name: 'paper-clip' }) }), _jsx(StyledInput, { type: 'file', ref: fileUploadInputRef, onChange: onFileChange, multiple: false, "data-testid": testIds.attachments })] }))] }), (() => {
|
|
584
|
+
if (active && pendingResult.current) {
|
|
585
|
+
return (_jsxs(Flex, { container: {
|
|
586
|
+
gap: 1,
|
|
587
|
+
justify: 'end',
|
|
588
|
+
alignItems: 'center',
|
|
589
|
+
pad: 1
|
|
590
|
+
}, children: [t('processing_speech'), _jsx(Progress, { placement: 'inline' })] }));
|
|
591
|
+
}
|
|
592
|
+
const isToolConfirmation = latestMessage &&
|
|
592
593
|
isCoachMessage(latestMessage) &&
|
|
593
|
-
latestMessage.isToolConfirmation
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
594
|
+
latestMessage.isToolConfirmation;
|
|
595
|
+
let onStopFn;
|
|
596
|
+
if (onStop) {
|
|
597
|
+
onStopFn = onStop;
|
|
598
|
+
}
|
|
599
|
+
else if (isToolConfirmation) {
|
|
600
|
+
onStopFn = stopProcess;
|
|
601
|
+
}
|
|
602
|
+
if (onStopFn) {
|
|
603
|
+
return (_jsx(StyledStopGeneratingButton, { variant: 'primary', icon: true, label: t('stop'), "aria-label": t('stop'), onClick: () => {
|
|
604
|
+
textAreaRef.current?.focus();
|
|
605
|
+
onStopFn?.();
|
|
606
|
+
}, children: _jsx(Icon, { name: 'square-solid' }) }));
|
|
607
|
+
}
|
|
608
|
+
const isLoading = latestMessage &&
|
|
609
|
+
isCoachMessage(latestMessage) &&
|
|
610
|
+
latestMessage.loading &&
|
|
611
|
+
!latestMessage.error;
|
|
612
|
+
if (isLoading) {
|
|
613
|
+
return (_jsxs(Flex, { container: {
|
|
614
|
+
gap: 1,
|
|
615
|
+
justify: 'end',
|
|
616
|
+
alignItems: 'center',
|
|
617
|
+
pad: 1
|
|
618
|
+
}, children: [t('generating_response'), _jsx(Progress, { placement: 'inline' })] }));
|
|
619
|
+
}
|
|
620
|
+
return (_jsx(StyledSendButton, { variant: 'primary', onClick: handleSendMessage, icon: true, label: t('send'), "aria-label": t('send_message'), children: _jsx(Icon, { name: 'send-solid' }) }));
|
|
621
|
+
})()] })] }) }) }), 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] }))] })), _jsx(Flex, { container: { justify: 'center' }, children: _jsx(StyledDisclaimerText, { inFullPage: !condition, children: t('ai_disclaimer') }) })] }));
|
|
597
622
|
const isCompact = variant.placement === 'fullpage' &&
|
|
598
623
|
!fullScreen &&
|
|
599
624
|
!isInLandingPageUtilities &&
|