@pega/cosmos-react-work 10.0.0-build.7.1 → 10.0.0-build.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Details/Details.styles.d.ts.map +1 -1
- package/lib/components/Details/Details.styles.js +5 -2
- package/lib/components/Details/Details.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.js +40 -41
- package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts +1 -0
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js +18 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts +2 -0
- package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Details.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAetD,OAAO,KAAK,EACV,yBAAyB,EAEzB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C,UAAU,sBAAuB,SAAQ,yBAAyB;IAChE,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,UAAU,wBAAwB;IAChC;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC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AG,CAAC,GAAG,CAAC,CAAC;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;IAC1C;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IAClC,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,KAAK,kCAAkC,GAAG,iBAAiB,CAAC,sBAAsB,CAAC,CAAC;AAGpF,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,2BAA2B,UAAU,CAAC;AACnD,eAAO,MAAM,6BAA6B,SAAS,CAAC;AAEpD,eAAO,MAAM,cAAc;;yLAE1B,CAAC;AAEF,eAAO,MAAM,0BAA0B,6NAkCrC,CAAC;AAIH,eAAO,MAAM,uBAAuB,6NAYlC,CAAC;AAIH,eAAO,MAAM,kBAAkB,6NAQ7B,CAAC;AAIH,eAAO,MAAM,kBAAkB,6NAW7B,CAAC;AAIH,eAAO,MAAM,2BAA2B,iOAuBtC,CAAC;AAIH,eAAO,MAAM,0BAA0B,6NAItC,CAAC;AAEF,eAAO,MAAM,iBAAiB;;gDAsI5B,CAAC;AAgBH,eAAO,MAAM,aAAa;cACd,YAAY,CAAC,SAAS,CAAC;kBACnB,MAAM;YAsEpB,CAAC;AAIH,eAAO,MAAM,mBAAmB,6PAgF/B,CAAC"}
|
|
@@ -244,7 +244,7 @@ export const StyledDetails = styled.div(({ variant, columnCount, theme }) => {
|
|
|
244
244
|
&::before {
|
|
245
245
|
content: '';
|
|
246
246
|
position: absolute;
|
|
247
|
-
inset-block-start:
|
|
247
|
+
inset-block-start: 0;
|
|
248
248
|
inset-block-end: 0;
|
|
249
249
|
inset-inline-start: 0;
|
|
250
250
|
width: ${borderWidth};
|
|
@@ -252,12 +252,15 @@ export const StyledDetails = styled.div(({ variant, columnCount, theme }) => {
|
|
|
252
252
|
|
|
253
253
|
${detached &&
|
|
254
254
|
css `
|
|
255
|
-
inset-block-start: 0;
|
|
256
255
|
width: 0.25rem;
|
|
257
256
|
background: ${transparentize(0.67, borderColor)};
|
|
258
257
|
border-radius: calc(${buttonBorderRadius} * ${baseBorderRadius});
|
|
259
258
|
`}
|
|
260
259
|
}
|
|
260
|
+
|
|
261
|
+
&:not(:first-child)::before {
|
|
262
|
+
inset-block-start: calc(1.5 * ${spacing});
|
|
263
|
+
}
|
|
261
264
|
`}
|
|
262
265
|
`}
|
|
263
266
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Details.styles.js","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,IAAI,EACL,MAAM,yBAAyB,CAAC;AAQjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AA6B9C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC;AACnD,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAEzC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjE,MAAM,EACJ,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,EACtC,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,GAAG,EAAE,GAAG,YA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C,mBAAmB,MAAM,OAAO;;WAE/D;SACF;;UAEC,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;;;;kCAIuB,aAAa;cACjC,UAAU,CAAC,OAAO,CAAC;;SAExB;;KAEJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { useContext } from 'react';\nimport { transparentize } from 'polished';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledFieldValueList,\n StyledIcon,\n useDirection,\n StyledButtonLink,\n Text\n} from '@pega/cosmos-react-core';\nimport type {\n StyledFieldValueListProps,\n FontSize,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\n\nimport type { DetailsProps } from './Details';\nimport DetailsContext from './DetailsContext';\n\ninterface StyledDetailsListProps extends StyledFieldValueListProps {\n /** Whether individual list items all have labels stacks on top */\n stacked?: boolean;\n /** The character length applied to all list labels */\n labelLength?: number;\n theme: DefaultTheme;\n}\n\ninterface StyledDetailColumnsProps {\n /**\n * Number of columns in the list\n * @default 1\n */\n columnCount?: 1 | 2 | 3;\n /**\n * Arrangement of columns\n */\n arrangement?: DetailsProps['arrangement'];\n /**\n * Style variations\n */\n variant?: DetailsProps['variant'];\n theme: DefaultTheme;\n}\n\ntype StyledDetailsListPropsWithDefaults = PropsWithDefaults<StyledDetailsListProps>;\n\nconst rowGapMultiplier = 1;\nexport const columnGapMultiplier = 5.5;\nexport const oneColumnDetailsColumnWidth = '100ch';\nexport const multiColumnDetailsColumnWidth = '80ch';\n\nexport const StyledNameText = styled(Text)`\n word-break: break-word;\n`;\n\nexport const StyledFieldValueGroupLabel = styled.div(({ theme }) => {\n const {\n base: { spacing, animation, palette }\n } = theme;\n const { rtl } = useDirection();\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n return css`\n width: 100%;\n grid-column: 1 / -1;\n margin-block-end: calc(${rowGapMultiplier} * ${spacing});\n ${detached &&\n css`\n border-bottom: 0.0625rem solid ${palette['border-line']};\n padding-bottom: calc(0.5 * ${spacing});\n `}\n\n ${StyledButtonLink} ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n ${StyledButtonLink}[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n ${StyledButtonLink}[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n});\n\nStyledFieldValueGroupLabel.defaultProps = defaultThemeProp;\n\nexport const StyledDetailDescription = styled.div(({ theme }) => {\n const {\n base: {\n spacing,\n 'content-width': { xl }\n }\n } = theme;\n\n return css`\n max-width: ${xl};\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailDescription.defaultProps = defaultThemeProp;\n\nexport const StyledDetailBanner = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailBanner.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumn = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n display: flex;\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n width: 100%;\n `;\n});\n\nStyledDetailColumn.defaultProps = defaultThemeProp;\n\nexport const StyledHighlightedDetailList = styled.dl(({ theme }) => {\n const {\n base: { spacing, palette }\n } = theme;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n max-width: calc(${multiColumnDetailsColumnWidth} * 3 + ${columnGapMultiplier} * ${spacing} * 2);\n padding-block-end: calc(1.5 * ${spacing});\n\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n\n + hr {\n border-top: unset;\n border-radius: unset;\n border-style: unset;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n margin-block-end: calc(1.5 * ${spacing});\n }\n `;\n});\n\nStyledHighlightedDetailList.defaultProps = defaultThemeProp;\n\nexport const StyledInlineFieldValueItem = styled.div`\n > * {\n min-width: 0;\n }\n`;\n\nexport const StyledDetailsList = styled(StyledFieldValueList)<StyledDetailsListPropsWithDefaults>(({\n stacked,\n labelLength,\n variant,\n theme\n}) => {\n const {\n base: {\n spacing,\n palette,\n 'content-width': { md }\n },\n components: {\n details: { 'field-label': fieldLabelPosition },\n 'field-value-list': {\n inline: { detached, 'border-style': borderStyle }\n }\n }\n } = theme;\n\n const { inFieldGroup } = useContext(DetailsContext);\n const labelTop = (stacked || fieldLabelPosition === 'stacked') && variant !== 'value-comparison';\n const isValueComparison = variant === 'value-comparison';\n const fieldValueGapMultiplier = 2;\n\n return css`\n /* Field Grid Styles */\n display: flex;\n flex-direction: column;\n row-gap: ${detached ? 0 : `calc(${rowGapMultiplier} * ${spacing})`};\n width: 100%;\n max-width: ${oneColumnDetailsColumnWidth};\n height: fit-content;\n container-type: inline-size;\n container-name: details-list;\n\n ${StyledFieldValue} {\n word-break: break-word;\n overflow: auto;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n }\n\n ${StyledInlineFieldValueItem}, ${StyledStackedFieldValue} {\n width: 100%;\n }\n\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr);\n grid-template-rows: max-content;\n column-gap: calc(${fieldValueGapMultiplier} * ${spacing});\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem ${borderStyle} ${palette['border-line']};\n }\n `}\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(calc(14ch - ${spacing}), calc(${labelLength}ch - ${spacing}))\n minmax(14ch, 1fr);\n `};\n }\n\n ${StyledStackedFieldValue} {\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem ${borderStyle} ${palette['border-line']};\n }\n `}\n }\n\n /* Stacked Label Styles */\n ${labelTop &&\n css`\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n\n dt {\n max-width: 100%;\n }\n\n ${!isValueComparison &&\n css`\n ${StyledStackedFieldValue}:not(:first-child) {\n margin-block-start: calc(${rowGapMultiplier} * ${spacing});\n }\n `}\n `}\n\n /* Value Comparison Styles */\n ${isValueComparison &&\n css`\n display: grid;\n grid-template-columns: auto auto;\n column-gap: 0;\n row-gap: calc(0.5 * ${spacing});\n\n > dd {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n `}\n\n /* Responsive behavior */\n ${!labelTop &&\n !isValueComparison &&\n css`\n @container details-list (width < ${md}) {\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(0, ${labelLength}ch) minmax(50%, 1fr);\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(0, calc(${labelLength}ch - ${spacing}))\n minmax(calc(50% + 0.5 * ${spacing}), 1fr);\n `}\n }\n\n dd {\n min-width: 50%;\n }\n }\n `}\n `;\n});\n\nStyledDetailsList.defaultProps = defaultThemeProp;\n\nconst spacingTop = (spacing: string) => {\n return css`\n > ${StyledFieldValueGroupLabel} {\n margin-block-start: calc((1.5 * ${rowGapMultiplier}) * ${spacing});\n }\n\n > ${StyledDetailDescription}:first-child {\n margin-block-start: calc(1.5 * ${spacing});\n }\n `;\n};\n\nexport const StyledDetails = styled.div<{\n variant?: DetailsProps['variant'];\n columnCount?: number;\n}>(({ variant, columnCount, theme }) => {\n const {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'border-line': borderColor }\n },\n components: {\n 'form-control': { 'border-width': borderWidth },\n button: { 'border-radius': buttonBorderRadius },\n 'field-value-list': {\n inline: { detached, 'border-style': borderStyle }\n }\n }\n } = theme;\n\n return css`\n &:not(:first-child) {\n ${spacingTop(spacing)}\n }\n\n ${variant === 'field-group' &&\n css`\n & + ${StyledDetailsList} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n ${columnCount === 1 &&\n css`\n position: relative;\n padding-inline-start: ${spacing};\n\n ${detached &&\n css`\n padding-inline-start: calc(1.25 * ${spacing});\n `}\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: calc(-1 * ${spacing});\n inset-block-end: 0;\n inset-inline-start: 0;\n width: ${borderWidth};\n background: ${borderColor};\n\n ${detached &&\n css`\n inset-block-start: 0;\n width: 0.25rem;\n background: ${transparentize(0.67, borderColor)};\n border-radius: calc(${buttonBorderRadius} * ${baseBorderRadius});\n `}\n }\n `}\n `}\n\n ${!variant &&\n detached &&\n css`\n & + ${StyledDetailsList} {\n margin-block-start: 0;\n border-block-start: 0.0625rem ${borderStyle} ${theme.base.palette['border-line']};\n }\n `};\n `;\n});\n\nStyledDetails.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumns = styled.div<StyledDetailColumnsProps>(\n ({ theme, arrangement, columnCount = 1 }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n width: 100%;\n\n ${columnCount === 2 &&\n !arrangement &&\n css`\n flex-wrap: wrap;\n `}\n\n ${columnCount === 1 &&\n css`\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n `};\n\n /* Column Widths */\n > ${StyledDetailColumn} {\n overflow: hidden;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n\n ${columnCount === 3 &&\n css`\n width: ${multiColumnDetailsColumnWidth};\n max-width: calc(33.33% - (${columnGapMultiplier} * ${spacing} * 2) / 3);\n `}\n\n ${columnCount === 2 &&\n css`\n width: calc(50% - (${columnGapMultiplier} * ${spacing}) / 2);\n max-width: unset;\n\n &:nth-child(3) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n\n ${columnCount !== 1 &&\n css`\n ${arrangement === 'narrowWide' &&\n css`\n &:nth-child(2) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n\n ${arrangement === 'wideNarrow' &&\n css`\n &:nth-child(1) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n `}\n\n ${columnCount === 1 &&\n css`\n width: 100%;\n max-width: 100%;\n\n &:not(:first-child) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n }\n `;\n }\n);\n\nStyledDetailColumns.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"Details.styles.js","sourceRoot":"","sources":["../../../src/components/Details/Details.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,IAAI,EACL,MAAM,yBAAyB,CAAC;AAQjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AA6B9C,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,2BAA2B,GAAG,OAAO,CAAC;AACnD,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAEzC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,K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AU,mBAAmB,MAAM,OAAO;;0CAE/C,mBAAmB,MAAM,OAAO;;WAE/D;;YAEC,WAAW,KAAK,YAAY;YAC9B,GAAG,CAAA;;;kBAGK,6BAA6B,UAAU,mBAAmB,MAAM,OAAO;;0CAE/C,mBAAmB,MAAM,OAAO;;WAE/D;SACF;;UAEC,WAAW,KAAK,CAAC;QACnB,GAAG,CAAA;;;;kCAIuB,aAAa;cACjC,UAAU,CAAC,OAAO,CAAC;;SAExB;;KAEJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\nimport { useContext } from 'react';\nimport { transparentize } from 'polished';\n\nimport {\n calculateFontSize,\n defaultThemeProp,\n StyledFieldValue,\n StyledStackedFieldValue,\n StyledFieldValueList,\n StyledIcon,\n useDirection,\n StyledButtonLink,\n Text\n} from '@pega/cosmos-react-core';\nimport type {\n StyledFieldValueListProps,\n FontSize,\n PropsWithDefaults\n} from '@pega/cosmos-react-core';\n\nimport type { DetailsProps } from './Details';\nimport DetailsContext from './DetailsContext';\n\ninterface StyledDetailsListProps extends StyledFieldValueListProps {\n /** Whether individual list items all have labels stacks on top */\n stacked?: boolean;\n /** The character length applied to all list labels */\n labelLength?: number;\n theme: DefaultTheme;\n}\n\ninterface StyledDetailColumnsProps {\n /**\n * Number of columns in the list\n * @default 1\n */\n columnCount?: 1 | 2 | 3;\n /**\n * Arrangement of columns\n */\n arrangement?: DetailsProps['arrangement'];\n /**\n * Style variations\n */\n variant?: DetailsProps['variant'];\n theme: DefaultTheme;\n}\n\ntype StyledDetailsListPropsWithDefaults = PropsWithDefaults<StyledDetailsListProps>;\n\nconst rowGapMultiplier = 1;\nexport const columnGapMultiplier = 5.5;\nexport const oneColumnDetailsColumnWidth = '100ch';\nexport const multiColumnDetailsColumnWidth = '80ch';\n\nexport const StyledNameText = styled(Text)`\n word-break: break-word;\n`;\n\nexport const StyledFieldValueGroupLabel = styled.div(({ theme }) => {\n const {\n base: { spacing, animation, palette }\n } = theme;\n const { rtl } = useDirection();\n const {\n components: {\n 'field-value-list': {\n inline: { detached }\n }\n }\n } = theme;\n return css`\n width: 100%;\n grid-column: 1 / -1;\n margin-block-end: calc(${rowGapMultiplier} * ${spacing});\n ${detached &&\n css`\n border-bottom: 0.0625rem solid ${palette['border-line']};\n padding-bottom: calc(0.5 * ${spacing});\n `}\n\n ${StyledButtonLink} ${StyledIcon} {\n transition: transform ${animation.speed} ${animation.timing.ease};\n }\n\n ${StyledButtonLink}[aria-expanded='true'] ${StyledIcon} {\n transform: rotate(90deg);\n }\n\n ${StyledButtonLink}[aria-expanded='false'] ${StyledIcon} {\n transform: rotate(${rtl ? 180 : 0}deg);\n }\n `;\n});\n\nStyledFieldValueGroupLabel.defaultProps = defaultThemeProp;\n\nexport const StyledDetailDescription = styled.div(({ theme }) => {\n const {\n base: {\n spacing,\n 'content-width': { xl }\n }\n } = theme;\n\n return css`\n max-width: ${xl};\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailDescription.defaultProps = defaultThemeProp;\n\nexport const StyledDetailBanner = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n margin-block-end: calc(1.5 * ${spacing});\n `;\n});\n\nStyledDetailBanner.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumn = styled.div(({ theme }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n display: flex;\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n width: 100%;\n `;\n});\n\nStyledDetailColumn.defaultProps = defaultThemeProp;\n\nexport const StyledHighlightedDetailList = styled.dl(({ theme }) => {\n const {\n base: { spacing, palette }\n } = theme;\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n max-width: calc(${multiColumnDetailsColumnWidth} * 3 + ${columnGapMultiplier} * ${spacing} * 2);\n padding-block-end: calc(1.5 * ${spacing});\n\n dd {\n font-size: ${fontSize[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n\n + hr {\n border-top: unset;\n border-radius: unset;\n border-style: unset;\n border-bottom: 0.0625rem solid ${palette['border-line']};\n margin-block-end: calc(1.5 * ${spacing});\n }\n `;\n});\n\nStyledHighlightedDetailList.defaultProps = defaultThemeProp;\n\nexport const StyledInlineFieldValueItem = styled.div`\n > * {\n min-width: 0;\n }\n`;\n\nexport const StyledDetailsList = styled(StyledFieldValueList)<StyledDetailsListPropsWithDefaults>(({\n stacked,\n labelLength,\n variant,\n theme\n}) => {\n const {\n base: {\n spacing,\n palette,\n 'content-width': { md }\n },\n components: {\n details: { 'field-label': fieldLabelPosition },\n 'field-value-list': {\n inline: { detached, 'border-style': borderStyle }\n }\n }\n } = theme;\n\n const { inFieldGroup } = useContext(DetailsContext);\n const labelTop = (stacked || fieldLabelPosition === 'stacked') && variant !== 'value-comparison';\n const isValueComparison = variant === 'value-comparison';\n const fieldValueGapMultiplier = 2;\n\n return css`\n /* Field Grid Styles */\n display: flex;\n flex-direction: column;\n row-gap: ${detached ? 0 : `calc(${rowGapMultiplier} * ${spacing})`};\n width: 100%;\n max-width: ${oneColumnDetailsColumnWidth};\n height: fit-content;\n container-type: inline-size;\n container-name: details-list;\n\n ${StyledFieldValue} {\n word-break: break-word;\n overflow: auto;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n }\n\n ${StyledInlineFieldValueItem}, ${StyledStackedFieldValue} {\n width: 100%;\n }\n\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(14ch, ${labelLength}ch) minmax(14ch, 1fr);\n grid-template-rows: max-content;\n column-gap: calc(${fieldValueGapMultiplier} * ${spacing});\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem ${borderStyle} ${palette['border-line']};\n }\n `}\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(calc(14ch - ${spacing}), calc(${labelLength}ch - ${spacing}))\n minmax(14ch, 1fr);\n `};\n }\n\n ${StyledStackedFieldValue} {\n ${detached &&\n css`\n padding-block: calc(0.5 * ${spacing});\n &:not(:last-child) {\n border-bottom: 0.0625rem ${borderStyle} ${palette['border-line']};\n }\n `}\n }\n\n /* Stacked Label Styles */\n ${labelTop &&\n css`\n grid-template-columns: minmax(0, 1fr);\n row-gap: 0;\n\n dt {\n max-width: 100%;\n }\n\n ${!isValueComparison &&\n css`\n ${StyledStackedFieldValue}:not(:first-child) {\n margin-block-start: calc(${rowGapMultiplier} * ${spacing});\n }\n `}\n `}\n\n /* Value Comparison Styles */\n ${isValueComparison &&\n css`\n display: grid;\n grid-template-columns: auto auto;\n column-gap: 0;\n row-gap: calc(0.5 * ${spacing});\n\n > dd {\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n }\n `}\n\n /* Responsive behavior */\n ${!labelTop &&\n !isValueComparison &&\n css`\n @container details-list (width < ${md}) {\n ${StyledInlineFieldValueItem} {\n grid-template-columns: minmax(0, ${labelLength}ch) minmax(50%, 1fr);\n\n ${inFieldGroup &&\n css`\n grid-template-columns:\n minmax(0, calc(${labelLength}ch - ${spacing}))\n minmax(calc(50% + 0.5 * ${spacing}), 1fr);\n `}\n }\n\n dd {\n min-width: 50%;\n }\n }\n `}\n `;\n});\n\nStyledDetailsList.defaultProps = defaultThemeProp;\n\nconst spacingTop = (spacing: string) => {\n return css`\n > ${StyledFieldValueGroupLabel} {\n margin-block-start: calc((1.5 * ${rowGapMultiplier}) * ${spacing});\n }\n\n > ${StyledDetailDescription}:first-child {\n margin-block-start: calc(1.5 * ${spacing});\n }\n `;\n};\n\nexport const StyledDetails = styled.div<{\n variant?: DetailsProps['variant'];\n columnCount?: number;\n}>(({ variant, columnCount, theme }) => {\n const {\n base: {\n spacing,\n 'border-radius': baseBorderRadius,\n palette: { 'border-line': borderColor }\n },\n components: {\n 'form-control': { 'border-width': borderWidth },\n button: { 'border-radius': buttonBorderRadius },\n 'field-value-list': {\n inline: { detached, 'border-style': borderStyle }\n }\n }\n } = theme;\n\n return css`\n &:not(:first-child) {\n ${spacingTop(spacing)}\n }\n\n ${variant === 'field-group' &&\n css`\n & + ${StyledDetailsList} {\n margin-block-start: calc(1.5 * ${spacing});\n }\n\n ${columnCount === 1 &&\n css`\n position: relative;\n padding-inline-start: ${spacing};\n\n ${detached &&\n css`\n padding-inline-start: calc(1.25 * ${spacing});\n `}\n\n &::before {\n content: '';\n position: absolute;\n inset-block-start: 0;\n inset-block-end: 0;\n inset-inline-start: 0;\n width: ${borderWidth};\n background: ${borderColor};\n\n ${detached &&\n css`\n width: 0.25rem;\n background: ${transparentize(0.67, borderColor)};\n border-radius: calc(${buttonBorderRadius} * ${baseBorderRadius});\n `}\n }\n\n &:not(:first-child)::before {\n inset-block-start: calc(1.5 * ${spacing});\n }\n `}\n `}\n\n ${!variant &&\n detached &&\n css`\n & + ${StyledDetailsList} {\n margin-block-start: 0;\n border-block-start: 0.0625rem ${borderStyle} ${theme.base.palette['border-line']};\n }\n `};\n `;\n});\n\nStyledDetails.defaultProps = defaultThemeProp;\n\nexport const StyledDetailColumns = styled.div<StyledDetailColumnsProps>(\n ({ theme, arrangement, columnCount = 1 }) => {\n const {\n base: { spacing }\n } = theme;\n\n return css`\n width: 100%;\n\n ${columnCount === 2 &&\n !arrangement &&\n css`\n flex-wrap: wrap;\n `}\n\n ${columnCount === 1 &&\n css`\n flex-direction: column;\n row-gap: calc(${rowGapMultiplier} * ${spacing});\n `};\n\n /* Column Widths */\n > ${StyledDetailColumn} {\n overflow: hidden;\n\n /* Negative margin to account for overflow clipping of focus indicator */\n padding: 0.3rem;\n margin: -0.3rem;\n\n ${columnCount === 3 &&\n css`\n width: ${multiColumnDetailsColumnWidth};\n max-width: calc(33.33% - (${columnGapMultiplier} * ${spacing} * 2) / 3);\n `}\n\n ${columnCount === 2 &&\n css`\n width: calc(50% - (${columnGapMultiplier} * ${spacing}) / 2);\n max-width: unset;\n\n &:nth-child(3) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n\n ${columnCount !== 1 &&\n css`\n ${arrangement === 'narrowWide' &&\n css`\n &:nth-child(2) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n\n ${arrangement === 'wideNarrow' &&\n css`\n &:nth-child(1) {\n width: calc(\n ${multiColumnDetailsColumnWidth} * 2 + ${columnGapMultiplier} * ${spacing}\n );\n max-width: calc(66.66% - (${columnGapMultiplier} * ${spacing}) / 3);\n }\n `}\n `}\n\n ${columnCount === 1 &&\n css`\n width: 100%;\n max-width: 100%;\n\n &:not(:first-child) > ${StyledDetails}:first-child {\n ${spacingTop(spacing)}\n }\n `}\n }\n `;\n }\n);\n\nStyledDetailColumns.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AAgHA,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;AAiDhF,eAAO,MAAM,SAAS,+CA2GrB,CAAC;AAEF,eAAO,MAAM,gBAAgB,+CAQ5B,CAAC;iCA28DyB,eAAe;;;AAQ1C,wBAA6D"}
|
|
@@ -17,24 +17,30 @@ import * as dockIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/doc
|
|
|
17
17
|
import * as undockIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/undock.icon';
|
|
18
18
|
import * as caretLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-left.icon';
|
|
19
19
|
import * as caretRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/caret-right.icon';
|
|
20
|
+
import * as clockSlaIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/clock-sla.icon';
|
|
20
21
|
import { getGenAICoachTestIds } from './GenAICoach.test-ids';
|
|
21
22
|
import { getSelectedKeys, isCoachMessage, isInUtilities, isUserMessage } from './GenAICoach.utils';
|
|
22
|
-
import { StyledMessagesContainer, StyledDisclaimerText, StyledGenAICoachContainer, StyledGenAIOptionsMenu, StyledInitialMessageContainer, StyledInputContainer, StyledMenuSuggestions, StyledMessagesList, StyledGridContainer, StyledFlexWrapper, StyledErrorContainer, StyledInput, StyledGuidedSuggestions, StyledComposerSection, StyledSendButton, StyledStopGeneratingButton, StyledGenAIFormControl, StyledGenAITextArea, StyledInitialMessageGrid, StyledGenAIFooter, StyledAgentIcon, StyledActionsContainer, StyledHeaderContainer, StyledFullscreenWrapper, StyledScrollButton, StyledSuggestionCardsView, StyledSuggestionCardsBottomHalf, StyledStickyComposer, StyledAISuggestedBadge, StyledSalutation, StyledSubHeading, StyledComposerWrapper, StyledBannerSalutationBlock, StyledComposerSelector, StyledSimplifiedInitialMessageGrid } from './GenAICoach.styles';
|
|
23
|
+
import { StyledMessagesContainer, StyledDisclaimerText, StyledGenAICoachContainer, StyledGenAIOptionsMenu, StyledInitialMessageContainer, StyledInputContainer, StyledMenuSuggestions, StyledMessagesList, StyledGridContainer, StyledFlexWrapper, StyledErrorContainer, StyledInput, StyledGuidedSuggestions, StyledComposerSection, StyledSendButton, StyledStopGeneratingButton, StyledGenAIFormControl, StyledGenAITextArea, StyledInitialMessageGrid, StyledGenAIFooter, StyledAgentIcon, StyledActionsContainer, StyledHeaderContainer, StyledFullscreenWrapper, StyledScrollButton, StyledSuggestionCardsView, StyledSuggestionCardsBottomHalf, StyledStickyComposer, StyledAISuggestedBadge, StyledSalutation, StyledSubHeading, StyledComposerWrapper, StyledBannerSalutationBlock, StyledComposerSelector, StyledSimplifiedInitialMessageGrid, StyledConversationHistoryButton } from './GenAICoach.styles';
|
|
23
24
|
import ActiveCases from './ActiveCases';
|
|
24
25
|
import CaseWorkflow from './CaseWorkflow';
|
|
25
26
|
import ConversationHistory from './ConversationHistory';
|
|
26
27
|
import Questionnaire from './Questionnaire';
|
|
27
28
|
import { GenAIMessage, InitialSuggestedMessage } from '.';
|
|
28
|
-
registerIcon(caretUpIcon, timesIcon, caretDownIcon, minusIcon, polarisSolidIcon, paperClipIcon, warnSolidIcon, squareSolidIcon, sendSolidIcon, plusIcon, dockIcon, undockIcon, caretLeftIcon, caretRightIcon, moreAltIcon);
|
|
29
|
+
registerIcon(caretUpIcon, timesIcon, caretDownIcon, minusIcon, polarisSolidIcon, paperClipIcon, warnSolidIcon, squareSolidIcon, sendSolidIcon, plusIcon, dockIcon, undockIcon, caretLeftIcon, caretRightIcon, clockSlaIcon, moreAltIcon);
|
|
29
30
|
const onHeightTransitionEnd = (el, callback) => {
|
|
30
31
|
const handler = (e) => {
|
|
31
32
|
if (e.propertyName !== 'height' || e.target !== el)
|
|
32
33
|
return;
|
|
33
34
|
el.removeEventListener('transitionend', handler);
|
|
35
|
+
el.removeEventListener('transitioncancel', handler);
|
|
34
36
|
callback();
|
|
35
37
|
};
|
|
36
38
|
el.addEventListener('transitionend', handler);
|
|
37
|
-
|
|
39
|
+
el.addEventListener('transitioncancel', handler);
|
|
40
|
+
return () => {
|
|
41
|
+
el.removeEventListener('transitionend', handler);
|
|
42
|
+
el.removeEventListener('transitioncancel', handler);
|
|
43
|
+
};
|
|
38
44
|
};
|
|
39
45
|
const buildInitialFormAnswers = (questions = []) => Object.fromEntries(questions.map(question => [
|
|
40
46
|
question.field,
|
|
@@ -98,7 +104,7 @@ const HeaderActions = ({ actions, allowFullScreen, variant, isUserTriggeredRef,
|
|
|
98
104
|
}
|
|
99
105
|
return (_jsx(Actions, { ...(actions ?? {}), menuAt: 1, "data-testid": actionsTestId, contextualLabel: selectedCoach, items: mergedItems }));
|
|
100
106
|
};
|
|
101
|
-
const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, onNewChat, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation = true, isPortalAgent = false, pagePanel, suggestionCardsView, draftMessage, caseWorkflow, activeCases, onStop, isCreatingConversation, conversationError, questionnaireData, onQuestionnaireDismiss, simplifiedAgent = false, subHeading, operatorName, agentModeProps, modelSelectorProps, ...restProps }) => {
|
|
107
|
+
const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, onNewChat, conversationHistory, onConversationHistoryOpen, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation = true, isPortalAgent = false, pagePanel, suggestionCardsView, draftMessage, caseWorkflow, activeCases, onStop, isCreatingConversation, conversationError, questionnaireData, onQuestionnaireDismiss, simplifiedAgent = false, subHeading, operatorName, agentModeProps, modelSelectorProps, ...restProps }) => {
|
|
102
108
|
const scrollTolerancePx = 2;
|
|
103
109
|
const scrollThresholdPx = 50;
|
|
104
110
|
const streamBufferLh = simplifiedAgent ? 15 : 5;
|
|
@@ -115,15 +121,15 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
115
121
|
const genAICoachRef = useRef(null);
|
|
116
122
|
const [messageEls, getMessageCbRef] = useRefMap();
|
|
117
123
|
const [showInitialScreen, setShowInitialScreen] = useState(true);
|
|
118
|
-
const prevExpandedHeightRef = useRef(0);
|
|
119
124
|
const agentInBanner = simplifiedAgent && variant.placement === 'fullpage';
|
|
125
|
+
const historyOpen = !!conversationHistory;
|
|
120
126
|
const agentExpanded = simplifiedAgent && messages.length > 0;
|
|
121
127
|
const hasAgentResponse = messages.some(msg => isCoachMessage(msg) && !msg.loading);
|
|
122
128
|
const focusInMessageListRef = useRef(false);
|
|
123
129
|
const mouseTriggeredFocusRef = useRef(false);
|
|
124
130
|
const isUserTriggered = useRef(false);
|
|
125
131
|
const userInitiatedSendRef = useRef(false);
|
|
126
|
-
const
|
|
132
|
+
const prevHeightRef = useRef(0);
|
|
127
133
|
const showNextCoachSender = useRef(true);
|
|
128
134
|
const lastFocusedMessageRef = useRef(null);
|
|
129
135
|
const initialFocusedElementRef = useRef(null);
|
|
@@ -498,6 +504,9 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
498
504
|
return;
|
|
499
505
|
if (simplifiedAgent) {
|
|
500
506
|
userInitiatedSendRef.current = true;
|
|
507
|
+
if (agentInBanner && messages.length === 0) {
|
|
508
|
+
prevHeightRef.current = genAICoachRef.current?.getBoundingClientRect().height ?? 0;
|
|
509
|
+
}
|
|
501
510
|
}
|
|
502
511
|
onSend({
|
|
503
512
|
id: createUID(),
|
|
@@ -542,11 +551,9 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
542
551
|
variant.onStateChange('maximized');
|
|
543
552
|
isUserTriggered.current = true;
|
|
544
553
|
}, children: _jsx(Icon, { name: 'caret-up' }) }) })] })) : (_jsxs(_Fragment, { children: [renderCoachOptions, _jsxs(Flex, { container: { gap: 0.5 }, as: StyledActionsContainer, children: [activeCases && _jsx(ActiveCases, { activeCases: activeCases }), simplifiedAgent && (_jsx(HeaderActions, { actions: actions, allowFullScreen: allowFullScreen, variant: variant, isUserTriggeredRef: isUserTriggered, onFullscreenToggle: toggleFullscreen, isFullscreen: fullScreen, selectedCoach: selectedCoach, actionsTestId: testIds.actions, simplifiedAgent: true })), onNewChat && (_jsx(Button, { icon: true, variant: 'simple', label: simplifiedAgent ? t('close') : t('new_chat'), "aria-label": simplifiedAgent ? t('close_chat_with_ai') : t('new_chat'), onClick: () => {
|
|
545
|
-
if (
|
|
546
|
-
|
|
547
|
-
genAICoachRef.current.getBoundingClientRect().height;
|
|
554
|
+
if (agentInBanner && genAICoachRef.current) {
|
|
555
|
+
prevHeightRef.current = genAICoachRef.current.getBoundingClientRect().height;
|
|
548
556
|
}
|
|
549
|
-
userInitiatedNewChatRef.current = true;
|
|
550
557
|
if (simplifiedAgent && conversationHistory) {
|
|
551
558
|
conversationHistory.onDismiss();
|
|
552
559
|
}
|
|
@@ -607,38 +614,16 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
607
614
|
textAreaRef.current?.focus();
|
|
608
615
|
}
|
|
609
616
|
}, [draftMessage, suggestionCardsView]);
|
|
610
|
-
|
|
611
|
-
if (!agentInBanner ||
|
|
612
|
-
!genAICoachRef.current ||
|
|
613
|
-
messages.length !== 0 ||
|
|
614
|
-
(loading && conversationHistory))
|
|
615
|
-
return;
|
|
617
|
+
const animateHeightFrom = useCallback((fromHeight) => {
|
|
616
618
|
const el = genAICoachRef.current;
|
|
617
|
-
|
|
618
|
-
const storedHeight = parseFloat(el.style.getPropertyValue('--compact-height')) || 0;
|
|
619
|
-
if (storedHeight > 0 && Math.abs(currentHeight - storedHeight) > scrollTolerancePx)
|
|
620
|
-
return;
|
|
621
|
-
el.style.removeProperty('--compact-height');
|
|
622
|
-
const naturalHeight = el.getBoundingClientRect().height;
|
|
623
|
-
el.style.setProperty('--compact-height', `${naturalHeight}px`);
|
|
624
|
-
});
|
|
625
|
-
useLayoutEffect(() => {
|
|
626
|
-
if (!agentInBanner || messages.length !== 0)
|
|
627
|
-
return;
|
|
628
|
-
if (!userInitiatedNewChatRef.current || !genAICoachRef.current)
|
|
619
|
+
if (!el)
|
|
629
620
|
return;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
const fromHeight = prevExpandedHeightRef.current;
|
|
633
|
-
const toHeight = parseFloat(el.style.getPropertyValue('--compact-height')) || 0;
|
|
634
|
-
if (!fromHeight || !toHeight)
|
|
621
|
+
const toHeight = el.getBoundingClientRect().height;
|
|
622
|
+
if (Math.abs(fromHeight - toHeight) <= scrollTolerancePx)
|
|
635
623
|
return;
|
|
636
|
-
el.style.height = `${fromHeight}px`;
|
|
637
624
|
el.style.transition = 'none';
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
prevExpandedHeightRef.current = 0;
|
|
641
|
-
});
|
|
625
|
+
el.style.height = `${fromHeight}px`;
|
|
626
|
+
const removeListener = onHeightTransitionEnd(el, () => el.style.removeProperty('height'));
|
|
642
627
|
const rafId = requestAnimationFrame(() => {
|
|
643
628
|
el.getBoundingClientRect();
|
|
644
629
|
el.style.removeProperty('transition');
|
|
@@ -647,8 +632,19 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
647
632
|
return () => {
|
|
648
633
|
cancelAnimationFrame(rafId);
|
|
649
634
|
removeListener();
|
|
635
|
+
el.style.removeProperty('height');
|
|
636
|
+
el.style.removeProperty('transition');
|
|
650
637
|
};
|
|
651
|
-
}, [
|
|
638
|
+
}, []);
|
|
639
|
+
useLayoutEffect(() => {
|
|
640
|
+
const fromHeight = prevHeightRef.current;
|
|
641
|
+
if (!agentInBanner || !fromHeight || historyOpen)
|
|
642
|
+
return;
|
|
643
|
+
if (messages.length === 0 && !showInitialScreen)
|
|
644
|
+
return;
|
|
645
|
+
prevHeightRef.current = 0;
|
|
646
|
+
return animateHeightFrom(fromHeight);
|
|
647
|
+
}, [messages.length, agentInBanner, showInitialScreen, historyOpen, animateHeightFrom]);
|
|
652
648
|
useEffect(() => {
|
|
653
649
|
if (!agentInBanner)
|
|
654
650
|
return;
|
|
@@ -890,7 +886,7 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
890
886
|
justify: 'between',
|
|
891
887
|
gap: 2,
|
|
892
888
|
pad: [undefined, 1, 1, 1]
|
|
893
|
-
}, children: [_jsxs(Flex, { container: { alignItems: 'center' }, item: { grow: 1, shrink: 1, basis: '0%' }, children: [!(messages.length === 0 && suggestionCardsView) && suggestions && (_jsx(MenuButton, { text: t('suggestions'), variant: 'simple', icon: 'chat-typing', iconOnly: true, as: StyledMenuSuggestions, menu: {
|
|
889
|
+
}, children: [_jsxs(Flex, { container: { alignItems: 'center' }, item: { grow: 1, shrink: 1, basis: '0%' }, children: [agentInBanner && messages.length === 0 && onConversationHistoryOpen && (_jsx(Flex, { container: { alignItems: 'center' }, as: StyledConversationHistoryButton, children: _jsx(Button, { icon: true, variant: 'simple', label: t('your_chats'), onClick: onConversationHistoryOpen, children: _jsx(Icon, { name: 'clock-sla' }) }) })), !(messages.length === 0 && suggestionCardsView) && suggestions && (_jsx(MenuButton, { text: t('suggestions'), variant: 'simple', icon: 'chat-typing', iconOnly: true, as: StyledMenuSuggestions, menu: {
|
|
894
890
|
items: suggestions,
|
|
895
891
|
onItemClick: id => {
|
|
896
892
|
const selected = menuHelpers.getItem(suggestions, id);
|
|
@@ -960,7 +956,7 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
960
956
|
!fullScreen &&
|
|
961
957
|
!isInLandingPageUtilities &&
|
|
962
958
|
messages.length === 0 &&
|
|
963
|
-
!(
|
|
959
|
+
!(agentInBanner && historyOpen);
|
|
964
960
|
const fullPageAndInitialScreen = (fullScreen || (variant.placement === 'fullpage' && !isInLandingPageUtilities)) &&
|
|
965
961
|
messages.length === 0;
|
|
966
962
|
const renderTextArea = agentInBanner || !fullPageAndInitialScreen ? genAIFooter : null;
|
|
@@ -1181,6 +1177,9 @@ const GenAICoachContent = ({ testId, coachOptions: coachOptionsProps, onCoachCha
|
|
|
1181
1177
|
conversationHistory.onItemClick?.(conversationId);
|
|
1182
1178
|
}, onDismiss: () => {
|
|
1183
1179
|
focusTextArea.current = true;
|
|
1180
|
+
if (agentInBanner && messages.length === 0 && genAICoachRef.current) {
|
|
1181
|
+
prevHeightRef.current = genAICoachRef.current.getBoundingClientRect().height;
|
|
1182
|
+
}
|
|
1184
1183
|
conversationHistory.onDismiss();
|
|
1185
1184
|
}, inFullPage: !condition, ref: historyViewRef }));
|
|
1186
1185
|
return (_jsxs(Flex, { ...restProps, container: { direction: 'column' }, as: StyledGenAICoachContainer, "data-testid": testIds.root, variant: variant, fullScreen: fullScreen, isCompact: isCompact, isPortalAgent: isPortalAgent, simplifiedAgent: simplifiedAgent, ref: genAICoachRef, children: [_jsx(Flex, { as: agentExpanded ? StyledHeaderContainer : undefined, container: {
|