@pega/cosmos-react-work 9.0.0-build.14.5 → 9.0.0-build.14.7
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/ArticleList/ArticleBuddy.d.ts.map +1 -1
- package/lib/components/ArticleList/ArticleBuddy.js +5 -1
- package/lib/components/ArticleList/ArticleBuddy.js.map +1 -1
- package/lib/components/ArticleList/ArticleList.types.d.ts +15 -1
- package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -1
- package/lib/components/ArticleList/ArticleList.types.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.js +12 -5
- 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 +9 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts +13 -0
- package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
- package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAIMessage.js +8 -43
- package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
- package/lib/components/GenAICoach/GenAIMessageFeedback.d.ts +4 -0
- package/lib/components/GenAICoach/GenAIMessageFeedback.d.ts.map +1 -0
- package/lib/components/GenAICoach/GenAIMessageFeedback.js +92 -0
- package/lib/components/GenAICoach/GenAIMessageFeedback.js.map +1 -0
- package/lib/components/InteractionNotification/InteractionNotification.d.ts +21 -5
- package/lib/components/InteractionNotification/InteractionNotification.d.ts.map +1 -1
- package/lib/components/InteractionNotification/InteractionNotification.js +9 -4
- package/lib/components/InteractionNotification/InteractionNotification.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleBuddy.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleBuddy.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAgB9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ArticleBuddy.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleBuddy.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,OAAO,CAAC;AAgB9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG7D,eAAO,MAAM,oBAAoB,yGAUhC,CAAC;AAQF,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAuHrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { Flex, defaultThemeProp, useI18n, Button, useLiveLog, TextArea, AIButton, Progress, getFocusables, MenuButton, AdditionalInfo } from '@pega/cosmos-react-core';
|
|
5
|
+
import GenAICoach from '../GenAICoach';
|
|
5
6
|
import ArticleBuddyResponse from './ArticleBuddyResponse';
|
|
6
7
|
export const StyledQueryContainer = styled.div(({ theme: { base: { spacing } } }) => {
|
|
7
8
|
return css `
|
|
@@ -12,7 +13,7 @@ StyledQueryContainer.defaultProps = defaultThemeProp;
|
|
|
12
13
|
const StyledBuddyContainer = styled(Flex) `
|
|
13
14
|
height: 100%;
|
|
14
15
|
`;
|
|
15
|
-
const ArticleBuddy = ({ query, onClear, onSubmit, buddyOptions, response, list, loading, ...restProps }) => {
|
|
16
|
+
const ArticleBuddy = ({ query, onClear, onSubmit, buddyOptions, response, list, loading, renderAgent, agentOptions, ...restProps }) => {
|
|
16
17
|
const t = useI18n();
|
|
17
18
|
const buddyRef = useRef(null);
|
|
18
19
|
const queryRef = useRef(null);
|
|
@@ -34,6 +35,9 @@ const ArticleBuddy = ({ query, onClear, onSubmit, buddyOptions, response, list,
|
|
|
34
35
|
queryRef.current?.focus();
|
|
35
36
|
}
|
|
36
37
|
}, [response?.content, loading, announceResult]);
|
|
38
|
+
if (renderAgent) {
|
|
39
|
+
return (_jsx(Flex, { ...restProps, ref: buddyRef, container: { direction: 'column' }, as: StyledBuddyContainer, children: _jsx(GenAICoach, { ...agentOptions }) }));
|
|
40
|
+
}
|
|
37
41
|
return (_jsxs(Flex, { ...restProps, container: { direction: 'column' }, ref: buddyRef, "aria-busy": loading, as: StyledBuddyContainer, children: [_jsxs(Flex, { as: StyledQueryContainer, container: { direction: 'column', gap: 1 }, children: [buddyOptions && (_jsxs(Flex, { container: { gap: 0.5 }, children: [_jsx(MenuButton, { ...buddyOptions.list, ...(buddyOptions.list.contextualLabel && {
|
|
38
42
|
'aria-label': buddyOptions.list.contextualLabel
|
|
39
43
|
}) }), buddyOptions.buddyInfo?.title && (_jsx(AdditionalInfo, { heading: buddyOptions.buddyInfo.title, children: buddyOptions.buddyInfo.description }))] })), _jsx(TextArea, { ...query, "aria-label": query.placeholder || t('ask_buddy'), ref: queryRef, autoResize: false, onKeyDown: (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleBuddy.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleBuddy.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,UAAU,EACV,cAAc,EACf,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ArticleBuddy.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleBuddy.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,UAAU,EACV,cAAc,EACf,MAAM,yBAAyB,CAAC;AAGjC,OAAO,UAAU,MAAM,eAAe,CAAC;AAGvC,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAE1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAC5C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,OAAO,EAAE,EAClB,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;0BACY,OAAO;KAC5B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,oBAAoB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAErD,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAExC,CAAC;AAEF,MAAM,YAAY,GAAwD,CAAC,EACzE,KAAK,EACL,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,WAAW,EACX,YAAY,EACZ,GAAG,SAAS,EACb,EAAE,EAAE;IACH,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC9C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AO,CAAC,GACJ,CACV,EACD,KAAC,QAAQ,IACP,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,EACf,QAAQ,EAAE,OAAO,gBACL,CAAC,CAAC,WAAW,CAAC,EAC1B,OAAO,EAAE,GAAG,EAAE;oCACZ,iBAAiB,CAAC,IAAI,CAAC,CAAC;oCACxB,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;oCAC1B,QAAQ,EAAE,CAAC;gCACb,CAAC,GACD,IACG,IACF,EAEP,KAAC,QAAQ,IAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE,cAAc,SAAG,EAEvF,CAAC,OAAO,IAAI,QAAQ,IAAI,KAAC,oBAAoB,OAAK,QAAQ,GAAI,IAC1D,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { useEffect, useRef, useState } from 'react';\nimport type { FunctionComponent, KeyboardEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n useI18n,\n Button,\n useLiveLog,\n TextArea,\n AIButton,\n Progress,\n getFocusables,\n MenuButton,\n AdditionalInfo\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\n\nimport GenAICoach from '../GenAICoach';\n\nimport type { ArticleBuddyProps } from './ArticleList.types';\nimport ArticleBuddyResponse from './ArticleBuddyResponse';\n\nexport const StyledQueryContainer = styled.div(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n padding: calc(2 * ${spacing});\n `;\n }\n);\n\nStyledQueryContainer.defaultProps = defaultThemeProp;\n\nconst StyledBuddyContainer = styled(Flex)`\n height: 100%;\n`;\n\nconst ArticleBuddy: FunctionComponent<ArticleBuddyProps & ForwardProps> = ({\n query,\n onClear,\n onSubmit,\n buddyOptions,\n response,\n list,\n loading,\n renderAgent,\n agentOptions,\n ...restProps\n}) => {\n const t = useI18n();\n const buddyRef = useRef<HTMLDivElement>(null);\n const queryRef = useRef<HTMLTextAreaElement>(null);\n const { announcePolite } = useLiveLog();\n const [announceResult, setannounceResult] = useState(false);\n\n useEffect(() => {\n const focusables = getFocusables(buddyRef);\n if (focusables.length > 0) {\n focusables[0].focus();\n }\n }, []);\n\n useEffect(() => {\n if (response?.content && !loading && announceResult) {\n announcePolite({\n message: t('result_available'),\n type: 'acknowledgement'\n });\n setannounceResult(false);\n queryRef.current?.focus();\n }\n }, [response?.content, loading, announceResult]);\n\n if (renderAgent) {\n return (\n <Flex\n {...restProps}\n ref={buddyRef}\n container={{ direction: 'column' }}\n as={StyledBuddyContainer}\n >\n <GenAICoach {...agentOptions} />\n </Flex>\n );\n }\n\n return (\n <Flex\n {...restProps}\n container={{ direction: 'column' }}\n ref={buddyRef}\n aria-busy={loading}\n as={StyledBuddyContainer}\n >\n <Flex as={StyledQueryContainer} container={{ direction: 'column', gap: 1 }}>\n {buddyOptions && (\n <Flex container={{ gap: 0.5 }}>\n <MenuButton\n {...buddyOptions.list}\n {...(buddyOptions.list.contextualLabel && {\n 'aria-label': buddyOptions.list.contextualLabel\n })}\n />\n {buddyOptions.buddyInfo?.title && (\n <AdditionalInfo heading={buddyOptions.buddyInfo.title}>\n {buddyOptions.buddyInfo.description}\n </AdditionalInfo>\n )}\n </Flex>\n )}\n\n <TextArea\n {...query}\n aria-label={query.placeholder || t('ask_buddy')}\n ref={queryRef}\n autoResize={false}\n onKeyDown={(e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n if (query.value?.trim()) {\n setannounceResult(true);\n onSubmit();\n }\n }\n }}\n />\n\n <Flex container={{ gap: 1, justify: 'end' }}>\n {query.value && onClear && (\n <Button\n variant='link'\n onClick={() => {\n onClear();\n }}\n >\n {t('clear')}\n </Button>\n )}\n <AIButton\n label={t('ask')}\n disabled={loading}\n aria-label={t('ask_buddy')}\n onClick={() => {\n setannounceResult(true);\n queryRef.current?.focus();\n onSubmit();\n }}\n />\n </Flex>\n </Flex>\n\n <Progress visible={!!loading} placement='block' message={t('loading')} focusOnVisible />\n\n {!loading && response && <ArticleBuddyResponse {...response} />}\n </Flex>\n );\n};\n\nexport default ArticleBuddy;\n"]}
|
|
@@ -4,6 +4,7 @@ import type { SearchFilter } from '@pega/cosmos-react-core/lib/components/Search
|
|
|
4
4
|
import type { ArticleRatingProps } from '../Article/ArticleRating';
|
|
5
5
|
import type { ArticleMetaProps } from '../Article/ArticleMeta';
|
|
6
6
|
import type { ArticleProps } from '../Article/Article';
|
|
7
|
+
import type { GenAICoachProps } from '../GenAICoach';
|
|
7
8
|
import type { RelatedQuestionsProps } from './RelatedQuestions';
|
|
8
9
|
export interface ArticleSummaryProps extends BaseProps {
|
|
9
10
|
/** Unique id of article */
|
|
@@ -121,7 +122,9 @@ export interface ArticleBuddyListProps extends MenuButtonProps {
|
|
|
121
122
|
/** Aria label for screen readers. */
|
|
122
123
|
contextualLabel?: string;
|
|
123
124
|
}
|
|
124
|
-
export interface
|
|
125
|
+
export interface ArticleBuddyStandardProps {
|
|
126
|
+
renderAgent?: false;
|
|
127
|
+
agentOptions?: never;
|
|
125
128
|
query: Required<Pick<TextAreaProps, 'label' | 'value' | 'placeholder' | 'onChange'>> & Pick<TextAreaProps, 'labelHidden'>;
|
|
126
129
|
buddyOptions?: {
|
|
127
130
|
list: ArticleBuddyListProps;
|
|
@@ -135,6 +138,17 @@ export interface ArticleBuddyProps {
|
|
|
135
138
|
loading?: boolean;
|
|
136
139
|
response?: BuddyResponseProps;
|
|
137
140
|
}
|
|
141
|
+
export interface ArticleBuddyAgentProps {
|
|
142
|
+
renderAgent: true;
|
|
143
|
+
agentOptions: OmitStrict<GenAICoachProps, 'initialSuggestedMessages' | 'attachments' | 'attachmentsError' | 'onAddAttachment' | 'lightboxPreviewProps'>;
|
|
144
|
+
query?: never;
|
|
145
|
+
buddyOptions?: never;
|
|
146
|
+
onSubmit?: never;
|
|
147
|
+
onClear?: never;
|
|
148
|
+
loading?: never;
|
|
149
|
+
response?: never;
|
|
150
|
+
}
|
|
151
|
+
export type ArticleBuddyProps = ArticleBuddyStandardProps | ArticleBuddyAgentProps;
|
|
138
152
|
export declare const isExternalLink: (reference: Reference) => reference is ExternalLinkProps;
|
|
139
153
|
export declare const isInternalArticle: (reference: Reference) => reference is InternalArticleProps;
|
|
140
154
|
export interface Articles {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleList.types.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,eAAe,EACf,SAAS,EACT,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,cAAc,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gEAAgE,CAAC;AAEnG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"ArticleList.types.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,aAAa,EACb,eAAe,EACf,SAAS,EACT,cAAc,EACd,kBAAk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ACF,CAAC;AAEF,wBAAgB,eAAe,CAC7B,IAAI,EAAE,qBAAqB,GAAG,mBAAmB,GAChD,IAAI,IAAI,mBAAmB,CAE7B;AAED,eAAO,MAAM,uBAAuB,GAClC,WAAW,CAAC,qBAAqB,GAAG,mBAAmB,CAAC,EAAE,KACzD,SAAS,IAAI,qBAAqB,EAEpC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,KAAK,QAAQ,GAAG,sBAAsB,GAAG,SAAS,KACjD,GAAG,IAAI,sBAET,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleList.types.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.types.ts"],"names":[],"mappings":"AA6LA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAoB,EAAkC,EAAE;IACrF,OAAO,SAAS,CAAC,IAAI,KAAK,MAAM,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAoB,EAAqC,EAAE;IAC3F,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC;AACrC,CAAC,CAAC;AAkJF,MAAM,UAAU,eAAe,CAC7B,IAAiD;IAEjD,OAAO,UAAU,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,SAA0D,EACpB,EAAE;IACxC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,GAAkD,EACnB,EAAE;IACjC,OAAQ,GAA8B,EAAE,cAAc,CAAC;AACzD,CAAC,CAAC","sourcesContent":["import type { MouseEvent, MouseEventHandler, ReactNode, KeyboardEvent } from 'react';\n\nimport type {\n ActionsProps,\n AdditionalInfoProps,\n BaseProps,\n ComboBoxProps,\n MenuButtonProps,\n MenuProps,\n NoChildrenProp,\n NumberDisplayProps,\n OmitStrict,\n RequireAtLeastOne,\n SearchInputProps,\n TextAreaProps,\n WithAttributes\n} from '@pega/cosmos-react-core';\nimport type { SearchFilter } from '@pega/cosmos-react-core/lib/components/SearchInput/SearchInput';\n\nimport type { ArticleRatingProps } from '../Article/ArticleRating';\nimport type { ArticleMetaProps } from '../Article/ArticleMeta';\nimport type { ArticleProps } from '../Article/Article';\n\nimport type { RelatedQuestionsProps } from './RelatedQuestions';\n\nexport interface ArticleSummaryProps extends BaseProps {\n /** Unique id of article */\n articleId: string;\n /** URL or DOM id to navigate to. This will render the nav item as a link. */\n href?: string;\n /** Article title */\n title: string;\n /** Article content */\n abstract: string;\n /** Callback fired when article title is clicked */\n onTitleClick?: (id?: string, event?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n /** Primary actions which needs to be displayed with an icon */\n actions?: ActionsProps;\n /** A list of elements to be rendered within a MetaList. */\n meta?: ArticleMetaProps;\n /** Rating - likes and dislikes of the article. */\n feedback?: OmitStrict<ArticleRatingProps, 'onReaction'> & {\n onReaction: (\n articleId: ArticleSummaryProps['articleId'],\n reaction: ArticleRatingProps['reaction']\n ) => void;\n };\n /** Quick filters to filter articles. */\n quickFilters?: QuickFilter[];\n /** callback fired when quick filter is clicked */\n onQuickFilterClick?: ArticleListProps['onQuickFilterClick'];\n}\n\nexport type AIArticleSummaryProps = WithAttributes<\n 'li',\n NoChildrenProp & {\n score?: NumberDisplayProps['value'];\n /**\n * Indicates whether semantic search functionality to be used.\n * @default false\n */\n semanticSearch: boolean;\n abstract?: ArticleSummaryProps['abstract'];\n } & Pick<\n ArticleSummaryProps,\n | 'articleId'\n | 'href'\n | 'title'\n | 'onTitleClick'\n | 'actions'\n | 'quickFilters'\n | 'onQuickFilterClick'\n >\n>;\n\nexport type SearchArticle = AIArticleSummaryProps | ArticleSummaryProps;\n\nexport interface BaseReferenceProps {\n id: string;\n name: string;\n confidence?: number;\n onClick?: (id: BaseReferenceProps['id'], e: MouseEvent<HTMLElement>) => void;\n}\n\nexport type ExternalLinkProps = BaseReferenceProps & { type: 'link'; href: string };\n\nexport type InternalArticleProps = BaseReferenceProps & {\n type: 'object';\n onClick: NonNullable<BaseReferenceProps['onClick']>;\n};\n\ntype Reference = ExternalLinkProps | InternalArticleProps;\n\n/** Handles reaction */\nexport type Reaction = 'liked' | 'disliked' | undefined;\n\nexport type ArticleFeedbackProps = WithAttributes<\n 'div',\n NoChildrenProp & {\n /** Question to be displayed */\n question: string;\n /** Handles reaction */\n reaction: Reaction;\n /** Callback to handle reaction */\n onReaction: (reaction: Reaction) => void;\n /** Handles comment section */\n comment?: Required<Pick<TextAreaProps, 'value' | 'placeholder' | 'onChange' | 'labelHidden'>>;\n /** Callback on the click of submit */\n onSubmit?: (\n feedback: { reaction: Reaction; comment: string },\n e: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLTextAreaElement>\n ) => void;\n /**\n * Sets the visibility of acknowledgement text\n * @default false\n */\n showThankYouMessage?: boolean;\n }\n>;\n\nexport interface BuddyResponseProps {\n /** title of the search content */\n title?: string;\n /** Main body of search content */\n content?: ReactNode;\n /** Action for share and copy */\n actions?: ActionsProps;\n /** References with confidence level */\n references?: Reference[];\n /** Disclaimer for the genAI response */\n disclaimer?: string;\n /** back button from the response */\n backNavigation?: ArticleProps['backNavigation'];\n /**\n * error state\n * @default false\n */\n error?: boolean;\n /** Feedback for buddy response */\n feedback?: ArticleFeedbackProps;\n /** Recent search suggestion from buddy */\n relatedQuestions?: RelatedQuestionsProps;\n}\n\nexport interface AutoAnsweredItem {\n id: string;\n query: string;\n onTitleClick: (id: string) => void;\n actions?: ActionsProps;\n abstract: string;\n}\n\nexport interface DetectedItem extends OmitStrict<AutoAnsweredItem, 'abstract'> {\n confidence?: number;\n}\n\nexport type BuddySuggestedArticlesProps = WithAttributes<\n 'div',\n NoChildrenProp & {\n autoAnswered?: AutoAnsweredItem[];\n detected?: DetectedItem[];\n pastQuestions?: string[];\n notRelevantQuestions?: string[];\n showMore?: boolean;\n onShowMoreToggle?: () => void;\n }\n>;\n\nexport interface ArticleBuddyListProps extends MenuButtonProps {\n /** Aria label for screen readers. */\n contextualLabel?: string;\n}\n\nexport interface ArticleBuddyProps {\n query: Required<Pick<TextAreaProps, 'label' | 'value' | 'placeholder' | 'onChange'>> &\n Pick<TextAreaProps, 'labelHidden'>;\n buddyOptions?: {\n list: ArticleBuddyListProps;\n buddyInfo?: {\n title: AdditionalInfoProps['heading'];\n description: AdditionalInfoProps['children'];\n };\n };\n onSubmit: () => void;\n onClear: () => void;\n loading?: boolean;\n response?: BuddyResponseProps;\n}\n\nexport const isExternalLink = (reference: Reference): reference is ExternalLinkProps => {\n return reference.type === 'link';\n};\n\nexport const isInternalArticle = (reference: Reference): reference is InternalArticleProps => {\n return reference.type === 'object';\n};\n\nexport interface Articles {\n /** List of articles */\n articles: ArticleSummaryProps[];\n /** count of articles */\n count?: number;\n /** Active article if one is open/selected */\n activeArticle?: ArticleProps | BuddyResponseProps;\n /** Props related to the Search Input. */\n searchInput: OmitStrict<\n SearchInputProps,\n 'searchResults' | 'recentSearches' | 'advancedSearchLink' | 'resultsPopover'\n > & {\n searchFilter?: MenuButtonProps;\n filterInfo?: {\n title: AdditionalInfoProps['heading'];\n description: AdditionalInfoProps['children'];\n };\n } & SearchFilter;\n /** Props related to the Category Input. */\n category?: OmitStrict<\n ComboBoxProps,\n | 'id'\n | 'labelHidden'\n | 'required'\n | 'disabled'\n | 'readOnly'\n | 'status'\n | 'info'\n | 'actions'\n | 'additionalInfo'\n >;\n\n /** Props related to the SortBy Input. */\n sortBy?: OmitStrict<\n ComboBoxProps,\n | 'id'\n | 'labelHidden'\n | 'required'\n | 'disabled'\n | 'readOnly'\n | 'status'\n | 'info'\n | 'mode'\n | 'actions'\n | 'additionalInfo'\n | 'onChange'\n | 'value'\n >;\n /** Callback fired when clear button is clicked */\n onClearClick?: MouseEventHandler<HTMLButtonElement>;\n /** Quick filters to filter articles */\n quickFilters?: QuickFilter[];\n /** Callback fired when applied quick filter is removed */\n handleQuickFilterRemove?: (id: string) => void;\n /** Prop to enable show / hide results */\n showResults?: boolean;\n}\n\nexport interface ArticleListHeaderProps {\n /** Title of article list */\n title: string;\n /** Article list header icon */\n icon?: string;\n /** Actions which needs to be displayed with an icon */\n actions?: ActionsProps;\n}\n\nexport type SemanticSearchArticles = OmitStrict<Articles, 'articles'> & {\n semanticFilter?: MenuProps;\n} & ArticleSemanticSearchProps;\n\ntype SuggestedArticles = Pick<Articles, 'count' | 'activeArticle'> & {\n articles: ArticleSummaryProps[] | BuddySuggestedArticlesProps;\n aiSuggestedArticles?: AIArticleSummaryProps[];\n};\n\nexport type ArticleListProps = RequireAtLeastOne<\n {\n /** Props related to article list header */\n header?: ArticleListHeaderProps;\n /** Data of suggested articles */\n suggested?: SuggestedArticles;\n /** Data of followed articles */\n followed?: Articles;\n /** Data of search articles */\n search?: Articles | SemanticSearchArticles;\n buddy?: {\n title: string;\n content: ArticleBuddyProps;\n };\n /** current active tab whose list has to be rendered */\n activeTab: string;\n /** Callback fired when tab is clicked */\n onTabClick?: (name: string, event?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n /**\n * Optionally renders an indeterminate progress indicator while articles are being fetched.\n * @default false\n */\n loading?: boolean;\n /**\n * Optionally renders an indeterminate progress indicator while progressively fetching articles\n * @default false\n */\n loadingMore?: boolean;\n /** callback fired when quick filter is clicked */\n onQuickFilterClick?: (\n quickFilterParam: QuickFilter,\n event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => void;\n /** Callback to fetch more rows */\n onLoadMore?: () => void;\n },\n 'suggested' | 'followed' | 'search' | 'buddy'\n>;\n\nexport interface QuickFilter {\n /** Unique id of quick Filter */\n id: string;\n /** Name of quick Filter */\n name: string;\n}\n\nexport type ArticleSemanticSearchProps = WithAttributes<\n 'div',\n NoChildrenProp & {\n semanticSearch: boolean;\n /** list of semantic articles */\n articles?: AIArticleSummaryProps[];\n /** Handles feedback section */\n feedback?: ArticleFeedbackProps;\n /**\n * Handles error\n * @default false\n */\n error?: boolean;\n /**\n * Sets the initial message\n * @default false\n */\n initialMessage?: boolean;\n relatedQuestions?: RelatedQuestionsProps;\n }\n>;\n\nexport function isSearchArticle(\n item: AIArticleSummaryProps | ArticleSummaryProps\n): item is ArticleSummaryProps {\n return 'abstract' in item;\n}\n\nexport const isSemanticSearchArticle = (\n fileItems: (AIArticleSummaryProps | ArticleSummaryProps)[]\n): fileItems is AIArticleSummaryProps[] => {\n return fileItems.every(item => 'semanticSearch' in item);\n};\n\nexport const isSemanticSearch = (\n obj: Articles | SemanticSearchArticles | undefined\n): obj is SemanticSearchArticles => {\n return (obj as SemanticSearchArticles)?.semanticSearch;\n};\n\nexport type ArticleListTabId = 'Suggested' | 'Followed' | 'Search' | 'Buddy';\n"]}
|
|
1
|
+
{"version":3,"file":"ArticleList.types.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.types.ts"],"names":[],"mappings":"AAoNA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAAoB,EAAkC,EAAE;IACrF,OAAO,SAAS,CAAC,IAAI,KAAK,MAAM,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAoB,EAAqC,EAAE;IAC3F,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC;AACrC,CAAC,CAAC;AAkJF,MAAM,UAAU,eAAe,CAC7B,IAAiD;IAEjD,OAAO,UAAU,IAAI,IAAI,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,SAA0D,EACpB,EAAE;IACxC,OAAO,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,IAAI,IAAI,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,GAAkD,EACnB,EAAE;IACjC,OAAQ,GAA8B,EAAE,cAAc,CAAC;AACzD,CAAC,CAAC","sourcesContent":["import type { MouseEvent, MouseEventHandler, ReactNode, KeyboardEvent } from 'react';\n\nimport type {\n ActionsProps,\n AdditionalInfoProps,\n BaseProps,\n ComboBoxProps,\n MenuButtonProps,\n MenuProps,\n NoChildrenProp,\n NumberDisplayProps,\n OmitStrict,\n RequireAtLeastOne,\n SearchInputProps,\n TextAreaProps,\n WithAttributes\n} from '@pega/cosmos-react-core';\nimport type { SearchFilter } from '@pega/cosmos-react-core/lib/components/SearchInput/SearchInput';\n\nimport type { ArticleRatingProps } from '../Article/ArticleRating';\nimport type { ArticleMetaProps } from '../Article/ArticleMeta';\nimport type { ArticleProps } from '../Article/Article';\nimport type { GenAICoachProps } from '../GenAICoach';\n\nimport type { RelatedQuestionsProps } from './RelatedQuestions';\n\nexport interface ArticleSummaryProps extends BaseProps {\n /** Unique id of article */\n articleId: string;\n /** URL or DOM id to navigate to. This will render the nav item as a link. */\n href?: string;\n /** Article title */\n title: string;\n /** Article content */\n abstract: string;\n /** Callback fired when article title is clicked */\n onTitleClick?: (id?: string, event?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n /** Primary actions which needs to be displayed with an icon */\n actions?: ActionsProps;\n /** A list of elements to be rendered within a MetaList. */\n meta?: ArticleMetaProps;\n /** Rating - likes and dislikes of the article. */\n feedback?: OmitStrict<ArticleRatingProps, 'onReaction'> & {\n onReaction: (\n articleId: ArticleSummaryProps['articleId'],\n reaction: ArticleRatingProps['reaction']\n ) => void;\n };\n /** Quick filters to filter articles. */\n quickFilters?: QuickFilter[];\n /** callback fired when quick filter is clicked */\n onQuickFilterClick?: ArticleListProps['onQuickFilterClick'];\n}\n\nexport type AIArticleSummaryProps = WithAttributes<\n 'li',\n NoChildrenProp & {\n score?: NumberDisplayProps['value'];\n /**\n * Indicates whether semantic search functionality to be used.\n * @default false\n */\n semanticSearch: boolean;\n abstract?: ArticleSummaryProps['abstract'];\n } & Pick<\n ArticleSummaryProps,\n | 'articleId'\n | 'href'\n | 'title'\n | 'onTitleClick'\n | 'actions'\n | 'quickFilters'\n | 'onQuickFilterClick'\n >\n>;\n\nexport type SearchArticle = AIArticleSummaryProps | ArticleSummaryProps;\n\nexport interface BaseReferenceProps {\n id: string;\n name: string;\n confidence?: number;\n onClick?: (id: BaseReferenceProps['id'], e: MouseEvent<HTMLElement>) => void;\n}\n\nexport type ExternalLinkProps = BaseReferenceProps & { type: 'link'; href: string };\n\nexport type InternalArticleProps = BaseReferenceProps & {\n type: 'object';\n onClick: NonNullable<BaseReferenceProps['onClick']>;\n};\n\ntype Reference = ExternalLinkProps | InternalArticleProps;\n\n/** Handles reaction */\nexport type Reaction = 'liked' | 'disliked' | undefined;\n\nexport type ArticleFeedbackProps = WithAttributes<\n 'div',\n NoChildrenProp & {\n /** Question to be displayed */\n question: string;\n /** Handles reaction */\n reaction: Reaction;\n /** Callback to handle reaction */\n onReaction: (reaction: Reaction) => void;\n /** Handles comment section */\n comment?: Required<Pick<TextAreaProps, 'value' | 'placeholder' | 'onChange' | 'labelHidden'>>;\n /** Callback on the click of submit */\n onSubmit?: (\n feedback: { reaction: Reaction; comment: string },\n e: MouseEvent<HTMLButtonElement> | KeyboardEvent<HTMLTextAreaElement>\n ) => void;\n /**\n * Sets the visibility of acknowledgement text\n * @default false\n */\n showThankYouMessage?: boolean;\n }\n>;\n\nexport interface BuddyResponseProps {\n /** title of the search content */\n title?: string;\n /** Main body of search content */\n content?: ReactNode;\n /** Action for share and copy */\n actions?: ActionsProps;\n /** References with confidence level */\n references?: Reference[];\n /** Disclaimer for the genAI response */\n disclaimer?: string;\n /** back button from the response */\n backNavigation?: ArticleProps['backNavigation'];\n /**\n * error state\n * @default false\n */\n error?: boolean;\n /** Feedback for buddy response */\n feedback?: ArticleFeedbackProps;\n /** Recent search suggestion from buddy */\n relatedQuestions?: RelatedQuestionsProps;\n}\n\nexport interface AutoAnsweredItem {\n id: string;\n query: string;\n onTitleClick: (id: string) => void;\n actions?: ActionsProps;\n abstract: string;\n}\n\nexport interface DetectedItem extends OmitStrict<AutoAnsweredItem, 'abstract'> {\n confidence?: number;\n}\n\nexport type BuddySuggestedArticlesProps = WithAttributes<\n 'div',\n NoChildrenProp & {\n autoAnswered?: AutoAnsweredItem[];\n detected?: DetectedItem[];\n pastQuestions?: string[];\n notRelevantQuestions?: string[];\n showMore?: boolean;\n onShowMoreToggle?: () => void;\n }\n>;\n\nexport interface ArticleBuddyListProps extends MenuButtonProps {\n /** Aria label for screen readers. */\n contextualLabel?: string;\n}\n\nexport interface ArticleBuddyStandardProps {\n renderAgent?: false;\n agentOptions?: never;\n query: Required<Pick<TextAreaProps, 'label' | 'value' | 'placeholder' | 'onChange'>> &\n Pick<TextAreaProps, 'labelHidden'>;\n buddyOptions?: {\n list: ArticleBuddyListProps;\n buddyInfo?: {\n title: AdditionalInfoProps['heading'];\n description: AdditionalInfoProps['children'];\n };\n };\n onSubmit: () => void;\n onClear: () => void;\n loading?: boolean;\n response?: BuddyResponseProps;\n}\n\nexport interface ArticleBuddyAgentProps {\n renderAgent: true;\n agentOptions: OmitStrict<\n GenAICoachProps,\n | 'initialSuggestedMessages'\n | 'attachments'\n | 'attachmentsError'\n | 'onAddAttachment'\n | 'lightboxPreviewProps'\n >;\n query?: never;\n buddyOptions?: never;\n onSubmit?: never;\n onClear?: never;\n loading?: never;\n response?: never;\n}\n\nexport type ArticleBuddyProps = ArticleBuddyStandardProps | ArticleBuddyAgentProps;\n\nexport const isExternalLink = (reference: Reference): reference is ExternalLinkProps => {\n return reference.type === 'link';\n};\n\nexport const isInternalArticle = (reference: Reference): reference is InternalArticleProps => {\n return reference.type === 'object';\n};\n\nexport interface Articles {\n /** List of articles */\n articles: ArticleSummaryProps[];\n /** count of articles */\n count?: number;\n /** Active article if one is open/selected */\n activeArticle?: ArticleProps | BuddyResponseProps;\n /** Props related to the Search Input. */\n searchInput: OmitStrict<\n SearchInputProps,\n 'searchResults' | 'recentSearches' | 'advancedSearchLink' | 'resultsPopover'\n > & {\n searchFilter?: MenuButtonProps;\n filterInfo?: {\n title: AdditionalInfoProps['heading'];\n description: AdditionalInfoProps['children'];\n };\n } & SearchFilter;\n /** Props related to the Category Input. */\n category?: OmitStrict<\n ComboBoxProps,\n | 'id'\n | 'labelHidden'\n | 'required'\n | 'disabled'\n | 'readOnly'\n | 'status'\n | 'info'\n | 'actions'\n | 'additionalInfo'\n >;\n\n /** Props related to the SortBy Input. */\n sortBy?: OmitStrict<\n ComboBoxProps,\n | 'id'\n | 'labelHidden'\n | 'required'\n | 'disabled'\n | 'readOnly'\n | 'status'\n | 'info'\n | 'mode'\n | 'actions'\n | 'additionalInfo'\n | 'onChange'\n | 'value'\n >;\n /** Callback fired when clear button is clicked */\n onClearClick?: MouseEventHandler<HTMLButtonElement>;\n /** Quick filters to filter articles */\n quickFilters?: QuickFilter[];\n /** Callback fired when applied quick filter is removed */\n handleQuickFilterRemove?: (id: string) => void;\n /** Prop to enable show / hide results */\n showResults?: boolean;\n}\n\nexport interface ArticleListHeaderProps {\n /** Title of article list */\n title: string;\n /** Article list header icon */\n icon?: string;\n /** Actions which needs to be displayed with an icon */\n actions?: ActionsProps;\n}\n\nexport type SemanticSearchArticles = OmitStrict<Articles, 'articles'> & {\n semanticFilter?: MenuProps;\n} & ArticleSemanticSearchProps;\n\ntype SuggestedArticles = Pick<Articles, 'count' | 'activeArticle'> & {\n articles: ArticleSummaryProps[] | BuddySuggestedArticlesProps;\n aiSuggestedArticles?: AIArticleSummaryProps[];\n};\n\nexport type ArticleListProps = RequireAtLeastOne<\n {\n /** Props related to article list header */\n header?: ArticleListHeaderProps;\n /** Data of suggested articles */\n suggested?: SuggestedArticles;\n /** Data of followed articles */\n followed?: Articles;\n /** Data of search articles */\n search?: Articles | SemanticSearchArticles;\n buddy?: {\n title: string;\n content: ArticleBuddyProps;\n };\n /** current active tab whose list has to be rendered */\n activeTab: string;\n /** Callback fired when tab is clicked */\n onTabClick?: (name: string, event?: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;\n /**\n * Optionally renders an indeterminate progress indicator while articles are being fetched.\n * @default false\n */\n loading?: boolean;\n /**\n * Optionally renders an indeterminate progress indicator while progressively fetching articles\n * @default false\n */\n loadingMore?: boolean;\n /** callback fired when quick filter is clicked */\n onQuickFilterClick?: (\n quickFilterParam: QuickFilter,\n event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>\n ) => void;\n /** Callback to fetch more rows */\n onLoadMore?: () => void;\n },\n 'suggested' | 'followed' | 'search' | 'buddy'\n>;\n\nexport interface QuickFilter {\n /** Unique id of quick Filter */\n id: string;\n /** Name of quick Filter */\n name: string;\n}\n\nexport type ArticleSemanticSearchProps = WithAttributes<\n 'div',\n NoChildrenProp & {\n semanticSearch: boolean;\n /** list of semantic articles */\n articles?: AIArticleSummaryProps[];\n /** Handles feedback section */\n feedback?: ArticleFeedbackProps;\n /**\n * Handles error\n * @default false\n */\n error?: boolean;\n /**\n * Sets the initial message\n * @default false\n */\n initialMessage?: boolean;\n relatedQuestions?: RelatedQuestionsProps;\n }\n>;\n\nexport function isSearchArticle(\n item: AIArticleSummaryProps | ArticleSummaryProps\n): item is ArticleSummaryProps {\n return 'abstract' in item;\n}\n\nexport const isSemanticSearchArticle = (\n fileItems: (AIArticleSummaryProps | ArticleSummaryProps)[]\n): fileItems is AIArticleSummaryProps[] => {\n return fileItems.every(item => 'semanticSearch' in item);\n};\n\nexport const isSemanticSearch = (\n obj: Articles | SemanticSearchArticles | undefined\n): obj is SemanticSearchArticles => {\n return (obj as SemanticSearchArticles)?.semanticSearch;\n};\n\nexport type ArticleListTabId = 'Suggested' | 'Followed' | 'Search' | 'Buddy';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GenAICoach.d.ts","sourceRoot":"","sources":["../../../src/components/GenAICoach/GenAICoach.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAqF5D,OAAO,EAAyC,KAAK,eAAe,EAAE,MAAM,GAAG,CAAC;AAchF,eAAO,MAAM,SAAS,+CAmDrB,CAAC;;;;AAm8BF,wBAA6D"}
|
|
@@ -12,13 +12,19 @@ import * as sendSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icon
|
|
|
12
12
|
import * as squareSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/square-solid.icon';
|
|
13
13
|
import { getGenAICoachTestIds } from './GenAICoach.test-ids';
|
|
14
14
|
import { isCoachMessage, isInUtilities, isUserMessage } from './GenAICoach.utils';
|
|
15
|
-
import { StyledMessagesContainer, StyledDisclaimerText, StyledGenAICoachContainer, StyledGenAIOptionsMenu, StyledInitialMessageContainer, StyledInputContainer, StyledMenuSuggestions, StyledMessagesList, StyledGridContainer, StyledFlexWrapper, StyledErrorContainer, StyledInput, StyledGuidedSuggestions, StyledComposerSection, StyledSendButton, StyledGenAIFormControl, StyledGenAITextArea, StyledInitialMessageGrid, StyledGenAIFooter, StyledAgentIcon, StyledStopButton } from './GenAICoach.styles';
|
|
15
|
+
import { StyledMessagesContainer, StyledDisclaimerText, StyledGenAICoachContainer, StyledGenAIOptionsMenu, StyledInitialMessageContainer, StyledInputContainer, StyledMenuSuggestions, StyledMessagesList, StyledGridContainer, StyledFlexWrapper, StyledErrorContainer, StyledInput, StyledGuidedSuggestions, StyledComposerSection, StyledSendButton, StyledGenAIFormControl, StyledGenAITextArea, StyledInitialMessageGrid, StyledGenAIFooter, StyledAgentIcon, StyledStopButton, StyledActionsContainer } from './GenAICoach.styles';
|
|
16
16
|
import ConversationHistory from './ConversationHistory';
|
|
17
17
|
import { GenAIMessage, InitialSuggestedMessage } from '.';
|
|
18
18
|
registerIcon(caretUpIcon, timesIcon, caretDownIcon, minusIcon, polarisSolidIcon, paperClipIcon, warnSolidIcon, squareSolidIcon, sendSolidIcon);
|
|
19
|
-
export const AgentIcon = () =>
|
|
19
|
+
export const AgentIcon = () => {
|
|
20
|
+
const uid = useUID();
|
|
21
|
+
const idA = `agent-gradient-a-${uid}`;
|
|
22
|
+
const idB = `agent-gradient-b-${uid}`;
|
|
23
|
+
const idC = `agent-clip-${uid}`;
|
|
24
|
+
return (_jsxs(StyledAgentIcon, { xmlns: 'http://www.w3.org/2000/svg', filter: 'drop-shadow(0 .125rem .125rem rgba(0,0,0,.03)) drop-shadow(.125rem .5rem .5rem rgba(0,0,0,.05)) drop-shadow(.125rem 1rem 1rem rgba(0,0,0,.08))', viewBox: '0 0 60 60', children: [_jsxs("linearGradient", { id: idA, x1: '30.586', x2: '3.059', y1: '58.111', y2: '30.584', gradientUnits: 'userSpaceOnUse', children: [_jsx("stop", { offset: '.115', stopColor: '#681fc3' }), _jsx("stop", { offset: '.418', stopColor: '#9795f3' }), _jsx("stop", { offset: '.591', stopColor: '#b3d2ff' }), _jsx("stop", { offset: '.966', stopColor: '#a467f0' })] }), _jsxs("linearGradient", { id: idB, x1: '7.137', x2: '29.565', y1: '0', y2: '60.151', gradientUnits: 'userSpaceOnUse', children: [_jsx("stop", { offset: '.457', stopColor: '#8165d2', stopOpacity: '0' }), _jsx("stop", { offset: '.524', stopColor: '#280096', stopOpacity: '.4' })] }), _jsx("clipPath", { id: idC, children: _jsx("path", { d: 'M0 0h60v60H0z' }) }), _jsxs("g", { fillRule: 'evenodd', clipPath: `url(#${idC})`, clipRule: 'evenodd', children: [_jsx("path", { fill: `url(#${idA})`, d: 'M60 30.002c-9.023.937-16.054 3.632-20.86 8.203C33.633 43.242 30.586 50.508 30 60c-1.173-9.61-4.453-16.875-9.727-21.914C15.35 33.516 8.555 30.82 0 30c9.023-.703 16.054-3.515 21.093-8.438C26.132 16.523 29.063 9.376 29.999 0c.704 10.43 4.102 18.164 10.313 23.202C45.352 27.186 51.914 29.413 60 30zm-3.75-18.75c-2.228.235-3.984.936-5.391 2.226-1.289 1.289-1.992 3.047-2.109 5.274-.235-2.227-.937-3.983-2.108-5.155-1.289-1.288-3.048-2.109-5.391-2.344 2.227-.116 3.867-.82 5.156-1.991 1.288-1.289 2.108-3.164 2.343-5.508.117 2.46.937 4.336 2.344 5.508 1.288 1.171 2.93 1.875 5.156 1.991zM18.75 48.75c-2.345.236-4.103.937-5.392 2.227-1.288 1.172-1.992 2.93-2.108 5.274-.235-2.46-1.055-4.218-2.46-5.507-1.056-1.055-2.812-1.758-5.04-1.992 1.993-.116 3.633-.703 4.804-1.758 1.524-1.172 2.46-3.047 2.696-5.743.116 1.992.703 3.751 1.875 5.156 1.172 1.288 3.047 2.108 5.626 2.344z' }), _jsx("path", { fill: `url(#${idB})`, d: 'M60 30.002c-9.023.937-16.054 3.632-20.86 8.203C33.633 43.242 30.586 50.508 30 60c-1.173-9.61-4.453-16.875-9.727-21.914C15.35 33.516 8.555 30.82 0 30c9.023-.703 16.054-3.515 21.093-8.438C26.132 16.523 29.063 9.376 29.999 0c.704 10.43 4.102 18.164 10.313 23.202C45.352 27.186 51.914 29.413 60 30zm-3.75-18.75c-2.228.235-3.984.936-5.391 2.226-1.289 1.289-1.992 3.047-2.109 5.274-.235-2.227-.937-3.983-2.108-5.155-1.289-1.288-3.048-2.109-5.391-2.344 2.227-.116 3.867-.82 5.156-1.991 1.288-1.289 2.108-3.164 2.343-5.508.117 2.46.937 4.336 2.344 5.508 1.288 1.171 2.93 1.875 5.156 1.991zM18.75 48.75c-2.345.236-4.103.937-5.392 2.227-1.288 1.172-1.992 2.93-2.108 5.274-.235-2.46-1.055-4.218-2.46-5.507-1.056-1.055-2.812-1.758-5.04-1.992 1.993-.116 3.633-.703 4.804-1.758 1.524-1.172 2.46-3.047 2.696-5.743.116 1.992.703 3.751 1.875 5.156 1.172 1.288 3.047 2.108 5.626 2.344z' })] })] }));
|
|
25
|
+
};
|
|
20
26
|
const VOICE_ERROR_DISMISS_DURATION = 3000;
|
|
21
|
-
const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, ...restProps }) => {
|
|
27
|
+
const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: onCoachChangeProp, messages = [], onSend, initialSuggestedMessages, suggestions, loading, error, variant, onOpen, guidedMode = false, actions, conversationHistory, onLayoutChange, onAddAttachment, attachments, attachmentsError, lightboxPreviewProps, allowFullScreen = true, isInLandingPageUtilities, stopProcess, voiceToTextProps, salutation, showSalutation = true, ...restProps }) => {
|
|
22
28
|
const theme = useTheme();
|
|
23
29
|
const t = useI18n();
|
|
24
30
|
const testIds = useTestIds(testId, getGenAICoachTestIds);
|
|
@@ -148,7 +154,7 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
|
|
|
148
154
|
return isInUtilities(variant) && variant.state === 'minimized' ? (_jsxs(_Fragment, { children: [_jsx(Text, { variant: 'h2', children: selectedCoach }), _jsx(Flex, { container: { alignItems: 'center' }, children: _jsx(Button, { icon: true, label: t('maximize'), "aria-label": t('agent_noun', [t('maximize')]), variant: 'simple', onClick: () => {
|
|
149
155
|
variant.onStateChange('maximized');
|
|
150
156
|
isUserTriggered.current = true;
|
|
151
|
-
}, children: _jsx(Icon, { name: 'caret-up' }) }) })] })) : (_jsxs(_Fragment, { children: [renderCoachOptions, _jsxs(Flex, { container: true, children: [isInUtilities(variant) && (_jsx(Button, { icon: true, label: t('minimize'), "aria-label": t('agent_noun', [t('minimize')]), variant: 'simple', onClick: () => {
|
|
157
|
+
}, children: _jsx(Icon, { name: 'caret-up' }) }) })] })) : (_jsxs(_Fragment, { children: [renderCoachOptions, _jsxs(Flex, { container: true, as: StyledActionsContainer, children: [isInUtilities(variant) && (_jsx(Button, { icon: true, label: t('minimize'), "aria-label": t('agent_noun', [t('minimize')]), variant: 'simple', onClick: () => {
|
|
152
158
|
variant.onStateChange('minimized');
|
|
153
159
|
isUserTriggered.current = true;
|
|
154
160
|
}, children: _jsx(Icon, { name: 'minus' }) })), allowFullScreen && _jsx(FullscreenButton, { onClick: () => setFullScreen(prev => !prev) }), actions && (_jsx(Actions, { "data-testid": testIds.actions, contextualLabel: selectedCoach, ...actions })), variant.placement === 'dialog' && (_jsx(Button, { icon: true, label: t('close'), "aria-label": t('agent_noun', [t('close')]), variant: 'simple', onClick: variant.onClose, children: _jsx(Icon, { name: 'times' }) }))] })] }));
|
|
@@ -349,7 +355,8 @@ const GenAICoach = ({ testId, coachOptions: coachOptionsProps, onCoachChange: on
|
|
|
349
355
|
alignItems: 'center',
|
|
350
356
|
gap: 2
|
|
351
357
|
}, item: { grow: 1 }, children: [((isInUtilities(variant) && variant.state === 'maximized') ||
|
|
352
|
-
!isInUtilities(variant)) &&
|
|
358
|
+
!isInUtilities(variant)) &&
|
|
359
|
+
showSalutation && (_jsxs(Flex, { container: { direction: 'column', alignItems: 'center', gap: 1 }, children: [_jsx(AgentIcon, {}), _jsx(Text, { variant: 'h3', children: salutation ?? t('welcome_text') })] })), _jsx(Grid, { as: StyledInitialMessageGrid, container: { cols: getGridColumns(), gap: 1.5 }, children: initialSuggestedMessages?.map(initialSuggestedMessage => (_jsx(InitialSuggestedMessage, { ...initialSuggestedMessage, onSend: initialMessage => {
|
|
353
360
|
if (guidedMode) {
|
|
354
361
|
onSend({
|
|
355
362
|
id: initialMessage.id,
|