@pega/cosmos-react-work 8.9.5 → 8.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
  2. package/lib/components/CaseView/CaseView.styles.js +4 -1
  3. package/lib/components/CaseView/CaseView.styles.js.map +1 -1
  4. package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
  5. package/lib/components/GenAICoach/GenAICoach.js +109 -39
  6. package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
  7. package/lib/components/GenAICoach/GenAICoach.styles.d.ts +9 -1
  8. package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
  9. package/lib/components/GenAICoach/GenAICoach.styles.js +70 -16
  10. package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
  11. package/lib/components/GenAICoach/GenAICoach.types.d.ts +11 -0
  12. package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
  13. package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
  14. package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
  15. package/lib/components/GenAICoach/GenAIMessage.js +13 -5
  16. package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
  17. package/lib/components/GenAICoach/InitialSuggestedMessage.d.ts.map +1 -1
  18. package/lib/components/GenAICoach/InitialSuggestedMessage.js +5 -6
  19. package/lib/components/GenAICoach/InitialSuggestedMessage.js.map +1 -1
  20. package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts.map +1 -1
  21. package/lib/components/UtilitiesLayout/UtilitiesLayout.js +3 -2
  22. package/lib/components/UtilitiesLayout/UtilitiesLayout.js.map +1 -1
  23. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts.map +1 -1
  24. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js +2 -1
  25. package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js.map +1 -1
  26. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"GenAICoach.styles.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EACL,eAAe,EACf,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACT,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,EAAE,cAAc,EAAE,MAAM,iEAAiE,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAGpF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC;AAChD,MAAM,eAAe,GAAG,OAAO,CAAC;AAEhC,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAElD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAGjD,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,EAC1D,UAAU,EAAE,EACV,IAAI,EAAE,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C;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;eAE5B,eAAe;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGxC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { useContext } from 'react';\nimport { mix } from 'polished';\n\nimport {\n AppShellContext,\n Button,\n FileList,\n Flex,\n FormControl,\n MenuButton,\n StyledButton,\n StyledEmptyState,\n StyledErrorState,\n StyledIcon,\n StyledText,\n SummaryItem,\n Text,\n TextArea,\n calculateFontSize,\n defaultThemeProp,\n tryCatch\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 { StyledProgress } from '@pega/cosmos-react-core/lib/components/Progress/Progress.styles';\nimport { resizeDrawerMaxWidth } from '@pega/cosmos-react-core/lib/styles/constants';\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 StyledGenAICoachContainer = styled.div<{\n variant: GenAICoachProps['variant'];\n}>(\n ({\n theme: {\n base: { palette, 'z-index': zIndex, spacing, breakpoints },\n components: {\n card: { 'border-radius': borderRadius }\n }\n },\n variant\n }) => {\n const { previewActive } = useContext(AppShellContext);\n return css`\n background: ${palette['primary-background']};\n min-width: var(--utilities-drawer-min-width);\n border-radius: ${borderRadius};\n ${isInUtilities(variant) &&\n css`\n min-height: 3rem;\n max-width: 31.25rem;\n box-shadow: 0 -1rem 1rem ${palette['app-background']};\n border-radius: ${borderRadius} ${borderRadius} 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 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 }\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 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 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 `;\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 ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n margin-block: calc(2 * ${spacing});\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 overflow-wrap: break-word;\n ${StyledEditorContainer} {\n padding: 0;\n }\n `;\n});\n\nStyledMessage.defaultProps = defaultThemeProp;\n\nexport const StyledUserMessage = styled.li(\n ({\n theme: {\n base: {\n 'border-radius': borderRadius,\n spacing,\n palette: { 'secondary-background': secondaryBackground }\n }\n }\n }) => {\n return css`\n overflow-wrap: break-word;\n background: ${secondaryBackground};\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 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 & > 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 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 StyledComposerActions = styled.div`\n margin-inline-start: auto;\n`;\n\nStyledComposerActions.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 StyledGenAIFooter = styled.div`\n width: 100%;\n max-width: ${maxWidthMessage};\n`;\n\nexport const StyledAgentIcon = styled.svg`\n width: 3rem;\n height: 3rem;\n`;\n\nStyledAgentIcon.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"GenAICoach.styles.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EACL,eAAe,EACf,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,MAAM,EACN,wBAAwB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5F,OAAO,EAAE,eAA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AC;AAEjD,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAA;eACnC,eAAe;;CAE7B,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EACxD,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;;;;qBAIS,OAAO;+BACG,OAAO;;;;;;GAMnC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,0BAA0B,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3D,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,IAAI,CAAA;IAC/C,SAAS,CAAC,CAAC,CAAC;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAC/C,KAAK,EAAE,EACL,UAAU,EAAE,EACV,KAAK,EAAE,EACL,eAAe,EAAE,EACf,MAAM,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,EACzC,EACF,EACF,EACF,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;kBACM,gBAAgB;GAC/B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA;;eAE5B,eAAe;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;;CAGxC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport { useContext } from 'react';\nimport { mix } from 'polished';\n\nimport {\n AppShellContext,\n Button,\n FileList,\n Flex,\n FormControl,\n MenuButton,\n StyledButton,\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} 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 { StyledProgress } 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';\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 StyledGenAICoachContainer = styled.div<{\n variant: GenAICoachProps['variant'];\n fullScreen: GenAICoachProps['allowFullScreen'];\n isCompact: boolean;\n}>(\n ({\n theme: {\n base: { palette, 'z-index': zIndex, spacing, breakpoints, animation },\n components: {\n card: { 'border-radius': borderRadius },\n agent: { background: agentBackground, 'foreground-color': agentForegroundColor }\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: ${borderRadius};\n transition: height ${animation.speed} ${animation.timing.ease};\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: ${borderRadius} ${borderRadius} 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 ${isCompact &&\n css`\n height: 26rem;\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 `;\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 overflow-wrap: break-word;\n ${StyledEditorContainer} {\n padding: 0;\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 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 & > 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 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 StyledComposerActions = styled.div`\n margin-inline-start: auto;\n`;\n\nStyledComposerActions.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`;\n\nexport const StyledAgentIcon = styled.svg`\n width: 3rem;\n height: 3rem;\n`;\n\nStyledAgentIcon.defaultProps = defaultThemeProp;\n"]}
