@pega/cosmos-react-work 7.0.0-build.22.26 → 7.0.0-build.22.28
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 +3 -3
- package/lib/components/ArticleList/ArticleBuddy.js.map +1 -1
- package/lib/components/ArticleList/ArticleList.types.d.ts +8 -1
- package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -1
- package/lib/components/ArticleList/ArticleList.types.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;
|
|
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;AAE5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI7D,eAAO,MAAM,oBAAoB,yGAWhC,CAAC;AAQF,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAiGrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Flex, defaultThemeProp, useI18n, Button, useLiveLog, TextArea, AIButton, Progress, getFocusables } from '@pega/cosmos-react-core';
|
|
4
|
+
import { Flex, defaultThemeProp, useI18n, Button, useLiveLog, TextArea, AIButton, Progress, getFocusables, MenuButton, AdditionalInfo } from '@pega/cosmos-react-core';
|
|
5
5
|
import ArticleBuddyList from './ArticleBuddyList';
|
|
6
6
|
import ArticleBuddyResponse from './ArticleBuddyResponse';
|
|
7
7
|
export const StyledQueryContainer = styled.div(({ theme: { base: { spacing, colors } } }) => {
|
|
@@ -14,7 +14,7 @@ StyledQueryContainer.defaultProps = defaultThemeProp;
|
|
|
14
14
|
const StyledBuddyContainer = styled(Flex) `
|
|
15
15
|
height: 100%;
|
|
16
16
|
`;
|
|
17
|
-
const ArticleBuddy = ({ query, onClear, onSubmit, response, list, loading, ...restProps }) => {
|
|
17
|
+
const ArticleBuddy = ({ query, onClear, onSubmit, buddyOptions, response, list, loading, ...restProps }) => {
|
|
18
18
|
const t = useI18n();
|
|
19
19
|
const buddyRef = useRef(null);
|
|
20
20
|
const { announcePolite } = useLiveLog();
|
|
@@ -34,7 +34,7 @@ const ArticleBuddy = ({ query, onClear, onSubmit, response, list, loading, ...re
|
|
|
34
34
|
setannounceResult(false);
|
|
35
35
|
}
|
|
36
36
|
}, [response?.content, loading, announceResult]);
|
|
37
|
-
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: [_jsx(TextArea, { ...query, autoResize: false, onKeyDown: (e) => {
|
|
37
|
+
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.buddyInfo?.title && (_jsx(AdditionalInfo, { heading: buddyOptions.buddyInfo.title, children: buddyOptions.buddyInfo.description }))] })), _jsx(TextArea, { ...query, autoResize: false, onKeyDown: (e) => {
|
|
38
38
|
if (e.key === 'Enter' && !e.shiftKey) {
|
|
39
39
|
e.preventDefault();
|
|
40
40
|
if (query.value?.trim()) {
|
|
@@ -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,
|
|
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;AAIjC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,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,MAAM,EAAE,EAC1B,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;0BACY,OAAO;0BACP,MAAM,CAAC,IAAI,CAAC,aAAa,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CACxB,QAAQ,EAAE,CAAC;gCACb,CAAC,GACD,IACG,IACF,EACP,KAAC,QAAQ,IAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,EAAC,OAAO,EAAC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,GAAI,EACxE,CAAC,OAAO,IAAI,CACX,8BACG,QAAQ,IAAI,KAAC,oBAAoB,OAAK,QAAQ,GAAI,EAElD,IAAI,IAAI,KAAC,gBAAgB,OAAK,IAAI,GAAI,IACtC,CACJ,IACI,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 type { ArticleBuddyProps } from './ArticleList.types';\nimport ArticleBuddyList from './ArticleBuddyList';\nimport ArticleBuddyResponse from './ArticleBuddyResponse';\n\nexport const StyledQueryContainer = styled.div(\n ({\n theme: {\n base: { spacing, colors }\n }\n }) => {\n return css`\n padding: calc(2 * ${spacing});\n background-color: ${colors.gray['extra-light']};\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 ...restProps\n}) => {\n const t = useI18n();\n const buddyRef = useRef<HTMLDivElement>(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 }\n }, [response?.content, loading, announceResult]);\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 {...buddyOptions.list} />\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 autoResize={false}\n onKeyDown={(e: KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n if (query.value?.trim()) {\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 onSubmit();\n }}\n />\n </Flex>\n </Flex>\n <Progress visible={!!loading} placement='block' message={t('loading')} />\n {!loading && (\n <>\n {response && <ArticleBuddyResponse {...response} />}\n\n {list && <ArticleBuddyList {...list} />}\n </>\n )}\n </Flex>\n );\n};\n\nexport default ArticleBuddy;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MouseEvent, MouseEventHandler, ReactNode, KeyboardEvent } from 'react';
|
|
2
|
-
import type { Action, BaseProps, ComboBoxProps, NoChildrenProp, NumberDisplayProps, OmitStrict, RequireAtLeastOne, SearchInputProps, TextAreaProps, WithAttributes } from '@pega/cosmos-react-core';
|
|
2
|
+
import type { Action, BaseProps, ComboBoxProps, MenuButtonProps, NoChildrenProp, NumberDisplayProps, OmitStrict, RequireAtLeastOne, SearchInputProps, TextAreaProps, WithAttributes, AdditionalInfoProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { ArticleRatingProps } from '../Article/ArticleRating';
|
|
4
4
|
import type { ArticleMetaProps } from '../Article/ArticleMeta';
|
|
5
5
|
export interface ArticleSummaryProps extends BaseProps {
|
|
@@ -112,6 +112,13 @@ export type BuddyListProps = WithAttributes<'div', NoChildrenProp & {
|
|
|
112
112
|
}>;
|
|
113
113
|
export interface ArticleBuddyProps {
|
|
114
114
|
query: Required<Pick<TextAreaProps, 'label' | 'value' | 'placeholder' | 'onChange'>> & Pick<TextAreaProps, 'labelHidden'>;
|
|
115
|
+
buddyOptions?: {
|
|
116
|
+
list: MenuButtonProps;
|
|
117
|
+
buddyInfo?: {
|
|
118
|
+
title: AdditionalInfoProps['heading'];
|
|
119
|
+
description: AdditionalInfoProps['children'];
|
|
120
|
+
};
|
|
121
|
+
};
|
|
115
122
|
onSubmit: () => void;
|
|
116
123
|
onClear: () => void;
|
|
117
124
|
loading?: boolean;
|
|
@@ -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,MAAM,EACN,SAAS,EACT,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,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,E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AM,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":"
|
|
1
|
+
{"version":3,"file":"ArticleList.types.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.types.ts"],"names":[],"mappings":"AAkLA,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;AAgIF,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","sourcesContent":["import type { MouseEvent, MouseEventHandler, ReactNode, KeyboardEvent } from 'react';\n\nimport type {\n Action,\n BaseProps,\n ComboBoxProps,\n MenuButtonProps,\n NoChildrenProp,\n NumberDisplayProps,\n OmitStrict,\n RequireAtLeastOne,\n SearchInputProps,\n TextAreaProps,\n WithAttributes,\n AdditionalInfoProps\n} from '@pega/cosmos-react-core';\n\nimport type { ArticleRatingProps } from '../Article/ArticleRating';\nimport type { ArticleMetaProps } from '../Article/ArticleMeta';\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?: Action[];\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 } & 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}\n\nexport type ExternalLinkProps = BaseReferenceProps & { type: 'link'; href: string };\n\nexport type InternalArticleProps = BaseReferenceProps & {\n type: 'object';\n onClick: (id: BaseReferenceProps['id'], e: MouseEvent<HTMLButtonElement>) => void;\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?: Action[];\n /** References with confidence level */\n references?: Reference[];\n /** Disclaimer for the genAI response */\n disclaimer?: string;\n\n /** back button from the response */\n onBackNavigation?: (e: MouseEvent<HTMLButtonElement>) => void;\n\n /**\n * error state\n * @default false\n */\n error?: boolean;\n /** Feedback for buddy response */\n feedback?: ArticleFeedbackProps;\n}\n\nexport interface AutoAnsweredItem {\n id: string;\n query: string;\n onTitleClick: (id: string) => void;\n actions?: Action[];\n abstract: string;\n}\n\nexport interface DetectedItem extends OmitStrict<AutoAnsweredItem, 'abstract'> {\n confidence?: number;\n}\n\nexport type BuddyListProps = 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 ArticleBuddyProps {\n query: Required<Pick<TextAreaProps, 'label' | 'value' | 'placeholder' | 'onChange'>> &\n Pick<TextAreaProps, 'labelHidden'>;\n buddyOptions?: {\n list: MenuButtonProps;\n buddyInfo?: {\n title: AdditionalInfoProps['heading'];\n description: AdditionalInfoProps['children'];\n };\n };\n onSubmit: () => void;\n onClear: () => void;\n loading?: boolean;\n list?: BuddyListProps;\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 /** Props related to the Search Input. */\n searchInput: OmitStrict<\n SearchInputProps,\n | 'placeholder'\n | 'onSearchSubmit'\n | 'searchResults'\n | 'recentSearches'\n | 'advancedSearchLink'\n | 'resultsPopover'\n >;\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 /** 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?: Action[];\n}\n\nexport type ArticleListProps = RequireAtLeastOne<\n {\n /** Props related to article list header */\n header?: ArticleListHeaderProps;\n /** Data of suggested articles */\n suggested?: Pick<Articles, 'articles' | 'count'> & {\n aiSuggestedArticles?: AIArticleSummaryProps[];\n };\n /** Data of followed articles */\n followed?: Articles;\n /** Data of search articles */\n search?: OmitStrict<Articles, 'articles'> & { articles: SearchArticle[] };\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 * Indicates whether semantic search functionality to be used.\n * @default false\n */\n semanticSearch?: boolean;\n /** Handles the feedback section */\n feedback?: ArticleFeedbackProps;\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 articles?: AIArticleSummaryProps[];\n feedback?: ArticleFeedbackProps;\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 type ArticleListTabId = 'Suggested' | 'Followed' | 'Search' | 'Buddy';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-work",
|
|
3
|
-
"version": "7.0.0-build.22.
|
|
3
|
+
"version": "7.0.0-build.22.28",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/pegasystems/cosmos-react.git",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"build": "tsc -b tsconfig.build.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@pega/cosmos-react-core": "7.0.0-build.22.
|
|
23
|
-
"@pega/cosmos-react-rte": "7.0.0-build.22.
|
|
22
|
+
"@pega/cosmos-react-core": "7.0.0-build.22.28",
|
|
23
|
+
"@pega/cosmos-react-rte": "7.0.0-build.22.28",
|
|
24
24
|
"@types/react": "^17.0.62",
|
|
25
25
|
"@types/react-dom": "^17.0.20",
|
|
26
26
|
"@types/styled-components": "^5.1.26",
|