@pega/cosmos-react-work 9.0.0-build.21.1 → 9.0.0-build.21.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/GenAICoach.styles.d.ts +1 -0
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js +8 -2
- package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts +10 -1
- 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 +42 -4
- package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
- package/lib/components/GenAICoach/ToolCandidates.d.ts +4 -0
- package/lib/components/GenAICoach/ToolCandidates.d.ts.map +1 -0
- package/lib/components/GenAICoach/ToolCandidates.js +19 -0
- package/lib/components/GenAICoach/ToolCandidates.js.map +1 -0
- package/package.json +3 -3
|
@@ -880,4 +880,5 @@ export declare const StyledActionContainer: import("styled-components/dist/types
|
|
|
880
880
|
}, "container" | "item" | "xs" | "xl" | "sm" | "md">>, "ref"> & import("react").RefAttributes<Element> & import("@pega/cosmos-react-core").ForwardProps, "ref"> & {
|
|
881
881
|
ref?: ((instance: Element | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<Element> | null | undefined;
|
|
882
882
|
}), import("styled-components/dist/types").BaseObject>> & string & Omit<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, keyof import("react").Component<any, {}, any>>;
|
|
883
|
+
export declare const StyledToolCandidatesModal: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("@pega/cosmos-react-core").ModalProps & import("@pega/cosmos-react-core").ForwardProps, never>> & string & Omit<import("react").FunctionComponent<import("@pega/cosmos-react-core").ModalProps & import("@pega/cosmos-react-core").ForwardProps>, keyof import("react").Component<any, {}, any>>;
|
|
883
884
|
//# sourceMappingURL=GenAICoach.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAICoach.styles.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.styles.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,eAAO,MAAM,oBAAoB,6NAAc,CAAC;AAGhD,eAAO,MAAM,qBAAqB,6NAAe,CAAC;AAElD,eAAO,MAAM,uBAAuB,6NAYnC,CAAC;AAIF,eAAO,MAAM,uBAAuB;;;
|
|
1
|
+
{"version":3,"file":"GenAICoach.styles.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.styles.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,eAAO,MAAM,oBAAoB,6NAAc,CAAC;AAGhD,eAAO,MAAM,qBAAqB,6NAAe,CAAC;AAElD,eAAO,MAAM,uBAAuB,6NAYnC,CAAC;AAIF,eAAO,MAAM,uBAAuB;;;2BA7B8B,CAAC;iDA+BlE,CAAC;AAEF,eAAO,MAAM,yBAAyB;aAC3B,eAAe,CAAC,SAAS,CAAC;gBACvB,eAAe,CAAC,iBAAiB,CAAC;eACnC,OAAO;YAkGnB,CAAC;AAIF,eAAO,MAAM,sBAAsB;;;2BAnG/B,CAAH;iDAwHC,CAAC;AAIH,eAAO,MAAM,qBAAqB;;;2BA5H9B,CAAH;iDAwIC,CAAC;AAIH,eAAO,MAAM,oBAAoB;;;gBAA8B,OAAO;kLAgBpE,CAAC;AAIH,eAAO,M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B,CAAC;AAIH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sOASjC,CAAC;AAEF,eAAO,MAAM,yBAAyB,iZAIpC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled, { createGlobalStyle, css } from 'styled-components';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
3
|
import { mix } from 'polished';
|
|
4
|
-
import { AIButton, AppShellContext, Button, FileList, Flex, FormControl, MenuButton, StyledEmptyState, StyledErrorState, StyledIcon, StyledText, SummaryItem, Text, TextArea, calculateFontSize, defaultThemeProp, tryCatch, Avatar, calculateForegroundColor,
|
|
4
|
+
import { AIButton, AppShellContext, Button, FileList, Flex, FormControl, MenuButton, StyledEmptyState, StyledErrorState, StyledIcon, StyledText, SummaryItem, Text, TextArea, calculateFontSize, defaultThemeProp, tryCatch, Avatar, calculateForegroundColor, Fullscreen, animations, Modal } from '@pega/cosmos-react-core';
|
|
5
5
|
import { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';
|
|
6
6
|
import { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';
|
|
7
7
|
import { StyledEditorContainer } from '@pega/cosmos-react-rte/lib/components/RichTextEditor/RichTextEditor.styles';
|
|
@@ -486,7 +486,7 @@ StyledConfirmationMsg.defaultProps = defaultThemeProp;
|
|
|
486
486
|
export const StyledActionsContainer = styled.div(() => css `
|
|
487
487
|
margin-inline-start: auto;
|
|
488
488
|
|
|
489
|
-
|
|
489
|
+
&& button {
|
|
490
490
|
margin-inline-start: 0;
|
|
491
491
|
}
|
|
492
492
|
`);
|
|
@@ -568,4 +568,10 @@ export const StyledActionContainer = styled(Flex) `
|
|
|
568
568
|
}
|
|
569
569
|
margin-inline-end: auto;
|
|
570
570
|
`;
|
|
571
|
+
export const StyledToolCandidatesModal = styled(Modal)(({ theme }) => {
|
|
572
|
+
return css `
|
|
573
|
+
max-width: ${theme.base['content-width'].xl};
|
|
574
|
+
`;
|
|
575
|
+
});
|
|
576
|
+
StyledToolCandidatesModal.defaultProps = defaultThemeProp;
|
|
571
577
|
//# sourceMappingURL=GenAICoach.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAICoach.styles.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EACL,QAAQ,EACR,eAAe,EACf,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,wBAAwB,EACxB,YAAY,EACZ,UAAU,EACV,UAAU,EACX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,4EAA4E,CAAC;AACnH,OAAO,EACL,cAAc,EACd,kBAAkB,EACnB,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,2CAA2C,CAAC;AACtE,OAAO,EAAE,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B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC5D,OAAO,GAAG,CAAA;kBACM,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,UAAU;8BACrB,KAAK,CAAC,IAAI,CAAC,OAAO;4CACJ,KAAK,CAAC,IAAI,CAAC,OAAO;wBACtC,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEpC,kBAAkB;eACT,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;GAExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;GAC/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;;;;CAShD,CAAC","sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components';\nimport { useContext } from 'react';\nimport { mix } from 'polished';\n\nimport {\n AIButton,\n AppShellContext,\n Button,\n FileList,\n Flex,\n FormControl,\n MenuButton,\n StyledEmptyState,\n StyledErrorState,\n StyledIcon,\n StyledText,\n SummaryItem,\n Text,\n TextArea,\n calculateFontSize,\n defaultThemeProp,\n tryCatch,\n Avatar,\n calculateForegroundColor,\n StyledButton,\n Fullscreen,\n animations\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\nimport { StyledEditorContainer } from '@pega/cosmos-react-rte/lib/components/RichTextEditor/RichTextEditor.styles';\nimport {\n StyledProgress,\n StyledProgressRing\n} from '@pega/cosmos-react-core/lib/components/Progress/Progress.styles';\nimport { resizeDrawerMaxWidth } from '@pega/cosmos-react-core/lib/styles/constants';\nimport { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\n\nimport type { GenAICoachProps } from './GenAICoach.types';\nimport { isInUtilities } from './GenAICoach.utils';\n\nexport const StyledMessageWrapper = styled.li``;\nconst maxWidthMessage = '46rem';\n\nexport const StyledComposerSection = styled.div``;\n\nexport const StyledMessagesContainer = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n margin-block-end: calc(2 * ${spacing});\n height: 100%;\n overflow-y: auto;\n `;\n }\n);\n\nStyledMessagesContainer.defaultProps = defaultThemeProp;\n\nexport const StyledFullscreenWrapper = styled(Fullscreen)`\n height: 100%;\n`;\n\nexport const StyledGenAICoachContainer = styled.div<{\n variant: GenAICoachProps['variant'];\n fullScreen: GenAICoachProps['allowFullScreen'];\n isCompact: boolean;\n}>(\n ({\n theme: {\n base: {\n palette,\n 'z-index': zIndex,\n spacing,\n breakpoints,\n animation,\n 'border-radius': baseBorderRadius\n },\n components: {\n card: { 'border-radius': cardBorderRadius },\n agent: { background: agentBackground, 'foreground-color': agentForegroundColor },\n 'form-control': { 'border-radius': formControlBorderRadius }\n }\n },\n variant,\n fullScreen,\n isCompact\n }) => {\n const { previewActive } = useContext(AppShellContext);\n const foregroundColorForAgent = calculateForegroundColor(agentBackground, agentForegroundColor);\n\n return css`\n background: ${agentBackground};\n color: ${foregroundColorForAgent};\n min-width: var(--utilities-drawer-min-width);\n border-radius: ${cardBorderRadius};\n transition: height ${animation.speed} ${animation.timing.ease};\n\n ${variant.placement === 'dialog' &&\n css`\n border-radius: calc(${formControlBorderRadius} * ${baseBorderRadius});\n `}\n\n ${isInUtilities(variant) &&\n !fullScreen &&\n css`\n min-height: 3rem;\n max-width: 31.25rem;\n box-shadow: 0 -1rem 1rem ${palette['app-background']};\n border-radius: ${cardBorderRadius} ${cardBorderRadius} 0 0;\n position: fixed;\n inset-block-end: 0;\n inset-inline-end: calc(2 * ${spacing});\n z-index: calc(${zIndex.drawer} + 1);\n width: 25rem;\n\n ${previewActive &&\n css`\n @media (min-width: ${breakpoints.xl}) {\n margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});\n }\n `}\n\n ${variant.state === 'minimized' &&\n css`\n height: 3rem;\n `}\n `}\n\n /*\n ~85% of Utilities height and fixed height if screen size less than md and devices with coarse pointer\n FIXME: This is a stopgap to address issue in Android web views via React Native where VH units do not work\n */\n ${((isInUtilities(variant) && variant.state === 'maximized') || !isInUtilities(variant)) &&\n !fullScreen &&\n css`\n height: calc(0.85 * var(--case-view-height, 95vh));\n @media (pointer: coarse) and (max-width: ${breakpoints.md}) {\n height: 40rem;\n }\n `}\n\n ${variant.placement === 'fullpage' &&\n css`\n height: var(--content-height-in-view, 100vh);\n `}\n\n ${isCompact &&\n css`\n height: 100%;\n max-height: var(--content-height-in-view, 100vh);\n\n ${StyledMessagesContainer} {\n margin-block-end: 0;\n }\n `}\n\n ${fullScreen &&\n css`\n height: 100vh;\n border-radius: 0;\n `}\n `;\n }\n);\n\nStyledGenAICoachContainer.defaultProps = defaultThemeProp;\n\nexport const StyledGenAIOptionsMenu = styled(MenuButton)(({\n theme: {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n 'font-weight': fontWeight,\n palette: { ai }\n }\n }\n}) => {\n const { l } = calculateFontSize(fontSize, fontScale);\n return css`\n color: inherit;\n ${StyledIcon}:first-child {\n color: ${ai};\n }\n ${StyledText} {\n font-weight: ${fontWeight['semi-bold']};\n font-size: ${l};\n }\n `;\n});\n\nStyledGenAIOptionsMenu.defaultProps = defaultThemeProp;\n\nexport const StyledMenuSuggestions = styled(MenuButton)(({\n theme: {\n base: { 'border-radius': baseBorderRadius, spacing },\n components: {\n button: { 'border-radius': borderRadius }\n }\n }\n}) => {\n return css`\n padding: calc(0.75 * ${spacing});\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n `;\n});\n\nStyledMenuSuggestions.defaultProps = defaultThemeProp;\n\nexport const StyledDisclaimerText = styled(Text)<{ inFullPage: boolean }>(({\n inFullPage,\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale, spacing }\n }\n}) => {\n const systemFontSize = calculateFontSize(fontSize, fontScale).xs;\n return css`\n font-size: ${systemFontSize};\n margin-block-start: ${spacing};\n ${inFullPage &&\n css`\n padding-block-end: calc(2 * ${spacing});\n `}\n opacity: 0.7;\n `;\n});\n\nStyledDisclaimerText.defaultProps = defaultThemeProp;\n\nexport const StyledFlexWrapper = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n margin-block-start: ${spacing};\n height: 100%;\n overflow-y: auto;\n position: relative;\n `;\n }\n);\n\nStyledFlexWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledGridContainer = styled.div<{ conversationHistory: boolean }>(\n ({ theme: { base }, conversationHistory }) => {\n return css`\n height: 100%;\n min-height: 0;\n ${conversationHistory &&\n css`\n border: 0.0625rem solid ${base.palette['border-line']};\n margin: calc(2 * ${base.spacing});\n border-radius: ${base['border-radius']};\n `}\n `;\n }\n);\n\nStyledGridContainer.defaultProps = defaultThemeProp;\n\nexport const StyledInitialMessageContainer = styled.div(() => {\n return css`\n ${StyledFormField} {\n width: 100%;\n max-width: ${maxWidthMessage};\n }\n `;\n});\n\nStyledInitialMessageContainer.defaultProps = defaultThemeProp;\n\nexport const StyledInputContainer = styled(Flex)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n margin-block-end: calc(2 * ${spacing});\n margin-inline: calc(2 * ${spacing});\n align-items: center;\n\n ${StyledFormField}, ${StyledComposerSection} {\n width: 100%;\n max-width: ${maxWidthMessage};\n }\n `;\n});\n\nStyledInputContainer.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestion = styled(Button)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n width: fit-content;\n padding: ${spacing};\n white-space: normal;\n word-break: break-word;\n & + & {\n margin-inline-start: 0;\n text-align: left;\n }\n `;\n});\n\nStyledSuggestion.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestionsContainer = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n margin-block-start: calc(1.5 * ${spacing});\n `;\n }\n);\n\nStyledSuggestionsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledTimeStamp = styled(Text)(() => {\n return css`\n display: flex;\n align-items: center;\n `;\n});\n\nStyledTimeStamp.defaultProps = defaultThemeProp;\n\nexport const StyledMessage = styled.p(({ theme }) => {\n return css`\n margin-block-start: calc(0.5 * ${theme.base.spacing});\n width: 100%;\n min-width: 0;\n overflow-wrap: break-word;\n\n ${StyledEditorContainer} {\n padding: 0;\n\n span {\n animation: ${animations.reveal} 1s forwards;\n }\n }\n `;\n});\n\nStyledMessage.defaultProps = defaultThemeProp;\n\nexport const StyledUserMessage = styled.li(\n ({\n theme: {\n base: { 'border-radius': borderRadius, spacing },\n components: {\n agent: {\n 'user-message': {\n background: userMessageBackground,\n 'foreground-color': userMessageForegroundColor\n }\n }\n }\n }\n }) => {\n const foregroundColorForUserMessage = calculateForegroundColor(\n userMessageBackground,\n userMessageForegroundColor\n );\n\n return css`\n overflow-wrap: break-word;\n background: ${userMessageBackground};\n color: ${foregroundColorForUserMessage};\n margin-inline-start: calc(4 * ${spacing});\n margin-block-end: calc(0.5 * ${spacing});\n padding: calc(0.5 * ${spacing});\n border-start-start-radius: min(calc(3 * ${borderRadius}), 1.5rem);\n border-start-end-radius: min(${borderRadius}, 0.5rem);\n border-end-start-radius: min(calc(3 * ${borderRadius}), 1.5rem);\n border-end-end-radius: min(calc(3 * ${borderRadius}), 1.5rem);\n `;\n }\n);\n\nStyledUserMessage.defaultProps = defaultThemeProp;\n\nexport const StyledSystemMessage = styled.li(\n ({\n theme: {\n base: { spacing, 'font-size': fontSize, 'font-scale': fontScale }\n }\n }) => {\n const systemFontSize = calculateFontSize(fontSize, fontScale).xs;\n return css`\n overflow-wrap: break-word;\n font-size: ${systemFontSize};\n opacity: 0.7;\n text-align: center;\n padding-inline: calc(2 * ${spacing});\n margin-block: calc(2 * ${spacing});\n `;\n }\n);\n\nStyledSystemMessage.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedMessage = styled.div(({ theme }) => {\n return css`\n column-gap: calc(2 * ${theme.base.spacing});\n min-height: 2rem;\n max-width: calc(0.8 * ${maxWidthMessage});\n width: 100%;\n text-align: left;\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding-inline-end: calc(2 * ${theme.base.spacing});\n cursor: pointer;\n &:hover,\n &:focus {\n border: 0.0625rem solid ${theme.base.palette.interactive};\n }\n ${StyledCardContent} {\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledSuggestedMessage.defaultProps = defaultThemeProp;\n\nexport const StyledMessagesList = styled.ul(\n ({\n theme: {\n base: { shadow, spacing }\n }\n }) => {\n return css`\n padding-block-start: ${spacing};\n list-style-type: none;\n align-self: center;\n max-width: ${maxWidthMessage};\n width: 100%;\n min-height: var(--stream-buffer, auto);\n\n & > li {\n max-width: calc(0.8 * ${maxWidthMessage});\n }\n & > li[from='user'] {\n margin-inline-start: auto;\n margin-block-end: ${spacing};\n }\n & > li[type='message'] {\n &:focus-visible {\n outline: none;\n box-shadow: ${shadow.focus};\n }\n margin-block-end: ${spacing};\n }\n `;\n }\n);\n\nStyledMessagesList.defaultProps = defaultThemeProp;\n\nexport const StyledHistoryContainer = styled(Flex)<{ inFullPage: boolean }>(\n ({ theme, inFullPage }) => css`\n height: 100%;\n min-height: 0;\n ${inFullPage &&\n css`\n border-inline-end: 0.0625rem solid ${theme.base.palette['border-line']};\n `}\n\n ${StyledEmptyState}, ${StyledErrorState} {\n justify-content: flex-start;\n padding-inline: calc(2 * ${theme.base.spacing});\n }\n `\n);\n\nStyledHistoryContainer.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled(Flex)(\n ({ theme }) => css`\n height: 100%;\n overflow-y: auto;\n margin-block-end: calc(2 * ${theme.base.spacing});\n `\n);\n\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledHistorySummaryListItem = styled(SummaryItem)(({ theme }) => {\n const hoverColor = tryCatch(() =>\n mix(0.95, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n return css`\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block: ${theme.base.spacing};\n border-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n\n &:hover {\n background-color: ${hoverColor};\n cursor: pointer;\n }\n &[aria-selected='true'] {\n background-color: ${hoverColor};\n }\n &:focus {\n border: 0.0625rem solid ${theme.base.palette.interactive};\n }\n `;\n});\n\nStyledHistorySummaryListItem.defaultProps = defaultThemeProp;\n\nexport const StyledLoadingItem = styled.li`\n ${StyledProgress} {\n margin: 0;\n }\n`;\n\nexport const StyledGroupHeader = styled.div(({ theme }) => {\n return css`\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block-start: calc(2 * ${theme.base.spacing});\n padding-block-end: calc(0.5 * ${theme.base.spacing});\n border-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `;\n});\n\nStyledGroupHeader.defaultProps = defaultThemeProp;\n\nexport const StyledErrorContainer = styled.div(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n `;\n});\n\nStyledErrorContainer.defaultProps = defaultThemeProp;\n\nexport const StyledInput = styled.input(() => {\n return css`\n display: none;\n `;\n});\n\nexport const StyledAttachmentsList = styled(FileList)(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n `;\n});\n\nStyledAttachmentsList.defaultProps = defaultThemeProp;\n\nexport const StyledGuidedSuggestions = styled(MenuButton)`\n width: 100%;\n max-width: ${maxWidthMessage};\n > span {\n justify-content: center;\n }\n`;\n\nexport const StyledAgentIcon = styled.svg`\n width: 3rem;\n height: 3rem;\n`;\n\nStyledAgentIcon.defaultProps = defaultThemeProp;\n\nexport const StyledGenAIFormControl = styled(FormControl)<{ focused?: boolean }>(({\n theme,\n focused\n}) => {\n return css`\n overflow: hidden;\n\n ${focused &&\n css`\n &:not([disabled]) {\n border-color: ${theme.components['form-control'][':focus']['border-color']};\n box-shadow: ${theme.components['form-control'][':focus']['box-shadow']};\n }\n\n &:hover:not([readonly]):not([disabled]):not(:focus, :focus-within) {\n border-color: transparent;\n }\n `}\n `;\n});\n\nStyledGenAIFormControl.defaultProps = defaultThemeProp;\n\nexport const StyledGenAITextArea = styled(TextArea)(({ theme: { components } }) => {\n return css`\n border: none;\n box-shadow: none;\n min-height: ${components.input.height};\n max-height: 6rem;\n overflow-y: auto;\n padding-block-end: 0;\n &:focus:not([disabled]) {\n border: none;\n box-shadow: none;\n background-color: transparent;\n }\n `;\n});\n\nStyledGenAITextArea.defaultProps = defaultThemeProp;\n\nexport const StyledSendButton = styled(Button)(({\n theme: {\n base: { palette, 'border-radius': baseBorderRadius },\n components: {\n 'form-control': { 'border-radius': formControlBorderRadius }\n }\n }\n}) => {\n return css`\n border-radius: calc(${baseBorderRadius} * ${formControlBorderRadius});\n margin-inline-start: auto;\n\n ${StyledIcon} {\n color: ${palette.light};\n }\n `;\n});\n\nStyledSendButton.defaultProps = defaultThemeProp;\n\nexport const StyledInitialMessageGrid = styled.div`\n max-width: ${maxWidthMessage};\n width: 100%;\n`;\n\nexport const StyledInitialMessageButton = styled(Button)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n white-space: normal;\n text-align: left;\n min-width: unset;\n padding-block: ${spacing};\n padding-inline: calc(2 * ${spacing});\n align-items: start;\n\n & + & {\n margin-inline-start: 0;\n }\n `;\n});\n\nStyledInitialMessageButton.defaultProps = defaultThemeProp;\n\nexport const StyledInitialMessageText = styled.span`\n ${lineClamp(3)};\n`;\n\nexport const StyledGenAIAvatar = styled(Avatar)(({\n theme: {\n components: {\n agent: {\n 'coach-message': {\n avatar: { background: avatarBackground }\n }\n }\n }\n }\n}) => {\n return css`\n background: ${avatarBackground};\n `;\n});\n\nStyledGenAIAvatar.defaultProps = defaultThemeProp;\n\nexport const StyledGenAIFooter = styled.div`\n width: 100%;\n max-width: ${maxWidthMessage};\n`;\nexport const StyledStopButton = styled(AIButton)`\n border-radius: 50%;\n`;\n\nexport const StyledToolMessage = styled.p(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'border-line': borderLine }\n }\n }\n }) => {\n return css`\n border-block-end: 0.125rem solid ${borderLine};\n padding: calc(2 * ${spacing});\n `;\n }\n);\n\nStyledToolMessage.defaultProps = defaultThemeProp;\n\nexport const StyledToolMessageContainer = styled.div(\n ({\n theme: {\n base: {\n spacing,\n 'border-radius': borderRadius,\n palette: { 'border-line': borderLine }\n }\n }\n }) => {\n return css`\n border: 0.125rem solid ${borderLine};\n border-radius: min(calc(2 * ${borderRadius}), 1rem);\n margin-block: ${spacing};\n `;\n }\n);\n\nStyledToolMessageContainer.defaultProps = defaultThemeProp;\n\nexport const StyledConfirmationMsg = styled(RichTextViewer)(\n ({\n theme: {\n base,\n components: {\n 'form-control': {\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n }\n }\n }\n }) => `\n padding: 0;\n background-color: ${readOnlyBackgroundColor};\n border-radius: calc(0.5 * ${base['border-radius']});\n`\n);\n\nStyledConfirmationMsg.defaultProps = defaultThemeProp;\n\nexport const StyledActionsContainer = styled.div(\n () => css`\n margin-inline-start: auto;\n\n ${StyledButton} {\n margin-inline-start: 0;\n }\n `\n);\n\nStyledActionsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledScrollButton = styled(Button)(({ theme }) => {\n return css`\n position: absolute;\n bottom: calc(var(--composer-height, 0rem) + calc(5 * ${theme.base.spacing}));\n width: fit-content;\n align-self: center;\n z-index: 1;\n box-shadow: ${theme.base.shadow.high};\n `;\n});\n\nStyledScrollButton.defaultProps = defaultThemeProp;\n\nexport const ProgressAngleStyle = createGlobalStyle`\n @property --angle {\n syntax: \"<angle>\";\n inherits: true;\n initial-value: 0deg;\n }\n`;\n\nexport const StyledProgressContainer = styled.div(({ theme }) => {\n return css`\n position: relative;\n isolation: isolate;\n border-radius: calc(2 * ${theme.base.spacing});\n border-start-start-radius: calc(0.5 * ${theme.base.spacing});\n border: calc(0.125 * ${theme.base.spacing}) solid transparent;\n background:\n linear-gradient(${theme.base.colors.white} 0 0) padding-box,\n conic-gradient(\n from var(--angle) in oklab,\n ${theme.base.colors.white} 0%,\n ${theme.base.colors.white} 10%,\n ${theme.base.colors.purple['extra-light']} 25%,\n ${theme.base.colors.purple.light} 50%,\n ${theme.base.colors.purple.medium} 75%,\n ${theme.base.colors.purple.dark} 100%\n )\n border-box;\n animation: spin 1s ease-in-out infinite;\n width: fit-content;\n\n @keyframes spin {\n to {\n --angle: 360deg;\n }\n }\n `;\n});\n\nStyledProgressContainer.defaultProps = defaultThemeProp;\n\nexport const StyledProgressContent = styled.div(({ theme }) => {\n return css`\n background: ${theme.components.agent.background};\n border-radius: calc(2 * ${theme.base.spacing});\n border-start-start-radius: calc(0.5 * ${theme.base.spacing});\n padding: calc(2 * ${theme.base.spacing});\n\n ${StyledProgressRing} {\n width: ${theme.components.icon.size.s};\n }\n `;\n});\n\nStyledProgressContent.defaultProps = defaultThemeProp;\n\nexport const StyledProgressText = styled(Text)(({ theme }) => {\n return css`\n color: ${theme.base.palette.ai};\n `;\n});\n\nStyledProgressText.defaultProps = defaultThemeProp;\n\nexport const StyledActionContainer = styled(Flex)`\n && {\n display: flex;\n }\n\n && > button:first-child:not(:last-child) {\n margin-inline-end: 0;\n }\n margin-inline-end: auto;\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"GenAICoach.styles.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenA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ExC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;GAC/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;;;;;CAShD,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnE,OAAO,GAAG,CAAA;iBACK,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;GAC5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components';\nimport { useContext } from 'react';\nimport { mix } from 'polished';\n\nimport {\n AIButton,\n AppShellContext,\n Button,\n FileList,\n Flex,\n FormControl,\n MenuButton,\n StyledEmptyState,\n StyledErrorState,\n StyledIcon,\n StyledText,\n SummaryItem,\n Text,\n TextArea,\n calculateFontSize,\n defaultThemeProp,\n tryCatch,\n Avatar,\n calculateForegroundColor,\n Fullscreen,\n animations,\n Modal\n} from '@pega/cosmos-react-core';\nimport { StyledCardContent } from '@pega/cosmos-react-core/lib/components/Card/CardContent';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\nimport { StyledEditorContainer } from '@pega/cosmos-react-rte/lib/components/RichTextEditor/RichTextEditor.styles';\nimport {\n StyledProgress,\n StyledProgressRing\n} from '@pega/cosmos-react-core/lib/components/Progress/Progress.styles';\nimport { resizeDrawerMaxWidth } from '@pega/cosmos-react-core/lib/styles/constants';\nimport { lineClamp } from '@pega/cosmos-react-core/lib/styles/mixins';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\n\nimport type { GenAICoachProps } from './GenAICoach.types';\nimport { isInUtilities } from './GenAICoach.utils';\n\nexport const StyledMessageWrapper = styled.li``;\nconst maxWidthMessage = '46rem';\n\nexport const StyledComposerSection = styled.div``;\n\nexport const StyledMessagesContainer = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n margin-block-end: calc(2 * ${spacing});\n height: 100%;\n overflow-y: auto;\n `;\n }\n);\n\nStyledMessagesContainer.defaultProps = defaultThemeProp;\n\nexport const StyledFullscreenWrapper = styled(Fullscreen)`\n height: 100%;\n`;\n\nexport const StyledGenAICoachContainer = styled.div<{\n variant: GenAICoachProps['variant'];\n fullScreen: GenAICoachProps['allowFullScreen'];\n isCompact: boolean;\n}>(\n ({\n theme: {\n base: {\n palette,\n 'z-index': zIndex,\n spacing,\n breakpoints,\n animation,\n 'border-radius': baseBorderRadius\n },\n components: {\n card: { 'border-radius': cardBorderRadius },\n agent: { background: agentBackground, 'foreground-color': agentForegroundColor },\n 'form-control': { 'border-radius': formControlBorderRadius }\n }\n },\n variant,\n fullScreen,\n isCompact\n }) => {\n const { previewActive } = useContext(AppShellContext);\n const foregroundColorForAgent = calculateForegroundColor(agentBackground, agentForegroundColor);\n\n return css`\n background: ${agentBackground};\n color: ${foregroundColorForAgent};\n min-width: var(--utilities-drawer-min-width);\n border-radius: ${cardBorderRadius};\n transition: height ${animation.speed} ${animation.timing.ease};\n\n ${variant.placement === 'dialog' &&\n css`\n border-radius: calc(${formControlBorderRadius} * ${baseBorderRadius});\n `}\n\n ${isInUtilities(variant) &&\n !fullScreen &&\n css`\n min-height: 3rem;\n max-width: 31.25rem;\n box-shadow: 0 -1rem 1rem ${palette['app-background']};\n border-radius: ${cardBorderRadius} ${cardBorderRadius} 0 0;\n position: fixed;\n inset-block-end: 0;\n inset-inline-end: calc(2 * ${spacing});\n z-index: calc(${zIndex.drawer} + 1);\n width: 25rem;\n\n ${previewActive &&\n css`\n @media (min-width: ${breakpoints.xl}) {\n margin-inline-end: min(var(--resize-drawer-width), ${resizeDrawerMaxWidth});\n }\n `}\n\n ${variant.state === 'minimized' &&\n css`\n height: 3rem;\n `}\n `}\n\n /*\n ~85% of Utilities height and fixed height if screen size less than md and devices with coarse pointer\n FIXME: This is a stopgap to address issue in Android web views via React Native where VH units do not work\n */\n ${((isInUtilities(variant) && variant.state === 'maximized') || !isInUtilities(variant)) &&\n !fullScreen &&\n css`\n height: calc(0.85 * var(--case-view-height, 95vh));\n @media (pointer: coarse) and (max-width: ${breakpoints.md}) {\n height: 40rem;\n }\n `}\n\n ${variant.placement === 'fullpage' &&\n css`\n height: var(--content-height-in-view, 100vh);\n `}\n\n ${isCompact &&\n css`\n height: 100%;\n max-height: var(--content-height-in-view, 100vh);\n\n ${StyledMessagesContainer} {\n margin-block-end: 0;\n }\n `}\n\n ${fullScreen &&\n css`\n height: 100vh;\n border-radius: 0;\n `}\n `;\n }\n);\n\nStyledGenAICoachContainer.defaultProps = defaultThemeProp;\n\nexport const StyledGenAIOptionsMenu = styled(MenuButton)(({\n theme: {\n base: {\n 'font-size': fontSize,\n 'font-scale': fontScale,\n 'font-weight': fontWeight,\n palette: { ai }\n }\n }\n}) => {\n const { l } = calculateFontSize(fontSize, fontScale);\n return css`\n color: inherit;\n ${StyledIcon}:first-child {\n color: ${ai};\n }\n ${StyledText} {\n font-weight: ${fontWeight['semi-bold']};\n font-size: ${l};\n }\n `;\n});\n\nStyledGenAIOptionsMenu.defaultProps = defaultThemeProp;\n\nexport const StyledMenuSuggestions = styled(MenuButton)(({\n theme: {\n base: { 'border-radius': baseBorderRadius, spacing },\n components: {\n button: { 'border-radius': borderRadius }\n }\n }\n}) => {\n return css`\n padding: calc(0.75 * ${spacing});\n border-radius: calc(${baseBorderRadius} * ${borderRadius});\n `;\n});\n\nStyledMenuSuggestions.defaultProps = defaultThemeProp;\n\nexport const StyledDisclaimerText = styled(Text)<{ inFullPage: boolean }>(({\n inFullPage,\n theme: {\n base: { 'font-size': fontSize, 'font-scale': fontScale, spacing }\n }\n}) => {\n const systemFontSize = calculateFontSize(fontSize, fontScale).xs;\n return css`\n font-size: ${systemFontSize};\n margin-block-start: ${spacing};\n ${inFullPage &&\n css`\n padding-block-end: calc(2 * ${spacing});\n `}\n opacity: 0.7;\n `;\n});\n\nStyledDisclaimerText.defaultProps = defaultThemeProp;\n\nexport const StyledFlexWrapper = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n margin-block-start: ${spacing};\n height: 100%;\n overflow-y: auto;\n position: relative;\n `;\n }\n);\n\nStyledFlexWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledGridContainer = styled.div<{ conversationHistory: boolean }>(\n ({ theme: { base }, conversationHistory }) => {\n return css`\n height: 100%;\n min-height: 0;\n ${conversationHistory &&\n css`\n border: 0.0625rem solid ${base.palette['border-line']};\n margin: calc(2 * ${base.spacing});\n border-radius: ${base['border-radius']};\n `}\n `;\n }\n);\n\nStyledGridContainer.defaultProps = defaultThemeProp;\n\nexport const StyledInitialMessageContainer = styled.div(() => {\n return css`\n ${StyledFormField} {\n width: 100%;\n max-width: ${maxWidthMessage};\n }\n `;\n});\n\nStyledInitialMessageContainer.defaultProps = defaultThemeProp;\n\nexport const StyledInputContainer = styled(Flex)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n margin-block-end: calc(2 * ${spacing});\n margin-inline: calc(2 * ${spacing});\n align-items: center;\n\n ${StyledFormField}, ${StyledComposerSection} {\n width: 100%;\n max-width: ${maxWidthMessage};\n }\n `;\n});\n\nStyledInputContainer.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestion = styled(Button)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n width: fit-content;\n padding: ${spacing};\n white-space: normal;\n word-break: break-word;\n & + & {\n margin-inline-start: 0;\n text-align: left;\n }\n `;\n});\n\nStyledSuggestion.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestionsContainer = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n margin-block-start: calc(1.5 * ${spacing});\n `;\n }\n);\n\nStyledSuggestionsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledTimeStamp = styled(Text)(() => {\n return css`\n display: flex;\n align-items: center;\n `;\n});\n\nStyledTimeStamp.defaultProps = defaultThemeProp;\n\nexport const StyledMessage = styled.p(({ theme }) => {\n return css`\n margin-block-start: calc(0.5 * ${theme.base.spacing});\n width: 100%;\n min-width: 0;\n overflow-wrap: break-word;\n\n ${StyledEditorContainer} {\n padding: 0;\n\n span {\n animation: ${animations.reveal} 1s forwards;\n }\n }\n `;\n});\n\nStyledMessage.defaultProps = defaultThemeProp;\n\nexport const StyledUserMessage = styled.li(\n ({\n theme: {\n base: { 'border-radius': borderRadius, spacing },\n components: {\n agent: {\n 'user-message': {\n background: userMessageBackground,\n 'foreground-color': userMessageForegroundColor\n }\n }\n }\n }\n }) => {\n const foregroundColorForUserMessage = calculateForegroundColor(\n userMessageBackground,\n userMessageForegroundColor\n );\n\n return css`\n overflow-wrap: break-word;\n background: ${userMessageBackground};\n color: ${foregroundColorForUserMessage};\n margin-inline-start: calc(4 * ${spacing});\n margin-block-end: calc(0.5 * ${spacing});\n padding: calc(0.5 * ${spacing});\n border-start-start-radius: min(calc(3 * ${borderRadius}), 1.5rem);\n border-start-end-radius: min(${borderRadius}, 0.5rem);\n border-end-start-radius: min(calc(3 * ${borderRadius}), 1.5rem);\n border-end-end-radius: min(calc(3 * ${borderRadius}), 1.5rem);\n `;\n }\n);\n\nStyledUserMessage.defaultProps = defaultThemeProp;\n\nexport const StyledSystemMessage = styled.li(\n ({\n theme: {\n base: { spacing, 'font-size': fontSize, 'font-scale': fontScale }\n }\n }) => {\n const systemFontSize = calculateFontSize(fontSize, fontScale).xs;\n return css`\n overflow-wrap: break-word;\n font-size: ${systemFontSize};\n opacity: 0.7;\n text-align: center;\n padding-inline: calc(2 * ${spacing});\n margin-block: calc(2 * ${spacing});\n `;\n }\n);\n\nStyledSystemMessage.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestedMessage = styled.div(({ theme }) => {\n return css`\n column-gap: calc(2 * ${theme.base.spacing});\n min-height: 2rem;\n max-width: calc(0.8 * ${maxWidthMessage});\n width: 100%;\n text-align: left;\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding-inline-end: calc(2 * ${theme.base.spacing});\n cursor: pointer;\n &:hover,\n &:focus {\n border: 0.0625rem solid ${theme.base.palette.interactive};\n }\n ${StyledCardContent} {\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block: calc(1.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledSuggestedMessage.defaultProps = defaultThemeProp;\n\nexport const StyledMessagesList = styled.ul(\n ({\n theme: {\n base: { shadow, spacing }\n }\n }) => {\n return css`\n padding-block-start: ${spacing};\n list-style-type: none;\n align-self: center;\n max-width: ${maxWidthMessage};\n width: 100%;\n min-height: var(--stream-buffer, auto);\n\n & > li {\n max-width: calc(0.8 * ${maxWidthMessage});\n }\n & > li[from='user'] {\n margin-inline-start: auto;\n margin-block-end: ${spacing};\n }\n & > li[type='message'] {\n &:focus-visible {\n outline: none;\n box-shadow: ${shadow.focus};\n }\n margin-block-end: ${spacing};\n }\n `;\n }\n);\n\nStyledMessagesList.defaultProps = defaultThemeProp;\n\nexport const StyledHistoryContainer = styled(Flex)<{ inFullPage: boolean }>(\n ({ theme, inFullPage }) => css`\n height: 100%;\n min-height: 0;\n ${inFullPage &&\n css`\n border-inline-end: 0.0625rem solid ${theme.base.palette['border-line']};\n `}\n\n ${StyledEmptyState}, ${StyledErrorState} {\n justify-content: flex-start;\n padding-inline: calc(2 * ${theme.base.spacing});\n }\n `\n);\n\nStyledHistoryContainer.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled(Flex)(\n ({ theme }) => css`\n height: 100%;\n overflow-y: auto;\n margin-block-end: calc(2 * ${theme.base.spacing});\n `\n);\n\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledHistorySummaryListItem = styled(SummaryItem)(({ theme }) => {\n const hoverColor = tryCatch(() =>\n mix(0.95, theme.base.palette['primary-background'], theme.base.palette.interactive)\n );\n return css`\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block: ${theme.base.spacing};\n border-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n\n &:hover {\n background-color: ${hoverColor};\n cursor: pointer;\n }\n &[aria-selected='true'] {\n background-color: ${hoverColor};\n }\n &:focus {\n border: 0.0625rem solid ${theme.base.palette.interactive};\n }\n `;\n});\n\nStyledHistorySummaryListItem.defaultProps = defaultThemeProp;\n\nexport const StyledLoadingItem = styled.li`\n ${StyledProgress} {\n margin: 0;\n }\n`;\n\nexport const StyledGroupHeader = styled.div(({ theme }) => {\n return css`\n padding-inline: calc(2 * ${theme.base.spacing});\n padding-block-start: calc(2 * ${theme.base.spacing});\n padding-block-end: calc(0.5 * ${theme.base.spacing});\n border-block-end: 0.0625rem solid ${theme.base.palette['border-line']};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n `;\n});\n\nStyledGroupHeader.defaultProps = defaultThemeProp;\n\nexport const StyledErrorContainer = styled.div(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n `;\n});\n\nStyledErrorContainer.defaultProps = defaultThemeProp;\n\nexport const StyledInput = styled.input(() => {\n return css`\n display: none;\n `;\n});\n\nexport const StyledAttachmentsList = styled(FileList)(({ theme }) => {\n return css`\n padding: ${theme.base.spacing};\n `;\n});\n\nStyledAttachmentsList.defaultProps = defaultThemeProp;\n\nexport const StyledGuidedSuggestions = styled(MenuButton)`\n width: 100%;\n max-width: ${maxWidthMessage};\n > span {\n justify-content: center;\n }\n`;\n\nexport const StyledAgentIcon = styled.svg`\n width: 3rem;\n height: 3rem;\n`;\n\nStyledAgentIcon.defaultProps = defaultThemeProp;\n\nexport const StyledGenAIFormControl = styled(FormControl)<{ focused?: boolean }>(({\n theme,\n focused\n}) => {\n return css`\n overflow: hidden;\n\n ${focused &&\n css`\n &:not([disabled]) {\n border-color: ${theme.components['form-control'][':focus']['border-color']};\n box-shadow: ${theme.components['form-control'][':focus']['box-shadow']};\n }\n\n &:hover:not([readonly]):not([disabled]):not(:focus, :focus-within) {\n border-color: transparent;\n }\n `}\n `;\n});\n\nStyledGenAIFormControl.defaultProps = defaultThemeProp;\n\nexport const StyledGenAITextArea = styled(TextArea)(({ theme: { components } }) => {\n return css`\n border: none;\n box-shadow: none;\n min-height: ${components.input.height};\n max-height: 6rem;\n overflow-y: auto;\n padding-block-end: 0;\n &:focus:not([disabled]) {\n border: none;\n box-shadow: none;\n background-color: transparent;\n }\n `;\n});\n\nStyledGenAITextArea.defaultProps = defaultThemeProp;\n\nexport const StyledSendButton = styled(Button)(({\n theme: {\n base: { palette, 'border-radius': baseBorderRadius },\n components: {\n 'form-control': { 'border-radius': formControlBorderRadius }\n }\n }\n}) => {\n return css`\n border-radius: calc(${baseBorderRadius} * ${formControlBorderRadius});\n margin-inline-start: auto;\n\n ${StyledIcon} {\n color: ${palette.light};\n }\n `;\n});\n\nStyledSendButton.defaultProps = defaultThemeProp;\n\nexport const StyledInitialMessageGrid = styled.div`\n max-width: ${maxWidthMessage};\n width: 100%;\n`;\n\nexport const StyledInitialMessageButton = styled(Button)(({\n theme: {\n base: { spacing }\n }\n}) => {\n return css`\n white-space: normal;\n text-align: left;\n min-width: unset;\n padding-block: ${spacing};\n padding-inline: calc(2 * ${spacing});\n align-items: start;\n\n & + & {\n margin-inline-start: 0;\n }\n `;\n});\n\nStyledInitialMessageButton.defaultProps = defaultThemeProp;\n\nexport const StyledInitialMessageText = styled.span`\n ${lineClamp(3)};\n`;\n\nexport const StyledGenAIAvatar = styled(Avatar)(({\n theme: {\n components: {\n agent: {\n 'coach-message': {\n avatar: { background: avatarBackground }\n }\n }\n }\n }\n}) => {\n return css`\n background: ${avatarBackground};\n `;\n});\n\nStyledGenAIAvatar.defaultProps = defaultThemeProp;\n\nexport const StyledGenAIFooter = styled.div`\n width: 100%;\n max-width: ${maxWidthMessage};\n`;\nexport const StyledStopButton = styled(AIButton)`\n border-radius: 50%;\n`;\n\nexport const StyledToolMessage = styled.p(\n ({\n theme: {\n base: {\n spacing,\n palette: { 'border-line': borderLine }\n }\n }\n }) => {\n return css`\n border-block-end: 0.125rem solid ${borderLine};\n padding: calc(2 * ${spacing});\n `;\n }\n);\n\nStyledToolMessage.defaultProps = defaultThemeProp;\n\nexport const StyledToolMessageContainer = styled.div(\n ({\n theme: {\n base: {\n spacing,\n 'border-radius': borderRadius,\n palette: { 'border-line': borderLine }\n }\n }\n }) => {\n return css`\n border: 0.125rem solid ${borderLine};\n border-radius: min(calc(2 * ${borderRadius}), 1rem);\n margin-block: ${spacing};\n `;\n }\n);\n\nStyledToolMessageContainer.defaultProps = defaultThemeProp;\n\nexport const StyledConfirmationMsg = styled(RichTextViewer)(\n ({\n theme: {\n base,\n components: {\n 'form-control': {\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n }\n }\n }\n }) => `\n padding: 0;\n background-color: ${readOnlyBackgroundColor};\n border-radius: calc(0.5 * ${base['border-radius']});\n`\n);\n\nStyledConfirmationMsg.defaultProps = defaultThemeProp;\n\nexport const StyledActionsContainer = styled.div(\n () => css`\n margin-inline-start: auto;\n\n && button {\n margin-inline-start: 0;\n }\n `\n);\n\nStyledActionsContainer.defaultProps = defaultThemeProp;\n\nexport const StyledScrollButton = styled(Button)(({ theme }) => {\n return css`\n position: absolute;\n bottom: calc(var(--composer-height, 0rem) + calc(5 * ${theme.base.spacing}));\n width: fit-content;\n align-self: center;\n z-index: 1;\n box-shadow: ${theme.base.shadow.high};\n `;\n});\n\nStyledScrollButton.defaultProps = defaultThemeProp;\n\nexport const ProgressAngleStyle = createGlobalStyle`\n @property --angle {\n syntax: \"<angle>\";\n inherits: true;\n initial-value: 0deg;\n }\n`;\n\nexport const StyledProgressContainer = styled.div(({ theme }) => {\n return css`\n position: relative;\n isolation: isolate;\n border-radius: calc(2 * ${theme.base.spacing});\n border-start-start-radius: calc(0.5 * ${theme.base.spacing});\n border: calc(0.125 * ${theme.base.spacing}) solid transparent;\n background:\n linear-gradient(${theme.base.colors.white} 0 0) padding-box,\n conic-gradient(\n from var(--angle) in oklab,\n ${theme.base.colors.white} 0%,\n ${theme.base.colors.white} 10%,\n ${theme.base.colors.purple['extra-light']} 25%,\n ${theme.base.colors.purple.light} 50%,\n ${theme.base.colors.purple.medium} 75%,\n ${theme.base.colors.purple.dark} 100%\n )\n border-box;\n animation: spin 1s ease-in-out infinite;\n width: fit-content;\n\n @keyframes spin {\n to {\n --angle: 360deg;\n }\n }\n `;\n});\n\nStyledProgressContainer.defaultProps = defaultThemeProp;\n\nexport const StyledProgressContent = styled.div(({ theme }) => {\n return css`\n background: ${theme.components.agent.background};\n border-radius: calc(2 * ${theme.base.spacing});\n border-start-start-radius: calc(0.5 * ${theme.base.spacing});\n padding: calc(2 * ${theme.base.spacing});\n\n ${StyledProgressRing} {\n width: ${theme.components.icon.size.s};\n }\n `;\n});\n\nStyledProgressContent.defaultProps = defaultThemeProp;\n\nexport const StyledProgressText = styled(Text)(({ theme }) => {\n return css`\n color: ${theme.base.palette.ai};\n `;\n});\n\nStyledProgressText.defaultProps = defaultThemeProp;\n\nexport const StyledActionContainer = styled(Flex)`\n && {\n display: flex;\n }\n\n && > button:first-child:not(:last-child) {\n margin-inline-end: 0;\n }\n margin-inline-end: auto;\n`;\n\nexport const StyledToolCandidatesModal = styled(Modal)(({ theme }) => {\n return css`\n max-width: ${theme.base['content-width'].xl};\n `;\n});\n\nStyledToolCandidatesModal.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Dispatch, Ref, SetStateAction } from 'react';
|
|
1
|
+
import type { Dispatch, ReactNode, Ref, SetStateAction } from 'react';
|
|
2
2
|
import type { BaseProps, MenuProps, OmitStrict, ProgressProps, RequireAtLeastOne, TestIdProp, WithAttributes, ActionsProps, FileItemProps, FileDisplayProps, LightboxProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { MDMap } from '@pega/cosmos-react-rte';
|
|
4
4
|
export type State = 'minimized' | 'maximized';
|
|
@@ -54,6 +54,11 @@ export interface ToolDetailsProps {
|
|
|
54
54
|
onCancel?: () => void;
|
|
55
55
|
toolsConfirmed: boolean;
|
|
56
56
|
}
|
|
57
|
+
export interface ToolCandidateDetailsProps {
|
|
58
|
+
loading?: boolean;
|
|
59
|
+
error?: string;
|
|
60
|
+
renderCandidatesTable?: () => ReactNode;
|
|
61
|
+
}
|
|
57
62
|
export type CoachMessageProps = RequireAtLeastOne<Partial<Pick<GenAICoachProps, 'onSend'>> & BaseProps & TestIdProp & Pick<MessageProps, 'id' | 'announceInteraction' | 'ref'> & (ToolDetailsProps | {
|
|
58
63
|
toolMessage?: never;
|
|
59
64
|
isToolConfirmation?: false;
|
|
@@ -81,6 +86,10 @@ export type CoachMessageProps = RequireAtLeastOne<Partial<Pick<GenAICoachProps,
|
|
|
81
86
|
promptFeedbackOn?: FeedbackPrompt;
|
|
82
87
|
allowFeedbackResubmission?: boolean;
|
|
83
88
|
};
|
|
89
|
+
toolCandidates?: {
|
|
90
|
+
toolState: ToolCandidateDetailsProps;
|
|
91
|
+
onViewToolsConsidered: (id: MessageProps['id']) => void;
|
|
92
|
+
};
|
|
84
93
|
onAnimationCursorUpdate?: (animatedTillCursor: number) => void;
|
|
85
94
|
animationInitialCursorPos?: number;
|
|
86
95
|
}, 'loading' | 'message' | 'error'>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAICoach.types.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,c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components/GenAICoach/GenAICoach.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Dispatch, Ref, SetStateAction } from 'react';\n\nimport type {\n BaseProps,\n MenuProps,\n OmitStrict,\n ProgressProps,\n RequireAtLeastOne,\n TestIdProp,\n WithAttributes,\n ActionsProps,\n FileItemProps,\n FileDisplayProps,\n LightboxProps\n} from '@pega/cosmos-react-core';\nimport type { MDMap } from '@pega/cosmos-react-rte';\n\nexport type State = 'minimized' | 'maximized';\nexport type Reaction = 'liked' | 'disliked';\nexport type FeedbackPrompt = 'liked' | 'disliked' | 'both';\n\nexport type Variant =\n | {\n placement: 'utilities';\n state: State;\n onStateChange: (state: State) => void;\n setGenAIHeight?: Dispatch<SetStateAction<number | undefined>>;\n }\n | { placement: 'fullpage' }\n | { placement: 'dialog'; onClose: () => void };\n\nexport interface MessageProps {\n id: string;\n message: string;\n announceInteraction?: boolean;\n attachments?: FileDisplayProps[];\n /**\n * Whether the message is a suggestion from the composer\n * @default false\n */\n fromComposer?: boolean;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLLIElement>;\n}\n\nexport type InitialSuggestedMessageProps = Pick<GenAICoachProps, 'onSend'> &\n BaseProps &\n TestIdProp &\n MessageProps;\n\nexport interface UserMessageProps extends BaseProps, TestIdProp, MessageProps {\n from: 'user';\n}\n\nexport type ToolParameters = {\n id: string;\n label: string;\n type: 'text' | 'number' | 'boolean';\n value: string;\n required: boolean;\n};\n\nexport interface Tool {\n id: string;\n name: string;\n message: string;\n decision: 'accept' | 'modify' | 'reject';\n parameters: ToolParameters[];\n}\n\nexport interface ToolDetailsProps {\n toolMessage: string;\n isToolConfirmation: true;\n tools: Tool[];\n onSubmit?: (tools: Tool[]) => void;\n onCancel?: () => void;\n toolsConfirmed: boolean;\n}\n\nexport type CoachMessageProps = RequireAtLeastOne<\n Partial<Pick<GenAICoachProps, 'onSend'>> &\n BaseProps &\n TestIdProp &\n Pick<MessageProps, 'id' | 'announceInteraction' | 'ref'> &\n (\n | ToolDetailsProps\n | {\n toolMessage?: never;\n isToolConfirmation?: false;\n tools?: never;\n onSubmit?: never;\n onCancel?: never;\n toolsConfirmed?: never;\n }\n ) & {\n from: 'coach';\n coachName: string;\n suggestions?: MessageProps[];\n loading?: boolean;\n enableStreaming?: boolean;\n allChunksReceived?: boolean;\n error?: string;\n message?: MessageProps['message'];\n messageActions?: ActionsProps;\n markdownMap?: MDMap;\n onStreamingUpdate?: (isStreamingDone: boolean) => void;\n feedback?: {\n reaction: Reaction | undefined;\n feedbackText?: string;\n onReaction: (id: MessageProps['id'], reaction: Reaction | undefined) => void;\n onFeedbackComplete: (id: MessageProps['id'], comment?: string) => void;\n promptFeedbackOn?: FeedbackPrompt;\n allowFeedbackResubmission?: boolean;\n };\n onAnimationCursorUpdate?: (animatedTillCursor: number) => void;\n animationInitialCursorPos?: number;\n },\n 'loading' | 'message' | 'error'\n>;\n\nexport interface SystemMessageProps\n extends TestIdProp,\n Pick<MessageProps, 'id' | 'message' | 'ref' | 'announceInteraction'> {\n from: 'system';\n loading?: boolean;\n}\n\nexport type GenAIMessageProps = UserMessageProps | CoachMessageProps | SystemMessageProps;\n\nexport interface ConversationHistoryProps extends TestIdProp {\n /** List of History items. */\n data: {\n id: string;\n section: string;\n conversations: {\n id: string;\n title: string;\n }[];\n }[];\n /** Click event for items within the list. */\n onItemClick?: (conversationId: string) => void;\n /** List loading state. */\n loading?: boolean;\n /** Called at scroll trigger to load more items. */\n loadMore?: () => void;\n /** True if History view is rendered in Full page view. */\n inFullPage?: boolean;\n /** Callback triggered when closing the history view. */\n onDismiss: () => void;\n /** Id of the selected item. */\n selectedItemId?: string;\n /** Set if there is an error in retreiving the data. */\n error?: string;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport type SendMessageProps = OmitStrict<MessageProps, 'attachments'> & {\n attachmentIds?: string[];\n tools?: Tool[];\n toolMessage?: string;\n};\n\nexport type GenAICoachProps = WithAttributes<\n 'div',\n TestIdProp & {\n /** Chat loading indicator */\n loading?: boolean | ProgressProps['message'];\n /** Set if there is an error in retreiving the data */\n error?: string;\n /** Coaches available in the chat header */\n coachOptions: MenuProps['items'];\n /** Handle the coach selections */\n onCoachChange: (id: MenuProps['id']) => void;\n /** Suggested messages to start the conversation */\n initialSuggestedMessages?: MessageProps[];\n /** Additional suggestions presented at the bottom of the chat window */\n suggestions?: MenuProps['items'];\n /** Send prompts */\n onSend: (message: SendMessageProps) => void;\n\n stopProcess?: () => void;\n /** Messages to be shown in the chatting window. */\n messages?: GenAIMessageProps[];\n /** Placement of the component */\n variant: Variant;\n /** From landing page utilities */\n isInLandingPageUtilities?: boolean;\n /** callback when component is mounted */\n onOpen?: () => void;\n /**\n * User would be guided with selective prompts to enable interaction with coach.\n * @default false\n */\n guidedMode?: boolean;\n /** Pass an array of Action objects to show Action button. */\n actions?: ActionsProps;\n /** Pass data to show history view. */\n conversationHistory?: ConversationHistoryProps;\n /** Callback triggered when the layout component changes. */\n onLayoutChange?: (inFullPage: boolean) => void;\n /** Callback when attachment icon is clicked */\n onAddAttachment?: (files: File[]) => void;\n /** Attachments list */\n attachments?: FileItemProps[];\n /** Error in attachments */\n attachmentsError?: string;\n /** Configuration for the Lightbox component that handles preview of media attachments and files */\n lightboxPreviewProps?: LightboxProps;\n /** Enable full screen */\n allowFullScreen?: boolean;\n /** Enable voice to text */\n voiceToTextProps?: {\n enableDictation: boolean;\n langCode: string;\n };\n /** Show welcome state */\n showSalutation?: boolean;\n /** Salutation message */\n salutation?: string;\n }\n>;\n\nexport interface MessageFeedbackProps {\n messageId: MessageProps['id'];\n feedback: CoachMessageProps['feedback'];\n}\n\nexport interface UtilitiesGenAICoachProps extends OmitStrict<GenAICoachProps, 'variant'> {\n onClose?: () => void;\n}\n\nexport interface GenAICoachScrollState {\n userAtBottom: boolean;\n isStreamingActive: boolean;\n smoothScrollOnEnd: boolean;\n initialBufferApplied: boolean;\n ignoreNextScrollEvent: boolean;\n lastScrollTop: number | null;\n bufferMinHeight: number | null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GenAICoach.types.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Dispatch, ReactNode, Ref, SetStateAction } from 'react';\n\nimport type {\n BaseProps,\n MenuProps,\n OmitStrict,\n ProgressProps,\n RequireAtLeastOne,\n TestIdProp,\n WithAttributes,\n ActionsProps,\n FileItemProps,\n FileDisplayProps,\n LightboxProps\n} from '@pega/cosmos-react-core';\nimport type { MDMap } from '@pega/cosmos-react-rte';\n\nexport type State = 'minimized' | 'maximized';\nexport type Reaction = 'liked' | 'disliked';\nexport type FeedbackPrompt = 'liked' | 'disliked' | 'both';\n\nexport type Variant =\n | {\n placement: 'utilities';\n state: State;\n onStateChange: (state: State) => void;\n setGenAIHeight?: Dispatch<SetStateAction<number | undefined>>;\n }\n | { placement: 'fullpage' }\n | { placement: 'dialog'; onClose: () => void };\n\nexport interface MessageProps {\n id: string;\n message: string;\n announceInteraction?: boolean;\n attachments?: FileDisplayProps[];\n /**\n * Whether the message is a suggestion from the composer\n * @default false\n */\n fromComposer?: boolean;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLLIElement>;\n}\n\nexport type InitialSuggestedMessageProps = Pick<GenAICoachProps, 'onSend'> &\n BaseProps &\n TestIdProp &\n MessageProps;\n\nexport interface UserMessageProps extends BaseProps, TestIdProp, MessageProps {\n from: 'user';\n}\n\nexport type ToolParameters = {\n id: string;\n label: string;\n type: 'text' | 'number' | 'boolean';\n value: string;\n required: boolean;\n};\n\nexport interface Tool {\n id: string;\n name: string;\n message: string;\n decision: 'accept' | 'modify' | 'reject';\n parameters: ToolParameters[];\n}\n\nexport interface ToolDetailsProps {\n toolMessage: string;\n isToolConfirmation: true;\n tools: Tool[];\n onSubmit?: (tools: Tool[]) => void;\n onCancel?: () => void;\n toolsConfirmed: boolean;\n}\n\nexport interface ToolCandidateDetailsProps {\n loading?: boolean;\n error?: string;\n renderCandidatesTable?: () => ReactNode;\n}\n\nexport type CoachMessageProps = RequireAtLeastOne<\n Partial<Pick<GenAICoachProps, 'onSend'>> &\n BaseProps &\n TestIdProp &\n Pick<MessageProps, 'id' | 'announceInteraction' | 'ref'> &\n (\n | ToolDetailsProps\n | {\n toolMessage?: never;\n isToolConfirmation?: false;\n tools?: never;\n onSubmit?: never;\n onCancel?: never;\n toolsConfirmed?: never;\n }\n ) & {\n from: 'coach';\n coachName: string;\n suggestions?: MessageProps[];\n loading?: boolean;\n enableStreaming?: boolean;\n allChunksReceived?: boolean;\n error?: string;\n message?: MessageProps['message'];\n messageActions?: ActionsProps;\n markdownMap?: MDMap;\n onStreamingUpdate?: (isStreamingDone: boolean) => void;\n feedback?: {\n reaction: Reaction | undefined;\n feedbackText?: string;\n onReaction: (id: MessageProps['id'], reaction: Reaction | undefined) => void;\n onFeedbackComplete: (id: MessageProps['id'], comment?: string) => void;\n promptFeedbackOn?: FeedbackPrompt;\n allowFeedbackResubmission?: boolean;\n };\n toolCandidates?: {\n toolState: ToolCandidateDetailsProps;\n onViewToolsConsidered: (id: MessageProps['id']) => void;\n };\n onAnimationCursorUpdate?: (animatedTillCursor: number) => void;\n animationInitialCursorPos?: number;\n },\n 'loading' | 'message' | 'error'\n>;\n\nexport interface SystemMessageProps\n extends TestIdProp,\n Pick<MessageProps, 'id' | 'message' | 'ref' | 'announceInteraction'> {\n from: 'system';\n loading?: boolean;\n}\n\nexport type GenAIMessageProps = UserMessageProps | CoachMessageProps | SystemMessageProps;\n\nexport interface ConversationHistoryProps extends TestIdProp {\n /** List of History items. */\n data: {\n id: string;\n section: string;\n conversations: {\n id: string;\n title: string;\n }[];\n }[];\n /** Click event for items within the list. */\n onItemClick?: (conversationId: string) => void;\n /** List loading state. */\n loading?: boolean;\n /** Called at scroll trigger to load more items. */\n loadMore?: () => void;\n /** True if History view is rendered in Full page view. */\n inFullPage?: boolean;\n /** Callback triggered when closing the history view. */\n onDismiss: () => void;\n /** Id of the selected item. */\n selectedItemId?: string;\n /** Set if there is an error in retreiving the data. */\n error?: string;\n /** Ref forwarded to the wrapping element. */\n ref?: Ref<HTMLUListElement>;\n}\n\nexport type SendMessageProps = OmitStrict<MessageProps, 'attachments'> & {\n attachmentIds?: string[];\n tools?: Tool[];\n toolMessage?: string;\n};\n\nexport type GenAICoachProps = WithAttributes<\n 'div',\n TestIdProp & {\n /** Chat loading indicator */\n loading?: boolean | ProgressProps['message'];\n /** Set if there is an error in retreiving the data */\n error?: string;\n /** Coaches available in the chat header */\n coachOptions: MenuProps['items'];\n /** Handle the coach selections */\n onCoachChange: (id: MenuProps['id']) => void;\n /** Suggested messages to start the conversation */\n initialSuggestedMessages?: MessageProps[];\n /** Additional suggestions presented at the bottom of the chat window */\n suggestions?: MenuProps['items'];\n /** Send prompts */\n onSend: (message: SendMessageProps) => void;\n\n stopProcess?: () => void;\n /** Messages to be shown in the chatting window. */\n messages?: GenAIMessageProps[];\n /** Placement of the component */\n variant: Variant;\n /** From landing page utilities */\n isInLandingPageUtilities?: boolean;\n /** callback when component is mounted */\n onOpen?: () => void;\n /**\n * User would be guided with selective prompts to enable interaction with coach.\n * @default false\n */\n guidedMode?: boolean;\n /** Pass an array of Action objects to show Action button. */\n actions?: ActionsProps;\n /** Pass data to show history view. */\n conversationHistory?: ConversationHistoryProps;\n /** Callback triggered when the layout component changes. */\n onLayoutChange?: (inFullPage: boolean) => void;\n /** Callback when attachment icon is clicked */\n onAddAttachment?: (files: File[]) => void;\n /** Attachments list */\n attachments?: FileItemProps[];\n /** Error in attachments */\n attachmentsError?: string;\n /** Configuration for the Lightbox component that handles preview of media attachments and files */\n lightboxPreviewProps?: LightboxProps;\n /** Enable full screen */\n allowFullScreen?: boolean;\n /** Enable voice to text */\n voiceToTextProps?: {\n enableDictation: boolean;\n langCode: string;\n };\n /** Show welcome state */\n showSalutation?: boolean;\n /** Salutation message */\n salutation?: string;\n }\n>;\n\nexport interface MessageFeedbackProps {\n messageId: MessageProps['id'];\n feedback: CoachMessageProps['feedback'];\n}\n\nexport interface UtilitiesGenAICoachProps extends OmitStrict<GenAICoachProps, 'variant'> {\n onClose?: () => void;\n}\n\nexport interface GenAICoachScrollState {\n userAtBottom: boolean;\n isStreamingActive: boolean;\n smoothScrollOnEnd: boolean;\n initialBufferApplied: boolean;\n ignoreNextScrollEvent: boolean;\n lastScrollTop: number | null;\n bufferMinHeight: number | null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIMessage.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAIMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,+BAA+B,
|
|
1
|
+
{"version":3,"file":"GenAIMessage.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAIMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,+BAA+B,EAIrC,MAAM,yBAAyB,CAAC;AAMjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAoB5D,KAAK,qBAAqB,GAAG;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,uBAAuB;AACvB,eAAO,MAAM,gBAAgB,4DAE3B,CAAC;AAEH,QAAA,MAAM,YAAY,EAAE,+BAA+B,CAAC,iBAAiB,CAsRpE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, forwardRef, useEffect, useMemo } from 'react';
|
|
3
|
-
import { Button, Flex, Progress, registerIcon, useI18n, useTheme, useTestIds, ErrorState, markdownToPlainText, Actions } from '@pega/cosmos-react-core';
|
|
2
|
+
import { createContext, forwardRef, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { Button, Flex, Progress, registerIcon, useI18n, useTheme, useTestIds, ErrorState, markdownToPlainText, Actions, Icon, useModalManager } from '@pega/cosmos-react-core';
|
|
4
4
|
import * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';
|
|
5
|
+
import * as brainIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/brain.icon';
|
|
5
6
|
import { RichTextViewer } from '@pega/cosmos-react-rte';
|
|
6
7
|
import { useAnimatedText } from '@pega/cosmos-react-core';
|
|
7
8
|
import { StyledActionsContainer, StyledAttachmentsList, StyledGenAIAvatar, StyledMessage, StyledSuggestion, StyledSuggestionsContainer, StyledSystemMessage, StyledUserMessage } from './GenAICoach.styles';
|
|
@@ -10,7 +11,8 @@ import { isCoachMessage, isUserMessage } from './GenAICoach.utils';
|
|
|
10
11
|
import GenAIMessageProgress from './GenAIMessageProgress';
|
|
11
12
|
import ToolConfirmationMessage from './ToolConfirmationMessage';
|
|
12
13
|
import GenAIMessageFeedbackButtons from './GenAIMessageFeedback';
|
|
13
|
-
|
|
14
|
+
import ToolCandidates from './ToolCandidates';
|
|
15
|
+
registerIcon(polarisSolidIcon, brainIcon);
|
|
14
16
|
/** Metadata Context */
|
|
15
17
|
export const StreamingContext = createContext({
|
|
16
18
|
isStreamingMessage: false
|
|
@@ -19,9 +21,12 @@ const GenAIMessage = forwardRef(function GenAIMessage(props, ref) {
|
|
|
19
21
|
const testIds = useTestIds(props.testId, getGenAICoachTestIds);
|
|
20
22
|
const theme = useTheme();
|
|
21
23
|
const t = useI18n();
|
|
24
|
+
const { create } = useModalManager();
|
|
25
|
+
const modalMethodsRef = useRef(null);
|
|
22
26
|
const { message, announceInteraction, ...restProps } = props;
|
|
23
27
|
const plainTextMessage = markdownToPlainText(message ?? '');
|
|
24
28
|
let ariaLabel = plainTextMessage;
|
|
29
|
+
const toolCandidates = isCoachMessage(props) ? props.toolCandidates : undefined;
|
|
25
30
|
const isStreamingMessage = isCoachMessage(props) && props.enableStreaming;
|
|
26
31
|
const allChunksReceived = isCoachMessage(props) && props.allChunksReceived;
|
|
27
32
|
const enableStreaming = !!isStreamingMessage && !allChunksReceived;
|
|
@@ -44,12 +49,32 @@ const GenAIMessage = forwardRef(function GenAIMessage(props, ref) {
|
|
|
44
49
|
props.onStreamingUpdate(!!allChunksReceived && isStreamingDone);
|
|
45
50
|
}
|
|
46
51
|
}, [enableStreaming, isStreamingDone, allChunksReceived]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (isCoachMessage(props) && toolCandidates && modalMethodsRef.current) {
|
|
54
|
+
modalMethodsRef.current.update({
|
|
55
|
+
loading: toolCandidates.toolState?.loading,
|
|
56
|
+
error: toolCandidates.toolState?.error,
|
|
57
|
+
renderCandidatesTable: toolCandidates.toolState?.renderCandidatesTable
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}, [toolCandidates]);
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
return () => {
|
|
63
|
+
const modalMethods = modalMethodsRef.current;
|
|
64
|
+
if (!modalMethods) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
modalMethods.dismiss();
|
|
68
|
+
modalMethods.unmount();
|
|
69
|
+
};
|
|
70
|
+
}, []);
|
|
47
71
|
const streamingContext = useMemo(() => {
|
|
48
72
|
return { isStreamingMessage, isStreamingInProgress: isCoachMessage(props) && props.loading };
|
|
49
73
|
}, [isStreamingMessage, props]);
|
|
50
74
|
if (isCoachMessage(props)) {
|
|
51
75
|
const { id: messageId, coachName, suggestions, onSend, loading, error, feedback, markdownMap, messageActions } = props;
|
|
52
76
|
const { reaction } = feedback ?? {};
|
|
77
|
+
const { toolState, onViewToolsConsidered } = toolCandidates ?? {};
|
|
53
78
|
let selectedFeedbackResponse;
|
|
54
79
|
let feedbackAriaLabel = t('sender_replied_message', [coachName, plainTextMessage ?? '']);
|
|
55
80
|
if (feedback && reaction) {
|
|
@@ -65,8 +90,21 @@ const GenAIMessage = forwardRef(function GenAIMessage(props, ref) {
|
|
|
65
90
|
if (announceInteraction) {
|
|
66
91
|
ariaLabel = `${ariaLabel} ${t('interaction_message')}`;
|
|
67
92
|
}
|
|
93
|
+
const onClickToolsConsidered = () => {
|
|
94
|
+
modalMethodsRef.current = create(ToolCandidates, {
|
|
95
|
+
loading: toolState?.loading,
|
|
96
|
+
error: toolState?.error,
|
|
97
|
+
renderCandidatesTable: toolState?.renderCandidatesTable
|
|
98
|
+
});
|
|
99
|
+
onViewToolsConsidered?.(messageId);
|
|
100
|
+
};
|
|
68
101
|
const streamingContent = isStreamingMessage && (_jsx(_Fragment, { children: message ? (_jsxs(_Fragment, { children: [_jsx(StreamingContext.Provider, { value: streamingContext, children: _jsx(RichTextViewer, { content: isStreamingMessage ? streamingMessage : message, type: 'markdown', markdownMap: markdownMap }) }), loading && _jsx(Progress, { variant: 'ellipsis', placement: 'inline' })] })) : (loading && _jsx(GenAIMessageProgress, {})) }));
|
|
69
|
-
return (_jsx(Flex, { as: 'li', "data-testid": testIds.coachMessage, ...restProps, container: { direction: 'row', pad: [1, 0], gap: 1 }, type: 'message', "aria-label": ariaLabel, ref: ref, children: _jsxs(_Fragment, { children: [_jsx(StyledGenAIAvatar, { name: coachName, icon: 'polaris-solid', color: theme.base.palette.ai, shape: 'circle', size: 'm' }), _jsxs(StyledMessage, { children: [streamingContent, loading || error ? (_jsxs(_Fragment, { children: [loading && !isStreamingMessage && (_jsx(GenAIMessageProgress, { ...(message ? { messages: [message] } : {}) })), error && _jsx(ErrorState, { message: error })] })) : (_jsxs(_Fragment, { children: [!isStreamingMessage && message && (_jsx(RichTextViewer, { content: message, type: 'markdown', markdownMap: markdownMap })), props.isToolConfirmation && _jsx(ToolConfirmationMessage, { ...props }), (feedback || messageActions
|
|
102
|
+
return (_jsx(Flex, { as: 'li', "data-testid": testIds.coachMessage, ...restProps, container: { direction: 'row', pad: [1, 0], gap: 1 }, type: 'message', "aria-label": ariaLabel, ref: ref, children: _jsxs(_Fragment, { children: [_jsx(StyledGenAIAvatar, { name: coachName, icon: 'polaris-solid', color: theme.base.palette.ai, shape: 'circle', size: 'm' }), _jsxs(StyledMessage, { children: [streamingContent, loading || error ? (_jsxs(_Fragment, { children: [loading && !isStreamingMessage && (_jsx(GenAIMessageProgress, { ...(message ? { messages: [message] } : {}) })), error && _jsx(ErrorState, { message: error })] })) : (_jsxs(_Fragment, { children: [!isStreamingMessage && message && (_jsx(RichTextViewer, { content: message, type: 'markdown', markdownMap: markdownMap })), props.isToolConfirmation && _jsx(ToolConfirmationMessage, { ...props }), (feedback || messageActions || onViewToolsConsidered) && (_jsxs(Flex, { container: {
|
|
103
|
+
direction: 'row',
|
|
104
|
+
gap: 1,
|
|
105
|
+
pad: [1, undefined],
|
|
106
|
+
alignItems: 'center'
|
|
107
|
+
}, as: StyledActionsContainer, children: [feedback && (_jsx(GenAIMessageFeedbackButtons, { messageId: messageId, feedback: feedback })), onViewToolsConsidered && (_jsx(Button, { label: t('agent_reasoning'), variant: 'simple', icon: true, compact: true, onClick: onClickToolsConsidered, children: _jsx(Icon, { name: 'brain' }) })), messageActions && _jsx(Actions, { ...messageActions })] })), suggestions && (_jsx(Flex, { as: StyledSuggestionsContainer, container: { direction: 'column', gap: 1 }, children: suggestions.map(({ id, message: prompt }) => {
|
|
70
108
|
return (_jsx(Button, { as: StyledSuggestion, onClick: onSend ? () => onSend({ id, message: prompt }) : undefined, children: prompt }, id));
|
|
71
109
|
}) }))] }))] })] }) }));
|
|
72
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAIMessage.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAIMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGtE,OAAO,EACL,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,mBAAmB,EAEnB,OA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S,GAAG,GAAG,SAAS,IAAI,CAAC,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACzD,CAAC;QAED,OAAO,CACL,MAAC,iBAAiB,IAChB,EAAE,EAAE,iBAAiB,iBACR,OAAO,CAAC,WAAW,KAC5B,SAAS;YACb,qFAAqF;YACrF,IAAI,EAAC,SAAS,gBACF,SAAS,EACrB,GAAG,EAAE,GAAG,aAEP,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,CACpD,KAAC,qBAAqB,IAAC,IAAI,EAAC,SAAS,EAAC,KAAK,EAAE,KAAK,CAAC,WAAW,GAAI,CACnE,EACA,OAAO,IAAI,KAAC,cAAc,IAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,UAAU,GAAG,IAC9C,CACrB,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAChC,EAAE,EAAE,mBAAmB,iBACV,OAAO,CAAC,WAAW,gBACpB,SAAS,EACrB,GAAG,EAAE,GAAG,YAEP,OAAO,GACH,CACR,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { createContext, forwardRef, useEffect, useMemo } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Button,\n Flex,\n Progress,\n registerIcon,\n useI18n,\n useTheme,\n useTestIds,\n ErrorState,\n markdownToPlainText,\n type ForwardRefForwardPropsComponent,\n Actions\n} from '@pega/cosmos-react-core';\nimport * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\nimport { useAnimatedText } from '@pega/cosmos-react-core';\n\nimport type { GenAIMessageProps } from './GenAICoach.types';\nimport {\n StyledActionsContainer,\n StyledAttachmentsList,\n StyledGenAIAvatar,\n StyledMessage,\n StyledSuggestion,\n StyledSuggestionsContainer,\n StyledSystemMessage,\n StyledUserMessage\n} from './GenAICoach.styles';\nimport { getGenAICoachTestIds } from './GenAICoach.test-ids';\nimport { isCoachMessage, isUserMessage } from './GenAICoach.utils';\nimport GenAIMessageProgress from './GenAIMessageProgress';\nimport ToolConfirmationMessage from './ToolConfirmationMessage';\nimport GenAIMessageFeedbackButtons from './GenAIMessageFeedback';\n\nregisterIcon(polarisSolidIcon);\n\ntype StreamingContextProps = {\n isStreamingMessage?: boolean;\n isStreamingInProgress?: boolean;\n};\n\n/** Metadata Context */\nexport const StreamingContext = createContext<StreamingContextProps | undefined>({\n isStreamingMessage: false\n});\n\nconst GenAIMessage: ForwardRefForwardPropsComponent<GenAIMessageProps> = forwardRef(\n function GenAIMessage(props: PropsWithoutRef<GenAIMessageProps>, ref: GenAIMessageProps['ref']) {\n const testIds = useTestIds(props.testId, getGenAICoachTestIds);\n const theme = useTheme();\n const t = useI18n();\n\n const { message, announceInteraction, ...restProps } = props;\n const plainTextMessage = markdownToPlainText(message ?? '');\n let ariaLabel = plainTextMessage;\n\n const isStreamingMessage = isCoachMessage(props) && props.enableStreaming;\n const allChunksReceived = isCoachMessage(props) && props.allChunksReceived;\n const enableStreaming = !!isStreamingMessage && !allChunksReceived;\n\n const {\n text: streamingMessage,\n isAnimationDone: isStreamingDone,\n animatedTillCursor\n } = useAnimatedText({\n text: message ?? '',\n allContentReceived: allChunksReceived === undefined ? true : allChunksReceived,\n enabled: enableStreaming,\n tokenizeMarkdown: true,\n cursorStartIndex:\n isCoachMessage(props) && props.animationInitialCursorPos\n ? props.animationInitialCursorPos\n : undefined\n });\n\n useEffect(() => {\n if (isCoachMessage(props) && props.onAnimationCursorUpdate) {\n props.onAnimationCursorUpdate(animatedTillCursor);\n }\n }, [animatedTillCursor]);\n\n useEffect(() => {\n if (isStreamingMessage && props.onStreamingUpdate) {\n props.onStreamingUpdate(!!allChunksReceived && isStreamingDone);\n }\n }, [enableStreaming, isStreamingDone, allChunksReceived]);\n\n const streamingContext: StreamingContextProps = useMemo(() => {\n return { isStreamingMessage, isStreamingInProgress: isCoachMessage(props) && props.loading };\n }, [isStreamingMessage, props]);\n\n if (isCoachMessage(props)) {\n const {\n id: messageId,\n coachName,\n suggestions,\n onSend,\n loading,\n error,\n feedback,\n markdownMap,\n messageActions\n } = props;\n\n const { reaction } = feedback ?? {};\n\n let selectedFeedbackResponse;\n\n let feedbackAriaLabel = t('sender_replied_message', [coachName, plainTextMessage ?? '']);\n\n if (feedback && reaction) {\n selectedFeedbackResponse = t('selected_noun', [\n reaction === 'liked' ? t('good_response') : t('bad_response')\n ]);\n\n feedbackAriaLabel = `${feedbackAriaLabel} ${selectedFeedbackResponse}`;\n }\n\n ariaLabel =\n suggestions && suggestions.length > 0\n ? `${feedbackAriaLabel} ${t('suggestions_in_message', [suggestions.length])}`\n : feedbackAriaLabel;\n\n if (announceInteraction) {\n ariaLabel = `${ariaLabel} ${t('interaction_message')}`;\n }\n\n const streamingContent = isStreamingMessage && (\n <>\n {message ? (\n <>\n <StreamingContext.Provider value={streamingContext}>\n <RichTextViewer\n content={isStreamingMessage ? streamingMessage : message}\n type='markdown'\n markdownMap={markdownMap}\n />\n </StreamingContext.Provider>\n\n {loading && <Progress variant='ellipsis' placement='inline' />}\n </>\n ) : (\n loading && <GenAIMessageProgress />\n )}\n </>\n );\n\n return (\n <Flex\n as='li'\n data-testid={testIds.coachMessage}\n {...restProps}\n container={{ direction: 'row', pad: [1, 0], gap: 1 }}\n type='message'\n aria-label={ariaLabel}\n ref={ref}\n >\n <>\n <StyledGenAIAvatar\n name={coachName}\n icon='polaris-solid'\n color={theme.base.palette.ai}\n shape='circle'\n size='m'\n />\n\n <StyledMessage>\n {/* Streaming loader and content */}\n {streamingContent}\n\n {loading || error ? (\n <>\n {loading && !isStreamingMessage && (\n <GenAIMessageProgress {...(message ? { messages: [message] } : {})} />\n )}\n {error && <ErrorState message={error} />}\n </>\n ) : (\n <>\n {/* Non streaming content */}\n {!isStreamingMessage && message && (\n <RichTextViewer content={message} type='markdown' markdownMap={markdownMap} />\n )}\n\n {props.isToolConfirmation && <ToolConfirmationMessage {...props} />}\n\n {(feedback || messageActions) && (\n <Flex\n container={{ direction: 'row', gap: 1, pad: [1, undefined] }}\n as={StyledActionsContainer}\n >\n {feedback && (\n <GenAIMessageFeedbackButtons messageId={messageId} feedback={feedback} />\n )}\n\n {messageActions && <Actions {...messageActions} />}\n </Flex>\n )}\n\n {suggestions && (\n <Flex\n as={StyledSuggestionsContainer}\n container={{ direction: 'column', gap: 1 }}\n >\n {suggestions.map(({ id, message: prompt }) => {\n return (\n <Button\n as={StyledSuggestion}\n onClick={onSend ? () => onSend({ id, message: prompt }) : undefined}\n key={id}\n >\n {prompt}\n </Button>\n );\n })}\n </Flex>\n )}\n </>\n )}\n </StyledMessage>\n </>\n </Flex>\n );\n }\n\n if (isUserMessage(props)) {\n if (plainTextMessage) {\n ariaLabel = t('you_asked', [plainTextMessage]);\n }\n\n if (announceInteraction) {\n ariaLabel = `${ariaLabel} ${t('interaction_message')}`;\n }\n\n return (\n <StyledUserMessage\n as={StyledUserMessage}\n data-testid={testIds.userMessage}\n {...restProps}\n // @ts-expect-error FIXME: Need to validate if we can remove message, and double 'as'\n type='message'\n aria-label={ariaLabel}\n ref={ref}\n >\n {props.attachments && props.attachments.length > 0 && (\n <StyledAttachmentsList type='display' items={props.attachments} />\n )}\n {message && <RichTextViewer content={message} type='markdown' />}\n </StyledUserMessage>\n );\n }\n\n if (props.from === 'system') {\n return (\n <Flex\n container={{ justify: 'center' }}\n as={StyledSystemMessage}\n data-testid={testIds.userMessage}\n aria-label={ariaLabel}\n ref={ref}\n >\n {message}\n </Flex>\n );\n }\n\n return null;\n }\n);\n\nexport default GenAIMessage;\n"]}
|
|
1
|
+
{"version":3,"file":"GenAIMessage.js","sourceRoot":"","sources":["../../../src/components/GenA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AQ,EAAE,CAAC;QAC5B,OAAO,CACL,KAAC,IAAI,IACH,SAAS,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAChC,EAAE,EAAE,mBAAmB,iBACV,OAAO,CAAC,WAAW,gBACpB,SAAS,EACrB,GAAG,EAAE,GAAG,YAEP,OAAO,GACH,CACR,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { createContext, forwardRef, useEffect, useMemo, useRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Button,\n Flex,\n Progress,\n registerIcon,\n useI18n,\n useTheme,\n useTestIds,\n ErrorState,\n markdownToPlainText,\n type ForwardRefForwardPropsComponent,\n Actions,\n Icon,\n useModalManager\n} from '@pega/cosmos-react-core';\nimport * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';\nimport * as brainIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/brain.icon';\nimport { RichTextViewer } from '@pega/cosmos-react-rte';\nimport { useAnimatedText } from '@pega/cosmos-react-core';\n\nimport type { GenAIMessageProps } from './GenAICoach.types';\nimport {\n StyledActionsContainer,\n StyledAttachmentsList,\n StyledGenAIAvatar,\n StyledMessage,\n StyledSuggestion,\n StyledSuggestionsContainer,\n StyledSystemMessage,\n StyledUserMessage\n} from './GenAICoach.styles';\nimport { getGenAICoachTestIds } from './GenAICoach.test-ids';\nimport { isCoachMessage, isUserMessage } from './GenAICoach.utils';\nimport GenAIMessageProgress from './GenAIMessageProgress';\nimport ToolConfirmationMessage from './ToolConfirmationMessage';\nimport GenAIMessageFeedbackButtons from './GenAIMessageFeedback';\nimport ToolCandidates from './ToolCandidates';\n\nregisterIcon(polarisSolidIcon, brainIcon);\n\ntype StreamingContextProps = {\n isStreamingMessage?: boolean;\n isStreamingInProgress?: boolean;\n};\n\n/** Metadata Context */\nexport const StreamingContext = createContext<StreamingContextProps | undefined>({\n isStreamingMessage: false\n});\n\nconst GenAIMessage: ForwardRefForwardPropsComponent<GenAIMessageProps> = forwardRef(\n function GenAIMessage(props: PropsWithoutRef<GenAIMessageProps>, ref: GenAIMessageProps['ref']) {\n const testIds = useTestIds(props.testId, getGenAICoachTestIds);\n const theme = useTheme();\n const t = useI18n();\n const { create } = useModalManager();\n\n const modalMethodsRef = useRef<ReturnType<typeof create> | null>(null);\n\n const { message, announceInteraction, ...restProps } = props;\n const plainTextMessage = markdownToPlainText(message ?? '');\n let ariaLabel = plainTextMessage;\n\n const toolCandidates = isCoachMessage(props) ? props.toolCandidates : undefined;\n\n const isStreamingMessage = isCoachMessage(props) && props.enableStreaming;\n const allChunksReceived = isCoachMessage(props) && props.allChunksReceived;\n const enableStreaming = !!isStreamingMessage && !allChunksReceived;\n\n const {\n text: streamingMessage,\n isAnimationDone: isStreamingDone,\n animatedTillCursor\n } = useAnimatedText({\n text: message ?? '',\n allContentReceived: allChunksReceived === undefined ? true : allChunksReceived,\n enabled: enableStreaming,\n tokenizeMarkdown: true,\n cursorStartIndex:\n isCoachMessage(props) && props.animationInitialCursorPos\n ? props.animationInitialCursorPos\n : undefined\n });\n\n useEffect(() => {\n if (isCoachMessage(props) && props.onAnimationCursorUpdate) {\n props.onAnimationCursorUpdate(animatedTillCursor);\n }\n }, [animatedTillCursor]);\n\n useEffect(() => {\n if (isStreamingMessage && props.onStreamingUpdate) {\n props.onStreamingUpdate(!!allChunksReceived && isStreamingDone);\n }\n }, [enableStreaming, isStreamingDone, allChunksReceived]);\n\n useEffect(() => {\n if (isCoachMessage(props) && toolCandidates && modalMethodsRef.current) {\n modalMethodsRef.current.update({\n loading: toolCandidates.toolState?.loading,\n error: toolCandidates.toolState?.error,\n renderCandidatesTable: toolCandidates.toolState?.renderCandidatesTable\n });\n }\n }, [toolCandidates]);\n\n useEffect(() => {\n return () => {\n const modalMethods = modalMethodsRef.current;\n\n if (!modalMethods) {\n return;\n }\n\n modalMethods.dismiss();\n modalMethods.unmount();\n };\n }, []);\n\n const streamingContext: StreamingContextProps = useMemo(() => {\n return { isStreamingMessage, isStreamingInProgress: isCoachMessage(props) && props.loading };\n }, [isStreamingMessage, props]);\n\n if (isCoachMessage(props)) {\n const {\n id: messageId,\n coachName,\n suggestions,\n onSend,\n loading,\n error,\n feedback,\n markdownMap,\n messageActions\n } = props;\n\n const { reaction } = feedback ?? {};\n const { toolState, onViewToolsConsidered } = toolCandidates ?? {};\n\n let selectedFeedbackResponse;\n\n let feedbackAriaLabel = t('sender_replied_message', [coachName, plainTextMessage ?? '']);\n\n if (feedback && reaction) {\n selectedFeedbackResponse = t('selected_noun', [\n reaction === 'liked' ? t('good_response') : t('bad_response')\n ]);\n\n feedbackAriaLabel = `${feedbackAriaLabel} ${selectedFeedbackResponse}`;\n }\n\n ariaLabel =\n suggestions && suggestions.length > 0\n ? `${feedbackAriaLabel} ${t('suggestions_in_message', [suggestions.length])}`\n : feedbackAriaLabel;\n\n if (announceInteraction) {\n ariaLabel = `${ariaLabel} ${t('interaction_message')}`;\n }\n\n const onClickToolsConsidered = () => {\n modalMethodsRef.current = create(ToolCandidates, {\n loading: toolState?.loading,\n error: toolState?.error,\n renderCandidatesTable: toolState?.renderCandidatesTable\n });\n\n onViewToolsConsidered?.(messageId);\n };\n\n const streamingContent = isStreamingMessage && (\n <>\n {message ? (\n <>\n <StreamingContext.Provider value={streamingContext}>\n <RichTextViewer\n content={isStreamingMessage ? streamingMessage : message}\n type='markdown'\n markdownMap={markdownMap}\n />\n </StreamingContext.Provider>\n\n {loading && <Progress variant='ellipsis' placement='inline' />}\n </>\n ) : (\n loading && <GenAIMessageProgress />\n )}\n </>\n );\n\n return (\n <Flex\n as='li'\n data-testid={testIds.coachMessage}\n {...restProps}\n container={{ direction: 'row', pad: [1, 0], gap: 1 }}\n type='message'\n aria-label={ariaLabel}\n ref={ref}\n >\n <>\n <StyledGenAIAvatar\n name={coachName}\n icon='polaris-solid'\n color={theme.base.palette.ai}\n shape='circle'\n size='m'\n />\n\n <StyledMessage>\n {/* Streaming loader and content */}\n {streamingContent}\n\n {loading || error ? (\n <>\n {loading && !isStreamingMessage && (\n <GenAIMessageProgress {...(message ? { messages: [message] } : {})} />\n )}\n {error && <ErrorState message={error} />}\n </>\n ) : (\n <>\n {/* Non streaming content */}\n {!isStreamingMessage && message && (\n <RichTextViewer content={message} type='markdown' markdownMap={markdownMap} />\n )}\n\n {props.isToolConfirmation && <ToolConfirmationMessage {...props} />}\n\n {(feedback || messageActions || onViewToolsConsidered) && (\n <Flex\n container={{\n direction: 'row',\n gap: 1,\n pad: [1, undefined],\n alignItems: 'center'\n }}\n as={StyledActionsContainer}\n >\n {feedback && (\n <GenAIMessageFeedbackButtons messageId={messageId} feedback={feedback} />\n )}\n\n {onViewToolsConsidered && (\n <Button\n label={t('agent_reasoning')}\n variant='simple'\n icon\n compact\n onClick={onClickToolsConsidered}\n >\n <Icon name='brain' />\n </Button>\n )}\n\n {messageActions && <Actions {...messageActions} />}\n </Flex>\n )}\n\n {suggestions && (\n <Flex\n as={StyledSuggestionsContainer}\n container={{ direction: 'column', gap: 1 }}\n >\n {suggestions.map(({ id, message: prompt }) => {\n return (\n <Button\n as={StyledSuggestion}\n onClick={onSend ? () => onSend({ id, message: prompt }) : undefined}\n key={id}\n >\n {prompt}\n </Button>\n );\n })}\n </Flex>\n )}\n </>\n )}\n </StyledMessage>\n </>\n </Flex>\n );\n }\n\n if (isUserMessage(props)) {\n if (plainTextMessage) {\n ariaLabel = t('you_asked', [plainTextMessage]);\n }\n\n if (announceInteraction) {\n ariaLabel = `${ariaLabel} ${t('interaction_message')}`;\n }\n\n return (\n <StyledUserMessage\n as={StyledUserMessage}\n data-testid={testIds.userMessage}\n {...restProps}\n // @ts-expect-error FIXME: Need to validate if we can remove message, and double 'as'\n type='message'\n aria-label={ariaLabel}\n ref={ref}\n >\n {props.attachments && props.attachments.length > 0 && (\n <StyledAttachmentsList type='display' items={props.attachments} />\n )}\n {message && <RichTextViewer content={message} type='markdown' />}\n </StyledUserMessage>\n );\n }\n\n if (props.from === 'system') {\n return (\n <Flex\n container={{ justify: 'center' }}\n as={StyledSystemMessage}\n data-testid={testIds.userMessage}\n aria-label={ariaLabel}\n ref={ref}\n >\n {message}\n </Flex>\n );\n }\n\n return null;\n }\n);\n\nexport default GenAIMessage;\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ToolCandidateDetailsProps } from './GenAICoach.types';
|
|
2
|
+
declare const ToolCandidates: ({ loading, error, renderCandidatesTable }: ToolCandidateDetailsProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default ToolCandidates;
|
|
4
|
+
//# sourceMappingURL=ToolCandidates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCandidates.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/ToolCandidates.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAGpE,QAAA,MAAM,cAAc,GAAI,2CAIrB,yBAAyB,4CAqB3B,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorState, Flex, Progress, useI18n } from '@pega/cosmos-react-core';
|
|
3
|
+
import { StyledToolCandidatesModal } from './GenAICoach.styles';
|
|
4
|
+
const ToolCandidates = ({ loading = true, error, renderCandidatesTable }) => {
|
|
5
|
+
const t = useI18n();
|
|
6
|
+
let content = null;
|
|
7
|
+
if (loading) {
|
|
8
|
+
content = _jsx(Progress, { placement: 'block', variant: 'ring' });
|
|
9
|
+
}
|
|
10
|
+
else if (error) {
|
|
11
|
+
content = _jsx(ErrorState, { message: error });
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
content = (_jsxs(Flex, { container: { direction: 'column', gap: 1 }, children: [t('reasoning_disclaimer'), renderCandidatesTable?.()] }));
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(StyledToolCandidatesModal, { heading: t('agent_reasoning'), children: content }));
|
|
17
|
+
};
|
|
18
|
+
export default ToolCandidates;
|
|
19
|
+
//# sourceMappingURL=ToolCandidates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCandidates.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/ToolCandidates.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAG9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,MAAM,cAAc,GAAG,CAAC,EACtB,OAAO,GAAG,IAAI,EACd,KAAK,EACL,qBAAqB,EACK,EAAE,EAAE;IAC9B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IAEpB,IAAI,OAAO,GAAc,IAAI,CAAC;IAE9B,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,GAAG,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,EAAC,OAAO,EAAC,MAAM,GAAG,CAAC;IAC1D,CAAC;SAAM,IAAI,KAAK,EAAE,CAAC;QACjB,OAAO,GAAG,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,GAAI,CAAC;IAC3C,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,CACR,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,aAC7C,CAAC,CAAC,sBAAsB,CAAC,EACzB,qBAAqB,EAAE,EAAE,IACrB,CACR,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,yBAAyB,IAAC,OAAO,EAAE,CAAC,CAAC,iBAAiB,CAAC,YAAG,OAAO,GAA6B,CAChG,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import type { ReactNode } from 'react';\n\nimport { ErrorState, Flex, Progress, useI18n } from '@pega/cosmos-react-core';\n\nimport type { ToolCandidateDetailsProps } from './GenAICoach.types';\nimport { StyledToolCandidatesModal } from './GenAICoach.styles';\n\nconst ToolCandidates = ({\n loading = true,\n error,\n renderCandidatesTable\n}: ToolCandidateDetailsProps) => {\n const t = useI18n();\n\n let content: ReactNode = null;\n\n if (loading) {\n content = <Progress placement='block' variant='ring' />;\n } else if (error) {\n content = <ErrorState message={error} />;\n } else {\n content = (\n <Flex container={{ direction: 'column', gap: 1 }}>\n {t('reasoning_disclaimer')}\n {renderCandidatesTable?.()}\n </Flex>\n );\n }\n\n return (\n <StyledToolCandidatesModal heading={t('agent_reasoning')}>{content}</StyledToolCandidatesModal>\n );\n};\n\nexport default ToolCandidates;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-work",
|
|
3
|
-
"version": "9.0.0-build.21.
|
|
3
|
+
"version": "9.0.0-build.21.3",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-core": "9.0.0-build.21.
|
|
18
|
-
"@pega/cosmos-react-rte": "9.0.0-build.21.
|
|
17
|
+
"@pega/cosmos-react-core": "9.0.0-build.21.3",
|
|
18
|
+
"@pega/cosmos-react-rte": "9.0.0-build.21.3",
|
|
19
19
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
20
20
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
21
21
|
"polished": "^4.1.0",
|