@@ -52,6 +52,8 @@ export type CoachMessageProps = RequireAtLeastOne<Partial<Pick<GenAICoachProps,
52
52
  allowFeedbackResubmission?: boolean;
53
53
  };
54
54
  messageActions?: ActionsProps;
55
+ onAnimationCursorUpdate?: (animatedTillCursor: number) => void;
56
+ animationInitialCursorPos?: number;
55
57
  }, 'loading' | 'message' | 'error'>;
56
58
  export type GenAIMessageProps = UserMessageProps | CoachMessageProps;
57
59
  export interface ConversationHistoryProps extends TestIdProp {
@@ -103,6 +105,8 @@ export type GenAICoachProps = WithAttributes<'div', TestIdProp & {
103
105
  messages?: GenAIMessageProps[];
104
106
  /** Placement of the component */
105
107
  variant: Variant;
108
+ /** From landing page utilities */
109
+ isInLandingPageUtilities?: boolean;
106
110
  /** callback when component is mounted */
107
111
  onOpen?: () => void;
108
112
  /**
@@ -128,6 +132,13 @@ export type GenAICoachProps = WithAttributes<'div', TestIdProp & {
128
132
  showSalutation?: boolean;
129
133
  /** Salutation message */
130
134
  salutation?: string;
135
+ /** Enable full screen */
136
+ allowFullScreen?: boolean;
137
+ /** Enable voice to text */
138
+ voiceToTextProps?: {
139
+ enableDictation: boolean;
140
+ langCode: string;
141
+ };
131
142
  }>;
132
143
  export interface MessageFeedbackProps {
133
144
  messageId: MessageProps['id'];
@@ -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,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,WAAW,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O,CAAC;IACjB,yCAAyC;IACzC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,4DAA4D;IAC5D,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,+CAA+C;IAC/C,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;IAC1C,uBAAuB;IACvB,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,2BAA2B;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mGAAmG;IACnG,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC,yBAAyB;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yBAAyB;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CACF,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;IAC9B,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,wBAAyB,SAAQ,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC;IACtF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
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,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,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AC;IAC9B,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,wBAAyB,SAAQ,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC;IACtF,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"GenAICoach.types.js","sourceRoot":"","sources":["../../../src/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 { RichTextViewerProps } 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 CoachMessageProps = RequireAtLeastOne<\n Partial<Pick<GenAICoachProps, 'onSend'>> &\n BaseProps &\n TestIdProp &\n Pick<MessageProps, 'id' | 'announceInteraction' | 'ref'> & {\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 markdownMap?: RichTextViewerProps['markdownMap'];\n onStreamingUpdate?: (isStreamingDone: boolean) => void;\n feedback?: {\n reaction: Reaction | undefined;\n feedbackText?: string;\n onReaction: (id: MessageProps['id'], reaction: Reaction) => void;\n onFeedbackComplete: (id: MessageProps['id'], comment?: string) => void;\n promptFeedbackOn?: FeedbackPrompt;\n allowFeedbackResubmission?: boolean;\n };\n messageActions?: ActionsProps;\n },\n 'loading' | 'message' | 'error'\n>;\n\nexport type GenAIMessageProps = UserMessageProps | CoachMessageProps;\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};\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 /** Messages to be shown in the chatting window. */\n messages?: GenAIMessageProps[];\n /** Placement of the component */\n variant: Variant;\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 /** 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"]}
1
+ {"version":3,"file":"GenAICoach.types.js","sourceRoot":"","sources":["../../../src/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 { RichTextViewerProps } 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 CoachMessageProps = RequireAtLeastOne<\n Partial<Pick<GenAICoachProps, 'onSend'>> &\n BaseProps &\n TestIdProp &\n Pick<MessageProps, 'id' | 'announceInteraction' | 'ref'> & {\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 markdownMap?: RichTextViewerProps['markdownMap'];\n onStreamingUpdate?: (isStreamingDone: boolean) => void;\n feedback?: {\n reaction: Reaction | undefined;\n feedbackText?: string;\n onReaction: (id: MessageProps['id'], reaction: Reaction) => void;\n onFeedbackComplete: (id: MessageProps['id'], comment?: string) => void;\n promptFeedbackOn?: FeedbackPrompt;\n allowFeedbackResubmission?: boolean;\n };\n messageActions?: ActionsProps;\n onAnimationCursorUpdate?: (animatedTillCursor: number) => void;\n animationInitialCursorPos?: number;\n },\n 'loading' | 'message' | 'error'\n>;\n\nexport type GenAIMessageProps = UserMessageProps | CoachMessageProps;\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};\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 /** 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 /** Show welcome state */\n showSalutation?: boolean;\n /** Salutation message */\n salutation?: string;\n /** Enable full screen */\n allowFullScreen?: boolean;\n /** Enable voice to text */\n voiceToTextProps?: {\n enableDictation: boolean;\n langCode: string;\n };\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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GenAIMessage.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAIMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAaL,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAgB5D,QAAA,MAAM,YAAY,EAAE,+BAA+B,CAAC,iBAAiB,CAiLpE,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"GenAIMessage.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAIMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAWL,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAiB5D,QAAA,MAAM,YAAY,EAAE,+BAA+B,CAAC,iBAAiB,CA+LpE,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useEffect } from 'react';
3
- import { Actions, Button, Flex, Icon, Progress, registerIcon, useI18n, useTheme, Text, useTestIds, ErrorState, markdownToPlainText } from '@pega/cosmos-react-core';
3
+ import { Actions, Button, Flex, Progress, registerIcon, useI18n, useTheme, useTestIds, ErrorState, markdownToPlainText } from '@pega/cosmos-react-core';
4
4
  import * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';
5
5
  import { RichTextViewer } from '@pega/cosmos-react-rte';
6
6
  import { useAnimatedText } from '@pega/cosmos-react-core';
7
- import { StyledActionsContainer, StyledAttachmentsList, StyledMessage, StyledSuggestion, StyledSuggestionsContainer, StyledUserMessage } from './GenAICoach.styles';
7
+ import { StyledActionsContainer, StyledAttachmentsList, StyledGenAIAvatar, StyledMessage, StyledSuggestion, StyledSuggestionsContainer, StyledUserMessage } from './GenAICoach.styles';
8
8
  import { getGenAICoachTestIds } from './GenAICoach.test-ids';
9
9
  import { isCoachMessage, isUserMessage } from './GenAICoach.utils';
10
10
  import GenAIMessageProgress from './GenAIMessageProgress';
@@ -20,12 +20,20 @@ const GenAIMessage = forwardRef(function GenAIMessage(props, ref) {
20
20
  const isStreamingMessage = isCoachMessage(props) && props.enableStreaming;
21
21
  const allChunksReceived = isCoachMessage(props) && props.allChunksReceived;
22
22
  const enableStreaming = !!isStreamingMessage && !allChunksReceived;
23
- const { text: streamingMessage, isAnimationDone: isStreamingDone } = useAnimatedText({
23
+ const { text: streamingMessage, isAnimationDone: isStreamingDone, animatedTillCursor } = useAnimatedText({
24
24
  text: message ?? '',
25
25
  allContentReceived: allChunksReceived === undefined ? true : allChunksReceived,
26
26
  enabled: enableStreaming,
27
- tokenizeMarkdown: true
27
+ tokenizeMarkdown: true,
28
+ cursorStartIndex: isCoachMessage(props) && props.animationInitialCursorPos
29
+ ? props.animationInitialCursorPos
30
+ : undefined
28
31
  });
32
+ useEffect(() => {
33
+ if (isCoachMessage(props) && props.onAnimationCursorUpdate) {
34
+ props.onAnimationCursorUpdate(animatedTillCursor);
35
+ }
36
+ }, [animatedTillCursor]);
29
37
  useEffect(() => {
30
38
  if (isStreamingMessage && props.onStreamingUpdate) {
31
39
  // Consider streaming is done when we have all the chunks and all of them are rendered
@@ -51,7 +59,7 @@ const GenAIMessage = forwardRef(function GenAIMessage(props, ref) {
51
59
  ariaLabel = `${ariaLabel} ${t('interaction_message')}`;
52
60
  }
53
61
  const streamingContent = isStreamingMessage && (_jsx(_Fragment, { children: message ? (_jsxs(_Fragment, { children: [_jsx(RichTextViewer, { content: isStreamingMessage ? streamingMessage : message, type: 'markdown', markdownMap: markdownMap }), loading && _jsx(Progress, { variant: 'ellipsis', placement: 'inline' })] })) : (loading && _jsx(GenAIMessageProgress, {})) }));
54
- return (_jsxs(Flex, { as: 'li', "data-testid": testIds.coachMessage, ...restProps, container: { direction: 'column', pad: [1, 0] }, type: 'message', "aria-label": ariaLabel, ref: ref, children: [_jsxs(Flex, { container: { gap: 1 }, children: [_jsx(Icon, { name: 'polaris-solid', color: theme.base.palette.ai, size: 's' }), _jsx(Text, { as: 'span', variant: 'h4', children: coachName })] }), _jsxs(StyledMessage, { children: [streamingContent, loading || error ? (_jsxs(_Fragment, { children: [loading && !isStreamingMessage && _jsx(GenAIMessageProgress, {}), error && _jsx(ErrorState, { message: error })] })) : (_jsxs(_Fragment, { children: [!isStreamingMessage && message && (_jsx(RichTextViewer, { content: message, type: 'markdown', markdownMap: markdownMap })), (feedback || messageActions) && (_jsxs(Flex, { container: { direction: 'row', gap: 1, pad: [1, undefined] }, as: StyledActionsContainer, children: [feedback && (_jsx(GenAIMessageFeedbackButtons, { messageId: messageId, feedback: feedback })), messageActions && _jsx(Actions, { ...messageActions })] })), suggestions && (_jsx(Flex, { as: StyledSuggestionsContainer, container: { direction: 'column', gap: 1 }, children: suggestions.map(({ id, message: prompt }) => {
62
+ return (_jsxs(Flex, { as: 'li', "data-testid": testIds.coachMessage, ...restProps, container: { direction: 'row', pad: [1, 0], gap: 0.5 }, type: 'message', "aria-label": ariaLabel, ref: ref, 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, {}), error && _jsx(ErrorState, { message: error })] })) : (_jsxs(_Fragment, { children: [!isStreamingMessage && message && (_jsx(RichTextViewer, { content: message, type: 'markdown', markdownMap: markdownMap })), (feedback || messageActions) && (_jsxs(Flex, { container: { direction: 'row', gap: 1, pad: [1, undefined] }, as: StyledActionsContainer, children: [feedback && (_jsx(GenAIMessageFeedbackButtons, { messageId: messageId, feedback: feedback })), messageActions && _jsx(Actions, { ...messageActions })] })), suggestions && (_jsx(Flex, { as: StyledSuggestionsContainer, container: { direction: 'column', gap: 1 }, children: suggestions.map(({ id, message: prompt }) => {
55
63
  return (_jsx(Button, { as: StyledSuggestion, onClick: onSend ? () => onSend({ id, message: prompt }) : undefined, children: prompt }, id));
56
64
  }) }))] }))] })] }));
57
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GenAIMessage.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAIMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,UAAU,EACV,mBAAmB,EAEpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,gBAAgB,MAAM,sEAAsE,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,2BAA2B,MAAM,wBAAwB,CAAC;AAEjE,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAE/B,MAAM,YAAY,GAAuD,UAAU,CACjF,SAAS,YAAY,CAAC,KAAyC,EAAE,GAA6B;IAC5F,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACz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AAE,IAAI,EAAC,UAAU,GAAG,IAC9C,CACrB,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, useEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Actions,\n Button,\n Flex,\n Icon,\n Progress,\n registerIcon,\n useI18n,\n useTheme,\n Text,\n useTestIds,\n ErrorState,\n markdownToPlainText,\n type ForwardRefForwardPropsComponent\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 StyledMessage,\n StyledSuggestion,\n StyledSuggestionsContainer,\n StyledUserMessage\n} from './GenAICoach.styles';\nimport { getGenAICoachTestIds } from './GenAICoach.test-ids';\nimport { isCoachMessage, isUserMessage } from './GenAICoach.utils';\nimport GenAIMessageProgress from './GenAIMessageProgress';\nimport GenAIMessageFeedbackButtons from './GenAIMessageFeedback';\n\nregisterIcon(polarisSolidIcon);\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 { text: streamingMessage, isAnimationDone: isStreamingDone } = useAnimatedText({\n text: message ?? '',\n allContentReceived: allChunksReceived === undefined ? true : allChunksReceived,\n enabled: enableStreaming,\n tokenizeMarkdown: true\n });\n\n useEffect(() => {\n if (isStreamingMessage && props.onStreamingUpdate) {\n // Consider streaming is done when we have all the chunks and all of them are rendered\n props.onStreamingUpdate(!!allChunksReceived && isStreamingDone);\n }\n }, [enableStreaming, isStreamingDone, allChunksReceived]);\n\n if (isCoachMessage(props)) {\n const {\n id: messageId,\n coachName,\n suggestions,\n onSend,\n loading,\n error,\n feedback,\n messageActions,\n markdownMap\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 <RichTextViewer\n content={isStreamingMessage ? streamingMessage : message}\n type='markdown'\n markdownMap={markdownMap}\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: 'column', pad: [1, 0] }}\n type='message'\n aria-label={ariaLabel}\n ref={ref}\n >\n <Flex container={{ gap: 1 }}>\n <Icon name='polaris-solid' color={theme.base.palette.ai} size='s' />\n <Text as='span' variant='h4'>\n {coachName}\n </Text>\n </Flex>\n\n <StyledMessage>\n {/* Streaming loader and content */}\n {streamingContent}\n\n {loading || error ? (\n <>\n {loading && !isStreamingMessage && <GenAIMessageProgress />}\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 {(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 as={StyledSuggestionsContainer} container={{ direction: 'column', gap: 1 }}>\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 </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 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 return null;\n }\n);\n\nexport default GenAIMessage;\n"]}
1
+ {"version":3,"file":"GenAIMessage.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAIMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9C,OAAO,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,mBAAmB,EAEpB,MAAM,yBAAyB,CAAC;AACjC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AO,EAAE,MAAM,EAAE,EAAE,EAAE;wCAC3C,OAAO,CACL,KAAC,MAAM,IACL,EAAE,EAAE,gBAAgB,EACpB,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,YAGlE,MAAM,IAFF,EAAE,CAGA,CACV,CAAC;oCACJ,CAAC,CAAC,GACG,CACR,IACA,CACJ,IACa,IACX,CACR,CAAC;IACJ,CAAC;IAED,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,gBAAgB,EAAE,CAAC;YACrB,SAAS,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACjD,CAAC;QAED,IAAI,mBAAmB,EAAE,CAAC;YACxB,SAAS,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,EACb,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,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { forwardRef, useEffect } from 'react';\nimport type { PropsWithoutRef } from 'react';\n\nimport {\n Actions,\n Button,\n Flex,\n Progress,\n registerIcon,\n useI18n,\n useTheme,\n useTestIds,\n ErrorState,\n markdownToPlainText,\n type ForwardRefForwardPropsComponent\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 StyledUserMessage\n} from './GenAICoach.styles';\nimport { getGenAICoachTestIds } from './GenAICoach.test-ids';\nimport { isCoachMessage, isUserMessage } from './GenAICoach.utils';\nimport GenAIMessageProgress from './GenAIMessageProgress';\nimport GenAIMessageFeedbackButtons from './GenAIMessageFeedback';\n\nregisterIcon(polarisSolidIcon);\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 // Consider streaming is done when we have all the chunks and all of them are rendered\n props.onStreamingUpdate(!!allChunksReceived && isStreamingDone);\n }\n }, [enableStreaming, isStreamingDone, allChunksReceived]);\n\n if (isCoachMessage(props)) {\n const {\n id: messageId,\n coachName,\n suggestions,\n onSend,\n loading,\n error,\n feedback,\n messageActions,\n markdownMap\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 <RichTextViewer\n content={isStreamingMessage ? streamingMessage : message}\n type='markdown'\n markdownMap={markdownMap}\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: 0.5 }}\n type='message'\n aria-label={ariaLabel}\n ref={ref}\n >\n <StyledGenAIAvatar\n name={coachName}\n icon='polaris-solid'\n color={theme.base.palette.ai}\n shape='circle'\n size='m'\n />\n <StyledMessage>\n {/* Streaming loader and content */}\n {streamingContent}\n\n {loading || error ? (\n <>\n {loading && !isStreamingMessage && <GenAIMessageProgress />}\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 {(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 as={StyledSuggestionsContainer} container={{ direction: 'column', gap: 1 }}>\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 </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 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 return null;\n }\n);\n\nexport default GenAIMessage;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"InitialSuggestedMessage.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/InitialSuggestedMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAIvE,QAAA,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,4BAA4B,CAiC1E,CAAC;AAEJ,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"InitialSuggestedMessage.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/InitialSuggestedMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAIhE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAIvE,QAAA,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,4BAA4B,CAyB1E,CAAC;AAEJ,eAAe,uBAAuB,CAAC"}
@@ -1,18 +1,17 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Card, CardContent, Flex, Icon, useDirection, useTestIds } from '@pega/cosmos-react-core';
3
- import { StyledSuggestedMessage } from './GenAICoach.styles';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTestIds } from '@pega/cosmos-react-core';
4
3
  import { getGenAICoachTestIds } from './GenAICoach.test-ids';
4
+ import { StyledInitialMessageButton, StyledInitialMessageText } from './GenAICoach.styles';
5
5
  const InitialSuggestedMessage = function SuggestionCard({ id, message, testId, onSend }) {
6
6
  const testIds = useTestIds(testId, getGenAICoachTestIds);
7
- const { end } = useDirection();
8
- return (_jsxs(Card, { container: { justify: 'between' }, as: StyledSuggestedMessage, onClick: () => {
7
+ return (_jsx(StyledInitialMessageButton, { onClick: () => {
9
8
  onSend({ id, message });
10
9
  }, onKeyDown: (e) => {
11
10
  if (e.key === 'Enter') {
12
11
  e.preventDefault();
13
12
  onSend({ id, message });
14
13
  }
15
- }, "data-testid": testIds.root, children: [_jsx(CardContent, { children: _jsx(Flex, { container: { alignItems: 'center' }, children: message }) }), _jsx(Flex, { container: { alignItems: 'center' }, children: _jsx(Icon, { name: `arrow-${end}` }) })] }));
14
+ }, "data-testid": testIds.root, children: _jsx(StyledInitialMessageText, { children: message }) }));
16
15
  };
17
16
  export default InitialSuggestedMessage;
18
17
  //# sourceMappingURL=InitialSuggestedMessage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"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AC;AACJ,CAAC,CAAC;AAEJ,eAAe,uBAAuB,CAAC","sourcesContent":["import type { FunctionComponent, PropsWithoutRef } from 'react';\n\nimport { Card, CardContent, Flex, Icon, useDirection, useTestIds } from '@pega/cosmos-react-core';\n\nimport type { InitialSuggestedMessageProps } from './GenAICoach.types';\nimport { StyledSuggestedMessage } from './GenAICoach.styles';\nimport { getGenAICoachTestIds } from './GenAICoach.test-ids';\n\nconst InitialSuggestedMessage: FunctionComponent<InitialSuggestedMessageProps> =\n function SuggestionCard({\n id,\n message,\n testId,\n onSend\n }: PropsWithoutRef<InitialSuggestedMessageProps>) {\n const testIds = useTestIds(testId, getGenAICoachTestIds);\n const { end } = useDirection();\n\n return (\n <Card\n container={{ justify: 'between' }}\n as={StyledSuggestedMessage}\n onClick={() => {\n onSend({ id, message });\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n onSend({ id, message });\n }\n }}\n data-testid={testIds.root}\n >\n <CardContent>\n <Flex container={{ alignItems: 'center' }}>{message}</Flex>\n </CardContent>\n <Flex container={{ alignItems: 'center' }}>\n <Icon name={`arrow-${end}`} />\n </Flex>\n </Card>\n );\n };\n\nexport default InitialSuggestedMessage;\n"]}
1
+ {"version":3,"file":"InitialSuggestedMessage.js","sourceRoot":"","sources":["../../../src/components/GenAICoach/InitialSuggestedMessage.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE3F,MAAM,uBAAuB,GAC3B,SAAS,cAAc,CAAC,EACtB,EAAE,EACF,OAAO,EACP,MAAM,EACN,MAAM,EACwC;IAC9C,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAEzD,OAAO,CACL,KAAC,0BAA0B,IACzB,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAC1B,CAAC,EACD,SAAS,EAAE,CAAC,CAAgB,EAAE,EAAE;YAC9B,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;gBACtB,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,MAAM,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC,iBACY,OAAO,CAAC,IAAI,YAEzB,KAAC,wBAAwB,cAAE,OAAO,GAA4B,GACnC,CAC9B,CAAC;AACJ,CAAC,CAAC;AAEJ,eAAe,uBAAuB,CAAC","sourcesContent":["import type { FunctionComponent, PropsWithoutRef } from 'react';\n\nimport { useTestIds } from '@pega/cosmos-react-core';\n\nimport type { InitialSuggestedMessageProps } from './GenAICoach.types';\nimport { getGenAICoachTestIds } from './GenAICoach.test-ids';\nimport { StyledInitialMessageButton, StyledInitialMessageText } from './GenAICoach.styles';\n\nconst InitialSuggestedMessage: FunctionComponent<InitialSuggestedMessageProps> =\n function SuggestionCard({\n id,\n message,\n testId,\n onSend\n }: PropsWithoutRef<InitialSuggestedMessageProps>) {\n const testIds = useTestIds(testId, getGenAICoachTestIds);\n\n return (\n <StyledInitialMessageButton\n onClick={() => {\n onSend({ id, message });\n }}\n onKeyDown={(e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n onSend({ id, message });\n }\n }}\n data-testid={testIds.root}\n >\n <StyledInitialMessageText>{message}</StyledInitialMessageText>\n </StyledInitialMessageButton>\n );\n };\n\nexport default InitialSuggestedMessage;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesLayout.d.ts","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAYlG,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAavE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAM9D,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,uBAAuB;IACvB,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CAsH3E,CAAC;AACF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"UtilitiesLayout.d.ts","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,iBAAiB,EAA2C,MAAM,OAAO,CAAC;AAYlG,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAavE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAM9D,MAAM,WAAW,oBAAqB,SAAQ,SAAS;IACrD,uBAAuB;IACvB,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,CAAC,iBAAiB,EAAE,OAAO,KAAK,IAAI,CAAC;IACzD,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,eAAe,EAAE,iBAAiB,CAAC,oBAAoB,GAAG,YAAY,CA0H3E,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -29,14 +29,15 @@ const UtilitiesLayout = ({ genAICoachProps, defaultExpandUtilities = false, disa
29
29
  utilitiesToggled.current = true;
30
30
  setUtilitiesExpanded(prevState => !prevState);
31
31
  }, disabled: disabled, ref: toggleButtonRef, children: _jsx(Icon, { name: `arrow-micro-${utilitiesExpanded ? end : start}` }) }));
32
+ const genAICoachInUtilities = genAICoachProps && (_jsx(GenAICoach, { ...genAICoachProps, variant: { placement: 'fullpage' }, isInLandingPageUtilities: true }));
32
33
  const genAICoach = genAICoachProps && (_jsx(GenAICoach, { ...genAICoachProps, variant: { placement: 'fullpage' } }));
33
34
  if (!mdOrAbove && genAICoach) {
34
35
  return genAICoach;
35
36
  }
36
37
  if (utilitiesExpanded && !lgOrAbove) {
37
- return (_jsx(Drawer, { as: StyledCaseDrawer, open: utilitiesExpanded, position: 'fixed', placement: end, shadow: true, nullWhenClosed: true, children: _jsxs(Flex, { as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 }, "data-app-region": true, children: [_jsxs(Flex, { container: { alignItems: 'center', justify: 'between' }, children: [_jsx(Text, { variant: 'h2', children: t('utilities') }), utilitiesToggleButton] }), genAICoach] }) }));
38
+ return (_jsx(Drawer, { as: StyledCaseDrawer, open: utilitiesExpanded, position: 'fixed', placement: end, shadow: true, nullWhenClosed: true, children: _jsxs(Flex, { as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 }, "data-app-region": true, children: [_jsxs(Flex, { container: { alignItems: 'center', justify: 'between' }, children: [_jsx(Text, { variant: 'h2', children: t('utilities') }), utilitiesToggleButton] }), genAICoachInUtilities] }) }));
38
39
  }
39
- return (_jsxs(Flex, { ...restProps, container: { direction: 'column', gap: 1 }, as: StyledUtilitiesLayout, utilitiesExpanded: utilitiesExpanded, lgOrAbove: lgOrAbove, children: [_jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: [0, 0, 1] }, children: [utilitiesExpanded && _jsx(Text, { variant: 'h2', children: t('utilities') }), utilitiesToggleButton] }), utilitiesExpanded && genAICoach, !utilitiesExpanded && (_jsx(StyledCoachButton, { iconOnly: true, variant: 'primary', ref: genAICoachButtonRef, onClick: () => setShowCoach(cur => !cur), label: t('chat_with_ai'), disabled: disabled })), genAICoachButtonRef.current && genAICoachProps && showCoach && (_jsx(UtilitySummaryItemDialog, { target: genAICoachButtonRef.current, onDismiss: () => setShowCoach(false), children: _jsx(GenAICoach, { ...genAICoachProps, variant: {
40
+ return (_jsxs(Flex, { ...restProps, container: { direction: 'column', gap: 1 }, as: StyledUtilitiesLayout, utilitiesExpanded: utilitiesExpanded, lgOrAbove: lgOrAbove, children: [_jsxs(Flex, { container: { alignItems: 'center', justify: 'between', pad: [0, 0, 1] }, children: [utilitiesExpanded && _jsx(Text, { variant: 'h2', children: t('utilities') }), utilitiesToggleButton] }), utilitiesExpanded && genAICoachInUtilities, !utilitiesExpanded && (_jsx(StyledCoachButton, { iconOnly: true, variant: 'primary', ref: genAICoachButtonRef, onClick: () => setShowCoach(cur => !cur), label: t('chat_with_ai'), disabled: disabled })), genAICoachButtonRef.current && genAICoachProps && showCoach && (_jsx(UtilitySummaryItemDialog, { target: genAICoachButtonRef.current, onDismiss: () => setShowCoach(false), children: _jsx(GenAICoach, { ...genAICoachProps, variant: {
40
41
  placement: 'dialog',
41
42
  onClose: () => {
42
43
  genAICoachProps.onClose?.();
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesLayout.js","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAgD,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,gBAAgB,MAAM,sEAAsE,CAAC;AACzG,OAAO,KAAK,mBAAmB,MAAM,0EAA0E,CAAC;AAChH,OAAO,KAAK,kBAAkB,MAA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OAAO,EAAE,EAAE,CAAC;4BAC5B,YAAY,CAAC,KAAK,CAAC,CAAC;4BACpB,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;wBACvC,CAAC;qBACF,GACD,GACuB,CAC5B,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,eAAe,CAAC","sourcesContent":["import { useState, type FunctionComponent, type PropsWithoutRef, useRef, useEffect } from 'react';\n\nimport {\n Drawer,\n Flex,\n Icon,\n useBreakpoint,\n useDirection,\n useI18n,\n Text,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps } from '@pega/cosmos-react-core';\nimport * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';\nimport * as arrowMicroRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-right.icon';\nimport * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';\n\nimport {\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledCoachButton,\n StyledExpandCollapseUtilitiesButton\n} from '../CaseView/CaseView.styles';\nimport { UtilitySummaryItemDialog } from '../CaseView';\nimport GenAICoach from '../GenAICoach';\nimport type { UtilitiesGenAICoachProps } from '../GenAICoach';\n\nimport StyledUtilitiesLayout from './UtilitiesLayout.styles';\n\nregisterIcon(polarisSolidIcon, arrowMicroRightIcon, arrowMicroLeftIcon);\n\nexport interface UtilitiesLayoutProps extends BaseProps {\n /** GenAICoach props */\n genAICoachProps?: UtilitiesGenAICoachProps;\n /** Callback triggered when utilities are expanded or collapsed */\n onToggleUtilities?: (utilitiesExpanded: boolean) => void;\n /** show utilities in expanded mode */\n defaultExpandUtilities?: boolean;\n /**\n * Determines if the actions will be disabled.\n * @default false\n */\n disabled?: boolean;\n}\n\nconst UtilitiesLayout: FunctionComponent<UtilitiesLayoutProps & ForwardProps> = ({\n genAICoachProps,\n defaultExpandUtilities = false,\n disabled = false,\n onToggleUtilities,\n ...restProps\n}: PropsWithoutRef<UtilitiesLayoutProps>) => {\n const [utilitiesExpanded, setUtilitiesExpanded] = useState(defaultExpandUtilities);\n const [showCoach, setShowCoach] = useState(false);\n\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n const genAICoachButtonRef = useRef<HTMLButtonElement>(null);\n const utilitiesToggled = useRef(false);\n const { end, start } = useDirection();\n const mdOrAbove = useBreakpoint('md');\n const lgOrAbove = useBreakpoint('lg');\n const t = useI18n();\n\n useEffect(() => {\n onToggleUtilities?.(utilitiesExpanded);\n if (!utilitiesExpanded && utilitiesToggled.current) {\n toggleButtonRef.current?.focus();\n }\n }, [utilitiesExpanded]);\n\n const utilitiesToggleButton = (\n <StyledExpandCollapseUtilitiesButton\n compact\n icon\n label={t(utilitiesExpanded ? 'collapse' : 'expand')}\n aria-label={t(utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel')}\n onClick={() => {\n utilitiesToggled.current = true;\n setUtilitiesExpanded(prevState => !prevState);\n }}\n disabled={disabled}\n ref={toggleButtonRef}\n >\n <Icon name={`arrow-micro-${utilitiesExpanded ? end : start}`} />\n </StyledExpandCollapseUtilitiesButton>\n );\n\n const genAICoach = genAICoachProps && (\n <GenAICoach {...genAICoachProps} variant={{ placement: 'fullpage' }} />\n );\n\n if (!mdOrAbove && genAICoach) {\n return genAICoach;\n }\n\n if (utilitiesExpanded && !lgOrAbove) {\n return (\n <Drawer\n as={StyledCaseDrawer}\n open={utilitiesExpanded}\n position='fixed'\n placement={end}\n shadow\n nullWhenClosed\n >\n <Flex\n as={StyledCaseDrawerContent}\n container={{ direction: 'column', gap: 2 }}\n data-app-region\n >\n <Flex container={{ alignItems: 'center', justify: 'between' }}>\n <Text variant='h2'>{t('utilities')}</Text>\n {utilitiesToggleButton}\n </Flex>\n {genAICoach}\n </Flex>\n </Drawer>\n );\n }\n\n return (\n <Flex\n {...restProps}\n container={{ direction: 'column', gap: 1 }}\n as={StyledUtilitiesLayout}\n utilitiesExpanded={utilitiesExpanded}\n lgOrAbove={lgOrAbove}\n >\n <Flex container={{ alignItems: 'center', justify: 'between', pad: [0, 0, 1] }}>\n {utilitiesExpanded && <Text variant='h2'>{t('utilities')}</Text>}\n {utilitiesToggleButton}\n </Flex>\n {utilitiesExpanded && genAICoach}\n {!utilitiesExpanded && (\n <StyledCoachButton\n iconOnly\n variant='primary'\n ref={genAICoachButtonRef}\n onClick={() => setShowCoach(cur => !cur)}\n label={t('chat_with_ai')}\n disabled={disabled}\n />\n )}\n {genAICoachButtonRef.current && genAICoachProps && showCoach && (\n <UtilitySummaryItemDialog\n target={genAICoachButtonRef.current}\n onDismiss={() => setShowCoach(false)}\n >\n <GenAICoach\n {...genAICoachProps}\n variant={{\n placement: 'dialog',\n onClose: () => {\n genAICoachProps.onClose?.();\n setShowCoach(false);\n genAICoachButtonRef.current?.focus();\n }\n }}\n />\n </UtilitySummaryItemDialog>\n )}\n </Flex>\n );\n};\nexport default UtilitiesLayout;\n"]}
1
+ {"version":3,"file":"UtilitiesLayout.js","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAgD,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG,OAAO,EACL,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,IAAI,EACJ,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,gBAAgB,MAAM,sEAAsE,CAAC;AACzG,OAAO,KAAK,mBAAmB,MAAM,0EAA0E,CAAC;AAChH,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAE9G,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,iBAAiB,EACjB,mCAAmC,EACpC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,UAAU,MAAM,eA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AAY,CAAC,KAAK,CAAC,CAAC;4BACpB,mBAAmB,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;wBACvC,CAAC;qBACF,GACD,GACuB,CAC5B,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,eAAe,CAAC","sourcesContent":["import { useState, type FunctionComponent, type PropsWithoutRef, useRef, useEffect } from 'react';\n\nimport {\n Drawer,\n Flex,\n Icon,\n useBreakpoint,\n useDirection,\n useI18n,\n Text,\n registerIcon\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps } from '@pega/cosmos-react-core';\nimport * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';\nimport * as arrowMicroRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-right.icon';\nimport * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';\n\nimport {\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledCoachButton,\n StyledExpandCollapseUtilitiesButton\n} from '../CaseView/CaseView.styles';\nimport { UtilitySummaryItemDialog } from '../CaseView';\nimport GenAICoach from '../GenAICoach';\nimport type { UtilitiesGenAICoachProps } from '../GenAICoach';\n\nimport StyledUtilitiesLayout from './UtilitiesLayout.styles';\n\nregisterIcon(polarisSolidIcon, arrowMicroRightIcon, arrowMicroLeftIcon);\n\nexport interface UtilitiesLayoutProps extends BaseProps {\n /** GenAICoach props */\n genAICoachProps?: UtilitiesGenAICoachProps;\n /** Callback triggered when utilities are expanded or collapsed */\n onToggleUtilities?: (utilitiesExpanded: boolean) => void;\n /** show utilities in expanded mode */\n defaultExpandUtilities?: boolean;\n /**\n * Determines if the actions will be disabled.\n * @default false\n */\n disabled?: boolean;\n}\n\nconst UtilitiesLayout: FunctionComponent<UtilitiesLayoutProps & ForwardProps> = ({\n genAICoachProps,\n defaultExpandUtilities = false,\n disabled = false,\n onToggleUtilities,\n ...restProps\n}: PropsWithoutRef<UtilitiesLayoutProps>) => {\n const [utilitiesExpanded, setUtilitiesExpanded] = useState(defaultExpandUtilities);\n const [showCoach, setShowCoach] = useState(false);\n\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n const genAICoachButtonRef = useRef<HTMLButtonElement>(null);\n const utilitiesToggled = useRef(false);\n const { end, start } = useDirection();\n const mdOrAbove = useBreakpoint('md');\n const lgOrAbove = useBreakpoint('lg');\n const t = useI18n();\n\n useEffect(() => {\n onToggleUtilities?.(utilitiesExpanded);\n if (!utilitiesExpanded && utilitiesToggled.current) {\n toggleButtonRef.current?.focus();\n }\n }, [utilitiesExpanded]);\n\n const utilitiesToggleButton = (\n <StyledExpandCollapseUtilitiesButton\n compact\n icon\n label={t(utilitiesExpanded ? 'collapse' : 'expand')}\n aria-label={t(utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel')}\n onClick={() => {\n utilitiesToggled.current = true;\n setUtilitiesExpanded(prevState => !prevState);\n }}\n disabled={disabled}\n ref={toggleButtonRef}\n >\n <Icon name={`arrow-micro-${utilitiesExpanded ? end : start}`} />\n </StyledExpandCollapseUtilitiesButton>\n );\n\n const genAICoachInUtilities = genAICoachProps && (\n <GenAICoach {...genAICoachProps} variant={{ placement: 'fullpage' }} isInLandingPageUtilities />\n );\n\n const genAICoach = genAICoachProps && (\n <GenAICoach {...genAICoachProps} variant={{ placement: 'fullpage' }} />\n );\n\n if (!mdOrAbove && genAICoach) {\n return genAICoach;\n }\n\n if (utilitiesExpanded && !lgOrAbove) {\n return (\n <Drawer\n as={StyledCaseDrawer}\n open={utilitiesExpanded}\n position='fixed'\n placement={end}\n shadow\n nullWhenClosed\n >\n <Flex\n as={StyledCaseDrawerContent}\n container={{ direction: 'column', gap: 2 }}\n data-app-region\n >\n <Flex container={{ alignItems: 'center', justify: 'between' }}>\n <Text variant='h2'>{t('utilities')}</Text>\n {utilitiesToggleButton}\n </Flex>\n {genAICoachInUtilities}\n </Flex>\n </Drawer>\n );\n }\n\n return (\n <Flex\n {...restProps}\n container={{ direction: 'column', gap: 1 }}\n as={StyledUtilitiesLayout}\n utilitiesExpanded={utilitiesExpanded}\n lgOrAbove={lgOrAbove}\n >\n <Flex container={{ alignItems: 'center', justify: 'between', pad: [0, 0, 1] }}>\n {utilitiesExpanded && <Text variant='h2'>{t('utilities')}</Text>}\n {utilitiesToggleButton}\n </Flex>\n {utilitiesExpanded && genAICoachInUtilities}\n {!utilitiesExpanded && (\n <StyledCoachButton\n iconOnly\n variant='primary'\n ref={genAICoachButtonRef}\n onClick={() => setShowCoach(cur => !cur)}\n label={t('chat_with_ai')}\n disabled={disabled}\n />\n )}\n {genAICoachButtonRef.current && genAICoachProps && showCoach && (\n <UtilitySummaryItemDialog\n target={genAICoachButtonRef.current}\n onDismiss={() => setShowCoach(false)}\n >\n <GenAICoach\n {...genAICoachProps}\n variant={{\n placement: 'dialog',\n onClose: () => {\n genAICoachProps.onClose?.();\n setShowCoach(false);\n genAICoachButtonRef.current?.focus();\n }\n }}\n />\n </UtilitySummaryItemDialog>\n )}\n </Flex>\n );\n};\nexport default UtilitiesLayout;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesLayout.styles.d.ts","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.styles.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,qBAAqB;wBACL,OAAO;gBACf,OAAO;SAmBnB,CAAC;AAIH,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"UtilitiesLayout.styles.d.ts","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.styles.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,qBAAqB;wBACL,OAAO;gBACf,OAAO;SAmBnB,CAAC;AAIH,eAAe,qBAAqB,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { defaultThemeProp } from '@pega/cosmos-react-core';
3
3
  import { headerHeight } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.styles';
4
+ import { StyledFullscreen } from '@pega/cosmos-react-core/lib/components/Fullscreen/Fullscreen';
4
5
  import { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';
5
6
  const StyledUtilitiesLayout = styled.div(({ utilitiesExpanded, lgOrAbove, theme }) => {
6
7
  return css `
@@ -16,7 +17,7 @@ const StyledUtilitiesLayout = styled.div(({ utilitiesExpanded, lgOrAbove, theme
16
17
  width: 25rem;
17
18
  `}
18
19
 
19
- ${StyledGenAICoachContainer} {
20
+ ${StyledFullscreen}, ${StyledGenAICoachContainer} {
20
21
  height: 100%;
21
22
  }
22
23
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"UtilitiesLayout.styles.js","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iEAAiE,CAAC;AAE/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAGrC,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7C,OAAO,GAAG,CAAA;;8BAEkB,KAAK,CAAC,IAAI,CAAC,OAAO;;yBAEvB,YAAY;2BACV,YAAY;MACjC,SAAS;QACX,iBAAiB;QACjB,GAAG,CAAA;oCAC6B,KAAK,CAAC,IAAI,CAAC,OAAO;;KAEjD;;MAEC,yBAAyB;;;GAG5B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,eAAe,qBAAqB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\nimport { headerHeight } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.styles';\n\nimport { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';\n\nconst StyledUtilitiesLayout = styled.div<{\n utilitiesExpanded?: boolean;\n lgOrAbove?: boolean;\n}>(({ utilitiesExpanded, lgOrAbove, theme }) => {\n return css`\n width: 3rem;\n padding-block: calc(2 * ${theme.base.spacing});\n position: sticky;\n inset-block-start: ${headerHeight};\n height: calc(100vh - ${headerHeight} - 2rem);\n ${lgOrAbove &&\n utilitiesExpanded &&\n css`\n margin-inline-end: calc(2 * ${theme.base.spacing});\n width: 25rem;\n `}\n\n ${StyledGenAICoachContainer} {\n height: 100%;\n }\n `;\n});\n\nStyledUtilitiesLayout.defaultProps = defaultThemeProp;\n\nexport default StyledUtilitiesLayout;\n"]}
1
+ {"version":3,"file":"UtilitiesLayout.styles.js","sourceRoot":"","sources":["../../../src/components/UtilitiesLayout/UtilitiesLayout.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,iEAAiE,CAAC;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8DAA8D,CAAC;AAEhG,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAGrC,CAAC,EAAE,iBAAiB,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;IAC7C,OAAO,GAAG,CAAA;;8BAEkB,KAAK,CAAC,IAAI,CAAC,OAAO;;yBAEvB,YAAY;2BACV,YAAY;MACjC,SAAS;QACX,iBAAiB;QACjB,GAAG,CAAA;oCAC6B,KAAK,CAAC,IAAI,CAAC,OAAO;;KAEjD;;MAEC,gBAAgB,KAAK,yBAAyB;;;GAGjD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,eAAe,qBAAqB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '@pega/cosmos-react-core';\nimport { headerHeight } from '@pega/cosmos-react-core/lib/components/AppShell/AppShell.styles';\nimport { StyledFullscreen } from '@pega/cosmos-react-core/lib/components/Fullscreen/Fullscreen';\n\nimport { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';\n\nconst StyledUtilitiesLayout = styled.div<{\n utilitiesExpanded?: boolean;\n lgOrAbove?: boolean;\n}>(({ utilitiesExpanded, lgOrAbove, theme }) => {\n return css`\n width: 3rem;\n padding-block: calc(2 * ${theme.base.spacing});\n position: sticky;\n inset-block-start: ${headerHeight};\n height: calc(100vh - ${headerHeight} - 2rem);\n ${lgOrAbove &&\n utilitiesExpanded &&\n css`\n margin-inline-end: calc(2 * ${theme.base.spacing});\n width: 25rem;\n `}\n\n ${StyledFullscreen}, ${StyledGenAICoachContainer} {\n height: 100%;\n }\n `;\n});\n\nStyledUtilitiesLayout.defaultProps = defaultThemeProp;\n\nexport default StyledUtilitiesLayout;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/cosmos-react-work",
3
- "version": "8.9.5",
3
+ "version": "8.10.0",
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": "8.9.5",
18
- "@pega/cosmos-react-rte": "8.9.5",
17
+ "@pega/cosmos-react-core": "8.10.0",
18
+ "@pega/cosmos-react-rte": "8.10.0",
19
19
  "@types/react": "^17.0.62 || ^18.3.3",
20
20
  "@types/react-dom": "^17.0.20 || ^18.3.0",
21
21
  "@types/styled-components": "^5.1.26",