@pega/cosmos-react-work 7.0.0-build.22.9 → 7.0.0-build.23.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/ArticleList/AIArticleSummary.d.ts.map +1 -1
- package/lib/components/ArticleList/AIArticleSummary.js +26 -11
- package/lib/components/ArticleList/AIArticleSummary.js.map +1 -1
- 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/ArticleFeedback.d.ts.map +1 -1
- package/lib/components/ArticleList/ArticleFeedback.js +5 -14
- package/lib/components/ArticleList/ArticleFeedback.js.map +1 -1
- package/lib/components/ArticleList/ArticleList.d.ts +1 -0
- package/lib/components/ArticleList/ArticleList.d.ts.map +1 -1
- package/lib/components/ArticleList/ArticleList.js +12 -5
- package/lib/components/ArticleList/ArticleList.js.map +1 -1
- package/lib/components/ArticleList/ArticleList.types.d.ts +51 -8
- package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -1
- package/lib/components/ArticleList/ArticleList.types.js +9 -0
- package/lib/components/ArticleList/ArticleList.types.js.map +1 -1
- package/lib/components/ArticleList/ArticleListFilter.d.ts +5 -2
- package/lib/components/ArticleList/ArticleListFilter.d.ts.map +1 -1
- package/lib/components/ArticleList/ArticleListFilter.js +7 -5
- package/lib/components/ArticleList/ArticleListFilter.js.map +1 -1
- package/lib/components/ArticleList/ArticleSemanticSearch.d.ts +5 -0
- package/lib/components/ArticleList/ArticleSemanticSearch.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleSemanticSearch.js +24 -0
- package/lib/components/ArticleList/ArticleSemanticSearch.js.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -1
- package/lib/components/ArticleList/ArticleSummary.js +4 -9
- package/lib/components/ArticleList/ArticleSummary.js.map +1 -1
- package/lib/components/ArticleList/ArticleSummaryHeader.js +1 -1
- package/lib/components/ArticleList/ArticleSummaryHeader.js.map +1 -1
- package/lib/components/ArticleList/ArticleTag.d.ts +7 -0
- package/lib/components/ArticleList/ArticleTag.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleTag.js +17 -0
- package/lib/components/ArticleList/ArticleTag.js.map +1 -0
- package/lib/components/ArticleList/index.d.ts +2 -1
- package/lib/components/ArticleList/index.d.ts.map +1 -1
- package/lib/components/ArticleList/index.js +1 -0
- package/lib/components/ArticleList/index.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +13 -6
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.styles.js +21 -23
- package/lib/components/CaseView/CaseView.styles.js.map +1 -1
- package/lib/components/CaseView/CaseView.types.d.ts +4 -9
- package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.types.js.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.js +11 -4
- package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
- package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -1
- package/lib/components/CaseView/UtilitySummaryItemDialog.js +3 -1
- package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.d.ts +1 -1
- package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.js +149 -28
- package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts +3 -3
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js +25 -18
- package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts +6 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
- package/lib/components/GenAICoach/GenAIMessage.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAIMessage.js +12 -4
- package/lib/components/GenAICoach/GenAIMessage.js.map +1 -1
- package/lib/components/GenAICoach/index.d.ts +1 -1
- package/lib/components/GenAICoach/index.d.ts.map +1 -1
- package/lib/components/GenAICoach/index.js.map +1 -1
- package/lib/components/SearchResults/Filter.d.ts +0 -1
- package/lib/components/SearchResults/Filter.d.ts.map +1 -1
- package/lib/components/SearchResults/Filter.js +1 -1
- package/lib/components/SearchResults/Filter.js.map +1 -1
- package/lib/components/SearchResults/SearchResult.d.ts +0 -1
- package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.js +1 -1
- package/lib/components/SearchResults/SearchResults.js.map +1 -1
- package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts +14 -0
- package/lib/components/UtilitiesLayout/UtilitiesLayout.d.ts.map +1 -0
- package/lib/components/UtilitiesLayout/UtilitiesLayout.js +46 -0
- package/lib/components/UtilitiesLayout/UtilitiesLayout.js.map +1 -0
- package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts +8 -0
- package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.d.ts.map +1 -0
- package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js +29 -0
- package/lib/components/UtilitiesLayout/UtilitiesLayout.styles.js.map +1 -0
- package/lib/components/UtilitiesLayout/index.d.ts +3 -0
- package/lib/components/UtilitiesLayout/index.d.ts.map +1 -0
- package/lib/components/UtilitiesLayout/index.js +2 -0
- package/lib/components/UtilitiesLayout/index.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleList.types.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleList.types.ts"],"names":[],"mappings":"AAwJA,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","sourcesContent":["import type { MouseEvent, MouseEventHandler, ReactNode, KeyboardEvent } from 'react';\n\nimport type {\n Action,\n BaseProps,\n ComboBoxProps,\n NoChildrenProp,\n NumberDisplayProps,\n OmitStrict,\n RequireAtLeastOne,\n SearchInputProps,\n TextAreaProps,\n WithAttributes\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 } & Pick<ArticleSummaryProps, 'articleId' | 'href' | 'title' | 'onTitleClick' | 'actions'>\n>;\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>;\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 * Optionally renders an indeterminate progress indicator while result are being fetched.\n * @default false\n */\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 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?: Articles;\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 ArticleListTabId = 'Suggested' | 'Followed' | 'Search' | 'Buddy';\n"]}
|
|
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;AA4IF,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 Action,\n AdditionalInfoProps,\n BaseProps,\n ComboBoxProps,\n MenuButtonProps,\n NoChildrenProp,\n NumberDisplayProps,\n OmitStrict,\n RequireAtLeastOne,\n SearchInputProps,\n TextAreaProps,\n WithAttributes\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 'searchResults' | 'recentSearches' | 'advancedSearchLink' | 'resultsPopover'\n > & {\n searchFilter?: MenuButtonProps;\n filterInfo?: {\n title: AdditionalInfoProps['heading'];\n description: AdditionalInfoProps['children'];\n };\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\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 SemanticSearchArticles = OmitStrict<Articles, 'articles'> & {\n semanticFilter?: MenuButtonProps;\n} & ArticleSemanticSearchProps;\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?: 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 }\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,6 +1,9 @@
|
|
|
1
1
|
import type { FunctionComponent } from 'react';
|
|
2
2
|
import type { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
import type { ArticleListProps } from './ArticleList.types';
|
|
4
|
-
|
|
3
|
+
import type { ArticleListProps, SemanticSearchArticles } from './ArticleList.types';
|
|
4
|
+
type ArticleListFilterProps = ArticleListProps['search'] & {
|
|
5
|
+
semanticSearch: boolean;
|
|
6
|
+
} & Pick<SemanticSearchArticles, 'semanticFilter'>;
|
|
7
|
+
declare const ArticleListFilter: FunctionComponent<ArticleListFilterProps & ForwardProps>;
|
|
5
8
|
export default ArticleListFilter;
|
|
6
9
|
//# sourceMappingURL=ArticleListFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleListFilter.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleListFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ArticleListFilter.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleListFilter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAiB/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AA+CpF,KAAK,sBAAsB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,GAAG;IAAE,cAAc,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CACzF,sBAAsB,EACtB,gBAAgB,CACjB,CAAC;AAEJ,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CAgF/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Button, Flex, SearchInput, useI18n, defaultThemeProp, ComboBox, StyledSearchInput, Text, Selectable } from '@pega/cosmos-react-core';
|
|
4
|
+
import { Button, Flex, SearchInput, useI18n, defaultThemeProp, ComboBox, StyledSearchInput, Text, Selectable, MenuButton, registerIcon, AdditionalInfo } from '@pega/cosmos-react-core';
|
|
5
5
|
import { StyledFormContent } from '@pega/cosmos-react-core/lib/components/MultiStepForm/MultiStepForm';
|
|
6
|
+
import * as filterIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter.icon';
|
|
7
|
+
registerIcon(filterIcon);
|
|
6
8
|
const StyledClearButton = styled(Button)(({ theme }) => {
|
|
7
9
|
return css `
|
|
8
10
|
margin-block-start: calc(4.5 * ${theme.base.spacing});
|
|
@@ -44,7 +46,7 @@ const StyledSearchFilters = styled.div(({ theme }) => {
|
|
|
44
46
|
});
|
|
45
47
|
StyledSearchFilters.defaultProps = defaultThemeProp;
|
|
46
48
|
const ArticleListFilter = (props) => {
|
|
47
|
-
const { searchInput, category, sortBy, onClearClick, articles, quickFilters = [], showResults = false, handleQuickFilterRemove, ...restProps } = props || {};
|
|
49
|
+
const { searchInput, category, sortBy, onClearClick, articles, quickFilters = [], showResults = false, handleQuickFilterRemove, semanticSearch = false, semanticFilter, ...restProps } = props || {};
|
|
48
50
|
const t = useI18n();
|
|
49
51
|
const searchResults = t('results_count', [articles?.length ?? 0]);
|
|
50
52
|
const quickFiltersRef = useRef([]);
|
|
@@ -53,9 +55,9 @@ const ArticleListFilter = (props) => {
|
|
|
53
55
|
quickFiltersRef.current[quickFilters.length - 1]?.focus();
|
|
54
56
|
}
|
|
55
57
|
}, [articles]);
|
|
56
|
-
return (_jsxs(StyledSearchFilters, { ...restProps, children: [_jsx(Flex, { container: { alignItems: 'center', gap: 1, pad: [0.5, undefined] }, children: _jsx(SearchInput, { ...searchInput }) }), quickFilters.map(({ id, name }, i) => (_jsx(StyledSelectable, { id: id, ref: (el) => {
|
|
58
|
+
return (_jsxs(StyledSearchFilters, { ...restProps, children: [searchInput.searchFilter && (_jsxs(Flex, { container: { alignItems: 'center', pad: [0.5, undefined] }, children: [_jsx(MenuButton, { ...searchInput.searchFilter }), searchInput.filterInfo?.title && (_jsx(AdditionalInfo, { heading: searchInput.filterInfo.title, children: searchInput.filterInfo.description }))] })), _jsxs(Flex, { container: { alignItems: 'center', gap: 1, pad: [0.5, undefined] }, children: [_jsx(SearchInput, { ...searchInput }), semanticSearch && semanticFilter && (_jsx(MenuButton, { variant: 'simple', icon: 'filter', iconOnly: true, ...semanticFilter }))] }), quickFilters.map(({ id, name }, i) => (_jsx(StyledSelectable, { id: id, ref: (el) => {
|
|
57
59
|
quickFiltersRef.current[i] = el;
|
|
58
|
-
}, onRemove: handleQuickFilterRemove ? () => handleQuickFilterRemove?.(id) : undefined, onClick: handleQuickFilterRemove ? () => handleQuickFilterRemove?.(id) : undefined, children: name }))),
|
|
60
|
+
}, onRemove: handleQuickFilterRemove ? () => handleQuickFilterRemove?.(id) : undefined, onClick: handleQuickFilterRemove ? () => handleQuickFilterRemove?.(id) : undefined, children: name }))), _jsx(StyledFilterContainer, { container: { gap: 1, alignItems: 'start' }, children: !semanticSearch && (_jsxs(_Fragment, { children: [category && _jsx(ComboBox, { ...category }), sortBy && _jsx(ComboBox, { ...sortBy }), onClearClick && (_jsx(StyledClearButton, { variant: 'link', label: t('clear'), "aria-label": t('clear_filters'), onClick: onClearClick, children: t('clear') }))] })) }), showResults && searchResults && _jsx(Text, { variant: 'secondary', children: searchResults })] }));
|
|
59
61
|
};
|
|
60
62
|
export default ArticleListFilter;
|
|
61
63
|
//# sourceMappingURL=ArticleListFilter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleListFilter.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleListFilter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,QAAQ,EACR,iBAAiB,EACjB,IAAI,EACJ,UAAU,
|
|
1
|
+
{"version":3,"file":"ArticleListFilter.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleListFilter.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,MAAM,EACN,IAAI,EACJ,WAAW,EACX,OAAO,EACP,gBA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IAAI,KAAC,IAAI,IAAC,OAAO,EAAC,WAAW,YAAE,aAAa,GAAQ,IAC7D,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { useEffect, useRef } from 'react';\nimport type { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Button,\n Flex,\n SearchInput,\n useI18n,\n defaultThemeProp,\n ComboBox,\n StyledSearchInput,\n Text,\n Selectable,\n MenuButton,\n registerIcon,\n AdditionalInfo\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport { StyledFormContent } from '@pega/cosmos-react-core/lib/components/MultiStepForm/MultiStepForm';\nimport * as filterIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/filter.icon';\n\nimport type { ArticleListProps, SemanticSearchArticles } from './ArticleList.types';\n\nregisterIcon(filterIcon);\n\nconst StyledClearButton = styled(Button)(({ theme }) => {\n return css`\n margin-block-start: calc(4.5 * ${theme.base.spacing});\n `;\n});\nStyledClearButton.defaultProps = defaultThemeProp;\n\nconst StyledFilterContainer = styled(Flex)`\n flex-grow: 1;\n`;\n\nconst StyledSelectable = styled(Selectable)(({ theme }) => {\n return css`\n line-height: calc(2 * ${theme.base.spacing});\n margin: calc(0.25 * ${theme.base.spacing});\n `;\n});\nStyledSelectable.defaultProps = defaultThemeProp;\n\nconst StyledSearchFilters = styled.div(({ theme }) => {\n return css`\n width: 100%;\n padding-block-start: ${theme.base.spacing};\n padding-inline: calc(2 * ${theme.base.spacing});\n\n > div:last-child {\n margin: 0;\n }\n\n ${StyledFormContent} {\n gap: ${theme.base.spacing};\n }\n\n ${StyledFilterContainer} > div {\n margin-top: calc(1.5 * ${theme.base.spacing});\n width: 100%;\n }\n ${StyledSearchInput} {\n flex-grow: 1;\n }\n `;\n});\nStyledSearchFilters.defaultProps = defaultThemeProp;\ntype ArticleListFilterProps = ArticleListProps['search'] & { semanticSearch: boolean } & Pick<\n SemanticSearchArticles,\n 'semanticFilter'\n >;\n\nconst ArticleListFilter: FunctionComponent<ArticleListFilterProps & ForwardProps> = (\n props: ArticleListFilterProps\n) => {\n const {\n searchInput,\n category,\n sortBy,\n onClearClick,\n articles,\n quickFilters = [],\n showResults = false,\n handleQuickFilterRemove,\n semanticSearch = false,\n semanticFilter,\n ...restProps\n } = props || {};\n const t = useI18n();\n const searchResults = t('results_count', [articles?.length ?? 0]);\n const quickFiltersRef = useRef<HTMLButtonElement[]>([]);\n\n useEffect(() => {\n if (quickFilters.length > 0 && quickFiltersRef.current.length > 0) {\n quickFiltersRef.current[quickFilters.length - 1]?.focus();\n }\n }, [articles]);\n\n return (\n <StyledSearchFilters {...restProps}>\n {searchInput.searchFilter && (\n <Flex container={{ alignItems: 'center', pad: [0.5, undefined] }}>\n <MenuButton {...searchInput.searchFilter} />\n {searchInput.filterInfo?.title && (\n <AdditionalInfo heading={searchInput.filterInfo.title}>\n {searchInput.filterInfo.description}\n </AdditionalInfo>\n )}\n </Flex>\n )}\n <Flex container={{ alignItems: 'center', gap: 1, pad: [0.5, undefined] }}>\n <SearchInput {...searchInput} />\n {semanticSearch && semanticFilter && (\n <MenuButton variant='simple' icon='filter' iconOnly {...semanticFilter} />\n )}\n </Flex>\n\n {quickFilters.map(({ id, name }, i) => (\n <StyledSelectable\n id={id}\n ref={(el: HTMLButtonElement) => {\n quickFiltersRef.current[i] = el;\n }}\n onRemove={handleQuickFilterRemove ? () => handleQuickFilterRemove?.(id) : undefined}\n onClick={handleQuickFilterRemove ? () => handleQuickFilterRemove?.(id) : undefined}\n >\n {name}\n </StyledSelectable>\n ))}\n\n <StyledFilterContainer container={{ gap: 1, alignItems: 'start' }}>\n {!semanticSearch && (\n <>\n {category && <ComboBox {...category} />}\n {sortBy && <ComboBox {...sortBy} />}\n {onClearClick && (\n <StyledClearButton\n variant='link'\n label={t('clear')}\n aria-label={t('clear_filters')}\n onClick={onClearClick}\n >\n {t('clear')}\n </StyledClearButton>\n )}\n </>\n )}\n </StyledFilterContainer>\n\n {showResults && searchResults && <Text variant='secondary'>{searchResults}</Text>}\n </StyledSearchFilters>\n );\n};\n\nexport default ArticleListFilter;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ArticleSemanticSearchProps } from './ArticleList.types';
|
|
3
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<ArticleSemanticSearchProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=ArticleSemanticSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleSemanticSearch.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSemanticSearch.tsx"],"names":[],"mappings":";AAcA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;;AAmBtE,wBAmCG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createElement as _createElement } from "react";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import styled, { css } from 'styled-components';
|
|
5
|
+
import { useI18n, Flex, EmptyState, defaultThemeProp, ErrorState } from '@pega/cosmos-react-core';
|
|
6
|
+
import { StyledSummaryList } from './ArticleList';
|
|
7
|
+
import AIArticleSummary from './AIArticleSummary';
|
|
8
|
+
import ArticleFeedback from './ArticleFeedback';
|
|
9
|
+
const StyledFeedback = styled(ArticleFeedback)(({ theme }) => {
|
|
10
|
+
return css `
|
|
11
|
+
background-color: ${theme.components['form-control'][':read-only']['background-color']};
|
|
12
|
+
padding: calc(2 * ${theme.base.spacing});
|
|
13
|
+
`;
|
|
14
|
+
});
|
|
15
|
+
StyledFeedback.defaultProps = defaultThemeProp;
|
|
16
|
+
const StyledError = styled(ErrorState) `
|
|
17
|
+
padding: calc(3 * ${({ theme }) => theme.base.spacing});
|
|
18
|
+
`;
|
|
19
|
+
StyledError.defaultProps = defaultThemeProp;
|
|
20
|
+
export default forwardRef(function ArticleSemanticSearch({ articles, feedback, error, initialMessage, ...restProps }, ref) {
|
|
21
|
+
const t = useI18n();
|
|
22
|
+
return (_jsx(_Fragment, { children: error ? (_jsx(StyledError, { message: t('error_message') })) : (_jsxs(_Fragment, { children: [_jsx(Flex, { ...restProps, container: { direction: 'column', gap: 0.5, pad: [1, 2] }, role: 'feed', ref: ref, as: StyledSummaryList, children: articles && articles.length > 0 ? (articles.map(article => (_createElement(AIArticleSummary, { ...article, key: article.articleId, semanticSearch: true })))) : (_jsx(EmptyState, { message: initialMessage ? t('semantic_initial_message') : t('no_articles_found') })) }), feedback && articles && articles.length > 0 && _jsx(StyledFeedback, { ...feedback })] })) }));
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=ArticleSemanticSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleSemanticSearch.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSemanticSearch.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,OAAO,EAEP,IAAI,EACJ,UAAU,EACV,gBAAgB,EAChB,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,MAAM,cAAc,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC3D,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC,kBAAkB,C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AChF,CACH,GACI,EAEN,QAAQ,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,cAAc,OAAK,QAAQ,GAAI,IAC/E,CACJ,GACA,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useI18n,\n type RefElement,\n Flex,\n EmptyState,\n defaultThemeProp,\n ErrorState\n} from '@pega/cosmos-react-core';\n\nimport { StyledSummaryList } from './ArticleList';\nimport type { ArticleSemanticSearchProps } from './ArticleList.types';\nimport AIArticleSummary from './AIArticleSummary';\nimport ArticleFeedback from './ArticleFeedback';\n\nconst StyledFeedback = styled(ArticleFeedback)(({ theme }) => {\n return css`\n background-color: ${theme.components['form-control'][':read-only']['background-color']};\n padding: calc(2 * ${theme.base.spacing});\n `;\n});\n\nStyledFeedback.defaultProps = defaultThemeProp;\n\nconst StyledError = styled(ErrorState)`\n padding: calc(3 * ${({ theme }) => theme.base.spacing});\n`;\n\nStyledError.defaultProps = defaultThemeProp;\n\nexport default forwardRef<\n RefElement<ArticleSemanticSearchProps>,\n PropsWithoutRef<ArticleSemanticSearchProps>\n>(function ArticleSemanticSearch({ articles, feedback, error, initialMessage, ...restProps }, ref) {\n const t = useI18n();\n\n return (\n <>\n {error ? (\n <StyledError message={t('error_message')} />\n ) : (\n <>\n <Flex\n {...restProps}\n container={{ direction: 'column', gap: 0.5, pad: [1, 2] }}\n role='feed'\n ref={ref}\n as={StyledSummaryList}\n >\n {articles && articles.length > 0 ? (\n articles.map(article => (\n <AIArticleSummary {...article} key={article.articleId} semanticSearch />\n ))\n ) : (\n <EmptyState\n message={initialMessage ? t('semantic_initial_message') : t('no_articles_found')}\n />\n )}\n </Flex>\n\n {feedback && articles && articles.length > 0 && <StyledFeedback {...feedback} />}\n </>\n )}\n </>\n );\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleSummary.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ArticleSummary.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAK/D,QAAA,MAAM,cAAc,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAsDzE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CardContent, CardFooter, Text, Flex
|
|
2
|
+
import { CardContent, CardFooter, Text, Flex } from '@pega/cosmos-react-core';
|
|
3
3
|
import ArticleRating from '../Article/ArticleRating';
|
|
4
4
|
import ArticleMeta from '../Article/ArticleMeta';
|
|
5
5
|
import ArticleSummaryHeader from './ArticleSummaryHeader';
|
|
6
|
-
import { ArticleCard
|
|
6
|
+
import { ArticleCard } from './ArticleSummary.styles';
|
|
7
|
+
import ArticleTag from './ArticleTag';
|
|
7
8
|
const ArticleSummary = (props) => {
|
|
8
9
|
const { articleId, href, title, abstract, onTitleClick, actions, meta, quickFilters, onQuickFilterClick, feedback, ...restProps } = props;
|
|
9
10
|
return (_jsxs(ArticleCard, { as: 'li', role: 'article', ...restProps, children: [_jsx(ArticleSummaryHeader, { articleId: articleId, title: title, actions: actions, onTitleClick: onTitleClick, href: href }), _jsx(CardContent, { children: _jsx(Text, { children: abstract }) }), _jsxs(CardFooter, { children: [feedback && (_jsx(Flex, { container: { pad: [0.5, undefined] }, item: {
|
|
@@ -12,13 +13,7 @@ const ArticleSummary = (props) => {
|
|
|
12
13
|
}, children: _jsx(ArticleRating, { ...feedback,
|
|
13
14
|
onReaction: reaction => {
|
|
14
15
|
feedback?.onReaction(articleId, reaction);
|
|
15
|
-
} }) })), meta && _jsx(ArticleMeta, { ...meta }), quickFilters && quickFilters.length > 0 && (_jsx(
|
|
16
|
-
gap: 0.5,
|
|
17
|
-
wrap: 'wrap'
|
|
18
|
-
}, item: {
|
|
19
|
-
grow: 1,
|
|
20
|
-
basis: '100%'
|
|
21
|
-
}, as: StyledQuickFilters, children: quickFilters.map(({ id, name }) => (_jsx(Tag, { onClick: onQuickFilterClick ? e => onQuickFilterClick?.({ id, name }, e) : undefined, children: `#${name}` }, id))) }))] })] }));
|
|
16
|
+
} }) })), meta && _jsx(ArticleMeta, { ...meta }), quickFilters && quickFilters.length > 0 && (_jsx(ArticleTag, { quickFilters: quickFilters, onQuickFilterClick: onQuickFilterClick }))] })] }));
|
|
22
17
|
};
|
|
23
18
|
export default ArticleSummary;
|
|
24
19
|
//# sourceMappingURL=ArticleSummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleSummary.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"ArticleSummary.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummary.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG9E,OAAO,aAAa,MAAM,0BAA0B,CAAC;AACrD,OAA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IACD,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import type { FunctionComponent } from 'react';\n\nimport { CardContent, CardFooter, Text, Flex } from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\n\nimport ArticleRating from '../Article/ArticleRating';\nimport ArticleMeta from '../Article/ArticleMeta';\n\nimport type { ArticleSummaryProps } from './ArticleList.types';\nimport ArticleSummaryHeader from './ArticleSummaryHeader';\nimport { ArticleCard } from './ArticleSummary.styles';\nimport ArticleTag from './ArticleTag';\n\nconst ArticleSummary: FunctionComponent<ArticleSummaryProps & ForwardProps> = (\n props: ArticleSummaryProps\n) => {\n const {\n articleId,\n href,\n title,\n abstract,\n onTitleClick,\n actions,\n meta,\n quickFilters,\n onQuickFilterClick,\n feedback,\n ...restProps\n } = props;\n return (\n <ArticleCard as='li' role='article' {...restProps}>\n <ArticleSummaryHeader\n articleId={articleId}\n title={title}\n actions={actions}\n onTitleClick={onTitleClick}\n href={href}\n />\n <CardContent>\n <Text>{abstract}</Text>\n </CardContent>\n <CardFooter>\n {feedback && (\n <Flex\n container={{ pad: [0.5, undefined] }}\n item={{\n grow: 1,\n basis: '100%'\n }}\n >\n <ArticleRating\n {...{\n ...feedback,\n onReaction: reaction => {\n feedback?.onReaction(articleId, reaction);\n }\n }}\n />\n </Flex>\n )}\n {meta && <ArticleMeta {...meta} />}\n {quickFilters && quickFilters.length > 0 && (\n <ArticleTag quickFilters={quickFilters} onQuickFilterClick={onQuickFilterClick} />\n )}\n </CardFooter>\n </ArticleCard>\n );\n};\n\nexport default ArticleSummary;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Actions, Button, CardHeader, Link } from '@pega/cosmos-react-core';
|
|
3
3
|
const ArticleSummaryHeader = ({ title, onTitleClick, href, actions, articleId }) => {
|
|
4
|
-
return (_jsx(CardHeader, { actions: actions?.length ? _jsx(Actions, { items: actions }) : undefined, children: href ? (_jsx(Link, { href: href, target: '_blank', children: title })) : (_jsx(Button, { variant: 'link', onClick: (e) => {
|
|
4
|
+
return (_jsx(CardHeader, { actions: actions?.length ? _jsx(Actions, { items: actions, compact: true }) : undefined, children: href ? (_jsx(Link, { href: href, target: '_blank', children: title })) : (_jsx(Button, { variant: 'link', onClick: (e) => {
|
|
5
5
|
onTitleClick?.(articleId, e);
|
|
6
6
|
}, children: title })) }));
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleSummaryHeader.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummaryHeader.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,OAAO,EACP,MAAM,EACN,UAAU,EACV,IAAI,EAGL,MAAM,yBAAyB,CAAC;AAUjC,MAAM,oBAAoB,GAAiD,CAAC,EAC1E,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,OAAO,EACP,SAAS,EACV,EAAE,EAAE;IACH,OAAO,CACL,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"ArticleSummaryHeader.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleSummaryHeader.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,OAAO,EACP,MAAM,EACN,UAAU,EACV,IAAI,EAGL,MAAM,yBAAyB,CAAC;AAUjC,MAAM,oBAAoB,GAAiD,CAAC,EAC1E,KAAK,EACL,YAAY,EACZ,IAAI,EACJ,OAAO,EACP,SAAS,EACV,EAAE,EAAE;IACH,OAAO,CACL,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,KAAK,EAAE,OAAO,EAAE,OAAO,SAAG,CAAC,CAAC,CAAC,SAAS,YACnF,IAAI,CAAC,CAAC,CAAC,CACN,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,QAAQ,YAC9B,KAAK,GACD,CACR,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,IACL,OAAO,EAAC,MAAM,EACd,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE;gBAC5C,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;YAC/B,CAAC,YAEA,KAAK,GACC,CACV,GACU,CACd,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import type { FunctionComponent, MouseEvent } from 'react';\n\nimport {\n Actions,\n Button,\n CardHeader,\n Link,\n type NoChildrenProp,\n type WithAttributes\n} from '@pega/cosmos-react-core';\n\nimport type { ArticleSummaryProps } from './ArticleList.types';\n\ntype ArticleSummaryHeaderProps = WithAttributes<\n 'header',\n NoChildrenProp &\n Pick<ArticleSummaryProps, 'articleId' | 'title' | 'href' | 'onTitleClick' | 'actions'>\n>;\n\nconst ArticleSummaryHeader: FunctionComponent<ArticleSummaryHeaderProps> = ({\n title,\n onTitleClick,\n href,\n actions,\n articleId\n}) => {\n return (\n <CardHeader actions={actions?.length ? <Actions items={actions} compact /> : undefined}>\n {href ? (\n <Link href={href} target='_blank'>\n {title}\n </Link>\n ) : (\n <Button\n variant='link'\n onClick={(e: MouseEvent<HTMLButtonElement>) => {\n onTitleClick?.(articleId, e);\n }}\n >\n {title}\n </Button>\n )}\n </CardHeader>\n );\n};\n\nexport default ArticleSummaryHeader;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type NoChildrenProp, type WithAttributes } from '@pega/cosmos-react-core';
|
|
3
|
+
import type { ArticleSummaryProps } from './ArticleList.types';
|
|
4
|
+
export type ArticleTagProps = WithAttributes<'div', NoChildrenProp & Pick<ArticleSummaryProps, 'quickFilters' | 'onQuickFilterClick'>>;
|
|
5
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<ArticleTagProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export default _default;
|
|
7
|
+
//# sourceMappingURL=ArticleTag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleTag.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleTag.tsx"],"names":[],"mappings":";AAGA,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,MAAM,MAAM,eAAe,GAAG,cAAc,CAC1C,KAAK,EACL,cAAc,GAAG,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,oBAAoB,CAAC,CAClF,CAAC;;AAEF,wBA8BE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { Tag, Flex } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledQuickFilters } from './ArticleSummary.styles';
|
|
5
|
+
export default forwardRef(function ArticleTag({ quickFilters, onQuickFilterClick, ...restProps }, ref) {
|
|
6
|
+
return (_jsx(Flex, { ...restProps, container: {
|
|
7
|
+
gap: 0.5,
|
|
8
|
+
wrap: 'wrap',
|
|
9
|
+
pad: [0.5, undefined, undefined]
|
|
10
|
+
}, item: {
|
|
11
|
+
grow: 1,
|
|
12
|
+
basis: '100%'
|
|
13
|
+
}, as: StyledQuickFilters, ref: ref, children: quickFilters &&
|
|
14
|
+
quickFilters.length > 0 &&
|
|
15
|
+
quickFilters.map(({ id, name }) => (_jsx(Tag, { onClick: onQuickFilterClick ? e => onQuickFilterClick?.({ id, name }, e) : undefined, children: name }, id))) }));
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=ArticleTag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArticleTag.js","sourceRoot":"","sources":["../../../src/components/ArticleList/ArticleTag.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAEL,GAAG,EACH,IAAI,EAGL,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAO7D,eAAe,UAAU,CACvB,SAAS,UAAU,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,SAAS,EAAE,EAAE,GAAG;IACzE,OAAO,CACL,KAAC,IAAI,OACC,SAAS,EACb,SAAS,EAAE;YACT,GAAG,EAAE,GAAG;YACR,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,CAAC;SACjC,EACD,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,MAAM;SACd,EACD,EAAE,EAAE,kBAAkB,EACtB,GAAG,EAAE,GAAG,YAEP,YAAY;YACX,YAAY,CAAC,MAAM,GAAG,CAAC;YACvB,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACjC,KAAC,GAAG,IAEF,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,YAEnF,IAAI,IAHA,EAAE,CAIH,CACP,CAAC,GACC,CACR,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import type { PropsWithoutRef } from 'react';\nimport { forwardRef } from 'react';\n\nimport {\n type RefElement,\n Tag,\n Flex,\n type NoChildrenProp,\n type WithAttributes\n} from '@pega/cosmos-react-core';\n\nimport type { ArticleSummaryProps } from './ArticleList.types';\nimport { StyledQuickFilters } from './ArticleSummary.styles';\n\nexport type ArticleTagProps = WithAttributes<\n 'div',\n NoChildrenProp & Pick<ArticleSummaryProps, 'quickFilters' | 'onQuickFilterClick'>\n>;\n\nexport default forwardRef<RefElement<ArticleTagProps>, PropsWithoutRef<ArticleTagProps>>(\n function ArticleTag({ quickFilters, onQuickFilterClick, ...restProps }, ref) {\n return (\n <Flex\n {...restProps}\n container={{\n gap: 0.5,\n wrap: 'wrap',\n pad: [0.5, undefined, undefined]\n }}\n item={{\n grow: 1,\n basis: '100%'\n }}\n as={StyledQuickFilters}\n ref={ref}\n >\n {quickFilters &&\n quickFilters.length > 0 &&\n quickFilters.map(({ id, name }) => (\n <Tag\n key={id}\n onClick={onQuickFilterClick ? e => onQuickFilterClick?.({ id, name }, e) : undefined}\n >\n {name}\n </Tag>\n ))}\n </Flex>\n );\n }\n);\n"]}
|
|
@@ -3,6 +3,7 @@ export type { ArticleListProps } from './ArticleList.types';
|
|
|
3
3
|
export { default as ArticleSummary } from './ArticleSummary';
|
|
4
4
|
export type { ArticleSummaryProps, AIArticleSummaryProps, Articles, QuickFilter } from './ArticleList.types';
|
|
5
5
|
export { default as ArticleListFilter } from './ArticleListFilter';
|
|
6
|
-
export type { ArticleBuddyProps, Reaction, BuddyListProps, BuddyResponseProps, AutoAnsweredItem, DetectedItem, ArticleFeedbackProps } from './ArticleList.types';
|
|
6
|
+
export type { ArticleBuddyProps, Reaction, BuddyListProps, BuddyResponseProps, AutoAnsweredItem, DetectedItem, ArticleFeedbackProps, SearchArticle, SemanticSearchArticles } from './ArticleList.types';
|
|
7
7
|
export { default as ArticleBuddy } from './ArticleBuddy';
|
|
8
|
+
export { default as ArticleSemanticSearch } from './ArticleSemanticSearch';
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACR,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EACV,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACR,WAAW,EACZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,aAAa,EACb,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -2,4 +2,5 @@ export { default } from './ArticleList';
|
|
|
2
2
|
export { default as ArticleSummary } from './ArticleSummary';
|
|
3
3
|
export { default as ArticleListFilter } from './ArticleListFilter';
|
|
4
4
|
export { default as ArticleBuddy } from './ArticleBuddy';
|
|
5
|
+
export { default as ArticleSemanticSearch } from './ArticleSemanticSearch';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAO7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ArticleList/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAO7D,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAYnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { default } from './ArticleList';\nexport type { ArticleListProps } from './ArticleList.types';\nexport { default as ArticleSummary } from './ArticleSummary';\nexport type {\n ArticleSummaryProps,\n AIArticleSummaryProps,\n Articles,\n QuickFilter\n} from './ArticleList.types';\nexport { default as ArticleListFilter } from './ArticleListFilter';\nexport type {\n ArticleBuddyProps,\n Reaction,\n BuddyListProps,\n BuddyResponseProps,\n AutoAnsweredItem,\n DetectedItem,\n ArticleFeedbackProps,\n SearchArticle,\n SemanticSearchArticles\n} from './ArticleList.types';\nexport { default as ArticleBuddy } from './ArticleBuddy';\nexport { default as ArticleSemanticSearch } from './ArticleSemanticSearch';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAwBhC,OAAO,KAAK,EAAE,YAAY,EAAO,MAAM,yBAAyB,CAAC;AA2BjE,OAAO,KAAK,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;;;;AA0uB5E,wBAAyD"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useLayoutEffect, useState, useContext } from 'react';
|
|
3
|
-
import { Flex, Grid, Icon, registerIcon, TabPanel, useBreakpoint, useScrollStick, useElement, Card, Drawer, useI18n, useDirection, Tabs, useAfterInitialEffect, windowIsAvailable, focusHeadingOrContainer, useConfiguration, useTestIds, withTestIds,
|
|
3
|
+
import { Flex, Grid, Icon, registerIcon, TabPanel, useBreakpoint, useScrollStick, useElement, Card, Drawer, useI18n, useDirection, Tabs, useAfterInitialEffect, windowIsAvailable, focusHeadingOrContainer, useConfiguration, useTestIds, withTestIds, AppShellContext } from '@pega/cosmos-react-core';
|
|
4
4
|
import * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';
|
|
5
5
|
import * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';
|
|
6
|
+
import * as polarisSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/polaris-solid.icon';
|
|
7
|
+
import * as arrowMicroRightIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-right.icon';
|
|
8
|
+
import * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';
|
|
6
9
|
import GenAICoach from '../GenAICoach';
|
|
7
10
|
import CaseSummary from './CaseSummary';
|
|
8
11
|
import UtilitiesSummary from './UtilitiesSummary';
|
|
@@ -11,7 +14,7 @@ import CaseViewContext from './CaseView.context';
|
|
|
11
14
|
import CaseSummaryFields from './CaseSummaryFields';
|
|
12
15
|
import { getCaseViewTestIds } from './CaseView.test-ids';
|
|
13
16
|
import UtilitySummaryItemDialog from './UtilitySummaryItemDialog';
|
|
14
|
-
registerIcon(moveRightSolidIcon, moveLeftSolidIcon);
|
|
17
|
+
registerIcon(moveRightSolidIcon, moveLeftSolidIcon, polarisSolidIcon, arrowMicroRightIcon, arrowMicroLeftIcon);
|
|
15
18
|
// This function is responsible for auto sizing table height in case tab panels.
|
|
16
19
|
const resizeTable = (tabPanelEl, workAreaEl) => {
|
|
17
20
|
tabPanelEl.style.removeProperty('--content-height-in-view');
|
|
@@ -314,7 +317,12 @@ genAICoachProps, ...restProps }) => {
|
|
|
314
317
|
return;
|
|
315
318
|
caseViewRef.current.style.setProperty('--summary-height', `${!summaryExpanded ? summaryRef.current.offsetHeight : 0}px`);
|
|
316
319
|
}, [summaryExpanded]);
|
|
317
|
-
const utilitiesAndGenAI = (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledUtilitiesWrapper, container: { gap: 2, direction: 'column' }, genAIHeight: genAIHeight, children: utilities }), genAICoachProps && (_jsx(GenAICoach, { ...genAICoachProps, variant: {
|
|
320
|
+
const utilitiesAndGenAI = (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledUtilitiesWrapper, container: { gap: 2, direction: 'column' }, genAIHeight: genAIHeight, children: utilities }), genAICoachProps && (_jsx(GenAICoach, { ...genAICoachProps, variant: {
|
|
321
|
+
placement: 'utilities',
|
|
322
|
+
state: genAIState,
|
|
323
|
+
onStateChange: setGenAIState,
|
|
324
|
+
setGenAIHeight
|
|
325
|
+
} }))] }));
|
|
318
326
|
// CaseView context value
|
|
319
327
|
// Choosing not to memo for now due to extent of deps and how often they change. Optimize as needed.
|
|
320
328
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
@@ -348,8 +356,7 @@ genAICoachProps, ...restProps }) => {
|
|
|
348
356
|
aboveSM: smOrAbove,
|
|
349
357
|
aboveMD: mdOrAbove,
|
|
350
358
|
aboveLG: lgOrAbove,
|
|
351
|
-
aboveXL: xlOrAbove
|
|
352
|
-
setGenAIHeight
|
|
359
|
+
aboveXL: xlOrAbove
|
|
353
360
|
};
|
|
354
361
|
const currentTabPanelRef = useRef(null);
|
|
355
362
|
// The following effects are dedicated to resizeTable handling.
|
|
@@ -436,7 +443,7 @@ genAICoachProps, ...restProps }) => {
|
|
|
436
443
|
}, "data-app-region": lgOrAbove || !utilitiesExpanded || undefined, "aria-label": t('utilities_label'), children: [_jsxs(Flex, { container: {
|
|
437
444
|
alignItems: 'center',
|
|
438
445
|
justify: utilitiesExpanded ? 'between' : 'center'
|
|
439
|
-
}, children: [utilitiesHeading, !lgOrAbove && utilitiesExpanded ? null : utilitiesToggleButton] }), utilitiesExpanded && lgOrAbove && utilitiesAndGenAI, (!utilitiesExpanded || (mdOrAbove && !lgOrAbove)) && (_jsxs(_Fragment, { children: [utilitiesSummaryItems && utilitiesSummaryItems.length > 0 && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems })), genAICoachProps && (_jsx(
|
|
446
|
+
}, children: [utilitiesHeading, !lgOrAbove && utilitiesExpanded ? null : utilitiesToggleButton] }), utilitiesExpanded && lgOrAbove && utilitiesAndGenAI, (!utilitiesExpanded || (mdOrAbove && !lgOrAbove)) && (_jsxs(_Fragment, { children: [utilitiesSummaryItems && utilitiesSummaryItems.length > 0 && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems })), genAICoachProps && (_jsx(StyledCoachButton, { iconOnly: true, variant: 'primary', ref: genAICoachButtonRef, onClick: () => setShowCoach(cur => !cur), label: t('coach', ['Pega GenAI™']) }))] }))] })), genAICoachButtonRef.current && genAICoachProps && showCoach && (_jsx(UtilitySummaryItemDialog, { target: genAICoachButtonRef.current, onDismiss: () => setShowCoach(false), children: _jsx(GenAICoach, { ...genAICoachProps, variant: {
|
|
440
447
|
placement: 'dialog',
|
|
441
448
|
onClose: () => {
|
|
442
449
|
genAICoachProps.onClose?.();
|